diff --git a/GraphEditor/README.md b/GraphEditor/README.md new file mode 100644 index 0000000..0205816 --- /dev/null +++ b/GraphEditor/README.md @@ -0,0 +1,24 @@ +# GraphEditor +This is an example project, generated by AntOS Development Kit + +## Howto + +1. Open the project.apj file with AntOSDK (simply double Click on it) +2. Modify the UI in *assets/scheme.html* +3. Modify application code in *coffees/main.coffee* +4. Modify CSS style in *css/main.css* +5. Other files need to be copied: put in to assets + +## Set up build target + +Click **Menu> Build > Build Option** or simply hit **ALT-Y** + +In the build options dialog, add or remove files that need to be +included into the build + +Click **Save** + +## Build application +* To build: **Menu > Build > Build** or **ALT-C** +* To build and run: **Menu > Build > Build and Run** or **CTRL-R** +* To release: **Menu > Build > Build release** or **ALT-P** \ No newline at end of file diff --git a/GraphEditor/assets/scheme.html b/GraphEditor/assets/scheme.html new file mode 100644 index 0000000..25cd28e --- /dev/null +++ b/GraphEditor/assets/scheme.html @@ -0,0 +1,14 @@ + + +
+ +
+
+ + + +
+
+ +
+
\ No newline at end of file diff --git a/GraphEditor/build/debug/README.md b/GraphEditor/build/debug/README.md new file mode 100644 index 0000000..0205816 --- /dev/null +++ b/GraphEditor/build/debug/README.md @@ -0,0 +1,24 @@ +# GraphEditor +This is an example project, generated by AntOS Development Kit + +## Howto + +1. Open the project.apj file with AntOSDK (simply double Click on it) +2. Modify the UI in *assets/scheme.html* +3. Modify application code in *coffees/main.coffee* +4. Modify CSS style in *css/main.css* +5. Other files need to be copied: put in to assets + +## Set up build target + +Click **Menu> Build > Build Option** or simply hit **ALT-Y** + +In the build options dialog, add or remove files that need to be +included into the build + +Click **Save** + +## Build application +* To build: **Menu > Build > Build** or **ALT-C** +* To build and run: **Menu > Build > Build and Run** or **CTRL-R** +* To release: **Menu > Build > Build release** or **ALT-P** \ No newline at end of file diff --git a/GraphEditor/build/debug/main.css b/GraphEditor/build/debug/main.css new file mode 100644 index 0000000..8ea2949 --- /dev/null +++ b/GraphEditor/build/debug/main.css @@ -0,0 +1,23 @@ + +afx-app-window[data-id="graph_editor_win"] div[data-id="preview"] +{ + display: flex; + align-items: center; + justify-content: center; +} +afx-app-window[data-id="graph_editor_win"] afx-button button +{ + border-radius: 0; + padding-top:2px; + padding-bottom: 2px; +} +afx-app-window[data-id="graph_editor_win"] afx-resizer{ + background-color: transparent; +} +afx-app-window[data-id="graph_editor_win"] div[data-id="btn-container"]{ + background-color: transparent; + position: absolute; + bottom:10px; + right: 10px; + display: inline; +} diff --git a/GraphEditor/build/debug/main.js b/GraphEditor/build/debug/main.js new file mode 100644 index 0000000..e905219 --- /dev/null +++ b/GraphEditor/build/debug/main.js @@ -0,0 +1,2294 @@ +(function() { + // Copyright 2017-2018 Xuan Sang LE + + // AnTOS Web desktop is is licensed under the GNU General Public + // License v3.0, see the LICENCE file for more information + + // This program is free software: you can redistribute it and/or + // modify it under the terms of the GNU General Public License as + // published by the Free Software Foundation, either version 3 of + // the License, or (at your option) any later version. + + // This program is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + // General Public License for more details. + + // You should have received a copy of the GNU General Public License + //along with this program. If not, see https://www.gnu.org/licenses/. + var GraphEditor; + + GraphEditor = class GraphEditor extends this.OS.GUI.BaseApplication { + constructor(args) { + super("GraphEditor", args); + } + + main() { + var me; + me = this; + //mermaid.initialize { startOnLoad: false } + mermaid.initialize({ + theme: 'forest' + }); + this.currfile = this.args && this.args.length > 0 ? this.args[0].asFileHandler() : "Untitled".asFileHandler(); + this.currfile.dirty = false; + this.datarea = this.find("datarea"); + this.preview = this.find("preview"); + this.btctn = this.find("btn-container"); + this.editor = ace.edit(this.datarea); + this.editor.setOptions({ + enableBasicAutocompletion: true, + enableLiveAutocompletion: true, + fontSize: "10pt" + }); + //@.editor.completers.push { getCompletions: ( editor, session, pos, prefix, callback ) -> } + this.editor.getSession().setUseWrapMode(true); + this.editor.session.setMode("ace/mode/text"); + this.editor.setTheme("ace/theme/monokai"); + this.editor.on("input", function() { + if (me.editormux) { + me.editormux = false; + return false; + } + if (!me.currfile.dirty) { + return me.currfile.dirty = true; + } + }); + if (!me.currfile.basename) { + me.editormux = true; + me.editor.setValue(GraphEditor.dummymermaid); + me.renderSVG(false); + } + this.editor.container.addEventListener("keydown", function(e) { + if (e.keyCode === 13) { + return me.renderSVG(true); + } + }, true); + this.bindKey("CTRL-R", function() { + return me.renderSVG(false); + }); + this.bindKey("ALT-G", function() { + return me.export("SVG"); + }); + this.bindKey("ALT-P", function() { + return me.export("PNG"); + }); + this.bindKey("ALT-N", function() { + return me.actionFile(`${me.name}-New`); + }); + this.bindKey("ALT-O", function() { + return me.actionFile(`${me.name}-Open`); + }); + this.bindKey("CTRL-S", function() { + return me.actionFile(`${me.name}-Save`); + }); + this.bindKey("ALT-W", function() { + return me.actionFile(`${me.name}-Saveas`); + }); + this.bindKey("CTRL-M", function() { + return me.svgToCanvas(function() {}); + }); + this.on("hboxchange", function() { + me.editor.resize(); + return me.calibrate(); + }); + this.on("focus", function() { + return me.editor.focus(); + }); + (this.find("btn-zoomin")).set("onbtclick", function(e) { + if (me.pan) { + return me.pan.zoomIn(); + } + }); + (this.find("btn-zoomout")).set("onbtclick", function(e) { + if (me.pan) { + return me.pan.zoomOut(); + } + }); + (this.find("btn-reset")).set("onbtclick", function(e) { + if (me.pan) { + return me.pan.resetZoom(); + } + }); + return this.open(this.currfile); + } + + menu() { + var me, menu; + me = this; + menu = [ + { + text: "__(File)", + child: [ + { + text: "__(New)", + dataid: `${this.name}-New`, + shortcut: "A-N" + }, + { + text: "__(Open)", + dataid: `${this.name}-Open`, + shortcut: "A-O" + }, + { + text: "__(Save)", + dataid: `${this.name}-Save`, + shortcut: "C-S" + }, + { + text: "__(Save as)", + dataid: `${this.name}-Saveas`, + shortcut: "A-W" + }, + { + text: "__(Render)", + dataid: `${this.name}-Render`, + shortcut: "C-R" + }, + { + text: "__(Export as)", + child: [ + { + text: "SVG", + shortcut: "A-G" + }, + { + text: "PNG", + shortcut: "A-P" + } + ], + onmenuselect: function(e) { + return me.export(e.item.data.text); + } + } + ], + onmenuselect: function(e) { + return me.actionFile(e.item.data.dataid); + } + } + ]; + return menu; + } + + open(file) { + var me; + if (file.path === "Untitled") { + return; + } + me = this; + file.dirty = false; + return file.read(function(d) { + me.currfile = file; + me.editormux = true; + me.currfile.dirty = false; + me.editor.setValue(d); + me.scheme.set("apptitle", `${me.currfile.basename}`); + return me.renderSVG(false); + }); + } + + save(file) { + var me; + me = this; + return file.write("text/plain", function(d) { + if (d.error) { + return me.error(__("Error saving file {0}", file.basename)); + } + file.dirty = false; + file.text = file.basename; + return me.scheme.set("apptitle", `${me.currfile.basename}`); + }); + } + + actionFile(e) { + var me, saveas; + me = this; + saveas = function() { + return me.openDialog("FileDiaLog", function(d, n) { + me.currfile.setPath(`${d}/${n}`); + return me.save(me.currfile); + }, __("Save as"), { + file: me.currfile + }); + }; + switch (e) { + case `${this.name}-Open`: + return this.openDialog("FileDiaLog", function(d, f) { + return me.open(`${d}/${f}`.asFileHandler()); + }, __("Open file")); + case `${this.name}-Save`: + this.currfile.cache = this.editor.getValue(); + if (this.currfile.basename) { + return this.save(this.currfile); + } + return saveas(); + case `${this.name}-Saveas`: + this.currfile.cache = this.editor.getValue(); + return saveas(); + case `${this.name}-Render`: + return me.renderSVG(false); + case `${this.name}-New`: + this.currfile = "Untitled".asFileHandler(); + this.currfile.cache = ""; + this.currfile.dirty = false; + this.editormux = true; + return this.editor.setValue(""); + } + } + + export(t) { + var me; + me = this; + return me.openDialog("FileDiaLog", function(d, n) { + var e, fp; + fp = `${d}/${n}`.asFileHandler(); + try { + switch (t) { + case "SVG": + fp.cache = me.svgtext(); + return fp.write("text/plain", function(r) { + if (r.error) { + return me.error(__("Cannot export to {0}: {1}", t, r.error)); + } + return me.notify(__("File exported")); + }); + case "PNG": + // toDataURL("image/png") + return me.svgToCanvas(function(canvas) { + var e; + try { + fp.cache = canvas.toDataURL("image/png"); + return fp.write("base64", function(r) { + if (r.error) { + return me.error(__("Cannot export to {0}: {1}", t, r.error)); + } + return me.notify(__("File exported")); + }); + } catch (error) { + e = error; + return me.error(__("Cannot export to PNG in this browser: {0}", e.message)); + } + }); + } + } catch (error) { + e = error; + return me.error(__("Cannot export: {0}", e.message)); + } + }, __("Export as"), { + file: me.currfile + }); + } + + renderSVG(silent) { + var e, id, me, text; + me = this; + id = Math.floor(Math.random() * 100000) + 1; + //if silent + // mermaid.parseError = (e, h) -> + //else + // mermaid.parseError = (e, h) -> + // me.error e + text = this.editor.getValue(); + try { + mermaid.parse(text); + } catch (error) { + e = error; + if (!silent) { + me.error(__("Syntax error: {0}", e.str)); + } + return; + } + return mermaid.render(`c${id}`, text, function(text, f) { + var svg; + me.preview.innerHTML = text; + $(me.preview).append(me.btctn); + me.calibrate(); + svg = $(me.preview).children("svg")[0]; + $(svg).attr("style", ""); + return me.pan = svgPanZoom(svg, { + zoomEnabled: true, + controlIconsEnabled: false, + fit: true, + center: true, + minZoom: 0.1 + }); + //rd $($.parseHTML text). + }, me.preview); + } + + svgtext() { + var serializer, svg; + svg = $(this.preview).children("svg")[0]; + $("g.label", svg).each(function(i) { + return $(this).css("font-family", "Ubuntu").css("font-size", "13px"); + }); + $("text", svg).each(function(j) { + return $(this).css("font-family", "Ubuntu").css("font-size", "13px"); + }); + serializer = new XMLSerializer(); + return serializer.serializeToString(svg); + } + + svgToCanvas(f) { + var DOMURL, img, me, svgBlob, svgStr, url; + me = this; + img = new Image(); + svgStr = this.svgtext(); + DOMURL = window.URL || window.webkitURL || window; + svgBlob = new Blob([svgStr], { + type: 'image/svg+xml;charset=utf-8' + }); + url = DOMURL.createObjectURL(svgBlob); + img.onload = function() { + var canvas; + canvas = me.find("offscreen"); + canvas.width = img.width; + canvas.height = img.height; + canvas.getContext("2d").drawImage(img, 0, 0, img.width, img.height); + return f(canvas); + }; + return img.src = url; + } + + calibrate() { + var prs, svg; + svg = ($(this.preview)).children("svg")[0]; + if (svg) { + prs = [$(this.preview).width(), $(this.preview).height()]; + $(svg).attr("width", prs[0] + "px"); + return $(svg).attr("height", prs[1] + "px"); + } + } + + cleanup(evt) { + var me; + if (!this.currfile) { + return; + } + if (!this.currfile.dirty) { + return; + } + me = this; + evt.preventDefault(); + return this.openDialog("YesNoDialog", function(d) { + if (d) { + me.currfile.dirty = false; + return me.quit(); + } + }, __("Quit"), { + text: __("Quit without saving ?") + }); + } + + }; + + GraphEditor.dummymermaid = "graph TD;\n A-->B;\n A-->C;\n B-->D;\n C-->D;"; + + GraphEditor.dependencies = ["ace/ace"]; + + this.OS.register("GraphEditor", GraphEditor); + +}).call(this); + +// svg-pan-zoom v3.5.2 +// https://github.com/ariutta/svg-pan-zoom +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0; i--) { + if (this.eventListeners.hasOwnProperty(haltEventListeners[i])) { + delete this.eventListeners[haltEventListeners[i]] + } + } + } + } + + // Bind eventListeners + for (var event in this.eventListeners) { + // Attach event to eventsListenerElement or SVG if not available + (this.options.eventsListenerElement || this.svg) + .addEventListener(event, this.eventListeners[event], false) + } + + // Zoom using mouse wheel + if (this.options.mouseWheelZoomEnabled) { + this.options.mouseWheelZoomEnabled = false // set to false as enable will set it back to true + this.enableMouseWheelZoom() + } +} + +/** + * Enable ability to zoom using mouse wheel + */ +SvgPanZoom.prototype.enableMouseWheelZoom = function() { + if (!this.options.mouseWheelZoomEnabled) { + var that = this + + // Mouse wheel listener + this.wheelListener = function(evt) { + return that.handleMouseWheel(evt); + } + + // Bind wheelListener + Wheel.on(this.options.eventsListenerElement || this.svg, this.wheelListener, false) + + this.options.mouseWheelZoomEnabled = true + } +} + +/** + * Disable ability to zoom using mouse wheel + */ +SvgPanZoom.prototype.disableMouseWheelZoom = function() { + if (this.options.mouseWheelZoomEnabled) { + Wheel.off(this.options.eventsListenerElement || this.svg, this.wheelListener, false) + this.options.mouseWheelZoomEnabled = false + } +} + +/** + * Handle mouse wheel event + * + * @param {Event} evt + */ +SvgPanZoom.prototype.handleMouseWheel = function(evt) { + if (!this.options.zoomEnabled || this.state !== 'none') { + return; + } + + if (this.options.preventMouseEventsDefault){ + if (evt.preventDefault) { + evt.preventDefault(); + } else { + evt.returnValue = false; + } + } + + // Default delta in case that deltaY is not available + var delta = evt.deltaY || 1 + , timeDelta = Date.now() - this.lastMouseWheelEventTime + , divider = 3 + Math.max(0, 30 - timeDelta) + + // Update cache + this.lastMouseWheelEventTime = Date.now() + + // Make empirical adjustments for browsers that give deltaY in pixels (deltaMode=0) + if ('deltaMode' in evt && evt.deltaMode === 0 && evt.wheelDelta) { + delta = evt.deltaY === 0 ? 0 : Math.abs(evt.wheelDelta) / evt.deltaY + } + + delta = -0.3 < delta && delta < 0.3 ? delta : (delta > 0 ? 1 : -1) * Math.log(Math.abs(delta) + 10) / divider + + var inversedScreenCTM = this.svg.getScreenCTM().inverse() + , relativeMousePoint = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(inversedScreenCTM) + , zoom = Math.pow(1 + this.options.zoomScaleSensitivity, (-1) * delta); // multiplying by neg. 1 so as to make zoom in/out behavior match Google maps behavior + + this.zoomAtPoint(zoom, relativeMousePoint) +} + +/** + * Zoom in at a SVG point + * + * @param {SVGPoint} point + * @param {Float} zoomScale Number representing how much to zoom + * @param {Boolean} zoomAbsolute Default false. If true, zoomScale is treated as an absolute value. + * Otherwise, zoomScale is treated as a multiplied (e.g. 1.10 would zoom in 10%) + */ +SvgPanZoom.prototype.zoomAtPoint = function(zoomScale, point, zoomAbsolute) { + var originalState = this.viewport.getOriginalState() + + if (!zoomAbsolute) { + // Fit zoomScale in set bounds + if (this.getZoom() * zoomScale < this.options.minZoom * originalState.zoom) { + zoomScale = (this.options.minZoom * originalState.zoom) / this.getZoom() + } else if (this.getZoom() * zoomScale > this.options.maxZoom * originalState.zoom) { + zoomScale = (this.options.maxZoom * originalState.zoom) / this.getZoom() + } + } else { + // Fit zoomScale in set bounds + zoomScale = Math.max(this.options.minZoom * originalState.zoom, Math.min(this.options.maxZoom * originalState.zoom, zoomScale)) + // Find relative scale to achieve desired scale + zoomScale = zoomScale/this.getZoom() + } + + var oldCTM = this.viewport.getCTM() + , relativePoint = point.matrixTransform(oldCTM.inverse()) + , modifier = this.svg.createSVGMatrix().translate(relativePoint.x, relativePoint.y).scale(zoomScale).translate(-relativePoint.x, -relativePoint.y) + , newCTM = oldCTM.multiply(modifier) + + if (newCTM.a !== oldCTM.a) { + this.viewport.setCTM(newCTM) + } +} + +/** + * Zoom at center point + * + * @param {Float} scale + * @param {Boolean} absolute Marks zoom scale as relative or absolute + */ +SvgPanZoom.prototype.zoom = function(scale, absolute) { + this.zoomAtPoint(scale, SvgUtils.getSvgCenterPoint(this.svg, this.width, this.height), absolute) +} + +/** + * Zoom used by public instance + * + * @param {Float} scale + * @param {Boolean} absolute Marks zoom scale as relative or absolute + */ +SvgPanZoom.prototype.publicZoom = function(scale, absolute) { + if (absolute) { + scale = this.computeFromRelativeZoom(scale) + } + + this.zoom(scale, absolute) +} + +/** + * Zoom at point used by public instance + * + * @param {Float} scale + * @param {SVGPoint|Object} point An object that has x and y attributes + * @param {Boolean} absolute Marks zoom scale as relative or absolute + */ +SvgPanZoom.prototype.publicZoomAtPoint = function(scale, point, absolute) { + if (absolute) { + // Transform zoom into a relative value + scale = this.computeFromRelativeZoom(scale) + } + + // If not a SVGPoint but has x and y then create a SVGPoint + if (Utils.getType(point) !== 'SVGPoint') { + if('x' in point && 'y' in point) { + point = SvgUtils.createSVGPoint(this.svg, point.x, point.y) + } else { + throw new Error('Given point is invalid') + } + } + + this.zoomAtPoint(scale, point, absolute) +} + +/** + * Get zoom scale + * + * @return {Float} zoom scale + */ +SvgPanZoom.prototype.getZoom = function() { + return this.viewport.getZoom() +} + +/** + * Get zoom scale for public usage + * + * @return {Float} zoom scale + */ +SvgPanZoom.prototype.getRelativeZoom = function() { + return this.viewport.getRelativeZoom() +} + +/** + * Compute actual zoom from public zoom + * + * @param {Float} zoom + * @return {Float} zoom scale + */ +SvgPanZoom.prototype.computeFromRelativeZoom = function(zoom) { + return zoom * this.viewport.getOriginalState().zoom +} + +/** + * Set zoom to initial state + */ +SvgPanZoom.prototype.resetZoom = function() { + var originalState = this.viewport.getOriginalState() + + this.zoom(originalState.zoom, true); +} + +/** + * Set pan to initial state + */ +SvgPanZoom.prototype.resetPan = function() { + this.pan(this.viewport.getOriginalState()); +} + +/** + * Set pan and zoom to initial state + */ +SvgPanZoom.prototype.reset = function() { + this.resetZoom() + this.resetPan() +} + +/** + * Handle double click event + * See handleMouseDown() for alternate detection method + * + * @param {Event} evt + */ +SvgPanZoom.prototype.handleDblClick = function(evt) { + if (this.options.preventMouseEventsDefault) { + if (evt.preventDefault) { + evt.preventDefault() + } else { + evt.returnValue = false + } + } + + // Check if target was a control button + if (this.options.controlIconsEnabled) { + var targetClass = evt.target.getAttribute('class') || '' + if (targetClass.indexOf('svg-pan-zoom-control') > -1) { + return false + } + } + + var zoomFactor + + if (evt.shiftKey) { + zoomFactor = 1/((1 + this.options.zoomScaleSensitivity) * 2) // zoom out when shift key pressed + } else { + zoomFactor = (1 + this.options.zoomScaleSensitivity) * 2 + } + + var point = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(this.svg.getScreenCTM().inverse()) + this.zoomAtPoint(zoomFactor, point) +} + +/** + * Handle click event + * + * @param {Event} evt + */ +SvgPanZoom.prototype.handleMouseDown = function(evt, prevEvt) { + if (this.options.preventMouseEventsDefault) { + if (evt.preventDefault) { + evt.preventDefault() + } else { + evt.returnValue = false + } + } + + Utils.mouseAndTouchNormalize(evt, this.svg) + + // Double click detection; more consistent than ondblclick + if (this.options.dblClickZoomEnabled && Utils.isDblClick(evt, prevEvt)){ + this.handleDblClick(evt) + } else { + // Pan mode + this.state = 'pan' + this.firstEventCTM = this.viewport.getCTM() + this.stateOrigin = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(this.firstEventCTM.inverse()) + } +} + +/** + * Handle mouse move event + * + * @param {Event} evt + */ +SvgPanZoom.prototype.handleMouseMove = function(evt) { + if (this.options.preventMouseEventsDefault) { + if (evt.preventDefault) { + evt.preventDefault() + } else { + evt.returnValue = false + } + } + + if (this.state === 'pan' && this.options.panEnabled) { + // Pan mode + var point = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(this.firstEventCTM.inverse()) + , viewportCTM = this.firstEventCTM.translate(point.x - this.stateOrigin.x, point.y - this.stateOrigin.y) + + this.viewport.setCTM(viewportCTM) + } +} + +/** + * Handle mouse button release event + * + * @param {Event} evt + */ +SvgPanZoom.prototype.handleMouseUp = function(evt) { + if (this.options.preventMouseEventsDefault) { + if (evt.preventDefault) { + evt.preventDefault() + } else { + evt.returnValue = false + } + } + + if (this.state === 'pan') { + // Quit pan mode + this.state = 'none' + } +} + +/** + * Adjust viewport size (only) so it will fit in SVG + * Does not center image + */ +SvgPanZoom.prototype.fit = function() { + var viewBox = this.viewport.getViewBox() + , newScale = Math.min(this.width/viewBox.width, this.height/viewBox.height) + + this.zoom(newScale, true) +} + +/** + * Adjust viewport size (only) so it will contain the SVG + * Does not center image + */ +SvgPanZoom.prototype.contain = function() { + var viewBox = this.viewport.getViewBox() + , newScale = Math.max(this.width/viewBox.width, this.height/viewBox.height) + + this.zoom(newScale, true) +} + +/** + * Adjust viewport pan (only) so it will be centered in SVG + * Does not zoom/fit/contain image + */ +SvgPanZoom.prototype.center = function() { + var viewBox = this.viewport.getViewBox() + , offsetX = (this.width - (viewBox.width + viewBox.x * 2) * this.getZoom()) * 0.5 + , offsetY = (this.height - (viewBox.height + viewBox.y * 2) * this.getZoom()) * 0.5 + + this.getPublicInstance().pan({x: offsetX, y: offsetY}) +} + +/** + * Update content cached BorderBox + * Use when viewport contents change + */ +SvgPanZoom.prototype.updateBBox = function() { + this.viewport.simpleViewBoxCache() +} + +/** + * Pan to a rendered position + * + * @param {Object} point {x: 0, y: 0} + */ +SvgPanZoom.prototype.pan = function(point) { + var viewportCTM = this.viewport.getCTM() + viewportCTM.e = point.x + viewportCTM.f = point.y + this.viewport.setCTM(viewportCTM) +} + +/** + * Relatively pan the graph by a specified rendered position vector + * + * @param {Object} point {x: 0, y: 0} + */ +SvgPanZoom.prototype.panBy = function(point) { + var viewportCTM = this.viewport.getCTM() + viewportCTM.e += point.x + viewportCTM.f += point.y + this.viewport.setCTM(viewportCTM) +} + +/** + * Get pan vector + * + * @return {Object} {x: 0, y: 0} + */ +SvgPanZoom.prototype.getPan = function() { + var state = this.viewport.getState() + + return {x: state.x, y: state.y} +} + +/** + * Recalculates cached svg dimensions and controls position + */ +SvgPanZoom.prototype.resize = function() { + // Get dimensions + var boundingClientRectNormalized = SvgUtils.getBoundingClientRectNormalized(this.svg) + this.width = boundingClientRectNormalized.width + this.height = boundingClientRectNormalized.height + + // Recalculate original state + var viewport = this.viewport + viewport.options.width = this.width + viewport.options.height = this.height + viewport.processCTM() + + // Reposition control icons by re-enabling them + if (this.options.controlIconsEnabled) { + this.getPublicInstance().disableControlIcons() + this.getPublicInstance().enableControlIcons() + } +} + +/** + * Unbind mouse events, free callbacks and destroy public instance + */ +SvgPanZoom.prototype.destroy = function() { + var that = this + + // Free callbacks + this.beforeZoom = null + this.onZoom = null + this.beforePan = null + this.onPan = null + this.onUpdatedCTM = null + + // Destroy custom event handlers + if (this.options.customEventsHandler != null) { // jshint ignore:line + this.options.customEventsHandler.destroy({ + svgElement: this.svg + , eventsListenerElement: this.options.eventsListenerElement + , instance: this.getPublicInstance() + }) + } + + // Unbind eventListeners + for (var event in this.eventListeners) { + (this.options.eventsListenerElement || this.svg) + .removeEventListener(event, this.eventListeners[event], false) + } + + // Unbind wheelListener + this.disableMouseWheelZoom() + + // Remove control icons + this.getPublicInstance().disableControlIcons() + + // Reset zoom and pan + this.reset() + + // Remove instance from instancesStore + instancesStore = instancesStore.filter(function(instance){ + return instance.svg !== that.svg + }) + + // Delete options and its contents + delete this.options + + // Delete viewport to make public shadow viewport functions uncallable + delete this.viewport + + // Destroy public instance and rewrite getPublicInstance + delete this.publicInstance + delete this.pi + this.getPublicInstance = function(){ + return null + } +} + +/** + * Returns a public instance object + * + * @return {Object} Public instance object + */ +SvgPanZoom.prototype.getPublicInstance = function() { + var that = this + + // Create cache + if (!this.publicInstance) { + this.publicInstance = this.pi = { + // Pan + enablePan: function() {that.options.panEnabled = true; return that.pi} + , disablePan: function() {that.options.panEnabled = false; return that.pi} + , isPanEnabled: function() {return !!that.options.panEnabled} + , pan: function(point) {that.pan(point); return that.pi} + , panBy: function(point) {that.panBy(point); return that.pi} + , getPan: function() {return that.getPan()} + // Pan event + , setBeforePan: function(fn) {that.options.beforePan = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi} + , setOnPan: function(fn) {that.options.onPan = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi} + // Zoom and Control Icons + , enableZoom: function() {that.options.zoomEnabled = true; return that.pi} + , disableZoom: function() {that.options.zoomEnabled = false; return that.pi} + , isZoomEnabled: function() {return !!that.options.zoomEnabled} + , enableControlIcons: function() { + if (!that.options.controlIconsEnabled) { + that.options.controlIconsEnabled = true + ControlIcons.enable(that) + } + return that.pi + } + , disableControlIcons: function() { + if (that.options.controlIconsEnabled) { + that.options.controlIconsEnabled = false; + ControlIcons.disable(that) + } + return that.pi + } + , isControlIconsEnabled: function() {return !!that.options.controlIconsEnabled} + // Double click zoom + , enableDblClickZoom: function() {that.options.dblClickZoomEnabled = true; return that.pi} + , disableDblClickZoom: function() {that.options.dblClickZoomEnabled = false; return that.pi} + , isDblClickZoomEnabled: function() {return !!that.options.dblClickZoomEnabled} + // Mouse wheel zoom + , enableMouseWheelZoom: function() {that.enableMouseWheelZoom(); return that.pi} + , disableMouseWheelZoom: function() {that.disableMouseWheelZoom(); return that.pi} + , isMouseWheelZoomEnabled: function() {return !!that.options.mouseWheelZoomEnabled} + // Zoom scale and bounds + , setZoomScaleSensitivity: function(scale) {that.options.zoomScaleSensitivity = scale; return that.pi} + , setMinZoom: function(zoom) {that.options.minZoom = zoom; return that.pi} + , setMaxZoom: function(zoom) {that.options.maxZoom = zoom; return that.pi} + // Zoom event + , setBeforeZoom: function(fn) {that.options.beforeZoom = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi} + , setOnZoom: function(fn) {that.options.onZoom = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi} + // Zooming + , zoom: function(scale) {that.publicZoom(scale, true); return that.pi} + , zoomBy: function(scale) {that.publicZoom(scale, false); return that.pi} + , zoomAtPoint: function(scale, point) {that.publicZoomAtPoint(scale, point, true); return that.pi} + , zoomAtPointBy: function(scale, point) {that.publicZoomAtPoint(scale, point, false); return that.pi} + , zoomIn: function() {this.zoomBy(1 + that.options.zoomScaleSensitivity); return that.pi} + , zoomOut: function() {this.zoomBy(1 / (1 + that.options.zoomScaleSensitivity)); return that.pi} + , getZoom: function() {return that.getRelativeZoom()} + // CTM update + , setOnUpdatedCTM: function(fn) {that.options.onUpdatedCTM = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi} + // Reset + , resetZoom: function() {that.resetZoom(); return that.pi} + , resetPan: function() {that.resetPan(); return that.pi} + , reset: function() {that.reset(); return that.pi} + // Fit, Contain and Center + , fit: function() {that.fit(); return that.pi} + , contain: function() {that.contain(); return that.pi} + , center: function() {that.center(); return that.pi} + // Size and Resize + , updateBBox: function() {that.updateBBox(); return that.pi} + , resize: function() {that.resize(); return that.pi} + , getSizes: function() { + return { + width: that.width + , height: that.height + , realZoom: that.getZoom() + , viewBox: that.viewport.getViewBox() + } + } + // Destroy + , destroy: function() {that.destroy(); return that.pi} + } + } + + return this.publicInstance +} + +/** + * Stores pairs of instances of SvgPanZoom and SVG + * Each pair is represented by an object {svg: SVGSVGElement, instance: SvgPanZoom} + * + * @type {Array} + */ +var instancesStore = [] + +var svgPanZoom = function(elementOrSelector, options){ + var svg = Utils.getSvg(elementOrSelector) + + if (svg === null) { + return null + } else { + // Look for existent instance + for(var i = instancesStore.length - 1; i >= 0; i--) { + if (instancesStore[i].svg === svg) { + return instancesStore[i].instance.getPublicInstance() + } + } + + // If instance not found - create one + instancesStore.push({ + svg: svg + , instance: new SvgPanZoom(svg, options) + }) + + // Return just pushed instance + return instancesStore[instancesStore.length - 1].instance.getPublicInstance() + } +} + +module.exports = svgPanZoom; + +},{"./control-icons":2,"./shadow-viewport":3,"./svg-utilities":5,"./uniwheel":6,"./utilities":7}],5:[function(require,module,exports){ +var Utils = require('./utilities') + , _browser = 'unknown' + ; + +// http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser +if (/*@cc_on!@*/false || !!document.documentMode) { // internet explorer + _browser = 'ie'; +} + +module.exports = { + svgNS: 'http://www.w3.org/2000/svg' +, xmlNS: 'http://www.w3.org/XML/1998/namespace' +, xmlnsNS: 'http://www.w3.org/2000/xmlns/' +, xlinkNS: 'http://www.w3.org/1999/xlink' +, evNS: 'http://www.w3.org/2001/xml-events' + + /** + * Get svg dimensions: width and height + * + * @param {SVGSVGElement} svg + * @return {Object} {width: 0, height: 0} + */ +, getBoundingClientRectNormalized: function(svg) { + if (svg.clientWidth && svg.clientHeight) { + return {width: svg.clientWidth, height: svg.clientHeight} + } else if (!!svg.getBoundingClientRect()) { + return svg.getBoundingClientRect(); + } else { + throw new Error('Cannot get BoundingClientRect for SVG.'); + } + } + + /** + * Gets g element with class of "viewport" or creates it if it doesn't exist + * + * @param {SVGSVGElement} svg + * @return {SVGElement} g (group) element + */ +, getOrCreateViewport: function(svg, selector) { + var viewport = null + + if (Utils.isElement(selector)) { + viewport = selector + } else { + viewport = svg.querySelector(selector) + } + + // Check if there is just one main group in SVG + if (!viewport) { + var childNodes = Array.prototype.slice.call(svg.childNodes || svg.children).filter(function(el){ + return el.nodeName !== 'defs' && el.nodeName !== '#text' + }) + + // Node name should be SVGGElement and should have no transform attribute + // Groups with transform are not used as viewport because it involves parsing of all transform possibilities + if (childNodes.length === 1 && childNodes[0].nodeName === 'g' && childNodes[0].getAttribute('transform') === null) { + viewport = childNodes[0] + } + } + + // If no favorable group element exists then create one + if (!viewport) { + var viewportId = 'viewport-' + new Date().toISOString().replace(/\D/g, ''); + viewport = document.createElementNS(this.svgNS, 'g'); + viewport.setAttribute('id', viewportId); + + // Internet Explorer (all versions?) can't use childNodes, but other browsers prefer (require?) using childNodes + var svgChildren = svg.childNodes || svg.children; + if (!!svgChildren && svgChildren.length > 0) { + for (var i = svgChildren.length; i > 0; i--) { + // Move everything into viewport except defs + if (svgChildren[svgChildren.length - i].nodeName !== 'defs') { + viewport.appendChild(svgChildren[svgChildren.length - i]); + } + } + } + svg.appendChild(viewport); + } + + // Parse class names + var classNames = []; + if (viewport.getAttribute('class')) { + classNames = viewport.getAttribute('class').split(' ') + } + + // Set class (if not set already) + if (!~classNames.indexOf('svg-pan-zoom_viewport')) { + classNames.push('svg-pan-zoom_viewport') + viewport.setAttribute('class', classNames.join(' ')) + } + + return viewport + } + + /** + * Set SVG attributes + * + * @param {SVGSVGElement} svg + */ + , setupSvgAttributes: function(svg) { + // Setting default attributes + svg.setAttribute('xmlns', this.svgNS); + svg.setAttributeNS(this.xmlnsNS, 'xmlns:xlink', this.xlinkNS); + svg.setAttributeNS(this.xmlnsNS, 'xmlns:ev', this.evNS); + + // Needed for Internet Explorer, otherwise the viewport overflows + if (svg.parentNode !== null) { + var style = svg.getAttribute('style') || ''; + if (style.toLowerCase().indexOf('overflow') === -1) { + svg.setAttribute('style', 'overflow: hidden; ' + style); + } + } + } + +/** + * How long Internet Explorer takes to finish updating its display (ms). + */ +, internetExplorerRedisplayInterval: 300 + +/** + * Forces the browser to redisplay all SVG elements that rely on an + * element defined in a 'defs' section. It works globally, for every + * available defs element on the page. + * The throttling is intentionally global. + * + * This is only needed for IE. It is as a hack to make markers (and 'use' elements?) + * visible after pan/zoom when there are multiple SVGs on the page. + * See bug report: https://connect.microsoft.com/IE/feedback/details/781964/ + * also see svg-pan-zoom issue: https://github.com/ariutta/svg-pan-zoom/issues/62 + */ +, refreshDefsGlobal: Utils.throttle(function() { + var allDefs = document.querySelectorAll('defs'); + var allDefsCount = allDefs.length; + for (var i = 0; i < allDefsCount; i++) { + var thisDefs = allDefs[i]; + thisDefs.parentNode.insertBefore(thisDefs, thisDefs); + } + }, this.internetExplorerRedisplayInterval) + + /** + * Sets the current transform matrix of an element + * + * @param {SVGElement} element + * @param {SVGMatrix} matrix CTM + * @param {SVGElement} defs + */ +, setCTM: function(element, matrix, defs) { + var that = this + , s = 'matrix(' + matrix.a + ',' + matrix.b + ',' + matrix.c + ',' + matrix.d + ',' + matrix.e + ',' + matrix.f + ')'; + + element.setAttributeNS(null, 'transform', s); + if ('transform' in element.style) { + element.style.transform = s; + } else if ('-ms-transform' in element.style) { + element.style['-ms-transform'] = s; + } else if ('-webkit-transform' in element.style) { + element.style['-webkit-transform'] = s; + } + + // IE has a bug that makes markers disappear on zoom (when the matrix "a" and/or "d" elements change) + // see http://stackoverflow.com/questions/17654578/svg-marker-does-not-work-in-ie9-10 + // and http://srndolha.wordpress.com/2013/11/25/svg-line-markers-may-disappear-in-internet-explorer-11/ + if (_browser === 'ie' && !!defs) { + // this refresh is intended for redisplaying the SVG during zooming + defs.parentNode.insertBefore(defs, defs); + // this refresh is intended for redisplaying the other SVGs on a page when panning a given SVG + // it is also needed for the given SVG itself, on zoomEnd, if the SVG contains any markers that + // are located under any other element(s). + window.setTimeout(function() { + that.refreshDefsGlobal(); + }, that.internetExplorerRedisplayInterval); + } + } + + /** + * Instantiate an SVGPoint object with given event coordinates + * + * @param {Event} evt + * @param {SVGSVGElement} svg + * @return {SVGPoint} point + */ +, getEventPoint: function(evt, svg) { + var point = svg.createSVGPoint() + + Utils.mouseAndTouchNormalize(evt, svg) + + point.x = evt.clientX + point.y = evt.clientY + + return point + } + + /** + * Get SVG center point + * + * @param {SVGSVGElement} svg + * @return {SVGPoint} + */ +, getSvgCenterPoint: function(svg, width, height) { + return this.createSVGPoint(svg, width / 2, height / 2) + } + + /** + * Create a SVGPoint with given x and y + * + * @param {SVGSVGElement} svg + * @param {Number} x + * @param {Number} y + * @return {SVGPoint} + */ +, createSVGPoint: function(svg, x, y) { + var point = svg.createSVGPoint() + point.x = x + point.y = y + + return point + } +} + +},{"./utilities":7}],6:[function(require,module,exports){ +// uniwheel 0.1.2 (customized) +// A unified cross browser mouse wheel event handler +// https://github.com/teemualap/uniwheel + +module.exports = (function(){ + + //Full details: https://developer.mozilla.org/en-US/docs/Web/Reference/Events/wheel + + var prefix = "", _addEventListener, _removeEventListener, onwheel, support, fns = []; + + // detect event model + if ( window.addEventListener ) { + _addEventListener = "addEventListener"; + _removeEventListener = "removeEventListener"; + } else { + _addEventListener = "attachEvent"; + _removeEventListener = "detachEvent"; + prefix = "on"; + } + + // detect available wheel event + support = "onwheel" in document.createElement("div") ? "wheel" : // Modern browsers support "wheel" + document.onmousewheel !== undefined ? "mousewheel" : // Webkit and IE support at least "mousewheel" + "DOMMouseScroll"; // let's assume that remaining browsers are older Firefox + + + function createCallback(element,callback,capture) { + + var fn = function(originalEvent) { + + !originalEvent && ( originalEvent = window.event ); + + // create a normalized event object + var event = { + // keep a ref to the original event object + originalEvent: originalEvent, + target: originalEvent.target || originalEvent.srcElement, + type: "wheel", + deltaMode: originalEvent.type == "MozMousePixelScroll" ? 0 : 1, + deltaX: 0, + delatZ: 0, + preventDefault: function() { + originalEvent.preventDefault ? + originalEvent.preventDefault() : + originalEvent.returnValue = false; + } + }; + + // calculate deltaY (and deltaX) according to the event + if ( support == "mousewheel" ) { + event.deltaY = - 1/40 * originalEvent.wheelDelta; + // Webkit also support wheelDeltaX + originalEvent.wheelDeltaX && ( event.deltaX = - 1/40 * originalEvent.wheelDeltaX ); + } else { + event.deltaY = originalEvent.detail; + } + + // it's time to fire the callback + return callback( event ); + + }; + + fns.push({ + element: element, + fn: fn, + capture: capture + }); + + return fn; + } + + function getCallback(element,capture) { + for (var i = 0; i < fns.length; i++) { + if (fns[i].element === element && fns[i].capture === capture) { + return fns[i].fn; + } + } + return function(){}; + } + + function removeCallback(element,capture) { + for (var i = 0; i < fns.length; i++) { + if (fns[i].element === element && fns[i].capture === capture) { + return fns.splice(i,1); + } + } + } + + function _addWheelListener( elem, eventName, callback, useCapture ) { + + var cb; + + if (support === "wheel") { + cb = callback; + } else { + cb = createCallback(elem,callback,useCapture); + } + + elem[ _addEventListener ]( prefix + eventName, cb, useCapture || false ); + + } + + function _removeWheelListener( elem, eventName, callback, useCapture ) { + + var cb; + + if (support === "wheel") { + cb = callback; + } else { + cb = getCallback(elem,useCapture); + } + + elem[ _removeEventListener ]( prefix + eventName, cb, useCapture || false ); + + removeCallback(elem,useCapture); + + } + + function addWheelListener( elem, callback, useCapture ) { + _addWheelListener( elem, support, callback, useCapture ); + + // handle MozMousePixelScroll in older Firefox + if( support == "DOMMouseScroll" ) { + _addWheelListener( elem, "MozMousePixelScroll", callback, useCapture); + } + } + + function removeWheelListener(elem,callback,useCapture){ + _removeWheelListener(elem,support,callback,useCapture); + + // handle MozMousePixelScroll in older Firefox + if( support == "DOMMouseScroll" ) { + _removeWheelListener(elem, "MozMousePixelScroll", callback, useCapture); + } + } + + return { + on: addWheelListener, + off: removeWheelListener + }; + +})(); + +},{}],7:[function(require,module,exports){ +module.exports = { + /** + * Extends an object + * + * @param {Object} target object to extend + * @param {Object} source object to take properties from + * @return {Object} extended object + */ + extend: function(target, source) { + target = target || {}; + for (var prop in source) { + // Go recursively + if (this.isObject(source[prop])) { + target[prop] = this.extend(target[prop], source[prop]) + } else { + target[prop] = source[prop] + } + } + return target; + } + + /** + * Checks if an object is a DOM element + * + * @param {Object} o HTML element or String + * @return {Boolean} returns true if object is a DOM element + */ +, isElement: function(o){ + return ( + o instanceof HTMLElement || o instanceof SVGElement || o instanceof SVGSVGElement || //DOM2 + (o && typeof o === 'object' && o !== null && o.nodeType === 1 && typeof o.nodeName === 'string') + ); + } + + /** + * Checks if an object is an Object + * + * @param {Object} o Object + * @return {Boolean} returns true if object is an Object + */ +, isObject: function(o){ + return Object.prototype.toString.call(o) === '[object Object]'; + } + + /** + * Checks if variable is Number + * + * @param {Integer|Float} n + * @return {Boolean} returns true if variable is Number + */ +, isNumber: function(n) { + return !isNaN(parseFloat(n)) && isFinite(n); + } + + /** + * Search for an SVG element + * + * @param {Object|String} elementOrSelector DOM Element or selector String + * @return {Object|Null} SVG or null + */ +, getSvg: function(elementOrSelector) { + var element + , svg; + + if (!this.isElement(elementOrSelector)) { + // If selector provided + if (typeof elementOrSelector === 'string' || elementOrSelector instanceof String) { + // Try to find the element + element = document.querySelector(elementOrSelector) + + if (!element) { + throw new Error('Provided selector did not find any elements. Selector: ' + elementOrSelector) + return null + } + } else { + throw new Error('Provided selector is not an HTML object nor String') + return null + } + } else { + element = elementOrSelector + } + + if (element.tagName.toLowerCase() === 'svg') { + svg = element; + } else { + if (element.tagName.toLowerCase() === 'object') { + svg = element.contentDocument.documentElement; + } else { + if (element.tagName.toLowerCase() === 'embed') { + svg = element.getSVGDocument().documentElement; + } else { + if (element.tagName.toLowerCase() === 'img') { + throw new Error('Cannot script an SVG in an "img" element. Please use an "object" element or an in-line SVG.'); + } else { + throw new Error('Cannot get SVG.'); + } + return null + } + } + } + + return svg + } + + /** + * Attach a given context to a function + * @param {Function} fn Function + * @param {Object} context Context + * @return {Function} Function with certain context + */ +, proxy: function(fn, context) { + return function() { + return fn.apply(context, arguments) + } + } + + /** + * Returns object type + * Uses toString that returns [object SVGPoint] + * And than parses object type from string + * + * @param {Object} o Any object + * @return {String} Object type + */ +, getType: function(o) { + return Object.prototype.toString.apply(o).replace(/^\[object\s/, '').replace(/\]$/, '') + } + + /** + * If it is a touch event than add clientX and clientY to event object + * + * @param {Event} evt + * @param {SVGSVGElement} svg + */ +, mouseAndTouchNormalize: function(evt, svg) { + // If no clientX then fallback + if (evt.clientX === void 0 || evt.clientX === null) { + // Fallback + evt.clientX = 0 + evt.clientY = 0 + + // If it is a touch event + if (evt.touches !== void 0 && evt.touches.length) { + if (evt.touches[0].clientX !== void 0) { + evt.clientX = evt.touches[0].clientX + evt.clientY = evt.touches[0].clientY + } else if (evt.touches[0].pageX !== void 0) { + var rect = svg.getBoundingClientRect(); + + evt.clientX = evt.touches[0].pageX - rect.left + evt.clientY = evt.touches[0].pageY - rect.top + } + // If it is a custom event + } else if (evt.originalEvent !== void 0) { + if (evt.originalEvent.clientX !== void 0) { + evt.clientX = evt.originalEvent.clientX + evt.clientY = evt.originalEvent.clientY + } + } + } + } + + /** + * Check if an event is a double click/tap + * TODO: For touch gestures use a library (hammer.js) that takes in account other events + * (touchmove and touchend). It should take in account tap duration and traveled distance + * + * @param {Event} evt + * @param {Event} prevEvt Previous Event + * @return {Boolean} + */ +, isDblClick: function(evt, prevEvt) { + // Double click detected by browser + if (evt.detail === 2) { + return true; + } + // Try to compare events + else if (prevEvt !== void 0 && prevEvt !== null) { + var timeStampDiff = evt.timeStamp - prevEvt.timeStamp // should be lower than 250 ms + , touchesDistance = Math.sqrt(Math.pow(evt.clientX - prevEvt.clientX, 2) + Math.pow(evt.clientY - prevEvt.clientY, 2)) + + return timeStampDiff < 250 && touchesDistance < 10 + } + + // Nothing found + return false; + } + + /** + * Returns current timestamp as an integer + * + * @return {Number} + */ +, now: Date.now || function() { + return new Date().getTime(); + } + + // From underscore. + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. +// jscs:disable +// jshint ignore:start +, throttle: function(func, wait, options) { + var that = this; + var context, args, result; + var timeout = null; + var previous = 0; + if (!options) options = {}; + var later = function() { + previous = options.leading === false ? 0 : that.now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + return function() { + var now = that.now(); + if (!previous && options.leading === false) previous = now; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + } +// jshint ignore:end +// jscs:enable + + /** + * Create a requestAnimationFrame simulation + * + * @param {Number|String} refreshRate + * @return {Function} + */ +, createRequestAnimationFrame: function(refreshRate) { + var timeout = null + + // Convert refreshRate to timeout + if (refreshRate !== 'auto' && refreshRate < 60 && refreshRate > 1) { + timeout = Math.floor(1000 / refreshRate) + } + + if (timeout === null) { + return window.requestAnimationFrame || requestTimeout(33) + } else { + return requestTimeout(timeout) + } + } +} + +/** + * Create a callback that will execute after a given timeout + * + * @param {Function} timeout + * @return {Function} + */ +function requestTimeout(timeout) { + return function(callback) { + window.setTimeout(callback, timeout) + } +} + +},{}]},{},[1]); + + +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mermaid=e():t.mermaid=e()}("undefined"!=typeof self?self:this,function(){return function(n){var r={};function a(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,a),e.l=!0,e.exports}return a.m=n,a.c=r,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=204)}([function(t,e,qn){(function(Wn){var t;t=function(){"use strict";var t,a;function h(){return t.apply(null,arguments)}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function u(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function l(t){return void 0===t}function c(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function d(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function f(t,e){var n,r=[];for(n=0;n>>0,r=0;rLt(t)?(i=t+1,s=o-Lt(t)):(i=t,s=o),{year:i,dayOfYear:s}}function zt(t,e,n){var r,a,i=It(t.year(),e,n),s=Math.floor((t.dayOfYear()-i-1)/7)+1;return s<1?r=s+Wt(a=t.year()-1,e,n):s>Wt(t.year(),e,n)?(r=s-Wt(t.year(),e,n),a=t.year()+1):(a=t.year(),r=s),{week:r,year:a}}function Wt(t,e,n){var r=It(t,e,n),a=It(t+1,e,n);return(Lt(t)-r+a)/7}z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),j("week","w"),j("isoWeek","W"),H("week",5),H("isoWeek",5),ut("w",Z),ut("ww",Z,V),ut("W",Z),ut("WW",Z,V),ft(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=w(t)});z("d",0,"do","day"),z("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),z("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),z("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),j("day","d"),j("weekday","e"),j("isoWeekday","E"),H("day",11),H("weekday",11),H("isoWeekday",11),ut("d",Z),ut("e",Z),ut("E",Z),ut("dd",function(t,e){return e.weekdaysMinRegex(t)}),ut("ddd",function(t,e){return e.weekdaysShortRegex(t)}),ut("dddd",function(t,e){return e.weekdaysRegex(t)}),ft(["dd","ddd","dddd"],function(t,e,n,r){var a=n._locale.weekdaysParse(t,r,n._strict);null!=a?e.d=a:y(n).invalidWeekday=t}),ft(["d","e","E"],function(t,e,n,r){e[r]=w(t)});var qt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ut="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Vt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $t=st;var Gt=st;var Jt=st;function Zt(){function t(t,e){return e.length-t.length}var e,n,r,a,i,s=[],o=[],u=[],l=[];for(e=0;e<7;e++)n=m([2e3,1]).day(e),r=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),i=this.weekdays(n,""),s.push(r),o.push(a),u.push(i),l.push(r),l.push(a),l.push(i);for(s.sort(t),o.sort(t),u.sort(t),l.sort(t),e=0;e<7;e++)o[e]=ct(o[e]),u[e]=ct(u[e]),l[e]=ct(l[e]);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("^("+s.join("|")+")","i")}function Kt(){return this.hours()%12||12}function Xt(t,e){z(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Qt(t,e){return e._meridiemParse}z("H",["HH",2],0,"hour"),z("h",["hh",2],0,Kt),z("k",["kk",2],0,function(){return this.hours()||24}),z("hmm",0,0,function(){return""+Kt.apply(this)+P(this.minutes(),2)}),z("hmmss",0,0,function(){return""+Kt.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)}),z("Hmm",0,0,function(){return""+this.hours()+P(this.minutes(),2)}),z("Hmmss",0,0,function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)}),Xt("a",!0),Xt("A",!1),j("hour","h"),H("hour",13),ut("a",Qt),ut("A",Qt),ut("H",Z),ut("h",Z),ut("k",Z),ut("HH",Z,V),ut("hh",Z,V),ut("kk",Z,V),ut("hmm",K),ut("hmmss",X),ut("Hmm",K),ut("Hmmss",X),ht(["H","HH"],yt),ht(["k","kk"],function(t,e,n){var r=w(t);e[yt]=24===r?0:r}),ht(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),ht(["h","hh"],function(t,e,n){e[yt]=w(t),y(n).bigHour=!0}),ht("hmm",function(t,e,n){var r=t.length-2;e[yt]=w(t.substr(0,r)),e[gt]=w(t.substr(r)),y(n).bigHour=!0}),ht("hmmss",function(t,e,n){var r=t.length-4,a=t.length-2;e[yt]=w(t.substr(0,r)),e[gt]=w(t.substr(r,2)),e[vt]=w(t.substr(a)),y(n).bigHour=!0}),ht("Hmm",function(t,e,n){var r=t.length-2;e[yt]=w(t.substr(0,r)),e[gt]=w(t.substr(r))}),ht("Hmmss",function(t,e,n){var r=t.length-4,a=t.length-2;e[yt]=w(t.substr(0,r)),e[gt]=w(t.substr(r,2)),e[vt]=w(t.substr(a))});var te,ee=Yt("Hours",!0),ne={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:jt,monthsShort:Ct,week:{dow:0,doy:6},weekdays:qt,weekdaysMin:Vt,weekdaysShort:Ut,meridiemParse:/[ap]\.?m?\.?/i},re={},ae={};function ie(t){return t?t.toLowerCase().replace("_","-"):t}function se(t){var e=null;if(!re[t]&&void 0!==Wn&&Wn&&Wn.exports)try{e=te._abbr;qn(207)("./"+t),oe(e)}catch(t){}return re[t]}function oe(t,e){var n;return t&&(n=l(e)?le(t):ue(t,e))&&(te=n),te._abbr}function ue(t,e){if(null!==e){var n=ne;if(e.abbr=t,null!=re[t])Y("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."),n=re[t]._config;else if(null!=e.parentLocale){if(null==re[e.parentLocale])return ae[e.parentLocale]||(ae[e.parentLocale]=[]),ae[e.parentLocale].push({name:t,config:e}),null;n=re[e.parentLocale]._config}return re[t]=new S(A(n,e)),ae[t]&&ae[t].forEach(function(t){ue(t.name,t.config)}),oe(t),re[t]}return delete re[t],null}function le(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return te;if(!o(t)){if(e=se(t))return e;t=[t]}return function(t){for(var e,n,r,a,i=0;i=e&&s(a,n,!0)>=e-1)break;e--}i++}return null}(t)}function ce(t){var e,n=t._a;return n&&-2===y(t).overflow&&(e=n[pt]<0||11St(n[_t],n[pt])?mt:n[yt]<0||24Wt(n,i,s)?y(t)._overflowWeeks=!0:null!=u?y(t)._overflowWeekday=!0:(o=Rt(n,r,a,i,s),t._a[_t]=o.year,t._dayOfYear=o.dayOfYear)}(t),null!=t._dayOfYear&&(i=de(t._a[_t],r[_t]),(t._dayOfYear>Lt(i)||0===t._dayOfYear)&&(y(t)._overflowDayOfYear=!0),n=Nt(i,0,t._dayOfYear),t._a[pt]=n.getUTCMonth(),t._a[mt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=r[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[yt]&&0===t._a[gt]&&0===t._a[vt]&&0===t._a[Mt]&&(t._nextDay=!0,t._a[yt]=0),t._d=(t._useUTC?Nt:function(t,e,n,r,a,i,s){var o=new Date(t,e,n,r,a,i,s);return t<100&&0<=t&&isFinite(o.getFullYear())&&o.setFullYear(t),o}).apply(null,s),a=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[yt]=24),t._w&&void 0!==t._w.d&&t._w.d!==a&&(y(t).weekdayMismatch=!0)}}var fe=/^\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)?)?$/,_e=/^\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)?)?$/,pe=/Z|[+-]\d\d(?::?\d\d)?/,me=[["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}/]],ye=[["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/]],ge=/^\/?Date\((\-?\d+)/i;function ve(t){var e,n,r,a,i,s,o=t._i,u=fe.exec(o)||_e.exec(o);if(u){for(y(t).iso=!0,e=0,n=me.length;en.valueOf():n.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Ie,ln.isUTC=Ie,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=n("dates accessor is deprecated. Use date instead.",nn),ln.months=n("months accessor is deprecated. Use month instead",Ot),ln.years=n("years accessor is deprecated. Use year instead",Dt),ln.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),ln.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var t={};if(M(t,this),(t=xe(t))._a){var e=t._isUTC?m(t._a):Ye(t._a);this._isDSTShifted=this.isValid()&&0Y.width){var l=a.text();if(a.text(""),l){var c,d;if(-1!==l.indexOf(" "))c=" ",d=l.split(" ");else{c="";var h,f,_=l.length,p=Math.ceil(s/Y.width),m=Math.floor(_/p);_<=m*p||p++,d=[];for(var y=0;yY.width&&w&&""!==w&&(k={string:w,width:x,offset:M+=x},v.push(k),a.text(""),a.text(L),y===d.length-1&&(b=L,a.text(b),D=n.getComputedTextLength())),y===d.length-1){a.text("");b&&""!==b&&(0>>1,Os=[["ary",vs],["bind",hs],["bindKey",fs],["curry",ps],["curryRight",ms],["flip",ks],["partial",ys],["partialRight",gs],["rearg",Ms]],Hs="[object Arguments]",Ps="[object Array]",Bs="[object AsyncFunction]",Ns="[object Boolean]",Is="[object Date]",Rs="[object DOMException]",zs="[object Error]",Ws="[object Function]",qs="[object GeneratorFunction]",Us="[object Map]",Vs="[object Number]",$s="[object Null]",Gs="[object Object]",Js="[object Promise]",Zs="[object Proxy]",Ks="[object RegExp]",Xs="[object Set]",Qs="[object String]",to="[object Symbol]",eo="[object Undefined]",no="[object WeakMap]",ro="[object WeakSet]",ao="[object ArrayBuffer]",io="[object DataView]",so="[object Float32Array]",oo="[object Float64Array]",uo="[object Int8Array]",lo="[object Int16Array]",co="[object Int32Array]",ho="[object Uint8Array]",fo="[object Uint8ClampedArray]",_o="[object Uint16Array]",po="[object Uint32Array]",mo=/\b__p \+= '';/g,yo=/\b(__p \+=) '' \+/g,go=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vo=/&(?:amp|lt|gt|quot|#39);/g,Mo=/[&<>"']/g,ko=RegExp(vo.source),bo=RegExp(Mo.source),Lo=/<%-([\s\S]+?)%>/g,wo=/<%([\s\S]+?)%>/g,xo=/<%=([\s\S]+?)%>/g,Do=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yo=/^\w*$/,To=/^\./,Ao=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,So=/[\\^$.*+?()[\]{}|]/g,Eo=RegExp(So.source),jo=/^\s+|\s+$/g,Co=/^\s+/,Fo=/\s+$/,Oo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ho=/\{\n\/\* \[wrapped with (.+)\] \*/,Po=/,? & /,Bo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,No=/\\(\\)?/g,Io=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ro=/\w*$/,zo=/^[-+]0x[0-9a-f]+$/i,Wo=/^0b[01]+$/i,qo=/^\[object .+?Constructor\]$/,Uo=/^0o[0-7]+$/i,Vo=/^(?:0|[1-9]\d*)$/,$o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Go=/($^)/,Jo=/['\n\r\u2028\u2029\\]/g,t="\\ud800-\\udfff",e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",n="\\u2700-\\u27bf",r="a-z\\xdf-\\xf6\\xf8-\\xff",a="A-Z\\xc0-\\xd6\\xd8-\\xde",i="\\ufe0e\\ufe0f",s="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="['’]",u="["+t+"]",l="["+s+"]",c="["+e+"]",d="\\d+",h="["+n+"]",f="["+r+"]",_="[^"+t+s+d+n+r+a+"]",p="\\ud83c[\\udffb-\\udfff]",m="[^"+t+"]",y="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="["+a+"]",M="\\u200d",k="(?:"+f+"|"+_+")",b="(?:"+v+"|"+_+")",L="(?:['’](?:d|ll|m|re|s|t|ve))?",w="(?:['’](?:D|LL|M|RE|S|T|VE))?",x="(?:"+c+"|"+p+")"+"?",D="["+i+"]?",Y=D+x+("(?:"+M+"(?:"+[m,y,g].join("|")+")"+D+x+")*"),T="(?:"+[h,y,g].join("|")+")"+Y,A="(?:"+[m+c+"?",c,y,g,u].join("|")+")",Zo=RegExp(o,"g"),Ko=RegExp(c,"g"),S=RegExp(p+"(?="+p+")|"+A+Y,"g"),Xo=RegExp([v+"?"+f+"+"+L+"(?="+[l,v,"$"].join("|")+")",b+"+"+w+"(?="+[l,v+k,"$"].join("|")+")",v+"?"+k+"+"+L,v+"+"+w,"\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",d,T].join("|"),"g"),E=RegExp("["+M+t+e+i+"]"),Qo=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eu=-1,nu={};nu[so]=nu[oo]=nu[uo]=nu[lo]=nu[co]=nu[ho]=nu[fo]=nu[_o]=nu[po]=!0,nu[Hs]=nu[Ps]=nu[ao]=nu[Ns]=nu[io]=nu[Is]=nu[zs]=nu[Ws]=nu[Us]=nu[Vs]=nu[Gs]=nu[Ks]=nu[Xs]=nu[Qs]=nu[no]=!1;var ru={};ru[Hs]=ru[Ps]=ru[ao]=ru[io]=ru[Ns]=ru[Is]=ru[so]=ru[oo]=ru[uo]=ru[lo]=ru[co]=ru[Us]=ru[Vs]=ru[Gs]=ru[Ks]=ru[Xs]=ru[Qs]=ru[to]=ru[ho]=ru[fo]=ru[_o]=ru[po]=!0,ru[zs]=ru[Ws]=ru[no]=!1;var j={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},au=parseFloat,iu=parseInt,C="object"==typeof R&&R&&R.Object===Object&&R,F="object"==typeof self&&self&&self.Object===Object&&self,su=C||F||Function("return this")(),O="object"==typeof W&&W&&!W.nodeType&&W,H=O&&"object"==typeof z&&z&&!z.nodeType&&z,ou=H&&H.exports===O,P=ou&&C.process,B=function(){try{return P&&P.binding&&P.binding("util")}catch(t){}}(),uu=B&&B.isArrayBuffer,lu=B&&B.isDate,cu=B&&B.isMap,du=B&&B.isRegExp,hu=B&&B.isSet,fu=B&&B.isTypedArray;function _u(t,e){return t.set(e[0],e[1]),t}function pu(t,e){return t.add(e),t}function mu(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function yu(t,e,n,r){for(var a=-1,i=null==t?0:t.length;++a":">",'"':""","'":"'"});function Vu(t){return"\\"+j[t]}function $u(t){return E.test(t)}function Gu(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function Ju(e,n){return function(t){return e(n(t))}}function Zu(t,e){for(var n=-1,r=t.length,a=0,i=[];++n",""":'"',"'":"'"});var el=function t(e){var n,T=(e=null==e?su:el.defaults(su.Object(),e,el.pick(su,tu))).Array,r=e.Date,a=e.Error,m=e.Function,i=e.Math,w=e.Object,y=e.RegExp,c=e.String,A=e.TypeError,s=T.prototype,o=m.prototype,u=w.prototype,l=e["__core-js_shared__"],d=o.toString,x=u.hasOwnProperty,h=0,f=(n=/[^.]+$/.exec(l&&l.keys&&l.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",_=u.toString,p=d.call(w),g=su._,v=y("^"+d.call(x).replace(So,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=ou?e.Buffer:ts,k=e.Symbol,b=e.Uint8Array,L=M?M.allocUnsafe:ts,D=Ju(w.getPrototypeOf,w),Y=w.create,S=u.propertyIsEnumerable,E=s.splice,j=k?k.isConcatSpreadable:ts,C=k?k.iterator:ts,F=k?k.toStringTag:ts,O=function(){try{var t=In(w,"defineProperty");return t({},"",{}),t}catch(t){}}(),H=e.clearTimeout!==su.clearTimeout&&e.clearTimeout,P=r&&r.now!==su.Date.now&&r.now,B=e.setTimeout!==su.setTimeout&&e.setTimeout,N=i.ceil,I=i.floor,R=w.getOwnPropertySymbols,z=M?M.isBuffer:ts,W=e.isFinite,q=s.join,U=Ju(w.keys,w),V=i.max,$=i.min,G=r.now,J=e.parseInt,Z=i.random,K=s.reverse,X=In(e,"DataView"),Q=In(e,"Map"),tt=In(e,"Promise"),et=In(e,"Set"),nt=In(e,"WeakMap"),rt=In(w,"create"),at=nt&&new nt,it={},st=fr(X),ot=fr(Q),ut=fr(tt),lt=fr(et),ct=fr(nt),dt=k?k.prototype:ts,ht=dt?dt.valueOf:ts,ft=dt?dt.toString:ts;function _t(t){if(Sa(t)&&!va(t)&&!(t instanceof gt)){if(t instanceof yt)return t;if(x.call(t,"__wrapped__"))return _r(t)}return new yt(t)}var pt=function(){function n(){}return function(t){if(!Aa(t))return{};if(Y)return Y(t);n.prototype=t;var e=new n;return n.prototype=ts,e}}();function mt(){}function yt(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=ts}function gt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=js,this.__views__=[]}function vt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=es&&(i=Ru,s=!1,e=new bt(e));t:for(;++a>>0,e>>>=0;for(var i=T(a);++r>>1,s=t[i];null!==s&&!Pa(s)&&(n?s<=e:s=ws)return arguments[0]}else r=0;return n.apply(ts,arguments)}}function ur(t,e){var n=-1,r=t.length,a=r-1;for(e=e===ts?r:e;++n>>0)?(t=$a(t))&&("string"==typeof e||null!=e&&!Fa(e))&&!(e=Pe(e))&&$u(t)?Je(Qu(t),0,n):t.split(e,n):[]},_t.spread=function(r,a){if("function"!=typeof r)throw new A(rs);return a=null==a?0:V(Wa(a),0),we(function(t){var e=t[a],n=Je(t,0,a);return e&&xu(n,e),mu(r,this,n)})},_t.tail=function(t){var e=null==t?0:t.length;return e?Ee(t,1,e):[]},_t.take=function(t,e,n){return t&&t.length?Ee(t,0,(e=n||e===ts?1:Wa(e))<0?0:e):[]},_t.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Ee(t,(e=r-(e=n||e===ts?1:Wa(e)))<0?0:e,r):[]},_t.takeRightWhile=function(t,e){return t&&t.length?Re(t,Pn(e,3),!1,!0):[]},_t.takeWhile=function(t,e){return t&&t.length?Re(t,Pn(e,3)):[]},_t.tap=function(t,e){return e(t),t},_t.throttle=function(t,e,n){var r=!0,a=!0;if("function"!=typeof t)throw new A(rs);return Aa(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),sa(t,e,{leading:r,maxWait:e,trailing:a})},_t.thru=zr,_t.toArray=Ra,_t.toPairs=fi,_t.toPairsIn=_i,_t.toPath=function(t){return va(t)?wu(t,hr):Pa(t)?[t]:rn(dr($a(t)))},_t.toPlainObject=Va,_t.transform=function(t,r,a){var e=va(t),n=e||La(t)||Ba(t);if(r=Pn(r,4),null==a){var i=t&&t.constructor;a=n?e?new i:[]:Aa(t)&&Da(i)?pt(D(t)):{}}return(n?gu:Gt)(t,function(t,e,n){return r(a,t,e,n)}),a},_t.unary=function(t){return na(t,1)},_t.union=Sr,_t.unionBy=Er,_t.unionWith=jr,_t.uniq=function(t){return t&&t.length?Be(t):[]},_t.uniqBy=function(t,e){return t&&t.length?Be(t,Pn(e,2)):[]},_t.uniqWith=function(t,e){return e="function"==typeof e?e:ts,t&&t.length?Be(t,ts,e):[]},_t.unset=function(t,e){return null==t||Ne(t,e)},_t.unzip=Cr,_t.unzipWith=Fr,_t.update=function(t,e,n){return null==t?t:Ie(t,e,Ve(n))},_t.updateWith=function(t,e,n,r){return r="function"==typeof r?r:ts,null==t?t:Ie(t,e,Ve(n),r)},_t.values=pi,_t.valuesIn=function(t){return null==t?[]:Iu(t,oi(t))},_t.without=Or,_t.words=Di,_t.wrap=function(t,e){return ha(Ve(e),t)},_t.xor=Hr,_t.xorBy=Pr,_t.xorWith=Br,_t.zip=Nr,_t.zipObject=function(t,e){return qe(t||[],e||[],At)},_t.zipObjectDeep=function(t,e){return qe(t||[],e||[],Ye)},_t.zipWith=Ir,_t.entries=fi,_t.entriesIn=_i,_t.extend=Ja,_t.extendWith=Za,Hi(_t,_t),_t.add=Vi,_t.attempt=Yi,_t.camelCase=mi,_t.capitalize=yi,_t.ceil=$i,_t.clamp=function(t,e,n){return n===ts&&(n=e,e=ts),n!==ts&&(n=(n=Ua(n))==n?n:0),e!==ts&&(e=(e=Ua(e))==e?e:0),Ot(Ua(t),e,n)},_t.clone=function(t){return Ht(t,ls)},_t.cloneDeep=function(t){return Ht(t,os|ls)},_t.cloneDeepWith=function(t,e){return Ht(t,os|ls,e="function"==typeof e?e:ts)},_t.cloneWith=function(t,e){return Ht(t,ls,e="function"==typeof e?e:ts)},_t.conformsTo=function(t,e){return null==e||Pt(t,e,si(e))},_t.deburr=gi,_t.defaultTo=function(t,e){return null==t||t!=t?e:t},_t.divide=Gi,_t.endsWith=function(t,e,n){t=$a(t),e=Pe(e);var r=t.length,a=n=n===ts?r:Ot(Wa(n),0,r);return 0<=(n-=e.length)&&t.slice(n,a)==e},_t.eq=pa,_t.escape=function(t){return(t=$a(t))&&bo.test(t)?t.replace(Mo,Uu):t},_t.escapeRegExp=function(t){return(t=$a(t))&&Eo.test(t)?t.replace(So,"\\$&"):t},_t.every=function(t,e,n){var r=va(t)?Mu:zt;return n&&Gn(t,e,n)&&(e=ts),r(t,Pn(e,3))},_t.find=Ur,_t.findIndex=gr,_t.findKey=function(t,e){return Au(t,Pn(e,3),Gt)},_t.findLast=Vr,_t.findLastIndex=vr,_t.findLastKey=function(t,e){return Au(t,Pn(e,3),Jt)},_t.floor=Ji,_t.forEach=$r,_t.forEachRight=Gr,_t.forIn=function(t,e){return null==t?t:Vt(t,Pn(e,3),oi)},_t.forInRight=function(t,e){return null==t?t:$t(t,Pn(e,3),oi)},_t.forOwn=function(t,e){return t&&Gt(t,Pn(e,3))},_t.forOwnRight=function(t,e){return t&&Jt(t,Pn(e,3))},_t.get=ei,_t.gt=ma,_t.gte=ya,_t.has=function(t,e){return null!=t&&qn(t,e,ee)},_t.hasIn=ni,_t.head=kr,_t.identity=ji,_t.includes=function(t,e,n,r){t=ka(t)?t:pi(t),n=n&&!r?Wa(n):0;var a=t.length;return n<0&&(n=V(a+n,0)),Ha(t)?n<=a&&-1=$(a=e,i=n)&&r=this.__values__.length;return{done:t,value:t?ts:this.__values__[this.__index__++]}},_t.prototype.plant=function(t){for(var e,n=this;n instanceof mt;){var r=_r(n);r.__index__=0,r.__values__=ts,e?a.__wrapped__=r:e=r;var a=r;n=n.__wrapped__}return a.__wrapped__=t,e},_t.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof gt){var e=t;return this.__actions__.length&&(e=new gt(this)),(e=e.reverse()).__actions__.push({func:zr,args:[Ar],thisArg:ts}),new yt(e,this.__chain__)}return this.thru(Ar)},_t.prototype.toJSON=_t.prototype.valueOf=_t.prototype.value=function(){return ze(this.__wrapped__,this.__actions__)},_t.prototype.first=_t.prototype.head,C&&(_t.prototype[C]=function(){return this}),_t}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(su._=el,define(function(){return el})):H?((H.exports=el)._=el,O._=el):su._=el}).call(this)}).call(W,e(18),e(3)(t))},function(t,e,n){var r=n(179),a=n(240),i=n(13);t.exports=function(t){return i(t)?r(t):a(t)}},function(t,e,n){var r=n(5).Symbol;t.exports=r},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(269),a=n(270),i=n(271),s=n(272),o=n(273);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e>>1;i(t[a],e)<0?n=a+1:r=a}return n},right:function(t,e,n,r){for(arguments.length<3&&(n=0),arguments.length<4&&(r=t.length);n>>1;0e;)a.push(r/i);else for(;(r=t+n*++s)=_.length)return h?h.call(f,t):d?t.sort(d):t;for(var e,a,i,s,o=-1,u=t.length,l=_[r++],c=new g;++o=_.length)return t;var a=[],i=e[r++];return t.forEach(function(t,e){a.push({key:t,values:n(e,r)})}),i?a.sort(function(t,e){return i(t.key,e.key)}):a}(p(F.map,t,0),0)},f.key=function(t){return _.push(t),f},f.sortKeys=function(t){return e[_.length-1]=t,f},f.sortValues=function(t){return d=t,f},f.rollup=function(t){return h=t,f},f},F.set=function(t){var e=new D;if(t)for(var n=0,r=t.length;n>16,t>>8&255,255&t)}function se(t){return ie(t)+""}Xt.brighter=function(t){return new $t(Math.min(100,this.l+Gt*(arguments.length?t:1)),this.a,this.b)},Xt.darker=function(t){return new $t(Math.max(0,this.l-Gt*(arguments.length?t:1)),this.a,this.b)},Xt.rgb=function(){return Qt(this.l,this.a,this.b)};var oe=(F.rgb=ae).prototype=new It;function ue(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function le(t,e,n){var r,a,i,s=0,o=0,u=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=r[2].split(","),r[1]){case"hsl":return n(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(fe(a[0]),fe(a[1]),fe(a[2]))}return(i=_e.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(s=(3840&i)>>4,s|=s>>4,o=240&i,o|=o>>4,u=15&i,u|=u<<4):7===t.length&&(s=(16711680&i)>>16,o=(65280&i)>>8,u=255&i)),e(s,o,u))}function ce(t,e,n){var r,a,i=Math.min(t/=255,e/=255,n/=255),s=Math.max(t,e,n),o=s-i,u=(s+i)/2;return o?(a=u<.5?o/(s+i):o/(2-s-i),r=t==s?(e-n)/o+(e=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function De(){for(var t,e=ge,n=1/0;e;)e.c?(e.t=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Se=F.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=F.round(t,Ye(t,e))).toFixed(Math.max(0,Math.min(20,Ye(t*(1+1e-15),e))))}});function Ee(t){return t+""}var je=F.time={},Ce=Date;function Fe(){this._=new Date(1e));)i=u[a=(a+1)%u.length];return r.reverse().join(o)}:H,function(t){var e=Ae.exec(t),c=e[1]||" ",d=e[2]||">",h=e[3]||"-",n=e[4]||"",f=e[5],_=+e[6],p=e[7],m=e[8],y=e[9],g=1,v="",M="",k=!1,b=!0;switch(m&&(m=+m.substring(1)),(f||"0"===c&&"="===d)&&(f=c="0",d="="),y){case"n":p=!0,y="g";break;case"%":g=100,M="%",y="f";break;case"p":g=100,M="%",y="r";break;case"b":case"o":case"x":case"X":"#"===n&&(v="0"+y.toLowerCase());case"c":b=!1;case"d":k=!0,m=0;break;case"s":g=-1,y="r"}"$"===n&&(v=r[0],M=r[1]),"r"!=y||m||(y="g"),null!=m&&("g"==y?m=Math.max(1,Math.min(21,m)):"e"!=y&&"f"!=y||(m=Math.max(0,Math.min(20,m)))),y=Se.get(y)||Ee;var L=f&&p;return function(t){var e=M;if(k&&t%1)return"";var n=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===h?"":h;if(g<0){var r=F.formatPrefix(t,m);t=r.scale(t),e=r.symbol+M}else t*=g;var a,i,s=(t=y(t,m)).lastIndexOf(".");if(s<0){var o=b?t.lastIndexOf("e"):-1;o<0?(a=t,i=""):(a=t.substring(0,o),i=t.substring(o))}else a=t.substring(0,s),i=w+t.substring(s+1);!f&&p&&(a=x(a,1/0));var u=v.length+a.length+i.length+(L?0:n.length),l=u<_?new Array(u=_-u+1).join(c):"";return L&&(a=x(l+a,l.length?_-i.length:1/0)),n+=v,t=a+i,("<"===d?n+t+l:">"===d?l+n+t:"^"===d?l.substring(0,u>>=1)+n+t+l.substring(u):n+(L?t:l+t))+e}}),timeFormat:function(t){var e=t.dateTime,n=t.date,r=t.time,a=t.periods,i=t.days,s=t.shortDays,o=t.months,u=t.shortMonths;function l(o){var u=o.length;function t(t){for(var e,n,r,a=[],i=-1,s=0;++iv(c,h)&&(h=t):v(t,h)>v(c,h)&&(c=t):c<=h?(tv(c,h)&&(h=t):v(t,h)>v(c,h)&&(c=t)}else y(t,e);p=n,_=t}function t(){m.point=s}function e(){l[0]=c,l[1]=h,m.point=y,p=null}function n(t,e){if(p){var n=t-_;i+=180bt&&(c=-(h=180)),l[0]=c,l[1]=h,p=null}function v(t,e){return(e-=t)<0?e+360:e}function M(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tv(o[0],o[1])&&(o[1]=i[1]),v(i[0],o[1])>v(o[0],o[1])&&(o[0]=i[0])):n.push(o=i);for(var r,a,i,s=-1/0,o=(e=0,n[a=n.length-1]);e<=a;o=i,++e)i=n[e],(r=v(o[1],i[0]))>s&&(s=r,c=i[0],h=o[1])}return u=l=null,c===1/0||d===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,d],[h,f]]}}(),F.geo.centroid=function(t){yn=gn=vn=Mn=kn=bn=Ln=wn=xn=Dn=Yn=0,F.geo.stream(t,Nn);var e=xn,n=Dn,r=Yn,a=e*e+n*n+r*r;return abt?Math.atan((Math.sin(r)*(o=Math.cos(i))*Math.sin(a)-Math.sin(i)*(s=Math.cos(r))*Math.sin(n))/(s*o*u)):(r+i)/2,d.point(p,_),d.lineEnd(),d.lineStart(),d.point(l,_),h=0),d.point(f=t,_=e),p=l},lineEnd:function(){d.lineEnd(),f=_=NaN},clean:function(){return 2-h}}},function(t,e,n,r){var a;if(null==t)a=n*Yt,r.point(-wt,a),r.point(0,a),r.point(wt,a),r.point(wt,0),r.point(wt,-a),r.point(0,-a),r.point(-wt,-a),r.point(-wt,0),r.point(-wt,a);else if(C(t[0]-e[0])>bt){var i=t[0]r&&0bt;return Zn(p,function(o){var u,l,c,d,h;return{lineStart:function(){d=c=!1,h=1},point:function(t,e){var n,r=[t,e],a=p(t,e),i=f?a?0:y(t,e):a?y(t+(t<0?wt:-wt),e):0;if(!u&&(d=c=a)&&o.lineStart(),a!==c&&(n=m(u,r),(Bn(u,n)||Bn(r,n))&&(r[0]+=bt,r[1]+=bt,a=p(r[0],r[1]))),a!==c)h=0,a?(o.lineStart(),n=m(r,u),o.point(n[0],n[1])):(n=m(u,r),o.point(n[0],n[1]),o.lineEnd()),u=n;else if(_&&u&&f^a){var s;i&l||!(s=m(r,u,!0))||(h=0,f?(o.lineStart(),o.point(s[0][0],s[0][1]),o.point(s[1][0],s[1][1]),o.lineEnd()):(o.point(s[1][0],s[1][1]),o.lineEnd(),o.lineStart(),o.point(s[0][0],s[0][1])))}!a||u&&Bn(u,r)||o.point(r[0],r[1]),u=r,c=a,l=i},lineEnd:function(){c&&o.lineEnd(),u=null},clean:function(){return h|(d&&c)<<1}}},Fr(a,6*Tt),f?[0,-a]:[-wt,a-wt]);function p(t,e){return Math.cos(t)*Math.cos(e)>D}function m(t,e,n){var r=[1,0,0],a=Cn(En(t),En(e)),i=jn(a,a),s=a[0],o=i-s*s;if(!o)return!n&&t;var u=D*i/o,l=-D*s/o,c=Cn(r,a),d=On(r,u);Fn(d,On(a,l));var h=c,f=jn(d,h),_=jn(h,h),p=f*f-_*(jn(d,d)-1);if(!(p<0)){var m=Math.sqrt(p),y=On(h,(-f-m)/_);if(Fn(y,d),y=Pn(y),!n)return y;var g,v=t[0],M=e[0],k=t[1],b=e[1];Mbt}).map(l)).concat(F.range(Math.ceil(s/_)*_,i,_).filter(function(t){return C(t%m)>bt}).map(c))}return g.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},g.outline=function(){return{type:"Polygon",coordinates:[d(a).concat(h(o).slice(1),d(r).reverse().slice(1),h(u).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.majorExtent(t).minorExtent(t):g.minorExtent()},g.majorExtent=function(t){return arguments.length?(a=+t[0][0],r=+t[1][0],u=+t[0][1],o=+t[1][1],r=l)return}else i={x:m,y:u};n={x:m,y:l}}else{if(i){if(i.y=l)return}else i={x:(u-a)/r,y:u};n={x:(l-a)/r,y:l}}else{if(i){if(i.y=o)return}else i={x:s,y:r*s+a};n={x:o,y:r*o+a}}else{if(i){if(i.xbt||C(a-n)>bt)&&(o.splice(s,0,new Ya((y=i.site,g=c,v=C(r-d)=s&&r.x<=u&&r.y>=o&&r.y<=l?[[s,l],[u,l],[u,o],[s,o]]:[]).point=a[e]}),i}function d(t){return t.map(function(t,e){return{x:Math.round(r(t,e)/bt)*bt,y:Math.round(a(t,e)/bt)*bt,i:e}})}return i.links=function(e){return Ca(d(e)).edges.filter(function(t){return t.l&&t.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},i.triangles=function(h){var f=[];return Ca(d(h)).cells.forEach(function(t,e){for(var n,r,a,i,s=t.site,o=t.edges.sort(Ma),u=-1,l=o.length,c=o[l-1].edge,d=c.l===s?c.r:c.l;++ui&&(a=r.slice(i,a),o[s]?o[s]+=a:o[++s]=a),(e=e[0])===(n=n[0])?o[s]?o[s]+=n:o[++s]=n:(o[++s]=null,u.push({i:s,x:Ia(e,n)})),i=Wa.lastIndex;return iu&&(u=e.x),e.y>l&&(l=e.y),n.push(e.x),r.push(e.y);else for(a=0;aa&&(r=n,a=e);return r}function Bi(t){return t.reduce(Ni,0)}function Ni(t,e){return t+e[1]}function Ii(t,e){return Ri(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Ri(t,e){for(var n=-1,r=+t[0],a=(t[1]-r)/e,i=[];++n<=e;)i[n]=a*n+r;return i}function zi(t){return[F.min(t),F.max(t)]}function Wi(t,e){return t.value-e.value}function qi(t,e){var n=t._pack_next;(t._pack_next=e)._pack_prev=t,(e._pack_next=n)._pack_prev=e}function Ui(t,e){(t._pack_next=e)._pack_prev=t}function Vi(t,e){var n=e.x-t.x,r=e.y-t.y,a=t.r+e.r;return n*n+r*r<.999*a*a}function $i(t){if((e=t.children)&&(u=e.length)){var e,n,r,a,i,s,o,u,l=1/0,c=-1/0,d=1/0,h=-1/0;if(e.forEach(Gi),(n=e[0]).x=-n.r,n.y=0,v(n),1=s[0]&&r<=s[1]&&((n=a[F.bisect(o,r,1,l)-1]).y+=c,n.push(t[e]));return a}return n.value=function(t){return arguments.length?(h=t,n):h},n.range=function(t){return arguments.length?(f=pe(t),n):f},n.bins=function(e){return arguments.length?(_="number"==typeof e?function(t){return Ri(t,e)}:pe(e),n):_},n.frequency=function(t){return arguments.length?(d=!!t,n):d},n},F.layout.pack=function(){var u,l=F.layout.hierarchy().sort(Wi),c=0,d=[1,1];function e(t,e){var n=l.call(this,t,e),r=n[0],a=d[0],i=d[1],s=null==u?Math.sqrt:"function"==typeof u?u:function(){return u};if(r.x=r.y=0,wi(r,function(t){t.r=+s(t.value)}),wi(r,$i),c){var o=c*(u?1:Math.max(2*r.r/a,2*r.r/i))/2;wi(r,function(t){t.r+=o}),wi(r,$i),wi(r,function(t){t.r-=o})}return function t(e,n,r,a){var i=e.children;e.x=n+=a*e.x;e.y=r+=a*e.y;e.r*=a;if(i)for(var s=-1,o=i.length;++ss.x&&(s=t),t.depth>o.depth&&(o=t)});var u=p(i,s)/2-i.x,l=h[0]/(s.x+p(s,i)/2+u),c=h[1]/(o.depth||1);Li(r,function(t){t.x=(t.x+u)*l,t.y=t.depth*c})}return n}function _(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,n=0,r=0,a=t.children,i=a.length;for(;0<=--i;)(e=a[i]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+p(t._,r._),t.m=t.z-a):t.z=a}else r&&(t.z=r.z+p(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,a=t,i=t,s=e,o=a.parent.children[0],u=a.m,l=i.m,c=s.m,d=o.m;s=Qi(s),a=Xi(a),s&&a;)o=Xi(o),(i=Qi(i)).a=t,0<(r=s.z+c-a.z-u+p(s._,a._))&&(ts((f=t,_=n,(h=s).a.parent===f.parent?h.a:_),t,r),u+=r,l+=r),c+=s.m,u+=a.m,d+=o.m,l+=i.m;s&&!Qi(i)&&(i.t=s,i.m+=c-l),a&&!Xi(o)&&(o.t=a,o.m+=u-d,n=t)}var h,f,_;return n}(t,r,t.parent.A||n[0])}function m(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function y(t){t.x*=h[0],t.y=t.depth*h[1]}return e.separation=function(t){return arguments.length?(p=t,e):p},e.size=function(t){return arguments.length?(f=null==(h=t)?y:null,e):f?null:h},e.nodeSize=function(t){return arguments.length?(f=null==(h=t)?null:y,e):f?h:null},bi(e,d)},F.layout.cluster=function(){var c=F.layout.hierarchy().sort(null).value(null),d=Ki,h=[1,1],f=!1;function e(t,e){var a,n=c.call(this,t,e),r=n[0],i=0;wi(r,function(t){var e,n,r=t.children;r&&r.length?(t.x=(n=r).reduce(function(t,e){return t+e.x},0)/n.length,t.y=(e=r,1+F.max(e,function(t){return t.y}))):(t.x=a?i+=d(t,a):0,t.y=0,a=t)});var s=function t(e){var n=e.children;return n&&n.length?t(n[0]):e}(r),o=function t(e){var n,r=e.children;return r&&(n=r.length)?t(r[n-1]):e}(r),u=s.x-d(s,o)/2,l=o.x+d(o,s)/2;return wi(r,f?function(t){t.x=(t.x-r.x)*h[0],t.y=(r.y-t.y)*h[1]}:function(t){t.x=(t.x-u)/(l-u)*h[0],t.y=(1-(r.y?t.y/r.y:1))*h[1]}),n}return e.separation=function(t){return arguments.length?(d=t,e):d},e.size=function(t){return arguments.length?(f=null==(h=t),e):f?null:h},e.nodeSize=function(t){return arguments.length?(f=null!=(h=t),e):f?h:null},bi(e,c)},F.layout.treemap=function(){var r,a=F.layout.hierarchy(),c=Math.round,i=[1,1],s=null,d=es,o=!1,h="squarify",u=.5*(1+Math.sqrt(5));function f(t,e){for(var n,r,a=-1,i=t.length;++an.dy)&&(l=n.dy);++in.dx)&&(l=n.dx);++ir;i--);e=e.slice(a,i)}return e};a.tickFormat=function(t,n){if(!arguments.length)return ys;arguments.length<2?n=ys:"function"!=typeof n&&(n=F.format(n));var r=Math.max(1,u*t/a.ticks().length);return function(t){var e=t/h(Math.round(d(t)));return e*urect,.s>rect").attr("width",L[1]-L[0])}function S(t){t.select(".extent").attr("y",w[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",w[1]-w[0])}function o(){var d,n,r=this,t=F.select(F.event.target),a=M.of(r,arguments),i=F.select(r),e=t.datum(),s=!/^(n|s)$/.test(e)&&k,o=!/^(e|w)$/.test(e)&&b,h=t.classed("extent"),u=gt(r),f=F.mouse(r),l=F.select(O(r)).on("keydown.brush",function(){32==F.event.keyCode&&(h||(d=null,f[0]-=L[1],f[1]-=w[1],h=2),P())}).on("keyup.brush",function(){32==F.event.keyCode&&2==h&&(f[0]+=L[1],f[1]+=w[1],h=0,P())});if(F.event.changedTouches?l.on("touchmove.brush",p).on("touchend.brush",y):l.on("mousemove.brush",p).on("mouseup.brush",y),i.interrupt().selectAll("*").interrupt(),h)f[0]=L[0]-f[0],f[1]=w[0]-f[1];else if(e){var c=+/w$/.test(e),_=+/^n/.test(e);n=[L[1-c]-f[0],w[1-_]-f[1]],f[0]=L[c],f[1]=w[_]}else F.event.altKey&&(d=f.slice());function p(){var t=F.mouse(r),e=!1;n&&(t[0]+=n[0],t[1]+=n[1]),h||(F.event.altKey?(d||(d=[(L[0]+L[1])/2,(w[0]+w[1])/2]),f[0]=L[+(t[0]e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0)/,/^(?:\^)/,/^(?:v\b)/,/^(?:\s*--[x]\s*)/,/^(?:\s*-->\s*)/,/^(?:\s*--[o]\s*)/,/^(?:\s*---\s*)/,/^(?:\s*-\.-[x]\s*)/,/^(?:\s*-\.->\s*)/,/^(?:\s*-\.-[o]\s*)/,/^(?:\s*-\.-\s*)/,/^(?:\s*.-[x]\s*)/,/^(?:\s*\.->\s*)/,/^(?:\s*\.-[o]\s*)/,/^(?:\s*\.-\s*)/,/^(?:\s*==[x]\s*)/,/^(?:\s*==>\s*)/,/^(?:\s*==[o]\s*)/,/^(?:\s*==[\=]\s*)/,/^(?:\s*--\s*)/,/^(?:\s*-\.\s*)/,/^(?:\s*==\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:[A-Za-z]+)/,/^(?:[!"#$%&'*+,-.`?\\_\/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\n+)/,/^(?:\s)/,/^(?:$)/],conditions:{string:{rules:[2,3],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70],inclusive:!0}}};function Yt(){this.yy={}}return xt.lexer=Dt,new((Yt.prototype=xt).Parser=Yt)}();r.parser=e,r.Parser=e.Parser,r.parse=function(){return e.parse.apply(e,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var e=a(8).readFileSync(a(9).normalize(t[1]),"utf8");return r.parser.parse(e)},void 0!==t&&a.c[a.s]===t&&r.main(n.argv.slice(1))}).call(r,a(7),a(3)(t))},function(t,r,a){"use strict";(function(n,t){var e=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,5],n=[1,6],r=[1,12],a=[1,13],i=[1,14],s=[1,15],o=[1,16],u=[1,17],l=[1,18],c=[1,19],d=[1,20],h=[1,21],f=[1,22],_=[8,16,17,18,19,20,21,22,23,24,25,26],p=[1,37],m=[1,33],y=[1,34],g=[1,35],v=[1,36],M=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],k=[10,28],b=[10,28,37,57,58],L=[2,49],w=[1,45],x=[1,48],D=[1,49],Y=[1,52],T=[2,65],A=[1,65],S=[1,66],E=[1,67],j=[1,68],C=[1,69],F=[1,70],O=[1,71],H=[1,72],P=[1,73],B=[8,16,17,18,19,20,21,22,23,24,25,26,47],N=[10,28,37],I={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,n,r,a,i,s){var o=i.length-1;switch(a){case 1:this.$=i[o-1];break;case 2:this.$=i[o-4];break;case 3:this.$=i[o-5];break;case 4:this.$=i[o-3];break;case 8:case 10:case 11:this.$=i[o];break;case 9:this.$=i[o-1]+""+i[o];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=i[o];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:r.addLink(i[o-1],i[o].id,i[o].op),this.$="oy";break;case 42:r.addLink(i[o-1],i[o].id,i[o].op),this.$={op:i[o-2],id:i[o-1]};break;case 44:this.$={op:i[o-1],id:i[o]};break;case 48:r.addVertex(i[o-1]),this.$=i[o-1];break;case 49:r.addVertex(i[o]),this.$=i[o];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:e,13:n},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f},{6:23,12:e,13:n},t(_,[2,5]),t(_,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:p,9:25,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},t([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f}),t(M,[2,8]),t(M,[2,10]),t(M,[2,11]),t(M,[2,12]),t(M,[2,13]),t(M,[2,14]),t(M,[2,15]),t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),t(M,[2,19]),t(M,[2,20]),{7:39,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f},{7:30,8:p,9:40,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},{10:[1,41]},{10:[2,21],28:[1,42]},t(k,[2,23]),t(k,[2,24]),t(k,[2,25]),t(b,L,{44:44,32:[1,43],45:w}),t(k,[2,27],{41:46,43:47,57:x,58:D}),t(k,[2,47],{43:47,34:50,41:51,37:Y,57:x,58:D}),{34:53,37:Y},{34:54,37:Y},{34:55,37:Y},{7:56,8:[1,57],14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f},{7:30,8:p,9:58,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},t(M,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:p,9:61,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},{7:62,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f},t(b,[2,48]),t(b,T,{14:10,15:11,7:63,46:64,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,48:A,49:S,50:E,51:j,52:C,53:F,54:O,55:H,56:P}),t(k,[2,41],{34:74,37:Y}),{7:77,8:p,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,33:76,42:75,47:v},t(B,[2,66]),t(B,[2,67]),t(k,[2,46]),t(k,[2,40],{34:78,37:Y}),{7:81,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,38:79,39:[1,80]},t(k,[2,28]),t(k,[2,29]),t(k,[2,30]),{8:[1,82]},{7:30,8:p,9:83,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},{10:[1,84]},{7:30,8:p,9:85,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},{5:[2,2]},{10:[2,22]},t(k,[2,26]),t(b,[2,51],{45:[1,86]}),t(b,[2,52]),t(b,[2,56]),t(b,[2,57]),t(b,[2,58]),t(b,[2,59]),t(b,[2,60]),t(b,[2,61]),t(b,[2,62]),t(b,[2,63]),t(b,[2,64]),t(k,[2,38]),t(N,[2,44],{43:47,41:87,57:x,58:D}),t(N,[2,45],{43:47,41:88,57:x,58:D}),t(b,L,{44:44,45:w}),t(k,[2,39]),{39:[1,89]},t(k,[2,34],{34:90,37:Y}),{32:[1,91]},{7:30,8:p,9:92,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},{10:[1,93]},t(b,[2,55]),{10:[1,94]},t(b,T,{46:95,48:A,49:S,50:E,51:j,52:C,53:F,54:O,55:H,56:P}),t(N,[2,42]),t(N,[2,43]),t(k,[2,33],{34:96,37:Y}),t(k,[2,32]),{7:97,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f},{10:[1,98]},t(b,[2,54]),{5:[2,3]},t(b,[2,50]),t(k,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},t(b,[2,53]),{7:81,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,38:101},{7:81,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],a=[null],i=[],s=this.table,o="",u=0,l=0,c=0,d=1,h=i.slice.call(arguments,1),f=Object.create(this.lexer),_={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(_.yy[p]=this.yy[p]);f.setInput(t,_.yy),_.yy.lexer=f,_.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var m=f.yylloc;i.push(m);var y=f.options&&f.options.ranges;"function"==typeof _.yy.parseError?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,v,M,k,b,L,w,x,D,Y,T={};;){if(M=n[n.length-1],this.defaultActions[M]?k=this.defaultActions[M]:(null==g&&(Y=void 0,"number"!=typeof(Y=r.pop()||f.lex()||d)&&(Y instanceof Array&&(Y=(r=Y).pop()),Y=e.symbols_[Y]||Y),g=Y),k=s[M]&&s[M][g]),void 0===k||!k.length||!k[0]){var A="";for(L in D=[],s[M])this.terminals_[L]&&2e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};function z(){this.yy={}}return I.lexer=R,new((z.prototype=I).Parser=z)}();r.parser=e,r.Parser=e.Parser,r.parse=function(){return e.parse.apply(e,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var e=a(8).readFileSync(a(9).normalize(t[1]),"utf8");return r.parser.parse(e)},void 0!==t&&a.c[a.s]===t&&r.main(n.argv.slice(1))}).call(r,a(7),a(3)(t))},function(t,e,n){var r;r=function(t,e){return function(n){var r={};function a(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,a),e.l=!0,e.exports}return a.m=n,a.c=r,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=5)}([function(t,e){t.exports=n(19)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addDummyNode=s,e.simplify=u,e.asNonCompoundGraph=l,e.successorWeights=c,e.predecessorWeights=d,e.intersectRect=h,e.buildLayerMatrix=f,e.normalizeRanks=_,e.removeEmptyRanks=p,e.addBorderNode=m,e.maxRank=y,e.partition=g,e.time=v,e.notime=M;var r,a=n(0),o=(r=a)&&r.__esModule?r:{default:r},i=n(2);function s(t,e,n,r){for(var a=void 0;a=o.default.uniqueId(r),t.hasNode(a););return n.dummy=e,t.setNode(a,n),a}function u(r){var a=(new i.Graph).setGraph(r.graph());return o.default.each(r.nodes(),function(t){a.setNode(t,r.node(t))}),o.default.each(r.edges(),function(t){var e=a.edge(t.v,t.w)||{weight:0,minlen:1},n=r.edge(t);a.setEdge(t.v,t.w,{weight:e.weight+n.weight,minlen:Math.max(e.minlen,n.minlen)})}),a}function l(e){var n=new i.Graph({multigraph:e.isMultigraph()}).setGraph(e.graph());return o.default.each(e.nodes(),function(t){e.children(t).length||n.setNode(t,e.node(t))}),o.default.each(e.edges(),function(t){n.setEdge(t,e.edge(t))}),n}function c(n){var t=o.default.map(n.nodes(),function(t){var e={};return o.default.each(n.outEdges(t),function(t){e[t.w]=(e[t.w]||0)+n.edge(t).weight}),e});return o.default.zipObject(n.nodes(),t)}function d(n){var t=o.default.map(n.nodes(),function(t){var e={};return o.default.each(n.inEdges(t),function(t){e[t.v]=(e[t.v]||0)+n.edge(t).weight}),e});return o.default.zipObject(n.nodes(),t)}function h(t,e){var n=t.x,r=t.y,a=e.x-n,i=e.y-r,s=t.width/2,o=t.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var u=void 0,l=void 0;return Math.abs(i)*s>Math.abs(a)*o?(i<0&&(o=-o),u=o*a/i,l=o):(a<0&&(s=-s),l=(u=s)*i/a),{x:n+u,y:r+l}}function f(r){var a=o.default.map(o.default.range(y(r)+1),function(){return[]});return o.default.each(r.nodes(),function(t){var e=r.node(t),n=e.rank;o.default.isUndefined(n)||(a[n][e.order]=t)}),a}function _(n){var r=o.default.min(o.default.map(n.nodes(),function(t){return n.node(t).rank}));o.default.each(n.nodes(),function(t){var e=n.node(t);o.default.has(e,"rank")&&(e.rank-=r)})}function p(n){var r=o.default.min(o.default.map(n.nodes(),function(t){return n.node(t).rank})),a=[];o.default.each(n.nodes(),function(t){var e=n.node(t).rank-r;a[e]||(a[e]=[]),a[e].push(t)});var i=0,s=n.graph().nodeRankFactor;o.default.each(a,function(t,e){o.default.isUndefined(t)&&e%s!=0?--i:i&&o.default.each(t,function(t){n.node(t).rank+=i})})}function m(t,e,n,r){var a={width:0,height:0};return 4<=arguments.length&&(a.rank=n,a.order=r),s(t,"border",a,e)}function y(n){return o.default.max(o.default.map(n.nodes(),function(t){var e=n.node(t).rank;if(!o.default.isUndefined(e))return e}))}function g(t,e){var n={lhs:[],rhs:[]};return o.default.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function v(t,e){var n=o.default.now();try{return e()}finally{console.log(t+" time: "+(o.default.now()-n)+"ms")}}function M(t,e){return e()}e.default={addDummyNode:s,simplify:u,asNonCompoundGraph:l,successorWeights:c,predecessorWeights:d,intersectRect:h,buildLayerMatrix:f,normalizeRanks:_,removeEmptyRanks:p,addBorderNode:m,maxRank:y,partition:g,time:v,notime:M}},function(t,e){t.exports=n(29)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.longestPath=i,e.slack=o;var r,a=n(0),s=(r=a)&&r.__esModule?r:{default:r};function i(a){var i={};s.default.each(a.sources(),function e(t){var n=a.node(t);if(s.default.has(i,t))return n.rank;i[t]=!0;var r=s.default.min(s.default.map(a.outEdges(t),function(t){return e(t.w)-a.edge(t).minlen}))||0;return n.rank=r})}function o(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}e.default={longestPath:i,slack:o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,a=n(0),o=(r=a)&&r.__esModule?r:{default:r},i=n(2),u=n(3);function s(i,s){return o.default.each(i.nodes(),function r(a){o.default.each(s.nodeEdges(a),function(t){var e=t.v,n=a===e?t.w:e;i.hasNode(n)||(0,u.slack)(s,t)||(i.setNode(n,{}),i.setEdge(a,n,{}),r(n))})}),i.nodeCount()}function l(e,n){return o.default.minBy(n.edges(),function(t){if(e.hasNode(t.v)!==e.hasNode(t.w))return(0,u.slack)(n,t)})}function c(t,e,n){o.default.each(t.nodes(),function(t){e.node(t).rank+=n})}e.default=function(t){var e=new i.Graph({directed:!1}),n=t.nodes()[0],r=t.nodeCount();e.setNode(n,{});for(var a=void 0;s(e,t)s.lim&&(o=s,u=!0);var l=_.default.filter(n.edges(),function(t){return u===g(e,e.node(t.v),o)&&u!==g(e,e.node(t.w),o)});return _.default.minBy(l,function(t){return(0,c.slack)(n,t)})}function y(t,e,n,r){var a,i,s,o,u=n.v,l=n.w;t.removeEdge(u,l),t.setEdge(r.v,r.w,{}),f(t),h(t,e),a=t,i=e,s=_.default.find(a.nodes(),function(t){return!i.node(t).parent}),o=(o=d(a,s)).slice(1),_.default.each(o,function(t){var e=a.node(t).parent,n=i.edge(t,e),r=!1;n||(n=i.edge(e,t),r=!0),i.node(t).rank=i.node(e).rank+(r?n.minlen:-n.minlen)})}function g(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}u.initLowLimValues=f,u.initCutValues=h,u.calcCutValue=l,u.leaveEdge=p,u.enterEdge=m,u.exchangeEdges=y,e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,a=n(0),s=(r=a)&&r.__esModule?r:{default:r};e.default=function(l){var r,a,i,c=(r=l,a={},i=0,s.default.each(r.children(),function t(e){var n=i;s.default.each(r.children(e),t),a[e]={low:n,lim:i++}}),a);s.default.each(l.graph().dummyChains,function(t){for(var e=l.node(t),n=e.edgeObj,r=function(t,e,n,r){var a=[],i=[],s=Math.min(e[n].low,e[r].low),o=Math.max(e[n].lim,e[r].lim),u=void 0,l=void 0;for(u=n;u=t.parent(u),a.push(u),u&&(e[u].low>s||o>e[u].lim););for(l=u,u=r;(u=t.parent(u))!==l;)i.push(u);return{path:a.concat(i.reverse()),lca:l}}(l,c,n.v,n.w),a=r.path,i=r.lca,s=0,o=a[s],u=!0;t!==n.w;){if(e=l.node(t),u){for(;(o=a[s])!==i&&l.node(o).maxRank>1]+=t.weight;u+=t.weight*n})),u}e.default=function(t,e){for(var n=0,r=1;r=i.barycenter)&&(n=t,a=r=0,(e=i).weight&&(r+=e.barycenter*e.weight,a+=e.weight),n.weight&&(r+=n.barycenter*n.weight,a+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/a,e.weight=a,e.i=Math.min(n.i,e.i),n.merged=!0)}}function r(e){return function(t){t.in.push(e),0==--t.indegree&&n.push(t)}}for(;n.length;){var a=n.pop();t.push(a),s.default.each(a.in.reverse(),e(a)),s.default.each(a.out,r(a))}return s.default.chain(t).filter(function(t){return!t.merged}).map(function(t){return s.default.pick(t,["vs","i","barycenter","weight"])}).value()}(s.default.filter(r,function(t){return!t.indegree}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var d=r(n(0)),h=r(n(1));function r(t){return t&&t.__esModule?t:{default:t}}function f(t,e,n){for(var r=void 0;e.length&&(r=d.default.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}e.default=function(t,e){var n,r=h.default.partition(t,function(t){return d.default.has(t,"barycenter")}),a=r.lhs,i=d.default.sortBy(r.rhs,function(t){return-t.i}),s=[],o=0,u=0,l=0;a.sort((n=!!e,function(t,e){return t.barycentere.barycenter?1:n?e.i-t.i:t.i-e.i})),l=f(s,i,l),d.default.each(a,function(t){l+=t.vs.length,s.push(t.vs),o+=t.barycenter*t.weight,u+=t.weight,l=f(s,i,l)});var c={vs:d.default.flatten(s,!0)};return u&&(c.barycenter=o/u,c.weight=u),c}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,a=n(0),u=(r=a)&&r.__esModule?r:{default:r},l=n(2);e.default=function(i,n,r){var s=function(t){for(var e=void 0;t.hasNode(e=u.default.uniqueId("_root")););return e}(i),o=new l.Graph({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(t){return i.node(t)});return u.default.each(i.nodes(),function(a){var t=i.node(a),e=i.parent(a);(t.rank===n||t.minRank<=n&&n<=t.maxRank)&&(o.setNode(a),o.setParent(a,e||s),u.default.each(i[r](a),function(t){var e=t.v===a?t.w:t.v,n=o.edge(e,a),r=u.default.isUndefined(n)?0:n.weight;o.setEdge(e,a,{weight:i.edge(t).weight+r})}),u.default.has(t,"minRank")&&o.setNode(a,{borderLeft:t.borderLeft[n],borderRight:t.borderRight[n]}))}),o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,a=n(0),u=(r=a)&&r.__esModule?r:{default:r};e.default=function(a,i,t){var s={},o=void 0;u.default.each(t,function(t){for(var e=a.parent(t),n=void 0,r=void 0;e;){if((n=a.parent(e))?(r=s[n],s[n]=e):(r=o,o=e),r&&r!==e)return void i.setEdge(r,e);e=n}})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=r(n(0)),o=r(n(1)),u=n(27);function r(t){return t&&t.__esModule?t:{default:t}}e.default=function(n){var r,t,a,i;n=o.default.asNonCompoundGraph(n),r=n,t=o.default.buildLayerMatrix(r),a=r.graph().ranksep,i=0,s.default.each(t,function(t){var e=s.default.max(s.default.map(t,function(t){return r.node(t).height}));s.default.each(t,function(t){r.node(t).y=i+e/2}),i+=e+a}),s.default.each((0,u.positionX)(n),function(t,e){n.node(e).x=t})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.positionX=i;var v=a(n(0)),M=n(2),r=a(n(1));function a(t){return t&&t.__esModule?t:{default:t}}function l(l,t){var c={};return v.default.reduce(t,function(t,r){var i=0,s=0,o=t.length,u=v.default.last(r);return v.default.each(r,function(t,e){var n=function(e,t){if(e.node(t).dummy)return v.default.find(e.predecessors(t),function(t){return e.node(t).dummy})}(l,t),a=n?l.node(n).order:o;(n||t===u)&&(v.default.each(r.slice(s,e+1),function(r){v.default.each(l.predecessors(r),function(t){var e=l.node(t),n=e.order;!(na)&&d(s,t,i)})})}return v.default.reduce(t,function(r,a){var i=-1,s=void 0,o=0;return v.default.each(a,function(t,e){if("border"===u.node(t).dummy){var n=u.predecessors(t);n.length&&(s=u.node(n[0]).order,l(a,o,e,i,s),o=e,i=s)}l(a,o,a.length,s,r.length)}),a}),s}function d(t,e,n){if(n",main:"dist/dagre-layout.js",keywords:["graph","layout","dagre"],scripts:{lint:"standard",jest:"jest --coverage",karma:"node -r babel-register node_modules/.bin/karma start",test:"yarn lint && yarn jest && yarn karma --single-run",bench:"node -r babel-register src/bench.js",build:"node -r babel-register node_modules/.bin/webpack --progress --colors","build:watch":"yarn build --watch",upgrade:"yarn-upgrade-all"},dependencies:{graphlib:"^2.1.1",lodash:"^4.17.4"},devDependencies:{"babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-preset-env":"^1.6.0","babel-preset-es2015":"^6.24.1",benchmark:"^2.1.4",chai:"^4.1.2",coveralls:"^2.13.1",jest:"^21.0.1",karma:"^1.7.1","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-mocha":"^1.3.0","karma-safari-launcher":"^1.0.0",mocha:"^3.5.0",sprintf:"^0.1.5",standard:"^10.0.3",webpack:"^3.5.6","webpack-node-externals":"^1.6.0","yarn-upgrade-all":"^0.1.8"},repository:{type:"git",url:"https://github.com/tylingsoft/dagre-layout.git"},license:"MIT",files:["dist/","lib/","index.js"],standard:{ignore:["dist/**/*.js","coverage/**/*.js"]},jest:{testRegex:"test/.+?-test\\.js",testPathIgnorePatterns:["test/bundle-test\\.js"]}}}]).default},t.exports=r(n(19),n(29))},function(t,e,n){var r=n(4),a=n(164);t.exports=function(e,t,n,r){return function(t,n,i,e){var s,o,u={},l=new a,r=function(t){var e=t.v!==s?t.v:t.w,n=u[e],r=i(t),a=o.distance+r;if(r<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+r);athis._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},r.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,a=t;n>1].prioritye[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[2,3,15],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!0}}};function w(){this.yy={}}return b.lexer=L,new((w.prototype=b).Parser=w)}();r.parser=e,r.Parser=e.Parser,r.parse=function(){return e.parse.apply(e,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var e=a(8).readFileSync(a(9).normalize(t[1]),"utf8");return r.parser.parse(e)},void 0!==t&&a.c[a.s]===t&&r.main(n.argv.slice(1))}).call(r,a(7),a(3)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.apply=e.setTitle=e.addNote=e.PLACEMENT=e.ARROWTYPE=e.LINETYPE=e.clear=e.getTitle=e.getActorKeys=e.getActor=e.getActors=e.getMessages=e.addSignal=e.addMessage=e.addActor=void 0;var a=n(1),i={},s=[],o=[],r="",u=e.addActor=function(t,e,n){var r=i[t];r&&e===r.name&&null==n||(null==n&&(n=e),i[t]={name:e,description:n})},l=e.addMessage=function(t,e,n,r){s.push({from:t,to:e,message:n,answer:r})},c=e.addSignal=function(t,e,n,r){a.logger.debug("Adding message from="+t+" to="+e+" message="+n+" type="+r),s.push({from:t,to:e,message:n,type:r})},d=e.getMessages=function(){return s},h=e.getActors=function(){return i},f=e.getActor=function(t){return i[t]},_=e.getActorKeys=function(){return Object.keys(i)},p=e.getTitle=function(){return r},m=e.clear=function(){i={},s=[]},y=e.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21},g=e.ARROWTYPE={FILLED:0,OPEN:1},v=e.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},M=e.addNote=function(t,e,n){var r={actor:t,placement:e,message:n},a=[].concat(t,t);o.push(r),s.push({from:a[0],to:a[1],message:n,type:y.NOTE,placement:e})},k=e.setTitle=function(t){r=t},b=e.apply=function e(t){if(t instanceof Array)t.forEach(function(t){e(t)});else switch(t.type){case"addActor":u(t.actor,t.actor,t.description);break;case"activeStart":case"activeEnd":c(t.actor,void 0,void 0,t.signalType);break;case"addNote":M(t.actor,t.placement,t.text);break;case"addMessage":c(t.from,t.to,t.msg,t.signalType);break;case"loopStart":c(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":c(void 0,void 0,void 0,t.signalType);break;case"optStart":c(void 0,void 0,t.optText,t.signalType);break;case"optEnd":c(void 0,void 0,void 0,t.signalType);break;case"altStart":case"else":c(void 0,void 0,t.altText,t.signalType);break;case"altEnd":c(void 0,void 0,void 0,t.signalType);break;case"setTitle":k(t.text);break;case"parStart":case"and":c(void 0,void 0,t.parText,t.signalType);break;case"parEnd":c(void 0,void 0,void 0,t.signalType)}};e.default={addActor:u,addMessage:l,addSignal:c,getMessages:d,getActors:h,getActor:f,getActorKeys:_,getTitle:p,clear:m,LINETYPE:y,ARROWTYPE:g,PLACEMENT:v,addNote:M,setTitle:k,apply:b}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getInfo=e.setInfo=e.getMessage=e.setMessage=void 0;var r=n(1),a="",i=!1,s=e.setMessage=function(t){r.logger.debug("Setting message to: "+t),a=t},o=e.getMessage=function(){return a},u=e.setInfo=function(t){i=t},l=e.getInfo=function(){return i};e.default={setMessage:s,getMessage:o,setInfo:u,getInfo:l}},function(t,r,a){"use strict";(function(n,t){var e=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[6,9,10,12],n={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,n,r,a,i,s){var o=i.length-1;switch(a){case 1:return r;case 4:break;case 6:r.setInfo(!0);break;case 7:r.setMessage(i[o]);break;case 8:this.$=i[o-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},t(e,[2,3]),t(e,[2,4]),t(e,[2,5]),t(e,[2,6]),t(e,[2,7]),{13:[1,11]},t(e,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],a=[null],i=[],s=this.table,o="",u=0,l=0,c=0,d=1,h=i.slice.call(arguments,1),f=Object.create(this.lexer),_={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(_.yy[p]=this.yy[p]);f.setInput(t,_.yy),_.yy.lexer=f,_.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var m=f.yylloc;i.push(m);var y=f.options&&f.options.ranges;"function"==typeof _.yy.parseError?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,v,M,k,b,L,w,x,D,Y,T={};;){if(M=n[n.length-1],this.defaultActions[M]?k=this.defaultActions[M]:(null==g&&(Y=void 0,"number"!=typeof(Y=r.pop()||f.lex()||d)&&(Y instanceof Array&&(Y=(r=Y).pop()),Y=e.symbols_[Y]||Y),g=Y),k=s[M]&&s[M][g]),void 0===k||!k.length||!k[0]){var A="";for(L in D=[],s[M])this.terminals_[L]&&2e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::[^#\n;]+)/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:[A-Za-z]+)/,/^(?:[!"#$%&'*+,-.`?\\_\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/],conditions:{string:{rules:[10,11],inclusive:!1},struct:{rules:[5,6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,8,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!0}}};function L(){this.yy={}}return k.lexer=b,new((L.prototype=k).Parser=L)}();r.parser=e,r.Parser=e.Parser,r.parse=function(){return e.parse.apply(e,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var e=a(8).readFileSync(a(9).normalize(t[1]),"utf8");return r.parser.parse(e)},void 0!==t&&a.c[a.s]===t&&r.main(n.argv.slice(1))}).call(r,a(7),a(3)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.relationType=e.lineType=e.cleanupLabel=e.addMembers=e.addRelation=e.getRelations=e.getClasses=e.getClass=e.clear=e.addClass=void 0;var r=n(1),a=[],i={},s=e.addClass=function(t){void 0===i[t]&&(i[t]={id:t,methods:[],members:[]})},o=e.clear=function(){a=[],i={}},u=e.getClass=function(t){return i[t]},l=e.getClasses=function(){return i},c=e.getRelations=function(){return a},d=e.addRelation=function(t){r.logger.warn("Adding relation: "+JSON.stringify(t)),s(t.id1),s(t.id2),a.push(t)},h=e.addMembers=function(t,e){var n=i[t];"string"==typeof e&&(")"===e.substr(-1)?n.methods.push(e):n.members.push(e))},f=e.cleanupLabel=function(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()},_=e.lineType={LINE:0,DOTTED_LINE:1},p=e.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3};e.default={addClass:s,clear:o,getClass:u,getClasses:l,getRelations:c,addRelation:d,addMembers:h,cleanupLabel:f,lineType:_,relationType:p}},function(t,r,a){"use strict";(function(n,t){var e=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[2,3],n=[1,7],r=[7,12,15,17,19,20,21],a=[7,11,12,15,17,19,20,21],i=[2,20],s=[1,32],o={trace:function(){},yy:{},symbols_:{error:2,start:3,GG:4,":":5,document:6,EOF:7,DIR:8,options:9,body:10,OPT:11,NL:12,line:13,statement:14,COMMIT:15,commit_arg:16,BRANCH:17,ID:18,CHECKOUT:19,MERGE:20,RESET:21,reset_arg:22,STR:23,HEAD:24,reset_parents:25,CARET:26,$accept:0,$end:1},terminals_:{2:"error",4:"GG",5:":",7:"EOF",8:"DIR",11:"OPT",12:"NL",15:"COMMIT",17:"BRANCH",18:"ID",19:"CHECKOUT",20:"MERGE",21:"RESET",23:"STR",24:"HEAD",26:"CARET"},productions_:[0,[3,4],[3,5],[6,0],[6,2],[9,2],[9,1],[10,0],[10,2],[13,2],[13,1],[14,2],[14,2],[14,2],[14,2],[14,2],[16,0],[16,1],[22,2],[22,2],[25,0],[25,2]],performAction:function(t,e,n,r,a,i,s){var o=i.length-1;switch(a){case 1:return i[o-1];case 2:return r.setDirection(i[o-3]),i[o-1];case 4:r.setOptions(i[o-1]),this.$=i[o];break;case 5:i[o-1]+=i[o],this.$=i[o-1];break;case 7:this.$=[];break;case 8:i[o-1].push(i[o]),this.$=i[o-1];break;case 9:this.$=i[o-1];break;case 11:r.commit(i[o]);break;case 12:r.branch(i[o]);break;case 13:r.checkout(i[o]);break;case 14:r.merge(i[o]);break;case 15:r.reset(i[o]);break;case 16:this.$="";break;case 17:this.$=i[o];break;case 18:this.$=i[o-1]+":"+i[o];break;case 19:this.$=i[o-1]+":"+r.count,r.count=0;break;case 20:r.count=0;break;case 21:r.count+=1}},table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3],8:[1,4]},{6:5,7:e,9:6,12:n},{5:[1,8]},{7:[1,9]},t(r,[2,7],{10:10,11:[1,11]}),t(a,[2,6]),{6:12,7:e,9:6,12:n},{1:[2,1]},{7:[2,4],12:[1,15],13:13,14:14,15:[1,16],17:[1,17],19:[1,18],20:[1,19],21:[1,20]},t(a,[2,5]),{7:[1,21]},t(r,[2,8]),{12:[1,22]},t(r,[2,10]),{12:[2,16],16:23,23:[1,24]},{18:[1,25]},{18:[1,26]},{18:[1,27]},{18:[1,30],22:28,24:[1,29]},{1:[2,2]},t(r,[2,9]),{12:[2,11]},{12:[2,17]},{12:[2,12]},{12:[2,13]},{12:[2,14]},{12:[2,15]},{12:i,25:31,26:s},{12:i,25:33,26:s},{12:[2,18]},{12:i,25:34,26:s},{12:[2,19]},{12:[2,21]}],defaultActions:{9:[2,1],21:[2,2],23:[2,11],24:[2,17],25:[2,12],26:[2,13],27:[2,14],28:[2,15],31:[2,18],33:[2,19],34:[2,21]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],a=[null],i=[],s=this.table,o="",u=0,l=0,c=0,d=1,h=i.slice.call(arguments,1),f=Object.create(this.lexer),_={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(_.yy[p]=this.yy[p]);f.setInput(t,_.yy),_.yy.lexer=f,_.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var m=f.yylloc;i.push(m);var y=f.options&&f.options.ranges;"function"==typeof _.yy.parseError?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,v,M,k,b,L,w,x,D,Y,T={};;){if(M=n[n.length-1],this.defaultActions[M]?k=this.defaultActions[M]:(null==g&&(Y=void 0,"number"!=typeof(Y=r.pop()||f.lex()||d)&&(Y instanceof Array&&(Y=(r=Y).pop()),Y=e.symbols_[Y]||Y),g=Y),k=s[M]&&s[M][g]),void 0===k||!k.length||!k[0]){var A="";for(L in D=[],s[M])this.terminals_[L]&&2e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,d={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot","\t":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr","ª":"ordf","á":"aacute","Á":"Aacute","à":"agrave","À":"Agrave","ă":"abreve","Ă":"Abreve","â":"acirc","Â":"Acirc","å":"aring","Å":"angst","ä":"auml","Ä":"Auml","ã":"atilde","Ã":"Atilde","ą":"aogon","Ą":"Aogon","ā":"amacr","Ā":"Amacr","æ":"aelig","Æ":"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf","ℬ":"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf","ℭ":"Cfr","𝒞":"Cscr","ℂ":"Copf","ć":"cacute","Ć":"Cacute","ĉ":"ccirc","Ĉ":"Ccirc","č":"ccaron","Č":"Ccaron","ċ":"cdot","Ċ":"Cdot","ç":"ccedil","Ç":"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf","ď":"dcaron","Ď":"Dcaron","đ":"dstrok","Đ":"Dstrok","ð":"eth","Ð":"ETH","ⅇ":"ee","ℯ":"escr","𝔢":"efr","𝕖":"eopf","ℰ":"Escr","𝔈":"Efr","𝔼":"Eopf","é":"eacute","É":"Eacute","è":"egrave","È":"Egrave","ê":"ecirc","Ê":"Ecirc","ě":"ecaron","Ě":"Ecaron","ë":"euml","Ë":"Euml","ė":"edot","Ė":"Edot","ę":"eogon","Ę":"Eogon","ē":"emacr","Ē":"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf","ℱ":"Fscr","ff":"fflig","ffi":"ffilig","ffl":"ffllig","fi":"filig",fj:"fjlig","fl":"fllig","ƒ":"fnof","ℊ":"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr","ǵ":"gacute","ğ":"gbreve","Ğ":"Gbreve","ĝ":"gcirc","Ĝ":"Gcirc","ġ":"gdot","Ġ":"Gdot","Ģ":"Gcedil","𝔥":"hfr","ℎ":"planckh","𝒽":"hscr","𝕙":"hopf","ℋ":"Hscr","ℌ":"Hfr","ℍ":"Hopf","ĥ":"hcirc","Ĥ":"Hcirc","ℏ":"hbar","ħ":"hstrok","Ħ":"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf","ℐ":"Iscr","ℑ":"Im","í":"iacute","Í":"Iacute","ì":"igrave","Ì":"Igrave","î":"icirc","Î":"Icirc","ï":"iuml","Ï":"Iuml","ĩ":"itilde","Ĩ":"Itilde","İ":"Idot","į":"iogon","Į":"Iogon","ī":"imacr","Ī":"Imacr","ij":"ijlig","IJ":"IJlig","ı":"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf","ĵ":"jcirc","Ĵ":"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr","ķ":"kcedil","Ķ":"Kcedil","𝔩":"lfr","𝓁":"lscr","ℓ":"ell","𝕝":"lopf","ℒ":"Lscr","𝔏":"Lfr","𝕃":"Lopf","ĺ":"lacute","Ĺ":"Lacute","ľ":"lcaron","Ľ":"Lcaron","ļ":"lcedil","Ļ":"Lcedil","ł":"lstrok","Ł":"Lstrok","ŀ":"lmidot","Ŀ":"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf","ℳ":"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr","ℕ":"Nopf","𝒩":"Nscr","𝔑":"Nfr","ń":"nacute","Ń":"Nacute","ň":"ncaron","Ň":"Ncaron","ñ":"ntilde","Ñ":"Ntilde","ņ":"ncedil","Ņ":"Ncedil","№":"numero","ŋ":"eng","Ŋ":"ENG","𝕠":"oopf","𝔬":"ofr","ℴ":"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf","º":"ordm","ó":"oacute","Ó":"Oacute","ò":"ograve","Ò":"Ograve","ô":"ocirc","Ô":"Ocirc","ö":"ouml","Ö":"Ouml","ő":"odblac","Ő":"Odblac","õ":"otilde","Õ":"Otilde","ø":"oslash","Ø":"Oslash","ō":"omacr","Ō":"Omacr","œ":"oelig","Œ":"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf","ℙ":"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr","ℚ":"Qopf","ĸ":"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr","ℛ":"Rscr","ℜ":"Re","ℝ":"Ropf","ŕ":"racute","Ŕ":"Racute","ř":"rcaron","Ř":"Rcaron","ŗ":"rcedil","Ŗ":"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS","ś":"sacute","Ś":"Sacute","ŝ":"scirc","Ŝ":"Scirc","š":"scaron","Š":"Scaron","ş":"scedil","Ş":"Scedil","ß":"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf","ť":"tcaron","Ť":"Tcaron","ţ":"tcedil","Ţ":"Tcedil","™":"trade","ŧ":"tstrok","Ŧ":"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr","ú":"uacute","Ú":"Uacute","ù":"ugrave","Ù":"Ugrave","ŭ":"ubreve","Ŭ":"Ubreve","û":"ucirc","Û":"Ucirc","ů":"uring","Ů":"Uring","ü":"uuml","Ü":"Uuml","ű":"udblac","Ű":"Udblac","ũ":"utilde","Ũ":"Utilde","ų":"uogon","Ų":"Uogon","ū":"umacr","Ū":"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr","ŵ":"wcirc","Ŵ":"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf","ý":"yacute","Ý":"Yacute","ŷ":"ycirc","Ŷ":"Ycirc","ÿ":"yuml","Ÿ":"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf","ℨ":"Zfr","ℤ":"Zopf","𝒵":"Zscr","ź":"zacute","Ź":"Zacute","ž":"zcaron","Ž":"Zcaron","ż":"zdot","Ż":"Zdot","Ƶ":"imped","þ":"thorn","Þ":"THORN","ʼn":"napos","α":"alpha","Α":"Alpha","β":"beta","Β":"Beta","γ":"gamma","Γ":"Gamma","δ":"delta","Δ":"Delta","ε":"epsi","ϵ":"epsiv","Ε":"Epsilon","ϝ":"gammad","Ϝ":"Gammad","ζ":"zeta","Ζ":"Zeta","η":"eta","Η":"Eta","θ":"theta","ϑ":"thetav","Θ":"Theta","ι":"iota","Ι":"Iota","κ":"kappa","ϰ":"kappav","Κ":"Kappa","λ":"lambda","Λ":"Lambda","μ":"mu","µ":"micro","Μ":"Mu","ν":"nu","Ν":"Nu","ξ":"xi","Ξ":"Xi","ο":"omicron","Ο":"Omicron","π":"pi","ϖ":"piv","Π":"Pi","ρ":"rho","ϱ":"rhov","Ρ":"Rho","σ":"sigma","Σ":"Sigma","ς":"sigmaf","τ":"tau","Τ":"Tau","υ":"upsi","Υ":"Upsilon","ϒ":"Upsi","φ":"phi","ϕ":"phiv","Φ":"Phi","χ":"chi","Χ":"Chi","ψ":"psi","Ψ":"Psi","ω":"omega","Ω":"ohm","а":"acy","А":"Acy","б":"bcy","Б":"Bcy","в":"vcy","В":"Vcy","г":"gcy","Г":"Gcy","ѓ":"gjcy","Ѓ":"GJcy","д":"dcy","Д":"Dcy","ђ":"djcy","Ђ":"DJcy","е":"iecy","Е":"IEcy","ё":"iocy","Ё":"IOcy","є":"jukcy","Є":"Jukcy","ж":"zhcy","Ж":"ZHcy","з":"zcy","З":"Zcy","ѕ":"dscy","Ѕ":"DScy","и":"icy","И":"Icy","і":"iukcy","І":"Iukcy","ї":"yicy","Ї":"YIcy","й":"jcy","Й":"Jcy","ј":"jsercy","Ј":"Jsercy","к":"kcy","К":"Kcy","ќ":"kjcy","Ќ":"KJcy","л":"lcy","Л":"Lcy","љ":"ljcy","Љ":"LJcy","м":"mcy","М":"Mcy","н":"ncy","Н":"Ncy","њ":"njcy","Њ":"NJcy","о":"ocy","О":"Ocy","п":"pcy","П":"Pcy","р":"rcy","Р":"Rcy","с":"scy","С":"Scy","т":"tcy","Т":"Tcy","ћ":"tshcy","Ћ":"TSHcy","у":"ucy","У":"Ucy","ў":"ubrcy","Ў":"Ubrcy","ф":"fcy","Ф":"Fcy","х":"khcy","Х":"KHcy","ц":"tscy","Ц":"TScy","ч":"chcy","Ч":"CHcy","џ":"dzcy","Џ":"DZcy","ш":"shcy","Ш":"SHcy","щ":"shchcy","Щ":"SHCHcy","ъ":"hardcy","Ъ":"HARDcy","ы":"ycy","Ы":"Ycy","ь":"softcy","Ь":"SOFTcy","э":"ecy","Э":"Ecy","ю":"yucy","Ю":"YUcy","я":"yacy","Я":"YAcy","ℵ":"aleph","ℶ":"beth","ℷ":"gimel","ℸ":"daleth"},h=/["&'<>`]/g,r={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},a=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,f=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)([=a-zA-Z0-9])?/g,m={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"},y={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"},s={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},_=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],p=String.fromCharCode,g={}.hasOwnProperty,v=function(t,e){return g.call(t,e)},M=function(t,e){if(!t)return e;var n,r={};for(n in e)r[n]=v(t,n)?t[n]:e[n];return r},k=function(t,e){var n="";return 55296<=t&&t<=57343||1114111>>10&1023|55296),t=56320|1023&t),n+=p(t))},b=function(t){return"&#x"+t.toString(16).toUpperCase()+";"},L=function(t){return"&#"+t+";"},w=function(t){throw Error("Parse error: "+t)},x=function(t,e){(e=M(e,x.options)).strict&&f.test(t)&&w("forbidden code point");var n=e.encodeEverything,r=e.useNamedReferences,a=e.allowUnsafeSymbols,i=e.decimal?L:b,s=function(t){return i(t.charCodeAt(0))};return n?(t=t.replace(u,function(t){return r&&v(d,t)?"&"+d[t]+";":s(t)}),r&&(t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),r&&(t=t.replace(c,function(t){return"&"+d[t]+";"}))):r?(a||(t=t.replace(h,function(t){return"&"+d[t]+";"})),t=(t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒")).replace(c,function(t){return"&"+d[t]+";"})):a||(t=t.replace(h,s)),t.replace(o,function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1);return i(1024*(e-55296)+n-56320+65536)}).replace(l,s)};x.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var D=function(t,_){var p=(_=M(_,D.options)).strict;return p&&a.test(t)&&w("malformed character reference"),t.replace(i,function(t,e,n,r,a,i,s,o){var u,l,c,d,h,f;return e?(c=e,l=n,p&&!l&&w("character reference was not terminated by a semicolon"),u=parseInt(c,10),k(u,p)):r?(d=r,l=a,p&&!l&&w("character reference was not terminated by a semicolon"),u=parseInt(d,16),k(u,p)):i?v(m,h=i)?m[h]:(p&&w("named character reference was not terminated by a semicolon"),t):(h=s,(f=o)&&_.isAttributeValue?(p&&"="==f&&w("`&` did not start a character reference"),t):(p&&w("named character reference was not terminated by a semicolon"),y[h]+(f||"")))})};D.options={isAttributeValue:!1,strict:!1};var Y={version:"1.1.1",encode:x,decode:D,escape:function(t){return t.replace(h,function(t){return r[t]})},unescape:D};void 0===(S=function(){return Y}.call(E,j,E,T))||(T.exports=S)}()}).call(E,j(3)(t),j(18))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeEntities=e.encodeEntities=e.version=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=n(1),f=E(n(157)),_=E(n(158)),p=E(n(208)),m=E(n(222)),y=E(n(224)),r=E(n(171)),a=E(n(160)),s=E(n(161)),o=E(n(168)),u=E(n(169)),l=E(n(170)),g=E(n(225)),c=E(n(172)),d=E(n(173)),v=E(n(174)),M=E(n(226)),k=E(n(175)),b=E(n(176)),L=E(n(227)),w=E(n(201)),x=E(n(6)),D=E(n(203)),Y=E(n(346)),T=E(n(348)),A=E(n(350)),S=E(n(352));function E(t){return t&&t.__esModule?t:{default:t}}var j={dark:Y.default,default:T.default,forest:A.default,neutral:S.default},C={theme:T.default,logLevel:5,startOnLoad:!0,arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequenceDiagram:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:3,axisFormatter:[["%I:%M",function(t){return t.getHours()}],["w. %U",function(t){return 1===t.getDay()}],["%a %d",function(t){return t.getDay()&&1!==t.getDate()}],["%b %d",function(t){return 1!==t.getDate()}],["%m-%y",function(t){return t.getMonth()}]]},classDiagram:{},gitGraph:{},info:{}};(0,h.setLogLevel)(C.logLevel);var F=e.version=function(){return D.default.version},O=e.encodeEntities=function(t){var e=t;return e=(e=(e=e.replace(/style.*:\S*#.*;/g,function(t){return t.substring(0,t.length-1)})).replace(/classDef.*:\S*#.*;/g,function(t){return t.substring(0,t.length-1)})).replace(/#\w+;/g,function(t){var e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})},H=e.decodeEntities=function(t){var e=t;return e=(e=(e=e.replace(/fl°°/g,function(){return"&#"})).replace(/fl°/g,function(){return"&"})).replace(/¶ß/g,function(){return";"})},P=function(t,e,n,r){if(void 0!==r)r.innerHTML="",x.default.select(r).append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g");else{var a=document.querySelector("#d"+t);a&&(a.innerHTML=""),x.default.select("body").append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g")}window.txt=e,e=O(e);var i=x.default.select("#d"+t).node();switch(_.default.detectType(e)){case"gitGraph":C.flowchart.arrowMarkerAbsolute=C.arrowMarkerAbsolute,L.default.setConf(C.gitGraph),L.default.draw(e,t,!1);break;case"graph":C.flowchart.arrowMarkerAbsolute=C.arrowMarkerAbsolute,p.default.setConf(C.flowchart),p.default.draw(e,t,!1);break;case"dotGraph":C.flowchart.arrowMarkerAbsolute=C.arrowMarkerAbsolute,p.default.setConf(C.flowchart),p.default.draw(e,t,!0);break;case"sequenceDiagram":C.sequenceDiagram.arrowMarkerAbsolute=C.arrowMarkerAbsolute,m.default.setConf(C.sequenceDiagram),m.default.draw(e,t);break;case"gantt":C.gantt.arrowMarkerAbsolute=C.arrowMarkerAbsolute,g.default.setConf(C.gantt),g.default.draw(e,t);break;case"classDiagram":C.classDiagram.arrowMarkerAbsolute=C.arrowMarkerAbsolute,M.default.setConf(C.classDiagram),M.default.draw(e,t);break;case"info":C.info.arrowMarkerAbsolute=C.arrowMarkerAbsolute,y.default.draw(e,t,F())}var s=i.firstChild,o=document.createElement("style"),u=window.getComputedStyle(s);o.innerHTML="\n "+(j[C.theme]||T.default)+"\nsvg {\n color: "+u.color+";\n font: "+u.font+";\n}\n ",s.insertBefore(o,s.firstChild),x.default.select("#d"+t).selectAll("foreignobject div").attr("xmlns","http://www.w3.org/1999/xhtml");var l="";C.arrowMarkerAbsolute&&(l=(l=(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)"));var c=x.default.select("#d"+t).node().innerHTML.replace(/url\(#arrowhead/g,"url("+l+"#arrowhead","g");c=H(c),void 0!==n?n(c,f.default.bindFunctions):h.logger.warn("CB = undefined!");var d=x.default.select("#d"+t).node();return null!==d&&"function"==typeof d.remove&&x.default.select("#d"+t).node().remove(),c};var B=function(t){for(var e=Object.keys(t),n=0;n'});else{for(var s=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.split(/
/),u=0;u'+t.text+""):(e.labelType="text",e.style="stroke: #333; stroke-width: 1.5px;fill:none",e.label=t.text.replace(/
/g,"\n"))):e.label=t.text.replace(/
/g,"\n")),a.setEdge(t.start,t.end,e,i)})},i=e.getClasses=function(t,e){var n=void 0;Y.default.clear(),(n=e?A.default.parser:T.default.parser).yy=Y.default,n.parse(t);var r=Y.default.getClasses();return void 0===r.default&&(r.default={id:"default"},r.default.styles=[],r.default.clusterStyles=["rx:4px","fill: rgb(255, 255, 222)","rx: 4px","stroke: rgb(170, 170, 51)","stroke-width: 1px"],r.default.nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],r.default.edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),r},s=e.draw=function(t,e,n){j.logger.debug("Drawing flowchart");var r=void 0;Y.default.clear(),(r=n?A.default.parser:T.default.parser).yy=Y.default;try{r.parse(t)}catch(t){j.logger.debug("Parsing failed")}var a=Y.default.getDirection();void 0===a&&(a="TD");for(var i=new E.default.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:a,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),s=void 0,o=Y.default.getSubGraphs(),u=o.length-1;0<=u;u--)s=o[u],Y.default.addVertex(s.id,s.title,"group",void 0);var l=Y.default.getVertices(),c=Y.default.getEdges(),d=0;for(d=o.length-1;0<=d;d--){s=o[d],S.default.selectAll("cluster").append("text");for(var h=0;hMath.abs(a)*o?(i<0&&(o=-o),u=0===i?0:o*a/i,l=o):(a<0&&(s=-s),u=s,l=0===a?0:s*i/a),{x:n+u,y:r+l}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(n(1)),i=r(n(11)),s=r(n(5)),o=r(n(12)),u=r(n(14)),l=r(n(0)),c=n(27);e.default={d3:a.default,graphlib:i.default,dagre:s.default,intersect:o.default,render:u.default,util:l.default,version:c.version}},function(t,e){t.exports=n(29)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(n(6)),i=r(n(7)),s=r(n(3)),o=r(n(8)),u=r(n(9));e.default={node:a.default,circle:i.default,ellipse:s.default,polygon:o.default,rect:u.default}},function(t,e,n){"use strict";function y(t,e){return 0g.width?(l.remove(),s=t.append("g"),c=(l=m.default.drawText(s,u,2*i.width-g.noteMargin))[0][0].getBBox().height,o.attr("width",2*i.width),v.insert(e,n,e+2*i.width,n+2*g.noteMargin+c)):v.insert(e,n,e+i.width,n+2*g.noteMargin+c),o.attr("height",c+2*g.noteMargin),v.bumpVerticalPos(c+2*g.noteMargin)},k=e.drawActors=function(t,e,n,r){for(var a=0;an&&(r.starty=n-6,n+=12),m.default.drawActivation(d,r,n,g),v.insert(r.startx,n-10,r.stopx,n);break;case y.parser.yy.LINETYPE.LOOP_START:v.bumpVerticalPos(g.boxMargin),v.newLoop(t.message),v.bumpVerticalPos(g.boxMargin+g.boxTextMargin);break;case y.parser.yy.LINETYPE.LOOP_END:a=v.endLoop(),m.default.drawLoop(d,a,"loop",g),v.bumpVerticalPos(g.boxMargin);break;case y.parser.yy.LINETYPE.OPT_START:v.bumpVerticalPos(g.boxMargin),v.newLoop(t.message),v.bumpVerticalPos(g.boxMargin+g.boxTextMargin);break;case y.parser.yy.LINETYPE.OPT_END:a=v.endLoop(),m.default.drawLoop(d,a,"opt",g),v.bumpVerticalPos(g.boxMargin);break;case y.parser.yy.LINETYPE.ALT_START:v.bumpVerticalPos(g.boxMargin),v.newLoop(t.message),v.bumpVerticalPos(g.boxMargin+g.boxTextMargin);break;case y.parser.yy.LINETYPE.ALT_ELSE:v.bumpVerticalPos(g.boxMargin),a=v.addSectionToLoop(t.message),v.bumpVerticalPos(g.boxMargin);break;case y.parser.yy.LINETYPE.ALT_END:a=v.endLoop(),m.default.drawLoop(d,a,"alt",g),v.bumpVerticalPos(g.boxMargin);break;case y.parser.yy.LINETYPE.PAR_START:v.bumpVerticalPos(g.boxMargin),v.newLoop(t.message),v.bumpVerticalPos(g.boxMargin+g.boxTextMargin);break;case y.parser.yy.LINETYPE.PAR_AND:v.bumpVerticalPos(g.boxMargin),a=v.addSectionToLoop(t.message),v.bumpVerticalPos(g.boxMargin);break;case y.parser.yy.LINETYPE.PAR_END:a=v.endLoop(),m.default.drawLoop(d,a,"par",g),v.bumpVerticalPos(g.boxMargin);break;default:try{v.bumpVerticalPos(g.messageMargin);var i=b(t.from),s=b(t.to),o=i[0]<=s[0]?1:0,u=i[0]/gi," "),a=t.append("text");a.attr("x",e.x),a.attr("y",e.y),a.style("text-anchor",e.anchor),a.attr("fill",e.fill),void 0!==e.class&&a.attr("class",e.class);var i=a.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.attr("fill",e.fill),i.text(r),void 0!==a.textwrap&&a.textwrap({x:e.x,y:e.y,width:n,height:1800},e.textMargin),a},o=e.drawLabel=function(t,e){var n,r,a,i,s,o=t.append("polygon");o.attr("points",(n=e.x,r=e.y,n+","+r+" "+(n+(a=50))+","+r+" "+(n+a)+","+(r+(i=20)-(s=7))+" "+(n+a-1.2*s)+","+(r+i)+" "+n+","+(r+i))),o.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,l(t,e)},c=-1,r=e.drawActor=function(t,e,n,r,a){var i=e+a.width/2,s=t.append("g");0===n&&(c++,s.append("line").attr("id","actor"+c).attr("x1",i).attr("y1",5).attr("x2",i).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));var o=_();o.x=e,o.y=n,o.fill="#eaeaea",o.width=a.width,o.height=a.height,o.class="actor",o.rx=3,o.ry=3,u(s,o),p(a)(r,s,o.x,o.y,o.width,o.height,{class:"actor"})},a=e.anchorElement=function(t){return t.append("g")},i=e.drawActivation=function(t,e,n){var r=_(),a=e.anchored;r.x=e.startx,r.y=e.starty,r.fill="#f4f4f4",r.width=e.stopx-e.startx,r.height=n-e.starty,u(a,r)},s=e.drawLoop=function(t,n,e,r){var a=t.append("g"),i=function(t,e,n,r){return a.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("class","loopLine")};i(n.startx,n.starty,n.stopx,n.starty),i(n.stopx,n.starty,n.stopx,n.stopy),i(n.startx,n.stopy,n.stopx,n.stopy),i(n.startx,n.starty,n.startx,n.stopy),void 0!==n.sections&&n.sections.forEach(function(t){i(n.startx,t,n.stopx,t).style("stroke-dasharray","3, 3")});var s=f();s.text=e,s.x=n.startx,s.y=n.starty,s.labelMargin=15,s.class="labelText",o(a,s),(s=f()).text="[ "+n.title+" ]",s.x=n.startx+(n.stopx-n.startx)/2,s.y=n.starty+1.5*r.boxMargin,s.anchor="middle",s.class="loopText",l(a,s),void 0!==n.sectionTitles&&n.sectionTitles.forEach(function(t,e){""!==t&&(s.text="[ "+t+" ]",s.y=n.sections[e]+1.5*r.boxMargin,l(a,s))})},d=e.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},h=e.insertArrowCrossHead=function(t){var e=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);e.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),e.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},f=e.getTextObj=function(){return{x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0}},_=e.getNoteRect=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},p=function(){function e(t,e,n,r,a,i,s){c(e.append("text").attr("x",n+a/2).attr("y",r+i/2+5).style("text-anchor","middle").text(t),s)}function l(t,e,n,r,a,i,s){var o=e.append("text").attr("x",n+a/2).attr("y",r).style("text-anchor","middle");if(o.append("tspan").attr("x",n+a/2).attr("dy","0").text(t),void 0!==o.textwrap){o.textwrap({x:n+a/2,y:r,width:a,height:i},0);var u=o.selectAll("tspan");0o?e+a-5:n+a+5:(n-e)/2+e+a}).attr("y",function(t,e){return e*n+y.barHeight/2+(y.fontSize/2-2)+r}).attr("text-height",e).attr("class",function(t){for(var e=h(t.startTime),n=h(t.endTime),r=this.getBBox().width,a=0,i=0;io?"taskTextOutsideLeft taskTextOutside"+a+" "+s:"taskTextOutsideRight taskTextOutside"+a+" "+s:"taskText taskText"+a+" "+s})}(t,a,i,s,r,0,e),function(r,a){for(var i=[],s=0,t=0;t "+t.w+": "+JSON.stringify(a.edge(t))),function(t,e,n){var r=function(t){switch(t){case y.default.relationType.AGGREGATION:return"aggregation";case y.default.relationType.EXTENSION:return"extension";case y.default.relationType.COMPOSITION:return"composition";case y.default.relationType.DEPENDENCY:return"dependency"}},a=e.points,i=g.default.svg.line().x(function(t){return t.x}).y(function(t){return t.y}).interpolate("basis"),s=t.append("path").attr("d",i(a)).attr("id","edge"+M).attr("class","relation"),o="";v.arrowMarkerAbsolute&&(o=(o=(o=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),"none"!==n.relation.type1&&s.attr("marker-start","url("+o+"#"+r(n.relation.type1)+"Start)"),"none"!==n.relation.type2&&s.attr("marker-end","url("+o+"#"+r(n.relation.type2)+"End)");var u=void 0,l=void 0,c=e.points.length;if(c%2!=0){var d=e.points[Math.floor(c/2)],h=e.points[Math.ceil(c/2)];u=(d.x+h.x)/2,l=(d.y+h.y)/2}else{var f=e.points[Math.floor(c/2)];u=f.x,l=f.y}if(void 0!==n.title){var _=t.append("g").attr("class","classLabel"),p=_.append("text").attr("class","label").attr("x",u).attr("y",l).attr("fill","red").attr("text-anchor","middle").text(n.title),m=(window.label=p).node().getBBox();_.insert("rect",":first-child").attr("class","box").attr("x",m.x-v.padding/2).attr("y",m.y-v.padding/2).attr("width",m.width+v.padding).attr("height",m.height+v.padding)}M++}(r,a.edge(t),a.edge(t).relation)}),r.attr("height","100%"),r.attr("width","100%"),r.attr("viewBox","0 0 "+(a.graph().width+20)+" "+(a.graph().height+20))};e.default={setConf:a,draw:i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.draw=e.setConf=void 0;var u=r(n(177)),l=r(n(245)),c=r(n(2)),d=r(n(265)),h=r(n(327)),f=r(n(201)),_=r(n(176)),p=r(n(6)),m=n(1);function r(t){return t&&t.__esModule?t:{default:t}}var y={},g=void 0,v={nodeSpacing:150,nodeFillColor:"yellow",nodeStrokeWidth:2,nodeStrokeColor:"grey",lineStrokeWidth:4,branchOffset:50,lineColor:"grey",leftMargin:50,branchColors:["#442f74","#983351","#609732","#AA9A39"],nodeRadius:10,nodeLabel:{width:75,height:100,x:-25,y:0}},M={},a=e.setConf=function(t){M=t};function k(t,e,n,r){r=r||"basis";var a=v.branchColors[n%v.branchColors.length],i=p.default.svg.line().x(function(t){return Math.round(t.x)}).y(function(t){return Math.round(t.y)}).interpolate(r);t.append("svg:path").attr("d",i(e)).style("stroke",a).style("stroke-width",v.lineStrokeWidth).style("fill","none")}function b(t,e){e=e||t.node().getBBox();var n=t.node().getCTM();return{left:n.e+e.x*n.a,top:n.f+e.y*n.d,width:e.width,height:e.height}}function L(t,e,n,r,a){m.logger.debug("svgDrawLineForCommits: ",e,n);var i=b(t.select("#node-"+e+" circle")),s=b(t.select("#node-"+n+" circle"));switch(r){case"LR":if(i.left-s.left>v.nodeSpacing){var o={x:i.left-v.nodeSpacing,y:s.top+s.height/2};k(t,[o,{x:s.left+s.width,y:s.top+s.height/2}],a,"linear"),k(t,[{x:i.left,y:i.top+i.height/2},{x:i.left-v.nodeSpacing/2,y:i.top+i.height/2},{x:i.left-v.nodeSpacing/2,y:o.y},o],a)}else k(t,[{x:i.left,y:i.top+i.height/2},{x:i.left-v.nodeSpacing/2,y:i.top+i.height/2},{x:i.left-v.nodeSpacing/2,y:s.top+s.height/2},{x:s.left+s.width,y:s.top+s.height/2}],a);break;case"BT":if(s.top-i.top>v.nodeSpacing){var u={x:s.left+s.width/2,y:i.top+i.height+v.nodeSpacing};k(t,[u,{x:s.left+s.width/2,y:s.top}],a,"linear"),k(t,[{x:i.left+i.width/2,y:i.top+i.height},{x:i.left+i.width/2,y:i.top+i.height+v.nodeSpacing/2},{x:s.left+s.width/2,y:u.y-v.nodeSpacing/2},u],a)}else k(t,[{x:i.left+i.width/2,y:i.top+i.height},{x:i.left+i.width/2,y:i.top+v.nodeSpacing/2},{x:s.left+s.width/2,y:s.top-v.nodeSpacing/2},{x:s.left+s.width/2,y:s.top}],a)}}var i=e.draw=function(t,e,n){try{var r=_.default.parser;r.yy=f.default,m.logger.debug("in gitgraph renderer",t,e,n),r.parse(t+"\n"),v=(0,l.default)(v,M,f.default.getOptions()),m.logger.debug("effective options",v);var a=f.default.getDirection();y=f.default.getCommits();var i=f.default.getBranchesAsObjArray();"BT"===a&&(v.nodeLabel.x=i.length*v.branchOffset,v.nodeLabel.width="100%",v.nodeLabel.y=-2*v.nodeRadius);var s=p.default.select("#"+e);(o=s).append("defs").append("g").attr("id","def-commit").append("circle").attr("r",v.nodeRadius).attr("cx",0).attr("cy",0),o.select("#def-commit").append("foreignObject").attr("width",v.nodeLabel.width).attr("height",v.nodeLabel.height).attr("x",v.nodeLabel.x).attr("y",v.nodeLabel.y).attr("class","node-label").attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").append("xhtml:p").html(""),g=1,(0,u.default)(i,function(t){!function t(e,n,r,a){var i=void 0,s=Object.keys(y).length;if((0,h.default)(n))do{if(i=y[n],m.logger.debug("in renderCommitHistory",i.id,i.seq),0=i)return arguments[0]}else r=0;return n.apply(void 0,arguments)}}},function(t,e,n){var a=n(22),i=n(13),s=n(31),o=n(14);t.exports=function(t,e,n){if(!o(n))return!1;var r=typeof e;return!!("number"==r?i(n)&&s(e,n.length):"string"==r&&e in n)&&a(n[e],t)}},function(t,e,n){var r=n(179),a=n(263),i=n(13);t.exports=function(t){return i(t)?r(t,!0):a(t)}},function(t,e,n){var a=n(14),i=n(185),s=n(264),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!a(t))return s(t);var e=i(t),n=[];for(var r in t)("constructor"!=r||!e&&o.call(t,r))&&n.push(r);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var r=n(266)(n(323));t.exports=r},function(t,e,n){var o=n(15),u=n(13),l=n(20);t.exports=function(s){return function(t,e,n){var r=Object(t);if(!u(t)){var a=o(e,3);t=l(t),e=function(t){return a(r[t],t,r)}}var i=s(t,e,n);return-1 + +
+ +
+
+ + + +
+
+ +
+ \ No newline at end of file diff --git a/GraphEditor/build/release/GraphEditor.zip b/GraphEditor/build/release/GraphEditor.zip new file mode 100644 index 0000000..fa12cd6 Binary files /dev/null and b/GraphEditor/build/release/GraphEditor.zip differ diff --git a/GraphEditor/coffees/main.coffee b/GraphEditor/coffees/main.coffee new file mode 100644 index 0000000..2f563c9 --- /dev/null +++ b/GraphEditor/coffees/main.coffee @@ -0,0 +1,264 @@ +# Copyright 2017-2018 Xuan Sang LE + +# AnTOS Web desktop is is licensed under the GNU General Public +# License v3.0, see the LICENCE file for more information + +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +#along with this program. If not, see https://www.gnu.org/licenses/. +class GraphEditor extends this.OS.GUI.BaseApplication + constructor: ( args ) -> + super "GraphEditor", args + + main: () -> + me = @ + #mermaid.initialize { startOnLoad: false } + mermaid.initialize { + theme: 'forest' + } + @currfile = if @args and @args.length > 0 then @args[0].asFileHandler() else "Untitled".asFileHandler() + @currfile.dirty = false + @datarea = @find "datarea" + @preview = @find "preview" + @btctn = @find "btn-container" + @.editor = ace.edit @datarea + @.editor.setOptions { + enableBasicAutocompletion: true, + enableLiveAutocompletion: true, + fontSize: "10pt" + } + #@.editor.completers.push { getCompletions: ( editor, session, pos, prefix, callback ) -> } + @editor.getSession().setUseWrapMode true + @editor.session.setMode "ace/mode/text" + @editor.setTheme "ace/theme/monokai" + @editor.on "input", () -> + if me.editormux + me.editormux = false + return false + if not me.currfile.dirty + me.currfile.dirty = true + + + if not me.currfile.basename + me.editormux = true + me.editor.setValue GraphEditor.dummymermaid + me.renderSVG false + + + @editor.container.addEventListener "keydown", (e) -> + me.renderSVG true if e.keyCode is 13 + , true + + @bindKey "CTRL-R", () -> me.renderSVG false + @bindKey "ALT-G", () -> me.export "SVG" + @bindKey "ALT-P", () -> me.export "PNG" + @bindKey "ALT-N", () -> me.actionFile "#{me.name}-New" + @bindKey "ALT-O", () -> me.actionFile "#{me.name}-Open" + @bindKey "CTRL-S", () -> me.actionFile "#{me.name}-Save" + @bindKey "ALT-W", () -> me.actionFile "#{me.name}-Saveas" + @bindKey "CTRL-M", () -> me.svgToCanvas(()->) + + @on "hboxchange", () -> + me.editor.resize() + me.calibrate() + @on "focus", () -> me.editor.focus() + (@find "btn-zoomin").set "onbtclick", (e) -> + me.pan.zoomIn() if me.pan + (@find "btn-zoomout").set "onbtclick", (e) -> + me.pan.zoomOut() if me.pan + (@find "btn-reset").set "onbtclick", (e) -> + me.pan.resetZoom() if me.pan + + @open @currfile + + menu: () -> + me = @ + menu = [{ + text: "__(File)", + child: [ + { text: "__(New)", dataid: "#{@name}-New", shortcut: "A-N" }, + { text: "__(Open)", dataid: "#{@name}-Open", shortcut: "A-O" }, + { text: "__(Save)", dataid: "#{@name}-Save", shortcut: "C-S" }, + { text: "__(Save as)",dataid: "#{@name}-Saveas" , shortcut: "A-W" }, + { text: "__(Render)", dataid: "#{@name}-Render", shortcut: "C-R" }, + { + text: "__(Export as)", + child: [ + { text: "SVG", shortcut: "A-G" }, + { text: "PNG", shortcut: "A-P" } + ], + onmenuselect: (e) -> me.export e.item.data.text + }, + ], + onmenuselect: (e) -> me.actionFile e.item.data.dataid + }] + menu + open: (file) -> + return if file.path is "Untitled" + me = @ + file.dirty = false + file.read (d) -> + me.currfile = file + me.editormux = true + me.currfile.dirty = false + me.editor.setValue d + me.scheme.set "apptitle", "#{me.currfile.basename}" + me.renderSVG false + save: (file) -> + me = @ + file.write "text/plain", (d) -> + return me.error __("Error saving file {0}", file.basename) if d.error + file.dirty = false + file.text = file.basename + me.scheme.set "apptitle", "#{me.currfile.basename}" + + actionFile: (e) -> + me = @ + saveas = () -> + me.openDialog "FileDiaLog", (d, n) -> + me.currfile.setPath "#{d}/#{n}" + me.save me.currfile + , __("Save as"), { file: me.currfile } + switch e + when "#{@name}-Open" + @openDialog "FileDiaLog", ( d, f ) -> + me.open "#{d}/#{f}".asFileHandler() + , __("Open file") + when "#{@name}-Save" + @currfile.cache = @editor.getValue() + return @save @currfile if @currfile.basename + saveas() + when "#{@name}-Saveas" + @currfile.cache = @editor.getValue() + saveas() + when "#{@name}-Render" + me.renderSVG false + when "#{@name}-New" + @currfile = "Untitled".asFileHandler() + @currfile.cache = "" + @currfile.dirty = false + @editormux = true + @editor.setValue("") + + export: (t) -> + me = @ + me.openDialog "FileDiaLog", (d, n) -> + fp = "#{d}/#{n}".asFileHandler() + try + switch t + when "SVG" + fp.cache = me.svgtext() + fp.write "text/plain", (r) -> + return me.error __("Cannot export to {0}: {1}", t, r.error) if r.error + me.notify __("File exported") + when "PNG" + # toDataURL("image/png") + me.svgToCanvas (canvas) -> + try + fp.cache = canvas.toDataURL "image/png" + fp.write "base64", (r) -> + return me.error __("Cannot export to {0}: {1}", t, r.error) if r.error + me.notify __("File exported") + catch e + me.error __("Cannot export to PNG in this browser: {0}", e.message) + catch e + me.error __("Cannot export: {0}", e.message) + , __("Export as"), { file: me.currfile } + + + renderSVG: (silent) -> + me = @ + id = Math.floor(Math.random() * 100000) + 1 + #if silent + # mermaid.parseError = (e, h) -> + #else + # mermaid.parseError = (e, h) -> + # me.error e + text = @editor.getValue() + try + mermaid.parse text + catch e + me.error __("Syntax error: {0}", e.str) if not silent + return + mermaid.render "c#{id}", text, (text, f) -> + me.preview.innerHTML = text + $(me.preview).append me.btctn + me.calibrate() + svg = $(me.preview).children("svg")[0] + $(svg).attr("style", "") + me.pan = svgPanZoom svg, { + zoomEnabled: true, + controlIconsEnabled: false, + fit: true, + center: true, + minZoom: 0.1 + } + #rd $($.parseHTML text). + , me.preview + + svgtext: () -> + svg = $(@preview).children("svg")[0] + $("g.label",svg).each (i) -> + $(@) + .css("font-family","Ubuntu") + .css("font-size", "13px") + $("text", svg).each (j) -> + $(@) + .css("font-family","Ubuntu") + .css("font-size", "13px") + serializer = new XMLSerializer() + return serializer.serializeToString(svg) + + svgToCanvas: (f) -> + me = @ + img = new Image() + svgStr = @svgtext() + DOMURL = window.URL || window.webkitURL || window + svgBlob = new Blob [svgStr], { type: 'image/svg+xml;charset=utf-8' } + url = DOMURL.createObjectURL svgBlob + img.onload = () -> + canvas = me.find "offscreen" + canvas.width = img.width + canvas.height = img.height + canvas.getContext("2d").drawImage img, 0, 0, img.width, img.height + f(canvas) + img.src = url + + calibrate: () -> + svg = ($ @preview).children("svg")[0] + if svg + prs = [$(@preview).width(), $(@preview).height()] + $(svg).attr "width", prs[0] + "px" + $(svg).attr "height", prs[1] + "px" + + cleanup: (evt) -> + return unless @currfile + return unless @currfile.dirty + me = @ + evt.preventDefault() + @.openDialog "YesNoDialog", (d) -> + if d + me.currfile.dirty = false + me.quit() + , __("Quit"), { text: __("Quit without saving ?") } + +GraphEditor.dummymermaid = """ +graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +""" +GraphEditor.dependencies = [ + "ace/ace" +] +this.OS.register "GraphEditor", GraphEditor diff --git a/GraphEditor/css/main.css b/GraphEditor/css/main.css new file mode 100644 index 0000000..b1e78f8 --- /dev/null +++ b/GraphEditor/css/main.css @@ -0,0 +1,22 @@ +afx-app-window[data-id="graph_editor_win"] div[data-id="preview"] +{ + display: flex; + align-items: center; + justify-content: center; +} +afx-app-window[data-id="graph_editor_win"] afx-button button +{ + border-radius: 0; + padding-top:2px; + padding-bottom: 2px; +} +afx-app-window[data-id="graph_editor_win"] afx-resizer{ + background-color: transparent; +} +afx-app-window[data-id="graph_editor_win"] div[data-id="btn-container"]{ + background-color: transparent; + position: absolute; + bottom:10px; + right: 10px; + display: inline; +} diff --git a/GraphEditor/javascripts/mermaidAPI.min.js b/GraphEditor/javascripts/mermaidAPI.min.js new file mode 100644 index 0000000..b24ed70 --- /dev/null +++ b/GraphEditor/javascripts/mermaidAPI.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mermaid=e():t.mermaid=e()}("undefined"!=typeof self?self:this,function(){return function(n){var r={};function a(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,a),e.l=!0,e.exports}return a.m=n,a.c=r,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=204)}([function(t,e,qn){(function(Wn){var t;t=function(){"use strict";var t,a;function h(){return t.apply(null,arguments)}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function u(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function l(t){return void 0===t}function c(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function d(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function f(t,e){var n,r=[];for(n=0;n>>0,r=0;rLt(t)?(i=t+1,s=o-Lt(t)):(i=t,s=o),{year:i,dayOfYear:s}}function zt(t,e,n){var r,a,i=It(t.year(),e,n),s=Math.floor((t.dayOfYear()-i-1)/7)+1;return s<1?r=s+Wt(a=t.year()-1,e,n):s>Wt(t.year(),e,n)?(r=s-Wt(t.year(),e,n),a=t.year()+1):(a=t.year(),r=s),{week:r,year:a}}function Wt(t,e,n){var r=It(t,e,n),a=It(t+1,e,n);return(Lt(t)-r+a)/7}z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),j("week","w"),j("isoWeek","W"),H("week",5),H("isoWeek",5),ut("w",Z),ut("ww",Z,V),ut("W",Z),ut("WW",Z,V),ft(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=w(t)});z("d",0,"do","day"),z("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),z("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),z("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),j("day","d"),j("weekday","e"),j("isoWeekday","E"),H("day",11),H("weekday",11),H("isoWeekday",11),ut("d",Z),ut("e",Z),ut("E",Z),ut("dd",function(t,e){return e.weekdaysMinRegex(t)}),ut("ddd",function(t,e){return e.weekdaysShortRegex(t)}),ut("dddd",function(t,e){return e.weekdaysRegex(t)}),ft(["dd","ddd","dddd"],function(t,e,n,r){var a=n._locale.weekdaysParse(t,r,n._strict);null!=a?e.d=a:y(n).invalidWeekday=t}),ft(["d","e","E"],function(t,e,n,r){e[r]=w(t)});var qt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ut="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Vt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $t=st;var Gt=st;var Jt=st;function Zt(){function t(t,e){return e.length-t.length}var e,n,r,a,i,s=[],o=[],u=[],l=[];for(e=0;e<7;e++)n=m([2e3,1]).day(e),r=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),i=this.weekdays(n,""),s.push(r),o.push(a),u.push(i),l.push(r),l.push(a),l.push(i);for(s.sort(t),o.sort(t),u.sort(t),l.sort(t),e=0;e<7;e++)o[e]=ct(o[e]),u[e]=ct(u[e]),l[e]=ct(l[e]);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("^("+s.join("|")+")","i")}function Kt(){return this.hours()%12||12}function Xt(t,e){z(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Qt(t,e){return e._meridiemParse}z("H",["HH",2],0,"hour"),z("h",["hh",2],0,Kt),z("k",["kk",2],0,function(){return this.hours()||24}),z("hmm",0,0,function(){return""+Kt.apply(this)+P(this.minutes(),2)}),z("hmmss",0,0,function(){return""+Kt.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)}),z("Hmm",0,0,function(){return""+this.hours()+P(this.minutes(),2)}),z("Hmmss",0,0,function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)}),Xt("a",!0),Xt("A",!1),j("hour","h"),H("hour",13),ut("a",Qt),ut("A",Qt),ut("H",Z),ut("h",Z),ut("k",Z),ut("HH",Z,V),ut("hh",Z,V),ut("kk",Z,V),ut("hmm",K),ut("hmmss",X),ut("Hmm",K),ut("Hmmss",X),ht(["H","HH"],yt),ht(["k","kk"],function(t,e,n){var r=w(t);e[yt]=24===r?0:r}),ht(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),ht(["h","hh"],function(t,e,n){e[yt]=w(t),y(n).bigHour=!0}),ht("hmm",function(t,e,n){var r=t.length-2;e[yt]=w(t.substr(0,r)),e[gt]=w(t.substr(r)),y(n).bigHour=!0}),ht("hmmss",function(t,e,n){var r=t.length-4,a=t.length-2;e[yt]=w(t.substr(0,r)),e[gt]=w(t.substr(r,2)),e[vt]=w(t.substr(a)),y(n).bigHour=!0}),ht("Hmm",function(t,e,n){var r=t.length-2;e[yt]=w(t.substr(0,r)),e[gt]=w(t.substr(r))}),ht("Hmmss",function(t,e,n){var r=t.length-4,a=t.length-2;e[yt]=w(t.substr(0,r)),e[gt]=w(t.substr(r,2)),e[vt]=w(t.substr(a))});var te,ee=Yt("Hours",!0),ne={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:jt,monthsShort:Ct,week:{dow:0,doy:6},weekdays:qt,weekdaysMin:Vt,weekdaysShort:Ut,meridiemParse:/[ap]\.?m?\.?/i},re={},ae={};function ie(t){return t?t.toLowerCase().replace("_","-"):t}function se(t){var e=null;if(!re[t]&&void 0!==Wn&&Wn&&Wn.exports)try{e=te._abbr;qn(207)("./"+t),oe(e)}catch(t){}return re[t]}function oe(t,e){var n;return t&&(n=l(e)?le(t):ue(t,e))&&(te=n),te._abbr}function ue(t,e){if(null!==e){var n=ne;if(e.abbr=t,null!=re[t])Y("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."),n=re[t]._config;else if(null!=e.parentLocale){if(null==re[e.parentLocale])return ae[e.parentLocale]||(ae[e.parentLocale]=[]),ae[e.parentLocale].push({name:t,config:e}),null;n=re[e.parentLocale]._config}return re[t]=new S(A(n,e)),ae[t]&&ae[t].forEach(function(t){ue(t.name,t.config)}),oe(t),re[t]}return delete re[t],null}function le(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return te;if(!o(t)){if(e=se(t))return e;t=[t]}return function(t){for(var e,n,r,a,i=0;i=e&&s(a,n,!0)>=e-1)break;e--}i++}return null}(t)}function ce(t){var e,n=t._a;return n&&-2===y(t).overflow&&(e=n[pt]<0||11St(n[_t],n[pt])?mt:n[yt]<0||24Wt(n,i,s)?y(t)._overflowWeeks=!0:null!=u?y(t)._overflowWeekday=!0:(o=Rt(n,r,a,i,s),t._a[_t]=o.year,t._dayOfYear=o.dayOfYear)}(t),null!=t._dayOfYear&&(i=de(t._a[_t],r[_t]),(t._dayOfYear>Lt(i)||0===t._dayOfYear)&&(y(t)._overflowDayOfYear=!0),n=Nt(i,0,t._dayOfYear),t._a[pt]=n.getUTCMonth(),t._a[mt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=r[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[yt]&&0===t._a[gt]&&0===t._a[vt]&&0===t._a[Mt]&&(t._nextDay=!0,t._a[yt]=0),t._d=(t._useUTC?Nt:function(t,e,n,r,a,i,s){var o=new Date(t,e,n,r,a,i,s);return t<100&&0<=t&&isFinite(o.getFullYear())&&o.setFullYear(t),o}).apply(null,s),a=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[yt]=24),t._w&&void 0!==t._w.d&&t._w.d!==a&&(y(t).weekdayMismatch=!0)}}var fe=/^\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)?)?$/,_e=/^\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)?)?$/,pe=/Z|[+-]\d\d(?::?\d\d)?/,me=[["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}/]],ye=[["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/]],ge=/^\/?Date\((\-?\d+)/i;function ve(t){var e,n,r,a,i,s,o=t._i,u=fe.exec(o)||_e.exec(o);if(u){for(y(t).iso=!0,e=0,n=me.length;en.valueOf():n.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Ie,ln.isUTC=Ie,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=n("dates accessor is deprecated. Use date instead.",nn),ln.months=n("months accessor is deprecated. Use month instead",Ot),ln.years=n("years accessor is deprecated. Use year instead",Dt),ln.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),ln.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var t={};if(M(t,this),(t=xe(t))._a){var e=t._isUTC?m(t._a):Ye(t._a);this._isDSTShifted=this.isValid()&&0Y.width){var l=a.text();if(a.text(""),l){var c,d;if(-1!==l.indexOf(" "))c=" ",d=l.split(" ");else{c="";var h,f,_=l.length,p=Math.ceil(s/Y.width),m=Math.floor(_/p);_<=m*p||p++,d=[];for(var y=0;yY.width&&w&&""!==w&&(k={string:w,width:x,offset:M+=x},v.push(k),a.text(""),a.text(L),y===d.length-1&&(b=L,a.text(b),D=n.getComputedTextLength())),y===d.length-1){a.text("");b&&""!==b&&(0>>1,Os=[["ary",vs],["bind",hs],["bindKey",fs],["curry",ps],["curryRight",ms],["flip",ks],["partial",ys],["partialRight",gs],["rearg",Ms]],Hs="[object Arguments]",Ps="[object Array]",Bs="[object AsyncFunction]",Ns="[object Boolean]",Is="[object Date]",Rs="[object DOMException]",zs="[object Error]",Ws="[object Function]",qs="[object GeneratorFunction]",Us="[object Map]",Vs="[object Number]",$s="[object Null]",Gs="[object Object]",Js="[object Promise]",Zs="[object Proxy]",Ks="[object RegExp]",Xs="[object Set]",Qs="[object String]",to="[object Symbol]",eo="[object Undefined]",no="[object WeakMap]",ro="[object WeakSet]",ao="[object ArrayBuffer]",io="[object DataView]",so="[object Float32Array]",oo="[object Float64Array]",uo="[object Int8Array]",lo="[object Int16Array]",co="[object Int32Array]",ho="[object Uint8Array]",fo="[object Uint8ClampedArray]",_o="[object Uint16Array]",po="[object Uint32Array]",mo=/\b__p \+= '';/g,yo=/\b(__p \+=) '' \+/g,go=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vo=/&(?:amp|lt|gt|quot|#39);/g,Mo=/[&<>"']/g,ko=RegExp(vo.source),bo=RegExp(Mo.source),Lo=/<%-([\s\S]+?)%>/g,wo=/<%([\s\S]+?)%>/g,xo=/<%=([\s\S]+?)%>/g,Do=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yo=/^\w*$/,To=/^\./,Ao=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,So=/[\\^$.*+?()[\]{}|]/g,Eo=RegExp(So.source),jo=/^\s+|\s+$/g,Co=/^\s+/,Fo=/\s+$/,Oo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ho=/\{\n\/\* \[wrapped with (.+)\] \*/,Po=/,? & /,Bo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,No=/\\(\\)?/g,Io=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ro=/\w*$/,zo=/^[-+]0x[0-9a-f]+$/i,Wo=/^0b[01]+$/i,qo=/^\[object .+?Constructor\]$/,Uo=/^0o[0-7]+$/i,Vo=/^(?:0|[1-9]\d*)$/,$o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Go=/($^)/,Jo=/['\n\r\u2028\u2029\\]/g,t="\\ud800-\\udfff",e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",n="\\u2700-\\u27bf",r="a-z\\xdf-\\xf6\\xf8-\\xff",a="A-Z\\xc0-\\xd6\\xd8-\\xde",i="\\ufe0e\\ufe0f",s="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="['’]",u="["+t+"]",l="["+s+"]",c="["+e+"]",d="\\d+",h="["+n+"]",f="["+r+"]",_="[^"+t+s+d+n+r+a+"]",p="\\ud83c[\\udffb-\\udfff]",m="[^"+t+"]",y="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="["+a+"]",M="\\u200d",k="(?:"+f+"|"+_+")",b="(?:"+v+"|"+_+")",L="(?:['’](?:d|ll|m|re|s|t|ve))?",w="(?:['’](?:D|LL|M|RE|S|T|VE))?",x="(?:"+c+"|"+p+")"+"?",D="["+i+"]?",Y=D+x+("(?:"+M+"(?:"+[m,y,g].join("|")+")"+D+x+")*"),T="(?:"+[h,y,g].join("|")+")"+Y,A="(?:"+[m+c+"?",c,y,g,u].join("|")+")",Zo=RegExp(o,"g"),Ko=RegExp(c,"g"),S=RegExp(p+"(?="+p+")|"+A+Y,"g"),Xo=RegExp([v+"?"+f+"+"+L+"(?="+[l,v,"$"].join("|")+")",b+"+"+w+"(?="+[l,v+k,"$"].join("|")+")",v+"?"+k+"+"+L,v+"+"+w,"\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",d,T].join("|"),"g"),E=RegExp("["+M+t+e+i+"]"),Qo=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eu=-1,nu={};nu[so]=nu[oo]=nu[uo]=nu[lo]=nu[co]=nu[ho]=nu[fo]=nu[_o]=nu[po]=!0,nu[Hs]=nu[Ps]=nu[ao]=nu[Ns]=nu[io]=nu[Is]=nu[zs]=nu[Ws]=nu[Us]=nu[Vs]=nu[Gs]=nu[Ks]=nu[Xs]=nu[Qs]=nu[no]=!1;var ru={};ru[Hs]=ru[Ps]=ru[ao]=ru[io]=ru[Ns]=ru[Is]=ru[so]=ru[oo]=ru[uo]=ru[lo]=ru[co]=ru[Us]=ru[Vs]=ru[Gs]=ru[Ks]=ru[Xs]=ru[Qs]=ru[to]=ru[ho]=ru[fo]=ru[_o]=ru[po]=!0,ru[zs]=ru[Ws]=ru[no]=!1;var j={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},au=parseFloat,iu=parseInt,C="object"==typeof R&&R&&R.Object===Object&&R,F="object"==typeof self&&self&&self.Object===Object&&self,su=C||F||Function("return this")(),O="object"==typeof W&&W&&!W.nodeType&&W,H=O&&"object"==typeof z&&z&&!z.nodeType&&z,ou=H&&H.exports===O,P=ou&&C.process,B=function(){try{return P&&P.binding&&P.binding("util")}catch(t){}}(),uu=B&&B.isArrayBuffer,lu=B&&B.isDate,cu=B&&B.isMap,du=B&&B.isRegExp,hu=B&&B.isSet,fu=B&&B.isTypedArray;function _u(t,e){return t.set(e[0],e[1]),t}function pu(t,e){return t.add(e),t}function mu(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function yu(t,e,n,r){for(var a=-1,i=null==t?0:t.length;++a":">",'"':""","'":"'"});function Vu(t){return"\\"+j[t]}function $u(t){return E.test(t)}function Gu(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function Ju(e,n){return function(t){return e(n(t))}}function Zu(t,e){for(var n=-1,r=t.length,a=0,i=[];++n",""":'"',"'":"'"});var el=function t(e){var n,T=(e=null==e?su:el.defaults(su.Object(),e,el.pick(su,tu))).Array,r=e.Date,a=e.Error,m=e.Function,i=e.Math,w=e.Object,y=e.RegExp,c=e.String,A=e.TypeError,s=T.prototype,o=m.prototype,u=w.prototype,l=e["__core-js_shared__"],d=o.toString,x=u.hasOwnProperty,h=0,f=(n=/[^.]+$/.exec(l&&l.keys&&l.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",_=u.toString,p=d.call(w),g=su._,v=y("^"+d.call(x).replace(So,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=ou?e.Buffer:ts,k=e.Symbol,b=e.Uint8Array,L=M?M.allocUnsafe:ts,D=Ju(w.getPrototypeOf,w),Y=w.create,S=u.propertyIsEnumerable,E=s.splice,j=k?k.isConcatSpreadable:ts,C=k?k.iterator:ts,F=k?k.toStringTag:ts,O=function(){try{var t=In(w,"defineProperty");return t({},"",{}),t}catch(t){}}(),H=e.clearTimeout!==su.clearTimeout&&e.clearTimeout,P=r&&r.now!==su.Date.now&&r.now,B=e.setTimeout!==su.setTimeout&&e.setTimeout,N=i.ceil,I=i.floor,R=w.getOwnPropertySymbols,z=M?M.isBuffer:ts,W=e.isFinite,q=s.join,U=Ju(w.keys,w),V=i.max,$=i.min,G=r.now,J=e.parseInt,Z=i.random,K=s.reverse,X=In(e,"DataView"),Q=In(e,"Map"),tt=In(e,"Promise"),et=In(e,"Set"),nt=In(e,"WeakMap"),rt=In(w,"create"),at=nt&&new nt,it={},st=fr(X),ot=fr(Q),ut=fr(tt),lt=fr(et),ct=fr(nt),dt=k?k.prototype:ts,ht=dt?dt.valueOf:ts,ft=dt?dt.toString:ts;function _t(t){if(Sa(t)&&!va(t)&&!(t instanceof gt)){if(t instanceof yt)return t;if(x.call(t,"__wrapped__"))return _r(t)}return new yt(t)}var pt=function(){function n(){}return function(t){if(!Aa(t))return{};if(Y)return Y(t);n.prototype=t;var e=new n;return n.prototype=ts,e}}();function mt(){}function yt(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=ts}function gt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=js,this.__views__=[]}function vt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=es&&(i=Ru,s=!1,e=new bt(e));t:for(;++a>>0,e>>>=0;for(var i=T(a);++r>>1,s=t[i];null!==s&&!Pa(s)&&(n?s<=e:s=ws)return arguments[0]}else r=0;return n.apply(ts,arguments)}}function ur(t,e){var n=-1,r=t.length,a=r-1;for(e=e===ts?r:e;++n>>0)?(t=$a(t))&&("string"==typeof e||null!=e&&!Fa(e))&&!(e=Pe(e))&&$u(t)?Je(Qu(t),0,n):t.split(e,n):[]},_t.spread=function(r,a){if("function"!=typeof r)throw new A(rs);return a=null==a?0:V(Wa(a),0),we(function(t){var e=t[a],n=Je(t,0,a);return e&&xu(n,e),mu(r,this,n)})},_t.tail=function(t){var e=null==t?0:t.length;return e?Ee(t,1,e):[]},_t.take=function(t,e,n){return t&&t.length?Ee(t,0,(e=n||e===ts?1:Wa(e))<0?0:e):[]},_t.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Ee(t,(e=r-(e=n||e===ts?1:Wa(e)))<0?0:e,r):[]},_t.takeRightWhile=function(t,e){return t&&t.length?Re(t,Pn(e,3),!1,!0):[]},_t.takeWhile=function(t,e){return t&&t.length?Re(t,Pn(e,3)):[]},_t.tap=function(t,e){return e(t),t},_t.throttle=function(t,e,n){var r=!0,a=!0;if("function"!=typeof t)throw new A(rs);return Aa(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),sa(t,e,{leading:r,maxWait:e,trailing:a})},_t.thru=zr,_t.toArray=Ra,_t.toPairs=fi,_t.toPairsIn=_i,_t.toPath=function(t){return va(t)?wu(t,hr):Pa(t)?[t]:rn(dr($a(t)))},_t.toPlainObject=Va,_t.transform=function(t,r,a){var e=va(t),n=e||La(t)||Ba(t);if(r=Pn(r,4),null==a){var i=t&&t.constructor;a=n?e?new i:[]:Aa(t)&&Da(i)?pt(D(t)):{}}return(n?gu:Gt)(t,function(t,e,n){return r(a,t,e,n)}),a},_t.unary=function(t){return na(t,1)},_t.union=Sr,_t.unionBy=Er,_t.unionWith=jr,_t.uniq=function(t){return t&&t.length?Be(t):[]},_t.uniqBy=function(t,e){return t&&t.length?Be(t,Pn(e,2)):[]},_t.uniqWith=function(t,e){return e="function"==typeof e?e:ts,t&&t.length?Be(t,ts,e):[]},_t.unset=function(t,e){return null==t||Ne(t,e)},_t.unzip=Cr,_t.unzipWith=Fr,_t.update=function(t,e,n){return null==t?t:Ie(t,e,Ve(n))},_t.updateWith=function(t,e,n,r){return r="function"==typeof r?r:ts,null==t?t:Ie(t,e,Ve(n),r)},_t.values=pi,_t.valuesIn=function(t){return null==t?[]:Iu(t,oi(t))},_t.without=Or,_t.words=Di,_t.wrap=function(t,e){return ha(Ve(e),t)},_t.xor=Hr,_t.xorBy=Pr,_t.xorWith=Br,_t.zip=Nr,_t.zipObject=function(t,e){return qe(t||[],e||[],At)},_t.zipObjectDeep=function(t,e){return qe(t||[],e||[],Ye)},_t.zipWith=Ir,_t.entries=fi,_t.entriesIn=_i,_t.extend=Ja,_t.extendWith=Za,Hi(_t,_t),_t.add=Vi,_t.attempt=Yi,_t.camelCase=mi,_t.capitalize=yi,_t.ceil=$i,_t.clamp=function(t,e,n){return n===ts&&(n=e,e=ts),n!==ts&&(n=(n=Ua(n))==n?n:0),e!==ts&&(e=(e=Ua(e))==e?e:0),Ot(Ua(t),e,n)},_t.clone=function(t){return Ht(t,ls)},_t.cloneDeep=function(t){return Ht(t,os|ls)},_t.cloneDeepWith=function(t,e){return Ht(t,os|ls,e="function"==typeof e?e:ts)},_t.cloneWith=function(t,e){return Ht(t,ls,e="function"==typeof e?e:ts)},_t.conformsTo=function(t,e){return null==e||Pt(t,e,si(e))},_t.deburr=gi,_t.defaultTo=function(t,e){return null==t||t!=t?e:t},_t.divide=Gi,_t.endsWith=function(t,e,n){t=$a(t),e=Pe(e);var r=t.length,a=n=n===ts?r:Ot(Wa(n),0,r);return 0<=(n-=e.length)&&t.slice(n,a)==e},_t.eq=pa,_t.escape=function(t){return(t=$a(t))&&bo.test(t)?t.replace(Mo,Uu):t},_t.escapeRegExp=function(t){return(t=$a(t))&&Eo.test(t)?t.replace(So,"\\$&"):t},_t.every=function(t,e,n){var r=va(t)?Mu:zt;return n&&Gn(t,e,n)&&(e=ts),r(t,Pn(e,3))},_t.find=Ur,_t.findIndex=gr,_t.findKey=function(t,e){return Au(t,Pn(e,3),Gt)},_t.findLast=Vr,_t.findLastIndex=vr,_t.findLastKey=function(t,e){return Au(t,Pn(e,3),Jt)},_t.floor=Ji,_t.forEach=$r,_t.forEachRight=Gr,_t.forIn=function(t,e){return null==t?t:Vt(t,Pn(e,3),oi)},_t.forInRight=function(t,e){return null==t?t:$t(t,Pn(e,3),oi)},_t.forOwn=function(t,e){return t&&Gt(t,Pn(e,3))},_t.forOwnRight=function(t,e){return t&&Jt(t,Pn(e,3))},_t.get=ei,_t.gt=ma,_t.gte=ya,_t.has=function(t,e){return null!=t&&qn(t,e,ee)},_t.hasIn=ni,_t.head=kr,_t.identity=ji,_t.includes=function(t,e,n,r){t=ka(t)?t:pi(t),n=n&&!r?Wa(n):0;var a=t.length;return n<0&&(n=V(a+n,0)),Ha(t)?n<=a&&-1=$(a=e,i=n)&&r=this.__values__.length;return{done:t,value:t?ts:this.__values__[this.__index__++]}},_t.prototype.plant=function(t){for(var e,n=this;n instanceof mt;){var r=_r(n);r.__index__=0,r.__values__=ts,e?a.__wrapped__=r:e=r;var a=r;n=n.__wrapped__}return a.__wrapped__=t,e},_t.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof gt){var e=t;return this.__actions__.length&&(e=new gt(this)),(e=e.reverse()).__actions__.push({func:zr,args:[Ar],thisArg:ts}),new yt(e,this.__chain__)}return this.thru(Ar)},_t.prototype.toJSON=_t.prototype.valueOf=_t.prototype.value=function(){return ze(this.__wrapped__,this.__actions__)},_t.prototype.first=_t.prototype.head,C&&(_t.prototype[C]=function(){return this}),_t}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(su._=el,define(function(){return el})):H?((H.exports=el)._=el,O._=el):su._=el}).call(this)}).call(W,e(18),e(3)(t))},function(t,e,n){var r=n(179),a=n(240),i=n(13);t.exports=function(t){return i(t)?r(t):a(t)}},function(t,e,n){var r=n(5).Symbol;t.exports=r},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(269),a=n(270),i=n(271),s=n(272),o=n(273);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e>>1;i(t[a],e)<0?n=a+1:r=a}return n},right:function(t,e,n,r){for(arguments.length<3&&(n=0),arguments.length<4&&(r=t.length);n>>1;0e;)a.push(r/i);else for(;(r=t+n*++s)=_.length)return h?h.call(f,t):d?t.sort(d):t;for(var e,a,i,s,o=-1,u=t.length,l=_[r++],c=new g;++o=_.length)return t;var a=[],i=e[r++];return t.forEach(function(t,e){a.push({key:t,values:n(e,r)})}),i?a.sort(function(t,e){return i(t.key,e.key)}):a}(p(F.map,t,0),0)},f.key=function(t){return _.push(t),f},f.sortKeys=function(t){return e[_.length-1]=t,f},f.sortValues=function(t){return d=t,f},f.rollup=function(t){return h=t,f},f},F.set=function(t){var e=new D;if(t)for(var n=0,r=t.length;n>16,t>>8&255,255&t)}function se(t){return ie(t)+""}Xt.brighter=function(t){return new $t(Math.min(100,this.l+Gt*(arguments.length?t:1)),this.a,this.b)},Xt.darker=function(t){return new $t(Math.max(0,this.l-Gt*(arguments.length?t:1)),this.a,this.b)},Xt.rgb=function(){return Qt(this.l,this.a,this.b)};var oe=(F.rgb=ae).prototype=new It;function ue(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function le(t,e,n){var r,a,i,s=0,o=0,u=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=r[2].split(","),r[1]){case"hsl":return n(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(fe(a[0]),fe(a[1]),fe(a[2]))}return(i=_e.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(s=(3840&i)>>4,s|=s>>4,o=240&i,o|=o>>4,u=15&i,u|=u<<4):7===t.length&&(s=(16711680&i)>>16,o=(65280&i)>>8,u=255&i)),e(s,o,u))}function ce(t,e,n){var r,a,i=Math.min(t/=255,e/=255,n/=255),s=Math.max(t,e,n),o=s-i,u=(s+i)/2;return o?(a=u<.5?o/(s+i):o/(2-s-i),r=t==s?(e-n)/o+(e=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function De(){for(var t,e=ge,n=1/0;e;)e.c?(e.t=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Se=F.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=F.round(t,Ye(t,e))).toFixed(Math.max(0,Math.min(20,Ye(t*(1+1e-15),e))))}});function Ee(t){return t+""}var je=F.time={},Ce=Date;function Fe(){this._=new Date(1e));)i=u[a=(a+1)%u.length];return r.reverse().join(o)}:H,function(t){var e=Ae.exec(t),c=e[1]||" ",d=e[2]||">",h=e[3]||"-",n=e[4]||"",f=e[5],_=+e[6],p=e[7],m=e[8],y=e[9],g=1,v="",M="",k=!1,b=!0;switch(m&&(m=+m.substring(1)),(f||"0"===c&&"="===d)&&(f=c="0",d="="),y){case"n":p=!0,y="g";break;case"%":g=100,M="%",y="f";break;case"p":g=100,M="%",y="r";break;case"b":case"o":case"x":case"X":"#"===n&&(v="0"+y.toLowerCase());case"c":b=!1;case"d":k=!0,m=0;break;case"s":g=-1,y="r"}"$"===n&&(v=r[0],M=r[1]),"r"!=y||m||(y="g"),null!=m&&("g"==y?m=Math.max(1,Math.min(21,m)):"e"!=y&&"f"!=y||(m=Math.max(0,Math.min(20,m)))),y=Se.get(y)||Ee;var L=f&&p;return function(t){var e=M;if(k&&t%1)return"";var n=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===h?"":h;if(g<0){var r=F.formatPrefix(t,m);t=r.scale(t),e=r.symbol+M}else t*=g;var a,i,s=(t=y(t,m)).lastIndexOf(".");if(s<0){var o=b?t.lastIndexOf("e"):-1;o<0?(a=t,i=""):(a=t.substring(0,o),i=t.substring(o))}else a=t.substring(0,s),i=w+t.substring(s+1);!f&&p&&(a=x(a,1/0));var u=v.length+a.length+i.length+(L?0:n.length),l=u<_?new Array(u=_-u+1).join(c):"";return L&&(a=x(l+a,l.length?_-i.length:1/0)),n+=v,t=a+i,("<"===d?n+t+l:">"===d?l+n+t:"^"===d?l.substring(0,u>>=1)+n+t+l.substring(u):n+(L?t:l+t))+e}}),timeFormat:function(t){var e=t.dateTime,n=t.date,r=t.time,a=t.periods,i=t.days,s=t.shortDays,o=t.months,u=t.shortMonths;function l(o){var u=o.length;function t(t){for(var e,n,r,a=[],i=-1,s=0;++iv(c,h)&&(h=t):v(t,h)>v(c,h)&&(c=t):c<=h?(tv(c,h)&&(h=t):v(t,h)>v(c,h)&&(c=t)}else y(t,e);p=n,_=t}function t(){m.point=s}function e(){l[0]=c,l[1]=h,m.point=y,p=null}function n(t,e){if(p){var n=t-_;i+=180bt&&(c=-(h=180)),l[0]=c,l[1]=h,p=null}function v(t,e){return(e-=t)<0?e+360:e}function M(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tv(o[0],o[1])&&(o[1]=i[1]),v(i[0],o[1])>v(o[0],o[1])&&(o[0]=i[0])):n.push(o=i);for(var r,a,i,s=-1/0,o=(e=0,n[a=n.length-1]);e<=a;o=i,++e)i=n[e],(r=v(o[1],i[0]))>s&&(s=r,c=i[0],h=o[1])}return u=l=null,c===1/0||d===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,d],[h,f]]}}(),F.geo.centroid=function(t){yn=gn=vn=Mn=kn=bn=Ln=wn=xn=Dn=Yn=0,F.geo.stream(t,Nn);var e=xn,n=Dn,r=Yn,a=e*e+n*n+r*r;return abt?Math.atan((Math.sin(r)*(o=Math.cos(i))*Math.sin(a)-Math.sin(i)*(s=Math.cos(r))*Math.sin(n))/(s*o*u)):(r+i)/2,d.point(p,_),d.lineEnd(),d.lineStart(),d.point(l,_),h=0),d.point(f=t,_=e),p=l},lineEnd:function(){d.lineEnd(),f=_=NaN},clean:function(){return 2-h}}},function(t,e,n,r){var a;if(null==t)a=n*Yt,r.point(-wt,a),r.point(0,a),r.point(wt,a),r.point(wt,0),r.point(wt,-a),r.point(0,-a),r.point(-wt,-a),r.point(-wt,0),r.point(-wt,a);else if(C(t[0]-e[0])>bt){var i=t[0]r&&0bt;return Zn(p,function(o){var u,l,c,d,h;return{lineStart:function(){d=c=!1,h=1},point:function(t,e){var n,r=[t,e],a=p(t,e),i=f?a?0:y(t,e):a?y(t+(t<0?wt:-wt),e):0;if(!u&&(d=c=a)&&o.lineStart(),a!==c&&(n=m(u,r),(Bn(u,n)||Bn(r,n))&&(r[0]+=bt,r[1]+=bt,a=p(r[0],r[1]))),a!==c)h=0,a?(o.lineStart(),n=m(r,u),o.point(n[0],n[1])):(n=m(u,r),o.point(n[0],n[1]),o.lineEnd()),u=n;else if(_&&u&&f^a){var s;i&l||!(s=m(r,u,!0))||(h=0,f?(o.lineStart(),o.point(s[0][0],s[0][1]),o.point(s[1][0],s[1][1]),o.lineEnd()):(o.point(s[1][0],s[1][1]),o.lineEnd(),o.lineStart(),o.point(s[0][0],s[0][1])))}!a||u&&Bn(u,r)||o.point(r[0],r[1]),u=r,c=a,l=i},lineEnd:function(){c&&o.lineEnd(),u=null},clean:function(){return h|(d&&c)<<1}}},Fr(a,6*Tt),f?[0,-a]:[-wt,a-wt]);function p(t,e){return Math.cos(t)*Math.cos(e)>D}function m(t,e,n){var r=[1,0,0],a=Cn(En(t),En(e)),i=jn(a,a),s=a[0],o=i-s*s;if(!o)return!n&&t;var u=D*i/o,l=-D*s/o,c=Cn(r,a),d=On(r,u);Fn(d,On(a,l));var h=c,f=jn(d,h),_=jn(h,h),p=f*f-_*(jn(d,d)-1);if(!(p<0)){var m=Math.sqrt(p),y=On(h,(-f-m)/_);if(Fn(y,d),y=Pn(y),!n)return y;var g,v=t[0],M=e[0],k=t[1],b=e[1];Mbt}).map(l)).concat(F.range(Math.ceil(s/_)*_,i,_).filter(function(t){return C(t%m)>bt}).map(c))}return g.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},g.outline=function(){return{type:"Polygon",coordinates:[d(a).concat(h(o).slice(1),d(r).reverse().slice(1),h(u).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.majorExtent(t).minorExtent(t):g.minorExtent()},g.majorExtent=function(t){return arguments.length?(a=+t[0][0],r=+t[1][0],u=+t[0][1],o=+t[1][1],r=l)return}else i={x:m,y:u};n={x:m,y:l}}else{if(i){if(i.y=l)return}else i={x:(u-a)/r,y:u};n={x:(l-a)/r,y:l}}else{if(i){if(i.y=o)return}else i={x:s,y:r*s+a};n={x:o,y:r*o+a}}else{if(i){if(i.xbt||C(a-n)>bt)&&(o.splice(s,0,new Ya((y=i.site,g=c,v=C(r-d)=s&&r.x<=u&&r.y>=o&&r.y<=l?[[s,l],[u,l],[u,o],[s,o]]:[]).point=a[e]}),i}function d(t){return t.map(function(t,e){return{x:Math.round(r(t,e)/bt)*bt,y:Math.round(a(t,e)/bt)*bt,i:e}})}return i.links=function(e){return Ca(d(e)).edges.filter(function(t){return t.l&&t.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},i.triangles=function(h){var f=[];return Ca(d(h)).cells.forEach(function(t,e){for(var n,r,a,i,s=t.site,o=t.edges.sort(Ma),u=-1,l=o.length,c=o[l-1].edge,d=c.l===s?c.r:c.l;++ui&&(a=r.slice(i,a),o[s]?o[s]+=a:o[++s]=a),(e=e[0])===(n=n[0])?o[s]?o[s]+=n:o[++s]=n:(o[++s]=null,u.push({i:s,x:Ia(e,n)})),i=Wa.lastIndex;return iu&&(u=e.x),e.y>l&&(l=e.y),n.push(e.x),r.push(e.y);else for(a=0;aa&&(r=n,a=e);return r}function Bi(t){return t.reduce(Ni,0)}function Ni(t,e){return t+e[1]}function Ii(t,e){return Ri(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Ri(t,e){for(var n=-1,r=+t[0],a=(t[1]-r)/e,i=[];++n<=e;)i[n]=a*n+r;return i}function zi(t){return[F.min(t),F.max(t)]}function Wi(t,e){return t.value-e.value}function qi(t,e){var n=t._pack_next;(t._pack_next=e)._pack_prev=t,(e._pack_next=n)._pack_prev=e}function Ui(t,e){(t._pack_next=e)._pack_prev=t}function Vi(t,e){var n=e.x-t.x,r=e.y-t.y,a=t.r+e.r;return n*n+r*r<.999*a*a}function $i(t){if((e=t.children)&&(u=e.length)){var e,n,r,a,i,s,o,u,l=1/0,c=-1/0,d=1/0,h=-1/0;if(e.forEach(Gi),(n=e[0]).x=-n.r,n.y=0,v(n),1=s[0]&&r<=s[1]&&((n=a[F.bisect(o,r,1,l)-1]).y+=c,n.push(t[e]));return a}return n.value=function(t){return arguments.length?(h=t,n):h},n.range=function(t){return arguments.length?(f=pe(t),n):f},n.bins=function(e){return arguments.length?(_="number"==typeof e?function(t){return Ri(t,e)}:pe(e),n):_},n.frequency=function(t){return arguments.length?(d=!!t,n):d},n},F.layout.pack=function(){var u,l=F.layout.hierarchy().sort(Wi),c=0,d=[1,1];function e(t,e){var n=l.call(this,t,e),r=n[0],a=d[0],i=d[1],s=null==u?Math.sqrt:"function"==typeof u?u:function(){return u};if(r.x=r.y=0,wi(r,function(t){t.r=+s(t.value)}),wi(r,$i),c){var o=c*(u?1:Math.max(2*r.r/a,2*r.r/i))/2;wi(r,function(t){t.r+=o}),wi(r,$i),wi(r,function(t){t.r-=o})}return function t(e,n,r,a){var i=e.children;e.x=n+=a*e.x;e.y=r+=a*e.y;e.r*=a;if(i)for(var s=-1,o=i.length;++ss.x&&(s=t),t.depth>o.depth&&(o=t)});var u=p(i,s)/2-i.x,l=h[0]/(s.x+p(s,i)/2+u),c=h[1]/(o.depth||1);Li(r,function(t){t.x=(t.x+u)*l,t.y=t.depth*c})}return n}function _(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,n=0,r=0,a=t.children,i=a.length;for(;0<=--i;)(e=a[i]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+p(t._,r._),t.m=t.z-a):t.z=a}else r&&(t.z=r.z+p(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,a=t,i=t,s=e,o=a.parent.children[0],u=a.m,l=i.m,c=s.m,d=o.m;s=Qi(s),a=Xi(a),s&&a;)o=Xi(o),(i=Qi(i)).a=t,0<(r=s.z+c-a.z-u+p(s._,a._))&&(ts((f=t,_=n,(h=s).a.parent===f.parent?h.a:_),t,r),u+=r,l+=r),c+=s.m,u+=a.m,d+=o.m,l+=i.m;s&&!Qi(i)&&(i.t=s,i.m+=c-l),a&&!Xi(o)&&(o.t=a,o.m+=u-d,n=t)}var h,f,_;return n}(t,r,t.parent.A||n[0])}function m(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function y(t){t.x*=h[0],t.y=t.depth*h[1]}return e.separation=function(t){return arguments.length?(p=t,e):p},e.size=function(t){return arguments.length?(f=null==(h=t)?y:null,e):f?null:h},e.nodeSize=function(t){return arguments.length?(f=null==(h=t)?null:y,e):f?h:null},bi(e,d)},F.layout.cluster=function(){var c=F.layout.hierarchy().sort(null).value(null),d=Ki,h=[1,1],f=!1;function e(t,e){var a,n=c.call(this,t,e),r=n[0],i=0;wi(r,function(t){var e,n,r=t.children;r&&r.length?(t.x=(n=r).reduce(function(t,e){return t+e.x},0)/n.length,t.y=(e=r,1+F.max(e,function(t){return t.y}))):(t.x=a?i+=d(t,a):0,t.y=0,a=t)});var s=function t(e){var n=e.children;return n&&n.length?t(n[0]):e}(r),o=function t(e){var n,r=e.children;return r&&(n=r.length)?t(r[n-1]):e}(r),u=s.x-d(s,o)/2,l=o.x+d(o,s)/2;return wi(r,f?function(t){t.x=(t.x-r.x)*h[0],t.y=(r.y-t.y)*h[1]}:function(t){t.x=(t.x-u)/(l-u)*h[0],t.y=(1-(r.y?t.y/r.y:1))*h[1]}),n}return e.separation=function(t){return arguments.length?(d=t,e):d},e.size=function(t){return arguments.length?(f=null==(h=t),e):f?null:h},e.nodeSize=function(t){return arguments.length?(f=null!=(h=t),e):f?h:null},bi(e,c)},F.layout.treemap=function(){var r,a=F.layout.hierarchy(),c=Math.round,i=[1,1],s=null,d=es,o=!1,h="squarify",u=.5*(1+Math.sqrt(5));function f(t,e){for(var n,r,a=-1,i=t.length;++an.dy)&&(l=n.dy);++in.dx)&&(l=n.dx);++ir;i--);e=e.slice(a,i)}return e};a.tickFormat=function(t,n){if(!arguments.length)return ys;arguments.length<2?n=ys:"function"!=typeof n&&(n=F.format(n));var r=Math.max(1,u*t/a.ticks().length);return function(t){var e=t/h(Math.round(d(t)));return e*urect,.s>rect").attr("width",L[1]-L[0])}function S(t){t.select(".extent").attr("y",w[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",w[1]-w[0])}function o(){var d,n,r=this,t=F.select(F.event.target),a=M.of(r,arguments),i=F.select(r),e=t.datum(),s=!/^(n|s)$/.test(e)&&k,o=!/^(e|w)$/.test(e)&&b,h=t.classed("extent"),u=gt(r),f=F.mouse(r),l=F.select(O(r)).on("keydown.brush",function(){32==F.event.keyCode&&(h||(d=null,f[0]-=L[1],f[1]-=w[1],h=2),P())}).on("keyup.brush",function(){32==F.event.keyCode&&2==h&&(f[0]+=L[1],f[1]+=w[1],h=0,P())});if(F.event.changedTouches?l.on("touchmove.brush",p).on("touchend.brush",y):l.on("mousemove.brush",p).on("mouseup.brush",y),i.interrupt().selectAll("*").interrupt(),h)f[0]=L[0]-f[0],f[1]=w[0]-f[1];else if(e){var c=+/w$/.test(e),_=+/^n/.test(e);n=[L[1-c]-f[0],w[1-_]-f[1]],f[0]=L[c],f[1]=w[_]}else F.event.altKey&&(d=f.slice());function p(){var t=F.mouse(r),e=!1;n&&(t[0]+=n[0],t[1]+=n[1]),h||(F.event.altKey?(d||(d=[(L[0]+L[1])/2,(w[0]+w[1])/2]),f[0]=L[+(t[0]e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0)/,/^(?:\^)/,/^(?:v\b)/,/^(?:\s*--[x]\s*)/,/^(?:\s*-->\s*)/,/^(?:\s*--[o]\s*)/,/^(?:\s*---\s*)/,/^(?:\s*-\.-[x]\s*)/,/^(?:\s*-\.->\s*)/,/^(?:\s*-\.-[o]\s*)/,/^(?:\s*-\.-\s*)/,/^(?:\s*.-[x]\s*)/,/^(?:\s*\.->\s*)/,/^(?:\s*\.-[o]\s*)/,/^(?:\s*\.-\s*)/,/^(?:\s*==[x]\s*)/,/^(?:\s*==>\s*)/,/^(?:\s*==[o]\s*)/,/^(?:\s*==[\=]\s*)/,/^(?:\s*--\s*)/,/^(?:\s*-\.\s*)/,/^(?:\s*==\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:[A-Za-z]+)/,/^(?:[!"#$%&'*+,-.`?\\_\/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\n+)/,/^(?:\s)/,/^(?:$)/],conditions:{string:{rules:[2,3],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70],inclusive:!0}}};function Yt(){this.yy={}}return xt.lexer=Dt,new((Yt.prototype=xt).Parser=Yt)}();r.parser=e,r.Parser=e.Parser,r.parse=function(){return e.parse.apply(e,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var e=a(8).readFileSync(a(9).normalize(t[1]),"utf8");return r.parser.parse(e)},void 0!==t&&a.c[a.s]===t&&r.main(n.argv.slice(1))}).call(r,a(7),a(3)(t))},function(t,r,a){"use strict";(function(n,t){var e=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,5],n=[1,6],r=[1,12],a=[1,13],i=[1,14],s=[1,15],o=[1,16],u=[1,17],l=[1,18],c=[1,19],d=[1,20],h=[1,21],f=[1,22],_=[8,16,17,18,19,20,21,22,23,24,25,26],p=[1,37],m=[1,33],y=[1,34],g=[1,35],v=[1,36],M=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],k=[10,28],b=[10,28,37,57,58],L=[2,49],w=[1,45],x=[1,48],D=[1,49],Y=[1,52],T=[2,65],A=[1,65],S=[1,66],E=[1,67],j=[1,68],C=[1,69],F=[1,70],O=[1,71],H=[1,72],P=[1,73],B=[8,16,17,18,19,20,21,22,23,24,25,26,47],N=[10,28,37],I={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,n,r,a,i,s){var o=i.length-1;switch(a){case 1:this.$=i[o-1];break;case 2:this.$=i[o-4];break;case 3:this.$=i[o-5];break;case 4:this.$=i[o-3];break;case 8:case 10:case 11:this.$=i[o];break;case 9:this.$=i[o-1]+""+i[o];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=i[o];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:r.addLink(i[o-1],i[o].id,i[o].op),this.$="oy";break;case 42:r.addLink(i[o-1],i[o].id,i[o].op),this.$={op:i[o-2],id:i[o-1]};break;case 44:this.$={op:i[o-1],id:i[o]};break;case 48:r.addVertex(i[o-1]),this.$=i[o-1];break;case 49:r.addVertex(i[o]),this.$=i[o];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:e,13:n},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f},{6:23,12:e,13:n},t(_,[2,5]),t(_,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:p,9:25,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},t([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f}),t(M,[2,8]),t(M,[2,10]),t(M,[2,11]),t(M,[2,12]),t(M,[2,13]),t(M,[2,14]),t(M,[2,15]),t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),t(M,[2,19]),t(M,[2,20]),{7:39,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f},{7:30,8:p,9:40,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},{10:[1,41]},{10:[2,21],28:[1,42]},t(k,[2,23]),t(k,[2,24]),t(k,[2,25]),t(b,L,{44:44,32:[1,43],45:w}),t(k,[2,27],{41:46,43:47,57:x,58:D}),t(k,[2,47],{43:47,34:50,41:51,37:Y,57:x,58:D}),{34:53,37:Y},{34:54,37:Y},{34:55,37:Y},{7:56,8:[1,57],14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f},{7:30,8:p,9:58,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},t(M,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:p,9:61,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},{7:62,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f},t(b,[2,48]),t(b,T,{14:10,15:11,7:63,46:64,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,48:A,49:S,50:E,51:j,52:C,53:F,54:O,55:H,56:P}),t(k,[2,41],{34:74,37:Y}),{7:77,8:p,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,33:76,42:75,47:v},t(B,[2,66]),t(B,[2,67]),t(k,[2,46]),t(k,[2,40],{34:78,37:Y}),{7:81,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,38:79,39:[1,80]},t(k,[2,28]),t(k,[2,29]),t(k,[2,30]),{8:[1,82]},{7:30,8:p,9:83,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},{10:[1,84]},{7:30,8:p,9:85,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},{5:[2,2]},{10:[2,22]},t(k,[2,26]),t(b,[2,51],{45:[1,86]}),t(b,[2,52]),t(b,[2,56]),t(b,[2,57]),t(b,[2,58]),t(b,[2,59]),t(b,[2,60]),t(b,[2,61]),t(b,[2,62]),t(b,[2,63]),t(b,[2,64]),t(k,[2,38]),t(N,[2,44],{43:47,41:87,57:x,58:D}),t(N,[2,45],{43:47,41:88,57:x,58:D}),t(b,L,{44:44,45:w}),t(k,[2,39]),{39:[1,89]},t(k,[2,34],{34:90,37:Y}),{32:[1,91]},{7:30,8:p,9:92,12:m,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,27:26,29:27,30:28,31:29,33:31,35:y,36:g,42:32,47:v},{10:[1,93]},t(b,[2,55]),{10:[1,94]},t(b,T,{46:95,48:A,49:S,50:E,51:j,52:C,53:F,54:O,55:H,56:P}),t(N,[2,42]),t(N,[2,43]),t(k,[2,33],{34:96,37:Y}),t(k,[2,32]),{7:97,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f},{10:[1,98]},t(b,[2,54]),{5:[2,3]},t(b,[2,50]),t(k,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},t(b,[2,53]),{7:81,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,38:101},{7:81,14:10,15:11,16:r,17:a,18:i,19:s,20:o,21:u,22:l,23:c,24:d,25:h,26:f,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],a=[null],i=[],s=this.table,o="",u=0,l=0,c=0,d=1,h=i.slice.call(arguments,1),f=Object.create(this.lexer),_={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(_.yy[p]=this.yy[p]);f.setInput(t,_.yy),_.yy.lexer=f,_.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var m=f.yylloc;i.push(m);var y=f.options&&f.options.ranges;"function"==typeof _.yy.parseError?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,v,M,k,b,L,w,x,D,Y,T={};;){if(M=n[n.length-1],this.defaultActions[M]?k=this.defaultActions[M]:(null==g&&(Y=void 0,"number"!=typeof(Y=r.pop()||f.lex()||d)&&(Y instanceof Array&&(Y=(r=Y).pop()),Y=e.symbols_[Y]||Y),g=Y),k=s[M]&&s[M][g]),void 0===k||!k.length||!k[0]){var A="";for(L in D=[],s[M])this.terminals_[L]&&2e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};function z(){this.yy={}}return I.lexer=R,new((z.prototype=I).Parser=z)}();r.parser=e,r.Parser=e.Parser,r.parse=function(){return e.parse.apply(e,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var e=a(8).readFileSync(a(9).normalize(t[1]),"utf8");return r.parser.parse(e)},void 0!==t&&a.c[a.s]===t&&r.main(n.argv.slice(1))}).call(r,a(7),a(3)(t))},function(t,e,n){var r;r=function(t,e){return function(n){var r={};function a(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,a),e.l=!0,e.exports}return a.m=n,a.c=r,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=5)}([function(t,e){t.exports=n(19)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addDummyNode=s,e.simplify=u,e.asNonCompoundGraph=l,e.successorWeights=c,e.predecessorWeights=d,e.intersectRect=h,e.buildLayerMatrix=f,e.normalizeRanks=_,e.removeEmptyRanks=p,e.addBorderNode=m,e.maxRank=y,e.partition=g,e.time=v,e.notime=M;var r,a=n(0),o=(r=a)&&r.__esModule?r:{default:r},i=n(2);function s(t,e,n,r){for(var a=void 0;a=o.default.uniqueId(r),t.hasNode(a););return n.dummy=e,t.setNode(a,n),a}function u(r){var a=(new i.Graph).setGraph(r.graph());return o.default.each(r.nodes(),function(t){a.setNode(t,r.node(t))}),o.default.each(r.edges(),function(t){var e=a.edge(t.v,t.w)||{weight:0,minlen:1},n=r.edge(t);a.setEdge(t.v,t.w,{weight:e.weight+n.weight,minlen:Math.max(e.minlen,n.minlen)})}),a}function l(e){var n=new i.Graph({multigraph:e.isMultigraph()}).setGraph(e.graph());return o.default.each(e.nodes(),function(t){e.children(t).length||n.setNode(t,e.node(t))}),o.default.each(e.edges(),function(t){n.setEdge(t,e.edge(t))}),n}function c(n){var t=o.default.map(n.nodes(),function(t){var e={};return o.default.each(n.outEdges(t),function(t){e[t.w]=(e[t.w]||0)+n.edge(t).weight}),e});return o.default.zipObject(n.nodes(),t)}function d(n){var t=o.default.map(n.nodes(),function(t){var e={};return o.default.each(n.inEdges(t),function(t){e[t.v]=(e[t.v]||0)+n.edge(t).weight}),e});return o.default.zipObject(n.nodes(),t)}function h(t,e){var n=t.x,r=t.y,a=e.x-n,i=e.y-r,s=t.width/2,o=t.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var u=void 0,l=void 0;return Math.abs(i)*s>Math.abs(a)*o?(i<0&&(o=-o),u=o*a/i,l=o):(a<0&&(s=-s),l=(u=s)*i/a),{x:n+u,y:r+l}}function f(r){var a=o.default.map(o.default.range(y(r)+1),function(){return[]});return o.default.each(r.nodes(),function(t){var e=r.node(t),n=e.rank;o.default.isUndefined(n)||(a[n][e.order]=t)}),a}function _(n){var r=o.default.min(o.default.map(n.nodes(),function(t){return n.node(t).rank}));o.default.each(n.nodes(),function(t){var e=n.node(t);o.default.has(e,"rank")&&(e.rank-=r)})}function p(n){var r=o.default.min(o.default.map(n.nodes(),function(t){return n.node(t).rank})),a=[];o.default.each(n.nodes(),function(t){var e=n.node(t).rank-r;a[e]||(a[e]=[]),a[e].push(t)});var i=0,s=n.graph().nodeRankFactor;o.default.each(a,function(t,e){o.default.isUndefined(t)&&e%s!=0?--i:i&&o.default.each(t,function(t){n.node(t).rank+=i})})}function m(t,e,n,r){var a={width:0,height:0};return 4<=arguments.length&&(a.rank=n,a.order=r),s(t,"border",a,e)}function y(n){return o.default.max(o.default.map(n.nodes(),function(t){var e=n.node(t).rank;if(!o.default.isUndefined(e))return e}))}function g(t,e){var n={lhs:[],rhs:[]};return o.default.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function v(t,e){var n=o.default.now();try{return e()}finally{console.log(t+" time: "+(o.default.now()-n)+"ms")}}function M(t,e){return e()}e.default={addDummyNode:s,simplify:u,asNonCompoundGraph:l,successorWeights:c,predecessorWeights:d,intersectRect:h,buildLayerMatrix:f,normalizeRanks:_,removeEmptyRanks:p,addBorderNode:m,maxRank:y,partition:g,time:v,notime:M}},function(t,e){t.exports=n(29)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.longestPath=i,e.slack=o;var r,a=n(0),s=(r=a)&&r.__esModule?r:{default:r};function i(a){var i={};s.default.each(a.sources(),function e(t){var n=a.node(t);if(s.default.has(i,t))return n.rank;i[t]=!0;var r=s.default.min(s.default.map(a.outEdges(t),function(t){return e(t.w)-a.edge(t).minlen}))||0;return n.rank=r})}function o(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}e.default={longestPath:i,slack:o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,a=n(0),o=(r=a)&&r.__esModule?r:{default:r},i=n(2),u=n(3);function s(i,s){return o.default.each(i.nodes(),function r(a){o.default.each(s.nodeEdges(a),function(t){var e=t.v,n=a===e?t.w:e;i.hasNode(n)||(0,u.slack)(s,t)||(i.setNode(n,{}),i.setEdge(a,n,{}),r(n))})}),i.nodeCount()}function l(e,n){return o.default.minBy(n.edges(),function(t){if(e.hasNode(t.v)!==e.hasNode(t.w))return(0,u.slack)(n,t)})}function c(t,e,n){o.default.each(t.nodes(),function(t){e.node(t).rank+=n})}e.default=function(t){var e=new i.Graph({directed:!1}),n=t.nodes()[0],r=t.nodeCount();e.setNode(n,{});for(var a=void 0;s(e,t)s.lim&&(o=s,u=!0);var l=_.default.filter(n.edges(),function(t){return u===g(e,e.node(t.v),o)&&u!==g(e,e.node(t.w),o)});return _.default.minBy(l,function(t){return(0,c.slack)(n,t)})}function y(t,e,n,r){var a,i,s,o,u=n.v,l=n.w;t.removeEdge(u,l),t.setEdge(r.v,r.w,{}),f(t),h(t,e),a=t,i=e,s=_.default.find(a.nodes(),function(t){return!i.node(t).parent}),o=(o=d(a,s)).slice(1),_.default.each(o,function(t){var e=a.node(t).parent,n=i.edge(t,e),r=!1;n||(n=i.edge(e,t),r=!0),i.node(t).rank=i.node(e).rank+(r?n.minlen:-n.minlen)})}function g(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}u.initLowLimValues=f,u.initCutValues=h,u.calcCutValue=l,u.leaveEdge=p,u.enterEdge=m,u.exchangeEdges=y,e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,a=n(0),s=(r=a)&&r.__esModule?r:{default:r};e.default=function(l){var r,a,i,c=(r=l,a={},i=0,s.default.each(r.children(),function t(e){var n=i;s.default.each(r.children(e),t),a[e]={low:n,lim:i++}}),a);s.default.each(l.graph().dummyChains,function(t){for(var e=l.node(t),n=e.edgeObj,r=function(t,e,n,r){var a=[],i=[],s=Math.min(e[n].low,e[r].low),o=Math.max(e[n].lim,e[r].lim),u=void 0,l=void 0;for(u=n;u=t.parent(u),a.push(u),u&&(e[u].low>s||o>e[u].lim););for(l=u,u=r;(u=t.parent(u))!==l;)i.push(u);return{path:a.concat(i.reverse()),lca:l}}(l,c,n.v,n.w),a=r.path,i=r.lca,s=0,o=a[s],u=!0;t!==n.w;){if(e=l.node(t),u){for(;(o=a[s])!==i&&l.node(o).maxRank>1]+=t.weight;u+=t.weight*n})),u}e.default=function(t,e){for(var n=0,r=1;r=i.barycenter)&&(n=t,a=r=0,(e=i).weight&&(r+=e.barycenter*e.weight,a+=e.weight),n.weight&&(r+=n.barycenter*n.weight,a+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/a,e.weight=a,e.i=Math.min(n.i,e.i),n.merged=!0)}}function r(e){return function(t){t.in.push(e),0==--t.indegree&&n.push(t)}}for(;n.length;){var a=n.pop();t.push(a),s.default.each(a.in.reverse(),e(a)),s.default.each(a.out,r(a))}return s.default.chain(t).filter(function(t){return!t.merged}).map(function(t){return s.default.pick(t,["vs","i","barycenter","weight"])}).value()}(s.default.filter(r,function(t){return!t.indegree}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var d=r(n(0)),h=r(n(1));function r(t){return t&&t.__esModule?t:{default:t}}function f(t,e,n){for(var r=void 0;e.length&&(r=d.default.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}e.default=function(t,e){var n,r=h.default.partition(t,function(t){return d.default.has(t,"barycenter")}),a=r.lhs,i=d.default.sortBy(r.rhs,function(t){return-t.i}),s=[],o=0,u=0,l=0;a.sort((n=!!e,function(t,e){return t.barycentere.barycenter?1:n?e.i-t.i:t.i-e.i})),l=f(s,i,l),d.default.each(a,function(t){l+=t.vs.length,s.push(t.vs),o+=t.barycenter*t.weight,u+=t.weight,l=f(s,i,l)});var c={vs:d.default.flatten(s,!0)};return u&&(c.barycenter=o/u,c.weight=u),c}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,a=n(0),u=(r=a)&&r.__esModule?r:{default:r},l=n(2);e.default=function(i,n,r){var s=function(t){for(var e=void 0;t.hasNode(e=u.default.uniqueId("_root")););return e}(i),o=new l.Graph({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(t){return i.node(t)});return u.default.each(i.nodes(),function(a){var t=i.node(a),e=i.parent(a);(t.rank===n||t.minRank<=n&&n<=t.maxRank)&&(o.setNode(a),o.setParent(a,e||s),u.default.each(i[r](a),function(t){var e=t.v===a?t.w:t.v,n=o.edge(e,a),r=u.default.isUndefined(n)?0:n.weight;o.setEdge(e,a,{weight:i.edge(t).weight+r})}),u.default.has(t,"minRank")&&o.setNode(a,{borderLeft:t.borderLeft[n],borderRight:t.borderRight[n]}))}),o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,a=n(0),u=(r=a)&&r.__esModule?r:{default:r};e.default=function(a,i,t){var s={},o=void 0;u.default.each(t,function(t){for(var e=a.parent(t),n=void 0,r=void 0;e;){if((n=a.parent(e))?(r=s[n],s[n]=e):(r=o,o=e),r&&r!==e)return void i.setEdge(r,e);e=n}})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=r(n(0)),o=r(n(1)),u=n(27);function r(t){return t&&t.__esModule?t:{default:t}}e.default=function(n){var r,t,a,i;n=o.default.asNonCompoundGraph(n),r=n,t=o.default.buildLayerMatrix(r),a=r.graph().ranksep,i=0,s.default.each(t,function(t){var e=s.default.max(s.default.map(t,function(t){return r.node(t).height}));s.default.each(t,function(t){r.node(t).y=i+e/2}),i+=e+a}),s.default.each((0,u.positionX)(n),function(t,e){n.node(e).x=t})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.positionX=i;var v=a(n(0)),M=n(2),r=a(n(1));function a(t){return t&&t.__esModule?t:{default:t}}function l(l,t){var c={};return v.default.reduce(t,function(t,r){var i=0,s=0,o=t.length,u=v.default.last(r);return v.default.each(r,function(t,e){var n=function(e,t){if(e.node(t).dummy)return v.default.find(e.predecessors(t),function(t){return e.node(t).dummy})}(l,t),a=n?l.node(n).order:o;(n||t===u)&&(v.default.each(r.slice(s,e+1),function(r){v.default.each(l.predecessors(r),function(t){var e=l.node(t),n=e.order;!(na)&&d(s,t,i)})})}return v.default.reduce(t,function(r,a){var i=-1,s=void 0,o=0;return v.default.each(a,function(t,e){if("border"===u.node(t).dummy){var n=u.predecessors(t);n.length&&(s=u.node(n[0]).order,l(a,o,e,i,s),o=e,i=s)}l(a,o,a.length,s,r.length)}),a}),s}function d(t,e,n){if(n",main:"dist/dagre-layout.js",keywords:["graph","layout","dagre"],scripts:{lint:"standard",jest:"jest --coverage",karma:"node -r babel-register node_modules/.bin/karma start",test:"yarn lint && yarn jest && yarn karma --single-run",bench:"node -r babel-register src/bench.js",build:"node -r babel-register node_modules/.bin/webpack --progress --colors","build:watch":"yarn build --watch",upgrade:"yarn-upgrade-all"},dependencies:{graphlib:"^2.1.1",lodash:"^4.17.4"},devDependencies:{"babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-preset-env":"^1.6.0","babel-preset-es2015":"^6.24.1",benchmark:"^2.1.4",chai:"^4.1.2",coveralls:"^2.13.1",jest:"^21.0.1",karma:"^1.7.1","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-mocha":"^1.3.0","karma-safari-launcher":"^1.0.0",mocha:"^3.5.0",sprintf:"^0.1.5",standard:"^10.0.3",webpack:"^3.5.6","webpack-node-externals":"^1.6.0","yarn-upgrade-all":"^0.1.8"},repository:{type:"git",url:"https://github.com/tylingsoft/dagre-layout.git"},license:"MIT",files:["dist/","lib/","index.js"],standard:{ignore:["dist/**/*.js","coverage/**/*.js"]},jest:{testRegex:"test/.+?-test\\.js",testPathIgnorePatterns:["test/bundle-test\\.js"]}}}]).default},t.exports=r(n(19),n(29))},function(t,e,n){var r=n(4),a=n(164);t.exports=function(e,t,n,r){return function(t,n,i,e){var s,o,u={},l=new a,r=function(t){var e=t.v!==s?t.v:t.w,n=u[e],r=i(t),a=o.distance+r;if(r<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+r);athis._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},r.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,a=t;n>1].prioritye[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[2,3,15],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!0}}};function w(){this.yy={}}return b.lexer=L,new((w.prototype=b).Parser=w)}();r.parser=e,r.Parser=e.Parser,r.parse=function(){return e.parse.apply(e,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var e=a(8).readFileSync(a(9).normalize(t[1]),"utf8");return r.parser.parse(e)},void 0!==t&&a.c[a.s]===t&&r.main(n.argv.slice(1))}).call(r,a(7),a(3)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.apply=e.setTitle=e.addNote=e.PLACEMENT=e.ARROWTYPE=e.LINETYPE=e.clear=e.getTitle=e.getActorKeys=e.getActor=e.getActors=e.getMessages=e.addSignal=e.addMessage=e.addActor=void 0;var a=n(1),i={},s=[],o=[],r="",u=e.addActor=function(t,e,n){var r=i[t];r&&e===r.name&&null==n||(null==n&&(n=e),i[t]={name:e,description:n})},l=e.addMessage=function(t,e,n,r){s.push({from:t,to:e,message:n,answer:r})},c=e.addSignal=function(t,e,n,r){a.logger.debug("Adding message from="+t+" to="+e+" message="+n+" type="+r),s.push({from:t,to:e,message:n,type:r})},d=e.getMessages=function(){return s},h=e.getActors=function(){return i},f=e.getActor=function(t){return i[t]},_=e.getActorKeys=function(){return Object.keys(i)},p=e.getTitle=function(){return r},m=e.clear=function(){i={},s=[]},y=e.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21},g=e.ARROWTYPE={FILLED:0,OPEN:1},v=e.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},M=e.addNote=function(t,e,n){var r={actor:t,placement:e,message:n},a=[].concat(t,t);o.push(r),s.push({from:a[0],to:a[1],message:n,type:y.NOTE,placement:e})},k=e.setTitle=function(t){r=t},b=e.apply=function e(t){if(t instanceof Array)t.forEach(function(t){e(t)});else switch(t.type){case"addActor":u(t.actor,t.actor,t.description);break;case"activeStart":case"activeEnd":c(t.actor,void 0,void 0,t.signalType);break;case"addNote":M(t.actor,t.placement,t.text);break;case"addMessage":c(t.from,t.to,t.msg,t.signalType);break;case"loopStart":c(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":c(void 0,void 0,void 0,t.signalType);break;case"optStart":c(void 0,void 0,t.optText,t.signalType);break;case"optEnd":c(void 0,void 0,void 0,t.signalType);break;case"altStart":case"else":c(void 0,void 0,t.altText,t.signalType);break;case"altEnd":c(void 0,void 0,void 0,t.signalType);break;case"setTitle":k(t.text);break;case"parStart":case"and":c(void 0,void 0,t.parText,t.signalType);break;case"parEnd":c(void 0,void 0,void 0,t.signalType)}};e.default={addActor:u,addMessage:l,addSignal:c,getMessages:d,getActors:h,getActor:f,getActorKeys:_,getTitle:p,clear:m,LINETYPE:y,ARROWTYPE:g,PLACEMENT:v,addNote:M,setTitle:k,apply:b}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getInfo=e.setInfo=e.getMessage=e.setMessage=void 0;var r=n(1),a="",i=!1,s=e.setMessage=function(t){r.logger.debug("Setting message to: "+t),a=t},o=e.getMessage=function(){return a},u=e.setInfo=function(t){i=t},l=e.getInfo=function(){return i};e.default={setMessage:s,getMessage:o,setInfo:u,getInfo:l}},function(t,r,a){"use strict";(function(n,t){var e=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[6,9,10,12],n={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,n,r,a,i,s){var o=i.length-1;switch(a){case 1:return r;case 4:break;case 6:r.setInfo(!0);break;case 7:r.setMessage(i[o]);break;case 8:this.$=i[o-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},t(e,[2,3]),t(e,[2,4]),t(e,[2,5]),t(e,[2,6]),t(e,[2,7]),{13:[1,11]},t(e,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],a=[null],i=[],s=this.table,o="",u=0,l=0,c=0,d=1,h=i.slice.call(arguments,1),f=Object.create(this.lexer),_={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(_.yy[p]=this.yy[p]);f.setInput(t,_.yy),_.yy.lexer=f,_.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var m=f.yylloc;i.push(m);var y=f.options&&f.options.ranges;"function"==typeof _.yy.parseError?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,v,M,k,b,L,w,x,D,Y,T={};;){if(M=n[n.length-1],this.defaultActions[M]?k=this.defaultActions[M]:(null==g&&(Y=void 0,"number"!=typeof(Y=r.pop()||f.lex()||d)&&(Y instanceof Array&&(Y=(r=Y).pop()),Y=e.symbols_[Y]||Y),g=Y),k=s[M]&&s[M][g]),void 0===k||!k.length||!k[0]){var A="";for(L in D=[],s[M])this.terminals_[L]&&2e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::[^#\n;]+)/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:[A-Za-z]+)/,/^(?:[!"#$%&'*+,-.`?\\_\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/],conditions:{string:{rules:[10,11],inclusive:!1},struct:{rules:[5,6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,8,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!0}}};function L(){this.yy={}}return k.lexer=b,new((L.prototype=k).Parser=L)}();r.parser=e,r.Parser=e.Parser,r.parse=function(){return e.parse.apply(e,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var e=a(8).readFileSync(a(9).normalize(t[1]),"utf8");return r.parser.parse(e)},void 0!==t&&a.c[a.s]===t&&r.main(n.argv.slice(1))}).call(r,a(7),a(3)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.relationType=e.lineType=e.cleanupLabel=e.addMembers=e.addRelation=e.getRelations=e.getClasses=e.getClass=e.clear=e.addClass=void 0;var r=n(1),a=[],i={},s=e.addClass=function(t){void 0===i[t]&&(i[t]={id:t,methods:[],members:[]})},o=e.clear=function(){a=[],i={}},u=e.getClass=function(t){return i[t]},l=e.getClasses=function(){return i},c=e.getRelations=function(){return a},d=e.addRelation=function(t){r.logger.warn("Adding relation: "+JSON.stringify(t)),s(t.id1),s(t.id2),a.push(t)},h=e.addMembers=function(t,e){var n=i[t];"string"==typeof e&&(")"===e.substr(-1)?n.methods.push(e):n.members.push(e))},f=e.cleanupLabel=function(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()},_=e.lineType={LINE:0,DOTTED_LINE:1},p=e.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3};e.default={addClass:s,clear:o,getClass:u,getClasses:l,getRelations:c,addRelation:d,addMembers:h,cleanupLabel:f,lineType:_,relationType:p}},function(t,r,a){"use strict";(function(n,t){var e=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[2,3],n=[1,7],r=[7,12,15,17,19,20,21],a=[7,11,12,15,17,19,20,21],i=[2,20],s=[1,32],o={trace:function(){},yy:{},symbols_:{error:2,start:3,GG:4,":":5,document:6,EOF:7,DIR:8,options:9,body:10,OPT:11,NL:12,line:13,statement:14,COMMIT:15,commit_arg:16,BRANCH:17,ID:18,CHECKOUT:19,MERGE:20,RESET:21,reset_arg:22,STR:23,HEAD:24,reset_parents:25,CARET:26,$accept:0,$end:1},terminals_:{2:"error",4:"GG",5:":",7:"EOF",8:"DIR",11:"OPT",12:"NL",15:"COMMIT",17:"BRANCH",18:"ID",19:"CHECKOUT",20:"MERGE",21:"RESET",23:"STR",24:"HEAD",26:"CARET"},productions_:[0,[3,4],[3,5],[6,0],[6,2],[9,2],[9,1],[10,0],[10,2],[13,2],[13,1],[14,2],[14,2],[14,2],[14,2],[14,2],[16,0],[16,1],[22,2],[22,2],[25,0],[25,2]],performAction:function(t,e,n,r,a,i,s){var o=i.length-1;switch(a){case 1:return i[o-1];case 2:return r.setDirection(i[o-3]),i[o-1];case 4:r.setOptions(i[o-1]),this.$=i[o];break;case 5:i[o-1]+=i[o],this.$=i[o-1];break;case 7:this.$=[];break;case 8:i[o-1].push(i[o]),this.$=i[o-1];break;case 9:this.$=i[o-1];break;case 11:r.commit(i[o]);break;case 12:r.branch(i[o]);break;case 13:r.checkout(i[o]);break;case 14:r.merge(i[o]);break;case 15:r.reset(i[o]);break;case 16:this.$="";break;case 17:this.$=i[o];break;case 18:this.$=i[o-1]+":"+i[o];break;case 19:this.$=i[o-1]+":"+r.count,r.count=0;break;case 20:r.count=0;break;case 21:r.count+=1}},table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3],8:[1,4]},{6:5,7:e,9:6,12:n},{5:[1,8]},{7:[1,9]},t(r,[2,7],{10:10,11:[1,11]}),t(a,[2,6]),{6:12,7:e,9:6,12:n},{1:[2,1]},{7:[2,4],12:[1,15],13:13,14:14,15:[1,16],17:[1,17],19:[1,18],20:[1,19],21:[1,20]},t(a,[2,5]),{7:[1,21]},t(r,[2,8]),{12:[1,22]},t(r,[2,10]),{12:[2,16],16:23,23:[1,24]},{18:[1,25]},{18:[1,26]},{18:[1,27]},{18:[1,30],22:28,24:[1,29]},{1:[2,2]},t(r,[2,9]),{12:[2,11]},{12:[2,17]},{12:[2,12]},{12:[2,13]},{12:[2,14]},{12:[2,15]},{12:i,25:31,26:s},{12:i,25:33,26:s},{12:[2,18]},{12:i,25:34,26:s},{12:[2,19]},{12:[2,21]}],defaultActions:{9:[2,1],21:[2,2],23:[2,11],24:[2,17],25:[2,12],26:[2,13],27:[2,14],28:[2,15],31:[2,18],33:[2,19],34:[2,21]},parseError:function(t,e){if(!e.recoverable){var n=function(t,e){this.message=t,this.hash=e};throw n.prototype=Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],a=[null],i=[],s=this.table,o="",u=0,l=0,c=0,d=1,h=i.slice.call(arguments,1),f=Object.create(this.lexer),_={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(_.yy[p]=this.yy[p]);f.setInput(t,_.yy),_.yy.lexer=f,_.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var m=f.yylloc;i.push(m);var y=f.options&&f.options.ranges;"function"==typeof _.yy.parseError?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,v,M,k,b,L,w,x,D,Y,T={};;){if(M=n[n.length-1],this.defaultActions[M]?k=this.defaultActions[M]:(null==g&&(Y=void 0,"number"!=typeof(Y=r.pop()||f.lex()||d)&&(Y instanceof Array&&(Y=(r=Y).pop()),Y=e.symbols_[Y]||Y),g=Y),k=s[M]&&s[M][g]),void 0===k||!k.length||!k[0]){var A="";for(L in D=[],s[M])this.terminals_[L]&&2e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return 0\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,d={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot","\t":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr","ª":"ordf","á":"aacute","Á":"Aacute","à":"agrave","À":"Agrave","ă":"abreve","Ă":"Abreve","â":"acirc","Â":"Acirc","å":"aring","Å":"angst","ä":"auml","Ä":"Auml","ã":"atilde","Ã":"Atilde","ą":"aogon","Ą":"Aogon","ā":"amacr","Ā":"Amacr","æ":"aelig","Æ":"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf","ℬ":"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf","ℭ":"Cfr","𝒞":"Cscr","ℂ":"Copf","ć":"cacute","Ć":"Cacute","ĉ":"ccirc","Ĉ":"Ccirc","č":"ccaron","Č":"Ccaron","ċ":"cdot","Ċ":"Cdot","ç":"ccedil","Ç":"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf","ď":"dcaron","Ď":"Dcaron","đ":"dstrok","Đ":"Dstrok","ð":"eth","Ð":"ETH","ⅇ":"ee","ℯ":"escr","𝔢":"efr","𝕖":"eopf","ℰ":"Escr","𝔈":"Efr","𝔼":"Eopf","é":"eacute","É":"Eacute","è":"egrave","È":"Egrave","ê":"ecirc","Ê":"Ecirc","ě":"ecaron","Ě":"Ecaron","ë":"euml","Ë":"Euml","ė":"edot","Ė":"Edot","ę":"eogon","Ę":"Eogon","ē":"emacr","Ē":"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf","ℱ":"Fscr","ff":"fflig","ffi":"ffilig","ffl":"ffllig","fi":"filig",fj:"fjlig","fl":"fllig","ƒ":"fnof","ℊ":"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr","ǵ":"gacute","ğ":"gbreve","Ğ":"Gbreve","ĝ":"gcirc","Ĝ":"Gcirc","ġ":"gdot","Ġ":"Gdot","Ģ":"Gcedil","𝔥":"hfr","ℎ":"planckh","𝒽":"hscr","𝕙":"hopf","ℋ":"Hscr","ℌ":"Hfr","ℍ":"Hopf","ĥ":"hcirc","Ĥ":"Hcirc","ℏ":"hbar","ħ":"hstrok","Ħ":"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf","ℐ":"Iscr","ℑ":"Im","í":"iacute","Í":"Iacute","ì":"igrave","Ì":"Igrave","î":"icirc","Î":"Icirc","ï":"iuml","Ï":"Iuml","ĩ":"itilde","Ĩ":"Itilde","İ":"Idot","į":"iogon","Į":"Iogon","ī":"imacr","Ī":"Imacr","ij":"ijlig","IJ":"IJlig","ı":"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf","ĵ":"jcirc","Ĵ":"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr","ķ":"kcedil","Ķ":"Kcedil","𝔩":"lfr","𝓁":"lscr","ℓ":"ell","𝕝":"lopf","ℒ":"Lscr","𝔏":"Lfr","𝕃":"Lopf","ĺ":"lacute","Ĺ":"Lacute","ľ":"lcaron","Ľ":"Lcaron","ļ":"lcedil","Ļ":"Lcedil","ł":"lstrok","Ł":"Lstrok","ŀ":"lmidot","Ŀ":"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf","ℳ":"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr","ℕ":"Nopf","𝒩":"Nscr","𝔑":"Nfr","ń":"nacute","Ń":"Nacute","ň":"ncaron","Ň":"Ncaron","ñ":"ntilde","Ñ":"Ntilde","ņ":"ncedil","Ņ":"Ncedil","№":"numero","ŋ":"eng","Ŋ":"ENG","𝕠":"oopf","𝔬":"ofr","ℴ":"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf","º":"ordm","ó":"oacute","Ó":"Oacute","ò":"ograve","Ò":"Ograve","ô":"ocirc","Ô":"Ocirc","ö":"ouml","Ö":"Ouml","ő":"odblac","Ő":"Odblac","õ":"otilde","Õ":"Otilde","ø":"oslash","Ø":"Oslash","ō":"omacr","Ō":"Omacr","œ":"oelig","Œ":"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf","ℙ":"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr","ℚ":"Qopf","ĸ":"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr","ℛ":"Rscr","ℜ":"Re","ℝ":"Ropf","ŕ":"racute","Ŕ":"Racute","ř":"rcaron","Ř":"Rcaron","ŗ":"rcedil","Ŗ":"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS","ś":"sacute","Ś":"Sacute","ŝ":"scirc","Ŝ":"Scirc","š":"scaron","Š":"Scaron","ş":"scedil","Ş":"Scedil","ß":"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf","ť":"tcaron","Ť":"Tcaron","ţ":"tcedil","Ţ":"Tcedil","™":"trade","ŧ":"tstrok","Ŧ":"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr","ú":"uacute","Ú":"Uacute","ù":"ugrave","Ù":"Ugrave","ŭ":"ubreve","Ŭ":"Ubreve","û":"ucirc","Û":"Ucirc","ů":"uring","Ů":"Uring","ü":"uuml","Ü":"Uuml","ű":"udblac","Ű":"Udblac","ũ":"utilde","Ũ":"Utilde","ų":"uogon","Ų":"Uogon","ū":"umacr","Ū":"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr","ŵ":"wcirc","Ŵ":"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf","ý":"yacute","Ý":"Yacute","ŷ":"ycirc","Ŷ":"Ycirc","ÿ":"yuml","Ÿ":"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf","ℨ":"Zfr","ℤ":"Zopf","𝒵":"Zscr","ź":"zacute","Ź":"Zacute","ž":"zcaron","Ž":"Zcaron","ż":"zdot","Ż":"Zdot","Ƶ":"imped","þ":"thorn","Þ":"THORN","ʼn":"napos","α":"alpha","Α":"Alpha","β":"beta","Β":"Beta","γ":"gamma","Γ":"Gamma","δ":"delta","Δ":"Delta","ε":"epsi","ϵ":"epsiv","Ε":"Epsilon","ϝ":"gammad","Ϝ":"Gammad","ζ":"zeta","Ζ":"Zeta","η":"eta","Η":"Eta","θ":"theta","ϑ":"thetav","Θ":"Theta","ι":"iota","Ι":"Iota","κ":"kappa","ϰ":"kappav","Κ":"Kappa","λ":"lambda","Λ":"Lambda","μ":"mu","µ":"micro","Μ":"Mu","ν":"nu","Ν":"Nu","ξ":"xi","Ξ":"Xi","ο":"omicron","Ο":"Omicron","π":"pi","ϖ":"piv","Π":"Pi","ρ":"rho","ϱ":"rhov","Ρ":"Rho","σ":"sigma","Σ":"Sigma","ς":"sigmaf","τ":"tau","Τ":"Tau","υ":"upsi","Υ":"Upsilon","ϒ":"Upsi","φ":"phi","ϕ":"phiv","Φ":"Phi","χ":"chi","Χ":"Chi","ψ":"psi","Ψ":"Psi","ω":"omega","Ω":"ohm","а":"acy","А":"Acy","б":"bcy","Б":"Bcy","в":"vcy","В":"Vcy","г":"gcy","Г":"Gcy","ѓ":"gjcy","Ѓ":"GJcy","д":"dcy","Д":"Dcy","ђ":"djcy","Ђ":"DJcy","е":"iecy","Е":"IEcy","ё":"iocy","Ё":"IOcy","є":"jukcy","Є":"Jukcy","ж":"zhcy","Ж":"ZHcy","з":"zcy","З":"Zcy","ѕ":"dscy","Ѕ":"DScy","и":"icy","И":"Icy","і":"iukcy","І":"Iukcy","ї":"yicy","Ї":"YIcy","й":"jcy","Й":"Jcy","ј":"jsercy","Ј":"Jsercy","к":"kcy","К":"Kcy","ќ":"kjcy","Ќ":"KJcy","л":"lcy","Л":"Lcy","љ":"ljcy","Љ":"LJcy","м":"mcy","М":"Mcy","н":"ncy","Н":"Ncy","њ":"njcy","Њ":"NJcy","о":"ocy","О":"Ocy","п":"pcy","П":"Pcy","р":"rcy","Р":"Rcy","с":"scy","С":"Scy","т":"tcy","Т":"Tcy","ћ":"tshcy","Ћ":"TSHcy","у":"ucy","У":"Ucy","ў":"ubrcy","Ў":"Ubrcy","ф":"fcy","Ф":"Fcy","х":"khcy","Х":"KHcy","ц":"tscy","Ц":"TScy","ч":"chcy","Ч":"CHcy","џ":"dzcy","Џ":"DZcy","ш":"shcy","Ш":"SHcy","щ":"shchcy","Щ":"SHCHcy","ъ":"hardcy","Ъ":"HARDcy","ы":"ycy","Ы":"Ycy","ь":"softcy","Ь":"SOFTcy","э":"ecy","Э":"Ecy","ю":"yucy","Ю":"YUcy","я":"yacy","Я":"YAcy","ℵ":"aleph","ℶ":"beth","ℷ":"gimel","ℸ":"daleth"},h=/["&'<>`]/g,r={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},a=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,f=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)([=a-zA-Z0-9])?/g,m={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"},y={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"},s={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},_=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],p=String.fromCharCode,g={}.hasOwnProperty,v=function(t,e){return g.call(t,e)},M=function(t,e){if(!t)return e;var n,r={};for(n in e)r[n]=v(t,n)?t[n]:e[n];return r},k=function(t,e){var n="";return 55296<=t&&t<=57343||1114111>>10&1023|55296),t=56320|1023&t),n+=p(t))},b=function(t){return"&#x"+t.toString(16).toUpperCase()+";"},L=function(t){return"&#"+t+";"},w=function(t){throw Error("Parse error: "+t)},x=function(t,e){(e=M(e,x.options)).strict&&f.test(t)&&w("forbidden code point");var n=e.encodeEverything,r=e.useNamedReferences,a=e.allowUnsafeSymbols,i=e.decimal?L:b,s=function(t){return i(t.charCodeAt(0))};return n?(t=t.replace(u,function(t){return r&&v(d,t)?"&"+d[t]+";":s(t)}),r&&(t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),r&&(t=t.replace(c,function(t){return"&"+d[t]+";"}))):r?(a||(t=t.replace(h,function(t){return"&"+d[t]+";"})),t=(t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒")).replace(c,function(t){return"&"+d[t]+";"})):a||(t=t.replace(h,s)),t.replace(o,function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1);return i(1024*(e-55296)+n-56320+65536)}).replace(l,s)};x.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var D=function(t,_){var p=(_=M(_,D.options)).strict;return p&&a.test(t)&&w("malformed character reference"),t.replace(i,function(t,e,n,r,a,i,s,o){var u,l,c,d,h,f;return e?(c=e,l=n,p&&!l&&w("character reference was not terminated by a semicolon"),u=parseInt(c,10),k(u,p)):r?(d=r,l=a,p&&!l&&w("character reference was not terminated by a semicolon"),u=parseInt(d,16),k(u,p)):i?v(m,h=i)?m[h]:(p&&w("named character reference was not terminated by a semicolon"),t):(h=s,(f=o)&&_.isAttributeValue?(p&&"="==f&&w("`&` did not start a character reference"),t):(p&&w("named character reference was not terminated by a semicolon"),y[h]+(f||"")))})};D.options={isAttributeValue:!1,strict:!1};var Y={version:"1.1.1",encode:x,decode:D,escape:function(t){return t.replace(h,function(t){return r[t]})},unescape:D};void 0===(S=function(){return Y}.call(E,j,E,T))||(T.exports=S)}()}).call(E,j(3)(t),j(18))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeEntities=e.encodeEntities=e.version=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=n(1),f=E(n(157)),_=E(n(158)),p=E(n(208)),m=E(n(222)),y=E(n(224)),r=E(n(171)),a=E(n(160)),s=E(n(161)),o=E(n(168)),u=E(n(169)),l=E(n(170)),g=E(n(225)),c=E(n(172)),d=E(n(173)),v=E(n(174)),M=E(n(226)),k=E(n(175)),b=E(n(176)),L=E(n(227)),w=E(n(201)),x=E(n(6)),D=E(n(203)),Y=E(n(346)),T=E(n(348)),A=E(n(350)),S=E(n(352));function E(t){return t&&t.__esModule?t:{default:t}}var j={dark:Y.default,default:T.default,forest:A.default,neutral:S.default},C={theme:T.default,logLevel:5,startOnLoad:!0,arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequenceDiagram:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:3,axisFormatter:[["%I:%M",function(t){return t.getHours()}],["w. %U",function(t){return 1===t.getDay()}],["%a %d",function(t){return t.getDay()&&1!==t.getDate()}],["%b %d",function(t){return 1!==t.getDate()}],["%m-%y",function(t){return t.getMonth()}]]},classDiagram:{},gitGraph:{},info:{}};(0,h.setLogLevel)(C.logLevel);var F=e.version=function(){return D.default.version},O=e.encodeEntities=function(t){var e=t;return e=(e=(e=e.replace(/style.*:\S*#.*;/g,function(t){return t.substring(0,t.length-1)})).replace(/classDef.*:\S*#.*;/g,function(t){return t.substring(0,t.length-1)})).replace(/#\w+;/g,function(t){var e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})},H=e.decodeEntities=function(t){var e=t;return e=(e=(e=e.replace(/fl°°/g,function(){return"&#"})).replace(/fl°/g,function(){return"&"})).replace(/¶ß/g,function(){return";"})},P=function(t,e,n,r){if(void 0!==r)r.innerHTML="",x.default.select(r).append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g");else{var a=document.querySelector("#d"+t);a&&(a.innerHTML=""),x.default.select("body").append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g")}window.txt=e,e=O(e);var i=x.default.select("#d"+t).node();switch(_.default.detectType(e)){case"gitGraph":C.flowchart.arrowMarkerAbsolute=C.arrowMarkerAbsolute,L.default.setConf(C.gitGraph),L.default.draw(e,t,!1);break;case"graph":C.flowchart.arrowMarkerAbsolute=C.arrowMarkerAbsolute,p.default.setConf(C.flowchart),p.default.draw(e,t,!1);break;case"dotGraph":C.flowchart.arrowMarkerAbsolute=C.arrowMarkerAbsolute,p.default.setConf(C.flowchart),p.default.draw(e,t,!0);break;case"sequenceDiagram":C.sequenceDiagram.arrowMarkerAbsolute=C.arrowMarkerAbsolute,m.default.setConf(C.sequenceDiagram),m.default.draw(e,t);break;case"gantt":C.gantt.arrowMarkerAbsolute=C.arrowMarkerAbsolute,g.default.setConf(C.gantt),g.default.draw(e,t);break;case"classDiagram":C.classDiagram.arrowMarkerAbsolute=C.arrowMarkerAbsolute,M.default.setConf(C.classDiagram),M.default.draw(e,t);break;case"info":C.info.arrowMarkerAbsolute=C.arrowMarkerAbsolute,y.default.draw(e,t,F())}var s=i.firstChild,o=document.createElement("style"),u=window.getComputedStyle(s);o.innerHTML="\n "+(j[C.theme]||T.default)+"\nsvg {\n color: "+u.color+";\n font: "+u.font+";\n}\n ",s.insertBefore(o,s.firstChild),x.default.select("#d"+t).selectAll("foreignobject div").attr("xmlns","http://www.w3.org/1999/xhtml");var l="";C.arrowMarkerAbsolute&&(l=(l=(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)"));var c=x.default.select("#d"+t).node().innerHTML.replace(/url\(#arrowhead/g,"url("+l+"#arrowhead","g");c=H(c),void 0!==n?n(c,f.default.bindFunctions):h.logger.warn("CB = undefined!");var d=x.default.select("#d"+t).node();return null!==d&&"function"==typeof d.remove&&x.default.select("#d"+t).node().remove(),c};var B=function(t){for(var e=Object.keys(t),n=0;n'});else{for(var s=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.split(/
/),u=0;u'+t.text+""):(e.labelType="text",e.style="stroke: #333; stroke-width: 1.5px;fill:none",e.label=t.text.replace(/
/g,"\n"))):e.label=t.text.replace(/
/g,"\n")),a.setEdge(t.start,t.end,e,i)})},i=e.getClasses=function(t,e){var n=void 0;Y.default.clear(),(n=e?A.default.parser:T.default.parser).yy=Y.default,n.parse(t);var r=Y.default.getClasses();return void 0===r.default&&(r.default={id:"default"},r.default.styles=[],r.default.clusterStyles=["rx:4px","fill: rgb(255, 255, 222)","rx: 4px","stroke: rgb(170, 170, 51)","stroke-width: 1px"],r.default.nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],r.default.edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),r},s=e.draw=function(t,e,n){j.logger.debug("Drawing flowchart");var r=void 0;Y.default.clear(),(r=n?A.default.parser:T.default.parser).yy=Y.default;try{r.parse(t)}catch(t){j.logger.debug("Parsing failed")}var a=Y.default.getDirection();void 0===a&&(a="TD");for(var i=new E.default.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:a,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),s=void 0,o=Y.default.getSubGraphs(),u=o.length-1;0<=u;u--)s=o[u],Y.default.addVertex(s.id,s.title,"group",void 0);var l=Y.default.getVertices(),c=Y.default.getEdges(),d=0;for(d=o.length-1;0<=d;d--){s=o[d],S.default.selectAll("cluster").append("text");for(var h=0;hMath.abs(a)*o?(i<0&&(o=-o),u=0===i?0:o*a/i,l=o):(a<0&&(s=-s),u=s,l=0===a?0:s*i/a),{x:n+u,y:r+l}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(n(1)),i=r(n(11)),s=r(n(5)),o=r(n(12)),u=r(n(14)),l=r(n(0)),c=n(27);e.default={d3:a.default,graphlib:i.default,dagre:s.default,intersect:o.default,render:u.default,util:l.default,version:c.version}},function(t,e){t.exports=n(29)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(n(6)),i=r(n(7)),s=r(n(3)),o=r(n(8)),u=r(n(9));e.default={node:a.default,circle:i.default,ellipse:s.default,polygon:o.default,rect:u.default}},function(t,e,n){"use strict";function y(t,e){return 0g.width?(l.remove(),s=t.append("g"),c=(l=m.default.drawText(s,u,2*i.width-g.noteMargin))[0][0].getBBox().height,o.attr("width",2*i.width),v.insert(e,n,e+2*i.width,n+2*g.noteMargin+c)):v.insert(e,n,e+i.width,n+2*g.noteMargin+c),o.attr("height",c+2*g.noteMargin),v.bumpVerticalPos(c+2*g.noteMargin)},k=e.drawActors=function(t,e,n,r){for(var a=0;an&&(r.starty=n-6,n+=12),m.default.drawActivation(d,r,n,g),v.insert(r.startx,n-10,r.stopx,n);break;case y.parser.yy.LINETYPE.LOOP_START:v.bumpVerticalPos(g.boxMargin),v.newLoop(t.message),v.bumpVerticalPos(g.boxMargin+g.boxTextMargin);break;case y.parser.yy.LINETYPE.LOOP_END:a=v.endLoop(),m.default.drawLoop(d,a,"loop",g),v.bumpVerticalPos(g.boxMargin);break;case y.parser.yy.LINETYPE.OPT_START:v.bumpVerticalPos(g.boxMargin),v.newLoop(t.message),v.bumpVerticalPos(g.boxMargin+g.boxTextMargin);break;case y.parser.yy.LINETYPE.OPT_END:a=v.endLoop(),m.default.drawLoop(d,a,"opt",g),v.bumpVerticalPos(g.boxMargin);break;case y.parser.yy.LINETYPE.ALT_START:v.bumpVerticalPos(g.boxMargin),v.newLoop(t.message),v.bumpVerticalPos(g.boxMargin+g.boxTextMargin);break;case y.parser.yy.LINETYPE.ALT_ELSE:v.bumpVerticalPos(g.boxMargin),a=v.addSectionToLoop(t.message),v.bumpVerticalPos(g.boxMargin);break;case y.parser.yy.LINETYPE.ALT_END:a=v.endLoop(),m.default.drawLoop(d,a,"alt",g),v.bumpVerticalPos(g.boxMargin);break;case y.parser.yy.LINETYPE.PAR_START:v.bumpVerticalPos(g.boxMargin),v.newLoop(t.message),v.bumpVerticalPos(g.boxMargin+g.boxTextMargin);break;case y.parser.yy.LINETYPE.PAR_AND:v.bumpVerticalPos(g.boxMargin),a=v.addSectionToLoop(t.message),v.bumpVerticalPos(g.boxMargin);break;case y.parser.yy.LINETYPE.PAR_END:a=v.endLoop(),m.default.drawLoop(d,a,"par",g),v.bumpVerticalPos(g.boxMargin);break;default:try{v.bumpVerticalPos(g.messageMargin);var i=b(t.from),s=b(t.to),o=i[0]<=s[0]?1:0,u=i[0]/gi," "),a=t.append("text");a.attr("x",e.x),a.attr("y",e.y),a.style("text-anchor",e.anchor),a.attr("fill",e.fill),void 0!==e.class&&a.attr("class",e.class);var i=a.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.attr("fill",e.fill),i.text(r),void 0!==a.textwrap&&a.textwrap({x:e.x,y:e.y,width:n,height:1800},e.textMargin),a},o=e.drawLabel=function(t,e){var n,r,a,i,s,o=t.append("polygon");o.attr("points",(n=e.x,r=e.y,n+","+r+" "+(n+(a=50))+","+r+" "+(n+a)+","+(r+(i=20)-(s=7))+" "+(n+a-1.2*s)+","+(r+i)+" "+n+","+(r+i))),o.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,l(t,e)},c=-1,r=e.drawActor=function(t,e,n,r,a){var i=e+a.width/2,s=t.append("g");0===n&&(c++,s.append("line").attr("id","actor"+c).attr("x1",i).attr("y1",5).attr("x2",i).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));var o=_();o.x=e,o.y=n,o.fill="#eaeaea",o.width=a.width,o.height=a.height,o.class="actor",o.rx=3,o.ry=3,u(s,o),p(a)(r,s,o.x,o.y,o.width,o.height,{class:"actor"})},a=e.anchorElement=function(t){return t.append("g")},i=e.drawActivation=function(t,e,n){var r=_(),a=e.anchored;r.x=e.startx,r.y=e.starty,r.fill="#f4f4f4",r.width=e.stopx-e.startx,r.height=n-e.starty,u(a,r)},s=e.drawLoop=function(t,n,e,r){var a=t.append("g"),i=function(t,e,n,r){return a.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("class","loopLine")};i(n.startx,n.starty,n.stopx,n.starty),i(n.stopx,n.starty,n.stopx,n.stopy),i(n.startx,n.stopy,n.stopx,n.stopy),i(n.startx,n.starty,n.startx,n.stopy),void 0!==n.sections&&n.sections.forEach(function(t){i(n.startx,t,n.stopx,t).style("stroke-dasharray","3, 3")});var s=f();s.text=e,s.x=n.startx,s.y=n.starty,s.labelMargin=15,s.class="labelText",o(a,s),(s=f()).text="[ "+n.title+" ]",s.x=n.startx+(n.stopx-n.startx)/2,s.y=n.starty+1.5*r.boxMargin,s.anchor="middle",s.class="loopText",l(a,s),void 0!==n.sectionTitles&&n.sectionTitles.forEach(function(t,e){""!==t&&(s.text="[ "+t+" ]",s.y=n.sections[e]+1.5*r.boxMargin,l(a,s))})},d=e.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},h=e.insertArrowCrossHead=function(t){var e=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);e.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),e.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},f=e.getTextObj=function(){return{x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0}},_=e.getNoteRect=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},p=function(){function e(t,e,n,r,a,i,s){c(e.append("text").attr("x",n+a/2).attr("y",r+i/2+5).style("text-anchor","middle").text(t),s)}function l(t,e,n,r,a,i,s){var o=e.append("text").attr("x",n+a/2).attr("y",r).style("text-anchor","middle");if(o.append("tspan").attr("x",n+a/2).attr("dy","0").text(t),void 0!==o.textwrap){o.textwrap({x:n+a/2,y:r,width:a,height:i},0);var u=o.selectAll("tspan");0o?e+a-5:n+a+5:(n-e)/2+e+a}).attr("y",function(t,e){return e*n+y.barHeight/2+(y.fontSize/2-2)+r}).attr("text-height",e).attr("class",function(t){for(var e=h(t.startTime),n=h(t.endTime),r=this.getBBox().width,a=0,i=0;io?"taskTextOutsideLeft taskTextOutside"+a+" "+s:"taskTextOutsideRight taskTextOutside"+a+" "+s:"taskText taskText"+a+" "+s})}(t,a,i,s,r,0,e),function(r,a){for(var i=[],s=0,t=0;t "+t.w+": "+JSON.stringify(a.edge(t))),function(t,e,n){var r=function(t){switch(t){case y.default.relationType.AGGREGATION:return"aggregation";case y.default.relationType.EXTENSION:return"extension";case y.default.relationType.COMPOSITION:return"composition";case y.default.relationType.DEPENDENCY:return"dependency"}},a=e.points,i=g.default.svg.line().x(function(t){return t.x}).y(function(t){return t.y}).interpolate("basis"),s=t.append("path").attr("d",i(a)).attr("id","edge"+M).attr("class","relation"),o="";v.arrowMarkerAbsolute&&(o=(o=(o=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),"none"!==n.relation.type1&&s.attr("marker-start","url("+o+"#"+r(n.relation.type1)+"Start)"),"none"!==n.relation.type2&&s.attr("marker-end","url("+o+"#"+r(n.relation.type2)+"End)");var u=void 0,l=void 0,c=e.points.length;if(c%2!=0){var d=e.points[Math.floor(c/2)],h=e.points[Math.ceil(c/2)];u=(d.x+h.x)/2,l=(d.y+h.y)/2}else{var f=e.points[Math.floor(c/2)];u=f.x,l=f.y}if(void 0!==n.title){var _=t.append("g").attr("class","classLabel"),p=_.append("text").attr("class","label").attr("x",u).attr("y",l).attr("fill","red").attr("text-anchor","middle").text(n.title),m=(window.label=p).node().getBBox();_.insert("rect",":first-child").attr("class","box").attr("x",m.x-v.padding/2).attr("y",m.y-v.padding/2).attr("width",m.width+v.padding).attr("height",m.height+v.padding)}M++}(r,a.edge(t),a.edge(t).relation)}),r.attr("height","100%"),r.attr("width","100%"),r.attr("viewBox","0 0 "+(a.graph().width+20)+" "+(a.graph().height+20))};e.default={setConf:a,draw:i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.draw=e.setConf=void 0;var u=r(n(177)),l=r(n(245)),c=r(n(2)),d=r(n(265)),h=r(n(327)),f=r(n(201)),_=r(n(176)),p=r(n(6)),m=n(1);function r(t){return t&&t.__esModule?t:{default:t}}var y={},g=void 0,v={nodeSpacing:150,nodeFillColor:"yellow",nodeStrokeWidth:2,nodeStrokeColor:"grey",lineStrokeWidth:4,branchOffset:50,lineColor:"grey",leftMargin:50,branchColors:["#442f74","#983351","#609732","#AA9A39"],nodeRadius:10,nodeLabel:{width:75,height:100,x:-25,y:0}},M={},a=e.setConf=function(t){M=t};function k(t,e,n,r){r=r||"basis";var a=v.branchColors[n%v.branchColors.length],i=p.default.svg.line().x(function(t){return Math.round(t.x)}).y(function(t){return Math.round(t.y)}).interpolate(r);t.append("svg:path").attr("d",i(e)).style("stroke",a).style("stroke-width",v.lineStrokeWidth).style("fill","none")}function b(t,e){e=e||t.node().getBBox();var n=t.node().getCTM();return{left:n.e+e.x*n.a,top:n.f+e.y*n.d,width:e.width,height:e.height}}function L(t,e,n,r,a){m.logger.debug("svgDrawLineForCommits: ",e,n);var i=b(t.select("#node-"+e+" circle")),s=b(t.select("#node-"+n+" circle"));switch(r){case"LR":if(i.left-s.left>v.nodeSpacing){var o={x:i.left-v.nodeSpacing,y:s.top+s.height/2};k(t,[o,{x:s.left+s.width,y:s.top+s.height/2}],a,"linear"),k(t,[{x:i.left,y:i.top+i.height/2},{x:i.left-v.nodeSpacing/2,y:i.top+i.height/2},{x:i.left-v.nodeSpacing/2,y:o.y},o],a)}else k(t,[{x:i.left,y:i.top+i.height/2},{x:i.left-v.nodeSpacing/2,y:i.top+i.height/2},{x:i.left-v.nodeSpacing/2,y:s.top+s.height/2},{x:s.left+s.width,y:s.top+s.height/2}],a);break;case"BT":if(s.top-i.top>v.nodeSpacing){var u={x:s.left+s.width/2,y:i.top+i.height+v.nodeSpacing};k(t,[u,{x:s.left+s.width/2,y:s.top}],a,"linear"),k(t,[{x:i.left+i.width/2,y:i.top+i.height},{x:i.left+i.width/2,y:i.top+i.height+v.nodeSpacing/2},{x:s.left+s.width/2,y:u.y-v.nodeSpacing/2},u],a)}else k(t,[{x:i.left+i.width/2,y:i.top+i.height},{x:i.left+i.width/2,y:i.top+v.nodeSpacing/2},{x:s.left+s.width/2,y:s.top-v.nodeSpacing/2},{x:s.left+s.width/2,y:s.top}],a)}}var i=e.draw=function(t,e,n){try{var r=_.default.parser;r.yy=f.default,m.logger.debug("in gitgraph renderer",t,e,n),r.parse(t+"\n"),v=(0,l.default)(v,M,f.default.getOptions()),m.logger.debug("effective options",v);var a=f.default.getDirection();y=f.default.getCommits();var i=f.default.getBranchesAsObjArray();"BT"===a&&(v.nodeLabel.x=i.length*v.branchOffset,v.nodeLabel.width="100%",v.nodeLabel.y=-2*v.nodeRadius);var s=p.default.select("#"+e);(o=s).append("defs").append("g").attr("id","def-commit").append("circle").attr("r",v.nodeRadius).attr("cx",0).attr("cy",0),o.select("#def-commit").append("foreignObject").attr("width",v.nodeLabel.width).attr("height",v.nodeLabel.height).attr("x",v.nodeLabel.x).attr("y",v.nodeLabel.y).attr("class","node-label").attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").append("xhtml:p").html(""),g=1,(0,u.default)(i,function(t){!function t(e,n,r,a){var i=void 0,s=Object.keys(y).length;if((0,h.default)(n))do{if(i=y[n],m.logger.debug("in renderCommitHistory",i.id,i.seq),0=i)return arguments[0]}else r=0;return n.apply(void 0,arguments)}}},function(t,e,n){var a=n(22),i=n(13),s=n(31),o=n(14);t.exports=function(t,e,n){if(!o(n))return!1;var r=typeof e;return!!("number"==r?i(n)&&s(e,n.length):"string"==r&&e in n)&&a(n[e],t)}},function(t,e,n){var r=n(179),a=n(263),i=n(13);t.exports=function(t){return i(t)?r(t,!0):a(t)}},function(t,e,n){var a=n(14),i=n(185),s=n(264),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!a(t))return s(t);var e=i(t),n=[];for(var r in t)("constructor"!=r||!e&&o.call(t,r))&&n.push(r);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var r=n(266)(n(323));t.exports=r},function(t,e,n){var o=n(15),u=n(13),l=n(20);t.exports=function(s){return function(t,e,n){var r=Object(t);if(!u(t)){var a=o(e,3);t=l(t),e=function(t){return a(r[t],t,r)}}var i=s(t,e,n);return-1= 0; i--) { + if (this.eventListeners.hasOwnProperty(haltEventListeners[i])) { + delete this.eventListeners[haltEventListeners[i]] + } + } + } + } + + // Bind eventListeners + for (var event in this.eventListeners) { + // Attach event to eventsListenerElement or SVG if not available + (this.options.eventsListenerElement || this.svg) + .addEventListener(event, this.eventListeners[event], false) + } + + // Zoom using mouse wheel + if (this.options.mouseWheelZoomEnabled) { + this.options.mouseWheelZoomEnabled = false // set to false as enable will set it back to true + this.enableMouseWheelZoom() + } +} + +/** + * Enable ability to zoom using mouse wheel + */ +SvgPanZoom.prototype.enableMouseWheelZoom = function() { + if (!this.options.mouseWheelZoomEnabled) { + var that = this + + // Mouse wheel listener + this.wheelListener = function(evt) { + return that.handleMouseWheel(evt); + } + + // Bind wheelListener + Wheel.on(this.options.eventsListenerElement || this.svg, this.wheelListener, false) + + this.options.mouseWheelZoomEnabled = true + } +} + +/** + * Disable ability to zoom using mouse wheel + */ +SvgPanZoom.prototype.disableMouseWheelZoom = function() { + if (this.options.mouseWheelZoomEnabled) { + Wheel.off(this.options.eventsListenerElement || this.svg, this.wheelListener, false) + this.options.mouseWheelZoomEnabled = false + } +} + +/** + * Handle mouse wheel event + * + * @param {Event} evt + */ +SvgPanZoom.prototype.handleMouseWheel = function(evt) { + if (!this.options.zoomEnabled || this.state !== 'none') { + return; + } + + if (this.options.preventMouseEventsDefault){ + if (evt.preventDefault) { + evt.preventDefault(); + } else { + evt.returnValue = false; + } + } + + // Default delta in case that deltaY is not available + var delta = evt.deltaY || 1 + , timeDelta = Date.now() - this.lastMouseWheelEventTime + , divider = 3 + Math.max(0, 30 - timeDelta) + + // Update cache + this.lastMouseWheelEventTime = Date.now() + + // Make empirical adjustments for browsers that give deltaY in pixels (deltaMode=0) + if ('deltaMode' in evt && evt.deltaMode === 0 && evt.wheelDelta) { + delta = evt.deltaY === 0 ? 0 : Math.abs(evt.wheelDelta) / evt.deltaY + } + + delta = -0.3 < delta && delta < 0.3 ? delta : (delta > 0 ? 1 : -1) * Math.log(Math.abs(delta) + 10) / divider + + var inversedScreenCTM = this.svg.getScreenCTM().inverse() + , relativeMousePoint = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(inversedScreenCTM) + , zoom = Math.pow(1 + this.options.zoomScaleSensitivity, (-1) * delta); // multiplying by neg. 1 so as to make zoom in/out behavior match Google maps behavior + + this.zoomAtPoint(zoom, relativeMousePoint) +} + +/** + * Zoom in at a SVG point + * + * @param {SVGPoint} point + * @param {Float} zoomScale Number representing how much to zoom + * @param {Boolean} zoomAbsolute Default false. If true, zoomScale is treated as an absolute value. + * Otherwise, zoomScale is treated as a multiplied (e.g. 1.10 would zoom in 10%) + */ +SvgPanZoom.prototype.zoomAtPoint = function(zoomScale, point, zoomAbsolute) { + var originalState = this.viewport.getOriginalState() + + if (!zoomAbsolute) { + // Fit zoomScale in set bounds + if (this.getZoom() * zoomScale < this.options.minZoom * originalState.zoom) { + zoomScale = (this.options.minZoom * originalState.zoom) / this.getZoom() + } else if (this.getZoom() * zoomScale > this.options.maxZoom * originalState.zoom) { + zoomScale = (this.options.maxZoom * originalState.zoom) / this.getZoom() + } + } else { + // Fit zoomScale in set bounds + zoomScale = Math.max(this.options.minZoom * originalState.zoom, Math.min(this.options.maxZoom * originalState.zoom, zoomScale)) + // Find relative scale to achieve desired scale + zoomScale = zoomScale/this.getZoom() + } + + var oldCTM = this.viewport.getCTM() + , relativePoint = point.matrixTransform(oldCTM.inverse()) + , modifier = this.svg.createSVGMatrix().translate(relativePoint.x, relativePoint.y).scale(zoomScale).translate(-relativePoint.x, -relativePoint.y) + , newCTM = oldCTM.multiply(modifier) + + if (newCTM.a !== oldCTM.a) { + this.viewport.setCTM(newCTM) + } +} + +/** + * Zoom at center point + * + * @param {Float} scale + * @param {Boolean} absolute Marks zoom scale as relative or absolute + */ +SvgPanZoom.prototype.zoom = function(scale, absolute) { + this.zoomAtPoint(scale, SvgUtils.getSvgCenterPoint(this.svg, this.width, this.height), absolute) +} + +/** + * Zoom used by public instance + * + * @param {Float} scale + * @param {Boolean} absolute Marks zoom scale as relative or absolute + */ +SvgPanZoom.prototype.publicZoom = function(scale, absolute) { + if (absolute) { + scale = this.computeFromRelativeZoom(scale) + } + + this.zoom(scale, absolute) +} + +/** + * Zoom at point used by public instance + * + * @param {Float} scale + * @param {SVGPoint|Object} point An object that has x and y attributes + * @param {Boolean} absolute Marks zoom scale as relative or absolute + */ +SvgPanZoom.prototype.publicZoomAtPoint = function(scale, point, absolute) { + if (absolute) { + // Transform zoom into a relative value + scale = this.computeFromRelativeZoom(scale) + } + + // If not a SVGPoint but has x and y then create a SVGPoint + if (Utils.getType(point) !== 'SVGPoint') { + if('x' in point && 'y' in point) { + point = SvgUtils.createSVGPoint(this.svg, point.x, point.y) + } else { + throw new Error('Given point is invalid') + } + } + + this.zoomAtPoint(scale, point, absolute) +} + +/** + * Get zoom scale + * + * @return {Float} zoom scale + */ +SvgPanZoom.prototype.getZoom = function() { + return this.viewport.getZoom() +} + +/** + * Get zoom scale for public usage + * + * @return {Float} zoom scale + */ +SvgPanZoom.prototype.getRelativeZoom = function() { + return this.viewport.getRelativeZoom() +} + +/** + * Compute actual zoom from public zoom + * + * @param {Float} zoom + * @return {Float} zoom scale + */ +SvgPanZoom.prototype.computeFromRelativeZoom = function(zoom) { + return zoom * this.viewport.getOriginalState().zoom +} + +/** + * Set zoom to initial state + */ +SvgPanZoom.prototype.resetZoom = function() { + var originalState = this.viewport.getOriginalState() + + this.zoom(originalState.zoom, true); +} + +/** + * Set pan to initial state + */ +SvgPanZoom.prototype.resetPan = function() { + this.pan(this.viewport.getOriginalState()); +} + +/** + * Set pan and zoom to initial state + */ +SvgPanZoom.prototype.reset = function() { + this.resetZoom() + this.resetPan() +} + +/** + * Handle double click event + * See handleMouseDown() for alternate detection method + * + * @param {Event} evt + */ +SvgPanZoom.prototype.handleDblClick = function(evt) { + if (this.options.preventMouseEventsDefault) { + if (evt.preventDefault) { + evt.preventDefault() + } else { + evt.returnValue = false + } + } + + // Check if target was a control button + if (this.options.controlIconsEnabled) { + var targetClass = evt.target.getAttribute('class') || '' + if (targetClass.indexOf('svg-pan-zoom-control') > -1) { + return false + } + } + + var zoomFactor + + if (evt.shiftKey) { + zoomFactor = 1/((1 + this.options.zoomScaleSensitivity) * 2) // zoom out when shift key pressed + } else { + zoomFactor = (1 + this.options.zoomScaleSensitivity) * 2 + } + + var point = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(this.svg.getScreenCTM().inverse()) + this.zoomAtPoint(zoomFactor, point) +} + +/** + * Handle click event + * + * @param {Event} evt + */ +SvgPanZoom.prototype.handleMouseDown = function(evt, prevEvt) { + if (this.options.preventMouseEventsDefault) { + if (evt.preventDefault) { + evt.preventDefault() + } else { + evt.returnValue = false + } + } + + Utils.mouseAndTouchNormalize(evt, this.svg) + + // Double click detection; more consistent than ondblclick + if (this.options.dblClickZoomEnabled && Utils.isDblClick(evt, prevEvt)){ + this.handleDblClick(evt) + } else { + // Pan mode + this.state = 'pan' + this.firstEventCTM = this.viewport.getCTM() + this.stateOrigin = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(this.firstEventCTM.inverse()) + } +} + +/** + * Handle mouse move event + * + * @param {Event} evt + */ +SvgPanZoom.prototype.handleMouseMove = function(evt) { + if (this.options.preventMouseEventsDefault) { + if (evt.preventDefault) { + evt.preventDefault() + } else { + evt.returnValue = false + } + } + + if (this.state === 'pan' && this.options.panEnabled) { + // Pan mode + var point = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(this.firstEventCTM.inverse()) + , viewportCTM = this.firstEventCTM.translate(point.x - this.stateOrigin.x, point.y - this.stateOrigin.y) + + this.viewport.setCTM(viewportCTM) + } +} + +/** + * Handle mouse button release event + * + * @param {Event} evt + */ +SvgPanZoom.prototype.handleMouseUp = function(evt) { + if (this.options.preventMouseEventsDefault) { + if (evt.preventDefault) { + evt.preventDefault() + } else { + evt.returnValue = false + } + } + + if (this.state === 'pan') { + // Quit pan mode + this.state = 'none' + } +} + +/** + * Adjust viewport size (only) so it will fit in SVG + * Does not center image + */ +SvgPanZoom.prototype.fit = function() { + var viewBox = this.viewport.getViewBox() + , newScale = Math.min(this.width/viewBox.width, this.height/viewBox.height) + + this.zoom(newScale, true) +} + +/** + * Adjust viewport size (only) so it will contain the SVG + * Does not center image + */ +SvgPanZoom.prototype.contain = function() { + var viewBox = this.viewport.getViewBox() + , newScale = Math.max(this.width/viewBox.width, this.height/viewBox.height) + + this.zoom(newScale, true) +} + +/** + * Adjust viewport pan (only) so it will be centered in SVG + * Does not zoom/fit/contain image + */ +SvgPanZoom.prototype.center = function() { + var viewBox = this.viewport.getViewBox() + , offsetX = (this.width - (viewBox.width + viewBox.x * 2) * this.getZoom()) * 0.5 + , offsetY = (this.height - (viewBox.height + viewBox.y * 2) * this.getZoom()) * 0.5 + + this.getPublicInstance().pan({x: offsetX, y: offsetY}) +} + +/** + * Update content cached BorderBox + * Use when viewport contents change + */ +SvgPanZoom.prototype.updateBBox = function() { + this.viewport.simpleViewBoxCache() +} + +/** + * Pan to a rendered position + * + * @param {Object} point {x: 0, y: 0} + */ +SvgPanZoom.prototype.pan = function(point) { + var viewportCTM = this.viewport.getCTM() + viewportCTM.e = point.x + viewportCTM.f = point.y + this.viewport.setCTM(viewportCTM) +} + +/** + * Relatively pan the graph by a specified rendered position vector + * + * @param {Object} point {x: 0, y: 0} + */ +SvgPanZoom.prototype.panBy = function(point) { + var viewportCTM = this.viewport.getCTM() + viewportCTM.e += point.x + viewportCTM.f += point.y + this.viewport.setCTM(viewportCTM) +} + +/** + * Get pan vector + * + * @return {Object} {x: 0, y: 0} + */ +SvgPanZoom.prototype.getPan = function() { + var state = this.viewport.getState() + + return {x: state.x, y: state.y} +} + +/** + * Recalculates cached svg dimensions and controls position + */ +SvgPanZoom.prototype.resize = function() { + // Get dimensions + var boundingClientRectNormalized = SvgUtils.getBoundingClientRectNormalized(this.svg) + this.width = boundingClientRectNormalized.width + this.height = boundingClientRectNormalized.height + + // Recalculate original state + var viewport = this.viewport + viewport.options.width = this.width + viewport.options.height = this.height + viewport.processCTM() + + // Reposition control icons by re-enabling them + if (this.options.controlIconsEnabled) { + this.getPublicInstance().disableControlIcons() + this.getPublicInstance().enableControlIcons() + } +} + +/** + * Unbind mouse events, free callbacks and destroy public instance + */ +SvgPanZoom.prototype.destroy = function() { + var that = this + + // Free callbacks + this.beforeZoom = null + this.onZoom = null + this.beforePan = null + this.onPan = null + this.onUpdatedCTM = null + + // Destroy custom event handlers + if (this.options.customEventsHandler != null) { // jshint ignore:line + this.options.customEventsHandler.destroy({ + svgElement: this.svg + , eventsListenerElement: this.options.eventsListenerElement + , instance: this.getPublicInstance() + }) + } + + // Unbind eventListeners + for (var event in this.eventListeners) { + (this.options.eventsListenerElement || this.svg) + .removeEventListener(event, this.eventListeners[event], false) + } + + // Unbind wheelListener + this.disableMouseWheelZoom() + + // Remove control icons + this.getPublicInstance().disableControlIcons() + + // Reset zoom and pan + this.reset() + + // Remove instance from instancesStore + instancesStore = instancesStore.filter(function(instance){ + return instance.svg !== that.svg + }) + + // Delete options and its contents + delete this.options + + // Delete viewport to make public shadow viewport functions uncallable + delete this.viewport + + // Destroy public instance and rewrite getPublicInstance + delete this.publicInstance + delete this.pi + this.getPublicInstance = function(){ + return null + } +} + +/** + * Returns a public instance object + * + * @return {Object} Public instance object + */ +SvgPanZoom.prototype.getPublicInstance = function() { + var that = this + + // Create cache + if (!this.publicInstance) { + this.publicInstance = this.pi = { + // Pan + enablePan: function() {that.options.panEnabled = true; return that.pi} + , disablePan: function() {that.options.panEnabled = false; return that.pi} + , isPanEnabled: function() {return !!that.options.panEnabled} + , pan: function(point) {that.pan(point); return that.pi} + , panBy: function(point) {that.panBy(point); return that.pi} + , getPan: function() {return that.getPan()} + // Pan event + , setBeforePan: function(fn) {that.options.beforePan = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi} + , setOnPan: function(fn) {that.options.onPan = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi} + // Zoom and Control Icons + , enableZoom: function() {that.options.zoomEnabled = true; return that.pi} + , disableZoom: function() {that.options.zoomEnabled = false; return that.pi} + , isZoomEnabled: function() {return !!that.options.zoomEnabled} + , enableControlIcons: function() { + if (!that.options.controlIconsEnabled) { + that.options.controlIconsEnabled = true + ControlIcons.enable(that) + } + return that.pi + } + , disableControlIcons: function() { + if (that.options.controlIconsEnabled) { + that.options.controlIconsEnabled = false; + ControlIcons.disable(that) + } + return that.pi + } + , isControlIconsEnabled: function() {return !!that.options.controlIconsEnabled} + // Double click zoom + , enableDblClickZoom: function() {that.options.dblClickZoomEnabled = true; return that.pi} + , disableDblClickZoom: function() {that.options.dblClickZoomEnabled = false; return that.pi} + , isDblClickZoomEnabled: function() {return !!that.options.dblClickZoomEnabled} + // Mouse wheel zoom + , enableMouseWheelZoom: function() {that.enableMouseWheelZoom(); return that.pi} + , disableMouseWheelZoom: function() {that.disableMouseWheelZoom(); return that.pi} + , isMouseWheelZoomEnabled: function() {return !!that.options.mouseWheelZoomEnabled} + // Zoom scale and bounds + , setZoomScaleSensitivity: function(scale) {that.options.zoomScaleSensitivity = scale; return that.pi} + , setMinZoom: function(zoom) {that.options.minZoom = zoom; return that.pi} + , setMaxZoom: function(zoom) {that.options.maxZoom = zoom; return that.pi} + // Zoom event + , setBeforeZoom: function(fn) {that.options.beforeZoom = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi} + , setOnZoom: function(fn) {that.options.onZoom = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi} + // Zooming + , zoom: function(scale) {that.publicZoom(scale, true); return that.pi} + , zoomBy: function(scale) {that.publicZoom(scale, false); return that.pi} + , zoomAtPoint: function(scale, point) {that.publicZoomAtPoint(scale, point, true); return that.pi} + , zoomAtPointBy: function(scale, point) {that.publicZoomAtPoint(scale, point, false); return that.pi} + , zoomIn: function() {this.zoomBy(1 + that.options.zoomScaleSensitivity); return that.pi} + , zoomOut: function() {this.zoomBy(1 / (1 + that.options.zoomScaleSensitivity)); return that.pi} + , getZoom: function() {return that.getRelativeZoom()} + // CTM update + , setOnUpdatedCTM: function(fn) {that.options.onUpdatedCTM = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi} + // Reset + , resetZoom: function() {that.resetZoom(); return that.pi} + , resetPan: function() {that.resetPan(); return that.pi} + , reset: function() {that.reset(); return that.pi} + // Fit, Contain and Center + , fit: function() {that.fit(); return that.pi} + , contain: function() {that.contain(); return that.pi} + , center: function() {that.center(); return that.pi} + // Size and Resize + , updateBBox: function() {that.updateBBox(); return that.pi} + , resize: function() {that.resize(); return that.pi} + , getSizes: function() { + return { + width: that.width + , height: that.height + , realZoom: that.getZoom() + , viewBox: that.viewport.getViewBox() + } + } + // Destroy + , destroy: function() {that.destroy(); return that.pi} + } + } + + return this.publicInstance +} + +/** + * Stores pairs of instances of SvgPanZoom and SVG + * Each pair is represented by an object {svg: SVGSVGElement, instance: SvgPanZoom} + * + * @type {Array} + */ +var instancesStore = [] + +var svgPanZoom = function(elementOrSelector, options){ + var svg = Utils.getSvg(elementOrSelector) + + if (svg === null) { + return null + } else { + // Look for existent instance + for(var i = instancesStore.length - 1; i >= 0; i--) { + if (instancesStore[i].svg === svg) { + return instancesStore[i].instance.getPublicInstance() + } + } + + // If instance not found - create one + instancesStore.push({ + svg: svg + , instance: new SvgPanZoom(svg, options) + }) + + // Return just pushed instance + return instancesStore[instancesStore.length - 1].instance.getPublicInstance() + } +} + +module.exports = svgPanZoom; + +},{"./control-icons":2,"./shadow-viewport":3,"./svg-utilities":5,"./uniwheel":6,"./utilities":7}],5:[function(require,module,exports){ +var Utils = require('./utilities') + , _browser = 'unknown' + ; + +// http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser +if (/*@cc_on!@*/false || !!document.documentMode) { // internet explorer + _browser = 'ie'; +} + +module.exports = { + svgNS: 'http://www.w3.org/2000/svg' +, xmlNS: 'http://www.w3.org/XML/1998/namespace' +, xmlnsNS: 'http://www.w3.org/2000/xmlns/' +, xlinkNS: 'http://www.w3.org/1999/xlink' +, evNS: 'http://www.w3.org/2001/xml-events' + + /** + * Get svg dimensions: width and height + * + * @param {SVGSVGElement} svg + * @return {Object} {width: 0, height: 0} + */ +, getBoundingClientRectNormalized: function(svg) { + if (svg.clientWidth && svg.clientHeight) { + return {width: svg.clientWidth, height: svg.clientHeight} + } else if (!!svg.getBoundingClientRect()) { + return svg.getBoundingClientRect(); + } else { + throw new Error('Cannot get BoundingClientRect for SVG.'); + } + } + + /** + * Gets g element with class of "viewport" or creates it if it doesn't exist + * + * @param {SVGSVGElement} svg + * @return {SVGElement} g (group) element + */ +, getOrCreateViewport: function(svg, selector) { + var viewport = null + + if (Utils.isElement(selector)) { + viewport = selector + } else { + viewport = svg.querySelector(selector) + } + + // Check if there is just one main group in SVG + if (!viewport) { + var childNodes = Array.prototype.slice.call(svg.childNodes || svg.children).filter(function(el){ + return el.nodeName !== 'defs' && el.nodeName !== '#text' + }) + + // Node name should be SVGGElement and should have no transform attribute + // Groups with transform are not used as viewport because it involves parsing of all transform possibilities + if (childNodes.length === 1 && childNodes[0].nodeName === 'g' && childNodes[0].getAttribute('transform') === null) { + viewport = childNodes[0] + } + } + + // If no favorable group element exists then create one + if (!viewport) { + var viewportId = 'viewport-' + new Date().toISOString().replace(/\D/g, ''); + viewport = document.createElementNS(this.svgNS, 'g'); + viewport.setAttribute('id', viewportId); + + // Internet Explorer (all versions?) can't use childNodes, but other browsers prefer (require?) using childNodes + var svgChildren = svg.childNodes || svg.children; + if (!!svgChildren && svgChildren.length > 0) { + for (var i = svgChildren.length; i > 0; i--) { + // Move everything into viewport except defs + if (svgChildren[svgChildren.length - i].nodeName !== 'defs') { + viewport.appendChild(svgChildren[svgChildren.length - i]); + } + } + } + svg.appendChild(viewport); + } + + // Parse class names + var classNames = []; + if (viewport.getAttribute('class')) { + classNames = viewport.getAttribute('class').split(' ') + } + + // Set class (if not set already) + if (!~classNames.indexOf('svg-pan-zoom_viewport')) { + classNames.push('svg-pan-zoom_viewport') + viewport.setAttribute('class', classNames.join(' ')) + } + + return viewport + } + + /** + * Set SVG attributes + * + * @param {SVGSVGElement} svg + */ + , setupSvgAttributes: function(svg) { + // Setting default attributes + svg.setAttribute('xmlns', this.svgNS); + svg.setAttributeNS(this.xmlnsNS, 'xmlns:xlink', this.xlinkNS); + svg.setAttributeNS(this.xmlnsNS, 'xmlns:ev', this.evNS); + + // Needed for Internet Explorer, otherwise the viewport overflows + if (svg.parentNode !== null) { + var style = svg.getAttribute('style') || ''; + if (style.toLowerCase().indexOf('overflow') === -1) { + svg.setAttribute('style', 'overflow: hidden; ' + style); + } + } + } + +/** + * How long Internet Explorer takes to finish updating its display (ms). + */ +, internetExplorerRedisplayInterval: 300 + +/** + * Forces the browser to redisplay all SVG elements that rely on an + * element defined in a 'defs' section. It works globally, for every + * available defs element on the page. + * The throttling is intentionally global. + * + * This is only needed for IE. It is as a hack to make markers (and 'use' elements?) + * visible after pan/zoom when there are multiple SVGs on the page. + * See bug report: https://connect.microsoft.com/IE/feedback/details/781964/ + * also see svg-pan-zoom issue: https://github.com/ariutta/svg-pan-zoom/issues/62 + */ +, refreshDefsGlobal: Utils.throttle(function() { + var allDefs = document.querySelectorAll('defs'); + var allDefsCount = allDefs.length; + for (var i = 0; i < allDefsCount; i++) { + var thisDefs = allDefs[i]; + thisDefs.parentNode.insertBefore(thisDefs, thisDefs); + } + }, this.internetExplorerRedisplayInterval) + + /** + * Sets the current transform matrix of an element + * + * @param {SVGElement} element + * @param {SVGMatrix} matrix CTM + * @param {SVGElement} defs + */ +, setCTM: function(element, matrix, defs) { + var that = this + , s = 'matrix(' + matrix.a + ',' + matrix.b + ',' + matrix.c + ',' + matrix.d + ',' + matrix.e + ',' + matrix.f + ')'; + + element.setAttributeNS(null, 'transform', s); + if ('transform' in element.style) { + element.style.transform = s; + } else if ('-ms-transform' in element.style) { + element.style['-ms-transform'] = s; + } else if ('-webkit-transform' in element.style) { + element.style['-webkit-transform'] = s; + } + + // IE has a bug that makes markers disappear on zoom (when the matrix "a" and/or "d" elements change) + // see http://stackoverflow.com/questions/17654578/svg-marker-does-not-work-in-ie9-10 + // and http://srndolha.wordpress.com/2013/11/25/svg-line-markers-may-disappear-in-internet-explorer-11/ + if (_browser === 'ie' && !!defs) { + // this refresh is intended for redisplaying the SVG during zooming + defs.parentNode.insertBefore(defs, defs); + // this refresh is intended for redisplaying the other SVGs on a page when panning a given SVG + // it is also needed for the given SVG itself, on zoomEnd, if the SVG contains any markers that + // are located under any other element(s). + window.setTimeout(function() { + that.refreshDefsGlobal(); + }, that.internetExplorerRedisplayInterval); + } + } + + /** + * Instantiate an SVGPoint object with given event coordinates + * + * @param {Event} evt + * @param {SVGSVGElement} svg + * @return {SVGPoint} point + */ +, getEventPoint: function(evt, svg) { + var point = svg.createSVGPoint() + + Utils.mouseAndTouchNormalize(evt, svg) + + point.x = evt.clientX + point.y = evt.clientY + + return point + } + + /** + * Get SVG center point + * + * @param {SVGSVGElement} svg + * @return {SVGPoint} + */ +, getSvgCenterPoint: function(svg, width, height) { + return this.createSVGPoint(svg, width / 2, height / 2) + } + + /** + * Create a SVGPoint with given x and y + * + * @param {SVGSVGElement} svg + * @param {Number} x + * @param {Number} y + * @return {SVGPoint} + */ +, createSVGPoint: function(svg, x, y) { + var point = svg.createSVGPoint() + point.x = x + point.y = y + + return point + } +} + +},{"./utilities":7}],6:[function(require,module,exports){ +// uniwheel 0.1.2 (customized) +// A unified cross browser mouse wheel event handler +// https://github.com/teemualap/uniwheel + +module.exports = (function(){ + + //Full details: https://developer.mozilla.org/en-US/docs/Web/Reference/Events/wheel + + var prefix = "", _addEventListener, _removeEventListener, onwheel, support, fns = []; + + // detect event model + if ( window.addEventListener ) { + _addEventListener = "addEventListener"; + _removeEventListener = "removeEventListener"; + } else { + _addEventListener = "attachEvent"; + _removeEventListener = "detachEvent"; + prefix = "on"; + } + + // detect available wheel event + support = "onwheel" in document.createElement("div") ? "wheel" : // Modern browsers support "wheel" + document.onmousewheel !== undefined ? "mousewheel" : // Webkit and IE support at least "mousewheel" + "DOMMouseScroll"; // let's assume that remaining browsers are older Firefox + + + function createCallback(element,callback,capture) { + + var fn = function(originalEvent) { + + !originalEvent && ( originalEvent = window.event ); + + // create a normalized event object + var event = { + // keep a ref to the original event object + originalEvent: originalEvent, + target: originalEvent.target || originalEvent.srcElement, + type: "wheel", + deltaMode: originalEvent.type == "MozMousePixelScroll" ? 0 : 1, + deltaX: 0, + delatZ: 0, + preventDefault: function() { + originalEvent.preventDefault ? + originalEvent.preventDefault() : + originalEvent.returnValue = false; + } + }; + + // calculate deltaY (and deltaX) according to the event + if ( support == "mousewheel" ) { + event.deltaY = - 1/40 * originalEvent.wheelDelta; + // Webkit also support wheelDeltaX + originalEvent.wheelDeltaX && ( event.deltaX = - 1/40 * originalEvent.wheelDeltaX ); + } else { + event.deltaY = originalEvent.detail; + } + + // it's time to fire the callback + return callback( event ); + + }; + + fns.push({ + element: element, + fn: fn, + capture: capture + }); + + return fn; + } + + function getCallback(element,capture) { + for (var i = 0; i < fns.length; i++) { + if (fns[i].element === element && fns[i].capture === capture) { + return fns[i].fn; + } + } + return function(){}; + } + + function removeCallback(element,capture) { + for (var i = 0; i < fns.length; i++) { + if (fns[i].element === element && fns[i].capture === capture) { + return fns.splice(i,1); + } + } + } + + function _addWheelListener( elem, eventName, callback, useCapture ) { + + var cb; + + if (support === "wheel") { + cb = callback; + } else { + cb = createCallback(elem,callback,useCapture); + } + + elem[ _addEventListener ]( prefix + eventName, cb, useCapture || false ); + + } + + function _removeWheelListener( elem, eventName, callback, useCapture ) { + + var cb; + + if (support === "wheel") { + cb = callback; + } else { + cb = getCallback(elem,useCapture); + } + + elem[ _removeEventListener ]( prefix + eventName, cb, useCapture || false ); + + removeCallback(elem,useCapture); + + } + + function addWheelListener( elem, callback, useCapture ) { + _addWheelListener( elem, support, callback, useCapture ); + + // handle MozMousePixelScroll in older Firefox + if( support == "DOMMouseScroll" ) { + _addWheelListener( elem, "MozMousePixelScroll", callback, useCapture); + } + } + + function removeWheelListener(elem,callback,useCapture){ + _removeWheelListener(elem,support,callback,useCapture); + + // handle MozMousePixelScroll in older Firefox + if( support == "DOMMouseScroll" ) { + _removeWheelListener(elem, "MozMousePixelScroll", callback, useCapture); + } + } + + return { + on: addWheelListener, + off: removeWheelListener + }; + +})(); + +},{}],7:[function(require,module,exports){ +module.exports = { + /** + * Extends an object + * + * @param {Object} target object to extend + * @param {Object} source object to take properties from + * @return {Object} extended object + */ + extend: function(target, source) { + target = target || {}; + for (var prop in source) { + // Go recursively + if (this.isObject(source[prop])) { + target[prop] = this.extend(target[prop], source[prop]) + } else { + target[prop] = source[prop] + } + } + return target; + } + + /** + * Checks if an object is a DOM element + * + * @param {Object} o HTML element or String + * @return {Boolean} returns true if object is a DOM element + */ +, isElement: function(o){ + return ( + o instanceof HTMLElement || o instanceof SVGElement || o instanceof SVGSVGElement || //DOM2 + (o && typeof o === 'object' && o !== null && o.nodeType === 1 && typeof o.nodeName === 'string') + ); + } + + /** + * Checks if an object is an Object + * + * @param {Object} o Object + * @return {Boolean} returns true if object is an Object + */ +, isObject: function(o){ + return Object.prototype.toString.call(o) === '[object Object]'; + } + + /** + * Checks if variable is Number + * + * @param {Integer|Float} n + * @return {Boolean} returns true if variable is Number + */ +, isNumber: function(n) { + return !isNaN(parseFloat(n)) && isFinite(n); + } + + /** + * Search for an SVG element + * + * @param {Object|String} elementOrSelector DOM Element or selector String + * @return {Object|Null} SVG or null + */ +, getSvg: function(elementOrSelector) { + var element + , svg; + + if (!this.isElement(elementOrSelector)) { + // If selector provided + if (typeof elementOrSelector === 'string' || elementOrSelector instanceof String) { + // Try to find the element + element = document.querySelector(elementOrSelector) + + if (!element) { + throw new Error('Provided selector did not find any elements. Selector: ' + elementOrSelector) + return null + } + } else { + throw new Error('Provided selector is not an HTML object nor String') + return null + } + } else { + element = elementOrSelector + } + + if (element.tagName.toLowerCase() === 'svg') { + svg = element; + } else { + if (element.tagName.toLowerCase() === 'object') { + svg = element.contentDocument.documentElement; + } else { + if (element.tagName.toLowerCase() === 'embed') { + svg = element.getSVGDocument().documentElement; + } else { + if (element.tagName.toLowerCase() === 'img') { + throw new Error('Cannot script an SVG in an "img" element. Please use an "object" element or an in-line SVG.'); + } else { + throw new Error('Cannot get SVG.'); + } + return null + } + } + } + + return svg + } + + /** + * Attach a given context to a function + * @param {Function} fn Function + * @param {Object} context Context + * @return {Function} Function with certain context + */ +, proxy: function(fn, context) { + return function() { + return fn.apply(context, arguments) + } + } + + /** + * Returns object type + * Uses toString that returns [object SVGPoint] + * And than parses object type from string + * + * @param {Object} o Any object + * @return {String} Object type + */ +, getType: function(o) { + return Object.prototype.toString.apply(o).replace(/^\[object\s/, '').replace(/\]$/, '') + } + + /** + * If it is a touch event than add clientX and clientY to event object + * + * @param {Event} evt + * @param {SVGSVGElement} svg + */ +, mouseAndTouchNormalize: function(evt, svg) { + // If no clientX then fallback + if (evt.clientX === void 0 || evt.clientX === null) { + // Fallback + evt.clientX = 0 + evt.clientY = 0 + + // If it is a touch event + if (evt.touches !== void 0 && evt.touches.length) { + if (evt.touches[0].clientX !== void 0) { + evt.clientX = evt.touches[0].clientX + evt.clientY = evt.touches[0].clientY + } else if (evt.touches[0].pageX !== void 0) { + var rect = svg.getBoundingClientRect(); + + evt.clientX = evt.touches[0].pageX - rect.left + evt.clientY = evt.touches[0].pageY - rect.top + } + // If it is a custom event + } else if (evt.originalEvent !== void 0) { + if (evt.originalEvent.clientX !== void 0) { + evt.clientX = evt.originalEvent.clientX + evt.clientY = evt.originalEvent.clientY + } + } + } + } + + /** + * Check if an event is a double click/tap + * TODO: For touch gestures use a library (hammer.js) that takes in account other events + * (touchmove and touchend). It should take in account tap duration and traveled distance + * + * @param {Event} evt + * @param {Event} prevEvt Previous Event + * @return {Boolean} + */ +, isDblClick: function(evt, prevEvt) { + // Double click detected by browser + if (evt.detail === 2) { + return true; + } + // Try to compare events + else if (prevEvt !== void 0 && prevEvt !== null) { + var timeStampDiff = evt.timeStamp - prevEvt.timeStamp // should be lower than 250 ms + , touchesDistance = Math.sqrt(Math.pow(evt.clientX - prevEvt.clientX, 2) + Math.pow(evt.clientY - prevEvt.clientY, 2)) + + return timeStampDiff < 250 && touchesDistance < 10 + } + + // Nothing found + return false; + } + + /** + * Returns current timestamp as an integer + * + * @return {Number} + */ +, now: Date.now || function() { + return new Date().getTime(); + } + + // From underscore. + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. +// jscs:disable +// jshint ignore:start +, throttle: function(func, wait, options) { + var that = this; + var context, args, result; + var timeout = null; + var previous = 0; + if (!options) options = {}; + var later = function() { + previous = options.leading === false ? 0 : that.now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + return function() { + var now = that.now(); + if (!previous && options.leading === false) previous = now; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + } +// jshint ignore:end +// jscs:enable + + /** + * Create a requestAnimationFrame simulation + * + * @param {Number|String} refreshRate + * @return {Function} + */ +, createRequestAnimationFrame: function(refreshRate) { + var timeout = null + + // Convert refreshRate to timeout + if (refreshRate !== 'auto' && refreshRate < 60 && refreshRate > 1) { + timeout = Math.floor(1000 / refreshRate) + } + + if (timeout === null) { + return window.requestAnimationFrame || requestTimeout(33) + } else { + return requestTimeout(timeout) + } + } +} + +/** + * Create a callback that will execute after a given timeout + * + * @param {Function} timeout + * @return {Function} + */ +function requestTimeout(timeout) { + return function(callback) { + window.setTimeout(callback, timeout) + } +} + +},{}]},{},[1]); + diff --git a/GraphEditor/package.json b/GraphEditor/package.json new file mode 100644 index 0000000..83a18e2 --- /dev/null +++ b/GraphEditor/package.json @@ -0,0 +1,14 @@ +{ + "app":"GraphEditor", + "name":"Graph Editor", + "description":"Create graph with dot language or mermaid", + "info":{ + "author": "Xuan Sang LE", + "email": "xsang.le@gmail.com", + "licences": "GPLv3" + }, + "version":"0.0.4-a", + "category":"Office", + "iconclass": "fa fa-sitemap", + "mimes":["text/.*graphviz"] +} diff --git a/GraphEditor/project.apj b/GraphEditor/project.apj new file mode 100644 index 0000000..e3a0194 --- /dev/null +++ b/GraphEditor/project.apj @@ -0,0 +1 @@ +{"name":"GraphEditor","root":"home://workspace/GraphEditor","css":["css/main.css"],"javascripts":["javascripts/svg-pan-zoom.js","javascripts/mermaidAPI.min.js"],"coffees":["coffees/main.coffee"],"copies":["assets/scheme.html","package.json","README.md"]} \ No newline at end of file diff --git a/OpenPage/build/debug/OpenPage.md b/OpenPage/build/debug/OpenPage.md new file mode 100644 index 0000000..d9dfca7 --- /dev/null +++ b/OpenPage/build/debug/OpenPage.md @@ -0,0 +1,14 @@ +![](https://os.lxsang.me/repo/OpenPage/OpenPage.png) +# OpenPage: ODT (Open Document Text) editor alpha +**OpenPage** is an AntOS application developed in-browser using AntOSDK. It is a Pure Javascript based rich text editor compatible with Open Document Format. + +**Feature:** +* Open, view and edit *.odt* documents +* Offer various formatting style to text +* Define and apply paragraph styles +* Insert link, image +* Embeded fonts +* Save documents as ODF format so that it can be compatible with desktop applications like Open Office + +**Credit:** +OpenPage is heavily based on the WebODF javascript library: https://webodf.org \ No newline at end of file diff --git a/OpenPage/build/debug/blank.odt b/OpenPage/build/debug/blank.odt new file mode 100644 index 0000000..2414e6f Binary files /dev/null and b/OpenPage/build/debug/blank.odt differ diff --git a/OpenPage/build/debug/icon.png b/OpenPage/build/debug/icon.png new file mode 100644 index 0000000..1dceb3d Binary files /dev/null and b/OpenPage/build/debug/icon.png differ diff --git a/OpenPage/build/debug/main.css b/OpenPage/build/debug/main.css new file mode 100644 index 0000000..2dc7edf --- /dev/null +++ b/OpenPage/build/debug/main.css @@ -0,0 +1,109 @@ + +@namespace office url(urn:oasis:names:tc:opendocument:xmlns:office:1.0); +afx-app-window[data-id="OpenPage"] div[data-id="container"] +{ + overflow: auto; + margin:0px; + padding:0px; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + background-color: #f2f1f0; + /*position: relative;*/ +} + +/* +@media screen, print, handheld, projection +{ + office|body{ + display: inline !important; + } +}*/ + + +/* +Fix annotation problem not showing +*/ +/* +afx-app-window[data-id="OpenPage"] document, afx-app-window[data-id="OpenPage"] office:body{ + display: inline !important; +} +afx-app-window[data-id="OpenPage"] .annotationsPane{ + right: 0 !important; + top: 0 !important; + position: absolute !important; +}*/ +afx-app-window[data-id="OpenPage"] div[data-id="odfcanvas"] +{ + cursor: text; + margin:auto; + box-shadow: 1px 1px 3px 3px #9f9F9F; + /*added*/ + transform-origin: top center; + -webkit-transform-origin: top center; + -moz-transform-origin: top center; + -o-transform-origin: top center; + overflow: hidden; +} + +afx-app-window[data-id="OpenPage"] afx-hbox[data-id="toolbox"] +{ + background-color: #f5f5f5; + border: 1px solid #eaeaea; + box-shadow: 3px 3px 3px #9f9F9F; +} +afx-app-window[data-id="OpenPage"] afx-hbox[data-id="status-bar"] +{ + background-color: #f5f5f5; + border: 1px solid #eaeaea; + box-shadow: -3px -3px 3px #9f9F9F; +} +afx-app-window[data-id="OpenPage"] afx-hbox[data-id="toolbox"] afx-button button, afx-app-window[data-id="OpenPage"] afx-button[data-id="btzoomfix"] button +{ + border: 1px solid #f5f5f5; + background-color: transparent; + width:100%; + height: 100%; +} + +afx-app-window[data-id="OpenPage"] afx-hbox[data-id="toolbox"] afx-button button:hover, afx-app-window[data-id="OpenPage"] afx-hbox[data-id="toolbox"] afx-button button.btactive, afx-app-window[data-id="OpenPage"] afx-button[data-id="btzoomfix"] button:hover +{ + border: 1px solid #759DC0; + background-color: transparent; + border-radius:5px; + color:#759DC0; +} + + +afx-app-window[data-id="HyperLinkDialog"] afx-label.header span +{ + font-weight: bold; +} +afx-app-window[data-id="FormatDialog"] afx-label.header +{ + padding-left: 5px; + border-bottom: 1px solid #a6a6a6; +} +afx-app-window[data-id="FormatDialog"] afx-label.header span +{ + font-weight: bold; +} +afx-app-window[data-id="FormatDialog"] afx-hbox[data-id="aligmentbox"] afx-label span, +afx-app-window[data-id="FormatDialog"] afx-hbox[data-id="spacingbox"] afx-label span, +afx-app-window[data-id="FormatDialog"] afx-hbox[data-id="stylebox"] afx-label span, +afx-app-window[data-id="FormatDialog"] afx-hbox[data-id="font-box"] > div > afx-label span +{ + display: block; + padding-top: 7px; +} + +afx-app-window[data-id="FormatDialog"] div[data-id="preview"] +{ + border: 1px solid #a6a6a6; +} +afx-app-window[data-id="FormatDialog"] div[data-id="txtcolor"], +afx-app-window[data-id="FormatDialog"] div[data-id="bgcolor"] +{ + border:1px solid #a6a6a6; + display: block; +} \ No newline at end of file diff --git a/OpenPage/build/debug/main.js b/OpenPage/build/debug/main.js new file mode 100644 index 0000000..9a9b769 --- /dev/null +++ b/OpenPage/build/debug/main.js @@ -0,0 +1,2771 @@ +(function() { + var FormatDialog, HyperLinkDialog, OpenPage; + + OpenPage = class OpenPage extends this.OS.GUI.BaseApplication { + constructor(args) { + super("OpenPage", args); + } + + main() { + var me; + // load session class + //if not OpenPage.EditorSession + // require ["webodf/editor/EditorSession"], (ES) -> + // OpenPage.EditorSession = ES + me = this; + this.eventSubscriptions = new core.EventSubscriptions(); + this.initToolbox(); + this.userid = `${this.systemsetting.user.username}@${this.pid}`; + //file = "home://welcome.odt" + //file = "#{@_api.handler.get}/home://welcome.odt" + //@canvas.load file + //odfContainer = new odf.OdfContainer file, (c) -> + // me.canvas.setOdfContainer c, false + this.currentStyle = ""; + if (this.args && this.args.length > 0) { + this.open(this.args[0]); + } else { + this.newdoc(); + } + this.resource = { + fonts: [], + formats: [] + }; + this.bindKey("ALT-N", function() { + return me.actionFile(`${me.name}-New`); + }); + this.bindKey("ALT-O", function() { + return me.actionFile(`${me.name}-Open`); + }); + this.bindKey("CTRL-S", function() { + return me.actionFile(`${me.name}-Save`); + }); + return this.bindKey("ALT-W", function() { + return me.actionFile(`${me.name}-Saveas`); + }); + } + + menu() { + var me, menu; + me = this; + menu = [ + { + text: "__(File)", + child: [ + { + text: "__(New)", + dataid: `${this.name}-New`, + shortcut: "A-N" + }, + { + text: "__(Open)", + dataid: `${this.name}-Open`, + shortcut: "A-O" + }, + { + text: "__(Save)", + dataid: `${this.name}-Save`, + shortcut: "C-S" + }, + { + text: "__(Save as)", + dataid: `${this.name}-Saveas`, + shortcut: "A-W" + } + ], + onmenuselect: function(e) { + return me.actionFile(e.item.data.dataid); + } + } + ]; + return menu; + } + + actionFile(e) { + var me, saveas; + me = this; + saveas = function() { + return me.openDialog("FileDiaLog", function(d, n, p) { + me.currfile.setPath(`${d}/${n}`); + return me.save(); + }, __("Save as"), { + file: me.currfile + }); + }; + switch (e) { + case `${this.name}-Open`: + return this.openDialog("FileDiaLog", function(d, f, p) { + return me.open(p); + }, __("Open file"), { + mimes: me.meta().mimes + }); + case `${this.name}-Save`: + if (this.currfile.basename) { + //@currfile.cache = @editor.value() + return this.save(); + } + return saveas(); + case `${this.name}-Saveas`: + return saveas(); + case `${this.name}-New`: + return this.newdoc(); + } + } + + newdoc() { + var blank; + blank = `${(this.meta().path)}/blank.odt`; + return this.open(blank, true); + } + + open(p, b) { + var me; + me = this; + return this.pathAsDataURL(p).then(function(r) { + var OdfContainer; + if (me.editorSession) { + me.closeDocument(); + } + me.initCanvas(); + return OdfContainer = new odf.OdfContainer(r.data, function(c) { + me.canvas.setOdfContainer(c, false); + if (b) { + return me.currfile = "Untitled".asFileHandler(); + } + if (me.currfile) { + me.currfile.setPath(p); + } else { + me.currfile = p.asFileHandler(); + } + me.scheme.set("apptitle", me.currfile.basename); + return me.notify(__("File {0} opened", p)); + }); + }).catch(function(e) { + return me.error(__("Problem read file {0}", e)); + }); + } + + save() { + var container, me; + me = this; + if (!this.editorSession) { + return; + } + container = this.canvas.odfContainer(); + if (!container) { + return this.error(__("No document container found")); + } + return container.createByteArray(function(ba) { + // create blob + me.currfile.cache = new Blob([ba], { + type: "application/vnd.oasis.opendocument.text" + }); + return me.currfile.write("application/vnd.oasis.opendocument.text", function(r) { + if (r.error) { + return me.error(__("Cannot save file: {0}", r.error)); + } + me.notify(__("File {0} saved", me.currfile.basename)); + me.scheme.set("apptitle", me.currfile.basename); + me.currfile.dirty = false; + return me.editorFocus(); + }); + }, function(err) { + return this.error(__("Cannot create byte array from container: {0}", err || "")); + }); + } + + initToolbox() { + var el, fn, me, name, ref; + me = this; + this.basictool = { + undo: this.find("btundo"), + redo: this.find("btredo"), + bold: this.find("btbold"), + italic: this.find("btitalic"), + underline: this.find("btunderline"), + strike: this.find("btstrike"), + note: this.find("btnote"), + link: this.find("btlink"), + unlink: this.find("btunlink"), + image: this.find("btimage"), + ac: this.find("btac"), + al: this.find("btal"), + ar: this.find("btar"), + aj: this.find("btaj"), + indent: this.find("btindent"), + outdent: this.find("btoutdent"), + fonts: this.find("font-list"), + fontsize: this.find("font-size"), + styles: this.find("format-list"), + zoom: this.find("slzoom"), + format: this.find("btformat") + }; + fn = function(name, el) { + var act; + if (name === "fonts" || name === "styles") { + act = "onlistselect"; + } else if (name === "fontsize" || name === "zoom") { + act = "onchange"; + } else { + act = "onbtclick"; + } + return el.set(act, function(e) { + if (!me.directFormattingCtl) { + return; + } + if (!me[name]) { + return; + } + me[name](e); + return me.editorFocus(); + }); + }; + ref = this.basictool; + for (name in ref) { + el = ref[name]; + fn(name, el); + } + (this.find("btzoomfix")).set("onbtclick", function(e) { + return me.zoom(100); + }); + return this.basictool.zoom.set("onchanging", function(e) { + var zlb; + zlb = me.find("lbzoom"); + return zlb.set("text", Math.floor(e) + "%"); + }); + } + + initCanvas() { + var el, me; + el = this.find("odfcanvas"); + me = this; + el.setAttribute("translate", "no"); + el.classList.add("notranslate"); + this.canvas = new odf.OdfCanvas(el); + this.documentChanged = function(e) { + if (me.currfile.dirty) { + return; + } + me.currfile.dirty = true; + return me.scheme.set("apptitle", me.currfile.basename + "*"); + }; + //console.log e + this.metaChanged = function(e) { + if (me.currfile.dirty) { + return; + } + me.currfile.dirty = true; + return me.scheme.set("apptitle", me.currfile.basename + "*"); + }; + //console.log e + this.textStylingChanged = function(e) { + return me.updateToolbar(e); + }; + this.paragrahStyleChanged = function(e) { + var i, item, items, j, len, v; + if (e.type !== "style") { + return; + } + items = me.basictool.styles.get("items"); + for (i = j = 0, len = items.length; j < len; i = ++j) { + v = items[i]; + if (v.name === e.styleName) { + item = i; + } + } + me.currentStyle = e.styleName; + return me.basictool.styles.set("selected", item); + }; + this.styleAdded = function(e) { + var dtext, item, items, j, len, stylens, v; + if (e.family !== 'paragraph') { + return; + } + items = me.basictool.styles.get("items"); + for (j = 0, len = items.length; j < len; j++) { + v = items[j]; + if (v.name === e.name) { + item = v; + } + } + if (item) { + return; + } + stylens = "urn:oasis:names:tc:opendocument:xmlns:style:1.0"; + el = me.editorSession.getParagraphStyleElement(e.name); + dtext = el.getAttributeNS(stylens, 'display-name'); + return me.basictool.styles.push({ + text: dtext, + name: e.name + }, true); + }; + //me.resource.formats.push {text: dtext, name:e.name} + this.updateSlider = function(v) { + var value, zlb; + value = Math.floor(v * 100); + me.basictool.zoom.set("value", value); + zlb = me.find("lbzoom"); + return zlb.set("text", value + "%"); + }; + //me.canvas.enableAnnotations true, true + return this.canvas.addListener("statereadychange", function() { + var op, viewOptions; + me.session = new ops.Session(me.canvas); + viewOptions = { + editInfoMarkersInitiallyVisible: false, + caretAvatarsInitiallyVisible: false, + caretBlinksOnRangeSelect: true + }; + me.editorSession = new OpenPage.EditorSession(me.session, me.userid, { + viewOptions: viewOptions, + directTextStylingEnabled: true, + directParagraphStylingEnabled: true, + paragraphStyleSelectingEnabled: true, + paragraphStyleEditingEnabled: true, + imageEditingEnabled: true, + hyperlinkEditingEnabled: true, + annotationsEnabled: true, + zoomingEnabled: true, + reviewModeEnabled: false + }); + me.initFontList(me.editorSession.getDeclaredFonts()); + me.initStyles(me.editorSession.getAvailableParagraphStyles()); + //fix annotation problem on canvas + //console.log $("office:body").css "background-color", "red" + // basic format + me.directFormattingCtl = me.editorSession.sessionController.getDirectFormattingController(); + me.directFormattingCtl.subscribe(gui.DirectFormattingController.textStylingChanged, me.textStylingChanged); + me.directFormattingCtl.subscribe(gui.DirectFormattingController.paragraphStylingChanged, me.textStylingChanged); + me.editorSession.subscribe(OpenPage.EditorSession.signalParagraphChanged, me.paragrahStyleChanged); + + // hyper link controller + me.hyperlinkController = me.editorSession.sessionController.getHyperlinkController(); + me.eventSubscriptions.addFrameSubscription(me.editorSession, OpenPage.EditorSession.signalCursorMoved, function() { + return me.updateHyperlinkButtons(); + }); + me.eventSubscriptions.addFrameSubscription(me.editorSession, OpenPage.EditorSession.signalParagraphChanged, function() { + return me.updateHyperlinkButtons(); + }); + me.eventSubscriptions.addFrameSubscription(me.editorSession, OpenPage.EditorSession.signalParagraphStyleModified, function() { + return me.updateHyperlinkButtons(); + }); + + //annotation controller + me.annotationController = me.editorSession.sessionController.getAnnotationController(); + + //image controller + me.imageController = me.editorSession.sessionController.getImageController(); + //imageController.subscribe(gui.ImageController.enabledChanged, enableButtons) + + //text controller + me.textController = me.editorSession.sessionController.getTextController(); + + // zoom controller + me.zoomHelper = me.editorSession.getOdfCanvas().getZoomHelper(); + me.zoomHelper.subscribe(gui.ZoomHelper.signalZoomChanged, me.updateSlider); + me.updateSlider(me.zoomHelper.getZoomLevel()); + + // format controller + me.editorSession.subscribe(OpenPage.EditorSession.signalCommonStyleCreated, me.styleAdded); + me.editorSession.sessionController.setUndoManager(new gui.TrivialUndoManager()); + me.editorSession.sessionController.getUndoManager().subscribe(gui.UndoManager.signalDocumentModifiedChanged, me.documentChanged); + me.editorSession.sessionController.getMetadataController().subscribe(gui.MetadataController.signalMetadataChanged, me.metaChanged); + op = new ops.OpAddMember(); + op.init({ + memberid: me.userid, + setProperties: { + "fullName": me.userid, + "color": "blue" + } + }); + me.session.enqueue([op]); + me.editorSession.sessionController.insertLocalCursor(); + return me.editorSession.sessionController.startEditing(); + }); + } + + //console.log me.editorSession.getDeclaredFonts() + + initFontList(list) { + var j, l, len, len1, v; + for (j = 0, len = list.length; j < len; j++) { + v = list[j]; + v.text = v.name; + } + for (l = 0, len1 = list.length; l < len1; l++) { + v = list[l]; + this.resource.fonts.push({ + text: v.text, + name: v.family + }); + } + return this.basictool.fonts.set("items", list); + } + + initStyles(list) { + var j, l, len, len1, v; + list.unshift({ + name: "", + displayName: 'Default style' + }); + for (j = 0, len = list.length; j < len; j++) { + v = list[j]; + v.text = v.displayName; + } + for (l = 0, len1 = list.length; l < len1; l++) { + v = list[l]; + this.resource.formats.push({ + text: v.text, + name: v.name + }); + } + return this.basictool.styles.set("items", list); + } + + updateToolbar(changes) { + if (changes.hasOwnProperty('isBold')) { + // basic style + this.basictool.bold.set("selected", changes.isBold); + } + if (changes.hasOwnProperty('isItalic')) { + this.basictool.italic.set("selected", changes.isItalic); + } + if (changes.hasOwnProperty('hasUnderline')) { + this.basictool.underline.set("selected", changes.hasUnderline); + } + if (changes.hasOwnProperty('hasStrikeThrough')) { + this.basictool.strike.set("selected", changes.hasStrikeThrough); + } + if (changes.hasOwnProperty("fontSize")) { + this.basictool.fontsize.set("value", changes.fontSize); + } + if (changes.hasOwnProperty("fontName")) { + this.selectFont(changes.fontName); + } + if (changes.hasOwnProperty("isAlignedLeft")) { + //pharagraph style + this.basictool.al.set("selected", changes.isAlignedLeft); + } + if (changes.hasOwnProperty("isAlignedRight")) { + this.basictool.ar.set("selected", changes.isAlignedRight); + } + if (changes.hasOwnProperty("isAlignedCenter")) { + this.basictool.ac.set("selected", changes.isAlignedCenter); + } + if (changes.hasOwnProperty("isAlignedJustified")) { + return this.basictool.aj.set("selected", changes.isAlignedJustified); + } + } + + updateHyperlinkButtons(e) { + var selectedLinks; + selectedLinks = this.editorSession.getSelectedHyperlinks(); + return this.basictool.unlink.set("enable", selectedLinks.length > 0); + } + + selectFont(name) { + var i, item, items, j, len, v; + items = this.basictool.fonts.get("items"); + for (i = j = 0, len = items.length; j < len; i = ++j) { + v = items[i]; + if (v.name === name) { + item = i; + } + } + return this.basictool.fonts.set("selected", item); + } + + editorFocus() { + return this.editorSession.sessionController.getEventManager().focus(); + } + + bold(e) { + //console.log @, e + return this.directFormattingCtl.setBold(!this.basictool.bold.get("selected")); + } + + italic(e) { + return this.directFormattingCtl.setItalic(!this.basictool.italic.get("selected")); + } + + underline(e) { + return this.directFormattingCtl.setHasUnderline(!this.basictool.underline.get("selected")); + } + + strike(e) { + return this.directFormattingCtl.setHasStrikethrough(!this.basictool.strike.get("selected")); + } + + fonts(e) { + return this.directFormattingCtl.setFontName(e.data.name); + } + + fontsize(e) { + return this.directFormattingCtl.setFontSize(e); + } + + al(e) { + return this.directFormattingCtl.alignParagraphLeft(); + } + + ar(e) { + return this.directFormattingCtl.alignParagraphRight(); + } + + ac(e) { + return this.directFormattingCtl.alignParagraphCenter(); + } + + note(e) { + return this.annotationController.addAnnotation(); + } + + aj(e) { + return this.directFormattingCtl.alignParagraphJustified(); + } + + indent(e) { + return this.directFormattingCtl.indent(); + } + + outdent(e) { + return this.directFormattingCtl.outdent(); + } + + link(e) { + var data, linkTarget, linksInSelection, me, selection, textSerializer; + // get the link first + me = this; + textSerializer = new odf.TextSerializer(); + selection = this.editorSession.getSelectedRange(); + linksInSelection = this.editorSession.getSelectedHyperlinks(); + linkTarget = linksInSelection[0] ? odf.OdfUtils.getHyperlinkTarget(linksInSelection[0]) : "http://"; + data = { + link: linkTarget, + text: "", + readonly: true, + action: "new" + }; + if (selection && selection.collapsed && linksInSelection.length === 1) { + // selection is collapsed within a single link + // text in this case is read only + data.text = textSerializer.writeToString(linksInSelection[0]); + data.action = "edit"; + } else if (selection && !selection.collapsed) { + // user select part of link or a block of text + // user convert a selection to a link + data.text = textSerializer.writeToString(selection.cloneContents()); + } else { + data.readonly = false; + } + return this.openDialog(new HyperLinkDialog(), function(d) { + var selectedLinkRange, selectionController; + selectionController = me.editorSession.sessionController.getSelectionController(); + if (d.readonly) { + // edit the existing link + if (d.action === "edit") { + selectedLinkRange = selection.cloneRange(); + selectedLinkRange.selectNode(linksInSelection[0]); + selectionController.selectRange(selectedLinkRange, true); + } + me.hyperlinkController.removeHyperlinks(); + return me.hyperlinkController.addHyperlink(d.link); + } else { + me.hyperlinkController.addHyperlink(d.link, d.text); + linksInSelection = me.editorSession.getSelectedHyperlinks(); + selectedLinkRange = selection.cloneRange(); + selectedLinkRange.selectNode(linksInSelection[0]); + return selectionController.selectRange(selectedLinkRange, true); + } + }, "__(Insert/edit link)", data); + } + + unlink(e) { + return this.hyperlinkController.removeHyperlinks(); + } + + undo(e) { + return this.editorSession.undo(); + } + + redo(e) { + return this.editorSession.redo(); + } + + pathAsDataURL(p) { + return new Promise(function(resolve, error) { + var fp; + fp = p.asFileHandler(); + return fp.read(function(data) { + var blob, reader; + blob = new Blob([data], { + type: fp.info.mime + }); + reader = new FileReader(); + reader.onloadend = function() { + if (reader.readyState !== 2) { + return error(p); + } + return resolve({ + data: reader.result, + fp: fp + }); + }; + return reader.readAsDataURL(blob); + }, "binary"); + }); + } + + /* + if not isText + + else + fp.read (data) -> + * convert to base64 + b64 = btoa data + dataurl = "data:#{fp.info.mime};base64," + b64 + resolve { reader: {result: dataurl}, fp:fp } + */ + image(e) { + var me; + me = this; + return this.openDialog("FileDiaLog", function(d, n, p) { + return me.pathAsDataURL(p).then(function(r) { + var hiddenImage; + hiddenImage = new Image(); + hiddenImage.style.position = "absolute"; + hiddenImage.style.left = "-99999px"; + document.body.appendChild(hiddenImage); + hiddenImage.onload = function() { + var content; + content = r.data.substring(r.data.indexOf(",") + 1); + //insert image + me.textController.removeCurrentSelection(); + me.imageController.insertImage(r.fp.info.mime, content, hiddenImage.width, hiddenImage.height); + return document.body.removeChild(hiddenImage); + }; + return hiddenImage.src = r.data; + }).catch(function() { + return me.error(__("Couldnt load image {0}", p)); + }); + }, __("Select image file"), { + mimes: ["image/.*"] + }); + } + + styles(e) { + if (e.data.name === this.currentStyle) { + return; + } + return this.editorSession.setCurrentParagraphStyle(e.data.name); + } + + zoom(e) { + //console.log "zooming", e + if (!this.zoomHelper) { + return; + } + return this.zoomHelper.setZoomLevel(e / 100.0); + } + + format(e) { + return this.openDialog(new FormatDialog(), function(d) {}, __("Add/Modify paragraph format"), this.resource); + } + + closeDocument(f) { + var me, op; + // finish editing + if (!(this.editorSession && this.session)) { + return; + } + me = this; + this.eventSubscriptions.unsubscribeAll(); + this.editorSession.sessionController.endEditing(); + this.editorSession.sessionController.removeLocalCursor(); + // remove user + op = new ops.OpRemoveMember(); + op.init({ + memberid: this.userid + }); + this.session.enqueue([op]); + // close the session + return this.session.close(function(e) { + if (e) { + return me.error(__("Cannot close session {0}", e)); + } + me.editorSession.sessionController.getMetadataController().unsubscribe(gui.MetadataController.signalMetadataChanged, me.metaChanged); + me.editorSession.sessionController.getUndoManager().unsubscribe(gui.UndoManager.signalDocumentModifiedChanged, me.documentChanged); + me.directFormattingCtl.unsubscribe(gui.DirectFormattingController.textStylingChanged, me.textStylingChanged); + me.directFormattingCtl.unsubscribe(gui.DirectFormattingController.paragraphStylingChanged, me.textStylingChanged); + me.editorSession.unsubscribe(OpenPage.EditorSession.signalParagraphChanged, me.paragrahStyleChanged); + me.zoomHelper.unsubscribe(gui.ZoomHelper.signalZoomChanged, me.updateSlider); + me.editorSession.unsubscribe(OpenPage.EditorSession.signalCommonStyleCreated, me.styleAdded); + // destry editorSession + return me.editorSession.destroy(function(e) { + if (e) { + return me.error(__("Cannot destroy editor session {0}", e)); + } + me.editorSession = void 0; + // destroy session + return me.session.destroy(function(e) { + if (e) { + return me.error(__("Cannot destroy document session {0}", e)); + } + core.Async.destroyAll([me.canvas.destroy], function(e) { + if (e) { + return me.error(__("Cannot destroy canvas {0}", e)); + } + me.notify("Document closed"); + if (f) { + return f(); + } + }); + me.session = void 0; + me.annotationController = void 0; + me.directFormattingCtl = void 0; + me.textController = void 0; + me.imageController = void 0; + me.ZoomHelper = void 0; + me.metaChanged = void 0; + me.documentChanged = void 0; + me.textStylingChanged = void 0; + me.paragrahStyleChanged = void 0; + me.updateSlider = void 0; + me.styleAdded = void 0; + me.basictool.fonts.set("selected", -1); + return me.basictool.styles.set("selected", -1); + }); + }); + }); + } + + + cleanup(e) { + var me; + me = this; + if (this.editorSession) { + e.preventDefault(); + return me.closeDocument(function() { + return me.quit(); + }); + } + } + + }; + + this.OS.register("OpenPage", OpenPage); + + HyperLinkDialog = class HyperLinkDialog extends this.OS.GUI.BasicDialog { + constructor() { + super("HyperLinkDialog", { + tags: [ + { + tag: "afx-label", + att: 'text="__(Text)" data-height="23" class="header"' + }, + { + tag: "input", + att: 'data-height="30"' + }, + { + tag: "afx-label", + att: 'text="__(Link)" data-height="23" class="header"' + }, + { + tag: "input", + att: 'data-height="30"' + }, + { + tag: "div", + att: ' data-height="5"' + } + ], + width: 350, + height: 150, + resizable: false, + buttons: [ + { + label: "Ok", + onclick: function(d) { + var data; + data = { + text: (d.find("content1")).value, + link: (d.find("content3")).value, + readonly: d.data.readonly, + action: d.data.action + }; + if (d.handler) { + d.handler(data); + } + return d.quit(); + } + }, + { + label: "__(Cancel)", + onclick: function(d) { + return d.quit(); + } + } + ], + filldata: function(d) { + if (!d.data) { + return; + } + (d.find("content1")).value = d.data.text; + (d.find("content3")).value = d.data.link; + return $(d.find("content1")).prop('disabled', d.data.readonly); + } + }); + } + + }; + + FormatDialog = class FormatDialog extends this.OS.GUI.BaseDialog { + constructor() { + super("FormatDialog"); + } + + init() { + return this._gui.htmlToScheme(FormatDialog.scheme, this, this.host); + } + + main() { + this.ui = { + aligment: { + left: this.find("swleft"), + right: this.find("swright"), + center: this.find("swcenter"), + justify: this.find("swjustify") + }, + spacing: { + left: this.find("spnleft"), + right: this.find("spnright"), + top: this.find("spntop"), + bottom: this.find("spnbottom"), + lineheight: this.find("spnlheight") + }, + padding: { + left: this.find("pspnleft"), + right: this.find("pspnright"), + top: this.find("pspntop"), + bottom: this.find("pspnbottom") + }, + style: { + bold: this.find("swbold"), + italic: this.find("switalic"), + underline: this.find("swunderline"), + color: this.find("txtcolor"), + bgcolor: this.find("bgcolor") + }, + font: { + family: this.find("lstfont"), + size: this.find("spnfsize") + }, + formats: this.find("lstformats") + }; + this.initStyleObject(); + this.preview = ($(this.find("preview")).find("p"))[0]; + $(this.preview).css("padding", "0").css("margin", "0"); + return this.initUIEvent(); + } + + //@previewStyle() + initStyleObject() { + // init the format object + return this.currentStyle = { + aligment: this._api.switcher("left", "right", "center", "justify"), + spacing: { + left: 0, + top: 0, + right: 0, + bottom: 0, + lineheight: 0 + }, + padding: { + left: 0, + top: 0, + right: 0, + bottom: 0 + }, + style: { + bold: false, + italic: false, + underline: false, + color: void 0, + bgcolor: void 0 + }, + font: { + family: void 0, + size: 12 + } + }; + } + + initUIEvent() { + var k, me, ref, ref1, ref2, ref3, set, v; + me = this; + set = function(e, o, k, f) { + return me.ui[o][k].set(e, function(r) { + var v; + v = r; + if (f) { + v = f(r); + } + me.currentStyle[o][k] = v; + return me.previewStyle(); + }); + }; + ref = this.ui.aligment; + for (k in ref) { + v = ref[k]; + set("onchange", "aligment", k, (function(e) { + return e.data; + })); + } + ref1 = this.ui.spacing; + for (k in ref1) { + v = ref1[k]; + set("onchange", "spacing", k); + } + ref2 = this.ui.padding; + for (k in ref2) { + v = ref2[k]; + set("onchange", "padding", k); + } + ref3 = this.ui.style; + for (k in ref3) { + v = ref3[k]; + if (k !== "color" && k !== "bgcolor") { + set("onchange", "style", k, (function(e) { + return e.data; + })); + } + } + set("onchange", "font", "size"); + $(this.ui.style.color).click(function(e) { + return me.openDialog("ColorPickerDialog", function(d) { + me.currentStyle.style.color = d; + return me.previewStyle(); + }); + }); + $(this.ui.style.bgcolor).click(function(e) { + return me.openDialog("ColorPickerDialog", function(d) { + me.currentStyle.style.bgcolor = d; + return me.previewStyle(); + }); + }); + if (this.data && this.data.fonts) { + //font + this.ui.font.family.set("items", this.data.fonts); + } + set("onlistselect", "font", "family", (function(e) { + return e.data; + })); + //format list + this.ui.formats.set("selected", -1); + if (this.data && this.data.formats) { + this.ui.formats.set("items", this.data.formats); + } + this.ui.formats.set("onlistselect", function(e) { + return me.fromODFStyleFormat(e.data); + }); + this.ui.formats.set("selected", 0); + (this.find("btok")).set("onbtclick", function(e) { + return me.saveCurrentStyle(); + }); + (this.find("btx")).set("onbtclick", function(e) { + return me.quit(); + }); + return (this.find("bt-clone")).set("onbtclick", function(e) { + return me.clone(); + }); + } + + clone() { + var me, selected; + me = this; + selected = this.ui.formats.get("selected"); + if (!selected) { + return; + } + return this.openDialog("PromptDialog", function(d) { + var newstyle; + if (!(d && d.trim() !== "")) { + return me.notify(__("Abort: no style name is specified")); + } + newstyle = me.parent.editorSession.cloneParagraphStyle(selected.name, d); + me.ui.formats.push({ + text: d, + name: newstyle + }); + me.ui.formats.set("selected", (me.ui.formats.get('count')) - 1); + return me.notify(__("New style: {0} added", newstyle)); + }, __("Clone style: {0}", selected.text), { + label: __("New style name:") + }); + } + + saveCurrentStyle() { + var odfs, selected; + selected = this.ui.formats.get("selected"); + if (!selected) { + return; + } + odfs = { + "style:paragraph-properties": { + "fo:margin-top": this.currentStyle.spacing.top + "mm", + "fo:margin-left": this.currentStyle.spacing.left + "mm", + "fo:margin-bottom": this.currentStyle.spacing.bottom + "mm", + "fo:margin-right": this.currentStyle.spacing.right + "mm", + "fo:padding-top": this.currentStyle.padding.top + "mm", + "fo:padding-left": this.currentStyle.padding.left + "mm", + "fo:padding-bottom": this.currentStyle.padding.bottom + "mm", + "fo:padding-right": this.currentStyle.padding.right + "mm", + "fo:line-height": this.currentStyle.spacing.lineheight > 0 ? this.currentStyle.spacing.lineheight + "mm" : "normal", + "fo:text-align": this.currentStyle.aligment.selected || "left" + }, + "style:text-properties": { + "fo:font-weight": this.currentStyle.style.bold ? "bold" : "normal", + "fo:font-style": this.currentStyle.style.italic ? "italic" : "normal", + "style:text-underline-style": this.currentStyle.style.underline ? "solid" : "none", + "fo:font-size": this.currentStyle.font.size + "pt", + "fo:font-name": this.currentStyle.font.family.text, + "fo:color": this.currentStyle.style.color ? this.currentStyle.style.color.hex : "#000000", + "fo:background-color": this.currentStyle.style.bgcolor ? this.currentStyle.style.bgcolor.hex : "transparent" + } + }; + this.parent.editorSession.updateParagraphStyle(selected.name, odfs); + return this.notify(__("Paragraph format [{0}] is saved", selected.text)); + } + + fromODFStyleFormat(odfs) { + var cssUnits, findFont, me, style; + me = this; + this.initStyleObject(); + cssUnits = new core.CSSUnits(); + findFont = function(name) { + var item, items, j, len, v; + items = me.ui.font.family.get("items"); + for (j = 0, len = items.length; j < len; j++) { + v = items[j]; + if (v.text === name) { + item = v; + } + } + if (!item) { + return void 0; + } + return item; + }; + // spacing + style = this.parent.editorSession.getParagraphStyleAttributes(odfs.name)['style:paragraph-properties']; + if (style) { + this.currentStyle.spacing.top = cssUnits.convertMeasure(style['fo:margin-top'], 'mm') || 0; + this.currentStyle.spacing.left = cssUnits.convertMeasure(style['fo:margin-left'], 'mm') || 0; + this.currentStyle.spacing.right = cssUnits.convertMeasure(style['fo:margin-right'], 'mm') || 0; + this.currentStyle.spacing.bottom = cssUnits.convertMeasure(style['fo:margin-bottom'], 'mm') || 0; + this.currentStyle.padding.top = cssUnits.convertMeasure(style['fo:padding-top'], 'mm') || 0; + this.currentStyle.padding.left = cssUnits.convertMeasure(style['fo:padding-left'], 'mm') || 0; + this.currentStyle.padding.right = cssUnits.convertMeasure(style['fo:padding-right'], 'mm') || 0; + this.currentStyle.padding.bottom = cssUnits.convertMeasure(style['fo:padding-bottom'], 'mm') || 0; + this.currentStyle.spacing.lineheight = cssUnits.convertMeasure(style['fo:line-height'], 'mm') || 4.2; // 1em = 4,2175176mm + if (style['fo:text-align']) { + this.currentStyle.aligment[style['fo:text-align']] = true; + } + } + style = this.parent.editorSession.getParagraphStyleAttributes(odfs.name)['style:text-properties']; + if (style) { + this.currentStyle.style.bold = style['fo:font-weight'] === 'bold'; + this.currentStyle.style.italic = style['fo:font-style'] === 'italic'; + if (style['style:text-underline-style'] && style['style:text-underline-style'] !== 'none') { + this.currentStyle.style.underline = true; + } + this.currentStyle.font.size = parseFloat(style['fo:font-size']); + this.currentStyle.font.family = findFont(style['style:font-name']); + if (style['fo:color']) { + this.currentStyle.style.color = { + hex: style['fo:color'] + }; + } + if (style['fo:background-color']) { + this.currentStyle.style.bgcolor = { + hex: style['fo:background-color'] + }; + } + } + return this.previewStyle(); + } + + previewStyle() { + var el, i, item, items, j, len, v; + //console.log "previewing" + // reset ui + this.ui.aligment.left.set("swon", this.currentStyle.aligment.left); + this.ui.aligment.right.set("swon", this.currentStyle.aligment.right); + this.ui.aligment.center.set("swon", this.currentStyle.aligment.center); + this.ui.aligment.justify.set("swon", this.currentStyle.aligment.justify); + this.ui.spacing.left.set("value", this.currentStyle.spacing.left); + this.ui.spacing.right.set("value", this.currentStyle.spacing.right); + this.ui.spacing.top.set("value", this.currentStyle.spacing.top); + this.ui.spacing.bottom.set("value", this.currentStyle.spacing.bottom); + this.ui.spacing.lineheight.set("value", this.currentStyle.spacing.lineheight); + this.ui.padding.left.set("value", this.currentStyle.padding.left); + this.ui.padding.right.set("value", this.currentStyle.padding.right); + this.ui.padding.top.set("value", this.currentStyle.padding.top); + this.ui.padding.bottom.set("value", this.currentStyle.padding.bottom); + this.ui.style.bold.set("swon", this.currentStyle.style.bold); + this.ui.style.italic.set("swon", this.currentStyle.style.italic); + this.ui.style.underline.set("swon", this.currentStyle.style.underline); + this.ui.font.size.set("value", this.currentStyle.font.size); + + //console.log @currentStyle + if (this.currentStyle.font.family) { + items = this.ui.font.family.get("items"); + for (i = j = 0, len = items.length; j < len; i = ++j) { + v = items[i]; + if (v.text === this.currentStyle.font.family.text) { + item = i; + } + } + if (item >= 0) { + this.ui.font.family.set("selected", item); + } + } + $(this.ui.style.color).css("background-color", this.currentStyle.style.color ? this.currentStyle.style.color.hex : "#000000"); + $(this.ui.style.bgcolor).css("background-color", this.currentStyle.style.bgcolor ? this.currentStyle.style.bgcolor.hex : "white"); + // set the preview css + el = $(this.preview); + el.css("text-align", this.currentStyle.aligment.selected ? this.currentStyle.aligment.selected : "left"); + el.css("margin-left", this.currentStyle.spacing.left + "mm"); + el.css("margin-right", this.currentStyle.spacing.right + "mm"); + el.css("margin-top", this.currentStyle.spacing.top + "mm"); + el.css("margin-bottom", this.currentStyle.spacing.bottom + "mm"); + el.css("padding-left", this.currentStyle.padding.left + "mm"); + el.css("padding-right", this.currentStyle.padding.right + "mm"); + el.css("padding-top", this.currentStyle.padding.top + "mm"); + el.css("padding-bottom", this.currentStyle.padding.bottom + "mm"); + el.css("font-weight", "normal").css("font-style", "normal").css("text-decoration", "none").css("line-height", "normal"); + if (this.currentStyle.style.bold) { + el.css("font-weight", "bold"); + } + if (this.currentStyle.style.italic) { + el.css("font-style", "italic"); + } + if (this.currentStyle.style.underline) { + el.css("text-decoration", "underline"); + } + el.css("color", this.currentStyle.style.color ? this.currentStyle.style.color.hex : "#000000"); + el.css("background-color", this.currentStyle.style.bgcolor ? this.currentStyle.style.bgcolor.hex : "transparent"); + el.css("font-size", this.currentStyle.font.size + "pt"); + if (this.currentStyle.font.family) { + el.css("font-family", this.currentStyle.font.family.name); + } + if (this.currentStyle.spacing.lineheight > 0) { + return el.css("line-height", this.currentStyle.spacing.lineheight + "mm"); + } + } + + }; + + FormatDialog.scheme = "\n \n
\n \n
\n \n
\n \n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n
\n
\n
\n \n
\n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n
\n
\n \n
\n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n
\n \n
\n \n
\n \n
\n \n \n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n \n
\n \n
\n \n
\n \n \n
\n \n \n
\n
\n
\n \n
\n \n
\n
\n

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce laoreet diam vestibulum massa malesuada quis dignissim libero blandit. Duis sit amet volutpat nisl.

\n
\n
\n
\n \n
\n \n
\n \n
\n \n
\n
\n
\n
"; + +}).call(this); + +/* + + This is a generated file. DO NOT EDIT. + + Copyright (C) 2010-2015 KO GmbH + + @licstart + The code in this file is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License (GNU AGPL) + as published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. + + The code in this file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with WebODF. If not, see . + + As additional permission under GNU AGPL version 3 section 7, you + may distribute UNMODIFIED VERSIONS OF THIS file without the copy of the GNU AGPL normally + required by section 4, provided you include this license notice and a URL + through which recipients can access the Corresponding Source. + + As a special exception to the AGPL, any HTML file which merely makes function + calls to this code, and for that purpose includes it in unmodified form by reference or in-line shall be + deemed a separate work for copyright law purposes. In addition, the copyright + holders of this code give you permission to combine this code with free + software libraries that are released under the GNU LGPL. You may copy and + distribute such a system following the terms of the GNU AGPL for this code + and the LGPL for the libraries. If you modify this code, you may extend this + exception to your version of the code, but you are not obligated to do so. + If you do not wish to do so, delete this exception statement from your + version. + + This license applies to this entire compilation. + @licend + + @source: http://www.webodf.org/ + @source: https://github.com/kogmbh/WebODF/ +*/ +var webodf_version="0.5.9";function Runtime(){}Runtime.prototype.getVariable=function(g){};Runtime.prototype.toJson=function(g){};Runtime.prototype.fromJson=function(g){};Runtime.prototype.byteArrayFromString=function(g,k){};Runtime.prototype.byteArrayToString=function(g,k){};Runtime.prototype.read=function(g,k,d,b){};Runtime.prototype.readFile=function(g,k,d){};Runtime.prototype.readFileSync=function(g,k){};Runtime.prototype.loadXML=function(g,k){};Runtime.prototype.writeFile=function(g,k,d){}; +Runtime.prototype.deleteFile=function(g,k){};Runtime.prototype.log=function(g,k){};Runtime.prototype.setTimeout=function(g,k){};Runtime.prototype.clearTimeout=function(g){};Runtime.prototype.libraryPaths=function(){};Runtime.prototype.currentDirectory=function(){};Runtime.prototype.setCurrentDirectory=function(g){};Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){};Runtime.prototype.parseXML=function(g){};Runtime.prototype.exit=function(g){}; +Runtime.prototype.getWindow=function(){};Runtime.prototype.requestAnimationFrame=function(g){};Runtime.prototype.cancelAnimationFrame=function(g){};Runtime.prototype.assert=function(g,k){};var IS_COMPILED_CODE=!0; +Runtime.byteArrayToString=function(g,k){function d(b){var d="",r,q=b.length;for(r=0;rl?e.push(l):(r+=1,a=b[r],194<=l&&224>l?e.push((l&31)<<6|a&63):(r+=1,c=b[r],224<=l&&240>l?e.push((l&15)<<12|(a&63)<<6|c&63):(r+=1,m=b[r],240<=l&&245>l&&(l=(l&7)<<18|(a&63)<<12|(c&63)<<6|m&63,l-=65536,e.push((l>>10)+55296,(l&1023)+56320))))),1E3<=e.length&& +(d+=String.fromCharCode.apply(null,e),e.length=0);return d+String.fromCharCode.apply(null,e)}var f;"utf8"===k?f=b(g):("binary"!==k&&this.log("Unsupported encoding: "+k),f=d(g));return f};Runtime.getVariable=function(g){try{return eval(g)}catch(k){}};Runtime.toJson=function(g){return JSON.stringify(g)};Runtime.fromJson=function(g){return JSON.parse(g)};Runtime.getFunctionName=function(g){return void 0===g.name?(g=/function\s+(\w+)/.exec(g))&&g[1]:g.name}; +Runtime.assert=function(g,k){if(!g)throw this.log("alert","ASSERTION FAILED:\n"+k),Error(k);}; +function BrowserRuntime(){function g(b){var e=b.length,l,a,c=0;for(l=0;la&&(c+=1,l+=1);return c}function k(b,e,l){var a=b.length,c,m;e=new Uint8Array(new ArrayBuffer(e));l?(e[0]=239,e[1]=187,e[2]=191,m=3):m=0;for(l=0;lc?(e[m]=c,m+=1):2048>c?(e[m]=192|c>>>6,e[m+1]=128|c&63,m+=2):55040>=c||57344<=c?(e[m]=224|c>>>12&15,e[m+1]=128|c>>>6&63,e[m+2]=128|c&63,m+=3):(l+=1,c=(c-55296<<10|b.charCodeAt(l)-56320)+65536, +e[m]=240|c>>>18&7,e[m+1]=128|c>>>12&63,e[m+2]=128|c>>>6&63,e[m+3]=128|c&63,m+=4);return e}function d(b){var e=b.length,l=new Uint8Array(new ArrayBuffer(e)),a;for(a=0;aa.status||0===a.status?l(null):l("Status "+String(a.status)+": "+a.responseText||a.statusText):l("File "+b+" is empty."))};c=e.buffer&&!a.sendAsBinary?e.buffer:r.byteArrayToString(e,"binary");try{a.sendAsBinary?a.sendAsBinary(c):a.send(c)}catch(m){r.log("HUH? "+ +m+" "+e),l(m.message)}};this.deleteFile=function(b,e){var l=new XMLHttpRequest;l.open("DELETE",b,!0);l.onreadystatechange=function(){4===l.readyState&&(200>l.status&&300<=l.status?e(l.responseText):e(null))};l.send(null)};this.loadXML=function(b,e){var l=new XMLHttpRequest;l.open("GET",b,!0);l.overrideMimeType&&l.overrideMimeType("text/xml");l.onreadystatechange=function(){4===l.readyState&&(0!==l.status||l.responseText?200===l.status||0===l.status?e(null,l.responseXML):e(l.responseText,null):e("File "+ +b+" is empty.",null))};try{l.send(null)}catch(a){e(a.message,null)}};this.log=b;this.enableAlerts=!0;this.assert=Runtime.assert;this.setTimeout=function(b,e){return setTimeout(function(){b()},e)};this.clearTimeout=function(b){clearTimeout(b)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.currentDirectory=function(){return""};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML= +function(b){return(new DOMParser).parseFromString(b,"text/xml")};this.exit=function(d){b("Calling exit with code "+String(d)+", but exit() is not implemented.")};this.getWindow=function(){return window};this.requestAnimationFrame=function(b){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,l=0;if(e)e.bind(window),l=e(b);else return setTimeout(b,15);return l};this.cancelAnimationFrame=function(b){var e=window.cancelAnimationFrame|| +window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame;e?(e.bind(window),e(b)):clearTimeout(b)}} +function NodeJSRuntime(){function g(b){var e=b.length,l,a=new Uint8Array(new ArrayBuffer(e));for(l=0;l").implementation} +function RhinoRuntime(){var g=this,k={},d=k.javax.xml.parsers.DocumentBuilderFactory.newInstance(),b,f,n="";d.setValidating(!1);d.setNamespaceAware(!0);d.setExpandEntityReferences(!1);d.setSchema(null);f=k.org.xml.sax.EntityResolver({resolveEntity:function(b,d){var f=new k.java.io.FileReader(d);return new k.org.xml.sax.InputSource(f)}});b=d.newDocumentBuilder();b.setEntityResolver(f);this.byteArrayFromString=function(b,d){var f,e=b.length,l=new Uint8Array(new ArrayBuffer(e));for(f=0;f>>18],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>12&63],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6&63],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c& +63];h===b+1?(c=a[h]<<4,m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c&63],m+="=="):h===b&&(c=a[h]<<10|a[h+1]<<2,m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>12],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6&63],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c&63],m+="=");return m}function d(a){a=a.replace(/[^A-Za-z0-9+\/]+/g, +"");var c=a.length,m=new Uint8Array(new ArrayBuffer(3*c)),b=a.length%4,d=0,l,e;for(l=0;l>16,m[d+1]=e>>8&255,m[d+2]=e&255,d+=3;c=3*c-[0,0,2,1][b];return m.subarray(0,c)}function b(a){var c,m,h=a.length,b=0,d=new Uint8Array(new ArrayBuffer(3*h));for(c=0;cm?d[b++]=m:(2048>m?d[b++]=192|m>>>6:(d[b++]=224|m>>>12&15,d[b++]=128|m>>>6&63),d[b++]=128|m&63);return d.subarray(0, +b)}function f(a){var c,m,h,b,d=a.length,l=new Uint8Array(new ArrayBuffer(d)),e=0;for(c=0;cm?l[e++]=m:(c+=1,h=a[c],224>m?l[e++]=(m&31)<<6|h&63:(c+=1,b=a[c],l[e++]=(m&15)<<12|(h&63)<<6|b&63));return l.subarray(0,e)}function n(a){return k(g(a))}function p(a){return String.fromCharCode.apply(String,d(a))}function r(a){return f(g(a))}function q(a){a=f(a);for(var c="",m=0;mc?l+=String.fromCharCode(c):(d+=1,h=a.charCodeAt(d)&255,224>c?l+=String.fromCharCode((c&31)<<6|h&63):(d+=1,b=a.charCodeAt(d)&255,l+=String.fromCharCode((c&15)<<12|(h&63)<<6|b&63)));return l}function l(a,c){function m(){var d=b+1E5;d>a.length&&(d=a.length);h+=e(a,b,d);b=d;d=b===a.length;c(h,d)&&!d&&runtime.setTimeout(m,0)}var h="",b=0;1E5>a.length?c(e(a,0,a.length),!0):("string"!==typeof a&&(a=a.slice()),m())}function a(a){return b(g(a))}function c(a){return String.fromCharCode.apply(String, +b(a))}function m(a){return String.fromCharCode.apply(String,b(g(a)))}var h=function(a){var c={},m,h;m=0;for(h=a.length;m=a.compareBoundaryPoints(Range.START_TO_START,c)&&0<=a.compareBoundaryPoints(Range.END_TO_END,c)}function n(a,c){return 0>=a.compareBoundaryPoints(Range.END_TO_START,c)&&0<=a.compareBoundaryPoints(Range.START_TO_END,c)}function p(a,c){var b=null;a.nodeType===Node.TEXT_NODE&&(0===a.length?(a.parentNode.removeChild(a),c.nodeType===Node.TEXT_NODE&&(b=c)):(c.nodeType===Node.TEXT_NODE&&(a.appendData(c.data),c.parentNode.removeChild(c)),b=a));return b} +function r(a){for(var c=a.parentNode;a.firstChild;)c.insertBefore(a.firstChild,a);c.removeChild(a);return c}function q(a,c){var b=a.parentNode,d=a.firstChild,l=c(a),e;if(l===NodeFilter.FILTER_SKIP)return b;for(;d;)e=d.nextSibling,q(d,c),d=e;b&&l===NodeFilter.FILTER_REJECT&&r(a);return b}function e(a,c){return a===c||Boolean(a.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY)}function l(a,c){return g().unscaledRangeClientRects?a:a/c}function a(c,h,b){Object.keys(h).forEach(function(d){var l= +d.split(":"),e=l[1],f=b(l[0]),l=h[d],n=typeof l;"object"===n?Object.keys(l).length&&(d=f?c.getElementsByTagNameNS(f,e)[0]||c.ownerDocument.createElementNS(f,d):c.getElementsByTagName(e)[0]||c.ownerDocument.createElement(d),c.appendChild(d),a(d,l,b)):f&&(runtime.assert("number"===n||"string"===n,"attempting to map unsupported type '"+n+"' (key: "+d+")"),c.setAttributeNS(f,d,String(l)))})}var c=null;this.splitBoundaries=function(a){var c,d=[],l,e,f;if(a.startContainer.nodeType===Node.TEXT_NODE||a.endContainer.nodeType=== +Node.TEXT_NODE){l=a.endContainer;e=a.endContainer.nodeType!==Node.TEXT_NODE?a.endOffset===a.endContainer.childNodes.length:!1;f=a.endOffset;c=a.endContainer;if(fg))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0k))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}};core.NodeFilterChain=function(g){var k=NodeFilter.FILTER_REJECT,d=NodeFilter.FILTER_ACCEPT;this.acceptNode=function(b){var f;for(f=0;f "+c.length),runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"),b===c.length&&(l.nextSibling()?a=0:l.parentNode()?a=1:runtime.assert(!1,"Error in setUnfilteredPosition: position not valid."))):ba.value||"%"===a.unit)?null:a}function L(a){return(a=I(a))&&"%"!==a.unit?null:a}function E(a){switch(a.namespaceURI){case odf.Namespaces.drawns:case odf.Namespaces.svgns:case odf.Namespaces.dr3dns:return!1;case odf.Namespaces.textns:switch(a.localName){case "note-body":case "ruby-text":return!1}break;case odf.Namespaces.officens:switch(a.localName){case "annotation":case "binary-data":case "event-listeners":return!1}break;default:switch(a.localName){case "cursor":case "editinfo":return!1}}return!0} +function N(a){return Boolean(n(a)&&(!r(a.textContent)||A(a,0)))}function O(a,c){for(;0=c.value||"%"===c.unit)?null:c;return c||L(a)};this.parseFoLineHeight= +function(a){return K(a)||L(a)};this.isTextContentContainingNode=E;this.getTextNodes=function(a,c){var b;b=aa.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_REJECT;a.nodeType===Node.TEXT_NODE?N(a)&&(c=NodeFilter.FILTER_ACCEPT):E(a)&&(c=NodeFilter.FILTER_SKIP);return c},NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);c||O(a,b);return b};this.getTextElements=D;this.getParagraphElements=function(a){var c;c=aa.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_REJECT;if(f(a))c=NodeFilter.FILTER_ACCEPT; +else if(E(a)||q(a))c=NodeFilter.FILTER_SKIP;return c},NodeFilter.SHOW_ELEMENT);V(a.startContainer,c,f);return c};this.getImageElements=function(a){var c;c=aa.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_SKIP;g(a)&&(c=NodeFilter.FILTER_ACCEPT);return c},NodeFilter.SHOW_ELEMENT);V(a.startContainer,c,g);return c};this.getHyperlinkElements=function(a){var c=[],d=a.cloneRange();a.collapsed&&a.endContainer.nodeType===Node.ELEMENT_NODE&&(a=W(a.endContainer,a.endOffset),a.nodeType===Node.TEXT_NODE&& +d.setEnd(a,1));D(d,!0,!1).forEach(function(a){for(a=a.parentNode;!f(a);){if(b(a)&&-1===c.indexOf(a)){c.push(a);break}a=a.parentNode}});d.detach();return c};this.getNormalizedFontFamilyName=function(a){/^(["'])(?:.|[\n\r])*?\1$/.test(a)||(a=a.replace(/^[ \t\r\n\f]*((?:.|[\n\r])*?)[ \t\r\n\f]*$/,"$1"),/[ \t\r\n\f]/.test(a)&&(a="'"+a.replace(/[ \t\r\n\f]+/g," ")+"'"));return a}};odf.OdfUtils=new odf.OdfUtilsImpl; +gui.OdfTextBodyNodeFilter=function(){var g=odf.OdfUtils,k=Node.TEXT_NODE,d=NodeFilter.FILTER_REJECT,b=NodeFilter.FILTER_ACCEPT,f=odf.Namespaces.textns;this.acceptNode=function(n){if(n.nodeType===k){if(!g.isGroupingElement(n.parentNode))return d}else if(n.namespaceURI===f&&"tracked-changes"===n.localName)return d;return b}};xmldom.LSSerializerFilter=function(){};xmldom.LSSerializerFilter.prototype.acceptNode=function(g){}; +odf.OdfNodeFilter=function(){this.acceptNode=function(g){return"http://www.w3.org/1999/xhtml"===g.namespaceURI?NodeFilter.FILTER_SKIP:g.namespaceURI&&g.namespaceURI.match(/^urn:webodf:/)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}};xmldom.XPathIterator=function(){};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){}; +function createXPathSingleton(){function g(b,a,c){return-1!==b&&(b=e&&c.push(k(b.substring(a,d)))):"["===b[d]&&(0>=e&&(a=d+1),e+=1),d+=1;return d};q=function(d,a,c){var m,h,e,n;for(m=0;m/g,">").replace(/'/g,"'").replace(/"/g,""")}function d(f,n){var g="",r=b.filter?b.filter.acceptNode(n):NodeFilter.FILTER_ACCEPT,q;if(r===NodeFilter.FILTER_ACCEPT&&n.nodeType===Node.ELEMENT_NODE){f.push();q=f.getQName(n);var e,l=n.attributes,a,c,m,h="",y;e="<"+q;a=l.length;for(c=0;c")}if(r===NodeFilter.FILTER_ACCEPT||r===NodeFilter.FILTER_SKIP){for(r=n.firstChild;r;)g+=d(f,r),r=r.nextSibling;n.nodeValue&&(g+=k(n.nodeValue))}q&&(g+="",f.pop());return g}var b=this;this.filter=null;this.writeToString=function(b,n){if(!b)return"";var k=new g(n);return d(k,b)}}; +(function(){function g(b){var a,c=r.length;for(a=0;ac)break;h=h.nextSibling}b.insertBefore(a,h)}}}var f=new odf.StyleInfo,n=core.DomUtils,p=odf.Namespaces.stylens,r="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "), +q=Date.now()+"_webodf_",e=new core.Base64;odf.ODFElement=function(){};odf.ODFDocumentElement=function(){};odf.ODFDocumentElement.prototype=new odf.ODFElement;odf.ODFDocumentElement.prototype.constructor=odf.ODFDocumentElement;odf.ODFDocumentElement.prototype.fontFaceDecls=null;odf.ODFDocumentElement.prototype.manifest=null;odf.ODFDocumentElement.prototype.settings=null;odf.ODFDocumentElement.namespaceURI="urn:oasis:names:tc:opendocument:xmlns:office:1.0";odf.ODFDocumentElement.localName="document"; +odf.AnnotationElement=function(){};odf.OdfPart=function(b,a,c,d){var h=this;this.size=0;this.type=null;this.name=b;this.container=c;this.url=null;this.mimetype=a;this.onstatereadychange=this.document=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.data="";this.load=function(){null!==d&&(this.mimetype=a,d.loadAsDataURL(b,a,function(a,c){a&&runtime.log(a);h.url=c;if(h.onchange)h.onchange(h);if(h.onstatereadychange)h.onstatereadychange(h)}))}};odf.OdfPart.prototype.load=function(){}; +odf.OdfPart.prototype.getUrl=function(){return this.data?"data:;base64,"+e.toBase64(this.data):null};odf.OdfContainer=function a(c,m){function h(a){for(var c=a.firstChild,b;c;)b=c.nextSibling,c.nodeType===Node.ELEMENT_NODE?h(c):c.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(c),c=b}function g(a){var c={},b,d,h=a.ownerDocument.createNodeIterator(a,NodeFilter.SHOW_ELEMENT,null,!1);for(a=h.nextNode();a;)"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&("annotation"=== +a.localName?(b=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","name"))&&(c.hasOwnProperty(b)?runtime.log("Warning: annotation name used more than once with : '"+b+"'"):c[b]=a):"annotation-end"===a.localName&&((b=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","name"))?c.hasOwnProperty(b)?(d=c[b],d.annotationEndElement?runtime.log("Warning: annotation name used more than once with : '"+b+"'"):d.annotationEndElement= +a):runtime.log("Warning: annotation end without an annotation start, name: '"+b+"'"):runtime.log("Warning: annotation end without a name found"))),a=h.nextNode()}function r(a,c){for(var b=a&&a.firstChild;b;)b.nodeType===Node.ELEMENT_NODE&&b.setAttributeNS("urn:webodf:names:scope","scope",c),b=b.nextSibling}function z(a,c){for(var b=B.rootElement.meta,b=b&&b.firstChild;b&&(b.namespaceURI!==a||b.localName!==c);)b=b.nextSibling;for(b=b&&b.firstChild;b&&b.nodeType!==Node.TEXT_NODE;)b=b.nextSibling;return b? +b.data:null}function w(a){var c={},b;for(a=a.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&&a.namespaceURI===p&&"font-face"===a.localName&&(b=a.getAttributeNS(p,"name"),c[b]=a),a=a.nextSibling;return c}function v(a,c){var b=null,d,h,e;if(a)for(b=a.cloneNode(!0),d=b.firstElementChild;d;)h=d.nextElementSibling,(e=d.getAttributeNS("urn:webodf:names:scope","scope"))&&e!==c&&b.removeChild(d),d=h;return b}function u(a,c){var b,d,h,e=null,m={};if(a)for(c.forEach(function(a){f.collectUsedFontFaces(m,a)}), +e=a.cloneNode(!0),b=e.firstElementChild;b;)d=b.nextElementSibling,h=b.getAttributeNS(p,"name"),m[h]||e.removeChild(b),b=d;return e}function t(a){var c=B.rootElement.ownerDocument,b;if(a){h(a.documentElement);try{b=c.importNode(a.documentElement,!0)}catch(d){}}return b}function A(a){B.state=a;if(B.onchange)B.onchange(B);if(B.onstatereadychange)B.onstatereadychange(B)}function I(a){Q=null;B.rootElement=a;a.fontFaceDecls=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls"); +a.styles=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles");a.automaticStyles=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles");a.masterStyles=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles");a.body=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","body");a.meta=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta");a.settings=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0", +"settings");a.scripts=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","scripts");g(a)}function K(c){var d=t(c),h=B.rootElement,e;d&&"document-styles"===d.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===d.namespaceURI?(h.fontFaceDecls=n.getDirectChild(d,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls"),b(h,h.fontFaceDecls),e=n.getDirectChild(d,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles"),h.styles=e||c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0", +"styles"),b(h,h.styles),e=n.getDirectChild(d,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"),h.automaticStyles=e||c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"),r(h.automaticStyles,"document-styles"),b(h,h.automaticStyles),d=n.getDirectChild(d,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles"),h.masterStyles=d||c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles"),b(h,h.masterStyles), +f.prefixStyleNames(h.automaticStyles,q,h.masterStyles)):A(a.INVALID)}function L(c){c=t(c);var d,h,e,m;if(c&&"document-content"===c.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===c.namespaceURI){d=B.rootElement;e=n.getDirectChild(c,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls");if(d.fontFaceDecls&&e){m=d.fontFaceDecls;var g,k,O,q,D={};h=w(m);q=w(e);for(e=e.firstElementChild;e;){g=e.nextElementSibling;if(e.namespaceURI===p&&"font-face"===e.localName)if(k=e.getAttributeNS(p, +"name"),h.hasOwnProperty(k)){if(!e.isEqualNode(h[k])){O=k;for(var y=h,E=q,u=0,W=void 0,W=O=O.replace(/\d+$/,"");y.hasOwnProperty(W)||E.hasOwnProperty(W);)u+=1,W=O+u;O=W;e.setAttributeNS(p,"style:name",O);m.appendChild(e);h[O]=e;delete q[k];D[k]=O}}else m.appendChild(e),h[k]=e,delete q[k];e=g}m=D}else e&&(d.fontFaceDecls=e,b(d,e));h=n.getDirectChild(c,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles");r(h,"document-content");m&&f.changeFontFaceNames(h,m);if(d.automaticStyles&&h)for(m= +h.firstChild;m;)d.automaticStyles.appendChild(m),m=h.firstChild;else h&&(d.automaticStyles=h,b(d,h));c=n.getDirectChild(c,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","body");if(null===c)throw" tag is mising.";d.body=c;b(d,d.body)}else A(a.INVALID)}function E(a){a=t(a);var c;a&&"document-meta"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&(c=B.rootElement,c.meta=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta"), +b(c,c.meta))}function N(a){a=t(a);var c;a&&"document-settings"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&(c=B.rootElement,c.settings=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","settings"),b(c,c.settings))}function O(a){a=t(a);var c;if(a&&"manifest"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"===a.namespaceURI)for(c=B.rootElement,c.manifest=a,a=c.manifest.firstElementChild;a;)"file-entry"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"=== +a.namespaceURI&&(M[a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","full-path")]=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","media-type")),a=a.nextElementSibling}function D(a,c,b){a=n.getElementsByTagName(a,c);var d;for(d=0;d'}function P(){var a=new xmldom.LSSerializer,c=R("document-meta");a.filter=new odf.OdfNodeFilter;c+=a.writeToString(B.rootElement.meta,odf.Namespaces.namespaceMap);return c+""}function aa(a,c){var b=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:file-entry");b.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:full-path",a);b.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", +"manifest:media-type",c);return b}function S(){var a=runtime.parseXML(''),c=a.documentElement,b=new xmldom.LSSerializer,d;for(d in M)M.hasOwnProperty(d)&&c.appendChild(aa(d,M[d]));b.filter=new odf.OdfNodeFilter;return'\n'+b.writeToString(a,odf.Namespaces.namespaceMap)}function fa(){var a,c,b,d=odf.Namespaces.namespaceMap, +h=new xmldom.LSSerializer,e=R("document-styles");c=v(B.rootElement.automaticStyles,"document-styles");b=B.rootElement.masterStyles.cloneNode(!0);a=u(B.rootElement.fontFaceDecls,[b,B.rootElement.styles,c]);f.removePrefixFromStyleNames(c,q,b);h.filter=new k(b,c);e+=h.writeToString(a,d);e+=h.writeToString(B.rootElement.styles,d);e+=h.writeToString(c,d);e+=h.writeToString(b,d);return e+""}function ha(){var a,c,b=odf.Namespaces.namespaceMap,h=new xmldom.LSSerializer,e=R("document-content"); +c=v(B.rootElement.automaticStyles,"document-content");a=u(B.rootElement.fontFaceDecls,[c]);h.filter=new d(B.rootElement.body,c);e+=h.writeToString(a,b);e+=h.writeToString(c,b);e+=h.writeToString(B.rootElement.body,b);return e+""}function C(c,b){runtime.loadXML(c,function(c,d){if(c)b(c);else if(d){V(d);W(d.documentElement);var h=t(d);h&&"document"===h.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===h.namespaceURI?(I(h),A(a.DONE)):A(a.INVALID)}else b("No DOM was loaded.")})} +function Z(a,c){var d;d=B.rootElement;var h=d.meta;h||(d.meta=h=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta"),b(d,h));d=h;a&&n.mapKeyValObjOntoNode(d,a,odf.Namespaces.lookupNamespaceURI);c&&n.removeKeyElementsFromNode(d,c,odf.Namespaces.lookupNamespaceURI)}function ba(c,b){function d(a,c){var b;c||(c=a);b=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0",c);f[a]=b;f.appendChild(b)}var h=new core.Zip("",null),e="application/vnd.oasis.opendocument."+ +c+(!0===b?"-template":""),m=runtime.byteArrayFromString(e,"utf8"),f=B.rootElement,g=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0",c);h.save("mimetype",m,!1,new Date);d("meta");d("settings");d("scripts");d("fontFaceDecls","font-face-decls");d("styles");d("automaticStyles","automatic-styles");d("masterStyles","master-styles");d("body");f.body.appendChild(g);M["/"]=e;M["settings.xml"]="text/xml";M["meta.xml"]="text/xml";M["styles.xml"]="text/xml";M["content.xml"]="text/xml"; +A(a.DONE);return h}function U(){var a,c=new Date,b="";B.rootElement.settings&&B.rootElement.settings.firstElementChild&&(a=new xmldom.LSSerializer,b=R("document-settings"),a.filter=new odf.OdfNodeFilter,b+=a.writeToString(B.rootElement.settings,odf.Namespaces.namespaceMap),b+="");(a=b)?(a=runtime.byteArrayFromString(a,"utf8"),Y.save("settings.xml",a,!0,c)):Y.remove("settings.xml");b=runtime.getWindow();a="WebODF/"+webodf.Version;b&&(a=a+" "+b.navigator.userAgent);Z({"meta:generator":a}, +null);a=runtime.byteArrayFromString(P(),"utf8");Y.save("meta.xml",a,!0,c);a=runtime.byteArrayFromString(fa(),"utf8");Y.save("styles.xml",a,!0,c);a=runtime.byteArrayFromString(ha(),"utf8");Y.save("content.xml",a,!0,c);a=runtime.byteArrayFromString(S(),"utf8");Y.save("META-INF/manifest.xml",a,!0,c)}function ga(a,c){U();Y.writeAs(a,function(a){c(a)})}var B=this,Y,M={},Q,F="";this.onstatereadychange=m;this.state=this.onchange=null;this.getMetadata=z;this.setRootElement=I;this.getContentElement=function(){var a; +Q||(a=B.rootElement.body,Q=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","text")||n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","presentation")||n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","spreadsheet"));if(!Q)throw"Could not find content element in .";return Q};this.getDocumentType=function(){var a=B.getContentElement();return a&&a.localName};this.isTemplate=function(){return"-template"===M["/"].substr(-9)}; +this.setIsTemplate=function(a){var c=M["/"],b="-template"===c.substr(-9);a!==b&&(c=a?c+"-template":c.substr(0,c.length-9),M["/"]=c,a=runtime.byteArrayFromString(c,"utf8"),Y.save("mimetype",a,!1,new Date))};this.getPart=function(a){return new odf.OdfPart(a,M[a],B,Y)};this.getPartData=function(a,c){Y.load(a,c)};this.setMetadata=Z;this.incrementEditingCycles=function(){var a=z(odf.Namespaces.metans,"editing-cycles"),a=a?parseInt(a,10):0;isNaN(a)&&(a=0);Z({"meta:editing-cycles":a+1},null);return a+1}; +this.createByteArray=function(a,c){U();Y.createByteArray(a,c)};this.saveAs=ga;this.save=function(a){ga(F,a)};this.getUrl=function(){return F};this.setBlob=function(a,c,b){b=e.convertBase64ToByteArray(b);Y.save(a,b,!1,new Date);M.hasOwnProperty(a)&&runtime.log(a+" has been overwritten.");M[a]=c};this.removeBlob=function(a){var c=Y.remove(a);runtime.assert(c,"file is not found: "+a);delete M[a]};this.state=a.LOADING;this.rootElement=function(a){var c=document.createElementNS(a.namespaceURI,a.localName), +b;a=new a.Type;for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c}({Type:odf.ODFDocumentElement,namespaceURI:odf.ODFDocumentElement.namespaceURI,localName:odf.ODFDocumentElement.localName});c===odf.OdfContainer.DocumentType.TEXT?Y=ba("text"):c===odf.OdfContainer.DocumentType.TEXT_TEMPLATE?Y=ba("text",!0):c===odf.OdfContainer.DocumentType.PRESENTATION?Y=ba("presentation"):c===odf.OdfContainer.DocumentType.PRESENTATION_TEMPLATE?Y=ba("presentation",!0):c===odf.OdfContainer.DocumentType.SPREADSHEET? +Y=ba("spreadsheet"):c===odf.OdfContainer.DocumentType.SPREADSHEET_TEMPLATE?Y=ba("spreadsheet",!0):(F=c,Y=new core.Zip(F,function(c,b){Y=b;c?C(F,function(b){c&&(Y.error=c+"\n"+b,A(a.INVALID))}):J([{path:"styles.xml",handler:K},{path:"content.xml",handler:L},{path:"meta.xml",handler:E},{path:"settings.xml",handler:N},{path:"META-INF/manifest.xml",handler:O}])}))};odf.OdfContainer.EMPTY=0;odf.OdfContainer.LOADING=1;odf.OdfContainer.DONE=2;odf.OdfContainer.INVALID=3;odf.OdfContainer.SAVING=4;odf.OdfContainer.MODIFIED= +5;odf.OdfContainer.getContainer=function(a){return new odf.OdfContainer(a,null)}})();odf.OdfContainer.DocumentType={TEXT:1,TEXT_TEMPLATE:2,PRESENTATION:3,PRESENTATION_TEMPLATE:4,SPREADSHEET:5,SPREADSHEET_TEMPLATE:6};gui.AnnotatableCanvas=function(){};gui.AnnotatableCanvas.prototype.refreshSize=function(){};gui.AnnotatableCanvas.prototype.getZoomLevel=function(){};gui.AnnotatableCanvas.prototype.getSizer=function(){}; +gui.AnnotationViewManager=function(g,k,d,b){function f(c){var b=c.annotationEndElement,d=l.createRange(),e=c.getAttributeNS(odf.Namespaces.officens,"name");b&&(d.setStart(c,c.childNodes.length),d.setEnd(b,0),c=a.getTextNodes(d,!1),c.forEach(function(a){var c;a:{for(c=a.parentNode;c.namespaceURI!==odf.Namespaces.officens||"body"!==c.localName;){if("http://www.w3.org/1999/xhtml"===c.namespaceURI&&"webodf-annotationHighlight"===c.className&&c.getAttribute("annotation")===e){c=!0;break a}c=c.parentNode}c= +!1}c||(c=l.createElement("span"),c.className="webodf-annotationHighlight",c.setAttribute("annotation",e),a.parentNode.replaceChild(c,a),c.appendChild(a))}));d.detach()}function n(a){var b=g.getSizer();a?(d.style.display="inline-block",b.style.paddingRight=c.getComputedStyle(d).width):(d.style.display="none",b.style.paddingRight=0);g.refreshSize()}function p(){e.sort(function(a,c){return 0!==(a.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_FOLLOWING)?-1:1})}function r(){var a;for(a=0;a=(n.getBoundingClientRect().top-r.bottom)/c?b.style.top=Math.abs(n.getBoundingClientRect().top-r.bottom)/c+20+"px":b.style.top="0px"): +b.style.top="0px";l.style.left=f.getBoundingClientRect().width/c+"px";var f=l.style,n=l.getBoundingClientRect().left/c,k=l.getBoundingClientRect().top/c,r=b.getBoundingClientRect().left/c,p=b.getBoundingClientRect().top/c,q=0,I=0,q=r-n,q=q*q,I=p-k,I=I*I,n=Math.sqrt(q+I);f.width=n+"px";k=Math.asin((b.getBoundingClientRect().top-l.getBoundingClientRect().top)/(c*parseFloat(l.style.width)));l.style.transform="rotate("+k+"rad)";l.style.MozTransform="rotate("+k+"rad)";l.style.WebkitTransform="rotate("+ +k+"rad)";l.style.msTransform="rotate("+k+"rad)"}}function q(a){var c=e.indexOf(a),b=a.parentNode.parentNode;"div"===b.localName&&(b.parentNode.insertBefore(a,b),b.parentNode.removeChild(b));a=a.getAttributeNS(odf.Namespaces.officens,"name");a=l.querySelectorAll('span.webodf-annotationHighlight[annotation="'+a+'"]');for(var d,b=0;bp||k.bottom>p)g.scrollTop=k.bottom-k.top<=p-f?g.scrollTop+(k.bottom-p):g.scrollTop+(k.top-f);k.leftn&&(g.scrollLeft=k.right-k.left<=n-b?g.scrollLeft+(k.right-n):g.scrollLeft-(b-k.left))}}}; +(function(){function g(d,n,k,r,q){var e,l=0,a;for(a in d)if(d.hasOwnProperty(a)){if(l===k){e=a;break}l+=1}e?n.getPartData(d[e].href,function(a,m){if(a)runtime.log(a);else if(m){var h="@font-face { font-family: "+(d[e].family||e)+"; src: url(data:application/x-font-ttf;charset=binary;base64,"+b.convertUTF8ArrayToBase64(m)+') format("truetype"); }';try{r.insertRule(h,r.cssRules.length)}catch(l){runtime.log("Problem inserting rule in CSS: "+runtime.toJson(l)+"\nRule: "+h)}}else runtime.log("missing font data for "+ +d[e].href);g(d,n,k+1,r,q)}):q&&q()}var k=xmldom.XPath,d=odf.OdfUtils,b=new core.Base64;odf.FontLoader=function(){this.loadFonts=function(b,n){for(var p=b.rootElement.fontFaceDecls;n.cssRules.length;)n.deleteRule(n.cssRules.length-1);if(p){var r={},q,e,l,a;if(p)for(p=k.getODFElementsWithXPath(p,"style:font-face[svg:font-face-src]",odf.Namespaces.lookupNamespaceURI),q=0;q text|list-item:first-child > :not(text|list):first-child:before',u+="{",u+="counter-increment: "+p+" 0;",u+="}",g(b,u));for(;l.counterIdStack.length>=k;)l.counterIdStack.pop();l.counterIdStack.push(p);t=l.contentRules[k.toString()]||"";for(u=1;u<=k;u+=1)t=t.replace(u+"webodf-listLevel",l.counterIdStack[u-1]);u='text|list[webodfhelper|counter-id="'+r+'"] > text|list-item > :not(text|list):first-child:before'; +u+="{";u+=t;u+="counter-increment: "+p+";";u+="}";g(b,u)}for(h=h.firstElementChild;h;)d(c,h,f,l),h=h.nextElementSibling}else l.continuedCounterIdStack=[]}var f=0,a="",c={};this.createCounterRules=function(a,b,n){var g=b.getAttributeNS(p,"id"),r=[];n&&(n=n.getAttributeNS("urn:webodf:names:helper","counter-id"),r=c[n].slice(0));a=new k(a,r);g?g="Y"+g:(f+=1,g="X"+f);d(g,b,0,a);c[g+"-level1-1"]=a.counterIdStack};this.initialiseCreatedCounters=function(){var c;c="office|document{"+("counter-reset: "+a+ +";");c+="}";g(b,c)}}var b=odf.Namespaces.fons,f=odf.Namespaces.stylens,n=odf.Namespaces.textns,p=odf.Namespaces.xmlns,r={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"};odf.ListStyleToCss=function(){function k(a){var b=m.parseLength(a);return b?c.convert(b.value,b.unit,"px"):(runtime.log("Could not parse value '"+a+"'."),0)}function e(a){return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function l(a,c){var b;a&&(b=a.getAttributeNS(n,"style-name"));return b===c}function a(a, +c,b){c=c.getElementsByTagNameNS(n,"list");a=new d(a);var m,g,k,q,t,A,I={},K;for(K=0;K text|list-item > text|list",--x;x=E&&E.getAttributeNS(b,"text-align")||"left";switch(x){case "end":x="right";break;case "start":x="left"}"label-alignment"===N?(D=O&&O.getAttributeNS(b,"margin-left")||"0px",J=O&&O.getAttributeNS(b,"text-indent")||"0px",R=O&&O.getAttributeNS(n,"label-followed-by"),O=k(D)):(D=E&&E.getAttributeNS(n,"space-before")||"0px",V=E&&E.getAttributeNS(n,"min-label-width")||"0px", +W=E&&E.getAttributeNS(n,"min-label-distance")||"0px",O=k(D)+k(V));E=p+" > text|list-item";E+="{";E+="margin-left: "+O+"px;";E+="}";g(e,E);E=p+" > text|list-item > text|list";E+="{";E+="margin-left: "+-O+"px;";E+="}";g(e,E);E=p+" > text|list-item > :not(text|list):first-child:before";E+="{";E+="text-align: "+x+";";E+="display: inline-block;";"label-alignment"===N?(E+="margin-left: "+J+";","listtab"===R&&(E+="padding-right: 0.2cm;")):(E+="min-width: "+V+";",E+="margin-left: "+(0===parseFloat(V)?"": +"-")+V+";",E+="padding-right: "+W+";");E+="}";g(e,E)}d=d.nextElementSibling}});a(c,e,m)}}})();odf.LazyStyleProperties=function(g,k){var d={};this.value=function(b){var f;d.hasOwnProperty(b)?f=d[b]:(f=k[b](),void 0===f&&g&&(f=g.value(b)),d[b]=f);return f};this.reset=function(b){g=b;d={}}}; +odf.StyleParseUtils=function(){function g(d){var b,f;d=(d=/(-?[0-9]*[0-9][0-9]*(\.[0-9]*)?|0+\.[0-9]*[1-9][0-9]*|\.[0-9]*[1-9][0-9]*)((cm)|(mm)|(in)|(pt)|(pc)|(px))/.exec(d))?{value:parseFloat(d[1]),unit:d[3]}:null;f=d&&d.unit;"px"===f?b=d.value:"cm"===f?b=d.value/2.54*96:"mm"===f?b=d.value/25.4*96:"in"===f?b=96*d.value:"pt"===f?b=d.value/.75:"pc"===f&&(b=16*d.value);return b}var k=odf.Namespaces.stylens;this.parseLength=g;this.parsePositiveLengthOrPercent=function(d,b,f){var n;d&&(n=parseFloat(d.substr(0, +d.indexOf("%"))),isNaN(n)&&(n=void 0));var k;void 0!==n?(f&&(k=f.value(b)),n=void 0===k?void 0:k/100*n):n=g(d);return n};this.getPropertiesElement=function(d,b,f){for(b=f?f.nextElementSibling:b.firstElementChild;null!==b&&(b.localName!==d||b.namespaceURI!==k);)b=b.nextElementSibling;return b};this.parseAttributeList=function(d){d&&(d=d.replace(/^\s*(.*?)\s*$/g,"$1"));return d&&0n.value&&(m="0.75pt"+h);h=m}else if(V.hasOwnProperty(e[1])){var m= +a,f=e[0],n=e[1],g=J.parseLength(h),r=void 0,p=void 0,q=void 0,O=void 0,q=void 0;if(g&&"%"===g.unit){r=g.value/100;p=k(m.parentNode);for(O="0";p;){if(q=y.getDirectChild(p,l,"paragraph-properties"))if(q=J.parseLength(q.getAttributeNS(f,n))){if("%"!==q.unit){O=q.value*r+q.unit;break}r*=q.value/100}p=k(p)}h=O}}e[2]&&(b+=e[2]+":"+h+";")}return b}function b(a,c,b,d){return c+c+b+b+d+d}function f(a,c){var b=[a],d=c.derivedStyles;Object.keys(d).forEach(function(a){a=f(a,d[a]);b=b.concat(a)});return b}function n(a, +c,b,d){function e(c,b){var d=[],h;c.forEach(function(a){m.forEach(function(c){d.push('draw|page[webodfhelper|page-style-name="'+c+'"] draw|frame[presentation|class="'+a+'"]')})});0 +z&&(a=z);for(c=Math.floor(a/d)*d;!b&&0<=c;)b=m[c],c-=d;for(b=b||x;b.nextBookmark&&b.nextBookmark.steps<=a;)e.check(),b=b.nextBookmark;runtime.assert(-1===a||b.steps<=a,"Bookmark @"+p(b)+" at step "+b.steps+" exceeds requested step of "+a);return b}function a(a){a.previousBookmark&&(a.previousBookmark.nextBookmark=a.nextBookmark);a.nextBookmark&&(a.nextBookmark.previousBookmark=a.previousBookmark)}function c(a){for(var c,b=null;!b&&a&&a!==k;)(c=q(a))&&(b=h[c])&&b.node!==a&&(runtime.log("Cloned node detected. Creating new bookmark"), +b=null,a.removeAttributeNS("urn:webodf:names:steps","nodeId")),a=a.parentNode;return b}var m={},h={},y=core.DomUtils,x,z,w=Node.DOCUMENT_POSITION_FOLLOWING,v=Node.DOCUMENT_POSITION_PRECEDING;this.updateBookmark=function(c,b){var g,n=Math.ceil(c/d)*d,p,v,E;if(void 0!==z&&zp.steps)m[n]=v;r()};this.setToClosestStep=function(a,c){var b;r();b=l(a);b.setIteratorPosition(c); +return b.steps};this.setToClosestDomPoint=function(a,b,d){var e,h;r();if(a===k&&0===b)e=x;else if(a===k&&b===k.childNodes.length)for(h in e=x,m)m.hasOwnProperty(h)&&(a=m[h],a.steps>e.steps&&(e=a));else if(e=c(a.childNodes.item(b)||a),!e)for(d.setUnfilteredPosition(a,b);!e&&d.previousNode();)e=c(d.getCurrentNode());e=e||x;void 0!==z&&e.steps>z&&(e=l(z));e.setIteratorPosition(d);return e.steps};this.damageCacheAfterStep=function(a){0>a&&(a=-1);void 0===z?z=a:aa)throw new RangeError("Requested steps is negative ("+a+")");for(b=p.setToClosestStep(a,k);bq.comparePoints(g,0,a,b),a=g,b=b?0:g.childNodes.length);k.setUnfilteredPosition(a,b);n(k,h)||k.setUnfilteredPosition(a,b);h=k.container();b=k.unfilteredDomOffset();a=p.setToClosestDomPoint(h,b,k);if(0>q.comparePoints(k.container(),k.unfilteredDomOffset(),h,b))return 0=e.textNode.length?null:e.textNode.splitText(e.offset));for(c=e.textNode;c!==a;){c=c.parentNode;m=c.cloneNode(!1);h&&m.appendChild(h);if(y)for(;y&&y.nextSibling;)m.appendChild(y.nextSibling);else for(;c.firstChild;)m.appendChild(c.firstChild);c.parentNode.insertBefore(m,c.nextSibling);y=c;h=m}p.isListItem(h)&&(h=h.childNodes.item(0));n?h.setAttributeNS(r,"text:style-name",n):h.removeAttributeNS(r,"style-name");0===e.textNode.length&& +e.textNode.parentNode.removeChild(e.textNode);d.emit(ops.OdtDocument.signalStepsInserted,{position:b});x&&f&&(d.moveCursor(g,b+1,0),d.emit(ops.Document.signalCursorMoved,x));d.fixCursorPositions();d.getOdfCanvas().refreshSize();d.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:l,memberId:g,timeStamp:k});d.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:h,memberId:g,timeStamp:k});d.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph", +memberid:g,timestamp:k,position:b,sourceParagraphPosition:d,paragraphStyleName:n,moveCursor:f}}}; +ops.OpUpdateMember=function(){function g(d){var f="//dc:creator[@editinfo:memberid='"+k+"']";d=xmldom.XPath.getODFElementsWithXPath(d.getRootNode(),f,function(b){return"editinfo"===b?"urn:webodf:names:editinfo":odf.Namespaces.lookupNamespaceURI(b)});for(f=0;f=e.width&&(e=null),g.detach();else if(k.isCharacterElement(f.container)||k.isCharacterFrame(f.container))e=b.getBoundingClientRect(f.container); +return e}var k=odf.OdfUtils,d=new odf.StepUtils,b=core.DomUtils,f=core.StepDirection.NEXT,n=gui.StepInfo.VisualDirection.LEFT_TO_RIGHT,p=gui.StepInfo.VisualDirection.RIGHT_TO_LEFT;this.getContentRect=g;this.moveToFilteredStep=function(b,d,e){function l(a,b){b.process(w,h,k)&&(a=!0,!x&&b.token&&(x=b.token));return a}var a=d===f,c,m,h,k,x,z=b.snapshot();c=!1;var w;do c=g(b),w={token:b.snapshot(),container:b.container,offset:b.offset,direction:d,visualDirection:d===f?n:p},m=b.nextStep()?g(b):null,b.restore(w.token), +a?(h=c,k=m):(h=m,k=c),c=e.reduce(l,!1);while(!c&&b.advanceStep(d));c||e.forEach(function(a){!x&&a.token&&(x=a.token)});b.restore(x||z);return Boolean(x)}}; +gui.Caret=function(g,k,d,b){function f(){a.style.opacity="0"===a.style.opacity?"1":"0";t.trigger()}function n(){y.selectNodeContents(h);return y.getBoundingClientRect()}function p(a){return E[a]!==L[a]}function r(){Object.keys(L).forEach(function(a){E[a]=L[a]})}function q(){if(!1===L.isShown||g.getSelectionType()!==ops.OdtCursor.RangeSelection||!b&&!g.getSelectedRange().collapsed)L.visibility="hidden",a.style.visibility="hidden",t.cancel();else if(L.visibility="visible",a.style.visibility="visible", +!1===L.isFocused)a.style.opacity="1",t.cancel();else{if(A||p("visibility"))a.style.opacity="1",t.cancel();t.trigger()}if(K||I){var d;d=g.getNode();var e,h,f=z.getBoundingClientRect(x.getSizer()),q=!1,y=0;d.removeAttributeNS("urn:webodf:names:cursor","caret-sizer-active");if(0d.height&&(d={top:d.top-(8-d.height)/2,height:8,right:d.right});l.style.height=d.height+"px";l.style.top=d.top+"px"; +l.style.left=d.right-d.width+"px";l.style.width=d.width?d.width+"px":"";m&&(d=runtime.getWindow().getComputedStyle(g.getNode(),null),d.font?m.style.font=d.font:(m.style.fontStyle=d.fontStyle,m.style.fontVariant=d.fontVariant,m.style.fontWeight=d.fontWeight,m.style.fontSize=d.fontSize,m.style.lineHeight=d.lineHeight,m.style.fontFamily=d.fontFamily))}L.isShown&&I&&k.scrollIntoView(a.getBoundingClientRect());p("isFocused")&&c.markAsFocussed(L.isFocused);r();K=I=A=!1}function e(a){l.parentNode.removeChild(l); +h.parentNode.removeChild(h);a()}var l,a,c,m,h,y,x=g.getDocument().getCanvas(),z=core.DomUtils,w=new gui.GuiStepUtils,v,u,t,A=!1,I=!1,K=!1,L={isFocused:!1,isShown:!0,visibility:"hidden"},E={isFocused:!L.isFocused,isShown:!L.isShown,visibility:"hidden"};this.handleUpdate=function(){K=!0;u.trigger()};this.refreshCursorBlinking=function(){A=!0;u.trigger()};this.setFocus=function(){L.isFocused=!0;u.trigger()};this.removeFocus=function(){L.isFocused=!1;u.trigger()};this.show=function(){L.isShown=!0;u.trigger()}; +this.hide=function(){L.isShown=!1;u.trigger()};this.setAvatarImageUrl=function(a){c.setImageUrl(a)};this.setColor=function(b){a.style.borderColor=b;c.setColor(b)};this.getCursor=function(){return g};this.getFocusElement=function(){return a};this.toggleHandleVisibility=function(){c.isVisible()?c.hide():c.show()};this.showHandle=function(){c.show()};this.hideHandle=function(){c.hide()};this.setOverlayElement=function(a){m=a;l.appendChild(a);K=!0;u.trigger()};this.ensureVisible=function(){I=!0;u.trigger()}; +this.getBoundingClientRect=function(){return z.getBoundingClientRect(l)};this.destroy=function(a){core.Async.destroyAll([u.destroy,t.destroy,c.destroy,e],a)};(function(){var b=g.getDocument(),e=[b.createRootFilter(g.getMemberId()),b.getPositionFilter()],m=b.getDOMDocument();y=m.createRange();h=m.createElement("span");h.className="webodf-caretSizer";h.textContent="|";g.getNode().appendChild(h);l=m.createElement("div");l.setAttributeNS("urn:webodf:names:editinfo","editinfo:memberid",g.getMemberId()); +l.className="webodf-caretOverlay";a=m.createElement("div");a.className="caret";l.appendChild(a);c=new gui.Avatar(l,d);x.getSizer().appendChild(l);v=b.createStepIterator(g.getNode(),0,e,b.getRootNode());u=core.Task.createRedrawTask(q);t=core.Task.createTimeoutTask(f,500);u.triggerImmediate()})()}; +odf.TextSerializer=function(){function g(b){var f="",n=k.filter?k.filter.acceptNode(b):NodeFilter.FILTER_ACCEPT,p=b.nodeType,r;if((n===NodeFilter.FILTER_ACCEPT||n===NodeFilter.FILTER_SKIP)&&d.isTextContentContainingNode(b))for(r=b.firstChild;r;)f+=g(r),r=r.nextSibling;n===NodeFilter.FILTER_ACCEPT&&(p===Node.ELEMENT_NODE&&d.isParagraph(b)?f+="\n":p===Node.TEXT_NODE&&b.textContent&&(f+=b.textContent));return f}var k=this,d=odf.OdfUtils;this.filter=null;this.writeToString=function(b){if(!b)return""; +b=g(b);"\n"===b[b.length-1]&&(b=b.substr(0,b.length-1));return b}};gui.MimeDataExporter=function(){var g;this.exportRangeToDataTransfer=function(k,d){var b;b=d.startContainer.ownerDocument.createElement("span");b.appendChild(d.cloneContents());b=g.writeToString(b);try{k.setData("text/plain",b)}catch(f){k.setData("Text",b)}};g=new odf.TextSerializer;g.filter=new odf.OdfNodeFilter}; +gui.Clipboard=function(g){this.setDataFromRange=function(k,d){var b,f=k.clipboardData;b=runtime.getWindow();!f&&b&&(f=b.clipboardData);f?(b=!0,g.exportRangeToDataTransfer(f,d),k.preventDefault()):b=!1;return b}}; +gui.SessionContext=function(g,k){var d=g.getOdtDocument(),b=odf.OdfUtils;this.isLocalCursorWithinOwnAnnotation=function(){var f=d.getCursor(k),g;if(!f)return!1;g=f&&f.getNode();f=d.getMember(k).getProperties().fullName;return(g=b.getParentAnnotation(g,d.getRootNode()))&&b.getAnnotationCreator(g)===f?!0:!1}}; +gui.StyleSummary=function(g){function k(b,d){var k=b+"|"+d,q;f.hasOwnProperty(k)||(q=[],g.forEach(function(e){e=(e=e.styleProperties[b])&&e[d];-1===q.indexOf(e)&&q.push(e)}),f[k]=q);return f[k]}function d(b,d,f){return function(){var g=k(b,d);return f.length>=g.length&&g.every(function(b){return-1!==f.indexOf(b)})}}function b(b,d){var f=k(b,d);return 1===f.length?f[0]:void 0}var f={};this.getPropertyValues=k;this.getCommonValue=b;this.isBold=d("style:text-properties","fo:font-weight",["bold"]);this.isItalic= +d("style:text-properties","fo:font-style",["italic"]);this.hasUnderline=d("style:text-properties","style:text-underline-style",["solid"]);this.hasStrikeThrough=d("style:text-properties","style:text-line-through-style",["solid"]);this.fontSize=function(){var d=b("style:text-properties","fo:font-size");return d&&parseFloat(d)};this.fontName=function(){return b("style:text-properties","style:font-name")};this.isAlignedLeft=d("style:paragraph-properties","fo:text-align",["left","start"]);this.isAlignedCenter= +d("style:paragraph-properties","fo:text-align",["center"]);this.isAlignedRight=d("style:paragraph-properties","fo:text-align",["right","end"]);this.isAlignedJustified=d("style:paragraph-properties","fo:text-align",["justify"]);this.text={isBold:this.isBold,isItalic:this.isItalic,hasUnderline:this.hasUnderline,hasStrikeThrough:this.hasStrikeThrough,fontSize:this.fontSize,fontName:this.fontName};this.paragraph={isAlignedLeft:this.isAlignedLeft,isAlignedCenter:this.isAlignedCenter,isAlignedRight:this.isAlignedRight, +isAlignedJustified:this.isAlignedJustified}}; +gui.DirectFormattingController=function(g,k,d,b,f,n,p){function r(){return U.value().styleSummary}function q(){return U.value().enabledFeatures}function e(a){var b;a.collapsed?(b=a.startContainer,b.hasChildNodes()&&a.startOffseta.clientWidth||a.scrollHeight>a.clientHeight)&&c.push(new l(a)),a=a.parentNode;c.push(new e(v));return c}function w(){var a; +h()||(a=z(K),x(),K.focus(),a.forEach(function(a){a.restore()}))}var v=runtime.getWindow(),u={beforecut:!0,beforepaste:!0,longpress:!0,drag:!0,dragstop:!0},t={mousedown:!0,mouseup:!0,focus:!0},A={},I={},K,L=g.getCanvas().getElement(),E=this,N={};this.addFilter=function(c,b){a(c,!0).filters.push(b)};this.removeFilter=function(c,b){var d=a(c,!0),e=d.filters.indexOf(b);-1!==e&&d.filters.splice(e,1)};this.subscribe=c;this.unsubscribe=m;this.hasFocus=h;this.focus=w;this.getEventTrap=function(){return K}; +this.setEditing=function(a){var c=h();c&&K.blur();a?K.removeAttribute("readOnly"):K.setAttribute("readOnly","true");c&&w()};this.destroy=function(a){m("touchstart",q);Object.keys(N).forEach(function(a){b(parseInt(a,10))});N.length=0;Object.keys(A).forEach(function(a){A[a].destroy()});A={};m("mousedown",y);m("mouseup",x);m("contextmenu",x);Object.keys(I).forEach(function(a){I[a].destroy()});I={};K.parentNode.removeChild(K);a()};(function(){var a=g.getOdfCanvas().getSizer(),b=a.ownerDocument;runtime.assert(Boolean(v), +"EventManager requires a window object to operate correctly");K=b.createElement("textarea");K.id="eventTrap";K.setAttribute("tabindex","-1");K.setAttribute("readOnly","true");K.setAttribute("rows","1");a.appendChild(K);c("mousedown",y);c("mouseup",x);c("contextmenu",x);A.longpress=new d("longpress",["touchstart","touchmove","touchend"],n);A.drag=new d("drag",["touchstart","touchmove","touchend"],p);A.dragstop=new d("dragstop",["drag","touchend"],r);c("touchstart",q)})()}; +gui.IOSSafariSupport=function(g){function k(){d.innerHeight!==d.outerHeight&&(b.style.display="none",runtime.requestAnimationFrame(function(){b.style.display="block"}))}var d=runtime.getWindow(),b=g.getEventTrap();this.destroy=function(d){g.unsubscribe("focus",k);b.removeAttribute("autocapitalize");b.style.WebkitTransform="";d()};g.subscribe("focus",k);b.setAttribute("autocapitalize","off");b.style.WebkitTransform="translateX(-10000px)"}; +gui.HyperlinkController=function(g,k,d,b){function f(){var b=!0;!0===k.getState(gui.CommonConstraints.EDIT.REVIEW_MODE)&&(b=d.isLocalCursorWithinOwnAnnotation());b!==e&&(e=b,q.emit(gui.HyperlinkController.enabledChanged,e))}function n(d){d.getMemberId()===b&&f()}var p=odf.OdfUtils,r=g.getOdtDocument(),q=new core.EventNotifier([gui.HyperlinkController.enabledChanged]),e=!1;this.isEnabled=function(){return e};this.subscribe=function(b,a){q.subscribe(b,a)};this.unsubscribe=function(b,a){q.unsubscribe(b, +a)};this.addHyperlink=function(d,a){if(e){var c=r.getCursorSelection(b),f=new ops.OpApplyHyperlink,h=[];if(0===c.length||a)a=a||d,f=new ops.OpInsertText,f.init({memberid:b,position:c.position,text:a}),c.length=a.length,h.push(f);f=new ops.OpApplyHyperlink;f.init({memberid:b,position:c.position,length:c.length,hyperlink:d});h.push(f);g.enqueue(h)}};this.removeHyperlinks=function(){if(e){var d=r.createPositionIterator(r.getRootNode()),a=r.getCursor(b).getSelectedRange(),c=p.getHyperlinkElements(a), +f=a.collapsed&&1===c.length,h=r.getDOMDocument().createRange(),k=[],n,q;0!==c.length&&(c.forEach(function(a){h.selectNodeContents(a);n=r.convertDomToCursorRange({anchorNode:h.startContainer,anchorOffset:h.startOffset,focusNode:h.endContainer,focusOffset:h.endOffset});q=new ops.OpRemoveHyperlink;q.init({memberid:b,position:n.position,length:n.length});k.push(q)}),f||(f=c[0],-1===a.comparePoint(f,0)&&(h.setStart(f,0),h.setEnd(a.startContainer,a.startOffset),n=r.convertDomToCursorRange({anchorNode:h.startContainer, +anchorOffset:h.startOffset,focusNode:h.endContainer,focusOffset:h.endOffset}),0k.width&&(v=k.width/n.width);n.height>k.height&&(u=k.height/n.height);k=Math.min(v,u);n= +{width:n.width*k,height:n.height*k}}k=p.convert(n.width,"px","cm")+"cm";p=p.convert(n.height,"px","cm")+"cm";u=e.getOdfCanvas().odfContainer().rootElement.styles;n=c.toLowerCase();var v=r.hasOwnProperty(n)?r[n]:null,t;n=[];runtime.assert(null!==v,"Image type is not supported: "+c);v="Pictures/"+f.generateImageName()+v;t=new ops.OpSetBlob;t.init({memberid:b,filename:v,mimetype:c,content:d});n.push(t);a.getStyleElement("Graphics","graphic",[u])||(c=new ops.OpAddStyle,c.init({memberid:b,styleName:"Graphics", +styleFamily:"graphic",isAutomaticStyle:!1,setProperties:{"style:graphic-properties":{"text:anchor-type":"paragraph","svg:x":"0cm","svg:y":"0cm","style:wrap":"dynamic","style:number-wrapped-paragraphs":"no-limit","style:wrap-contour":"false","style:vertical-pos":"top","style:vertical-rel":"paragraph","style:horizontal-pos":"center","style:horizontal-rel":"paragraph"}}}),n.push(c));c=f.generateStyleName();d=new ops.OpAddStyle;d.init({memberid:b,styleName:c,styleFamily:"graphic",isAutomaticStyle:!0, +setProperties:{"style:parent-style-name":"Graphics","style:graphic-properties":{"style:vertical-pos":"top","style:vertical-rel":"baseline","style:horizontal-pos":"center","style:horizontal-rel":"paragraph","fo:background-color":"transparent","style:background-transparency":"100%","style:shadow":"none","style:mirror":"none","fo:clip":"rect(0cm, 0cm, 0cm, 0cm)","draw:luminance":"0%","draw:contrast":"0%","draw:red":"0%","draw:green":"0%","draw:blue":"0%","draw:gamma":"100%","draw:color-inversion":"false", +"draw:image-opacity":"100%","draw:color-mode":"standard"}}});n.push(d);t=new ops.OpInsertImage;t.init({memberid:b,position:e.getCursorPosition(b),filename:v,frameWidth:k,frameHeight:p,frameStyleName:c,frameName:f.generateFrameName()});n.push(t);g.enqueue(n)}};this.destroy=function(a){e.unsubscribe(ops.Document.signalCursorMoved,p);k.unsubscribe(gui.CommonConstraints.EDIT.REVIEW_MODE,n);a()};e.subscribe(ops.Document.signalCursorMoved,p);k.subscribe(gui.CommonConstraints.EDIT.REVIEW_MODE,n);n()}; +gui.ImageController.enabledChanged="enabled/changed"; +gui.ImageSelector=function(g){function k(){var d=g.getSizer(),k=f.createElement("div");k.id="imageSelector";k.style.borderWidth="1px";d.appendChild(k);b.forEach(function(b){var d=f.createElement("div");d.className=b;k.appendChild(d)});return k}var d=odf.Namespaces.svgns,b="topLeft topRight bottomRight bottomLeft topMiddle rightMiddle bottomMiddle leftMiddle".split(" "),f=g.getElement().ownerDocument,n=!1;this.select=function(b){var r,q,e=f.getElementById("imageSelector");e||(e=k());n=!0;r=e.parentNode; +q=b.getBoundingClientRect();var l=r.getBoundingClientRect(),a=g.getZoomLevel();r=(q.left-l.left)/a-1;q=(q.top-l.top)/a-1;e.style.display="block";e.style.left=r+"px";e.style.top=q+"px";e.style.width=b.getAttributeNS(d,"width");e.style.height=b.getAttributeNS(d,"height")};this.clearSelection=function(){var b;n&&(b=f.getElementById("imageSelector"))&&(b.style.display="none");n=!1};this.isSelectorElement=function(b){var d=f.getElementById("imageSelector");return d?b===d||b.parentNode===d:!1}}; +(function(){function g(g){function d(b){p=b.which&&String.fromCharCode(b.which)===n;n=void 0;return!1===p}function b(){p=!1}function f(b){n=b.data;p=!1}var n,p=!1;this.destroy=function(n){g.unsubscribe("textInput",b);g.unsubscribe("compositionend",f);g.removeFilter("keypress",d);n()};g.subscribe("textInput",b);g.subscribe("compositionend",f);g.addFilter("keypress",d)}gui.InputMethodEditor=function(k,d){function b(c){a&&(c?a.getNode().setAttributeNS("urn:webodf:names:cursor","composing","true"):(a.getNode().removeAttributeNS("urn:webodf:names:cursor", +"composing"),h.textContent=""))}function f(){x&&(x=!1,b(!1),w.emit(gui.InputMethodEditor.signalCompositionEnd,{data:z}),z="")}function n(){I||(I=!0,f(),a&&a.getSelectedRange().collapsed?c.value="":c.value=u.writeToString(a.getSelectedRange().cloneContents()),c.setSelectionRange(0,c.value.length),I=!1)}function p(){d.hasFocus()&&y.trigger()}function r(){v=void 0;y.cancel();b(!0);x||w.emit(gui.InputMethodEditor.signalCompositionStart,{data:""})}function q(a){a=v=a.data;x=!0;z+=a;y.trigger()}function e(a){a.data!== +v&&(a=a.data,x=!0,z+=a,y.trigger());v=void 0}function l(){h.textContent=c.value}var a=null,c=d.getEventTrap(),m=c.ownerDocument,h,y,x=!1,z="",w=new core.EventNotifier([gui.InputMethodEditor.signalCompositionStart,gui.InputMethodEditor.signalCompositionEnd]),v,u,t=[],A,I=!1;this.subscribe=w.subscribe;this.unsubscribe=w.unsubscribe;this.registerCursor=function(c){c.getMemberId()===k&&(a=c,a.getNode().appendChild(h),c.subscribe(ops.OdtCursor.signalCursorUpdated,p),d.subscribe("input",l),d.subscribe("compositionupdate", +l))};this.removeCursor=function(c){a&&c===k&&(a.getNode().removeChild(h),a.unsubscribe(ops.OdtCursor.signalCursorUpdated,p),d.unsubscribe("input",l),d.unsubscribe("compositionupdate",l),a=null)};this.destroy=function(a){d.unsubscribe("compositionstart",r);d.unsubscribe("compositionend",q);d.unsubscribe("textInput",e);d.unsubscribe("keypress",f);d.unsubscribe("focus",n);core.Async.destroyAll(A,a)};(function(){u=new odf.TextSerializer;u.filter=new odf.OdfNodeFilter;d.subscribe("compositionstart",r); +d.subscribe("compositionend",q);d.subscribe("textInput",e);d.subscribe("keypress",f);d.subscribe("focus",n);t.push(new g(d));A=t.map(function(a){return a.destroy});h=m.createElement("span");h.setAttribute("id","composer");y=core.Task.createTimeoutTask(n,1);A.push(y.destroy)})()};gui.InputMethodEditor.signalCompositionStart="input/compositionstart";gui.InputMethodEditor.signalCompositionEnd="input/compositionend"})(); +gui.MetadataController=function(g,k){function d(b){n.emit(gui.MetadataController.signalMetadataChanged,b)}function b(b){var d=-1===p.indexOf(b);d||runtime.log("Setting "+b+" is restricted.");return d}var f=g.getOdtDocument(),n=new core.EventNotifier([gui.MetadataController.signalMetadataChanged]),p=["dc:creator","dc:date","meta:editing-cycles","meta:editing-duration","meta:document-statistic"];this.setMetadata=function(d,f){var e={},l="",a;d&&Object.keys(d).filter(b).forEach(function(a){e[a]=d[a]}); +f&&(l=f.filter(b).join(","));if(0f:!1}function d(b){null!==b&&!1===k(b)&&(f=Math.abs(b-g))}var b=this,f,n=gui.StepInfo.VisualDirection.LEFT_TO_RIGHT;this.token=void 0;this.process=function(f,g,q){var e,l;f.visualDirection===n?(e=g&&g.right,l=q&&q.left):(e=g&&g.left,l=q&&q.right);if(k(e)||k(l))return!0;if(g||q)d(e),d(l),b.token=f.token;return!1}}; +gui.LineBoundaryScanner=function(){var g=this,k=null;this.token=void 0;this.process=function(d,b,f){var n;if(n=f)if(k){var p=k;n=Math.min(p.bottom-p.top,f.bottom-f.top);var r=Math.max(p.top,f.top),p=Math.min(p.bottom,f.bottom)-r;n=.4>=(0b?a.previousSibling:a.nextSibling,c(f)===NodeFilter.FILTER_ACCEPT&&(d=f),a=a.parentNode;return d}function b(a,b){var c;return null===a?m.NO_NEIGHBOUR:p.isCharacterElement(a)?m.SPACE_CHAR:a.nodeType===f||p.isTextSpan(a)||p.isHyperlink(a)?(c=a.textContent.charAt(b()),q.test(c)?m.SPACE_CHAR:r.test(c)?m.PUNCTUATION_CHAR:m.WORD_CHAR):m.OTHER}var f=Node.TEXT_NODE,n=Node.ELEMENT_NODE, +p=odf.OdfUtils,r=/[!-#%-*,-\/:-;?-@\[-\]_{}\u00a1\u00ab\u00b7\u00bb\u00bf;\u00b7\u055a-\u055f\u0589-\u058a\u05be\u05c0\u05c3\u05c6\u05f3-\u05f4\u0609-\u060a\u060c-\u060d\u061b\u061e-\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0964-\u0965\u0970\u0df4\u0e4f\u0e5a-\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u104a-\u104f\u10fb\u1361-\u1368\u166d-\u166e\u169b-\u169c\u16eb-\u16ed\u1735-\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944-\u1945\u19de-\u19df\u1a1e-\u1a1f\u1b5a-\u1b60\u1c3b-\u1c3f\u1c7e-\u1c7f\u2000-\u206e\u207d-\u207e\u208d-\u208e\u3008-\u3009\u2768-\u2775\u27c5-\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc-\u29fd\u2cf9-\u2cfc\u2cfe-\u2cff\u2e00-\u2e7e\u3000-\u303f\u30a0\u30fb\ua60d-\ua60f\ua673\ua67e\ua874-\ua877\ua8ce-\ua8cf\ua92e-\ua92f\ua95f\uaa5c-\uaa5f\ufd3e-\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a-\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a-\uff1b\uff1f-\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]|\ud800[\udd00-\udd01\udf9f\udfd0]|\ud802[\udd1f\udd3f\ude50-\ude58]|\ud809[\udc00-\udc7e]/, +q=/\s/,e=core.PositionFilter.FilterResult.FILTER_ACCEPT,l=core.PositionFilter.FilterResult.FILTER_REJECT,a=odf.WordBoundaryFilter.IncludeWhitespace.TRAILING,c=odf.WordBoundaryFilter.IncludeWhitespace.LEADING,m={NO_NEIGHBOUR:0,SPACE_CHAR:1,PUNCTUATION_CHAR:2,WORD_CHAR:3,OTHER:4};this.acceptPosition=function(f){var g=f.container(),p=f.leftNode(),r=f.rightNode(),q=f.unfilteredDomOffset,v=function(){return f.unfilteredDomOffset()-1};g.nodeType===n&&(null===r&&(r=d(g,1,f.getNodeFilter())),null===p&&(p= +d(g,-1,f.getNodeFilter())));g!==r&&(q=function(){return 0});g!==p&&null!==p&&(v=function(){return p.textContent.length-1});g=b(p,v);r=b(r,q);return g===m.WORD_CHAR&&r===m.WORD_CHAR||g===m.PUNCTUATION_CHAR&&r===m.PUNCTUATION_CHAR||k===a&&g!==m.NO_NEIGHBOUR&&r===m.SPACE_CHAR||k===c&&g===m.SPACE_CHAR&&r!==m.NO_NEIGHBOUR?l:e}};odf.WordBoundaryFilter.IncludeWhitespace={None:0,TRAILING:1,LEADING:2}; +gui.SelectionController=function(g,k){function d(a){var b=a.spec();if(a.isEdit||b.memberid===k)I=void 0,K.cancel()}function b(){var a=x.getCursor(k).getNode();return x.createStepIterator(a,0,[v,t],x.getRootElement(a))}function f(a,b,c){c=new odf.WordBoundaryFilter(x,c);var d=x.getRootElement(a)||x.getRootNode(),e=x.createRootFilter(d);return x.createStepIterator(a,b,[v,e,c],d)}function n(a,b){return b?{anchorNode:a.startContainer,anchorOffset:a.startOffset,focusNode:a.endContainer,focusOffset:a.endOffset}: +{anchorNode:a.endContainer,anchorOffset:a.endOffset,focusNode:a.startContainer,focusOffset:a.startOffset}}function p(a,b,c){var d=new ops.OpMoveCursor;d.init({memberid:k,position:a,length:b||0,selectionType:c});return d}function r(a,b,c){var d;d=x.getCursor(k);d=n(d.getSelectedRange(),d.hasForwardSelection());d.focusNode=a;d.focusOffset=b;c||(d.anchorNode=d.focusNode,d.anchorOffset=d.focusOffset);a=x.convertDomToCursorRange(d);g.enqueue([p(a.position,a.length)])}function q(a){var b;b=f(a.startContainer, +a.startOffset,L);b.roundToPreviousStep()&&a.setStart(b.container(),b.offset());b=f(a.endContainer,a.endOffset,E);b.roundToNextStep()&&a.setEnd(b.container(),b.offset())}function e(a){var b=w.getParagraphElements(a),c=b[0],b=b[b.length-1];c&&a.setStart(c,0);b&&(w.isParagraph(a.endContainer)&&0===a.endOffset?a.setEndBefore(b):a.setEnd(b,b.childNodes.length))}function l(a,b,c,d){var e,f;d?(e=c.startContainer,f=c.startOffset):(e=c.endContainer,f=c.endOffset);z.containsNode(a,e)||(f=0>z.comparePoints(a, +0,e,f)?0:a.childNodes.length,e=a);a=x.createStepIterator(e,f,b,w.getParagraphElement(e)||a);a.roundToClosestStep()||runtime.assert(!1,"No step found in requested range");d?c.setStart(a.container(),a.offset()):c.setEnd(a.container(),a.offset())}function a(a,c){var d=b();d.advanceStep(a)&&r(d.container(),d.offset(),c)}function c(a,c){var d,e=I,f=[new gui.LineBoundaryScanner,new gui.ParagraphBoundaryScanner];void 0===e&&A&&(e=A());isNaN(e)||(d=b(),u.moveToFilteredStep(d,a,f)&&d.advanceStep(a)&&(f=[new gui.ClosestXOffsetScanner(e), +new gui.LineBoundaryScanner,new gui.ParagraphBoundaryScanner],u.moveToFilteredStep(d,a,f)&&(r(d.container(),d.offset(),c),I=e,K.restart())))}function m(a,c){var d=b(),e=[new gui.LineBoundaryScanner,new gui.ParagraphBoundaryScanner];u.moveToFilteredStep(d,a,e)&&r(d.container(),d.offset(),c)}function h(a,b){var c=x.getCursor(k),c=n(c.getSelectedRange(),c.hasForwardSelection()),c=f(c.focusNode,c.focusOffset,L);c.advanceStep(a)&&r(c.container(),c.offset(),b)}function y(a,b,c){var d=!1,e=x.getCursor(k), +e=n(e.getSelectedRange(),e.hasForwardSelection()),d=x.getRootElement(e.focusNode);runtime.assert(Boolean(d),"SelectionController: Cursor outside root");e=x.createStepIterator(e.focusNode,e.focusOffset,[v,t],d);e.roundToClosestStep();e.advanceStep(a)&&(c=c(e.container()))&&(a===N?(e.setPosition(c,0),d=e.roundToNextStep()):(e.setPosition(c,c.childNodes.length),d=e.roundToPreviousStep()),d&&r(e.container(),e.offset(),b))}var x=g.getOdtDocument(),z=core.DomUtils,w=odf.OdfUtils,v=x.getPositionFilter(), +u=new gui.GuiStepUtils,t=x.createRootFilter(k),A=null,I,K,L=odf.WordBoundaryFilter.IncludeWhitespace.TRAILING,E=odf.WordBoundaryFilter.IncludeWhitespace.LEADING,N=core.StepDirection.PREVIOUS,O=core.StepDirection.NEXT;this.selectionToRange=function(a){var b=0<=z.comparePoints(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset),c=a.focusNode.ownerDocument.createRange();b?(c.setStart(a.anchorNode,a.anchorOffset),c.setEnd(a.focusNode,a.focusOffset)):(c.setStart(a.focusNode,a.focusOffset),c.setEnd(a.anchorNode, +a.anchorOffset));return{range:c,hasForwardSelection:b}};this.rangeToSelection=n;this.selectImage=function(a){var c=x.getRootElement(a),b=x.createRootFilter(c),c=x.createStepIterator(a,0,[b,x.getPositionFilter()],c),d;c.roundToPreviousStep()||runtime.assert(!1,"No walkable position before frame");b=c.container();d=c.offset();c.setPosition(a,a.childNodes.length);c.roundToNextStep()||runtime.assert(!1,"No walkable position after frame");a=x.convertDomToCursorRange({anchorNode:b,anchorOffset:d,focusNode:c.container(), +focusOffset:c.offset()});a=p(a.position,a.length,ops.OdtCursor.RegionSelection);g.enqueue([a])};this.expandToWordBoundaries=q;this.expandToParagraphBoundaries=e;this.selectRange=function(a,c,b){var d=x.getOdfCanvas().getElement(),f,h=[v];f=z.containsNode(d,a.startContainer);d=z.containsNode(d,a.endContainer);if(f||d)if(f&&d&&(2===b?q(a):3<=b&&e(a)),(b=c?x.getRootElement(a.startContainer):x.getRootElement(a.endContainer))||(b=x.getRootNode()),h.push(x.createRootFilter(b)),l(b,h,a,!0),l(b,h,a,!1),a= +n(a,c),c=x.convertDomToCursorRange(a),a=x.getCursorSelection(k),c.position!==a.position||c.length!==a.length)a=p(c.position,c.length,ops.OdtCursor.RangeSelection),g.enqueue([a])};this.moveCursorToLeft=function(){a(N,!1);return!0};this.moveCursorToRight=function(){a(O,!1);return!0};this.extendSelectionToLeft=function(){a(N,!0);return!0};this.extendSelectionToRight=function(){a(O,!0);return!0};this.setCaretXPositionLocator=function(a){A=a};this.moveCursorUp=function(){c(N,!1);return!0};this.moveCursorDown= +function(){c(O,!1);return!0};this.extendSelectionUp=function(){c(N,!0);return!0};this.extendSelectionDown=function(){c(O,!0);return!0};this.moveCursorBeforeWord=function(){h(N,!1);return!0};this.moveCursorPastWord=function(){h(O,!1);return!0};this.extendSelectionBeforeWord=function(){h(N,!0);return!0};this.extendSelectionPastWord=function(){h(O,!0);return!0};this.moveCursorToLineStart=function(){m(N,!1);return!0};this.moveCursorToLineEnd=function(){m(O,!1);return!0};this.extendSelectionToLineStart= +function(){m(N,!0);return!0};this.extendSelectionToLineEnd=function(){m(O,!0);return!0};this.extendSelectionToParagraphStart=function(){y(N,!0,w.getParagraphElement);return!0};this.extendSelectionToParagraphEnd=function(){y(O,!0,w.getParagraphElement);return!0};this.moveCursorToParagraphStart=function(){y(N,!1,w.getParagraphElement);return!0};this.moveCursorToParagraphEnd=function(){y(O,!1,w.getParagraphElement);return!0};this.moveCursorToDocumentStart=function(){y(N,!1,x.getRootElement);return!0}; +this.moveCursorToDocumentEnd=function(){y(O,!1,x.getRootElement);return!0};this.extendSelectionToDocumentStart=function(){y(N,!0,x.getRootElement);return!0};this.extendSelectionToDocumentEnd=function(){y(O,!0,x.getRootElement);return!0};this.extendSelectionToEntireDocument=function(){var a=x.getCursor(k),a=x.getRootElement(a.getNode()),c,b,d;runtime.assert(Boolean(a),"SelectionController: Cursor outside root");d=x.createStepIterator(a,0,[v,t],a);d.roundToClosestStep();c=d.container();b=d.offset(); +d.setPosition(a,a.childNodes.length);d.roundToClosestStep();a=x.convertDomToCursorRange({anchorNode:c,anchorOffset:b,focusNode:d.container(),focusOffset:d.offset()});g.enqueue([p(a.position,a.length)]);return!0};this.destroy=function(a){x.unsubscribe(ops.OdtDocument.signalOperationStart,d);core.Async.destroyAll([K.destroy],a)};(function(){K=core.Task.createTimeoutTask(function(){I=void 0},2E3);x.subscribe(ops.OdtDocument.signalOperationStart,d)})()}; +gui.TextController=function(g,k,d,b,f,n){function p(){y=!0===k.getState(gui.CommonConstraints.EDIT.REVIEW_MODE)?d.isLocalCursorWithinOwnAnnotation():!0}function r(a){a.getMemberId()===b&&p()}function q(a,b,d){var e=[c.getPositionFilter()];d&&e.push(c.createRootFilter(a.startContainer));d=c.createStepIterator(a.startContainer,a.startOffset,e,b);d.roundToClosestStep()||runtime.assert(!1,"No walkable step found in paragraph element at range start");b=c.convertDomPointToCursorStep(d.container(),d.offset()); +a.collapsed?a=b:(d.setPosition(a.endContainer,a.endOffset),d.roundToClosestStep()||runtime.assert(!1,"No walkable step found in paragraph element at range end"),a=c.convertDomPointToCursorStep(d.container(),d.offset()));return{position:b,length:a-b}}function e(a){var c,d,e,f=m.getParagraphElements(a),g=a.cloneRange(),l=[];c=f[0];1a.length&&(a.position+=a.length,a.length=-a.length);return a}function a(a){if(!y)return!1;var d,f=c.getCursor(b).getSelectedRange().cloneRange(), +h=l(c.getCursorSelection(b)),m;if(0===h.length){h=void 0;d=c.getCursor(b).getNode();m=c.getRootElement(d);var k=[c.getPositionFilter(),c.createRootFilter(m)];m=c.createStepIterator(d,0,k,m);m.roundToClosestStep()&&(a?m.nextStep():m.previousStep())&&(h=l(c.convertDomToCursorRange({anchorNode:d,anchorOffset:0,focusNode:m.container(),focusOffset:m.offset()})),a?(f.setStart(d,0),f.setEnd(m.container(),m.offset())):(f.setStart(m.container(),m.offset()),f.setEnd(d,0)))}h&&g.enqueue(e(f));return void 0!== +h}var c=g.getOdtDocument(),m=odf.OdfUtils,h=core.DomUtils,y=!1,x=odf.Namespaces.textns,z=core.StepDirection.NEXT;this.isEnabled=function(){return y};this.enqueueParagraphSplittingOps=function(){if(!y)return!1;var a=c.getCursor(b),d=a.getSelectedRange(),f=l(c.getCursorSelection(b)),h=[],a=m.getParagraphElement(a.getNode()),k=a.getAttributeNS(x,"style-name")||"";0d.left&&(d=v(e)))c.focusNode=d.container,c.focusOffset=d.offset, +b&&(c.anchorNode=c.focusNode,c.anchorOffset=c.focusOffset)}else S.isImage(c.focusNode.firstChild)&&1===c.focusOffset&&S.isCharacterFrame(c.focusNode)&&(d=v(c.focusNode))&&(c.anchorNode=c.focusNode=d.container,c.anchorOffset=c.focusOffset=d.offset);c.anchorNode&&c.focusNode&&(c=T.selectionToRange(c),T.selectRange(c.range,c.hasForwardSelection,0===a.button?a.detail:0));F.focus()}function t(a){var c;if(c=n(a.clientX,a.clientY))a=c.container,c=c.offset,a={anchorNode:a,anchorOffset:c,focusNode:a,focusOffset:c}, +a=T.selectionToRange(a),T.selectRange(a.range,a.hasForwardSelection,2),F.focus()}function A(a){var c=a.target||a.srcElement||null,d,e,f;ma.processRequests();U&&(S.isImage(c)&&S.isCharacterFrame(c.parentNode)&&W.getSelection().isCollapsed?(T.selectImage(c.parentNode),F.focus()):la.isSelectorElement(c)?F.focus():B?(c=b.getSelectedRange(),e=c.collapsed,S.isImage(c.endContainer)&&0===c.endOffset&&S.isCharacterFrame(c.endContainer.parentNode)&&(f=c.endContainer.parentNode,f=v(f))&&(c.setEnd(f.container, +f.offset),e&&c.collapse(!1)),T.selectRange(c,b.hasForwardSelection(),0===a.button?a.detail:0),F.focus()):ua?u(a):(d=aa.cloneEvent(a),M=runtime.setTimeout(function(){u(d)},0)),oa=0,B=U=!1)}function I(a){var c=J.getCursor(d).getSelectedRange();c.collapsed||fa.exportRangeToDataTransfer(a.dataTransfer,c)}function K(){U&&F.focus();oa=0;B=U=!1}function L(a){A(a)}function E(a){var c=a.target||a.srcElement||null,b=null;"annotationRemoveButton"===c.className?(runtime.assert(ja,"Remove buttons are displayed on annotations while annotation editing is disabled in the controller."), +b=c.parentNode.getElementsByTagNameNS(odf.Namespaces.officens,"annotation").item(0),ca.removeAnnotation(b),F.focus()):"webodf-draggable"!==c.getAttribute("class")&&A(a)}function N(a){(a=a.data)&&(-1===a.indexOf("\n")?da.insertText(a):ea.paste(a))}function O(a){return function(){a();return!0}}function D(a){return function(c){return J.getCursor(d).getSelectionType()===ops.OdtCursor.RangeSelection?a(c):!0}}function V(c){F.unsubscribe("keydown",C.handleEvent);F.unsubscribe("keypress",Z.handleEvent);F.unsubscribe("keyup", +ba.handleEvent);F.unsubscribe("copy",q);F.unsubscribe("mousedown",w);F.unsubscribe("mousemove",ma.trigger);F.unsubscribe("mouseup",E);F.unsubscribe("contextmenu",L);F.unsubscribe("dragstart",I);F.unsubscribe("dragend",K);F.unsubscribe("click",pa.handleClick);F.unsubscribe("longpress",t);F.unsubscribe("drag",y);F.unsubscribe("dragstop",x);J.unsubscribe(ops.OdtDocument.signalOperationEnd,na.trigger);J.unsubscribe(ops.Document.signalCursorAdded,ka.registerCursor);J.unsubscribe(ops.Document.signalCursorRemoved, +ka.removeCursor);J.unsubscribe(ops.OdtDocument.signalOperationEnd,a);c()}var W=runtime.getWindow(),J=k.getOdtDocument(),R=new gui.SessionConstraints,P=new gui.SessionContext(k,d),aa=core.DomUtils,S=odf.OdfUtils,fa=new gui.MimeDataExporter,ha=new gui.Clipboard(fa),C=new gui.KeyboardHandler,Z=new gui.KeyboardHandler,ba=new gui.KeyboardHandler,U=!1,ga=new odf.ObjectNameGenerator(J.getOdfCanvas().odfContainer(),d),B=!1,Y=null,M,Q=null,F=new gui.EventManager(J),ja=f.annotationsEnabled,ca=new gui.AnnotationController(k, +R,d),X=new gui.DirectFormattingController(k,R,P,d,ga,f.directTextStylingEnabled,f.directParagraphStylingEnabled),da=new gui.TextController(k,R,P,d,X.createCursorStyleOp,X.createParagraphStyleOps),qa=new gui.ImageController(k,R,P,d,ga),la=new gui.ImageSelector(J.getOdfCanvas()),ia=J.createPositionIterator(J.getRootNode()),ma,na,ea=new gui.PasteController(k,R,P,d),ka=new gui.InputMethodEditor(d,F),oa=0,pa=new gui.HyperlinkClickHandler(J.getOdfCanvas().getElement,C,ba),ta=new gui.HyperlinkController(k, +R,P,d),T=new gui.SelectionController(k,d),va=new gui.MetadataController(k,d),G=gui.KeyboardHandler.Modifier,H=gui.KeyboardHandler.KeyCode,ra=-1!==W.navigator.appVersion.toLowerCase().indexOf("mac"),ua=-1!==["iPad","iPod","iPhone"].indexOf(W.navigator.platform),sa;runtime.assert(null!==W,"Expected to be run in an environment which has a global window, like a browser.");this.undo=m;this.redo=h;this.insertLocalCursor=function(){runtime.assert(void 0===k.getOdtDocument().getCursor(d),"Inserting local cursor a second time."); +var a=new ops.OpAddCursor;a.init({memberid:d});k.enqueue([a]);F.focus()};this.removeLocalCursor=function(){runtime.assert(void 0!==k.getOdtDocument().getCursor(d),"Removing local cursor without inserting before.");var a=new ops.OpRemoveCursor;a.init({memberid:d});k.enqueue([a])};this.startEditing=function(){ka.subscribe(gui.InputMethodEditor.signalCompositionStart,da.removeCurrentSelection);ka.subscribe(gui.InputMethodEditor.signalCompositionEnd,N);F.subscribe("beforecut",r);F.subscribe("cut",p); +F.subscribe("beforepaste",l);F.subscribe("paste",e);Q&&Q.initialize();F.setEditing(!0);pa.setModifier(ra?G.Meta:G.Ctrl);C.bind(H.Backspace,G.None,O(da.removeTextByBackspaceKey),!0);C.bind(H.Delete,G.None,da.removeTextByDeleteKey);C.bind(H.Tab,G.None,D(function(){da.insertText("\t");return!0}));ra?(C.bind(H.Clear,G.None,da.removeCurrentSelection),C.bind(H.B,G.Meta,D(X.toggleBold)),C.bind(H.I,G.Meta,D(X.toggleItalic)),C.bind(H.U,G.Meta,D(X.toggleUnderline)),C.bind(H.L,G.MetaShift,D(X.alignParagraphLeft)), +C.bind(H.E,G.MetaShift,D(X.alignParagraphCenter)),C.bind(H.R,G.MetaShift,D(X.alignParagraphRight)),C.bind(H.J,G.MetaShift,D(X.alignParagraphJustified)),ja&&C.bind(H.C,G.MetaShift,ca.addAnnotation),C.bind(H.Z,G.Meta,m),C.bind(H.Z,G.MetaShift,h)):(C.bind(H.B,G.Ctrl,D(X.toggleBold)),C.bind(H.I,G.Ctrl,D(X.toggleItalic)),C.bind(H.U,G.Ctrl,D(X.toggleUnderline)),C.bind(H.L,G.CtrlShift,D(X.alignParagraphLeft)),C.bind(H.E,G.CtrlShift,D(X.alignParagraphCenter)),C.bind(H.R,G.CtrlShift,D(X.alignParagraphRight)), +C.bind(H.J,G.CtrlShift,D(X.alignParagraphJustified)),ja&&C.bind(H.C,G.CtrlAlt,ca.addAnnotation),C.bind(H.Z,G.Ctrl,m),C.bind(H.Z,G.CtrlShift,h));Z.setDefault(D(function(a){var c;c=null===a.which||void 0===a.which?String.fromCharCode(a.keyCode):0!==a.which&&0!==a.charCode?String.fromCharCode(a.which):null;return!c||a.altKey||a.ctrlKey||a.metaKey?!1:(da.insertText(c),!0)}));Z.bind(H.Enter,G.None,D(da.enqueueParagraphSplittingOps))};this.endEditing=function(){ka.unsubscribe(gui.InputMethodEditor.signalCompositionStart, +da.removeCurrentSelection);ka.unsubscribe(gui.InputMethodEditor.signalCompositionEnd,N);F.unsubscribe("cut",p);F.unsubscribe("beforecut",r);F.unsubscribe("paste",e);F.unsubscribe("beforepaste",l);F.setEditing(!1);pa.setModifier(G.None);C.bind(H.Backspace,G.None,function(){return!0},!0);C.unbind(H.Delete,G.None);C.unbind(H.Tab,G.None);ra?(C.unbind(H.Clear,G.None),C.unbind(H.B,G.Meta),C.unbind(H.I,G.Meta),C.unbind(H.U,G.Meta),C.unbind(H.L,G.MetaShift),C.unbind(H.E,G.MetaShift),C.unbind(H.R,G.MetaShift), +C.unbind(H.J,G.MetaShift),ja&&C.unbind(H.C,G.MetaShift),C.unbind(H.Z,G.Meta),C.unbind(H.Z,G.MetaShift)):(C.unbind(H.B,G.Ctrl),C.unbind(H.I,G.Ctrl),C.unbind(H.U,G.Ctrl),C.unbind(H.L,G.CtrlShift),C.unbind(H.E,G.CtrlShift),C.unbind(H.R,G.CtrlShift),C.unbind(H.J,G.CtrlShift),ja&&C.unbind(H.C,G.CtrlAlt),C.unbind(H.Z,G.Ctrl),C.unbind(H.Z,G.CtrlShift));Z.setDefault(null);Z.unbind(H.Enter,G.None)};this.getInputMemberId=function(){return d};this.getSession=function(){return k};this.getSessionConstraints=function(){return R}; +this.setUndoManager=function(a){Q&&Q.unsubscribe(gui.UndoManager.signalUndoStackChanged,c);if(Q=a)Q.setDocument(J),Q.setPlaybackFunction(k.enqueue),Q.subscribe(gui.UndoManager.signalUndoStackChanged,c)};this.getUndoManager=function(){return Q};this.getMetadataController=function(){return va};this.getAnnotationController=function(){return ca};this.getDirectFormattingController=function(){return X};this.getHyperlinkClickHandler=function(){return pa};this.getHyperlinkController=function(){return ta}; +this.getImageController=function(){return qa};this.getSelectionController=function(){return T};this.getTextController=function(){return da};this.getEventManager=function(){return F};this.getKeyboardHandlers=function(){return{keydown:C,keypress:Z}};this.destroy=function(a){var c=[ma.destroy,na.destroy,X.destroy,ka.destroy,F.destroy,pa.destroy,ta.destroy,va.destroy,T.destroy,da.destroy,V];sa&&c.unshift(sa.destroy);runtime.clearTimeout(M);core.Async.destroyAll(c,a)};ma=core.Task.createRedrawTask(z); +na=core.Task.createRedrawTask(function(){var a=J.getCursor(d);if(a&&a.getSelectionType()===ops.OdtCursor.RegionSelection&&(a=S.getImageElements(a.getSelectedRange())[0])){la.select(a.parentNode);return}la.clearSelection()});C.bind(H.Left,G.None,D(T.moveCursorToLeft));C.bind(H.Right,G.None,D(T.moveCursorToRight));C.bind(H.Up,G.None,D(T.moveCursorUp));C.bind(H.Down,G.None,D(T.moveCursorDown));C.bind(H.Left,G.Shift,D(T.extendSelectionToLeft));C.bind(H.Right,G.Shift,D(T.extendSelectionToRight));C.bind(H.Up, +G.Shift,D(T.extendSelectionUp));C.bind(H.Down,G.Shift,D(T.extendSelectionDown));C.bind(H.Home,G.None,D(T.moveCursorToLineStart));C.bind(H.End,G.None,D(T.moveCursorToLineEnd));C.bind(H.Home,G.Ctrl,D(T.moveCursorToDocumentStart));C.bind(H.End,G.Ctrl,D(T.moveCursorToDocumentEnd));C.bind(H.Home,G.Shift,D(T.extendSelectionToLineStart));C.bind(H.End,G.Shift,D(T.extendSelectionToLineEnd));C.bind(H.Up,G.CtrlShift,D(T.extendSelectionToParagraphStart));C.bind(H.Down,G.CtrlShift,D(T.extendSelectionToParagraphEnd)); +C.bind(H.Home,G.CtrlShift,D(T.extendSelectionToDocumentStart));C.bind(H.End,G.CtrlShift,D(T.extendSelectionToDocumentEnd));ra?(C.bind(H.Left,G.Alt,D(T.moveCursorBeforeWord)),C.bind(H.Right,G.Alt,D(T.moveCursorPastWord)),C.bind(H.Left,G.Meta,D(T.moveCursorToLineStart)),C.bind(H.Right,G.Meta,D(T.moveCursorToLineEnd)),C.bind(H.Home,G.Meta,D(T.moveCursorToDocumentStart)),C.bind(H.End,G.Meta,D(T.moveCursorToDocumentEnd)),C.bind(H.Left,G.AltShift,D(T.extendSelectionBeforeWord)),C.bind(H.Right,G.AltShift, +D(T.extendSelectionPastWord)),C.bind(H.Left,G.MetaShift,D(T.extendSelectionToLineStart)),C.bind(H.Right,G.MetaShift,D(T.extendSelectionToLineEnd)),C.bind(H.Up,G.AltShift,D(T.extendSelectionToParagraphStart)),C.bind(H.Down,G.AltShift,D(T.extendSelectionToParagraphEnd)),C.bind(H.Up,G.MetaShift,D(T.extendSelectionToDocumentStart)),C.bind(H.Down,G.MetaShift,D(T.extendSelectionToDocumentEnd)),C.bind(H.A,G.Meta,D(T.extendSelectionToEntireDocument))):(C.bind(H.Left,G.Ctrl,D(T.moveCursorBeforeWord)),C.bind(H.Right, +G.Ctrl,D(T.moveCursorPastWord)),C.bind(H.Left,G.CtrlShift,D(T.extendSelectionBeforeWord)),C.bind(H.Right,G.CtrlShift,D(T.extendSelectionPastWord)),C.bind(H.A,G.Ctrl,D(T.extendSelectionToEntireDocument)));ua&&(sa=new gui.IOSSafariSupport(F));F.subscribe("keydown",C.handleEvent);F.subscribe("keypress",Z.handleEvent);F.subscribe("keyup",ba.handleEvent);F.subscribe("copy",q);F.subscribe("mousedown",w);F.subscribe("mousemove",ma.trigger);F.subscribe("mouseup",E);F.subscribe("contextmenu",L);F.subscribe("dragstart", +I);F.subscribe("dragend",K);F.subscribe("click",pa.handleClick);F.subscribe("longpress",t);F.subscribe("drag",y);F.subscribe("dragstop",x);J.subscribe(ops.OdtDocument.signalOperationEnd,na.trigger);J.subscribe(ops.Document.signalCursorAdded,ka.registerCursor);J.subscribe(ops.Document.signalCursorRemoved,ka.removeCursor);J.subscribe(ops.OdtDocument.signalOperationEnd,a)}})(); +gui.CaretManager=function(g,k){function d(b){return n.hasOwnProperty(b)?n[b]:null}function b(){return Object.keys(n).map(function(b){return n[b]})}function f(b){var d=n[b];d&&(delete n[b],b===g.getInputMemberId()?(r.unsubscribe(ops.OdtDocument.signalProcessingBatchEnd,d.ensureVisible),r.unsubscribe(ops.Document.signalCursorMoved,d.refreshCursorBlinking),q.unsubscribe("compositionupdate",d.handleUpdate),q.unsubscribe("compositionend",d.handleUpdate),q.unsubscribe("focus",d.setFocus),q.unsubscribe("blur", +d.removeFocus),p.removeEventListener("focus",d.show,!1),p.removeEventListener("blur",d.hide,!1)):r.unsubscribe(ops.OdtDocument.signalProcessingBatchEnd,d.handleUpdate),d.destroy(function(){}))}var n={},p=runtime.getWindow(),r=g.getSession().getOdtDocument(),q=g.getEventManager();this.registerCursor=function(b,d,a){var c=b.getMemberId();b=new gui.Caret(b,k,d,a);n[c]=b;c===g.getInputMemberId()?(runtime.log("Starting to track input on new cursor of "+c),r.subscribe(ops.OdtDocument.signalProcessingBatchEnd, +b.ensureVisible),r.subscribe(ops.Document.signalCursorMoved,b.refreshCursorBlinking),q.subscribe("compositionupdate",b.handleUpdate),q.subscribe("compositionend",b.handleUpdate),q.subscribe("focus",b.setFocus),q.subscribe("blur",b.removeFocus),p.addEventListener("focus",b.show,!1),p.addEventListener("blur",b.hide,!1),b.setOverlayElement(q.getEventTrap())):r.subscribe(ops.OdtDocument.signalProcessingBatchEnd,b.handleUpdate);return b};this.getCaret=d;this.getCarets=b;this.destroy=function(d){var l= +b().map(function(a){return a.destroy});g.getSelectionController().setCaretXPositionLocator(null);r.unsubscribe(ops.Document.signalCursorRemoved,f);n={};core.Async.destroyAll(l,d)};g.getSelectionController().setCaretXPositionLocator(function(){var b=d(g.getInputMemberId()),f;b&&(f=b.getBoundingClientRect());return f?f.right:void 0});r.subscribe(ops.Document.signalCursorRemoved,f)}; +gui.EditInfoHandle=function(g){var k=[],d,b=g.ownerDocument,f=b.documentElement.namespaceURI;this.setEdits=function(g){k=g;var p,r,q,e;core.DomUtils.removeAllChildNodes(d);for(g=0;gc?(r=d(1,0),q=d(.5,1E4-c),e=d(.2,2E4-c)):1E4<=c&&2E4>c?(r=d(.5,0),e=d(.2,2E4-c)):r=d(.2,0)};this.getEdits=function(){return g.getEdits()};this.clearEdits=function(){g.clearEdits(); +n.setEdits([]);p.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&p.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return g};this.show=function(){p.style.display="block"};this.hide=function(){b.hideHandle();p.style.display="none"};this.showHandle=function(){n.show()};this.hideHandle=function(){n.hide()};this.destroy=function(b){runtime.clearTimeout(r);runtime.clearTimeout(q);runtime.clearTimeout(e);f.removeChild(p);n.destroy(function(a){a? +b(a):g.destroy(b)})};(function(){var d=g.getOdtDocument().getDOMDocument();p=d.createElementNS(d.documentElement.namespaceURI,"div");p.setAttribute("class","editInfoMarker");p.onmouseover=function(){b.showHandle()};p.onmouseout=function(){b.hideHandle()};f=g.getNode();f.appendChild(p);n=new gui.EditInfoHandle(f);k||b.hide()})()}; +gui.HyperlinkTooltipView=function(g,k){var d=core.DomUtils,b=odf.OdfUtils,f=runtime.getWindow(),n,p,r;runtime.assert(null!==f,"Expected to be run in an environment which has a global window, like a browser.");this.showTooltip=function(q){var e=q.target||q.srcElement,l=g.getSizer(),a=g.getZoomLevel(),c;a:{for(;e;){if(b.isHyperlink(e))break a;if(b.isParagraph(e)||b.isInlineRoot(e))break;e=e.parentNode}e=null}if(e){d.containsNode(l,r)||l.appendChild(r);c=p;var m;switch(k()){case gui.KeyboardHandler.Modifier.Ctrl:m= +runtime.tr("Ctrl-click to follow link");break;case gui.KeyboardHandler.Modifier.Meta:m=runtime.tr("\u2318-click to follow link");break;default:m=""}c.textContent=m;n.textContent=b.getHyperlinkTarget(e);r.style.display="block";c=f.innerWidth-r.offsetWidth-15;e=q.clientX>c?c:q.clientX+15;c=f.innerHeight-r.offsetHeight-10;q=q.clientY>c?c:q.clientY+10;l=l.getBoundingClientRect();e=(e-l.left)/a;q=(q-l.top)/a;r.style.left=e+"px";r.style.top=q+"px"}};this.hideTooltip=function(){r.style.display="none"};this.destroy= +function(b){r.parentNode&&r.parentNode.removeChild(r);b()};(function(){var b=g.getElement().ownerDocument;n=b.createElement("span");p=b.createElement("span");n.className="webodf-hyperlinkTooltipLink";p.className="webodf-hyperlinkTooltipText";r=b.createElement("div");r.className="webodf-hyperlinkTooltip";r.appendChild(n);r.appendChild(p);g.getElement().appendChild(r)})()}; +gui.OdfFieldView=function(g){function k(){var b=odf.OdfSchema.getFields().map(function(b){return b.replace(":","|")}),d=b.join(",\n")+"\n{ background-color: #D0D0D0; }\n",b=b.map(function(b){return b+":empty::after"}).join(",\n")+"\n{ content:' '; white-space: pre; }\n";return d+"\n"+b}var d,b=g.getElement().ownerDocument;this.showFieldHighlight=function(){d.appendChild(b.createTextNode(k()))};this.hideFieldHighlight=function(){for(var b=d.sheet,g=b.cssRules;g.length;)b.deleteRule(g.length-1)};this.destroy= +function(b){d.parentNode&&d.parentNode.removeChild(d);b()};d=function(){var d=b.getElementsByTagName("head").item(0),g=b.createElement("style"),k="";g.type="text/css";g.media="screen, print, handheld, projection";odf.Namespaces.forEachPrefix(function(b,d){k+="@namespace "+b+" url("+d+");\n"});g.appendChild(b.createTextNode(k));d.appendChild(g);return g}()}; +gui.ShadowCursor=function(g){var k=g.getDOMDocument().createRange(),d=!0;this.removeFromDocument=function(){};this.getMemberId=function(){return gui.ShadowCursor.ShadowCursorMemberId};this.getSelectedRange=function(){return k};this.setSelectedRange=function(b,f){k=b;d=!1!==f};this.hasForwardSelection=function(){return d};this.getDocument=function(){return g};this.getSelectionType=function(){return ops.OdtCursor.RangeSelection};k.setStart(g.getRootNode(),0)};gui.ShadowCursor.ShadowCursorMemberId=""; +gui.SelectionView=function(g){};gui.SelectionView.prototype.rerender=function(){};gui.SelectionView.prototype.show=function(){};gui.SelectionView.prototype.hide=function(){};gui.SelectionView.prototype.destroy=function(g){}; +gui.SelectionViewManager=function(g){function k(){return Object.keys(d).map(function(b){return d[b]})}var d={};this.getSelectionView=function(b){return d.hasOwnProperty(b)?d[b]:null};this.getSelectionViews=k;this.removeSelectionView=function(b){d.hasOwnProperty(b)&&(d[b].destroy(function(){}),delete d[b])};this.hideSelectionView=function(b){d.hasOwnProperty(b)&&d[b].hide()};this.showSelectionView=function(b){d.hasOwnProperty(b)&&d[b].show()};this.rerenderSelectionViews=function(){Object.keys(d).forEach(function(b){d[b].rerender()})}; +this.registerCursor=function(b,f){var k=b.getMemberId(),p=new g(b);f?p.show():p.hide();return d[k]=p};this.destroy=function(b){function d(k,r){r?b(r):k .webodf-draggable"),a=gui.ShadowCursor.ShadowCursorMemberId,e(".webodf-selectionOverlay","{ fill: "+b+"; stroke: "+b+";}",""),e(".webodf-touchEnabled .webodf-selectionOverlay","{ display: block; }"," > .webodf-draggable"))}function l(a){var c,b;for(b in t)t.hasOwnProperty(b)&&(c=t[b],a?c.show():c.hide())}function a(a){n.getCarets().forEach(function(c){a?c.showHandle():c.hideHandle()})}function c(a){var c=a.getMemberId();a=a.getProperties();e(c,a.fullName,a.color)}function m(a){var c= +a.getMemberId(),d=b.getOdtDocument().getMember(c).getProperties();n.registerCursor(a,E,N);p.registerCursor(a,!0);if(a=n.getCaret(c))a.setAvatarImageUrl(d.imageUrl),a.setColor(d.color);runtime.log("+++ View here +++ eagerly created an Caret for '"+c+"'! +++")}function h(a){a=a.getMemberId();var c=p.getSelectionView(d),b=p.getSelectionView(gui.ShadowCursor.ShadowCursorMemberId),e=n.getCaret(d);a===d?(b.hide(),c&&c.show(),e&&e.show()):a===gui.ShadowCursor.ShadowCursorMemberId&&(b.show(),c&&c.hide(), +e&&e.hide())}function y(a){p.removeSelectionView(a)}function x(a){var c=a.paragraphElement,d=a.memberId;a=a.timeStamp;var e,f="",h=c.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo").item(0);h?(f=h.getAttributeNS("urn:webodf:names:editinfo","id"),e=t[f]):(f=Math.random().toString(),e=new ops.EditInfo(c,b.getOdtDocument()),e=new gui.EditInfoMarker(e,L),h=c.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo").item(0),h.setAttributeNS("urn:webodf:names:editinfo","id",f),t[f]=e); +e.addEdit(d,new Date(a));K.trigger()}function z(){var a;u.hasChildNodes()&&core.DomUtils.removeAllChildNodes(u);!0===f.getState(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN)&&(a=b.getOdtDocument().getMember(d))&&(a=a.getProperties().fullName,u.appendChild(document.createTextNode(".annotationWrapper:not([creator = '"+a+"']) .annotationRemoveButton { display: none; }")))}function w(a){var b=Object.keys(t).map(function(a){return t[a]});A.unsubscribe(ops.Document.signalMemberAdded,c);A.unsubscribe(ops.Document.signalMemberUpdated, +c);A.unsubscribe(ops.Document.signalCursorAdded,m);A.unsubscribe(ops.Document.signalCursorRemoved,y);A.unsubscribe(ops.OdtDocument.signalParagraphChanged,x);A.unsubscribe(ops.Document.signalCursorMoved,h);A.unsubscribe(ops.OdtDocument.signalParagraphChanged,p.rerenderSelectionViews);A.unsubscribe(ops.OdtDocument.signalTableAdded,p.rerenderSelectionViews);A.unsubscribe(ops.OdtDocument.signalParagraphStyleModified,p.rerenderSelectionViews);f.unsubscribe(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN, +z);A.unsubscribe(ops.Document.signalMemberAdded,z);A.unsubscribe(ops.Document.signalMemberUpdated,z);v.parentNode.removeChild(v);u.parentNode.removeChild(u);(function W(c,d){d?a(d):ca.length;c&&g(a);return c}function d(a,c){function b(e){a[e]===c&&d.push(e)}var d=[];a&&["style:parent-style-name","style:next-style-name"].forEach(b);return d}function b(a,c){function b(d){a[d]===c&&delete a[d]}a&&["style:parent-style-name","style:next-style-name"].forEach(b)}function f(a){var c={};Object.keys(a).forEach(function(b){c[b]="object"===typeof a[b]?f(a[b]):a[b]});return c}function n(a, +c,b,d){var e,f=!1,g=!1,k,l=[];d&&d.attributes&&(l=d.attributes.split(","));a&&(b||0=a.length?0:a.length-e.length)):void 0!==a.length&&(e=a.position+a.length,d<=e?a.length-=c.length:b=c.position+c.length)){d=b?a:c;e=b?c:a;if(a.position!==c.position||a.length!==c.length)n=f(d),r=f(e);c=q(e.setProperties,null,d.setProperties, +null,"style:text-properties");if(c.majorChanged||c.minorChanged)g=[],a=[],k=d.position+d.length,l=e.position+e.length,e.positionk?c.minorChanged&&(n=r,n.position=k,n.length=l-k,a.push(n),e.length=k-e.position):k>l&&c.majorChanged&&(n.position=l, +n.length=k-l,g.push(n),d.length=l-d.position),d.setProperties&&p(d.setProperties)&&g.push(d),e.setProperties&&p(e.setProperties)&&a.push(e),b?(k=g,g=a):k=a}return{opSpecsA:k,opSpecsB:g}},InsertText:function(a,c){c.position<=a.position?a.position+=c.text.length:c.position<=a.position+a.length&&(a.length+=c.text.length);return{opSpecsA:[a],opSpecsB:[c]}},MergeParagraph:function(a,c){var b=a.position,d=a.position+a.length;b>=c.sourceStartPosition&&--b;d>=c.sourceStartPosition&&--d;a.position=b;a.length= +d-b;return{opSpecsA:[a],opSpecsB:[c]}},MoveCursor:e,RemoveAnnotation:function(a,b){var d=a.position,e=a.position+a.length,f=b.position+b.length,g=[a],k=[b];b.position<=d&&e<=f?g=[]:(fb.position?a.position+=b.text.length:d?b.position+=a.text.length:a.position+= +b.text.length;return{opSpecsA:[a],opSpecsB:[b]}},MergeParagraph:function(a,b){a.position>=b.sourceStartPosition?--a.position:(a.positiona.position&&(b.position+=a.text.length);return{opSpecsA:[a],opSpecsB:[b]}},SplitParagraph:function(a,b){a.position=a.sourceStartPosition&&--f;d>=a.sourceStartPosition&&--d;0<=b.length?(b.position=f,b.length=d-f):(b.position=d,b.length=f-d);return{opSpecsA:[a],opSpecsB:[b]}},RemoveAnnotation:function(a,b){var d=b.position+b.length,e=[a],f=[b];b.position<=a.destinationStartPosition&&a.sourceStartPosition<=d?(e=[],--b.length):a.sourceStartPosition=a.sourceStartPosition?--b.position:(b.positiona.sourceStartPosition)--b.position;else if(b.position===a.destinationStartPosition||b.position===a.sourceStartPosition)b.position=a.destinationStartPosition,a.paragraphStyleName=b.styleName;return{opSpecsA:d,opSpecsB:e}},SplitParagraph:function(a,b){var d,e=[a],f=[b];b.position=a.destinationStartPosition&&b.position=a.sourceStartPosition&&(--b.position,--b.sourceParagraphPosition);return{opSpecsA:e,opSpecsB:f}},UpdateMember:e,UpdateMetadata:e, +UpdateParagraphStyle:e},MoveCursor:{MoveCursor:e,RemoveAnnotation:function(a,b){var d=k(a),e=a.position+a.length,f=b.position+b.length;b.position<=a.position&&e<=f?(a.position=b.position-1,a.length=0):(fb.position?a.position+= +1:a.position===b.sourceParagraphPosition&&(b.paragraphStyleName=a.styleName,g=f(a),g.position=b.position+1,d.push(g));return{opSpecsA:d,opSpecsB:e}},UpdateMember:e,UpdateMetadata:e,UpdateParagraphStyle:e},SplitParagraph:{SplitParagraph:function(a,b,d){var e,f;a.position + +(c) 2009-2014 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/master/LICENSE + @licend +*/ +!function(e){var globalScope=typeof window!=="undefined"?window:typeof global!=="undefined"?global:{},externs=globalScope.externs||(globalScope.externs={});externs.JSZip=e()}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'");}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f, +f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o>2;enc2=(chr1&3)<<4|chr2>>4;enc3=(chr2&15)<<2|chr3>> +6;enc4=chr3&63;if(isNaN(chr2))enc3=enc4=64;else if(isNaN(chr3))enc4=64;output=output+_keyStr.charAt(enc1)+_keyStr.charAt(enc2)+_keyStr.charAt(enc3)+_keyStr.charAt(enc4)}return output};exports.decode=function(input,utf8){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64)output=output+String.fromCharCode(chr2);if(enc4!=64)output=output+String.fromCharCode(chr3)}return output}},{}],2:[function(_dereq_,module,exports){function CompressedObject(){this.compressedSize=0;this.uncompressedSize=0;this.crc32=0;this.compressionMethod=null;this.compressedContent=null}CompressedObject.prototype={getContent:function(){return null},getCompressedContent:function(){return null}}; +module.exports=CompressedObject},{}],3:[function(_dereq_,module,exports){exports.STORE={magic:"\x00\x00",compress:function(content){return content},uncompress:function(content){return content},compressInputType:null,uncompressInputType:null};exports.DEFLATE=_dereq_("./flate")},{"./flate":8}],4:[function(_dereq_,module,exports){var utils=_dereq_("./utils");var table=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021, +3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527, +1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856, +1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626, +1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692, +2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614, +3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];module.exports=function crc32(input,crc){if(typeof input==="undefined"||!input.length)return 0;var isArray=utils.getTypeOf(input)!=="string";if(typeof crc=="undefined")crc=0;var x=0;var y=0;var b=0;crc=crc^-1;for(var i=0,iTop=input.length;i>>8^x}return crc^-1}},{"./utils":21}],5:[function(_dereq_,module,exports){var utils=_dereq_("./utils"); +function DataReader(data){this.data=null;this.length=0;this.index=0}DataReader.prototype={checkOffset:function(offset){this.checkIndex(this.index+offset)},checkIndex:function(newIndex){if(this.length=this.index;i--)result=(result<<8)+this.byteAt(i);this.index+=size;return result},readString:function(size){return utils.transformTo("string",this.readData(size))},readData:function(size){},lastIndexOfSignature:function(sig){},readDate:function(){var dostime=this.readInt(4);return new Date((dostime>>25&127)+1980,(dostime>>21&15)-1,dostime>>16&31,dostime>>11&31,dostime>>5&63,(dostime&31)<<1)}};module.exports=DataReader},{"./utils":21}],6:[function(_dereq_, +module,exports){exports.base64=false;exports.binary=false;exports.dir=false;exports.createFolders=false;exports.date=null;exports.compression=null;exports.comment=null},{}],7:[function(_dereq_,module,exports){var utils=_dereq_("./utils");exports.string2binary=function(str){return utils.string2binary(str)};exports.string2Uint8Array=function(str){return utils.transformTo("uint8array",str)};exports.uint8Array2String=function(array){return utils.transformTo("string",array)};exports.string2Blob=function(str){var buffer= +utils.transformTo("arraybuffer",str);return utils.arrayBuffer2Blob(buffer)};exports.arrayBuffer2Blob=function(buffer){return utils.arrayBuffer2Blob(buffer)};exports.transformTo=function(outputType,input){return utils.transformTo(outputType,input)};exports.getTypeOf=function(input){return utils.getTypeOf(input)};exports.checkSupport=function(type){return utils.checkSupport(type)};exports.MAX_VALUE_16BITS=utils.MAX_VALUE_16BITS;exports.MAX_VALUE_32BITS=utils.MAX_VALUE_32BITS;exports.pretty=function(str){return utils.pretty(str)}; +exports.findCompression=function(compressionMethod){return utils.findCompression(compressionMethod)};exports.isRegExp=function(object){return utils.isRegExp(object)}},{"./utils":21}],8:[function(_dereq_,module,exports){var USE_TYPEDARRAY=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Uint32Array!=="undefined";var pako=_dereq_("pako");exports.uncompressInputType=USE_TYPEDARRAY?"uint8array":"array";exports.compressInputType=USE_TYPEDARRAY?"uint8array":"array";exports.magic= +"\b\x00";exports.compress=function(input){return pako.deflateRaw(input)};exports.uncompress=function(input){return pako.inflateRaw(input)}},{"pako":24}],9:[function(_dereq_,module,exports){var base64=_dereq_("./base64");function JSZip(data,options){if(!(this instanceof JSZip))return new JSZip(data,options);this.files={};this.comment=null;this.root="";if(data)this.load(data,options);this.clone=function(){var newObj=new JSZip;for(var i in this)if(typeof this[i]!=="function")newObj[i]=this[i];return newObj}} +JSZip.prototype=_dereq_("./object");JSZip.prototype.load=_dereq_("./load");JSZip.support=_dereq_("./support");JSZip.defaults=_dereq_("./defaults");JSZip.utils=_dereq_("./deprecatedPublicUtils");JSZip.base64={encode:function(input){return base64.encode(input)},decode:function(input){return base64.decode(input)}};JSZip.compressions=_dereq_("./compressions");module.exports=JSZip},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(_dereq_, +module,exports){var base64=_dereq_("./base64");var ZipEntries=_dereq_("./zipEntries");module.exports=function(data,options){var files,zipEntries,i,input;options=options||{};if(options.base64)data=base64.decode(data);zipEntries=new ZipEntries(data,options);files=zipEntries.files;for(i=0;i>>8}return hex};var extend=function(){var result={},i,attr;for(i=0;i0?path.substring(0,lastSlash):""};var folderAdd=function(name,createFolders){if(name.slice(-1)!="/")name+="/";createFolders=typeof createFolders!=="undefined"?createFolders:false;if(!this.files[name])fileAdd.call(this,name,null,{dir:true,createFolders:createFolders});return this.files[name]};var generateCompressedObjectFrom=function(file,compression){var result=new CompressedObject,content;if(file._data instanceof +CompressedObject){result.uncompressedSize=file._data.uncompressedSize;result.crc32=file._data.crc32;if(result.uncompressedSize===0||file.dir){compression=compressions["STORE"];result.compressedContent="";result.crc32=0}else if(file._data.compressionMethod===compression.magic)result.compressedContent=file._data.getCompressedContent();else{content=file._data.getContent();result.compressedContent=compression.compress(utils.transformTo(compression.compressInputType,content))}}else{content=getBinaryData(file); +if(!content||content.length===0||file.dir){compression=compressions["STORE"];content=""}result.uncompressedSize=content.length;result.crc32=crc32(content);result.compressedContent=compression.compress(utils.transformTo(compression.compressInputType,content))}result.compressedSize=result.compressedContent.length;result.compressionMethod=compression.magic;return result};var generateZipParts=function(name,file,compressedObject,offset){var data=compressedObject.compressedContent,utfEncodedFileName=utils.transformTo("string", +utf8.utf8encode(file.name)),comment=file.comment||"",utfEncodedComment=utils.transformTo("string",utf8.utf8encode(comment)),useUTF8ForFileName=utfEncodedFileName.length!==file.name.length,useUTF8ForComment=utfEncodedComment.length!==comment.length,o=file.options,dosTime,dosDate,extraFields="",unicodePathExtraField="",unicodeCommentExtraField="",dir,date;if(file._initialMetadata.dir!==file.dir)dir=file.dir;else dir=o.dir;if(file._initialMetadata.date!==file.date)date=file.date;else date=o.date;dosTime= +date.getHours();dosTime=dosTime<<6;dosTime=dosTime|date.getMinutes();dosTime=dosTime<<5;dosTime=dosTime|date.getSeconds()/2;dosDate=date.getFullYear()-1980;dosDate=dosDate<<4;dosDate=dosDate|date.getMonth()+1;dosDate=dosDate<<5;dosDate=dosDate|date.getDate();if(useUTF8ForFileName){unicodePathExtraField=decToHex(1,1)+decToHex(crc32(utfEncodedFileName),4)+utfEncodedFileName;extraFields+="up"+decToHex(unicodePathExtraField.length,2)+unicodePathExtraField}if(useUTF8ForComment){unicodeCommentExtraField= +decToHex(1,1)+decToHex(this.crc32(utfEncodedComment),4)+utfEncodedComment;extraFields+="uc"+decToHex(unicodeCommentExtraField.length,2)+unicodeCommentExtraField}var header="";header+="\n\x00";header+=useUTF8ForFileName||useUTF8ForComment?"\x00\b":"\x00\x00";header+=compressedObject.compressionMethod;header+=decToHex(dosTime,2);header+=decToHex(dosDate,2);header+=decToHex(compressedObject.crc32,4);header+=decToHex(compressedObject.compressedSize,4);header+=decToHex(compressedObject.uncompressedSize, +4);header+=decToHex(utfEncodedFileName.length,2);header+=decToHex(extraFields.length,2);var fileRecord=signature.LOCAL_FILE_HEADER+header+utfEncodedFileName+extraFields;var dirRecord=signature.CENTRAL_FILE_HEADER+"\u0014\x00"+header+decToHex(utfEncodedComment.length,2)+"\x00\x00"+"\x00\x00"+(dir===true?"\u0010\x00\x00\x00":"\x00\x00\x00\x00")+decToHex(offset,4)+utfEncodedFileName+extraFields+utfEncodedComment;return{fileRecord:fileRecord,dirRecord:dirRecord,compressedObject:compressedObject}};var out= +{load:function(stream,options){throw new Error("Load method is not defined. Is the file jszip-load.js included ?");},filter:function(search){var result=[],filename,relativePath,file,fileClone;for(filename in this.files){if(!this.files.hasOwnProperty(filename))continue;file=this.files[filename];fileClone=new ZipObject(file.name,file._data,extend(file.options));relativePath=filename.slice(this.root.length,filename.length);if(filename.slice(0,this.root.length)===this.root&&search(relativePath,fileClone))result.push(fileClone)}return result}, +file:function(name,data,o){if(arguments.length===1)if(utils.isRegExp(name)){var regexp=name;return this.filter(function(relativePath,file){return!file.dir&®exp.test(relativePath)})}else return this.filter(function(relativePath,file){return!file.dir&&relativePath===name})[0]||null;else{name=this.root+name;fileAdd.call(this,name,data,o)}return this},folder:function(arg){if(!arg)return this;if(utils.isRegExp(arg))return this.filter(function(relativePath,file){return file.dir&&arg.test(relativePath)}); +var name=this.root+arg;var newFolder=folderAdd.call(this,name);var ret=this.clone();ret.root=newFolder.name;return ret},remove:function(name){name=this.root+name;var file=this.files[name];if(!file){if(name.slice(-1)!="/")name+="/";file=this.files[name]}if(file&&!file.dir)delete this.files[name];else{var kids=this.filter(function(relativePath,file){return file.name.slice(0,name.length)===name});for(var i=0;i=0;--i)if(this.data[i]===sig0&&this.data[i+1]===sig1&&this.data[i+2]===sig2&&this.data[i+3]===sig3)return i;return-1};Uint8ArrayReader.prototype.readData=function(size){this.checkOffset(size);if(size===0)return new Uint8Array(0);var result=this.data.subarray(this.index, +this.index+size);this.index+=size;return result};module.exports=Uint8ArrayReader},{"./dataReader":5}],19:[function(_dereq_,module,exports){var utils=_dereq_("./utils");var Uint8ArrayWriter=function(length){this.data=new Uint8Array(length);this.index=0};Uint8ArrayWriter.prototype={append:function(input){if(input.length!==0){input=utils.transformTo("uint8array",input);this.data.set(input,this.index);this.index+=input.length}},finalize:function(){return this.data}};module.exports=Uint8ArrayWriter},{"./utils":21}], +20:[function(_dereq_,module,exports){var utils=_dereq_("./utils");var support=_dereq_("./support");var nodeBuffer=_dereq_("./nodeBuffer");var _utf8len=new Array(256);for(var i=0;i<256;i++)_utf8len[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=function(str){var buf,c,c2,m_pos,i,str_len=str.length,buf_len=0;for(m_pos=0;m_pos>>6;buf[i++]=128|c&63}else if(c<65536){buf[i++]=224|c>>>12;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}else{buf[i++]= +240|c>>>18;buf[i++]=128|c>>>12&63;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}}return buf};var utf8border=function(buf,max){var pos;max=max||buf.length;if(max>buf.length)max=buf.length;pos=max-1;while(pos>=0&&(buf[pos]&192)===128)pos--;if(pos<0)return max;if(pos===0)return max;return pos+_utf8len[buf[pos]]>max?pos:max};var buf2string=function(buf){var str,i,out,c,c_len;var len=buf.length;var utf16buf=new Array(len*2);for(out=0,i=0;i4){utf16buf[out++]=65533;i+=c_len-1;continue}c&=c_len===2?31:c_len===3?15:7;while(c_len>1&&i1){utf16buf[out++]=65533;continue}if(c<65536)utf16buf[out++]=c;else{c-=65536;utf16buf[out++]=55296|c>>10&1023;utf16buf[out++]=56320|c&1023}}if(utf16buf.length!==out)if(utf16buf.subarray)utf16buf=utf16buf.subarray(0,out);else utf16buf.length=out;return utils.applyFromCharCode(utf16buf)};exports.utf8encode=function utf8encode(str){if(support.nodebuffer)return nodeBuffer(str, +"utf-8");return string2buf(str)};exports.utf8decode=function utf8decode(buf){if(support.nodebuffer)return utils.transformTo("nodebuffer",buf).toString("utf-8");buf=utils.transformTo(support.uint8array?"uint8array":"array",buf);var result=[],k=0,len=buf.length,chunk=65536;while(k1)try{if(type==="array"||type==="nodebuffer")result.push(String.fromCharCode.apply(null,array.slice(k,Math.min(k+chunk,len))));else result.push(String.fromCharCode.apply(null, +array.subarray(k,Math.min(k+chunk,len))));k+=chunk}catch(e){chunk=Math.floor(chunk/2)}return result.join("")}exports.applyFromCharCode=arrayLikeToString;function arrayLikeToArrayLike(arrayFrom,arrayTo){for(var i=0;i1)throw new Error("Multi-volumes zip are not supported");},readLocalFiles:function(){var i,file;for(i=0;i0)opt.windowBits=-opt.windowBits;else if(opt.gzip&&opt.windowBits>0&&opt.windowBits<16)opt.windowBits+=16;this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new zstream;this.strm.avail_out=0;var status=zlib_deflate.deflateInit2(this.strm,opt.level,opt.method,opt.windowBits,opt.memLevel,opt.strategy);if(status!==Z_OK)throw new Error(msg[status]); +if(opt.header)zlib_deflate.deflateSetHeader(this.strm,opt.header)};Deflate.prototype.push=function(data,mode){var strm=this.strm;var chunkSize=this.options.chunkSize;var status,_mode;if(this.ended)return false;_mode=mode===~~mode?mode:mode===true?Z_FINISH:Z_NO_FLUSH;if(typeof data==="string")strm.input=strings.string2buf(data);else strm.input=data;strm.next_in=0;strm.avail_in=strm.input.length;do{if(strm.avail_out===0){strm.output=new utils.Buf8(chunkSize);strm.next_out=0;strm.avail_out=chunkSize}status= +zlib_deflate.deflate(strm,_mode);if(status!==Z_STREAM_END&&status!==Z_OK){this.onEnd(status);this.ended=true;return false}if(strm.avail_out===0||strm.avail_in===0&&_mode===Z_FINISH)if(this.options.to==="string")this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output,strm.next_out)));else this.onData(utils.shrinkBuf(strm.output,strm.next_out))}while((strm.avail_in>0||strm.avail_out===0)&&status!==Z_STREAM_END);if(_mode===Z_FINISH){status=zlib_deflate.deflateEnd(this.strm);this.onEnd(status); +this.ended=true;return status===Z_OK}return true};Deflate.prototype.onData=function(chunk){this.chunks.push(chunk)};Deflate.prototype.onEnd=function(status){if(status===Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=utils.flattenChunks(this.chunks);this.chunks=[];this.err=status;this.msg=this.strm.msg};function deflate(input,options){var deflator=new Deflate(options);deflator.push(input,true);if(deflator.err)throw deflator.msg;return deflator.result}function deflateRaw(input, +options){options=options||{};options.raw=true;return deflate(input,options)}function gzip(input,options){options=options||{};options.gzip=true;return deflate(input,options)}exports.Deflate=Deflate;exports.deflate=deflate;exports.deflateRaw=deflateRaw;exports.gzip=gzip},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(_dereq_,module,exports){var zlib_inflate=_dereq_("./zlib/inflate.js");var utils=_dereq_("./utils/common");var strings= +_dereq_("./utils/strings");var c=_dereq_("./zlib/constants");var msg=_dereq_("./zlib/messages");var zstream=_dereq_("./zlib/zstream");var gzheader=_dereq_("./zlib/gzheader");var Inflate=function(options){this.options=utils.assign({chunkSize:16384,windowBits:0,to:""},options||{});var opt=this.options;if(opt.raw&&opt.windowBits>=0&&opt.windowBits<16){opt.windowBits=-opt.windowBits;if(opt.windowBits===0)opt.windowBits=-15}if(opt.windowBits>=0&&opt.windowBits<16&&!(options&&options.windowBits))opt.windowBits+= +32;if(opt.windowBits>15&&opt.windowBits<48)if((opt.windowBits&15)===0)opt.windowBits|=15;this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new zstream;this.strm.avail_out=0;var status=zlib_inflate.inflateInit2(this.strm,opt.windowBits);if(status!==c.Z_OK)throw new Error(msg[status]);this.header=new gzheader;zlib_inflate.inflateGetHeader(this.strm,this.header)};Inflate.prototype.push=function(data,mode){var strm=this.strm;var chunkSize=this.options.chunkSize;var status,_mode;var next_out_utf8, +tail,utf8str;if(this.ended)return false;_mode=mode===~~mode?mode:mode===true?c.Z_FINISH:c.Z_NO_FLUSH;if(typeof data==="string")strm.input=strings.binstring2buf(data);else strm.input=data;strm.next_in=0;strm.avail_in=strm.input.length;do{if(strm.avail_out===0){strm.output=new utils.Buf8(chunkSize);strm.next_out=0;strm.avail_out=chunkSize}status=zlib_inflate.inflate(strm,c.Z_NO_FLUSH);if(status!==c.Z_STREAM_END&&status!==c.Z_OK){this.onEnd(status);this.ended=true;return false}if(strm.next_out)if(strm.avail_out=== +0||status===c.Z_STREAM_END||strm.avail_in===0&&_mode===c.Z_FINISH)if(this.options.to==="string"){next_out_utf8=strings.utf8border(strm.output,strm.next_out);tail=strm.next_out-next_out_utf8;utf8str=strings.buf2string(strm.output,next_out_utf8);strm.next_out=tail;strm.avail_out=chunkSize-tail;if(tail)utils.arraySet(strm.output,strm.output,next_out_utf8,tail,0);this.onData(utf8str)}else this.onData(utils.shrinkBuf(strm.output,strm.next_out))}while(strm.avail_in>0&&status!==c.Z_STREAM_END);if(status=== +c.Z_STREAM_END)_mode=c.Z_FINISH;if(_mode===c.Z_FINISH){status=zlib_inflate.inflateEnd(this.strm);this.onEnd(status);this.ended=true;return status===c.Z_OK}return true};Inflate.prototype.onData=function(chunk){this.chunks.push(chunk)};Inflate.prototype.onEnd=function(status){if(status===c.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=utils.flattenChunks(this.chunks);this.chunks=[];this.err=status;this.msg=this.strm.msg};function inflate(input,options){var inflator= +new Inflate(options);inflator.push(input,true);if(inflator.err)throw inflator.msg;return inflator.result}function inflateRaw(input,options){options=options||{};options.raw=true;return inflate(input,options)}exports.Inflate=Inflate;exports.inflate=inflate;exports.inflateRaw=inflateRaw;exports.ungzip=inflate},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(_dereq_,module,exports){var TYPED_OK= +typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";exports.assign=function(obj){var sources=Array.prototype.slice.call(arguments,1);while(sources.length){var source=sources.shift();if(!source)continue;if(typeof source!=="object")throw new TypeError(source+"must be non-object");for(var p in source)if(source.hasOwnProperty(p))obj[p]=source[p]}return obj};exports.shrinkBuf=function(buf,size){if(buf.length===size)return buf;if(buf.subarray)return buf.subarray(0, +size);buf.length=size;return buf};var fnTyped={arraySet:function(dest,src,src_offs,len,dest_offs){if(src.subarray&&dest.subarray){dest.set(src.subarray(src_offs,src_offs+len),dest_offs);return}for(var i=0;i=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;_utf8len[254]=_utf8len[254]=1;exports.string2buf=function(str){var buf,c,c2,m_pos,i,str_len=str.length,buf_len=0;for(m_pos=0;m_pos>>6;buf[i++]=128|c&63}else if(c<65536){buf[i++]=224|c>>>12;buf[i++]= +128|c>>>6&63;buf[i++]=128|c&63}else{buf[i++]=240|c>>>18;buf[i++]=128|c>>>12&63;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}}return buf};function buf2binstring(buf,len){if(len<65537)if(buf.subarray&&STR_APPLY_UIA_OK||!buf.subarray&&STR_APPLY_OK)return String.fromCharCode.apply(null,utils.shrinkBuf(buf,len));var result="";for(var i=0;i4){utf16buf[out++]=65533;i+=c_len-1;continue}c&=c_len===2?31:c_len===3?15:7;while(c_len>1&&i1){utf16buf[out++]=65533;continue}if(c<65536)utf16buf[out++]= +c;else{c-=65536;utf16buf[out++]=55296|c>>10&1023;utf16buf[out++]=56320|c&1023}}return buf2binstring(utf16buf,out)};exports.utf8border=function(buf,max){var pos;max=max||buf.length;if(max>buf.length)max=buf.length;pos=max-1;while(pos>=0&&(buf[pos]&192)===128)pos--;if(pos<0)return max;if(pos===0)return max;return pos+_utf8len[buf[pos]]>max?pos:max}},{"./common":27}],29:[function(_dereq_,module,exports){function adler32(adler,buf,len,pos){var s1=adler&65535|0,s2=adler>>>16&65535|0,n=0;while(len!==0){n= +len>2E3?2E3:len;len-=n;do{s1=s1+buf[pos++]|0;s2=s2+s1|0}while(--n);s1%=65521;s2%=65521}return s1|s2<<16|0}module.exports=adler32},{}],30:[function(_dereq_,module,exports){module.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4, +Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],31:[function(_dereq_,module,exports){function makeTable(){var c,table=[];for(var n=0;n<256;n++){c=n;for(var k=0;k<8;k++)c=c&1?3988292384^c>>>1:c>>>1;table[n]=c}return table}var crcTable=makeTable();function crc32(crc,buf,len,pos){var t=crcTable,end=pos+len;crc=crc^-1;for(var i=pos;i>>8^t[(crc^buf[i])&255];return crc^-1}module.exports=crc32},{}],32:[function(_dereq_,module,exports){var utils=_dereq_("../utils/common"); +var trees=_dereq_("./trees");var adler32=_dereq_("./adler32");var crc32=_dereq_("./crc32");var msg=_dereq_("./messages");var Z_NO_FLUSH=0;var Z_PARTIAL_FLUSH=1;var Z_FULL_FLUSH=3;var Z_FINISH=4;var Z_BLOCK=5;var Z_OK=0;var Z_STREAM_END=1;var Z_STREAM_ERROR=-2;var Z_DATA_ERROR=-3;var Z_BUF_ERROR=-5;var Z_DEFAULT_COMPRESSION=-1;var Z_FILTERED=1;var Z_HUFFMAN_ONLY=2;var Z_RLE=3;var Z_FIXED=4;var Z_DEFAULT_STRATEGY=0;var Z_UNKNOWN=2;var Z_DEFLATED=8;var MAX_MEM_LEVEL=9;var MAX_WBITS=15;var DEF_MEM_LEVEL= +8;var LENGTH_CODES=29;var LITERALS=256;var L_CODES=LITERALS+1+LENGTH_CODES;var D_CODES=30;var BL_CODES=19;var HEAP_SIZE=2*L_CODES+1;var MAX_BITS=15;var MIN_MATCH=3;var MAX_MATCH=258;var MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1;var PRESET_DICT=32;var INIT_STATE=42;var EXTRA_STATE=69;var NAME_STATE=73;var COMMENT_STATE=91;var HCRC_STATE=103;var BUSY_STATE=113;var FINISH_STATE=666;var BS_NEED_MORE=1;var BS_BLOCK_DONE=2;var BS_FINISH_STARTED=3;var BS_FINISH_DONE=4;var OS_CODE=3;function err(strm,errorCode){strm.msg= +msg[errorCode];return errorCode}function rank(f){return(f<<1)-(f>4?9:0)}function zero(buf){var len=buf.length;while(--len>=0)buf[len]=0}function flush_pending(strm){var s=strm.state;var len=s.pending;if(len>strm.avail_out)len=strm.avail_out;if(len===0)return;utils.arraySet(strm.output,s.pending_buf,s.pending_out,len,strm.next_out);strm.next_out+=len;s.pending_out+=len;strm.total_out+=len;strm.avail_out-=len;s.pending-=len;if(s.pending===0)s.pending_out=0}function flush_block_only(s,last){trees._tr_flush_block(s, +s.block_start>=0?s.block_start:-1,s.strstart-s.block_start,last);s.block_start=s.strstart;flush_pending(s.strm)}function put_byte(s,b){s.pending_buf[s.pending++]=b}function putShortMSB(s,b){s.pending_buf[s.pending++]=b>>>8&255;s.pending_buf[s.pending++]=b&255}function read_buf(strm,buf,start,size){var len=strm.avail_in;if(len>size)len=size;if(len===0)return 0;strm.avail_in-=len;utils.arraySet(buf,strm.input,strm.next_in,len,start);if(strm.state.wrap===1)strm.adler=adler32(strm.adler,buf,len,start); +else if(strm.state.wrap===2)strm.adler=crc32(strm.adler,buf,len,start);strm.next_in+=len;strm.total_in+=len;return len}function longest_match(s,cur_match){var chain_length=s.max_chain_length;var scan=s.strstart;var match;var len;var best_len=s.prev_length;var nice_match=s.nice_match;var limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0;var _win=s.window;var wmask=s.w_mask;var prev=s.prev;var strend=s.strstart+MAX_MATCH;var scan_end1=_win[scan+best_len-1];var scan_end=_win[scan+ +best_len];if(s.prev_length>=s.good_match)chain_length>>=2;if(nice_match>s.lookahead)nice_match=s.lookahead;do{match=cur_match;if(_win[match+best_len]!==scan_end||_win[match+best_len-1]!==scan_end1||_win[match]!==_win[scan]||_win[++match]!==_win[scan+1])continue;scan+=2;match++;do;while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]=== +_win[++match]&&scanbest_len){s.match_start=cur_match;best_len=len;if(len>=nice_match)break;scan_end1=_win[scan+best_len-1];scan_end=_win[scan+best_len]}}while((cur_match=prev[cur_match&wmask])>limit&&--chain_length!==0);if(best_len<=s.lookahead)return best_len;return s.lookahead}function fill_window(s){var _w_size=s.w_size;var p,n,m,more,str;do{more=s.window_size-s.lookahead-s.strstart;if(s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window, +s.window,_w_size,_w_size,0);s.match_start-=_w_size;s.strstart-=_w_size;s.block_start-=_w_size;n=s.hash_size;p=n;do{m=s.head[--p];s.head[p]=m>=_w_size?m-_w_size:0}while(--n);n=_w_size;p=n;do{m=s.prev[--p];s.prev[p]=m>=_w_size?m-_w_size:0}while(--n);more+=_w_size}if(s.strm.avail_in===0)break;n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more);s.lookahead+=n;if(s.lookahead+s.insert>=MIN_MATCH){str=s.strstart-s.insert;s.ins_h=s.window[str];s.ins_h=(s.ins_h<s.pending_buf_size-5)max_block_size=s.pending_buf_size-5;for(;;){if(s.lookahead<=1){fill_window(s);if(s.lookahead===0&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(s.lookahead=== +0)break}s.strstart+=s.lookahead;s.lookahead=0;var max_start=s.block_start+max_block_size;if(s.strstart===0||s.strstart>=max_start){s.lookahead=s.strstart-max_start;s.strstart=max_start;flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}if(s.strstart-s.block_start>=s.w_size-MIN_LOOKAHEAD){flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}}s.insert=0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0)return BS_FINISH_STARTED;return BS_FINISH_DONE}if(s.strstart> +s.block_start){flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}return BS_NEED_MORE}function deflate_fast(s,flush){var hash_head;var bflush;for(;;){if(s.lookahead=MIN_MATCH){s.ins_h=(s.ins_h<=MIN_MATCH){bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;if(s.match_length<=s.max_lazy_match&&s.lookahead>=MIN_MATCH){s.match_length--;do{s.strstart++;s.ins_h=(s.ins_h<=MIN_MATCH){s.ins_h=(s.ins_h<4096))s.match_length=MIN_MATCH-1}if(s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH;bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length- +MIN_MATCH);s.lookahead-=s.prev_length-1;s.prev_length-=2;do if(++s.strstart<=max_insert){s.ins_h=(s.ins_h<=MIN_MATCH&&s.strstart>0){scan=s.strstart-1;prev=_win[scan];if(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]){strend=s.strstart+MAX_MATCH;do;while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&& +prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scans.lookahead)s.match_length=s.lookahead}}if(s.match_length>=MIN_MATCH){bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;s.strstart+=s.match_length;s.match_length=0}else{bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++}if(bflush){flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}}s.insert= +0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0)return BS_FINISH_STARTED;return BS_FINISH_DONE}if(s.last_lit){flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}return BS_BLOCK_DONE}function deflate_huff(s,flush){var bflush;for(;;){if(s.lookahead===0){fill_window(s);if(s.lookahead===0){if(flush===Z_NO_FLUSH)return BS_NEED_MORE;break}}s.match_length=0;bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;if(bflush){flush_block_only(s, +false);if(s.strm.avail_out===0)return BS_NEED_MORE}}s.insert=0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0)return BS_FINISH_STARTED;return BS_FINISH_DONE}if(s.last_lit){flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}return BS_BLOCK_DONE}var Config=function(good_length,max_lazy,nice_length,max_chain,func){this.good_length=good_length;this.max_lazy=max_lazy;this.nice_length=nice_length;this.max_chain=max_chain;this.func=func};var configuration_table; +configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)];function lm_init(s){s.window_size=2*s.w_size;zero(s.head);s.max_lazy_match=configuration_table[s.level].max_lazy; +s.good_match=configuration_table[s.level].good_length;s.nice_match=configuration_table[s.level].nice_length;s.max_chain_length=configuration_table[s.level].max_chain;s.strstart=0;s.block_start=0;s.lookahead=0;s.insert=0;s.match_length=s.prev_length=MIN_MATCH-1;s.match_available=0;s.ins_h=0}function DeflateState(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=Z_DEFLATED;this.last_flush= +-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new utils.Buf16(HEAP_SIZE*2);this.dyn_dtree= +new utils.Buf16((2*D_CODES+1)*2);this.bl_tree=new utils.Buf16((2*BL_CODES+1)*2);zero(this.dyn_ltree);zero(this.dyn_dtree);zero(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new utils.Buf16(MAX_BITS+1);this.heap=new utils.Buf16(2*L_CODES+1);zero(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new utils.Buf16(2*L_CODES+1);zero(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0; +this.bi_buf=0;this.bi_valid=0}function deflateResetKeep(strm){var s;if(!strm||!strm.state)return err(strm,Z_STREAM_ERROR);strm.total_in=strm.total_out=0;strm.data_type=Z_UNKNOWN;s=strm.state;s.pending=0;s.pending_out=0;if(s.wrap<0)s.wrap=-s.wrap;s.status=s.wrap?INIT_STATE:BUSY_STATE;strm.adler=s.wrap===2?0:1;s.last_flush=Z_NO_FLUSH;trees._tr_init(s);return Z_OK}function deflateReset(strm){var ret=deflateResetKeep(strm);if(ret===Z_OK)lm_init(strm.state);return ret}function deflateSetHeader(strm,head){if(!strm|| +!strm.state)return Z_STREAM_ERROR;if(strm.state.wrap!==2)return Z_STREAM_ERROR;strm.state.gzhead=head;return Z_OK}function deflateInit2(strm,level,method,windowBits,memLevel,strategy){if(!strm)return Z_STREAM_ERROR;var wrap=1;if(level===Z_DEFAULT_COMPRESSION)level=6;if(windowBits<0){wrap=0;windowBits=-windowBits}else if(windowBits>15){wrap=2;windowBits-=16}if(memLevel<1||memLevel>MAX_MEM_LEVEL||method!==Z_DEFLATED||windowBits<8||windowBits>15||level<0||level>9||strategy<0||strategy>Z_FIXED)return err(strm, +Z_STREAM_ERROR);if(windowBits===8)windowBits=9;var s=new DeflateState;strm.state=s;s.strm=strm;s.wrap=wrap;s.gzhead=null;s.w_bits=windowBits;s.w_size=1<>1;s.l_buf=(1+2)*s.lit_bufsize;s.level=level;s.strategy=strategy;s.method=method;return deflateReset(strm)}function deflateInit(strm,level){return deflateInit2(strm,level,Z_DEFLATED,MAX_WBITS,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY)}function deflate(strm,flush){var old_flush,s;var beg,val;if(!strm||!strm.state||flush>Z_BLOCK||flush<0)return strm?err(strm,Z_STREAM_ERROR):Z_STREAM_ERROR;s=strm.state;if(!strm.output||!strm.input&&strm.avail_in!==0||s.status===FINISH_STATE&&flush!==Z_FINISH)return err(strm, +strm.avail_out===0?Z_BUF_ERROR:Z_STREAM_ERROR);s.strm=strm;old_flush=s.last_flush;s.last_flush=flush;if(s.status===INIT_STATE)if(s.wrap===2){strm.adler=0;put_byte(s,31);put_byte(s,139);put_byte(s,8);if(!s.gzhead){put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,s.level===9?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0);put_byte(s,OS_CODE);s.status=BUSY_STATE}else{put_byte(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(!s.gzhead.extra?0:4)+(!s.gzhead.name?0:8)+(!s.gzhead.comment? +0:16));put_byte(s,s.gzhead.time&255);put_byte(s,s.gzhead.time>>8&255);put_byte(s,s.gzhead.time>>16&255);put_byte(s,s.gzhead.time>>24&255);put_byte(s,s.level===9?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0);put_byte(s,s.gzhead.os&255);if(s.gzhead.extra&&s.gzhead.extra.length){put_byte(s,s.gzhead.extra.length&255);put_byte(s,s.gzhead.extra.length>>8&255)}if(s.gzhead.hcrc)strm.adler=crc32(strm.adler,s.pending_buf,s.pending,0);s.gzindex=0;s.status=EXTRA_STATE}}else{var header=Z_DEFLATED+(s.w_bits-8<< +4)<<8;var level_flags=-1;if(s.strategy>=Z_HUFFMAN_ONLY||s.level<2)level_flags=0;else if(s.level<6)level_flags=1;else if(s.level===6)level_flags=2;else level_flags=3;header|=level_flags<<6;if(s.strstart!==0)header|=PRESET_DICT;header+=31-header%31;s.status=BUSY_STATE;putShortMSB(s,header);if(s.strstart!==0){putShortMSB(s,strm.adler>>>16);putShortMSB(s,strm.adler&65535)}strm.adler=1}if(s.status===EXTRA_STATE)if(s.gzhead.extra){beg=s.pending;while(s.gzindex<(s.gzhead.extra.length&65535)){if(s.pending=== +s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size)break}put_byte(s,s.gzhead.extra[s.gzindex]&255);s.gzindex++}if(s.gzhead.hcrc&&s.pending>beg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);if(s.gzindex===s.gzhead.extra.length){s.gzindex=0;s.status=NAME_STATE}}else s.status=NAME_STATE;if(s.status===NAME_STATE)if(s.gzhead.name){beg=s.pending;do{if(s.pending=== +s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size){val=1;break}}if(s.gzindexbeg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);if(val===0){s.gzindex=0;s.status=COMMENT_STATE}}else s.status=COMMENT_STATE;if(s.status===COMMENT_STATE)if(s.gzhead.comment){beg= +s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size){val=1;break}}if(s.gzindexbeg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);if(val===0)s.status=HCRC_STATE}else s.status=HCRC_STATE;if(s.status=== +HCRC_STATE)if(s.gzhead.hcrc){if(s.pending+2>s.pending_buf_size)flush_pending(strm);if(s.pending+2<=s.pending_buf_size){put_byte(s,strm.adler&255);put_byte(s,strm.adler>>8&255);strm.adler=0;s.status=BUSY_STATE}}else s.status=BUSY_STATE;if(s.pending!==0){flush_pending(strm);if(strm.avail_out===0){s.last_flush=-1;return Z_OK}}else if(strm.avail_in===0&&rank(flush)<=rank(old_flush)&&flush!==Z_FINISH)return err(strm,Z_BUF_ERROR);if(s.status===FINISH_STATE&&strm.avail_in!==0)return err(strm,Z_BUF_ERROR); +if(strm.avail_in!==0||s.lookahead!==0||flush!==Z_NO_FLUSH&&s.status!==FINISH_STATE){var bstate=s.strategy===Z_HUFFMAN_ONLY?deflate_huff(s,flush):s.strategy===Z_RLE?deflate_rle(s,flush):configuration_table[s.level].func(s,flush);if(bstate===BS_FINISH_STARTED||bstate===BS_FINISH_DONE)s.status=FINISH_STATE;if(bstate===BS_NEED_MORE||bstate===BS_FINISH_STARTED){if(strm.avail_out===0)s.last_flush=-1;return Z_OK}if(bstate===BS_BLOCK_DONE){if(flush===Z_PARTIAL_FLUSH)trees._tr_align(s);else if(flush!==Z_BLOCK){trees._tr_stored_block(s, +0,0,false);if(flush===Z_FULL_FLUSH){zero(s.head);if(s.lookahead===0){s.strstart=0;s.block_start=0;s.insert=0}}}flush_pending(strm);if(strm.avail_out===0){s.last_flush=-1;return Z_OK}}}if(flush!==Z_FINISH)return Z_OK;if(s.wrap<=0)return Z_STREAM_END;if(s.wrap===2){put_byte(s,strm.adler&255);put_byte(s,strm.adler>>8&255);put_byte(s,strm.adler>>16&255);put_byte(s,strm.adler>>24&255);put_byte(s,strm.total_in&255);put_byte(s,strm.total_in>>8&255);put_byte(s,strm.total_in>>16&255);put_byte(s,strm.total_in>> +24&255)}else{putShortMSB(s,strm.adler>>>16);putShortMSB(s,strm.adler&65535)}flush_pending(strm);if(s.wrap>0)s.wrap=-s.wrap;return s.pending!==0?Z_OK:Z_STREAM_END}function deflateEnd(strm){var status;if(!strm||!strm.state)return Z_STREAM_ERROR;status=strm.state.status;if(status!==INIT_STATE&&status!==EXTRA_STATE&&status!==NAME_STATE&&status!==COMMENT_STATE&&status!==HCRC_STATE&&status!==BUSY_STATE&&status!==FINISH_STATE)return err(strm,Z_STREAM_ERROR);strm.state=null;return status===BUSY_STATE?err(strm, +Z_DATA_ERROR):Z_OK}exports.deflateInit=deflateInit;exports.deflateInit2=deflateInit2;exports.deflateReset=deflateReset;exports.deflateResetKeep=deflateResetKeep;exports.deflateSetHeader=deflateSetHeader;exports.deflate=deflate;exports.deflateEnd=deflateEnd;exports.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(_dereq_,module,exports){function GZheader(){this.text=0;this.time=0;this.xflags=0;this.os=0; +this.extra=null;this.extra_len=0;this.name="";this.comment="";this.hcrc=0;this.done=false}module.exports=GZheader},{}],34:[function(_dereq_,module,exports){var BAD=30;var TYPE=12;module.exports=function inflate_fast(strm,start){var state;var _in;var last;var _out;var beg;var end;var dmax;var wsize;var whave;var wnext;var window;var hold;var bits;var lcode;var dcode;var lmask;var dmask;var here;var op;var len;var dist;var from;var from_source;var input,output;state=strm.state;_in=strm.next_in;input= +strm.input;last=_in+(strm.avail_in-5);_out=strm.next_out;output=strm.output;beg=_out-(start-strm.avail_out);end=_out+(strm.avail_out-257);dmax=state.dmax;wsize=state.wsize;whave=state.whave;wnext=state.wnext;window=state.window;hold=state.hold;bits=state.bits;lcode=state.lencode;dcode=state.distcode;lmask=(1<>>24;hold>>>=op; +bits-=op;op=here>>>16&255;if(op===0)output[_out++]=here&65535;else if(op&16){len=here&65535;op&=15;if(op){if(bits>>=op;bits-=op}if(bits<15){hold+=input[_in++]<>>24;hold>>>=op;bits-=op;op=here>>>16&255;if(op&16){dist=here&65535;op&=15;if(bitsdmax){strm.msg="invalid distance too far back";state.mode=BAD;break top}hold>>>=op;bits-=op;op=_out-beg;if(dist>op){op=dist-op;if(op>whave)if(state.sane){strm.msg="invalid distance too far back";state.mode=BAD;break top}from=0;from_source=window;if(wnext===0){from+=wsize-op;if(op2){output[_out++]=from_source[from++];output[_out++]=from_source[from++];output[_out++]=from_source[from++];len-=3}if(len){output[_out++]=from_source[from++];if(len>1)output[_out++]=from_source[from++]}}else{from=_out-dist;do{output[_out++]=output[from++];output[_out++]= +output[from++];output[_out++]=output[from++];len-=3}while(len>2);if(len){output[_out++]=output[from++];if(len>1)output[_out++]=output[from++]}}}else if((op&64)===0){here=dcode[(here&65535)+(hold&(1<>3;_in-=len;bits-=len<<3;hold&=(1<>>24&255)+(q>>>8&65280)+((q&65280)<<8)+((q&255)<<24)}function InflateState(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset= +0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new utils.Buf16(320);this.work=new utils.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function inflateResetKeep(strm){var state;if(!strm||!strm.state)return Z_STREAM_ERROR;state=strm.state;strm.total_in=strm.total_out=state.total=0;strm.msg="";if(state.wrap)strm.adler=state.wrap&1;state.mode=HEAD;state.last= +0;state.havedict=0;state.dmax=32768;state.head=null;state.hold=0;state.bits=0;state.lencode=state.lendyn=new utils.Buf32(ENOUGH_LENS);state.distcode=state.distdyn=new utils.Buf32(ENOUGH_DISTS);state.sane=1;state.back=-1;return Z_OK}function inflateReset(strm){var state;if(!strm||!strm.state)return Z_STREAM_ERROR;state=strm.state;state.wsize=0;state.whave=0;state.wnext=0;return inflateResetKeep(strm)}function inflateReset2(strm,windowBits){var wrap;var state;if(!strm||!strm.state)return Z_STREAM_ERROR; +state=strm.state;if(windowBits<0){wrap=0;windowBits=-windowBits}else{wrap=(windowBits>>4)+1;if(windowBits<48)windowBits&=15}if(windowBits&&(windowBits<8||windowBits>15))return Z_STREAM_ERROR;if(state.window!==null&&state.wbits!==windowBits)state.window=null;state.wrap=wrap;state.wbits=windowBits;return inflateReset(strm)}function inflateInit2(strm,windowBits){var ret;var state;if(!strm)return Z_STREAM_ERROR;state=new InflateState;strm.state=state;state.window=null;ret=inflateReset2(strm,windowBits); +if(ret!==Z_OK)strm.state=null;return ret}function inflateInit(strm){return inflateInit2(strm,DEF_WBITS)}var virgin=true;var lenfix,distfix;function fixedtables(state){if(virgin){var sym;lenfix=new utils.Buf32(512);distfix=new utils.Buf32(32);sym=0;while(sym<144)state.lens[sym++]=8;while(sym<256)state.lens[sym++]=9;while(sym<280)state.lens[sym++]=7;while(sym<288)state.lens[sym++]=8;inflate_table(LENS,state.lens,0,288,lenfix,0,state.work,{bits:9});sym=0;while(sym<32)state.lens[sym++]=5;inflate_table(DISTS, +state.lens,0,32,distfix,0,state.work,{bits:5});virgin=false}state.lencode=lenfix;state.lenbits=9;state.distcode=distfix;state.distbits=5}function updatewindow(strm,src,end,copy){var dist;var state=strm.state;if(state.window===null){state.wsize=1<=state.wsize){utils.arraySet(state.window,src,end-state.wsize,state.wsize,0);state.wnext=0;state.whave=state.wsize}else{dist=state.wsize-state.wnext;if(dist>copy)dist= +copy;utils.arraySet(state.window,src,end-copy,dist,state.wnext);copy-=dist;if(copy){utils.arraySet(state.window,src,end-copy,copy,0);state.wnext=copy;state.whave=state.wsize}else{state.wnext+=dist;if(state.wnext===state.wsize)state.wnext=0;if(state.whave>>8&255;state.check=crc32(state.check,hbuf,2,0);hold=0;bits=0;state.mode=FLAGS;break}state.flags=0;if(state.head)state.head.done=false;if(!(state.wrap&1)||(((hold&255)<<8)+(hold>>8))%31){strm.msg="incorrect header check";state.mode=BAD;break}if((hold&15)!==Z_DEFLATED){strm.msg="unknown compression method";state.mode= +BAD;break}hold>>>=4;bits-=4;len=(hold&15)+8;if(state.wbits===0)state.wbits=len;else if(len>state.wbits){strm.msg="invalid window size";state.mode=BAD;break}state.dmax=1<>8&1;if(state.flags&512){hbuf[0]=hold&255;hbuf[1]=hold>>>8&255;state.check=crc32(state.check,hbuf,2,0)}hold=0;bits=0;state.mode=TIME;case TIME:while(bits<32){if(have===0)break inf_leave;have--;hold+=input[next++]<>>8&255;hbuf[2]=hold>>>16&255;hbuf[3]=hold>>>24&255;state.check=crc32(state.check,hbuf,4,0)}hold=0;bits=0;state.mode=OS;case OS:while(bits< +16){if(have===0)break inf_leave;have--;hold+=input[next++]<>8}if(state.flags&512){hbuf[0]=hold&255;hbuf[1]=hold>>>8&255;state.check=crc32(state.check,hbuf,2,0)}hold=0;bits=0;state.mode=EXLEN;case EXLEN:if(state.flags&1024){while(bits<16){if(have===0)break inf_leave;have--;hold+=input[next++]<>>8&255;state.check= +crc32(state.check,hbuf,2,0)}hold=0;bits=0}else if(state.head)state.head.extra=null;state.mode=EXTRA;case EXTRA:if(state.flags&1024){copy=state.length;if(copy>have)copy=have;if(copy){if(state.head){len=state.head.extra_len-state.length;if(!state.head.extra)state.head.extra=new Array(state.head.extra_len);utils.arraySet(state.head.extra,input,next,copy,len)}if(state.flags&512)state.check=crc32(state.check,input,copy,next);have-=copy;next+=copy;state.length-=copy}if(state.length)break inf_leave}state.length= +0;state.mode=NAME;case NAME:if(state.flags&2048){if(have===0)break inf_leave;copy=0;do{len=input[next+copy++];if(state.head&&len&&state.length<65536)state.head.name+=String.fromCharCode(len)}while(len&©>9&1;state.head.done=true}strm.adler=state.check=0;state.mode=TYPE;break;case DICTID:while(bits<32){if(have===0)break inf_leave;have--;hold+=input[next++]<>>=bits&7;bits-=bits&7;state.mode=CHECK;break}while(bits<3){if(have===0)break inf_leave;have--;hold+=input[next++]<>>=1;bits-=1;switch(hold&3){case 0:state.mode=STORED;break;case 1:fixedtables(state);state.mode=LEN_;if(flush===Z_TREES){hold>>>=2;bits-=2;break inf_leave}break;case 2:state.mode=TABLE;break;case 3:strm.msg="invalid block type";state.mode=BAD}hold>>>=2;bits-=2;break;case STORED:hold>>>=bits&7;bits-=bits&7;while(bits< +32){if(have===0)break inf_leave;have--;hold+=input[next++]<>>16^65535)){strm.msg="invalid stored block lengths";state.mode=BAD;break}state.length=hold&65535;hold=0;bits=0;state.mode=COPY_;if(flush===Z_TREES)break inf_leave;case COPY_:state.mode=COPY;case COPY:copy=state.length;if(copy){if(copy>have)copy=have;if(copy>left)copy=left;if(copy===0)break inf_leave;utils.arraySet(output,input,next,copy,put);have-=copy;next+=copy;left-=copy;put+=copy;state.length-=copy; +break}state.mode=TYPE;break;case TABLE:while(bits<14){if(have===0)break inf_leave;have--;hold+=input[next++]<>>=5;bits-=5;state.ndist=(hold&31)+1;hold>>>=5;bits-=5;state.ncode=(hold&15)+4;hold>>>=4;bits-=4;if(state.nlen>286||state.ndist>30){strm.msg="too many length or distance symbols";state.mode=BAD;break}state.have=0;state.mode=LENLENS;case LENLENS:while(state.have>>=3;bits-=3}while(state.have<19)state.lens[order[state.have++]]=0;state.lencode=state.lendyn;state.lenbits=7;opts={bits:state.lenbits};ret=inflate_table(CODES,state.lens,0,19,state.lencode,0,state.work,opts);state.lenbits=opts.bits;if(ret){strm.msg="invalid code lengths set";state.mode=BAD;break}state.have=0;state.mode=CODELENS;case CODELENS:while(state.have>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits)break;if(have===0)break inf_leave;have--;hold+=input[next++]<>>=here_bits;bits-=here_bits;state.lens[state.have++]=here_val}else{if(here_val===16){n=here_bits+2;while(bits>>=here_bits;bits-=here_bits;if(state.have===0){strm.msg="invalid bit length repeat";state.mode=BAD;break}len=state.lens[state.have-1];copy=3+(hold& +3);hold>>>=2;bits-=2}else if(here_val===17){n=here_bits+3;while(bits>>=here_bits;bits-=here_bits;len=0;copy=3+(hold&7);hold>>>=3;bits-=3}else{n=here_bits+7;while(bits>>=here_bits;bits-=here_bits;len=0;copy=11+(hold&127);hold>>>=7;bits-=7}if(state.have+copy>state.nlen+state.ndist){strm.msg="invalid bit length repeat";state.mode=BAD;break}while(copy--)state.lens[state.have++]= +len}}if(state.mode===BAD)break;if(state.lens[256]===0){strm.msg="invalid code -- missing end-of-block";state.mode=BAD;break}state.lenbits=9;opts={bits:state.lenbits};ret=inflate_table(LENS,state.lens,0,state.nlen,state.lencode,0,state.work,opts);state.lenbits=opts.bits;if(ret){strm.msg="invalid literal/lengths set";state.mode=BAD;break}state.distbits=6;state.distcode=state.distdyn;opts={bits:state.distbits};ret=inflate_table(DISTS,state.lens,state.nlen,state.ndist,state.distcode,0,state.work,opts); +state.distbits=opts.bits;if(ret){strm.msg="invalid distances set";state.mode=BAD;break}state.mode=LEN_;if(flush===Z_TREES)break inf_leave;case LEN_:state.mode=LEN;case LEN:if(have>=6&&left>=258){strm.next_out=put;strm.avail_out=left;strm.next_in=next;strm.avail_in=have;state.hold=hold;state.bits=bits;inflate_fast(strm,_out);put=strm.next_out;output=strm.output;left=strm.avail_out;next=strm.next_in;input=strm.input;have=strm.avail_in;hold=state.hold;bits=state.bits;if(state.mode===TYPE)state.back= +-1;break}state.back=0;for(;;){here=state.lencode[hold&(1<>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits)break;if(have===0)break inf_leave;have--;hold+=input[next++]<>last_bits)];here_bits=here>>>24;here_op=here>>>16&255;here_val=here&65535;if(last_bits+here_bits<=bits)break;if(have=== +0)break inf_leave;have--;hold+=input[next++]<>>=last_bits;bits-=last_bits;state.back+=last_bits}hold>>>=here_bits;bits-=here_bits;state.back+=here_bits;state.length=here_val;if(here_op===0){state.mode=LIT;break}if(here_op&32){state.back=-1;state.mode=TYPE;break}if(here_op&64){strm.msg="invalid literal/length code";state.mode=BAD;break}state.extra=here_op&15;state.mode=LENEXT;case LENEXT:if(state.extra){n=state.extra;while(bits>>=state.extra;bits-=state.extra;state.back+=state.extra}state.was=state.length;state.mode=DIST;case DIST:for(;;){here=state.distcode[hold&(1<>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits)break;if(have===0)break inf_leave;have--;hold+=input[next++]<>last_bits)];here_bits=here>>>24;here_op=here>>>16&255;here_val=here&65535;if(last_bits+here_bits<=bits)break;if(have===0)break inf_leave;have--;hold+=input[next++]<>>=last_bits;bits-=last_bits;state.back+=last_bits}hold>>>=here_bits;bits-=here_bits;state.back+=here_bits;if(here_op&64){strm.msg="invalid distance code";state.mode=BAD;break}state.offset=here_val;state.extra=here_op&15;state.mode=DISTEXT;case DISTEXT:if(state.extra){n=state.extra;while(bits>>=state.extra;bits-=state.extra;state.back+=state.extra}if(state.offset>state.dmax){strm.msg="invalid distance too far back";state.mode=BAD;break}state.mode=MATCH;case MATCH:if(left===0)break inf_leave;copy=_out-left;if(state.offset>copy){copy=state.offset-copy;if(copy>state.whave)if(state.sane){strm.msg="invalid distance too far back";state.mode=BAD;break}if(copy>state.wnext){copy-=state.wnext; +from=state.wsize-copy}else from=state.wnext-copy;if(copy>state.length)copy=state.length;from_source=state.window}else{from_source=output;from=put-state.offset;copy=state.length}if(copy>left)copy=left;left-=copy;state.length-=copy;do output[put++]=from_source[from++];while(--copy);if(state.length===0)state.mode=LEN;break;case LIT:if(left===0)break inf_leave;output[put++]=state.length;left--;state.mode=LEN;break;case CHECK:if(state.wrap){while(bits<32){if(have===0)break inf_leave;have--;hold|=input[next++]<< +bits;bits+=8}_out-=left;strm.total_out+=_out;state.total+=_out;if(_out)strm.adler=state.check=state.flags?crc32(state.check,output,_out,put-_out):adler32(state.check,output,_out,put-_out);_out=left;if((state.flags?hold:ZSWAP32(hold))!==state.check){strm.msg="incorrect data check";state.mode=BAD;break}hold=0;bits=0}state.mode=LENGTH;case LENGTH:if(state.wrap&&state.flags){while(bits<32){if(have===0)break inf_leave;have--;hold+=input[next++]<=1;max--)if(count[max]!==0)break;if(root>max)root=max;if(max===0){table[table_index++]=1<<24|64<<16|0;table[table_index++]= +1<<24|64<<16|0;opts.bits=1;return 0}for(min=1;min0&&(type===CODES||max!==1))return-1;offs[1]=0;for(len=1;lenENOUGH_LENS||type===DISTS&&used>ENOUGH_DISTS)return 1;var i=0;for(;;){i++;here_bits=len-drop;if(work[sym]end){here_op=extra[extra_index+work[sym]];here_val=base[base_index+work[sym]]}else{here_op=32+64;here_val=0}incr=1<>drop)+fill]= +here_bits<<24|here_op<<16|here_val|0}while(fill!==0);incr=1<>=1;if(incr!==0){huff&=incr-1;huff+=incr}else huff=0;sym++;if(--count[len]===0){if(len===max)break;len=lens[lens_index+work[sym]]}if(len>root&&(huff&mask)!==low){if(drop===0)drop=root;next+=min;curr=len-drop;left=1<ENOUGH_LENS||type===DISTS&&used>ENOUGH_DISTS)return 1;low=huff&mask;table[low]=root<< +24|curr<<16|next-table_index|0}}if(huff!==0)table[next+huff]=len-drop<<24|64<<16|0;opts.bits=root;return 0}},{"../utils/common":27}],37:[function(_dereq_,module,exports){module.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],38:[function(_dereq_,module,exports){var utils=_dereq_("../utils/common");var Z_FIXED=4;var Z_BINARY=0;var Z_TEXT=1;var Z_UNKNOWN=2;function zero(buf){var len= +buf.length;while(--len>=0)buf[len]=0}var STORED_BLOCK=0;var STATIC_TREES=1;var DYN_TREES=2;var MIN_MATCH=3;var MAX_MATCH=258;var LENGTH_CODES=29;var LITERALS=256;var L_CODES=LITERALS+1+LENGTH_CODES;var D_CODES=30;var BL_CODES=19;var HEAP_SIZE=2*L_CODES+1;var MAX_BITS=15;var Buf_size=16;var MAX_BL_BITS=7;var END_BLOCK=256;var REP_3_6=16;var REPZ_3_10=17;var REPZ_11_138=18;var extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7, +7,8,8,9,9,10,10,11,11,12,12,13,13];var extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var DIST_CODE_LEN=512;var static_ltree=new Array((L_CODES+2)*2);zero(static_ltree);var static_dtree=new Array(D_CODES*2);zero(static_dtree);var _dist_code=new Array(DIST_CODE_LEN);zero(_dist_code);var _length_code=new Array(MAX_MATCH-MIN_MATCH+1);zero(_length_code);var base_length=new Array(LENGTH_CODES);zero(base_length);var base_dist=new Array(D_CODES); +zero(base_dist);var StaticTreeDesc=function(static_tree,extra_bits,extra_base,elems,max_length){this.static_tree=static_tree;this.extra_bits=extra_bits;this.extra_base=extra_base;this.elems=elems;this.max_length=max_length;this.has_stree=static_tree&&static_tree.length};var static_l_desc;var static_d_desc;var static_bl_desc;var TreeDesc=function(dyn_tree,stat_desc){this.dyn_tree=dyn_tree;this.max_code=0;this.stat_desc=stat_desc};function d_code(dist){return dist<256?_dist_code[dist]:_dist_code[256+ +(dist>>>7)]}function put_short(s,w){s.pending_buf[s.pending++]=w&255;s.pending_buf[s.pending++]=w>>>8&255}function send_bits(s,value,length){if(s.bi_valid>Buf_size-length){s.bi_buf|=value<>Buf_size-s.bi_valid;s.bi_valid+=length-Buf_size}else{s.bi_buf|=value<>>=1;res<<=1}while(--len>0); +return res>>>1}function bi_flush(s){if(s.bi_valid===16){put_short(s,s.bi_buf);s.bi_buf=0;s.bi_valid=0}else if(s.bi_valid>=8){s.pending_buf[s.pending++]=s.bi_buf&255;s.bi_buf>>=8;s.bi_valid-=8}}function gen_bitlen(s,desc){var tree=desc.dyn_tree;var max_code=desc.max_code;var stree=desc.stat_desc.static_tree;var has_stree=desc.stat_desc.has_stree;var extra=desc.stat_desc.extra_bits;var base=desc.stat_desc.extra_base;var max_length=desc.stat_desc.max_length;var h;var n,m;var bits;var xbits;var f;var overflow= +0;for(bits=0;bits<=MAX_BITS;bits++)s.bl_count[bits]=0;tree[s.heap[s.heap_max]*2+1]=0;for(h=s.heap_max+1;hmax_length){bits=max_length;overflow++}tree[n*2+1]=bits;if(n>max_code)continue;s.bl_count[bits]++;xbits=0;if(n>=base)xbits=extra[n-base];f=tree[n*2];s.opt_len+=f*(bits+xbits);if(has_stree)s.static_len+=f*(stree[n*2+1]+xbits)}if(overflow===0)return;do{bits=max_length-1;while(s.bl_count[bits]===0)bits--;s.bl_count[bits]--;s.bl_count[bits+ +1]+=2;s.bl_count[max_length]--;overflow-=2}while(overflow>0);for(bits=max_length;bits!==0;bits--){n=s.bl_count[bits];while(n!==0){m=s.heap[--h];if(m>max_code)continue;if(tree[m*2+1]!==bits){s.opt_len+=(bits-tree[m*2+1])*tree[m*2];tree[m*2+1]=bits}n--}}}function gen_codes(tree,max_code,bl_count){var next_code=new Array(MAX_BITS+1);var code=0;var bits;var n;for(bits=1;bits<=MAX_BITS;bits++)next_code[bits]=code=code+bl_count[bits-1]<<1;for(n=0;n<=max_code;n++){var len=tree[n*2+1];if(len===0)continue; +tree[n*2]=bi_reverse(next_code[len]++,len)}}function tr_static_init(){var n;var bits;var length;var code;var dist;var bl_count=new Array(MAX_BITS+1);length=0;for(code=0;code>=7;for(;code8)put_short(s,s.bi_buf);else if(s.bi_valid>0)s.pending_buf[s.pending++]= +s.bi_buf;s.bi_buf=0;s.bi_valid=0}function copy_block(s,buf,len,header){bi_windup(s);if(header){put_short(s,len);put_short(s,~len)}utils.arraySet(s.pending_buf,s.window,buf,len,s.pending);s.pending+=len}function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]>1;n>=1;n--)pqdownheap(s,tree,n);node=elems;do{n=s.heap[1];s.heap[1]=s.heap[s.heap_len--];pqdownheap(s,tree,1);m=s.heap[1];s.heap[--s.heap_max]=n;s.heap[--s.heap_max]=m;tree[node*2]=tree[n*2]+tree[m*2];s.depth[node]=(s.depth[n]>=s.depth[m]?s.depth[n]:s.depth[m])+1;tree[n*2+1]=tree[m*2+1]=node;s.heap[1]=node++;pqdownheap(s,tree,1)}while(s.heap_len>=2);s.heap[--s.heap_max]=s.heap[1];gen_bitlen(s, +desc);gen_codes(tree,max_code,s.bl_count)}function scan_tree(s,tree,max_code){var n;var prevlen=-1;var curlen;var nextlen=tree[0*2+1];var count=0;var max_count=7;var min_count=4;if(nextlen===0){max_count=138;min_count=3}tree[(max_code+1)*2+1]=65535;for(n=0;n<=max_code;n++){curlen=nextlen;nextlen=tree[(n+1)*2+1];if(++count=3;max_blindex--)if(s.bl_tree[bl_order[max_blindex]*2+1]!==0)break;s.opt_len+=3*(max_blindex+1)+5+5+4;return max_blindex}function send_all_trees(s,lcodes,dcodes,blcodes){var rank;send_bits(s,lcodes-257,5);send_bits(s,dcodes-1,5);send_bits(s,blcodes-4,4);for(rank=0;rank>>=1)if(black_mask&1&&s.dyn_ltree[n*2]!==0)return Z_BINARY;if(s.dyn_ltree[9*2]!==0||s.dyn_ltree[10*2]!==0||s.dyn_ltree[13*2]!==0)return Z_TEXT;for(n=32;n0){if(s.strm.data_type===Z_UNKNOWN)s.strm.data_type= +detect_data_type(s);build_tree(s,s.l_desc);build_tree(s,s.d_desc);max_blindex=build_bl_tree(s);opt_lenb=s.opt_len+3+7>>>3;static_lenb=s.static_len+3+7>>>3;if(static_lenb<=opt_lenb)opt_lenb=static_lenb}else opt_lenb=static_lenb=stored_len+5;if(stored_len+4<=opt_lenb&&buf!==-1)_tr_stored_block(s,buf,stored_len,last);else if(s.strategy===Z_FIXED||static_lenb===opt_lenb){send_bits(s,(STATIC_TREES<<1)+(last?1:0),3);compress_block(s,static_ltree,static_dtree)}else{send_bits(s,(DYN_TREES<<1)+(last?1:0), +3);send_all_trees(s,s.l_desc.max_code+1,s.d_desc.max_code+1,max_blindex+1);compress_block(s,s.dyn_ltree,s.dyn_dtree)}init_block(s);if(last)bi_windup(s)}function _tr_tally(s,dist,lc){s.pending_buf[s.d_buf+s.last_lit*2]=dist>>>8&255;s.pending_buf[s.d_buf+s.last_lit*2+1]=dist&255;s.pending_buf[s.l_buf+s.last_lit]=lc&255;s.last_lit++;if(dist===0)s.dyn_ltree[lc*2]++;else{s.matches++;dist--;s.dyn_ltree[(_length_code[lc]+LITERALS+1)*2]++;s.dyn_dtree[d_code(dist)*2]++}return s.last_lit===s.lit_bufsize-1} +exports._tr_init=_tr_init;exports._tr_stored_block=_tr_stored_block;exports._tr_flush_block=_tr_flush_block;exports._tr_tally=_tr_tally;exports._tr_align=_tr_align},{"../utils/common":27}],39:[function(_dereq_,module,exports){function ZStream(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}module.exports=ZStream},{}]},{},[9])(9)}); + +/** + * Copyright (C) 2013 KO GmbH + * + * @licstart + * This file is part of WebODF. + * + * WebODF is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License (GNU AGPL) + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * WebODF is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with WebODF. If not, see . + * @licend + * + * @source: http://www.webodf.org/ + * @source: https://github.com/kogmbh/WebODF/ + */ + +/*global runtime, define, document, core, odf, gui, ops*/ + +/*define("webodf/editor/EditorSession", [ + "dojo/text!resources/fonts/fonts.css" +],*/ +this.OS.APP.OpenPage.EditorSession = (function (fontsCSS) { // fontsCSS is retrieved as a string, using dojo's text retrieval AMD plugin + "use strict"; + + runtime.loadClass("core.Async"); + runtime.loadClass("core.DomUtils"); + runtime.loadClass("odf.OdfUtils"); + runtime.loadClass("ops.OdtDocument"); + runtime.loadClass("ops.OdtStepsTranslator"); + runtime.loadClass("ops.Session"); + runtime.loadClass("odf.Namespaces"); + runtime.loadClass("odf.OdfCanvas"); + runtime.loadClass("odf.OdfUtils"); + runtime.loadClass("gui.CaretManager"); + runtime.loadClass("gui.Caret"); + runtime.loadClass("gui.OdfFieldView"); + runtime.loadClass("gui.SessionController"); + runtime.loadClass("gui.SessionView"); + runtime.loadClass("gui.HyperlinkTooltipView"); + runtime.loadClass("gui.TrivialUndoManager"); + runtime.loadClass("gui.SvgSelectionView"); + runtime.loadClass("gui.SelectionViewManager"); + runtime.loadClass("core.EventNotifier"); + runtime.loadClass("gui.ShadowCursor"); + runtime.loadClass("gui.CommonConstraints"); + + /** + * Instantiate a new editor session attached to an existing operation session + * @constructor + * @implements {core.EventSource} + * @param {!ops.Session} session + * @param {!string} localMemberId + * @param {{viewOptions:gui.SessionViewOptions,directParagraphStylingEnabled:boolean,annotationsEnabled:boolean}} config + */ + var EditorSession = function EditorSession(session, localMemberId, config) { + var self = this, + currentParagraphNode = null, + currentCommonStyleName = null, + currentStyleName = null, + caretManager, + selectionViewManager, + hyperlinkTooltipView, + odtDocument = session.getOdtDocument(), + textns = odf.Namespaces.textns, + fontStyles = document.createElement('style'), + formatting = odtDocument.getFormatting(), + domUtils = core.DomUtils, + odfUtils = odf.OdfUtils, + odfFieldView, + eventNotifier = new core.EventNotifier([ + EditorSession.signalMemberAdded, + EditorSession.signalMemberUpdated, + EditorSession.signalMemberRemoved, + EditorSession.signalCursorAdded, + EditorSession.signalCursorMoved, + EditorSession.signalCursorRemoved, + EditorSession.signalParagraphChanged, + EditorSession.signalCommonStyleCreated, + EditorSession.signalCommonStyleDeleted, + EditorSession.signalParagraphStyleModified, + EditorSession.signalUndoStackChanged]), + shadowCursor = new gui.ShadowCursor(odtDocument), + sessionConstraints, + /**@const*/ + NEXT = core.StepDirection.NEXT; + + /** + * @return {Array.} + */ + function getAvailableFonts() { + var availableFonts, regex, matches; + + availableFonts = {}; + + /*jslint regexp: true*/ + regex = /font-family *: *(?:\'([^']*)\'|\"([^"]*)\")/gm; + /*jslint regexp: false*/ + matches = regex.exec(fontsCSS); + + while (matches) { + availableFonts[matches[1] || matches[2]] = 1; + matches = regex.exec(fontsCSS); + } + availableFonts = Object.keys(availableFonts); + + return availableFonts; + } + + function checkParagraphStyleName() { + var newStyleName, + newCommonStyleName; + + newStyleName = currentParagraphNode.getAttributeNS(textns, 'style-name'); + + if (newStyleName !== currentStyleName) { + currentStyleName = newStyleName; + // check if common style is still the same + newCommonStyleName = formatting.getFirstCommonParentStyleNameOrSelf(newStyleName); + if (!newCommonStyleName) { + // Default style, empty-string name + currentCommonStyleName = newStyleName = currentStyleName = ""; + self.emit(EditorSession.signalParagraphChanged, { + type: 'style', + node: currentParagraphNode, + styleName: currentCommonStyleName + }); + return; + } + // a common style + if (newCommonStyleName !== currentCommonStyleName) { + currentCommonStyleName = newCommonStyleName; + self.emit(EditorSession.signalParagraphChanged, { + type: 'style', + node: currentParagraphNode, + styleName: currentCommonStyleName + }); + } + } + } + /** + * Creates a NCName from the passed string + * @param {!string} name + * @return {!string} + */ + function createNCName(name) { + var letter, + result = "", + i; + + // encode + for (i = 0; i < name.length; i += 1) { + letter = name[i]; + // simple approach, can be improved to not skip other allowed chars + if (letter.match(/[a-zA-Z0-9.-_]/) !== null) { + result += letter; + } else { + result += "_" + letter.charCodeAt(0).toString(16) + "_"; + } + } + // ensure leading char is from proper range + if (result.match(/^[a-zA-Z_]/) === null) { + result = "_" + result; + } + + return result; + } + + function uniqueParagraphStyleNCName(name) { + var result, + i = 0, + ncMemberId = createNCName(localMemberId), + ncName = createNCName(name); + + // create default paragraph style + // localMemberId is used to avoid id conflicts with ids created by other members + result = ncName + "_" + ncMemberId; + // then loop until result is really unique + while (formatting.hasParagraphStyle(result)) { + result = ncName + "_" + i + "_" + ncMemberId; + i += 1; + } + + return result; + } + + function trackCursor(cursor) { + var node; + + node = odfUtils.getParagraphElement(cursor.getNode()); + if (!node) { + return; + } + currentParagraphNode = node; + checkParagraphStyleName(); + } + + function trackCurrentParagraph(info) { + var cursor = odtDocument.getCursor(localMemberId), + range = cursor && cursor.getSelectedRange(), + paragraphRange = odtDocument.getDOMDocument().createRange(); + paragraphRange.selectNode(info.paragraphElement); + if ((range && domUtils.rangesIntersect(range, paragraphRange)) || info.paragraphElement === currentParagraphNode) { + self.emit(EditorSession.signalParagraphChanged, info); + checkParagraphStyleName(); + } + paragraphRange.detach(); + } + + function onMemberAdded(member) { + self.emit(EditorSession.signalMemberAdded, member.getMemberId()); + } + + function onMemberUpdated(member) { + self.emit(EditorSession.signalMemberUpdated, member.getMemberId()); + } + + function onMemberRemoved(memberId) { + self.emit(EditorSession.signalMemberRemoved, memberId); + } + + function onCursorAdded(cursor) { + self.emit(EditorSession.signalCursorAdded, cursor.getMemberId()); + trackCursor(cursor); + } + + function onCursorRemoved(memberId) { + self.emit(EditorSession.signalCursorRemoved, memberId); + } + + function onCursorMoved(cursor) { + // Emit 'cursorMoved' only when *I* am moving the cursor, not the other users + if (cursor.getMemberId() === localMemberId) { + self.emit(EditorSession.signalCursorMoved, cursor); + trackCursor(cursor); + } + } + + function onStyleCreated(newStyleName) { + self.emit(EditorSession.signalCommonStyleCreated, newStyleName); + } + + function onStyleDeleted(styleName) { + self.emit(EditorSession.signalCommonStyleDeleted, styleName); + } + + function onParagraphStyleModified(styleName) { + self.emit(EditorSession.signalParagraphStyleModified, styleName); + } + + /** + * Call all subscribers for the given event with the specified argument + * @param {!string} eventid + * @param {Object} args + */ + this.emit = function (eventid, args) { + eventNotifier.emit(eventid, args); + }; + + /** + * Subscribe to a given event with a callback + * @param {!string} eventid + * @param {!Function} cb + */ + this.subscribe = function (eventid, cb) { + eventNotifier.subscribe(eventid, cb); + }; + + /** + * @param {!string} eventid + * @param {!Function} cb + * @return {undefined} + */ + this.unsubscribe = function (eventid, cb) { + eventNotifier.unsubscribe(eventid, cb); + }; + + this.getCursorPosition = function () { + return odtDocument.getCursorPosition(localMemberId); + }; + + this.getCursorSelection = function () { + return odtDocument.getCursorSelection(localMemberId); + }; + + this.getOdfCanvas = function () { + return odtDocument.getOdfCanvas(); + }; + + this.getCurrentParagraph = function () { + return currentParagraphNode; + }; + + this.getAvailableParagraphStyles = function () { + return formatting.getAvailableParagraphStyles(); + }; + + this.getCurrentParagraphStyle = function () { + return currentCommonStyleName; + }; + + /** + * Applies the paragraph style with the given + * style name to all the paragraphs within + * the cursor selection. + * @param {!string} styleName + * @return {undefined} + */ + this.setCurrentParagraphStyle = function (styleName) { + var range = odtDocument.getCursor(localMemberId).getSelectedRange(), + paragraphs = odfUtils.getParagraphElements(range), + opQueue = []; + + paragraphs.forEach(function (paragraph) { + var paragraphStartPoint = odtDocument.convertDomPointToCursorStep(paragraph, 0, NEXT), + paragraphStyleName = paragraph.getAttributeNS(odf.Namespaces.textns, "style-name"), + opSetParagraphStyle; + + if (paragraphStyleName !== styleName) { + opSetParagraphStyle = new ops.OpSetParagraphStyle(); + opSetParagraphStyle.init({ + memberid: localMemberId, + styleName: styleName, + position: paragraphStartPoint + }); + opQueue.push(opSetParagraphStyle); + } + }); + + if (opQueue.length > 0) { + session.enqueue(opQueue); + } + }; + + this.insertTable = function (initialRows, initialColumns, tableStyleName, tableColumnStyleName, tableCellStyleMatrix) { + var op = new ops.OpInsertTable(); + op.init({ + memberid: localMemberId, + position: self.getCursorPosition(), + initialRows: initialRows, + initialColumns: initialColumns, + tableStyleName: tableStyleName, + tableColumnStyleName: tableColumnStyleName, + tableCellStyleMatrix: tableCellStyleMatrix + }); + session.enqueue([op]); + }; + + /** + * Takes a style name and returns the corresponding paragraph style + * element. If the style name is an empty string, the default style + * is returned. + * @param {!string} styleName + * @return {?Element} + */ + function getParagraphStyleElement(styleName) { + return (styleName === "") + ? formatting.getDefaultStyleElement('paragraph') + : formatting.getStyleElement(styleName, 'paragraph'); + } + + this.getParagraphStyleElement = getParagraphStyleElement; + + /** + * Returns if the style is used anywhere in the document + * @param {!Element} styleElement + * @return {boolean} + */ + this.isStyleUsed = function (styleElement) { + return formatting.isStyleUsed(styleElement); + }; + + /** + * Returns the attributes of a given paragraph style name + * (with inheritance). If the name is an empty string, + * the attributes of the default style are returned. + * @param {!string} styleName + * @return {?odf.Formatting.StyleData} + */ + this.getParagraphStyleAttributes = function (styleName) { + var styleNode = getParagraphStyleElement(styleName), + includeSystemDefault = styleName === ""; + + if (styleNode) { + return formatting.getInheritedStyleAttributes(styleNode, includeSystemDefault); + } + + return null; + }; + + /** + * Creates and enqueues a paragraph-style cloning operation. + * Returns the created id for the new style. + * @param {!string} styleName id of the style to update + * @param {!{paragraphProperties,textProperties}} setProperties properties which are set + * @param {!{paragraphPropertyNames,textPropertyNames}=} removedProperties properties which are removed + * @return {undefined} + */ + this.updateParagraphStyle = function (styleName, setProperties, removedProperties) { + var op; + op = new ops.OpUpdateParagraphStyle(); + op.init({ + memberid: localMemberId, + styleName: styleName, + setProperties: setProperties, + removedProperties: (!removedProperties) ? {} : removedProperties + }); + session.enqueue([op]); + }; + + /** + * Creates and enqueues a paragraph-style cloning operation. + * Returns the created id for the new style. + * @param {!string} styleName id of the style to clone + * @param {!string} newStyleDisplayName display name of the new style + * @return {!string} + */ + this.cloneParagraphStyle = function (styleName, newStyleDisplayName) { + var newStyleName = uniqueParagraphStyleNCName(newStyleDisplayName), + styleNode = getParagraphStyleElement(styleName), + op, setProperties, attributes, i; + + setProperties = formatting.getStyleAttributes(styleNode); + // copy any attributes directly on the style + attributes = styleNode.attributes; + for (i = 0; i < attributes.length; i += 1) { + // skip... + // * style:display-name -> not copied, set to new string below + // * style:name -> not copied, set from op by styleName property + // * style:family -> "paragraph" always, set by op + if (!/^(style:display-name|style:name|style:family)/.test(attributes[i].name)) { + setProperties[attributes[i].name] = attributes[i].value; + } + } + + setProperties['style:display-name'] = newStyleDisplayName; + + op = new ops.OpAddStyle(); + op.init({ + memberid: localMemberId, + styleName: newStyleName, + styleFamily: 'paragraph', + setProperties: setProperties + }); + session.enqueue([op]); + + return newStyleName; + }; + + this.deleteStyle = function (styleName) { + var op; + op = new ops.OpRemoveStyle(); + op.init({ + memberid: localMemberId, + styleName: styleName, + styleFamily: 'paragraph' + }); + session.enqueue([op]); + }; + + /** + * Returns an array of the declared fonts in the ODF document, + * with 'duplicates' like Arial1, Arial2, etc removed. The alphabetically + * first font name for any given family is kept. + * The elements of the array are objects containing the font's name and + * the family. + * @return {Array.} + */ + this.getDeclaredFonts = function () { + var fontMap = formatting.getFontMap(), + usedFamilies = [], + array = [], + sortedNames, + key, + value, + i; + + // Sort all the keys in the font map alphabetically + sortedNames = Object.keys(fontMap); + sortedNames.sort(); + + for (i = 0; i < sortedNames.length; i += 1) { + key = sortedNames[i]; + value = fontMap[key]; + + // Use the font declaration only if the family is not already used. + // Therefore we are able to discard the alphabetic successors of the first + // font name. + if (usedFamilies.indexOf(value) === -1) { + array.push({ + name: key, + family: value + }); + if (value) { + usedFamilies.push(value); + } + } + } + + return array; + }; + + this.getSelectedHyperlinks = function () { + var cursor = odtDocument.getCursor(localMemberId); + // no own cursor yet/currently added? + if (!cursor) { + return []; + } + return odfUtils.getHyperlinkElements(cursor.getSelectedRange()); + }; + + this.getSelectedRange = function () { + var cursor = odtDocument.getCursor(localMemberId); + return cursor && cursor.getSelectedRange(); + }; + + function undoStackModified(e) { + self.emit(EditorSession.signalUndoStackChanged, e); + } + + this.undo = function () { + self.sessionController.undo(); + }; + + this.redo = function () { + self.sessionController.redo(); + }; + + /** + * @param {!string} memberId + * @return {?ops.Member} + */ + this.getMember = function (memberId) { + return odtDocument.getMember(memberId); + }; + + /** + * @param {!function(!Object=)} callback passing an error object in case of error + * @return {undefined} + */ + function destroy(callback) { + var head = document.getElementsByTagName('head')[0], + eventManager = self.sessionController.getEventManager(); + + head.removeChild(fontStyles); + + odtDocument.unsubscribe(ops.Document.signalMemberAdded, onMemberAdded); + odtDocument.unsubscribe(ops.Document.signalMemberUpdated, onMemberUpdated); + odtDocument.unsubscribe(ops.Document.signalMemberRemoved, onMemberRemoved); + odtDocument.unsubscribe(ops.Document.signalCursorAdded, onCursorAdded); + odtDocument.unsubscribe(ops.Document.signalCursorRemoved, onCursorRemoved); + odtDocument.unsubscribe(ops.Document.signalCursorMoved, onCursorMoved); + odtDocument.unsubscribe(ops.OdtDocument.signalCommonStyleCreated, onStyleCreated); + odtDocument.unsubscribe(ops.OdtDocument.signalCommonStyleDeleted, onStyleDeleted); + odtDocument.unsubscribe(ops.OdtDocument.signalParagraphStyleModified, onParagraphStyleModified); + odtDocument.unsubscribe(ops.OdtDocument.signalParagraphChanged, trackCurrentParagraph); + odtDocument.unsubscribe(ops.OdtDocument.signalUndoStackChanged, undoStackModified); + + eventManager.unsubscribe("mousemove", hyperlinkTooltipView.showTooltip); + eventManager.unsubscribe("mouseout", hyperlinkTooltipView.hideTooltip); + delete self.sessionView; + delete self.sessionController; + callback(); + } + + /** + * @param {!function(!Error=)} callback passing an error object in case of error + * @return {undefined} + */ + this.destroy = function(callback) { + var cleanup = [ + self.sessionView.destroy, + caretManager.destroy, + selectionViewManager.destroy, + self.sessionController.destroy, + hyperlinkTooltipView.destroy, + odfFieldView.destroy, + destroy + ]; + + core.Async.destroyAll(cleanup, callback); + }; + + function init() { + var head = document.getElementsByTagName('head')[0], + odfCanvas = session.getOdtDocument().getOdfCanvas(), + eventManager; + + // TODO: fonts.css should be rather done by odfCanvas, or? + fontStyles.type = 'text/css'; + fontStyles.media = 'screen, print, handheld, projection'; + fontStyles.appendChild(document.createTextNode(fontsCSS)); + head.appendChild(fontStyles); + + odfFieldView = new gui.OdfFieldView(odfCanvas); + odfFieldView.showFieldHighlight(); + self.sessionController = new gui.SessionController(session, localMemberId, shadowCursor, { + annotationsEnabled: config.annotationsEnabled, + directTextStylingEnabled: config.directTextStylingEnabled, + directParagraphStylingEnabled: config.directParagraphStylingEnabled + }); + sessionConstraints = self.sessionController.getSessionConstraints(); + + eventManager = self.sessionController.getEventManager(); + hyperlinkTooltipView = new gui.HyperlinkTooltipView(odfCanvas, + self.sessionController.getHyperlinkClickHandler().getModifier); + eventManager.subscribe("mousemove", hyperlinkTooltipView.showTooltip); + eventManager.subscribe("mouseout", hyperlinkTooltipView.hideTooltip); + + caretManager = new gui.CaretManager(self.sessionController, odfCanvas.getViewport()); + selectionViewManager = new gui.SelectionViewManager(gui.SvgSelectionView); + self.sessionView = new gui.SessionView(config.viewOptions, localMemberId, session, sessionConstraints, caretManager, selectionViewManager); + self.availableFonts = getAvailableFonts(); + selectionViewManager.registerCursor(shadowCursor, true); + + // Session Constraints can be applied once the controllers are instantiated. + if (config.reviewModeEnabled) { + // Disallow deleting other authors' annotations. + sessionConstraints.setState(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN, true); + sessionConstraints.setState(gui.CommonConstraints.EDIT.REVIEW_MODE, true); + } + + // Custom signals, that make sense in the Editor context. We do not want to expose webodf's ops signals to random bits of the editor UI. + odtDocument.subscribe(ops.Document.signalMemberAdded, onMemberAdded); + odtDocument.subscribe(ops.Document.signalMemberUpdated, onMemberUpdated); + odtDocument.subscribe(ops.Document.signalMemberRemoved, onMemberRemoved); + odtDocument.subscribe(ops.Document.signalCursorAdded, onCursorAdded); + odtDocument.subscribe(ops.Document.signalCursorRemoved, onCursorRemoved); + odtDocument.subscribe(ops.Document.signalCursorMoved, onCursorMoved); + odtDocument.subscribe(ops.OdtDocument.signalCommonStyleCreated, onStyleCreated); + odtDocument.subscribe(ops.OdtDocument.signalCommonStyleDeleted, onStyleDeleted); + odtDocument.subscribe(ops.OdtDocument.signalParagraphStyleModified, onParagraphStyleModified); + odtDocument.subscribe(ops.OdtDocument.signalParagraphChanged, trackCurrentParagraph); + odtDocument.subscribe(ops.OdtDocument.signalUndoStackChanged, undoStackModified); + } + + init(); + }; + + /**@const*/EditorSession.signalMemberAdded = "memberAdded"; + /**@const*/EditorSession.signalMemberUpdated = "memberUpdated"; + /**@const*/EditorSession.signalMemberRemoved = "memberRemoved"; + /**@const*/EditorSession.signalCursorAdded = "cursorAdded"; + /**@const*/EditorSession.signalCursorRemoved = "cursorRemoved"; + /**@const*/EditorSession.signalCursorMoved = "cursorMoved"; + /**@const*/EditorSession.signalParagraphChanged = "paragraphChanged"; + /**@const*/EditorSession.signalCommonStyleCreated = "styleCreated"; + /**@const*/EditorSession.signalCommonStyleDeleted = "styleDeleted"; + /**@const*/EditorSession.signalParagraphStyleModified = "paragraphStyleModified"; + /**@const*/EditorSession.signalUndoStackChanged = "signalUndoStackChanged"; + + return EditorSession; +})(""); + diff --git a/OpenPage/build/debug/package.json b/OpenPage/build/debug/package.json new file mode 100644 index 0000000..8408503 --- /dev/null +++ b/OpenPage/build/debug/package.json @@ -0,0 +1,13 @@ +{ + "app":"OpenPage", + "name":"OpenPage", + "description":"Open Document Format (ODF) text editor using WebODF", + "info":{ + "author": "Xuan Sang LE", + "email": "xsang.le@gmail.com" + }, + "version":"0.0.2-a", + "category":"Other", + "icon":"icon.png", + "mimes":["application/vnd.oasis.opendocument.text"] +} \ No newline at end of file diff --git a/OpenPage/build/debug/scheme.html b/OpenPage/build/debug/scheme.html new file mode 100644 index 0000000..3f16689 --- /dev/null +++ b/OpenPage/build/debug/scheme.html @@ -0,0 +1,47 @@ + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+
\ No newline at end of file diff --git a/OpenPage/build/release/OpenPage.zip b/OpenPage/build/release/OpenPage.zip index 882e08b..40b0c4a 100644 Binary files a/OpenPage/build/release/OpenPage.zip and b/OpenPage/build/release/OpenPage.zip differ diff --git a/OpenPage/coffees/main.coffee b/OpenPage/coffees/main.coffee index 6f1ef05..4fdd212 100644 --- a/OpenPage/coffees/main.coffee +++ b/OpenPage/coffees/main.coffee @@ -45,7 +45,7 @@ class OpenPage extends this.OS.GUI.BaseApplication me = @ saveas = () -> me.openDialog "FileDiaLog", (d, n, p) -> - me.currfile.setPath "#{d}#{n}" + me.currfile.setPath "#{d}/#{n}" me.save() , __("Save as"), { file: me.currfile } switch e @@ -68,15 +68,14 @@ class OpenPage extends this.OS.GUI.BaseApplication @open blank, true open: (p,b) -> me = @ - @pathAsDataURL(p) .then (r) -> me.closeDocument() if me.editorSession me.initCanvas() - OdfContainer = new odf.OdfContainer r.reader.result, (c) -> + OdfContainer = new odf.OdfContainer r.data, (c) -> me.canvas.setOdfContainer c, false return me.currfile = "Untitled".asFileHandler() if b - me.currfile.setPath p + if me.currfile then me.currfile.setPath p else me.currfile = p.asFileHandler() me.scheme.set "apptitle", me.currfile.basename me.notify __("File {0} opened", p) .catch (e) -> @@ -391,10 +390,19 @@ class OpenPage extends this.OS.GUI.BaseApplication reader = new FileReader() reader.onloadend = () -> return error(p) if reader.readyState isnt 2 - resolve {reader: reader, fp: fp } + resolve {data: reader.result, fp: fp } reader.readAsDataURL blob , "binary" - + ### + if not isText + + else + fp.read (data) -> + # convert to base64 + b64 = btoa data + dataurl = "data:#{fp.info.mime};base64," + b64 + resolve { reader: {result: dataurl}, fp:fp } + ### image: (e) -> me = @ @@ -406,12 +414,12 @@ class OpenPage extends this.OS.GUI.BaseApplication hiddenImage.style.left = "-99999px" document.body.appendChild hiddenImage hiddenImage.onload = () -> - content = r.reader.result.substring(r.reader.result.indexOf(",") + 1) + content = r.data.substring(r.data.indexOf(",") + 1) #insert image me.textController.removeCurrentSelection() me.imageController.insertImage r.fp.info.mime, content, hiddenImage.width, hiddenImage.height document.body.removeChild hiddenImage - hiddenImage.src = r.reader.result + hiddenImage.src = r.data .catch () -> me.error __("Couldnt load image {0}", p) , __("Select image file"), { mimes: ["image/.*"] } diff --git a/OpenPage/package.json b/OpenPage/package.json index cd58c36..8408503 100644 --- a/OpenPage/package.json +++ b/OpenPage/package.json @@ -6,7 +6,7 @@ "author": "Xuan Sang LE", "email": "xsang.le@gmail.com" }, - "version":"0.0.1-a", + "version":"0.0.2-a", "category":"Other", "icon":"icon.png", "mimes":["application/vnd.oasis.opendocument.text"]