diff --git a/CHANGES.md b/CHANGES.md
index 5740009d..44e77e00 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -11,6 +11,7 @@
- Optimization: Re-rerun image optimization per update
- Linting (ESLint): Adjust per now applied rules
- Linting (ESLint): Add HTML files to linting
+- Linting (ESLint): Avoid shadowing
- Refactoring: Use `static` keyword for classes
- Testing: Accessibility test API update
- Docs: Clarify need for Node.js/npm being installed
diff --git a/dist/index-es.js b/dist/index-es.js
index 3443a268..08717148 100644
--- a/dist/index-es.js
+++ b/dist/index-es.js
@@ -29262,7 +29262,7 @@ function _loadSvgString() {
_loadSvgString = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee23(str) {
- var _ref45,
+ var _ref46,
noAlert,
success,
_args23 = arguments;
@@ -29271,7 +29271,7 @@ function _loadSvgString() {
while (1) {
switch (_context23.prev = _context23.next) {
case 0:
- _ref45 = _args23.length > 1 && _args23[1] !== undefined ? _args23[1] : {}, noAlert = _ref45.noAlert;
+ _ref46 = _args23.length > 1 && _args23[1] !== undefined ? _args23[1] : {}, noAlert = _ref46.noAlert;
success = svgCanvas.setSvgString(str) !== false;
if (!success) {
@@ -31053,8 +31053,8 @@ editor.init = function () {
_promptImgURL = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee18() {
- var _ref31,
- _ref31$cancelDeletes,
+ var _ref32,
+ _ref32$cancelDeletes,
cancelDeletes,
curhref,
url,
@@ -31064,7 +31064,7 @@ editor.init = function () {
while (1) {
switch (_context18.prev = _context18.next) {
case 0:
- _ref31 = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {}, _ref31$cancelDeletes = _ref31.cancelDeletes, cancelDeletes = _ref31$cancelDeletes === void 0 ? false : _ref31$cancelDeletes;
+ _ref32 = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {}, _ref32$cancelDeletes = _ref32.cancelDeletes, cancelDeletes = _ref32$cancelDeletes === void 0 ? false : _ref32$cancelDeletes;
curhref = svgCanvas.getHref(selectedElement);
curhref = curhref.startsWith('data:') ? '' : curhref;
_context18.next = 5;
@@ -36365,75 +36365,83 @@ editor.init = function () {
workarea[0].addEventListener('dragover', onDragOver);
workarea[0].addEventListener('dragleave', onDragLeave);
workarea[0].addEventListener('drop', importImage);
- var open = $$b('').click(
+ var open = $$b('').change(
/*#__PURE__*/
- _asyncToGenerator(
- /*#__PURE__*/
- regeneratorRuntime.mark(function _callee16() {
- var ok, reader;
- return regeneratorRuntime.wrap(function _callee16$(_context16) {
- while (1) {
- switch (_context16.prev = _context16.next) {
- case 0:
- _context16.next = 2;
- return editor.openPrep();
+ function () {
+ var _ref28 = _asyncToGenerator(
+ /*#__PURE__*/
+ regeneratorRuntime.mark(function _callee16(e) {
+ var ok, reader;
+ return regeneratorRuntime.wrap(function _callee16$(_context16) {
+ while (1) {
+ switch (_context16.prev = _context16.next) {
+ case 0:
+ _context16.next = 2;
+ return editor.openPrep();
- case 2:
- ok = _context16.sent;
+ case 2:
+ ok = _context16.sent;
- if (ok) {
- _context16.next = 5;
- break;
- }
+ if (ok) {
+ _context16.next = 5;
+ break;
+ }
- return _context16.abrupt("return");
+ return _context16.abrupt("return");
- case 5:
- svgCanvas.clear();
+ case 5:
+ svgCanvas.clear();
- if (this.files.length === 1) {
- $$b.process_cancel(uiStrings$1.notification.loadingImage);
- reader = new FileReader();
+ if (this.files.length === 1) {
+ $$b.process_cancel(uiStrings$1.notification.loadingImage);
+ reader = new FileReader();
- reader.onloadend =
- /*#__PURE__*/
- function () {
- var _ref29 = _asyncToGenerator(
+ reader.onloadend =
/*#__PURE__*/
- regeneratorRuntime.mark(function _callee15(e) {
- return regeneratorRuntime.wrap(function _callee15$(_context15) {
- while (1) {
- switch (_context15.prev = _context15.next) {
- case 0:
- _context15.next = 2;
- return loadSvgString(e.target.result);
+ function () {
+ var _ref30 = _asyncToGenerator(
+ /*#__PURE__*/
+ regeneratorRuntime.mark(function _callee15(_ref29) {
+ var target;
+ return regeneratorRuntime.wrap(function _callee15$(_context15) {
+ while (1) {
+ switch (_context15.prev = _context15.next) {
+ case 0:
+ target = _ref29.target;
+ _context15.next = 3;
+ return loadSvgString(target.result);
- case 2:
- updateCanvas();
+ case 3:
+ updateCanvas();
- case 3:
- case "end":
- return _context15.stop();
+ case 4:
+ case "end":
+ return _context15.stop();
+ }
}
- }
- }, _callee15);
- }));
+ }, _callee15);
+ }));
- return function (_x6) {
- return _ref29.apply(this, arguments);
- };
- }();
+ return function (_x7) {
+ return _ref30.apply(this, arguments);
+ };
+ }();
- reader.readAsText(this.files[0]);
- }
+ reader.readAsText(this.files[0]);
+ }
- case 7:
- case "end":
- return _context16.stop();
+ case 7:
+ case "end":
+ return _context16.stop();
+ }
}
- }
- }, _callee16, this);
- })));
+ }, _callee16, this);
+ }));
+
+ return function (_x6) {
+ return _ref28.apply(this, arguments);
+ };
+ }());
$$b('#tool_open').show().prepend(open);
var imgImport = $$b('').change(importImage);
$$b('#tool_import').show().prepend(imgImport);
@@ -36456,7 +36464,7 @@ editor.init = function () {
var setLang = editor.setLang =
/*#__PURE__*/
function () {
- var _ref30 = _asyncToGenerator(
+ var _ref31 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee17(lang, allStrings) {
var oldLayerName, renameLayer, elems;
@@ -36564,8 +36572,8 @@ editor.init = function () {
}, _callee17);
}));
- return function (_x7, _x8) {
- return _ref30.apply(this, arguments);
+ return function (_x8, _x9) {
+ return _ref31.apply(this, arguments);
};
}();
@@ -36659,9 +36667,9 @@ regeneratorRuntime.mark(function _callee20() {
case 0:
_context20.prev = 0;
_context20.next = 3;
- return Promise.all(callbacks.map(function (_ref33) {
- var _ref34 = _slicedToArray(_ref33, 1),
- cb = _ref34[0];
+ return Promise.all(callbacks.map(function (_ref34) {
+ var _ref35 = _slicedToArray(_ref34, 1),
+ cb = _ref35[0];
return cb(); // eslint-disable-line promise/prefer-await-to-callbacks
}));
@@ -36673,18 +36681,18 @@ regeneratorRuntime.mark(function _callee20() {
case 5:
_context20.prev = 5;
_context20.t0 = _context20["catch"](0);
- callbacks.forEach(function (_ref35) {
- var _ref36 = _slicedToArray(_ref35, 3),
- reject = _ref36[2];
+ callbacks.forEach(function (_ref36) {
+ var _ref37 = _slicedToArray(_ref36, 3),
+ reject = _ref37[2];
reject();
});
throw _context20.t0;
case 9:
- callbacks.forEach(function (_ref37) {
- var _ref38 = _slicedToArray(_ref37, 2),
- resolve = _ref38[1];
+ callbacks.forEach(function (_ref38) {
+ var _ref39 = _slicedToArray(_ref38, 2),
+ resolve = _ref39[1];
resolve();
});
@@ -36705,8 +36713,8 @@ regeneratorRuntime.mark(function _callee20() {
*/
editor.loadFromString = function (str) {
- var _ref39 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- noAlert = _ref39.noAlert;
+ var _ref40 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ noAlert = _ref40.noAlert;
return editor.ready(
/*#__PURE__*/
@@ -36776,9 +36784,9 @@ editor.disableUI = function (featList) {// $(function () {
editor.loadFromURL = function (url) {
- var _ref41 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- cache = _ref41.cache,
- noAlert = _ref41.noAlert;
+ var _ref42 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ cache = _ref42.cache,
+ noAlert = _ref42.noAlert;
return editor.ready(function () {
return new Promise(function (resolve, reject) {
@@ -36827,8 +36835,8 @@ editor.loadFromURL = function (url) {
editor.loadFromDataURI = function (str) {
- var _ref42 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- noAlert = _ref42.noAlert;
+ var _ref43 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ noAlert = _ref43.noAlert;
return editor.ready(function () {
var base64 = false;
@@ -36885,9 +36893,9 @@ var messageQueue = [];
* @returns {void}
*/
-var messageListener = function messageListener(_ref43) {
- var data = _ref43.data,
- origin = _ref43.origin;
+var messageListener = function messageListener(_ref44) {
+ var data = _ref44.data,
+ origin = _ref44.origin;
// eslint-disable-line no-shadow
// console.log('data, origin, extensionsAdded', data, origin, extensionsAdded);
var messageObj = {
diff --git a/dist/index-es.min.js b/dist/index-es.min.js
index 1b899a98..14c461ab 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