diff --git a/dist/extensions/ext-server_moinsave.js b/dist/extensions/ext-server_moinsave.js index 1b529df5..9fa50a85 100644 --- a/dist/extensions/ext-server_moinsave.js +++ b/dist/extensions/ext-server_moinsave.js @@ -4909,15 +4909,15 @@ var svgEditorExtension_server_moinsave = (function () { var _save = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee(win, data) { - var svg, qstr, _qstr$substr$split, _qstr$substr$split2, name, svgData, c, datauri, pngData; + var svg, _ref2, pathname, name, svgData, c, datauri, pngData; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: svg = '\n' + data; - qstr = $.param.querystring(); - _qstr$substr$split = qstr.substr(9).split('/+get/'), _qstr$substr$split2 = _slicedToArray(_qstr$substr$split, 2), name = _qstr$substr$split2[1]; + _ref2 = new URL(location), pathname = _ref2.pathname; + name = pathname.replace(/\/+get\//, ''); svgData = encode64(svg); if (!$('#export_canvas').length) { diff --git a/dist/extensions/ext-storage.js b/dist/extensions/ext-storage.js index c7ebeaf1..9a0965fe 100644 --- a/dist/extensions/ext-storage.js +++ b/dist/extensions/ext-storage.js @@ -89,15 +89,13 @@ var svgEditorExtension_storage = (function () { * The functionality was originally part of the SVG Editor, but moved to a * separate extension to make the setting behavior optional, and adapted * to inform the user of its setting of local data. - * Dependencies: * - * 1. jQuery BBQ (for deparam) * @license MIT * * @copyright 2010 Brett Zamir - * @todo Revisit on whether to use $.pref over directly setting curConfig in all - * extensions for a more public API (not only for extPath and imagePath, - * but other currently used config in the extensions) + * @todo Revisit on whether to use `svgEditor.pref` over directly setting + * `curConfig` in all extensions for a more public API (not only for `extPath` + * and `imagePath`, but other currently used config in the extensions) * @todo We might provide control of storage settings through the UI besides the * initial (or URL-forced) dialog. * */ @@ -122,6 +120,7 @@ var svgEditorExtension_storage = (function () { * Replace `storagePrompt` parameter within URL. * @param {string} val * @returns {void} + * @todo Replace the string manipulation with `searchParams.set` */ function replaceStoragePrompt(val) { @@ -257,14 +256,14 @@ var svgEditorExtension_storage = (function () { var _langReady = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee(_ref4) { - var importLocale, _$$deparam$querystrin, storagePrompt, confirmSetStorage, message, storagePrefsAndContent, storagePrefsOnly, storagePrefs, storageNoPrefsOrContent, storageNoPrefs, rememberLabel, rememberTooltip, options, oldContainerWidth, oldContainerMarginLeft, oldContentHeight, oldContainerHeight, _ref5, pref, checked; + var importLocale, storagePrompt, confirmSetStorage, message, storagePrefsAndContent, storagePrefsOnly, storagePrefs, storageNoPrefsOrContent, storageNoPrefs, rememberLabel, rememberTooltip, options, oldContainerWidth, oldContainerMarginLeft, oldContentHeight, oldContainerHeight, _ref5, pref, checked; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: importLocale = _ref4.importLocale; - _$$deparam$querystrin = $.deparam.querystring(true), storagePrompt = _$$deparam$querystrin.storagePrompt; + storagePrompt = new URL(top.location).searchParams.get('storagePrompt'); _context.next = 4; return importLocale(); @@ -289,11 +288,11 @@ var svgEditorExtension_storage = (function () { if (!(!forceStorage && ( // If the URL has been explicitly set to always prompt the // user (e.g., so one can be pointed to a URL where one // can alter one's settings, say to prevent future storage)... - storagePrompt === true || // ...or...if the URL at least doesn't explicitly prevent a + storagePrompt === 'true' || // ...or...if the URL at least doesn't explicitly prevent a // storage prompt (as we use for users who // don't want to set cookies at all but who don't want // continual prompts about it)... - storagePrompt !== false && // ...and this user hasn't previously indicated a desire for storage + storagePrompt !== 'false' && // ...and this user hasn't previously indicated a desire for storage !document.cookie.match(/(?:^|;\s*)svgeditstore=(?:prefsAndContent|prefsOnly)/) // ...then show the storage prompt. ))) { _context.next = 44; @@ -361,7 +360,7 @@ var svgEditorExtension_storage = (function () { // don't want ask them again upon page refresh so move // them instead to a URL which does not always prompt - if (!(storagePrompt === true && checked)) { + if (!(storagePrompt === 'true' && checked)) { _context.next = 28; break; } diff --git a/dist/index-es.js b/dist/index-es.js index 48279750..fa7eb943 100644 --- a/dist/index-es.js +++ b/dist/index-es.js @@ -28615,44 +28615,33 @@ function () { case 0: if (givenParam) { langParam = givenParam; - } else { - langParam = $$a.pref('lang'); + } else if (navigator.userLanguage) { + // Explorer + langParam = navigator.userLanguage; + } else if (navigator.language) { + // FF, Opera, ... + langParam = navigator.language; + } - if (!langParam) { - if (navigator.userLanguage) { - // Explorer - langParam = navigator.userLanguage; - } else if (navigator.language) { - // FF, Opera, ... - langParam = navigator.language; - } - } - - console.log('Lang: ' + langParam); // eslint-disable-line no-console - // Set to English if language is not in list of good langs - - if (!goodLangs.includes(langParam) && langParam !== 'test') { - langParam = 'en'; - } // don't bother on first run if language is English - // The following line prevents setLang from running - // extensions which depend on updated uiStrings, - // so commenting it out. - // if (langParam.startsWith('en')) {return;} + console.log('Lang: ' + langParam); // eslint-disable-line no-console + // Set to English if language is not in list of good langs + if (!goodLangs.includes(langParam) && langParam !== 'test') { + langParam = 'en'; } url = conf.langPath + 'lang.' + langParam + '.js'; _context2.t0 = readLang; - _context2.next = 5; + _context2.next = 7; return importSetGlobalDefault(url, { global: 'svgEditorLang_' + langParam.replace(/-/g, '_') }); - case 5: + case 7: _context2.t1 = _context2.sent; return _context2.abrupt("return", (0, _context2.t0)(_context2.t1)); - case 7: + case 9: case "end": return _context2.stop(); } @@ -29152,7 +29141,7 @@ function _loadSvgString() { _loadSvgString = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee23(str) { - var _ref46, + var _ref47, noAlert, success, _args23 = arguments; @@ -29161,7 +29150,7 @@ function _loadSvgString() { while (1) { switch (_context23.prev = _context23.next) { case 0: - _ref46 = _args23.length > 1 && _args23[1] !== undefined ? _args23[1] : {}, noAlert = _ref46.noAlert; + _ref47 = _args23.length > 1 && _args23[1] !== undefined ? _args23[1] : {}, noAlert = _ref47.noAlert; success = svgCanvas.setSvgString(str) !== false; if (!success) { @@ -29273,16 +29262,16 @@ function getImportLocale(_ref) { * @param {boolean} [mayBeEmpty] If value may be falsey. * @returns {string|void} If val is missing or falsey and `mayBeEmpty` is not set, the * value of the previously stored preference will be returned. -* @todo Can we change setting on the jQuery namespace (onto editor) to avoid conflicts? * @todo Review whether any remaining existing direct references to -* getting `curPrefs` can be changed to use `$.pref()` getting to ensure -* `defaultPrefs` fallback (also for sake of `allowInitialUserOverride`); specifically, `bkgd_color` could be changed so that -* the pref dialog has a button to auto-calculate background, but otherwise uses `$.pref()` to be able to get default prefs -* or overridable settings +* getting `curPrefs` can be changed to use `svgEditor.pref()` getting to ensure +* `defaultPrefs` fallback (also for sake of `allowInitialUserOverride`); +* specifically, `bkgd_color` could be changed so that the pref dialog has a +* button to auto-calculate background, but otherwise uses `svgEditor.pref()` to +* be able to get default prefs or overridable settings */ -$$b.pref = function (key, val, mayBeEmpty) { +editor.pref = function (key, val, mayBeEmpty) { if (mayBeEmpty || val) { curPrefs[key] = val; /** @@ -29411,7 +29400,7 @@ editor.setConfig = function (opts, cfgCfg) { if (cfgCfg.allowInitialUserOverride === true) { defaultPrefs[key] = val; } else { - $$b.pref(key, val); + editor.pref(key, val); } } else if (['extensions', 'stylesheets', 'allowedOrigins'].includes(key)) { if (cfgCfg.overwrite === false && (curConfig.preventAllURLConfig || ['allowedOrigins', 'stylesheets'].includes(key) || key === 'extensions' && curConfig.lockExtensions)) { @@ -29623,7 +29612,6 @@ editor.init = function () { (function () { // Load config/data from URL if given - var src, qstr; urldata = $$b.deparam.querystring(true); if (!$$b.isEmptyObject(urldata)) { @@ -29656,21 +29644,26 @@ editor.init = function () { setupCurConfig(); if (!curConfig.preventURLContentLoading) { - src = urldata.source; - qstr = $$b.param.querystring(); + var _urldata = urldata, + source = _urldata.source; - if (!src) { + if (!source) { // urldata.source may have been null if it ended with '=' - if (qstr.includes('source=data:')) { - src = qstr.match(/source=(data:[^&]*)/)[1]; // ({src} = qstr.match(/source=(?data:[^&]*)/).groups); + var _ref4 = new URL(location), + searchParams = _ref4.searchParams; + + var src = searchParams.get('source'); + + if (src.startsWith('data:')) { + source = src; } } - if (src) { - if (src.startsWith('data:')) { - editor.loadFromDataURI(src); + if (source) { + if (source.startsWith('data:')) { + editor.loadFromDataURI(source); } else { - editor.loadFromString(src); + editor.loadFromString(source); } return; @@ -29725,22 +29718,22 @@ editor.init = function () { var extAndLocaleFunc = /*#__PURE__*/ function () { - var _ref4 = _asyncToGenerator( + var _ref5 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee3() { - var _ref5, langParam, langData, _uiStrings$common, ok, cancel; + var _ref6, langParam, langData, _uiStrings$common, ok, cancel; return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: _context3.next = 2; - return editor.putLocale(null, goodLangs, curConfig); + return editor.putLocale(editor.pref('lang'), goodLangs, curConfig); case 2: - _ref5 = _context3.sent; - langParam = _ref5.langParam; - langData = _ref5.langData; + _ref6 = _context3.sent; + langParam = _ref6.langParam; + langData = _ref6.langData; _context3.next = 7; return setLang(langParam, langData); @@ -29757,7 +29750,7 @@ editor.init = function () { return Promise.all(curConfig.extensions.map( /*#__PURE__*/ function () { - var _ref6 = _asyncToGenerator( + var _ref7 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee2(extname) { var extName, url, imported, _imported$name, _name2, init, importLocale; @@ -29825,7 +29818,7 @@ editor.init = function () { })); return function (_x2) { - return _ref6.apply(this, arguments); + return _ref7.apply(this, arguments); }; }())); @@ -29877,7 +29870,7 @@ editor.init = function () { })); return function extAndLocaleFunc() { - return _ref4.apply(this, arguments); + return _ref5.apply(this, arguments); }; }(); @@ -30011,7 +30004,7 @@ editor.init = function () { scaleElements(elems, scale); hiddenPs.css('visibility', 'visible').hide(); // return; - $$b.pref('iconsize', size); + editor.pref('iconsize', size); $$b('#iconsize').val(size); // Change icon size // $('.tool_button, .push_button, .tool_button_current, .disabled, .icon_label, #url_notice, #tool_open') // .find('> svg, > img').each(function () { @@ -30371,7 +30364,7 @@ editor.init = function () { while (1) { switch (_context4.prev = _context4.next) { case 0: - getStylesheetPriority = function _ref8(stylesheetFile) { + getStylesheetPriority = function _ref9(stylesheetFile) { switch (stylesheetFile) { case 'jgraduate/css/jPicker.css': return 1; @@ -30399,7 +30392,7 @@ editor.init = function () { minHeight = tleft.offset().top + tleft.outerHeight(); } - size = $$b.pref('iconsize'); + size = editor.pref('iconsize'); editor.setIconSize(size || ($$b(window).height() < minHeight ? 's' : 'm')); // Look for any missing flyout icons from plugins $$b('.tools_flyout').each(function () { @@ -30446,10 +30439,10 @@ editor.init = function () { _context4.next = 11; return loadStylesheets(stylesheets, { - acceptErrors: function acceptErrors(_ref7) { - var stylesheetURL = _ref7.stylesheetURL, - reject = _ref7.reject, - resolve = _ref7.resolve; + acceptErrors: function acceptErrors(_ref8) { + var stylesheetURL = _ref8.stylesheetURL, + reject = _ref8.reject, + resolve = _ref8.resolve; if ($$b.loadingStylesheets.includes(stylesheetURL)) { reject(new Error("Missing expected stylesheet: ".concat(stylesheetURL))); @@ -30736,7 +30729,7 @@ editor.init = function () { a.click(); // Alert will only appear the first time saved OR the // first time the bug is encountered - var done = $$b.pref('save_notice_done'); + var done = editor.pref('save_notice_done'); if (done !== 'all') { var note = uiStrings$1.notification.saveFromBrowser.replace('%s', 'SVG'); // Check if FF and has @@ -30745,13 +30738,13 @@ editor.init = function () { if (svg.includes(' 0 && _args18[0] !== undefined ? _args18[0] : {}, _ref32$cancelDeletes = _ref32.cancelDeletes, cancelDeletes = _ref32$cancelDeletes === void 0 ? false : _ref32$cancelDeletes; + _ref33 = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {}, _ref33$cancelDeletes = _ref33.cancelDeletes, cancelDeletes = _ref33$cancelDeletes === void 0 ? false : _ref33$cancelDeletes; curhref = svgCanvas.getHref(selectedElement); curhref = curhref.startsWith('data:') ? '' : curhref; _context18.next = 5; @@ -31966,10 +31959,10 @@ editor.init = function () { // Get this button's options var idSel = '#' + this.getAttribute('id'); - var _Object$entries$find = Object.entries(btnOpts).find(function (_ref9) { - var _ref10 = _slicedToArray(_ref9, 2), - _ = _ref10[0], - sel = _ref10[1].sel; + var _Object$entries$find = Object.entries(btnOpts).find(function (_ref10) { + var _ref11 = _slicedToArray(_ref10, 2), + _ = _ref11[0], + sel = _ref11[1].sel; return sel === idSel; }), @@ -31996,10 +31989,10 @@ editor.init = function () { if (ev.type === 'keydown') { var flyoutIsSelected = $$b(options.parent + '_show').hasClass('tool_button_current'); var currentOperation = $$b(options.parent + '_show').attr('data-curopt'); - Object.entries(holders[opts.parent]).some(function (_ref11) { - var _ref12 = _slicedToArray(_ref11, 2), - j = _ref12[0], - tool = _ref12[1]; + Object.entries(holders[opts.parent]).some(function (_ref12) { + var _ref13 = _slicedToArray(_ref12, 2), + j = _ref13[0], + tool = _ref13[1]; if (tool.sel !== currentOperation) { return false; @@ -32212,7 +32205,7 @@ editor.init = function () { var extAdded = /*#__PURE__*/ function () { - var _ref13 = _asyncToGenerator( + var _ref14 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee5(win, ext) { var cbCalled, resizeDone, lang, prepResize, runCallback, btnSelects, svgicons, fallbackObj, altsObj, placementObj, holders; @@ -32220,7 +32213,7 @@ editor.init = function () { while (1) { switch (_context5.prev = _context5.next) { case 0: - prepResize = function _ref14() { + prepResize = function _ref15() { if (resizeTimer) { clearTimeout(resizeTimer); resizeTimer = null; @@ -32229,7 +32222,7 @@ editor.init = function () { if (!resizeDone) { resizeTimer = setTimeout(function () { resizeDone = true; - setIconSize($$b.pref('iconsize')); + setIconSize(editor.pref('iconsize')); }, 50); } }; @@ -32256,7 +32249,7 @@ editor.init = function () { } // We check for this since the "lang" pref could have been set by storage - lang = $$b.pref('lang'); + lang = editor.pref('lang'); _context5.next = 10; return ext.langReady({ lang: lang, @@ -32673,7 +32666,7 @@ editor.init = function () { callback: function callback(icons) { // Non-ideal hack to make the icon match the current size // if (curPrefs.iconsize && curPrefs.iconsize !== 'm') { - if ($$b.pref('iconsize') !== 'm') { + if (editor.pref('iconsize') !== 'm') { prepResize(); } @@ -32695,7 +32688,7 @@ editor.init = function () { })); return function extAdded(_x4, _x5) { - return _ref13.apply(this, arguments); + return _ref14.apply(this, arguments); }; }(); /** @@ -32770,9 +32763,9 @@ editor.init = function () { * @listens module:svgcanvas.SvgCanvas#event:updateCanvas * @returns {void} */ - function (win, _ref15) { - var center = _ref15.center, - newCtr = _ref15.newCtr; + function (win, _ref16) { + var center = _ref16.center, + newCtr = _ref16.newCtr; updateCanvas(center, newCtr); }); svgCanvas.bind('contextset', contextChanged); @@ -32801,8 +32794,8 @@ editor.init = function () { $$b(this).addClass(curBg); }); }); - setBackground($$b.pref('bkgd_color'), $$b.pref('bkgd_url')); - $$b('#image_save_opts input').val([$$b.pref('img_save')]); + setBackground(editor.pref('bkgd_color'), editor.pref('bkgd_url')); + $$b('#image_save_opts input').val([editor.pref('img_save')]); /** * @type {module:jQuerySpinButton.ValueCallback} */ @@ -33653,7 +33646,7 @@ editor.init = function () { var makeHyperlink = /*#__PURE__*/ function () { - var _ref17 = _asyncToGenerator( + var _ref18 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee7() { var url; @@ -33685,7 +33678,7 @@ editor.init = function () { })); return function makeHyperlink() { - return _ref17.apply(this, arguments); + return _ref18.apply(this, arguments); }; }(); /** @@ -33808,7 +33801,7 @@ editor.init = function () { var clickClear = /*#__PURE__*/ function () { - var _ref18 = _asyncToGenerator( + var _ref19 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee8() { var _curConfig$dimensions, x, y, ok; @@ -33851,7 +33844,7 @@ editor.init = function () { })); return function clickClear() { - return _ref18.apply(this, arguments); + return _ref19.apply(this, arguments); }; }(); /** @@ -33885,7 +33878,7 @@ editor.init = function () { var clickSave = function clickSave() { // In the future, more options can be provided here var saveOpts = { - images: $$b.pref('img_save'), + images: editor.pref('img_save'), round_digits: 6 }; svgCanvas.save(saveOpts); @@ -33900,7 +33893,7 @@ editor.init = function () { var clickExport = /*#__PURE__*/ function () { - var _ref19 = _asyncToGenerator( + var _ref20 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee9() { var imgType, exportWindowName, openExportWindow, chrome, quality; @@ -33908,7 +33901,7 @@ editor.init = function () { while (1) { switch (_context9.prev = _context9.next) { case 0: - openExportWindow = function _ref20() { + openExportWindow = function _ref21() { var loadingImage = uiStrings$1.notification.loadingImage; if (curConfig.exportWindowType === 'new') { @@ -33999,7 +33992,7 @@ editor.init = function () { })); return function clickExport() { - return _ref19.apply(this, arguments); + return _ref20.apply(this, arguments); }; }(); /** @@ -34123,7 +34116,7 @@ editor.init = function () { docprops = true; // This selects the correct radio button by using the array notation - $$b('#image_save_opts input').val([$$b.pref('img_save')]); // update resolution option with actual resolution + $$b('#image_save_opts input').val([editor.pref('img_save')]); // update resolution option with actual resolution var res = svgCanvas.getResolution(); @@ -34152,7 +34145,7 @@ editor.init = function () { $$b('#main_menu').hide(); // Update background color with current one var canvasBg = curPrefs.bkgd_color; - var url = $$b.pref('bkgd_url'); + var url = editor.pref('bkgd_url'); blocks.each(function () { var blk = $$b(this); var isBg = blk.css('background-color') === canvasBg; @@ -34205,7 +34198,7 @@ editor.init = function () { var saveSourceEditor = /*#__PURE__*/ function () { - var _ref21 = _asyncToGenerator( + var _ref22 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee10() { var saveChanges, ok; @@ -34265,7 +34258,7 @@ editor.init = function () { })); return function saveSourceEditor() { - return _ref21.apply(this, arguments); + return _ref22.apply(this, arguments); }; }(); /** @@ -34278,7 +34271,7 @@ editor.init = function () { $$b('#svg_docprops').hide(); $$b('#canvas_width,#canvas_height').removeAttr('disabled'); $$b('#resolution')[0].selectedIndex = 0; - $$b('#image_save_opts input').val([$$b.pref('img_save')]); + $$b('#image_save_opts input').val([editor.pref('img_save')]); docprops = false; }; /** @@ -34335,7 +34328,7 @@ editor.init = function () { } // Set image save option - $$b.pref('img_save', $$b('#image_save_opts :checked').val()); + editor.pref('img_save', $$b('#image_save_opts :checked').val()); updateCanvas(); hideDocProperties(); return true; @@ -34352,7 +34345,7 @@ editor.init = function () { _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee11() { - var color, lang, _ref23, langParam, langData; + var color, lang, _ref24, langParam, langData; return regeneratorRuntime.wrap(function _callee11$(_context11) { while (1) { @@ -34364,7 +34357,7 @@ editor.init = function () { lang = $$b('#lang_select').val(); - if (!(lang !== $$b.pref('lang'))) { + if (!(lang && lang !== editor.pref('lang'))) { _context11.next = 11; break; } @@ -34373,9 +34366,9 @@ editor.init = function () { return editor.putLocale(lang, goodLangs, curConfig); case 6: - _ref23 = _context11.sent; - langParam = _ref23.langParam; - langData = _ref23.langData; + _ref24 = _context11.sent; + langParam = _ref24.langParam; + langData = _ref24.langData; _context11.next = 11; return setLang(langParam, langData); @@ -34415,7 +34408,7 @@ editor.init = function () { var cancelOverlays = /*#__PURE__*/ function () { - var _ref24 = _asyncToGenerator( + var _ref25 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee12() { var ok; @@ -34486,7 +34479,7 @@ editor.init = function () { })); return function cancelOverlays() { - return _ref24.apply(this, arguments); + return _ref25.apply(this, arguments); }; }(); @@ -34814,7 +34807,7 @@ editor.init = function () { // Disable option $$b('#image_save_opts [value=embed]').attr('disabled', 'disabled'); $$b('#image_save_opts input').val(['ref']); - $$b.pref('img_save', 'ref'); + editor.pref('img_save', 'ref'); $$b('#image_opt_embed').css('color', '#666').attr('title', uiStrings$1.notification.featNotSupported); } }); @@ -36228,8 +36221,8 @@ editor.init = function () { // bitmap handling reader = new FileReader(); - reader.onloadend = function (_ref27) { - var result = _ref27.target.result; + reader.onloadend = function (_ref28) { + var result = _ref28.target.result; /** * Insert the new image until we know its dimensions. @@ -36281,7 +36274,7 @@ editor.init = function () { var open = $$b('').change( /*#__PURE__*/ function () { - var _ref28 = _asyncToGenerator( + var _ref29 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee16(e) { var ok, reader; @@ -36312,15 +36305,15 @@ editor.init = function () { reader.onloadend = /*#__PURE__*/ function () { - var _ref30 = _asyncToGenerator( + var _ref31 = _asyncToGenerator( /*#__PURE__*/ - regeneratorRuntime.mark(function _callee15(_ref29) { + regeneratorRuntime.mark(function _callee15(_ref30) { var target; return regeneratorRuntime.wrap(function _callee15$(_context15) { while (1) { switch (_context15.prev = _context15.next) { case 0: - target = _ref29.target; + target = _ref30.target; _context15.next = 3; return loadSvgString(target.result); @@ -36336,7 +36329,7 @@ editor.init = function () { })); return function (_x7) { - return _ref30.apply(this, arguments); + return _ref31.apply(this, arguments); }; }(); @@ -36352,7 +36345,7 @@ editor.init = function () { })); return function (_x6) { - return _ref28.apply(this, arguments); + return _ref29.apply(this, arguments); }; }()); $$b('#tool_open').show(); @@ -36383,7 +36376,7 @@ editor.init = function () { var setLang = editor.setLang = /*#__PURE__*/ function () { - var _ref31 = _asyncToGenerator( + var _ref32 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee17(lang, allStrings) { var oldLayerName, renameLayer, elems; @@ -36392,7 +36385,7 @@ editor.init = function () { switch (_context17.prev = _context17.next) { case 0: editor.langChanged = true; - $$b.pref('lang', lang); + editor.pref('lang', lang); $$b('#lang_select').val(lang); if (allStrings) { @@ -36491,7 +36484,7 @@ editor.init = function () { })); return function (_x8, _x9) { - return _ref31.apply(this, arguments); + return _ref32.apply(this, arguments); }; }(); @@ -36585,9 +36578,9 @@ regeneratorRuntime.mark(function _callee20() { case 0: _context20.prev = 0; _context20.next = 3; - return Promise.all(callbacks.map(function (_ref34) { - var _ref35 = _slicedToArray(_ref34, 1), - cb = _ref35[0]; + return Promise.all(callbacks.map(function (_ref35) { + var _ref36 = _slicedToArray(_ref35, 1), + cb = _ref36[0]; return cb(); // eslint-disable-line promise/prefer-await-to-callbacks })); @@ -36599,18 +36592,18 @@ regeneratorRuntime.mark(function _callee20() { case 5: _context20.prev = 5; _context20.t0 = _context20["catch"](0); - callbacks.forEach(function (_ref36) { - var _ref37 = _slicedToArray(_ref36, 3), - reject = _ref37[2]; + callbacks.forEach(function (_ref37) { + var _ref38 = _slicedToArray(_ref37, 3), + reject = _ref38[2]; reject(); }); throw _context20.t0; case 9: - callbacks.forEach(function (_ref38) { - var _ref39 = _slicedToArray(_ref38, 2), - resolve = _ref39[1]; + callbacks.forEach(function (_ref39) { + var _ref40 = _slicedToArray(_ref39, 2), + resolve = _ref40[1]; resolve(); }); @@ -36631,8 +36624,8 @@ regeneratorRuntime.mark(function _callee20() { */ editor.loadFromString = function (str) { - var _ref40 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - noAlert = _ref40.noAlert; + var _ref41 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + noAlert = _ref41.noAlert; return editor.ready( /*#__PURE__*/ @@ -36702,9 +36695,9 @@ editor.disableUI = function (featList) {// $(function () { editor.loadFromURL = function (url) { - var _ref42 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - cache = _ref42.cache, - noAlert = _ref42.noAlert; + var _ref43 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + cache = _ref43.cache, + noAlert = _ref43.noAlert; return editor.ready(function () { return new Promise(function (resolve, reject) { @@ -36753,8 +36746,8 @@ editor.loadFromURL = function (url) { editor.loadFromDataURI = function (str) { - var _ref43 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - noAlert = _ref43.noAlert; + var _ref44 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + noAlert = _ref44.noAlert; return editor.ready(function () { var base64 = false; @@ -36811,9 +36804,9 @@ var messageQueue = []; * @returns {void} */ -var messageListener = function messageListener(_ref44) { - var data = _ref44.data, - origin = _ref44.origin; +var messageListener = function messageListener(_ref45) { + var data = _ref45.data, + origin = _ref45.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 dcb2e060..b457a046 100644 --- a/dist/index-es.min.js +++ b/dist/index-es.min.js @@ -138,7 +138,7 @@ var _r={svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"}; * John Dyers' website: {@link http://johndyer.name} * Color Picker page: {@link http://johndyer.name/photoshop-like-javascript-color-picker/} */ -function br(e,t){return void 0===t&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)}window.console||(window.console={log:function(e){},dir:function(e){}});var xr,wr,Sr=function(e){return null==e},kr=jQuery,Cr=function(e,t,n){var r=kr("#svg_editor").parent();Object.entries(t).forEach((function(t){var a=d(t,2),i=a[0],o=a[1];o||console.log(i),n&&(i="#"+i);var s=r.find(i);if(s.length){var l=s[0];switch(e){case"aria-label":l.setAttribute("aria-label",o);break;case"content":h(l.childNodes).some((function(e){return!(3!==e.nodeType||!e.textContent.trim())&&(e.textContent=o,!0)}));break;case"title":l.title=o}}else console.log("Missing element for localization: "+i)}))},Ar=function(){var e=n(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,s,l,c,u,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wr.addLangData(xr);case 2:if(n=e.sent,kr.each(n,(function(e,n){n.data&&(t=kr.merge(t,n.data))})),t.tools){e.next=6;break}return e.abrupt("return",void 0);case 6:return a=(r=t).tools,i=r.properties,o=r.config,s=r.layers,l=r.common,c=r.ui,Cr("content",{curve_segments:i.curve_segments,fitToContent:a.fitToContent,fit_to_all:a.fit_to_all,fit_to_canvas:a.fit_to_canvas,fit_to_layer_content:a.fit_to_layer_content,fit_to_sel:a.fit_to_sel,icon_large:o.icon_large,icon_medium:o.icon_medium,icon_small:o.icon_small,icon_xlarge:o.icon_xlarge,image_opt_embed:o.image_opt_embed,image_opt_ref:o.image_opt_ref,includedImages:o.included_images,largest_object:a.largest_object,layersLabel:s.layers,page:a.page,relativeToLabel:a.relativeTo,selLayerLabel:s.move_elems_to,selectedPredefined:o.select_predefined,selected_objects:a.selected_objects,smallest_object:a.smallest_object,straight_segments:i.straight_segments,svginfo_bg_url:o.editor_img_url+":",svginfo_bg_note:o.editor_bg_note,svginfo_change_background:o.background,svginfo_dim:o.doc_dims,svginfo_editor_prefs:o.editor_prefs,svginfo_height:l.height,svginfo_icons:o.icon_size,svginfo_image_props:o.image_props,svginfo_lang:o.language,svginfo_title:o.doc_title,svginfo_width:l.width,tool_docprops_cancel:l.cancel,tool_docprops_save:l.ok,tool_source_cancel:l.cancel,tool_source_save:l.ok,tool_prefs_cancel:l.cancel,tool_prefs_save:l.ok,sidepanel_handle:s.layers.split("").join(" "),tool_clear:a.new_doc,tool_docprops:a.docprops,tool_export:a.export_img,tool_import:a.import_doc,tool_open:a.open_doc,tool_save:a.save_doc,tool_editor_prefs:o.editor_prefs,tool_editor_homepage:a.editor_homepage,svginfo_units_rulers:o.units_and_rulers,svginfo_rulers_onoff:o.show_rulers,svginfo_unit:o.base_unit,svginfo_grid_settings:o.grid,svginfo_snap_onoff:o.snapping_onoff,svginfo_snap_step:o.snapping_stepsize,svginfo_grid_color:o.grid_color},!0),u={},["cut","copy","paste","paste_in_place","delete","group","ungroup","move_front","move_up","move_down","move_back"].forEach((function(e){u['#cmenu_canvas a[href="#'+e+'"]']=a[e]})),["dupe","merge_down","merge_all"].forEach((function(e){u['#cmenu_layers a[href="#'+e+'"]']=s[e]})),u['#cmenu_layers a[href="#delete"]']=s.del,Cr("content",u),h={},Object.entries({tool_blur:i.blur,tool_position:a.align_to_page,tool_font_family:i.font_family,zoom_panel:c.zoom_level,stroke_linejoin:i.linejoin_miter,stroke_linecap:i.linecap_butt,tool_opacity:i.opacity}).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];h["#"+n+" button"]=r})),Object.entries({group_opacity:i.opacity,zoom:c.zoom_level}).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];h["#"+n]=r})),Cr("aria-label",h),Cr("title",{align_relative_to:a.align_relative_to,circle_cx:i.circle_cx,circle_cy:i.circle_cy,circle_r:i.circle_r,cornerRadiusLabel:i.corner_radius,ellipse_cx:i.ellipse_cx,ellipse_cy:i.ellipse_cy,ellipse_rx:i.ellipse_rx,ellipse_ry:i.ellipse_ry,fill_color:i.fill_color,font_family:i.font_family,idLabel:i.id,image_height:i.image_height,image_url:i.image_url,image_width:i.image_width,layer_delete:s.del,layer_down:s.move_down,layer_new:s.new,layer_rename:s.rename,layer_moreopts:l.more_opts,layer_up:s.move_up,line_x1:i.line_x1,line_x2:i.line_x2,line_y1:i.line_y1,line_y2:i.line_y2,linecap_butt:i.linecap_butt,linecap_round:i.linecap_round,linecap_square:i.linecap_square,linejoin_bevel:i.linejoin_bevel,linejoin_miter:i.linejoin_miter,linejoin_round:i.linejoin_round,main_icon:a.main_menu,palette:c.palette_info,zoom_panel:c.zoom_level,path_node_x:i.node_x,path_node_y:i.node_y,rect_height_tool:i.rect_height,rect_width_tool:i.rect_width,seg_type:i.seg_type,selLayerNames:s.move_selected,selected_x:i.pos_x,selected_y:i.pos_y,stroke_color:i.stroke_color,stroke_style:i.stroke_style,stroke_width:i.stroke_width,svginfo_title:o.doc_title,text:i.text_contents,toggle_stroke_tools:c.toggle_stroke_tools,tool_add_subpath:a.add_subpath,tool_alignbottom:a.align_bottom,tool_aligncenter:a.align_center,tool_alignleft:a.align_left,tool_alignmiddle:a.align_middle,tool_alignright:a.align_right,tool_aligntop:a.align_top,tool_angle:i.angle,tool_blur:i.blur,tool_bold:i.bold,tool_circle:a.mode_circle,tool_clone:a.clone,tool_clone_multi:a.clone,tool_delete:a.del,tool_delete_multi:a.del,tool_ellipse:a.mode_ellipse,tool_fhellipse:a.mode_fhellipse,tool_fhpath:a.mode_fhpath,tool_fhrect:a.mode_fhrect,tool_font_size:i.font_size,tool_group_elements:a.group_elements,tool_make_link:a.make_link,tool_link_url:a.set_link_url,tool_image:a.mode_image,tool_italic:i.italic,tool_line:a.mode_line,tool_move_bottom:a.move_bottom,tool_move_top:a.move_top,tool_node_clone:a.node_clone,tool_node_delete:a.node_delete,tool_node_link:a.node_link,tool_opacity:i.opacity,tool_openclose_path:a.openclose_path,tool_path:a.mode_path,tool_position:a.align_to_page,tool_rect:a.mode_rect,tool_redo:a.redo,tool_reorient:a.reorient_path,tool_select:a.mode_select,tool_source:a.source_save,tool_square:a.mode_square,tool_text:a.mode_text,tool_topath:a.to_path,tool_undo:a.undo,tool_ungroup:a.ungroup,tool_wireframe:a.wireframe_mode,tool_zoom:a.mode_zoom,url_notice:a.no_embed},!0),e.abrupt("return",{langParam:xr,langData:t});case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Er=function(){var e=n(regeneratorRuntime.mark((function e(t,n,r){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t?xr=t:((xr=kr.pref("lang"))||(navigator.userLanguage?xr=navigator.userLanguage:navigator.language&&(xr=navigator.language)),console.log("Lang: "+xr),n.includes(xr)||"test"===xr||(xr="en")),a=r.langPath+"lang."+xr+".js",e.t0=Ar,e.next=5,un(a,{global:"svgEditorLang_"+xr.replace(/-/g,"_")});case 5:return e.t1=e.sent,e.abrupt("return",(0,e.t0)(e.t1));case 7:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();function Gr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Pr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.before,r=t.after,a=t.favicon,i=t.canvas,o=t.image,s=void 0===o||o,l=t.acceptErrors;return e=Array.isArray(e)?e:[e],Promise.all(e.map((function(e){return function(e){var t={};if(Array.isArray(e)){var o=Gr(e,2);e=o[0];var c=o[1];t=void 0===c?{}:c}var u=t.favicon,d=void 0===u?a:u,h=t,f=h.before,p=void 0===f?n:f,g=h.after,m=void 0===g?r:g,v=h.canvas,y=void 0===v?i:v,_=h.image,b=void 0===_?s:_;function x(){p?p.before(w):m?m.after(w):document.head.appendChild(w)}var w=document.createElement("link");return new Promise((function(n,r){var a=r;if(l&&(a="function"==typeof l?function(a){l({error:a,stylesheetURL:e,options:t,resolve:n,reject:r})}:n),e.endsWith(".css")?d=!1:e.endsWith(".ico")&&(d=!0),d){if(w.rel="shortcut icon",w.type="image/x-icon",!1===b)return w.href=e,x(),void n(w);var i=document.createElement("canvas");i.width=16,i.height=16;var o=i.getContext("2d"),s=document.createElement("img");return s.addEventListener("error",(function(e){r(e)})),s.addEventListener("load",(function(){o.drawImage(s,0,0),w.href=y?i.toDataURL("image/x-icon"):e,x(),n(w)})),void(s.src=e)}w.rel="stylesheet",w.type="text/css",w.href=e,x(),w.addEventListener("error",(function(e){a(e)})),w.addEventListener("load",(function(){n(w)}))}))}(e)})))}var Ir={},Nr=[function(e){function t(t){if("string"==typeof t.data){var n=t.handler,r=t.data.toLowerCase().split(" ");t.handler=function(t){if(this===t.target||27===t.which||!/textarea|select/i.test(t.target.nodeName)&&"text"!==t.target.type){var a="keypress"!==t.type&&e.hotkeys.specialKeys[t.which],i=String.fromCharCode(t.which).toLowerCase(),o="",s={};t.altKey&&"alt"!==a&&(o+="alt+"),t.ctrlKey&&"ctrl"!==a&&(o+="ctrl+"),t.metaKey&&!t.ctrlKey&&"meta"!==a&&(o+="meta+"),t.shiftKey&&"shift"!==a&&(o+="shift+"),a?s[o+a]=!0:(s[o+i]=!0,s[o+e.hotkeys.shiftNums[i]]=!0,"shift+"===o&&(s[e.hotkeys.shiftNums[i]]=!0));for(var l=0,c=r.length;l","/":"?","\\":"|"}},e.each(["keydown","keyup","keypress"],(function(){e.event.special[this]={add:t}})),e},function(t){return function(t,n){var r,a,i,o,s,l,c,u,d=Array.prototype.slice,h=decodeURIComponent,f=t.param,p=t.bbq=t.bbq||{},g=t.event.special,m="hashchange",v="querystring",y="fragment",_="elemUrlAttr",b="location",x="href",w="src",S=/^.*\?|#.*$/g,k=/^.*\#/,C={};function A(e){return"string"==typeof e}function E(e){var t=d.call(arguments,1);return function(){return e.apply(this,t.concat(d.call(arguments)))}}function G(e,a,o,s,l){var c,d,p,g,m;return s!==r?(m=(p=o.match(e?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/))[3]||"",2===l&&A(s)?d=s.replace(e?k:S,""):(g=i(p[2]),s=A(s)?i[e?y:v](s):s,d=2===l?s:1===l?t.extend({},s,g):t.extend({},g,s),d=f(d),e&&(d=d.replace(u,h))),c=p[1]+(e?"#":d||!p[1]?"?":"")+d+m):c=a(o!==r?o:n[b][x]),c}function P(e,t,n){return t===r||"boolean"==typeof t?(n=t,t=f[e?y:v]()):t=A(t)?t.replace(e?k:S,""):t,i(t,n)}function I(n,a,i,o){return A(i)||"object"===e(i)||(o=i,i=a,a=r),this.each((function(){var e=t(this),r=a||c()[(this.nodeName||"").toLowerCase()]||"",s=r&&e.attr(r)||"";e.attr(r,f[n](s,i,o))}))}f[v]=E(G,0,(function(e){return e.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")})),f[y]=a=E(G,1,(function(e){return e.replace(/^[^#]*#?(.*)$/,"$1")})),a.noEscape=function(e){e=e||"";var n=t.map(e.split(""),encodeURIComponent);u=new RegExp(n.join("|"),"g")},a.noEscape(",/"),t.deparam=i=function(e,n){var a={},i={true:!0,false:!1,null:null};return t.each(e.replace(/\+/g," ").split("&"),(function(e,o){var s,l=o.split("="),c=h(l[0]),u=a,d=0,f=c.split("]["),p=f.length-1;if(/\[/.test(f[0])&&/\]$/.test(f[p])?(f[p]=f[p].replace(/\]$/,""),p=(f=f.shift().split("[").concat(f)).length-1):p=0,2===l.length)if(s=h(l[1]),n&&(s=s&&!isNaN(s)?+s:"undefined"===s?r:i[s]!==r?i[s]:s),p)for(;d<=p;d++)u=u[c=""===f[d]?u.length:f[d]]=d').hide().insertAfter("body")[0].contentWindow,s=function(){return v(i.document[u][h])},(o=function(e,t){if(e!==t){var n=i.document;n.open().close(),n[u].hash="#"+e}})(v()))),function r(){var i=v(),l=s(n);i!==n?(o(n=i,l),e(t).trigger(d)):l!==n&&(t[u][h]=t[u][h].replace(/#.*/,"")+"#"+l),a=setTimeout(r,e[d+"Delay"])}()}},l.stop=function(){i||(a&&clearTimeout(a),a=0)},r=l}(t,window),t},function(e){var t={};return e.svgIcons=function(n){var r,a,i,o,s,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c="http://www.w3.org/2000/svg",u="http://www.w3.org/1999/xlink",d=l.w||24,h=l.h||24,f=!1,p=!1,g=0,m="data:image/svg+xml;charset=utf-8;base64,";if(l.svgz){o=e('').appendTo("body").hide();try{a=o[0].contentDocument,o.load(y),y(0,!0)}catch(e){w()}}else{var v=new DOMParser;e.ajax({url:n,dataType:"string",success:function(t){t?(a=v.parseFromString(t,"text/xml"),e((function(){y("ajax")}))):e(w)},error:function(t){window.opera?e((function(){w()})):t.responseText?((a=v.parseFromString(t.responseText,"text/xml")).childNodes.length||e(w),e((function(){y("ajax")}))):e(w)}})}function y(t,n){if("ajax"!==t){if(p)return;var s=(a=o[0].contentDocument)&&a.getElementById("svg_eof");if(!(s||n&&s))return void(++g<50?setTimeout(y,20):(w(),p=!0));p=!0}if(r=e(a.firstChild).children(),l.no_img)setTimeout((function(){f||x()}),500);else{var c=m+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";i=e(new Image).attr({src:c,width:0,height:0,alt:l.testIconAlt||"icon"}).appendTo("body").load((function(){x(!0)})).error((function(){x()}))}}function _(e,t,n,r){if(vr&&t.css("visibility","hidden"),l.replace){r&&t.attr("id",n);var a=e.attr("class");if(a&&t.attr("class","svg_icon "+a),!e.alt){var i="icon";l.alts&&(i=l.alts[n]||i),t.attr("alt",i)}e.replaceWith(t)}else e.append(t);vr&&setTimeout((function(){t.removeAttr("style")}),1)}function b(e,n){void 0!==l.id_match&&!1===l.id_match||_(s,e,n,!0),t[n]=e}function x(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!f){var p;if(l.no_img&&(n=!1),n&&(p=e(document.createElement("div"))).hide().appendTo("body"),a){var g=l.fallback_path||"";e.each(a,(function(t,n){s=e("#"+t);var r="icon";l.alts&&(r=l.alts[t]||r),b(e(new Image).attr({class:"svg_icon",src:g+n,width:d,height:h,alt:r}),t)}))}else for(var v=r.length,y=0;y0&&!n&&(i=yr(i,r)),_(e(this),i,a)}))})),a||(n&&p.remove(),o&&o.remove(),i&&i.remove()),l.resize&&e.resizeSvgIcons(l.resize),f=!0,l.callback&&l.callback(t)}}function w(){if(n.includes(".svgz")){var t=n.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg"),e.svgIcons(t,l)}else l.fallback&&x(!1,l.fallback)}},e.getSvgIcon=function(e,n){var r=t[e];return n&&r&&(r=yr(r,0).clone(!0)),r},e.resizeSvgIcons=function(t){var n=!e(".svg_icon:first").length;e.each(t,(function(t,r){var a=Array.isArray(r),i=a?r[0]:r,o=a?r[1]:r;n&&(t=t.replace(/\.svg_icon/g,"svg")),e(t).each((function(){this.setAttribute("width",i),this.setAttribute("height",o),window.opera&&window.widget&&(this.parentNode.style.width=i+"px",this.parentNode.style.height=o+"px")}))}))},e},function(t){t.loadingStylesheets||(t.loadingStylesheets=[]),t.loadingStylesheets.includes("jgraduate/css/jGraduate.css")||t.loadingStylesheets.push("jgraduate/css/jGraduate.css"),t.jGraduate={Paint:function e(t){r(this,e);var n=t||{};if(this.alpha=isNaN(n.alpha)?100:n.alpha,n.copy)switch(this.type=n.copy.type,this.alpha=n.copy.alpha,this.solidColor=null,this.linearGradient=null,this.radialGradient=null,this.type){case"none":break;case"solidColor":this.solidColor=n.copy.solidColor;break;case"linearGradient":this.linearGradient=n.copy.linearGradient.cloneNode(!0);break;case"radialGradient":this.radialGradient=n.copy.radialGradient.cloneNode(!0)}else n.linearGradient?(this.type="linearGradient",this.solidColor=null,this.radialGradient=null,this.linearGradient=n.linearGradient.cloneNode(!0)):n.radialGradient?(this.type="radialGradient",this.solidColor=null,this.linearGradient=null,this.radialGradient=n.radialGradient.cloneNode(!0)):n.solidColor?(this.type="solidColor",this.solidColor=n.solidColor):(this.type="none",this.solidColor=null,this.linearGradient=null,this.radialGradient=null)}},t.fn.jGraduateDefaults={paint:new t.jGraduate.Paint,window:{pickerTitle:"Drag markers to pick a paint"},images:{clientPath:"images/"},newstop:"inverse"};var n=navigator.userAgent.includes("Gecko/");function a(e,t,r){var a=document.createElementNS(_r.svg,e);return function(e,t){n?Object.entries(t).forEach((function(t){var n=d(t,2),r=n[0],a=n[1];e.setAttribute(r,a)})):Object.entries(t).forEach((function(t){var n=d(t,2),r=n[0],a=n[1],i=e[r];i&&"SVGLength"===i.constructor?i.baseVal.value=a:e.setAttribute(r,a)}))}(a,t),r&&r.append(a),a}return t.fn.jGraduate=function(n,r,i){return this.each((function(){var o=t(this),s=t.extend(!0,{},t.fn.jGraduateDefaults,n||{}),l=o.attr("id"),c="#"+o.attr("id")+" ";if(c){var u=function(){switch(o.paint.type){case"radialGradient":o.paint.linearGradient=null;break;case"linearGradient":o.paint.radialGradient=null;break;case"solidColor":o.paint.radialGradient=o.paint.linearGradient=null}"function"==typeof o.okCallback&&o.okCallback(o.paint),o.hide()},d=function(){"function"==typeof o.cancelCallback&&o.cancelCallback(),o.hide()};t.extend(!0,o,{paint:new t.jGraduate.Paint({copy:s.paint}),okCallback:"function"==typeof r?r:null,cancelCallback:"function"==typeof i?i:null});var h=null,f=t(window);"none"===o.paint.type&&(o.paint=new t.jGraduate.Paint({solidColor:"ffffff"})),o.addClass("jGraduate_Picker"),o.html('
  • Solid Color
  • Linear Gradient
  • Radial Gradient
');var p=t(c+"> .jGraduate_colPick"),g=t(c+"> .jGraduate_gradPick");g.html('

'+s.window.pickerTitle+'


');var m=256,v=m-0,y=m-0,_={};t(".jGraduate_SliderBar").width(145);var b,x=t("#"+l+"_jGraduate_GradContainer")[0],w=a("svg",{id:l+"_jgraduate_svg",width:m,height:m,xmlns:_r.svg},x),S=o.paint.type,k=o.paint[S],C=k,A=o.paint.alpha,E="solidColor"===S;switch(S){case"solidColor":case"linearGradient":if(E||(C.id=l+"_lg_jgraduate_grad",k=C=w.appendChild(C)),a("radialGradient",{id:l+"_rg_jgraduate_grad"},w),"linearGradient"===S)break;case"radialGradient":E||(C.id=l+"_rg_jgraduate_grad",k=C=w.appendChild(C)),a("linearGradient",{id:l+"_lg_jgraduate_grad"},w)}if(E){k=C=t("#"+l+"_lg_jgraduate_grad")[0],Me(0,"#"+(h=o.paint[S]),1);var G=e(s.newstop);if("string"===G)switch(s.newstop){case"same":Me(1,"#"+h,1);break;case"inverse":for(var P="",I=0;I<6;I+=2){var N=(255-parseInt(h.substr(I,2),16)).toString(16);N.length<2&&(N=0+N),P+=N}Me(1,"#"+P,1);break;case"white":Me(1,"#ffffff",1);break;case"black":Me(1,"#000000",1)}else if("object"===G){var T="opac"in s.newstop?s.newstop.opac:1;Me(1,s.newstop.color||"#"+h,T)}}var L,M=parseFloat(k.getAttribute("x1")||0),O=parseFloat(k.getAttribute("y1")||0),j=parseFloat(k.getAttribute("x2")||1),V=parseFloat(k.getAttribute("y2")||0),R=parseFloat(k.getAttribute("cx")||.5),B=parseFloat(k.getAttribute("cy")||.5),D=parseFloat(k.getAttribute("fx")||R),U=parseFloat(k.getAttribute("fy")||B),F=a("rect",{id:l+"_jgraduate_rect",x:0,y:0,width:v,height:y,fill:"url(#"+l+"_jgraduate_grad)","fill-opacity":A/100},w),H=t("
").attr({class:"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:O*m,left:M*m}).data("coord","start").appendTo(x),z=H.clone().text(2).css({top:V*m,left:j*m}).attr("title","End stop").data("coord","end").appendTo(x),q=t("
").attr({class:"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:B*m,left:R*m}).data("coord","center").appendTo(x),Y=q.clone().text("F").css({top:U*m,left:D*m,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(x);Y[0].id=l+"_jGraduate_focusCoord",t.each(["x1","y1","x2","y2","cx","cy","fx","fy"],(function(e,n){var r=isNaN(n[1]),a=C.getAttribute(n);a||(a=r?"0.5":"x2"===n?"1.0":"0.0"),_[n]=t("#"+l+"_jGraduate_"+n).val(a).change((function(){isNaN(parseFloat(this.value))||this.value<0?this.value=0:this.value>1&&(this.value=1),("f"!==n[0]||L)&&(r&&"radialGradient"===S||!r&&"linearGradient"===S)&&C.setAttribute(n,this.value);var e=r?"c"===n[0]?q:Y:"1"===n[1]?H:z,t=n.includes("x")?"left":"top";e.css(t,this.value*m)})).change()}));var W,X,Q,K,Z=t("#"+l+"_jGraduate_StopSlider"),$=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},void 0),J=1,ee=1,te=0,ne=R,re=B,ae=a("svg",{width:"100%",height:45},Z[0]),ie=a("pattern",{width:16,height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},ae),oe=a("image",{width:16,height:16},ie),se=s.images.clientPath+"map-opacity.png";oe.setAttributeNS(_r.xlink,"xlink:href",se),t(ae).click((function(e){if(K=Z.offset(),"path"!==e.target.tagName){var t=e.pageX-K.left-8;Me((t=t<10?10:t>m+10?m+10:t)/m,0,0,!0),e.stopPropagation()}})),t(ae).mouseover((function(){ae.append($)})),b=a("g",{},ae),a("line",{x1:10,y1:15,x2:m+10,y2:15,"stroke-width":2,stroke:"#000"},ae);var le,ce,ue,de,he=g.find(".jGraduate_spreadMethod").change((function(){C.setAttribute("spreadMethod",t(this).val())})),fe=null,pe=function(e){var t=e.pageX-le.left,n=e.pageY-le.top;t=t<0?0:t>m?m:t,n=n<0?0:n>m?m:n,fe.css("left",t).css("top",n);var r=t/v,a=n/y,i=fe.data("coord"),o=C;switch(i){case"start":_.x1.val(r),_.y1.val(a),o.setAttribute("x1",r),o.setAttribute("y1",a);break;case"end":_.x2.val(r),_.y2.val(a),o.setAttribute("x2",r),o.setAttribute("y2",a);break;case"center":_.cx.val(r),_.cy.val(a),o.setAttribute("cx",r),o.setAttribute("cy",a),ne=r,re=a,Ve();break;case"focus":_.fx.val(r),_.fy.val(a),o.setAttribute("fx",r),o.setAttribute("fy",a),Ve()}e.preventDefault()},ge=function e(){fe=null,f.unbind("mousemove",pe).unbind("mouseup",e)},me=(W=C.getElementsByTagNameNS(_r.svg,"stop")).length;if(me<2){for(;me<2;)C.append(document.createElementNS(_r.svg,"stop")),++me;W=C.getElementsByTagNameNS(_r.svg,"stop")}for(var ve=0;ve99.5&&(n=99.5),n>0?ee=1-n/100:J=-n/100-1,a=(n+100)/2*145/100,t&&Ve();break;case"angle":a=(te=n)/180,a+=.5,a*=145,t&&Ve()}a>145?a=145:a<0&&(a=0),r.css({"margin-left":a-5})})).change()}));for(var Pe=function(e){!function(e){var t=de.offset.left,n=de.parent,r=e.pageX-t-parseInt(n.css("border-left-width"));r>145&&(r=145),r<=0&&(r=0);var a=r-5;switch(r/=145,de.type){case"radius":(r=Math.pow(2*r,2.5))>.98&&r<1.02&&(r=1),r<=.01&&(r=.01),C.setAttribute("r",r);break;case"opacity":o.paint.alpha=parseInt(100*r),F.setAttribute("fill-opacity",r);break;case"ellip":J=1,ee=1,r<.5?J=(r/=.5)<=0?.01:r:r>.5&&(ee=(r=2-(r/=.5))<=0?.01:r),Ve(),ee===(r-=1)+1&&(r=Math.abs(r));break;case"angle":r-=.5,te=r*=180,Ve(),r/=100}de.elem.css({"margin-left":a}),r=Math.round(100*r),de.input.val(r)}(e),e.preventDefault()},Ie=function e(t){f.unbind("mousemove",Pe).unbind("mouseup",e),de=null},Ne=(255*o.paint.alpha/100).toString(16);Ne.length<2;)Ne="0"+Ne;Ne=Ne.split(".")[0],h="none"===o.paint.solidColor?"":o.paint.solidColor+Ne,E||(h=W[0].getAttribute("stop-color")),t.extend(t.fn.jPicker.defaults.window,{alphaSupport:!0,effects:{type:"show",speed:0}}),p.jPicker({window:{title:s.window.pickerTitle},images:{clientPath:s.images.clientPath},color:{active:h,alphaSupport:!0}},(function(e){o.paint.type="solidColor",o.paint.alpha=e.val("ahex")?Math.round(e.val("a")/255*100):100,o.paint.solidColor=e.val("hex")?e.val("hex"):"none",o.paint.radialGradient=null,u()}),null,(function(){d()}));var Te,Le=t(c+" .jGraduate_tabs li");switch(Le.click((function(){Le.removeClass("jGraduate_tab_current"),t(this).addClass("jGraduate_tab_current"),t(c+" > div").hide();var e=t(this).attr("data-type");if(t(c+" .jGraduate_gradPick").show(),"rg"===e||"lg"===e){t(".jGraduate_"+e+"_field").show(),t(".jGraduate_"+("lg"===e?"rg":"lg")+"_field").hide(),t("#"+l+"_jgraduate_rect")[0].setAttribute("fill","url(#"+l+"_"+e+"_jgraduate_grad)"),S="lg"===e?"linearGradient":"radialGradient",t("#"+l+"_jGraduate_OpacInput").val(o.paint.alpha).change();var n=t("#"+l+"_"+e+"_jgraduate_grad")[0];if(C!==n){var r=t(C).find("stop");t(n).empty().append(r),C=n;var a=he.val();C.setAttribute("spreadMethod",a)}L="rg"===e&&null!==C.getAttribute("fx")&&!(R===D&&B===U),t("#"+l+"_jGraduate_focusCoord").toggle(L),L&&(t("#"+l+"_jGraduate_match_ctr")[0].checked=!1)}else t(c+" .jGraduate_gradPick").hide(),t(c+" .jGraduate_colPick").show()})),t(c+" > div").hide(),Le.removeClass("jGraduate_tab_current"),o.paint.type){case"linearGradient":Te=t(c+" .jGraduate_tab_lingrad");break;case"radialGradient":Te=t(c+" .jGraduate_tab_radgrad");break;default:Te=t(c+" .jGraduate_tab_color")}o.show(),setTimeout((function(){Te.addClass("jGraduate_tab_current").click()}),10)}else t.alert("Container element must have an id attribute to maintain unique id strings for sub-elements.");function Me(e,n,r,i,o){var c=o||a("stop",{"stop-color":n,"stop-opacity":r,offset:e},C);o?(n=o.getAttribute("stop-color"),r=o.getAttribute("stop-opacity"),e=o.getAttribute("offset")):C.append(c),null===r&&(r=1);var u="M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",d=a("path",{d:u,fill:"url(#jGraduate_trans)",transform:"translate("+(10+e*m)+", 26)"},b),h=a("path",{d:u,fill:n,"fill-opacity":r,transform:"translate("+(10+e*m)+", 26)",stroke:"#000","stroke-width":1.5},b);return t(h).mousedown((function(e){return Oe(this),Q=X,f.mousemove(Re).mouseup(je),K=Z.offset(),e.preventDefault(),!1})).data("stop",c).data("bg",d).dblclick((function(){t("div.jGraduate_LightBox").show();for(var e=this,r=Number(c.getAttribute("stop-opacity"))||1,a=c.getAttribute("stop-color")||1,i=(255*parseFloat(r)).toString(16);i.length<2;)i="0"+i;n=a.substr(1)+i,t("#"+l+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:s.images.clientPath},color:{active:n,alphaSupport:!0}},(function(n,i){a=n.val("hex")?"#"+n.val("hex"):"none",r=null!==n.val("a")?n.val("a")/256:1,e.setAttribute("fill",a),e.setAttribute("fill-opacity",r),c.setAttribute("stop-color",a),c.setAttribute("stop-opacity",r),t("div.jGraduate_LightBox").hide(),t("#"+l+"_jGraduate_stopPicker").hide()}),null,(function(){t("div.jGraduate_LightBox").hide(),t("#"+l+"_jGraduate_stopPicker").hide()}))})),t(C).find("stop").each((function(){var r=t(this);if(Number(this.getAttribute("offset"))>e){if(!n){var a=this.getAttribute("stop-color"),i=this.getAttribute("stop-opacity");c.setAttribute("stop-color",a),h.setAttribute("fill",a),c.setAttribute("stop-opacity",null===i?1:i),h.setAttribute("fill-opacity",null===i?1:i)}return r.before(c),!1}return!0})),i&&Oe(h),c}function Oe(e){X&&X.setAttribute("stroke","#000"),e.setAttribute("stroke","blue"),X=e}function je(){f.unbind("mousemove",Re),"none"!==$.getAttribute("display")&&function(){$.setAttribute("display","none");var e=t(X),n=e.data("stop"),r=e.data("bg");t([X,n,r]).remove()}(),Q=null}function Ve(){var e=te?"rotate("+te+","+ne+","+re+") ":"";if(1===J&&1===ee)C.removeAttribute("gradientTransform");else{var t=-ne*(J-1),n=-re*(ee-1);C.setAttribute("gradientTransform",e+"translate("+t+","+n+") scale("+J+","+ee+")")}}function Re(e){var n=e.pageX-K.left,r=e.pageY-K.top,a="translate("+(n=n<10?10:n>m+10?m+10:n)+", 26)";r<-60||r>130?($.setAttribute("display","block"),$.setAttribute("transform",a)):$.setAttribute("display","none"),Q.setAttribute("transform",a),t.data(Q,"bg").setAttribute("transform",a);var i=t.data(Q,"stop"),o=(n-10)/m;i.setAttribute("offset",o);var s=0;t(C).find("stop").each((function(e){var n=this.getAttribute("offset"),r=t(this);nn(o,"offsetLeft")+o.offsetWidth*s-this.spinCfg._btn_width?i=120?this.adjustValue(this.spinCfg.step):e.wheelDelta<=-120&&this.adjustValue(-this.spinCfg.step),e.preventDefault()})).change((function(e){this.adjustValue(0)})),this.addEventListener&&this.addEventListener("DOMMouseScroll",(function(e){e.detail>0?this.adjustValue(-this.spinCfg.step):e.detail<0&&this.adjustValue(this.spinCfg.step),e.preventDefault()}))}))},e} +function br(e,t){return void 0===t&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)}window.console||(window.console={log:function(e){},dir:function(e){}});var xr,wr,Sr=function(e){return null==e},kr=jQuery,Cr=function(e,t,n){var r=kr("#svg_editor").parent();Object.entries(t).forEach((function(t){var a=d(t,2),i=a[0],o=a[1];o||console.log(i),n&&(i="#"+i);var s=r.find(i);if(s.length){var l=s[0];switch(e){case"aria-label":l.setAttribute("aria-label",o);break;case"content":h(l.childNodes).some((function(e){return!(3!==e.nodeType||!e.textContent.trim())&&(e.textContent=o,!0)}));break;case"title":l.title=o}}else console.log("Missing element for localization: "+i)}))},Ar=function(){var e=n(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,s,l,c,u,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wr.addLangData(xr);case 2:if(n=e.sent,kr.each(n,(function(e,n){n.data&&(t=kr.merge(t,n.data))})),t.tools){e.next=6;break}return e.abrupt("return",void 0);case 6:return a=(r=t).tools,i=r.properties,o=r.config,s=r.layers,l=r.common,c=r.ui,Cr("content",{curve_segments:i.curve_segments,fitToContent:a.fitToContent,fit_to_all:a.fit_to_all,fit_to_canvas:a.fit_to_canvas,fit_to_layer_content:a.fit_to_layer_content,fit_to_sel:a.fit_to_sel,icon_large:o.icon_large,icon_medium:o.icon_medium,icon_small:o.icon_small,icon_xlarge:o.icon_xlarge,image_opt_embed:o.image_opt_embed,image_opt_ref:o.image_opt_ref,includedImages:o.included_images,largest_object:a.largest_object,layersLabel:s.layers,page:a.page,relativeToLabel:a.relativeTo,selLayerLabel:s.move_elems_to,selectedPredefined:o.select_predefined,selected_objects:a.selected_objects,smallest_object:a.smallest_object,straight_segments:i.straight_segments,svginfo_bg_url:o.editor_img_url+":",svginfo_bg_note:o.editor_bg_note,svginfo_change_background:o.background,svginfo_dim:o.doc_dims,svginfo_editor_prefs:o.editor_prefs,svginfo_height:l.height,svginfo_icons:o.icon_size,svginfo_image_props:o.image_props,svginfo_lang:o.language,svginfo_title:o.doc_title,svginfo_width:l.width,tool_docprops_cancel:l.cancel,tool_docprops_save:l.ok,tool_source_cancel:l.cancel,tool_source_save:l.ok,tool_prefs_cancel:l.cancel,tool_prefs_save:l.ok,sidepanel_handle:s.layers.split("").join(" "),tool_clear:a.new_doc,tool_docprops:a.docprops,tool_export:a.export_img,tool_import:a.import_doc,tool_open:a.open_doc,tool_save:a.save_doc,tool_editor_prefs:o.editor_prefs,tool_editor_homepage:a.editor_homepage,svginfo_units_rulers:o.units_and_rulers,svginfo_rulers_onoff:o.show_rulers,svginfo_unit:o.base_unit,svginfo_grid_settings:o.grid,svginfo_snap_onoff:o.snapping_onoff,svginfo_snap_step:o.snapping_stepsize,svginfo_grid_color:o.grid_color},!0),u={},["cut","copy","paste","paste_in_place","delete","group","ungroup","move_front","move_up","move_down","move_back"].forEach((function(e){u['#cmenu_canvas a[href="#'+e+'"]']=a[e]})),["dupe","merge_down","merge_all"].forEach((function(e){u['#cmenu_layers a[href="#'+e+'"]']=s[e]})),u['#cmenu_layers a[href="#delete"]']=s.del,Cr("content",u),h={},Object.entries({tool_blur:i.blur,tool_position:a.align_to_page,tool_font_family:i.font_family,zoom_panel:c.zoom_level,stroke_linejoin:i.linejoin_miter,stroke_linecap:i.linecap_butt,tool_opacity:i.opacity}).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];h["#"+n+" button"]=r})),Object.entries({group_opacity:i.opacity,zoom:c.zoom_level}).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];h["#"+n]=r})),Cr("aria-label",h),Cr("title",{align_relative_to:a.align_relative_to,circle_cx:i.circle_cx,circle_cy:i.circle_cy,circle_r:i.circle_r,cornerRadiusLabel:i.corner_radius,ellipse_cx:i.ellipse_cx,ellipse_cy:i.ellipse_cy,ellipse_rx:i.ellipse_rx,ellipse_ry:i.ellipse_ry,fill_color:i.fill_color,font_family:i.font_family,idLabel:i.id,image_height:i.image_height,image_url:i.image_url,image_width:i.image_width,layer_delete:s.del,layer_down:s.move_down,layer_new:s.new,layer_rename:s.rename,layer_moreopts:l.more_opts,layer_up:s.move_up,line_x1:i.line_x1,line_x2:i.line_x2,line_y1:i.line_y1,line_y2:i.line_y2,linecap_butt:i.linecap_butt,linecap_round:i.linecap_round,linecap_square:i.linecap_square,linejoin_bevel:i.linejoin_bevel,linejoin_miter:i.linejoin_miter,linejoin_round:i.linejoin_round,main_icon:a.main_menu,palette:c.palette_info,zoom_panel:c.zoom_level,path_node_x:i.node_x,path_node_y:i.node_y,rect_height_tool:i.rect_height,rect_width_tool:i.rect_width,seg_type:i.seg_type,selLayerNames:s.move_selected,selected_x:i.pos_x,selected_y:i.pos_y,stroke_color:i.stroke_color,stroke_style:i.stroke_style,stroke_width:i.stroke_width,svginfo_title:o.doc_title,text:i.text_contents,toggle_stroke_tools:c.toggle_stroke_tools,tool_add_subpath:a.add_subpath,tool_alignbottom:a.align_bottom,tool_aligncenter:a.align_center,tool_alignleft:a.align_left,tool_alignmiddle:a.align_middle,tool_alignright:a.align_right,tool_aligntop:a.align_top,tool_angle:i.angle,tool_blur:i.blur,tool_bold:i.bold,tool_circle:a.mode_circle,tool_clone:a.clone,tool_clone_multi:a.clone,tool_delete:a.del,tool_delete_multi:a.del,tool_ellipse:a.mode_ellipse,tool_fhellipse:a.mode_fhellipse,tool_fhpath:a.mode_fhpath,tool_fhrect:a.mode_fhrect,tool_font_size:i.font_size,tool_group_elements:a.group_elements,tool_make_link:a.make_link,tool_link_url:a.set_link_url,tool_image:a.mode_image,tool_italic:i.italic,tool_line:a.mode_line,tool_move_bottom:a.move_bottom,tool_move_top:a.move_top,tool_node_clone:a.node_clone,tool_node_delete:a.node_delete,tool_node_link:a.node_link,tool_opacity:i.opacity,tool_openclose_path:a.openclose_path,tool_path:a.mode_path,tool_position:a.align_to_page,tool_rect:a.mode_rect,tool_redo:a.redo,tool_reorient:a.reorient_path,tool_select:a.mode_select,tool_source:a.source_save,tool_square:a.mode_square,tool_text:a.mode_text,tool_topath:a.to_path,tool_undo:a.undo,tool_ungroup:a.ungroup,tool_wireframe:a.wireframe_mode,tool_zoom:a.mode_zoom,url_notice:a.no_embed},!0),e.abrupt("return",{langParam:xr,langData:t});case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Er=function(){var e=n(regeneratorRuntime.mark((function e(t,n,r){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t?xr=t:navigator.userLanguage?xr=navigator.userLanguage:navigator.language&&(xr=navigator.language),console.log("Lang: "+xr),n.includes(xr)||"test"===xr||(xr="en"),a=r.langPath+"lang."+xr+".js",e.t0=Ar,e.next=7,un(a,{global:"svgEditorLang_"+xr.replace(/-/g,"_")});case 7:return e.t1=e.sent,e.abrupt("return",(0,e.t0)(e.t1));case 9:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();function Gr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Pr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.before,r=t.after,a=t.favicon,i=t.canvas,o=t.image,s=void 0===o||o,l=t.acceptErrors;return e=Array.isArray(e)?e:[e],Promise.all(e.map((function(e){return function(e){var t={};if(Array.isArray(e)){var o=Gr(e,2);e=o[0];var c=o[1];t=void 0===c?{}:c}var u=t.favicon,d=void 0===u?a:u,h=t,f=h.before,p=void 0===f?n:f,g=h.after,m=void 0===g?r:g,v=h.canvas,y=void 0===v?i:v,_=h.image,b=void 0===_?s:_;function x(){p?p.before(w):m?m.after(w):document.head.appendChild(w)}var w=document.createElement("link");return new Promise((function(n,r){var a=r;if(l&&(a="function"==typeof l?function(a){l({error:a,stylesheetURL:e,options:t,resolve:n,reject:r})}:n),e.endsWith(".css")?d=!1:e.endsWith(".ico")&&(d=!0),d){if(w.rel="shortcut icon",w.type="image/x-icon",!1===b)return w.href=e,x(),void n(w);var i=document.createElement("canvas");i.width=16,i.height=16;var o=i.getContext("2d"),s=document.createElement("img");return s.addEventListener("error",(function(e){r(e)})),s.addEventListener("load",(function(){o.drawImage(s,0,0),w.href=y?i.toDataURL("image/x-icon"):e,x(),n(w)})),void(s.src=e)}w.rel="stylesheet",w.type="text/css",w.href=e,x(),w.addEventListener("error",(function(e){a(e)})),w.addEventListener("load",(function(){n(w)}))}))}(e)})))}var Ir={},Nr=[function(e){function t(t){if("string"==typeof t.data){var n=t.handler,r=t.data.toLowerCase().split(" ");t.handler=function(t){if(this===t.target||27===t.which||!/textarea|select/i.test(t.target.nodeName)&&"text"!==t.target.type){var a="keypress"!==t.type&&e.hotkeys.specialKeys[t.which],i=String.fromCharCode(t.which).toLowerCase(),o="",s={};t.altKey&&"alt"!==a&&(o+="alt+"),t.ctrlKey&&"ctrl"!==a&&(o+="ctrl+"),t.metaKey&&!t.ctrlKey&&"meta"!==a&&(o+="meta+"),t.shiftKey&&"shift"!==a&&(o+="shift+"),a?s[o+a]=!0:(s[o+i]=!0,s[o+e.hotkeys.shiftNums[i]]=!0,"shift+"===o&&(s[e.hotkeys.shiftNums[i]]=!0));for(var l=0,c=r.length;l","/":"?","\\":"|"}},e.each(["keydown","keyup","keypress"],(function(){e.event.special[this]={add:t}})),e},function(t){return function(t,n){var r,a,i,o,s,l,c,u,d=Array.prototype.slice,h=decodeURIComponent,f=t.param,p=t.bbq=t.bbq||{},g=t.event.special,m="hashchange",v="querystring",y="fragment",_="elemUrlAttr",b="location",x="href",w="src",S=/^.*\?|#.*$/g,k=/^.*\#/,C={};function A(e){return"string"==typeof e}function E(e){var t=d.call(arguments,1);return function(){return e.apply(this,t.concat(d.call(arguments)))}}function G(e,a,o,s,l){var c,d,p,g,m;return s!==r?(m=(p=o.match(e?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/))[3]||"",2===l&&A(s)?d=s.replace(e?k:S,""):(g=i(p[2]),s=A(s)?i[e?y:v](s):s,d=2===l?s:1===l?t.extend({},s,g):t.extend({},g,s),d=f(d),e&&(d=d.replace(u,h))),c=p[1]+(e?"#":d||!p[1]?"?":"")+d+m):c=a(o!==r?o:n[b][x]),c}function P(e,t,n){return t===r||"boolean"==typeof t?(n=t,t=f[e?y:v]()):t=A(t)?t.replace(e?k:S,""):t,i(t,n)}function I(n,a,i,o){return A(i)||"object"===e(i)||(o=i,i=a,a=r),this.each((function(){var e=t(this),r=a||c()[(this.nodeName||"").toLowerCase()]||"",s=r&&e.attr(r)||"";e.attr(r,f[n](s,i,o))}))}f[v]=E(G,0,(function(e){return e.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")})),f[y]=a=E(G,1,(function(e){return e.replace(/^[^#]*#?(.*)$/,"$1")})),a.noEscape=function(e){e=e||"";var n=t.map(e.split(""),encodeURIComponent);u=new RegExp(n.join("|"),"g")},a.noEscape(",/"),t.deparam=i=function(e,n){var a={},i={true:!0,false:!1,null:null};return t.each(e.replace(/\+/g," ").split("&"),(function(e,o){var s,l=o.split("="),c=h(l[0]),u=a,d=0,f=c.split("]["),p=f.length-1;if(/\[/.test(f[0])&&/\]$/.test(f[p])?(f[p]=f[p].replace(/\]$/,""),p=(f=f.shift().split("[").concat(f)).length-1):p=0,2===l.length)if(s=h(l[1]),n&&(s=s&&!isNaN(s)?+s:"undefined"===s?r:i[s]!==r?i[s]:s),p)for(;d<=p;d++)u=u[c=""===f[d]?u.length:f[d]]=d').hide().insertAfter("body")[0].contentWindow,s=function(){return v(i.document[u][h])},(o=function(e,t){if(e!==t){var n=i.document;n.open().close(),n[u].hash="#"+e}})(v()))),function r(){var i=v(),l=s(n);i!==n?(o(n=i,l),e(t).trigger(d)):l!==n&&(t[u][h]=t[u][h].replace(/#.*/,"")+"#"+l),a=setTimeout(r,e[d+"Delay"])}()}},l.stop=function(){i||(a&&clearTimeout(a),a=0)},r=l}(t,window),t},function(e){var t={};return e.svgIcons=function(n){var r,a,i,o,s,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c="http://www.w3.org/2000/svg",u="http://www.w3.org/1999/xlink",d=l.w||24,h=l.h||24,f=!1,p=!1,g=0,m="data:image/svg+xml;charset=utf-8;base64,";if(l.svgz){o=e('').appendTo("body").hide();try{a=o[0].contentDocument,o.load(y),y(0,!0)}catch(e){w()}}else{var v=new DOMParser;e.ajax({url:n,dataType:"string",success:function(t){t?(a=v.parseFromString(t,"text/xml"),e((function(){y("ajax")}))):e(w)},error:function(t){window.opera?e((function(){w()})):t.responseText?((a=v.parseFromString(t.responseText,"text/xml")).childNodes.length||e(w),e((function(){y("ajax")}))):e(w)}})}function y(t,n){if("ajax"!==t){if(p)return;var s=(a=o[0].contentDocument)&&a.getElementById("svg_eof");if(!(s||n&&s))return void(++g<50?setTimeout(y,20):(w(),p=!0));p=!0}if(r=e(a.firstChild).children(),l.no_img)setTimeout((function(){f||x()}),500);else{var c=m+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";i=e(new Image).attr({src:c,width:0,height:0,alt:l.testIconAlt||"icon"}).appendTo("body").load((function(){x(!0)})).error((function(){x()}))}}function _(e,t,n,r){if(vr&&t.css("visibility","hidden"),l.replace){r&&t.attr("id",n);var a=e.attr("class");if(a&&t.attr("class","svg_icon "+a),!e.alt){var i="icon";l.alts&&(i=l.alts[n]||i),t.attr("alt",i)}e.replaceWith(t)}else e.append(t);vr&&setTimeout((function(){t.removeAttr("style")}),1)}function b(e,n){void 0!==l.id_match&&!1===l.id_match||_(s,e,n,!0),t[n]=e}function x(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!f){var p;if(l.no_img&&(n=!1),n&&(p=e(document.createElement("div"))).hide().appendTo("body"),a){var g=l.fallback_path||"";e.each(a,(function(t,n){s=e("#"+t);var r="icon";l.alts&&(r=l.alts[t]||r),b(e(new Image).attr({class:"svg_icon",src:g+n,width:d,height:h,alt:r}),t)}))}else for(var v=r.length,y=0;y0&&!n&&(i=yr(i,r)),_(e(this),i,a)}))})),a||(n&&p.remove(),o&&o.remove(),i&&i.remove()),l.resize&&e.resizeSvgIcons(l.resize),f=!0,l.callback&&l.callback(t)}}function w(){if(n.includes(".svgz")){var t=n.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg"),e.svgIcons(t,l)}else l.fallback&&x(!1,l.fallback)}},e.getSvgIcon=function(e,n){var r=t[e];return n&&r&&(r=yr(r,0).clone(!0)),r},e.resizeSvgIcons=function(t){var n=!e(".svg_icon:first").length;e.each(t,(function(t,r){var a=Array.isArray(r),i=a?r[0]:r,o=a?r[1]:r;n&&(t=t.replace(/\.svg_icon/g,"svg")),e(t).each((function(){this.setAttribute("width",i),this.setAttribute("height",o),window.opera&&window.widget&&(this.parentNode.style.width=i+"px",this.parentNode.style.height=o+"px")}))}))},e},function(t){t.loadingStylesheets||(t.loadingStylesheets=[]),t.loadingStylesheets.includes("jgraduate/css/jGraduate.css")||t.loadingStylesheets.push("jgraduate/css/jGraduate.css"),t.jGraduate={Paint:function e(t){r(this,e);var n=t||{};if(this.alpha=isNaN(n.alpha)?100:n.alpha,n.copy)switch(this.type=n.copy.type,this.alpha=n.copy.alpha,this.solidColor=null,this.linearGradient=null,this.radialGradient=null,this.type){case"none":break;case"solidColor":this.solidColor=n.copy.solidColor;break;case"linearGradient":this.linearGradient=n.copy.linearGradient.cloneNode(!0);break;case"radialGradient":this.radialGradient=n.copy.radialGradient.cloneNode(!0)}else n.linearGradient?(this.type="linearGradient",this.solidColor=null,this.radialGradient=null,this.linearGradient=n.linearGradient.cloneNode(!0)):n.radialGradient?(this.type="radialGradient",this.solidColor=null,this.linearGradient=null,this.radialGradient=n.radialGradient.cloneNode(!0)):n.solidColor?(this.type="solidColor",this.solidColor=n.solidColor):(this.type="none",this.solidColor=null,this.linearGradient=null,this.radialGradient=null)}},t.fn.jGraduateDefaults={paint:new t.jGraduate.Paint,window:{pickerTitle:"Drag markers to pick a paint"},images:{clientPath:"images/"},newstop:"inverse"};var n=navigator.userAgent.includes("Gecko/");function a(e,t,r){var a=document.createElementNS(_r.svg,e);return function(e,t){n?Object.entries(t).forEach((function(t){var n=d(t,2),r=n[0],a=n[1];e.setAttribute(r,a)})):Object.entries(t).forEach((function(t){var n=d(t,2),r=n[0],a=n[1],i=e[r];i&&"SVGLength"===i.constructor?i.baseVal.value=a:e.setAttribute(r,a)}))}(a,t),r&&r.append(a),a}return t.fn.jGraduate=function(n,r,i){return this.each((function(){var o=t(this),s=t.extend(!0,{},t.fn.jGraduateDefaults,n||{}),l=o.attr("id"),c="#"+o.attr("id")+" ";if(c){var u=function(){switch(o.paint.type){case"radialGradient":o.paint.linearGradient=null;break;case"linearGradient":o.paint.radialGradient=null;break;case"solidColor":o.paint.radialGradient=o.paint.linearGradient=null}"function"==typeof o.okCallback&&o.okCallback(o.paint),o.hide()},d=function(){"function"==typeof o.cancelCallback&&o.cancelCallback(),o.hide()};t.extend(!0,o,{paint:new t.jGraduate.Paint({copy:s.paint}),okCallback:"function"==typeof r?r:null,cancelCallback:"function"==typeof i?i:null});var h=null,f=t(window);"none"===o.paint.type&&(o.paint=new t.jGraduate.Paint({solidColor:"ffffff"})),o.addClass("jGraduate_Picker"),o.html('
  • Solid Color
  • Linear Gradient
  • Radial Gradient
');var p=t(c+"> .jGraduate_colPick"),g=t(c+"> .jGraduate_gradPick");g.html('

'+s.window.pickerTitle+'


');var m=256,v=m-0,y=m-0,_={};t(".jGraduate_SliderBar").width(145);var b,x=t("#"+l+"_jGraduate_GradContainer")[0],w=a("svg",{id:l+"_jgraduate_svg",width:m,height:m,xmlns:_r.svg},x),S=o.paint.type,k=o.paint[S],C=k,A=o.paint.alpha,E="solidColor"===S;switch(S){case"solidColor":case"linearGradient":if(E||(C.id=l+"_lg_jgraduate_grad",k=C=w.appendChild(C)),a("radialGradient",{id:l+"_rg_jgraduate_grad"},w),"linearGradient"===S)break;case"radialGradient":E||(C.id=l+"_rg_jgraduate_grad",k=C=w.appendChild(C)),a("linearGradient",{id:l+"_lg_jgraduate_grad"},w)}if(E){k=C=t("#"+l+"_lg_jgraduate_grad")[0],Me(0,"#"+(h=o.paint[S]),1);var G=e(s.newstop);if("string"===G)switch(s.newstop){case"same":Me(1,"#"+h,1);break;case"inverse":for(var P="",I=0;I<6;I+=2){var N=(255-parseInt(h.substr(I,2),16)).toString(16);N.length<2&&(N=0+N),P+=N}Me(1,"#"+P,1);break;case"white":Me(1,"#ffffff",1);break;case"black":Me(1,"#000000",1)}else if("object"===G){var T="opac"in s.newstop?s.newstop.opac:1;Me(1,s.newstop.color||"#"+h,T)}}var L,M=parseFloat(k.getAttribute("x1")||0),O=parseFloat(k.getAttribute("y1")||0),j=parseFloat(k.getAttribute("x2")||1),V=parseFloat(k.getAttribute("y2")||0),R=parseFloat(k.getAttribute("cx")||.5),B=parseFloat(k.getAttribute("cy")||.5),D=parseFloat(k.getAttribute("fx")||R),U=parseFloat(k.getAttribute("fy")||B),F=a("rect",{id:l+"_jgraduate_rect",x:0,y:0,width:v,height:y,fill:"url(#"+l+"_jgraduate_grad)","fill-opacity":A/100},w),H=t("
").attr({class:"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:O*m,left:M*m}).data("coord","start").appendTo(x),z=H.clone().text(2).css({top:V*m,left:j*m}).attr("title","End stop").data("coord","end").appendTo(x),q=t("
").attr({class:"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:B*m,left:R*m}).data("coord","center").appendTo(x),Y=q.clone().text("F").css({top:U*m,left:D*m,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(x);Y[0].id=l+"_jGraduate_focusCoord",t.each(["x1","y1","x2","y2","cx","cy","fx","fy"],(function(e,n){var r=isNaN(n[1]),a=C.getAttribute(n);a||(a=r?"0.5":"x2"===n?"1.0":"0.0"),_[n]=t("#"+l+"_jGraduate_"+n).val(a).change((function(){isNaN(parseFloat(this.value))||this.value<0?this.value=0:this.value>1&&(this.value=1),("f"!==n[0]||L)&&(r&&"radialGradient"===S||!r&&"linearGradient"===S)&&C.setAttribute(n,this.value);var e=r?"c"===n[0]?q:Y:"1"===n[1]?H:z,t=n.includes("x")?"left":"top";e.css(t,this.value*m)})).change()}));var W,X,Q,K,Z=t("#"+l+"_jGraduate_StopSlider"),$=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},void 0),J=1,ee=1,te=0,ne=R,re=B,ae=a("svg",{width:"100%",height:45},Z[0]),ie=a("pattern",{width:16,height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},ae),oe=a("image",{width:16,height:16},ie),se=s.images.clientPath+"map-opacity.png";oe.setAttributeNS(_r.xlink,"xlink:href",se),t(ae).click((function(e){if(K=Z.offset(),"path"!==e.target.tagName){var t=e.pageX-K.left-8;Me((t=t<10?10:t>m+10?m+10:t)/m,0,0,!0),e.stopPropagation()}})),t(ae).mouseover((function(){ae.append($)})),b=a("g",{},ae),a("line",{x1:10,y1:15,x2:m+10,y2:15,"stroke-width":2,stroke:"#000"},ae);var le,ce,ue,de,he=g.find(".jGraduate_spreadMethod").change((function(){C.setAttribute("spreadMethod",t(this).val())})),fe=null,pe=function(e){var t=e.pageX-le.left,n=e.pageY-le.top;t=t<0?0:t>m?m:t,n=n<0?0:n>m?m:n,fe.css("left",t).css("top",n);var r=t/v,a=n/y,i=fe.data("coord"),o=C;switch(i){case"start":_.x1.val(r),_.y1.val(a),o.setAttribute("x1",r),o.setAttribute("y1",a);break;case"end":_.x2.val(r),_.y2.val(a),o.setAttribute("x2",r),o.setAttribute("y2",a);break;case"center":_.cx.val(r),_.cy.val(a),o.setAttribute("cx",r),o.setAttribute("cy",a),ne=r,re=a,Ve();break;case"focus":_.fx.val(r),_.fy.val(a),o.setAttribute("fx",r),o.setAttribute("fy",a),Ve()}e.preventDefault()},ge=function e(){fe=null,f.unbind("mousemove",pe).unbind("mouseup",e)},me=(W=C.getElementsByTagNameNS(_r.svg,"stop")).length;if(me<2){for(;me<2;)C.append(document.createElementNS(_r.svg,"stop")),++me;W=C.getElementsByTagNameNS(_r.svg,"stop")}for(var ve=0;ve99.5&&(n=99.5),n>0?ee=1-n/100:J=-n/100-1,a=(n+100)/2*145/100,t&&Ve();break;case"angle":a=(te=n)/180,a+=.5,a*=145,t&&Ve()}a>145?a=145:a<0&&(a=0),r.css({"margin-left":a-5})})).change()}));for(var Pe=function(e){!function(e){var t=de.offset.left,n=de.parent,r=e.pageX-t-parseInt(n.css("border-left-width"));r>145&&(r=145),r<=0&&(r=0);var a=r-5;switch(r/=145,de.type){case"radius":(r=Math.pow(2*r,2.5))>.98&&r<1.02&&(r=1),r<=.01&&(r=.01),C.setAttribute("r",r);break;case"opacity":o.paint.alpha=parseInt(100*r),F.setAttribute("fill-opacity",r);break;case"ellip":J=1,ee=1,r<.5?J=(r/=.5)<=0?.01:r:r>.5&&(ee=(r=2-(r/=.5))<=0?.01:r),Ve(),ee===(r-=1)+1&&(r=Math.abs(r));break;case"angle":r-=.5,te=r*=180,Ve(),r/=100}de.elem.css({"margin-left":a}),r=Math.round(100*r),de.input.val(r)}(e),e.preventDefault()},Ie=function e(t){f.unbind("mousemove",Pe).unbind("mouseup",e),de=null},Ne=(255*o.paint.alpha/100).toString(16);Ne.length<2;)Ne="0"+Ne;Ne=Ne.split(".")[0],h="none"===o.paint.solidColor?"":o.paint.solidColor+Ne,E||(h=W[0].getAttribute("stop-color")),t.extend(t.fn.jPicker.defaults.window,{alphaSupport:!0,effects:{type:"show",speed:0}}),p.jPicker({window:{title:s.window.pickerTitle},images:{clientPath:s.images.clientPath},color:{active:h,alphaSupport:!0}},(function(e){o.paint.type="solidColor",o.paint.alpha=e.val("ahex")?Math.round(e.val("a")/255*100):100,o.paint.solidColor=e.val("hex")?e.val("hex"):"none",o.paint.radialGradient=null,u()}),null,(function(){d()}));var Te,Le=t(c+" .jGraduate_tabs li");switch(Le.click((function(){Le.removeClass("jGraduate_tab_current"),t(this).addClass("jGraduate_tab_current"),t(c+" > div").hide();var e=t(this).attr("data-type");if(t(c+" .jGraduate_gradPick").show(),"rg"===e||"lg"===e){t(".jGraduate_"+e+"_field").show(),t(".jGraduate_"+("lg"===e?"rg":"lg")+"_field").hide(),t("#"+l+"_jgraduate_rect")[0].setAttribute("fill","url(#"+l+"_"+e+"_jgraduate_grad)"),S="lg"===e?"linearGradient":"radialGradient",t("#"+l+"_jGraduate_OpacInput").val(o.paint.alpha).change();var n=t("#"+l+"_"+e+"_jgraduate_grad")[0];if(C!==n){var r=t(C).find("stop");t(n).empty().append(r),C=n;var a=he.val();C.setAttribute("spreadMethod",a)}L="rg"===e&&null!==C.getAttribute("fx")&&!(R===D&&B===U),t("#"+l+"_jGraduate_focusCoord").toggle(L),L&&(t("#"+l+"_jGraduate_match_ctr")[0].checked=!1)}else t(c+" .jGraduate_gradPick").hide(),t(c+" .jGraduate_colPick").show()})),t(c+" > div").hide(),Le.removeClass("jGraduate_tab_current"),o.paint.type){case"linearGradient":Te=t(c+" .jGraduate_tab_lingrad");break;case"radialGradient":Te=t(c+" .jGraduate_tab_radgrad");break;default:Te=t(c+" .jGraduate_tab_color")}o.show(),setTimeout((function(){Te.addClass("jGraduate_tab_current").click()}),10)}else t.alert("Container element must have an id attribute to maintain unique id strings for sub-elements.");function Me(e,n,r,i,o){var c=o||a("stop",{"stop-color":n,"stop-opacity":r,offset:e},C);o?(n=o.getAttribute("stop-color"),r=o.getAttribute("stop-opacity"),e=o.getAttribute("offset")):C.append(c),null===r&&(r=1);var u="M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",d=a("path",{d:u,fill:"url(#jGraduate_trans)",transform:"translate("+(10+e*m)+", 26)"},b),h=a("path",{d:u,fill:n,"fill-opacity":r,transform:"translate("+(10+e*m)+", 26)",stroke:"#000","stroke-width":1.5},b);return t(h).mousedown((function(e){return Oe(this),Q=X,f.mousemove(Re).mouseup(je),K=Z.offset(),e.preventDefault(),!1})).data("stop",c).data("bg",d).dblclick((function(){t("div.jGraduate_LightBox").show();for(var e=this,r=Number(c.getAttribute("stop-opacity"))||1,a=c.getAttribute("stop-color")||1,i=(255*parseFloat(r)).toString(16);i.length<2;)i="0"+i;n=a.substr(1)+i,t("#"+l+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:s.images.clientPath},color:{active:n,alphaSupport:!0}},(function(n,i){a=n.val("hex")?"#"+n.val("hex"):"none",r=null!==n.val("a")?n.val("a")/256:1,e.setAttribute("fill",a),e.setAttribute("fill-opacity",r),c.setAttribute("stop-color",a),c.setAttribute("stop-opacity",r),t("div.jGraduate_LightBox").hide(),t("#"+l+"_jGraduate_stopPicker").hide()}),null,(function(){t("div.jGraduate_LightBox").hide(),t("#"+l+"_jGraduate_stopPicker").hide()}))})),t(C).find("stop").each((function(){var r=t(this);if(Number(this.getAttribute("offset"))>e){if(!n){var a=this.getAttribute("stop-color"),i=this.getAttribute("stop-opacity");c.setAttribute("stop-color",a),h.setAttribute("fill",a),c.setAttribute("stop-opacity",null===i?1:i),h.setAttribute("fill-opacity",null===i?1:i)}return r.before(c),!1}return!0})),i&&Oe(h),c}function Oe(e){X&&X.setAttribute("stroke","#000"),e.setAttribute("stroke","blue"),X=e}function je(){f.unbind("mousemove",Re),"none"!==$.getAttribute("display")&&function(){$.setAttribute("display","none");var e=t(X),n=e.data("stop"),r=e.data("bg");t([X,n,r]).remove()}(),Q=null}function Ve(){var e=te?"rotate("+te+","+ne+","+re+") ":"";if(1===J&&1===ee)C.removeAttribute("gradientTransform");else{var t=-ne*(J-1),n=-re*(ee-1);C.setAttribute("gradientTransform",e+"translate("+t+","+n+") scale("+J+","+ee+")")}}function Re(e){var n=e.pageX-K.left,r=e.pageY-K.top,a="translate("+(n=n<10?10:n>m+10?m+10:n)+", 26)";r<-60||r>130?($.setAttribute("display","block"),$.setAttribute("transform",a)):$.setAttribute("display","none"),Q.setAttribute("transform",a),t.data(Q,"bg").setAttribute("transform",a);var i=t.data(Q,"stop"),o=(n-10)/m;i.setAttribute("offset",o);var s=0;t(C).find("stop").each((function(e){var n=this.getAttribute("offset"),r=t(this);nn(o,"offsetLeft")+o.offsetWidth*s-this.spinCfg._btn_width?i=120?this.adjustValue(this.spinCfg.step):e.wheelDelta<=-120&&this.adjustValue(-this.spinCfg.step),e.preventDefault()})).change((function(e){this.adjustValue(0)})),this.addEventListener&&this.addEventListener("DOMMouseScroll",(function(e){e.detail>0?this.adjustValue(-this.spinCfg.step):e.detail<0&&this.adjustValue(this.spinCfg.step),e.preventDefault()}))}))},e} /** * @file jQuery Context Menu Plugin * Cory S.N. LaViska @@ -156,5 +156,5 @@ function br(e,t){return void 0===t&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow( * This plugin is dual-licensed under the GNU General Public License * and the MIT License and is copyright A Beautiful Site, LLC. * -*/,q,function(e){var t=e(window),n=e(document);return e.extend(e.fn,{contextMenu:function(r,a){return void 0!==r.menu&&(void 0===r.inSpeed&&(r.inSpeed=150),void 0===r.outSpeed&&(r.outSpeed=75),0===r.inSpeed&&(r.inSpeed=-1),0===r.outSpeed&&(r.outSpeed=-1),e(this).each((function(){var i=e(this),o=e(i).offset(),s=e("#"+r.menu);s.addClass("contextMenu"),e(this).bind("mousedown",(function(l){e(this).mouseup((function(c){var u=e(this);if(u.unbind("mouseup"),2===l.button||r.allowLeft||l.ctrlKey&&U()){if(c.stopPropagation(),e(".contextMenu").hide(),i.hasClass("disabled"))return!1;var d=c.pageX,h=c.pageY,f=t.width()-s.width(),p=t.height()-s.height();d>f-15&&(d=f-15),h>p-30&&(h=p-30),n.unbind("click"),s.css({top:h,left:d}).fadeIn(r.inSpeed),s.find("A").mouseover((function(){s.find("LI.hover").removeClass("hover"),e(this).parent().addClass("hover")})).mouseout((function(){s.find("LI.hover").removeClass("hover")})),n.keypress((function(e){switch(e.keyCode){case 38:s.find("LI.hover").length?(s.find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover"),s.find("LI.hover").length||s.find("LI:last").addClass("hover")):s.find("LI:last").addClass("hover");break;case 40:s.find("LI.hover").length?(s.find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover"),s.find("LI.hover").length||s.find("LI:first").addClass("hover")):s.find("LI:first").addClass("hover");break;case 13:s.find("LI.hover A").trigger("click");break;case 27:n.trigger("click")}})),s.find("A").unbind("mouseup"),s.find("LI:not(.disabled) A").mouseup((function(){return n.unbind("click").unbind("keypress"),e(".contextMenu").hide(),a&&a(e(this).attr("href").substr(1),e(u),{x:d-o.left,y:h-o.top,docX:d,docY:h}),!1})),setTimeout((function(){n.click((function(){return n.unbind("click").unbind("keypress"),s.fadeOut(r.outSpeed),!1}))}),0)}}))})),e.browser.mozilla?e("#"+r.menu).each((function(){e(this).css({MozUserSelect:"none"})})):e.browser.msie?e("#"+r.menu).each((function(){e(this).bind("selectstart.disableTextSelect",(function(){return!1}))})):e("#"+r.menu).each((function(){e(this).bind("mousedown.disableTextSelect",(function(){return!1}))})),e(i).add(e("UL.contextMenu")).bind("contextmenu",(function(){return!1}))})),e(this))},disableContextMenuItems:function(t){return void 0===t?(e(this).find("LI").addClass("disabled"),e(this)):(e(this).each((function(){if(void 0!==t){var n=t.split(","),r=!0,a=!1,i=void 0;try{for(var o,s=n[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value;e(this).find('A[href="'+l+'"]').parent().addClass("disabled")}}catch(e){a=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}}})),e(this))},enableContextMenuItems:function(t){return void 0===t?(e(this).find("LI.disabled").removeClass("disabled"),e(this)):(e(this).each((function(){if(void 0!==t){var n=t.split(","),r=!0,a=!1,i=void 0;try{for(var o,s=n[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value;e(this).find('A[href="'+l+'"]').parent().removeClass("disabled")}}catch(e){a=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}}})),e(this))},disableContextMenu:function(){return e(this).each((function(){e(this).addClass("disabled")})),e(this)},enableContextMenu:function(){return e(this).each((function(){e(this).removeClass("disabled")})),e(this)},destroyContextMenu:function(){return e(this).each((function(){e(this).unbind("mousedown").unbind("mouseup")})),e(this)}}),e},function(t){t.loadingStylesheets||(t.loadingStylesheets=[]);t.loadingStylesheets.includes("jgraduate/css/jPicker.css")||t.loadingStylesheets.push("jgraduate/css/jPicker.css");var n=function e(n,a){r(this,e);var i=this;function o(e){k.forEach((function(t){t.call(i,i,e)}))}function s(e){var r=n.offset();f={l:0|r.left,t:0|r.top},clearTimeout(p),p=setTimeout((function(){u.call(i,e)}),0),t(document).bind("mousemove",l).bind("mouseup",c),e.preventDefault()}function l(e){return clearTimeout(p),p=setTimeout((function(){u.call(i,e)}),0),e.stopPropagation(),e.preventDefault(),!1}function c(e){return t(document).unbind("mouseup",c).unbind("mousemove",l),e.stopPropagation(),e.preventDefault(),!1}function u(e){var t=n.w,r=n.h,a=e.pageX-f.l,o=e.pageY-f.t;a<0?a=0:a>t&&(a=t),o<0?o=0:o>r&&(o=r),d.call(i,"xy",{x:a/t*_+v,y:o/r*w+b})}function d(e,t,n){if(!(void 0!==t))switch(Sr(e)&&(e="xy"),e.toLowerCase()){case"x":return g;case"y":return m;case"xy":default:return{x:g,y:m}}if(Sr(n)||n!==i){var r,a,s=!1;switch(Sr(e)&&(e="xy"),e.toLowerCase()){case"x":r=t&&(t.x&&0|t.x||0|t)||0;break;case"y":a=t&&(t.y&&0|t.y||0|t)||0;break;case"xy":default:r=t&&t.x&&0|t.x||0,a=t&&t.y&&0|t.y||0}Sr(r)||(ry&&(r=y),g!==r&&(g=r,s=!0)),Sr(a)||(ax&&(a=x),m!==a&&(m=a,s=!0)),s&&o.call(i,n||i)}}function h(e){"function"==typeof e&&k.push(e)}var f,p,g=0,m=0,v=0,y=100,_=100,b=0,x=100,w=100,S=n.find("img:first"),k=[];t.extend(!0,i,{val:d,range:function(e,t){var n,r,a,i;if(!(void 0!==t))switch(Sr(e)&&(e="all"),e.toLowerCase()){case"minx":return v;case"maxx":return y;case"rangex":return{minX:v,maxX:y,rangeX:_};case"miny":return b;case"maxy":return x;case"rangey":return{minY:b,maxY:x,rangeY:w};case"all":default:return{minX:v,maxX:y,rangeX:_,minY:b,maxY:x,rangeY:w}}switch(Sr(e)&&(e="all"),e.toLowerCase()){case"minx":n=t&&(t.minX&&0|t.minX||0|t)||0;break;case"maxx":r=t&&(t.maxX&&0|t.maxX||0|t)||0;break;case"rangex":n=t&&t.minX&&0|t.minX||0,r=t&&t.maxX&&0|t.maxX||0;break;case"miny":a=t&&(t.minY&&0|t.minY||0|t)||0;break;case"maxy":i=t&&(t.maxY&&0|t.maxY||0|t)||0;break;case"rangey":a=t&&t.minY&&0|t.minY||0,i=t&&t.maxY&&0|t.maxY||0;break;case"all":default:n=t&&t.minX&&0|t.minX||0,r=t&&t.maxX&&0|t.maxX||0,a=t&&t.minY&&0|t.minY||0,i=t&&t.maxY&&0|t.maxY||0}Sr(n)||v===n||(_=y-(v=n)),Sr(r)||y===r||(_=(y=r)-v),Sr(a)||b===a||(w=x-(b=a)),Sr(i)||x===i||(w=(x=i)-b)},bind:h,unbind:function(e){if("function"==typeof e)for(var t;t=k.includes(e);)k.splice(t,1)},destroy:function(){t(document).unbind("mouseup",c).unbind("mousemove",l),n.unbind("mousedown",s),n=null,S=null,k=null}}),S.src=a.arrow&&a.arrow.image,S.w=a.arrow&&a.arrow.width||S.width(),S.h=a.arrow&&a.arrow.height||S.height(),n.w=a.map&&a.map.width||n.width(),n.h=a.map&&a.map.height||n.height(),n.bind("mousedown",s),h.call(i,(function(){var e=n.w,t=n.h,r=S.w,a=S.h,i=0,o=0;setTimeout((function(){_>0&&(i=g===y?e:g/_*e|0),w>0&&(o=m===x?t:m/w*t|0),r>=e?i=(e>>1)-(r>>1):i-=r>>1,a>=t?o=(t>>1)-(a>>1):o-=a>>1,S.css({left:i+"px",top:o+"px"})}))}))},a=function e(n,a,i,o){r(this,e);var s=this,l=n.find("td.Text input");function c(e){if(""!==e.target.value||e.target===w.get(0)||(Sr(i)||e.target===i.get(0))&&!Sr(i)){if(!h(e))return e;switch(e.target){case g.get(0):switch(e.keyCode){case 38:return g.val(f.call(s,1+(g.val()<<0),0,255)),a.val("r",g.val(),e.target),!1;case 40:return g.val(f.call(s,(g.val()<<0)-1,0,255)),a.val("r",g.val(),e.target),!1}break;case m.get(0):switch(e.keyCode){case 38:return m.val(f.call(s,1+(m.val()<<0),0,255)),a.val("g",m.val(),e.target),!1;case 40:return m.val(f.call(s,(m.val()<<0)-1,0,255)),a.val("g",m.val(),e.target),!1}break;case v.get(0):switch(e.keyCode){case 38:return v.val(f.call(s,1+(v.val()<<0),0,255)),a.val("b",v.val(),e.target),!1;case 40:return v.val(f.call(s,(v.val()<<0)-1,0,255)),a.val("b",v.val(),e.target),!1}break;case y&&y.get(0):switch(e.keyCode){case 38:return y.val(f.call(s,parseFloat(y.val())+1,0,100)),a.val("a",br(255*y.val()/100,o),e.target),!1;case 40:return y.val(f.call(s,parseFloat(y.val())-1,0,100)),a.val("a",br(255*y.val()/100,o),e.target),!1}break;case _.get(0):switch(e.keyCode){case 38:return _.val(f.call(s,1+(_.val()<<0),0,360)),a.val("h",_.val(),e.target),!1;case 40:return _.val(f.call(s,(_.val()<<0)-1,0,360)),a.val("h",_.val(),e.target),!1}break;case b.get(0):switch(e.keyCode){case 38:return b.val(f.call(s,1+(b.val()<<0),0,100)),a.val("s",b.val(),e.target),!1;case 40:return b.val(f.call(s,(b.val()<<0)-1,0,100)),a.val("s",b.val(),e.target),!1}break;case x.get(0):switch(e.keyCode){case 38:return x.val(f.call(s,1+(x.val()<<0),0,100)),a.val("v",x.val(),e.target),!1;case 40:return x.val(f.call(s,(x.val()<<0)-1,0,100)),a.val("v",x.val(),e.target),!1}}}}function u(e){if(""!==e.target.value||e.target===w.get(0)||(Sr(i)||e.target===i.get(0))&&!Sr(i)){if(!h(e))return e;switch(e.target){case g.get(0):g.val(f.call(s,g.val(),0,255)),a.val("r",g.val(),e.target);break;case m.get(0):m.val(f.call(s,m.val(),0,255)),a.val("g",m.val(),e.target);break;case v.get(0):v.val(f.call(s,v.val(),0,255)),a.val("b",v.val(),e.target);break;case y&&y.get(0):y.val(f.call(s,y.val(),0,100)),a.val("a",br(255*y.val()/100,o),e.target);break;case _.get(0):_.val(f.call(s,_.val(),0,360)),a.val("h",_.val(),e.target);break;case b.get(0):b.val(f.call(s,b.val(),0,100)),a.val("s",b.val(),e.target);break;case x.get(0):x.val(f.call(s,x.val(),0,100)),a.val("v",x.val(),e.target);break;case w.get(0):w.val(w.val().replace(/[^a-fA-F\d]/g,"").toLowerCase().substring(0,6)),i&&i.val(w.val()),a.val("hex",""!==w.val()?w.val():null,e.target);break;case i&&i.get(0):i.val(i.val().replace(/[^a-fA-F\d]/g,"").toLowerCase().substring(0,6)),w.val(i.val()),a.val("hex",""!==i.val()?i.val():null,e.target);break;case S&&S.get(0):S.val(S.val().replace(/[^a-fA-F\d]/g,"").toLowerCase().substring(0,2)),a.val("a",Sr(S.val())?null:parseInt(S.val(),16),e.target)}}}function d(e){if(!Sr(a.val()))switch(e.target){case g.get(0):g.val(a.val("r"));break;case m.get(0):m.val(a.val("g"));break;case v.get(0):v.val(a.val("b"));break;case y&&y.get(0):y.val(br(100*a.val("a")/255,o));break;case _.get(0):_.val(a.val("h"));break;case b.get(0):b.val(a.val("s"));break;case x.get(0):x.val(a.val("v"));break;case w.get(0):case i&&i.get(0):w.val(a.val("hex")),i&&i.val(a.val("hex"));break;case S&&S.get(0):S.val(a.val("ahex").substring(6))}}function h(e){switch(e.keyCode){case 9:case 16:case 29:case 37:case 39:return!1;case"c".charCodeAt():case"v".charCodeAt():if(e.ctrlKey)return!1}return!0}function f(e,t,n){return""===e||isNaN(e)?t:e>n?n:e7?l.eq(6):null,_=l.eq(0),b=l.eq(1),x=l.eq(2),w=l.eq(l.length>7?7:6),S=l.length>7?l.eq(8):null;t.extend(!0,s,{destroy:function(){g.add(m).add(v).add(y).add(_).add(b).add(x).add(w).add(i).add(S).unbind("keyup",u).unbind("blur",d),g.add(m).add(v).add(y).add(_).add(b).add(x).unbind("keydown",c),a.unbind(p),g=null,m=null,v=null,y=null,_=null,b=null,x=null,w=null,S=null}}),g.add(m).add(v).add(y).add(_).add(b).add(x).add(w).add(i).add(S).bind("keyup",u).bind("blur",d),g.add(m).add(v).add(y).add(_).add(b).add(x).bind("keydown",c),a.bind(p)};t.jPicker={List:[],Color:function(n){var r=this;function a(e){for(var t=0;t255&&(x.r=255),o!==x.r&&(o=x.r,_=!0);break;case"g":if(S)return;w=!0,x.g=n&&n.g&&0|n.g||n&&0|n||0,x.g<0?x.g=0:x.g>255&&(x.g=255),s!==x.g&&(s=x.g,_=!0);break;case"b":if(S)return;w=!0,x.b=n&&n.b&&0|n.b||n&&0|n||0,x.b<0?x.b=0:x.b>255&&(x.b=255),c!==x.b&&(c=x.b,_=!0);break;case"a":x.a=n&&!Sr(n.a)?0|n.a:0|n,x.a<0?x.a=0:x.a>255&&(x.a=255),u!==x.a&&(u=x.a,_=!0);break;case"h":if(w)return;S=!0,x.h=n&&n.h&&0|n.h||n&&0|n||0,x.h<0?x.h=0:x.h>360&&(x.h=360),d!==x.h&&(d=x.h,_=!0);break;case"s":if(w)return;S=!0,x.s=Sr(n.s)?0|n:0|n.s,x.s<0?x.s=0:x.s>100&&(x.s=100),f!==x.s&&(f=x.s,_=!0);break;case"v":if(w)return;S=!0,x.v=Sr(n.v)?0|n:0|n.v,x.v<0?x.v=0:x.v>100&&(x.v=100),p!==x.v&&(p=x.v,_=!0)}})),_){if(w){o=o||0,s=s||0,c=c||0;var k=l.rgbToHsv({r:o,g:s,b:c});d=k.h,f=k.s,p=k.v}else if(S){d=d||0,f=Sr(f)?100:f,p=Sr(p)?100:p;var C=l.hsvToRgb({h:d,s:f,v:p});o=C.r,s=C.g,c=C.b}u=Sr(u)?255:u,a.call(r,g||r)}}}}var o,s,c,u,d,f,p,g=[];t.extend(!0,r,{val:i,bind:function(e){"function"==typeof e&&g.push(e)},unbind:function(e){if("function"==typeof e)for(var t;t=g.includes(e);)g.splice(t,1)},destroy:function(){g=null}}),n&&(Sr(n.ahex)?Sr(n.hex)?Sr(n.r)||Sr(n.g)||Sr(n.b)?Sr(n.h)||Sr(n.s)||Sr(n.v)||i("hsv"+(Sr(n.a)?"":"a"),n):i("rgb"+(Sr(n.a)?"":"a"),n):i((Sr(n.a)?"":"a")+"hex",Sr(n.a)?n:{ahex:n.hex+l.intToHex(n.a)}):i("ahex",n))},ColorMethods:{hexToRgba:function(e){if(""===e||"none"===e)return{r:null,g:null,b:null,a:null};var t="00",n="00",r="00",a="255";return 6===(e=this.validateHex(e)).length&&(e+="ff"),e.length>6?(t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6),a=e.substring(6,e.length)):(e.length>4&&(t=e.substring(4,e.length),e=e.substring(0,4)),e.length>2&&(n=e.substring(2,e.length),e=e.substring(0,2)),e.length>0&&(r=e.substring(0,e.length))),{r:this.hexToInt(t),g:this.hexToInt(n),b:this.hexToInt(r),a:this.hexToInt(a)}},validateHex:function(e){return(e=e.toLowerCase().replace(/[^a-f\d]/g,"")).length>8&&(e=e.substring(0,8)),e},rgbaToHex:function(e){return this.intToHex(e.r)+this.intToHex(e.g)+this.intToHex(e.b)+this.intToHex(e.a)},intToHex:function(e){var t=(0|e).toString(16);return 1===t.length&&(t="0"+t),t.toLowerCase()},hexToInt:function(e){return parseInt(e,16)},rgbToHsv:function(e){var t,n=e.r/255,r=e.g/255,a=e.b/255,i={h:0,s:0,v:0},o=0,s=0;return n>=r&&n>=a?(s=n,o=r>a?a:r):r>=a&&r>=n?(s=r,o=n>a?a:n):(s=a,o=r>n?n:r),i.v=s,i.s=s?(s-o)/s:0,i.s?(t=s-o,i.h=n===s?(r-a)/t:r===s?2+(a-n)/t:4+(n-r)/t,i.h=parseInt(60*i.h),i.h<0&&(i.h+=360)):i.h=0,i.s=100*i.s|0,i.v=100*i.v|0,i},hsvToRgb:function(e){var t={r:0,g:0,b:0,a:100},n=e.h,r=e.s,a=e.v;if(0===r)t.r=t.g=t.b=0===a?0:255*a/100|0;else{360===n&&(n=0);var i=0|(n/=60),o=n-i,s=(a/=100)*(1-(r/=100)),l=a*(1-r*o),c=a*(1-r*(1-o));switch(i){case 0:t.r=a,t.g=c,t.b=s;break;case 1:t.r=l,t.g=a,t.b=s;break;case 2:t.r=s,t.g=a,t.b=c;break;case 3:t.r=s,t.g=l,t.b=a;break;case 4:t.r=c,t.g=s,t.b=a;break;case 5:t.r=a,t.g=s,t.b=l}t.r=255*t.r|0,t.g=255*t.g|0,t.b=255*t.b|0}return t}}};var i=t.jPicker,o=i.Color,s=i.List,l=i.ColorMethods;return t.fn.jPicker=function(r,i,c,u){return this.each((function(){var d=this,h=t.extend(!0,{},t.fn.jPicker.defaults,r);"input"===t(d).get(0).nodeName.toLowerCase()&&(t.extend(!0,h,{window:{bindToInput:!0,expandable:!0,input:t(d)}}),""===t(d).val()?(h.color.active=new o({hex:null}),h.color.current=new o({hex:null})):l.validateHex(t(d).val())&&(h.color.active=new o({hex:t(d).val(),a:h.color.active.val("a")}),h.color.current=new o({hex:t(d).val(),a:h.color.active.val("a")}))),h.window.expandable?t(d).after('    '):h.window.liveUpdate=!1;var f=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters;function p(e){var t,n,r=z.active,a=r.val("hex");switch(h.color.mode=e,e){case"h":if(setTimeout((function(){w.call(d,K,"transparent"),k.call(d,$,0),C.call(d,$,100),k.call(d,J,260),C.call(d,J,100),w.call(d,Z,"transparent"),k.call(d,te,0),C.call(d,te,100),k.call(d,ne,260),C.call(d,ne,100),k.call(d,re,260),C.call(d,re,100),k.call(d,ae,260),C.call(d,ae,100),k.call(d,oe,260),C.call(d,oe,100)}),0),se.range("all",{minX:0,maxX:100,minY:0,maxY:100}),le.range("rangeY",{minY:0,maxY:360}),Sr(r.val("ahex")))break;se.val("xy",{x:r.val("s"),y:100-r.val("v")},se),le.val("y",360-r.val("h"),le);break;case"s":if(setTimeout((function(){w.call(d,K,"transparent"),k.call(d,$,-260),k.call(d,J,-520),k.call(d,te,-260),k.call(d,ne,-520),k.call(d,oe,260),C.call(d,oe,100)}),0),se.range("all",{minX:0,maxX:360,minY:0,maxY:100}),le.range("rangeY",{minY:0,maxY:100}),Sr(r.val("ahex")))break;se.val("xy",{x:r.val("h"),y:100-r.val("v")},se),le.val("y",100-r.val("s"),le);break;case"v":if(setTimeout((function(){w.call(d,K,"000000"),k.call(d,$,-780),k.call(d,J,260),w.call(d,Z,a),k.call(d,te,-520),k.call(d,ne,260),C.call(d,ne,100),k.call(d,oe,260),C.call(d,oe,100)}),0),se.range("all",{minX:0,maxX:360,minY:0,maxY:100}),le.range("rangeY",{minY:0,maxY:100}),Sr(r.val("ahex")))break;se.val("xy",{x:r.val("h"),y:100-r.val("s")},se),le.val("y",100-r.val("v"),le);break;case"r":if(t=-1040,n=-780,se.range("all",{minX:0,maxX:255,minY:0,maxY:255}),le.range("rangeY",{minY:0,maxY:255}),Sr(r.val("ahex")))break;se.val("xy",{x:r.val("b"),y:255-r.val("g")},se),le.val("y",255-r.val("r"),le);break;case"g":if(t=-1560,n=-1820,se.range("all",{minX:0,maxX:255,minY:0,maxY:255}),le.range("rangeY",{minY:0,maxY:255}),Sr(r.val("ahex")))break;se.val("xy",{x:r.val("b"),y:255-r.val("r")},se),le.val("y",255-r.val("g"),le);break;case"b":if(t=-2080,n=-2860,se.range("all",{minX:0,maxX:255,minY:0,maxY:255}),le.range("rangeY",{minY:0,maxY:255}),Sr(r.val("ahex")))break;se.val("xy",{x:r.val("r"),y:255-r.val("g")},se),le.val("y",255-r.val("b"),le);break;case"a":if(setTimeout((function(){w.call(d,K,"transparent"),k.call(d,$,-260),k.call(d,J,-520),k.call(d,te,260),k.call(d,ne,260),C.call(d,ne,100),k.call(d,oe,0),C.call(d,oe,100)}),0),se.range("all",{minX:0,maxX:360,minY:0,maxY:100}),le.range("rangeY",{minY:0,maxY:255}),Sr(r.val("ahex")))break;se.val("xy",{x:r.val("h"),y:100-r.val("v")},se),le.val("y",255-r.val("a"),le);break;default:throw new Error("Invalid Mode")}switch(e){case"h":break;case"s":case"v":case"a":setTimeout((function(){C.call(d,$,100),C.call(d,te,100),k.call(d,re,260),C.call(d,re,100),k.call(d,ae,260),C.call(d,ae,100)}),0);break;case"r":case"g":case"b":setTimeout((function(){w.call(d,K,"transparent"),w.call(d,Z,"transparent"),C.call(d,te,100),C.call(d,$,100),k.call(d,$,t),k.call(d,J,t-260),k.call(d,te,n-780),k.call(d,ne,n-520),k.call(d,re,n),k.call(d,ae,n-260),k.call(d,oe,260),C.call(d,oe,100)}),0)}Sr(r.val("ahex"))||g.call(d,r)}function g(e,t){(Sr(t)||t!==le&&t!==se)&&y.call(d,e,t),setTimeout((function(){_.call(d,e),b.call(d,e),x.call(d,e)}),0)}function m(e,t){var n=z.active;if(t===se||!Sr(n.val())){var r=e.val("all");switch(h.color.mode){case"h":n.val("sv",{s:r.x,v:100-r.y},t);break;case"s":case"a":n.val("hv",{h:r.x,v:100-r.y},t);break;case"v":n.val("hs",{h:r.x,s:100-r.y},t);break;case"r":n.val("gb",{g:255-r.y,b:r.x},t);break;case"g":n.val("rb",{r:255-r.y,b:r.x},t);break;case"b":n.val("rg",{r:r.x,g:255-r.y},t)}}}function v(e,t){var n=z.active;if(t===le||!Sr(n.val()))switch(h.color.mode){case"h":n.val("h",{h:360-e.val("y")},t);break;case"s":n.val("s",{s:100-e.val("y")},t);break;case"v":n.val("v",{v:100-e.val("y")},t);break;case"r":n.val("r",{r:255-e.val("y")},t);break;case"g":n.val("g",{g:255-e.val("y")},t);break;case"b":n.val("b",{b:255-e.val("y")},t);break;case"a":n.val("a",255-e.val("y"),t)}}function y(e,t){if(t!==se)switch(h.color.mode){case"h":var n=e.val("sv");se.val("xy",{x:Sr(n)?100:n.s,y:100-(Sr(n)?100:n.v)},t);break;case"s":case"a":var r=e.val("hv");se.val("xy",{x:r&&r.h||0,y:100-(Sr(r)?100:r.v)},t);break;case"v":var a=e.val("hs");se.val("xy",{x:a&&a.h||0,y:100-(Sr(a)?100:a.s)},t);break;case"r":var i=e.val("bg");se.val("xy",{x:i&&i.b||0,y:255-(i&&i.g||0)},t);break;case"g":var o=e.val("br");se.val("xy",{x:o&&o.b||0,y:255-(o&&o.r||0)},t);break;case"b":var s=e.val("rg");se.val("xy",{x:s&&s.r||0,y:255-(s&&s.g||0)},t)}if(t!==le)switch(h.color.mode){case"h":le.val("y",360-(e.val("h")||0),t);break;case"s":var l=e.val("s");le.val("y",100-(Sr(l)?100:l),t);break;case"v":var c=e.val("v");le.val("y",100-(Sr(c)?100:c),t);break;case"r":le.val("y",255-(e.val("r")||0),t);break;case"g":le.val("y",255-(e.val("g")||0),t);break;case"b":le.val("y",255-(e.val("b")||0),t);break;case"a":var u=e.val("a");le.val("y",255-(Sr(u)?255:u),t)}}function _(e){try{var t=e.val("all");ue.css({backgroundColor:t&&"#"+t.hex||"transparent"}),C.call(d,ue,t&&br(100*t.a/255,4)||0)}catch(e){}}function b(e){switch(h.color.mode){case"h":w.call(d,K,new o({h:e.val("h")||0,s:100,v:100}).val("hex"));break;case"s":case"a":var t=e.val("s");C.call(d,J,100-(Sr(t)?100:t));break;case"v":var n=e.val("v");C.call(d,$,Sr(n)?100:n);break;case"r":C.call(d,J,br((e.val("r")||0)/255*100,4));break;case"g":C.call(d,J,br((e.val("g")||0)/255*100,4));break;case"b":C.call(d,J,br((e.val("b")||0)/255*100))}var r=e.val("a");C.call(d,ee,br(100*(255-(r||0))/255,4))}function x(e){switch(h.color.mode){case"h":var t=e.val("a");C.call(d,ie,br(100*(255-(t||0))/255,4));break;case"s":var n=e.val("hva"),r=new o({h:n&&n.h||0,s:100,v:Sr(n)?100:n.v});w.call(d,Z,r.val("hex")),C.call(d,ne,100-(Sr(n)?100:n.v)),C.call(d,ie,br(100*(255-(n&&n.a||0))/255,4));break;case"v":var a=e.val("hsa"),i=new o({h:a&&a.h||0,s:Sr(a)?100:a.s,v:100});w.call(d,Z,i.val("hex")),C.call(d,ie,br(100*(255-(a&&a.a||0))/255,4));break;case"r":case"g":case"b":var s=e.val("rgba"),l=0,c=0;"r"===h.color.mode?(l=s&&s.b||0,c=s&&s.g||0):"g"===h.color.mode?(l=s&&s.b||0,c=s&&s.r||0):"b"===h.color.mode&&(l=s&&s.r||0,c=s&&s.g||0);var u=c>l?l:c;C.call(d,ne,l>c?br((l-c)/(255-c)*100,4):0),C.call(d,re,c>l?br((c-l)/(255-l)*100,4):0),C.call(d,ae,br(u/255*100,4)),C.call(d,ie,br(100*(255-(s&&s.a||0))/255,4));break;case"a":var f=e.val("a");w.call(d,Z,e.val("hex")||"000000"),C.call(d,ie,Sr(f)?100:0),C.call(d,oe,Sr(f)?0:100)}}function w(e,t){e.css({backgroundColor:t&&6===t.length&&"#"+t||"transparent"})}function S(e,t){f&&(t.includes("AlphaBar.png")||t.includes("Bars.png")||t.includes("Maps.png"))?(e.attr("pngSrc",t),e.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+t+"', sizingMethod='scale')"})):e.css({backgroundImage:"url('"+t+"')"})}function k(e,t){e.css({top:t+"px"})}function C(e,t){if(e.css({visibility:t>0?"visible":"hidden"}),t>0&&t<100)if(f){var n=e.attr("pngSrc");!Sr(n)&&(n.includes("AlphaBar.png")||n.includes("Bars.png")||n.includes("Maps.png"))?e.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+n+"', sizingMethod='scale') progid:DXImageTransform.Microsoft.Alpha(opacity="+t+")"}):e.css({opacity:br(t/100,4)})}else e.css({opacity:br(t/100,4)});else if(0===t||100===t)if(f){var r=e.attr("pngSrc");!Sr(r)&&(r.includes("AlphaBar.png")||r.includes("Bars.png")||r.includes("Maps.png"))?e.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+r+"', sizingMethod='scale')"}):e.css({opacity:""})}else e.css({opacity:""})}function A(){z.active.val("ahex",z.current.val("ahex"))}function E(){z.current.val("ahex",z.active.val("ahex"))}function G(e){t(this).parents("tbody:first").find('input:radio[value!="'+e.target.value+'"]').removeAttr("checked"),p.call(d,e.target.value)}function P(){A.call(d)}function I(){A.call(d),h.window.expandable&&D.call(d),"function"==typeof u&&u.call(d,z.active,fe)}function N(){E.call(d),h.window.expandable&&D.call(d),"function"==typeof i&&i.call(d,z.active,he)}function T(){B.call(d)}function L(e){var t=e.val("hex");de.css({backgroundColor:t&&"#"+t||"transparent"}),C.call(d,de,br(100*(e.val("a")||0)/255,4))}function M(e){var t=e.val("hex"),n=e.val("va");ge.css({backgroundColor:t&&"#"+t||"transparent"}),C.call(d,me,br(100*(255-(n&&n.a||0))/255,4)),h.window.bindToInput&&h.window.updateInputColor&&h.window.input.css({backgroundColor:t&&"#"+t||"transparent",color:Sr(n)||n.v>75?"#000000":"#ffffff"})}function O(e){q=parseInt(Q.css("left")),Y=parseInt(Q.css("top")),W=e.pageX,X=e.pageY,t(document).bind("mousemove",j).bind("mouseup",V),e.preventDefault()}function j(e){return Q.css({left:q-(W-e.pageX)+"px",top:Y-(X-e.pageY)+"px"}),h.window.expandable&&!t.support.boxModel&&Q.prev().css({left:Q.css("left"),top:Q.css("top")}),e.stopPropagation(),e.preventDefault(),!1}function V(e){return t(document).unbind("mousemove",j).unbind("mouseup",V),e.stopPropagation(),e.preventDefault(),!1}function R(e){return e.preventDefault(),e.stopPropagation(),z.active.val("ahex",t(this).attr("title")||null,e.target),!1}function B(){function e(){if(h.window.expandable&&!t.support.boxModel){var e=Q.find("table:first");Q.before("