diff --git a/.eslintrc.js b/.eslintrc.js
index 93a3cbb5..2558a110 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -144,7 +144,6 @@ module.exports = {
complexity: ["off"],
"default-case": ["off"],
"require-unicode-regexp": ["off"],
- "no-console": ["off"],
"no-magic-numbers": ["off"],
"no-warning-comments": ["off"],
"max-len": ["off", {
diff --git a/CHANGES.md b/CHANGES.md
index 92ba234e..d4c04b5e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -2,8 +2,8 @@
# ?
-- l10n: Add Chinese (simplified) extension locales (Thanks, @enlove!)
-- Linting (ESLint): Avoid reporting `no-console`
+- Fix: Problem with retaining lines with grid mode (@NeiroNx)
+- l10n: Add Chinese (simplified) extension locales (@enlove)
- Refactoring: Avoid Firefox console errors with hidden iframe
## 4.1.0
diff --git a/dist/extensions/ext-arrows.js b/dist/extensions/ext-arrows.js
index 94908b34..ce286777 100644
--- a/dist/extensions/ext-arrows.js
+++ b/dist/extensions/ext-arrows.js
@@ -352,9 +352,11 @@ var svgEditorExtension_arrows = (function () {
}, _callee, this);
}));
- return function addLangData(_x2) {
+ function addLangData(_x2) {
return _addLangData.apply(this, arguments);
- };
+ }
+
+ return addLangData;
}(),
selectedChanged: function selectedChanged(opts) {
// Use this to update the current selected elements
@@ -397,9 +399,11 @@ var svgEditorExtension_arrows = (function () {
}, _callee2, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-closepath.js b/dist/extensions/ext-closepath.js
index 39a84fd7..92f67eb3 100644
--- a/dist/extensions/ext-closepath.js
+++ b/dist/extensions/ext-closepath.js
@@ -162,9 +162,11 @@ var svgEditorExtension_closepath = (function () {
}, _callee, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-connector.js b/dist/extensions/ext-connector.js
index 86c8b48b..3fbedc65 100644
--- a/dist/extensions/ext-connector.js
+++ b/dist/extensions/ext-connector.js
@@ -686,9 +686,11 @@ var svgEditorExtension_connector = (function () {
}, _callee, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-eyedropper.js b/dist/extensions/ext-eyedropper.js
index 54c3f314..39dee302 100644
--- a/dist/extensions/ext-eyedropper.js
+++ b/dist/extensions/ext-eyedropper.js
@@ -195,9 +195,11 @@ var svgEditorExtension_eyedropper = (function () {
}, _callee, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-foreignobject.js b/dist/extensions/ext-foreignobject.js
index 702acb74..88c7acc0 100644
--- a/dist/extensions/ext-foreignobject.js
+++ b/dist/extensions/ext-foreignobject.js
@@ -359,9 +359,11 @@ var svgEditorExtension_foreignobject = (function () {
}, _callee2, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-grid.js b/dist/extensions/ext-grid.js
index 35d10720..ff1afa2f 100644
--- a/dist/extensions/ext-grid.js
+++ b/dist/extensions/ext-grid.js
@@ -140,8 +140,9 @@ var svgEditorExtension_grid = (function () {
overflow: 'visible',
display: 'none'
});
- canvBG.append(canvasGrid); // grid-pattern
- gridDefs = svgdoc.createElementNS(NS.SVG, 'defs');
+ canvBG.append(canvasGrid);
+ gridDefs = svgdoc.createElementNS(NS.SVG, 'defs'); // grid-pattern
+
gridPattern = svgdoc.createElementNS(NS.SVG, 'pattern');
assignAttributes(gridPattern, {
id: 'gridpattern',
@@ -212,7 +213,7 @@ var svgEditorExtension_grid = (function () {
})
});
- case 25:
+ case 27:
case "end":
return _context.stop();
}
@@ -220,9 +221,11 @@ var svgEditorExtension_grid = (function () {
}, _callee, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-helloworld.js b/dist/extensions/ext-helloworld.js
index 72146cc7..709aadc5 100644
--- a/dist/extensions/ext-helloworld.js
+++ b/dist/extensions/ext-helloworld.js
@@ -180,9 +180,11 @@ var svgEditorExtension_helloworld = (function () {
}, _callee, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-imagelib.js b/dist/extensions/ext-imagelib.js
index b3ac4657..aa2a2307 100644
--- a/dist/extensions/ext-imagelib.js
+++ b/dist/extensions/ext-imagelib.js
@@ -573,9 +573,11 @@ var svgEditorExtension_imagelib = (function () {
}, _callee2, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-locale/arrows/zh-CN.js b/dist/extensions/ext-locale/arrows/zh-CN.js
new file mode 100644
index 00000000..cb9286a6
--- /dev/null
+++ b/dist/extensions/ext-locale/arrows/zh-CN.js
@@ -0,0 +1,25 @@
+var svgEditorExtensionLocale_arrows_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '箭头',
+ langList: [{
+ id: 'arrow_none',
+ textContent: '无箭头'
+ }],
+ contextTools: [{
+ title: '选择箭头类型',
+ options: {
+ none: '无箭头',
+ end: '---->',
+ start: '<----',
+ both: '<--->',
+ mid: '-->--',
+ mid_bk: '--<--'
+ }
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/closepath/zh-CN.js b/dist/extensions/ext-locale/closepath/zh-CN.js
new file mode 100644
index 00000000..fa9f1a3b
--- /dev/null
+++ b/dist/extensions/ext-locale/closepath/zh-CN.js
@@ -0,0 +1,15 @@
+var svgEditorExtensionLocale_closepath_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '闭合路径',
+ buttons: [{
+ title: '打开路径'
+ }, {
+ title: '关闭路径'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/connector/zh-CN.js b/dist/extensions/ext-locale/connector/zh-CN.js
new file mode 100644
index 00000000..19c812d3
--- /dev/null
+++ b/dist/extensions/ext-locale/connector/zh-CN.js
@@ -0,0 +1,17 @@
+var svgEditorExtensionLocale_connector_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '连接器',
+ langList: [{
+ id: 'mode_connect',
+ title: '连接两个对象'
+ }],
+ buttons: [{
+ title: '连接两个对象'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/eyedropper/zh-CN.js b/dist/extensions/ext-locale/eyedropper/zh-CN.js
new file mode 100644
index 00000000..2ccb17cd
--- /dev/null
+++ b/dist/extensions/ext-locale/eyedropper/zh-CN.js
@@ -0,0 +1,14 @@
+var svgEditorExtensionLocale_eyedropper_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '滴管',
+ buttons: [{
+ title: '滴管工具',
+ key: 'I'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/foreignobject/zh-CN.js b/dist/extensions/ext-locale/foreignobject/zh-CN.js
new file mode 100644
index 00000000..99fa9f63
--- /dev/null
+++ b/dist/extensions/ext-locale/foreignobject/zh-CN.js
@@ -0,0 +1,25 @@
+var svgEditorExtensionLocale_foreignobject_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '外部对象',
+ buttons: [{
+ title: '外部对象工具'
+ }, {
+ title: '编辑外部对象内容'
+ }],
+ contextTools: [{
+ title: '改变外部对象宽度',
+ label: 'w'
+ }, {
+ title: '改变外部对象高度',
+ label: 'h'
+ }, {
+ title: '改变外部对象文字大小',
+ label: '文字大小'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/grid/zh-CN.js b/dist/extensions/ext-locale/grid/zh-CN.js
new file mode 100644
index 00000000..829fac4e
--- /dev/null
+++ b/dist/extensions/ext-locale/grid/zh-CN.js
@@ -0,0 +1,13 @@
+var svgEditorExtensionLocale_grid_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '网格视图',
+ buttons: [{
+ title: '显示/隐藏网格'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/helloworld/zh-CN.js b/dist/extensions/ext-locale/helloworld/zh-CN.js
new file mode 100644
index 00000000..1fee497b
--- /dev/null
+++ b/dist/extensions/ext-locale/helloworld/zh-CN.js
@@ -0,0 +1,14 @@
+var svgEditorExtensionLocale_helloworld_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: 'Hello World',
+ text: 'Hello World!\n\n 请点击: {x}, {y}',
+ buttons: [{
+ title: "输出 'Hello World'"
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/markers/zh-CN.js b/dist/extensions/ext-locale/markers/zh-CN.js
new file mode 100644
index 00000000..3f86f2f1
--- /dev/null
+++ b/dist/extensions/ext-locale/markers/zh-CN.js
@@ -0,0 +1,81 @@
+var svgEditorExtensionLocale_markers_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '标记',
+ langList: [{
+ id: 'nomarker',
+ title: '无标记'
+ }, {
+ id: 'leftarrow',
+ title: '左箭头'
+ }, {
+ id: 'rightarrow',
+ title: '右箭头'
+ }, {
+ id: 'textmarker',
+ title: '文本'
+ }, {
+ id: 'forwardslash',
+ title: '斜杠'
+ }, {
+ id: 'reverseslash',
+ title: '反斜杠'
+ }, {
+ id: 'verticalslash',
+ title: '垂直线'
+ }, {
+ id: 'box',
+ title: '方块'
+ }, {
+ id: 'star',
+ title: '星形'
+ }, {
+ id: 'xmark',
+ title: 'X'
+ }, {
+ id: 'triangle',
+ title: '三角形'
+ }, {
+ id: 'mcircle',
+ title: '圆形'
+ }, {
+ id: 'leftarrow_o',
+ title: '左箭头(空心)'
+ }, {
+ id: 'rightarrow_o',
+ title: '右箭头(空心)'
+ }, {
+ id: 'box_o',
+ title: '方块(空心)'
+ }, {
+ id: 'star_o',
+ title: '星形(空心)'
+ }, {
+ id: 'triangle_o',
+ title: '三角形(空心)'
+ }, {
+ id: 'mcircle_o',
+ title: '圆形(空心)'
+ }],
+ contextTools: [{
+ title: '起始标记',
+ label: 's'
+ }, {
+ title: '选择起始标记类型'
+ }, {
+ title: '中段标记',
+ label: 'm'
+ }, {
+ title: '选择中段标记类型'
+ }, {
+ title: '末端标记',
+ label: 'e'
+ }, {
+ title: '选择末端标记类型'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/mathjax/zh-CN.js b/dist/extensions/ext-locale/mathjax/zh-CN.js
new file mode 100644
index 00000000..372d3710
--- /dev/null
+++ b/dist/extensions/ext-locale/mathjax/zh-CN.js
@@ -0,0 +1,13 @@
+var svgEditorExtensionLocale_mathjax_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '数学',
+ buttons: [{
+ title: '添加数学计算'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/panning/zh-CN.js b/dist/extensions/ext-locale/panning/zh-CN.js
new file mode 100644
index 00000000..dcc266c5
--- /dev/null
+++ b/dist/extensions/ext-locale/panning/zh-CN.js
@@ -0,0 +1,13 @@
+var svgEditorExtensionLocale_panning_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '移动',
+ buttons: [{
+ title: '移动'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/polygon/zh-CN.js b/dist/extensions/ext-locale/polygon/zh-CN.js
new file mode 100644
index 00000000..2afc4ec9
--- /dev/null
+++ b/dist/extensions/ext-locale/polygon/zh-CN.js
@@ -0,0 +1,17 @@
+var svgEditorExtensionLocale_polygon_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '多边形',
+ buttons: [{
+ title: '多边形工具'
+ }],
+ contextTools: [{
+ title: '边数',
+ label: '边数'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/server_moinsave/zh-CN.js b/dist/extensions/ext-locale/server_moinsave/zh-CN.js
new file mode 100644
index 00000000..86a47c71
--- /dev/null
+++ b/dist/extensions/ext-locale/server_moinsave/zh-CN.js
@@ -0,0 +1,10 @@
+var svgEditorExtensionLocale_server_moinsave_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ saved: '已保存! 返回视图!'
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/server_opensave/zh-CN.js b/dist/extensions/ext-locale/server_opensave/zh-CN.js
new file mode 100644
index 00000000..7b10037b
--- /dev/null
+++ b/dist/extensions/ext-locale/server_opensave/zh-CN.js
@@ -0,0 +1,10 @@
+var svgEditorExtensionLocale_server_opensave_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ uploading: '正在上传...'
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/shapes/zh-CN.js b/dist/extensions/ext-locale/shapes/zh-CN.js
new file mode 100644
index 00000000..215ab2c6
--- /dev/null
+++ b/dist/extensions/ext-locale/shapes/zh-CN.js
@@ -0,0 +1,29 @@
+var svgEditorExtensionLocale_shapes_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ loading: '正在加载...',
+ categories: {
+ basic: '基本',
+ object: '对象',
+ symbol: '符号',
+ arrow: '箭头',
+ flowchart: '工作流',
+ animal: '动物',
+ game: '棋牌',
+ dialog_balloon: '会话框',
+ electronics: '电子',
+ math: '数学',
+ music: '音乐',
+ misc: '其他',
+ raphael_1: 'raphaeljs.com 集合 1',
+ raphael_2: 'raphaeljs.com 集合 2'
+ },
+ buttons: [{
+ title: '图元库'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/star/zh-CN.js b/dist/extensions/ext-locale/star/zh-CN.js
new file mode 100644
index 00000000..cda4d8a2
--- /dev/null
+++ b/dist/extensions/ext-locale/star/zh-CN.js
@@ -0,0 +1,23 @@
+var svgEditorExtensionLocale_star_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: '星形',
+ buttons: [{
+ title: '星形工具'
+ }],
+ contextTools: [{
+ title: '顶点',
+ label: '顶点'
+ }, {
+ title: '钝度',
+ label: '钝度'
+ }, {
+ title: '径向',
+ label: '径向'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/storage/zh-CN.js b/dist/extensions/ext-locale/storage/zh-CN.js
new file mode 100644
index 00000000..b5c12eb2
--- /dev/null
+++ b/dist/extensions/ext-locale/storage/zh-CN.js
@@ -0,0 +1,17 @@
+var svgEditorExtensionLocale_storage_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ message: '默认情况下, SVG-Edit 在本地保存配置参数和画布内容. 如果基于隐私考虑, ' + '您可以勾选以下选项修改配置.',
+ storagePrefsAndContent: '本地存储配置参数和SVG图',
+ storagePrefsOnly: '本地只存储配置参数',
+ storagePrefs: '本地存储配置参数',
+ storageNoPrefsOrContent: '本地不保存配置参数和SVG图',
+ storageNoPrefs: '本地不保存配置参数',
+ rememberLabel: '记住选择?',
+ rememberTooltip: '如果您勾选记住选择,将不再弹出本窗口.'
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-locale/webappfind/zh-CN.js b/dist/extensions/ext-locale/webappfind/zh-CN.js
new file mode 100644
index 00000000..bb8fd461
--- /dev/null
+++ b/dist/extensions/ext-locale/webappfind/zh-CN.js
@@ -0,0 +1,13 @@
+var svgEditorExtensionLocale_webappfind_zh_CN = (function () {
+ 'use strict';
+
+ var zhCN = {
+ name: 'WebAppFind',
+ buttons: [{
+ title: '保存图片到磁盘'
+ }]
+ };
+
+ return zhCN;
+
+}());
diff --git a/dist/extensions/ext-markers.js b/dist/extensions/ext-markers.js
index 50537c7a..1c42bdda 100644
--- a/dist/extensions/ext-markers.js
+++ b/dist/extensions/ext-markers.js
@@ -759,9 +759,11 @@ var svgEditorExtension_markers = (function () {
}, _callee3, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-mathjax.js b/dist/extensions/ext-mathjax.js
index ab2e9f4d..c3e1a95d 100644
--- a/dist/extensions/ext-mathjax.js
+++ b/dist/extensions/ext-mathjax.js
@@ -309,9 +309,11 @@ var svgEditorExtension_mathjax = (function () {
}, _callee, this, [[7, 13]]);
}));
- return function click() {
+ function click() {
return _click.apply(this, arguments);
- };
+ }
+
+ return click;
}()
}
}];
@@ -359,9 +361,11 @@ var svgEditorExtension_mathjax = (function () {
}, _callee2, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-panning.js b/dist/extensions/ext-panning.js
index e2f6a987..7ea9eb9c 100644
--- a/dist/extensions/ext-panning.js
+++ b/dist/extensions/ext-panning.js
@@ -115,9 +115,11 @@ var svgEditorExtension_panning = (function () {
}, _callee, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-polygon.js b/dist/extensions/ext-polygon.js
index 87a0ab0d..3bb2ff47 100644
--- a/dist/extensions/ext-polygon.js
+++ b/dist/extensions/ext-polygon.js
@@ -301,9 +301,11 @@ var svgEditorExtension_polygon = (function () {
}, _callee, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-server_moinsave.js b/dist/extensions/ext-server_moinsave.js
index 7622b7ca..0402b869 100644
--- a/dist/extensions/ext-server_moinsave.js
+++ b/dist/extensions/ext-server_moinsave.js
@@ -4861,10 +4861,12 @@ var svgEditorExtension_server_moinsave = (function () {
svgEditor = this;
svgCanvas = svgEditor.canvas;
saveSvgAction = '/+modify'; // Create upload target (hidden iframe)
+ // Hiding by size instead of display to avoid FF console errors
+ // with `getBBox` in browser.js `supportsPathBBox_`)
/* const target = */
- $('').hide().appendTo('body');
+ $('').appendTo('body');
svgEditor.setCustomHandlers({
save: function () {
var _save = _asyncToGenerator(
@@ -4915,9 +4917,11 @@ var svgEditorExtension_server_moinsave = (function () {
}, _callee, this);
}));
- return function save(_x2, _x3) {
+ function save(_x2, _x3) {
return _save.apply(this, arguments);
- };
+ }
+
+ return save;
}()
});
@@ -4929,9 +4933,11 @@ var svgEditorExtension_server_moinsave = (function () {
}, _callee2, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-server_opensave.js b/dist/extensions/ext-server_opensave.js
index 89587c18..8cef0cd8 100644
--- a/dist/extensions/ext-server_opensave.js
+++ b/dist/extensions/ext-server_opensave.js
@@ -4993,8 +4993,10 @@ var svgEditorExtension_server_opensave = (function () {
saveSvgAction = svgEditor.curConfig.extPath + 'filesave.php', saveImgAction = svgEditor.curConfig.extPath + 'filesave.php'; // Create upload target (hidden iframe)
- cancelled = false;
- $('').hide().appendTo('body');
+ cancelled = false; // Hiding by size instead of display to avoid FF console errors
+ // with `getBBox` in browser.js `supportsPathBBox_`)
+
+ $('').appendTo('body');
svgEditor.setCustomHandlers({
save: function save(win, data) {
var svg = '\n' + data,
@@ -5094,9 +5096,11 @@ var svgEditorExtension_server_opensave = (function () {
}, _callee, this);
}));
- return function exportImage(_x2, _x3) {
+ function exportImage(_x2, _x3) {
return _exportImage.apply(this, arguments);
- };
+ }
+
+ return exportImage;
}()
}); // Do nothing if client support is found
@@ -5182,9 +5186,11 @@ var svgEditorExtension_server_opensave = (function () {
}, _callee5, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-shapes.js b/dist/extensions/ext-shapes.js
index 6022450b..15856533 100644
--- a/dist/extensions/ext-shapes.js
+++ b/dist/extensions/ext-shapes.js
@@ -412,9 +412,11 @@ var svgEditorExtension_shapes = (function () {
}, _callee, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-star.js b/dist/extensions/ext-star.js
index ca8f3bd8..9afe02be 100644
--- a/dist/extensions/ext-star.js
+++ b/dist/extensions/ext-star.js
@@ -286,9 +286,11 @@ var svgEditorExtension_star = (function () {
}, _callee, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/ext-storage.js b/dist/extensions/ext-storage.js
index 9d13602f..5e818bf5 100644
--- a/dist/extensions/ext-storage.js
+++ b/dist/extensions/ext-storage.js
@@ -415,9 +415,11 @@ var svgEditorExtension_storage = (function () {
}, _callee, this);
}));
- return function langReady(_x) {
+ function langReady(_x) {
return _langReady.apply(this, arguments);
- };
+ }
+
+ return langReady;
}()
};
}
diff --git a/dist/extensions/ext-webappfind.js b/dist/extensions/ext-webappfind.js
index 4492bfa0..8069aa72 100644
--- a/dist/extensions/ext-webappfind.js
+++ b/dist/extensions/ext-webappfind.js
@@ -166,9 +166,11 @@ var svgEditorExtension_webappfind = (function () {
}, _callee, this);
}));
- return function init(_x) {
+ function init(_x) {
return _init.apply(this, arguments);
- };
+ }
+
+ return init;
}()
};
diff --git a/dist/extensions/imagelib/openclipart.js b/dist/extensions/imagelib/openclipart.js
index 724920be..2906d4cb 100644
--- a/dist/extensions/imagelib/openclipart.js
+++ b/dist/extensions/imagelib/openclipart.js
@@ -3146,9 +3146,11 @@
}, _callee2, this);
}));
- return function click(_x2) {
+ function click(_x2) {
return _click.apply(this, arguments);
- };
+ }
+
+ return click;
}()
}
}, [// If we wanted interactive versions despite security risk:
@@ -3254,9 +3256,11 @@
}, _callee, this);
}));
- return function $submit() {
+ function $submit() {
return _$submit.apply(this, arguments);
- };
+ }
+
+ return $submit;
}()
},
$on: {
diff --git a/dist/index-es.js b/dist/index-es.js
index b074836c..9aa3afc1 100644
--- a/dist/index-es.js
+++ b/dist/index-es.js
@@ -28922,9 +28922,11 @@ function getImportLocale(_ref) {
}, _callee, this, [[2, 8]]);
}));
- return function importLocaleDefaulting() {
+ function importLocaleDefaulting() {
return _importLocaleDefaulting.apply(this, arguments);
- };
+ }
+
+ return importLocaleDefaulting;
}()
);
}
@@ -30119,9 +30121,11 @@ editor.init = function () {
}, _callee4, this);
}));
- return function callback(_x3) {
+ function callback(_x3) {
return _callback.apply(this, arguments);
- };
+ }
+
+ return callback;
}()
});
/**
diff --git a/dist/index-es.min.js b/dist/index-es.min.js
index 262daf64..e4947ffa 100644
--- a/dist/index-es.min.js
+++ b/dist/index-es.min.js
@@ -1,2 +1,2 @@
-function _typeof(e){return(_typeof="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})(e)}function asyncGeneratorStep(e,t,n,r,a,i,s){try{var o=e[i](s),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(r,a)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function s(e){asyncGeneratorStep(i,r,a,s,o,"next",e)}function o(e){asyncGeneratorStep(i,r,a,s,o,"throw",e)}s(void 0)})}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;nt.getTotalLength())break;n--}while(n>0);return n}),window.SVGPathSeg=e,window.SVGPathSegClosePath=t,window.SVGPathSegMovetoAbs=n,window.SVGPathSegMovetoRel=r,window.SVGPathSegLinetoAbs=a,window.SVGPathSegLinetoRel=i,window.SVGPathSegCurvetoCubicAbs=s,window.SVGPathSegCurvetoCubicRel=o,window.SVGPathSegCurvetoQuadraticAbs=l,window.SVGPathSegCurvetoQuadraticRel=c,window.SVGPathSegArcAbs=u,window.SVGPathSegArcRel=d,window.SVGPathSegLinetoHorizontalAbs=h,window.SVGPathSegLinetoHorizontalRel=p,window.SVGPathSegLinetoVerticalAbs=g,window.SVGPathSegLinetoVerticalRel=f,window.SVGPathSegCurvetoCubicSmoothAbs=m,window.SVGPathSegCurvetoCubicSmoothRel=v,window.SVGPathSegCurvetoQuadraticSmoothAbs=_,window.SVGPathSegCurvetoQuadraticSmoothRel=b}if(!("SVGPathSegList"in window&&"appendItem"in window.SVGPathSegList.prototype)){var y=function(){function e(t){_classCallCheck(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 _createClass(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(){_classCallCheck(this,e),this.pathSegList=[]}return _createClass(e,[{key:"appendSegment",value:function(e){this.pathSegList.push(e)}}]),e}(),r=function(){function e(t){_classCallCheck(this,e),this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()}return _createClass(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,s=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex"9")&&"."!==this._string.charAt(this._currentIndex))){for(var o=this._currentIndex;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!==o)for(var l=this._currentIndex-1,c=1;l>=o;)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!==s&&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)),s!==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 s={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(t,s.x,s.y,s.x2,s.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var o={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(t,o.x,o.y,o.x1,o.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}(),a=new n,i=new r(e);if(!i.initialCommandIsMoveTo())return[];for(;i.hasMoreData();){var s=i.parseSegment();if(!s)return[];a.appendSegment(s)}return a.pathSegList}}]),e}();y.prototype.classname="SVGPathSegList",Object.defineProperty(y.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),y._pathSegArrayAsString=function(e){var t="",n=!0;return e.forEach(function(e){n?(n=!1,t+=e._asPathString()):t+=" "+e._asPathString()}),t},Object.defineProperties(SVGPathElement.prototype,{pathSegList:{get:function(){return this._pathSegList||(this._pathSegList=new y(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=y}}();var $=jQuery,supportsSVG_=Boolean(document.createElementNS&&document.createElementNS(NS.SVG,"svg").createSVGRect),_navigator=navigator,userAgent=_navigator.userAgent,svg=document.createElementNS(NS.SVG,"svg"),isOpera_=Boolean(window.opera),isWebkit_=userAgent.includes("AppleWebKit"),isGecko_=userAgent.includes("Gecko/"),isIE_=userAgent.includes("MSIE"),isChrome_=userAgent.includes("Chrome/"),isWindows_=userAgent.includes("Windows"),isMac_=userAgent.includes("Macintosh"),isTouch_="ontouchstart"in window,supportsSelectors_=Boolean(svg.querySelector),supportsXpath_=Boolean(document.evaluate),supportsPathReplaceItem_=function(){var e=document.createElementNS(NS.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}(),supportsPathInsertItemBefore_=function(){var e=document.createElementNS(NS.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}(),supportsGoodTextCharPos_=function(){var e=document.createElementNS(NS.SVG,"svg"),t=document.createElementNS(NS.SVG,"svg");document.documentElement.append(e),t.setAttribute("x",5),e.append(t);var n=document.createElementNS(NS.SVG,"text");n.textContent="a",t.append(n);try{return 0===n.getStartPositionOfChar(0).x}catch(e){return!1}finally{e.remove()}}(),supportsPathBBox_=function(){var e=document.createElementNS(NS.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(NS.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}(),supportsHVLineContainerBBox_=function(){var e=document.createElementNS(NS.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(NS.SVG,"path");t.setAttribute("d","M0,0 10,0");var n=document.createElementNS(NS.SVG,"path");n.setAttribute("d","M5,0 15,0");var r=document.createElementNS(NS.SVG,"g");r.append(t,n),e.append(r);var a=r.getBBox();return e.remove(),15===a.width}(),supportsGoodDecimals_=function(){var e=document.createElementNS(NS.SVG,"rect");e.setAttribute("x",.1);var t=!e.cloneNode(!1).getAttribute("x").includes(",");return t||$.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.'),t}(),supportsNonScalingStroke_=function(){var e=document.createElementNS(NS.SVG,"rect");return e.setAttribute("style","vector-effect:non-scaling-stroke"),"non-scaling-stroke"===e.style.vectorEffect}(),supportsNativeSVGTransformLists_=function(){var e=document.createElementNS(NS.SVG,"rect").transform.baseVal,t=svg.createSVGTransform();e.appendItem(t);var n=e.getItem(0),r=function(e){return e&&"object"===_typeof(e)&&"function"==typeof e.setMatrix&&"angle"in e};return r(n)&&r(t)&&n.type===t.type&&n.angle===t.angle&&n.matrix.a===t.matrix.a&&n.matrix.b===t.matrix.b&&n.matrix.c===t.matrix.c&&n.matrix.d===t.matrix.d&&n.matrix.e===t.matrix.e&&n.matrix.f===t.matrix.f}(),isOpera=function(){return isOpera_},isWebkit=function(){return isWebkit_},isGecko=function(){return isGecko_},isIE=function(){return isIE_},isChrome=function(){return isChrome_},isMac=function(){return isMac_},isTouch=function(){return isTouch_},supportsSelectors=function(){return supportsSelectors_},supportsXpath=function(){return supportsXpath_},supportsPathReplaceItem=function(){return supportsPathReplaceItem_},supportsPathInsertItemBefore=function(){return supportsPathInsertItemBefore_},supportsPathBBox=function(){return supportsPathBBox_},supportsHVLineContainerBBox=function(){return supportsHVLineContainerBBox_},supportsGoodTextCharPos=function(){return supportsGoodTextCharPos_},supportsNonScalingStroke=function(){return supportsNonScalingStroke_},supportsNativeTransformLists=function(){return supportsNativeSVGTransformLists_};function jQueryPluginSVG(e){var t=e.fn.attr;return e.fn.attr=function(e,n){var r=this.length;if(!r)return t.call(this,e,n);for(var a=0;a=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(HistoryEventTypes.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}();BatchCommand.type=BatchCommand.prototype.type;var UndoManager=function(){function e(t){_classCallCheck(this,e),this.handler_=t||null,this.undoStackPointer=0,this.undoStack=[],this.undoChangeStackPointer=-1,this.undoableChangeStack=[]}return _createClass(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 s=t[r];isNullish(s)||(i[r]=s,a[r]=s.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 BatchCommand("Change "+n),a=t.elements.length;a--;){var i=t.elements[a];if(!isNullish(i)){var s={};s[n]=t.oldValues[a],s[n]!==i.getAttribute(n)&&r.addSubCommand(new ChangeElementCommand(i,s,n))}}return this.undoableChangeStack[e]=null,r}}]),e}(),hstry=Object.freeze({HistoryEventTypes:HistoryEventTypes,MoveElementCommand:MoveElementCommand,InsertElementCommand:InsertElementCommand,RemoveElementCommand:RemoveElementCommand,ChangeElementCommand:ChangeElementCommand,BatchCommand:BatchCommand,UndoManager:UndoManager}),NEAR_ZERO=1e-14,svg$1=document.createElementNS(NS.SVG,"svg"),transformPoint=function(e,t,n){return{x:n.a*e+n.c*t+n.e,y:n.b*e+n.d*t+n.f}},isIdentity=function(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f},matrixMultiply=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=svg$1.createSVGMatrix(),i=t;i<=n;++i){var s=i>=0&&ie.x&&t.ye.y},$$1=jQuery,segData={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"]},uiStrings={},setUiStrings=function(e){Object.assign(uiStrings,e.ui)},pathFuncs=[],linkControlPts=!0,pathData={},setLinkControlPoints=function(e){linkControlPts=e},path=null,editorContext_=null,init$1=function(e){editorContext_=e,pathFuncs=[0,"ClosePath"];$$1.each(["Moveto","Lineto","CurvetoCubic","CurvetoQuadratic","Arc","LinetoHorizontal","LinetoVertical","CurvetoCubicSmooth","CurvetoQuadraticSmooth"],function(e,t){pathFuncs.push(t+"Abs"),pathFuncs.push(t+"Rel")})},insertItemBefore=function(e,t,n){var r=e.pathSegList;if(supportsPathInsertItemBefore())r.insertItemBefore(t,n);else{for(var a=r.numberOfItems,i=[],s=0;s0?(p=f element");this.elem=t,this.segs=[],this.selected_pts=[],path=this,this.init()}return _createClass(e,[{key:"init",value:function(){$$1(getGripContainer()).find("*").each(function(){$$1(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[o+1],u=o-1<0?null:i[o-1];if(2===l.type){if(u&&1!==u.type){var d=i[s];d.next=i[s+1],d.next.prev=d,d.addGrip()}s=o}else if(c&&1===c.type)l.next=i[s+1],l.next.prev=l,l.mate=i[s],l.addGrip(),isNullish(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[s];h.next=i[s+1],h.next.prev=h,h.addGrip(),l.addGrip(),this.first_seg||(this.first_seg=i[s])}}return this}},{key:"eachSeg",value:function(e){for(var t=this.segs.length,n=0;n=0&&this.selected_pts.push(r)}this.selected_pts.sort();var a=this.selected_pts.length,i=[];for(i.length=a;a--;){var s=this.selected_pts[a],o=this.segs[s];o.select(!0),i[a]=o.ptgrip}var l=e.subpathIsClosed(this.selected_pts[0]);editorContext_.addPtsToSelection({grips:i,closedSubpath:l})}}]),e}();Path.subpathIsClosed=function(e){var t=!1;return path.eachSeg(function(n){return n<=e||2!==this.type&&(1!==this.type||(t=!0,!1))}),t};var newcx,newcy,oldcx,oldcy,angle,getPath_=function(e){var t=pathData[e.id];return t||(t=pathData[e.id]=new Path(e)),t},removePath_=function(e){e in pathData&&delete pathData[e]},getRotVals=function(e,t){var n=e-oldcx,r=t-oldcy,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)+angle;return n=a*Math.cos(i)+oldcx,r=a*Math.sin(i)+oldcy,n-=newcx,r-=newcy,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)-angle,{x:a*Math.cos(i)+newcx,y:a*Math.sin(i)+newcy}},recalcRotatedPath=function(){var e=path.elem;if(angle=getRotationAngle(e,!0)){var t=path.oldbbox;oldcx=t.x+t.width/2,oldcy=t.y+t.height/2;var n=getBBox(e);newcx=n.x+n.width/2,newcy=n.y+n.height/2;var r=newcx-oldcx,a=newcy-oldcy,i=Math.sqrt(r*r+a*a),s=Math.atan2(a,r)+angle;newcx=i*Math.cos(s)+oldcx,newcy=i*Math.sin(s)+oldcy;for(var o=e.pathSegList,l=o.numberOfItems;l;){l-=1;var c=o.getItem(l),u=c.pathSegType;if(1!==u){var d=getRotVals(c.x,c.y),h=[d.x,d.y];if(!isNullish(c.x1)&&!isNullish(c.x2)){var p=getRotVals(c.x1,c.y1),g=getRotVals(c.x2,c.y2);h.splice(h.length,0,p.x,p.y,g.x,g.y)}replacePathSeg(u,l,h)}}getBBox(e);var f=editorContext_.getSVGRoot().createSVGTransform(),m=getTransformList(e);f.setRotate(180*angle/Math.PI,newcx,newcy),m.replaceItem(f,0)}},clearData=function(){pathData={}},reorientGrads=function(e,t){for(var n=getBBox(e),r=0;r<2;r++){var a=0===r?"fill":"stroke",i=e.getAttribute(a);if(i&&i.startsWith("url(")){var s=getRefElem(i);if("linearGradient"===s.tagName){var o=s.getAttribute("x1")||0,l=s.getAttribute("y1")||0,c=s.getAttribute("x2")||1,u=s.getAttribute("y2")||0;o=n.width*o+n.x,l=n.height*l+n.y,c=n.width*c+n.x,u=n.height*u+n.y;var d=transformPoint(o,l,t),h=transformPoint(c,u,t),p={};p.x1=(d.x-n.x)/n.width,p.y1=(d.y-n.y)/n.height,p.x2=(h.x-n.x)/n.width,p.y2=(h.y-n.y)/n.height;var g=s.cloneNode(!0);$$1(g).attr(p),g.id=editorContext_.getNextId(),findDefs().append(g),e.setAttribute(a,"url(#"+g.id+")")}}}},pathMap=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],convertPath=function(e,t){for(var n=e.pathSegList,r=n.numberOfItems,a=0,i=0,s="",o=null,l=0;l=k-S&&m<=k+S&&v>=A-S&&v<=A+S){w=!0;break}}s=editorContext_.getId(),removePath_(s);var E,N,T=getElem(s),P=x.numberOfItems;if(w){if(C<=1&&P>=2){var G=x.getItem(0).x,L=x.getItem(0).y;E=4===(N=_.pathSegList.getItem(1)).pathSegType?y.createSVGPathSegLinetoAbs(G,L):y.createSVGPathSegCurvetoCubicAbs(G,L,N.x1/f,N.y1/f,G,L);var I=y.createSVGPathSegClosePath();x.appendItem(E),x.appendItem(I)}else if(P<3)return!1;if($$1(_).remove(),editorContext_.setDrawnPath(null),editorContext_.setStarted(!1),n){path.matrix&&editorContext_.remapElement(T,{},path.matrix.inverse());var M=T.getAttribute("d"),R=$$1(path.elem).attr("d");return $$1(path.elem).attr("d",R+M),$$1(T).remove(),path.matrix&&recalcRotatedPath(),init$1(),pathActions.toEditMode(path.elem),path.selectPt(),!1}}else{if(!$$1.contains(editorContext_.getContainer(),editorContext_.getMouseTarget(t)))return!1;var O=y.pathSegList.numberOfItems,B=y.pathSegList.getItem(O-1),V=B.x,j=B.y;if(t.shiftKey){var F=snapToAngle(V,j,m,v);m=F.x,v=F.y}E=4===(N=_.pathSegList.getItem(1)).pathSegType?y.createSVGPathSegLinetoAbs(editorContext_.round(m),editorContext_.round(v)):y.createSVGPathSegCurvetoCubicAbs(editorContext_.round(m),editorContext_.round(v),N.x1/f,N.y1/f,N.x2/f,N.y2/f),y.pathSegList.appendItem(E),m*=f,v*=f,_.setAttribute("d",["M",m,v,m,v].join(" ")),b=O,n&&(b+=path.segs.length),addPointGrip(b,m,v)}}else{var D="M"+m+","+v+" ";editorContext_.setDrawnPath(editorContext_.addSVGElementFromJson({element:"path",curStyles:!0,attr:{d:D,id:editorContext_.getNextId(),opacity:editorContext_.getOpacity()/2}})),_.setAttribute("d",["M",p,g,p,g].join(" ")),b=n?path.segs.length:0,addPointGrip(b,p,g)}}},mouseMove:function(n,r){var i=editorContext_.getCurrentZoom();a=!0;var s=editorContext_.getDrawnPath();if("path"!==editorContext_.getCurrentMode())if(path.dragging){var o=getPointFromGrip({x:path.dragging[0],y:path.dragging[1]},path),l=getPointFromGrip({x:n,y:r},path),c=l.x-o.x,u=l.y-o.y;path.dragging=[n,r],path.dragctrl?path.moveCtrl(c,u):path.movePts(c,u)}else path.selected_pts=[],path.eachSeg(function(e){if(this.next||this.prev){var t=editorContext_.getRubberBox().getBBox(),n=getGripPt(this),r={x:n.x,y:n.y,width:0,height:0},a=rectsIntersect(t,r);this.select(a),a&&path.selected_pts.push(this.index)}});else{if(!s)return;var d=s.pathSegList,h=d.numberOfItems-1;if(e){var p=addCtrlGrip("1c1"),g=addCtrlGrip("0c2");p.setAttribute("cx",n),p.setAttribute("cy",r),p.setAttribute("display","inline");var f=e[0],m=e[1],v=f+(f-n/i),_=m+(m-r/i);g.setAttribute("cx",v*i),g.setAttribute("cy",_*i),g.setAttribute("display","inline");var b=getCtrlLine(1);if(assignAttributes(b,{x1:n,y1:r,x2:v*i,y2:_*i,display:"inline"}),0===h)t=[n,r];else{var y=d.getItem(h-1),x=y.x,C=y.y;6===y.pathSegType?(x+=x-y.x2,C+=C-y.y2):t&&(x=t[0]/i,C=t[1]/i),replacePathSeg(6,h,[f,m,x,C,v,_],s)}}else{var S=getElem("path_stretch_line");if(S){var w=d.getItem(h);if(6===w.pathSegType){var $=w.x+(w.x-w.x2),k=w.y+(w.y-w.y2);replacePathSeg(6,1,[n,r,$*i,k*i,n,r],S)}else t?replacePathSeg(6,1,[n,r,t[0],t[1],n,r],S):replacePathSeg(4,1,[n,r],S)}}}},mouseUp:function(n,r,i,s){var o=editorContext_.getDrawnPath();if("path"===editorContext_.getCurrentMode())return e=null,o||(r=getElem(editorContext_.getId()),editorContext_.setStarted(!1),t=null),{keep:!0,element:r};var l=editorContext_.getRubberBox();if(path.dragging){var c=path.cur_pt;path.dragging=!1,path.dragctrl=!1,path.update(),a&&path.endChanges("Move path point(s)"),n.shiftKey||a||path.selectPt(c)}else l&&"none"!==l.getAttribute("display")?(l.setAttribute("display","none"),l.getAttribute("width")<=2&&l.getAttribute("height")<=2&&pathActions.toSelectMode(n.target)):pathActions.toSelectMode(n.target);a=!1},toEditMode:function(e){path=getPath_(e),editorContext_.setCurrentMode("pathedit"),editorContext_.clearSelection(),path.show(!0).update(),path.oldbbox=getBBox(path.elem),n=!1},toSelectMode:function(e){var t=e===path.elem;editorContext_.setCurrentMode("select"),path.show(!1),r=!1,editorContext_.clearSelection(),path.matrix&&recalcRotatedPath(),t&&(editorContext_.call("selected",[e]),editorContext_.addToSelection([e],!0))},addSubPath:function(e){e?(editorContext_.setCurrentMode("path"),n=!0):(pathActions.clear(!0),pathActions.toEditMode(path.elem))},select:function(e){r===e?(pathActions.toEditMode(e),editorContext_.setCurrentMode("pathedit")):r=e},reorient:function(){var e=editorContext_.getSelectedElements()[0];if(e&&0!==getRotationAngle(e)){var t=new BatchCommand("Reorient path"),n={d:e.getAttribute("d"),transform:e.getAttribute("transform")};t.addSubCommand(new ChangeElementCommand(e,n)),editorContext_.clearSelection(),this.resetOrientation(e),editorContext_.addCommandToHistory(t),getPath_(e).show(!1).matrix=null,this.clear(),editorContext_.addToSelection([e],!0),editorContext_.call("changed",editorContext_.getSelectedElements())}},clear:function(e){var n=editorContext_.getDrawnPath();if(r=null,n){var a=getElem(editorContext_.getId());$$1(getElem("path_stretch_line")).remove(),$$1(a).remove(),$$1(getElem("pathpointgrip_container")).find("*").attr("display","none"),t=null,editorContext_.setDrawnPath(null),editorContext_.setStarted(!1)}else"pathedit"===editorContext_.getCurrentMode()&&this.toSelectMode();path&&path.init().show(!1)},resetOrientation:function(e){if(isNullish(e)||"path"!==e.nodeName)return!1;var t=getTransformList(e),n=transformListToTransform(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 s=[];$$1.each(["",1,2],function(e,t){var r=a["x"+t],i=a["y"+t];if(void 0!==r&&void 0!==i){var o=transformPoint(r,i,n);s.splice(s.length,0,o.x,o.y)}}),replacePathSeg(i,t,s,e)},s=0;s0){var o=t.getItem(n-1).pathSegType;if(2===o){r(n-1,1),e();break}if(1===o&&t.numberOfItems-1===n){r(n,1),e();break}}}return!1}(),path.elem.pathSegList.numberOfItems<=1)return pathActions.toSelectMode(path.elem),void editorContext_.canvas.deleteSelectedElements();if(path.init(),path.clearSelection(),window.opera){var r=$$1(path.elem);r.attr("d",r.attr("d"))}path.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,s=[];for(s.push(["M",a.x,",",a.y," C"].join("")),t=1;t<=r-4;t+=3){var o=n.getItem(t),l=n.getItem(t+1),c=n.getItem(t+2);if(i){var u=smoothControlPoints(i,o,a);if(u&&2===u.length){var d=s[s.length-1].split(",");d[2]=u[0].x,d[3]=u[0].y,s[s.length-1]=d.join(","),o=u[1]}}s.push([o.x,o.y,l.x,l.y,c.x,c.y].join(",")),a=c,i=l}for(s.push("L");t)/,"$1$2")},toXml=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")};function encode64(e){if(e=encodeUTF8(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++),s=e.charCodeAt(n++),o=a>>2,l=(3&a)<<4|i>>4,c=(15&i)<<2|s>>6,u=63&s;isNaN(i)?(c=64,u=64):isNaN(s)&&(u=64),t[r++]=KEYSTR.charAt(o),t[r++]=KEYSTR.charAt(l),t[r++]=KEYSTR.charAt(c),t[r++]=KEYSTR.charAt(u)}while(n>4,l=(15&a)<<4|i>>2,c=(3&i)<<6|s;t+=String.fromCharCode(o),64!==i&&(t+=String.fromCharCode(l)),64!==s&&(t+=String.fromCharCode(c))}while(nSVG-edit