diff --git a/classes/controller.php b/classes/controller.php index 68aa2dc0..556a4681 100644 --- a/classes/controller.php +++ b/classes/controller.php @@ -750,7 +750,7 @@ class AdminController $html = $page->content(); - $this->admin->json_response = ['status' => 'success', 'message' => $html]; + $this->admin->json_response = ['status' => 'success', 'preview' => $html]; } catch (\Exception $e) { $this->admin->json_response = ['status' => 'error', 'message' => $e->getMessage()]; diff --git a/themes/grav/app/forms/fields/editor.js b/themes/grav/app/forms/fields/editor.js index 9a5ace5b..576664c5 100644 --- a/themes/grav/app/forms/fields/editor.js +++ b/themes/grav/app/forms/fields/editor.js @@ -110,10 +110,16 @@ export class Toolbar { static templates() { return { navigation: ` -
+ `, states: ` - +"+t.stack+""),console.error(t.message+" at "+t.stack)}Object.defineProperty(e,"__esModule",{value:!0}),e.parseStatus=i,e.parseJSON=o,e.userFeedback=a,e.userFeedbackError=s;var u=n(289),c=r(u),l=n(293),f=function d(t){var d=new Error(t.statusText||t||"");return d.response=t,d}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(290),o=r(i);o["default"].options.positionClass="toast-top-right",o["default"].options.preventDuplicates=!0,e["default"]=o["default"]},,,,function(t,e){t.exports=GravAdmin},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,s,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[t],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),c=n.slice(),i=c.length,u=0;i>u;u++)c[u].apply(this,s);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,a,s;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],a=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(s=a;s-- >0;)if(n[s]===e||n[s].listener&&n[s].listener===e){i=s;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){(function(t){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n"+n+"
")}return(0,s["default"])("#grav-update-button").on("click",function(){(0,s["default"])(this).html(u.translations.PLUGIN_ADMIN.UPDATING_PLEASE_WAIT+" "+(0,l["default"])(t.assets["grav-update"].size)+"..")}),this}},{key:"resources",value:function(){if(!this.payload.resources.total)return this.maintenance("hide");var t=["plugins","themes"],e=["plugin","theme"],n=this.task,r=this.payload.resources,i=r.plugins,o=r.themes;return this.payload.resources.total?void[i,o].forEach(function(r,i){if(r&&!Array.isArray(r)){var o=Object.keys(r).length,a=t[i];(0,s["default"])('#admin-menu a[href$="/'+t[i]+'"]').find(".badges").addClass("with-updates").find(".badge.updates").text(o);var c=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase(),l=(0,s["default"])(".grav-update."+a);l.html('\n\n \n '+o+" "+u.translations.PLUGIN_ADMIN.OF_YOUR+" "+a+" "+u.translations.PLUGIN_ADMIN.HAVE_AN_UPDATE_AVAILABLE+'\n '+u.translations.PLUGIN_ADMIN.UPDATE+" All "+c+"\n
\n "),Object.keys(r).forEach(function(t){var o=(0,s["default"])("[data-gpm-"+e[i]+'="'+t+'"] .gpm-name'),c=o.find("a");"plugins"!==a||o.find(".badge.update").length?"themes"===a&&o.append('"):o.append(''+u.translations.PLUGIN_ADMIN.UPDATE_AVAILABLE+"!");var l=(0,s["default"])(".grav-update."+e[i]);l.length&&l.html('\n\n \n v'+r[t].available+" "+u.translations.PLUGIN_ADMIN.OF_THIS+" "+e[i]+" "+u.translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE+'!\n '+u.translations.PLUGIN_ADMIN.UPDATE+" "+(e[i].charAt(0).toUpperCase()+e[i].substr(1).toLowerCase())+"\n
\n ")})}}):this}}]),t}();e["default"]=d;var h=new d;e.Instance=h,f.Instance.on("fetched",function(t,e){h.setPayload(t.payload||{}),h.grav().resources()}),"1"===u.config.enable_auto_updates_check&&f.Instance.fetch()},function(t,e){"use strict";function n(t,e){if(0===t)return"0 Byte";var n=1e3,i=Math.floor(Math.log(t)/Math.log(n)),o=e+1||3;return(t/Math.pow(n,i)).toPrecision(o)+" "+r[i]}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n;var r=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(291),o=r(i),a=n(1),s=n(293),u=n(289),c=r(u);(0,o["default"])("[data-gpm-checkupdates]").on("click",function(){var t=(0,o["default"])(this);t.find("i").addClass("fa-spin"),a.Instance.fetch(function(e){t.find("i").removeClass("fa-spin");var n=e.payload;if(n)if(n.grav.isUpdatable||n.resources.total){var r=n.grav.isUpdatable?"Grav v"+n.grav.available:"",i=n.resources.total?n.resources.total+" "+s.translations.PLUGIN_ADMIN.UPDATES_ARE_AVAILABLE:"";i||(r+=" "+s.translations.PLUGIN_ADMIN.IS_AVAILABLE_FOR_UPDATE),c["default"].info(r+(r&&i?" "+s.translations.PLUGIN_ADMIN.AND+" ":"")+i)}else c["default"].success(s.translations.PLUGIN_ADMIN.EVERYTHING_UP_TO_DATE)},!0)})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(291),o=r(i),a=n(300),s=r(a);(0,o["default"])("body").on("click","[data-maintenance-update]",function(){var t=(0,o["default"])(this),e=t.data("maintenanceUpdate");t.attr("disabled","disabled").find("> .fa").removeClass("fa-cloud-download").addClass("fa-refresh fa-spin"),(0,s["default"])(e,function(e){"updategrav"===e.type&&((0,o["default"])("[data-gpm-grav]").remove(),(0,o["default"])("#footer .grav-version").html(e.version)),t.removeAttr("disabled").find("> .fa").removeClass("fa-refresh fa-spin").addClass("fa-cloud-download")})})},function(t,e,n){(function(t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(288),i=n(293),o=void 0,a=function(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=arguments.length<=2||void 0===arguments[2]?function(){return!0}:arguments[2];return"function"==typeof n&&(a=n,n={}),n.method&&"post"===n.method&&n.body&&!function(){var t=new FormData;n.body=Object.assign({"admin-nonce":i.config.admin_nonce},n.body),Object.keys(n.body).map(function(e){return t.append(e,n.body[e])}),n.body=t}(),n=Object.assign({credentials:"same-origin",headers:{Accept:"application/json"}},n),t(e,n).then(function(t){return o=t,t}).then(r.parseStatus).then(r.parseJSON).then(r.userFeedback).then(function(t){return a(t,o)})["catch"](r.userFeedbackError)};e["default"]=a}).call(e,n(2))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(302),o=r(i),a=n(304);n(305),e["default"]={Chart:{Chart:o["default"],UpdatesChart:i.UpdatesChart,Instances:i.Instances},Cache:a.Instance}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instances=e.UpdatesChart=e.defaults=void 0;var s=function x(t,e,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:x(i,e,n)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(n)},u=function(){function t(t,e){for(var n=0;n"+d.translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD+" "+t.name+"
\n"+e.message+""})}},{key:"onDropzoneComplete",value:function(t){if(!t.accepted){var e={status:"error",message:d.translations.PLUGIN_ADMIN.FILE_UNSUPPORTED+": "+t.name.match(/\..+/).join("")};return this.handleError({file:t,data:e,mode:"removeFile",msg:"
"+d.translations.PLUGIN_ADMIN.FILE_ERROR_ADD+" "+t.name+"
\n"+e.message+""})}(0,s["default"])(".dz-preview").prop("draggable","true")}},{key:"onDropzoneRemovedFile",value:function(t){if(t.accepted&&!t.rejected){var e=this.form.data("media-url")+"/task"+d.config.param_sep+"delmedia";(0,f["default"])(e,{method:"post",body:{filename:t.name}})}}},{key:"onDropzoneError",value:function(t,e,n){var r=n?e.error.message:e;return(0,s["default"])(t.previewElement).find("[data-dz-errormessage]").html(r),this.handleError({file:t,data:{status:"error"},msg:"
"+r+""})}},{key:"handleError",value:function(t){var e=t.file,n=t.data,r=t.mode,i=t.msg;if("error"===n.status||"unauthorized"===n.status){switch(r){case"addBack":e instanceof File?this.dropzone.addFile.call(this.dropzone,e):(this.dropzone.files.push(e),this.dropzone.options.addedfile.call(this.dropzone,e),this.dropzone.options.thumbnail.call(this.dropzone,e,e.extras.url));break;case"removeFile":e.rejected=!0,this.dropzone.removeFile.call(this.dropzone,e)}var o=(0,s["default"])('[data-remodal-id="generic"]');o.find(".error-content").html(i),s["default"].remodal.lookup[o.data("remodal")].open()}}}]),t}();e["default"]=p;e.Instance=new p},,,function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(291),o=r(i);(0,o["default"])('[name="task"][value="saveas"], [name="task"][value="switchlanguage"]').on("mousedown touchstart",function(t){var e=["lang","redirect"],n=(0,o["default"])(t.currentTarget),r=(0,o["default"])("#"+n.attr("form"));return r.length?(e.forEach(function(t){var e=n.attr(t);if(e){var i=r.find('[name="'+t+'"]');i.length||(i=(0,o["default"])(''),r.append(i)),i.val(e)}}),!0):void 0})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(324),o=r(i),a=n(327),s=r(a),u=n(328),c=r(u);e["default"]={Form:{Form:s["default"],Instance:a.Instance},Fields:c["default"],FormState:{FormState:o["default"],Instance:i.Instance}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.DOMBehaviors=e.Instance=void 0;var o=function(){function t(t,e){for(var n=0;n
"+t.stack+""),console.error(t.message+" at "+t.stack)}Object.defineProperty(e,"__esModule",{value:!0}),e.parseStatus=i,e.parseJSON=o,e.userFeedback=a,e.userFeedbackError=s;var u=n(289),c=r(u),l=n(293),f=function d(t){var d=new Error(t.statusText||t||"");return d.response=t,d}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(290),o=r(i);o["default"].options.positionClass="toast-top-right",o["default"].options.preventDuplicates=!0,e["default"]=o["default"]},,,,function(t,e){t.exports=GravAdmin},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,s,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[t],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),c=n.slice(),i=c.length,u=0;i>u;u++)c[u].apply(this,s);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,a,s;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],a=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(s=a;s-- >0;)if(n[s]===e||n[s].listener&&n[s].listener===e){i=s;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){(function(t){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n"+n+"
")}return(0,s["default"])("#grav-update-button").on("click",function(){(0,s["default"])(this).html(u.translations.PLUGIN_ADMIN.UPDATING_PLEASE_WAIT+" "+(0,l["default"])(t.assets["grav-update"].size)+"..")}),this}},{key:"resources",value:function(){if(!this.payload.resources.total)return this.maintenance("hide");var t=["plugins","themes"],e=["plugin","theme"],n=this.task,r=this.payload.resources,i=r.plugins,o=r.themes;return this.payload.resources.total?void[i,o].forEach(function(r,i){if(r&&!Array.isArray(r)){var o=Object.keys(r).length,a=t[i];(0,s["default"])('#admin-menu a[href$="/'+t[i]+'"]').find(".badges").addClass("with-updates").find(".badge.updates").text(o);var c=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase(),l=(0,s["default"])(".grav-update."+a);l.html('\n\n \n '+o+" "+u.translations.PLUGIN_ADMIN.OF_YOUR+" "+a+" "+u.translations.PLUGIN_ADMIN.HAVE_AN_UPDATE_AVAILABLE+'\n '+u.translations.PLUGIN_ADMIN.UPDATE+" All "+c+"\n
\n "),Object.keys(r).forEach(function(t){var o=(0,s["default"])("[data-gpm-"+e[i]+'="'+t+'"] .gpm-name'),c=o.find("a");"plugins"!==a||o.find(".badge.update").length?"themes"===a&&o.append('"):o.append(''+u.translations.PLUGIN_ADMIN.UPDATE_AVAILABLE+"!");var l=(0,s["default"])(".grav-update."+e[i]);l.length&&l.html('\n\n \n v'+r[t].available+" "+u.translations.PLUGIN_ADMIN.OF_THIS+" "+e[i]+" "+u.translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE+'!\n '+u.translations.PLUGIN_ADMIN.UPDATE+" "+(e[i].charAt(0).toUpperCase()+e[i].substr(1).toLowerCase())+"\n
\n ")})}}):this}}]),t}();e["default"]=d;var h=new d;e.Instance=h,f.Instance.on("fetched",function(t,e){h.setPayload(t.payload||{}),h.grav().resources()}),"1"===u.config.enable_auto_updates_check&&f.Instance.fetch()},function(t,e){"use strict";function n(t,e){if(0===t)return"0 Byte";var n=1e3,i=Math.floor(Math.log(t)/Math.log(n)),o=e+1||3;return(t/Math.pow(n,i)).toPrecision(o)+" "+r[i]}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n;var r=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(291),o=r(i),a=n(1),s=n(293),u=n(289),c=r(u);(0,o["default"])("[data-gpm-checkupdates]").on("click",function(){var t=(0,o["default"])(this);t.find("i").addClass("fa-spin"),a.Instance.fetch(function(e){t.find("i").removeClass("fa-spin");var n=e.payload;if(n)if(n.grav.isUpdatable||n.resources.total){var r=n.grav.isUpdatable?"Grav v"+n.grav.available:"",i=n.resources.total?n.resources.total+" "+s.translations.PLUGIN_ADMIN.UPDATES_ARE_AVAILABLE:"";i||(r+=" "+s.translations.PLUGIN_ADMIN.IS_AVAILABLE_FOR_UPDATE),c["default"].info(r+(r&&i?" "+s.translations.PLUGIN_ADMIN.AND+" ":"")+i)}else c["default"].success(s.translations.PLUGIN_ADMIN.EVERYTHING_UP_TO_DATE)},!0)})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(291),o=r(i),a=n(300),s=r(a);(0,o["default"])("body").on("click","[data-maintenance-update]",function(){var t=(0,o["default"])(this),e=t.data("maintenanceUpdate");t.attr("disabled","disabled").find("> .fa").removeClass("fa-cloud-download").addClass("fa-refresh fa-spin"),(0,s["default"])(e,function(e){"updategrav"===e.type&&((0,o["default"])("[data-gpm-grav]").remove(),(0,o["default"])("#footer .grav-version").html(e.version)),t.removeAttr("disabled").find("> .fa").removeClass("fa-refresh fa-spin").addClass("fa-cloud-download")})})},function(t,e,n){(function(t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(288),i=n(293),o=void 0,a=function(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=arguments.length<=2||void 0===arguments[2]?function(){return!0}:arguments[2];return"function"==typeof n&&(a=n,n={}),n.method&&"post"===n.method&&n.body&&!function(){var t=new FormData;n.body=Object.assign({"admin-nonce":i.config.admin_nonce},n.body),Object.keys(n.body).map(function(e){return t.append(e,n.body[e])}),n.body=t}(),n=Object.assign({credentials:"same-origin",headers:{Accept:"application/json"}},n),t(e,n).then(function(t){return o=t,t}).then(r.parseStatus).then(r.parseJSON).then(r.userFeedback).then(function(t){return a(t,o)})["catch"](r.userFeedbackError)};e["default"]=a}).call(e,n(2))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(302),o=r(i),a=n(304);n(305),e["default"]={Chart:{Chart:o["default"],UpdatesChart:i.UpdatesChart,Instances:i.Instances},Cache:a.Instance}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instances=e.UpdatesChart=e.defaults=void 0;var s=function x(t,e,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:x(i,e,n)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(n)},u=function(){function t(t,e){for(var n=0;n"+d.translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD+" "+t.name+"
\n"+e.message+""})}},{key:"onDropzoneComplete",value:function(t){if(!t.accepted){var e={status:"error",message:d.translations.PLUGIN_ADMIN.FILE_UNSUPPORTED+": "+t.name.match(/\..+/).join("")};return this.handleError({file:t,data:e,mode:"removeFile",msg:"
"+d.translations.PLUGIN_ADMIN.FILE_ERROR_ADD+" "+t.name+"
\n"+e.message+""})}(0,s["default"])(".dz-preview").prop("draggable","true")}},{key:"onDropzoneRemovedFile",value:function(t){if(t.accepted&&!t.rejected){var e=this.form.data("media-url")+"/task"+d.config.param_sep+"delmedia";(0,f["default"])(e,{method:"post",body:{filename:t.name}})}}},{key:"onDropzoneError",value:function(t,e,n){var r=n?e.error.message:e;return(0,s["default"])(t.previewElement).find("[data-dz-errormessage]").html(r),this.handleError({file:t,data:{status:"error"},msg:"
"+r+""})}},{key:"handleError",value:function(t){var e=t.file,n=t.data,r=t.mode,i=t.msg;if("error"===n.status||"unauthorized"===n.status){switch(r){case"addBack":e instanceof File?this.dropzone.addFile.call(this.dropzone,e):(this.dropzone.files.push(e),this.dropzone.options.addedfile.call(this.dropzone,e),this.dropzone.options.thumbnail.call(this.dropzone,e,e.extras.url));break;case"removeFile":e.rejected=!0,this.dropzone.removeFile.call(this.dropzone,e)}var o=(0,s["default"])('[data-remodal-id="generic"]');o.find(".error-content").html(i),s["default"].remodal.lookup[o.data("remodal")].open()}}}]),t}();e["default"]=p;e.Instance=new p},,,function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(291),o=r(i);(0,o["default"])('[name="task"][value="saveas"], [name="task"][value="switchlanguage"]').on("mousedown touchstart",function(t){var e=["lang","redirect"],n=(0,o["default"])(t.currentTarget),r=(0,o["default"])("#"+n.attr("form"));return r.length?(e.forEach(function(t){var e=n.attr(t);if(e){var i=r.find('[name="'+t+'"]');i.length||(i=(0,o["default"])(''),r.append(i)),i.val(e)}}),!0):void 0})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(324),o=r(i),a=n(327),s=r(a),u=n(328),c=r(u);e["default"]={Form:{Form:s["default"],Instance:a.Instance},Fields:c["default"],FormState:{FormState:o["default"],Instance:i.Instance}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.DOMBehaviors=e.Instance=void 0;var o=function(){function t(t,e){for(var n=0;n
"+this.options.dictFallbackText+"
"),i+='"+this.options.dictFallbackText+"
"),i+='