Updated JQuery-flot plug-in integration
authorThierry Florac <tflorac@ulthar.net>
Wed, 16 Oct 2019 13:01:12 +0200
changeset 547 9fe15f541572
parent 546 9f02c09d2393
child 548 fd5c3b0c68d1
Updated JQuery-flot plug-in integration
src/pyams_skin/resources/js/myams-form.js
src/pyams_skin/resources/js/myams-plugins.js
src/pyams_skin/resources/js/myams-plugins.min.js
src/pyams_skin/resources/js/myams.js
src/pyams_skin/resources/js/myams.min.js
--- a/src/pyams_skin/resources/js/myams-form.js	Wed Oct 16 13:00:43 2019 +0200
+++ b/src/pyams_skin/resources/js/myams-form.js	Wed Oct 16 13:01:12 2019 +0200
@@ -181,16 +181,16 @@
 
 											   var button,
 												   buttonData,
-												   buttonTarget;
-											   var data = form.data();
-											   var formOptions = data.amsFormOptions;
-											   var formData;
-											   var formDataCallback;
+												   buttonTarget,
+												   data = form.data(),
+												   formOptions = data.amsFormOptions,
+												   formData,
+												   formDataCallback;
 
-											   var progressHandler;
-											   var progressInterval;
-											   var progressCallback;
-											   var progressEndCallback;
+											   var progressHandler,
+												   progressInterval,
+												   progressCallback,
+												   progressEndCallback;
 
 											   // Inner progress status handler
 											   function _getProgress(handler, progress_id) {
@@ -363,8 +363,8 @@
 														   if (modal.exists()) {
 															   ams.dialog && ams.dialog.close(form);
 														   } else {
-															   var callback;
-															   var button = form.data('ams-submit-button');
+															   var callback,
+																   button = form.data('ams-submit-button');
 															   if (button) {
 																   callback = button.data('ams-form-submit-callback');
 															   }
@@ -462,8 +462,8 @@
 		 * @param message: the optional message
 		 */
 		initSubmit: function(target, message) {
-			var form = $(this);
-			var spin = '<i class="fa fa-3x fa-gear fa-spin"></i>';
+			var form = $(this),
+				spin = '<i class="fa fa-3x fa-gear fa-spin"></i>';
 			if (!message) {
 				message = form.data('ams-form-submit-message');
 			}
@@ -509,8 +509,8 @@
 		 * @param message: the optional submit message
 		 */
 		initSubmitFooter: function(message) {
-			var form = $(this);
-			var spin = '<i class="fa fa-3x fa-gear fa-spin"></i>';
+			var form = $(this),
+				spin = '<i class="fa fa-3x fa-gear fa-spin"></i>';
 			if (!message) {
 				message = $(this).data('ams-form-submit-message');
 			}
@@ -529,8 +529,8 @@
 		 * @param target: the form submit container target
 		 */
 		finalizeSubmitFooter: function(/*target*/) {
-			var form = $(this);
-			var footer = $('footer', form);
+			var form = $(this),
+				footer = $('footer', form);
 			if (footer) {
 				$('.row', footer).remove();
 				$('button', footer).show();
@@ -565,8 +565,8 @@
 				}
 			}
 
-			var data = form.data();
-			var dataType;
+			var data = form.data(),
+				dataType;
 			if (data.amsFormDatatype) {
 				dataType = data.amsFormDatatype;
 			} else {
@@ -650,13 +650,13 @@
 			if (!validators.length) {
 				return true;
 			}
-			var output = [];
-			var result = true;
+			var output = [],
+				result = true;
 			for (var index=0; index < validators.length; index++) {
-				var validator = validators[index];
-				var source = validator[0];
-				var handler = validator[1];
-				var validatorResult = ams.executeFunctionByName(handler, form, source);
+				var validator = validators[index],
+					source = validator[0],
+					handler = validator[1],
+					validatorResult = ams.executeFunctionByName(handler, form, source);
 				if (validatorResult === false) {
 					result = false;
 				} else if (typeof(validatorResult) === 'string') {
--- a/src/pyams_skin/resources/js/myams-plugins.js	Wed Oct 16 13:00:43 2019 +0200
+++ b/src/pyams_skin/resources/js/myams-plugins.js	Wed Oct 16 13:01:12 2019 +0200
@@ -1695,45 +1695,75 @@
 		chart: function(element) {
 			var charts = $('.chart', element);
 			if (charts.length > 0) {
-				ams.ajax && ams.ajax.check($.fn.plot,
-										   ams.baseURL + 'flot/jquery.flot' + ams.devext + '.js',
-										   function() {
-											   charts.each(function() {
+				ams.ajax && ams.ajax.check([window.Flot, $.color],
+					[ams.baseURL + 'ext/flot/jquery.canvaswrapper' + ams.devext + '.js',
+					 ams.baseURL + 'ext/flot/jquery.colorhelpers' + ams.devext + '.js'],
+					function () {
+						ams.ajax.check($.fn.plot,
+							ams.baseURL + 'ext/flot/jquery.flot' + ams.devext + '.js',
+							function () {
+								charts.each(function () {
 
-												   function checkPlugin(plugin) {
-													   for (var index in $.plot.plugins) {
-														   if ($.plot.plugins.hasOwnProperty(index)) {
-															   var pluginInfo = $.plot.plugins[index];
-															   if (pluginInfo.name === plugin) {
-																   return pluginInfo;
-															   }
-														   }
-													   }
-													   return null;
-												   }
+									var chart = $(this),
+										data = chart.data(),
+										dataOptions = {},
+										plugin,
+										flotPlugins = (data.amsChartPlugins || '').split(/\s+/);
+
+									function checkPlugin(plugin) {
+										for (var index in $.plot.plugins) {
+											if ($.plot.plugins.hasOwnProperty(index)) {
+												var pluginInfo = $.plot.plugins[index];
+												if (pluginInfo.name === plugin) {
+													return pluginInfo;
+												}
+											}
+										}
+										return null;
+									}
 
-												   var chart = $(this);
-												   var data = chart.data();
-												   var dataOptions = {};
-												   var plugins = (data.amsChartPlugins || '').split(/\s+/);
-												   if (plugins.length > 0) {
-													   for (var index in plugins) {
-														   if (plugins.hasOwnProperty(index)) {
-															   var pluginName = plugins[index];
-															   if (!checkPlugin(pluginName)) {
-																   ams.getScript(ams.baseURL + 'flot/jquery.flot.' + pluginName + ams.devext + '.js');
-															   }
-														   }
-													   }
-												   }
-												   var settings = $.extend({}, dataOptions, data.amsChartOptions);
-												   settings = ams.executeFunctionByName(data.amsChartInitCallback, chart, settings) || settings;
-												   var chartData = data.amsChartData;
-												   chartData = ams.executeFunctionByName(data.amsChartInitData, chart, chartData) || chartData;
-												   var plugin = chart.plot(chartData, settings);
-												   ams.executeFunctionByName(data.amsChartAfterInitCallback, chart, plugin, settings);
-											   });
-										   });
+									function initChart() {
+										var settings = $.extend({}, dataOptions, data.amsChartOptions);
+										settings = ams.executeFunctionByName(data.amsChartInitCallback, chart, settings) || settings;
+										var chartData = data.amsChartData,
+											chartDataLoader = data.amsChartDataLoader;
+										if (chartDataLoader) {
+											$.getJSON(chartDataLoader, chartData).done(function (data) {
+												settings = $.extend({}, settings, data.settings);
+												createChart(data.data, settings);
+											});
+										} else {
+											createChart(data, settings);
+										}
+									}
+
+									function createChart(chartData, settings) {
+										chartData = ams.executeFunctionByName(data.amsChartInitData, chart, chartData) || chartData;
+										plugin = chart.plot(chartData, settings);
+										ams.executeFunctionByName(data.amsChartAfterInitCallback, chart, plugin, settings);
+									}
+
+									var deferred = [];
+									if (flotPlugins.length > 0) {
+										for (var index in flotPlugins) {
+											if (flotPlugins.hasOwnProperty(index)) {
+												var pluginName = flotPlugins[index];
+												if (!checkPlugin(pluginName)) {
+													deferred.push(ams.getScript(ams.baseURL + 'ext/flot/jquery.flot.' + pluginName + ams.devext + '.js'));
+												}
+											}
+										}
+									}
+									if (deferred.length > 0) {
+										$.when.apply($, deferred).then(function () {
+											initChart();
+										})
+									} else {
+										initChart();
+									}
+								});
+							});
+					});
 			}
 		},
 
--- a/src/pyams_skin/resources/js/myams-plugins.min.js	Wed Oct 16 13:00:43 2019 +0200
+++ b/src/pyams_skin/resources/js/myams-plugins.min.js	Wed Oct 16 13:01:12 2019 +0200
@@ -1,1 +1,1 @@
-!function(e,a){var t=a.MyAMS;e.extend(t.plugins.enabled,{svg:function(a){var t=e(".svg-container",a);t.length>0&&t.each(function(){var a=e(this),t=e("svg",a),n=t.attr("width"),s=t.attr("height");n&&s&&t.get(0).setAttribute("viewBox","0 0 "+Math.round(parseFloat(n))+" "+Math.round(parseFloat(s))),t.attr("width","100%").attr("height","auto")})},hint:function(a){var n=e(".hint:not(:parents(.nohints))",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.tipsy,t.baseURL+"ext/jquery-tipsy"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-tipsy"+t.devext+".css","jquery-tipsy",function(){n.each(function(){var a=e(this),n=a.data(),s={html:void 0===n.amsHintHtml?(a.attr("title")||"").startsWith("<"):n.amsHintHtml,title:t.getFunctionByName(n.amsHintTitleGetter)||function(){var a=e(this),t=a.attr("original-title")||a.attr(n.amsHintTitleAttr||"title")||(n.amsHintHtml?a.html():a.text());return t=t.replace(/\?_="/,"?_="+(new Date).getTime()+'"')},opacity:n.amsHintOpacity||.95,gravity:n.amsHintGravity||"sw",offset:n.amsHintOffset||0},i=e.extend({},s,n.amsHintOptions);i=t.executeFunctionByName(n.amsHintInitCallback,a,i)||i;var r=a.tipsy(i);t.executeFunctionByName(n.amsHintAfterInitCallback,a,r,i)})})})},contextMenu:function(a){var n=e(".context-menu",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={menuSelector:n.amsContextmenuSelector,menuSelected:t.helpers&&t.helpers.contextMenuHandler},i=e.extend({},s,n.amsContextmenuOptions);i=t.executeFunctionByName(n.amsContextmenuInitCallback,a,i)||i;var r=a.contextMenu(i);t.executeFunctionByName(n.amsContextmenuAfterInitCallback,a,r,i)})},switcher:function(a){e("LEGEND.switcher",a).each(function(){var a=e(this),t=a.parent("fieldset"),n=a.data();n.amsSwitcher||(e('<i class="fa fa-fw"></i>').prependTo(e(this)).addClass("open"===n.amsSwitcherState?n.amsSwitcherMinusClass||"fa-minus":n.amsSwitcherPlusClass||"fa-plus"),a.on("click",function(s){s.preventDefault();var i={};if(a.trigger("ams.switcher.before-switch",[a,i]),!i.veto)if(t.hasClass("switched")){t.removeClass("switched"),e(".fa",a).removeClass(n.amsSwitcherPlusClass||"fa-plus").addClass(n.amsSwitcherMinusClass||"fa-minus"),a.trigger("ams.switcher.opened",[a]);var r=a.attr("id");r&&e('legend.switcher[data-ams-switcher-sync="'+r+'"]',t).each(function(){var a=e(this);a.parents("fieldset").hasClass("switched")&&a.click()})}else t.addClass("switched"),e(".fa",a).removeClass(n.amsSwitcherMinusClass||"fa-minus").addClass(n.amsSwitcherPlusClass||"fa-plus"),a.trigger("ams.switcher.closed",[a])}),"open"!==n.amsSwitcherState&&t.addClass("switched"),a.data("ams-switcher","on"))})},checker:function(a){e("LEGEND.checker",a).each(function(){var a=e(this),n=a.parent("fieldset"),s=a.data();if(!s.amsChecker){var i=e('<label class="checkbox"></label>'),r=s.amsCheckerFieldname||"checker_"+t.generateId(),o=r.replace(/\./,"_"),c=s.amsCheckerHiddenPrefix,l=null,m=s.amsCheckerHiddenValueOn||"true",d=s.amsCheckerHiddenValueOff||"false",u=s.amsCheckerMarker||!1;c?l=e('<input type="hidden">').attr("name",c+r).val("on"===s.amsCheckerState?m:d).prependTo(a):u&&e('<input type="hidden">').attr("name",u).attr("value",1).prependTo(a);var b=e('<input type="checkbox">').attr("name",r).attr("id",o).data("ams-checker-hidden-input",l).data("ams-checker-init",!0).val(s.amsCheckerValue||!0).attr("checked","on"===s.amsCheckerState?"checked":null);s.amsCheckerReadonly?b.attr("disabled","disabled"):b.on("change",function(i){i.preventDefault();var r={},o=e(this).is(":checked");if(a.trigger("ams.checker.before-switch",[a,r]),r.veto)e(this).prop("checked",!o);else if(t.executeFunctionByName(s.amsCheckerChangeHandler,a,o),!s.amsCheckerCancelDefault){var c=b.data("ams-checker-hidden-input");o?("disable"===s.amsCheckerMode?(n.removeAttr("disabled"),e(".select2",n).removeAttr("disabled")):n.removeClass("switched"),c&&c.val(m),e("[data-required]",n).attr("required","required"),a.trigger("ams.checker.opened",[a])):("disable"===s.amsCheckerMode?(n.prop("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),c&&c.val(d),e("[data-required]",n).removeAttr("required"),a.trigger("ams.checker.closed",[a]))}}),b.appendTo(i),e(">label",a).attr("for",b.attr("id")),i.append("<i></i>").prependTo(a);var h=e("[required]",n);h.attr("data-required",!0),"on"===s.amsCheckerState?b.attr("checked",!0):("disable"===s.amsCheckerMode?(n.attr("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),h.removeAttr("required")),a.data("ams-checker","on")}})},slider:function(a){var n=e(".slider",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.slider,t.baseURL+"ext/bootstrap-slider-2.0.0"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=e.extend({},{},a.data.amsSliderOptions);s=t.executeFunctionByName(n.amsSliderInitCallback,a,s)||s;var i=a.slider(s);t.executeFunctionByName(n.amsSliderAfterInitCallback,a,i,s)})})},draggable:function(a){var n=e(".draggable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={cursor:n.amsDraggableCursor||"move",containment:n.amsDraggableContainment,handle:n.amsDraggableHandle,connectToSortable:n.amsDraggableConnectSortable,helper:t.getFunctionByName(n.amsDraggableHelper)||n.amsDraggableHelper,start:t.getFunctionByName(n.amsDraggableStart),stop:t.getFunctionByName(n.amsDraggableStop)},i=e.extend({},s,n.amsDraggableOptions);i=t.executeFunctionByName(n.amsDraggableInitCallback,a,i)||i;var r=a.draggable(i);a.disableSelection(),t.executeFunctionByName(n.amsDraggableAfterInitCallback,a,r,i)})},droppable:function(a){var n=e(".droppable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={accept:n.amsdroppableAccept,drop:t.getFunctionByName(n.amsDroppableDrop)},i=e.extend({},s,n.amsDroppableOptions);i=t.executeFunctionByName(n.amsDroppableInitCallback,a,i)||i;var r=a.droppable(i);t.executeFunctionByName(n.amsDroppableAfterInitCallback,a,r,i)})},sortable:function(a){var n=e(".sortable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={items:n.amsSortableItems,handle:n.amsSortableHandle,helper:n.amsSortableHelper,connectWith:n.amsSortableConnectwith,start:t.getFunctionByName(n.amsSortableStart),over:t.getFunctionByName(n.amsSortableOver),containment:n.amsSortableContainment,placeholder:n.amsSortablePlaceholder,stop:t.getFunctionByName(n.amsSortableStop)},i=e.extend({},s,n.amsSortableOptions);i=t.executeFunctionByName(n.amsSortableInitCallback,a,i)||i;var r=a.sortable(i);a.disableSelection(),t.executeFunctionByName(n.amsSortableAfterInitCallback,a,r,i)})},resizable:function(a){var n=e(".resizable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={autoHide:!1===n.amsResizableAutohide||n.amsResizableAutohide,containment:n.amsResizableContainment,grid:n.amsResizableGrid,handles:n.amsResizableHandles,start:t.getFunctionByName(n.amsResizableStart),stop:t.getFunctionByName(n.amsResizableStop)},i=e.extend({},s,n.amsResizableOptions);i=t.executeFunctionByName(n.amsResizableInitCallback,a,i)||i;var r=a.resizable(i);a.disableSelection(),t.executeFunctionByName(n.amsResizableAfterInitCallback,a,r,i)})},typeahead:function(a){var n=e(".typeahead",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.typeahead,t.baseURL+"ext/jquery-typeahead"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=e.extend({},{},n.amsTypeaheadOptions);s=t.executeFunctionByName(n.amsTypeaheadInitCallback,a,s)||s;var i=a.typeahead(s);t.executeFunctionByName(n.amsTypeaheadAfterInitCallback,a,i,s)})})},treeview:function(a){var n=e(".treeview",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.treview,t.baseURL+"ext/bootstrap-treeview"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/bootstrap-treeview"+t.devext+".css","bootstrap-treeview",function(){n.each(function(){var a=e(this),n=a.data(),s={data:n.amsTreeviewData,levels:n.amsTreeviewLevels,injectStyle:n.amsTreeviewInjectStyle,expandIcon:n.amsTreeviewExpandIcon||"fa fa-fw fa-plus-square-o",collapseIcon:n.amsTreeviewCollaspeIcon||"fa fa-fw fa-minus-square-o",emptyIcon:n.amsTreeviewEmptyIcon||"fa fa-fw",nodeIcon:n.amsTreeviewNodeIcon,selectedIcon:n.amsTreeviewSelectedIcon,checkedIcon:n.amsTreeviewCheckedIcon||"fa fa-fw fa-check-square-o",uncheckedIcon:n.amsTreeviewUncheckedIcon||"fa fa-fw fa-square-o",color:n.amsTreeviewColor,backColor:n.amsTreeviewBackColor,borderColor:n.amsTreeviewBorderColor,onHoverColor:n.amsTreeviewHoverColor,selectedColor:n.amsTreeviewSelectedColor,selectedBackColor:n.amsTreeviewSelectedBackColor,unselectableColor:n.amsTreeviewUnselectableColor||"rgba(1,1,1,0.25)",unselectableBackColor:n.amsTreeviewUnselectableBackColor||"rgba(1,1,1,0.25)",enableLinks:n.amsTreeviewEnableLinks,highlightSelected:n.amsTreeviewHighlightSelected,highlightSearchResults:n.amsTreeviewhighlightSearchResults,showBorder:n.amsTreeviewShowBorder,showIcon:n.amsTreeviewShowIcon,showCheckbox:n.amsTreeviewShowCheckbox,showTags:n.amsTreeviewShowTags,toggleUnselectable:n.amsTreeviewToggleUnselectable,multiSelect:n.amsTreeviewMultiSelect,onNodeChecked:t.getFunctionByName(n.amsTreeviewNodeChecked),onNodeCollapsed:t.getFunctionByName(n.amsTreeviewNodeCollapsed),onNodeDisabled:t.getFunctionByName(n.amsTreeviewNodeDisabled),onNodeEnabled:t.getFunctionByName(n.amsTreeviewNodeEnabled),onNodeExpanded:t.getFunctionByName(n.amsTreeviewNodeExpanded),onNodeSelected:t.getFunctionByName(n.amsTreeviewNodeSelected),onNodeUnchecked:t.getFunctionByName(n.amsTreeviewNodeUnchecked),onNodeUnselected:t.getFunctionByName(n.amsTreeviewNodeUnselected),onSearchComplete:t.getFunctionByName(n.amsTreeviewSearchComplete),onSearchCleared:t.getFunctionByName(n.amsTreeviewSearchCleared)},i=e.extend({},s,n.amsTreeviewOptions);i=t.executeFunctionByName(n.amsTreeviewInitcallback,a,i)||i;var r=a.treeview(i);t.executeFunctionByName(n.amsTreeviewAfterInitCallback,a,r,i)})})})},select2:function(a){var n=e(".select2",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.select2,t.baseURL+"ext/jquery-select2-3.5.4"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();if(!n.select2){var s={placeholder:n.amsSelect2Placeholder,multiple:n.amsSelect2Multiple,minimumInputLength:n.amsSelect2MinimumInputLength||0,maximumSelectionSize:n.amsSelect2MaximumSelectionSize,openOnEnter:void 0===n.amsSelect2EnterOpen||n.amsSelect2EnterOpen,allowClear:void 0===n.amsSelect2AllowClear||n.amsSelect2AllowClear,width:n.amsSelect2Width||"100%",initSelection:t.getFunctionByName(n.amsSelect2InitSelection),formatSelection:void 0===n.amsSelect2FormatSelection?t.helpers&&t.helpers.select2FormatSelection:t.getFunctionByName(n.amsSelect2FormatSelection),formatResult:t.getFunctionByName(n.amsSelect2FormatResult),formatMatches:void 0===n.amsSelect2FormatMatches?function(e){return 1===e?t.i18n.SELECT2_MATCH:e+t.i18n.SELECT2_MATCHES}:t.getFunctionByName(n.amsSelect2FormatMatches),formatNoMatches:void 0===n.amsSelect2FormatResult?function(e){return t.i18n.SELECT2_NOMATCHES}:t.getFunctionByName(n.amsSelect2FormatResult),formatInputTooShort:void 0===n.amsSelect2FormatInputTooShort?function(e,a){var n=a-e.length;return t.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooShort),formatInputTooLong:void 0===n.amsSelect2FormatInputTooLong?function(e,a){var n=e.length-a;return t.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooLong),formatSelectionTooBig:void 0===n.amsSelect2FormatSelectionTooBig?function(e){return t.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,e).replace(/\{1\}/,1===e?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatSelectionTooBig),formatLoadMore:void 0===n.amsSelect2FormatLoadMore?function(e){return t.i18n.SELECT2_LOADMORE}:t.getFunctionByName(n.amsSelect2FormatLoadMore),formatSearching:void 0===n.amsSelect2FormatSearching?function(){return t.i18n.SELECT2_SEARCHING}:t.getFunctionByName(n.amsSelect2FormatSearching),separator:n.amsSelect2Separator||",",tokenSeparators:n.amsSelect2TokensSeparators||[","],tokenizer:t.getFunctionByName(n.amsSelect2Tokenizer)};switch(a.context.type){case"text":case"hidden":if(!s.initSelection){var i=a.data("ams-select2-values");i&&(s.initSelection=function(a,t){var n=[];e(a.val().split(s.separator)).each(function(){n.push({id:this,text:i[this]||this})}),t(n)})}}a.attr("readonly")?"hidden"===a.attr("type")&&(s.query=function(){return[]}):n.amsSelect2Query?(s.query=t.getFunctionByName(n.amsSelect2Query),s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryUrl?(s.ajax={url:n.amsSelect2QueryUrl,quietMillis:n.amsSelect2QuietMillis||200,type:n.amsSelect2QueryType||"POST",dataType:n.amsSelect2QueryDatatype||"json",data:function(a,t,s){var i={};return i[n.amsSelect2QueryParamName||"query"]=a,i[n.amsSelect2PageParamName||"page"]=t,i[n.amsSelect2ContextParamName||"context"]=s,e.extend({},i,n.amsSelect2QueryOptions)},results:t.helpers&&t.helpers.select2QueryUrlResultsCallback},s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryMethod?(s.query=function(s){var i={id:(new Date).getTime(),params:n.amsSelect2QueryParams||{},success:function(e){return t.helpers&&t.helpers.select2QueryMethodSuccessCallback.call(a,e,"success",s)},error:t.error&&t.error.show};i.params[n.amsSelect2QueryParamName||"query"]=s.term,i.params[n.amsSelect2PageParamName||"page"]=s.page,i.params[n.amsSelect2ContextParamName||"context"]=s.context,i=e.extend({},i,n.amsSelect2QueryOptions),i=t.executeFunctionByName(n.amsSelect2QueryInitCallback,a,i)||i,t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){e.jsonRPC.withOptions({endPoint:n.amsSelect2MethodTarget||t.jsonrpc&&t.jsonrpc.getAddr(),namespace:n.amsSelect2MethodNamespace,cache:!1},function(){e.jsonRPC.request(n.amsSelect2QueryMethod,i)})})},s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2Tags?s.tags=n.amsSelect2Tags:n.amsSelect2Data&&(s.data=n.amsSelect2Data),n.amsSelect2EnableFreeTags&&(s.createSearchChoice=function(e){return{id:e,text:(n.amsSelect2FreeTagsPrefix||t.i18n.SELECT2_FREETAG_PREFIX)+e}});var r=e.extend({},s,n.amsSelect2Options);r=t.executeFunctionByName(n.amsSelect2InitCallback,a,r)||r;var o=a.select2(r);t.executeFunctionByName(n.amsSelect2AfterInitCallback,a,o,r),a.hasClass("ordered")&&t.ajax&&t.ajax.check(e.fn.select2Sortable,t.baseURL+"ext/jquery-select2-sortable"+t.devext+".js",function(){a.select2Sortable({bindOrder:"sortableStop"})}),a.on("change",function(){void 0!==e(a.get(0).form).data("validator")&&e(a).valid()})}})})},maskedit:function(a){var n=e("[data-mask]",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.mask,t.baseURL+"ext/jquery-maskedinput-1.4.1"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s={placeholder:void 0===n.amsMaskeditPlaceholder?"X":n.amsMaskeditPlaceholder,complete:t.getFunctionByName(n.amsMaskeditComplete)},i=e.extend({},s,n.amsMaskeditOptions);i=t.executeFunctionByName(n.amsMaskeditInitCallback,a,i)||i;var r=a.mask(a.attr("data-mask"),i);t.executeFunctionByName(n.amsMaskeditAfterInitCallback,a,r,i)})})},inputmask:function(a){var n=e("input[data-input-mask]",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.inputmask,t.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+t.devext+".js",function(){n.each(function(){var a,n=e(this),s=n.data();a="object"==typeof s.inputMask?s.inputMask:{mask:s.inputMask.toString()};var i=e.extend({},a,s.amsInputmaskOptions);i=t.executeFunctionByName(s.amsInputmaskInitCallback,n,i)||i;var r=n.inputmask(i);t.executeFunctionByName(s.amsInputmaskAfterInitCallback,n,r,i)})})},datepicker:function(a){var n=e(".datepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y",datepicker:!0,dayOfWeekStart:1,timepicker:!1,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},datetimepicker:function(a){var n=e(".datetimepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y H:i",datepicker:!0,dayOfWeekStart:1,timepicker:!0,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},timepicker:function(a){var n=e(".timepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},colorpicker:function(a){var n=e(".colorpicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.minicolors,t.baseURL+"ext/jquery-minicolors"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-minicolors"+t.devext+".css","jquery-minicolors",function(){n.each(function(){var a=e(this),n=a.data(),s={position:n.amsColorpickerPosition||a.closest(".input").data("ams-colorpicker-position")||"bottom left"},i=e.extend({},s,n.amsColorpickerOptions);i=t.executeFunctionByName(n.amsColorpickerInitCallback,a,i)||i;var r=a.minicolors(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},dndupload:function(a){var n=e(".dndupload",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.dndupload,t.baseURL+"ext/jquery-dndupload"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-dndupload"+t.devext+".css","jquery-dndupload",function(){n.each(function(){var a=e(this),n=a.data(),s={action:n.amsDnduploadAction||a.attr("action")||"upload-files",fieldname:n.amsDnduploadFieldname||"files",autosubmit:n.amsDnduploadAutosubmit},i=e.extend({},s,n.amsDnduploadOptions);i=t.executeFunctionByName(n.amsDnduploadInitCallback,a,i)||i;var r=a.dndupload(i);t.executeFunctionByName(n.amsDnduploadAfterInitcallback,a,r,i)})})})},validate:function(a){var n=e("FORM:not([novalidate])",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.validate,t.baseURL+"ext/jquery-validate-1.17.0"+t.devext+".js",function(a){if(a&&(e.validator.setDefaults({highlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(e,a){var t=a.parents("label, .input").first();t.length?e.insertAfter(t):e.insertAfter(a)}}),t.plugins&&t.plugins.i18n)){for(var s in t.plugins.i18n.validate)if(t.plugins.i18n.validate.hasOwnProperty(s)){var i=t.plugins.i18n.validate[s];"string"==typeof i&&i.indexOf("{0}")>-1&&(t.plugins.i18n.validate[s]=e.validator.format(i))}e.extend(e.validator.messages,t.plugins.i18n.validate)}n.each(function(){var a=e(this),n=a.data(),s={ignore:null,submitHandler:void 0!==a.attr("data-async")?void 0===n.amsFormSubmitHandler?function(){return e(".state-error",a).removeClass("state-error"),t.ajax&&t.ajax.check(e.fn.ajaxSubmit,t.baseURL+"ext/jquery-form-3.49"+t.devext+".js"),t.form&&t.form.submit(a)}:t.getFunctionByName(n.amsFormSubmitHandler):void 0,invalidHandler:void 0===n.amsFormInvalidHandler?function(t,n){e(".state-error",a).removeClass("state-error");for(var s=0;s<n.errorList.length;s++){var i=n.errorList[s],r=e(i.element).parents(".tab-pane").index()+1;if(r>0){var o=e(".nav-tabs",e(i.element).parents(".tabforms"));e("li:nth-child("+r+")",o).removeClassPrefix("state-").addClass("state-error"),e("li.state-error:first a",o).click()}}}:t.getFunctionByName(n.amsFormInvalidHandler)};e("[data-ams-validate-rules]",a).each(function(a){0===a&&(s.rules={}),s.rules[e(this).attr("name")]=e(this).data("ams-validate-rules")}),e("[data-ams-validate-messages]",a).each(function(a){0===a&&(s.messages={}),s.messages[e(this).attr("name")]=e(this).data("ams-validate-messages")});var i=e.extend({},s,n.amsValidateOptions);i=t.executeFunctionByName(n.amsValidateInitCallback,a,i)||i;var r=a.validate(i);t.executeFunctionByName(n.amsValidateAfterInitCallback,a,r,i)})})},datatable:function(a){var n=e(".datatable",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.dataTable,t.baseURL+"ext/jquery-dataTables-1.9.4"+t.devext+".js",function(){t.ajax.check(e.fn.dataTableExt.oPagination.bootstrap_full,t.baseURL+"myams-dataTables"+t.devext+".js",function(){e(n).each(function(){var a,n=e(this),s=n.data(),i=(s.amsDatatableExtensions||"").split(/\s+/),r=s.amsDatatableSdom||"W"+(i.indexOf("colreorder")>=0||i.indexOf("colreorderwithresize")>=0?"R":"")+"<'dt-top-row'"+(i.indexOf("colvis")>=0?"C":"")+(!1===s.amsDatatablePagination||!1===s.amsDatatablePaginationSize?"":"L")+(!1===s.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(i.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===s.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",o=s.amsDatatableSorting;if("string"==typeof o){var c=o.split(";");for(o=[],a=0;a<c.length;a++){var l=c[a].split(",");l[0]=parseInt(l[0]),o.push(l)}}var m,d=[],u=e("th",n).listattr("data-ams-datatable-sortable");for(a=0;a<u.length;a++){var b=u[a];void 0!==b?((m=d[a]||{}).bSortable="string"==typeof b?JSON.parse(b):b,d[a]=m):d[a]=d[a]||{}}var h=e("th",n).listattr("data-ams-datatable-stype");for(a=0;a<h.length;a++){var p=h[a];p?((m=d[a]||{}).sType=p,d[a]=m):d[a]=d[a]||{}}var f={bJQueryUI:!1,bServerSide:s.amsDatatableServerSide||!1,sAjaxSource:!0===s.amsDatatableServerSide?s.amsDatatableAjaxSource:void 0,sServerMethod:!0===s.amsDatatableServerSide?"POST":void 0,bFilter:!1!==s.amsDatatableGlobalFilter||i.indexOf("columnfilter")>=0,bPaginate:!1!==s.amsDatatablePagination,bInfo:!1!==s.amsDatatableInfo,bSort:!1!==s.amsDatatableSort,aaSorting:o,aoColumns:d.length>0?d:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:s.amsDatatableDisplayLength||25,sPaginationType:s.amsDatatablePaginationType||"bootstrap_full",sDom:r,oLanguage:t.plugins&&t.plugins.i18n.datatables,fnInitComplete:function(a,n){e(".ColVis_Button").addClass("btn btn-default btn-sm").html((t.plugins&&t.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}},g=e.extend({},f,s.amsDatatableOptions),x=[],v=[],y=[];if(i.length>0)for(a=0;a<i.length;a++)switch(i[a]){case"autofill":x.push(e.fn.dataTable.AutoFill),v.push(t.baseURL+"ext/jquery-dataTables-autoFill"+t.devext+".js");break;case"columnfilter":x.push(e.fn.columnFilter),v.push(t.baseURL+"ext/jquery-dataTables-columnFilter"+t.devext+".js");break;case"colreorder":x.push(e.fn.dataTable.ColReorder),v.push(t.baseURL+"ext/jquery-dataTables-colReorder"+t.devext+".js");break;case"colreorderwithresize":x.push(window.ColReorder),v.push(t.baseURL+"ext/jquery-dataTables-colReorderWithResize"+t.devext+".js");break;case"colvis":x.push(e.fn.dataTable.ColVis),v.push(t.baseURL+"ext/jquery-dataTables-colVis"+t.devext+".js"),y.push(function(){g.oColVis=e.extend({},{activate:"click",sAlign:"right"},s.amsDatatableColvisOptions)});break;case"editable":x.push(e.fn.editable),v.push(t.baseURL+"ext/jquery-jeditable"+t.devext+".js"),x.push(e.fn.makeEditable),v.push(t.baseURL+"ext/jquery-dataTables-editable"+t.devext+".js");break;case"fixedcolumns":x.push(e.fn.dataTable.FixedColumns),v.push(t.baseURL+"ext/jquery-dataTables-fixedColumns"+t.devext+".js");break;case"fixedheader":x.push(e.fn.dataTable.Fixedheader),v.push(t.baseURL+"ext/jquery-dataTables-fixedHeader"+t.devext+".js");break;case"keytable":x.push(window.keyTable),v.push(t.baseURL+"ext/jquery-dataTables-keyTable"+t.devext+".js");break;case"rowgrouping":x.push(e.fn.rowGrouping),v.push(t.baseURL+"ext/jquery-dataTables-rowGrouping"+t.devext+".js");break;case"rowreordering":x.push(e.fn.rowReordering),v.push(t.baseURL+"ext/jquery-dataTables-rowReordering"+t.devext+".js");break;case"scroller":x.push(e.fn.dataTable.Scroller),v.push(t.baseURL+"ext/jquery-dataTables-scroller"+t.devext+".js")}y.push(function(){g=t.executeFunctionByName(s.amsDatatableInitCallback,n,g)||g;try{var r=n.dataTable(g);if(t.executeFunctionByName(s.amsDatatableAfterInitCallback,n,r,g),i.length>0)for(a=0;a<i.length;a++)switch(i[a]){case"autofill":var o=e.extend({},s.amsDatatableAutofillOptions,g.autofill);o=t.executeFunctionByName(s.amsDatatableAutofillInitCallback,n,o)||o,n.data("ams-autofill",void 0===s.amsDatatableAutofillConstructor?new e.fn.dataTable.AutoFill(n,o):t.executeFunctionByName(s.amsDatatableAutofillConstructor,n,r,o));break;case"columnfilter":var c=e.extend({},{sPlaceHolder:"head:after"},s.amsDatatableColumnfilterOptions,g.columnfilter);c=t.executeFunctionByName(s.amsDatatableColumnfilterInitCallback,n,c)||c,n.data("ams-columnfilter",void 0===s.amsDatatableColumnfilterConstructor?r.columnFilter(c):t.executeFunctionByName(s.amsDatatableColumnfilterConstructor,n,r,c));break;case"editable":var l=e.extend({},s.amsDatatableEditableOptions,g.editable);l=t.executeFunctionByName(s.amsDatatableEditableInitCallback,n,l)||l,n.data("ams-editable",void 0===s.amsDatatableEditableConstructor?n.makeEditable(l):t.executeFunctionByName(s.amsDatatableEditableConstructor,n,r,l));break;case"fixedcolumns":var m=e.extend({},s.amsDatatableFixedcolumnsOptions,g.fixedcolumns);m=t.executeFunctionByName(s.amsDatatableFixedcolumnsInitCallback,n,m)||m,n.data("ams-fixedcolumns",void 0===s.amsDatatableFixedcolumnsConstructor?new e.fn.dataTable.FixedColumns(n,m):t.executeFunctionByName(s.amsDatatableFixedcolumnsConstructor,n,r,m));break;case"fixedheader":var d=e.extend({},s.amsDatatableFixedheaderOptions,g.fixedheader);d=t.executeFunctionByName(s.amsDatatableFixedheadeInitCallback,n,d)||d,n.data("ams-fixedheader",void 0===s.amsDatatableFixedheaderConstructor?new e.fn.dataTable.FixedHeader(n,d):t.executeFunctionByName(s.amsDatatableFixedheaderConstructor,n,r,d));break;case"keytable":var u={table:n.get(0),datatable:r},b=e.extend({},u,s.amsDatatableKeytableOptions,g.keytable);b=t.executeFunctionByName(s.amsDatatableKeytableInitCallback,n,b)||b,n.data("ams-keytable",void 0===s.amsDatatableKeytableConstructor?new KeyTable(b):t.executeFunctionByName(s.amsDatatableKeytableConstructor,n,r,b));break;case"rowgrouping":var h=e.extend({},s.amsDatatableRowgroupingOptions,g.rowgrouping);h=t.executeFunctionByName(s.amsDatatableRowgroupingInitCallback,n,h)||h,n.data("ams-rowgrouping",void 0===s.amsDatatableRowgroupingConstructor?n.rowGrouping(h):t.executeFunctionByName(s.amsDatatableRowgroupingConstructor,n,r,h));break;case"rowreordering":var p=e.extend({},s.amsDatatableRowreorderingOptions,g.rowreordering);p=t.executeFunctionByName(s.amsDatatableRowreorderingInitCallback,n,p)||p,n.data("ams-rowreordering",void 0===s.amsDatatableRowreorderingConstructor?n.rowReordering(p):t.executeFunctionByName(s.amsDatatableRowreorderingConstructor,n,r,p))}if(s.amsDatatableFinalizeCallback){var f=s.amsDatatableFinalizeCallback.split(/\s+/);if(f.length>0)for(a=0;a<f.length;a++)t.executeFunctionByName(f[a],n,r,g)}}catch(e){}}),t.ajax&&t.ajax.check(x,v,y)})})})},tablednd:function(a){var n=e(".table-dnd",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.tableDnD,t.baseURL+"ext/jquery-tablednd"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();n.amsTabledndDragHandle?e("tr",a).addClass("no-drag-handle"):e(a).on("mouseover","tr",function(){e(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){e(this.cells[0]).removeClass("drag-handle")});var s={onDragClass:n.amsTabledndDragClass||"dragging-row",onDragStart:t.getFunctionByName(n.amsTabledndDragStart),dragHandle:n.amsTabledndDragHandle,scrollAmount:n.amsTabledndScrollAmount,onAllowDrop:n.amsTabledndAllowDrop,onDrop:t.getFunctionByName(n.amsTabledndDrop)||function(s,i){var r=n.amsTabledndDropTarget;if(r){e(i).data("ams-disabled-handlers","click");try{var o=[];e(s.rows).each(function(){var a=e(this).data("ams-element-name");a&&o.push(a)});var c=t.getFunctionByName(r);if("function"==typeof c)c.call(a,s,o);else{if(!r.startsWith(window.location.protocol)){var l=n.amsLocation;l&&(r=l+"/"+r)}t.ajax&&t.ajax.post(r,{names:JSON.stringify(o)},function(e,a){"success"!==e.status&&t.ajax.handleJSON(e)})}}finally{setTimeout(function(){e(i).removeData("ams-disabled-handlers")},50)}}return!1}},i=e.extend({},s,n.amsTabledndOptions);i=t.executeFunctionByName(n.amsTabledndInitCallback,a,i)||i;var r=a.tableDnD(i);t.executeFunctionByName(n.amsTabledndAfterInitCallback,a,r,i)})})},wizard:function(a){var n=e(".wizard",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.bootstrapWizard,t.baseURL+"ext/bootstrap-wizard-1.4.2"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s={withVisible:void 0===n.amsWizardWithVisible||n.amsWizardWithVisible,tabClass:n.amsWizardTabClass,firstSelector:n.amsWizardFirstSelector,previousSelector:n.amsWizardPreviousSelector,nextSelector:n.amsWizardNextSelector,lastSelector:n.amsWizardLastSelector,finishSelector:n.amsWizardFinishSelector,backSelector:n.amsWizardBackSelector,onInit:t.getFunctionByName(n.amsWizardInit),onShow:t.getFunctionByName(n.amsWizardShow),onNext:t.getFunctionByName(n.amsWizardNext),onPrevious:t.getFunctionByName(n.amsWizardPrevious),onFirst:t.getFunctionByName(n.amsWizardFirst),onLast:t.getFunctionByName(n.amsWizardLast),onBack:t.getFunctionByName(n.amsWizardBack),onFinish:t.getFunctionByName(n.amsWizardFinish),onTabChange:t.getFunctionByName(n.amsWizardTabChange),onTabClick:t.getFunctionByName(n.amsWizardTabClick),onTabShow:t.getFunctionByName(n.amsWizardTabShow)},i=e.extend({},s,n.amsWizardOptions);i=t.executeFunctionByName(n.amsWizardInitCallback,a,i)||i;var r=a.bootstrapWizard(i);t.executeFunctionByName(n.amsWizardAfterInitCallback,a,r,i)})})},tinymce:function(a){function n(){e(".tinymce",e(this)).each(function(){var a=tinymce.get(e(this).attr("id"));a&&a.remove()})}var s=e(".tinymce",a);if(s.length>0){var i=t.baseURL+"ext/tinymce"+(t.devmode?"/dev":"");t.ajax&&t.ajax.check(window.tinymce,i+"/tinymce"+t.devext+".js",function(a){function r(){s.each(function(){var a=e(this),n=a.data(),s={theme:n.amsTinymceTheme||"modern",language:t.lang,menubar:!1!==n.amsTinymceMenubar,statusbar:!1!==n.amsTinymceStatusbar,plugins:n.amsTinymcePlugins||["advlist autosave autolink lists link charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern autoresize"],toolbar:n.amsTinymceToolbar,toolbar1:!1!==n.amsTinymceToolbar1&&(n.amsTinymceToolbar1||"undo redo | pastetext | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"),toolbar2:!1!==n.amsTinymceToolbar2&&(n.amsTinymceToolbar2||"forecolor backcolor emoticons | charmap link image media | fullscreen preview print | code"),content_css:n.amsTinymceContentCss,formats:n.amsTinymceFormats,style_formats:n.amsTinymceStyleFormats,block_formats:n.amsTinymceBlockFormats,valid_classes:n.amsTinymceValidClasses,image_advtab:!0,image_list:t.getFunctionByName(n.amsTinymceImageList)||n.amsTinymceImageList,image_class_list:n.amsTinymceImageClassList,link_list:t.getFunctionByName(n.amsTinymceLinkList)||n.amsTinymceLinkList,link_class_list:n.amsTinymceLinkClassList,paste_as_text:void 0===n.amsTinymcePasteAsText||n.amsTinymcePasteAsText,paste_auto_cleanup_on_paste:void 0===n.amsTinymcePasteAutoCleanup||n.amsTinymcePasteAutoCleanup,paste_strip_class_attributes:n.amsTinymcePasteStripClassAttributes||"all",paste_remove_spans:void 0===n.amsTinymcePaseRemoveSpans||n.amsTinymcePasteRemoveSpans,paste_remove_styles:void 0===n.amsTinymcePasteRemoveStyles||n.amsTinymcePasteRemoveStyles,height:n.amsTinymceHeight||50,min_height:50,resize:!0,autoresize_min_height:50,autoresize_max_height:500};if(n.amsTinymceExternalPlugins){var i=n.amsTinymceExternalPlugins.split(/\s+/);for(var r in i)if(i.hasOwnProperty(r)){var o=a.data("ams-tinymce-plugin-"+i[r]);tinymce.PluginManager.load(i[r],t.getSource(o))}}var c=e.extend({},s,n.amsTinymceOptions);c=t.executeFunctionByName(n.amsTinymceInitCallback,a,c)||c;var l=a.tinymce(c);t.executeFunctionByName(n.amsTinymceAfterInitCallback,a,l,c)})}a?t.getScript(i+"/jquery.tinymce"+t.devext+".js",function(){tinymce.baseURL=i,tinymce.suffix=t.devext,t.skin&&t.skin.registerCleanCallback(n),r()}):r()})}},editor:function(n){var s=e(".text-editor textarea",n);s.length>0&&t.ajax&&t.ajax.check(a.ace,t.baseURL+"ext/ace/ace.js",function(n){var i=function(){a.ace_loaded=!0,s.each(function(){var a=e(this),n=a.parents(".text-editor"),s=n.data(),i=ace.require("ace/ext/modelist"),r=s.amsEditorMode||i.getModeForPath(s.amsEditorFilename||"editor.txt").mode,o=e("<div>",{position:"absolute",width:a.width(),height:a.height(),class:a.attr("class")}).insertBefore(a);a.css("display","none");var c=ace.edit(o[0]),l={mode:r,tabSize:4,useSoftTabs:!1,showGutter:!0,showLineNumbers:!0,printMargin:132,showInvisibles:!0},m=e.extend({},l,s.amsEditorOptions);m=t.executeFunctionByName(s.amsEditorInitCallback,a,m)||m,c.setOptions(m),c.session.setValue(a.val()),c.session.on("change",function(){a.val(c.session.getValue())}),n.data("editor",c),t.executeFunctionByName(s.amsEditorAfterInitCallback,a,c,m)})};n?(ace.config.set("basePath",t.baseURL+"ext/ace"),t.ajax.check(a.ace_loaded,[t.baseURL+"ext/ace/ext-modelist.js"],i)):i()})},imgareaselect:function(a){var n=e(".imgareaselect",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.imgAreaSelect,t.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-imgareaselect"+t.devext+".css","jquery-imgareaselect",function(){n.each(function(){var a=e(this),n=a.data(),s=n.amsImgareaselectParent?a.parents(n.amsImgareaselectParent):"body",i={instance:!0,handles:!0,parent:s,x1:n.amsImgareaselectX1||0,y1:n.amsImgareaselectY1||0,x2:n.amsImgareaselectX2||n.amsImgareaselectImageWidth,y2:n.amsImgareaselectY2||n.amsImgareaselectImageHeight,imageWidth:n.amsImgareaselectImageWidth,imageHeight:n.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:n.amsImgareaselectRatio,onSelectEnd:t.getFunctionByName(n.amsImgareaselectSelectEnd)||function(a,t){var i=n.amsImgareaselectTargetField||"image_";e('input[name="'+i+'x1"]',s).val(t.x1),e('input[name="'+i+'y1"]',s).val(t.y1),e('input[name="'+i+'x2"]',s).val(t.x2),e('input[name="'+i+'y2"]',s).val(t.y2)}},r=e.extend({},i,n.amsImgareaselectOptions);r=t.executeFunctionByName(n.amsImgareaselectInitCallback,a,r)||r;var o=a.imgAreaSelect(r);t.executeFunctionByName(n.amsImgareaselectAfterInitCallback,a,o,r),setTimeout(function(){o.update()},250)})})})},fancybox:function(a){var n=e(".fancybox",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.fancybox,t.baseURL+"ext/jquery-fancybox-2.1.5"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-fancybox-2.1.5"+t.devext+".css","jquery-fancybox",function(){n.each(function(){var a,n=e(this),s=n.data(),i=n;s.amsFancyboxElements&&(i=e(s.amsFancyboxElements,n));var r=(s.amsFancyboxHelpers||"").split(/\s+/);if(r.length>0)for(a=0;a<r.length;a++)switch(r[a]){case"buttons":t.ajax&&t.ajax.check(e.fancybox.helpers.buttons,t.baseURL+"ext/fancybox-helpers/fancybox-buttons"+t.devext+".js");break;case"thumbs":t.ajax&&t.ajax.check(e.fancybox.helpers.thumbs,t.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+t.devext+".js");break;case"media":t.ajax&&t.ajax.check(e.fancybox.helpers.media,t.baseURL+"ext/fancybox-helpers/fancybox-media"+t.devext+".js")}var o={type:s.amsFancyboxType,padding:s.amsFancyboxPadding||10,margin:s.amsFancyboxMargin||10,loop:s.amsFancyboxLoop,beforeLoad:t.getFunctionByName(s.amsFancyboxBeforeLoad)||function(){var a;if(s.amsFancyboxTitleGetter&&(a=t.executeFunctionByName(s.amsFancyboxTitleGetter,this)),!a){var n=e("*:first",this.element);(a=n.attr("original-title")||n.attr("title"))||(a=e(this.element).attr("original-title")||e(this.element).attr("title"))}this.title=a},afterLoad:t.getFunctionByName(s.amsFancyboxAfterLoad),helpers:{title:{type:"inside"}}};if(r.length>0)for(a=0;a<r.length;a++)switch(r[a]){case"buttons":o.helpers.buttons={position:s.amsFancyboxButtonsPosition||"top"};break;case"thumbs":o.helpers.thumbs={width:s.amsFancyboxThumbsWidth||50,height:s.amsFancyboxThumbsHeight||50};break;case"media":o.helpers.media=!0}var c=e.extend({},o,s.amsFancyboxOptions);c=t.executeFunctionByName(s.amsFancyboxInitCallback,n,c)||c;var l=i.fancybox(c);t.executeFunctionByName(s.amsFancyboxAfterInitCallback,n,l,c)})})})},chart:function(a){var n=e(".chart",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.plot,t.baseURL+"flot/jquery.flot"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=(n.amsChartPlugins||"").split(/\s+/);if(s.length>0)for(var i in s)if(s.hasOwnProperty(i)){var r=s[i];(function(a){for(var t in e.plot.plugins)if(e.plot.plugins.hasOwnProperty(t)){var n=e.plot.plugins[t];if(n.name===a)return n}return null})(r)||t.getScript(t.baseURL+"flot/jquery.flot."+r+t.devext+".js")}var o=e.extend({},{},n.amsChartOptions);o=t.executeFunctionByName(n.amsChartInitCallback,a,o)||o;var c=n.amsChartData;c=t.executeFunctionByName(n.amsChartInitData,a,c)||c;var l=a.plot(c,o);t.executeFunctionByName(n.amsChartAfterInitCallback,a,l,o)})})},graphs:function(a){var n=e(".sparkline",a);n.length>0&&t.ajax&&t.ajax.check(t.graphs,t.baseURL+"myams-graphs"+t.devext+".js",function(){t.graphs.init(n)})},scrollbars:function(a){var n=e(".scrollbar",a);n.length>0&&t.ajax&&t.ajax.check(e.event.special.mousewheel,t.baseURL+"ext/jquery-mousewheel.min.js",function(){t.ajax.check(e.fn.mCustomScrollbar,t.baseURL+"ext/jquery-mCustomScrollbar"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar",function(){n.each(function(){var a=e(this),n=a.data(),s={theme:n.amsScrollbarTheme||"light"},i=e.extend({},s,n.amsScrollbarOptions);i=t.executeFunctionByName(n.amsScrollbarInitCallback,a,i)||i;var r=a.mCustomScrollbar(i);t.executeFunctionByName(n.amsScrollbarAfterInitCallback,a,r,i)})})})})}})}(jQuery,this);
+!function(e,a){var t=a.MyAMS;e.extend(t.plugins.enabled,{svg:function(a){var t=e(".svg-container",a);t.length>0&&t.each(function(){var a=e(this),t=e("svg",a),n=t.attr("width"),s=t.attr("height");n&&s&&t.get(0).setAttribute("viewBox","0 0 "+Math.round(parseFloat(n))+" "+Math.round(parseFloat(s))),t.attr("width","100%").attr("height","auto")})},hint:function(a){var n=e(".hint:not(:parents(.nohints))",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.tipsy,t.baseURL+"ext/jquery-tipsy"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-tipsy"+t.devext+".css","jquery-tipsy",function(){n.each(function(){var a=e(this),n=a.data(),s={html:void 0===n.amsHintHtml?(a.attr("title")||"").startsWith("<"):n.amsHintHtml,title:t.getFunctionByName(n.amsHintTitleGetter)||function(){var a=e(this),t=a.attr("original-title")||a.attr(n.amsHintTitleAttr||"title")||(n.amsHintHtml?a.html():a.text());return t=t.replace(/\?_="/,"?_="+(new Date).getTime()+'"')},opacity:n.amsHintOpacity||.95,gravity:n.amsHintGravity||"sw",offset:n.amsHintOffset||0},i=e.extend({},s,n.amsHintOptions);i=t.executeFunctionByName(n.amsHintInitCallback,a,i)||i;var r=a.tipsy(i);t.executeFunctionByName(n.amsHintAfterInitCallback,a,r,i)})})})},contextMenu:function(a){var n=e(".context-menu",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={menuSelector:n.amsContextmenuSelector,menuSelected:t.helpers&&t.helpers.contextMenuHandler},i=e.extend({},s,n.amsContextmenuOptions);i=t.executeFunctionByName(n.amsContextmenuInitCallback,a,i)||i;var r=a.contextMenu(i);t.executeFunctionByName(n.amsContextmenuAfterInitCallback,a,r,i)})},switcher:function(a){e("LEGEND.switcher",a).each(function(){var a=e(this),t=a.parent("fieldset"),n=a.data();n.amsSwitcher||(e('<i class="fa fa-fw"></i>').prependTo(e(this)).addClass("open"===n.amsSwitcherState?n.amsSwitcherMinusClass||"fa-minus":n.amsSwitcherPlusClass||"fa-plus"),a.on("click",function(s){s.preventDefault();var i={};if(a.trigger("ams.switcher.before-switch",[a,i]),!i.veto)if(t.hasClass("switched")){t.removeClass("switched"),e(".fa",a).removeClass(n.amsSwitcherPlusClass||"fa-plus").addClass(n.amsSwitcherMinusClass||"fa-minus"),a.trigger("ams.switcher.opened",[a]);var r=a.attr("id");r&&e('legend.switcher[data-ams-switcher-sync="'+r+'"]',t).each(function(){var a=e(this);a.parents("fieldset").hasClass("switched")&&a.click()})}else t.addClass("switched"),e(".fa",a).removeClass(n.amsSwitcherMinusClass||"fa-minus").addClass(n.amsSwitcherPlusClass||"fa-plus"),a.trigger("ams.switcher.closed",[a])}),"open"!==n.amsSwitcherState&&t.addClass("switched"),a.data("ams-switcher","on"))})},checker:function(a){e("LEGEND.checker",a).each(function(){var a=e(this),n=a.parent("fieldset"),s=a.data();if(!s.amsChecker){var i=e('<label class="checkbox"></label>'),r=s.amsCheckerFieldname||"checker_"+t.generateId(),o=r.replace(/\./,"_"),c=s.amsCheckerHiddenPrefix,l=null,m=s.amsCheckerHiddenValueOn||"true",d=s.amsCheckerHiddenValueOff||"false",u=s.amsCheckerMarker||!1;c?l=e('<input type="hidden">').attr("name",c+r).val("on"===s.amsCheckerState?m:d).prependTo(a):u&&e('<input type="hidden">').attr("name",u).attr("value",1).prependTo(a);var h=e('<input type="checkbox">').attr("name",r).attr("id",o).data("ams-checker-hidden-input",l).data("ams-checker-init",!0).val(s.amsCheckerValue||!0).attr("checked","on"===s.amsCheckerState?"checked":null);s.amsCheckerReadonly?h.attr("disabled","disabled"):h.on("change",function(i){i.preventDefault();var r={},o=e(this).is(":checked");if(a.trigger("ams.checker.before-switch",[a,r]),r.veto)e(this).prop("checked",!o);else if(t.executeFunctionByName(s.amsCheckerChangeHandler,a,o),!s.amsCheckerCancelDefault){var c=h.data("ams-checker-hidden-input");o?("disable"===s.amsCheckerMode?(n.removeAttr("disabled"),e(".select2",n).removeAttr("disabled")):n.removeClass("switched"),c&&c.val(m),e("[data-required]",n).attr("required","required"),a.trigger("ams.checker.opened",[a])):("disable"===s.amsCheckerMode?(n.prop("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),c&&c.val(d),e("[data-required]",n).removeAttr("required"),a.trigger("ams.checker.closed",[a]))}}),h.appendTo(i),e(">label",a).attr("for",h.attr("id")),i.append("<i></i>").prependTo(a);var b=e("[required]",n);b.attr("data-required",!0),"on"===s.amsCheckerState?h.attr("checked",!0):("disable"===s.amsCheckerMode?(n.attr("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),b.removeAttr("required")),a.data("ams-checker","on")}})},slider:function(a){var n=e(".slider",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.slider,t.baseURL+"ext/bootstrap-slider-2.0.0"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=e.extend({},{},a.data.amsSliderOptions);s=t.executeFunctionByName(n.amsSliderInitCallback,a,s)||s;var i=a.slider(s);t.executeFunctionByName(n.amsSliderAfterInitCallback,a,i,s)})})},draggable:function(a){var n=e(".draggable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={cursor:n.amsDraggableCursor||"move",containment:n.amsDraggableContainment,handle:n.amsDraggableHandle,connectToSortable:n.amsDraggableConnectSortable,helper:t.getFunctionByName(n.amsDraggableHelper)||n.amsDraggableHelper,start:t.getFunctionByName(n.amsDraggableStart),stop:t.getFunctionByName(n.amsDraggableStop)},i=e.extend({},s,n.amsDraggableOptions);i=t.executeFunctionByName(n.amsDraggableInitCallback,a,i)||i;var r=a.draggable(i);a.disableSelection(),t.executeFunctionByName(n.amsDraggableAfterInitCallback,a,r,i)})},droppable:function(a){var n=e(".droppable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={accept:n.amsdroppableAccept,drop:t.getFunctionByName(n.amsDroppableDrop)},i=e.extend({},s,n.amsDroppableOptions);i=t.executeFunctionByName(n.amsDroppableInitCallback,a,i)||i;var r=a.droppable(i);t.executeFunctionByName(n.amsDroppableAfterInitCallback,a,r,i)})},sortable:function(a){var n=e(".sortable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={items:n.amsSortableItems,handle:n.amsSortableHandle,helper:n.amsSortableHelper,connectWith:n.amsSortableConnectwith,start:t.getFunctionByName(n.amsSortableStart),over:t.getFunctionByName(n.amsSortableOver),containment:n.amsSortableContainment,placeholder:n.amsSortablePlaceholder,stop:t.getFunctionByName(n.amsSortableStop)},i=e.extend({},s,n.amsSortableOptions);i=t.executeFunctionByName(n.amsSortableInitCallback,a,i)||i;var r=a.sortable(i);a.disableSelection(),t.executeFunctionByName(n.amsSortableAfterInitCallback,a,r,i)})},resizable:function(a){var n=e(".resizable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={autoHide:!1===n.amsResizableAutohide||n.amsResizableAutohide,containment:n.amsResizableContainment,grid:n.amsResizableGrid,handles:n.amsResizableHandles,start:t.getFunctionByName(n.amsResizableStart),stop:t.getFunctionByName(n.amsResizableStop)},i=e.extend({},s,n.amsResizableOptions);i=t.executeFunctionByName(n.amsResizableInitCallback,a,i)||i;var r=a.resizable(i);a.disableSelection(),t.executeFunctionByName(n.amsResizableAfterInitCallback,a,r,i)})},typeahead:function(a){var n=e(".typeahead",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.typeahead,t.baseURL+"ext/jquery-typeahead"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=e.extend({},{},n.amsTypeaheadOptions);s=t.executeFunctionByName(n.amsTypeaheadInitCallback,a,s)||s;var i=a.typeahead(s);t.executeFunctionByName(n.amsTypeaheadAfterInitCallback,a,i,s)})})},treeview:function(a){var n=e(".treeview",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.treview,t.baseURL+"ext/bootstrap-treeview"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/bootstrap-treeview"+t.devext+".css","bootstrap-treeview",function(){n.each(function(){var a=e(this),n=a.data(),s={data:n.amsTreeviewData,levels:n.amsTreeviewLevels,injectStyle:n.amsTreeviewInjectStyle,expandIcon:n.amsTreeviewExpandIcon||"fa fa-fw fa-plus-square-o",collapseIcon:n.amsTreeviewCollaspeIcon||"fa fa-fw fa-minus-square-o",emptyIcon:n.amsTreeviewEmptyIcon||"fa fa-fw",nodeIcon:n.amsTreeviewNodeIcon,selectedIcon:n.amsTreeviewSelectedIcon,checkedIcon:n.amsTreeviewCheckedIcon||"fa fa-fw fa-check-square-o",uncheckedIcon:n.amsTreeviewUncheckedIcon||"fa fa-fw fa-square-o",color:n.amsTreeviewColor,backColor:n.amsTreeviewBackColor,borderColor:n.amsTreeviewBorderColor,onHoverColor:n.amsTreeviewHoverColor,selectedColor:n.amsTreeviewSelectedColor,selectedBackColor:n.amsTreeviewSelectedBackColor,unselectableColor:n.amsTreeviewUnselectableColor||"rgba(1,1,1,0.25)",unselectableBackColor:n.amsTreeviewUnselectableBackColor||"rgba(1,1,1,0.25)",enableLinks:n.amsTreeviewEnableLinks,highlightSelected:n.amsTreeviewHighlightSelected,highlightSearchResults:n.amsTreeviewhighlightSearchResults,showBorder:n.amsTreeviewShowBorder,showIcon:n.amsTreeviewShowIcon,showCheckbox:n.amsTreeviewShowCheckbox,showTags:n.amsTreeviewShowTags,toggleUnselectable:n.amsTreeviewToggleUnselectable,multiSelect:n.amsTreeviewMultiSelect,onNodeChecked:t.getFunctionByName(n.amsTreeviewNodeChecked),onNodeCollapsed:t.getFunctionByName(n.amsTreeviewNodeCollapsed),onNodeDisabled:t.getFunctionByName(n.amsTreeviewNodeDisabled),onNodeEnabled:t.getFunctionByName(n.amsTreeviewNodeEnabled),onNodeExpanded:t.getFunctionByName(n.amsTreeviewNodeExpanded),onNodeSelected:t.getFunctionByName(n.amsTreeviewNodeSelected),onNodeUnchecked:t.getFunctionByName(n.amsTreeviewNodeUnchecked),onNodeUnselected:t.getFunctionByName(n.amsTreeviewNodeUnselected),onSearchComplete:t.getFunctionByName(n.amsTreeviewSearchComplete),onSearchCleared:t.getFunctionByName(n.amsTreeviewSearchCleared)},i=e.extend({},s,n.amsTreeviewOptions);i=t.executeFunctionByName(n.amsTreeviewInitcallback,a,i)||i;var r=a.treeview(i);t.executeFunctionByName(n.amsTreeviewAfterInitCallback,a,r,i)})})})},select2:function(a){var n=e(".select2",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.select2,t.baseURL+"ext/jquery-select2-3.5.4"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();if(!n.select2){var s={placeholder:n.amsSelect2Placeholder,multiple:n.amsSelect2Multiple,minimumInputLength:n.amsSelect2MinimumInputLength||0,maximumSelectionSize:n.amsSelect2MaximumSelectionSize,openOnEnter:void 0===n.amsSelect2EnterOpen||n.amsSelect2EnterOpen,allowClear:void 0===n.amsSelect2AllowClear||n.amsSelect2AllowClear,width:n.amsSelect2Width||"100%",initSelection:t.getFunctionByName(n.amsSelect2InitSelection),formatSelection:void 0===n.amsSelect2FormatSelection?t.helpers&&t.helpers.select2FormatSelection:t.getFunctionByName(n.amsSelect2FormatSelection),formatResult:t.getFunctionByName(n.amsSelect2FormatResult),formatMatches:void 0===n.amsSelect2FormatMatches?function(e){return 1===e?t.i18n.SELECT2_MATCH:e+t.i18n.SELECT2_MATCHES}:t.getFunctionByName(n.amsSelect2FormatMatches),formatNoMatches:void 0===n.amsSelect2FormatResult?function(e){return t.i18n.SELECT2_NOMATCHES}:t.getFunctionByName(n.amsSelect2FormatResult),formatInputTooShort:void 0===n.amsSelect2FormatInputTooShort?function(e,a){var n=a-e.length;return t.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooShort),formatInputTooLong:void 0===n.amsSelect2FormatInputTooLong?function(e,a){var n=e.length-a;return t.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooLong),formatSelectionTooBig:void 0===n.amsSelect2FormatSelectionTooBig?function(e){return t.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,e).replace(/\{1\}/,1===e?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatSelectionTooBig),formatLoadMore:void 0===n.amsSelect2FormatLoadMore?function(e){return t.i18n.SELECT2_LOADMORE}:t.getFunctionByName(n.amsSelect2FormatLoadMore),formatSearching:void 0===n.amsSelect2FormatSearching?function(){return t.i18n.SELECT2_SEARCHING}:t.getFunctionByName(n.amsSelect2FormatSearching),separator:n.amsSelect2Separator||",",tokenSeparators:n.amsSelect2TokensSeparators||[","],tokenizer:t.getFunctionByName(n.amsSelect2Tokenizer)};switch(a.context.type){case"text":case"hidden":if(!s.initSelection){var i=a.data("ams-select2-values");i&&(s.initSelection=function(a,t){var n=[];e(a.val().split(s.separator)).each(function(){n.push({id:this,text:i[this]||this})}),t(n)})}}a.attr("readonly")?"hidden"===a.attr("type")&&(s.query=function(){return[]}):n.amsSelect2Query?(s.query=t.getFunctionByName(n.amsSelect2Query),s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryUrl?(s.ajax={url:n.amsSelect2QueryUrl,quietMillis:n.amsSelect2QuietMillis||200,type:n.amsSelect2QueryType||"POST",dataType:n.amsSelect2QueryDatatype||"json",data:function(a,t,s){var i={};return i[n.amsSelect2QueryParamName||"query"]=a,i[n.amsSelect2PageParamName||"page"]=t,i[n.amsSelect2ContextParamName||"context"]=s,e.extend({},i,n.amsSelect2QueryOptions)},results:t.helpers&&t.helpers.select2QueryUrlResultsCallback},s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryMethod?(s.query=function(s){var i={id:(new Date).getTime(),params:n.amsSelect2QueryParams||{},success:function(e){return t.helpers&&t.helpers.select2QueryMethodSuccessCallback.call(a,e,"success",s)},error:t.error&&t.error.show};i.params[n.amsSelect2QueryParamName||"query"]=s.term,i.params[n.amsSelect2PageParamName||"page"]=s.page,i.params[n.amsSelect2ContextParamName||"context"]=s.context,i=e.extend({},i,n.amsSelect2QueryOptions),i=t.executeFunctionByName(n.amsSelect2QueryInitCallback,a,i)||i,t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){e.jsonRPC.withOptions({endPoint:n.amsSelect2MethodTarget||t.jsonrpc&&t.jsonrpc.getAddr(),namespace:n.amsSelect2MethodNamespace,cache:!1},function(){e.jsonRPC.request(n.amsSelect2QueryMethod,i)})})},s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2Tags?s.tags=n.amsSelect2Tags:n.amsSelect2Data&&(s.data=n.amsSelect2Data),n.amsSelect2EnableFreeTags&&(s.createSearchChoice=function(e){return{id:e,text:(n.amsSelect2FreeTagsPrefix||t.i18n.SELECT2_FREETAG_PREFIX)+e}});var r=e.extend({},s,n.amsSelect2Options);r=t.executeFunctionByName(n.amsSelect2InitCallback,a,r)||r;var o=a.select2(r);t.executeFunctionByName(n.amsSelect2AfterInitCallback,a,o,r),a.hasClass("ordered")&&t.ajax&&t.ajax.check(e.fn.select2Sortable,t.baseURL+"ext/jquery-select2-sortable"+t.devext+".js",function(){a.select2Sortable({bindOrder:"sortableStop"})}),a.on("change",function(){void 0!==e(a.get(0).form).data("validator")&&e(a).valid()})}})})},maskedit:function(a){var n=e("[data-mask]",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.mask,t.baseURL+"ext/jquery-maskedinput-1.4.1"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s={placeholder:void 0===n.amsMaskeditPlaceholder?"X":n.amsMaskeditPlaceholder,complete:t.getFunctionByName(n.amsMaskeditComplete)},i=e.extend({},s,n.amsMaskeditOptions);i=t.executeFunctionByName(n.amsMaskeditInitCallback,a,i)||i;var r=a.mask(a.attr("data-mask"),i);t.executeFunctionByName(n.amsMaskeditAfterInitCallback,a,r,i)})})},inputmask:function(a){var n=e("input[data-input-mask]",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.inputmask,t.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+t.devext+".js",function(){n.each(function(){var a,n=e(this),s=n.data();a="object"==typeof s.inputMask?s.inputMask:{mask:s.inputMask.toString()};var i=e.extend({},a,s.amsInputmaskOptions);i=t.executeFunctionByName(s.amsInputmaskInitCallback,n,i)||i;var r=n.inputmask(i);t.executeFunctionByName(s.amsInputmaskAfterInitCallback,n,r,i)})})},datepicker:function(a){var n=e(".datepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y",datepicker:!0,dayOfWeekStart:1,timepicker:!1,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},datetimepicker:function(a){var n=e(".datetimepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y H:i",datepicker:!0,dayOfWeekStart:1,timepicker:!0,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},timepicker:function(a){var n=e(".timepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},colorpicker:function(a){var n=e(".colorpicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.minicolors,t.baseURL+"ext/jquery-minicolors"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-minicolors"+t.devext+".css","jquery-minicolors",function(){n.each(function(){var a=e(this),n=a.data(),s={position:n.amsColorpickerPosition||a.closest(".input").data("ams-colorpicker-position")||"bottom left"},i=e.extend({},s,n.amsColorpickerOptions);i=t.executeFunctionByName(n.amsColorpickerInitCallback,a,i)||i;var r=a.minicolors(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},dndupload:function(a){var n=e(".dndupload",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.dndupload,t.baseURL+"ext/jquery-dndupload"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-dndupload"+t.devext+".css","jquery-dndupload",function(){n.each(function(){var a=e(this),n=a.data(),s={action:n.amsDnduploadAction||a.attr("action")||"upload-files",fieldname:n.amsDnduploadFieldname||"files",autosubmit:n.amsDnduploadAutosubmit},i=e.extend({},s,n.amsDnduploadOptions);i=t.executeFunctionByName(n.amsDnduploadInitCallback,a,i)||i;var r=a.dndupload(i);t.executeFunctionByName(n.amsDnduploadAfterInitcallback,a,r,i)})})})},validate:function(a){var n=e("FORM:not([novalidate])",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.validate,t.baseURL+"ext/jquery-validate-1.17.0"+t.devext+".js",function(a){if(a&&(e.validator.setDefaults({highlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(e,a){var t=a.parents("label, .input").first();t.length?e.insertAfter(t):e.insertAfter(a)}}),t.plugins&&t.plugins.i18n)){for(var s in t.plugins.i18n.validate)if(t.plugins.i18n.validate.hasOwnProperty(s)){var i=t.plugins.i18n.validate[s];"string"==typeof i&&i.indexOf("{0}")>-1&&(t.plugins.i18n.validate[s]=e.validator.format(i))}e.extend(e.validator.messages,t.plugins.i18n.validate)}n.each(function(){var a=e(this),n=a.data(),s={ignore:null,submitHandler:void 0!==a.attr("data-async")?void 0===n.amsFormSubmitHandler?function(){return e(".state-error",a).removeClass("state-error"),t.ajax&&t.ajax.check(e.fn.ajaxSubmit,t.baseURL+"ext/jquery-form-3.49"+t.devext+".js"),t.form&&t.form.submit(a)}:t.getFunctionByName(n.amsFormSubmitHandler):void 0,invalidHandler:void 0===n.amsFormInvalidHandler?function(t,n){e(".state-error",a).removeClass("state-error");for(var s=0;s<n.errorList.length;s++){var i=n.errorList[s],r=e(i.element).parents(".tab-pane").index()+1;if(r>0){var o=e(".nav-tabs",e(i.element).parents(".tabforms"));e("li:nth-child("+r+")",o).removeClassPrefix("state-").addClass("state-error"),e("li.state-error:first a",o).click()}}}:t.getFunctionByName(n.amsFormInvalidHandler)};e("[data-ams-validate-rules]",a).each(function(a){0===a&&(s.rules={}),s.rules[e(this).attr("name")]=e(this).data("ams-validate-rules")}),e("[data-ams-validate-messages]",a).each(function(a){0===a&&(s.messages={}),s.messages[e(this).attr("name")]=e(this).data("ams-validate-messages")});var i=e.extend({},s,n.amsValidateOptions);i=t.executeFunctionByName(n.amsValidateInitCallback,a,i)||i;var r=a.validate(i);t.executeFunctionByName(n.amsValidateAfterInitCallback,a,r,i)})})},datatable:function(a){var n=e(".datatable",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.dataTable,t.baseURL+"ext/jquery-dataTables-1.9.4"+t.devext+".js",function(){t.ajax.check(e.fn.dataTableExt.oPagination.bootstrap_full,t.baseURL+"myams-dataTables"+t.devext+".js",function(){e(n).each(function(){var a,n=e(this),s=n.data(),i=(s.amsDatatableExtensions||"").split(/\s+/),r=s.amsDatatableSdom||"W"+(i.indexOf("colreorder")>=0||i.indexOf("colreorderwithresize")>=0?"R":"")+"<'dt-top-row'"+(i.indexOf("colvis")>=0?"C":"")+(!1===s.amsDatatablePagination||!1===s.amsDatatablePaginationSize?"":"L")+(!1===s.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(i.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===s.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",o=s.amsDatatableSorting;if("string"==typeof o){var c=o.split(";");for(o=[],a=0;a<c.length;a++){var l=c[a].split(",");l[0]=parseInt(l[0]),o.push(l)}}var m,d=[],u=e("th",n).listattr("data-ams-datatable-sortable");for(a=0;a<u.length;a++){var h=u[a];void 0!==h?((m=d[a]||{}).bSortable="string"==typeof h?JSON.parse(h):h,d[a]=m):d[a]=d[a]||{}}var b=e("th",n).listattr("data-ams-datatable-stype");for(a=0;a<b.length;a++){var p=b[a];p?((m=d[a]||{}).sType=p,d[a]=m):d[a]=d[a]||{}}var f={bJQueryUI:!1,bServerSide:s.amsDatatableServerSide||!1,sAjaxSource:!0===s.amsDatatableServerSide?s.amsDatatableAjaxSource:void 0,sServerMethod:!0===s.amsDatatableServerSide?"POST":void 0,bFilter:!1!==s.amsDatatableGlobalFilter||i.indexOf("columnfilter")>=0,bPaginate:!1!==s.amsDatatablePagination,bInfo:!1!==s.amsDatatableInfo,bSort:!1!==s.amsDatatableSort,aaSorting:o,aoColumns:d.length>0?d:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:s.amsDatatableDisplayLength||25,sPaginationType:s.amsDatatablePaginationType||"bootstrap_full",sDom:r,oLanguage:t.plugins&&t.plugins.i18n.datatables,fnInitComplete:function(a,n){e(".ColVis_Button").addClass("btn btn-default btn-sm").html((t.plugins&&t.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}},g=e.extend({},f,s.amsDatatableOptions),x=[],v=[],y=[];if(i.length>0)for(a=0;a<i.length;a++)switch(i[a]){case"autofill":x.push(e.fn.dataTable.AutoFill),v.push(t.baseURL+"ext/jquery-dataTables-autoFill"+t.devext+".js");break;case"columnfilter":x.push(e.fn.columnFilter),v.push(t.baseURL+"ext/jquery-dataTables-columnFilter"+t.devext+".js");break;case"colreorder":x.push(e.fn.dataTable.ColReorder),v.push(t.baseURL+"ext/jquery-dataTables-colReorder"+t.devext+".js");break;case"colreorderwithresize":x.push(window.ColReorder),v.push(t.baseURL+"ext/jquery-dataTables-colReorderWithResize"+t.devext+".js");break;case"colvis":x.push(e.fn.dataTable.ColVis),v.push(t.baseURL+"ext/jquery-dataTables-colVis"+t.devext+".js"),y.push(function(){g.oColVis=e.extend({},{activate:"click",sAlign:"right"},s.amsDatatableColvisOptions)});break;case"editable":x.push(e.fn.editable),v.push(t.baseURL+"ext/jquery-jeditable"+t.devext+".js"),x.push(e.fn.makeEditable),v.push(t.baseURL+"ext/jquery-dataTables-editable"+t.devext+".js");break;case"fixedcolumns":x.push(e.fn.dataTable.FixedColumns),v.push(t.baseURL+"ext/jquery-dataTables-fixedColumns"+t.devext+".js");break;case"fixedheader":x.push(e.fn.dataTable.Fixedheader),v.push(t.baseURL+"ext/jquery-dataTables-fixedHeader"+t.devext+".js");break;case"keytable":x.push(window.keyTable),v.push(t.baseURL+"ext/jquery-dataTables-keyTable"+t.devext+".js");break;case"rowgrouping":x.push(e.fn.rowGrouping),v.push(t.baseURL+"ext/jquery-dataTables-rowGrouping"+t.devext+".js");break;case"rowreordering":x.push(e.fn.rowReordering),v.push(t.baseURL+"ext/jquery-dataTables-rowReordering"+t.devext+".js");break;case"scroller":x.push(e.fn.dataTable.Scroller),v.push(t.baseURL+"ext/jquery-dataTables-scroller"+t.devext+".js")}y.push(function(){g=t.executeFunctionByName(s.amsDatatableInitCallback,n,g)||g;try{var r=n.dataTable(g);if(t.executeFunctionByName(s.amsDatatableAfterInitCallback,n,r,g),i.length>0)for(a=0;a<i.length;a++)switch(i[a]){case"autofill":var o=e.extend({},s.amsDatatableAutofillOptions,g.autofill);o=t.executeFunctionByName(s.amsDatatableAutofillInitCallback,n,o)||o,n.data("ams-autofill",void 0===s.amsDatatableAutofillConstructor?new e.fn.dataTable.AutoFill(n,o):t.executeFunctionByName(s.amsDatatableAutofillConstructor,n,r,o));break;case"columnfilter":var c=e.extend({},{sPlaceHolder:"head:after"},s.amsDatatableColumnfilterOptions,g.columnfilter);c=t.executeFunctionByName(s.amsDatatableColumnfilterInitCallback,n,c)||c,n.data("ams-columnfilter",void 0===s.amsDatatableColumnfilterConstructor?r.columnFilter(c):t.executeFunctionByName(s.amsDatatableColumnfilterConstructor,n,r,c));break;case"editable":var l=e.extend({},s.amsDatatableEditableOptions,g.editable);l=t.executeFunctionByName(s.amsDatatableEditableInitCallback,n,l)||l,n.data("ams-editable",void 0===s.amsDatatableEditableConstructor?n.makeEditable(l):t.executeFunctionByName(s.amsDatatableEditableConstructor,n,r,l));break;case"fixedcolumns":var m=e.extend({},s.amsDatatableFixedcolumnsOptions,g.fixedcolumns);m=t.executeFunctionByName(s.amsDatatableFixedcolumnsInitCallback,n,m)||m,n.data("ams-fixedcolumns",void 0===s.amsDatatableFixedcolumnsConstructor?new e.fn.dataTable.FixedColumns(n,m):t.executeFunctionByName(s.amsDatatableFixedcolumnsConstructor,n,r,m));break;case"fixedheader":var d=e.extend({},s.amsDatatableFixedheaderOptions,g.fixedheader);d=t.executeFunctionByName(s.amsDatatableFixedheadeInitCallback,n,d)||d,n.data("ams-fixedheader",void 0===s.amsDatatableFixedheaderConstructor?new e.fn.dataTable.FixedHeader(n,d):t.executeFunctionByName(s.amsDatatableFixedheaderConstructor,n,r,d));break;case"keytable":var u={table:n.get(0),datatable:r},h=e.extend({},u,s.amsDatatableKeytableOptions,g.keytable);h=t.executeFunctionByName(s.amsDatatableKeytableInitCallback,n,h)||h,n.data("ams-keytable",void 0===s.amsDatatableKeytableConstructor?new KeyTable(h):t.executeFunctionByName(s.amsDatatableKeytableConstructor,n,r,h));break;case"rowgrouping":var b=e.extend({},s.amsDatatableRowgroupingOptions,g.rowgrouping);b=t.executeFunctionByName(s.amsDatatableRowgroupingInitCallback,n,b)||b,n.data("ams-rowgrouping",void 0===s.amsDatatableRowgroupingConstructor?n.rowGrouping(b):t.executeFunctionByName(s.amsDatatableRowgroupingConstructor,n,r,b));break;case"rowreordering":var p=e.extend({},s.amsDatatableRowreorderingOptions,g.rowreordering);p=t.executeFunctionByName(s.amsDatatableRowreorderingInitCallback,n,p)||p,n.data("ams-rowreordering",void 0===s.amsDatatableRowreorderingConstructor?n.rowReordering(p):t.executeFunctionByName(s.amsDatatableRowreorderingConstructor,n,r,p))}if(s.amsDatatableFinalizeCallback){var f=s.amsDatatableFinalizeCallback.split(/\s+/);if(f.length>0)for(a=0;a<f.length;a++)t.executeFunctionByName(f[a],n,r,g)}}catch(e){}}),t.ajax&&t.ajax.check(x,v,y)})})})},tablednd:function(a){var n=e(".table-dnd",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.tableDnD,t.baseURL+"ext/jquery-tablednd"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();n.amsTabledndDragHandle?e("tr",a).addClass("no-drag-handle"):e(a).on("mouseover","tr",function(){e(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){e(this.cells[0]).removeClass("drag-handle")});var s={onDragClass:n.amsTabledndDragClass||"dragging-row",onDragStart:t.getFunctionByName(n.amsTabledndDragStart),dragHandle:n.amsTabledndDragHandle,scrollAmount:n.amsTabledndScrollAmount,onAllowDrop:n.amsTabledndAllowDrop,onDrop:t.getFunctionByName(n.amsTabledndDrop)||function(s,i){var r=n.amsTabledndDropTarget;if(r){e(i).data("ams-disabled-handlers","click");try{var o=[];e(s.rows).each(function(){var a=e(this).data("ams-element-name");a&&o.push(a)});var c=t.getFunctionByName(r);if("function"==typeof c)c.call(a,s,o);else{if(!r.startsWith(window.location.protocol)){var l=n.amsLocation;l&&(r=l+"/"+r)}t.ajax&&t.ajax.post(r,{names:JSON.stringify(o)},function(e,a){"success"!==e.status&&t.ajax.handleJSON(e)})}}finally{setTimeout(function(){e(i).removeData("ams-disabled-handlers")},50)}}return!1}},i=e.extend({},s,n.amsTabledndOptions);i=t.executeFunctionByName(n.amsTabledndInitCallback,a,i)||i;var r=a.tableDnD(i);t.executeFunctionByName(n.amsTabledndAfterInitCallback,a,r,i)})})},wizard:function(a){var n=e(".wizard",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.bootstrapWizard,t.baseURL+"ext/bootstrap-wizard-1.4.2"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s={withVisible:void 0===n.amsWizardWithVisible||n.amsWizardWithVisible,tabClass:n.amsWizardTabClass,firstSelector:n.amsWizardFirstSelector,previousSelector:n.amsWizardPreviousSelector,nextSelector:n.amsWizardNextSelector,lastSelector:n.amsWizardLastSelector,finishSelector:n.amsWizardFinishSelector,backSelector:n.amsWizardBackSelector,onInit:t.getFunctionByName(n.amsWizardInit),onShow:t.getFunctionByName(n.amsWizardShow),onNext:t.getFunctionByName(n.amsWizardNext),onPrevious:t.getFunctionByName(n.amsWizardPrevious),onFirst:t.getFunctionByName(n.amsWizardFirst),onLast:t.getFunctionByName(n.amsWizardLast),onBack:t.getFunctionByName(n.amsWizardBack),onFinish:t.getFunctionByName(n.amsWizardFinish),onTabChange:t.getFunctionByName(n.amsWizardTabChange),onTabClick:t.getFunctionByName(n.amsWizardTabClick),onTabShow:t.getFunctionByName(n.amsWizardTabShow)},i=e.extend({},s,n.amsWizardOptions);i=t.executeFunctionByName(n.amsWizardInitCallback,a,i)||i;var r=a.bootstrapWizard(i);t.executeFunctionByName(n.amsWizardAfterInitCallback,a,r,i)})})},tinymce:function(a){function n(){e(".tinymce",e(this)).each(function(){var a=tinymce.get(e(this).attr("id"));a&&a.remove()})}var s=e(".tinymce",a);if(s.length>0){var i=t.baseURL+"ext/tinymce"+(t.devmode?"/dev":"");t.ajax&&t.ajax.check(window.tinymce,i+"/tinymce"+t.devext+".js",function(a){function r(){s.each(function(){var a=e(this),n=a.data(),s={theme:n.amsTinymceTheme||"modern",language:t.lang,menubar:!1!==n.amsTinymceMenubar,statusbar:!1!==n.amsTinymceStatusbar,plugins:n.amsTinymcePlugins||["advlist autosave autolink lists link charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern autoresize"],toolbar:n.amsTinymceToolbar,toolbar1:!1!==n.amsTinymceToolbar1&&(n.amsTinymceToolbar1||"undo redo | pastetext | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"),toolbar2:!1!==n.amsTinymceToolbar2&&(n.amsTinymceToolbar2||"forecolor backcolor emoticons | charmap link image media | fullscreen preview print | code"),content_css:n.amsTinymceContentCss,formats:n.amsTinymceFormats,style_formats:n.amsTinymceStyleFormats,block_formats:n.amsTinymceBlockFormats,valid_classes:n.amsTinymceValidClasses,image_advtab:!0,image_list:t.getFunctionByName(n.amsTinymceImageList)||n.amsTinymceImageList,image_class_list:n.amsTinymceImageClassList,link_list:t.getFunctionByName(n.amsTinymceLinkList)||n.amsTinymceLinkList,link_class_list:n.amsTinymceLinkClassList,paste_as_text:void 0===n.amsTinymcePasteAsText||n.amsTinymcePasteAsText,paste_auto_cleanup_on_paste:void 0===n.amsTinymcePasteAutoCleanup||n.amsTinymcePasteAutoCleanup,paste_strip_class_attributes:n.amsTinymcePasteStripClassAttributes||"all",paste_remove_spans:void 0===n.amsTinymcePaseRemoveSpans||n.amsTinymcePasteRemoveSpans,paste_remove_styles:void 0===n.amsTinymcePasteRemoveStyles||n.amsTinymcePasteRemoveStyles,height:n.amsTinymceHeight||50,min_height:50,resize:!0,autoresize_min_height:50,autoresize_max_height:500};if(n.amsTinymceExternalPlugins){var i=n.amsTinymceExternalPlugins.split(/\s+/);for(var r in i)if(i.hasOwnProperty(r)){var o=a.data("ams-tinymce-plugin-"+i[r]);tinymce.PluginManager.load(i[r],t.getSource(o))}}var c=e.extend({},s,n.amsTinymceOptions);c=t.executeFunctionByName(n.amsTinymceInitCallback,a,c)||c;var l=a.tinymce(c);t.executeFunctionByName(n.amsTinymceAfterInitCallback,a,l,c)})}a?t.getScript(i+"/jquery.tinymce"+t.devext+".js",function(){tinymce.baseURL=i,tinymce.suffix=t.devext,t.skin&&t.skin.registerCleanCallback(n),r()}):r()})}},editor:function(n){var s=e(".text-editor textarea",n);s.length>0&&t.ajax&&t.ajax.check(a.ace,t.baseURL+"ext/ace/ace.js",function(n){var i=function(){a.ace_loaded=!0,s.each(function(){var a=e(this),n=a.parents(".text-editor"),s=n.data(),i=ace.require("ace/ext/modelist"),r=s.amsEditorMode||i.getModeForPath(s.amsEditorFilename||"editor.txt").mode,o=e("<div>",{position:"absolute",width:a.width(),height:a.height(),class:a.attr("class")}).insertBefore(a);a.css("display","none");var c=ace.edit(o[0]),l={mode:r,tabSize:4,useSoftTabs:!1,showGutter:!0,showLineNumbers:!0,printMargin:132,showInvisibles:!0},m=e.extend({},l,s.amsEditorOptions);m=t.executeFunctionByName(s.amsEditorInitCallback,a,m)||m,c.setOptions(m),c.session.setValue(a.val()),c.session.on("change",function(){a.val(c.session.getValue())}),n.data("editor",c),t.executeFunctionByName(s.amsEditorAfterInitCallback,a,c,m)})};n?(ace.config.set("basePath",t.baseURL+"ext/ace"),t.ajax.check(a.ace_loaded,[t.baseURL+"ext/ace/ext-modelist.js"],i)):i()})},imgareaselect:function(a){var n=e(".imgareaselect",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.imgAreaSelect,t.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-imgareaselect"+t.devext+".css","jquery-imgareaselect",function(){n.each(function(){var a=e(this),n=a.data(),s=n.amsImgareaselectParent?a.parents(n.amsImgareaselectParent):"body",i={instance:!0,handles:!0,parent:s,x1:n.amsImgareaselectX1||0,y1:n.amsImgareaselectY1||0,x2:n.amsImgareaselectX2||n.amsImgareaselectImageWidth,y2:n.amsImgareaselectY2||n.amsImgareaselectImageHeight,imageWidth:n.amsImgareaselectImageWidth,imageHeight:n.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:n.amsImgareaselectRatio,onSelectEnd:t.getFunctionByName(n.amsImgareaselectSelectEnd)||function(a,t){var i=n.amsImgareaselectTargetField||"image_";e('input[name="'+i+'x1"]',s).val(t.x1),e('input[name="'+i+'y1"]',s).val(t.y1),e('input[name="'+i+'x2"]',s).val(t.x2),e('input[name="'+i+'y2"]',s).val(t.y2)}},r=e.extend({},i,n.amsImgareaselectOptions);r=t.executeFunctionByName(n.amsImgareaselectInitCallback,a,r)||r;var o=a.imgAreaSelect(r);t.executeFunctionByName(n.amsImgareaselectAfterInitCallback,a,o,r),setTimeout(function(){o.update()},250)})})})},fancybox:function(a){var n=e(".fancybox",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.fancybox,t.baseURL+"ext/jquery-fancybox-2.1.5"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-fancybox-2.1.5"+t.devext+".css","jquery-fancybox",function(){n.each(function(){var a,n=e(this),s=n.data(),i=n;s.amsFancyboxElements&&(i=e(s.amsFancyboxElements,n));var r=(s.amsFancyboxHelpers||"").split(/\s+/);if(r.length>0)for(a=0;a<r.length;a++)switch(r[a]){case"buttons":t.ajax&&t.ajax.check(e.fancybox.helpers.buttons,t.baseURL+"ext/fancybox-helpers/fancybox-buttons"+t.devext+".js");break;case"thumbs":t.ajax&&t.ajax.check(e.fancybox.helpers.thumbs,t.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+t.devext+".js");break;case"media":t.ajax&&t.ajax.check(e.fancybox.helpers.media,t.baseURL+"ext/fancybox-helpers/fancybox-media"+t.devext+".js")}var o={type:s.amsFancyboxType,padding:s.amsFancyboxPadding||10,margin:s.amsFancyboxMargin||10,loop:s.amsFancyboxLoop,beforeLoad:t.getFunctionByName(s.amsFancyboxBeforeLoad)||function(){var a;if(s.amsFancyboxTitleGetter&&(a=t.executeFunctionByName(s.amsFancyboxTitleGetter,this)),!a){var n=e("*:first",this.element);(a=n.attr("original-title")||n.attr("title"))||(a=e(this.element).attr("original-title")||e(this.element).attr("title"))}this.title=a},afterLoad:t.getFunctionByName(s.amsFancyboxAfterLoad),helpers:{title:{type:"inside"}}};if(r.length>0)for(a=0;a<r.length;a++)switch(r[a]){case"buttons":o.helpers.buttons={position:s.amsFancyboxButtonsPosition||"top"};break;case"thumbs":o.helpers.thumbs={width:s.amsFancyboxThumbsWidth||50,height:s.amsFancyboxThumbsHeight||50};break;case"media":o.helpers.media=!0}var c=e.extend({},o,s.amsFancyboxOptions);c=t.executeFunctionByName(s.amsFancyboxInitCallback,n,c)||c;var l=i.fancybox(c);t.executeFunctionByName(s.amsFancyboxAfterInitCallback,n,l,c)})})})},chart:function(a){var n=e(".chart",a);n.length>0&&t.ajax&&t.ajax.check([window.Flot,e.color],[t.baseURL+"ext/flot/jquery.canvaswrapper"+t.devext+".js",t.baseURL+"ext/flot/jquery.colorhelpers"+t.devext+".js"],function(){t.ajax.check(e.fn.plot,t.baseURL+"ext/flot/jquery.flot"+t.devext+".js",function(){n.each(function(){function a(){var a=e.extend({},o,r.amsChartOptions);a=t.executeFunctionByName(r.amsChartInitCallback,i,a)||a;var s=r.amsChartData,c=r.amsChartDataLoader;c?e.getJSON(c,s).done(function(t){a=e.extend({},a,t.settings),n(t.data,a)}):n(r,a)}function n(e,a){e=t.executeFunctionByName(r.amsChartInitData,i,e)||e,s=i.plot(e,a),t.executeFunctionByName(r.amsChartAfterInitCallback,i,s,a)}var s,i=e(this),r=i.data(),o={},c=(r.amsChartPlugins||"").split(/\s+/),l=[];if(c.length>0)for(var m in c)if(c.hasOwnProperty(m)){var d=c[m];(function(a){for(var t in e.plot.plugins)if(e.plot.plugins.hasOwnProperty(t)){var n=e.plot.plugins[t];if(n.name===a)return n}return null})(d)||l.push(t.getScript(t.baseURL+"ext/flot/jquery.flot."+d+t.devext+".js"))}l.length>0?e.when.apply(e,l).then(function(){a()}):a()})})})},graphs:function(a){var n=e(".sparkline",a);n.length>0&&t.ajax&&t.ajax.check(t.graphs,t.baseURL+"myams-graphs"+t.devext+".js",function(){t.graphs.init(n)})},scrollbars:function(a){var n=e(".scrollbar",a);n.length>0&&t.ajax&&t.ajax.check(e.event.special.mousewheel,t.baseURL+"ext/jquery-mousewheel.min.js",function(){t.ajax.check(e.fn.mCustomScrollbar,t.baseURL+"ext/jquery-mCustomScrollbar"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar",function(){n.each(function(){var a=e(this),n=a.data(),s={theme:n.amsScrollbarTheme||"light"},i=e.extend({},s,n.amsScrollbarOptions);i=t.executeFunctionByName(n.amsScrollbarInitCallback,a,i)||i;var r=a.mCustomScrollbar(i);t.executeFunctionByName(n.amsScrollbarAfterInitCallback,a,r,i)})})})})}})}(jQuery,this);
--- a/src/pyams_skin/resources/js/myams.js	Wed Oct 16 13:00:43 2019 +0200
+++ b/src/pyams_skin/resources/js/myams.js	Wed Oct 16 13:01:12 2019 +0200
@@ -1947,16 +1947,16 @@
 
 											   var button,
 												   buttonData,
-												   buttonTarget;
-											   var data = form.data();
-											   var formOptions = data.amsFormOptions;
-											   var formData;
-											   var formDataCallback;
-
-											   var progressHandler;
-											   var progressInterval;
-											   var progressCallback;
-											   var progressEndCallback;
+												   buttonTarget,
+												   data = form.data(),
+												   formOptions = data.amsFormOptions,
+												   formData,
+												   formDataCallback;
+
+											   var progressHandler,
+												   progressInterval,
+												   progressCallback,
+												   progressEndCallback;
 
 											   // Inner progress status handler
 											   function _getProgress(handler, progress_id) {
@@ -2129,8 +2129,8 @@
 														   if (modal.exists()) {
 															   ams.dialog && ams.dialog.close(form);
 														   } else {
-															   var callback;
-															   var button = form.data('ams-submit-button');
+															   var callback,
+																   button = form.data('ams-submit-button');
 															   if (button) {
 																   callback = button.data('ams-form-submit-callback');
 															   }
@@ -2228,8 +2228,8 @@
 		 * @param message: the optional message
 		 */
 		initSubmit: function(target, message) {
-			var form = $(this);
-			var spin = '<i class="fa fa-3x fa-gear fa-spin"></i>';
+			var form = $(this),
+				spin = '<i class="fa fa-3x fa-gear fa-spin"></i>';
 			if (!message) {
 				message = form.data('ams-form-submit-message');
 			}
@@ -2275,8 +2275,8 @@
 		 * @param message: the optional submit message
 		 */
 		initSubmitFooter: function(message) {
-			var form = $(this);
-			var spin = '<i class="fa fa-3x fa-gear fa-spin"></i>';
+			var form = $(this),
+				spin = '<i class="fa fa-3x fa-gear fa-spin"></i>';
 			if (!message) {
 				message = $(this).data('ams-form-submit-message');
 			}
@@ -2295,8 +2295,8 @@
 		 * @param target: the form submit container target
 		 */
 		finalizeSubmitFooter: function(/*target*/) {
-			var form = $(this);
-			var footer = $('footer', form);
+			var form = $(this),
+				footer = $('footer', form);
 			if (footer) {
 				$('.row', footer).remove();
 				$('button', footer).show();
@@ -2331,8 +2331,8 @@
 				}
 			}
 
-			var data = form.data();
-			var dataType;
+			var data = form.data(),
+				dataType;
 			if (data.amsFormDatatype) {
 				dataType = data.amsFormDatatype;
 			} else {
@@ -2416,13 +2416,13 @@
 			if (!validators.length) {
 				return true;
 			}
-			var output = [];
-			var result = true;
+			var output = [],
+				result = true;
 			for (var index=0; index < validators.length; index++) {
-				var validator = validators[index];
-				var source = validator[0];
-				var handler = validator[1];
-				var validatorResult = ams.executeFunctionByName(handler, form, source);
+				var validator = validators[index],
+					source = validator[0],
+					handler = validator[1],
+					validatorResult = ams.executeFunctionByName(handler, form, source);
 				if (validatorResult === false) {
 					result = false;
 				} else if (typeof(validatorResult) === 'string') {
@@ -5061,45 +5061,75 @@
 		chart: function(element) {
 			var charts = $('.chart', element);
 			if (charts.length > 0) {
-				ams.ajax && ams.ajax.check($.fn.plot,
-										   ams.baseURL + 'flot/jquery.flot' + ams.devext + '.js',
-										   function() {
-											   charts.each(function() {
-
-												   function checkPlugin(plugin) {
-													   for (var index in $.plot.plugins) {
-														   if ($.plot.plugins.hasOwnProperty(index)) {
-															   var pluginInfo = $.plot.plugins[index];
-															   if (pluginInfo.name === plugin) {
-																   return pluginInfo;
-															   }
-														   }
-													   }
-													   return null;
-												   }
-
-												   var chart = $(this);
-												   var data = chart.data();
-												   var dataOptions = {};
-												   var plugins = (data.amsChartPlugins || '').split(/\s+/);
-												   if (plugins.length > 0) {
-													   for (var index in plugins) {
-														   if (plugins.hasOwnProperty(index)) {
-															   var pluginName = plugins[index];
-															   if (!checkPlugin(pluginName)) {
-																   ams.getScript(ams.baseURL + 'flot/jquery.flot.' + pluginName + ams.devext + '.js');
-															   }
-														   }
-													   }
-												   }
-												   var settings = $.extend({}, dataOptions, data.amsChartOptions);
-												   settings = ams.executeFunctionByName(data.amsChartInitCallback, chart, settings) || settings;
-												   var chartData = data.amsChartData;
-												   chartData = ams.executeFunctionByName(data.amsChartInitData, chart, chartData) || chartData;
-												   var plugin = chart.plot(chartData, settings);
-												   ams.executeFunctionByName(data.amsChartAfterInitCallback, chart, plugin, settings);
-											   });
-										   });
+				ams.ajax && ams.ajax.check([window.Flot, $.color],
+					[ams.baseURL + 'ext/flot/jquery.canvaswrapper' + ams.devext + '.js',
+					 ams.baseURL + 'ext/flot/jquery.colorhelpers' + ams.devext + '.js'],
+					function () {
+						ams.ajax.check($.fn.plot,
+							ams.baseURL + 'ext/flot/jquery.flot' + ams.devext + '.js',
+							function () {
+								charts.each(function () {
+
+									var chart = $(this),
+										data = chart.data(),
+										dataOptions = {},
+										plugin,
+										flotPlugins = (data.amsChartPlugins || '').split(/\s+/);
+
+									function checkPlugin(plugin) {
+										for (var index in $.plot.plugins) {
+											if ($.plot.plugins.hasOwnProperty(index)) {
+												var pluginInfo = $.plot.plugins[index];
+												if (pluginInfo.name === plugin) {
+													return pluginInfo;
+												}
+											}
+										}
+										return null;
+									}
+
+									function initChart() {
+										var settings = $.extend({}, dataOptions, data.amsChartOptions);
+										settings = ams.executeFunctionByName(data.amsChartInitCallback, chart, settings) || settings;
+										var chartData = data.amsChartData,
+											chartDataLoader = data.amsChartDataLoader;
+										if (chartDataLoader) {
+											$.getJSON(chartDataLoader, chartData).done(function (data) {
+												settings = $.extend({}, settings, data.settings);
+												createChart(data.data, settings);
+											});
+										} else {
+											createChart(data, settings);
+										}
+									}
+
+									function createChart(chartData, settings) {
+										chartData = ams.executeFunctionByName(data.amsChartInitData, chart, chartData) || chartData;
+										plugin = chart.plot(chartData, settings);
+										ams.executeFunctionByName(data.amsChartAfterInitCallback, chart, plugin, settings);
+									}
+
+									var deferred = [];
+									if (flotPlugins.length > 0) {
+										for (var index in flotPlugins) {
+											if (flotPlugins.hasOwnProperty(index)) {
+												var pluginName = flotPlugins[index];
+												if (!checkPlugin(pluginName)) {
+													deferred.push(ams.getScript(ams.baseURL + 'ext/flot/jquery.flot.' + pluginName + ams.devext + '.js'));
+												}
+											}
+										}
+									}
+									if (deferred.length > 0) {
+										$.when.apply($, deferred).then(function () {
+											initChart();
+										})
+									} else {
+										initChart();
+									}
+								});
+							});
+					});
 			}
 		},
 
--- a/src/pyams_skin/resources/js/myams.min.js	Wed Oct 16 13:00:43 2019 +0200
+++ b/src/pyams_skin/resources/js/myams.min.js	Wed Oct 16 13:01:12 2019 +0200
@@ -1,1 +1,1 @@
-"use strict";!function(e,a){var t=a.console;String.prototype.startsWith=function(e){var a=this.length,t=e.length;return!(a<t)&&this.substr(0,t)===e},String.prototype.endsWith=function(e){var a=this.length,t=e.length;return!(a<t)&&this.substr(a-t)===e},String.prototype.unserialize=function(e){for(var a=decodeURIComponent(this).split("&"),t={},n=0;n<a.length;n++){var s=a[n].split("=",2);t[s[0]]=s[1]}return t},Array.prototype.indexOf||(Array.prototype.indexOf=function(e,a){var t=this.length;for((a=(a=Number(a)||0)<0?Math.ceil(a):Math.floor(a))<0&&(a+=t);a<t;a++)if(a in this&&this[a]===e)return a;return-1}),e.expr[":"].hasvalue=function(a,t,n){return""!==e(a).val()},e.expr[":"].econtains=function(a,t,n){return(a.textContent||a.innerText||e(a).text()||"").toLowerCase()===n[3].toLowerCase()},e.expr[":"].withtext=function(a,t,n){return(a.textContent||a.innerText||e(a).text()||"")===n[3]},e.expr[":"].parents=function(a,t,n){return e(a).parents(n[3]).length>0},void 0===e.scrollbarWidth&&(e.scrollbarWidth=function(){var a=e('<div style="width: 50px; height: 50px; overflow: auto"><div/></div>').appendTo("body"),t=a.children(),n=t.innerWidth()-t.height(99).innerWidth();return a.remove(),n}),e.fn.extend({exists:function(){return e(this).length>0},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(a){var t=[];return this.each(function(){t.push(e(this).attr(a))}),t},style:function(e,a,t){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==e?void 0!==a?(t=void 0!==t?t:"",n.setProperty(e,a,t),this):n.getPropertyValue(e):n}},removeClassPrefix:function(a){return this.each(function(t,n){var s=n.className.split(" ").map(function(e){return e.startsWith(a)?"":e});n.className=e.trim(s.join(" "))}),this}}),void 0===a.MyAMS&&(a.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var n=a.MyAMS,s=n;n.baseURL=function(){var a=e('script[src*="/myams.js"], script[src*="/myams.min.js"], script[src*="/myams-core.js"], script[src*="/myams-core.min.js"], script[src*="/myams-require.js"], script[src*="/myams-require.min.js"]').attr("src");return s.devmode=a.indexOf(".min.js")<0,s.devext=s.devmode?"":".min",a.substring(0,a.lastIndexOf("/")+1)}(),n.log=function(){t&&t.debug&&t.debug(this,arguments)},n.getQueryVar=function(e,a){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var t=new RegExp(".*?[&\\?]"+a+"=(.*?)&.*"),n=e.replace(t,"$1");return n!==e&&n},n.rgb2hex=function(a){return"#"+e.map(a.match(/\b(\d+)\b/g),function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},n.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},n.generateUUID=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===a?t:3&t|8).toString(16)})},n.getObject=function(e,a){if(e){if("string"!=typeof e)return e;var t=e.split(".");a=void 0===a||null===a?window:a;for(var n=0;n<t.length;n++)try{a=a[t[n]]}catch(e){return}return a}},n.getFunctionByName=function(e,a){if(void 0!==e){if("function"==typeof e)return e;var t=e.split("."),n=t.pop();a=void 0===a||null===a?window:a;for(var s=0;s<t.length;s++)try{a=a[t[s]]}catch(e){return}try{return a[n]}catch(e){return}}},n.executeFunctionByName=function(e,a){var t=s.getFunctionByName(e,window);if("function"==typeof t){var n=Array.prototype.slice.call(arguments,2);return t.apply(a,n)}},n.isInDOM=function(t){return!!(t=e(t)).exists()&&a.document.body.contains(t[0])},n.getSource=function(e){return e.replace(/{[^{}]*}/g,function(e){return s.getFunctionByName(e.substr(1,e.length-2))})},n.getScript=function(a,t,n,i){"object"==typeof t&&(i=n,n=t,t=null),void 0===n&&(n={});var r={dataType:"script",url:s.getSource(a),success:t,error:i||s.error.show,cache:!s.devmode,async:void 0===n.async?"function"==typeof t:n.async},o=e.extend({},r,n);return e.ajax(o)},n.getCSS=function(a,t,n,i){n&&(n=s.getFunctionByName(n));var r=e("HEAD"),o=e('style[data-ams-id="'+t+'"]',r);if(0===o.length){if(o=e("<style>").attr("data-ams-id",t).text('@import "'+s.getSource(a)+'";'),n)var c=setInterval(function(){try{o[0].sheet.cssRules;n.call(window,!0,i),clearInterval(c)}catch(e){}},10);o.appendTo(r)}else n&&n.call(window,!1,i)},n.initHandlers=function(a){e(a).on("click","[data-ams-click-handler]",function(a){var t=e(this),n=t.data("ams-disabled-handlers");if(!0!==n&&"click"!==n&&"all"!==n){var i=t.data();if(i.amsClickHandler){!0!==i.amsStopPropagation&&!0!==i.amsClickStopPropagation||a.stopPropagation(),!0!==i.amsClickKeepDefault&&a.preventDefault();for(var r=i.amsClickHandler.split(/\s+/),o=0;o<r.length;o++){var c=s.getFunctionByName(r[o]);void 0!==c&&c.call(t,a,i.amsClickHandlerOptions)}}}}),e(a).on("change","[data-ams-change-handler]",function(a){var t=e(this);if(!t.prop("readonly")){var n=t.data("ams-disabled-handlers");if(!0!==n&&"change"!==n&&"all"!==n){var i=t.data();if(i.amsChangeHandler){!0!==i.amsStopPropagation&&!0!==i.amsChangeStopPropagation||a.stopPropagation(),!0!==i.amsChangeKeepDefault&&a.preventDefault();for(var r=i.amsChangeHandler.split(/\s+/),o=0;o<r.length;o++){var c=s.getFunctionByName(r[o]);void 0!==c&&c.call(t,a,i.amsChangeHandlerOptions)}}}}}),e(a).on("reset","form",function(a){var t=e(this);setTimeout(function(){e(".alert-danger, SPAN.state-error",t).not(".persistent").remove(),e("LABEL.state-error",t).removeClass("state-error"),e('INPUT.select2[type="hidden"]',t).each(function(){var a=e(this),t=a.data("select2"),n=a.data("ams-select2-input-value");n&&a.select2("val",n.split(t.opts.separator))}),t.find(".select2").trigger("change"),e("[data-ams-reset-callback]",t).each(function(){var a=e(this),n=a.data(),i=s.getFunctionByName(n.amsResetCallback);void 0!==i&&i.call(t,a,n.amsResetCallbackOptions)})},10),s.form&&s.form.setFocus(t)}),e(a).on("reset","[data-ams-reset-handler]",function(a){var t=e(this),n=t.data();if(n.amsResetHandler){!0!==n.amsResetKeepDefault&&a.preventDefault();var i=s.getFunctionByName(n.amsResetHandler);void 0!==i&&i.call(t,n.amsResetHandlerOptions)}}),e(a).on("click","[data-ams-click-event]",function(a){var t=e(this);e(a.target).trigger(t.data("ams-click-event"),t.data("ams-click-event-options"))}),e(a).on("click",'input[type="checkbox"][readonly]',function(){return!1})}}(jQuery,this),function(e,a){a.MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",LOADING:"Loading...",PROGRESS:"Processing",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",CLIPBOARD_COPY:"Copy to clipboard with Ctrl+C, and Enter",CLIPBOARD_CHARACTER_COPY_OK:"Character copied to clipboard",CLIPBOARD_TEXT_COPY_OK:"Text copied to clipboard",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"}}(jQuery,this),jQuery.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");for(var a="",t=0;t<e.length;t++){var n=e.charCodeAt(t);n<128?a+=String.fromCharCode(n):n>127&&n<2048?(a+=String.fromCharCode(n>>6|192),a+=String.fromCharCode(63&n|128)):(a+=String.fromCharCode(n>>12|224),a+=String.fromCharCode(n>>6&63|128),a+=String.fromCharCode(63&n|128))}return a},decode:function(e){for(var a="",t=0,n=0,s=0,i=0;t<e.length;)(n=e.charCodeAt(t))<128?(a+=String.fromCharCode(n),t++):n>191&&n<224?(s=e.charCodeAt(t+1),a+=String.fromCharCode((31&n)<<6|63&s),t+=2):(s=e.charCodeAt(t+1),i=e.charCodeAt(t+2),a+=String.fromCharCode((15&n)<<12|(63&s)<<6|63&i),t+=3);return a}},function(e,a){var t=a.MyAMS;e.fn.extend({contextMenu:function(a){function n(t,n,s){var i=e(window)[n](),r=e(a.menuSelector)[n](),o=t;return t+r>i&&r<t&&(o-=r),o}return this.each(function(){e("a",e(a.menuSelector)).each(function(){e(this).data("ams-context-menu",!0)}),e(this).on("contextmenu",function(s){if(!s.ctrlKey)return e(a.menuSelector).data("invokedOn",e(s.target)).show().css({position:"fixed",left:n(s.clientX,"width")-10,top:n(s.clientY,"height")-10}).off("click").on("click",function(n){e(this).hide();var s=e(this).data("invokedOn"),i=e(n.target);a.menuSelected.call(this,s,i),t.event&&t.event.stop(n)}),!1}),e(document).click(function(){e(a.menuSelector).hide()})})},myams_menu:function(a){var t=e.extend({},{accordion:!0,speed:200,closedSign:'<em class="fa fa-angle-down"></em>',openedSign:'<em class="fa fa-angle-up"></em>'},a),n=e(this);n.find("LI").each(function(){var a=e(this);if(a.find("UL").size()>0){a.find("A:first").append("<b class='collapse-sign'>"+t.closedSign+"</b>");var n=a.find("A:first");"#"===n.attr("href")&&n.click(function(){return!1})}}),n.find("LI.active").each(function(){var a=e(this).parents("UL"),n=a.parent("LI");a.slideDown(t.speed),n.find("b:first").html(t.openedSign),n.addClass("open")}),n.find("LI A").on("click",function(){var a=e(this);if(!a.hasClass("active")){var s=a.attr("href").replace(/^#/,""),i=a.parent().find("UL");if(t.accordion){var r=a.parent().parents("UL"),o=n.find("UL:visible");o.each(function(a){var n=!0;if(r.each(function(e){if(r[e]===o[a])return n=!1,!1}),n&&i!==o[a]){var c=e(o[a]);!s&&c.hasClass("active")||c.slideUp(t.speed,function(){e(this).parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}var c=a.parent().find("UL:first");s||!c.is(":visible")||c.hasClass("active")?c.slideDown(t.speed,function(){a.parent("LI").addClass("open").find("B:first").delay(t.speed).html(t.openedSign)}):c.slideUp(t.speed,function(){a.parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}})}(jQuery,this),function(e,a){a.MyAMS.event={stop:function(e){e||(e=window.event),e&&"string"!=typeof e&&(e.stopPropagation?(e.stopPropagation(),e.preventDefault()):(e.cancelBubble=!0,e.returnValue=!1))}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.browser={getInternetExplorerVersion:function(){var e=-1;if("Microsoft Internet Explorer"===navigator.appName){var a=navigator.userAgent;null!==new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(a)&&(e=parseFloat(RegExp.$1))}return e},checkVersion:function(){var e="You're not using Windows Internet Explorer.",t=this.getInternetExplorerVersion();t>-1&&(e=t>=8?"You're using a recent copy of Windows Internet Explorer.":"You should upgrade your copy of Windows Internet Explorer."),a.alert&&a.alert(e)},isIE8orlower:function(){var e="0",a=this.getInternetExplorerVersion();return a>-1&&(e=a>=9?0:1),e},copyToClipboard:function(n){function s(n){var s=!1;if(window.clipboardData&&window.clipboardData.setData)s=clipboardData.setData("Text",n);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var i=e("<textarea>");i.val(n),i.css("position","fixed"),i.appendTo(e("body")),i.get(0).select();try{document.execCommand("copy"),s=!0}catch(e){console&&console.warn&&console.warn("Copy to clipboard failed.",e)}finally{i.remove()}}s?t.skin&&t.skin.smallBox("success",{title:n.length>1?t.i18n.CLIPBOARD_TEXT_COPY_OK:t.i18n.CLIPBOARD_CHARACTER_COPY_OK,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}):a.prompt&&a.prompt(t.i18n.CLIPBOARD_COPY,n)}if(void 0===n)return function(){var a=e(this),t=a.text();a.parents(".btn-group").removeClass("open"),s(t)};s(n)}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.error={ajax:function(e,a,n,s){if(!("abort"===s||a&&a.statusText&&"OK"===a.statusText.toUpperCase()))if(a=t.ajax&&t.ajax.getResponse(a)){if("json"===a.contentType)t.ajax.handleJSON(a.data);else{var i=s||e.statusText||e.type,r=a.responseText;t.skin&&t.skin.messageBox("error",{title:t.i18n.ERROR_OCCURED,content:"<h4>"+i+"</h4><p>"+(r||"")+"</p>",icon:"fa fa-warning animated shake",timeout:1e4})}console&&(console.error&&console.error(e),console.debug&&console.debug(a))}else console.error&&console.error("Missing MyAMS AJAX module!")},show:function(e,a,n){if(n){var s=t.ajax&&t.ajax.getResponse(e);s?("json"===s.contentType?t.ajax.handleJSON(s.data):t.skin.messageBox("error",{title:t.i18n.ERRORS_OCCURED,content:"<h4>"+a+"</h4><p>"+n+"</p>",icon:"fa fa-warning animated shake",timeout:1e4}),console&&(console.error&&console.error(n),console.debug&&console.debug(e))):console.error&&console.error("Missing MyAMS AJAX module!")}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.ajax={check:function(a,n,s,i){function r(e,a){if(void 0!==s){s instanceof Array||(s=[s]);for(var n=0;n<s.length;n++){var i=t.getFunctionByName(s[n]);"function"==typeof i&&i(e,a)}}}s instanceof Array||"object"==typeof s&&(i=s,s=void 0);var o,c={async:"function"==typeof s},l=e.extend({},c,i),d=[];if(a instanceof Array){for(o=0;o<a.length;o++)void 0===a[o]&&d.push(t.getScript(n[o],{async:!0}));d.length>0?e.when.apply(e,d).then(function(){r(!0,i)}):r(!1,i)}else if(void 0===a)if(n instanceof Array){for(o=0;o<n.length;o++)d.push(t.getScript(n[o],{async:!0}));d.length>0?e.when.apply(e,d).then(function(){r(!0,i)}):r(!1,i)}else"string"==typeof n&&t.getScript(n,function(){r(!0,i)},l);else r(!1,i)},getAddr:function(a){var t=a||e("HTML HEAD BASE").attr("href")||window.location.href;return t.substr(0,t.lastIndexOf("/")+1)},start:function(){e("#ajax-gear").show()},stop:function(){e("#ajax-gear").hide()},progress:function(e){e.lengthComputable&&(e.loaded>=e.total||console&&console.log&&console.log(parseInt(e.loaded/e.total*100,10)+"%"))},getJSON:function(){return function(e){var a=e.url;delete e.url,t.ajax.post(a,e,function(e,a,n){t.ajax.handleJSON(e)})}},post:function(n,s,i,r){var o;o=n.startsWith(window.location.protocol)?n:this.getAddr()+n,"function"==typeof i?(r=i,i={}):i||(i={}),void 0===r&&(r=i.callback),"string"==typeof r&&(r=t.getFunctionByName(r)),delete i.callback;var c,l={url:o,type:"post",cache:!1,async:"function"==typeof r,data:e.param(s),dataType:"json",beforeSend:function(e,n){if(void 0!==a.Cookies){var s=Cookies.get(t.csrfCookieName);s&&e.setRequestHeader(t.csrfHeaderName,s)}},success:r||function(e){c=e.result}},d=e.extend({},l,i);return e.ajax(d),c},getResponse:function(e){var a,n,s=e.getResponseHeader("content-type");if(s)if(s.startsWith("application/javascript"))a="script",n=e.responseText;else if(s.startsWith("text/html"))a="html",n=e.responseText;else if(s.startsWith("text/xml"))a="xml",n=e.responseText;else if(n=e.responseJSON)a="json";else try{n=JSON.parse(e.responseText),a="json"}catch(t){n=e.responseText,a="text"}else a="json",n={status:"alert",alert:{title:t.i18n.ERROR_OCCURED,content:t.i18n.NO_SERVER_RESPONSE}};return{contentType:a,data:n}},handleJSON:function(n,s,i){var r,o=n.status;switch(o){case"alert":a.alert&&a.alert(n.alert.title+"\n\n"+n.alert.content);break;case"error":t.form&&t.form.showErrors(s,n);break;case"info":case"success":void 0!==s&&(t.form&&t.form.resetChanged(s),!1!==n.close_form&&t.dialog&&t.dialog.close(s));break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":void 0!==s&&(t.form&&t.form.resetChanged(s),!1!==n.close_form&&t.dialog&&t.dialog.close(s));break;case"modal":t.dialog&&t.dialog.open(n.location);break;case"reload":void 0!==s&&(t.form&&t.form.resetChanged(s),!1!==n.close_form&&t.dialog&&t.dialog.close(s)),(r=n.location||window.location.hash).startsWith("#")&&(r=r.substr(1));var c=e(n.target||i||"#content");t.skin&&t.skin.loadURL(r,c,{preLoadCallback:t.getFunctionByName(n.pre_reload)||function(){e("[data-ams-pre-reload]",c).each(function(){t.executeFunctionByName(e(this).data("ams-pre-reload"))})},preLoadCallbackOptions:n.pre_reload_options,afterLoadCallback:t.getFunctionByName(n.post_reload)||function(){e("[data-ams-post-reload]",c).each(function(){t.executeFunctionByName(e(this).data("ams-post-reload"))})},afterLoadCallbackOptions:n.post_reload_options});break;case"redirect":void 0!==s&&(t.form&&t.form.resetChanged(s),!0===n.close_form&&t.dialog&&t.dialog.close(s)),(r=n.location||window.location.href).endsWith("##")&&(r=r.replace(/##/,window.location.hash)),n.window?window.open(r,n.window,n.options):window.location.href===r?window.location.reload(!0):window.location.href=r;break;default:console&&console.log&&console.log("Unhandled status: "+o)}var l,d,m;if(n.content&&(d=n.content,m=e(d.target||i||s||"#content"),!0===d.raw?m.text(d.text):(m.html(d.html),t.initContent&&t.initContent(m)),d.keep_hidden||m.removeClass("hidden")),n.contents){var u=n.contents;for(l=0;l<u.length;l++)d=u[l],m=e(d.target),!0===d.raw?m.text(d.text):(m.html(d.html),t.initContent&&t.initContent(m)),d.keep_hidden||m.removeClass("hidden")}var f;if(n.message&&("string"==typeof(f=n.message)?"info"===o||"success"===o?t.skin&&t.skin.smallBox(o,{title:f,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}):t.skin&&t.skin.alert(e(s||"#content"),o,f):t.skin&&t.skin.alert(e(f.target||i||s||"#content"),f.status||"success",f.header,f.body,f.subtitle)),n.smallbox&&("string"==typeof(f=n.smallbox)?t.skin&&t.skin.smallBox(n.smallbox_status||o,{title:n.smallbox,icon:n.smallbox_icon||"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:n.smallbox_timeout||3e3}):t.skin&&t.skin.smallBox(f.status||o,{title:f.message,icon:f.icon||"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:f.timeout||3e3})),n.messagebox)if("string"==typeof(f=n.messagebox))t.skin&&t.skin.messageBox("info",{title:t.i18n.ERROR_OCCURED,content:f,timeout:1e4});else{var h=f.status||"info";"error"===h&&s&&i&&t.executeFunctionByName(s.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",s,i),t.skin&&t.skin.messageBox(h,{title:f.title||t.i18n.ERROR_OCCURED,content:f.content,icon:f.icon,number:f.number,timeout:null===f.timeout?void 0:f.timeout||1e4})}if(n.event&&s.trigger(n.event,n.event_options),n.events){var p;for(void 0===s&&(s=e(document)),l=0;l<n.events.length;l++)null!==(p=n.events[l])&&("string"==typeof p?s.trigger(p,n.events_options):s.trigger(p.event,p.options))}if(n.callback&&t.executeFunctionByName(n.callback,s,n.options),n.callbacks){var g;for(l=0;l<n.callbacks.length;l++)"function"==typeof(g=n.callbacks[l])?t.executeFunctionByName(g,s,g.options):t.executeFunctionByName(g.callback,s,g.options)}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.jsonrpc={getAddr:function(a){var t=(a||e("HTML HEAD BASE").attr("href")||window.location.href).replace(/\+\+skin\+\+\w+\//,"");return t.substr(0,t.lastIndexOf("/")+1)},query:function(a,n,s,i){t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){"function"==typeof s?(i=s,s={}):s||(s={}),"undefined"===i&&(i=s.callback),"string"==typeof i&&(i=t.getFunctionByName(i)),delete s.callback;var r={};"string"==typeof a?r.query=a:"object"==typeof a&&e.extend(r,a),e.extend(r,s);var o,c={id:(new Date).getTime(),params:r,success:i||function(e){o=e},error:t.error&&t.error.show},l=e.extend({},c,s);return e.jsonRPC.withOptions({endPoint:t.jsonrpc.getAddr(s.url),namespace:s.namespace,cache:!1},function(){e.jsonRPC.request(n,l)}),o})},post:function(a,n,s,i){t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){"function"==typeof s?(i=s,s={}):s||(s={}),void 0===i&&(i=s.callback),"string"==typeof i&&(i=t.getFunctionByName(i)),delete s.callback;var r,o={id:(new Date).getTime(),params:n,success:i||function(e){r=e},error:t.error&&t.error.show},c=e.extend({},o,s);return e.jsonRPC.withOptions({endPoint:t.jsonrpc.getAddr(s.url),namespace:s.namespace,cache:!1},function(){e.jsonRPC.request(a,c)}),r})}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.xmlrpc={getAddr:function(a){var t=(a||e("HTML HEAD BASE").attr("href")||window.location.href).replace(/\+\+skin\+\+\w+\//,"");return t.substr(0,t.lastIndexOf("/")+1)},post:function(a,n,s,i,r){t.ajax&&t.ajax.check(e.xmlrpc,t.baseURL+"ext/jquery-xmlrpc"+t.devext+".js",function(){"function"==typeof i?(r=i,i={}):i||(i={}),void 0===r&&(r=i.callback),"string"==typeof r&&(r=t.getFunctionByName(r)),delete i.callback;var o,c={url:t.xmlrpc.getAddr(a),methodName:n,params:s,success:r||function(e){o=e},error:t.error&&t.error.show},l=e.extend({},c,i);return e.xmlrpc(l),o})}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.form={init:function(a){e("FORM",a).each(function(){var a=e(this);e('INPUT.select2[type="hidden"]',a).each(function(){var a=e(this);a.data("ams-select2-input-value",a.val())})});(t.warnOnFormChange?e('FORM[data-ams-warn-on-change!="false"]',a):e('FORM[data-ams-warn-on-change="true"]',a)).each(function(){var a=e(this);e('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',a).each(function(){var a=e(this);if(!0!==a.data("ams-ignore-change")){var n=a.data("ams-changed-event")||"change";a.on(n,function(){t.form.setChanged(e(this).parents("FORM"))})}}),a.on("reset",function(){t.form.resetChanged(e(this))})})},setFocus:function(a){var t=e("[data-ams-focus-target]",a).first();t.exists()||(t=e("input, select",a).first()),t.exists()&&(t.hasClass("select2-input")&&(t=t.parents(".select2")),t.hasClass("select2")?setTimeout(function(){t.select2("focus"),!0===t.data("ams-focus-open")&&t.select2("open")},100):t.focus())},checkBeforeUnload:function(){if(e('FORM[data-ams-form-changed="true"]').exists())return t.i18n.FORM_CHANGED_WARNING},confirmChangedForm:function(n,s,i){"function"==typeof n&&(s=n,n=void 0),e('FORM[data-ams-form-changed="true"]',n).exists()?i?a.confirm(t.i18n.FORM_CHANGED_WARNING,t.i18n.WARNING)?s.call(n):i.call(n):t.skin&&t.skin.bigBox({title:t.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i>&nbsp; '+t.i18n.FORM_CHANGED_WARNING,buttons:t.i18n.BTN_OK_CANCEL},function(e){e===t.i18n.BTN_OK&&s.call(n)}):s.call(n)},setChanged:function(e){e.attr("data-ams-form-changed",!0)},resetChanged:function(a){void 0!==a&&e(a).removeAttr("data-ams-form-changed")},submit:function(n,s,i){if(!(n=e(n)).exists())return!1;if("object"==typeof s&&(i=s,s=void 0),n.data("submitted"))return n.data("ams-form-hide-submitted")||t.skin&&t.skin.messageBox("warning",{title:t.i18n.WAIT,content:t.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:n.data("ams-form-alert-timeout")||5e3}),!1;if(t.form&&!t.form._checkSubmitValidators(n))return!1;e(".alert-danger, SPAN.state-error",n).not(".persistent").remove(),e(".state-error",n).removeClassPrefix("state-");var r=e(n.data("ams-submit-button"));return r&&!r.data("ams-form-hide-loading")&&(r.data("ams-progress-content",r.html()),r.button("loading")),t.ajax&&t.ajax.check(e.fn.ajaxSubmit,t.baseURL+"ext/jquery-form-3.49"+t.devext+".js",function(){function r(n,r){var o,c,l,d,m,u,f,h,p,g=n.data(),b=g.amsFormOptions;if(i&&(m=i.formDataInitCallback),m?delete i.formDataInitCallback:m=g.amsFormDataInitCallback,m){var v={};if(d=t.executeFunctionByName(m,n,v),v.veto)return(o=n.data("ams-submit-button"))&&o.button("reset"),t.form.finalizeSubmitFooter.call(n),!1}else d=g.amsFormData||{};(o=e(n.data("ams-submit-button")))&&o.exists()?l=(c=o.data()).amsFormSubmitTarget:c={};var x,y=s||c.amsFormHandler||g.amsFormHandler||"";if(y.startsWith(window.location.protocol))x=y;else{var k=c.amsFormAction||n.attr("action").replace(/#/,"");x=k.startsWith(window.location.protocol)?k:t.ajax&&t.ajax.getAddr()+k,x+=y}u=c.amsProgressHandler||g.amsProgressHandler||"",f=c.amsProgressInterval||g.amsProgressInterval||1e3,h=c.amsProgressCallback||g.amsProgressCallback,p=c.amsProgressEndCallback||g.amsProgressEndCallback;var C=null;i&&i.initSubmitTarget?t.executeFunctionByName(i.initSubmitTarget,n):g.amsFormInitSubmitTarget?(C=e(l||g.amsFormSubmitTarget||"#content"),t.executeFunctionByName(g.amsFormInitSubmit||"MyAMS.form.initSubmit",n,C)):g.amsFormHideSubmitFooter||t.executeFunctionByName(g.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",n),i&&(d=e.extend({},d,i.form_data));var S;u?d.progress_id=t.generateUUID():(S=void 0!==r.uuid)&&(x.indexOf("X-Progress-ID")<0&&(x+="?X-Progress-ID="+r.uuid),delete r.uuid);var w={url:x,type:"post",cache:!1,data:d,dataType:g.amsFormDatatype,beforeSerialize:function(){void 0!==a.tinyMCE&&a.tinyMCE.triggerSave()},beforeSubmit:function(e,a){a.data("submitted",!0)},error:function(e,a,n,s){C&&t.executeFunctionByName(g.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",s,C),t.form.resetAfterSubmit(s)},iframe:S},j=i&&i.downloadTarget||g.amsFormDownloadTarget;if(j){var T=e('iframe[name="'+j+'"]');T.exists()||(T=e("<iframe></iframe>").hide().attr("name",j).appendTo(e("body"))),w=e.extend({},w,{iframe:!0,iframeTarget:T,success:function(a,n,s,i){if(e(i).parents(".modal-dialog").exists())t.dialog&&t.dialog.close(i);else{var r,o=i.data("ams-submit-button");o&&(r=o.data("ams-form-submit-callback")),r||(r=t.getFunctionByName(g.amsFormSubmitCallback)||t.form._submitCallback);try{r.call(i,a,n,s,i)}finally{t.form.resetAfterSubmit(i),t.form.resetChanged(i)}}}})}else w=e.extend({},w,{error:function(e,a,n,s){C&&t.executeFunctionByName(g.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",s,C),t.form.resetAfterSubmit(s)},success:function(e,a,n,s){var i,r=s.data("ams-submit-button");r&&(i=r.data("ams-form-submit-callback")),i||(i=t.getFunctionByName(g.amsFormSubmitCallback)||t.form._submitCallback);try{i.call(s,e,a,n,s)}finally{t.form.resetAfterSubmit(s),t.form.resetChanged(s)}},iframe:S});var N=e.extend({},w,r,b,i);if(u&&function(e,a){function s(){clearTimeout(r),t.form.resetAfterSubmit(n,o),o.html(o.data("ams-progress-content")),t.executeFunctionByName(p,n,o),t.form.resetChanged(n)}function i(){t.ajax&&t.ajax.post(e,{progress_id:a},{error:s},t.getFunctionByName(h)||function(e,a){if("success"===a)if("running"===e.status){if(e.message)o.text(e.message);else{var n=o.data("ams-progress-text")||t.i18n.PROGRESS;e.current?n+=": "+e.current+"/ "+(e.length||100):n+="...",o.text(n)}r=setTimeout(i,f)}else"finished"===e.status&&s();else s()})}var r;o.button("loading"),r=setTimeout(i,f)}(u,d.progress_id),e(n).ajaxSubmit(N),j){var F=e(n).parents(".modal-dialog"),R=F.exists()&&o.exists()&&o.data("ams-keep-modal");F.exists()&&!0!==R?t.dialog&&t.dialog.close(n):u||setTimeout(function(){t.form.resetAfterSubmit(n,o),t.form.resetChanged(n)},o.data("ams-form-reset-timeout")||2e3)}}if(!0!==n.data("ams-form-ignore-uploads")&&e('INPUT[type="file"]',n).length>0){t.ajax&&t.ajax.check(e.progressBar,t.baseURL+"ext/jquery-progressbar"+t.devext+".js");var o=e.extend({},{uuid:e.progressBar.submit(n)});r(n,o)}else r(n,{})}),!1},initSubmit:function(a,t){var n=e(this),s='<i class="fa fa-3x fa-gear fa-spin"></i>';t||(t=n.data("ams-form-submit-message")),t&&(s+="<strong>"+t+"</strong>"),e(a).html('<div class="row margin-20"><div class="text-center">'+s+"</div></div>"),e(a).parents(".hidden").removeClass("hidden")},resetAfterSubmit:function(e){if(e.is(":visible")){var a=e.data("ams-submit-button");a&&a.button("reset"),t.form.finalizeSubmitFooter.call(e)}e.data("submitted",!1),e.removeData("ams-submit-button")},finalizeSubmitOnError:function(a){e("i",a).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(a){var t=e(this),n='<i class="fa fa-3x fa-gear fa-spin"></i>';a||(a=e(this).data("ams-form-submit-message")),a&&(n+='<strong class="submit-message align-top padding-left-10 margin-top-10">'+a+"</strong>");var s=e("footer",t);e("button",s).hide(),s.append('<div class="row"><div class="text-center">'+n+"</div></div>")},finalizeSubmitFooter:function(){var a=e(this),t=e("footer",a);t&&(e(".row",t).remove(),e("button",t).show())},_submitCallback:function(a,n,s,i){var r;i.is(":visible")&&(t.form.finalizeSubmitFooter.call(i),(r=i.data("ams-submit-button"))&&r.button("reset"));var o,c=i.data();if(c.amsFormDatatype)o=c.amsFormDatatype;else{var l=t.ajax&&t.ajax.getResponse(s);l&&(o=l.contentType,a=l.data)}var d;switch(d=e(r?r.data("ams-form-submit-target")||c.amsFormSubmitTarget||"#content":c.amsFormSubmitTarget||"#content"),o){case"json":t.ajax&&t.ajax.handleJSON(a,i,d);break;case"script":case"xml":break;case"html":case"text":default:t.form.resetChanged(i),r&&!0!==r.data("ams-keep-modal")&&t.dialog&&t.dialog.close(i),d.exists()||(d=e("body")),d.parents(".hidden").removeClass("hidden"),e(".alert",d.parents(".alerts-container")).remove(),d.css({opacity:"0.0"}).html(a).delay(50).animate({opacity:"1.0"},300),t.initContent&&t.initContent(d),t.form.setFocus(d)}var m=s.getResponseHeader("X-AMS-Callback");if(m){var u=s.getResponseHeader("X-AMS-Callback-Options");t.executeFunctionByName(m,i,void 0===u?{}:JSON.parse(u),s)}},_getSubmitValidators:function(a){var t=[],n=a.data("ams-form-validator");return n&&t.push([a,n]),e("[data-ams-form-validator]",a).each(function(){var a=e(this);t.push([a,a.data("ams-form-validator")])}),t},_checkSubmitValidators:function(e){var a=t.form._getSubmitValidators(e);if(!a.length)return!0;for(var n=[],s=!0,i=0;i<a.length;i++){var r=a[i],o=r[0],c=r[1],l=t.executeFunctionByName(c,e,o);!1===l?s=!1:"string"==typeof l?n.push(l):s.length&&s.length>0&&(n=n.concat(s))}if(n.length>0){var d=1===n.length?t.i18n.ERROR_OCCURED:t.i18n.ERRORS_OCCURED;return t.skin&&t.skin.alert(e,"danger",d,n),!1}return s},showErrors:function(a,n){var s;if("string"==typeof n)t.skin&&t.skin.alert(a,"error",t.i18n.ERROR_OCCURED,n);else if(n instanceof Array)s=1===n.length?t.i18n.ERROR_OCCURED:t.i18n.ERRORS_OCCURED,t.skin&&t.skin.alert(a,"error",s,n);else{e(".state-error",a).removeClass("state-error"),s=n.error_header||(n.widgets&&n.widgets.length>1?t.i18n.ERRORS_OCCURED:t.i18n.ERROR_OCCURED);var i,r=[];if(n.messages)for(i=0;i<n.messages.length;i++){var o=n.messages[i];o.header?r.push("<strong>"+o.header+"</strong><br />"+o.message):r.push(o.message||o)}if(n.widgets)for(i=0;i<n.widgets.length;i++){var c=n.widgets[i],l=e('[name="'+c.name+'"]',a);l.exists()||(l=e('[name="'+c.name+':list"]',a)),l.exists()?l.parents("label, .input").first().removeClassPrefix("state-").addClass("state-error").after('<span for="name" class="state-error">'+c.message+"</span>"):c.label&&r.push(c.label+" : "+c.message);var d=l.parents(".tab-pane").index()+1;if(d>0){var m=e(".nav-tabs",e(l).parents(".tabforms"));e("li:nth-child("+d+")",m).removeClassPrefix("state-").addClass("state-error"),e("li.state-error:first a",a).click()}}t.skin&&t.skin.alert(e(".form-group:first",a),n.error_level||"error",s,r,n.error_message)}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.dialog={_shown_callbacks:[],registerShownCallback:function(e,a){var n;a&&(n=a.objectOrParentWithClass("modal-dialog"));var s;n&&n.exists()?void 0===(s=n.data("shown-callbacks"))&&(s=[],n.data("shown-callbacks",s)):s=t.dialog._shown_callbacks,s.indexOf(e)<0&&s.push(e)},_hide_callbacks:[],registerHideCallback:function(e,a){var n;a&&(n=a.objectOrParentWithClass("modal-dialog"));var s;n&&n.exists()?void 0===(s=n.data("hide-callbacks"))&&(s=[],n.data("hide-callbacks",s)):s=t.dialog._hide_callbacks,s.indexOf(e)<0&&s.push(e)},open:function(a,n,s){t.ajax&&t.ajax.check(e.fn.modalmanager,t.baseURL+"ext/bootstrap-modalmanager"+t.devext+".js",function(){t.ajax.check(e.fn.modal.defaults,t.baseURL+"ext/bootstrap-modal"+t.devext+".js",function(i){i&&(e(document).off("click.modal"),e.fn.modal.defaults.spinner=e.fn.modalmanager.defaults.spinner='<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="progress-bar" style="width: 100%;"></div></div></div>');var r,o;if("string"==typeof a)r={},o=a;else{r=a.data(),o=a.attr("href")||r.amsUrl;var c=t.getFunctionByName(o);"function"==typeof c&&(o=c.call(a))}o&&(e("body").modalmanager("loading"),0===o.indexOf("#")?e(o).modal("show"):e.ajax({url:o,type:"get",cache:void 0!==r.amsAllowCache&&r.amsAllowCache,data:n,success:function(n,i,c){e("body").modalmanager("removeLoading");var l=t.ajax.getResponse(c),d=l.contentType,m=l.data;switch(d){case"json":t.ajax.handleJSON(m,e(e(a).data("ams-json-target")||"#content"));break;case"script":case"xml":break;case"html":case"text":default:var u=e(m),f=e(".modal-dialog",u.wrap("<div></div>").parent()),h=f.data()||{},p={backdrop:"static",overflow:h.amsModalOverflow||".modal-viewport",maxHeight:void 0===h.amsModalMaxHeight?function(){var a=e(window).height(),t=parseInt(f.css("margin-top")),n=Math.round(a/10);return a-e(".modal-header",u).outerHeight(!0)-e("footer",u).outerHeight(!0)-t-n}:t.getFunctionByName(h.amsModalMaxHeight)},g=e.extend({},p,h.amsModalOptions);g=t.executeFunctionByName(h.amsModalInitCallback,f,g)||g,s&&(s.shown&&t.dialog.registerShownCallback(s.shown,u),s.hide&&t.dialog.registerHideCallback(s.hide,u)),e("<div>").addClass("modal fade").append(u).modal(g).on("shown",t.dialog.shown).on("hidden",t.dialog.hidden),t.initContent&&t.initContent(u),!1!==r.amsLogEvent&&t.stats&&t.stats.logPageview(o)}}}))})})},shown:function(a){function n(a){var t=e(".scrollmarker.top",i),n=i.scrollTop();n>0?t.show():t.hide();var s=e(".scrollmarker.bottom",i);r+n>=i.get(0).scrollHeight?s.hide():s.show()}var s=a.target,i=e(".modal-viewport",s);if(i.exists()){var r=parseInt(i.css("max-height")),o=e.scrollbarWidth();"hidden"!==i.css("overflow")&&i.height()===r?(e("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",i.width()-o).hide().appendTo(i),e("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",r-20).css("width",i.width()-o).appendTo(i),i.scroll(n),i.off("resize").on("resize",n)):e(".scrollmarker",i).remove()}e("[data-ams-shown-callback]",s).each(function(){var a=t.getFunctionByName(e(this).data("ams-shown-callback"));a&&a.call(s,this)});var c,l=e(".modal-dialog",s).data("shown-callbacks");if(l)for(c=0;c<l.length;c++)l[c].call(s);if(l=t.dialog._shown_callbacks)for(c=0;c<l.length;c++)l[c].call(s);t.form&&t.form.setFocus(s)},close:function(a){"string"==typeof a&&(a=e(a));var t=a.parents(".modal").data("modal");if(t){var n=e("body").data("modalmanager");n&&n.getOpenModals().indexOf(t)>=0&&t.hide()}},hidden:function(a){var n=a.target;t.skin&&t.skin.cleanContainer(n),e("[data-ams-hidden-callback]",n).each(function(){var a=t.getFunctionByName(e(this).data("ams-hidden-callback"));a&&a.call(n,this)});var s,i=e(".modal-dialog",n).data("hide-callbacks");if(i)for(s=0;s<i.length;s++)i[s].call(n);if(i=t.dialog._hide_callbacks)for(s=0;s<i.length;s++)i[s].call(n)}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.helpers={sort:function(a,t){t||(t="weight"),a.children().sort(function(a,n){return+e(a).data(t)-+e(n).data(t)}).each(function(){a.append(this)})},select2ClearSelection:function(){var a=e(this),t=a.parents("label").first(),n=a.data("ams-select2-target");e('[name="'+n+'"]',t).data("select2").val("")},select2FormatSelection:function(a,t){a instanceof Array||(a=[a]),e(a).each(function(){"object"==typeof this?t.append(this.text):t.append(this)})},select2SelectAllHelper:function(){var a=e(this),t=a.parents("label").first(),n=a.data("ams-select2-target"),s=e('[name="'+n+'"]',t);"SELECT"===s.get(0).tagName?s.select2("val",e("option",s).listattr("value")):s.select2("data",s.data("ams-select2-data"))},select2QueryUrlResultsCallback:function(a,n,s){switch(a.status){case"error":t.skin&&t.skin.messageBox("error",{title:t.i18n.ERROR_OCCURED,content:"<h4>"+a.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":e(this).data("select2").dropdown.hide(),t.dialog&&t.dialog.open(a.location);break;default:return{results:a.results||a,more:a.has_more||!1,context:a.context}}},select2QueryMethodSuccessCallback:function(a,n,s){var i=a.result;if("string"==typeof i)try{i=JSON.parse(i)}catch(e){}switch(i.status){case"error":t.skin&&t.skin.messageBox("error",{title:t.i18n.ERROR_OCCURED,content:"<h4>"+i.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":e(this).data("select2").dropdown.hide(),t.dialog&&t.dialog.open(i.location);break;default:s.callback({results:i.results||i,more:i.has_more||!1,context:i.context})}},select2ChangeHelper:function(){var a=e(this),n=a.data(),s=e(n.amsSelect2HelperTarget);switch(n.amsSelect2HelperType){case"html":s.html('<div class="text-center"><i class="fa fa-2x fa-gear fa-spin"></i></div>');var i={};i[n.amsSelect2HelperArgument||"value"]=a.val(),e.get(n.amsSelect2HelperUrl,i,t.getFunctionByName(n.amsSelect2HelperCallback)||function(e){e?(s.html(e),t.initContent&&t.initContent(s)):s.empty()}).fail(function(){s.empty()});break;case"json-rpc":s.html('<div class="text-center"><i class="fa fa-2x fa-gear fa-spin"></i></div>'),t.jsonrpc&&t.jsonrpc.post(n.amsSelect2HelperMethod,{value:a.val()},{url:n.amsSelect2HelperUrl},t.getFunctionByName(n.amsSelect2HelperCallback)||function(e){e.result?(s.html(e.result),t.initContent&&t.initContent(s)):s.empty()});break;default:var r=n.amsSelect2HelperCallback;r&&t.executeFunctionByName(r,a,n)}},contextMenuHandler:function(e,a){"A"!==a.get(0).tagName&&(a=a.parents("a").first());var n=a.data();if("modal"===n.toggle)t.dialog&&t.dialog.open(a);else{var s=a.attr("href")||n.amsUrl;if(!s||s.startsWith("javascript")||a.attr("target"))return;t.event&&t.event.stop();var i=t.getFunctionByName(s);"function"==typeof i&&(s=i.call(a,e)),"function"==typeof s?s.call(a,e):(s=s.replace(/\%23/,"#"),(e=a.data("ams-target"))?t.form&&t.form.confirmChangedForm(e,function(){t.skin&&t.skin.loadURL(s,e,a.data("ams-link-options"),a.data("ams-link-callback"))}):t.form&&t.form.confirmChangedForm(function(){s.startsWith("#")?s!==location.hash&&(t.root.hasClass("mobile-view-activated")?(t.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=s},150)):window.location.hash=s):window.location=s}))}},datetimepickerDialogHiddenCallback:function(){e(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")},clearSearchTarget:function(){var a=e(this);if(!a.val()){var t=e(a).parents("form").first();e(t.data("ams-form-submit-target")).empty()}},setSEOStatus:function(){var a=e(this),t=a.siblings(".progress").children(".progress-bar"),n=Math.min(a.val().length,100),s="success";n<20||n>80?s="danger":(n<40||n>66)&&(s="warning"),t.removeClassPrefix("progress-bar").addClass("progress-bar").addClass("progress-bar-"+s).css("width",n+"%")}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.plugins={enabled:{},init:function(a){function n(e,a){if(o.hasOwnProperty(e)){var n=o[e];n.css=n.css||a.css,n.callbacks.push({callback:a.callback,context:a.context}),a.register&&(n.register=!0),!1===a.async&&(n.async=!1)}else o[e]={src:a.src,css:a.css,callbacks:[{callback:a.callback,context:a.context}],register:a.register,async:a.async};a.css&&t.getCSS(a.css,e+"_css")}function s(e){var n,s,i=c.callbacks;if(i&&i.length){for(n=0;n<i.length;n++)if(s=i[n],s.callback=t.getFunctionByName(s.callback),!1!==c.register){var o=t.plugins.enabled;o.hasOwnProperty(r)?o[r].push(s):o[r]=[s]}}else!1!==c.register&&(t.plugins.enabled[r]=null);if(!0!==e&&i&&i.length&&!1!==c.async)for(n=0;n<i.length;n++)s=i[n],t.executeFunctionByName(s.callback,a,s.context)}t.plugins.initData(a);var i=[];e("[data-ams-plugins-disabled]",a).each(function(){for(var a=e(this).data("ams-plugins-disabled").split(/\s+/),t=0;t<a.length;t++)i.push(a[t])});var r,o={};e("[data-ams-plugins]",a).each(function(){var a=e(this),t=a.data("ams-plugins");if("string"==typeof t)for(var s=a.data("ams-plugins").split(/\s+/),i=0;i<s.length;i++){r=s[i];var o={src:a.data("ams-plugin-"+r+"-src"),css:a.data("ams-plugin-"+r+"-css"),callback:a.data("ams-plugin-"+r+"-callback"),context:a,register:a.data("ams-plugin-"+r+"-register"),async:a.data("ams-plugin-"+r+"-async")};n(r,o)}else for(r in t)t.hasOwnProperty(r)&&n(r,t[r])});var c;for(r in o)o.hasOwnProperty(r)&&(c=o[r],void 0===t.plugins.enabled[r]?t.getScript(c.src,s,{async:void 0===c.async||c.async}):(!function(){var e=t.plugins.enabled[r];for(l=0;l<e.length;l++){var a=e[l];a&&a.context&&!t.isInDOM(a.context)&&(e[l]=null)}}(),s(!0)));for(var l in t.plugins.enabled)if(t.plugins.enabled.hasOwnProperty(l)&&!(i.indexOf(l)>=0)){var d=t.plugins.enabled[l];if(d)switch(typeof d){case"function":d(a);break;default:for(var m=0;m<d.length;m++){var u=d[m];switch(typeof u){case"function":u(a);break;default:u&&u.callback&&u.callback(u.context)}}}}},initData:function(a){e("[data-ams-data]",a).each(function(){var a=e(this),t=a.data("ams-data");if(t)for(var n in t)if(t.hasOwnProperty(n)){var s=t[n];"string"!=typeof s&&(s=JSON.stringify(s)),a.attr("data-"+n,s)}})},register:function(e,a,n){if("function"==typeof a&&(n=a,a=null),a=a||e.name,t.plugins.enabled.indexOf(a)>=0)console&&console.warn&&console.warn("Plugin "+a+" is already registered!");else if("object"==typeof e){var s=e.src;s?t.ajax&&t.ajax.check(e.callback,s,function(s){s&&(t.plugins.enabled[a]=t.getFunctionByName(e.callback),e.css&&t.getCSS(e.css,a+"_css"),n&&t.executeFunctionByName(n))}):(t.plugins.enabled[a]=t.getFunctionByName(e.callback),e.css&&t.getCSS(e.css,a+"_css"),n&&t.executeFunctionByName(n))}else"function"==typeof e&&(t.plugins.enabled[a]=e,n&&t.executeFunctionByName(n))}},t.plugins.i18n={widgets:{},validate:{},datatables:{},fancybox:{ERROR:"Can't load requested content.",RETRY:"Please check URL or try again later.",CLOSE:"Close",NEXT:"Next",PREVIOUS:"Previous"},dndupload:{FILES_SELECTED:"{count} files selected",CHOOSE_FILE:"Select file(s)",ADD_INFO:"to add them to current folder,",DRAG_FILE:"or drag and drop them here!",UPLOAD:"Upload",UPLOADING:"Uploading&hellip;",DONE:"Done!",UPLOAD_MORE:"Upload more?",ERROR:"Error!",TRY_AGAIN:"Try again?"}}}(jQuery,this),function(e,a){var t=a.MyAMS;e.extend(t.plugins.enabled,{svg:function(a){var t=e(".svg-container",a);t.length>0&&t.each(function(){var a=e(this),t=e("svg",a),n=t.attr("width"),s=t.attr("height");n&&s&&t.get(0).setAttribute("viewBox","0 0 "+Math.round(parseFloat(n))+" "+Math.round(parseFloat(s))),t.attr("width","100%").attr("height","auto")})},hint:function(a){var n=e(".hint:not(:parents(.nohints))",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.tipsy,t.baseURL+"ext/jquery-tipsy"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-tipsy"+t.devext+".css","jquery-tipsy",function(){n.each(function(){var a=e(this),n=a.data(),s={html:void 0===n.amsHintHtml?(a.attr("title")||"").startsWith("<"):n.amsHintHtml,title:t.getFunctionByName(n.amsHintTitleGetter)||function(){var a=e(this),t=a.attr("original-title")||a.attr(n.amsHintTitleAttr||"title")||(n.amsHintHtml?a.html():a.text());return t=t.replace(/\?_="/,"?_="+(new Date).getTime()+'"')},opacity:n.amsHintOpacity||.95,gravity:n.amsHintGravity||"sw",offset:n.amsHintOffset||0},i=e.extend({},s,n.amsHintOptions);i=t.executeFunctionByName(n.amsHintInitCallback,a,i)||i;var r=a.tipsy(i);t.executeFunctionByName(n.amsHintAfterInitCallback,a,r,i)})})})},contextMenu:function(a){var n=e(".context-menu",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={menuSelector:n.amsContextmenuSelector,menuSelected:t.helpers&&t.helpers.contextMenuHandler},i=e.extend({},s,n.amsContextmenuOptions);i=t.executeFunctionByName(n.amsContextmenuInitCallback,a,i)||i;var r=a.contextMenu(i);t.executeFunctionByName(n.amsContextmenuAfterInitCallback,a,r,i)})},switcher:function(a){e("LEGEND.switcher",a).each(function(){var a=e(this),t=a.parent("fieldset"),n=a.data();n.amsSwitcher||(e('<i class="fa fa-fw"></i>').prependTo(e(this)).addClass("open"===n.amsSwitcherState?n.amsSwitcherMinusClass||"fa-minus":n.amsSwitcherPlusClass||"fa-plus"),a.on("click",function(s){s.preventDefault();var i={};if(a.trigger("ams.switcher.before-switch",[a,i]),!i.veto)if(t.hasClass("switched")){t.removeClass("switched"),e(".fa",a).removeClass(n.amsSwitcherPlusClass||"fa-plus").addClass(n.amsSwitcherMinusClass||"fa-minus"),a.trigger("ams.switcher.opened",[a]);var r=a.attr("id");r&&e('legend.switcher[data-ams-switcher-sync="'+r+'"]',t).each(function(){var a=e(this);a.parents("fieldset").hasClass("switched")&&a.click()})}else t.addClass("switched"),e(".fa",a).removeClass(n.amsSwitcherMinusClass||"fa-minus").addClass(n.amsSwitcherPlusClass||"fa-plus"),a.trigger("ams.switcher.closed",[a])}),"open"!==n.amsSwitcherState&&t.addClass("switched"),a.data("ams-switcher","on"))})},checker:function(a){e("LEGEND.checker",a).each(function(){var a=e(this),n=a.parent("fieldset"),s=a.data();if(!s.amsChecker){var i=e('<label class="checkbox"></label>'),r=s.amsCheckerFieldname||"checker_"+t.generateId(),o=r.replace(/\./,"_"),c=s.amsCheckerHiddenPrefix,l=null,d=s.amsCheckerHiddenValueOn||"true",m=s.amsCheckerHiddenValueOff||"false",u=s.amsCheckerMarker||!1;c?l=e('<input type="hidden">').attr("name",c+r).val("on"===s.amsCheckerState?d:m).prependTo(a):u&&e('<input type="hidden">').attr("name",u).attr("value",1).prependTo(a);var f=e('<input type="checkbox">').attr("name",r).attr("id",o).data("ams-checker-hidden-input",l).data("ams-checker-init",!0).val(s.amsCheckerValue||!0).attr("checked","on"===s.amsCheckerState?"checked":null);s.amsCheckerReadonly?f.attr("disabled","disabled"):f.on("change",function(i){i.preventDefault();var r={},o=e(this).is(":checked");if(a.trigger("ams.checker.before-switch",[a,r]),r.veto)e(this).prop("checked",!o);else if(t.executeFunctionByName(s.amsCheckerChangeHandler,a,o),!s.amsCheckerCancelDefault){var c=f.data("ams-checker-hidden-input");o?("disable"===s.amsCheckerMode?(n.removeAttr("disabled"),e(".select2",n).removeAttr("disabled")):n.removeClass("switched"),c&&c.val(d),e("[data-required]",n).attr("required","required"),a.trigger("ams.checker.opened",[a])):("disable"===s.amsCheckerMode?(n.prop("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),c&&c.val(m),e("[data-required]",n).removeAttr("required"),a.trigger("ams.checker.closed",[a]))}}),f.appendTo(i),e(">label",a).attr("for",f.attr("id")),i.append("<i></i>").prependTo(a);var h=e("[required]",n);h.attr("data-required",!0),"on"===s.amsCheckerState?f.attr("checked",!0):("disable"===s.amsCheckerMode?(n.attr("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),h.removeAttr("required")),a.data("ams-checker","on")}})},slider:function(a){var n=e(".slider",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.slider,t.baseURL+"ext/bootstrap-slider-2.0.0"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=e.extend({},{},a.data.amsSliderOptions);s=t.executeFunctionByName(n.amsSliderInitCallback,a,s)||s;var i=a.slider(s);t.executeFunctionByName(n.amsSliderAfterInitCallback,a,i,s)})})},draggable:function(a){var n=e(".draggable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={cursor:n.amsDraggableCursor||"move",containment:n.amsDraggableContainment,handle:n.amsDraggableHandle,connectToSortable:n.amsDraggableConnectSortable,helper:t.getFunctionByName(n.amsDraggableHelper)||n.amsDraggableHelper,start:t.getFunctionByName(n.amsDraggableStart),stop:t.getFunctionByName(n.amsDraggableStop)},i=e.extend({},s,n.amsDraggableOptions);i=t.executeFunctionByName(n.amsDraggableInitCallback,a,i)||i;var r=a.draggable(i);a.disableSelection(),t.executeFunctionByName(n.amsDraggableAfterInitCallback,a,r,i)})},droppable:function(a){var n=e(".droppable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={accept:n.amsdroppableAccept,drop:t.getFunctionByName(n.amsDroppableDrop)},i=e.extend({},s,n.amsDroppableOptions);i=t.executeFunctionByName(n.amsDroppableInitCallback,a,i)||i;var r=a.droppable(i);t.executeFunctionByName(n.amsDroppableAfterInitCallback,a,r,i)})},sortable:function(a){var n=e(".sortable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={items:n.amsSortableItems,handle:n.amsSortableHandle,helper:n.amsSortableHelper,connectWith:n.amsSortableConnectwith,start:t.getFunctionByName(n.amsSortableStart),over:t.getFunctionByName(n.amsSortableOver),containment:n.amsSortableContainment,placeholder:n.amsSortablePlaceholder,stop:t.getFunctionByName(n.amsSortableStop)},i=e.extend({},s,n.amsSortableOptions);i=t.executeFunctionByName(n.amsSortableInitCallback,a,i)||i;var r=a.sortable(i);a.disableSelection(),t.executeFunctionByName(n.amsSortableAfterInitCallback,a,r,i)})},resizable:function(a){var n=e(".resizable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={autoHide:!1===n.amsResizableAutohide||n.amsResizableAutohide,containment:n.amsResizableContainment,grid:n.amsResizableGrid,handles:n.amsResizableHandles,start:t.getFunctionByName(n.amsResizableStart),stop:t.getFunctionByName(n.amsResizableStop)},i=e.extend({},s,n.amsResizableOptions);i=t.executeFunctionByName(n.amsResizableInitCallback,a,i)||i;var r=a.resizable(i);a.disableSelection(),t.executeFunctionByName(n.amsResizableAfterInitCallback,a,r,i)})},typeahead:function(a){var n=e(".typeahead",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.typeahead,t.baseURL+"ext/jquery-typeahead"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=e.extend({},{},n.amsTypeaheadOptions);s=t.executeFunctionByName(n.amsTypeaheadInitCallback,a,s)||s;var i=a.typeahead(s);t.executeFunctionByName(n.amsTypeaheadAfterInitCallback,a,i,s)})})},treeview:function(a){var n=e(".treeview",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.treview,t.baseURL+"ext/bootstrap-treeview"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/bootstrap-treeview"+t.devext+".css","bootstrap-treeview",function(){n.each(function(){var a=e(this),n=a.data(),s={data:n.amsTreeviewData,levels:n.amsTreeviewLevels,injectStyle:n.amsTreeviewInjectStyle,expandIcon:n.amsTreeviewExpandIcon||"fa fa-fw fa-plus-square-o",collapseIcon:n.amsTreeviewCollaspeIcon||"fa fa-fw fa-minus-square-o",emptyIcon:n.amsTreeviewEmptyIcon||"fa fa-fw",nodeIcon:n.amsTreeviewNodeIcon,selectedIcon:n.amsTreeviewSelectedIcon,checkedIcon:n.amsTreeviewCheckedIcon||"fa fa-fw fa-check-square-o",uncheckedIcon:n.amsTreeviewUncheckedIcon||"fa fa-fw fa-square-o",color:n.amsTreeviewColor,backColor:n.amsTreeviewBackColor,borderColor:n.amsTreeviewBorderColor,onHoverColor:n.amsTreeviewHoverColor,selectedColor:n.amsTreeviewSelectedColor,selectedBackColor:n.amsTreeviewSelectedBackColor,unselectableColor:n.amsTreeviewUnselectableColor||"rgba(1,1,1,0.25)",unselectableBackColor:n.amsTreeviewUnselectableBackColor||"rgba(1,1,1,0.25)",enableLinks:n.amsTreeviewEnableLinks,highlightSelected:n.amsTreeviewHighlightSelected,highlightSearchResults:n.amsTreeviewhighlightSearchResults,showBorder:n.amsTreeviewShowBorder,showIcon:n.amsTreeviewShowIcon,showCheckbox:n.amsTreeviewShowCheckbox,showTags:n.amsTreeviewShowTags,toggleUnselectable:n.amsTreeviewToggleUnselectable,multiSelect:n.amsTreeviewMultiSelect,onNodeChecked:t.getFunctionByName(n.amsTreeviewNodeChecked),onNodeCollapsed:t.getFunctionByName(n.amsTreeviewNodeCollapsed),onNodeDisabled:t.getFunctionByName(n.amsTreeviewNodeDisabled),onNodeEnabled:t.getFunctionByName(n.amsTreeviewNodeEnabled),onNodeExpanded:t.getFunctionByName(n.amsTreeviewNodeExpanded),onNodeSelected:t.getFunctionByName(n.amsTreeviewNodeSelected),onNodeUnchecked:t.getFunctionByName(n.amsTreeviewNodeUnchecked),onNodeUnselected:t.getFunctionByName(n.amsTreeviewNodeUnselected),onSearchComplete:t.getFunctionByName(n.amsTreeviewSearchComplete),onSearchCleared:t.getFunctionByName(n.amsTreeviewSearchCleared)},i=e.extend({},s,n.amsTreeviewOptions);i=t.executeFunctionByName(n.amsTreeviewInitcallback,a,i)||i;var r=a.treeview(i);t.executeFunctionByName(n.amsTreeviewAfterInitCallback,a,r,i)})})})},select2:function(a){var n=e(".select2",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.select2,t.baseURL+"ext/jquery-select2-3.5.4"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();if(!n.select2){var s={placeholder:n.amsSelect2Placeholder,multiple:n.amsSelect2Multiple,minimumInputLength:n.amsSelect2MinimumInputLength||0,maximumSelectionSize:n.amsSelect2MaximumSelectionSize,openOnEnter:void 0===n.amsSelect2EnterOpen||n.amsSelect2EnterOpen,allowClear:void 0===n.amsSelect2AllowClear||n.amsSelect2AllowClear,width:n.amsSelect2Width||"100%",initSelection:t.getFunctionByName(n.amsSelect2InitSelection),formatSelection:void 0===n.amsSelect2FormatSelection?t.helpers&&t.helpers.select2FormatSelection:t.getFunctionByName(n.amsSelect2FormatSelection),formatResult:t.getFunctionByName(n.amsSelect2FormatResult),formatMatches:void 0===n.amsSelect2FormatMatches?function(e){return 1===e?t.i18n.SELECT2_MATCH:e+t.i18n.SELECT2_MATCHES}:t.getFunctionByName(n.amsSelect2FormatMatches),formatNoMatches:void 0===n.amsSelect2FormatResult?function(e){return t.i18n.SELECT2_NOMATCHES}:t.getFunctionByName(n.amsSelect2FormatResult),formatInputTooShort:void 0===n.amsSelect2FormatInputTooShort?function(e,a){var n=a-e.length;return t.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooShort),formatInputTooLong:void 0===n.amsSelect2FormatInputTooLong?function(e,a){var n=e.length-a;return t.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooLong),formatSelectionTooBig:void 0===n.amsSelect2FormatSelectionTooBig?function(e){return t.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,e).replace(/\{1\}/,1===e?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatSelectionTooBig),formatLoadMore:void 0===n.amsSelect2FormatLoadMore?function(e){return t.i18n.SELECT2_LOADMORE}:t.getFunctionByName(n.amsSelect2FormatLoadMore),formatSearching:void 0===n.amsSelect2FormatSearching?function(){return t.i18n.SELECT2_SEARCHING}:t.getFunctionByName(n.amsSelect2FormatSearching),separator:n.amsSelect2Separator||",",tokenSeparators:n.amsSelect2TokensSeparators||[","],tokenizer:t.getFunctionByName(n.amsSelect2Tokenizer)};switch(a.context.type){case"text":case"hidden":if(!s.initSelection){var i=a.data("ams-select2-values");i&&(s.initSelection=function(a,t){var n=[];e(a.val().split(s.separator)).each(function(){n.push({id:this,text:i[this]||this})}),t(n)})}}a.attr("readonly")?"hidden"===a.attr("type")&&(s.query=function(){return[]}):n.amsSelect2Query?(s.query=t.getFunctionByName(n.amsSelect2Query),s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryUrl?(s.ajax={url:n.amsSelect2QueryUrl,quietMillis:n.amsSelect2QuietMillis||200,type:n.amsSelect2QueryType||"POST",dataType:n.amsSelect2QueryDatatype||"json",data:function(a,t,s){var i={};return i[n.amsSelect2QueryParamName||"query"]=a,i[n.amsSelect2PageParamName||"page"]=t,i[n.amsSelect2ContextParamName||"context"]=s,e.extend({},i,n.amsSelect2QueryOptions)},results:t.helpers&&t.helpers.select2QueryUrlResultsCallback},s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryMethod?(s.query=function(s){var i={id:(new Date).getTime(),params:n.amsSelect2QueryParams||{},success:function(e){return t.helpers&&t.helpers.select2QueryMethodSuccessCallback.call(a,e,"success",s)},error:t.error&&t.error.show};i.params[n.amsSelect2QueryParamName||"query"]=s.term,i.params[n.amsSelect2PageParamName||"page"]=s.page,i.params[n.amsSelect2ContextParamName||"context"]=s.context,i=e.extend({},i,n.amsSelect2QueryOptions),i=t.executeFunctionByName(n.amsSelect2QueryInitCallback,a,i)||i,t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){e.jsonRPC.withOptions({endPoint:n.amsSelect2MethodTarget||t.jsonrpc&&t.jsonrpc.getAddr(),namespace:n.amsSelect2MethodNamespace,cache:!1},function(){e.jsonRPC.request(n.amsSelect2QueryMethod,i)})})},s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2Tags?s.tags=n.amsSelect2Tags:n.amsSelect2Data&&(s.data=n.amsSelect2Data),n.amsSelect2EnableFreeTags&&(s.createSearchChoice=function(e){return{id:e,text:(n.amsSelect2FreeTagsPrefix||t.i18n.SELECT2_FREETAG_PREFIX)+e}});var r=e.extend({},s,n.amsSelect2Options);r=t.executeFunctionByName(n.amsSelect2InitCallback,a,r)||r;var o=a.select2(r);t.executeFunctionByName(n.amsSelect2AfterInitCallback,a,o,r),a.hasClass("ordered")&&t.ajax&&t.ajax.check(e.fn.select2Sortable,t.baseURL+"ext/jquery-select2-sortable"+t.devext+".js",function(){a.select2Sortable({bindOrder:"sortableStop"})}),a.on("change",function(){void 0!==e(a.get(0).form).data("validator")&&e(a).valid()})}})})},maskedit:function(a){var n=e("[data-mask]",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.mask,t.baseURL+"ext/jquery-maskedinput-1.4.1"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s={placeholder:void 0===n.amsMaskeditPlaceholder?"X":n.amsMaskeditPlaceholder,complete:t.getFunctionByName(n.amsMaskeditComplete)},i=e.extend({},s,n.amsMaskeditOptions);i=t.executeFunctionByName(n.amsMaskeditInitCallback,a,i)||i;var r=a.mask(a.attr("data-mask"),i);t.executeFunctionByName(n.amsMaskeditAfterInitCallback,a,r,i)})})},inputmask:function(a){var n=e("input[data-input-mask]",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.inputmask,t.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+t.devext+".js",function(){n.each(function(){var a,n=e(this),s=n.data();a="object"==typeof s.inputMask?s.inputMask:{mask:s.inputMask.toString()};var i=e.extend({},a,s.amsInputmaskOptions);i=t.executeFunctionByName(s.amsInputmaskInitCallback,n,i)||i;var r=n.inputmask(i);t.executeFunctionByName(s.amsInputmaskAfterInitCallback,n,r,i)})})},datepicker:function(a){var n=e(".datepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y",datepicker:!0,dayOfWeekStart:1,timepicker:!1,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},datetimepicker:function(a){var n=e(".datetimepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y H:i",datepicker:!0,dayOfWeekStart:1,timepicker:!0,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},timepicker:function(a){var n=e(".timepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},colorpicker:function(a){var n=e(".colorpicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.minicolors,t.baseURL+"ext/jquery-minicolors"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-minicolors"+t.devext+".css","jquery-minicolors",function(){n.each(function(){var a=e(this),n=a.data(),s={position:n.amsColorpickerPosition||a.closest(".input").data("ams-colorpicker-position")||"bottom left"},i=e.extend({},s,n.amsColorpickerOptions);i=t.executeFunctionByName(n.amsColorpickerInitCallback,a,i)||i;var r=a.minicolors(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},dndupload:function(a){var n=e(".dndupload",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.dndupload,t.baseURL+"ext/jquery-dndupload"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-dndupload"+t.devext+".css","jquery-dndupload",function(){n.each(function(){var a=e(this),n=a.data(),s={action:n.amsDnduploadAction||a.attr("action")||"upload-files",fieldname:n.amsDnduploadFieldname||"files",autosubmit:n.amsDnduploadAutosubmit},i=e.extend({},s,n.amsDnduploadOptions);i=t.executeFunctionByName(n.amsDnduploadInitCallback,a,i)||i;var r=a.dndupload(i);t.executeFunctionByName(n.amsDnduploadAfterInitcallback,a,r,i)})})})},validate:function(a){var n=e("FORM:not([novalidate])",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.validate,t.baseURL+"ext/jquery-validate-1.17.0"+t.devext+".js",function(a){if(a&&(e.validator.setDefaults({highlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(e,a){var t=a.parents("label, .input").first();t.length?e.insertAfter(t):e.insertAfter(a)}}),t.plugins&&t.plugins.i18n)){for(var s in t.plugins.i18n.validate)if(t.plugins.i18n.validate.hasOwnProperty(s)){var i=t.plugins.i18n.validate[s];"string"==typeof i&&i.indexOf("{0}")>-1&&(t.plugins.i18n.validate[s]=e.validator.format(i))}e.extend(e.validator.messages,t.plugins.i18n.validate)}n.each(function(){var a=e(this),n=a.data(),s={ignore:null,submitHandler:void 0!==a.attr("data-async")?void 0===n.amsFormSubmitHandler?function(){return e(".state-error",a).removeClass("state-error"),t.ajax&&t.ajax.check(e.fn.ajaxSubmit,t.baseURL+"ext/jquery-form-3.49"+t.devext+".js"),t.form&&t.form.submit(a)}:t.getFunctionByName(n.amsFormSubmitHandler):void 0,invalidHandler:void 0===n.amsFormInvalidHandler?function(t,n){e(".state-error",a).removeClass("state-error");for(var s=0;s<n.errorList.length;s++){var i=n.errorList[s],r=e(i.element).parents(".tab-pane").index()+1;if(r>0){var o=e(".nav-tabs",e(i.element).parents(".tabforms"));e("li:nth-child("+r+")",o).removeClassPrefix("state-").addClass("state-error"),e("li.state-error:first a",o).click()}}}:t.getFunctionByName(n.amsFormInvalidHandler)};e("[data-ams-validate-rules]",a).each(function(a){0===a&&(s.rules={}),s.rules[e(this).attr("name")]=e(this).data("ams-validate-rules")}),e("[data-ams-validate-messages]",a).each(function(a){0===a&&(s.messages={}),s.messages[e(this).attr("name")]=e(this).data("ams-validate-messages")});var i=e.extend({},s,n.amsValidateOptions);i=t.executeFunctionByName(n.amsValidateInitCallback,a,i)||i;var r=a.validate(i);t.executeFunctionByName(n.amsValidateAfterInitCallback,a,r,i)})})},datatable:function(a){var n=e(".datatable",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.dataTable,t.baseURL+"ext/jquery-dataTables-1.9.4"+t.devext+".js",function(){t.ajax.check(e.fn.dataTableExt.oPagination.bootstrap_full,t.baseURL+"myams-dataTables"+t.devext+".js",function(){e(n).each(function(){var a,n=e(this),s=n.data(),i=(s.amsDatatableExtensions||"").split(/\s+/),r=s.amsDatatableSdom||"W"+(i.indexOf("colreorder")>=0||i.indexOf("colreorderwithresize")>=0?"R":"")+"<'dt-top-row'"+(i.indexOf("colvis")>=0?"C":"")+(!1===s.amsDatatablePagination||!1===s.amsDatatablePaginationSize?"":"L")+(!1===s.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(i.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===s.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",o=s.amsDatatableSorting;if("string"==typeof o){var c=o.split(";");for(o=[],a=0;a<c.length;a++){var l=c[a].split(",");l[0]=parseInt(l[0]),o.push(l)}}var d,m=[],u=e("th",n).listattr("data-ams-datatable-sortable");for(a=0;a<u.length;a++){var f=u[a];void 0!==f?((d=m[a]||{}).bSortable="string"==typeof f?JSON.parse(f):f,m[a]=d):m[a]=m[a]||{}}var h=e("th",n).listattr("data-ams-datatable-stype");for(a=0;a<h.length;a++){var p=h[a];p?((d=m[a]||{}).sType=p,m[a]=d):m[a]=m[a]||{}}var g={bJQueryUI:!1,bServerSide:s.amsDatatableServerSide||!1,sAjaxSource:!0===s.amsDatatableServerSide?s.amsDatatableAjaxSource:void 0,sServerMethod:!0===s.amsDatatableServerSide?"POST":void 0,bFilter:!1!==s.amsDatatableGlobalFilter||i.indexOf("columnfilter")>=0,bPaginate:!1!==s.amsDatatablePagination,bInfo:!1!==s.amsDatatableInfo,bSort:!1!==s.amsDatatableSort,aaSorting:o,aoColumns:m.length>0?m:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:s.amsDatatableDisplayLength||25,sPaginationType:s.amsDatatablePaginationType||"bootstrap_full",sDom:r,oLanguage:t.plugins&&t.plugins.i18n.datatables,fnInitComplete:function(a,n){e(".ColVis_Button").addClass("btn btn-default btn-sm").html((t.plugins&&t.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}},b=e.extend({},g,s.amsDatatableOptions),v=[],x=[],y=[];if(i.length>0)for(a=0;a<i.length;a++)switch(i[a]){case"autofill":v.push(e.fn.dataTable.AutoFill),x.push(t.baseURL+"ext/jquery-dataTables-autoFill"+t.devext+".js");break;case"columnfilter":v.push(e.fn.columnFilter),x.push(t.baseURL+"ext/jquery-dataTables-columnFilter"+t.devext+".js");break;case"colreorder":v.push(e.fn.dataTable.ColReorder),x.push(t.baseURL+"ext/jquery-dataTables-colReorder"+t.devext+".js");break;case"colreorderwithresize":v.push(window.ColReorder),x.push(t.baseURL+"ext/jquery-dataTables-colReorderWithResize"+t.devext+".js");break;case"colvis":v.push(e.fn.dataTable.ColVis),x.push(t.baseURL+"ext/jquery-dataTables-colVis"+t.devext+".js"),y.push(function(){b.oColVis=e.extend({},{activate:"click",sAlign:"right"},s.amsDatatableColvisOptions)});break;case"editable":v.push(e.fn.editable),x.push(t.baseURL+"ext/jquery-jeditable"+t.devext+".js"),v.push(e.fn.makeEditable),x.push(t.baseURL+"ext/jquery-dataTables-editable"+t.devext+".js");break;case"fixedcolumns":v.push(e.fn.dataTable.FixedColumns),x.push(t.baseURL+"ext/jquery-dataTables-fixedColumns"+t.devext+".js");break;case"fixedheader":v.push(e.fn.dataTable.Fixedheader),x.push(t.baseURL+"ext/jquery-dataTables-fixedHeader"+t.devext+".js");break;case"keytable":v.push(window.keyTable),x.push(t.baseURL+"ext/jquery-dataTables-keyTable"+t.devext+".js");break;case"rowgrouping":v.push(e.fn.rowGrouping),x.push(t.baseURL+"ext/jquery-dataTables-rowGrouping"+t.devext+".js");break;case"rowreordering":v.push(e.fn.rowReordering),x.push(t.baseURL+"ext/jquery-dataTables-rowReordering"+t.devext+".js");break;case"scroller":v.push(e.fn.dataTable.Scroller),x.push(t.baseURL+"ext/jquery-dataTables-scroller"+t.devext+".js")}y.push(function(){b=t.executeFunctionByName(s.amsDatatableInitCallback,n,b)||b;try{var r=n.dataTable(b);if(t.executeFunctionByName(s.amsDatatableAfterInitCallback,n,r,b),i.length>0)for(a=0;a<i.length;a++)switch(i[a]){case"autofill":var o=e.extend({},s.amsDatatableAutofillOptions,b.autofill);o=t.executeFunctionByName(s.amsDatatableAutofillInitCallback,n,o)||o,n.data("ams-autofill",void 0===s.amsDatatableAutofillConstructor?new e.fn.dataTable.AutoFill(n,o):t.executeFunctionByName(s.amsDatatableAutofillConstructor,n,r,o));break;case"columnfilter":var c=e.extend({},{sPlaceHolder:"head:after"},s.amsDatatableColumnfilterOptions,b.columnfilter);c=t.executeFunctionByName(s.amsDatatableColumnfilterInitCallback,n,c)||c,n.data("ams-columnfilter",void 0===s.amsDatatableColumnfilterConstructor?r.columnFilter(c):t.executeFunctionByName(s.amsDatatableColumnfilterConstructor,n,r,c));break;case"editable":var l=e.extend({},s.amsDatatableEditableOptions,b.editable);l=t.executeFunctionByName(s.amsDatatableEditableInitCallback,n,l)||l,n.data("ams-editable",void 0===s.amsDatatableEditableConstructor?n.makeEditable(l):t.executeFunctionByName(s.amsDatatableEditableConstructor,n,r,l));break;case"fixedcolumns":var d=e.extend({},s.amsDatatableFixedcolumnsOptions,b.fixedcolumns);d=t.executeFunctionByName(s.amsDatatableFixedcolumnsInitCallback,n,d)||d,n.data("ams-fixedcolumns",void 0===s.amsDatatableFixedcolumnsConstructor?new e.fn.dataTable.FixedColumns(n,d):t.executeFunctionByName(s.amsDatatableFixedcolumnsConstructor,n,r,d));break;case"fixedheader":var m=e.extend({},s.amsDatatableFixedheaderOptions,b.fixedheader);m=t.executeFunctionByName(s.amsDatatableFixedheadeInitCallback,n,m)||m,n.data("ams-fixedheader",void 0===s.amsDatatableFixedheaderConstructor?new e.fn.dataTable.FixedHeader(n,m):t.executeFunctionByName(s.amsDatatableFixedheaderConstructor,n,r,m));break;case"keytable":var u={table:n.get(0),datatable:r},f=e.extend({},u,s.amsDatatableKeytableOptions,b.keytable);f=t.executeFunctionByName(s.amsDatatableKeytableInitCallback,n,f)||f,n.data("ams-keytable",void 0===s.amsDatatableKeytableConstructor?new KeyTable(f):t.executeFunctionByName(s.amsDatatableKeytableConstructor,n,r,f));break;case"rowgrouping":var h=e.extend({},s.amsDatatableRowgroupingOptions,b.rowgrouping);h=t.executeFunctionByName(s.amsDatatableRowgroupingInitCallback,n,h)||h,n.data("ams-rowgrouping",void 0===s.amsDatatableRowgroupingConstructor?n.rowGrouping(h):t.executeFunctionByName(s.amsDatatableRowgroupingConstructor,n,r,h));break;case"rowreordering":var p=e.extend({},s.amsDatatableRowreorderingOptions,b.rowreordering);p=t.executeFunctionByName(s.amsDatatableRowreorderingInitCallback,n,p)||p,n.data("ams-rowreordering",void 0===s.amsDatatableRowreorderingConstructor?n.rowReordering(p):t.executeFunctionByName(s.amsDatatableRowreorderingConstructor,n,r,p))}if(s.amsDatatableFinalizeCallback){var g=s.amsDatatableFinalizeCallback.split(/\s+/);if(g.length>0)for(a=0;a<g.length;a++)t.executeFunctionByName(g[a],n,r,b)}}catch(e){}}),t.ajax&&t.ajax.check(v,x,y)})})})},tablednd:function(a){var n=e(".table-dnd",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.tableDnD,t.baseURL+"ext/jquery-tablednd"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();n.amsTabledndDragHandle?e("tr",a).addClass("no-drag-handle"):e(a).on("mouseover","tr",function(){e(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){e(this.cells[0]).removeClass("drag-handle")});var s={onDragClass:n.amsTabledndDragClass||"dragging-row",onDragStart:t.getFunctionByName(n.amsTabledndDragStart),dragHandle:n.amsTabledndDragHandle,scrollAmount:n.amsTabledndScrollAmount,onAllowDrop:n.amsTabledndAllowDrop,onDrop:t.getFunctionByName(n.amsTabledndDrop)||function(s,i){var r=n.amsTabledndDropTarget;if(r){e(i).data("ams-disabled-handlers","click");try{var o=[];e(s.rows).each(function(){var a=e(this).data("ams-element-name");a&&o.push(a)});var c=t.getFunctionByName(r);if("function"==typeof c)c.call(a,s,o);else{if(!r.startsWith(window.location.protocol)){var l=n.amsLocation;l&&(r=l+"/"+r)}t.ajax&&t.ajax.post(r,{names:JSON.stringify(o)},function(e,a){"success"!==e.status&&t.ajax.handleJSON(e)})}}finally{setTimeout(function(){e(i).removeData("ams-disabled-handlers")},50)}}return!1}},i=e.extend({},s,n.amsTabledndOptions);i=t.executeFunctionByName(n.amsTabledndInitCallback,a,i)||i;var r=a.tableDnD(i);t.executeFunctionByName(n.amsTabledndAfterInitCallback,a,r,i)})})},wizard:function(a){var n=e(".wizard",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.bootstrapWizard,t.baseURL+"ext/bootstrap-wizard-1.4.2"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s={withVisible:void 0===n.amsWizardWithVisible||n.amsWizardWithVisible,tabClass:n.amsWizardTabClass,firstSelector:n.amsWizardFirstSelector,previousSelector:n.amsWizardPreviousSelector,nextSelector:n.amsWizardNextSelector,lastSelector:n.amsWizardLastSelector,finishSelector:n.amsWizardFinishSelector,backSelector:n.amsWizardBackSelector,onInit:t.getFunctionByName(n.amsWizardInit),onShow:t.getFunctionByName(n.amsWizardShow),onNext:t.getFunctionByName(n.amsWizardNext),onPrevious:t.getFunctionByName(n.amsWizardPrevious),onFirst:t.getFunctionByName(n.amsWizardFirst),onLast:t.getFunctionByName(n.amsWizardLast),onBack:t.getFunctionByName(n.amsWizardBack),onFinish:t.getFunctionByName(n.amsWizardFinish),onTabChange:t.getFunctionByName(n.amsWizardTabChange),onTabClick:t.getFunctionByName(n.amsWizardTabClick),onTabShow:t.getFunctionByName(n.amsWizardTabShow)},i=e.extend({},s,n.amsWizardOptions);i=t.executeFunctionByName(n.amsWizardInitCallback,a,i)||i;var r=a.bootstrapWizard(i);t.executeFunctionByName(n.amsWizardAfterInitCallback,a,r,i)})})},tinymce:function(a){function n(){e(".tinymce",e(this)).each(function(){var a=tinymce.get(e(this).attr("id"));a&&a.remove()})}var s=e(".tinymce",a);if(s.length>0){var i=t.baseURL+"ext/tinymce"+(t.devmode?"/dev":"");t.ajax&&t.ajax.check(window.tinymce,i+"/tinymce"+t.devext+".js",function(a){function r(){s.each(function(){var a=e(this),n=a.data(),s={theme:n.amsTinymceTheme||"modern",language:t.lang,menubar:!1!==n.amsTinymceMenubar,statusbar:!1!==n.amsTinymceStatusbar,plugins:n.amsTinymcePlugins||["advlist autosave autolink lists link charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern autoresize"],toolbar:n.amsTinymceToolbar,toolbar1:!1!==n.amsTinymceToolbar1&&(n.amsTinymceToolbar1||"undo redo | pastetext | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"),toolbar2:!1!==n.amsTinymceToolbar2&&(n.amsTinymceToolbar2||"forecolor backcolor emoticons | charmap link image media | fullscreen preview print | code"),content_css:n.amsTinymceContentCss,formats:n.amsTinymceFormats,style_formats:n.amsTinymceStyleFormats,block_formats:n.amsTinymceBlockFormats,valid_classes:n.amsTinymceValidClasses,image_advtab:!0,image_list:t.getFunctionByName(n.amsTinymceImageList)||n.amsTinymceImageList,image_class_list:n.amsTinymceImageClassList,link_list:t.getFunctionByName(n.amsTinymceLinkList)||n.amsTinymceLinkList,link_class_list:n.amsTinymceLinkClassList,paste_as_text:void 0===n.amsTinymcePasteAsText||n.amsTinymcePasteAsText,paste_auto_cleanup_on_paste:void 0===n.amsTinymcePasteAutoCleanup||n.amsTinymcePasteAutoCleanup,paste_strip_class_attributes:n.amsTinymcePasteStripClassAttributes||"all",paste_remove_spans:void 0===n.amsTinymcePaseRemoveSpans||n.amsTinymcePasteRemoveSpans,paste_remove_styles:void 0===n.amsTinymcePasteRemoveStyles||n.amsTinymcePasteRemoveStyles,height:n.amsTinymceHeight||50,min_height:50,resize:!0,autoresize_min_height:50,autoresize_max_height:500};if(n.amsTinymceExternalPlugins){var i=n.amsTinymceExternalPlugins.split(/\s+/);for(var r in i)if(i.hasOwnProperty(r)){var o=a.data("ams-tinymce-plugin-"+i[r]);tinymce.PluginManager.load(i[r],t.getSource(o))}}var c=e.extend({},s,n.amsTinymceOptions);c=t.executeFunctionByName(n.amsTinymceInitCallback,a,c)||c;var l=a.tinymce(c);t.executeFunctionByName(n.amsTinymceAfterInitCallback,a,l,c)})}a?t.getScript(i+"/jquery.tinymce"+t.devext+".js",function(){tinymce.baseURL=i,tinymce.suffix=t.devext,t.skin&&t.skin.registerCleanCallback(n),r()}):r()})}},editor:function(n){var s=e(".text-editor textarea",n);s.length>0&&t.ajax&&t.ajax.check(a.ace,t.baseURL+"ext/ace/ace.js",function(n){var i=function(){a.ace_loaded=!0,s.each(function(){var a=e(this),n=a.parents(".text-editor"),s=n.data(),i=ace.require("ace/ext/modelist"),r=s.amsEditorMode||i.getModeForPath(s.amsEditorFilename||"editor.txt").mode,o=e("<div>",{position:"absolute",width:a.width(),height:a.height(),class:a.attr("class")}).insertBefore(a);a.css("display","none");var c=ace.edit(o[0]),l={mode:r,tabSize:4,useSoftTabs:!1,showGutter:!0,showLineNumbers:!0,printMargin:132,showInvisibles:!0},d=e.extend({},l,s.amsEditorOptions);d=t.executeFunctionByName(s.amsEditorInitCallback,a,d)||d,c.setOptions(d),c.session.setValue(a.val()),c.session.on("change",function(){a.val(c.session.getValue())}),n.data("editor",c),t.executeFunctionByName(s.amsEditorAfterInitCallback,a,c,d)})};n?(ace.config.set("basePath",t.baseURL+"ext/ace"),t.ajax.check(a.ace_loaded,[t.baseURL+"ext/ace/ext-modelist.js"],i)):i()})},imgareaselect:function(a){var n=e(".imgareaselect",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.imgAreaSelect,t.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-imgareaselect"+t.devext+".css","jquery-imgareaselect",function(){n.each(function(){var a=e(this),n=a.data(),s=n.amsImgareaselectParent?a.parents(n.amsImgareaselectParent):"body",i={instance:!0,handles:!0,parent:s,x1:n.amsImgareaselectX1||0,y1:n.amsImgareaselectY1||0,x2:n.amsImgareaselectX2||n.amsImgareaselectImageWidth,y2:n.amsImgareaselectY2||n.amsImgareaselectImageHeight,imageWidth:n.amsImgareaselectImageWidth,imageHeight:n.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:n.amsImgareaselectRatio,onSelectEnd:t.getFunctionByName(n.amsImgareaselectSelectEnd)||function(a,t){var i=n.amsImgareaselectTargetField||"image_";e('input[name="'+i+'x1"]',s).val(t.x1),e('input[name="'+i+'y1"]',s).val(t.y1),e('input[name="'+i+'x2"]',s).val(t.x2),e('input[name="'+i+'y2"]',s).val(t.y2)}},r=e.extend({},i,n.amsImgareaselectOptions);r=t.executeFunctionByName(n.amsImgareaselectInitCallback,a,r)||r;var o=a.imgAreaSelect(r);t.executeFunctionByName(n.amsImgareaselectAfterInitCallback,a,o,r),setTimeout(function(){o.update()},250)})})})},fancybox:function(a){var n=e(".fancybox",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.fancybox,t.baseURL+"ext/jquery-fancybox-2.1.5"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-fancybox-2.1.5"+t.devext+".css","jquery-fancybox",function(){n.each(function(){var a,n=e(this),s=n.data(),i=n;s.amsFancyboxElements&&(i=e(s.amsFancyboxElements,n));var r=(s.amsFancyboxHelpers||"").split(/\s+/);if(r.length>0)for(a=0;a<r.length;a++)switch(r[a]){case"buttons":t.ajax&&t.ajax.check(e.fancybox.helpers.buttons,t.baseURL+"ext/fancybox-helpers/fancybox-buttons"+t.devext+".js");break;case"thumbs":t.ajax&&t.ajax.check(e.fancybox.helpers.thumbs,t.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+t.devext+".js");break;case"media":t.ajax&&t.ajax.check(e.fancybox.helpers.media,t.baseURL+"ext/fancybox-helpers/fancybox-media"+t.devext+".js")}var o={type:s.amsFancyboxType,padding:s.amsFancyboxPadding||10,margin:s.amsFancyboxMargin||10,loop:s.amsFancyboxLoop,beforeLoad:t.getFunctionByName(s.amsFancyboxBeforeLoad)||function(){var a;if(s.amsFancyboxTitleGetter&&(a=t.executeFunctionByName(s.amsFancyboxTitleGetter,this)),!a){var n=e("*:first",this.element);(a=n.attr("original-title")||n.attr("title"))||(a=e(this.element).attr("original-title")||e(this.element).attr("title"))}this.title=a},afterLoad:t.getFunctionByName(s.amsFancyboxAfterLoad),helpers:{title:{type:"inside"}}};if(r.length>0)for(a=0;a<r.length;a++)switch(r[a]){case"buttons":o.helpers.buttons={position:s.amsFancyboxButtonsPosition||"top"};break;case"thumbs":o.helpers.thumbs={width:s.amsFancyboxThumbsWidth||50,height:s.amsFancyboxThumbsHeight||50};break;case"media":o.helpers.media=!0}var c=e.extend({},o,s.amsFancyboxOptions);c=t.executeFunctionByName(s.amsFancyboxInitCallback,n,c)||c;var l=i.fancybox(c);t.executeFunctionByName(s.amsFancyboxAfterInitCallback,n,l,c)})})})},chart:function(a){var n=e(".chart",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.plot,t.baseURL+"flot/jquery.flot"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=(n.amsChartPlugins||"").split(/\s+/);if(s.length>0)for(var i in s)if(s.hasOwnProperty(i)){var r=s[i];(function(a){for(var t in e.plot.plugins)if(e.plot.plugins.hasOwnProperty(t)){var n=e.plot.plugins[t];if(n.name===a)return n}return null})(r)||t.getScript(t.baseURL+"flot/jquery.flot."+r+t.devext+".js")}var o=e.extend({},{},n.amsChartOptions);o=t.executeFunctionByName(n.amsChartInitCallback,a,o)||o;var c=n.amsChartData;c=t.executeFunctionByName(n.amsChartInitData,a,c)||c;var l=a.plot(c,o);t.executeFunctionByName(n.amsChartAfterInitCallback,a,l,o)})})},graphs:function(a){var n=e(".sparkline",a);n.length>0&&t.ajax&&t.ajax.check(t.graphs,t.baseURL+"myams-graphs"+t.devext+".js",function(){t.graphs.init(n)})},scrollbars:function(a){var n=e(".scrollbar",a);n.length>0&&t.ajax&&t.ajax.check(e.event.special.mousewheel,t.baseURL+"ext/jquery-mousewheel.min.js",function(){t.ajax.check(e.fn.mCustomScrollbar,t.baseURL+"ext/jquery-mCustomScrollbar"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar",function(){n.each(function(){var a=e(this),n=a.data(),s={theme:n.amsScrollbarTheme||"light"},i=e.extend({},s,n.amsScrollbarOptions);i=t.executeFunctionByName(n.amsScrollbarInitCallback,a,i)||i;var r=a.mCustomScrollbar(i);t.executeFunctionByName(n.amsScrollbarAfterInitCallback,a,r,i)})})})})}})}(jQuery,this),function(e,a){var t=a.MyAMS;t.callbacks={init:function(a){e("[data-ams-callback]",a).each(function(){var a=this,n=e(a).data();try{var s=JSON.parse(n.amsCallback);Array.isArray(s)||(s=[s])}catch(e){s=n.amsCallback.split(/\s+/)}for(var i=0;i<s.length;i++){var r=s[i];if("string"==typeof r){var o=t.getFunctionByName(r),c=n.amsCallbackOptions;"string"==typeof c&&(c=c.unserialize()),void 0===o?n.amsCallbackSource?t.getScript(n.amsCallbackSource,function(e){t.executeFunctionByName(e,a,c)}(r),{async:void 0===n.amsCallbackAsync||n.amsCallbackAsync}):console&&console.warn&&console.warn("Undefined callback: "+n.amsCallback):o.call(a,c)}else o=t.getFunctionByName(r.callback),"string"==typeof(c=r.options)&&(c=c.unserialize()),void 0===o?r.source?t.getScript(r.source,function(e){t.executeFunctionByName(e.callback,a,e.options)}(r),{async:void 0===r.async||r.async}):console&&console.warn&&console.warn("Undefined callback: "+r.callback):o.call(a,r.options)}})},alert:function(a){var n=e(this).data(),s=e.extend({},a,n.amsAlertOptions),i=e(n.amsAlertParent||s.parent||this),r=n.amsAlertStatus||s.status||"info",o=n.amsAlertHeader||s.header,c=n.amsAlertMessage||s.message,l=n.amsAlertSubtitle||s.subtitle,d=void 0===n.amsAlertMargin?void 0!==s.margin&&s.margin:n.amsAlertMargin;t.skin&&t.skin.alert(i,r,o,c,l,d)},messageBox:function(a){var n=e(this).data(),s=e.extend({},a,n.amsMessageboxOptions),i=e.extend({},s,{title:n.amsMessageboxTitle||s.title||"",content:n.amsMessageboxContent||s.content||"",icon:n.amsMessageboxIcon||s.icon,number:n.amsMessageboxNumber||s.number,timeout:n.amsMessageboxTimeout||s.timeout}),r=n.amsMessageboxStatus||s.status||"info",o=t.getFunctionByName(n.amsMessageboxCallback||s.callback);t.skin&&t.skin.messageBox(r,i,o)},smallBox:function(a){var n=e(this).data(),s=e.extend({},a,n.amsSmallboxOptions),i=e.extend({},s,{title:n.amsSmallboxTitle||s.title||"",content:n.amsSmallboxContent||s.content||"",icon:n.amsSmallboxIcon||s.icon,iconSmall:n.amsSmallboxIconSmall||s.iconSmall,timeout:n.amsSmallboxTimeout||s.timeout}),r=n.amsSmallboxStatus||s.status||"info",o=t.getFunctionByName(n.amsSmallboxCallback||s.callback);t.skin&&t.skin.smallBox(r,i,o)}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.events={init:function(a){e("[data-ams-events-handlers]",a).each(function(){var a=e(this),n=a.data("ams-events-handlers");if(n)for(var s in n)n.hasOwnProperty(s)&&a.on(s,t.getFunctionByName(n[s]))})}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.container={changeOrder:function(a,t){e('input[name="'+e(this).data("ams-input-name")+'"]',e(this)).val(t.join(";"))},deleteElement:function(){return function(){var a=e(this);t.skin&&t.skin.bigBox({title:t.i18n.WARNING,content:'<i class="text-danger fa fa-fw fa-bell"></i>&nbsp; '+t.i18n.DELETE_WARNING,status:"info",buttons:t.i18n.BTN_OK_CANCEL},function(e){if(e===t.i18n.BTN_OK){var n=a.parents("tr").first(),s=n.parents("table").first(),i=n.data("ams-location")||s.data("ams-location")||"";i&&(i+="/");var r=n.data("ams-delete-target")||s.data("ams-delete-target")||"delete-element.json",o=n.data("ams-element-name");t.ajax&&t.ajax.post(i+r,{object_name:o},function(e,a){"success"===e.status?(s.hasClass("datatable")?s.dataTable().fnDeleteRow(n[0]):n.remove(),e.handle_json&&t.ajax.handleJSON(e)):t.ajax.handleJSON(e)})}})}},switchElementVisibility:function(){return function(){var a=e(this),n=a.parents("td").first(),s=a.parents("tr").first(),i=s.parents("table");e("i",a).attr("class","fa fa-fw fa-spinner fa-pulse"),t.ajax&&t.ajax.post(i.data("ams-location")+"/"+(n.data("ams-attribute-switcher")||i.data("ams-attribute-switcher")),{object_name:s.data("ams-element-name")},function(n,s){"success"===n.status?n.visible?e("i",a).attr("class","fa fa-fw fa-eye"):e("i",a).attr("class","fa fa-fw fa-eye-slash text-danger"):t.ajax.handleJSON(n)})}},switchElementAttribute:function(){return function(){var a=e(this),n=a.parents("td").first(),s=n.data("ams-switcher-attribute-name"),i=a.parents("tr").first(),r=i.parents("table");e("i",a).attr("class","fa fa-fw fa-spinner fa-pulse"),t.ajax&&t.ajax.post(r.data("ams-location")+"/"+(n.data("ams-attribute-switcher")||r.data("ams-attribute-switcher")),{object_name:i.data("ams-element-name")},function(n,i){"success"===n.status?n[s]||n.on?e("i",a).attr("class",r.data("ams-"+s+"-icon-on")||"fa fa-fw fa-check-square-o"):e("i",a).attr("class",r.data("ams-"+s+"-icon-off")||"fa fa-fw fa-check-square txt-color-silver opacity-75"):t.ajax.handleJSON(n)})}},exportTableToTSV:function(){return function(){var n=e(this);t.ajax&&t.ajax.check(a.saveAs,t.baseURL+"ext/js-filesaver"+t.devext+".js",function(){var a=e("table.datatable",n.parents(".ams-widget:first")),t=a.dataTable(),s="";e("th",a).each(function(a){a>0&&(s+="\t"),s+=e(this).text()}),s+="\n",e(t.fnGetData()).each(function(){e(this).each(function(e){e>0&&(s+="\t"),s+=this}),s+="\n"});var i=new Blob([s],{type:"text/tsv; charset=utf-8"});saveAs(i,"export.tsv")})}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.tree={switchTableNode:function(){function a(t){e('tr[data-ams-tree-node-parent-id="'+t+'"]').each(function(){var t=e(this);a(t.data("ams-tree-node-id")),t.remove()})}var n=e(this),s=e("i.switch",n),i=n.parents("tr").first(),r=i.parents("table").first();if(s.hasClass("fa-minus-square-o"))a(i.data("ams-tree-node-id")),s.removeClass("fa-minus-square-o").addClass("fa-plus-square-o");else{var o=i.data("ams-location")||r.data("ams-location")||"",c=i.data("ams-tree-nodes-target")||r.data("ams-tree-nodes-target")||"get-tree-nodes.json",l=i.data("ams-element-name");s.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),t.ajax&&t.ajax.post(o+"/"+l+"/"+c,{can_sort:!e("td.sorter",i).is(":empty")},function(a,n){if(a.length>0){for(var o=i,c=0;c<a.length;c++){var l=e(a[c]);l.insertAfter(o).addClass("no-drag-handle"),t.initContent&&t.initContent(l),o=l}r.hasClass("table-dnd")&&r.tableDnDUpdate()}s.removeClass("fa-cog fa-spin").addClass("fa-minus-square-o")})}},switchTree:function(){var a=e(this),n=e("i.switch",a),s=e(this).parents("table").first(),i=s.data("ams-tree-node-id");if(n.hasClass("fa-minus-square-o"))e("tr[data-ams-tree-node-parent-id]").filter('tr[data-ams-tree-node-parent-id!="'+i+'"]').remove(),e("i.switch",s).removeClass("fa-minus-square-o").addClass("fa-plus-square-o");else{var r=e("tbody tr",s).first(),o=s.data("ams-location")||"",c=s.data("ams-tree-nodes-target")||"get-tree.json";n.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),t.ajax&&t.ajax.post(o+"/"+c,{can_sort:!e("td.sorter",r).is(":empty")},function(a,i){e("tr[data-ams-tree-node-id]",s).remove();for(var r=null,o=0;o<a.length;o++){var c=e(a[o]);null===r?c.appendTo(e("tbody",s)):c.insertAfter(r),c.addClass("no-drag-handle"),t.initContent&&t.initContent(c),r=c}s.hasClass("table-dnd")&&s.tableDnDUpdate(),e("i.switch",s).removeClass("fa-plus-square-o").addClass("fa-minus-square-o"),n.removeClass("fa-cog fa-spin").addClass("fa-minus-square-o")})}},sortTree:function(a,n){var s=e(a).data(),i=s.amsTabledndDropTarget;if(i){(n=e(n)).data("ams-disabled-handlers","click");try{var r=n.parents("table").first().data("ams-tree-node-id"),o=n.data("ams-tree-node-id"),c=n.data("ams-tree-node-parent-id"),l=n.prev("tr");if(l.exists()){var d=l.data("ams-tree-node-id"),m=e(".switch",l);if(m.hasClass("fa-minus-square-o"))if(c===d)var u="reorder";else u="reparent";else u=c===(d=l.data("ams-tree-node-parent-id"))?"reorder":"reparent"}else m=null,u=c===(d=r)?"reorder":"reparent";var f=t.getFunctionByName(i);if("function"==typeof f)f.call(table,a,p);else{if(!i.startsWith(window.location.protocol)){var h=s.amsLocation;h&&(i=h+"/"+i)}var p={action:u,child:o,parent:d,order:JSON.stringify(e("tr[data-ams-tree-node-id]").listattr("data-ams-tree-node-id")),can_sort:!e("td.sorter",n).is(":empty")};t.ajax&&t.ajax.post(i,p,function(a){function s(a){e('tr[data-ams-tree-node-parent-id="'+a+'"]').each(function(){var a=e(this);s(a.attr("data-ams-tree-node-id")),a.remove()})}if(a.status)t.ajax.handleJSON(a);else{var i=e(n).parents("tbody").first();if(s(o),"reparent"===p.action){s(d),n.remove();for(var r=e('tr[data-ams-tree-node-id="'+d+'"]'),c=0;c<a.length;c++){var l=e(a[c]);r.exists()?l.insertAfter(r).addClass("no-drag-handle"):l.prependTo(i).addClass("no-drag-handle"),t.initContent&&t.initContent(l),r=l}}e("tr").parents("table").tableDnDUpdate()}})}}finally{setTimeout(function(){e(n).removeData("ams-disabled-handlers")},50)}}return!1}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.skin={_setPageHeight:function(){var a=e("#main").height(),n=e(window).height()-t.navbarHeight;a>n?t.root.css("min-height",a+t.navbarHeight):t.root.css("min-height",n),t.leftPanel.css("min-height",n),t.leftPanel.css("max-height",n)},_checkMobileWidth:function(){e(window).width()<979?t.root.addClass("mobile-view-activated"):t.root.hasClass("mobile-view-activated")&&t.root.removeClass("mobile-view-activated")},_showShortcutButtons:function(){t.shortcuts&&t.shortcuts.animate({height:"show"},200,"easeOutCirc"),t.root.addClass("shortcut-on")},_hideShortcutButtons:function(){t.shortcuts&&t.shortcuts.animate({height:"hide"},300,"easeOutCirc"),t.root.removeClass("shortcut-on")},checkNotification:function(){var a=e(".badge","#user-activity >span");parseInt(a.text())>0?a.removeClass("hidden").addClass("bg-color-red bounceIn animated"):a.addClass("hidden").removeClass("bg-color-red bounceIn animated")},refreshNotificationsPanel:function(a){var t=e(this);t.addClass("disabled"),e("i",t).addClass("fa-spin"),e('input[name="activity"]:checked',"#user-activity").change(),e("i",t).removeClass("fa-spin"),t.removeClass("disabled")},refreshContent:function(a){var n=e('[id="'+a.object_id+'"]');return n.replaceWith(e(a.content)),n=e('[id="'+a.object_id+'"]'),t.initContent&&t.initContent(n),n},refreshImage:function(a){e('img[src^="'+a.src+'"]').attr("src",a.target)},refreshWidget:function(a){var n=e('[id="'+a.parent_id+'"]'),s=e('[name="'+a.widget_name+'"]',n);s.exists()||(s=e('[name="'+a.widget_name+':list"]',n));var i=s.parents(".input").last();return i.html(a.content),t.initContent&&t.initContent(i),i},refreshTable:function(a){var n=e('[id="'+a.object_id+'"]').parents(".ams-widget:first");return n.replaceWith(e(a.table)),n=e('[id="'+a.object_id+'"]').parents(".ams-widget:first"),t.initContent&&t.initContent(n),n},refreshSwitchedTable:function(e){var a=t.skin.refreshTable(e);if(a){var n=a.siblings("legend");n.parents("fieldset:first").hasClass("switched")&&n.click()}},refreshRow:function(a){var n=e('tr[id="'+a.object_id+'"]'),s=n.parents("table").first(),i=e(a.row);return n.replaceWith(i),t.initContent&&t.initContent(i),s.hasClass("table-dnd")&&(i.addClass("no-drag-handle"),s.tableDnDUpdate()),i},refreshRowCell:function(a){var n=e('tr[id="'+a.object_id+'"]'),s=n.parents("table").first(),i=e("tr",e("thead",s)),r=e('th[data-ams-column-name="'+a.col_name+'"]',i),o=e("th",i).index(r);if(o>-1){var c=e(e("td",n).get(o));c.html(a.cell),t.initContent&&t.initContent(c)}},switchCellContent:function(a){var n=e(this),s=e("i.switch",n),i=n.parents("td"),r=e(n.data("ams-switch-target")||".inner-table-form",i),o=n.parents("tr");if(s.hasClass("fa-plus-square-o")){var c=o.parents("table");r.html('<h1 class="loading"><i class="fa fa-gear fa-spin"></i></h1>'),t.ajax&&t.ajax.post(c.data("ams-location")+"/"+n.data("ams-switch-handler"),{object_name:o.data("ams-element-name")},function(e){r.html(e),e&&(t.initContent&&t.initContent(r),s.removeClass("fa-plus-square-o").addClass("fa-minus-square-o"))})}else t.skin.cleanContainer(r),r.empty(),s.removeClass("fa-minus-square-o").addClass("fa-plus-square-o")},_initDesktopWidgets:function(n){if(t.enableWidgets){var s=e(".ams-widget",n);s.length>0&&t.ajax&&t.ajax.check(e.fn.MyAMSWidget,t.baseURL+"myams-widgets"+t.devext+".js",function(){s.each(function(){var a=e(this),n=a.data(),s=e.extend({},{deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"},n.amsWidgetOptions);s=t.executeFunctionByName(n.amsWidgetInitcallback,a,s)||s,a.MyAMSWidget(s)}),a.MyAMSWidget.initWidgetsGrid(e(".ams-widget-grid",n))})}},_initMobileWidgets:function(e){t.enableMobile&&t.enableWidgets&&t.skin._initDesktopWidgets(e)},alert:function(a,n,s,i,r,o){"error"===n&&(n="danger"),e(".alert-"+n,a).not(".persistent").remove();var c='<div class="'+(o?"margin-10":"")+" alert alert-block alert-"+n+' padding-5 fade in"><a class="close" data-dismiss="alert"><i class="fa fa-check"></i></a><h4 class="alert-heading"><i class="fa fa-fw fa-warning"></i> '+s+"</h4>"+(r?"<p>"+r+"</p>":"");if("string"==typeof i)c+="<ul><li>"+i+"</li></ul>";else if(i){c+="<ul>";for(var l in i)e.isNumeric(l)&&(c+="<li>"+i[l]+"</li>");c+="</ul>"}e(c+="</div>").insertBefore(a),a.exists&&t.skin.scrollTo(a,{offset:{top:-50}})},bigBox:function(e,a){t.ajax&&t.ajax.check(t.notify,t.baseURL+"myams-notify"+t.devext+".js",function(){t.notify.messageBox(e,a)})},messageBox:function(e,a,n){"object"==typeof e&&(n=a,a=e||{},e="info"),t.ajax&&t.ajax.check(t.notify,t.baseURL+"myams-notify"+t.devext+".js",function(){switch(e){case"error":case"danger":a.color="#C46A69";break;case"warning":a.color="#C79121";break;case"success":a.color="#739E73";break;default:a.color=a.color||"#3276B1"}a.sound=!1,t.notify.bigBox(a,n)})},smallBox:function(e,a,n){"object"==typeof e&&(n=a,a=e||{},e="info"),t.ajax&&t.ajax.check(t.notify,t.baseURL+"myams-notify"+t.devext+".js",function(){switch(e){case"error":case"danger":a.color="#C46A69";break;case"warning":a.color="#C79121";break;case"success":a.color="#739E73";break;default:a.color=a.color||"#3276B1"}a.sound=!1,t.notify.smallBox(a,n)})},scrollTo:function(a,n){t.ajax&&t.ajax.check(e.scrollTo,t.baseURL+"ext/jquery-scrollto-2.1.2"+t.devext+".js",function(){var t=e("body"),s=n.offset||0;t.hasClass("fixed-header")&&(s-=e("#header").height()),t.hasClass("fixed-ribbon")&&(s-=e("#ribbon").height()),n=e.extend({},n,{offset:s}),e.scrollTo(a,n)})},_drawBreadCrumb:function(){var a=e("OL.breadcrumb","#ribbon");e("li",a).not(".parent").remove(),e("li",a).exists()||a.append(e("<li></li>").append(e("<a></a>").text(t.i18n.HOME).addClass("padding-right-5").attr("href",e('nav a[href!="#"]:first').attr("href")))),e("LI.active >A","nav").each(function(){var t=e(this),n=e.trim(t.clone().children(".badge").remove().end().text()),s=e("<li></li>").append(t.attr("href").replace(/^#/,"")?e("<a></a>").html(n).attr("href",t.attr("href")):n);a.append(s)})},checkURL:function(){function a(a){e(".active",s).removeClass("active"),a.addClass("open").addClass("active"),a.parents("li").addClass("open active").children("ul").addClass("active").show(),a.parents("li:first").removeClass("open"),a.parents("ul").addClass(a.attr("href").replace(/^#/,"")?"active":"").show()}var n,s=e("nav"),i=location.hash,r=i.replace(/^#/,"");if(r){var o=e("#content");o.exists()||(o=e("body")),(n=e('A[href="'+i+'"]',s)).exists()&&a(n),t.skin.loadURL(r,o,{afterLoadCallback:function(){var a=e("html head title").data("ams-title-prefix");document.title=(a?a+" > ":"")+(e("[data-ams-page-title]:first",o).data("ams-page-title")||n.attr("title")||document.title)}})}else{var c=e("[data-ams-active-menu]").data("ams-active-menu");(n=c?e('A[href="'+c+'"]',s):e('>UL >LI >A[href!="#"]',s).first()).exists()&&(a(n),c?t.skin._drawBreadCrumb():window.location.hash=n.attr("href"))}},_clean_callbacks:[],registerCleanCallback:function(e){var a=t.skin._clean_callbacks;a.indexOf(e)<0&&a.push(e)},unregisterCleanCallback:function(e){var a=t.skin._clean_callbacks,n=a.indexOf(e);n>=0&&a.splice(n,1)},cleanContainer:function(e){for(var a=t.skin._clean_callbacks,n=0;n<a.length;n++)a[n].call(e)},loadURL:function(a,n,s,i){a.startsWith("#")&&(a=a.substr(1)),"function"==typeof s?(i=s,s={}):void 0===s&&(s={}),n=e(n);var r={type:"GET",url:a,dataType:"html",cache:!1,beforeSend:function(){if(s&&s.preLoadCallback&&t.executeFunctionByName(s.preLoadCallback,this,s.preLoadCallbackOptions),t.skin.cleanContainer(n),n.html('<h1 class="loading"><i class="fa fa-cog fa-spin"></i> '+t.i18n.LOADING+" </h1>"),n[0]===e("#content")[0]){t.skin._drawBreadCrumb();var a=e("html head title").data("ams-title-prefix");document.title=(a?a+" > ":"")+e(".breadcrumb LI:last-child").text(),e("html, body").animate({scrollTop:0},"fast")}else n.animate({scrollTop:0},"fast")},success:function(a,r,o){if(i)t.executeFunctionByName(i,this,a,r,o,s);else{var c=t.ajax&&t.ajax.getResponse(o);if(c){var l=c.contentType,d=c.data;switch(e(".loading",n).remove(),l){case"json":t.ajax.handleJSON(d,n);break;case"script":case"xml":break;case"html":case"text":default:n.parents(".hidden").removeClass("hidden"),e(".alert",n.parents(".alerts-container")).remove(),n.css({opacity:"0.0"}).html(a).removeClass("hidden").delay(50).animate({opacity:"1.0"},300),t.initContent&&t.initContent(n),t.form&&t.form.setFocus(n)}s&&s.afterLoadCallback&&t.executeFunctionByName(s.afterLoadCallback,this,s.afterLoadCallbackOptions),t.stats&&t.stats.logPageview()}}},error:function(e,a,i){n.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+t.i18n.ERROR+i+"</h3>"+e.responseText),s&&s.afterErrorCallback&&t.executeFunctionByName(s.afterErrorCallback,this)},async:void 0===s.async||s.async},o=e.extend({},r,s);e.ajax(o)},setLanguage:function(e,a){var n=a.lang;switch(a.handler_type||"json"){case"json":var s=a.method||"setUserLanguage";t.jsonrpc&&t.jsonrpc.post(s,{lang:n},function(){window.location.reload(!0)});break;case"ajax":var i=a.href||"setUserLanguage";t.ajax&&t.ajax.post(i,{lang:n},function(){window.location.reload(!0)})}},logout:function(){window.location=t.loginURL}}}(jQuery,this),function(e,a){a.MyAMS.stats={logPageview:function(e){if(void 0!==a._gaq){var t=a.window.location;a._gaq.push(["_trackPageview",e||t.pathname+t.hash])}},logEvent:function(e,t,n){void 0!==a._gaq&&("object"==typeof e&&(t=e.action,n=e.label,e=e.category),a._gaq.push(["_trackEvent",e,t,n]))}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.initPage=function(){var n=e("body");t.root=n,t.leftPanel=e("#left-panel"),t.shortcuts=e("#shortcuts"),t.plugins.initData(n);var s=e.ajaxSettings.xhr;e.ajaxSetup({beforeSend:function(e,n){if(t.safeMethods.indexOf(n.type)<0&&void 0!==a.Cookies){var s=Cookies.get(t.csrfCookieName);s&&e.setRequestHeader(t.csrfHeaderName,s)}},progress:t.ajax&&t.ajax.progress,progressUpload:t.ajax&&t.ajax.progress,xhr:function(){var e=s();if(e&&"function"==typeof e.addEventListener){var a=this;a&&a.progress&&e.addEventListener("progress",function(e){a.progress(e)},!1)}return e}}),e(document).ajaxStart(t.ajax&&t.ajax.start),e(document).ajaxStop(t.ajax&&t.ajax.stop),e(document).ajaxError(t.error&&t.error.ajax);var i=a.localStorage&&a.localStorage.getItem("window-state");i&&n.addClass(i),t.isMobile?(t.root.addClass("mobile-detected"),t.device="mobile",t.enableFastclick&&t.ajax&&t.ajax.check(e.fn.noClickDelay,t.baseURL+"/ext/jquery-smartclick"+t.devext+".js",function(){e("NAV UL A").noClickDelay(),e("A","#hide-menu").noClickDelay()})):(t.root.addClass("desktop-detected"),t.device="desktop"),e("#show-shortcuts").click(function(e){t.shortcuts.is(":visible")?t.skin&&t.skin._hideShortcutButtons():t.skin&&t.skin._showShortcutButtons(),e.preventDefault()}),t.shortcuts.click(function(e){t.skin&&t.skin._hideShortcutButtons()}),e(document).mouseup(function(e){t.shortcuts.is(e.target)||0!==t.shortcuts.has(e.target).length||t.skin&&t.skin._hideShortcutButtons()}),e("#search-mobile").click(function(){t.root.addClass("search-mobile")}),e("#cancel-search-js").click(function(){t.root.removeClass("search-mobile")}),e(".activity-button","#user-activity").click(function(a){var t=e("#user-activity"),n=e(".ajax-dropdown",t);n.is(":visible")?(n.fadeOut(150),t.removeClass("active")):(n.css("left",-n.innerWidth()+t.innerWidth()).fadeIn(150),t.addClass("active")),a.preventDefault()}),t.skin&&t.skin.checkNotification(),e(document).mouseup(function(a){var t=e(".ajax-dropdown");t.is(a.target)||0!==t.has(a.target).length||t.fadeOut(150).prev().removeClass("active")}),e('input[name="activity"]').change(function(a){var n=e(this).data("ams-url");if(n){a.preventDefault(),a.stopPropagation();var s=t.getFunctionByName(n);if("function"==typeof s&&(n=s.call(this)),"function"==typeof n)n.call(this);else{var i=e(".ajax-notifications");t.skin&&t.skin.loadURL(n,i)}}}),e("a","#user-menu LI.logout").click(function(a){a.preventDefault(),a.stopPropagation(),t.loginURL=e(this).attr("href"),t.skin&&t.skin.bigBox({title:"<i class='fa fa-sign-out txt-color-orangeDark'></i> "+t.i18n.LOGOUT+" <span class='txt-color-orangeDark'><strong>"+e("#show-shortcut").text()+"</strong></span> ?",content:t.i18n.LOGOUT_COMMENT,buttons:t.i18n.BTN_YES_NO},function(e){e===t.i18n.BTN_YES&&(t.root.addClass("animated fadeOutUp"),setTimeout(t.skin.logout,1e3))})});var r=e("nav");e("UL",r).myams_menu({accordion:!1!==r.data("ams-menu-accordion"),speed:t.menuSpeed}),e("#hide-menu").find(">:first-child >A").click(function(e){n.toggleClass("hidden-menu"),a.localStorage&&(n.hasClass("hidden-menu")?a.localStorage.setItem("window-state","hidden-menu"):a.localStorage.setItem("window-state","")),e.preventDefault()}),e(".minifyme").click(function(t){n.toggleClass("minified"),a.localStorage&&(n.hasClass("minified")?a.localStorage.setItem("window-state","minified"):a.localStorage.setItem("window-state","")),e(this).effect("highlight",{},500),t.preventDefault()}),e("#refresh").click(function(e){t.skin&&t.skin.bigBox({title:"<i class='fa fa-refresh' style='color: green'></i> "+t.i18n.CLEAR_STORAGE_TITLE,content:t.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+t.i18n.BTN_CANCEL+"]["+t.i18n.BTN_OK+"]"},function(e){e===t.i18n.BTN_OK&&localStorage&&(localStorage.clear(),location.reload())}),e.preventDefault()}),n.on("click",function(a){var t=e(this);t.is(a.target)||0!==t.has(a.target).length||0!==e(".popover").has(a.target).length||t.popover("hide")}),t.ajax&&t.ajax.check(e.resize,t.baseURL+"ext/jquery-resize"+t.devext+".js",function(){e("#main").resize(function(){t.skin._setPageHeight(),t.skin._checkMobileWidth()}),r.resize(function(){t.skin._setPageHeight()})}),t.ajaxNav&&(e(document).on("click",'a[href="#"]',function(e){e.preventDefault()}),e(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(a){var n=e(a.currentTarget),s=n.data("ams-disabled-handlers");if(!0!==s&&"click"!==s&&"all"!==s){var i=n.attr("href")||n.data("ams-url");if(i&&!i.startsWith("javascript")&&!n.attr("target")&&!0!==n.data("ams-context-menu")){a.preventDefault(),a.stopPropagation();var r,o,c;i.indexOf("?")>=0?(o=(r=i.split("?"))[0],c=r[1].unserialize()):(o=i,c=void 0);var l=t.getFunctionByName(o);if("function"==typeof l&&(i=l.call(n,c)),"function"==typeof i)i.call(n,c);else if(i=i.replace(/\%23/,"#"),a.ctrlKey)window.open(i);else{var d=n.data("ams-target");d?"_blank"===d?window.open(i):t.form&&t.form.confirmChangedForm(d,function(){t.skin&&t.skin.loadURL(i,d,n.data("ams-link-options"),n.data("ams-link-callback"))}):t.form&&t.form.confirmChangedForm(function(){i.startsWith("#")?i!==location.hash&&(t.root.hasClass("mobile-view-activated")?(t.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=i},50)):window.location.hash=i):window.location=i})}}}}),e(document).on("click",'a[target="_blank"]',function(a){a.preventDefault();var n=e(a.currentTarget);window.open(n.attr("href")),t.stats&&t.stats.logEvent(n.data("ams-stats-category")||"Navigation",n.data("ams-stats-action")||"External",n.data("ams-stats-label")||n.attr("href"))}),e(document).on("click",'a[target="_top"]',function(a){a.preventDefault(),t.form&&t.form.confirmChangedForm(function(){window.location=e(a.currentTarget).attr("href")})}),e(window).on("hashchange",t.skin&&t.skin.checkURL)),e(document).off("click.modal").on("click",'[data-toggle="modal"]',function(a){var n=e(this),s=n.data("ams-disabled-handlers");!0!==s&&"click"!==s&&"all"!==s&&!0!==n.data("ams-context-menu")&&(!0===n.data("ams-stop-propagation")&&a.stopPropagation(),a.preventDefault(),t.dialog&&t.dialog.open(n),n.parents("#shortcut").exists()&&setTimeout(t.skin._hideShortcutButtons,300))}),e(document).on("click",'button[type="submit"], button.submit',function(){var a=e(this);e(a.get(0).form).data("ams-submit-button",a)}),t.initHandlers(document),e(document).on("keydown","textarea",function(a){10!==a.keyCode&&13!==a.keyCode||!a.ctrlKey&&!a.metaKey||e(this).closest("form").submit()}),e(document).on("change",'input[type="file"]',function(a){a.preventDefault();var t=e(this),n=t.parent(".button");n.exists()&&n.parent().hasClass("input-file")&&n.next('input[type="text"]').val(t.val())}),e(document).on("focus",'input[readonly="readonly"]',function(){e(this).blur()}),e(document).on("focusin",function(a){e(a.target).closest(".mce-window").length&&a.stopImmediatePropagation()}),e(document).on("click",".nav-tabs a[data-toggle=tab]",function(a){if(e(this).parent("li").hasClass("disabled"))return a.preventDefault(),!1}),e(document).on("show.bs.dropdown",".btn-group",function(){var a=e(this),t=a.children(".dropdown-menu"),n=a.get(0).getBoundingClientRect(),s=n.top,i=n.height,r=t.outerHeight();s>r&&e(window).height()-s<i+r&&a.addClass("dropup")}).on("hidden.bs.dropdown",".btn-group",function(){e(this).removeClass("dropup")}),e(document).on("show.bs.tab",function(a){var n=e(a.target);n.exists()&&"A"!==n.get(0).tagName&&(n=e("a[href]",n));var s=n.data();if(s&&s.amsUrl){if(s.amsTabLoaded)return;n.append('<i class="fa fa-spin fa-cog margin-left-5"></i>'),t.skin&&t.skin.loadURL(s.amsUrl,n.attr("href"),{afterLoadCallback:function(){s.amsTabLoadOnce&&n.data("ams-tab-loaded",!0),e("i",n).remove()},afterErrorCallback:function(){e("i",n).remove()}})}}),e(document).on("hide.bs.modal",function(a){var n=e(a.target);t.form&&t.form.confirmChangedForm(n,function(){var e=n.data("modal")||n.data("bs.modal");return e&&(e.isShown=!0),!0},function(){return a.preventDefault(),!1})}),e(document).on("myams.refresh",function(e,a){t.executeFunctionByName(a.handler||t.skin&&t.skin.refreshContent,e.target,a)}),t.initContent(document),t.ajaxNav&&r.exists()&&t.skin&&t.skin.checkURL(),t.form&&t.form.setFocus(document),e(window).on("beforeunload",t.form&&t.form.checkBeforeUnload)},t.initContent=function(a){e(".tipsy").remove(),e("[rel=tooltip]",a).tooltip(),e("[rel=popover]",a).popover(),e("[rel=popover-hover]",a).popover({trigger:"hover"}),t.plugins&&t.plugins.init(a),t.callbacks&&t.callbacks.init(a),t.events&&t.events.init(a),t.form&&t.form.init(a),"desktop"===t.device?t.skin&&t.skin._initDesktopWidgets(a):t.skin&&t.skin._initMobileWidgets(a),t.skin&&t.skin._setPageHeight()},e(document).ready(function(){var a=(e=jQuery.noConflict())("HTML");a.removeClass("no-js").addClass("js");var n=a.attr("lang")||a.attr("xml:lang");n&&!n.startsWith("en")?(t.lang=n,t.getScript(t.baseURL+"i18n/myams_"+n.substr(0,2)+t.devext+".js",function(){t.initPage()})):t.initPage()})}(jQuery,this);
+"use strict";!function(e,a){var t=a.console;String.prototype.startsWith=function(e){var a=this.length,t=e.length;return!(a<t)&&this.substr(0,t)===e},String.prototype.endsWith=function(e){var a=this.length,t=e.length;return!(a<t)&&this.substr(a-t)===e},String.prototype.unserialize=function(e){for(var a=decodeURIComponent(this).split("&"),t={},n=0;n<a.length;n++){var s=a[n].split("=",2);t[s[0]]=s[1]}return t},Array.prototype.indexOf||(Array.prototype.indexOf=function(e,a){var t=this.length;for((a=(a=Number(a)||0)<0?Math.ceil(a):Math.floor(a))<0&&(a+=t);a<t;a++)if(a in this&&this[a]===e)return a;return-1}),e.expr[":"].hasvalue=function(a,t,n){return""!==e(a).val()},e.expr[":"].econtains=function(a,t,n){return(a.textContent||a.innerText||e(a).text()||"").toLowerCase()===n[3].toLowerCase()},e.expr[":"].withtext=function(a,t,n){return(a.textContent||a.innerText||e(a).text()||"")===n[3]},e.expr[":"].parents=function(a,t,n){return e(a).parents(n[3]).length>0},void 0===e.scrollbarWidth&&(e.scrollbarWidth=function(){var a=e('<div style="width: 50px; height: 50px; overflow: auto"><div/></div>').appendTo("body"),t=a.children(),n=t.innerWidth()-t.height(99).innerWidth();return a.remove(),n}),e.fn.extend({exists:function(){return e(this).length>0},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(a){var t=[];return this.each(function(){t.push(e(this).attr(a))}),t},style:function(e,a,t){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==e?void 0!==a?(t=void 0!==t?t:"",n.setProperty(e,a,t),this):n.getPropertyValue(e):n}},removeClassPrefix:function(a){return this.each(function(t,n){var s=n.className.split(" ").map(function(e){return e.startsWith(a)?"":e});n.className=e.trim(s.join(" "))}),this}}),void 0===a.MyAMS&&(a.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var n=a.MyAMS,s=n;n.baseURL=function(){var a=e('script[src*="/myams.js"], script[src*="/myams.min.js"], script[src*="/myams-core.js"], script[src*="/myams-core.min.js"], script[src*="/myams-require.js"], script[src*="/myams-require.min.js"]').attr("src");return s.devmode=a.indexOf(".min.js")<0,s.devext=s.devmode?"":".min",a.substring(0,a.lastIndexOf("/")+1)}(),n.log=function(){t&&t.debug&&t.debug(this,arguments)},n.getQueryVar=function(e,a){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var t=new RegExp(".*?[&\\?]"+a+"=(.*?)&.*"),n=e.replace(t,"$1");return n!==e&&n},n.rgb2hex=function(a){return"#"+e.map(a.match(/\b(\d+)\b/g),function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},n.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},n.generateUUID=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===a?t:3&t|8).toString(16)})},n.getObject=function(e,a){if(e){if("string"!=typeof e)return e;var t=e.split(".");a=void 0===a||null===a?window:a;for(var n=0;n<t.length;n++)try{a=a[t[n]]}catch(e){return}return a}},n.getFunctionByName=function(e,a){if(void 0!==e){if("function"==typeof e)return e;var t=e.split("."),n=t.pop();a=void 0===a||null===a?window:a;for(var s=0;s<t.length;s++)try{a=a[t[s]]}catch(e){return}try{return a[n]}catch(e){return}}},n.executeFunctionByName=function(e,a){var t=s.getFunctionByName(e,window);if("function"==typeof t){var n=Array.prototype.slice.call(arguments,2);return t.apply(a,n)}},n.isInDOM=function(t){return!!(t=e(t)).exists()&&a.document.body.contains(t[0])},n.getSource=function(e){return e.replace(/{[^{}]*}/g,function(e){return s.getFunctionByName(e.substr(1,e.length-2))})},n.getScript=function(a,t,n,i){"object"==typeof t&&(i=n,n=t,t=null),void 0===n&&(n={});var r={dataType:"script",url:s.getSource(a),success:t,error:i||s.error.show,cache:!s.devmode,async:void 0===n.async?"function"==typeof t:n.async},o=e.extend({},r,n);return e.ajax(o)},n.getCSS=function(a,t,n,i){n&&(n=s.getFunctionByName(n));var r=e("HEAD"),o=e('style[data-ams-id="'+t+'"]',r);if(0===o.length){if(o=e("<style>").attr("data-ams-id",t).text('@import "'+s.getSource(a)+'";'),n)var c=setInterval(function(){try{o[0].sheet.cssRules;n.call(window,!0,i),clearInterval(c)}catch(e){}},10);o.appendTo(r)}else n&&n.call(window,!1,i)},n.initHandlers=function(a){e(a).on("click","[data-ams-click-handler]",function(a){var t=e(this),n=t.data("ams-disabled-handlers");if(!0!==n&&"click"!==n&&"all"!==n){var i=t.data();if(i.amsClickHandler){!0!==i.amsStopPropagation&&!0!==i.amsClickStopPropagation||a.stopPropagation(),!0!==i.amsClickKeepDefault&&a.preventDefault();for(var r=i.amsClickHandler.split(/\s+/),o=0;o<r.length;o++){var c=s.getFunctionByName(r[o]);void 0!==c&&c.call(t,a,i.amsClickHandlerOptions)}}}}),e(a).on("change","[data-ams-change-handler]",function(a){var t=e(this);if(!t.prop("readonly")){var n=t.data("ams-disabled-handlers");if(!0!==n&&"change"!==n&&"all"!==n){var i=t.data();if(i.amsChangeHandler){!0!==i.amsStopPropagation&&!0!==i.amsChangeStopPropagation||a.stopPropagation(),!0!==i.amsChangeKeepDefault&&a.preventDefault();for(var r=i.amsChangeHandler.split(/\s+/),o=0;o<r.length;o++){var c=s.getFunctionByName(r[o]);void 0!==c&&c.call(t,a,i.amsChangeHandlerOptions)}}}}}),e(a).on("reset","form",function(a){var t=e(this);setTimeout(function(){e(".alert-danger, SPAN.state-error",t).not(".persistent").remove(),e("LABEL.state-error",t).removeClass("state-error"),e('INPUT.select2[type="hidden"]',t).each(function(){var a=e(this),t=a.data("select2"),n=a.data("ams-select2-input-value");n&&a.select2("val",n.split(t.opts.separator))}),t.find(".select2").trigger("change"),e("[data-ams-reset-callback]",t).each(function(){var a=e(this),n=a.data(),i=s.getFunctionByName(n.amsResetCallback);void 0!==i&&i.call(t,a,n.amsResetCallbackOptions)})},10),s.form&&s.form.setFocus(t)}),e(a).on("reset","[data-ams-reset-handler]",function(a){var t=e(this),n=t.data();if(n.amsResetHandler){!0!==n.amsResetKeepDefault&&a.preventDefault();var i=s.getFunctionByName(n.amsResetHandler);void 0!==i&&i.call(t,n.amsResetHandlerOptions)}}),e(a).on("click","[data-ams-click-event]",function(a){var t=e(this);e(a.target).trigger(t.data("ams-click-event"),t.data("ams-click-event-options"))}),e(a).on("click",'input[type="checkbox"][readonly]',function(){return!1})}}(jQuery,this),function(e,a){a.MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",LOADING:"Loading...",PROGRESS:"Processing",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",CLIPBOARD_COPY:"Copy to clipboard with Ctrl+C, and Enter",CLIPBOARD_CHARACTER_COPY_OK:"Character copied to clipboard",CLIPBOARD_TEXT_COPY_OK:"Text copied to clipboard",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"}}(jQuery,this),jQuery.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");for(var a="",t=0;t<e.length;t++){var n=e.charCodeAt(t);n<128?a+=String.fromCharCode(n):n>127&&n<2048?(a+=String.fromCharCode(n>>6|192),a+=String.fromCharCode(63&n|128)):(a+=String.fromCharCode(n>>12|224),a+=String.fromCharCode(n>>6&63|128),a+=String.fromCharCode(63&n|128))}return a},decode:function(e){for(var a="",t=0,n=0,s=0,i=0;t<e.length;)(n=e.charCodeAt(t))<128?(a+=String.fromCharCode(n),t++):n>191&&n<224?(s=e.charCodeAt(t+1),a+=String.fromCharCode((31&n)<<6|63&s),t+=2):(s=e.charCodeAt(t+1),i=e.charCodeAt(t+2),a+=String.fromCharCode((15&n)<<12|(63&s)<<6|63&i),t+=3);return a}},function(e,a){var t=a.MyAMS;e.fn.extend({contextMenu:function(a){function n(t,n,s){var i=e(window)[n](),r=e(a.menuSelector)[n](),o=t;return t+r>i&&r<t&&(o-=r),o}return this.each(function(){e("a",e(a.menuSelector)).each(function(){e(this).data("ams-context-menu",!0)}),e(this).on("contextmenu",function(s){if(!s.ctrlKey)return e(a.menuSelector).data("invokedOn",e(s.target)).show().css({position:"fixed",left:n(s.clientX,"width")-10,top:n(s.clientY,"height")-10}).off("click").on("click",function(n){e(this).hide();var s=e(this).data("invokedOn"),i=e(n.target);a.menuSelected.call(this,s,i),t.event&&t.event.stop(n)}),!1}),e(document).click(function(){e(a.menuSelector).hide()})})},myams_menu:function(a){var t=e.extend({},{accordion:!0,speed:200,closedSign:'<em class="fa fa-angle-down"></em>',openedSign:'<em class="fa fa-angle-up"></em>'},a),n=e(this);n.find("LI").each(function(){var a=e(this);if(a.find("UL").size()>0){a.find("A:first").append("<b class='collapse-sign'>"+t.closedSign+"</b>");var n=a.find("A:first");"#"===n.attr("href")&&n.click(function(){return!1})}}),n.find("LI.active").each(function(){var a=e(this).parents("UL"),n=a.parent("LI");a.slideDown(t.speed),n.find("b:first").html(t.openedSign),n.addClass("open")}),n.find("LI A").on("click",function(){var a=e(this);if(!a.hasClass("active")){var s=a.attr("href").replace(/^#/,""),i=a.parent().find("UL");if(t.accordion){var r=a.parent().parents("UL"),o=n.find("UL:visible");o.each(function(a){var n=!0;if(r.each(function(e){if(r[e]===o[a])return n=!1,!1}),n&&i!==o[a]){var c=e(o[a]);!s&&c.hasClass("active")||c.slideUp(t.speed,function(){e(this).parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}var c=a.parent().find("UL:first");s||!c.is(":visible")||c.hasClass("active")?c.slideDown(t.speed,function(){a.parent("LI").addClass("open").find("B:first").delay(t.speed).html(t.openedSign)}):c.slideUp(t.speed,function(){a.parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}})}(jQuery,this),function(e,a){a.MyAMS.event={stop:function(e){e||(e=window.event),e&&"string"!=typeof e&&(e.stopPropagation?(e.stopPropagation(),e.preventDefault()):(e.cancelBubble=!0,e.returnValue=!1))}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.browser={getInternetExplorerVersion:function(){var e=-1;if("Microsoft Internet Explorer"===navigator.appName){var a=navigator.userAgent;null!==new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(a)&&(e=parseFloat(RegExp.$1))}return e},checkVersion:function(){var e="You're not using Windows Internet Explorer.",t=this.getInternetExplorerVersion();t>-1&&(e=t>=8?"You're using a recent copy of Windows Internet Explorer.":"You should upgrade your copy of Windows Internet Explorer."),a.alert&&a.alert(e)},isIE8orlower:function(){var e="0",a=this.getInternetExplorerVersion();return a>-1&&(e=a>=9?0:1),e},copyToClipboard:function(n){function s(n){var s=!1;if(window.clipboardData&&window.clipboardData.setData)s=clipboardData.setData("Text",n);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var i=e("<textarea>");i.val(n),i.css("position","fixed"),i.appendTo(e("body")),i.get(0).select();try{document.execCommand("copy"),s=!0}catch(e){console&&console.warn&&console.warn("Copy to clipboard failed.",e)}finally{i.remove()}}s?t.skin&&t.skin.smallBox("success",{title:n.length>1?t.i18n.CLIPBOARD_TEXT_COPY_OK:t.i18n.CLIPBOARD_CHARACTER_COPY_OK,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}):a.prompt&&a.prompt(t.i18n.CLIPBOARD_COPY,n)}if(void 0===n)return function(){var a=e(this),t=a.text();a.parents(".btn-group").removeClass("open"),s(t)};s(n)}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.error={ajax:function(e,a,n,s){if(!("abort"===s||a&&a.statusText&&"OK"===a.statusText.toUpperCase()))if(a=t.ajax&&t.ajax.getResponse(a)){if("json"===a.contentType)t.ajax.handleJSON(a.data);else{var i=s||e.statusText||e.type,r=a.responseText;t.skin&&t.skin.messageBox("error",{title:t.i18n.ERROR_OCCURED,content:"<h4>"+i+"</h4><p>"+(r||"")+"</p>",icon:"fa fa-warning animated shake",timeout:1e4})}console&&(console.error&&console.error(e),console.debug&&console.debug(a))}else console.error&&console.error("Missing MyAMS AJAX module!")},show:function(e,a,n){if(n){var s=t.ajax&&t.ajax.getResponse(e);s?("json"===s.contentType?t.ajax.handleJSON(s.data):t.skin.messageBox("error",{title:t.i18n.ERRORS_OCCURED,content:"<h4>"+a+"</h4><p>"+n+"</p>",icon:"fa fa-warning animated shake",timeout:1e4}),console&&(console.error&&console.error(n),console.debug&&console.debug(e))):console.error&&console.error("Missing MyAMS AJAX module!")}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.ajax={check:function(a,n,s,i){function r(e,a){if(void 0!==s){s instanceof Array||(s=[s]);for(var n=0;n<s.length;n++){var i=t.getFunctionByName(s[n]);"function"==typeof i&&i(e,a)}}}s instanceof Array||"object"==typeof s&&(i=s,s=void 0);var o,c={async:"function"==typeof s},l=e.extend({},c,i),d=[];if(a instanceof Array){for(o=0;o<a.length;o++)void 0===a[o]&&d.push(t.getScript(n[o],{async:!0}));d.length>0?e.when.apply(e,d).then(function(){r(!0,i)}):r(!1,i)}else if(void 0===a)if(n instanceof Array){for(o=0;o<n.length;o++)d.push(t.getScript(n[o],{async:!0}));d.length>0?e.when.apply(e,d).then(function(){r(!0,i)}):r(!1,i)}else"string"==typeof n&&t.getScript(n,function(){r(!0,i)},l);else r(!1,i)},getAddr:function(a){var t=a||e("HTML HEAD BASE").attr("href")||window.location.href;return t.substr(0,t.lastIndexOf("/")+1)},start:function(){e("#ajax-gear").show()},stop:function(){e("#ajax-gear").hide()},progress:function(e){e.lengthComputable&&(e.loaded>=e.total||console&&console.log&&console.log(parseInt(e.loaded/e.total*100,10)+"%"))},getJSON:function(){return function(e){var a=e.url;delete e.url,t.ajax.post(a,e,function(e,a,n){t.ajax.handleJSON(e)})}},post:function(n,s,i,r){var o;o=n.startsWith(window.location.protocol)?n:this.getAddr()+n,"function"==typeof i?(r=i,i={}):i||(i={}),void 0===r&&(r=i.callback),"string"==typeof r&&(r=t.getFunctionByName(r)),delete i.callback;var c,l={url:o,type:"post",cache:!1,async:"function"==typeof r,data:e.param(s),dataType:"json",beforeSend:function(e,n){if(void 0!==a.Cookies){var s=Cookies.get(t.csrfCookieName);s&&e.setRequestHeader(t.csrfHeaderName,s)}},success:r||function(e){c=e.result}},d=e.extend({},l,i);return e.ajax(d),c},getResponse:function(e){var a,n,s=e.getResponseHeader("content-type");if(s)if(s.startsWith("application/javascript"))a="script",n=e.responseText;else if(s.startsWith("text/html"))a="html",n=e.responseText;else if(s.startsWith("text/xml"))a="xml",n=e.responseText;else if(n=e.responseJSON)a="json";else try{n=JSON.parse(e.responseText),a="json"}catch(t){n=e.responseText,a="text"}else a="json",n={status:"alert",alert:{title:t.i18n.ERROR_OCCURED,content:t.i18n.NO_SERVER_RESPONSE}};return{contentType:a,data:n}},handleJSON:function(n,s,i){var r,o=n.status;switch(o){case"alert":a.alert&&a.alert(n.alert.title+"\n\n"+n.alert.content);break;case"error":t.form&&t.form.showErrors(s,n);break;case"info":case"success":void 0!==s&&(t.form&&t.form.resetChanged(s),!1!==n.close_form&&t.dialog&&t.dialog.close(s));break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":void 0!==s&&(t.form&&t.form.resetChanged(s),!1!==n.close_form&&t.dialog&&t.dialog.close(s));break;case"modal":t.dialog&&t.dialog.open(n.location);break;case"reload":void 0!==s&&(t.form&&t.form.resetChanged(s),!1!==n.close_form&&t.dialog&&t.dialog.close(s)),(r=n.location||window.location.hash).startsWith("#")&&(r=r.substr(1));var c=e(n.target||i||"#content");t.skin&&t.skin.loadURL(r,c,{preLoadCallback:t.getFunctionByName(n.pre_reload)||function(){e("[data-ams-pre-reload]",c).each(function(){t.executeFunctionByName(e(this).data("ams-pre-reload"))})},preLoadCallbackOptions:n.pre_reload_options,afterLoadCallback:t.getFunctionByName(n.post_reload)||function(){e("[data-ams-post-reload]",c).each(function(){t.executeFunctionByName(e(this).data("ams-post-reload"))})},afterLoadCallbackOptions:n.post_reload_options});break;case"redirect":void 0!==s&&(t.form&&t.form.resetChanged(s),!0===n.close_form&&t.dialog&&t.dialog.close(s)),(r=n.location||window.location.href).endsWith("##")&&(r=r.replace(/##/,window.location.hash)),n.window?window.open(r,n.window,n.options):window.location.href===r?window.location.reload(!0):window.location.href=r;break;default:console&&console.log&&console.log("Unhandled status: "+o)}var l,d,m;if(n.content&&(d=n.content,m=e(d.target||i||s||"#content"),!0===d.raw?m.text(d.text):(m.html(d.html),t.initContent&&t.initContent(m)),d.keep_hidden||m.removeClass("hidden")),n.contents){var u=n.contents;for(l=0;l<u.length;l++)d=u[l],m=e(d.target),!0===d.raw?m.text(d.text):(m.html(d.html),t.initContent&&t.initContent(m)),d.keep_hidden||m.removeClass("hidden")}var f;if(n.message&&("string"==typeof(f=n.message)?"info"===o||"success"===o?t.skin&&t.skin.smallBox(o,{title:f,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}):t.skin&&t.skin.alert(e(s||"#content"),o,f):t.skin&&t.skin.alert(e(f.target||i||s||"#content"),f.status||"success",f.header,f.body,f.subtitle)),n.smallbox&&("string"==typeof(f=n.smallbox)?t.skin&&t.skin.smallBox(n.smallbox_status||o,{title:n.smallbox,icon:n.smallbox_icon||"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:n.smallbox_timeout||3e3}):t.skin&&t.skin.smallBox(f.status||o,{title:f.message,icon:f.icon||"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:f.timeout||3e3})),n.messagebox)if("string"==typeof(f=n.messagebox))t.skin&&t.skin.messageBox("info",{title:t.i18n.ERROR_OCCURED,content:f,timeout:1e4});else{var h=f.status||"info";"error"===h&&s&&i&&t.executeFunctionByName(s.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",s,i),t.skin&&t.skin.messageBox(h,{title:f.title||t.i18n.ERROR_OCCURED,content:f.content,icon:f.icon,number:f.number,timeout:null===f.timeout?void 0:f.timeout||1e4})}if(n.event&&s.trigger(n.event,n.event_options),n.events){var p;for(void 0===s&&(s=e(document)),l=0;l<n.events.length;l++)null!==(p=n.events[l])&&("string"==typeof p?s.trigger(p,n.events_options):s.trigger(p.event,p.options))}if(n.callback&&t.executeFunctionByName(n.callback,s,n.options),n.callbacks){var g;for(l=0;l<n.callbacks.length;l++)"function"==typeof(g=n.callbacks[l])?t.executeFunctionByName(g,s,g.options):t.executeFunctionByName(g.callback,s,g.options)}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.jsonrpc={getAddr:function(a){var t=(a||e("HTML HEAD BASE").attr("href")||window.location.href).replace(/\+\+skin\+\+\w+\//,"");return t.substr(0,t.lastIndexOf("/")+1)},query:function(a,n,s,i){t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){"function"==typeof s?(i=s,s={}):s||(s={}),"undefined"===i&&(i=s.callback),"string"==typeof i&&(i=t.getFunctionByName(i)),delete s.callback;var r={};"string"==typeof a?r.query=a:"object"==typeof a&&e.extend(r,a),e.extend(r,s);var o,c={id:(new Date).getTime(),params:r,success:i||function(e){o=e},error:t.error&&t.error.show},l=e.extend({},c,s);return e.jsonRPC.withOptions({endPoint:t.jsonrpc.getAddr(s.url),namespace:s.namespace,cache:!1},function(){e.jsonRPC.request(n,l)}),o})},post:function(a,n,s,i){t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){"function"==typeof s?(i=s,s={}):s||(s={}),void 0===i&&(i=s.callback),"string"==typeof i&&(i=t.getFunctionByName(i)),delete s.callback;var r,o={id:(new Date).getTime(),params:n,success:i||function(e){r=e},error:t.error&&t.error.show},c=e.extend({},o,s);return e.jsonRPC.withOptions({endPoint:t.jsonrpc.getAddr(s.url),namespace:s.namespace,cache:!1},function(){e.jsonRPC.request(a,c)}),r})}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.xmlrpc={getAddr:function(a){var t=(a||e("HTML HEAD BASE").attr("href")||window.location.href).replace(/\+\+skin\+\+\w+\//,"");return t.substr(0,t.lastIndexOf("/")+1)},post:function(a,n,s,i,r){t.ajax&&t.ajax.check(e.xmlrpc,t.baseURL+"ext/jquery-xmlrpc"+t.devext+".js",function(){"function"==typeof i?(r=i,i={}):i||(i={}),void 0===r&&(r=i.callback),"string"==typeof r&&(r=t.getFunctionByName(r)),delete i.callback;var o,c={url:t.xmlrpc.getAddr(a),methodName:n,params:s,success:r||function(e){o=e},error:t.error&&t.error.show},l=e.extend({},c,i);return e.xmlrpc(l),o})}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.form={init:function(a){e("FORM",a).each(function(){var a=e(this);e('INPUT.select2[type="hidden"]',a).each(function(){var a=e(this);a.data("ams-select2-input-value",a.val())})});(t.warnOnFormChange?e('FORM[data-ams-warn-on-change!="false"]',a):e('FORM[data-ams-warn-on-change="true"]',a)).each(function(){var a=e(this);e('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',a).each(function(){var a=e(this);if(!0!==a.data("ams-ignore-change")){var n=a.data("ams-changed-event")||"change";a.on(n,function(){t.form.setChanged(e(this).parents("FORM"))})}}),a.on("reset",function(){t.form.resetChanged(e(this))})})},setFocus:function(a){var t=e("[data-ams-focus-target]",a).first();t.exists()||(t=e("input, select",a).first()),t.exists()&&(t.hasClass("select2-input")&&(t=t.parents(".select2")),t.hasClass("select2")?setTimeout(function(){t.select2("focus"),!0===t.data("ams-focus-open")&&t.select2("open")},100):t.focus())},checkBeforeUnload:function(){if(e('FORM[data-ams-form-changed="true"]').exists())return t.i18n.FORM_CHANGED_WARNING},confirmChangedForm:function(n,s,i){"function"==typeof n&&(s=n,n=void 0),e('FORM[data-ams-form-changed="true"]',n).exists()?i?a.confirm(t.i18n.FORM_CHANGED_WARNING,t.i18n.WARNING)?s.call(n):i.call(n):t.skin&&t.skin.bigBox({title:t.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i>&nbsp; '+t.i18n.FORM_CHANGED_WARNING,buttons:t.i18n.BTN_OK_CANCEL},function(e){e===t.i18n.BTN_OK&&s.call(n)}):s.call(n)},setChanged:function(e){e.attr("data-ams-form-changed",!0)},resetChanged:function(a){void 0!==a&&e(a).removeAttr("data-ams-form-changed")},submit:function(n,s,i){if(!(n=e(n)).exists())return!1;if("object"==typeof s&&(i=s,s=void 0),n.data("submitted"))return n.data("ams-form-hide-submitted")||t.skin&&t.skin.messageBox("warning",{title:t.i18n.WAIT,content:t.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:n.data("ams-form-alert-timeout")||5e3}),!1;if(t.form&&!t.form._checkSubmitValidators(n))return!1;e(".alert-danger, SPAN.state-error",n).not(".persistent").remove(),e(".state-error",n).removeClassPrefix("state-");var r=e(n.data("ams-submit-button"));return r&&!r.data("ams-form-hide-loading")&&(r.data("ams-progress-content",r.html()),r.button("loading")),t.ajax&&t.ajax.check(e.fn.ajaxSubmit,t.baseURL+"ext/jquery-form-3.49"+t.devext+".js",function(){function r(n,r){var o,c,l,d,m,u,f,h,p,g=n.data(),b=g.amsFormOptions;if(i&&(m=i.formDataInitCallback),m?delete i.formDataInitCallback:m=g.amsFormDataInitCallback,m){var v={};if(d=t.executeFunctionByName(m,n,v),v.veto)return(o=n.data("ams-submit-button"))&&o.button("reset"),t.form.finalizeSubmitFooter.call(n),!1}else d=g.amsFormData||{};(o=e(n.data("ams-submit-button")))&&o.exists()?l=(c=o.data()).amsFormSubmitTarget:c={};var x,y=s||c.amsFormHandler||g.amsFormHandler||"";if(y.startsWith(window.location.protocol))x=y;else{var k=c.amsFormAction||n.attr("action").replace(/#/,"");x=k.startsWith(window.location.protocol)?k:t.ajax&&t.ajax.getAddr()+k,x+=y}u=c.amsProgressHandler||g.amsProgressHandler||"",f=c.amsProgressInterval||g.amsProgressInterval||1e3,h=c.amsProgressCallback||g.amsProgressCallback,p=c.amsProgressEndCallback||g.amsProgressEndCallback;var C=null;i&&i.initSubmitTarget?t.executeFunctionByName(i.initSubmitTarget,n):g.amsFormInitSubmitTarget?(C=e(l||g.amsFormSubmitTarget||"#content"),t.executeFunctionByName(g.amsFormInitSubmit||"MyAMS.form.initSubmit",n,C)):g.amsFormHideSubmitFooter||t.executeFunctionByName(g.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",n),i&&(d=e.extend({},d,i.form_data));var S;u?d.progress_id=t.generateUUID():(S=void 0!==r.uuid)&&(x.indexOf("X-Progress-ID")<0&&(x+="?X-Progress-ID="+r.uuid),delete r.uuid);var w={url:x,type:"post",cache:!1,data:d,dataType:g.amsFormDatatype,beforeSerialize:function(){void 0!==a.tinyMCE&&a.tinyMCE.triggerSave()},beforeSubmit:function(e,a){a.data("submitted",!0)},error:function(e,a,n,s){C&&t.executeFunctionByName(g.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",s,C),t.form.resetAfterSubmit(s)},iframe:S},j=i&&i.downloadTarget||g.amsFormDownloadTarget;if(j){var T=e('iframe[name="'+j+'"]');T.exists()||(T=e("<iframe></iframe>").hide().attr("name",j).appendTo(e("body"))),w=e.extend({},w,{iframe:!0,iframeTarget:T,success:function(a,n,s,i){if(e(i).parents(".modal-dialog").exists())t.dialog&&t.dialog.close(i);else{var r,o=i.data("ams-submit-button");o&&(r=o.data("ams-form-submit-callback")),r||(r=t.getFunctionByName(g.amsFormSubmitCallback)||t.form._submitCallback);try{r.call(i,a,n,s,i)}finally{t.form.resetAfterSubmit(i),t.form.resetChanged(i)}}}})}else w=e.extend({},w,{error:function(e,a,n,s){C&&t.executeFunctionByName(g.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",s,C),t.form.resetAfterSubmit(s)},success:function(e,a,n,s){var i,r=s.data("ams-submit-button");r&&(i=r.data("ams-form-submit-callback")),i||(i=t.getFunctionByName(g.amsFormSubmitCallback)||t.form._submitCallback);try{i.call(s,e,a,n,s)}finally{t.form.resetAfterSubmit(s),t.form.resetChanged(s)}},iframe:S});var N=e.extend({},w,r,b,i);if(u&&function(e,a){function s(){clearTimeout(r),t.form.resetAfterSubmit(n,o),o.html(o.data("ams-progress-content")),t.executeFunctionByName(p,n,o),t.form.resetChanged(n)}function i(){t.ajax&&t.ajax.post(e,{progress_id:a},{error:s},t.getFunctionByName(h)||function(e,a){if("success"===a)if("running"===e.status){if(e.message)o.text(e.message);else{var n=o.data("ams-progress-text")||t.i18n.PROGRESS;e.current?n+=": "+e.current+"/ "+(e.length||100):n+="...",o.text(n)}r=setTimeout(i,f)}else"finished"===e.status&&s();else s()})}var r;o.button("loading"),r=setTimeout(i,f)}(u,d.progress_id),e(n).ajaxSubmit(N),j){var F=e(n).parents(".modal-dialog"),R=F.exists()&&o.exists()&&o.data("ams-keep-modal");F.exists()&&!0!==R?t.dialog&&t.dialog.close(n):u||setTimeout(function(){t.form.resetAfterSubmit(n,o),t.form.resetChanged(n)},o.data("ams-form-reset-timeout")||2e3)}}if(!0!==n.data("ams-form-ignore-uploads")&&e('INPUT[type="file"]',n).length>0){t.ajax&&t.ajax.check(e.progressBar,t.baseURL+"ext/jquery-progressbar"+t.devext+".js");var o=e.extend({},{uuid:e.progressBar.submit(n)});r(n,o)}else r(n,{})}),!1},initSubmit:function(a,t){var n=e(this),s='<i class="fa fa-3x fa-gear fa-spin"></i>';t||(t=n.data("ams-form-submit-message")),t&&(s+="<strong>"+t+"</strong>"),e(a).html('<div class="row margin-20"><div class="text-center">'+s+"</div></div>"),e(a).parents(".hidden").removeClass("hidden")},resetAfterSubmit:function(e){if(e.is(":visible")){var a=e.data("ams-submit-button");a&&a.button("reset"),t.form.finalizeSubmitFooter.call(e)}e.data("submitted",!1),e.removeData("ams-submit-button")},finalizeSubmitOnError:function(a){e("i",a).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(a){var t=e(this),n='<i class="fa fa-3x fa-gear fa-spin"></i>';a||(a=e(this).data("ams-form-submit-message")),a&&(n+='<strong class="submit-message align-top padding-left-10 margin-top-10">'+a+"</strong>");var s=e("footer",t);e("button",s).hide(),s.append('<div class="row"><div class="text-center">'+n+"</div></div>")},finalizeSubmitFooter:function(){var a=e(this),t=e("footer",a);t&&(e(".row",t).remove(),e("button",t).show())},_submitCallback:function(a,n,s,i){var r;i.is(":visible")&&(t.form.finalizeSubmitFooter.call(i),(r=i.data("ams-submit-button"))&&r.button("reset"));var o,c=i.data();if(c.amsFormDatatype)o=c.amsFormDatatype;else{var l=t.ajax&&t.ajax.getResponse(s);l&&(o=l.contentType,a=l.data)}var d;switch(d=e(r?r.data("ams-form-submit-target")||c.amsFormSubmitTarget||"#content":c.amsFormSubmitTarget||"#content"),o){case"json":t.ajax&&t.ajax.handleJSON(a,i,d);break;case"script":case"xml":break;case"html":case"text":default:t.form.resetChanged(i),r&&!0!==r.data("ams-keep-modal")&&t.dialog&&t.dialog.close(i),d.exists()||(d=e("body")),d.parents(".hidden").removeClass("hidden"),e(".alert",d.parents(".alerts-container")).remove(),d.css({opacity:"0.0"}).html(a).delay(50).animate({opacity:"1.0"},300),t.initContent&&t.initContent(d),t.form.setFocus(d)}var m=s.getResponseHeader("X-AMS-Callback");if(m){var u=s.getResponseHeader("X-AMS-Callback-Options");t.executeFunctionByName(m,i,void 0===u?{}:JSON.parse(u),s)}},_getSubmitValidators:function(a){var t=[],n=a.data("ams-form-validator");return n&&t.push([a,n]),e("[data-ams-form-validator]",a).each(function(){var a=e(this);t.push([a,a.data("ams-form-validator")])}),t},_checkSubmitValidators:function(e){var a=t.form._getSubmitValidators(e);if(!a.length)return!0;for(var n=[],s=!0,i=0;i<a.length;i++){var r=a[i],o=r[0],c=r[1],l=t.executeFunctionByName(c,e,o);!1===l?s=!1:"string"==typeof l?n.push(l):s.length&&s.length>0&&(n=n.concat(s))}if(n.length>0){var d=1===n.length?t.i18n.ERROR_OCCURED:t.i18n.ERRORS_OCCURED;return t.skin&&t.skin.alert(e,"danger",d,n),!1}return s},showErrors:function(a,n){var s;if("string"==typeof n)t.skin&&t.skin.alert(a,"error",t.i18n.ERROR_OCCURED,n);else if(n instanceof Array)s=1===n.length?t.i18n.ERROR_OCCURED:t.i18n.ERRORS_OCCURED,t.skin&&t.skin.alert(a,"error",s,n);else{e(".state-error",a).removeClass("state-error"),s=n.error_header||(n.widgets&&n.widgets.length>1?t.i18n.ERRORS_OCCURED:t.i18n.ERROR_OCCURED);var i,r=[];if(n.messages)for(i=0;i<n.messages.length;i++){var o=n.messages[i];o.header?r.push("<strong>"+o.header+"</strong><br />"+o.message):r.push(o.message||o)}if(n.widgets)for(i=0;i<n.widgets.length;i++){var c=n.widgets[i],l=e('[name="'+c.name+'"]',a);l.exists()||(l=e('[name="'+c.name+':list"]',a)),l.exists()?l.parents("label, .input").first().removeClassPrefix("state-").addClass("state-error").after('<span for="name" class="state-error">'+c.message+"</span>"):c.label&&r.push(c.label+" : "+c.message);var d=l.parents(".tab-pane").index()+1;if(d>0){var m=e(".nav-tabs",e(l).parents(".tabforms"));e("li:nth-child("+d+")",m).removeClassPrefix("state-").addClass("state-error"),e("li.state-error:first a",a).click()}}t.skin&&t.skin.alert(e(".form-group:first",a),n.error_level||"error",s,r,n.error_message)}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.dialog={_shown_callbacks:[],registerShownCallback:function(e,a){var n;a&&(n=a.objectOrParentWithClass("modal-dialog"));var s;n&&n.exists()?void 0===(s=n.data("shown-callbacks"))&&(s=[],n.data("shown-callbacks",s)):s=t.dialog._shown_callbacks,s.indexOf(e)<0&&s.push(e)},_hide_callbacks:[],registerHideCallback:function(e,a){var n;a&&(n=a.objectOrParentWithClass("modal-dialog"));var s;n&&n.exists()?void 0===(s=n.data("hide-callbacks"))&&(s=[],n.data("hide-callbacks",s)):s=t.dialog._hide_callbacks,s.indexOf(e)<0&&s.push(e)},open:function(a,n,s){t.ajax&&t.ajax.check(e.fn.modalmanager,t.baseURL+"ext/bootstrap-modalmanager"+t.devext+".js",function(){t.ajax.check(e.fn.modal.defaults,t.baseURL+"ext/bootstrap-modal"+t.devext+".js",function(i){i&&(e(document).off("click.modal"),e.fn.modal.defaults.spinner=e.fn.modalmanager.defaults.spinner='<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="progress-bar" style="width: 100%;"></div></div></div>');var r,o;if("string"==typeof a)r={},o=a;else{r=a.data(),o=a.attr("href")||r.amsUrl;var c=t.getFunctionByName(o);"function"==typeof c&&(o=c.call(a))}o&&(e("body").modalmanager("loading"),0===o.indexOf("#")?e(o).modal("show"):e.ajax({url:o,type:"get",cache:void 0!==r.amsAllowCache&&r.amsAllowCache,data:n,success:function(n,i,c){e("body").modalmanager("removeLoading");var l=t.ajax.getResponse(c),d=l.contentType,m=l.data;switch(d){case"json":t.ajax.handleJSON(m,e(e(a).data("ams-json-target")||"#content"));break;case"script":case"xml":break;case"html":case"text":default:var u=e(m),f=e(".modal-dialog",u.wrap("<div></div>").parent()),h=f.data()||{},p={backdrop:"static",overflow:h.amsModalOverflow||".modal-viewport",maxHeight:void 0===h.amsModalMaxHeight?function(){var a=e(window).height(),t=parseInt(f.css("margin-top")),n=Math.round(a/10);return a-e(".modal-header",u).outerHeight(!0)-e("footer",u).outerHeight(!0)-t-n}:t.getFunctionByName(h.amsModalMaxHeight)},g=e.extend({},p,h.amsModalOptions);g=t.executeFunctionByName(h.amsModalInitCallback,f,g)||g,s&&(s.shown&&t.dialog.registerShownCallback(s.shown,u),s.hide&&t.dialog.registerHideCallback(s.hide,u)),e("<div>").addClass("modal fade").append(u).modal(g).on("shown",t.dialog.shown).on("hidden",t.dialog.hidden),t.initContent&&t.initContent(u),!1!==r.amsLogEvent&&t.stats&&t.stats.logPageview(o)}}}))})})},shown:function(a){function n(a){var t=e(".scrollmarker.top",i),n=i.scrollTop();n>0?t.show():t.hide();var s=e(".scrollmarker.bottom",i);r+n>=i.get(0).scrollHeight?s.hide():s.show()}var s=a.target,i=e(".modal-viewport",s);if(i.exists()){var r=parseInt(i.css("max-height")),o=e.scrollbarWidth();"hidden"!==i.css("overflow")&&i.height()===r?(e("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",i.width()-o).hide().appendTo(i),e("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",r-20).css("width",i.width()-o).appendTo(i),i.scroll(n),i.off("resize").on("resize",n)):e(".scrollmarker",i).remove()}e("[data-ams-shown-callback]",s).each(function(){var a=t.getFunctionByName(e(this).data("ams-shown-callback"));a&&a.call(s,this)});var c,l=e(".modal-dialog",s).data("shown-callbacks");if(l)for(c=0;c<l.length;c++)l[c].call(s);if(l=t.dialog._shown_callbacks)for(c=0;c<l.length;c++)l[c].call(s);t.form&&t.form.setFocus(s)},close:function(a){"string"==typeof a&&(a=e(a));var t=a.parents(".modal").data("modal");if(t){var n=e("body").data("modalmanager");n&&n.getOpenModals().indexOf(t)>=0&&t.hide()}},hidden:function(a){var n=a.target;t.skin&&t.skin.cleanContainer(n),e("[data-ams-hidden-callback]",n).each(function(){var a=t.getFunctionByName(e(this).data("ams-hidden-callback"));a&&a.call(n,this)});var s,i=e(".modal-dialog",n).data("hide-callbacks");if(i)for(s=0;s<i.length;s++)i[s].call(n);if(i=t.dialog._hide_callbacks)for(s=0;s<i.length;s++)i[s].call(n)}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.helpers={sort:function(a,t){t||(t="weight"),a.children().sort(function(a,n){return+e(a).data(t)-+e(n).data(t)}).each(function(){a.append(this)})},select2ClearSelection:function(){var a=e(this),t=a.parents("label").first(),n=a.data("ams-select2-target");e('[name="'+n+'"]',t).data("select2").val("")},select2FormatSelection:function(a,t){a instanceof Array||(a=[a]),e(a).each(function(){"object"==typeof this?t.append(this.text):t.append(this)})},select2SelectAllHelper:function(){var a=e(this),t=a.parents("label").first(),n=a.data("ams-select2-target"),s=e('[name="'+n+'"]',t);"SELECT"===s.get(0).tagName?s.select2("val",e("option",s).listattr("value")):s.select2("data",s.data("ams-select2-data"))},select2QueryUrlResultsCallback:function(a,n,s){switch(a.status){case"error":t.skin&&t.skin.messageBox("error",{title:t.i18n.ERROR_OCCURED,content:"<h4>"+a.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":e(this).data("select2").dropdown.hide(),t.dialog&&t.dialog.open(a.location);break;default:return{results:a.results||a,more:a.has_more||!1,context:a.context}}},select2QueryMethodSuccessCallback:function(a,n,s){var i=a.result;if("string"==typeof i)try{i=JSON.parse(i)}catch(e){}switch(i.status){case"error":t.skin&&t.skin.messageBox("error",{title:t.i18n.ERROR_OCCURED,content:"<h4>"+i.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":e(this).data("select2").dropdown.hide(),t.dialog&&t.dialog.open(i.location);break;default:s.callback({results:i.results||i,more:i.has_more||!1,context:i.context})}},select2ChangeHelper:function(){var a=e(this),n=a.data(),s=e(n.amsSelect2HelperTarget);switch(n.amsSelect2HelperType){case"html":s.html('<div class="text-center"><i class="fa fa-2x fa-gear fa-spin"></i></div>');var i={};i[n.amsSelect2HelperArgument||"value"]=a.val(),e.get(n.amsSelect2HelperUrl,i,t.getFunctionByName(n.amsSelect2HelperCallback)||function(e){e?(s.html(e),t.initContent&&t.initContent(s)):s.empty()}).fail(function(){s.empty()});break;case"json-rpc":s.html('<div class="text-center"><i class="fa fa-2x fa-gear fa-spin"></i></div>'),t.jsonrpc&&t.jsonrpc.post(n.amsSelect2HelperMethod,{value:a.val()},{url:n.amsSelect2HelperUrl},t.getFunctionByName(n.amsSelect2HelperCallback)||function(e){e.result?(s.html(e.result),t.initContent&&t.initContent(s)):s.empty()});break;default:var r=n.amsSelect2HelperCallback;r&&t.executeFunctionByName(r,a,n)}},contextMenuHandler:function(e,a){"A"!==a.get(0).tagName&&(a=a.parents("a").first());var n=a.data();if("modal"===n.toggle)t.dialog&&t.dialog.open(a);else{var s=a.attr("href")||n.amsUrl;if(!s||s.startsWith("javascript")||a.attr("target"))return;t.event&&t.event.stop();var i=t.getFunctionByName(s);"function"==typeof i&&(s=i.call(a,e)),"function"==typeof s?s.call(a,e):(s=s.replace(/\%23/,"#"),(e=a.data("ams-target"))?t.form&&t.form.confirmChangedForm(e,function(){t.skin&&t.skin.loadURL(s,e,a.data("ams-link-options"),a.data("ams-link-callback"))}):t.form&&t.form.confirmChangedForm(function(){s.startsWith("#")?s!==location.hash&&(t.root.hasClass("mobile-view-activated")?(t.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=s},150)):window.location.hash=s):window.location=s}))}},datetimepickerDialogHiddenCallback:function(){e(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")},clearSearchTarget:function(){var a=e(this);if(!a.val()){var t=e(a).parents("form").first();e(t.data("ams-form-submit-target")).empty()}},setSEOStatus:function(){var a=e(this),t=a.siblings(".progress").children(".progress-bar"),n=Math.min(a.val().length,100),s="success";n<20||n>80?s="danger":(n<40||n>66)&&(s="warning"),t.removeClassPrefix("progress-bar").addClass("progress-bar").addClass("progress-bar-"+s).css("width",n+"%")}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.plugins={enabled:{},init:function(a){function n(e,a){if(o.hasOwnProperty(e)){var n=o[e];n.css=n.css||a.css,n.callbacks.push({callback:a.callback,context:a.context}),a.register&&(n.register=!0),!1===a.async&&(n.async=!1)}else o[e]={src:a.src,css:a.css,callbacks:[{callback:a.callback,context:a.context}],register:a.register,async:a.async};a.css&&t.getCSS(a.css,e+"_css")}function s(e){var n,s,i=c.callbacks;if(i&&i.length){for(n=0;n<i.length;n++)if(s=i[n],s.callback=t.getFunctionByName(s.callback),!1!==c.register){var o=t.plugins.enabled;o.hasOwnProperty(r)?o[r].push(s):o[r]=[s]}}else!1!==c.register&&(t.plugins.enabled[r]=null);if(!0!==e&&i&&i.length&&!1!==c.async)for(n=0;n<i.length;n++)s=i[n],t.executeFunctionByName(s.callback,a,s.context)}t.plugins.initData(a);var i=[];e("[data-ams-plugins-disabled]",a).each(function(){for(var a=e(this).data("ams-plugins-disabled").split(/\s+/),t=0;t<a.length;t++)i.push(a[t])});var r,o={};e("[data-ams-plugins]",a).each(function(){var a=e(this),t=a.data("ams-plugins");if("string"==typeof t)for(var s=a.data("ams-plugins").split(/\s+/),i=0;i<s.length;i++){r=s[i];var o={src:a.data("ams-plugin-"+r+"-src"),css:a.data("ams-plugin-"+r+"-css"),callback:a.data("ams-plugin-"+r+"-callback"),context:a,register:a.data("ams-plugin-"+r+"-register"),async:a.data("ams-plugin-"+r+"-async")};n(r,o)}else for(r in t)t.hasOwnProperty(r)&&n(r,t[r])});var c;for(r in o)o.hasOwnProperty(r)&&(c=o[r],void 0===t.plugins.enabled[r]?t.getScript(c.src,s,{async:void 0===c.async||c.async}):(!function(){var e=t.plugins.enabled[r];for(l=0;l<e.length;l++){var a=e[l];a&&a.context&&!t.isInDOM(a.context)&&(e[l]=null)}}(),s(!0)));for(var l in t.plugins.enabled)if(t.plugins.enabled.hasOwnProperty(l)&&!(i.indexOf(l)>=0)){var d=t.plugins.enabled[l];if(d)switch(typeof d){case"function":d(a);break;default:for(var m=0;m<d.length;m++){var u=d[m];switch(typeof u){case"function":u(a);break;default:u&&u.callback&&u.callback(u.context)}}}}},initData:function(a){e("[data-ams-data]",a).each(function(){var a=e(this),t=a.data("ams-data");if(t)for(var n in t)if(t.hasOwnProperty(n)){var s=t[n];"string"!=typeof s&&(s=JSON.stringify(s)),a.attr("data-"+n,s)}})},register:function(e,a,n){if("function"==typeof a&&(n=a,a=null),a=a||e.name,t.plugins.enabled.indexOf(a)>=0)console&&console.warn&&console.warn("Plugin "+a+" is already registered!");else if("object"==typeof e){var s=e.src;s?t.ajax&&t.ajax.check(e.callback,s,function(s){s&&(t.plugins.enabled[a]=t.getFunctionByName(e.callback),e.css&&t.getCSS(e.css,a+"_css"),n&&t.executeFunctionByName(n))}):(t.plugins.enabled[a]=t.getFunctionByName(e.callback),e.css&&t.getCSS(e.css,a+"_css"),n&&t.executeFunctionByName(n))}else"function"==typeof e&&(t.plugins.enabled[a]=e,n&&t.executeFunctionByName(n))}},t.plugins.i18n={widgets:{},validate:{},datatables:{},fancybox:{ERROR:"Can't load requested content.",RETRY:"Please check URL or try again later.",CLOSE:"Close",NEXT:"Next",PREVIOUS:"Previous"},dndupload:{FILES_SELECTED:"{count} files selected",CHOOSE_FILE:"Select file(s)",ADD_INFO:"to add them to current folder,",DRAG_FILE:"or drag and drop them here!",UPLOAD:"Upload",UPLOADING:"Uploading&hellip;",DONE:"Done!",UPLOAD_MORE:"Upload more?",ERROR:"Error!",TRY_AGAIN:"Try again?"}}}(jQuery,this),function(e,a){var t=a.MyAMS;e.extend(t.plugins.enabled,{svg:function(a){var t=e(".svg-container",a);t.length>0&&t.each(function(){var a=e(this),t=e("svg",a),n=t.attr("width"),s=t.attr("height");n&&s&&t.get(0).setAttribute("viewBox","0 0 "+Math.round(parseFloat(n))+" "+Math.round(parseFloat(s))),t.attr("width","100%").attr("height","auto")})},hint:function(a){var n=e(".hint:not(:parents(.nohints))",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.tipsy,t.baseURL+"ext/jquery-tipsy"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-tipsy"+t.devext+".css","jquery-tipsy",function(){n.each(function(){var a=e(this),n=a.data(),s={html:void 0===n.amsHintHtml?(a.attr("title")||"").startsWith("<"):n.amsHintHtml,title:t.getFunctionByName(n.amsHintTitleGetter)||function(){var a=e(this),t=a.attr("original-title")||a.attr(n.amsHintTitleAttr||"title")||(n.amsHintHtml?a.html():a.text());return t=t.replace(/\?_="/,"?_="+(new Date).getTime()+'"')},opacity:n.amsHintOpacity||.95,gravity:n.amsHintGravity||"sw",offset:n.amsHintOffset||0},i=e.extend({},s,n.amsHintOptions);i=t.executeFunctionByName(n.amsHintInitCallback,a,i)||i;var r=a.tipsy(i);t.executeFunctionByName(n.amsHintAfterInitCallback,a,r,i)})})})},contextMenu:function(a){var n=e(".context-menu",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={menuSelector:n.amsContextmenuSelector,menuSelected:t.helpers&&t.helpers.contextMenuHandler},i=e.extend({},s,n.amsContextmenuOptions);i=t.executeFunctionByName(n.amsContextmenuInitCallback,a,i)||i;var r=a.contextMenu(i);t.executeFunctionByName(n.amsContextmenuAfterInitCallback,a,r,i)})},switcher:function(a){e("LEGEND.switcher",a).each(function(){var a=e(this),t=a.parent("fieldset"),n=a.data();n.amsSwitcher||(e('<i class="fa fa-fw"></i>').prependTo(e(this)).addClass("open"===n.amsSwitcherState?n.amsSwitcherMinusClass||"fa-minus":n.amsSwitcherPlusClass||"fa-plus"),a.on("click",function(s){s.preventDefault();var i={};if(a.trigger("ams.switcher.before-switch",[a,i]),!i.veto)if(t.hasClass("switched")){t.removeClass("switched"),e(".fa",a).removeClass(n.amsSwitcherPlusClass||"fa-plus").addClass(n.amsSwitcherMinusClass||"fa-minus"),a.trigger("ams.switcher.opened",[a]);var r=a.attr("id");r&&e('legend.switcher[data-ams-switcher-sync="'+r+'"]',t).each(function(){var a=e(this);a.parents("fieldset").hasClass("switched")&&a.click()})}else t.addClass("switched"),e(".fa",a).removeClass(n.amsSwitcherMinusClass||"fa-minus").addClass(n.amsSwitcherPlusClass||"fa-plus"),a.trigger("ams.switcher.closed",[a])}),"open"!==n.amsSwitcherState&&t.addClass("switched"),a.data("ams-switcher","on"))})},checker:function(a){e("LEGEND.checker",a).each(function(){var a=e(this),n=a.parent("fieldset"),s=a.data();if(!s.amsChecker){var i=e('<label class="checkbox"></label>'),r=s.amsCheckerFieldname||"checker_"+t.generateId(),o=r.replace(/\./,"_"),c=s.amsCheckerHiddenPrefix,l=null,d=s.amsCheckerHiddenValueOn||"true",m=s.amsCheckerHiddenValueOff||"false",u=s.amsCheckerMarker||!1;c?l=e('<input type="hidden">').attr("name",c+r).val("on"===s.amsCheckerState?d:m).prependTo(a):u&&e('<input type="hidden">').attr("name",u).attr("value",1).prependTo(a);var f=e('<input type="checkbox">').attr("name",r).attr("id",o).data("ams-checker-hidden-input",l).data("ams-checker-init",!0).val(s.amsCheckerValue||!0).attr("checked","on"===s.amsCheckerState?"checked":null);s.amsCheckerReadonly?f.attr("disabled","disabled"):f.on("change",function(i){i.preventDefault();var r={},o=e(this).is(":checked");if(a.trigger("ams.checker.before-switch",[a,r]),r.veto)e(this).prop("checked",!o);else if(t.executeFunctionByName(s.amsCheckerChangeHandler,a,o),!s.amsCheckerCancelDefault){var c=f.data("ams-checker-hidden-input");o?("disable"===s.amsCheckerMode?(n.removeAttr("disabled"),e(".select2",n).removeAttr("disabled")):n.removeClass("switched"),c&&c.val(d),e("[data-required]",n).attr("required","required"),a.trigger("ams.checker.opened",[a])):("disable"===s.amsCheckerMode?(n.prop("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),c&&c.val(m),e("[data-required]",n).removeAttr("required"),a.trigger("ams.checker.closed",[a]))}}),f.appendTo(i),e(">label",a).attr("for",f.attr("id")),i.append("<i></i>").prependTo(a);var h=e("[required]",n);h.attr("data-required",!0),"on"===s.amsCheckerState?f.attr("checked",!0):("disable"===s.amsCheckerMode?(n.attr("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),h.removeAttr("required")),a.data("ams-checker","on")}})},slider:function(a){var n=e(".slider",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.slider,t.baseURL+"ext/bootstrap-slider-2.0.0"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=e.extend({},{},a.data.amsSliderOptions);s=t.executeFunctionByName(n.amsSliderInitCallback,a,s)||s;var i=a.slider(s);t.executeFunctionByName(n.amsSliderAfterInitCallback,a,i,s)})})},draggable:function(a){var n=e(".draggable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={cursor:n.amsDraggableCursor||"move",containment:n.amsDraggableContainment,handle:n.amsDraggableHandle,connectToSortable:n.amsDraggableConnectSortable,helper:t.getFunctionByName(n.amsDraggableHelper)||n.amsDraggableHelper,start:t.getFunctionByName(n.amsDraggableStart),stop:t.getFunctionByName(n.amsDraggableStop)},i=e.extend({},s,n.amsDraggableOptions);i=t.executeFunctionByName(n.amsDraggableInitCallback,a,i)||i;var r=a.draggable(i);a.disableSelection(),t.executeFunctionByName(n.amsDraggableAfterInitCallback,a,r,i)})},droppable:function(a){var n=e(".droppable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={accept:n.amsdroppableAccept,drop:t.getFunctionByName(n.amsDroppableDrop)},i=e.extend({},s,n.amsDroppableOptions);i=t.executeFunctionByName(n.amsDroppableInitCallback,a,i)||i;var r=a.droppable(i);t.executeFunctionByName(n.amsDroppableAfterInitCallback,a,r,i)})},sortable:function(a){var n=e(".sortable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={items:n.amsSortableItems,handle:n.amsSortableHandle,helper:n.amsSortableHelper,connectWith:n.amsSortableConnectwith,start:t.getFunctionByName(n.amsSortableStart),over:t.getFunctionByName(n.amsSortableOver),containment:n.amsSortableContainment,placeholder:n.amsSortablePlaceholder,stop:t.getFunctionByName(n.amsSortableStop)},i=e.extend({},s,n.amsSortableOptions);i=t.executeFunctionByName(n.amsSortableInitCallback,a,i)||i;var r=a.sortable(i);a.disableSelection(),t.executeFunctionByName(n.amsSortableAfterInitCallback,a,r,i)})},resizable:function(a){var n=e(".resizable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),s={autoHide:!1===n.amsResizableAutohide||n.amsResizableAutohide,containment:n.amsResizableContainment,grid:n.amsResizableGrid,handles:n.amsResizableHandles,start:t.getFunctionByName(n.amsResizableStart),stop:t.getFunctionByName(n.amsResizableStop)},i=e.extend({},s,n.amsResizableOptions);i=t.executeFunctionByName(n.amsResizableInitCallback,a,i)||i;var r=a.resizable(i);a.disableSelection(),t.executeFunctionByName(n.amsResizableAfterInitCallback,a,r,i)})},typeahead:function(a){var n=e(".typeahead",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.typeahead,t.baseURL+"ext/jquery-typeahead"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s=e.extend({},{},n.amsTypeaheadOptions);s=t.executeFunctionByName(n.amsTypeaheadInitCallback,a,s)||s;var i=a.typeahead(s);t.executeFunctionByName(n.amsTypeaheadAfterInitCallback,a,i,s)})})},treeview:function(a){var n=e(".treeview",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.treview,t.baseURL+"ext/bootstrap-treeview"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/bootstrap-treeview"+t.devext+".css","bootstrap-treeview",function(){n.each(function(){var a=e(this),n=a.data(),s={data:n.amsTreeviewData,levels:n.amsTreeviewLevels,injectStyle:n.amsTreeviewInjectStyle,expandIcon:n.amsTreeviewExpandIcon||"fa fa-fw fa-plus-square-o",collapseIcon:n.amsTreeviewCollaspeIcon||"fa fa-fw fa-minus-square-o",emptyIcon:n.amsTreeviewEmptyIcon||"fa fa-fw",nodeIcon:n.amsTreeviewNodeIcon,selectedIcon:n.amsTreeviewSelectedIcon,checkedIcon:n.amsTreeviewCheckedIcon||"fa fa-fw fa-check-square-o",uncheckedIcon:n.amsTreeviewUncheckedIcon||"fa fa-fw fa-square-o",color:n.amsTreeviewColor,backColor:n.amsTreeviewBackColor,borderColor:n.amsTreeviewBorderColor,onHoverColor:n.amsTreeviewHoverColor,selectedColor:n.amsTreeviewSelectedColor,selectedBackColor:n.amsTreeviewSelectedBackColor,unselectableColor:n.amsTreeviewUnselectableColor||"rgba(1,1,1,0.25)",unselectableBackColor:n.amsTreeviewUnselectableBackColor||"rgba(1,1,1,0.25)",enableLinks:n.amsTreeviewEnableLinks,highlightSelected:n.amsTreeviewHighlightSelected,highlightSearchResults:n.amsTreeviewhighlightSearchResults,showBorder:n.amsTreeviewShowBorder,showIcon:n.amsTreeviewShowIcon,showCheckbox:n.amsTreeviewShowCheckbox,showTags:n.amsTreeviewShowTags,toggleUnselectable:n.amsTreeviewToggleUnselectable,multiSelect:n.amsTreeviewMultiSelect,onNodeChecked:t.getFunctionByName(n.amsTreeviewNodeChecked),onNodeCollapsed:t.getFunctionByName(n.amsTreeviewNodeCollapsed),onNodeDisabled:t.getFunctionByName(n.amsTreeviewNodeDisabled),onNodeEnabled:t.getFunctionByName(n.amsTreeviewNodeEnabled),onNodeExpanded:t.getFunctionByName(n.amsTreeviewNodeExpanded),onNodeSelected:t.getFunctionByName(n.amsTreeviewNodeSelected),onNodeUnchecked:t.getFunctionByName(n.amsTreeviewNodeUnchecked),onNodeUnselected:t.getFunctionByName(n.amsTreeviewNodeUnselected),onSearchComplete:t.getFunctionByName(n.amsTreeviewSearchComplete),onSearchCleared:t.getFunctionByName(n.amsTreeviewSearchCleared)},i=e.extend({},s,n.amsTreeviewOptions);i=t.executeFunctionByName(n.amsTreeviewInitcallback,a,i)||i;var r=a.treeview(i);t.executeFunctionByName(n.amsTreeviewAfterInitCallback,a,r,i)})})})},select2:function(a){var n=e(".select2",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.select2,t.baseURL+"ext/jquery-select2-3.5.4"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();if(!n.select2){var s={placeholder:n.amsSelect2Placeholder,multiple:n.amsSelect2Multiple,minimumInputLength:n.amsSelect2MinimumInputLength||0,maximumSelectionSize:n.amsSelect2MaximumSelectionSize,openOnEnter:void 0===n.amsSelect2EnterOpen||n.amsSelect2EnterOpen,allowClear:void 0===n.amsSelect2AllowClear||n.amsSelect2AllowClear,width:n.amsSelect2Width||"100%",initSelection:t.getFunctionByName(n.amsSelect2InitSelection),formatSelection:void 0===n.amsSelect2FormatSelection?t.helpers&&t.helpers.select2FormatSelection:t.getFunctionByName(n.amsSelect2FormatSelection),formatResult:t.getFunctionByName(n.amsSelect2FormatResult),formatMatches:void 0===n.amsSelect2FormatMatches?function(e){return 1===e?t.i18n.SELECT2_MATCH:e+t.i18n.SELECT2_MATCHES}:t.getFunctionByName(n.amsSelect2FormatMatches),formatNoMatches:void 0===n.amsSelect2FormatResult?function(e){return t.i18n.SELECT2_NOMATCHES}:t.getFunctionByName(n.amsSelect2FormatResult),formatInputTooShort:void 0===n.amsSelect2FormatInputTooShort?function(e,a){var n=a-e.length;return t.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooShort),formatInputTooLong:void 0===n.amsSelect2FormatInputTooLong?function(e,a){var n=e.length-a;return t.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooLong),formatSelectionTooBig:void 0===n.amsSelect2FormatSelectionTooBig?function(e){return t.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,e).replace(/\{1\}/,1===e?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatSelectionTooBig),formatLoadMore:void 0===n.amsSelect2FormatLoadMore?function(e){return t.i18n.SELECT2_LOADMORE}:t.getFunctionByName(n.amsSelect2FormatLoadMore),formatSearching:void 0===n.amsSelect2FormatSearching?function(){return t.i18n.SELECT2_SEARCHING}:t.getFunctionByName(n.amsSelect2FormatSearching),separator:n.amsSelect2Separator||",",tokenSeparators:n.amsSelect2TokensSeparators||[","],tokenizer:t.getFunctionByName(n.amsSelect2Tokenizer)};switch(a.context.type){case"text":case"hidden":if(!s.initSelection){var i=a.data("ams-select2-values");i&&(s.initSelection=function(a,t){var n=[];e(a.val().split(s.separator)).each(function(){n.push({id:this,text:i[this]||this})}),t(n)})}}a.attr("readonly")?"hidden"===a.attr("type")&&(s.query=function(){return[]}):n.amsSelect2Query?(s.query=t.getFunctionByName(n.amsSelect2Query),s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryUrl?(s.ajax={url:n.amsSelect2QueryUrl,quietMillis:n.amsSelect2QuietMillis||200,type:n.amsSelect2QueryType||"POST",dataType:n.amsSelect2QueryDatatype||"json",data:function(a,t,s){var i={};return i[n.amsSelect2QueryParamName||"query"]=a,i[n.amsSelect2PageParamName||"page"]=t,i[n.amsSelect2ContextParamName||"context"]=s,e.extend({},i,n.amsSelect2QueryOptions)},results:t.helpers&&t.helpers.select2QueryUrlResultsCallback},s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryMethod?(s.query=function(s){var i={id:(new Date).getTime(),params:n.amsSelect2QueryParams||{},success:function(e){return t.helpers&&t.helpers.select2QueryMethodSuccessCallback.call(a,e,"success",s)},error:t.error&&t.error.show};i.params[n.amsSelect2QueryParamName||"query"]=s.term,i.params[n.amsSelect2PageParamName||"page"]=s.page,i.params[n.amsSelect2ContextParamName||"context"]=s.context,i=e.extend({},i,n.amsSelect2QueryOptions),i=t.executeFunctionByName(n.amsSelect2QueryInitCallback,a,i)||i,t.ajax&&t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){e.jsonRPC.withOptions({endPoint:n.amsSelect2MethodTarget||t.jsonrpc&&t.jsonrpc.getAddr(),namespace:n.amsSelect2MethodNamespace,cache:!1},function(){e.jsonRPC.request(n.amsSelect2QueryMethod,i)})})},s.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2Tags?s.tags=n.amsSelect2Tags:n.amsSelect2Data&&(s.data=n.amsSelect2Data),n.amsSelect2EnableFreeTags&&(s.createSearchChoice=function(e){return{id:e,text:(n.amsSelect2FreeTagsPrefix||t.i18n.SELECT2_FREETAG_PREFIX)+e}});var r=e.extend({},s,n.amsSelect2Options);r=t.executeFunctionByName(n.amsSelect2InitCallback,a,r)||r;var o=a.select2(r);t.executeFunctionByName(n.amsSelect2AfterInitCallback,a,o,r),a.hasClass("ordered")&&t.ajax&&t.ajax.check(e.fn.select2Sortable,t.baseURL+"ext/jquery-select2-sortable"+t.devext+".js",function(){a.select2Sortable({bindOrder:"sortableStop"})}),a.on("change",function(){void 0!==e(a.get(0).form).data("validator")&&e(a).valid()})}})})},maskedit:function(a){var n=e("[data-mask]",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.mask,t.baseURL+"ext/jquery-maskedinput-1.4.1"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s={placeholder:void 0===n.amsMaskeditPlaceholder?"X":n.amsMaskeditPlaceholder,complete:t.getFunctionByName(n.amsMaskeditComplete)},i=e.extend({},s,n.amsMaskeditOptions);i=t.executeFunctionByName(n.amsMaskeditInitCallback,a,i)||i;var r=a.mask(a.attr("data-mask"),i);t.executeFunctionByName(n.amsMaskeditAfterInitCallback,a,r,i)})})},inputmask:function(a){var n=e("input[data-input-mask]",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.inputmask,t.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+t.devext+".js",function(){n.each(function(){var a,n=e(this),s=n.data();a="object"==typeof s.inputMask?s.inputMask:{mask:s.inputMask.toString()};var i=e.extend({},a,s.amsInputmaskOptions);i=t.executeFunctionByName(s.amsInputmaskInitCallback,n,i)||i;var r=n.inputmask(i);t.executeFunctionByName(s.amsInputmaskAfterInitCallback,n,r,i)})})},datepicker:function(a){var n=e(".datepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y",datepicker:!0,dayOfWeekStart:1,timepicker:!1,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},datetimepicker:function(a){var n=e(".datetimepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y H:i",datepicker:!0,dayOfWeekStart:1,timepicker:!0,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},timepicker:function(a){var n=e(".timepicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog&&t.dialog.registerHideCallback(t.helpers&&t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),s={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect},i=e.extend({},s,n.amsDatetimepickerOptions);i=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,i)||i;var r=a.datetimepicker(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},colorpicker:function(a){var n=e(".colorpicker",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.minicolors,t.baseURL+"ext/jquery-minicolors"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-minicolors"+t.devext+".css","jquery-minicolors",function(){n.each(function(){var a=e(this),n=a.data(),s={position:n.amsColorpickerPosition||a.closest(".input").data("ams-colorpicker-position")||"bottom left"},i=e.extend({},s,n.amsColorpickerOptions);i=t.executeFunctionByName(n.amsColorpickerInitCallback,a,i)||i;var r=a.minicolors(i);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,i)})})})},dndupload:function(a){var n=e(".dndupload",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.dndupload,t.baseURL+"ext/jquery-dndupload"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-dndupload"+t.devext+".css","jquery-dndupload",function(){n.each(function(){var a=e(this),n=a.data(),s={action:n.amsDnduploadAction||a.attr("action")||"upload-files",fieldname:n.amsDnduploadFieldname||"files",autosubmit:n.amsDnduploadAutosubmit},i=e.extend({},s,n.amsDnduploadOptions);i=t.executeFunctionByName(n.amsDnduploadInitCallback,a,i)||i;var r=a.dndupload(i);t.executeFunctionByName(n.amsDnduploadAfterInitcallback,a,r,i)})})})},validate:function(a){var n=e("FORM:not([novalidate])",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.validate,t.baseURL+"ext/jquery-validate-1.17.0"+t.devext+".js",function(a){if(a&&(e.validator.setDefaults({highlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(e,a){var t=a.parents("label, .input").first();t.length?e.insertAfter(t):e.insertAfter(a)}}),t.plugins&&t.plugins.i18n)){for(var s in t.plugins.i18n.validate)if(t.plugins.i18n.validate.hasOwnProperty(s)){var i=t.plugins.i18n.validate[s];"string"==typeof i&&i.indexOf("{0}")>-1&&(t.plugins.i18n.validate[s]=e.validator.format(i))}e.extend(e.validator.messages,t.plugins.i18n.validate)}n.each(function(){var a=e(this),n=a.data(),s={ignore:null,submitHandler:void 0!==a.attr("data-async")?void 0===n.amsFormSubmitHandler?function(){return e(".state-error",a).removeClass("state-error"),t.ajax&&t.ajax.check(e.fn.ajaxSubmit,t.baseURL+"ext/jquery-form-3.49"+t.devext+".js"),t.form&&t.form.submit(a)}:t.getFunctionByName(n.amsFormSubmitHandler):void 0,invalidHandler:void 0===n.amsFormInvalidHandler?function(t,n){e(".state-error",a).removeClass("state-error");for(var s=0;s<n.errorList.length;s++){var i=n.errorList[s],r=e(i.element).parents(".tab-pane").index()+1;if(r>0){var o=e(".nav-tabs",e(i.element).parents(".tabforms"));e("li:nth-child("+r+")",o).removeClassPrefix("state-").addClass("state-error"),e("li.state-error:first a",o).click()}}}:t.getFunctionByName(n.amsFormInvalidHandler)};e("[data-ams-validate-rules]",a).each(function(a){0===a&&(s.rules={}),s.rules[e(this).attr("name")]=e(this).data("ams-validate-rules")}),e("[data-ams-validate-messages]",a).each(function(a){0===a&&(s.messages={}),s.messages[e(this).attr("name")]=e(this).data("ams-validate-messages")});var i=e.extend({},s,n.amsValidateOptions);i=t.executeFunctionByName(n.amsValidateInitCallback,a,i)||i;var r=a.validate(i);t.executeFunctionByName(n.amsValidateAfterInitCallback,a,r,i)})})},datatable:function(a){var n=e(".datatable",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.dataTable,t.baseURL+"ext/jquery-dataTables-1.9.4"+t.devext+".js",function(){t.ajax.check(e.fn.dataTableExt.oPagination.bootstrap_full,t.baseURL+"myams-dataTables"+t.devext+".js",function(){e(n).each(function(){var a,n=e(this),s=n.data(),i=(s.amsDatatableExtensions||"").split(/\s+/),r=s.amsDatatableSdom||"W"+(i.indexOf("colreorder")>=0||i.indexOf("colreorderwithresize")>=0?"R":"")+"<'dt-top-row'"+(i.indexOf("colvis")>=0?"C":"")+(!1===s.amsDatatablePagination||!1===s.amsDatatablePaginationSize?"":"L")+(!1===s.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(i.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===s.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",o=s.amsDatatableSorting;if("string"==typeof o){var c=o.split(";");for(o=[],a=0;a<c.length;a++){var l=c[a].split(",");l[0]=parseInt(l[0]),o.push(l)}}var d,m=[],u=e("th",n).listattr("data-ams-datatable-sortable");for(a=0;a<u.length;a++){var f=u[a];void 0!==f?((d=m[a]||{}).bSortable="string"==typeof f?JSON.parse(f):f,m[a]=d):m[a]=m[a]||{}}var h=e("th",n).listattr("data-ams-datatable-stype");for(a=0;a<h.length;a++){var p=h[a];p?((d=m[a]||{}).sType=p,m[a]=d):m[a]=m[a]||{}}var g={bJQueryUI:!1,bServerSide:s.amsDatatableServerSide||!1,sAjaxSource:!0===s.amsDatatableServerSide?s.amsDatatableAjaxSource:void 0,sServerMethod:!0===s.amsDatatableServerSide?"POST":void 0,bFilter:!1!==s.amsDatatableGlobalFilter||i.indexOf("columnfilter")>=0,bPaginate:!1!==s.amsDatatablePagination,bInfo:!1!==s.amsDatatableInfo,bSort:!1!==s.amsDatatableSort,aaSorting:o,aoColumns:m.length>0?m:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:s.amsDatatableDisplayLength||25,sPaginationType:s.amsDatatablePaginationType||"bootstrap_full",sDom:r,oLanguage:t.plugins&&t.plugins.i18n.datatables,fnInitComplete:function(a,n){e(".ColVis_Button").addClass("btn btn-default btn-sm").html((t.plugins&&t.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}},b=e.extend({},g,s.amsDatatableOptions),v=[],x=[],y=[];if(i.length>0)for(a=0;a<i.length;a++)switch(i[a]){case"autofill":v.push(e.fn.dataTable.AutoFill),x.push(t.baseURL+"ext/jquery-dataTables-autoFill"+t.devext+".js");break;case"columnfilter":v.push(e.fn.columnFilter),x.push(t.baseURL+"ext/jquery-dataTables-columnFilter"+t.devext+".js");break;case"colreorder":v.push(e.fn.dataTable.ColReorder),x.push(t.baseURL+"ext/jquery-dataTables-colReorder"+t.devext+".js");break;case"colreorderwithresize":v.push(window.ColReorder),x.push(t.baseURL+"ext/jquery-dataTables-colReorderWithResize"+t.devext+".js");break;case"colvis":v.push(e.fn.dataTable.ColVis),x.push(t.baseURL+"ext/jquery-dataTables-colVis"+t.devext+".js"),y.push(function(){b.oColVis=e.extend({},{activate:"click",sAlign:"right"},s.amsDatatableColvisOptions)});break;case"editable":v.push(e.fn.editable),x.push(t.baseURL+"ext/jquery-jeditable"+t.devext+".js"),v.push(e.fn.makeEditable),x.push(t.baseURL+"ext/jquery-dataTables-editable"+t.devext+".js");break;case"fixedcolumns":v.push(e.fn.dataTable.FixedColumns),x.push(t.baseURL+"ext/jquery-dataTables-fixedColumns"+t.devext+".js");break;case"fixedheader":v.push(e.fn.dataTable.Fixedheader),x.push(t.baseURL+"ext/jquery-dataTables-fixedHeader"+t.devext+".js");break;case"keytable":v.push(window.keyTable),x.push(t.baseURL+"ext/jquery-dataTables-keyTable"+t.devext+".js");break;case"rowgrouping":v.push(e.fn.rowGrouping),x.push(t.baseURL+"ext/jquery-dataTables-rowGrouping"+t.devext+".js");break;case"rowreordering":v.push(e.fn.rowReordering),x.push(t.baseURL+"ext/jquery-dataTables-rowReordering"+t.devext+".js");break;case"scroller":v.push(e.fn.dataTable.Scroller),x.push(t.baseURL+"ext/jquery-dataTables-scroller"+t.devext+".js")}y.push(function(){b=t.executeFunctionByName(s.amsDatatableInitCallback,n,b)||b;try{var r=n.dataTable(b);if(t.executeFunctionByName(s.amsDatatableAfterInitCallback,n,r,b),i.length>0)for(a=0;a<i.length;a++)switch(i[a]){case"autofill":var o=e.extend({},s.amsDatatableAutofillOptions,b.autofill);o=t.executeFunctionByName(s.amsDatatableAutofillInitCallback,n,o)||o,n.data("ams-autofill",void 0===s.amsDatatableAutofillConstructor?new e.fn.dataTable.AutoFill(n,o):t.executeFunctionByName(s.amsDatatableAutofillConstructor,n,r,o));break;case"columnfilter":var c=e.extend({},{sPlaceHolder:"head:after"},s.amsDatatableColumnfilterOptions,b.columnfilter);c=t.executeFunctionByName(s.amsDatatableColumnfilterInitCallback,n,c)||c,n.data("ams-columnfilter",void 0===s.amsDatatableColumnfilterConstructor?r.columnFilter(c):t.executeFunctionByName(s.amsDatatableColumnfilterConstructor,n,r,c));break;case"editable":var l=e.extend({},s.amsDatatableEditableOptions,b.editable);l=t.executeFunctionByName(s.amsDatatableEditableInitCallback,n,l)||l,n.data("ams-editable",void 0===s.amsDatatableEditableConstructor?n.makeEditable(l):t.executeFunctionByName(s.amsDatatableEditableConstructor,n,r,l));break;case"fixedcolumns":var d=e.extend({},s.amsDatatableFixedcolumnsOptions,b.fixedcolumns);d=t.executeFunctionByName(s.amsDatatableFixedcolumnsInitCallback,n,d)||d,n.data("ams-fixedcolumns",void 0===s.amsDatatableFixedcolumnsConstructor?new e.fn.dataTable.FixedColumns(n,d):t.executeFunctionByName(s.amsDatatableFixedcolumnsConstructor,n,r,d));break;case"fixedheader":var m=e.extend({},s.amsDatatableFixedheaderOptions,b.fixedheader);m=t.executeFunctionByName(s.amsDatatableFixedheadeInitCallback,n,m)||m,n.data("ams-fixedheader",void 0===s.amsDatatableFixedheaderConstructor?new e.fn.dataTable.FixedHeader(n,m):t.executeFunctionByName(s.amsDatatableFixedheaderConstructor,n,r,m));break;case"keytable":var u={table:n.get(0),datatable:r},f=e.extend({},u,s.amsDatatableKeytableOptions,b.keytable);f=t.executeFunctionByName(s.amsDatatableKeytableInitCallback,n,f)||f,n.data("ams-keytable",void 0===s.amsDatatableKeytableConstructor?new KeyTable(f):t.executeFunctionByName(s.amsDatatableKeytableConstructor,n,r,f));break;case"rowgrouping":var h=e.extend({},s.amsDatatableRowgroupingOptions,b.rowgrouping);h=t.executeFunctionByName(s.amsDatatableRowgroupingInitCallback,n,h)||h,n.data("ams-rowgrouping",void 0===s.amsDatatableRowgroupingConstructor?n.rowGrouping(h):t.executeFunctionByName(s.amsDatatableRowgroupingConstructor,n,r,h));break;case"rowreordering":var p=e.extend({},s.amsDatatableRowreorderingOptions,b.rowreordering);p=t.executeFunctionByName(s.amsDatatableRowreorderingInitCallback,n,p)||p,n.data("ams-rowreordering",void 0===s.amsDatatableRowreorderingConstructor?n.rowReordering(p):t.executeFunctionByName(s.amsDatatableRowreorderingConstructor,n,r,p))}if(s.amsDatatableFinalizeCallback){var g=s.amsDatatableFinalizeCallback.split(/\s+/);if(g.length>0)for(a=0;a<g.length;a++)t.executeFunctionByName(g[a],n,r,b)}}catch(e){}}),t.ajax&&t.ajax.check(v,x,y)})})})},tablednd:function(a){var n=e(".table-dnd",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.tableDnD,t.baseURL+"ext/jquery-tablednd"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();n.amsTabledndDragHandle?e("tr",a).addClass("no-drag-handle"):e(a).on("mouseover","tr",function(){e(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){e(this.cells[0]).removeClass("drag-handle")});var s={onDragClass:n.amsTabledndDragClass||"dragging-row",onDragStart:t.getFunctionByName(n.amsTabledndDragStart),dragHandle:n.amsTabledndDragHandle,scrollAmount:n.amsTabledndScrollAmount,onAllowDrop:n.amsTabledndAllowDrop,onDrop:t.getFunctionByName(n.amsTabledndDrop)||function(s,i){var r=n.amsTabledndDropTarget;if(r){e(i).data("ams-disabled-handlers","click");try{var o=[];e(s.rows).each(function(){var a=e(this).data("ams-element-name");a&&o.push(a)});var c=t.getFunctionByName(r);if("function"==typeof c)c.call(a,s,o);else{if(!r.startsWith(window.location.protocol)){var l=n.amsLocation;l&&(r=l+"/"+r)}t.ajax&&t.ajax.post(r,{names:JSON.stringify(o)},function(e,a){"success"!==e.status&&t.ajax.handleJSON(e)})}}finally{setTimeout(function(){e(i).removeData("ams-disabled-handlers")},50)}}return!1}},i=e.extend({},s,n.amsTabledndOptions);i=t.executeFunctionByName(n.amsTabledndInitCallback,a,i)||i;var r=a.tableDnD(i);t.executeFunctionByName(n.amsTabledndAfterInitCallback,a,r,i)})})},wizard:function(a){var n=e(".wizard",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.bootstrapWizard,t.baseURL+"ext/bootstrap-wizard-1.4.2"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),s={withVisible:void 0===n.amsWizardWithVisible||n.amsWizardWithVisible,tabClass:n.amsWizardTabClass,firstSelector:n.amsWizardFirstSelector,previousSelector:n.amsWizardPreviousSelector,nextSelector:n.amsWizardNextSelector,lastSelector:n.amsWizardLastSelector,finishSelector:n.amsWizardFinishSelector,backSelector:n.amsWizardBackSelector,onInit:t.getFunctionByName(n.amsWizardInit),onShow:t.getFunctionByName(n.amsWizardShow),onNext:t.getFunctionByName(n.amsWizardNext),onPrevious:t.getFunctionByName(n.amsWizardPrevious),onFirst:t.getFunctionByName(n.amsWizardFirst),onLast:t.getFunctionByName(n.amsWizardLast),onBack:t.getFunctionByName(n.amsWizardBack),onFinish:t.getFunctionByName(n.amsWizardFinish),onTabChange:t.getFunctionByName(n.amsWizardTabChange),onTabClick:t.getFunctionByName(n.amsWizardTabClick),onTabShow:t.getFunctionByName(n.amsWizardTabShow)},i=e.extend({},s,n.amsWizardOptions);i=t.executeFunctionByName(n.amsWizardInitCallback,a,i)||i;var r=a.bootstrapWizard(i);t.executeFunctionByName(n.amsWizardAfterInitCallback,a,r,i)})})},tinymce:function(a){function n(){e(".tinymce",e(this)).each(function(){var a=tinymce.get(e(this).attr("id"));a&&a.remove()})}var s=e(".tinymce",a);if(s.length>0){var i=t.baseURL+"ext/tinymce"+(t.devmode?"/dev":"");t.ajax&&t.ajax.check(window.tinymce,i+"/tinymce"+t.devext+".js",function(a){function r(){s.each(function(){var a=e(this),n=a.data(),s={theme:n.amsTinymceTheme||"modern",language:t.lang,menubar:!1!==n.amsTinymceMenubar,statusbar:!1!==n.amsTinymceStatusbar,plugins:n.amsTinymcePlugins||["advlist autosave autolink lists link charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern autoresize"],toolbar:n.amsTinymceToolbar,toolbar1:!1!==n.amsTinymceToolbar1&&(n.amsTinymceToolbar1||"undo redo | pastetext | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"),toolbar2:!1!==n.amsTinymceToolbar2&&(n.amsTinymceToolbar2||"forecolor backcolor emoticons | charmap link image media | fullscreen preview print | code"),content_css:n.amsTinymceContentCss,formats:n.amsTinymceFormats,style_formats:n.amsTinymceStyleFormats,block_formats:n.amsTinymceBlockFormats,valid_classes:n.amsTinymceValidClasses,image_advtab:!0,image_list:t.getFunctionByName(n.amsTinymceImageList)||n.amsTinymceImageList,image_class_list:n.amsTinymceImageClassList,link_list:t.getFunctionByName(n.amsTinymceLinkList)||n.amsTinymceLinkList,link_class_list:n.amsTinymceLinkClassList,paste_as_text:void 0===n.amsTinymcePasteAsText||n.amsTinymcePasteAsText,paste_auto_cleanup_on_paste:void 0===n.amsTinymcePasteAutoCleanup||n.amsTinymcePasteAutoCleanup,paste_strip_class_attributes:n.amsTinymcePasteStripClassAttributes||"all",paste_remove_spans:void 0===n.amsTinymcePaseRemoveSpans||n.amsTinymcePasteRemoveSpans,paste_remove_styles:void 0===n.amsTinymcePasteRemoveStyles||n.amsTinymcePasteRemoveStyles,height:n.amsTinymceHeight||50,min_height:50,resize:!0,autoresize_min_height:50,autoresize_max_height:500};if(n.amsTinymceExternalPlugins){var i=n.amsTinymceExternalPlugins.split(/\s+/);for(var r in i)if(i.hasOwnProperty(r)){var o=a.data("ams-tinymce-plugin-"+i[r]);tinymce.PluginManager.load(i[r],t.getSource(o))}}var c=e.extend({},s,n.amsTinymceOptions);c=t.executeFunctionByName(n.amsTinymceInitCallback,a,c)||c;var l=a.tinymce(c);t.executeFunctionByName(n.amsTinymceAfterInitCallback,a,l,c)})}a?t.getScript(i+"/jquery.tinymce"+t.devext+".js",function(){tinymce.baseURL=i,tinymce.suffix=t.devext,t.skin&&t.skin.registerCleanCallback(n),r()}):r()})}},editor:function(n){var s=e(".text-editor textarea",n);s.length>0&&t.ajax&&t.ajax.check(a.ace,t.baseURL+"ext/ace/ace.js",function(n){var i=function(){a.ace_loaded=!0,s.each(function(){var a=e(this),n=a.parents(".text-editor"),s=n.data(),i=ace.require("ace/ext/modelist"),r=s.amsEditorMode||i.getModeForPath(s.amsEditorFilename||"editor.txt").mode,o=e("<div>",{position:"absolute",width:a.width(),height:a.height(),class:a.attr("class")}).insertBefore(a);a.css("display","none");var c=ace.edit(o[0]),l={mode:r,tabSize:4,useSoftTabs:!1,showGutter:!0,showLineNumbers:!0,printMargin:132,showInvisibles:!0},d=e.extend({},l,s.amsEditorOptions);d=t.executeFunctionByName(s.amsEditorInitCallback,a,d)||d,c.setOptions(d),c.session.setValue(a.val()),c.session.on("change",function(){a.val(c.session.getValue())}),n.data("editor",c),t.executeFunctionByName(s.amsEditorAfterInitCallback,a,c,d)})};n?(ace.config.set("basePath",t.baseURL+"ext/ace"),t.ajax.check(a.ace_loaded,[t.baseURL+"ext/ace/ext-modelist.js"],i)):i()})},imgareaselect:function(a){var n=e(".imgareaselect",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.imgAreaSelect,t.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-imgareaselect"+t.devext+".css","jquery-imgareaselect",function(){n.each(function(){var a=e(this),n=a.data(),s=n.amsImgareaselectParent?a.parents(n.amsImgareaselectParent):"body",i={instance:!0,handles:!0,parent:s,x1:n.amsImgareaselectX1||0,y1:n.amsImgareaselectY1||0,x2:n.amsImgareaselectX2||n.amsImgareaselectImageWidth,y2:n.amsImgareaselectY2||n.amsImgareaselectImageHeight,imageWidth:n.amsImgareaselectImageWidth,imageHeight:n.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:n.amsImgareaselectRatio,onSelectEnd:t.getFunctionByName(n.amsImgareaselectSelectEnd)||function(a,t){var i=n.amsImgareaselectTargetField||"image_";e('input[name="'+i+'x1"]',s).val(t.x1),e('input[name="'+i+'y1"]',s).val(t.y1),e('input[name="'+i+'x2"]',s).val(t.x2),e('input[name="'+i+'y2"]',s).val(t.y2)}},r=e.extend({},i,n.amsImgareaselectOptions);r=t.executeFunctionByName(n.amsImgareaselectInitCallback,a,r)||r;var o=a.imgAreaSelect(r);t.executeFunctionByName(n.amsImgareaselectAfterInitCallback,a,o,r),setTimeout(function(){o.update()},250)})})})},fancybox:function(a){var n=e(".fancybox",a);n.length>0&&t.ajax&&t.ajax.check(e.fn.fancybox,t.baseURL+"ext/jquery-fancybox-2.1.5"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-fancybox-2.1.5"+t.devext+".css","jquery-fancybox",function(){n.each(function(){var a,n=e(this),s=n.data(),i=n;s.amsFancyboxElements&&(i=e(s.amsFancyboxElements,n));var r=(s.amsFancyboxHelpers||"").split(/\s+/);if(r.length>0)for(a=0;a<r.length;a++)switch(r[a]){case"buttons":t.ajax&&t.ajax.check(e.fancybox.helpers.buttons,t.baseURL+"ext/fancybox-helpers/fancybox-buttons"+t.devext+".js");break;case"thumbs":t.ajax&&t.ajax.check(e.fancybox.helpers.thumbs,t.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+t.devext+".js");break;case"media":t.ajax&&t.ajax.check(e.fancybox.helpers.media,t.baseURL+"ext/fancybox-helpers/fancybox-media"+t.devext+".js")}var o={type:s.amsFancyboxType,padding:s.amsFancyboxPadding||10,margin:s.amsFancyboxMargin||10,loop:s.amsFancyboxLoop,beforeLoad:t.getFunctionByName(s.amsFancyboxBeforeLoad)||function(){var a;if(s.amsFancyboxTitleGetter&&(a=t.executeFunctionByName(s.amsFancyboxTitleGetter,this)),!a){var n=e("*:first",this.element);(a=n.attr("original-title")||n.attr("title"))||(a=e(this.element).attr("original-title")||e(this.element).attr("title"))}this.title=a},afterLoad:t.getFunctionByName(s.amsFancyboxAfterLoad),helpers:{title:{type:"inside"}}};if(r.length>0)for(a=0;a<r.length;a++)switch(r[a]){case"buttons":o.helpers.buttons={position:s.amsFancyboxButtonsPosition||"top"};break;case"thumbs":o.helpers.thumbs={width:s.amsFancyboxThumbsWidth||50,height:s.amsFancyboxThumbsHeight||50};break;case"media":o.helpers.media=!0}var c=e.extend({},o,s.amsFancyboxOptions);c=t.executeFunctionByName(s.amsFancyboxInitCallback,n,c)||c;var l=i.fancybox(c);t.executeFunctionByName(s.amsFancyboxAfterInitCallback,n,l,c)})})})},chart:function(a){var n=e(".chart",a);n.length>0&&t.ajax&&t.ajax.check([window.Flot,e.color],[t.baseURL+"ext/flot/jquery.canvaswrapper"+t.devext+".js",t.baseURL+"ext/flot/jquery.colorhelpers"+t.devext+".js"],function(){t.ajax.check(e.fn.plot,t.baseURL+"ext/flot/jquery.flot"+t.devext+".js",function(){n.each(function(){function a(){var a=e.extend({},o,r.amsChartOptions);a=t.executeFunctionByName(r.amsChartInitCallback,i,a)||a;var s=r.amsChartData,c=r.amsChartDataLoader;c?e.getJSON(c,s).done(function(t){a=e.extend({},a,t.settings),n(t.data,a)}):n(r,a)}function n(e,a){e=t.executeFunctionByName(r.amsChartInitData,i,e)||e,s=i.plot(e,a),t.executeFunctionByName(r.amsChartAfterInitCallback,i,s,a)}var s,i=e(this),r=i.data(),o={},c=(r.amsChartPlugins||"").split(/\s+/),l=[];if(c.length>0)for(var d in c)if(c.hasOwnProperty(d)){var m=c[d];(function(a){for(var t in e.plot.plugins)if(e.plot.plugins.hasOwnProperty(t)){var n=e.plot.plugins[t];if(n.name===a)return n}return null})(m)||l.push(t.getScript(t.baseURL+"ext/flot/jquery.flot."+m+t.devext+".js"))}l.length>0?e.when.apply(e,l).then(function(){a()}):a()})})})},graphs:function(a){var n=e(".sparkline",a);n.length>0&&t.ajax&&t.ajax.check(t.graphs,t.baseURL+"myams-graphs"+t.devext+".js",function(){t.graphs.init(n)})},scrollbars:function(a){var n=e(".scrollbar",a);n.length>0&&t.ajax&&t.ajax.check(e.event.special.mousewheel,t.baseURL+"ext/jquery-mousewheel.min.js",function(){t.ajax.check(e.fn.mCustomScrollbar,t.baseURL+"ext/jquery-mCustomScrollbar"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar",function(){n.each(function(){var a=e(this),n=a.data(),s={theme:n.amsScrollbarTheme||"light"},i=e.extend({},s,n.amsScrollbarOptions);i=t.executeFunctionByName(n.amsScrollbarInitCallback,a,i)||i;var r=a.mCustomScrollbar(i);t.executeFunctionByName(n.amsScrollbarAfterInitCallback,a,r,i)})})})})}})}(jQuery,this),function(e,a){var t=a.MyAMS;t.callbacks={init:function(a){e("[data-ams-callback]",a).each(function(){var a=this,n=e(a).data();try{var s=JSON.parse(n.amsCallback);Array.isArray(s)||(s=[s])}catch(e){s=n.amsCallback.split(/\s+/)}for(var i=0;i<s.length;i++){var r=s[i];if("string"==typeof r){var o=t.getFunctionByName(r),c=n.amsCallbackOptions;"string"==typeof c&&(c=c.unserialize()),void 0===o?n.amsCallbackSource?t.getScript(n.amsCallbackSource,function(e){t.executeFunctionByName(e,a,c)}(r),{async:void 0===n.amsCallbackAsync||n.amsCallbackAsync}):console&&console.warn&&console.warn("Undefined callback: "+n.amsCallback):o.call(a,c)}else o=t.getFunctionByName(r.callback),"string"==typeof(c=r.options)&&(c=c.unserialize()),void 0===o?r.source?t.getScript(r.source,function(e){t.executeFunctionByName(e.callback,a,e.options)}(r),{async:void 0===r.async||r.async}):console&&console.warn&&console.warn("Undefined callback: "+r.callback):o.call(a,r.options)}})},alert:function(a){var n=e(this).data(),s=e.extend({},a,n.amsAlertOptions),i=e(n.amsAlertParent||s.parent||this),r=n.amsAlertStatus||s.status||"info",o=n.amsAlertHeader||s.header,c=n.amsAlertMessage||s.message,l=n.amsAlertSubtitle||s.subtitle,d=void 0===n.amsAlertMargin?void 0!==s.margin&&s.margin:n.amsAlertMargin;t.skin&&t.skin.alert(i,r,o,c,l,d)},messageBox:function(a){var n=e(this).data(),s=e.extend({},a,n.amsMessageboxOptions),i=e.extend({},s,{title:n.amsMessageboxTitle||s.title||"",content:n.amsMessageboxContent||s.content||"",icon:n.amsMessageboxIcon||s.icon,number:n.amsMessageboxNumber||s.number,timeout:n.amsMessageboxTimeout||s.timeout}),r=n.amsMessageboxStatus||s.status||"info",o=t.getFunctionByName(n.amsMessageboxCallback||s.callback);t.skin&&t.skin.messageBox(r,i,o)},smallBox:function(a){var n=e(this).data(),s=e.extend({},a,n.amsSmallboxOptions),i=e.extend({},s,{title:n.amsSmallboxTitle||s.title||"",content:n.amsSmallboxContent||s.content||"",icon:n.amsSmallboxIcon||s.icon,iconSmall:n.amsSmallboxIconSmall||s.iconSmall,timeout:n.amsSmallboxTimeout||s.timeout}),r=n.amsSmallboxStatus||s.status||"info",o=t.getFunctionByName(n.amsSmallboxCallback||s.callback);t.skin&&t.skin.smallBox(r,i,o)}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.events={init:function(a){e("[data-ams-events-handlers]",a).each(function(){var a=e(this),n=a.data("ams-events-handlers");if(n)for(var s in n)n.hasOwnProperty(s)&&a.on(s,t.getFunctionByName(n[s]))})}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.container={changeOrder:function(a,t){e('input[name="'+e(this).data("ams-input-name")+'"]',e(this)).val(t.join(";"))},deleteElement:function(){return function(){var a=e(this);t.skin&&t.skin.bigBox({title:t.i18n.WARNING,content:'<i class="text-danger fa fa-fw fa-bell"></i>&nbsp; '+t.i18n.DELETE_WARNING,status:"info",buttons:t.i18n.BTN_OK_CANCEL},function(e){if(e===t.i18n.BTN_OK){var n=a.parents("tr").first(),s=n.parents("table").first(),i=n.data("ams-location")||s.data("ams-location")||"";i&&(i+="/");var r=n.data("ams-delete-target")||s.data("ams-delete-target")||"delete-element.json",o=n.data("ams-element-name");t.ajax&&t.ajax.post(i+r,{object_name:o},function(e,a){"success"===e.status?(s.hasClass("datatable")?s.dataTable().fnDeleteRow(n[0]):n.remove(),e.handle_json&&t.ajax.handleJSON(e)):t.ajax.handleJSON(e)})}})}},switchElementVisibility:function(){return function(){var a=e(this),n=a.parents("td").first(),s=a.parents("tr").first(),i=s.parents("table");e("i",a).attr("class","fa fa-fw fa-spinner fa-pulse"),t.ajax&&t.ajax.post(i.data("ams-location")+"/"+(n.data("ams-attribute-switcher")||i.data("ams-attribute-switcher")),{object_name:s.data("ams-element-name")},function(n,s){"success"===n.status?n.visible?e("i",a).attr("class","fa fa-fw fa-eye"):e("i",a).attr("class","fa fa-fw fa-eye-slash text-danger"):t.ajax.handleJSON(n)})}},switchElementAttribute:function(){return function(){var a=e(this),n=a.parents("td").first(),s=n.data("ams-switcher-attribute-name"),i=a.parents("tr").first(),r=i.parents("table");e("i",a).attr("class","fa fa-fw fa-spinner fa-pulse"),t.ajax&&t.ajax.post(r.data("ams-location")+"/"+(n.data("ams-attribute-switcher")||r.data("ams-attribute-switcher")),{object_name:i.data("ams-element-name")},function(n,i){"success"===n.status?n[s]||n.on?e("i",a).attr("class",r.data("ams-"+s+"-icon-on")||"fa fa-fw fa-check-square-o"):e("i",a).attr("class",r.data("ams-"+s+"-icon-off")||"fa fa-fw fa-check-square txt-color-silver opacity-75"):t.ajax.handleJSON(n)})}},exportTableToTSV:function(){return function(){var n=e(this);t.ajax&&t.ajax.check(a.saveAs,t.baseURL+"ext/js-filesaver"+t.devext+".js",function(){var a=e("table.datatable",n.parents(".ams-widget:first")),t=a.dataTable(),s="";e("th",a).each(function(a){a>0&&(s+="\t"),s+=e(this).text()}),s+="\n",e(t.fnGetData()).each(function(){e(this).each(function(e){e>0&&(s+="\t"),s+=this}),s+="\n"});var i=new Blob([s],{type:"text/tsv; charset=utf-8"});saveAs(i,"export.tsv")})}}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.tree={switchTableNode:function(){function a(t){e('tr[data-ams-tree-node-parent-id="'+t+'"]').each(function(){var t=e(this);a(t.data("ams-tree-node-id")),t.remove()})}var n=e(this),s=e("i.switch",n),i=n.parents("tr").first(),r=i.parents("table").first();if(s.hasClass("fa-minus-square-o"))a(i.data("ams-tree-node-id")),s.removeClass("fa-minus-square-o").addClass("fa-plus-square-o");else{var o=i.data("ams-location")||r.data("ams-location")||"",c=i.data("ams-tree-nodes-target")||r.data("ams-tree-nodes-target")||"get-tree-nodes.json",l=i.data("ams-element-name");s.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),t.ajax&&t.ajax.post(o+"/"+l+"/"+c,{can_sort:!e("td.sorter",i).is(":empty")},function(a,n){if(a.length>0){for(var o=i,c=0;c<a.length;c++){var l=e(a[c]);l.insertAfter(o).addClass("no-drag-handle"),t.initContent&&t.initContent(l),o=l}r.hasClass("table-dnd")&&r.tableDnDUpdate()}s.removeClass("fa-cog fa-spin").addClass("fa-minus-square-o")})}},switchTree:function(){var a=e(this),n=e("i.switch",a),s=e(this).parents("table").first(),i=s.data("ams-tree-node-id");if(n.hasClass("fa-minus-square-o"))e("tr[data-ams-tree-node-parent-id]").filter('tr[data-ams-tree-node-parent-id!="'+i+'"]').remove(),e("i.switch",s).removeClass("fa-minus-square-o").addClass("fa-plus-square-o");else{var r=e("tbody tr",s).first(),o=s.data("ams-location")||"",c=s.data("ams-tree-nodes-target")||"get-tree.json";n.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),t.ajax&&t.ajax.post(o+"/"+c,{can_sort:!e("td.sorter",r).is(":empty")},function(a,i){e("tr[data-ams-tree-node-id]",s).remove();for(var r=null,o=0;o<a.length;o++){var c=e(a[o]);null===r?c.appendTo(e("tbody",s)):c.insertAfter(r),c.addClass("no-drag-handle"),t.initContent&&t.initContent(c),r=c}s.hasClass("table-dnd")&&s.tableDnDUpdate(),e("i.switch",s).removeClass("fa-plus-square-o").addClass("fa-minus-square-o"),n.removeClass("fa-cog fa-spin").addClass("fa-minus-square-o")})}},sortTree:function(a,n){var s=e(a).data(),i=s.amsTabledndDropTarget;if(i){(n=e(n)).data("ams-disabled-handlers","click");try{var r=n.parents("table").first().data("ams-tree-node-id"),o=n.data("ams-tree-node-id"),c=n.data("ams-tree-node-parent-id"),l=n.prev("tr");if(l.exists()){var d=l.data("ams-tree-node-id"),m=e(".switch",l);if(m.hasClass("fa-minus-square-o"))if(c===d)var u="reorder";else u="reparent";else u=c===(d=l.data("ams-tree-node-parent-id"))?"reorder":"reparent"}else m=null,u=c===(d=r)?"reorder":"reparent";var f=t.getFunctionByName(i);if("function"==typeof f)f.call(table,a,p);else{if(!i.startsWith(window.location.protocol)){var h=s.amsLocation;h&&(i=h+"/"+i)}var p={action:u,child:o,parent:d,order:JSON.stringify(e("tr[data-ams-tree-node-id]").listattr("data-ams-tree-node-id")),can_sort:!e("td.sorter",n).is(":empty")};t.ajax&&t.ajax.post(i,p,function(a){function s(a){e('tr[data-ams-tree-node-parent-id="'+a+'"]').each(function(){var a=e(this);s(a.attr("data-ams-tree-node-id")),a.remove()})}if(a.status)t.ajax.handleJSON(a);else{var i=e(n).parents("tbody").first();if(s(o),"reparent"===p.action){s(d),n.remove();for(var r=e('tr[data-ams-tree-node-id="'+d+'"]'),c=0;c<a.length;c++){var l=e(a[c]);r.exists()?l.insertAfter(r).addClass("no-drag-handle"):l.prependTo(i).addClass("no-drag-handle"),t.initContent&&t.initContent(l),r=l}}e("tr").parents("table").tableDnDUpdate()}})}}finally{setTimeout(function(){e(n).removeData("ams-disabled-handlers")},50)}}return!1}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.skin={_setPageHeight:function(){var a=e("#main").height(),n=e(window).height()-t.navbarHeight;a>n?t.root.css("min-height",a+t.navbarHeight):t.root.css("min-height",n),t.leftPanel.css("min-height",n),t.leftPanel.css("max-height",n)},_checkMobileWidth:function(){e(window).width()<979?t.root.addClass("mobile-view-activated"):t.root.hasClass("mobile-view-activated")&&t.root.removeClass("mobile-view-activated")},_showShortcutButtons:function(){t.shortcuts&&t.shortcuts.animate({height:"show"},200,"easeOutCirc"),t.root.addClass("shortcut-on")},_hideShortcutButtons:function(){t.shortcuts&&t.shortcuts.animate({height:"hide"},300,"easeOutCirc"),t.root.removeClass("shortcut-on")},checkNotification:function(){var a=e(".badge","#user-activity >span");parseInt(a.text())>0?a.removeClass("hidden").addClass("bg-color-red bounceIn animated"):a.addClass("hidden").removeClass("bg-color-red bounceIn animated")},refreshNotificationsPanel:function(a){var t=e(this);t.addClass("disabled"),e("i",t).addClass("fa-spin"),e('input[name="activity"]:checked',"#user-activity").change(),e("i",t).removeClass("fa-spin"),t.removeClass("disabled")},refreshContent:function(a){var n=e('[id="'+a.object_id+'"]');return n.replaceWith(e(a.content)),n=e('[id="'+a.object_id+'"]'),t.initContent&&t.initContent(n),n},refreshImage:function(a){e('img[src^="'+a.src+'"]').attr("src",a.target)},refreshWidget:function(a){var n=e('[id="'+a.parent_id+'"]'),s=e('[name="'+a.widget_name+'"]',n);s.exists()||(s=e('[name="'+a.widget_name+':list"]',n));var i=s.parents(".input").last();return i.html(a.content),t.initContent&&t.initContent(i),i},refreshTable:function(a){var n=e('[id="'+a.object_id+'"]').parents(".ams-widget:first");return n.replaceWith(e(a.table)),n=e('[id="'+a.object_id+'"]').parents(".ams-widget:first"),t.initContent&&t.initContent(n),n},refreshSwitchedTable:function(e){var a=t.skin.refreshTable(e);if(a){var n=a.siblings("legend");n.parents("fieldset:first").hasClass("switched")&&n.click()}},refreshRow:function(a){var n=e('tr[id="'+a.object_id+'"]'),s=n.parents("table").first(),i=e(a.row);return n.replaceWith(i),t.initContent&&t.initContent(i),s.hasClass("table-dnd")&&(i.addClass("no-drag-handle"),s.tableDnDUpdate()),i},refreshRowCell:function(a){var n=e('tr[id="'+a.object_id+'"]'),s=n.parents("table").first(),i=e("tr",e("thead",s)),r=e('th[data-ams-column-name="'+a.col_name+'"]',i),o=e("th",i).index(r);if(o>-1){var c=e(e("td",n).get(o));c.html(a.cell),t.initContent&&t.initContent(c)}},switchCellContent:function(a){var n=e(this),s=e("i.switch",n),i=n.parents("td"),r=e(n.data("ams-switch-target")||".inner-table-form",i),o=n.parents("tr");if(s.hasClass("fa-plus-square-o")){var c=o.parents("table");r.html('<h1 class="loading"><i class="fa fa-gear fa-spin"></i></h1>'),t.ajax&&t.ajax.post(c.data("ams-location")+"/"+n.data("ams-switch-handler"),{object_name:o.data("ams-element-name")},function(e){r.html(e),e&&(t.initContent&&t.initContent(r),s.removeClass("fa-plus-square-o").addClass("fa-minus-square-o"))})}else t.skin.cleanContainer(r),r.empty(),s.removeClass("fa-minus-square-o").addClass("fa-plus-square-o")},_initDesktopWidgets:function(n){if(t.enableWidgets){var s=e(".ams-widget",n);s.length>0&&t.ajax&&t.ajax.check(e.fn.MyAMSWidget,t.baseURL+"myams-widgets"+t.devext+".js",function(){s.each(function(){var a=e(this),n=a.data(),s=e.extend({},{deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"},n.amsWidgetOptions);s=t.executeFunctionByName(n.amsWidgetInitcallback,a,s)||s,a.MyAMSWidget(s)}),a.MyAMSWidget.initWidgetsGrid(e(".ams-widget-grid",n))})}},_initMobileWidgets:function(e){t.enableMobile&&t.enableWidgets&&t.skin._initDesktopWidgets(e)},alert:function(a,n,s,i,r,o){"error"===n&&(n="danger"),e(".alert-"+n,a).not(".persistent").remove();var c='<div class="'+(o?"margin-10":"")+" alert alert-block alert-"+n+' padding-5 fade in"><a class="close" data-dismiss="alert"><i class="fa fa-check"></i></a><h4 class="alert-heading"><i class="fa fa-fw fa-warning"></i> '+s+"</h4>"+(r?"<p>"+r+"</p>":"");if("string"==typeof i)c+="<ul><li>"+i+"</li></ul>";else if(i){c+="<ul>";for(var l in i)e.isNumeric(l)&&(c+="<li>"+i[l]+"</li>");c+="</ul>"}e(c+="</div>").insertBefore(a),a.exists&&t.skin.scrollTo(a,{offset:{top:-50}})},bigBox:function(e,a){t.ajax&&t.ajax.check(t.notify,t.baseURL+"myams-notify"+t.devext+".js",function(){t.notify.messageBox(e,a)})},messageBox:function(e,a,n){"object"==typeof e&&(n=a,a=e||{},e="info"),t.ajax&&t.ajax.check(t.notify,t.baseURL+"myams-notify"+t.devext+".js",function(){switch(e){case"error":case"danger":a.color="#C46A69";break;case"warning":a.color="#C79121";break;case"success":a.color="#739E73";break;default:a.color=a.color||"#3276B1"}a.sound=!1,t.notify.bigBox(a,n)})},smallBox:function(e,a,n){"object"==typeof e&&(n=a,a=e||{},e="info"),t.ajax&&t.ajax.check(t.notify,t.baseURL+"myams-notify"+t.devext+".js",function(){switch(e){case"error":case"danger":a.color="#C46A69";break;case"warning":a.color="#C79121";break;case"success":a.color="#739E73";break;default:a.color=a.color||"#3276B1"}a.sound=!1,t.notify.smallBox(a,n)})},scrollTo:function(a,n){t.ajax&&t.ajax.check(e.scrollTo,t.baseURL+"ext/jquery-scrollto-2.1.2"+t.devext+".js",function(){var t=e("body"),s=n.offset||0;t.hasClass("fixed-header")&&(s-=e("#header").height()),t.hasClass("fixed-ribbon")&&(s-=e("#ribbon").height()),n=e.extend({},n,{offset:s}),e.scrollTo(a,n)})},_drawBreadCrumb:function(){var a=e("OL.breadcrumb","#ribbon");e("li",a).not(".parent").remove(),e("li",a).exists()||a.append(e("<li></li>").append(e("<a></a>").text(t.i18n.HOME).addClass("padding-right-5").attr("href",e('nav a[href!="#"]:first').attr("href")))),e("LI.active >A","nav").each(function(){var t=e(this),n=e.trim(t.clone().children(".badge").remove().end().text()),s=e("<li></li>").append(t.attr("href").replace(/^#/,"")?e("<a></a>").html(n).attr("href",t.attr("href")):n);a.append(s)})},checkURL:function(){function a(a){e(".active",s).removeClass("active"),a.addClass("open").addClass("active"),a.parents("li").addClass("open active").children("ul").addClass("active").show(),a.parents("li:first").removeClass("open"),a.parents("ul").addClass(a.attr("href").replace(/^#/,"")?"active":"").show()}var n,s=e("nav"),i=location.hash,r=i.replace(/^#/,"");if(r){var o=e("#content");o.exists()||(o=e("body")),(n=e('A[href="'+i+'"]',s)).exists()&&a(n),t.skin.loadURL(r,o,{afterLoadCallback:function(){var a=e("html head title").data("ams-title-prefix");document.title=(a?a+" > ":"")+(e("[data-ams-page-title]:first",o).data("ams-page-title")||n.attr("title")||document.title)}})}else{var c=e("[data-ams-active-menu]").data("ams-active-menu");(n=c?e('A[href="'+c+'"]',s):e('>UL >LI >A[href!="#"]',s).first()).exists()&&(a(n),c?t.skin._drawBreadCrumb():window.location.hash=n.attr("href"))}},_clean_callbacks:[],registerCleanCallback:function(e){var a=t.skin._clean_callbacks;a.indexOf(e)<0&&a.push(e)},unregisterCleanCallback:function(e){var a=t.skin._clean_callbacks,n=a.indexOf(e);n>=0&&a.splice(n,1)},cleanContainer:function(e){for(var a=t.skin._clean_callbacks,n=0;n<a.length;n++)a[n].call(e)},loadURL:function(a,n,s,i){a.startsWith("#")&&(a=a.substr(1)),"function"==typeof s?(i=s,s={}):void 0===s&&(s={}),n=e(n);var r={type:"GET",url:a,dataType:"html",cache:!1,beforeSend:function(){if(s&&s.preLoadCallback&&t.executeFunctionByName(s.preLoadCallback,this,s.preLoadCallbackOptions),t.skin.cleanContainer(n),n.html('<h1 class="loading"><i class="fa fa-cog fa-spin"></i> '+t.i18n.LOADING+" </h1>"),n[0]===e("#content")[0]){t.skin._drawBreadCrumb();var a=e("html head title").data("ams-title-prefix");document.title=(a?a+" > ":"")+e(".breadcrumb LI:last-child").text(),e("html, body").animate({scrollTop:0},"fast")}else n.animate({scrollTop:0},"fast")},success:function(a,r,o){if(i)t.executeFunctionByName(i,this,a,r,o,s);else{var c=t.ajax&&t.ajax.getResponse(o);if(c){var l=c.contentType,d=c.data;switch(e(".loading",n).remove(),l){case"json":t.ajax.handleJSON(d,n);break;case"script":case"xml":break;case"html":case"text":default:n.parents(".hidden").removeClass("hidden"),e(".alert",n.parents(".alerts-container")).remove(),n.css({opacity:"0.0"}).html(a).removeClass("hidden").delay(50).animate({opacity:"1.0"},300),t.initContent&&t.initContent(n),t.form&&t.form.setFocus(n)}s&&s.afterLoadCallback&&t.executeFunctionByName(s.afterLoadCallback,this,s.afterLoadCallbackOptions),t.stats&&t.stats.logPageview()}}},error:function(e,a,i){n.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+t.i18n.ERROR+i+"</h3>"+e.responseText),s&&s.afterErrorCallback&&t.executeFunctionByName(s.afterErrorCallback,this)},async:void 0===s.async||s.async},o=e.extend({},r,s);e.ajax(o)},setLanguage:function(e,a){var n=a.lang;switch(a.handler_type||"json"){case"json":var s=a.method||"setUserLanguage";t.jsonrpc&&t.jsonrpc.post(s,{lang:n},function(){window.location.reload(!0)});break;case"ajax":var i=a.href||"setUserLanguage";t.ajax&&t.ajax.post(i,{lang:n},function(){window.location.reload(!0)})}},logout:function(){window.location=t.loginURL}}}(jQuery,this),function(e,a){a.MyAMS.stats={logPageview:function(e){if(void 0!==a._gaq){var t=a.window.location;a._gaq.push(["_trackPageview",e||t.pathname+t.hash])}},logEvent:function(e,t,n){void 0!==a._gaq&&("object"==typeof e&&(t=e.action,n=e.label,e=e.category),a._gaq.push(["_trackEvent",e,t,n]))}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.initPage=function(){var n=e("body");t.root=n,t.leftPanel=e("#left-panel"),t.shortcuts=e("#shortcuts"),t.plugins.initData(n);var s=e.ajaxSettings.xhr;e.ajaxSetup({beforeSend:function(e,n){if(t.safeMethods.indexOf(n.type)<0&&void 0!==a.Cookies){var s=Cookies.get(t.csrfCookieName);s&&e.setRequestHeader(t.csrfHeaderName,s)}},progress:t.ajax&&t.ajax.progress,progressUpload:t.ajax&&t.ajax.progress,xhr:function(){var e=s();if(e&&"function"==typeof e.addEventListener){var a=this;a&&a.progress&&e.addEventListener("progress",function(e){a.progress(e)},!1)}return e}}),e(document).ajaxStart(t.ajax&&t.ajax.start),e(document).ajaxStop(t.ajax&&t.ajax.stop),e(document).ajaxError(t.error&&t.error.ajax);var i=a.localStorage&&a.localStorage.getItem("window-state");i&&n.addClass(i),t.isMobile?(t.root.addClass("mobile-detected"),t.device="mobile",t.enableFastclick&&t.ajax&&t.ajax.check(e.fn.noClickDelay,t.baseURL+"/ext/jquery-smartclick"+t.devext+".js",function(){e("NAV UL A").noClickDelay(),e("A","#hide-menu").noClickDelay()})):(t.root.addClass("desktop-detected"),t.device="desktop"),e("#show-shortcuts").click(function(e){t.shortcuts.is(":visible")?t.skin&&t.skin._hideShortcutButtons():t.skin&&t.skin._showShortcutButtons(),e.preventDefault()}),t.shortcuts.click(function(e){t.skin&&t.skin._hideShortcutButtons()}),e(document).mouseup(function(e){t.shortcuts.is(e.target)||0!==t.shortcuts.has(e.target).length||t.skin&&t.skin._hideShortcutButtons()}),e("#search-mobile").click(function(){t.root.addClass("search-mobile")}),e("#cancel-search-js").click(function(){t.root.removeClass("search-mobile")}),e(".activity-button","#user-activity").click(function(a){var t=e("#user-activity"),n=e(".ajax-dropdown",t);n.is(":visible")?(n.fadeOut(150),t.removeClass("active")):(n.css("left",-n.innerWidth()+t.innerWidth()).fadeIn(150),t.addClass("active")),a.preventDefault()}),t.skin&&t.skin.checkNotification(),e(document).mouseup(function(a){var t=e(".ajax-dropdown");t.is(a.target)||0!==t.has(a.target).length||t.fadeOut(150).prev().removeClass("active")}),e('input[name="activity"]').change(function(a){var n=e(this).data("ams-url");if(n){a.preventDefault(),a.stopPropagation();var s=t.getFunctionByName(n);if("function"==typeof s&&(n=s.call(this)),"function"==typeof n)n.call(this);else{var i=e(".ajax-notifications");t.skin&&t.skin.loadURL(n,i)}}}),e("a","#user-menu LI.logout").click(function(a){a.preventDefault(),a.stopPropagation(),t.loginURL=e(this).attr("href"),t.skin&&t.skin.bigBox({title:"<i class='fa fa-sign-out txt-color-orangeDark'></i> "+t.i18n.LOGOUT+" <span class='txt-color-orangeDark'><strong>"+e("#show-shortcut").text()+"</strong></span> ?",content:t.i18n.LOGOUT_COMMENT,buttons:t.i18n.BTN_YES_NO},function(e){e===t.i18n.BTN_YES&&(t.root.addClass("animated fadeOutUp"),setTimeout(t.skin.logout,1e3))})});var r=e("nav");e("UL",r).myams_menu({accordion:!1!==r.data("ams-menu-accordion"),speed:t.menuSpeed}),e("#hide-menu").find(">:first-child >A").click(function(e){n.toggleClass("hidden-menu"),a.localStorage&&(n.hasClass("hidden-menu")?a.localStorage.setItem("window-state","hidden-menu"):a.localStorage.setItem("window-state","")),e.preventDefault()}),e(".minifyme").click(function(t){n.toggleClass("minified"),a.localStorage&&(n.hasClass("minified")?a.localStorage.setItem("window-state","minified"):a.localStorage.setItem("window-state","")),e(this).effect("highlight",{},500),t.preventDefault()}),e("#refresh").click(function(e){t.skin&&t.skin.bigBox({title:"<i class='fa fa-refresh' style='color: green'></i> "+t.i18n.CLEAR_STORAGE_TITLE,content:t.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+t.i18n.BTN_CANCEL+"]["+t.i18n.BTN_OK+"]"},function(e){e===t.i18n.BTN_OK&&localStorage&&(localStorage.clear(),location.reload())}),e.preventDefault()}),n.on("click",function(a){var t=e(this);t.is(a.target)||0!==t.has(a.target).length||0!==e(".popover").has(a.target).length||t.popover("hide")}),t.ajax&&t.ajax.check(e.resize,t.baseURL+"ext/jquery-resize"+t.devext+".js",function(){e("#main").resize(function(){t.skin._setPageHeight(),t.skin._checkMobileWidth()}),r.resize(function(){t.skin._setPageHeight()})}),t.ajaxNav&&(e(document).on("click",'a[href="#"]',function(e){e.preventDefault()}),e(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(a){var n=e(a.currentTarget),s=n.data("ams-disabled-handlers");if(!0!==s&&"click"!==s&&"all"!==s){var i=n.attr("href")||n.data("ams-url");if(i&&!i.startsWith("javascript")&&!n.attr("target")&&!0!==n.data("ams-context-menu")){a.preventDefault(),a.stopPropagation();var r,o,c;i.indexOf("?")>=0?(o=(r=i.split("?"))[0],c=r[1].unserialize()):(o=i,c=void 0);var l=t.getFunctionByName(o);if("function"==typeof l&&(i=l.call(n,c)),"function"==typeof i)i.call(n,c);else if(i=i.replace(/\%23/,"#"),a.ctrlKey)window.open(i);else{var d=n.data("ams-target");d?"_blank"===d?window.open(i):t.form&&t.form.confirmChangedForm(d,function(){t.skin&&t.skin.loadURL(i,d,n.data("ams-link-options"),n.data("ams-link-callback"))}):t.form&&t.form.confirmChangedForm(function(){i.startsWith("#")?i!==location.hash&&(t.root.hasClass("mobile-view-activated")?(t.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=i},50)):window.location.hash=i):window.location=i})}}}}),e(document).on("click",'a[target="_blank"]',function(a){a.preventDefault();var n=e(a.currentTarget);window.open(n.attr("href")),t.stats&&t.stats.logEvent(n.data("ams-stats-category")||"Navigation",n.data("ams-stats-action")||"External",n.data("ams-stats-label")||n.attr("href"))}),e(document).on("click",'a[target="_top"]',function(a){a.preventDefault(),t.form&&t.form.confirmChangedForm(function(){window.location=e(a.currentTarget).attr("href")})}),e(window).on("hashchange",t.skin&&t.skin.checkURL)),e(document).off("click.modal").on("click",'[data-toggle="modal"]',function(a){var n=e(this),s=n.data("ams-disabled-handlers");!0!==s&&"click"!==s&&"all"!==s&&!0!==n.data("ams-context-menu")&&(!0===n.data("ams-stop-propagation")&&a.stopPropagation(),a.preventDefault(),t.dialog&&t.dialog.open(n),n.parents("#shortcut").exists()&&setTimeout(t.skin._hideShortcutButtons,300))}),e(document).on("click",'button[type="submit"], button.submit',function(){var a=e(this);e(a.get(0).form).data("ams-submit-button",a)}),t.initHandlers(document),e(document).on("keydown","textarea",function(a){10!==a.keyCode&&13!==a.keyCode||!a.ctrlKey&&!a.metaKey||e(this).closest("form").submit()}),e(document).on("change",'input[type="file"]',function(a){a.preventDefault();var t=e(this),n=t.parent(".button");n.exists()&&n.parent().hasClass("input-file")&&n.next('input[type="text"]').val(t.val())}),e(document).on("focus",'input[readonly="readonly"]',function(){e(this).blur()}),e(document).on("focusin",function(a){e(a.target).closest(".mce-window").length&&a.stopImmediatePropagation()}),e(document).on("click",".nav-tabs a[data-toggle=tab]",function(a){if(e(this).parent("li").hasClass("disabled"))return a.preventDefault(),!1}),e(document).on("show.bs.dropdown",".btn-group",function(){var a=e(this),t=a.children(".dropdown-menu"),n=a.get(0).getBoundingClientRect(),s=n.top,i=n.height,r=t.outerHeight();s>r&&e(window).height()-s<i+r&&a.addClass("dropup")}).on("hidden.bs.dropdown",".btn-group",function(){e(this).removeClass("dropup")}),e(document).on("show.bs.tab",function(a){var n=e(a.target);n.exists()&&"A"!==n.get(0).tagName&&(n=e("a[href]",n));var s=n.data();if(s&&s.amsUrl){if(s.amsTabLoaded)return;n.append('<i class="fa fa-spin fa-cog margin-left-5"></i>'),t.skin&&t.skin.loadURL(s.amsUrl,n.attr("href"),{afterLoadCallback:function(){s.amsTabLoadOnce&&n.data("ams-tab-loaded",!0),e("i",n).remove()},afterErrorCallback:function(){e("i",n).remove()}})}}),e(document).on("hide.bs.modal",function(a){var n=e(a.target);t.form&&t.form.confirmChangedForm(n,function(){var e=n.data("modal")||n.data("bs.modal");return e&&(e.isShown=!0),!0},function(){return a.preventDefault(),!1})}),e(document).on("myams.refresh",function(e,a){t.executeFunctionByName(a.handler||t.skin&&t.skin.refreshContent,e.target,a)}),t.initContent(document),t.ajaxNav&&r.exists()&&t.skin&&t.skin.checkURL(),t.form&&t.form.setFocus(document),e(window).on("beforeunload",t.form&&t.form.checkBeforeUnload)},t.initContent=function(a){e(".tipsy").remove(),e("[rel=tooltip]",a).tooltip(),e("[rel=popover]",a).popover(),e("[rel=popover-hover]",a).popover({trigger:"hover"}),t.plugins&&t.plugins.init(a),t.callbacks&&t.callbacks.init(a),t.events&&t.events.init(a),t.form&&t.form.init(a),"desktop"===t.device?t.skin&&t.skin._initDesktopWidgets(a):t.skin&&t.skin._initMobileWidgets(a),t.skin&&t.skin._setPageHeight()},e(document).ready(function(){var a=(e=jQuery.noConflict())("HTML");a.removeClass("no-js").addClass("js");var n=a.attr("lang")||a.attr("xml:lang");n&&!n.startsWith("en")?(t.lang=n,t.getScript(t.baseURL+"i18n/myams_"+n.substr(0,2)+t.devext+".js",function(){t.initPage()})):t.initPage()})}(jQuery,this);