--- a/src/pyams_skin/resources/js/myams-plugins.min.js Fri Jul 26 12:40:31 2019 +0200
+++ b/src/pyams_skin/resources/js/myams-plugins.min.js Fri Jul 26 12:42:05 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"),i=t.attr("height");n&&i&&t.get(0).setAttribute("viewBox","0 0 "+Math.round(parseFloat(n))+" "+Math.round(parseFloat(i))),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(),i={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},s=e.extend({},i,n.amsHintOptions);s=t.executeFunctionByName(n.amsHintInitCallback,a,s)||s;var r=a.tipsy(s);t.executeFunctionByName(n.amsHintAfterInitCallback,a,r,s)})})})},contextMenu:function(a){var n=e(".context-menu",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={menuSelector:n.amsContextmenuSelector,menuSelected:t.helpers&&t.helpers.contextMenuHandler},s=e.extend({},i,n.amsContextmenuOptions);s=t.executeFunctionByName(n.amsContextmenuInitCallback,a,s)||s;var r=a.contextMenu(s);t.executeFunctionByName(n.amsContextmenuAfterInitCallback,a,r,s)})},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(i){i.preventDefault();var s={};if(a.trigger("ams.switcher.before-switch",[a,s]),!s.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"),i=a.data();if(!i.amsChecker){var s=e('<label class="checkbox"></label>'),r=i.amsCheckerFieldname||"checker_"+t.generateId(),o=r.replace(/\./,"_"),c=i.amsCheckerHiddenPrefix,l=null,m=i.amsCheckerHiddenValueOn||"true",d=i.amsCheckerHiddenValueOff||"false",u=i.amsCheckerMarker||!1;c?l=e('<input type="hidden">').attr("name",c+r).val("on"===i.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(i.amsCheckerValue||!0).attr("checked","on"===i.amsCheckerState?"checked":null);i.amsCheckerReadonly?b.attr("disabled","disabled"):b.on("change",function(s){s.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(i.amsCheckerChangeHandler,a,o),!i.amsCheckerCancelDefault){var c=b.data("ams-checker-hidden-input");o?("disable"===i.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"===i.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(s),e(">label",a).attr("for",b.attr("id")),s.append("<i></i>").prependTo(a);var h=e("[required]",n);h.attr("data-required",!0),"on"===i.amsCheckerState?b.attr("checked",!0):("disable"===i.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(),i=e.extend({},{},a.data.amsSliderOptions);i=t.executeFunctionByName(n.amsSliderInitCallback,a,i)||i;var s=a.slider(i);t.executeFunctionByName(n.amsSliderAfterInitCallback,a,s,i)})})},draggable:function(a){var n=e(".draggable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={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)},s=e.extend({},i,n.amsDraggableOptions);s=t.executeFunctionByName(n.amsDraggableInitCallback,a,s)||s;var r=a.draggable(s);a.disableSelection(),t.executeFunctionByName(n.amsDraggableAfterInitCallback,a,r,s)})},droppable:function(a){var n=e(".droppable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={accept:n.amsdroppableAccept,drop:t.getFunctionByName(n.amsDroppableDrop)},s=e.extend({},i,n.amsDroppableOptions);s=t.executeFunctionByName(n.amsDroppableInitCallback,a,s)||s;var r=a.droppable(s);t.executeFunctionByName(n.amsDroppableAfterInitCallback,a,r,s)})},sortable:function(a){var n=e(".sortable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={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)},s=e.extend({},i,n.amsSortableOptions);s=t.executeFunctionByName(n.amsSortableInitCallback,a,s)||s;var r=a.sortable(s);a.disableSelection(),t.executeFunctionByName(n.amsSortableAfterInitCallback,a,r,s)})},resizable:function(a){var n=e(".resizable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={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)},s=e.extend({},i,n.amsResizableOptions);s=t.executeFunctionByName(n.amsResizableInitCallback,a,s)||s;var r=a.resizable(s);a.disableSelection(),t.executeFunctionByName(n.amsResizableAfterInitCallback,a,r,s)})},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(),i=e.extend({},{},n.amsTypeaheadOptions);i=t.executeFunctionByName(n.amsTypeaheadInitCallback,a,i)||i;var s=a.typeahead(i);t.executeFunctionByName(n.amsTypeaheadAfterInitCallback,a,s,i)})})},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(),i={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)},s=e.extend({},i,n.amsTreeviewOptions);s=t.executeFunctionByName(n.amsTreeviewInitcallback,a,s)||s;var r=a.treeview(s);t.executeFunctionByName(n.amsTreeviewAfterInitCallback,a,r,s)})})})},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 i={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(!i.initSelection){var s=a.data("ams-select2-values");s&&(i.initSelection=function(a,t){var n=[];e(a.val().split(i.separator)).each(function(){n.push({id:this,text:s[this]||this})}),t(n)})}}a.attr("readonly")?"hidden"===a.attr("type")&&(i.query=function(){return[]}):n.amsSelect2Query?(i.query=t.getFunctionByName(n.amsSelect2Query),i.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryUrl?(i.ajax={url:n.amsSelect2QueryUrl,quietMillis:n.amsSelect2QuietMillis||200,type:n.amsSelect2QueryType||"POST",dataType:n.amsSelect2QueryDatatype||"json",data:function(a,t,i){var s={};return s[n.amsSelect2QueryParamName||"query"]=a,s[n.amsSelect2PageParamName||"page"]=t,s[n.amsSelect2ContextParamName||"context"]=i,e.extend({},s,n.amsSelect2QueryOptions)},results:t.helpers&&t.helpers.select2QueryUrlResultsCallback},i.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryMethod?(i.query=function(i){var s={id:(new Date).getTime(),params:n.amsSelect2QueryParams||{},success:function(e){return t.helpers&&t.helpers.select2QueryMethodSuccessCallback.call(a,e,"success",i)},error:t.error&&t.error.show};s.params[n.amsSelect2QueryParamName||"query"]=i.term,s.params[n.amsSelect2PageParamName||"page"]=i.page,s.params[n.amsSelect2ContextParamName||"context"]=i.context,s=e.extend({},s,n.amsSelect2QueryOptions),s=t.executeFunctionByName(n.amsSelect2QueryInitCallback,a,s)||s,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,s)})})},i.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2Tags?i.tags=n.amsSelect2Tags:n.amsSelect2Data&&(i.data=n.amsSelect2Data),n.amsSelect2EnableFreeTags&&(i.createSearchChoice=function(e){return{id:e,text:(n.amsSelect2FreeTagsPrefix||t.i18n.SELECT2_FREETAG_PREFIX)+e}});var r=e.extend({},i,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(),i={placeholder:void 0===n.amsMaskeditPlaceholder?"X":n.amsMaskeditPlaceholder,complete:t.getFunctionByName(n.amsMaskeditComplete)},s=e.extend({},i,n.amsMaskeditOptions);s=t.executeFunctionByName(n.amsMaskeditInitCallback,a,s)||s;var r=a.mask(a.attr("data-mask"),s);t.executeFunctionByName(n.amsMaskeditAfterInitCallback,a,r,s)})})},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),i=n.data();a="object"==typeof i.inputMask?i.inputMask:{mask:i.inputMask.toString()};var s=e.extend({},a,i.amsInputmaskOptions);s=t.executeFunctionByName(i.amsInputmaskInitCallback,n,s)||s;var r=n.inputmask(s);t.executeFunctionByName(i.amsInputmaskAfterInitCallback,n,r,s)})})},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(),i={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},s=e.extend({},i,n.amsDatetimepickerOptions);s=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},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(),i={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},s=e.extend({},i,n.amsDatetimepickerOptions);s=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},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(),i={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect},s=e.extend({},i,n.amsDatetimepickerOptions);s=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},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(),i={position:n.amsColorpickerPosition||a.closest(".input").data("ams-colorpicker-position")||"bottom left"},s=e.extend({},i,n.amsColorpickerOptions);s=t.executeFunctionByName(n.amsColorpickerInitCallback,a,s)||s;var r=a.minicolors(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},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(),i={action:n.amsDnduploadAction||a.attr("action")||"upload-files",fieldname:n.amsDnduploadFieldname||"files",autosubmit:n.amsDnduploadAutosubmit},s=e.extend({},i,n.amsDnduploadOptions);s=t.executeFunctionByName(n.amsDnduploadInitCallback,a,s)||s;var r=a.dndupload(s);t.executeFunctionByName(n.amsDnduploadAfterInitcallback,a,r,s)})})})},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:first");t.length?e.insertAfter(t):e.insertAfter(a)}}),t.plugins&&t.plugins.i18n)){for(var i in t.plugins.i18n.validate)if(t.plugins.i18n.validate.hasOwnProperty(i)){var s=t.plugins.i18n.validate[i];"string"==typeof s&&s.indexOf("{0}")>-1&&(t.plugins.i18n.validate[i]=e.validator.format(s))}e.extend(e.validator.messages,t.plugins.i18n.validate)}n.each(function(){var a=e(this),n=a.data(),i={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!==a.attr("data-async")?void 0===n.amsFormInvalidHandler?function(t,n){e(".state-error",a).removeClass("state-error");for(var i=0;i<n.errorList.length;i++){var s=n.errorList[i],r=e(s.element).parents(".tab-pane").index()+1;if(r>0){var o=e(".nav-tabs",e(s.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):void 0};e("[data-ams-validate-rules]",a).each(function(a){0===a&&(i.rules={}),i.rules[e(this).attr("name")]=e(this).data("ams-validate-rules")});var s=e.extend({},i,n.amsValidateOptions);s=t.executeFunctionByName(n.amsValidateInitCallback,a,s)||s;var r=a.validate(s);t.executeFunctionByName(n.amsValidateAfterInitCallback,a,r,s)})})},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),i=n.data(),s=(i.amsDatatableExtensions||"").split(/\s+/),r=i.amsDatatableSdom||"W"+(s.indexOf("colreorder")>=0||s.indexOf("colreorderwithresize")>=0?"R":"")+"<'dt-top-row'"+(s.indexOf("colvis")>=0?"C":"")+(!1===i.amsDatatablePagination||!1===i.amsDatatablePaginationSize?"":"L")+(!1===i.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(s.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===i.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",o=i.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:i.amsDatatableServerSide||!1,sAjaxSource:!0===i.amsDatatableServerSide?i.amsDatatableAjaxSource:void 0,sServerMethod:!0===i.amsDatatableServerSide?"POST":void 0,bFilter:!1!==i.amsDatatableGlobalFilter||s.indexOf("columnfilter")>=0,bPaginate:!1!==i.amsDatatablePagination,bInfo:!1!==i.amsDatatableInfo,bSort:!1!==i.amsDatatableSort,aaSorting:o,aoColumns:d.length>0?d:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:i.amsDatatableDisplayLength||25,sPaginationType:i.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,i.amsDatatableOptions),x=[],v=[],y=[];if(s.length>0)for(a=0;a<s.length;a++)switch(s[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"},i.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(i.amsDatatableInitCallback,n,g)||g;try{var r=n.dataTable(g);if(t.executeFunctionByName(i.amsDatatableAfterInitCallback,n,r,g),s.length>0)for(a=0;a<s.length;a++)switch(s[a]){case"autofill":var o=e.extend({},i.amsDatatableAutofillOptions,g.autofill);o=t.executeFunctionByName(i.amsDatatableAutofillInitCallback,n,o)||o,n.data("ams-autofill",void 0===i.amsDatatableAutofillConstructor?new e.fn.dataTable.AutoFill(n,o):t.executeFunctionByName(i.amsDatatableAutofillConstructor,n,r,o));break;case"columnfilter":var c=e.extend({},{sPlaceHolder:"head:after"},i.amsDatatableColumnfilterOptions,g.columnfilter);c=t.executeFunctionByName(i.amsDatatableColumnfilterInitCallback,n,c)||c,n.data("ams-columnfilter",void 0===i.amsDatatableColumnfilterConstructor?r.columnFilter(c):t.executeFunctionByName(i.amsDatatableColumnfilterConstructor,n,r,c));break;case"editable":var l=e.extend({},i.amsDatatableEditableOptions,g.editable);l=t.executeFunctionByName(i.amsDatatableEditableInitCallback,n,l)||l,n.data("ams-editable",void 0===i.amsDatatableEditableConstructor?n.makeEditable(l):t.executeFunctionByName(i.amsDatatableEditableConstructor,n,r,l));break;case"fixedcolumns":var m=e.extend({},i.amsDatatableFixedcolumnsOptions,g.fixedcolumns);m=t.executeFunctionByName(i.amsDatatableFixedcolumnsInitCallback,n,m)||m,n.data("ams-fixedcolumns",void 0===i.amsDatatableFixedcolumnsConstructor?new e.fn.dataTable.FixedColumns(n,m):t.executeFunctionByName(i.amsDatatableFixedcolumnsConstructor,n,r,m));break;case"fixedheader":var d=e.extend({},i.amsDatatableFixedheaderOptions,g.fixedheader);d=t.executeFunctionByName(i.amsDatatableFixedheadeInitCallback,n,d)||d,n.data("ams-fixedheader",void 0===i.amsDatatableFixedheaderConstructor?new e.fn.dataTable.FixedHeader(n,d):t.executeFunctionByName(i.amsDatatableFixedheaderConstructor,n,r,d));break;case"keytable":var u={table:n.get(0),datatable:r},b=e.extend({},u,i.amsDatatableKeytableOptions,g.keytable);b=t.executeFunctionByName(i.amsDatatableKeytableInitCallback,n,b)||b,n.data("ams-keytable",void 0===i.amsDatatableKeytableConstructor?new KeyTable(b):t.executeFunctionByName(i.amsDatatableKeytableConstructor,n,r,b));break;case"rowgrouping":var h=e.extend({},i.amsDatatableRowgroupingOptions,g.rowgrouping);h=t.executeFunctionByName(i.amsDatatableRowgroupingInitCallback,n,h)||h,n.data("ams-rowgrouping",void 0===i.amsDatatableRowgroupingConstructor?n.rowGrouping(h):t.executeFunctionByName(i.amsDatatableRowgroupingConstructor,n,r,h));break;case"rowreordering":var p=e.extend({},i.amsDatatableRowreorderingOptions,g.rowreordering);p=t.executeFunctionByName(i.amsDatatableRowreorderingInitCallback,n,p)||p,n.data("ams-rowreordering",void 0===i.amsDatatableRowreorderingConstructor?n.rowReordering(p):t.executeFunctionByName(i.amsDatatableRowreorderingConstructor,n,r,p))}if(i.amsDatatableFinalizeCallback){var f=i.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 i={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(i,s){var r=n.amsTabledndDropTarget;if(r){e(s).data("ams-disabled-handlers","click");try{var o=[];e(i.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,i,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)})}}finally{setTimeout(function(){e(s).removeData("ams-disabled-handlers")},50)}}return!1}},s=e.extend({},i,n.amsTabledndOptions);s=t.executeFunctionByName(n.amsTabledndInitCallback,a,s)||s;var r=a.tableDnD(s);t.executeFunctionByName(n.amsTabledndAfterInitCallback,a,r,s)})})},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(),i={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)},s=e.extend({},i,n.amsWizardOptions);s=t.executeFunctionByName(n.amsWizardInitCallback,a,s)||s;var r=a.bootstrapWizard(s);t.executeFunctionByName(n.amsWizardAfterInitCallback,a,r,s)})})},tinymce:function(a){function n(){e(".tinymce",e(this)).each(function(){var a=tinymce.get(e(this).attr("id"));a&&a.remove()})}var i=e(".tinymce",a);if(i.length>0){var s=t.baseURL+"ext/tinymce"+(t.devmode?"/dev":"");t.ajax&&t.ajax.check(window.tinymce,s+"/tinymce"+t.devext+".js",function(a){function r(){i.each(function(){var a=e(this),n=a.data(),i={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 s=n.amsTinymceExternalPlugins.split(/\s+/);for(var r in s)if(s.hasOwnProperty(r)){var o=a.data("ams-tinymce-plugin-"+s[r]);tinymce.PluginManager.load(s[r],t.getSource(o))}}var c=e.extend({},i,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(s+"/jquery.tinymce"+t.devext+".js",function(){tinymce.baseURL=s,tinymce.suffix=t.devext,t.skin&&t.skin.registerCleanCallback(n),r()}):r()})}},editor:function(n){var i=e(".text-editor textarea",n);i.length>0&&t.ajax&&t.ajax.check(a.ace,t.baseURL+"ext/ace/ace.js",function(n){var s=function(){a.ace_loaded=!0,i.each(function(){var a=e(this),n=a.parents(".text-editor"),i=n.data(),s=ace.require("ace/ext/modelist"),r=i.amsEditorMode||s.getModeForPath(i.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,i.amsEditorOptions);m=t.executeFunctionByName(i.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(i.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"],s)):s()})},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(),i=n.amsImgareaselectParent?a.parents(n.amsImgareaselectParent):"body",s={instance:!0,handles:!0,parent:i,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 s=n.amsImgareaselectTargetField||"image_";e('input[name="'+s+'x1"]',i).val(t.x1),e('input[name="'+s+'y1"]',i).val(t.y1),e('input[name="'+s+'x2"]',i).val(t.x2),e('input[name="'+s+'y2"]',i).val(t.y2)}},r=e.extend({},s,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),i=n.data(),s=n;i.amsFancyboxElements&&(s=e(i.amsFancyboxElements,n));var r=(i.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:i.amsFancyboxType,padding:i.amsFancyboxPadding||10,margin:i.amsFancyboxMargin||10,loop:i.amsFancyboxLoop,beforeLoad:t.getFunctionByName(i.amsFancyboxBeforeLoad)||function(){var a;if(i.amsFancyboxTitleGetter&&(a=t.executeFunctionByName(i.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(i.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:i.amsFancyboxButtonsPosition||"top"};break;case"thumbs":o.helpers.thumbs={width:i.amsFancyboxThumbsWidth||50,height:i.amsFancyboxThumbsHeight||50};break;case"media":o.helpers.media=!0}var c=e.extend({},o,i.amsFancyboxOptions);c=t.executeFunctionByName(i.amsFancyboxInitCallback,n,c)||c;var l=s.fancybox(c);t.executeFunctionByName(i.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(),i=(n.amsChartPlugins||"").split(/\s+/);if(i.length>0)for(var s in i)if(i.hasOwnProperty(s)){var r=i[s];(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(),i={theme:n.amsScrollbarTheme||"light"},s=e.extend({},i,n.amsScrollbarOptions);s=t.executeFunctionByName(n.amsScrollbarInitCallback,a,s)||s;var r=a.mCustomScrollbar(s);t.executeFunctionByName(n.amsScrollbarAfterInitCallback,a,r,s)})})})})}})}(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"),i=t.attr("height");n&&i&&t.get(0).setAttribute("viewBox","0 0 "+Math.round(parseFloat(n))+" "+Math.round(parseFloat(i))),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(),i={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},s=e.extend({},i,n.amsHintOptions);s=t.executeFunctionByName(n.amsHintInitCallback,a,s)||s;var r=a.tipsy(s);t.executeFunctionByName(n.amsHintAfterInitCallback,a,r,s)})})})},contextMenu:function(a){var n=e(".context-menu",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={menuSelector:n.amsContextmenuSelector,menuSelected:t.helpers&&t.helpers.contextMenuHandler},s=e.extend({},i,n.amsContextmenuOptions);s=t.executeFunctionByName(n.amsContextmenuInitCallback,a,s)||s;var r=a.contextMenu(s);t.executeFunctionByName(n.amsContextmenuAfterInitCallback,a,r,s)})},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(i){i.preventDefault();var s={};if(a.trigger("ams.switcher.before-switch",[a,s]),!s.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"),i=a.data();if(!i.amsChecker){var s=e('<label class="checkbox"></label>'),r=i.amsCheckerFieldname||"checker_"+t.generateId(),o=r.replace(/\./,"_"),c=i.amsCheckerHiddenPrefix,l=null,m=i.amsCheckerHiddenValueOn||"true",d=i.amsCheckerHiddenValueOff||"false",u=i.amsCheckerMarker||!1;c?l=e('<input type="hidden">').attr("name",c+r).val("on"===i.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(i.amsCheckerValue||!0).attr("checked","on"===i.amsCheckerState?"checked":null);i.amsCheckerReadonly?b.attr("disabled","disabled"):b.on("change",function(s){s.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(i.amsCheckerChangeHandler,a,o),!i.amsCheckerCancelDefault){var c=b.data("ams-checker-hidden-input");o?("disable"===i.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"===i.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(s),e(">label",a).attr("for",b.attr("id")),s.append("<i></i>").prependTo(a);var h=e("[required]",n);h.attr("data-required",!0),"on"===i.amsCheckerState?b.attr("checked",!0):("disable"===i.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(),i=e.extend({},{},a.data.amsSliderOptions);i=t.executeFunctionByName(n.amsSliderInitCallback,a,i)||i;var s=a.slider(i);t.executeFunctionByName(n.amsSliderAfterInitCallback,a,s,i)})})},draggable:function(a){var n=e(".draggable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={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)},s=e.extend({},i,n.amsDraggableOptions);s=t.executeFunctionByName(n.amsDraggableInitCallback,a,s)||s;var r=a.draggable(s);a.disableSelection(),t.executeFunctionByName(n.amsDraggableAfterInitCallback,a,r,s)})},droppable:function(a){var n=e(".droppable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={accept:n.amsdroppableAccept,drop:t.getFunctionByName(n.amsDroppableDrop)},s=e.extend({},i,n.amsDroppableOptions);s=t.executeFunctionByName(n.amsDroppableInitCallback,a,s)||s;var r=a.droppable(s);t.executeFunctionByName(n.amsDroppableAfterInitCallback,a,r,s)})},sortable:function(a){var n=e(".sortable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={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)},s=e.extend({},i,n.amsSortableOptions);s=t.executeFunctionByName(n.amsSortableInitCallback,a,s)||s;var r=a.sortable(s);a.disableSelection(),t.executeFunctionByName(n.amsSortableAfterInitCallback,a,r,s)})},resizable:function(a){var n=e(".resizable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={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)},s=e.extend({},i,n.amsResizableOptions);s=t.executeFunctionByName(n.amsResizableInitCallback,a,s)||s;var r=a.resizable(s);a.disableSelection(),t.executeFunctionByName(n.amsResizableAfterInitCallback,a,r,s)})},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(),i=e.extend({},{},n.amsTypeaheadOptions);i=t.executeFunctionByName(n.amsTypeaheadInitCallback,a,i)||i;var s=a.typeahead(i);t.executeFunctionByName(n.amsTypeaheadAfterInitCallback,a,s,i)})})},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(),i={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)},s=e.extend({},i,n.amsTreeviewOptions);s=t.executeFunctionByName(n.amsTreeviewInitcallback,a,s)||s;var r=a.treeview(s);t.executeFunctionByName(n.amsTreeviewAfterInitCallback,a,r,s)})})})},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 i={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(!i.initSelection){var s=a.data("ams-select2-values");s&&(i.initSelection=function(a,t){var n=[];e(a.val().split(i.separator)).each(function(){n.push({id:this,text:s[this]||this})}),t(n)})}}a.attr("readonly")?"hidden"===a.attr("type")&&(i.query=function(){return[]}):n.amsSelect2Query?(i.query=t.getFunctionByName(n.amsSelect2Query),i.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryUrl?(i.ajax={url:n.amsSelect2QueryUrl,quietMillis:n.amsSelect2QuietMillis||200,type:n.amsSelect2QueryType||"POST",dataType:n.amsSelect2QueryDatatype||"json",data:function(a,t,i){var s={};return s[n.amsSelect2QueryParamName||"query"]=a,s[n.amsSelect2PageParamName||"page"]=t,s[n.amsSelect2ContextParamName||"context"]=i,e.extend({},s,n.amsSelect2QueryOptions)},results:t.helpers&&t.helpers.select2QueryUrlResultsCallback},i.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryMethod?(i.query=function(i){var s={id:(new Date).getTime(),params:n.amsSelect2QueryParams||{},success:function(e){return t.helpers&&t.helpers.select2QueryMethodSuccessCallback.call(a,e,"success",i)},error:t.error&&t.error.show};s.params[n.amsSelect2QueryParamName||"query"]=i.term,s.params[n.amsSelect2PageParamName||"page"]=i.page,s.params[n.amsSelect2ContextParamName||"context"]=i.context,s=e.extend({},s,n.amsSelect2QueryOptions),s=t.executeFunctionByName(n.amsSelect2QueryInitCallback,a,s)||s,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,s)})})},i.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2Tags?i.tags=n.amsSelect2Tags:n.amsSelect2Data&&(i.data=n.amsSelect2Data),n.amsSelect2EnableFreeTags&&(i.createSearchChoice=function(e){return{id:e,text:(n.amsSelect2FreeTagsPrefix||t.i18n.SELECT2_FREETAG_PREFIX)+e}});var r=e.extend({},i,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(),i={placeholder:void 0===n.amsMaskeditPlaceholder?"X":n.amsMaskeditPlaceholder,complete:t.getFunctionByName(n.amsMaskeditComplete)},s=e.extend({},i,n.amsMaskeditOptions);s=t.executeFunctionByName(n.amsMaskeditInitCallback,a,s)||s;var r=a.mask(a.attr("data-mask"),s);t.executeFunctionByName(n.amsMaskeditAfterInitCallback,a,r,s)})})},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),i=n.data();a="object"==typeof i.inputMask?i.inputMask:{mask:i.inputMask.toString()};var s=e.extend({},a,i.amsInputmaskOptions);s=t.executeFunctionByName(i.amsInputmaskInitCallback,n,s)||s;var r=n.inputmask(s);t.executeFunctionByName(i.amsInputmaskAfterInitCallback,n,r,s)})})},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(),i={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},s=e.extend({},i,n.amsDatetimepickerOptions);s=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},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(),i={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},s=e.extend({},i,n.amsDatetimepickerOptions);s=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},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(),i={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect},s=e.extend({},i,n.amsDatetimepickerOptions);s=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},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(),i={position:n.amsColorpickerPosition||a.closest(".input").data("ams-colorpicker-position")||"bottom left"},s=e.extend({},i,n.amsColorpickerOptions);s=t.executeFunctionByName(n.amsColorpickerInitCallback,a,s)||s;var r=a.minicolors(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},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(),i={action:n.amsDnduploadAction||a.attr("action")||"upload-files",fieldname:n.amsDnduploadFieldname||"files",autosubmit:n.amsDnduploadAutosubmit},s=e.extend({},i,n.amsDnduploadOptions);s=t.executeFunctionByName(n.amsDnduploadInitCallback,a,s)||s;var r=a.dndupload(s);t.executeFunctionByName(n.amsDnduploadAfterInitcallback,a,r,s)})})})},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:first");t.length?e.insertAfter(t):e.insertAfter(a)}}),t.plugins&&t.plugins.i18n)){for(var i in t.plugins.i18n.validate)if(t.plugins.i18n.validate.hasOwnProperty(i)){var s=t.plugins.i18n.validate[i];"string"==typeof s&&s.indexOf("{0}")>-1&&(t.plugins.i18n.validate[i]=e.validator.format(s))}e.extend(e.validator.messages,t.plugins.i18n.validate)}n.each(function(){var a=e(this),n=a.data(),i={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 i=0;i<n.errorList.length;i++){var s=n.errorList[i],r=e(s.element).parents(".tab-pane").index()+1;if(r>0){var o=e(".nav-tabs",e(s.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&&(i.rules={}),i.rules[e(this).attr("name")]=e(this).data("ams-validate-rules")});var s=e.extend({},i,n.amsValidateOptions);s=t.executeFunctionByName(n.amsValidateInitCallback,a,s)||s;var r=a.validate(s);t.executeFunctionByName(n.amsValidateAfterInitCallback,a,r,s)})})},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),i=n.data(),s=(i.amsDatatableExtensions||"").split(/\s+/),r=i.amsDatatableSdom||"W"+(s.indexOf("colreorder")>=0||s.indexOf("colreorderwithresize")>=0?"R":"")+"<'dt-top-row'"+(s.indexOf("colvis")>=0?"C":"")+(!1===i.amsDatatablePagination||!1===i.amsDatatablePaginationSize?"":"L")+(!1===i.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(s.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===i.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",o=i.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:i.amsDatatableServerSide||!1,sAjaxSource:!0===i.amsDatatableServerSide?i.amsDatatableAjaxSource:void 0,sServerMethod:!0===i.amsDatatableServerSide?"POST":void 0,bFilter:!1!==i.amsDatatableGlobalFilter||s.indexOf("columnfilter")>=0,bPaginate:!1!==i.amsDatatablePagination,bInfo:!1!==i.amsDatatableInfo,bSort:!1!==i.amsDatatableSort,aaSorting:o,aoColumns:d.length>0?d:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:i.amsDatatableDisplayLength||25,sPaginationType:i.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,i.amsDatatableOptions),x=[],v=[],y=[];if(s.length>0)for(a=0;a<s.length;a++)switch(s[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"},i.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(i.amsDatatableInitCallback,n,g)||g;try{var r=n.dataTable(g);if(t.executeFunctionByName(i.amsDatatableAfterInitCallback,n,r,g),s.length>0)for(a=0;a<s.length;a++)switch(s[a]){case"autofill":var o=e.extend({},i.amsDatatableAutofillOptions,g.autofill);o=t.executeFunctionByName(i.amsDatatableAutofillInitCallback,n,o)||o,n.data("ams-autofill",void 0===i.amsDatatableAutofillConstructor?new e.fn.dataTable.AutoFill(n,o):t.executeFunctionByName(i.amsDatatableAutofillConstructor,n,r,o));break;case"columnfilter":var c=e.extend({},{sPlaceHolder:"head:after"},i.amsDatatableColumnfilterOptions,g.columnfilter);c=t.executeFunctionByName(i.amsDatatableColumnfilterInitCallback,n,c)||c,n.data("ams-columnfilter",void 0===i.amsDatatableColumnfilterConstructor?r.columnFilter(c):t.executeFunctionByName(i.amsDatatableColumnfilterConstructor,n,r,c));break;case"editable":var l=e.extend({},i.amsDatatableEditableOptions,g.editable);l=t.executeFunctionByName(i.amsDatatableEditableInitCallback,n,l)||l,n.data("ams-editable",void 0===i.amsDatatableEditableConstructor?n.makeEditable(l):t.executeFunctionByName(i.amsDatatableEditableConstructor,n,r,l));break;case"fixedcolumns":var m=e.extend({},i.amsDatatableFixedcolumnsOptions,g.fixedcolumns);m=t.executeFunctionByName(i.amsDatatableFixedcolumnsInitCallback,n,m)||m,n.data("ams-fixedcolumns",void 0===i.amsDatatableFixedcolumnsConstructor?new e.fn.dataTable.FixedColumns(n,m):t.executeFunctionByName(i.amsDatatableFixedcolumnsConstructor,n,r,m));break;case"fixedheader":var d=e.extend({},i.amsDatatableFixedheaderOptions,g.fixedheader);d=t.executeFunctionByName(i.amsDatatableFixedheadeInitCallback,n,d)||d,n.data("ams-fixedheader",void 0===i.amsDatatableFixedheaderConstructor?new e.fn.dataTable.FixedHeader(n,d):t.executeFunctionByName(i.amsDatatableFixedheaderConstructor,n,r,d));break;case"keytable":var u={table:n.get(0),datatable:r},b=e.extend({},u,i.amsDatatableKeytableOptions,g.keytable);b=t.executeFunctionByName(i.amsDatatableKeytableInitCallback,n,b)||b,n.data("ams-keytable",void 0===i.amsDatatableKeytableConstructor?new KeyTable(b):t.executeFunctionByName(i.amsDatatableKeytableConstructor,n,r,b));break;case"rowgrouping":var h=e.extend({},i.amsDatatableRowgroupingOptions,g.rowgrouping);h=t.executeFunctionByName(i.amsDatatableRowgroupingInitCallback,n,h)||h,n.data("ams-rowgrouping",void 0===i.amsDatatableRowgroupingConstructor?n.rowGrouping(h):t.executeFunctionByName(i.amsDatatableRowgroupingConstructor,n,r,h));break;case"rowreordering":var p=e.extend({},i.amsDatatableRowreorderingOptions,g.rowreordering);p=t.executeFunctionByName(i.amsDatatableRowreorderingInitCallback,n,p)||p,n.data("ams-rowreordering",void 0===i.amsDatatableRowreorderingConstructor?n.rowReordering(p):t.executeFunctionByName(i.amsDatatableRowreorderingConstructor,n,r,p))}if(i.amsDatatableFinalizeCallback){var f=i.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 i={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(i,s){var r=n.amsTabledndDropTarget;if(r){e(s).data("ams-disabled-handlers","click");try{var o=[];e(i.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,i,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(s).removeData("ams-disabled-handlers")},50)}}return!1}},s=e.extend({},i,n.amsTabledndOptions);s=t.executeFunctionByName(n.amsTabledndInitCallback,a,s)||s;var r=a.tableDnD(s);t.executeFunctionByName(n.amsTabledndAfterInitCallback,a,r,s)})})},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(),i={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)},s=e.extend({},i,n.amsWizardOptions);s=t.executeFunctionByName(n.amsWizardInitCallback,a,s)||s;var r=a.bootstrapWizard(s);t.executeFunctionByName(n.amsWizardAfterInitCallback,a,r,s)})})},tinymce:function(a){function n(){e(".tinymce",e(this)).each(function(){var a=tinymce.get(e(this).attr("id"));a&&a.remove()})}var i=e(".tinymce",a);if(i.length>0){var s=t.baseURL+"ext/tinymce"+(t.devmode?"/dev":"");t.ajax&&t.ajax.check(window.tinymce,s+"/tinymce"+t.devext+".js",function(a){function r(){i.each(function(){var a=e(this),n=a.data(),i={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 s=n.amsTinymceExternalPlugins.split(/\s+/);for(var r in s)if(s.hasOwnProperty(r)){var o=a.data("ams-tinymce-plugin-"+s[r]);tinymce.PluginManager.load(s[r],t.getSource(o))}}var c=e.extend({},i,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(s+"/jquery.tinymce"+t.devext+".js",function(){tinymce.baseURL=s,tinymce.suffix=t.devext,t.skin&&t.skin.registerCleanCallback(n),r()}):r()})}},editor:function(n){var i=e(".text-editor textarea",n);i.length>0&&t.ajax&&t.ajax.check(a.ace,t.baseURL+"ext/ace/ace.js",function(n){var s=function(){a.ace_loaded=!0,i.each(function(){var a=e(this),n=a.parents(".text-editor"),i=n.data(),s=ace.require("ace/ext/modelist"),r=i.amsEditorMode||s.getModeForPath(i.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,i.amsEditorOptions);m=t.executeFunctionByName(i.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(i.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"],s)):s()})},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(),i=n.amsImgareaselectParent?a.parents(n.amsImgareaselectParent):"body",s={instance:!0,handles:!0,parent:i,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 s=n.amsImgareaselectTargetField||"image_";e('input[name="'+s+'x1"]',i).val(t.x1),e('input[name="'+s+'y1"]',i).val(t.y1),e('input[name="'+s+'x2"]',i).val(t.x2),e('input[name="'+s+'y2"]',i).val(t.y2)}},r=e.extend({},s,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),i=n.data(),s=n;i.amsFancyboxElements&&(s=e(i.amsFancyboxElements,n));var r=(i.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:i.amsFancyboxType,padding:i.amsFancyboxPadding||10,margin:i.amsFancyboxMargin||10,loop:i.amsFancyboxLoop,beforeLoad:t.getFunctionByName(i.amsFancyboxBeforeLoad)||function(){var a;if(i.amsFancyboxTitleGetter&&(a=t.executeFunctionByName(i.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(i.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:i.amsFancyboxButtonsPosition||"top"};break;case"thumbs":o.helpers.thumbs={width:i.amsFancyboxThumbsWidth||50,height:i.amsFancyboxThumbsHeight||50};break;case"media":o.helpers.media=!0}var c=e.extend({},o,i.amsFancyboxOptions);c=t.executeFunctionByName(i.amsFancyboxInitCallback,n,c)||c;var l=s.fancybox(c);t.executeFunctionByName(i.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(),i=(n.amsChartPlugins||"").split(/\s+/);if(i.length>0)for(var s in i)if(i.hasOwnProperty(s)){var r=i[s];(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(),i={theme:n.amsScrollbarTheme||"light"},s=e.extend({},i,n.amsScrollbarOptions);s=t.executeFunctionByName(n.amsScrollbarInitCallback,a,s)||s;var r=a.mCustomScrollbar(s);t.executeFunctionByName(n.amsScrollbarAfterInitCallback,a,r,s)})})})})}})}(jQuery,this);