"use strict";function_classCallCheck(a,b){if(!(ainstanceofb))thrownewTypeError("Cannot call a class as a function")}function_defineProperties(a,b){for(varc,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"inc&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function_createClass(a,b,c){returnb&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}/*
* Copyright (c) by the ACP3 Developers.
* See the LICENSE file at the top-level module directory for licencing details.
* Scroll to the beginning of the content area, if the current viewport is near the bottom
*/scrollIntoView:functionscrollIntoView(){varb=a(this.settings.targetElement).offset().top;a(c).scrollTop()>b&&a("html, body").animate({scrollTop:b},"fast")},replaceContent:functionreplaceContent(b,c){b&&a(b).length?a(b).html(a(c).find(b).html()):a(this.settings.targetElement).html(c)},rebindHandlers:functionrebindHandlers(b){varc=b&&a(b).length?a(b):a(this.settings.targetElement);c.find("[data-ajax-form=\"true\"]").formSubmit(),this.findSubmitButton()},hideLoadingLayer:functionhideLoadingLayer(){a("#loading-layer").removeClass("loading-layer__active")},handleFormErrorMessages:functionhandleFormErrorMessages(b,c){vard=a("#error-box"),e=b.find(".modal-body");// Place the error messages inside the modal body for a better styling
d.remove(),d=a(c),d.hide().prependTo(0<e.length&&e.is(":visible")?e:b).fadeIn(),this.prettyPrintResponseErrorMessages(b,d)},prettyPrintResponseErrorMessages:functionprettyPrintResponseErrorMessages(b,c){vard=this;// highlight all input fields where the validation has failed