diff --git a/dist/canvg.js b/dist/canvg.js index 896e4514..910cee5a 100644 --- a/dist/canvg.js +++ b/dist/canvg.js @@ -243,6 +243,10 @@ var canvg = (function (exports) { } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; @@ -278,7 +282,7 @@ var canvg = (function (exports) { function _wrapRegExp(re, groups) { _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, groups); + return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); @@ -287,10 +291,10 @@ var canvg = (function (exports) { var _groups = new WeakMap(); - function BabelRegExp(re, groups) { - var _this = _RegExp.call(this, re); + function BabelRegExp(re, flags, groups) { + var _this = _RegExp.call(this, re, flags); - _groups.set(_this, groups); + _groups.set(_this, groups || _groups.get(re)); return _this; } diff --git a/dist/extensions/ext-arrows.js b/dist/extensions/ext-arrows.js index 47e15fab..c34ac71c 100644 --- a/dist/extensions/ext-arrows.js +++ b/dist/extensions/ext-arrows.js @@ -138,7 +138,7 @@ var svgEditorExtension_arrows = (function () { function _wrapRegExp(re, groups) { _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, groups); + return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); @@ -147,10 +147,10 @@ var svgEditorExtension_arrows = (function () { var _groups = new WeakMap(); - function BabelRegExp(re, groups) { - var _this = _RegExp.call(this, re); + function BabelRegExp(re, flags, groups) { + var _this = _RegExp.call(this, re, flags); - _groups.set(_this, groups); + _groups.set(_this, groups || _groups.get(re)); return _this; } diff --git a/dist/extensions/ext-helloworld.js b/dist/extensions/ext-helloworld.js index 709aadc5..8f04bc97 100644 --- a/dist/extensions/ext-helloworld.js +++ b/dist/extensions/ext-helloworld.js @@ -46,6 +46,10 @@ var svgEditorExtension_helloworld = (function () { } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; diff --git a/dist/extensions/ext-locale/imagelib/de.js b/dist/extensions/ext-locale/imagelib/de.js index 8833d81f..52057562 100644 --- a/dist/extensions/ext-locale/imagelib/de.js +++ b/dist/extensions/ext-locale/imagelib/de.js @@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_de = (function () { name: 'IAN Symbol Libraries', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', description: 'Free library of illustrations' - /* - // See message in "en" locale for further details - , - { - name: 'Openclipart', - url: 'https://openclipart.org/svgedit', - description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' - } - */ - - }] + } + /* + // See message in "en" locale for further details + , + { + name: 'Openclipart', + url: 'https://openclipart.org/svgedit', + description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' + } + */ + ] }; return de; diff --git a/dist/extensions/ext-locale/imagelib/en.js b/dist/extensions/ext-locale/imagelib/en.js index 1a95bc1e..3ab39c02 100644 --- a/dist/extensions/ext-locale/imagelib/en.js +++ b/dist/extensions/ext-locale/imagelib/en.js @@ -17,23 +17,23 @@ var svgEditorExtensionLocale_imagelib_en = (function () { }, { name: 'IAN Symbol Libraries', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', - description: 'Free library of illustrations' // The site is no longer using our API, and they have added an - // `X-Frame-Options` header which prevents our usage cross-origin: - // Getting messages like this in console: - // Refused to display 'https://openclipart.org/detail/307176/sign-bike' in a frame - // because it set 'X-Frame-Options' to 'sameorigin'. - // url: 'https://openclipart.org/svgedit', - // However, they do have a custom API which we are using here: + description: 'Free library of illustrations' + } // The site is no longer using our API, and they have added an + // `X-Frame-Options` header which prevents our usage cross-origin: + // Getting messages like this in console: + // Refused to display 'https://openclipart.org/detail/307176/sign-bike' in a frame + // because it set 'X-Frame-Options' to 'sameorigin'. + // url: 'https://openclipart.org/svgedit', + // However, they do have a custom API which we are using here: - /* - { - name: 'Openclipart', - url: '{path}imagelib/openclipart{modularVersion}.html', - description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' - } - */ - - }] + /* + { + name: 'Openclipart', + url: '{path}imagelib/openclipart{modularVersion}.html', + description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' + } + */ + ] }; return en; diff --git a/dist/extensions/ext-locale/imagelib/fr.js b/dist/extensions/ext-locale/imagelib/fr.js index 23da94ce..cb6e2619 100644 --- a/dist/extensions/ext-locale/imagelib/fr.js +++ b/dist/extensions/ext-locale/imagelib/fr.js @@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_fr = (function () { name: 'IAN Symbol Libraries', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', description: 'Free library of illustrations' - /* - // See message in "en" locale for further details - , - { - name: 'Openclipart', - url: 'https://openclipart.org/svgedit', - description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' - } - */ - - }] + } + /* + // See message in "en" locale for further details + , + { + name: 'Openclipart', + url: 'https://openclipart.org/svgedit', + description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' + } + */ + ] }; return fr; diff --git a/dist/extensions/ext-locale/imagelib/pl.js b/dist/extensions/ext-locale/imagelib/pl.js index 459da03d..af9eff1d 100644 --- a/dist/extensions/ext-locale/imagelib/pl.js +++ b/dist/extensions/ext-locale/imagelib/pl.js @@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_pl = (function () { name: 'IAN Symbol Libraries', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', description: 'Free library of illustrations' - /* - // See message in "en" locale for further details - , - { - name: 'Openclipart', - url: 'https://openclipart.org/svgedit', - description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' - } - */ - - }] + } + /* + // See message in "en" locale for further details + , + { + name: 'Openclipart', + url: 'https://openclipart.org/svgedit', + description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' + } + */ + ] }; return pl; diff --git a/dist/extensions/ext-locale/imagelib/pt-BR.js b/dist/extensions/ext-locale/imagelib/pt-BR.js index 1706a458..abbb7291 100644 --- a/dist/extensions/ext-locale/imagelib/pt-BR.js +++ b/dist/extensions/ext-locale/imagelib/pt-BR.js @@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_pt_BR = (function () { name: 'IAN Symbol Libraries', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', description: 'Free library of illustrations' - /* - // See message in "en" locale for further details - , - { - name: 'Openclipart', - url: 'https://openclipart.org/svgedit', - description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' - } - */ - - }] + } + /* + // See message in "en" locale for further details + , + { + name: 'Openclipart', + url: 'https://openclipart.org/svgedit', + description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' + } + */ + ] }; return ptBR; diff --git a/dist/extensions/ext-locale/imagelib/ro.js b/dist/extensions/ext-locale/imagelib/ro.js index 9cc1dd6f..31324df0 100644 --- a/dist/extensions/ext-locale/imagelib/ro.js +++ b/dist/extensions/ext-locale/imagelib/ro.js @@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_ro = (function () { name: 'IAN Symbol Libraries', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', description: 'Free library of illustrations' - /* - // See message in "en" locale for further details - , - { - name: 'Openclipart', - url: 'https://openclipart.org/svgedit', - description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' - } - */ - - }] + } + /* + // See message in "en" locale for further details + , + { + name: 'Openclipart', + url: 'https://openclipart.org/svgedit', + description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' + } + */ + ] }; return ro; diff --git a/dist/extensions/ext-locale/imagelib/sk.js b/dist/extensions/ext-locale/imagelib/sk.js index 12a98917..6a72ab31 100644 --- a/dist/extensions/ext-locale/imagelib/sk.js +++ b/dist/extensions/ext-locale/imagelib/sk.js @@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_sk = (function () { name: 'IAN Symbol Libraries', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', description: 'Free library of illustrations' - /* - // See message in "en" locale for further details - , - { - name: 'Openclipart', - url: 'https://openclipart.org/svgedit', - description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' - } - */ - - }] + } + /* + // See message in "en" locale for further details + , + { + name: 'Openclipart', + url: 'https://openclipart.org/svgedit', + description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' + } + */ + ] }; return sk; diff --git a/dist/extensions/ext-locale/imagelib/sl.js b/dist/extensions/ext-locale/imagelib/sl.js index ae563f5b..1dba6e38 100644 --- a/dist/extensions/ext-locale/imagelib/sl.js +++ b/dist/extensions/ext-locale/imagelib/sl.js @@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_sl = (function () { name: 'IAN Symbol Libraries', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', description: 'Free library of illustrations' - /* - // See message in "en" locale for further details - , - { - name: 'Openclipart', - url: 'https://openclipart.org/svgedit', - description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' - } - */ - - }] + } + /* + // See message in "en" locale for further details + , + { + name: 'Openclipart', + url: 'https://openclipart.org/svgedit', + description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' + } + */ + ] }; return sl; diff --git a/dist/extensions/ext-locale/imagelib/zh-CN.js b/dist/extensions/ext-locale/imagelib/zh-CN.js index 6c6cedf5..0ff164a9 100644 --- a/dist/extensions/ext-locale/imagelib/zh-CN.js +++ b/dist/extensions/ext-locale/imagelib/zh-CN.js @@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_zh_CN = (function () { name: 'IAN Symbol Libraries', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', description: 'Free library of illustrations' - /* - // See message in "en" locale for further details - , - { - name: 'Openclipart', - url: 'https://openclipart.org/svgedit', - description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' - } - */ - - }] + } + /* + // See message in "en" locale for further details + , + { + name: 'Openclipart', + url: 'https://openclipart.org/svgedit', + description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' + } + */ + ] }; return zhCN; diff --git a/dist/extensions/ext-markers.js b/dist/extensions/ext-markers.js index 38fbb89e..386f973c 100644 --- a/dist/extensions/ext-markers.js +++ b/dist/extensions/ext-markers.js @@ -138,7 +138,7 @@ var svgEditorExtension_markers = (function () { function _wrapRegExp(re, groups) { _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, groups); + return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); @@ -147,10 +147,10 @@ var svgEditorExtension_markers = (function () { var _groups = new WeakMap(); - function BabelRegExp(re, groups) { - var _this = _RegExp.call(this, re); + function BabelRegExp(re, flags, groups) { + var _this = _RegExp.call(this, re, flags); - _groups.set(_this, groups); + _groups.set(_this, groups || _groups.get(re)); return _this; } diff --git a/dist/extensions/ext-placemark.js b/dist/extensions/ext-placemark.js index 57f7b573..aecc0854 100644 --- a/dist/extensions/ext-placemark.js +++ b/dist/extensions/ext-placemark.js @@ -145,6 +145,10 @@ var svgEditorExtension_placemark = (function () { } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; @@ -176,7 +180,7 @@ var svgEditorExtension_placemark = (function () { function _wrapRegExp(re, groups) { _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, groups); + return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); @@ -185,10 +189,10 @@ var svgEditorExtension_placemark = (function () { var _groups = new WeakMap(); - function BabelRegExp(re, groups) { - var _this = _RegExp.call(this, re); + function BabelRegExp(re, flags, groups) { + var _this = _RegExp.call(this, re, flags); - _groups.set(_this, groups); + _groups.set(_this, groups || _groups.get(re)); return _this; } diff --git a/dist/extensions/ext-server_moinsave.js b/dist/extensions/ext-server_moinsave.js index b14c077c..60f4e25a 100644 --- a/dist/extensions/ext-server_moinsave.js +++ b/dist/extensions/ext-server_moinsave.js @@ -243,6 +243,10 @@ var svgEditorExtension_server_moinsave = (function () { } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; @@ -278,7 +282,7 @@ var svgEditorExtension_server_moinsave = (function () { function _wrapRegExp(re, groups) { _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, groups); + return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); @@ -287,10 +291,10 @@ var svgEditorExtension_server_moinsave = (function () { var _groups = new WeakMap(); - function BabelRegExp(re, groups) { - var _this = _RegExp.call(this, re); + function BabelRegExp(re, flags, groups) { + var _this = _RegExp.call(this, re, flags); - _groups.set(_this, groups); + _groups.set(_this, groups || _groups.get(re)); return _this; } diff --git a/dist/extensions/ext-server_opensave.js b/dist/extensions/ext-server_opensave.js index 557d704b..fcdde65c 100644 --- a/dist/extensions/ext-server_opensave.js +++ b/dist/extensions/ext-server_opensave.js @@ -243,6 +243,10 @@ var svgEditorExtension_server_opensave = (function () { } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; @@ -278,7 +282,7 @@ var svgEditorExtension_server_opensave = (function () { function _wrapRegExp(re, groups) { _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, groups); + return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); @@ -287,10 +291,10 @@ var svgEditorExtension_server_opensave = (function () { var _groups = new WeakMap(); - function BabelRegExp(re, groups) { - var _this = _RegExp.call(this, re); + function BabelRegExp(re, flags, groups) { + var _this = _RegExp.call(this, re, flags); - _groups.set(_this, groups); + _groups.set(_this, groups || _groups.get(re)); return _this; } diff --git a/dist/extensions/ext-shapes.js b/dist/extensions/ext-shapes.js index 8283a9ec..dd7b1195 100644 --- a/dist/extensions/ext-shapes.js +++ b/dist/extensions/ext-shapes.js @@ -46,6 +46,10 @@ var svgEditorExtension_shapes = (function () { } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; diff --git a/dist/extensions/ext-storage.js b/dist/extensions/ext-storage.js index a23d835a..bb9a7906 100644 --- a/dist/extensions/ext-storage.js +++ b/dist/extensions/ext-storage.js @@ -145,6 +145,10 @@ var svgEditorExtension_storage = (function () { } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; @@ -176,7 +180,7 @@ var svgEditorExtension_storage = (function () { function _wrapRegExp(re, groups) { _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, groups); + return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); @@ -185,10 +189,10 @@ var svgEditorExtension_storage = (function () { var _groups = new WeakMap(); - function BabelRegExp(re, groups) { - var _this = _RegExp.call(this, re); + function BabelRegExp(re, flags, groups) { + var _this = _RegExp.call(this, re, flags); - _groups.set(_this, groups); + _groups.set(_this, groups || _groups.get(re)); return _this; } diff --git a/dist/extensions/ext-webappfind.js b/dist/extensions/ext-webappfind.js index 91646e56..f8f14683 100644 --- a/dist/extensions/ext-webappfind.js +++ b/dist/extensions/ext-webappfind.js @@ -87,8 +87,8 @@ var svgEditorExtension_webappfind = (function () { if (origin !== location.origin || // We are only interested in a message sent as though within this URL by our browser add-on excludedMessages.includes(type) // Avoid our post below (other messages might be possible in the future which may also need to be excluded if your subsequent code makes assumptions on the type of message this is) ) { - return; - } + return; + } } catch (err) { return; } diff --git a/dist/extensions/imagelib/openclipart.js b/dist/extensions/imagelib/openclipart.js index 874dc008..735f1c0e 100644 --- a/dist/extensions/imagelib/openclipart.js +++ b/dist/extensions/imagelib/openclipart.js @@ -215,6 +215,10 @@ } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; diff --git a/dist/index-es.js b/dist/index-es.js index 63441a53..1fb7c430 100644 --- a/dist/index-es.js +++ b/dist/index-es.js @@ -228,6 +228,10 @@ function _iterableToArray(iter) { } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; @@ -263,7 +267,7 @@ function _nonIterableRest() { function _wrapRegExp(re, groups) { _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, groups); + return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); @@ -272,10 +276,10 @@ function _wrapRegExp(re, groups) { var _groups = new WeakMap(); - function BabelRegExp(re, groups) { - var _this = _RegExp.call(this, re); + function BabelRegExp(re, flags, groups) { + var _this = _RegExp.call(this, re, flags); - _groups.set(_this, groups); + _groups.set(_this, groups || _groups.get(re)); return _this; } @@ -2736,7 +2740,7 @@ var getReverseNS = function getReverseNS() { }, enumerable: true }, - // FIXME: The following are not implemented and simply return SVGPathElement.pathSegList. + // TODO: The following are not implemented and simply return SVGPathElement.pathSegList. normalizedPathSegList: { get: function get() { return this.pathSegList; @@ -4692,7 +4696,7 @@ function () { }, { key: "addCommandToHistory", value: function addCommandToHistory(cmd) { - // FIXME: we MUST compress consecutive text changes to the same element + // TODO: we MUST compress consecutive text changes to the same element // (right now each keystroke is saved as a separate command that includes the // entire text contents of the text element) // TODO: consider limiting the history that we store here (need to do some slicing) @@ -8381,7 +8385,7 @@ var walkTree = function walkTree(elem, cbFn) { /** * Walks the tree and executes the callback on each element in a depth-first fashion. * @function module:utilities.walkTreePost -* @todo FIXME: Shouldn't this be calling walkTreePost? +* @todo Shouldn't this be calling walkTreePost? * @param {Element} elem - DOM element to traverse * @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element * @returns {void} @@ -9361,8 +9365,8 @@ var snapToGrid = function snapToGrid(value) { */ var regexEscape = function regexEscape(str) { - // From: http://phpjs.org/functions - return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&'); + // Originally from: http://phpjs.org/functions + return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&'); }; /** * Prevents default browser click behaviour on the given element. @@ -11824,7 +11828,7 @@ var sanitizeSvg = function sanitizeSvg(node) { } else { // remove all children from this node and insert them before this node - // FIXME: in the case of animation elements this will hardly ever be correct + // TODO: in the case of animation elements this will hardly ever be correct var children = []; while (node.hasChildNodes()) { @@ -12504,7 +12508,7 @@ var recalculateDimensions = function recalculateDimensions(selected) { if (Math.abs(a) > 1.0e-10) { s = Math.sin(a) / (1 - Math.cos(a)); } else { - // FIXME: This blows up if the angle is exactly 0! + // TODO: This blows up if the angle is exactly 0! s = 2 / a; } @@ -12865,7 +12869,7 @@ var recalculateDimensions = function recalculateDimensions(selected) { } // else, it's a non-group } else { - // FIXME: box might be null for some elements ( etc), need to handle this + // TODO: box might be null for some elements ( etc), need to handle this var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in , // but we still may need to recalculate them (see issue 595). // TODO: Figure out how to get BBox from these elements in case they @@ -12889,7 +12893,7 @@ var recalculateDimensions = function recalculateDimensions(selected) { var _a = _angle * Math.PI / 180; - var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // FIXME: This blows up if the angle is exactly 0! + var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // TODO: This blows up if the angle is exactly 0! : 2 / _a; for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) { @@ -15608,19 +15612,38 @@ function SvgCanvas(container, config) { if (!rightClick) { // insert a dummy transform so if the element(s) are moved it will have // a transform to use for its translate - for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) { - var selectedElement = _selectedElements[_i2]; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; - if (isNullish(selectedElement)) { - continue; + try { + for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var selectedElement = _step.value; + + if (isNullish(selectedElement)) { + continue; + } + + var slist = getTransformList(selectedElement); + + if (slist.numberOfItems) { + slist.insertItemBefore(svgroot.createSVGTransform(), 0); + } else { + slist.appendItem(svgroot.createSVGTransform()); + } } - - var slist = getTransformList(selectedElement); - - if (slist.numberOfItems) { - slist.insertItemBefore(svgroot.createSVGTransform(), 0); - } else { - slist.appendItem(svgroot.createSVGTransform()); + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator["return"] != null) { + _iterator["return"](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } } } } @@ -15784,7 +15807,7 @@ function SvgCanvas(container, config) { break; } - case 'square': // FIXME: once we create the rect, we lose information that this was a square + case 'square': // TODO: once we create the rect, we lose information that this was a square // (for resizing purposes this could be important) // Fallthrough @@ -17726,11 +17749,11 @@ function SvgCanvas(container, config) { } }); }); - var _i3 = attrs.length; + var _i2 = attrs.length; var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow']; - while (_i3--) { - var attr = attrs[_i3]; + while (_i2--) { + var attr = attrs[_i2]; var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip if (attr.nodeName.startsWith('xmlns:')) { @@ -17756,8 +17779,8 @@ function SvgCanvas(container, config) { var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style']; - for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) { - var _attr = attrs[_i4]; + for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) { + var _attr = attrs[_i3]; var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko @@ -17813,14 +17836,14 @@ function SvgCanvas(container, config) { indent++; var bOneLine = false; - for (var _i5 = 0; _i5 < childs.length; _i5++) { - var child = childs.item(_i5); + for (var _i4 = 0; _i4 < childs.length; _i4++) { + var child = childs.item(_i4); switch (child.nodeType) { case 1: // element node out.push('\n'); - out.push(this.svgToString(childs.item(_i5), indent)); + out.push(this.svgToString(childs.item(_i4), indent)); break; case 3: @@ -17862,7 +17885,7 @@ function SvgCanvas(container, config) { if (!bOneLine) { out.push('\n'); - for (var _i6 = 0; _i6 < indent; _i6++) { + for (var _i5 = 0; _i5 < indent; _i5++) { out.push(' '); } } @@ -18938,27 +18961,27 @@ function SvgCanvas(container, config) { } var attrs = svg.attributes; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; try { - for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var attr = _step.value; + for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var attr = _step2.value; // Ok for `NamedNodeMap` symbol.setAttribute(attr.nodeName, attr.value); } } catch (err) { - _didIteratorError = true; - _iteratorError = err; + _didIteratorError2 = true; + _iteratorError2 = err; } finally { try { - if (!_iteratorNormalCompletion && _iterator["return"] != null) { - _iterator["return"](); + if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { + _iterator2["return"](); } } finally { - if (_didIteratorError) { - throw _iteratorError; + if (_didIteratorError2) { + throw _iteratorError2; } } } @@ -19183,29 +19206,29 @@ function SvgCanvas(container, config) { elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem; var childs = elem.childNodes; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; try { - for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var child = _step2.value; + for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var child = _step3.value; if (child.nodeName === 'title') { return child.textContent; } } } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; + _didIteratorError3 = true; + _iteratorError3 = err; } finally { try { - if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { - _iterator2["return"](); + if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) { + _iterator3["return"](); } } finally { - if (_didIteratorError2) { - throw _iteratorError2; + if (_didIteratorError3) { + throw _iteratorError3; } } } @@ -19273,13 +19296,13 @@ function SvgCanvas(container, config) { var docTitle = false, oldTitle = ''; var batchCmd = new BatchCommand$1('Change Image Title'); - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; try { - for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var child = _step3.value; + for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var child = _step4.value; if (child.nodeName === 'title') { docTitle = child; @@ -19288,16 +19311,16 @@ function SvgCanvas(container, config) { } } } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; + _didIteratorError4 = true; + _iteratorError4 = err; } finally { try { - if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) { - _iterator3["return"](); + if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) { + _iterator4["return"](); } } finally { - if (_didIteratorError3) { - throw _iteratorError3; + if (_didIteratorError4) { + throw _iteratorError4; } } } @@ -20606,7 +20629,7 @@ function SvgCanvas(container, config) { canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true); return "continue"; } // only allow the transform/opacity/filter attribute to change on elements, slightly hacky - // TODO: FIXME: Missing statement body + // TODO: Missing statement body // if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {} @@ -21285,9 +21308,9 @@ function SvgCanvas(container, config) { this.moveToTopSelectedElement = function () { - var _selectedElements2 = selectedElements, - _selectedElements3 = _slicedToArray(_selectedElements2, 1), - selected = _selectedElements3[0]; + var _selectedElements = selectedElements, + _selectedElements2 = _slicedToArray(_selectedElements, 1), + selected = _selectedElements2[0]; if (!isNullish(selected)) { var t = selected; @@ -21312,9 +21335,9 @@ function SvgCanvas(container, config) { this.moveToBottomSelectedElement = function () { - var _selectedElements4 = selectedElements, - _selectedElements5 = _slicedToArray(_selectedElements4, 1), - selected = _selectedElements5[0]; + var _selectedElements3 = selectedElements, + _selectedElements4 = _slicedToArray(_selectedElements3, 1), + selected = _selectedElements4[0]; if (!isNullish(selected)) { var t = selected; @@ -21622,45 +21645,45 @@ function SvgCanvas(container, config) { var dx = new Array(len); var dy = new Array(len); - for (var _i7 = 0; _i7 < len; ++_i7) { - if (isNullish(selectedElements[_i7])) { + for (var _i6 = 0; _i6 < len; ++_i6) { + if (isNullish(selectedElements[_i6])) { break; } // const elem = selectedElements[i]; - var bbox = bboxes[_i7]; - dx[_i7] = 0; - dy[_i7] = 0; + var bbox = bboxes[_i6]; + dx[_i6] = 0; + dy[_i6] = 0; switch (type) { case 'l': // left (horizontal) - dx[_i7] = minx - bbox.x; + dx[_i6] = minx - bbox.x; break; case 'c': // center (horizontal) - dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2); + dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2); break; case 'r': // right (horizontal) - dx[_i7] = maxx - (bbox.x + bbox.width); + dx[_i6] = maxx - (bbox.x + bbox.width); break; case 't': // top (vertical) - dy[_i7] = miny - bbox.y; + dy[_i6] = miny - bbox.y; break; case 'm': // middle (vertical) - dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2); + dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2); break; case 'b': // bottom (vertical) - dy[_i7] = maxy - (bbox.y + bbox.height); + dy[_i6] = maxy - (bbox.y + bbox.height); break; } } @@ -22826,14 +22849,14 @@ function jQueryPluginSVGIcons($) { /** * * @param {boolean} [toImage] - * @param {external:jQuery.svgIcons.Fallback} [fallback] + * @param {external:jQuery.svgIcons.Fallback} [fallback=false] * @returns {void} */ function makeIcons() { var toImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - var fallback = arguments.length > 1 ? arguments[1] : undefined; + var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (iconsMade) return; if (opts.no_img) toImage = false; var tempHolder; @@ -30168,90 +30191,90 @@ editor.init = function () { }, 'div#workarea': { left: 38, - top: 74 // '#tools_bottom': { - // left: {s: '27px', l: '46px', xl: '65px'}, - // height: {s: '58px', l: '98px', xl: '145px'} - // }, - // '#color_tools': { - // 'border-spacing': {s: '0 1px'}, - // 'margin-top': {s: '-1px'} - // }, - // '#color_tools .icon_label': { - // width: {l:'43px', xl: '60px'} - // }, - // '.color_tool': { - // height: {s: '20px'} - // }, - // '#tool_opacity': { - // top: {s: '1px'}, - // height: {s: 'auto', l:'auto', xl:'auto'} - // }, - // '#tools_top input, #tools_bottom input': { - // 'margin-top': {s: '2px', l: '4px', xl: '5px'}, - // height: {s: 'auto', l: 'auto', xl: 'auto'}, - // border: {s: '1px solid #555', l: 'auto', xl: 'auto'}, - // 'font-size': {s: '.9em', l: '1.2em', xl: '1.4em'} - // }, - // '#zoom_panel': { - // 'margin-top': {s: '3px', l: '4px', xl: '5px'} - // }, - // '#copyright, #tools_bottom .label': { - // 'font-size': {l: '1.5em', xl: '2em'}, - // 'line-height': {s: '15px'} - // }, - // '#tools_bottom_2': { - // width: {l: '295px', xl: '355px'}, - // top: {s: '4px'} - // }, - // '#tools_top > div, #tools_top': { - // 'line-height': {s: '17px', l: '34px', xl: '50px'} - // }, - // '.dropdown button': { - // height: {s: '18px', l: '34px', xl: '40px'}, - // 'line-height': {s: '18px', l: '34px', xl: '40px'}, - // 'margin-top': {s: '3px'} - // }, - // '#tools_top label, #tools_bottom label': { - // 'font-size': {s: '1em', l: '1.5em', xl: '2em'}, - // height: {s: '25px', l: '42px', xl: '64px'} - // }, - // 'div.toolset': { - // height: {s: '25px', l: '42px', xl: '64px'} - // }, - // '#tool_bold, #tool_italic': { - // 'font-size': {s: '1.5em', l: '3em', xl: '4.5em'} - // }, - // '#sidepanels': { - // top: {s: '50px', l: '88px', xl: '125px'}, - // bottom: {s: '51px', l: '68px', xl: '65px'} - // }, - // '#layerbuttons': { - // width: {l: '130px', xl: '175px'}, - // height: {l: '24px', xl: '30px'} - // }, - // '#layerlist': { - // width: {l: '128px', xl: '150px'} - // }, - // '.layer_button': { - // width: {l: '19px', xl: '28px'}, - // height: {l: '19px', xl: '28px'} - // }, - // 'input.spin-button': { - // 'background-image': {l: 'url('images/spinbtn_updn_big.png')', xl: 'url('images/spinbtn_updn_big.png')'}, - // 'background-position': {l: '100% -5px', xl: '100% -2px'}, - // 'padding-right': {l: '24px', xl: '24px' } - // }, - // 'input.spin-button.up': { - // 'background-position': {l: '100% -45px', xl: '100% -42px'} - // }, - // 'input.spin-button.down': { - // 'background-position': {l: '100% -85px', xl: '100% -82px'} - // }, - // '#position_opts': { - // width: {all: (size_num*4) +'px'} - // } + top: 74 + } // '#tools_bottom': { + // left: {s: '27px', l: '46px', xl: '65px'}, + // height: {s: '58px', l: '98px', xl: '145px'} + // }, + // '#color_tools': { + // 'border-spacing': {s: '0 1px'}, + // 'margin-top': {s: '-1px'} + // }, + // '#color_tools .icon_label': { + // width: {l:'43px', xl: '60px'} + // }, + // '.color_tool': { + // height: {s: '20px'} + // }, + // '#tool_opacity': { + // top: {s: '1px'}, + // height: {s: 'auto', l:'auto', xl:'auto'} + // }, + // '#tools_top input, #tools_bottom input': { + // 'margin-top': {s: '2px', l: '4px', xl: '5px'}, + // height: {s: 'auto', l: 'auto', xl: 'auto'}, + // border: {s: '1px solid #555', l: 'auto', xl: 'auto'}, + // 'font-size': {s: '.9em', l: '1.2em', xl: '1.4em'} + // }, + // '#zoom_panel': { + // 'margin-top': {s: '3px', l: '4px', xl: '5px'} + // }, + // '#copyright, #tools_bottom .label': { + // 'font-size': {l: '1.5em', xl: '2em'}, + // 'line-height': {s: '15px'} + // }, + // '#tools_bottom_2': { + // width: {l: '295px', xl: '355px'}, + // top: {s: '4px'} + // }, + // '#tools_top > div, #tools_top': { + // 'line-height': {s: '17px', l: '34px', xl: '50px'} + // }, + // '.dropdown button': { + // height: {s: '18px', l: '34px', xl: '40px'}, + // 'line-height': {s: '18px', l: '34px', xl: '40px'}, + // 'margin-top': {s: '3px'} + // }, + // '#tools_top label, #tools_bottom label': { + // 'font-size': {s: '1em', l: '1.5em', xl: '2em'}, + // height: {s: '25px', l: '42px', xl: '64px'} + // }, + // 'div.toolset': { + // height: {s: '25px', l: '42px', xl: '64px'} + // }, + // '#tool_bold, #tool_italic': { + // 'font-size': {s: '1.5em', l: '3em', xl: '4.5em'} + // }, + // '#sidepanels': { + // top: {s: '50px', l: '88px', xl: '125px'}, + // bottom: {s: '51px', l: '68px', xl: '65px'} + // }, + // '#layerbuttons': { + // width: {l: '130px', xl: '175px'}, + // height: {l: '24px', xl: '30px'} + // }, + // '#layerlist': { + // width: {l: '128px', xl: '150px'} + // }, + // '.layer_button': { + // width: {l: '19px', xl: '28px'}, + // height: {l: '19px', xl: '28px'} + // }, + // 'input.spin-button': { + // 'background-image': {l: 'url('images/spinbtn_updn_big.png')', xl: 'url('images/spinbtn_updn_big.png')'}, + // 'background-position': {l: '100% -5px', xl: '100% -2px'}, + // 'padding-right': {l: '24px', xl: '24px' } + // }, + // 'input.spin-button.up': { + // 'background-position': {l: '100% -45px', xl: '100% -42px'} + // }, + // 'input.spin-button.down': { + // 'background-position': {l: '100% -85px', xl: '100% -82px'} + // }, + // '#position_opts': { + // width: {all: (size_num*4) +'px'} + // } - } }; var ruleElem = $$b('#tool_size_rules'); @@ -30755,7 +30778,7 @@ editor.init = function () { var num = 5 - $$b('#layerlist tr.layer').size(); while (num-- > 0) { - // FIXME: there must a better way to do this + // TODO: there must a better way to do this layerlist.append('_'); } }; diff --git a/dist/index-es.min.js b/dist/index-es.min.js index 14c461ab..8d6ee144 100644 --- a/dist/index-es.min.js +++ b/dist/index-es.min.js @@ -1,2 +1,2 @@ -function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(a,i){var o=e.apply(n,r);function s(e){t(o,a,i,s,l,"next",e)}function l(e){t(o,a,i,s,l,"throw",e)}s(void 0)})}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n]+)>/g,function(e,t){return"$"+n[t]}))}if("function"==typeof t){var i=this;return r[Symbol.replace].call(this,e,function(){var e=[];return e.push.apply(e,arguments),"object"!=typeof e[e.length-1]&&e.push(o(e,i)),t.apply(this,e)})}return r[Symbol.replace].call(this,e,t)},g.apply(this,arguments)}function m(e){var t=e.changedTouches,n=t[0],r="";switch(e.type){case"touchstart":r="mousedown";break;case"touchmove":r="mousemove";break;case"touchend":r="mouseup";break;default:return}var a=n.screenX,i=n.screenY,o=n.clientX,s=n.clientY,l=new MouseEvent(r,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:a,screenY:i,clientX:o,clientY:s,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});t.length<2&&(n.target.dispatchEvent(l),e.preventDefault())}document.addEventListener("touchstart",m,!0),document.addEventListener("touchmove",m,!0),document.addEventListener("touchend",m,!0),document.addEventListener("touchcancel",m,!0);var v={HTML:"http://www.w3.org/1999/xhtml",MATH:"http://www.w3.org/1998/Math/MathML",SE:"http://svg-edit.googlecode.com",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"},y=function(){var e={};return Object.entries(v).forEach(function(t){var n=p(t,2),r=n[0],a=n[1];e[a]=r.toLowerCase()}),e};!function(){if(!("SVGPathSeg"in window)){var e=function(){function e(t,n,a){r(this,e),this.pathSegType=t,this.pathSegTypeAsLetter=n,this._owningPathSegList=a}return i(e,[{key:"_segmentChanged",value:function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)}}]),e}();e.prototype.classname="SVGPathSeg",e.PATHSEG_UNKNOWN=0,e.PATHSEG_CLOSEPATH=1,e.PATHSEG_MOVETO_ABS=2,e.PATHSEG_MOVETO_REL=3,e.PATHSEG_LINETO_ABS=4,e.PATHSEG_LINETO_REL=5,e.PATHSEG_CURVETO_CUBIC_ABS=6,e.PATHSEG_CURVETO_CUBIC_REL=7,e.PATHSEG_CURVETO_QUADRATIC_ABS=8,e.PATHSEG_CURVETO_QUADRATIC_REL=9,e.PATHSEG_ARC_ABS=10,e.PATHSEG_ARC_REL=11,e.PATHSEG_LINETO_HORIZONTAL_ABS=12,e.PATHSEG_LINETO_HORIZONTAL_REL=13,e.PATHSEG_LINETO_VERTICAL_ABS=14,e.PATHSEG_LINETO_VERTICAL_REL=15,e.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,e.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19;var t=function(t){function n(t){return r(this,n),h(this,l(n).call(this,e.PATHSEG_CLOSEPATH,"z",t))}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegClosePath]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter}},{key:"clone",value:function(){return new n(void 0)}}]),n}(),n=function(t){function n(t,a,i){var o;return r(this,n),(o=h(this,l(n).call(this,e.PATHSEG_MOVETO_ABS,"M",t)))._x=a,o._y=i,o}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegMovetoAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}();Object.defineProperties(n.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var a=function(t){function n(t,a,i){var o;return r(this,n),(o=h(this,l(n).call(this,e.PATHSEG_MOVETO_REL,"m",t)))._x=a,o._y=i,o}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegMovetoRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}();Object.defineProperties(a.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var o=function(t){function n(t,a,i){var o;return r(this,n),(o=h(this,l(n).call(this,e.PATHSEG_LINETO_ABS,"L",t)))._x=a,o._y=i,o}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}();Object.defineProperties(o.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var c=function(t){function n(t,a,i){var o;return r(this,n),(o=h(this,l(n).call(this,e.PATHSEG_LINETO_REL,"l",t)))._x=a,o._y=i,o}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}();Object.defineProperties(c.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var u=function(t){function n(t,a,i,o,s,c,u){var d;return r(this,n),(d=h(this,l(n).call(this,e.PATHSEG_CURVETO_CUBIC_ABS,"C",t)))._x=a,d._y=i,d._x1=o,d._y1=s,d._x2=c,d._y2=u,d}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)}}]),n}();Object.defineProperties(u.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var d=function(t){function n(t,a,i,o,s,c,u){var d;return r(this,n),(d=h(this,l(n).call(this,e.PATHSEG_CURVETO_CUBIC_REL,"c",t)))._x=a,d._y=i,d._x1=o,d._y1=s,d._x2=c,d._y2=u,d}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)}}]),n}();Object.defineProperties(d.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var p=function(t){function n(t,a,i,o,s){var c;return r(this,n),(c=h(this,l(n).call(this,e.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",t)))._x=a,c._y=i,c._x1=o,c._y1=s,c}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x1,this._y1)}}]),n}();Object.defineProperties(p.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}});var f=function(t){function n(t,a,i,o,s){var c;return r(this,n),(c=h(this,l(n).call(this,e.PATHSEG_CURVETO_QUADRATIC_REL,"q",t)))._x=a,c._y=i,c._x1=o,c._y1=s,c}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x1,this._y1)}}]),n}();Object.defineProperties(f.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}});var g=function(t){function n(t,a,i,o,s,c,u,d){var p;return r(this,n),(p=h(this,l(n).call(this,e.PATHSEG_ARC_ABS,"A",t)))._x=a,p._y=i,p._r1=o,p._r2=s,p._angle=c,p._largeArcFlag=u,p._sweepFlag=d,p}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegArcAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)}}]),n}();Object.defineProperties(g.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},r1:{get:function(){return this._r1},set:function(e){this._r1=e,this._segmentChanged()},enumerable:!0},r2:{get:function(){return this._r2},set:function(e){this._r2=e,this._segmentChanged()},enumerable:!0},angle:{get:function(){return this._angle},set:function(e){this._angle=e,this._segmentChanged()},enumerable:!0},largeArcFlag:{get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag=e,this._segmentChanged()},enumerable:!0},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag=e,this._segmentChanged()},enumerable:!0}});var m=function(t){function n(t,a,i,o,s,c,u,d){var p;return r(this,n),(p=h(this,l(n).call(this,e.PATHSEG_ARC_REL,"a",t)))._x=a,p._y=i,p._r1=o,p._r2=s,p._angle=c,p._largeArcFlag=u,p._sweepFlag=d,p}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegArcRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)}}]),n}();Object.defineProperties(m.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},r1:{get:function(){return this._r1},set:function(e){this._r1=e,this._segmentChanged()},enumerable:!0},r2:{get:function(){return this._r2},set:function(e){this._r2=e,this._segmentChanged()},enumerable:!0},angle:{get:function(){return this._angle},set:function(e){this._angle=e,this._segmentChanged()},enumerable:!0},largeArcFlag:{get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag=e,this._segmentChanged()},enumerable:!0},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag=e,this._segmentChanged()},enumerable:!0}});var v=function(t){function n(t,a){var i;return r(this,n),(i=h(this,l(n).call(this,e.PATHSEG_LINETO_HORIZONTAL_ABS,"H",t)))._x=a,i}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoHorizontalAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x}},{key:"clone",value:function(){return new n(void 0,this._x)}}]),n}();Object.defineProperty(v.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0});var y=function(t){function n(t,a){var i;return r(this,n),(i=h(this,l(n).call(this,e.PATHSEG_LINETO_HORIZONTAL_REL,"h",t)))._x=a,i}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoHorizontalRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x}},{key:"clone",value:function(){return new n(void 0,this._x)}}]),n}();Object.defineProperty(y.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0});var _=function(t){function n(t,a){var i;return r(this,n),(i=h(this,l(n).call(this,e.PATHSEG_LINETO_VERTICAL_ABS,"V",t)))._y=a,i}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoVerticalAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._y)}}]),n}();Object.defineProperty(_.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0});var b=function(t){function n(t,a){var i;return r(this,n),(i=h(this,l(n).call(this,e.PATHSEG_LINETO_VERTICAL_REL,"v",t)))._y=a,i}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoVerticalRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._y)}}]),n}();Object.defineProperty(b.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0});var x=function(t){function n(t,a,i,o,s){var c;return r(this,n),(c=h(this,l(n).call(this,e.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",t)))._x=a,c._y=i,c._x2=o,c._y2=s,c}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x2,this._y2)}}]),n}();Object.defineProperties(x.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var w=function(t){function n(t,a,i,o,s){var c;return r(this,n),(c=h(this,l(n).call(this,e.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",t)))._x=a,c._y=i,c._x2=o,c._y2=s,c}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x2,this._y2)}}]),n}();Object.defineProperties(w.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var S=function(t){function n(t,a,i){var o;return r(this,n),(o=h(this,l(n).call(this,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",t)))._x=a,o._y=i,o}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}();Object.defineProperties(S.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var k=function(t){function n(t,a,i){var o;return r(this,n),(o=h(this,l(n).call(this,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",t)))._x=a,o._y=i,o}return s(n,e),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}();Object.defineProperties(k.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}}),SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new t(void 0)},SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(e,t){return new n(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegMovetoRel=function(e,t){return new a(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(e,t){return new o(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegLinetoRel=function(e,t){return new c(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(e,t,n,r,a,i){return new u(void 0,e,t,n,r,a,i)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(e,t,n,r,a,i){return new d(void 0,e,t,n,r,a,i)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(e,t,n,r){return new p(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(e,t,n,r){return new f(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegArcAbs=function(e,t,n,r,a,i,o){return new g(void 0,e,t,n,r,a,i,o)},SVGPathElement.prototype.createSVGPathSegArcRel=function(e,t,n,r,a,i,o){return new m(void 0,e,t,n,r,a,i,o)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(e){return new v(void 0,e)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(e){return new y(void 0,e)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(e){return new _(void 0,e)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(e){return new b(void 0,e)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(e,t,n,r){return new x(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(e,t,n,r){return new w(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(e,t){return new S(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(e,t){return new k(void 0,e,t)},"getPathSegAtLength"in SVGPathElement.prototype||(SVGPathElement.prototype.getPathSegAtLength=function(e){if(void 0===e||!isFinite(e))throw new Error("Invalid arguments.");var t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d",this.getAttribute("d"));var n=t.pathSegList.numberOfItems-1;if(n<=0)return 0;do{if(t.pathSegList.removeItem(n),e>t.getTotalLength())break;n--}while(n>0);return n}),window.SVGPathSeg=e,window.SVGPathSegClosePath=t,window.SVGPathSegMovetoAbs=n,window.SVGPathSegMovetoRel=a,window.SVGPathSegLinetoAbs=o,window.SVGPathSegLinetoRel=c,window.SVGPathSegCurvetoCubicAbs=u,window.SVGPathSegCurvetoCubicRel=d,window.SVGPathSegCurvetoQuadraticAbs=p,window.SVGPathSegCurvetoQuadraticRel=f,window.SVGPathSegArcAbs=g,window.SVGPathSegArcRel=m,window.SVGPathSegLinetoHorizontalAbs=v,window.SVGPathSegLinetoHorizontalRel=y,window.SVGPathSegLinetoVerticalAbs=_,window.SVGPathSegLinetoVerticalRel=b,window.SVGPathSegCurvetoCubicSmoothAbs=x,window.SVGPathSegCurvetoCubicSmoothRel=w,window.SVGPathSegCurvetoQuadraticSmoothAbs=S,window.SVGPathSegCurvetoQuadraticSmoothRel=k}if(!("SVGPathSegList"in window&&"appendItem"in window.SVGPathSegList.prototype)){var C=function(){function e(t){r(this,e),this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}return i(e,[{key:"_checkPathSynchronizedToList",value:function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())}},{key:"_updateListFromPathMutations",value:function(e){if(this._pathElement){var t=!1;e.forEach(function(e){"d"===e.attributeName&&(t=!0)}),t&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}}},{key:"_writeListToPath",value:function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",e._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}},{key:"segmentChanged",value:function(e){this._writeListToPath()}},{key:"clear",value:function(){this._checkPathSynchronizedToList(),this._list.forEach(function(e){e._owningPathSegList=null}),this._list=[],this._writeListToPath()}},{key:"initialize",value:function(e){return this._checkPathSynchronizedToList(),this._list=[e],e._owningPathSegList=this,this._writeListToPath(),e}},{key:"_checkValidIndex",value:function(e){if(isNaN(e)||e<0||e>=this.numberOfItems)throw new Error("INDEX_SIZE_ERR")}},{key:"getItem",value:function(e){return this._checkPathSynchronizedToList(),this._checkValidIndex(e),this._list[e]}},{key:"insertItemBefore",value:function(e,t){return this._checkPathSynchronizedToList(),t>this.numberOfItems&&(t=this.numberOfItems),e._owningPathSegList&&(e=e.clone()),this._list.splice(t,0,e),e._owningPathSegList=this,this._writeListToPath(),e}},{key:"replaceItem",value:function(e,t){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._checkValidIndex(t),this._list[t]=e,e._owningPathSegList=this,this._writeListToPath(),e}},{key:"removeItem",value:function(e){this._checkPathSynchronizedToList(),this._checkValidIndex(e);var t=this._list[e];return this._list.splice(e,1),this._writeListToPath(),t}},{key:"appendItem",value:function(e){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._list.push(e),e._owningPathSegList=this,this._writeListToPath(),e}},{key:"_parsePath",value:function(e){if(!e||!e.length)return[];var t=this,n=function(){function e(){r(this,e),this.pathSegList=[]}return i(e,[{key:"appendSegment",value:function(e){this.pathSegList.push(e)}}]),e}(),a=function(){function e(t){r(this,e),this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()}return i(e,[{key:"_isCurrentSpace",value:function(){var e=this._string[this._currentIndex];return e<=" "&&(" "===e||"\n"===e||"\t"===e||"\r"===e||"\f"===e)}},{key:"_skipOptionalSpaces",value:function(){for(;this._currentIndex="0"&&e<="9")&&t!==SVGPathSeg.PATHSEG_CLOSEPATH?t===SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:t===SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:t:SVGPathSeg.PATHSEG_UNKNOWN}},{key:"initialCommandIsMoveTo",value:function(){if(!this.hasMoreData())return!0;var e=this.peekSegmentType();return e===SVGPathSeg.PATHSEG_MOVETO_ABS||e===SVGPathSeg.PATHSEG_MOVETO_REL}},{key:"_parseNumber",value:function(){var e=0,t=0,n=1,r=0,a=1,i=1,o=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex"9")&&"."!==this._string.charAt(this._currentIndex))){for(var s=this._currentIndex;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!==s)for(var l=this._currentIndex-1,c=1;l>=s;)t+=c*(this._string.charAt(l--)-"0"),c*=10;if(this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)n*=10,r+=(this._string.charAt(this._currentIndex)-"0")/n,this._currentIndex+=1}if(this._currentIndex!==o&&this._currentIndex+1=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)e*=10,e+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var u=t+r;if(u*=a,e&&(u*=Math.pow(10,i*e)),o!==this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),u}}},{key:"_parseArcFlag",value:function(){if(!(this._currentIndex>=this._endIndex)){var e=!1,t=this._string.charAt(this._currentIndex++);if("0"===t)e=!1;else{if("1"!==t)return;e=!0}return this._skipOptionalSpacesOrDelimiter(),e}}},{key:"parseSegment",value:function(){var e=this._string[this._currentIndex],n=this._pathSegTypeFromChar(e);if(n===SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand===SVGPathSeg.PATHSEG_UNKNOWN)return null;if((n=this._nextCommandHelper(e,this._previousCommand))===SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=n,n){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(t);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(t,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var a={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(t,a.x,a.y,a.x1,a.y1,a.x2,a.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(t,i.x,i.y,i.x2,i.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var o={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(t,o.x,o.y,o.x2,o.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var s={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(t,s.x,s.y,s.x1,s.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var l={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(t,l.x,l.y,l.x1,l.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var c={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(t,c.x,c.y,c.x1,c.y1,c.arcAngle,c.arcLarge,c.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:var u={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(t,u.x,u.y,u.x1,u.y1,u.arcAngle,u.arcLarge,u.arcSweep);default:throw new Error("Unknown path seg type.")}}}]),e}(),o=new n,s=new a(e);if(!s.initialCommandIsMoveTo())return[];for(;s.hasMoreData();){var l=s.parseSegment();if(!l)return[];o.appendSegment(l)}return o.pathSegList}}],[{key:"_pathSegArrayAsString",value:function(e){var t="",n=!0;return e.forEach(function(e){n?(n=!1,t+=e._asPathString()):t+=" "+e._asPathString()}),t}}]),e}();C.prototype.classname="SVGPathSegList",Object.defineProperty(C.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperties(SVGPathElement.prototype,{pathSegList:{get:function(){return this._pathSegList||(this._pathSegList=new C(this)),this._pathSegList},enumerable:!0},normalizedPathSegList:{get:function(){return this.pathSegList},enumerable:!0},animatedPathSegList:{get:function(){return this.pathSegList},enumerable:!0},animatedNormalizedPathSegList:{get:function(){return this.pathSegList},enumerable:!0}}),window.SVGPathSegList=C}}();var _,b=jQuery,x=(Boolean(document.createElementNS&&document.createElementNS(v.SVG,"svg").createSVGRect),navigator.userAgent),w=document.createElementNS(v.SVG,"svg"),S=Boolean(window.opera),k=x.includes("AppleWebKit"),C=x.includes("Gecko/"),A=x.includes("MSIE"),E=x.includes("Chrome/"),G=(x.includes("Windows"),x.includes("Macintosh")),P="ontouchstart"in window,I=Boolean(w.querySelector),N=Boolean(document.evaluate),T=function(){var e=document.createElementNS(v.SVG,"path");e.setAttribute("d","M0,0 10,10");var t=e.pathSegList,n=e.createSVGPathSegLinetoAbs(5,5);try{return t.replaceItem(n,1),!0}catch(e){}return!1}(),L=function(){var e=document.createElementNS(v.SVG,"path");e.setAttribute("d","M0,0 10,10");var t=e.pathSegList,n=e.createSVGPathSegLinetoAbs(5,5);try{return t.insertItemBefore(n,1),!0}catch(e){}return!1}(),M=function(){var e=document.createElementNS(v.SVG,"svg"),t=document.createElementNS(v.SVG,"svg");document.documentElement.append(e),t.setAttribute("x",5),e.append(t);var n=document.createElementNS(v.SVG,"text");n.textContent="a",t.append(n);try{return 0===n.getStartPositionOfChar(0).x}catch(e){return!1}finally{e.remove()}}(),O=function(){var e=document.createElementNS(v.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(v.SVG,"path");t.setAttribute("d","M0,0 C0,0 10,10 10,0"),e.append(t);var n=t.getBBox();return e.remove(),n.height>4&&n.height<5}(),j=function(){var e=document.createElementNS(v.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(v.SVG,"path");t.setAttribute("d","M0,0 10,0");var n=document.createElementNS(v.SVG,"path");n.setAttribute("d","M5,0 15,0");var r=document.createElementNS(v.SVG,"g");r.append(t,n),e.append(r);var a=r.getBBox();return e.remove(),15===a.width}(),V=(function(){var e=document.createElementNS(v.SVG,"rect");e.setAttribute("x",.1);var t=!e.cloneNode(!1).getAttribute("x").includes(",");t||b.alert('NOTE: This version of Opera is known to contain bugs in SVG-edit.\nPlease upgrade to the latest version in which the problems have been fixed.')}(),(_=document.createElementNS(v.SVG,"rect")).setAttribute("style","vector-effect:non-scaling-stroke"),"non-scaling-stroke"===_.style.vectorEffect),R=function(){var t=document.createElementNS(v.SVG,"rect").transform.baseVal,n=w.createSVGTransform();t.appendItem(n);var r=t.getItem(0),a=function(t){return t&&"object"===e(t)&&"function"==typeof t.setMatrix&&"angle"in t};return a(r)&&a(n)&&r.type===n.type&&r.angle===n.angle&&r.matrix.a===n.matrix.a&&r.matrix.b===n.matrix.b&&r.matrix.c===n.matrix.c&&r.matrix.d===n.matrix.d&&r.matrix.e===n.matrix.e&&r.matrix.f===n.matrix.f}(),B=function(){return S},D=function(){return k},U=function(){return C},F=function(){return A},H=function(){return E},z=function(){return G},q=function(){return P},Y=function(){return j},W=function(){return V};function X(t){var n=t.fn.attr;return t.fn.attr=function(t,r){var a=this.length;if(!a)return n.call(this,t,r);for(var i=0;i -");var i=a.groups.nonWhitespace.split(/[, ]+/),o=f("abcdef"),s=Q.createSVGMatrix();Object.values(i).forEach(function(e,t){i[t]=parseFloat(e),"matrix"===n&&(s[o[t]]=i[t])});var l=Q.createSVGTransform(),c="set"+n.charAt(0).toUpperCase()+n.slice(1),u="matrix"===n?[s]:i;"scale"===n&&1===u.length?u.push(u[0]):"translate"===n&&1===u.length?u.push(0):"rotate"===n&&1===u.length&&u.push(0,0),l[c].apply(l,f(u)),e._list.appendItem(l)}()},this._removeFromOtherLists=function(e){e&&Object.values($).some(function(t){for(var n=0,r=t._xforms.length;n=0)return this._xforms[e];var t=new Error("DOMException with code=INDEX_SIZE_ERR");throw t.code=1,t}},{key:"insertItemBefore",value:function(e,t){var n=null;if(t>=0)if(t=0&&(this._removeFromOtherLists(e),this._xforms[t]=e,n=e,this._list._update()),n}},{key:"removeItem",value:function(e){if(e=0){var t,n=this._xforms[e],r=new Array(this.numberOfItems-1);for(t=0;t=0;t--)this.stack[t].unapply(e);e&&e.handleHistoryEvent(he.AFTER_UNAPPLY,this)}},{key:"elements",value:function(){for(var e=[],t=this.stack.length;t--;)for(var n=this.stack[t].elements(),r=n.length;r--;)e.includes(n[r])||e.push(n[r]);return e}},{key:"addSubCommand",value:function(e){this.stack.push(e)}},{key:"isEmpty",value:function(){return!this.stack.length}}]),t}();ye.type=ye.prototype.type;var _e,be,xe,we,Se,ke=function(){function e(t){r(this,e),this.handler_=t||null,this.undoStackPointer=0,this.undoStack=[],this.undoChangeStackPointer=-1,this.undoableChangeStack=[]}return i(e,[{key:"resetUndoStack",value:function(){this.undoStack=[],this.undoStackPointer=0}},{key:"getUndoStackSize",value:function(){return this.undoStackPointer}},{key:"getRedoStackSize",value:function(){return this.undoStack.length-this.undoStackPointer}},{key:"getNextUndoCommandText",value:function(){return this.undoStackPointer>0?this.undoStack[this.undoStackPointer-1].getText():""}},{key:"getNextRedoCommandText",value:function(){return this.undoStackPointer0&&this.undoStack[--this.undoStackPointer].unapply(this.handler_)}},{key:"redo",value:function(){this.undoStackPointer0&&this.undoStack[this.undoStackPointer++].apply(this.handler_)}},{key:"addCommandToHistory",value:function(e){this.undoStackPointer0&&(this.undoStack=this.undoStack.splice(0,this.undoStackPointer)),this.undoStack.push(e),this.undoStackPointer=this.undoStack.length}},{key:"beginUndoableChange",value:function(e,t){for(var n=++this.undoChangeStackPointer,r=t.length,a=new Array(r),i=new Array(r);r--;){var o=t[r];ln(o)||(i[r]=o,a[r]=o.getAttribute(e))}this.undoableChangeStack[n]={attrName:e,oldValues:a,elements:i}}},{key:"finishUndoableChange",value:function(){for(var e=this.undoChangeStackPointer--,t=this.undoableChangeStack[e],n=t.attrName,r=new ye("Change "+n),a=t.elements.length;a--;){var i=t.elements[a];if(!ln(i)){var o={};o[n]=t.oldValues[a],o[n]!==i.getAttribute(n)&&r.addSubCommand(new ve(i,o,n))}}return this.undoableChangeStack[e]=null,r}}]),e}(),Ce=Object.freeze({HistoryEventTypes:he,MoveElementCommand:fe,InsertElementCommand:ge,RemoveElementCommand:me,ChangeElementCommand:ve,BatchCommand:ye,UndoManager:ke}),Ae=document.createElementNS(v.SVG,"svg"),Ee=function(e,t,n){return{x:n.a*e+n.c*t+n.e,y:n.b*e+n.d*t+n.f}},Ge=function(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f},Pe=function(){for(var e=arguments.length,t=new Array(e),n=0;n(n=parseInt(n))){var r=n;n=t,t=r}for(var a=Ae.createSVGMatrix(),i=t;i<=n;++i){var o=i>=0&&ie.x&&t.ye.y},je=jQuery,Ve={2:["x","y"],4:["x","y"],6:["x","y","x1","y1","x2","y2"],8:["x","y","x1","y1"],10:["x","y","r1","r2","angle","largeArcFlag","sweepFlag"],12:["x"],14:["y"],16:["x","y","x2","y2"],18:["x","y"]},Re={},Be=function(e){Object.assign(Re,e.ui)},De=[],Ue=!0,Fe={},He=null,ze=null,qe=function(e){ze=e,De=[0,"ClosePath"];je.each(["Moveto","Lineto","CurvetoCubic","CurvetoQuadratic","Arc","LinetoHorizontal","LinetoVertical","CurvetoCubicSmooth","CurvetoQuadraticSmooth"],function(e,t){De.push(t+"Abs"),De.push(t+"Rel")})},Ye=function(e,t,n){var r=e.pathSegList;if(L)r.insertItemBefore(t,n);else{for(var a=r.numberOfItems,i=[],o=0;o0?(p=g element");this.elem=t,this.segs=[],this.selected_pts=[],He=this,this.init()}return i(e,[{key:"init",value:function(){je(Ze()).find("*").each(function(){je(this).attr("display","none")});var e=this.elem.pathSegList,t=e.numberOfItems;this.segs=[],this.selected_pts=[],this.first_seg=null;for(var n=0;n=t?null:i[s+1],u=s-1<0?null:i[s-1];if(2===l.type){if(u&&1!==u.type){var d=i[o];d.next=i[o+1],d.next.prev=d,d.addGrip()}o=s}else if(c&&1===c.type)l.next=i[o+1],l.next.prev=l,l.mate=i[o],l.addGrip(),ln(this.first_seg)&&(this.first_seg=l);else if(c)1!==l.type&&(l.addGrip(),c&&2!==c.type&&(l.next=c,l.next.prev=l));else if(1!==l.type){var h=i[o];h.next=i[o+1],h.next.prev=h,h.addGrip(),l.addGrip(),this.first_seg||(this.first_seg=i[o])}}return this}},{key:"eachSeg",value:function(e){for(var t=this.segs.length,n=0;n=0&&n.selected_pts.push(e)}),this.selected_pts.sort();var r=this.selected_pts.length,a=[];for(a.length=r;r--;){var i=this.selected_pts[r],o=this.segs[i];o.select(!0),a[r]=o.ptgrip}var s=e.subpathIsClosed(this.selected_pts[0]);ze.addPtsToSelection({grips:a,closedSubpath:s})}}],[{key:"subpathIsClosed",value:function(e){var t=!1;return He.eachSeg(function(n){return n<=e||2!==this.type&&(1!==this.type||(t=!0,!1))}),t}}]),e}(),ot=function(e){var t=Fe[e.id];return t||(t=Fe[e.id]=new it(e)),t},st=function(e){e in Fe&&delete Fe[e]},lt=function(e,t){var n=e-xe,r=t-we,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)+Se;return n=a*Math.cos(i)+xe,r=a*Math.sin(i)+we,n-=_e,r-=be,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)-Se,{x:a*Math.cos(i)+_e,y:a*Math.sin(i)+be}},ct=function(){var e=He.elem;if(Se=en(e,!0)){var t=He.oldbbox;xe=t.x+t.width/2,we=t.y+t.height/2;var n=Ht(e);_e=n.x+n.width/2,be=n.y+n.height/2;var r=_e-xe,a=be-we,i=Math.sqrt(r*r+a*a),o=Math.atan2(a,r)+Se;_e=i*Math.cos(o)+xe,be=i*Math.sin(o)+we;for(var s=e.pathSegList,l=s.numberOfItems;l;){l-=1;var c=s.getItem(l),u=c.pathSegType;if(1!==u){var d=lt(c.x,c.y),h=[d.x,d.y];if(!ln(c.x1)&&!ln(c.x2)){var p=lt(c.x1,c.y1),f=lt(c.x2,c.y2);h.splice(h.length,0,p.x,p.y,f.x,f.y)}tt(u,l,h)}}Ht(e);var g=ze.getSVGRoot().createSVGTransform(),m=te(e);g.setRotate(180*Se/Math.PI,_e,be),m.replaceItem(g,0)}},ut=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],dt=function(e,t){for(var n=e.pathSegList,r=n.numberOfItems,a=0,i=0,o="",s=null,l=0;l=C-w&&f<=C+w&&g>=A-w&&g<=A+w){S=!0;break}}a=ze.getId(),st(a);var E,G,P=nn(a),I=b.numberOfItems;if(S){if(x<=1&&I>=2){var N=b.getItem(0).x,T=b.getItem(0).y;E=4===(G=m.pathSegList.getItem(1)).pathSegType?_.createSVGPathSegLinetoAbs(N,T):_.createSVGPathSegCurvetoCubicAbs(N,T,G.x1/p,G.y1/p,N,T);var L=_.createSVGPathSegClosePath();b.appendItem(E),b.appendItem(L)}else if(I<3)return!1;if(je(m).remove(),ze.setDrawnPath(null),ze.setStarted(!1),gt){He.matrix&&ze.remapElement(P,{},He.matrix.inverse());var M=P.getAttribute("d"),O=je(He.elem).attr("d");return je(He.elem).attr("d",O+M),je(P).remove(),He.matrix&&ct(),qe(),yt.toEditMode(He.elem),He.selectPt(),!1}}else{if(!je.contains(ze.getContainer(),ze.getMouseTarget(e)))return!1;var j=_.pathSegList.numberOfItems,V=_.pathSegList.getItem(j-1),R=V.x,B=V.y;if(e.shiftKey){var D=Me(R,B,f,g);f=D.x,g=D.y}E=4===(G=m.pathSegList.getItem(1)).pathSegType?_.createSVGPathSegLinetoAbs(ze.round(f),ze.round(g)):_.createSVGPathSegCurvetoCubicAbs(ze.round(f),ze.round(g),G.x1/p,G.y1/p,G.x2/p,G.y2/p),_.pathSegList.appendItem(E),f*=p,g*=p,m.setAttribute("d",["M",f,g,f,g].join(" ")),y=j,gt&&(y+=He.segs.length),Ke(y,f,g)}}else{var U="M"+f+","+g+" ";ze.setDrawnPath(ze.addSVGElementFromJson({element:"path",curStyles:!0,attr:{d:U,id:ze.getNextId(),opacity:ze.getOpacity()/2}})),m.setAttribute("d",["M",d,h,d,h].join(" ")),y=gt?He.segs.length:0,Ke(y,d,h)}}},mouseMove:function(e,t){var n=ze.getCurrentZoom();vt=!0;var r=ze.getDrawnPath();if("path"!==ze.getCurrentMode())if(He.dragging){var a=Qe({x:He.dragging[0],y:He.dragging[1]},He),i=Qe({x:e,y:t},He),o=i.x-a.x,s=i.y-a.y;He.dragging=[e,t],He.dragctrl?He.moveCtrl(o,s):He.movePts(o,s)}else He.selected_pts=[],He.eachSeg(function(e){if(this.next||this.prev){var t=ze.getRubberBox().getBBox(),n=Xe(this),r={x:n.x,y:n.y,width:0,height:0},a=Oe(t,r);this.select(a),a&&He.selected_pts.push(this.index)}});else{if(!r)return;var l=r.pathSegList,c=l.numberOfItems-1;if(pt){var u=$e("1c1"),d=$e("0c2");u.setAttribute("cx",e),u.setAttribute("cy",t),u.setAttribute("display","inline");var h=pt[0],p=pt[1],f=h+(h-e/n),g=p+(p-t/n);d.setAttribute("cx",f*n),d.setAttribute("cy",g*n),d.setAttribute("display","inline");var m=Je(1);if(rn(m,{x1:e,y1:t,x2:f*n,y2:g*n,display:"inline"}),0===c)ft=[e,t];else{var v=l.getItem(c-1),y=v.x,_=v.y;6===v.pathSegType?(y+=y-v.x2,_+=_-v.y2):ft&&(y=ft[0]/n,_=ft[1]/n),tt(6,c,[h,p,y,_,f,g],r)}}else{var b=nn("path_stretch_line");if(b){var x=l.getItem(c);if(6===x.pathSegType){var w=x.x+(x.x-x.x2),S=x.y+(x.y-x.y2);tt(6,1,[e,t,w*n,S*n,e,t],b)}else ft?tt(6,1,[e,t,ft[0],ft[1],e,t],b):tt(4,1,[e,t],b)}}}},mouseUp:function(e,t,n,r){var a=ze.getDrawnPath();if("path"===ze.getCurrentMode())return pt=null,a||(t=nn(ze.getId()),ze.setStarted(!1),ft=null),{keep:!0,element:t};var i=ze.getRubberBox();if(He.dragging){var o=He.cur_pt;He.dragging=!1,He.dragctrl=!1,He.update(),vt&&He.endChanges("Move path point(s)"),e.shiftKey||vt||He.selectPt(o)}else i&&"none"!==i.getAttribute("display")?(i.setAttribute("display","none"),i.getAttribute("width")<=2&&i.getAttribute("height")<=2&&yt.toSelectMode(e.target)):yt.toSelectMode(e.target);vt=!1},toEditMode:function(e){He=ot(e),ze.setCurrentMode("pathedit"),ze.clearSelection(),He.show(!0).update(),He.oldbbox=Ht(He.elem),gt=!1},toSelectMode:function(e){var t=e===He.elem;ze.setCurrentMode("select"),He.show(!1),mt=!1,ze.clearSelection(),He.matrix&&ct(),t&&(ze.call("selected",[e]),ze.addToSelection([e],!0))},addSubPath:function(e){e?(ze.setCurrentMode("path"),gt=!0):(yt.clear(!0),yt.toEditMode(He.elem))},select:function(e){mt===e?(yt.toEditMode(e),ze.setCurrentMode("pathedit")):mt=e},reorient:function(){var e=ze.getSelectedElements()[0];if(e&&0!==en(e)){var t=new ye("Reorient path"),n={d:e.getAttribute("d"),transform:e.getAttribute("transform")};t.addSubCommand(new ve(e,n)),ze.clearSelection(),this.resetOrientation(e),ze.addCommandToHistory(t),ot(e).show(!1).matrix=null,this.clear(),ze.addToSelection([e],!0),ze.call("changed",ze.getSelectedElements())}},clear:function(e){var t=ze.getDrawnPath();if(mt=null,t){var n=nn(ze.getId());je(nn("path_stretch_line")).remove(),je(n).remove(),je(nn("pathpointgrip_container")).find("*").attr("display","none"),ft=null,ze.setDrawnPath(null),ze.setStarted(!1)}else"pathedit"===ze.getCurrentMode()&&this.toSelectMode();He&&He.init().show(!1)},resetOrientation:function(e){if(ln(e)||"path"!==e.nodeName)return!1;var t=te(e),n=Te(t).matrix;t.clear(),e.removeAttribute("transform");for(var r=e.pathSegList,a=r.numberOfItems,i=function(t){var a=r.getItem(t),i=a.pathSegType;if(1===i)return"continue";var o=[];je.each(["",1,2],function(e,t){var r=a["x"+t],i=a["y"+t];if(void 0!==r&&void 0!==i){var s=Ee(r,i,n);o.splice(o.length,0,s.x,s.y)}}),tt(i,t,o,e)},o=0;o0){var s=t.getItem(n-1).pathSegType;if(2===s){r(n-1,1),e();break}if(1===s&&t.numberOfItems-1===n){r(n,1),e();break}}}return!1}(),He.elem.pathSegList.numberOfItems<=1)return yt.toSelectMode(He.elem),void ze.canvas.deleteSelectedElements();if(He.init(),He.clearSelection(),window.opera){var r=je(He.elem);r.attr("d",r.attr("d"))}He.endChanges("Delete path node(s)")}},smoothPolylineIntoPath:function(e){var t,n=e.points,r=n.numberOfItems;if(r>=4){var a=n.getItem(0),i=null,o=[];for(o.push(["M",a.x,",",a.y," C"].join("")),t=1;t<=r-4;t+=3){var s=n.getItem(t),l=n.getItem(t+1),c=n.getItem(t+2);if(i){var u=rt(i,s,a);if(u&&2===u.length){var d=o[o.length-1].split(",");d[2]=u[0].x,d[3]=u[0].y,o[o.length-1]=d.join(","),s=u[1]}}o.push([s.x,s.y,l.x,l.y,c.x,c.y].join(",")),a=c,i=l}for(o.push("L");t)/,{doctypeOpen:1,doctypeClose:2}),"$$")},Et=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")};function Gt(e){if(e=Nt(e),window.btoa)return window.btoa(e);var t=new Array(4*Math.floor((e.length+2)/3)),n=0,r=0;do{var a=e.charCodeAt(n++),i=e.charCodeAt(n++),o=e.charCodeAt(n++),s=a>>2,l=(3&a)<<4|i>>4,c=(15&i)<<2|o>>6,u=63&o;isNaN(i)?(c=64,u=64):isNaN(o)&&(u=64),t[r++]=bt.charAt(s),t[r++]=bt.charAt(l),t[r++]=bt.charAt(c),t[r++]=bt.charAt(u)}while(n>4,l=(15&a)<<4|i>>2,c=(3&i)<<6|o;t+=String.fromCharCode(s),64!==i&&(t+=String.fromCharCode(l)),64!==o&&(t+=String.fromCharCode(c))}while(nSVG-edit "],{type:"text/html"});return Lt(e)}(),Ot=function(e){var t,n;e.includes("0?t=t[0]:(t=e.ownerDocument.createElementNS(v.SVG,"defs"),e.firstChild?e.insertBefore(t,e.firstChild.nextSibling):e.append(t)),t},Ut=function(e){for(var t=e.pathSegList,n=t.numberOfItems,r=[[],[]],a=t.getItem(0),i=[a.x,a.y],o=function(e,t,n,r){return function(a){return 1-Math.pow(a,3)*i[e]+3-Math.pow(a,2)*a*t[e]+3*(1-a)*Math.pow(a,2)*n[e]+Math.pow(a,3)*r[e]}},s=0;s0&&y<1&&r[h].push(p(y));var _=(-f-Math.sqrt(v))/(2*g);_>0&&_<1&&r[h].push(p(_))}}else{if(0===f)continue;var b=-m/f;b>0&&b<1&&r[h].push(p(b))}}i=d}else r[0].push(l.x),r[1].push(l.y)}var x=Math.min.apply(null,r[0]),w=Math.max.apply(null,r[0])-x,S=Math.min.apply(null,r[1]);return{x:x,y:S,width:w,height:Math.max.apply(null,r[1])-S}};function Ft(e){if(Y())try{return e.getBBox()}catch(e){}var t,n,r=_t.data(e,"ref"),a=null;r?(n=_t(r).children().clone().attr("visibility","hidden"),_t(Ct).append(n),a=n.filter("line, path")):a=_t(e).find("line, path");var i=!1;if(a.length)if(a.each(function(){var e=this.getBBox();e.width&&e.height||(i=!0)}),i){var o=r?n:_t(e).children();t=Kt(o)}else t=e.getBBox();else t=e.getBBox();return r&&n.remove(),t}var Ht=function(e){var t=e||wt.geSelectedElements()[0];if(1!==e.nodeType)return null;var n,r=t.nodeName,a=null;switch(r){case"text":""===t.textContent?(t.textContent="a",a=t.getBBox(),t.textContent=""):t.getBBox&&(a=t.getBBox());break;case"path":O?t.getBBox&&(a=t.getBBox()):a=Ut(t);break;case"g":case"a":a=Ft(t);break;default:if("use"===r&&(a=Ft(t)),"use"===r||"foreignObject"===r&&D()){if(a||(a=t.getBBox()),!D()){var i=a,o=i.x,s=i.y;a={width:i.width,height:i.height,x:o+parseFloat(t.getAttribute("x")||0),y:s+parseFloat(t.getAttribute("y")||0)}}}else if(xt.includes(r))if(t)try{a=t.getBBox()}catch(e){var l=t.getExtentOfChar(0),c=t.getComputedTextLength();a={x:l.x,y:l.y,width:c,height:l.height}}else{var u=_t(t).closest("foreignObject");u.length&&u[0].getBBox&&(a=u[0].getBBox())}}return a&&(a={x:(n=a).x,y:n.y,width:n.width,height:n.height}),a},zt=function(e){var t="";return _t.each(e,function(e,n){var r=p(n,2),a=r[0],i=r[1];t+=a;for(var o=0;o-.001&&n<.001||n<-89.99||n>89.99)}(i,o)){if(["ellipse","path","line","polyline","polygon"].includes(e.tagName))r=s=Wt(e,t,n);else if("rect"===e.tagName){var l=e.getAttribute("rx"),c=e.getAttribute("ry");(l||c)&&(r=s=Wt(e,t,n))}}if(!s){var u=Te(a).matrix;r=Ne(r.x,r.y,r.width,r.height,u).aabox}}return r};function Qt(e){var t=e.getAttribute("stroke-width");return isNaN(t)||"none"===e.getAttribute("stroke")?0:t/2}var Kt=function(e,t,n){if(!e||!e.length)return!1;var r;if(_t.each(e,function(){r||this.parentNode&&(r=Xt(this,t,n))}),void 0===r)return null;var a=r.x+r.width,i=r.y+r.height,o=r.x,s=r.y;if(1===e.length){var l=Qt(e[0]);o-=l,s-=l,a+=l,i+=l}else _t.each(e,function(e,r){var l=Xt(r,t,n);if(l){var c=Qt(r);o=Math.min(o,l.x-c),s=Math.min(s,l.y-c),1===r.nodeType&&(a=Math.max(a,l.x+l.width+c),i=Math.max(i,l.y+l.height+c))}});return r.x=o,r.y=s,r.width=a-o,r.height=i-s,r},Zt=function(e){e||(e=_t(wt.getSVGContent()).children());var t=[];return _t(e).children().each(function(e,n){n.getBBox&&t.push(n)}),t.reverse()},$t=function(e){return e||(e=Zt()),Kt(e,wt.addSVGElementFromJson,wt.pathActions)},Jt=function(e,t){if(!e)return 0;for(var n=e.numberOfItems,r=0;r");var t=e.shortcut||"";cn("#cmenu_canvas").append("
  • "+e.label+""+t+"
  • ")}(e)})};function hn(e,t){["id","class","type"].forEach(function(n){n in t&&(e[n]=t[n])})}function pn(e,t){return fn(e,o({},t,{returnDefault:!0}))}function fn(e,t){return gn.apply(this,arguments)}function gn(){return(gn=n(regeneratorRuntime.mark(function e(t,n){var r,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.global,a=n.returnDefault,!!("svgEditor"in window&&window.svgEditor&&!1===window.svgEditor.modules)){e.next=4;break}return e.abrupt("return",vn(t,void 0,{returnDefault:a}));case 4:return e.next=6,mn(t);case 6:return e.abrupt("return",window[r]);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function mn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)?Promise.all(e.map(function(e){return mn(e,t)})):new Promise(function(n,r){var a=document.createElement("script");function i(){r(new Error("Failed to import: ".concat(e))),s()}function o(){n(),s()}var s=function(){a.removeEventListener("error",i),a.removeEventListener("load",o),a.remove(),a.src=""};a.defer="defer",hn(a,t),a.addEventListener("error",i),a.addEventListener("load",o),a.src=e,document.head.append(a)})}function vn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).returnDefault,r=void 0!==n&&n;return Array.isArray(e)?Promise.all(e.map(function(e){return vn(e,t)})):new Promise(function(n,a){var i="$importModule$"+Math.random().toString(32).slice(2),o=document.createElement("script");function s(){a(new Error("Failed to import: ".concat(e))),c()}function l(){n(window[i]),c()}var c=function(){delete window[i],o.removeEventListener("error",s),o.removeEventListener("load",l),o.remove(),URL.revokeObjectURL(o.src),o.src=""};hn(o,t),o.defer="defer",o.type="module",o.addEventListener("error",s),o.addEventListener("load",l);var u=function(e){var t=document.createElement("a");return t.setAttribute("href",e),t.cloneNode(!1).href}(e),d="import * as m from '".concat(u.replace(/'/g,"\\'"),"'; window.").concat(i," = ").concat(r?"m.default || ":"","m;"),h=new Blob([d],{type:"text/javascript"});o.src=URL.createObjectURL(h),document.head.append(o)})}function yn(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ok:"Ok",cancel:"Cancel"};t("#dialog_container").draggable({cancel:"#dialog_content, #dialog_buttons *",containment:"window"}).css("position","absolute");var r=t("#dialog_box"),a=t("#dialog_buttons"),i=t("#dialog_content");function o(o,s,l,c,u,d){i.html("

    "+s.replace(/\n/g,"

    ")+"

    ").toggleClass("prompt","prompt"===o),a.empty();var h=t('').appendTo(a);return new Promise(function(p,f){var g,m;if("alert"!==o&&t('').appendTo(a).click(function(){r.hide(),p(!1)}),"prompt"===o)(g=t('').prependTo(a)).val(l||""),g.bind("keydown","return",function(){h.click()});else if("select"===o){var v=t('
    ');if(g=t('').appendTo(y)).val(d.value),d.tooltip&&y.attr("title",d.tooltip),m.prop("checked",Boolean(d.checked)),v.append(t("
    ").append(y))}t.each(c||[],function(n,r){"object"===e(r)?g.append(t("