Updated datatable plug-in initialization when sort-type is not defined for all columns
authorThierry Florac <thierry.florac@onf.fr>
Wed, 15 Nov 2017 17:03:30 +0100
changeset 241 4b68a8759677
parent 240 007e0e70ef13
child 242 a61b26d60c94
Updated datatable plug-in initialization when sort-type is not defined for all columns
src/pyams_skin/resources/js/myams.js
src/pyams_skin/resources/js/myams.min.js
--- a/src/pyams_skin/resources/js/myams.js	Wed Nov 15 17:02:31 2017 +0100
+++ b/src/pyams_skin/resources/js/myams.js	Wed Nov 15 17:03:30 2017 +0100
@@ -3734,6 +3734,8 @@
 																	   column = columns[index] || {};
 																	   column.bSortable = sortable;
 																	   columns[index] = column;
+																   } else {
+																	   columns[index] = columns[index] || {};
 																   }
 															   }
 															   // Check columns types
@@ -3744,6 +3746,8 @@
 																	   column = columns[index] || {};
 																	   column.sType = sortType;
 																	   columns[index] = column;
+																   } else {
+																	   columns[index] = columns[index] || {};
 																   }
 															   }
 															   // Set options
@@ -3820,7 +3824,7 @@
 																			   sources.push(ams.baseURL + 'ext/jquery-dataTables-keyTable' + ams.devext + '.js');
 																			   break;
 																		   case 'rowgrouping':
-																			   checkers.push($.fn.rowGrouping());
+																			   checkers.push($.fn.rowGrouping);
 																			   sources.push(ams.baseURL + 'ext/jquery-dataTables-rowGrouping' + ams.devext + '.js');
 																			   break;
 																		   case 'rowreordering':
--- a/src/pyams_skin/resources/js/myams.min.js	Wed Nov 15 17:02:31 2017 +0100
+++ b/src/pyams_skin/resources/js/myams.min.js	Wed Nov 15 17:03:30 2017 +0100
@@ -1,1 +1,1 @@
-!function(e,a){"use strict";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},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 i=n.className.split(" ").map(function(e){return e.startsWith(a)?"":e});n.className=e.trim(i.join(" "))}),this},contextMenu:function(a){function t(t,n,i){var s=e(window)[n](),r=e(a.menuSelector)[n](),o=t;return t+r>s&&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(n){if(!n.ctrlKey)return e(a.menuSelector).data("invokedOn",e(n.target)).show().css({position:"fixed",left:t(n.clientX,"width")-10,top:t(n.clientY,"height")-10}).off("click").on("click",function(t){e(this).hide();var n=e(this).data("invokedOn"),s=e(t.target);a.menuSelected.call(this,n,s),i.event.stop(t)}),!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 i=a.attr("href").replace(/^#/,""),s=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&&s!==o[a]){var c=e(o[a]);!i&&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");i||!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)})}})}}),e.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,i=0,s=0;t<e.length;)(n=e.charCodeAt(t))<128?(a+=String.fromCharCode(n),t++):n>191&&n<224?(i=e.charCodeAt(t+1),a+=String.fromCharCode((31&n)<<6|63&i),t+=2):(i=e.charCodeAt(t+1),s=e.charCodeAt(t+2),a+=String.fromCharCode((15&n)<<12|(63&i)<<6|63&s),t+=3);return a}},void 0===a.MyAMS&&(a.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,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,i=n;n.baseURL=function(){var a=e('script[src*="/myams.js"], script[src*="/myams.min.js"]').attr("src");return i.devmode=a.indexOf(".min.js")<0,i.devext=i.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 i=0;i<t.length;i++)try{a=a[t[i]]}catch(e){return}try{return a[n]}catch(e){return}}},n.executeFunctionByName=function(e,a){var t=i.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 i.getFunctionByName(e.substr(1,e.length-2))})},n.getScript=function(a,t,n){"object"==typeof t&&(n=t,t=null),void 0===n&&(n={});var s={dataType:"script",url:i.getSource(a),success:t,error:i.error.show,cache:!i.devmode,async:void 0===n.async?"function"==typeof t:n.async},r=e.extend({},s,n);return e.ajax(r)},n.getCSS=function(a,t){var n=e("HEAD");if(0===e('link[data-ams-id="'+t+'"]',n).length){var s=i.getSource(a);i.devmode&&(s+="?_="+(new Date).getTime()),e("<link />").attr({rel:"stylesheet",type:"text/css",href:s,"data-ams-id":t}).appendTo(n)}},n.event={stop:function(e){e||(e=window.event),e&&(e.stopPropagation?(e.stopPropagation(),e.preventDefault()):(e.cancelBubble=!0,e.returnValue=!1))}},n.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(s){function r(s){var r=!1;if(window.clipboardData&&window.clipboardData.setData)r=clipboardData.setData("Text",s);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var o=e("<textarea>");o.val(s),o.css("position","fixed"),o.appendTo(e("body")),o.get(0).select();try{document.execCommand("copy"),r=!0}catch(e){t&&t.warn&&t.warn("Copy to clipboard failed.",e)}finally{o.remove()}}r?i.skin.smallBox("success",{title:s.length>1?i.i18n.CLIPBOARD_TEXT_COPY_OK:i.i18n.CLIPBOARD_CHARACTER_COPY_OK,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:1e3}):a.prompt&&a.prompt(n.i18n.CLIPBOARD_COPY,s)}if(void 0===s)return function(){var a=e(this),t=a.text();a.parents(".btn-group").removeClass("open"),r(t)};r(s)}},n.error={ajax:function(e,a,n,s){if(!("abort"===s||a&&a.statusText&&"OK"===a.statusText.toUpperCase())){if("json"===(a=i.ajax.getResponse(a)).contentType)i.ajax.handleJSON(a.data);else{var r=e.statusText||e.type,o=a.responseText;i.skin.messageBox("error",{title:i.i18n.ERROR_OCCURED,content:"<h4>"+r+"</h4><p>"+(o||"")+"</p>",icon:"fa fa-warning animated shake",timeout:1e4})}t&&(t.error&&t.error(e),t.debug&&t.debug(a))}},show:function(e,a,n){if(n){var s=i.ajax.getResponse(e);"json"===s.contentType?i.ajax.handleJSON(s.data):i.skin.messageBox("error",{title:i.i18n.ERRORS_OCCURED,content:"<h4>"+a+"</h4><p>"+n+"</p>",icon:"fa fa-warning animated shake",timeout:1e4}),t&&(t.error&&t.error(n),t.debug&&t.debug(e))}}},n.ajax={check:function(a,t,n,s){function r(e,a){if(void 0!==n){n instanceof Array||(n=[n]);for(var t=0;t<n.length;t++){var s=i.getFunctionByName(n[t]);"function"==typeof s&&s(e,a)}}}n instanceof Array||"object"==typeof n&&(s=n,n=void 0);var o={async:"function"==typeof n},c=e.extend({},o,s);if(a instanceof Array){for(var l=[],d=0;d<a.length;d++)void 0===a[d]&&l.push(i.getScript(t[d],{async:!0}));l.length>0?e.when.apply(e,l).then(function(){r(!0,s)}):r(!1,s)}else void 0===a?"string"==typeof t&&i.getScript(t,function(){r(!0,s)},c):r(!1,s)},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||t&&t.log&&t.log(parseInt(e.loaded/e.total*100,10)+"%"))},post:function(a,t,n,s){var r;r=a.startsWith(window.location.protocol)?a:this.getAddr()+a,"function"==typeof n?(s=n,n={}):n||(n={}),void 0===s&&(s=n.callback),"string"==typeof s&&(s=i.getFunctionByName(s)),delete n.callback;var o,c={url:r,type:"post",cache:!1,async:"function"==typeof s,data:e.param(t),dataType:"json",success:s||function(e){o=e.result}},l=e.extend({},c,n);return e.ajax(l),o},getResponse:function(e){var a,t,n=e.getResponseHeader("content-type");if(n)if(n.startsWith("application/javascript"))a="script",t=e.responseText;else if(n.startsWith("text/html"))a="html",t=e.responseText;else if(n.startsWith("text/xml"))a="xml",t=e.responseText;else if(t=e.responseJSON)a="json";else try{t=JSON.parse(e.responseText),a="json"}catch(n){t=e.responseText,a="text"}else a="json",t={status:"alert",alert:{title:i.i18n.ERROR_OCCURED,content:i.i18n.NO_SERVER_RESPONSE}};return{contentType:a,data:t}},handleJSON:function(n,s,r){var o,c=n.status;switch(c){case"alert":a.alert&&a.alert(n.alert.title+"\n\n"+n.alert.content);break;case"error":i.form.showErrors(s,n);break;case"info":case"success":void 0!==s&&(i.form.resetChanged(s),!1!==n.close_form&&i.dialog.close(s));break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":void 0!==s&&(i.form.resetChanged(s),!1!==n.close_form&&i.dialog.close(s));break;case"modal":i.dialog.open(n.location);break;case"reload":void 0!==s&&(i.form.resetChanged(s),!1!==n.close_form&&i.dialog.close(s)),(o=n.location||window.location.hash).startsWith("#")&&(o=o.substr(1));var l=e(n.target||r||"#content");i.skin.loadURL(o,l,{preLoadCallback:i.getFunctionByName(n.pre_reload)||function(){e("[data-ams-pre-reload]",l).each(function(){i.executeFunctionByName(e(this).data("ams-pre-reload"))})},afterLoadCallback:i.getFunctionByName(n.post_reload)||function(){e("[data-ams-post-reload]",l).each(function(){i.executeFunctionByName(e(this).data("ams-post-reload"))})}});break;case"redirect":void 0!==s&&(i.form.resetChanged(s),!0===n.close_form&&i.dialog.close(s)),o=n.location||window.location.href,n.window?window.open(o,n.window,n.options):window.location.href===o?window.location.reload(!0):window.location.href=o;break;default:t&&t.log&&t.log("Unhandled status: "+c)}var d,m,u;if(n.content&&(m=n.content,u=e(m.target||r||s||"#content"),!0===m.raw?u.text(m.text):(u.html(m.html),i.initContent(u)),m.keep_hidden||u.removeClass("hidden")),n.contents){var f=n.contents;for(d=0;d<f.length;d++)m=f[d],u=e(m.target),!0===m.raw?u.text(m.text):(u.html(m.html),i.initContent(u)),m.keep_hidden||u.removeClass("hidden")}var h;if(n.message&&("string"==typeof(h=n.message)?"info"===c||"success"===c?i.skin.smallBox(c,{title:h,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}):i.skin.alert(e(s||"#content"),c,h):i.skin.alert(e(h.target||r||s||"#content"),h.status||"success",h.header,h.body,h.subtitle)),n.smallbox&&i.skin.smallBox(n.smallbox_status||c,{title:n.smallbox,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}),n.messagebox)if("string"==typeof(h=n.messagebox))i.skin.messageBox("info",{title:i.i18n.ERROR_OCCURED,content:h,timeout:1e4});else{var p=h.status||"info";"error"===p&&s&&r&&i.executeFunctionByName(s.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",s,r),i.skin.messageBox(p,{title:h.title||i.i18n.ERROR_OCCURED,content:h.content,icon:h.icon,number:h.number,timeout:null===h.timeout?void 0:h.timeout||1e4})}if(n.event&&s.trigger(n.event,n.event_options),n.events){var g;for(void 0===s&&(s=e(document)),d=0;d<n.events.length;d++)"string"==typeof(g=n.events[d])?s.trigger(g,n.events_options):s.trigger(g.event,g.options)}if(n.callback&&i.executeFunctionByName(n.callback,s,n.options),n.callbacks){var b;for(d=0;d<n.callbacks.length;d++)"function"==typeof(b=n.callbacks[d])?i.executeFunctionByName(b,s,b.options):i.executeFunctionByName(b.callback,s,b.options)}}},n.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,t,n,s){i.ajax.check(e.jsonRPC,i.baseURL+"ext/jquery-jsonrpc"+i.devext+".js",function(){"function"==typeof n?(s=n,n={}):n||(n={}),"undefined"===s&&(s=n.callback),"string"==typeof s&&(s=i.getFunctionByName(s)),delete n.callback;var r={};"string"==typeof a?r.query=a:"object"==typeof a&&e.extend(r,a),e.extend(r,n);var o,c={id:(new Date).getTime(),params:r,success:s||function(e){o=e},error:i.error.show},l=e.extend({},c,n);return e.jsonRPC.withOptions({endPoint:i.jsonrpc.getAddr(n.url),namespace:n.namespace,cache:!1},function(){e.jsonRPC.request(t,l)}),o})},post:function(a,t,n,s){i.ajax.check(e.jsonRPC,i.baseURL+"ext/jquery-jsonrpc"+i.devext+".js",function(){"function"==typeof n?(s=n,n={}):n||(n={}),void 0===s&&(s=n.callback),"string"==typeof s&&(s=i.getFunctionByName(s)),delete n.callback;var r,o={id:(new Date).getTime(),params:t,success:s||function(e){r=e},error:i.error.show},c=e.extend({},o,n);return e.jsonRPC.withOptions({endPoint:i.jsonrpc.getAddr(n.url),namespace:n.namespace,cache:!1},function(){e.jsonRPC.request(a,c)}),r})}},n.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,t,n,s,r){i.ajax.check(e.xmlrpc,i.baseURL+"ext/jquery-xmlrpc"+i.devext+".js",function(){"function"==typeof s?(r=s,s={}):s||(s={}),void 0===r&&(r=s.callback),"string"==typeof r&&(r=i.getFunctionByName(r)),delete s.callback;var o,c={url:i.xmlrpc.getAddr(a),methodName:t,params:n,success:r||function(e){o=e},error:i.error.show},l=e.extend({},c,s);return e.xmlrpc(l),o})}},n.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())})});(i.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 t=a.data("ams-changed-event")||"change";a.on(t,function(){i.form.setChanged(e(this).parents("FORM"))})}}),a.on("reset",function(){i.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 i.i18n.FORM_CHANGED_WARNING},confirmChangedForm:function(t,n,s){"function"==typeof t&&(n=t,t=void 0),e('FORM[data-ams-form-changed="true"]',t).exists()?s?a.confirm(i.i18n.FORM_CHANGED_WARNING,i.i18n.WARNING)?n.call(t):s.call(t):i.skin.bigBox({title:i.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i>&nbsp; '+i.i18n.FORM_CHANGED_WARNING,buttons:i.i18n.BTN_OK_CANCEL},function(e){e===i.i18n.BTN_OK&&n.call(t)}):n.call(t)},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(t,n,s){if(!(t=e(t)).exists())return!1;if("object"==typeof n&&(s=n,n=void 0),t.data("submitted"))return t.data("ams-form-hide-submitted")||i.skin.messageBox("warning",{title:i.i18n.WAIT,content:i.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:t.data("ams-form-alert-timeout")||5e3}),!1;if(!i.form._checkSubmitValidators(t))return!1;e(".alert-danger, SPAN.state-error",t).not(".persistent").remove(),e(".state-error",t).removeClassPrefix("state-");var r=e(t.data("ams-submit-button"));return r&&!r.data("ams-form-hide-loading")&&(r.data("ams-progress-content",r.html()),r.button("loading")),i.ajax.check(e.fn.ajaxSubmit,i.baseURL+"ext/jquery-form-3.49"+i.devext+".js",function(){function r(t,r){var o,c,l,d,m,u,f,h,p,g=t.data(),b=g.amsFormOptions;if(s&&(m=s.formDataInitCallback),m?delete s.formDataInitCallback:m=g.amsFormDataInitCallback,m){var v={};if(d="function"==typeof m?m.call(t,v):i.executeFunctionByName(m,t,v),v.veto)return(o=t.data("ams-submit-button"))&&o.button("reset"),i.form.finalizeSubmitFooter.call(t),!1}else d=g.amsFormData||{};(o=e(t.data("ams-submit-button")))&&o.exists()?l=(c=o.data()).amsFormSubmitTarget:c={};var x,y=n||c.amsFormHandler||g.amsFormHandler||"";if(y.startsWith(window.location.protocol))x=y;else{var k=c.amsFormAction||t.attr("action").replace(/#/,"");x=k.startsWith(window.location.protocol)?k:i.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;s&&s.initSubmitTarget?i.executeFunctionByName(s.initSubmitTarget,t):g.amsFormInitSubmitTarget?(C=e(l||g.amsFormSubmitTarget||"#content"),i.executeFunctionByName(g.amsFormInitSubmit||"MyAMS.form.initSubmit",t,C)):g.amsFormHideSubmitFooter||i.executeFunctionByName(g.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",t),s&&(d=e.extend({},d,s.form_data));var S;u?d.progress_id=i.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,t,n){C&&i.executeFunctionByName(g.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",n,C),i.form.resetAfterSubmit(n)},iframe:S},F=s&&s.downloadTarget||g.amsFormDownloadTarget;if(F){var N=e('iframe[name="'+F+'"]');N.exists()||(N=e("<iframe></iframe>").hide().attr("name",F).appendTo(e("body"))),w=e.extend({},w,{iframe:!0,iframeTarget:N,success:function(a,t,n,s){if(e(s).parents(".modal-dialog").exists())i.dialog.close(s);else{var r,o=s.data("ams-submit-button");o&&(r=o.data("ams-form-submit-callback")),r||(r=i.getFunctionByName(g.amsFormSubmitCallback)||i.form._submitCallback);try{r.call(s,a,t,n,s)}finally{i.form.resetAfterSubmit(s),i.form.resetChanged(s)}}}})}else w=e.extend({},w,{error:function(e,a,t,n){C&&i.executeFunctionByName(g.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",n,C),i.form.resetAfterSubmit(n)},success:function(e,a,t,n){var s,r=n.data("ams-submit-button");r&&(s=r.data("ams-form-submit-callback")),s||(s=i.getFunctionByName(g.amsFormSubmitCallback)||i.form._submitCallback);try{s.call(n,e,a,t,n)}finally{i.form.resetAfterSubmit(n),i.form.resetChanged(n)}},iframe:S});var T=e.extend({},w,r,b,s);if(u&&function(e,a){function n(){clearInterval(s),i.form.resetAfterSubmit(t,o),o.html(o.data("ams-progress-content")),i.executeFunctionByName(p,t,o),i.form.resetChanged(t)}var s;o.button("loading"),s=setInterval(function(){i.ajax.post(e,{progress_id:a},{error:n},i.getFunctionByName(h)||function(e,a){if("success"===a)if("running"===e.status)if(e.message)o.text(e.message);else{var t=o.data("ams-progress-text")||i.i18n.PROGRESS;e.current?t+=": "+e.current+"/ "+(e.length||100):t+="...",o.text(t)}else"finished"===e.status&&n();else n()})},f)}(u,d.progress_id),e(t).ajaxSubmit(T),F){var R=e(t).parents(".modal-dialog"),O=R.exists()&&o.exists()&&o.data("ams-keep-modal");R.exists()&&!0!==O?i.dialog.close(t):u||setTimeout(function(){i.form.resetAfterSubmit(t,o),i.form.resetChanged(t)},o.data("ams-form-reset-timeout")||2e3)}}if(!0!==t.data("ams-form-ignore-uploads")&&e('INPUT[type="file"]',t).length>0){i.ajax.check(e.progressBar,i.baseURL+"ext/jquery-progressbar"+i.devext+".js");var o=e.extend({},{uuid:e.progressBar.submit(t)});r(t,o)}else r(t,{})}),!1},initSubmit:function(a,t){var n=e(this),i='<i class="fa fa-3x fa-gear fa-spin"></i>';t||(t=n.data("ams-form-submit-message")),t&&(i+="<strong>"+t+"</strong>"),e(a).html('<div class="row margin-20"><div class="text-center">'+i+"</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"),i.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 i=e("footer",t);e("button",i).hide(),i.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,t,n,s){var r;s.is(":visible")&&(i.form.finalizeSubmitFooter.call(s),(r=s.data("ams-submit-button"))&&r.button("reset"));var o,c=s.data();if(c.amsFormDatatype)o=c.amsFormDatatype;else{var l=i.ajax.getResponse(n);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":i.ajax.handleJSON(a,s,d);break;case"script":case"xml":break;case"html":case"text":default:i.form.resetChanged(s),r&&!0!==r.data("ams-keep-modal")&&i.dialog.close(s),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),i.initContent(d),i.form.setFocus(d)}var m=n.getResponseHeader("X-AMS-Callback");if(m){var u=n.getResponseHeader("X-AMS-Callback-Options");i.executeFunctionByName(m,s,void 0===u?{}:JSON.parse(u),n)}},_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=i.form._getSubmitValidators(e);if(!a.length)return!0;for(var t=[],n=!0,s=0;s<a.length;s++){var r=a[s],o=r[0],c=r[1],l=i.executeFunctionByName(c,e,o);!1===l?n=!1:"string"==typeof l?t.push(l):n.length&&n.length>0&&(t=t.concat(n))}if(t.length>0){var d=1===t.length?i.i18n.ERROR_OCCURED:i.i18n.ERRORS_OCCURED;return i.skin.alert(e,"danger",d,t),!1}return n},showErrors:function(a,t){var n;if("string"==typeof t)i.skin.alert(a,"error",i.i18n.ERROR_OCCURED,t);else if(t instanceof Array)n=1===t.length?i.i18n.ERROR_OCCURED:i.i18n.ERRORS_OCCURED,i.skin.alert(a,"error",n,t);else{e(".state-error",a).removeClass("state-error"),n=t.error_header||(t.widgets&&t.widgets.length>1?i.i18n.ERRORS_OCCURED:i.i18n.ERROR_OCCURED);var s,r=[];if(t.messages)for(s=0;s<t.messages.length;s++){var o=t.messages[s];o.header?r.push("<strong>"+o.header+"</strong><br />"+o.message):r.push(o.message||o)}if(t.widgets)for(s=0;s<t.widgets.length;s++){var c=t.widgets[s],l=e('[name="'+c.name+'"]',a);l.exists()||(l=e('[name="'+c.name+':list"]',a)),l.exists()&&l.parents("label: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()}}i.skin.alert(e("fieldset:first",a),t.error_level||"error",n,r,t.error_message)}}},n.dialog={_shown_callbacks:[],registerShownCallback:function(e,a){var t;a&&(t=a.objectOrParentWithClass("modal-dialog"));var n;t&&t.exists()?void 0===(n=t.data("shown-callbacks"))&&(n=[],t.data("shown-callbacks",n)):n=i.dialog._shown_callbacks,n.indexOf(e)<0&&n.push(e)},_hide_callbacks:[],registerHideCallback:function(e,a){var t;a&&(t=a.objectOrParentWithClass("modal-dialog"));var n;t&&t.exists()?void 0===(n=t.data("hide-callbacks"))&&(n=[],t.data("hide-callbacks",n)):n=i.dialog._hide_callbacks,n.indexOf(e)<0&&n.push(e)},open:function(a,t){i.ajax.check(e.fn.modalmanager,i.baseURL+"ext/bootstrap-modalmanager"+i.devext+".js",function(){i.ajax.check(e.fn.modal.defaults,i.baseURL+"ext/bootstrap-modal"+i.devext+".js",function(n){n&&(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 s,r;if("string"==typeof a)s={},r=a;else{s=a.data(),r=a.attr("href")||s.amsUrl;var o=i.getFunctionByName(r);"function"==typeof o&&(r=o.call(a))}r&&(e("body").modalmanager("loading"),0===r.indexOf("#")?e(r).modal("show"):e.ajax({url:r,type:"get",cache:void 0!==s.amsAllowCache&&s.amsAllowCache,data:t,success:function(t,n,o){e("body").modalmanager("removeLoading");var c=i.ajax.getResponse(o),l=c.contentType,d=c.data;switch(l){case"json":i.ajax.handleJSON(d,e(e(a).data("ams-json-target")||"#content"));break;case"script":case"xml":break;case"html":case"text":default:var m=e(d),u=e(".modal-dialog",m.wrap("<div></div>").parent()),f=u.data(),h={backdrop:"static",overflow:f.amsModalOverflow||".modal-viewport",maxHeight:void 0===f.amsModalMaxHeight?function(){return e(window).height()-e(".modal-header",m).outerHeight(!0)-e("footer",m).outerHeight(!0)-85}:i.getFunctionByName(f.amsModalMaxHeight)},p=e.extend({},h,f.amsModalOptions);p=i.executeFunctionByName(f.amsModalInitCallback,u,p)||p,e("<div>").addClass("modal fade").append(m).modal(p).on("shown",i.dialog.shown).on("hidden",i.dialog.hidden),i.initContent(m),!1!==s.amsLogEvent&&i.stats.logPageview(r)}}}))})})},shown:function(a){function t(a){var t=e(".scrollmarker.top",s),n=s.scrollTop();n>0?t.show():t.hide();var i=e(".scrollmarker.bottom",s);r+n>=s.get(0).scrollHeight?i.hide():i.show()}var n=a.target,s=e(".modal-viewport",n);if(s.exists()){var r=parseInt(s.css("max-height")),o=e.scrollbarWidth();"hidden"!==s.css("overflow")&&s.height()===r?(e("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",s.width()-o).hide().appendTo(s),e("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",r-20).css("width",s.width()-o).appendTo(s),s.scroll(t),s.off("resize").on("resize",t)):e(".scrollmarker",s).remove()}e("[data-ams-shown-callback]",n).each(function(){var a=i.getFunctionByName(e(this).data("ams-shown-callback"));a&&a.call(n,this)});var c,l=e(".modal-dialog",n).data("shown-callbacks");if(l)for(c=0;c<l.length;c++)l[c].call(n);if(l=i.dialog._shown_callbacks)for(c=0;c<l.length;c++)l[c].call(n);i.form.setFocus(n)},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 t=a.target;i.skin.cleanContainer(t),e("[data-ams-hidden-callback]",t).each(function(){var a=i.getFunctionByName(e(this).data("ams-hidden-callback"));a&&a.call(t,this)});var n,s=e(".modal-dialog",t).data("hide-callbacks");if(s)for(n=0;n<s.length;n++)s[n].call(t);if(s=i.dialog._hide_callbacks)for(n=0;n<s.length;n++)s[n].call(t)}},n.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"),n=a.data("ams-select2-target");e('[name="'+n+'"]',t).data("select2").val("")},select2FormatSelection:function(a,t){a instanceof Array?e(a).each(function(){"object"==typeof this?t.append(this.text):t.append(this)}):"object"==typeof a?t.append(a.text):t.append(a)},select2SelectAllHelper:function(){var a=e(this).parents("label:first"),t=e(".select2",a);t.select2("data",t.data("ams-select2-data"))},select2QueryUrlResultsCallback:function(a,t,n){switch(a.status){case"error":i.skin.messageBox("error",{title:i.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(),i.dialog.open(a.location);break;default:return{results:a.results||a,more:a.has_more||!1,context:a.context}}},select2QueryMethodSuccessCallback:function(a,t,n){var s=a.result;if("string"==typeof s)try{s=JSON.parse(s)}catch(e){}switch(s.status){case"error":i.skin.messageBox("error",{title:i.i18n.ERROR_OCCURED,content:"<h4>"+s.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":e(this).data("select2").dropdown.hide(),i.dialog.open(s.location);break;default:n.callback({results:s.results||s,more:s.has_more||!1,context:s.context})}},contextMenuHandler:function(e,a){var t=a.data();if("modal"===t.toggle)i.dialog.open(a);else{var n=a.attr("href")||t.amsUrl;if(!n||n.startsWith("javascript")||a.attr("target"))return;i.event.stop();var s=i.getFunctionByName(n);"function"==typeof s&&(n=s.call(a,e)),"function"==typeof n?n.call(a,e):(n=n.replace(/\%23/,"#"),(e=a.data("ams-target"))?i.form.confirmChangedForm(e,function(){i.skin.loadURL(n,e,a.data("ams-link-options"),a.data("ams-link-callback"))}):i.form.confirmChangedForm(function(){n.startsWith("#")?n!==location.hash&&(i.root.hasClass("mobile-view-activated")?(i.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=n},150)):window.location.hash=n):window.location=n}))}},datetimepickerDialogHiddenCallback:function(){e(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")}},n.plugins={init:function(a){function t(e,a){if(o.hasOwnProperty(e)){var t=o[e];t.css=t.css||a.css,t.callbacks.push({callback:a.callback,context:a.context}),a.register&&(t.register=!0),!1===a.async&&(t.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&&i.getCSS(a.css,e+"_css")}function n(e){var t,n,s=c.callbacks;if(s&&s.length){for(t=0;t<s.length;t++)if(n=s[t],n.callback=i.getFunctionByName(n.callback),!1!==c.register){var o=i.plugins.enabled;o.hasOwnProperty(r)?o[r].push(n):o[r]=[n]}}else!1!==c.register&&(i.plugins.enabled[r]=null);if(!0!==e&&s&&s.length&&!1!==c.async)for(t=0;t<s.length;t++)n=s[t],i.executeFunctionByName(n.callback,a,n.context)}i.plugins.initData(a);var s=[];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++)s.push(a[t])});var r,o={};e("[data-ams-plugins]",a).each(function(){var a=e(this),n=a.data("ams-plugins");if("string"==typeof n)for(var i=a.data("ams-plugins").split(/\s+/),s=0;s<i.length;s++){r=i[s];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")};t(r,o)}else for(r in n)n.hasOwnProperty(r)&&t(r,n[r])});var c;for(r in o)o.hasOwnProperty(r)&&(c=o[r],void 0===i.plugins.enabled[r]?i.getScript(c.src,n,{async:void 0===c.async||c.async}):(!function(){var e=i.plugins.enabled[r];for(l=0;l<e.length;l++){var a=e[l];a&&a.context&&!i.isInDOM(a.context)&&(e[l]=null)}}(),n(!0)));for(var l in i.plugins.enabled)if(i.plugins.enabled.hasOwnProperty(l)&&!(s.indexOf(l)>=0)){var d=i.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 i=t[n];"string"!=typeof i&&(i=JSON.stringify(i)),a.attr("data-"+n,i)}})},register:function(e,a,n){if("function"==typeof a&&(n=a,a=null),a=a||e.name,i.plugins.enabled.indexOf(a)>=0)t&&t.warn&&t.warn("Plugin "+a+" is already registered!");else if("object"==typeof e){var s=e.src;s?i.ajax.check(e.callback,s,function(t){t&&(i.plugins.enabled[a]=i.getFunctionByName(e.callback),e.css&&i.getCSS(e.css,a+"_css"),n&&i.executeFunctionByName(n))}):(i.plugins.enabled[a]=i.getFunctionByName(e.callback),e.css&&i.getCSS(e.css,a+"_css"),n&&i.executeFunctionByName(n))}else"function"==typeof e&&(i.plugins.enabled[a]=e,n&&i.executeFunctionByName(n))},enabled:{hint:function(a){var t=e(".hint:not(:parents(.nohints))",a);t.length>0&&i.ajax.check(e.fn.tipsy,i.baseURL+"ext/jquery-tipsy"+i.devext+".js",function(){i.getCSS(i.baseURL+"../css/ext/jquery-tipsy"+i.devext+".css","jquery-tipsy"),t.each(function(){var a=e(this),t=a.data(),n={html:t.amsHintHtml,title:i.getFunctionByName(t.amsHintTitleGetter)||function(){var a=e(this),n=a.attr("original-title")||a.attr(t.amsHintTitleAttr||"title")||(t.amsHintHtml?a.html():a.text());return n=n.replace(/\?_="/,"?_="+(new Date).getTime()+'"')},opacity:t.amsHintOpacity||.95,gravity:t.amsHintGravity||"sw",offset:t.amsHintOffset||0},s=e.extend({},n,t.amsHintOptions);s=i.executeFunctionByName(t.amsHintInitCallback,a,s)||s;var r=a.tipsy(s);i.executeFunctionByName(t.amsHintAfterInitCallback,a,r,s)})})},contextMenu:function(a){var t=e(".context-menu",a);t.length>0&&t.each(function(){var a=e(this),t=a.data(),n={menuSelector:t.amsContextmenuSelector,menuSelected:i.helpers.contextMenuHandler},s=e.extend({},n,t.amsContextmenuOptions);s=i.executeFunctionByName(t.amsContextmenuInitCallback,a,s)||s;var r=a.contextMenu(s);i.executeFunctionByName(t.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),t=a.parent("fieldset"),n=a.data();if(!n.amsChecker){var s=e('<label class="checkbox"></label>'),r=n.amsCheckerFieldname||"checker_"+i.generateId(),o=r.replace(/\./,"_"),c=n.amsCheckerHiddenPrefix,l=null,d=n.amsCheckerHiddenValueOn||"true",m=n.amsCheckerHiddenValueOff||"false",u=n.amsCheckerMarker||!1;c?l=e('<input type="hidden">').attr("name",c+r).val("on"===n.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(n.amsCheckerValue||!0).attr("checked","on"===n.amsCheckerState?"checked":null);n.amsCheckerReadonly?f.attr("disabled","disabled"):f.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(i.executeFunctionByName(n.amsCheckerChangeHandler,a,o),!n.amsCheckerCancelDefault){var c=f.data("ams-checker-hidden-input");o?("disable"===n.amsCheckerMode?t.removeAttr("disabled"):t.removeClass("switched"),c&&c.val(d),e("[data-required]",t).attr("required","required"),a.trigger("ams.checker.opened",[a])):("disable"===n.amsCheckerMode?t.prop("disabled","disabled"):t.addClass("switched"),c&&c.val(m),e("[data-required]",t).removeAttr("required"),a.trigger("ams.checker.closed",[a]))}}),f.appendTo(s),e(">label",a).attr("for",f.attr("id")),s.append("<i></i>").prependTo(a);var h=e("[required]",t);h.attr("data-required",!0),"on"===n.amsCheckerState?f.attr("checked",!0):("disable"===n.amsCheckerMode?t.attr("disabled","disabled"):t.addClass("switched"),h.removeAttr("required")),a.data("ams-checker","on")}})},slider:function(a){var t=e(".slider",a);t.length>0&&i.ajax.check(e.fn.slider,i.baseURL+"ext/bootstrap-slider-2.0.0"+i.devext+".js",function(){t.each(function(){var a=e(this),t=a.data(),n=e.extend({},{},a.data.amsSliderOptions);n=i.executeFunctionByName(t.amsSliderInitCallback,a,n)||n;var s=a.slider(n);i.executeFunctionByName(t.amsSliderAfterInitCallback,a,s,n)})})},draggable:function(a){var t=e(".draggable",a);t.length>0&&t.each(function(){var a=e(this),t=a.data(),n={containment:t.amsDraggableContainment,helper:i.getFunctionByName(t.amsDraggableHelper)||t.amsDraggableHelper,start:i.getFunctionByName(t.amsDraggableStart),stop:i.getFunctionByName(t.amsDraggableStop)},s=e.extend({},n,t.amsDraggableOptions);s=i.executeFunctionByName(t.amsDraggableInitCallback,a,s)||s;var r=a.draggable(s);a.disableSelection(),i.executeFunctionByName(t.amsDraggableAfterInitCallback,a,r,s)})},sortable:function(a){var t=e(".sortable",a);t.length>0&&t.each(function(){var a=e(this),t=a.data(),n={items:t.amsSortableItems,handle:t.amsSortableHandle,helper:t.amsSortableHelper,connectWith:t.amsSortableConnectwith,start:i.getFunctionByName(t.amsSortableStart),over:i.getFunctionByName(t.amsSortableOver),containment:t.amsSortableContainment,placeholder:t.amsSortablePlaceholder,stop:i.getFunctionByName(t.amsSortableStop)},s=e.extend({},n,t.amsSortableOptions);s=i.executeFunctionByName(t.amsSortableInitCallback,a,s)||s;var r=a.sortable(s);a.disableSelection(),i.executeFunctionByName(t.amsSortableAfterInitCallback,a,r,s)})},resizable:function(a){var t=e(".resizable",a);t.length>0&&t.each(function(){var a=e(this),t=a.data(),n={autoHide:!1===t.amsResizableAutohide||t.amsResizableAutohide,containment:t.amsResizableContainment,grid:t.amsResizableGrid,handles:t.amsResizableHandles,start:i.getFunctionByName(t.amsResizableStart),stop:i.getFunctionByName(t.amsResizableStop)},s=e.extend({},n,t.amsResizableOptions);s=i.executeFunctionByName(t.amsResizableInitCallback,a,s)||s;var r=a.resizable(s);a.disableSelection(),i.executeFunctionByName(t.amsResizableAfterInitCallback,a,r,s)})},typeahead:function(a){var t=e(".typeahead",a);t.length>0&&i.ajax.check(e.fn.typeahead,i.baseURL+"ext/jquery-typeahead"+i.devext+".js",function(){t.each(function(){var a=e(this),t=a.data(),n=e.extend({},{},t.amsTypeaheadOptions);n=i.executeFunctionByName(t.amsTypeaheadInitCallback,a,n)||n;var s=a.typeahead(n);i.executeFunctionByName(t.amsTypeaheadAfterInitCallback,a,s,n)})})},select2:function(a){var t=e(".select2",a);t.length>0&&i.ajax.check(e.fn.select2,i.baseURL+"ext/jquery-select2-3.5.2"+i.devext+".js",function(){t.each(function(){var a=e(this),t=a.data(),n={placeholder:t.amsSelect2Placeholder,multiple:t.amsSelect2Multiple,minimumInputLength:t.amsSelect2MinimumInputLength||0,maximumSelectionSize:t.amsSelect2MaximumSelectionSize,openOnEnter:void 0===t.amsSelect2EnterOpen||t.amsSelect2EnterOpen,allowClear:void 0===t.amsSelect2AllowClear||t.amsSelect2AllowClear,width:t.amsSelect2Width||"100%",initSelection:i.getFunctionByName(t.amsSelect2InitSelection),formatSelection:void 0===t.amsSelect2FormatSelection?i.helpers.select2FormatSelection:i.getFunctionByName(t.amsSelect2FormatSelection),formatResult:i.getFunctionByName(t.amsSelect2FormatResult),formatMatches:void 0===t.amsSelect2FormatMatches?function(e){return 1===e?i.i18n.SELECT2_MATCH:e+i.i18n.SELECT2_MATCHES}:i.getFunctionByName(t.amsSelect2FormatMatches),formatNoMatches:void 0===t.amsSelect2FormatResult?function(e){return i.i18n.SELECT2_NOMATCHES}:i.getFunctionByName(t.amsSelect2FormatResult),formatInputTooShort:void 0===t.amsSelect2FormatInputTooShort?function(e,a){var t=a-e.length;return i.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,t).replace(/\{1\}/,1===t?"":i.i18n.SELECT2_PLURAL)}:i.getFunctionByName(t.amsSelect2FormatInputTooShort),formatInputTooLong:void 0===t.amsSelect2FormatInputTooLong?function(e,a){var t=e.length-a;return i.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,t).replace(/\{1\}/,1===t?"":i.i18n.SELECT2_PLURAL)}:i.getFunctionByName(t.amsSelect2FormatInputTooLong),formatSelectionTooBig:void 0===t.amsSelect2FormatSelectionTooBig?function(e){return i.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,e).replace(/\{1\}/,1===e?"":i.i18n.SELECT2_PLURAL)}:i.getFunctionByName(t.amsSelect2FormatSelectionTooBig),formatLoadMore:void 0===t.amsSelect2FormatLoadMore?function(e){return i.i18n.SELECT2_LOADMORE}:i.getFunctionByName(t.amsSelect2FormatLoadMore),formatSearching:void 0===t.amsSelect2FormatSearching?function(){return i.i18n.SELECT2_SEARCHING}:i.getFunctionByName(t.amsSelect2FormatSearching),separator:t.amsSelect2Separator||",",tokenSeparators:t.amsSelect2TokensSeparators||[","],tokenizer:i.getFunctionByName(t.amsSelect2Tokenizer)};switch(a.context.type){case"text":case"hidden":if(!n.initSelection){var s=a.data("ams-select2-values");s&&(n.initSelection=function(a,t){var i=[];e(a.val().split(n.separator)).each(function(){i.push({id:this,text:s[this]||this})}),t(i)})}}a.attr("readonly")?"hidden"===a.attr("type")&&(n.query=function(){return[]}):t.amsSelect2Query?(n.query=i.getFunctionByName(t.amsSelect2Query),n.minimumInputLength=t.amsSelect2MinimumInputLength||1):t.amsSelect2QueryUrl?(n.ajax={url:t.amsSelect2QueryUrl,quietMillis:t.amsSelect2QuietMillis||200,type:t.amsSelect2QueryType||"POST",dataType:t.amsSelect2QueryDatatype||"json",data:function(a,n,i){var s={};return s[t.amsSelect2QueryParamName||"query"]=a,s[t.amsSelect2PageParamName||"page"]=n,s[t.amsSelect2ContextParamName||"context"]=i,e.extend({},s,t.amsSelect2QueryOptions)},results:i.helpers.select2QueryUrlResultsCallback},n.minimumInputLength=t.amsSelect2MinimumInputLength||1):t.amsSelect2QueryMethod?(n.query=function(n){var s={id:(new Date).getTime(),params:t.amsSelect2QueryParams||{},success:function(e){return i.helpers.select2QueryMethodSuccessCallback.call(a,e,"success",n)},error:i.error.show};s.params[t.amsSelect2QueryParamName||"query"]=n.term,s.params[t.amsSelect2PageParamName||"page"]=n.page,s.params[t.amsSelect2ContextParamName||"context"]=n.context,s=e.extend({},s,t.amsSelect2QueryOptions),s=i.executeFunctionByName(t.amsSelect2QueryInitCallback,a,s)||s,i.ajax.check(e.jsonRPC,i.baseURL+"ext/jquery-jsonrpc"+i.devext+".js",function(){e.jsonRPC.withOptions({endPoint:t.amsSelect2MethodTarget||i.jsonrpc.getAddr(),namespace:t.amsSelect2MethodNamespace,cache:!1},function(){e.jsonRPC.request(t.amsSelect2QueryMethod,s)})})},n.minimumInputLength=t.amsSelect2MinimumInputLength||1):t.amsSelect2Tags?n.tags=t.amsSelect2Tags:t.amsSelect2Data&&(n.data=t.amsSelect2Data),t.amsSelect2EnableFreeTags&&(n.createSearchChoice=function(e){return{id:e,text:(t.amsSelect2FreeTagsPrefix||i.i18n.SELECT2_FREETAG_PREFIX)+e}});var r=e.extend({},n,t.amsSelect2Options);r=i.executeFunctionByName(t.amsSelect2InitCallback,a,r)||r;var o=a.select2(r);i.executeFunctionByName(t.amsSelect2AfterInitCallback,a,o,r),a.hasClass("ordered")&&i.ajax.check(e.fn.select2Sortable,i.baseURL+"ext/jquery-select2-sortable"+i.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 t=e("[data-mask]",a);t.length>0&&i.ajax.check(e.fn.mask,i.baseURL+"ext/jquery-maskedinput-1.4.1"+i.devext+".js",function(){t.each(function(){var a=e(this),t=a.data(),n={placeholder:void 0===t.amsMaskeditPlaceholder?"X":t.amsMaskeditPlaceholder,complete:i.getFunctionByName(t.amsMaskeditComplete)},s=e.extend({},n,t.amsMaskeditOptions);s=i.executeFunctionByName(t.amsMaskeditInitCallback,a,s)||s;var r=a.mask(a.attr("data-mask"),s);i.executeFunctionByName(t.amsMaskeditAfterInitCallback,a,r,s)})})},inputmask:function(a){var t=e("[data-input-mask]",a);t.length>0&&i.ajax.check(e.fn.inputmask,i.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+i.devext+".js",function(){t.each(function(){var a,t=e(this),n=t.data();a="object"==typeof n.inputMask?n.inputMask:{mask:n.inputMask.toString()};var s=e.extend({},a,n.amsInputmaskOptions);s=i.executeFunctionByName(n.amsInputmaskInitCallback,t,s)||s;var r=t.inputmask(s);i.executeFunctionByName(n.amsInputmaskAfterInitCallback,t,r,s)})})},datepicker:function(a){var t=e(".datepicker",a);t.length>0&&i.ajax.check(e.fn.datetimepicker,i.baseURL+"ext/jquery-datetimepicker"+i.devext+".js",function(a){a&&(i.getCSS(i.baseURL+"../css/ext/jquery-datetimepicker"+i.devext+".css","jquery-datetimepicker"),i.dialog.registerHideCallback(i.helpers.datetimepickerDialogHiddenCallback)),t.each(function(){var a=e(this),t=a.data(),n={lang:t.amsDatetimepickerLang||i.lang,format:t.amsDatetimepickerFormat||"d/m/y",datepicker:!0,dayOfWeekStart:1,timepicker:!1,closeOnDateSelect:void 0===t.amsDatetimepickerCloseOnSelect||t.amsDatetimepickerCloseOnSelect,weeks:t.amsDatetimepickerWeeks},s=e.extend({},n,t.amsDatetimepickerOptions);s=i.executeFunctionByName(t.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);i.executeFunctionByName(t.amsDatetimepickerAfterInitCallback,a,r,s)})})},datetimepicker:function(a){var t=e(".datetimepicker",a);t.length>0&&i.ajax.check(e.fn.datetimepicker,i.baseURL+"ext/jquery-datetimepicker"+i.devext+".js",function(a){a&&(i.getCSS(i.baseURL+"../css/ext/jquery-datetimepicker"+i.devext+".css","jquery-datetimepicker"),i.dialog.registerHideCallback(i.helpers.datetimepickerDialogHiddenCallback)),t.each(function(){var a=e(this),t=a.data(),n={lang:t.amsDatetimepickerLang||i.lang,format:t.amsDatetimepickerFormat||"d/m/y H:i",datepicker:!0,dayOfWeekStart:1,timepicker:!0,closeOnDateSelect:void 0===t.amsDatetimepickerCloseOnSelect||t.amsDatetimepickerCloseOnSelect,closeOnTimeSelect:void 0===t.amsDatetimepickerCloseOnSelect||t.amsDatetimepickerCloseOnSelect,weeks:t.amsDatetimepickerWeeks},s=e.extend({},n,t.amsDatetimepickerOptions);s=i.executeFunctionByName(t.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);i.executeFunctionByName(t.amsDatetimepickerAfterInitCallback,a,r,s)})})},timepicker:function(a){var t=e(".timepicker",a);t.length>0&&i.ajax.check(e.fn.datetimepicker,i.baseURL+"ext/jquery-datetimepicker"+i.devext+".js",function(a){a&&(i.getCSS(i.baseURL+"../css/ext/jquery-datetimepicker"+i.devext+".css","jquery-datetimepicker"),i.dialog.registerHideCallback(i.helpers.datetimepickerDialogHiddenCallback)),t.each(function(){var a=e(this),t=a.data(),n={lang:t.amsDatetimepickerLang||i.lang,format:t.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===t.amsDatetimepickerCloseOnSelect||t.amsDatetimepickerCloseOnSelect},s=e.extend({},n,t.amsDatetimepickerOptions);s=i.executeFunctionByName(t.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);i.executeFunctionByName(t.amsDatetimepickerAfterInitCallback,a,r,s)})})},colorpicker:function(a){var t=e(".colorpicker",a);t.length>0&&i.ajax.check(e.fn.minicolors,i.baseURL+"ext/jquery-minicolors"+i.devext+".js",function(a){a&&i.getCSS(i.baseURL+"../css/ext/jquery-minicolors"+i.devext+".css","jquery-minicolors"),t.each(function(){var a=e(this),t=a.data(),n={position:t.amsColorpickerPosition||a.closest("label.input").data("ams-colorpicker-position")||"bottom left"},s=e.extend({},n,t.amsColorpickerOptions);s=i.executeFunctionByName(t.amsColorpickerInitCallback,a,s)||s;var r=a.minicolors(s);i.executeFunctionByName(t.amsDatetimepickerAfterInitCallback,a,r,s)})})},validate:function(a){var t=e("FORM:not([novalidate])",a);t.length>0&&i.ajax.check(e.fn.validate,i.baseURL+"ext/jquery-validate-1.11.1"+i.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)}}),i.plugins.i18n)){for(var n in i.plugins.i18n.validate)if(i.plugins.i18n.validate.hasOwnProperty(n)){var s=i.plugins.i18n.validate[n];"string"==typeof s&&s.indexOf("{0}")>-1&&(i.plugins.i18n.validate[n]=e.validator.format(s))}e.extend(e.validator.messages,i.plugins.i18n.validate)}t.each(function(){var a=e(this),t=a.data(),n={ignore:null,submitHandler:void 0!==a.attr("data-async")?void 0===t.amsFormSubmitHandler?function(){return e(".state-error",a).removeClass("state-error"),i.ajax.check(e.fn.ajaxSubmit,i.baseURL+"ext/jquery-form-3.49"+i.devext+".js"),i.form.submit(a)}:i.getFunctionByName(t.amsFormSubmitHandler):void 0,invalidHandler:void 0!==a.attr("data-async")?void 0===t.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()}}}:i.getFunctionByName(t.amsFormInvalidHandler):void 0};e("[data-ams-validate-rules]",a).each(function(a){0===a&&(n.rules={}),n.rules[e(this).attr("name")]=e(this).data("ams-validate-rules")});var s=e.extend({},n,t.amsValidateOptions);s=i.executeFunctionByName(t.amsValidateInitCallback,a,s)||s;var r=a.validate(s);i.executeFunctionByName(t.amsValidateAfterInitCallback,a,r,s)})})},datatable:function(a){var t=e(".datatable",a);t.length>0&&i.ajax.check(e.fn.dataTable,i.baseURL+"ext/jquery-dataTables-1.9.4"+i.devext+".js",function(a){i.ajax.check(e.fn.dataTableExt.oPagination.bootstrap_full,i.baseURL+"myams-dataTables"+i.devext+".js",function(){e(t).each(function(){var a,t=e(this),n=t.data(),s=(n.amsDatatableExtensions||"").split(/\s+/),r=n.amsDatatableSdom||"W"+(s.indexOf("colreorder")>=0||s.indexOf("colreorderwithresize")>=0?"R":"")+"<'dt-top-row'"+(s.indexOf("colvis")>=0?"C":"")+(!1===n.amsDatatablePagination||!1===n.amsDatatablePaginationSize?"":"L")+(!1===n.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(s.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===n.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",o=n.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",t).listattr("data-ams-datatable-sortable");for(a=0;a<u.length;a++){var f=u[a];void 0!==f&&((d=m[a]||{}).bSortable=f,m[a]=d)}var h=e("th",t).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)}var g={bJQueryUI:!1,bFilter:!1!==n.amsDatatableGlobalFilter||s.indexOf("columnfilter")>=0,bPaginate:!1!==n.amsDatatablePagination,bInfo:!1!==n.amsDatatableInfo,bSort:!1!==n.amsDatatableSort,aaSorting:o,aoColumns:m.length>0?m:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:n.amsDatatableDisplayLength||25,sPaginationType:n.amsDatatablePaginationType||"bootstrap_full",sDom:r,oLanguage:i.plugins.i18n.datatables,fnInitComplete:function(a,t){e(".ColVis_Button").addClass("btn btn-default btn-sm").html((i.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}},b=e.extend({},g,n.amsDatatableOptions),v=[],x=[],y=[];if(s.length>0)for(a=0;a<s.length;a++)switch(s[a]){case"autofill":v.push(e.fn.dataTable.AutoFill),x.push(i.baseURL+"ext/jquery-dataTables-autoFill"+i.devext+".js");break;case"columnfilter":v.push(e.fn.columnFilter),x.push(i.baseURL+"ext/jquery-dataTables-columnFilter"+i.devext+".js");break;case"colreorder":v.push(e.fn.dataTable.ColReorder),x.push(i.baseURL+"ext/jquery-dataTables-colReorder"+i.devext+".js");break;case"colreorderwithresize":v.push(window.ColReorder),x.push(i.baseURL+"ext/jquery-dataTables-colReorderWithResize"+i.devext+".js");break;case"colvis":v.push(e.fn.dataTable.ColVis),x.push(i.baseURL+"ext/jquery-dataTables-colVis"+i.devext+".js"),y.push(function(){b.oColVis=e.extend({},{activate:"click",sAlign:"right"},n.amsDatatableColvisOptions)});break;case"editable":v.push(e.fn.editable),x.push(i.baseURL+"ext/jquery-jeditable"+i.devext+".js"),v.push(e.fn.makeEditable),x.push(i.baseURL+"ext/jquery-dataTables-editable"+i.devext+".js");break;case"fixedcolumns":v.push(e.fn.dataTable.FixedColumns),x.push(i.baseURL+"ext/jquery-dataTables-fixedColumns"+i.devext+".js");break;case"fixedheader":v.push(e.fn.dataTable.Fixedheader),x.push(i.baseURL+"ext/jquery-dataTables-fixedHeader"+i.devext+".js");break;case"keytable":v.push(window.keyTable),x.push(i.baseURL+"ext/jquery-dataTables-keyTable"+i.devext+".js");break;case"rowgrouping":v.push(e.fn.rowGrouping()),x.push(i.baseURL+"ext/jquery-dataTables-rowGrouping"+i.devext+".js");break;case"rowreordering":v.push(e.fn.rowReordering),x.push(i.baseURL+"ext/jquery-dataTables-rowReordering"+i.devext+".js");break;case"scroller":v.push(e.fn.dataTable.Scroller),x.push(i.baseURL+"ext/jquery-dataTables-scroller"+i.devext+".js")}y.push(function(){b=i.executeFunctionByName(n.amsDatatableInitCallback,t,b)||b;try{var r=t.dataTable(b);if(i.executeFunctionByName(n.amsDatatableAfterInitCallback,t,r,b),s.length>0)for(a=0;a<s.length;a++)switch(s[a]){case"autofill":var o=e.extend({},n.amsDatatableAutofillOptions,b.autofill);o=i.executeFunctionByName(n.amsDatatableAutofillInitCallback,t,o)||o,t.data("ams-autofill",void 0===n.amsDatatableAutofillConstructor?new e.fn.dataTable.AutoFill(t,o):i.executeFunctionByName(n.amsDatatableAutofillConstructor,t,r,o));break;case"columnfilter":var c=e.extend({},{sPlaceHolder:"head:after"},n.amsDatatableColumnfilterOptions,b.columnfilter);c=i.executeFunctionByName(n.amsDatatableColumnfilterInitCallback,t,c)||c,t.data("ams-columnfilter",void 0===n.amsDatatableColumnfilterConstructor?r.columnFilter(c):i.executeFunctionByName(n.amsDatatableColumnfilterConstructor,t,r,c));break;case"editable":var l=e.extend({},n.amsDatatableEditableOptions,b.editable);l=i.executeFunctionByName(n.amsDatatableEditableInitCallback,t,l)||l,t.data("ams-editable",void 0===n.amsDatatableEditableConstructor?t.makeEditable(l):i.executeFunctionByName(n.amsDatatableEditableConstructor,t,r,l));break;case"fixedcolumns":var d=e.extend({},n.amsDatatableFixedcolumnsOptions,b.fixedcolumns);d=i.executeFunctionByName(n.amsDatatableFixedcolumnsInitCallback,t,d)||d,t.data("ams-fixedcolumns",void 0===n.amsDatatableFixedcolumnsConstructor?new e.fn.dataTable.FixedColumns(t,d):i.executeFunctionByName(n.amsDatatableFixedcolumnsConstructor,t,r,d));break;case"fixedheader":var m=e.extend({},n.amsDatatableFixedheaderOptions,b.fixedheader);m=i.executeFunctionByName(n.amsDatatableFixedheadeInitCallback,t,m)||m,t.data("ams-fixedheader",void 0===n.amsDatatableFixedheaderConstructor?new e.fn.dataTable.FixedHeader(t,m):i.executeFunctionByName(n.amsDatatableFixedheaderConstructor,t,r,m));break;case"keytable":var u={table:t.get(0),datatable:r},f=e.extend({},u,n.amsDatatableKeytableOptions,b.keytable);f=i.executeFunctionByName(n.amsDatatableKeytableInitCallback,t,f)||f,t.data("ams-keytable",void 0===n.amsDatatableKeytableConstructor?new KeyTable(f):i.executeFunctionByName(n.amsDatatableKeytableConstructor,t,r,f));break;case"rowgrouping":var h=e.extend({},n.amsDatatableRowgroupingOptions,b.rowgrouping);h=i.executeFunctionByName(n.amsDatatableRowgroupingInitCallback,t,h)||h,t.data("ams-rowgrouping",void 0===n.amsDatatableRowgroupingConstructor?t.rowGrouping(h):i.executeFunctionByName(n.amsDatatableRowgroupingConstructor,t,r,h));break;case"rowreordering":var p=e.extend({},n.amsDatatableRowreorderingOptions,b.rowreordering);p=i.executeFunctionByName(n.amsDatatableRowreorderingInitCallback,t,p)||p,t.data("ams-rowreordering",void 0===n.amsDatatableRowreorderingConstructor?t.rowReordering(p):i.executeFunctionByName(n.amsDatatableRowreorderingConstructor,t,r,p))}if(n.amsDatatableFinalizeCallback){var g=n.amsDatatableFinalizeCallback.split(/\s+/);if(g.length>0)for(a=0;a<g.length;a++)i.executeFunctionByName(g[a],t,r,b)}}catch(e){}}),i.ajax.check(v,x,y)})})})},tablednd:function(a){var t=e(".table-dnd",a);t.length>0&&i.ajax.check(e.fn.tableDnD,i.baseURL+"ext/jquery-tablednd"+i.devext+".js",function(a){t.each(function(){var a=e(this),t=a.data();t.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 n={onDragClass:t.amsTabledndDragClass||"dragging-row",onDragStart:i.getFunctionByName(t.amsTabledndDragStart),dragHandle:t.amsTabledndDragHandle,scrollAmount:t.amsTabledndScrollAmount,onAllowDrop:t.amsTabledndAllowDrop,onDrop:i.getFunctionByName(t.amsTabledndDrop)||function(n,s){var r=t.amsTabledndDropTarget;if(r){e(s).data("ams-disabled-handlers","click");var o=[];e(n.rows).each(function(){var a=e(this).data("ams-element-name");a&&o.push(a)});var c=i.getFunctionByName(r);if("function"==typeof c)c.call(a,n,o);else{if(!r.startsWith(window.location.protocol)){var l=t.amsLocation;l&&(r=l+"/"+r)}i.ajax.post(r,{names:JSON.stringify(o)})}setTimeout(function(){e(s).removeData("ams-disabled-handlers")},50)}return!1}},s=e.extend({},n,t.amsTabledndOptions);s=i.executeFunctionByName(t.amsTabledndInitCallback,a,s)||s;var r=a.tableDnD(s);i.executeFunctionByName(t.amsTabledndAfterInitCallback,a,r,s)})})},wizard:function(a){var t=e(".wizard",a);t.length>0&&i.ajax.check(e.fn.bootstrapWizard,i.baseURL+"ext/bootstrap-wizard-1.4.2"+i.devext+".js",function(a){t.each(function(){var a=e(this),t=a.data(),n={withVisible:void 0===t.amsWizardWithVisible||t.amsWizardWithVisible,tabClass:t.amsWizardTabClass,firstSelector:t.amsWizardFirstSelector,previousSelector:t.amsWizardPreviousSelector,nextSelector:t.amsWizardNextSelector,lastSelector:t.amsWizardLastSelector,finishSelector:t.amsWizardFinishSelector,backSelector:t.amsWizardBackSelector,onInit:i.getFunctionByName(t.amsWizardInit),onShow:i.getFunctionByName(t.amsWizardShow),onNext:i.getFunctionByName(t.amsWizardNext),onPrevious:i.getFunctionByName(t.amsWizardPrevious),onFirst:i.getFunctionByName(t.amsWizardFirst),onLast:i.getFunctionByName(t.amsWizardLast),onBack:i.getFunctionByName(t.amsWizardBack),onFinish:i.getFunctionByName(t.amsWizardFinish),onTabChange:i.getFunctionByName(t.amsWizardTabChange),onTabClick:i.getFunctionByName(t.amsWizardTabClick),onTabShow:i.getFunctionByName(t.amsWizardTabShow)},s=e.extend({},n,t.amsWizardOptions);s=i.executeFunctionByName(t.amsWizardInitCallback,a,s)||s;var r=a.bootstrapWizard(s);i.executeFunctionByName(t.amsWizardAfterInitCallback,a,r,s)})})},tinymce:function(a){function t(){e(".tinymce",e(this)).each(function(){var a=tinymce.get(e(this).attr("id"));a&&a.remove()})}var n=e(".tinymce",a);if(n.length>0){var s=i.baseURL+"ext/tinymce"+(i.devmode?"/dev":"");i.ajax.check(window.tinymce,s+"/tinymce"+i.devext+".js",function(a){function r(){n.each(function(){var a=e(this),t=a.data(),n={theme:t.amsTinymceTheme||"modern",language:i.lang,plugins:["advlist autosave autolink lists link image charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime media nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern autoresize"],toolbar1:t.amsTinymceToolbar1||"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent",toolbar2:t.amsTinymceToolbar2||"forecolor backcolor emoticons | charmap link image media | fullscreen preview print | code",content_css:t.amsTinymceContentCss,formats:t.amsTinymceFormats,style_formats:t.amsTinymceStyleFormats,block_formats:t.amsTinymceBlockFormats,valid_classes:t.amsTinymceValidClasses,image_advtab:!0,image_list:i.getFunctionByName(t.amsTinymceImageList)||t.amsTinymceImageList,image_class_list:t.amsTinymceImageClassList,link_list:i.getFunctionByName(t.amsTinymceLinkList)||t.amsTinymceLinkList,link_class_list:t.amsTinymceLinkClassList,height:50,min_height:50,autoresize_min_height:50,autoresize_max_height:500,resize:!0};if(t.amsTinymceExternalPlugins){var s=t.amsTinymceExternalPlugins.split(/\s+/);for(var r in s){var o=a.data("ams-tinymce-plugin-"+s[r]);tinymce.PluginManager.load(s[r],i.getSource(o))}}var c=e.extend({},n,t.amsTinymceOptions);c=i.executeFunctionByName(t.amsTinymceInitCallback,a,c)||c;var l=a.tinymce(c);i.executeFunctionByName(t.amsTinymceAfterInitCallback,a,l,c)})}a?i.getScript(s+"/jquery.tinymce"+i.devext+".js",function(){tinymce.baseURL=s,tinymce.suffix=i.devext,i.skin.registerCleanCallback(t),r()}):r()})}},imgareaselect:function(a){var t=e(".imgareaselect",a);t.length>0&&i.ajax.check(e.fn.imgAreaSelect,i.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+i.devext+".js",function(a){a&&i.getCSS(i.baseURL+"../css/ext/jquery-imgareaselect"+i.devext+".css"),t.each(function(){var a=e(this),t=a.data(),n=t.amsImgareaselectParent?a.parents(t.amsImgareaselectParent):"body",s={instance:!0,handles:!0,parent:n,x1:t.amsImgareaselectX1||0,y1:t.amsImgareaselectY1||0,x2:t.amsImgareaselectX2||t.amsImgareaselectImageWidth,y2:t.amsImgareaselectY2||t.amsImgareaselectImageHeight,imageWidth:t.amsImgareaselectImageWidth,imageHeight:t.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:t.amsImgareaselectRatio,onSelectEnd:i.getFunctionByName(t.amsImgareaselectSelectEnd)||function(a,i){var s=t.amsImgareaselectTargetField||"image_";e('input[name="'+s+'x1"]',n).val(i.x1),e('input[name="'+s+'y1"]',n).val(i.y1),e('input[name="'+s+'x2"]',n).val(i.x2),e('input[name="'+s+'y2"]',n).val(i.y2)}},r=e.extend({},s,t.amsImgareaselectOptions);r=i.executeFunctionByName(t.amsImgareaselectInitCallback,a,r)||r;var o=a.imgAreaSelect(r);i.executeFunctionByName(t.amsImgareaselectAfterInitCallback,a,o,r),setTimeout(function(){o.update()},250)})})},fancybox:function(a){var t=e(".fancybox",a);t.length>0&&i.ajax.check(e.fn.fancybox,i.baseURL+"ext/jquery-fancybox-2.1.5"+i.devext+".js",function(a){a&&i.getCSS(i.baseURL+"../css/ext/jquery-fancybox-2.1.5"+i.devext+".css"),t.each(function(){var a=e(this),t=a.data(),n=a;t.amsFancyboxElements&&(n=e(t.amsFancyboxElements,a));var s=(t.amsFancyboxHelpers||"").split(/\s+/);if(s.length>0)for(var r=0;r<s.length;r++){var o=s[r];switch(o){case"buttons":i.ajax.check(e.fancybox.helpers.buttons,i.baseURL+"ext/fancybox-helpers/fancybox-buttons"+i.devext+".js");break;case"thumbs":i.ajax.check(e.fancybox.helpers.thumbs,i.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+i.devext+".js");break;case"media":i.ajax.check(e.fancybox.helpers.media,i.baseURL+"ext/fancybox-helpers/fancybox-media"+i.devext+".js")}}var c={type:t.amsFancyboxType,padding:t.amsFancyboxPadding||10,margin:t.amsFancyboxMargin||10,loop:t.amsFancyboxLoop,beforeLoad:i.getFunctionByName(t.amsFancyboxBeforeLoad)||function(){var a;if(t.amsFancyboxTitleGetter&&(a=i.executeFunctionByName(t.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:i.getFunctionByName(t.amsFancyboxAfterLoad),helpers:{title:{type:"inside"}}};if(s.length>0)for(r=0;r<s.length;r++)switch(o=s[r]){case"buttons":c.helpers.buttons={position:t.amsFancyboxButtonsPosition||"top"};break;case"thumbs":c.helpers.thumbs={width:t.amsFancyboxThumbsWidth||50,height:t.amsFancyboxThumbsHeight||50};break;case"media":c.helpers.media=!0}var l=e.extend({},c,t.amsFancyboxOptions);l=i.executeFunctionByName(t.amsFancyboxInitCallback,a,l)||l;var d=n.fancybox(l);i.executeFunctionByName(t.amsFancyboxAfterInitCallback,a,d,l)})})},chart:function(a){var t=e(".chart",a);t.length>0&&i.ajax.check(e.fn.plot,i.baseURL+"flot/jquery.flot"+i.devext+".js",function(){t.each(function(){var a=e(this),t=a.data(),n=(t.amsChartPlugins||"").split(/\s+/);if(n.length>0)for(var s in n){var r=n[s];(function(a){for(var t in e.plot.plugins){var n=e.plot.plugins[t];if(n.name==a)return n}return null})(r)||i.getScript(i.baseURL+"flot/jquery.flot."+r+i.devext+".js")}var o=e.extend({},{},t.amsChartOptions);o=i.executeFunctionByName(t.amsChartInitCallback,a,o)||o;var c=t.amsChartData;c=i.executeFunctionByName(t.amsChartInitData,a,c)||c;var l=a.plot(c,o);i.executeFunctionByName(t.amsChartAfterInitCallback,a,l,o)})})},graphs:function(a){var t=e(".sparkline",a);t.length>0&&i.ajax.check(i.graphs,i.baseURL+"myams-graphs"+i.devext+".js",function(){i.graphs.init(t)})},scrollbars:function(a){var t=e(".scrollbar",a);t.length>0&&i.ajax.check(e.event.special.mousewheel,i.baseURL+"ext/jquery-mousewheel.min.js",function(){i.ajax.check(e.fn.mCustomScrollbar,i.baseURL+"ext/jquery-mCustomScrollbar"+i.devext+".js",function(a){a&&i.getCSS(i.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar"),t.each(function(){var a=e(this),t=a.data(),n={theme:t.amsScrollbarTheme||"light"},s=e.extend({},n,t.amsScrollbarOptions);s=i.executeFunctionByName(t.amsScrollbarInitCallback,a,s)||s;var r=a.mCustomScrollbar(s);i.executeFunctionByName(t.amsScrollbarAfterInitCallback,a,r,s)})})})}}},n.callbacks={init:function(a){e("[data-ams-callback]",a).each(function(){var a=this,n=e(a).data(),s=i.getFunctionByName(n.amsCallback);void 0===s?n.amsCallbackSource?i.getScript(n.amsCallbackSource,function(){i.executeFunctionByName(n.amsCallback,a,n.amsCallbackOptions)}):t&&t.warn&&t.warn("Undefined callback: "+n.amsCallback):s.call(a,n.amsCallbackOptions)})},alert:function(a){var t=e(this).data(),n=e.extend({},a,t.amsAlertOptions),s=e(t.amsAlertParent||n.parent||this),r=t.amsAlertStatus||n.status||"info",o=t.amsAlertHeader||n.header,c=t.amsAlertMessage||n.message,l=t.amsAlertSubtitle||n.subtitle,d=void 0===t.amsAlertMargin?void 0!==n.margin&&n.margin:t.amsAlertMargin;i.skin.alert(s,r,o,c,l,d)},messageBox:function(a){var t=e(this).data(),n=e.extend({},a,t.amsMessageboxOptions),s=e.extend({},n,{title:t.amsMessageboxTitle||n.title||"",content:t.amsMessageboxContent||n.content||"",icon:t.amsMessageboxIcon||n.icon,number:t.amsMessageboxNumber||n.number,timeout:t.amsMessageboxTimeout||n.timeout}),r=t.amsMessageboxStatus||n.status||"info",o=i.getFunctionByName(t.amsMessageboxCallback||n.callback);i.skin.messageBox(r,s,o)},smallBox:function(a){var t=e(this).data(),n=e.extend({},a,t.amsSmallboxOptions),s=e.extend({},n,{title:t.amsSmallboxTitle||n.title||"",content:t.amsSmallboxContent||n.content||"",icon:t.amsSmallboxIcon||n.icon,iconSmall:t.amsSmallboxIconSmall||n.iconSmall,timeout:t.amsSmallboxTimeout||n.timeout}),r=t.amsSmallboxStatus||n.status||"info",o=i.getFunctionByName(t.amsSmallboxCallback||n.callback);i.skin.smallBox(r,s,o)}},n.events={init:function(a){e("[data-ams-events-handlers]",a).each(function(){var a=e(this),t=a.data("ams-events-handlers");if(t)for(var n in t)t.hasOwnProperty(n)&&a.on(n,i.getFunctionByName(t[n]))})}},n.container={changeOrder:function(a,t){e('input[name="'+e(this).data("ams-input-name")+'"]',e(this)).val(t.join(";"))},deleteElement:function(a){return function(){var a=e(this);n.skin.bigBox({title:i.i18n.WARNING,content:'<i class="text-danger fa fa-fw fa-bell"></i>&nbsp; '+i.i18n.DELETE_WARNING,status:"info",buttons:i.i18n.BTN_OK_CANCEL},function(e){if(e===i.i18n.BTN_OK){var t=a.parents("table").first(),s=t.data("ams-location")||"",r=a.parents("tr").first(),o=r.data("ams-delete-target")||t.data("ams-delete-target")||"delete-element.json",c=r.data("ams-element-name");n.ajax.post(s+"/"+o,{object_name:c},function(e,a){"success"===e.status?(t.hasClass("datatable")?t.dataTable().fnDeleteRow(r[0]):r.remove(),e.handle_json&&n.ajax.handleJSON(e)):n.ajax.handleJSON(e)})}})}}},n.skin={_setPageHeight:function(){var a=e("#main").height(),t=(i.leftPanel.height(),e(window).height()-i.navbarHeight);a>t?i.root.css("min-height",a+i.navbarHeight):i.root.css("min-height",t),i.leftPanel.css("min-height",t),i.leftPanel.css("max-height",t)},_checkMobileWidth:function(){e(window).width()<979?i.root.addClass("mobile-view-activated"):i.root.hasClass("mobile-view-activated")&&i.root.removeClass("mobile-view-activated")},_showShortcutButtons:function(){i.shortcuts.animate({height:"show"},200,"easeOutCirc"),i.root.addClass("shortcut-on")},_hideShortcutButtons:function(){i.shortcuts.animate({height:"hide"},300,"easeOutCirc"),i.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")},_initDesktopWidgets:function(t){if(i.enableWidgets){var n=e(".ams-widget",t);n.length>0&&i.ajax.check(e.fn.MyAMSWidget,i.baseURL+"myams-widgets"+i.devext+".js",function(){n.each(function(){var a=e(this),t=a.data(),n=e.extend({},{deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"},t.amsWidgetOptions);n=i.executeFunctionByName(t.amsWidgetInitcallback,a,n)||n,a.MyAMSWidget(n)}),a.MyAMSWidget.initWidgetsGrid(e(".ams-widget-grid",t))})}},_initMobileWidgets:function(e){i.enableMobile&&i.enableWidgets&&i.skin._initDesktopWidgets(e)},alert:function(a,t,n,s,r,o){"error"===t&&(t="danger"),e(".alert-"+t,a).not(".persistent").remove();var c='<div class="'+(o?"margin-10":"")+" alert alert-block alert-"+t+' 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> '+n+"</h4>"+(r?"<p>"+r+"</p>":"");if("string"==typeof s)c+="<ul><li>"+s+"</li></ul>";else if(s){c+="<ul>";for(var l in s)e.isNumeric(l)&&(c+="<li>"+s[l]+"</li>");c+="</ul>"}e(c+="</div>").prependTo(a);a.exists&&i.ajax.check(e.scrollTo,i.baseURL+"ext/jquery-scrollTo.min.js",function(){e.scrollTo(a,{offset:{top:-50}})})},bigBox:function(e,a){i.ajax.check(i.notify,i.baseURL+"myams-notify"+i.devext+".js",function(){i.notify.messageBox(e,a)})},messageBox:function(e,a,t){"object"==typeof e&&(t=a,a=e||{},e="info"),i.ajax.check(i.notify,i.baseURL+"myams-notify"+i.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,i.notify.bigBox(a,t)})},smallBox:function(e,a,t){"object"==typeof e&&(t=a,a=e||{},e="info"),i.ajax.check(i.notify,i.baseURL+"myams-notify"+i.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,i.notify.smallBox(a,t)})},_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(i.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()),i=e("<li></li>").append(t.attr("href").replace(/^#/,"")?e("<a></a>").html(n).attr("href",t.attr("href")):n);a.append(i)})},checkURL:function(){function a(a){e(".active",n).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 t,n=e("nav"),s=location.hash,r=s.replace(/^#/,"");if(r){var o=e("#content");o.exists()||(o=e("body")),(t=e('A[href="'+s+'"]',n)).exists()&&a(t),i.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")||t.attr("title")||document.title)}})}else{var c=e("[data-ams-active-menu]").data("ams-active-menu");(t=c?e('A[href="'+c+'"]',n):e('>UL >LI >A[href!="#"]',n).first()).exists()&&(a(t),c?i.skin._drawBreadCrumb():window.location.hash=t.attr("href"))}},_clean_callbacks:[],registerCleanCallback:function(e){var a=i.skin._clean_callbacks;a.indexOf(e)<0&&a.push(e)},unregisterCleanCallback:function(e){var a=i.skin._clean_callbacks,t=a.indexOf(e);t>=0&&a.splice(t,1)},cleanContainer:function(e){for(var a=i.skin._clean_callbacks,t=0;t<a.length;t++)a[t].call(e)},loadURL:function(a,t,n,s){a.startsWith("#")&&(a=a.substr(1)),"function"==typeof n?(s=n,n={}):void 0===n&&(n={}),t=e(t);var r={type:"GET",url:a,dataType:"html",cache:!1,beforeSend:function(){if(n&&n.preLoadCallback&&i.executeFunctionByName(n.preLoadCallback,this),i.skin.cleanContainer(t),t.html('<h1 class="loading"><i class="fa fa-cog fa-spin"></i> '+i.i18n.LOADING+" </h1>"),t[0]===e("#content")[0]){i.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 t.animate({scrollTop:0},"fast")},success:function(a,r,o){if(s)i.executeFunctionByName(s,this,a,r,o,n);else{var c=i.ajax.getResponse(o),l=c.contentType,d=c.data;switch(e(".loading",t).remove(),l){case"json":i.ajax.handleJSON(d,t);break;case"script":case"xml":break;case"html":case"text":default:t.parents(".hidden").removeClass("hidden"),e(".alert",t.parents(".alerts-container")).remove(),t.css({opacity:"0.0"}).html(a).removeClass("hidden").delay(50).animate({opacity:"1.0"},300),i.initContent(t),i.form.setFocus(t)}n&&n.afterLoadCallback&&i.executeFunctionByName(n.afterLoadCallback,this),i.stats.logPageview()}},error:function(e,a,n){t.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+i.i18n.ERROR+n+"</h3>"+e.responseText)},async:void 0===n.async||n.async},o=e.extend({},r,n);e.ajax(o)},setLanguage:function(e){var a=e.lang;switch(e.handler_type||"json"){case"json":var t=e.method||"setUserLanguage";i.jsonrpc.post(t,{lang:a},function(){window.location.reload(!0)});break;case"ajax":var n=e.href||"setUserLanguage";i.ajax.post(n,{lang:a},function(){window.location.reload(!0)})}},logout:function(){window.location=i.loginURL}},n.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]))}},n.initPage=function(){var a=e("body");i.root=a,i.leftPanel=e("#left-panel"),i.shortcuts=e("#shortcuts"),i.plugins.initData(a);var t=e.ajaxSettings.xhr;e.ajaxSetup({progress:i.ajax.progress,progressUpload:i.ajax.progress,xhr:function(){var e=t();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(i.ajax.start),e(document).ajaxStop(i.ajax.stop),e(document).ajaxError(i.error.ajax),i.isMobile?(i.root.addClass("mobile-detected"),i.device="mobile",i.enableFastclick&&i.ajax.check(e.fn.noClickDelay,i.baseURL+"/ext/jquery-smartclick"+i.devext+".js",function(){e("NAV UL A").noClickDelay(),e("A","#hide-menu").noClickDelay()})):(i.root.addClass("desktop-detected"),i.device="desktop"),e("#hide-menu >:first-child > A").click(function(e){a.toggleClass("hidden-menu"),e.preventDefault()}),e("#show-shortcuts").click(function(e){i.shortcuts.is(":visible")?i.skin._hideShortcutButtons():i.skin._showShortcutButtons(),e.preventDefault()}),i.shortcuts.click(function(e){i.skin._hideShortcutButtons()}),e(document).mouseup(function(e){i.shortcuts.is(e.target)||0!==i.shortcuts.has(e.target).length||i.skin._hideShortcutButtons()}),e("#search-mobile").click(function(){i.root.addClass("search-mobile")}),e("#cancel-search-js").click(function(){i.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()}),i.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 t=e(this).data("ams-url");if(t){a.preventDefault(),a.stopPropagation();var n=i.getFunctionByName(t);if("function"==typeof n&&(t=n.call(this)),"function"==typeof t)t.call(this);else{var s=e(".ajax-notifications");i.skin.loadURL(t,s)}}}),e("a","#user-menu LI.logout").click(function(a){a.preventDefault(),a.stopPropagation(),i.loginURL=e(this).attr("href"),i.skin.bigBox({title:"<i class='fa fa-sign-out txt-color-orangeDark'></i> "+i.i18n.LOGOUT+" <span class='txt-color-orangeDark'><strong>"+e("#show-shortcut").text()+"</strong></span> ?",content:i.i18n.LOGOUT_COMMENT,buttons:i.i18n.BTN_YES_NO},function(e){e===i.i18n.BTN_YES&&(i.root.addClass("animated fadeOutUp"),setTimeout(i.skin.logout,1e3))})});var n=e("nav");e("UL",n).myams_menu({accordion:!1!==n.data("ams-menu-accordion"),speed:i.menuSpeed}),e(".minifyme").click(function(a){e("BODY").toggleClass("minified"),e(this).effect("highlight",{},500),a.preventDefault()}),e("#refresh").click(function(e){i.skin.bigBox({title:"<i class='fa fa-refresh' style='color: green'></i> "+i.i18n.CLEAR_STORAGE_TITLE,content:i.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+i.i18n.BTN_CANCEL+"]["+i.i18n.BTN_OK+"]"},function(e){e===i.i18n.BTN_OK&&localStorage&&(localStorage.clear(),location.reload())}),e.preventDefault()}),a.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")}),i.ajax.check(e.resize,i.baseURL+"ext/jquery-resize"+i.devext+".js",function(){e("#main").resize(function(){i.skin._setPageHeight(),i.skin._checkMobileWidth()}),n.resize(function(){i.skin._setPageHeight()})}),i.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 t=e(a.currentTarget),n=t.data("ams-disabled-handlers");if(!0!==n&&"click"!==n&&"all"!==n){var s=t.attr("href")||t.data("ams-url");if(s&&!s.startsWith("javascript")&&!t.attr("target")&&!0!==t.data("ams-context-menu")){a.preventDefault(),a.stopPropagation();var r=i.getFunctionByName(s);if("function"==typeof r&&(s=r.call(t)),"function"==typeof s)s.call(t);else if(s=s.replace(/\%23/,"#"),a.ctrlKey)window.open(s);else{var o=t.data("ams-target");o?i.form.confirmChangedForm(o,function(){i.skin.loadURL(s,o,t.data("ams-link-options"),t.data("ams-link-callback"))}):i.form.confirmChangedForm(function(){s.startsWith("#")?s!==location.hash&&(i.root.hasClass("mobile-view-activated")?(i.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=s},50)):window.location.hash=s):window.location=s})}}}}),e(document).on("click",'a[target="_blank"]',function(a){a.preventDefault();var t=e(a.currentTarget);window.open(t.attr("href")),i.stats.logEvent(t.data("ams-stats-category")||"Navigation",t.data("ams-stats-action")||"External",t.data("ams-stats-label")||t.attr("href"))}),e(document).on("click",'a[target="_top"]',function(a){a.preventDefault(),i.form.confirmChangedForm(function(){window.location=e(a.currentTarget).attr("href")})}),e(window).on("hashchange",i.skin.checkURL)),e(document).off("click.modal").on("click",'[data-toggle="modal"]',function(a){var t=e(this),n=t.data("ams-disabled-handlers");!0!==n&&"click"!==n&&"all"!==n&&!0!==t.data("ams-context-menu")&&(!0===t.data("ams-stop-propagation")&&a.stopPropagation(),a.preventDefault(),i.dialog.open(t),t.parents("#shortcut").exists()&&setTimeout(i.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)}),e(document).on("click",'input[type="checkbox"][readonly]',function(){return!1}),e(document).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 s=t.data();if(s.amsClickHandler){!0!==s.amsStopPropagation&&!0!==s.amsClickStopPropagation||a.stopPropagation(),!0!==s.amsClickKeepDefault&&a.preventDefault();var r=i.getFunctionByName(s.amsClickHandler);void 0!==r&&r.call(t,s.amsClickHandlerOptions)}}}),e(document).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 s=t.data();if(s.amsChangeHandler){!0!==s.amsChangeKeepDefault&&a.preventDefault();var r=i.getFunctionByName(s.amsChangeHandler);void 0!==r&&r.call(t,s.amsChangeHandlerOptions)}}}}),e(document).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");a.select2("val",a.data("ams-select2-input-value").split(t.opts.separator))}),t.find(".select2").trigger("change"),e("[data-ams-reset-callback]",t).each(function(){var a=e(this),n=a.data(),s=i.getFunctionByName(n.amsResetCallback);void 0!==s&&s.call(t,a,n.amsResetCallbackOptions)})},10),i.form.setFocus(t)}),e(document).on("reset","[data-ams-reset-handler]",function(a){var t=e(this),n=t.data();if(n.amsResetHandler){!0!==n.amsResetKeepDefault&&a.preventDefault();var s=i.getFunctionByName(n.amsResetHandler);void 0!==s&&s.call(t,n.amsResetHandlerOptions)}}),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("focusin",function(a){e(a.target).closest(".mce-window").length&&a.stopImmediatePropagation()}),e("a[data-toggle=tab]",".nav-tabs").on("click",function(a){if(e(this).parent("li").hasClass("disabled"))return a.preventDefault(),!1}),e(document).on("show.bs.tab",function(a){var t=e(a.target),n=t.data();if(n.amsUrl){if(n.amsTabLoaded)return;try{t.append('<i class="fa fa-spin fa-cog margin-left-5"></i>'),i.skin.loadURL(n.amsUrl,t.attr("href"),{afterLoadCallback:function(){n.amsTabLoadOnce&&t.data("ams-tab-loaded",!0)}})}finally{e("i",t).remove()}}}),e(document).on("hide.bs.modal",function(a){var t=e(a.target);i.form.confirmChangedForm(t,function(){return t.data("modal").isShown=!0,!0},function(){return a.preventDefault(),!1})}),i.initContent(document),i.ajaxNav&&n.exists()&&i.skin.checkURL(),i.form.setFocus(document),e(window).on("beforeunload",i.form.checkBeforeUnload)},n.initContent=function(a){e(".tipsy").remove(),e("[rel=tooltip]",a).tooltip(),e("[rel=popover]",a).popover(),e("[rel=popover-hover]",a).popover({trigger:"hover"}),i.plugins.init(a),i.callbacks.init(a),i.events.init(a),i.form.init(a),"desktop"===i.device?i.skin._initDesktopWidgets(a):i.skin._initMobileWidgets(a),i.skin._setPageHeight()},n.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"},n.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"}},e(document).ready(function(){var a=(e=jQuery.noConflict())("HTML"),t=a.attr("lang")||a.attr("xml:lang");t&&!t.startsWith("en")?(n.lang=t,n.getScript(n.baseURL+"i18n/myams_"+t.substr(0,2)+".js",function(){n.initPage()})):n.initPage()})}(jQuery,this);
+!function(e,a){"use strict";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},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 i=n.className.split(" ").map(function(e){return e.startsWith(a)?"":e});n.className=e.trim(i.join(" "))}),this},contextMenu:function(a){function t(t,n,i){var s=e(window)[n](),r=e(a.menuSelector)[n](),o=t;return t+r>s&&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(n){if(!n.ctrlKey)return e(a.menuSelector).data("invokedOn",e(n.target)).show().css({position:"fixed",left:t(n.clientX,"width")-10,top:t(n.clientY,"height")-10}).off("click").on("click",function(t){e(this).hide();var n=e(this).data("invokedOn"),s=e(t.target);a.menuSelected.call(this,n,s),i.event.stop(t)}),!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 i=a.attr("href").replace(/^#/,""),s=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&&s!==o[a]){var c=e(o[a]);!i&&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");i||!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)})}})}}),e.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,i=0,s=0;t<e.length;)(n=e.charCodeAt(t))<128?(a+=String.fromCharCode(n),t++):n>191&&n<224?(i=e.charCodeAt(t+1),a+=String.fromCharCode((31&n)<<6|63&i),t+=2):(i=e.charCodeAt(t+1),s=e.charCodeAt(t+2),a+=String.fromCharCode((15&n)<<12|(63&i)<<6|63&s),t+=3);return a}},void 0===a.MyAMS&&(a.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,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,i=n;n.baseURL=function(){var a=e('script[src*="/myams.js"], script[src*="/myams.min.js"]').attr("src");return i.devmode=a.indexOf(".min.js")<0,i.devext=i.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 i=0;i<t.length;i++)try{a=a[t[i]]}catch(e){return}try{return a[n]}catch(e){return}}},n.executeFunctionByName=function(e,a){var t=i.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 i.getFunctionByName(e.substr(1,e.length-2))})},n.getScript=function(a,t,n){"object"==typeof t&&(n=t,t=null),void 0===n&&(n={});var s={dataType:"script",url:i.getSource(a),success:t,error:i.error.show,cache:!i.devmode,async:void 0===n.async?"function"==typeof t:n.async},r=e.extend({},s,n);return e.ajax(r)},n.getCSS=function(a,t){var n=e("HEAD");if(0===e('link[data-ams-id="'+t+'"]',n).length){var s=i.getSource(a);i.devmode&&(s+="?_="+(new Date).getTime()),e("<link />").attr({rel:"stylesheet",type:"text/css",href:s,"data-ams-id":t}).appendTo(n)}},n.event={stop:function(e){e||(e=window.event),e&&(e.stopPropagation?(e.stopPropagation(),e.preventDefault()):(e.cancelBubble=!0,e.returnValue=!1))}},n.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(s){function r(s){var r=!1;if(window.clipboardData&&window.clipboardData.setData)r=clipboardData.setData("Text",s);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var o=e("<textarea>");o.val(s),o.css("position","fixed"),o.appendTo(e("body")),o.get(0).select();try{document.execCommand("copy"),r=!0}catch(e){t&&t.warn&&t.warn("Copy to clipboard failed.",e)}finally{o.remove()}}r?i.skin.smallBox("success",{title:s.length>1?i.i18n.CLIPBOARD_TEXT_COPY_OK:i.i18n.CLIPBOARD_CHARACTER_COPY_OK,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:1e3}):a.prompt&&a.prompt(n.i18n.CLIPBOARD_COPY,s)}if(void 0===s)return function(){var a=e(this),t=a.text();a.parents(".btn-group").removeClass("open"),r(t)};r(s)}},n.error={ajax:function(e,a,n,s){if(!("abort"===s||a&&a.statusText&&"OK"===a.statusText.toUpperCase())){if("json"===(a=i.ajax.getResponse(a)).contentType)i.ajax.handleJSON(a.data);else{var r=e.statusText||e.type,o=a.responseText;i.skin.messageBox("error",{title:i.i18n.ERROR_OCCURED,content:"<h4>"+r+"</h4><p>"+(o||"")+"</p>",icon:"fa fa-warning animated shake",timeout:1e4})}t&&(t.error&&t.error(e),t.debug&&t.debug(a))}},show:function(e,a,n){if(n){var s=i.ajax.getResponse(e);"json"===s.contentType?i.ajax.handleJSON(s.data):i.skin.messageBox("error",{title:i.i18n.ERRORS_OCCURED,content:"<h4>"+a+"</h4><p>"+n+"</p>",icon:"fa fa-warning animated shake",timeout:1e4}),t&&(t.error&&t.error(n),t.debug&&t.debug(e))}}},n.ajax={check:function(a,t,n,s){function r(e,a){if(void 0!==n){n instanceof Array||(n=[n]);for(var t=0;t<n.length;t++){var s=i.getFunctionByName(n[t]);"function"==typeof s&&s(e,a)}}}n instanceof Array||"object"==typeof n&&(s=n,n=void 0);var o={async:"function"==typeof n},c=e.extend({},o,s);if(a instanceof Array){for(var l=[],d=0;d<a.length;d++)void 0===a[d]&&l.push(i.getScript(t[d],{async:!0}));l.length>0?e.when.apply(e,l).then(function(){r(!0,s)}):r(!1,s)}else void 0===a?"string"==typeof t&&i.getScript(t,function(){r(!0,s)},c):r(!1,s)},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||t&&t.log&&t.log(parseInt(e.loaded/e.total*100,10)+"%"))},post:function(a,t,n,s){var r;r=a.startsWith(window.location.protocol)?a:this.getAddr()+a,"function"==typeof n?(s=n,n={}):n||(n={}),void 0===s&&(s=n.callback),"string"==typeof s&&(s=i.getFunctionByName(s)),delete n.callback;var o,c={url:r,type:"post",cache:!1,async:"function"==typeof s,data:e.param(t),dataType:"json",success:s||function(e){o=e.result}},l=e.extend({},c,n);return e.ajax(l),o},getResponse:function(e){var a,t,n=e.getResponseHeader("content-type");if(n)if(n.startsWith("application/javascript"))a="script",t=e.responseText;else if(n.startsWith("text/html"))a="html",t=e.responseText;else if(n.startsWith("text/xml"))a="xml",t=e.responseText;else if(t=e.responseJSON)a="json";else try{t=JSON.parse(e.responseText),a="json"}catch(n){t=e.responseText,a="text"}else a="json",t={status:"alert",alert:{title:i.i18n.ERROR_OCCURED,content:i.i18n.NO_SERVER_RESPONSE}};return{contentType:a,data:t}},handleJSON:function(n,s,r){var o,c=n.status;switch(c){case"alert":a.alert&&a.alert(n.alert.title+"\n\n"+n.alert.content);break;case"error":i.form.showErrors(s,n);break;case"info":case"success":void 0!==s&&(i.form.resetChanged(s),!1!==n.close_form&&i.dialog.close(s));break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":void 0!==s&&(i.form.resetChanged(s),!1!==n.close_form&&i.dialog.close(s));break;case"modal":i.dialog.open(n.location);break;case"reload":void 0!==s&&(i.form.resetChanged(s),!1!==n.close_form&&i.dialog.close(s)),(o=n.location||window.location.hash).startsWith("#")&&(o=o.substr(1));var l=e(n.target||r||"#content");i.skin.loadURL(o,l,{preLoadCallback:i.getFunctionByName(n.pre_reload)||function(){e("[data-ams-pre-reload]",l).each(function(){i.executeFunctionByName(e(this).data("ams-pre-reload"))})},afterLoadCallback:i.getFunctionByName(n.post_reload)||function(){e("[data-ams-post-reload]",l).each(function(){i.executeFunctionByName(e(this).data("ams-post-reload"))})}});break;case"redirect":void 0!==s&&(i.form.resetChanged(s),!0===n.close_form&&i.dialog.close(s)),o=n.location||window.location.href,n.window?window.open(o,n.window,n.options):window.location.href===o?window.location.reload(!0):window.location.href=o;break;default:t&&t.log&&t.log("Unhandled status: "+c)}var d,m,u;if(n.content&&(m=n.content,u=e(m.target||r||s||"#content"),!0===m.raw?u.text(m.text):(u.html(m.html),i.initContent(u)),m.keep_hidden||u.removeClass("hidden")),n.contents){var f=n.contents;for(d=0;d<f.length;d++)m=f[d],u=e(m.target),!0===m.raw?u.text(m.text):(u.html(m.html),i.initContent(u)),m.keep_hidden||u.removeClass("hidden")}var h;if(n.message&&("string"==typeof(h=n.message)?"info"===c||"success"===c?i.skin.smallBox(c,{title:h,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}):i.skin.alert(e(s||"#content"),c,h):i.skin.alert(e(h.target||r||s||"#content"),h.status||"success",h.header,h.body,h.subtitle)),n.smallbox&&i.skin.smallBox(n.smallbox_status||c,{title:n.smallbox,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3e3}),n.messagebox)if("string"==typeof(h=n.messagebox))i.skin.messageBox("info",{title:i.i18n.ERROR_OCCURED,content:h,timeout:1e4});else{var p=h.status||"info";"error"===p&&s&&r&&i.executeFunctionByName(s.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",s,r),i.skin.messageBox(p,{title:h.title||i.i18n.ERROR_OCCURED,content:h.content,icon:h.icon,number:h.number,timeout:null===h.timeout?void 0:h.timeout||1e4})}if(n.event&&s.trigger(n.event,n.event_options),n.events){var g;for(void 0===s&&(s=e(document)),d=0;d<n.events.length;d++)"string"==typeof(g=n.events[d])?s.trigger(g,n.events_options):s.trigger(g.event,g.options)}if(n.callback&&i.executeFunctionByName(n.callback,s,n.options),n.callbacks){var b;for(d=0;d<n.callbacks.length;d++)"function"==typeof(b=n.callbacks[d])?i.executeFunctionByName(b,s,b.options):i.executeFunctionByName(b.callback,s,b.options)}}},n.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,t,n,s){i.ajax.check(e.jsonRPC,i.baseURL+"ext/jquery-jsonrpc"+i.devext+".js",function(){"function"==typeof n?(s=n,n={}):n||(n={}),"undefined"===s&&(s=n.callback),"string"==typeof s&&(s=i.getFunctionByName(s)),delete n.callback;var r={};"string"==typeof a?r.query=a:"object"==typeof a&&e.extend(r,a),e.extend(r,n);var o,c={id:(new Date).getTime(),params:r,success:s||function(e){o=e},error:i.error.show},l=e.extend({},c,n);return e.jsonRPC.withOptions({endPoint:i.jsonrpc.getAddr(n.url),namespace:n.namespace,cache:!1},function(){e.jsonRPC.request(t,l)}),o})},post:function(a,t,n,s){i.ajax.check(e.jsonRPC,i.baseURL+"ext/jquery-jsonrpc"+i.devext+".js",function(){"function"==typeof n?(s=n,n={}):n||(n={}),void 0===s&&(s=n.callback),"string"==typeof s&&(s=i.getFunctionByName(s)),delete n.callback;var r,o={id:(new Date).getTime(),params:t,success:s||function(e){r=e},error:i.error.show},c=e.extend({},o,n);return e.jsonRPC.withOptions({endPoint:i.jsonrpc.getAddr(n.url),namespace:n.namespace,cache:!1},function(){e.jsonRPC.request(a,c)}),r})}},n.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,t,n,s,r){i.ajax.check(e.xmlrpc,i.baseURL+"ext/jquery-xmlrpc"+i.devext+".js",function(){"function"==typeof s?(r=s,s={}):s||(s={}),void 0===r&&(r=s.callback),"string"==typeof r&&(r=i.getFunctionByName(r)),delete s.callback;var o,c={url:i.xmlrpc.getAddr(a),methodName:t,params:n,success:r||function(e){o=e},error:i.error.show},l=e.extend({},c,s);return e.xmlrpc(l),o})}},n.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())})});(i.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 t=a.data("ams-changed-event")||"change";a.on(t,function(){i.form.setChanged(e(this).parents("FORM"))})}}),a.on("reset",function(){i.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 i.i18n.FORM_CHANGED_WARNING},confirmChangedForm:function(t,n,s){"function"==typeof t&&(n=t,t=void 0),e('FORM[data-ams-form-changed="true"]',t).exists()?s?a.confirm(i.i18n.FORM_CHANGED_WARNING,i.i18n.WARNING)?n.call(t):s.call(t):i.skin.bigBox({title:i.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i>&nbsp; '+i.i18n.FORM_CHANGED_WARNING,buttons:i.i18n.BTN_OK_CANCEL},function(e){e===i.i18n.BTN_OK&&n.call(t)}):n.call(t)},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(t,n,s){if(!(t=e(t)).exists())return!1;if("object"==typeof n&&(s=n,n=void 0),t.data("submitted"))return t.data("ams-form-hide-submitted")||i.skin.messageBox("warning",{title:i.i18n.WAIT,content:i.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:t.data("ams-form-alert-timeout")||5e3}),!1;if(!i.form._checkSubmitValidators(t))return!1;e(".alert-danger, SPAN.state-error",t).not(".persistent").remove(),e(".state-error",t).removeClassPrefix("state-");var r=e(t.data("ams-submit-button"));return r&&!r.data("ams-form-hide-loading")&&(r.data("ams-progress-content",r.html()),r.button("loading")),i.ajax.check(e.fn.ajaxSubmit,i.baseURL+"ext/jquery-form-3.49"+i.devext+".js",function(){function r(t,r){var o,c,l,d,m,u,f,h,p,g=t.data(),b=g.amsFormOptions;if(s&&(m=s.formDataInitCallback),m?delete s.formDataInitCallback:m=g.amsFormDataInitCallback,m){var v={};if(d="function"==typeof m?m.call(t,v):i.executeFunctionByName(m,t,v),v.veto)return(o=t.data("ams-submit-button"))&&o.button("reset"),i.form.finalizeSubmitFooter.call(t),!1}else d=g.amsFormData||{};(o=e(t.data("ams-submit-button")))&&o.exists()?l=(c=o.data()).amsFormSubmitTarget:c={};var x,y=n||c.amsFormHandler||g.amsFormHandler||"";if(y.startsWith(window.location.protocol))x=y;else{var k=c.amsFormAction||t.attr("action").replace(/#/,"");x=k.startsWith(window.location.protocol)?k:i.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;s&&s.initSubmitTarget?i.executeFunctionByName(s.initSubmitTarget,t):g.amsFormInitSubmitTarget?(C=e(l||g.amsFormSubmitTarget||"#content"),i.executeFunctionByName(g.amsFormInitSubmit||"MyAMS.form.initSubmit",t,C)):g.amsFormHideSubmitFooter||i.executeFunctionByName(g.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",t),s&&(d=e.extend({},d,s.form_data));var S;u?d.progress_id=i.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,t,n){C&&i.executeFunctionByName(g.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",n,C),i.form.resetAfterSubmit(n)},iframe:S},F=s&&s.downloadTarget||g.amsFormDownloadTarget;if(F){var N=e('iframe[name="'+F+'"]');N.exists()||(N=e("<iframe></iframe>").hide().attr("name",F).appendTo(e("body"))),w=e.extend({},w,{iframe:!0,iframeTarget:N,success:function(a,t,n,s){if(e(s).parents(".modal-dialog").exists())i.dialog.close(s);else{var r,o=s.data("ams-submit-button");o&&(r=o.data("ams-form-submit-callback")),r||(r=i.getFunctionByName(g.amsFormSubmitCallback)||i.form._submitCallback);try{r.call(s,a,t,n,s)}finally{i.form.resetAfterSubmit(s),i.form.resetChanged(s)}}}})}else w=e.extend({},w,{error:function(e,a,t,n){C&&i.executeFunctionByName(g.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",n,C),i.form.resetAfterSubmit(n)},success:function(e,a,t,n){var s,r=n.data("ams-submit-button");r&&(s=r.data("ams-form-submit-callback")),s||(s=i.getFunctionByName(g.amsFormSubmitCallback)||i.form._submitCallback);try{s.call(n,e,a,t,n)}finally{i.form.resetAfterSubmit(n),i.form.resetChanged(n)}},iframe:S});var T=e.extend({},w,r,b,s);if(u&&function(e,a){function n(){clearInterval(s),i.form.resetAfterSubmit(t,o),o.html(o.data("ams-progress-content")),i.executeFunctionByName(p,t,o),i.form.resetChanged(t)}var s;o.button("loading"),s=setInterval(function(){i.ajax.post(e,{progress_id:a},{error:n},i.getFunctionByName(h)||function(e,a){if("success"===a)if("running"===e.status)if(e.message)o.text(e.message);else{var t=o.data("ams-progress-text")||i.i18n.PROGRESS;e.current?t+=": "+e.current+"/ "+(e.length||100):t+="...",o.text(t)}else"finished"===e.status&&n();else n()})},f)}(u,d.progress_id),e(t).ajaxSubmit(T),F){var R=e(t).parents(".modal-dialog"),O=R.exists()&&o.exists()&&o.data("ams-keep-modal");R.exists()&&!0!==O?i.dialog.close(t):u||setTimeout(function(){i.form.resetAfterSubmit(t,o),i.form.resetChanged(t)},o.data("ams-form-reset-timeout")||2e3)}}if(!0!==t.data("ams-form-ignore-uploads")&&e('INPUT[type="file"]',t).length>0){i.ajax.check(e.progressBar,i.baseURL+"ext/jquery-progressbar"+i.devext+".js");var o=e.extend({},{uuid:e.progressBar.submit(t)});r(t,o)}else r(t,{})}),!1},initSubmit:function(a,t){var n=e(this),i='<i class="fa fa-3x fa-gear fa-spin"></i>';t||(t=n.data("ams-form-submit-message")),t&&(i+="<strong>"+t+"</strong>"),e(a).html('<div class="row margin-20"><div class="text-center">'+i+"</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"),i.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 i=e("footer",t);e("button",i).hide(),i.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,t,n,s){var r;s.is(":visible")&&(i.form.finalizeSubmitFooter.call(s),(r=s.data("ams-submit-button"))&&r.button("reset"));var o,c=s.data();if(c.amsFormDatatype)o=c.amsFormDatatype;else{var l=i.ajax.getResponse(n);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":i.ajax.handleJSON(a,s,d);break;case"script":case"xml":break;case"html":case"text":default:i.form.resetChanged(s),r&&!0!==r.data("ams-keep-modal")&&i.dialog.close(s),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),i.initContent(d),i.form.setFocus(d)}var m=n.getResponseHeader("X-AMS-Callback");if(m){var u=n.getResponseHeader("X-AMS-Callback-Options");i.executeFunctionByName(m,s,void 0===u?{}:JSON.parse(u),n)}},_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=i.form._getSubmitValidators(e);if(!a.length)return!0;for(var t=[],n=!0,s=0;s<a.length;s++){var r=a[s],o=r[0],c=r[1],l=i.executeFunctionByName(c,e,o);!1===l?n=!1:"string"==typeof l?t.push(l):n.length&&n.length>0&&(t=t.concat(n))}if(t.length>0){var d=1===t.length?i.i18n.ERROR_OCCURED:i.i18n.ERRORS_OCCURED;return i.skin.alert(e,"danger",d,t),!1}return n},showErrors:function(a,t){var n;if("string"==typeof t)i.skin.alert(a,"error",i.i18n.ERROR_OCCURED,t);else if(t instanceof Array)n=1===t.length?i.i18n.ERROR_OCCURED:i.i18n.ERRORS_OCCURED,i.skin.alert(a,"error",n,t);else{e(".state-error",a).removeClass("state-error"),n=t.error_header||(t.widgets&&t.widgets.length>1?i.i18n.ERRORS_OCCURED:i.i18n.ERROR_OCCURED);var s,r=[];if(t.messages)for(s=0;s<t.messages.length;s++){var o=t.messages[s];o.header?r.push("<strong>"+o.header+"</strong><br />"+o.message):r.push(o.message||o)}if(t.widgets)for(s=0;s<t.widgets.length;s++){var c=t.widgets[s],l=e('[name="'+c.name+'"]',a);l.exists()||(l=e('[name="'+c.name+':list"]',a)),l.exists()&&l.parents("label: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()}}i.skin.alert(e("fieldset:first",a),t.error_level||"error",n,r,t.error_message)}}},n.dialog={_shown_callbacks:[],registerShownCallback:function(e,a){var t;a&&(t=a.objectOrParentWithClass("modal-dialog"));var n;t&&t.exists()?void 0===(n=t.data("shown-callbacks"))&&(n=[],t.data("shown-callbacks",n)):n=i.dialog._shown_callbacks,n.indexOf(e)<0&&n.push(e)},_hide_callbacks:[],registerHideCallback:function(e,a){var t;a&&(t=a.objectOrParentWithClass("modal-dialog"));var n;t&&t.exists()?void 0===(n=t.data("hide-callbacks"))&&(n=[],t.data("hide-callbacks",n)):n=i.dialog._hide_callbacks,n.indexOf(e)<0&&n.push(e)},open:function(a,t){i.ajax.check(e.fn.modalmanager,i.baseURL+"ext/bootstrap-modalmanager"+i.devext+".js",function(){i.ajax.check(e.fn.modal.defaults,i.baseURL+"ext/bootstrap-modal"+i.devext+".js",function(n){n&&(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 s,r;if("string"==typeof a)s={},r=a;else{s=a.data(),r=a.attr("href")||s.amsUrl;var o=i.getFunctionByName(r);"function"==typeof o&&(r=o.call(a))}r&&(e("body").modalmanager("loading"),0===r.indexOf("#")?e(r).modal("show"):e.ajax({url:r,type:"get",cache:void 0!==s.amsAllowCache&&s.amsAllowCache,data:t,success:function(t,n,o){e("body").modalmanager("removeLoading");var c=i.ajax.getResponse(o),l=c.contentType,d=c.data;switch(l){case"json":i.ajax.handleJSON(d,e(e(a).data("ams-json-target")||"#content"));break;case"script":case"xml":break;case"html":case"text":default:var m=e(d),u=e(".modal-dialog",m.wrap("<div></div>").parent()),f=u.data(),h={backdrop:"static",overflow:f.amsModalOverflow||".modal-viewport",maxHeight:void 0===f.amsModalMaxHeight?function(){return e(window).height()-e(".modal-header",m).outerHeight(!0)-e("footer",m).outerHeight(!0)-85}:i.getFunctionByName(f.amsModalMaxHeight)},p=e.extend({},h,f.amsModalOptions);p=i.executeFunctionByName(f.amsModalInitCallback,u,p)||p,e("<div>").addClass("modal fade").append(m).modal(p).on("shown",i.dialog.shown).on("hidden",i.dialog.hidden),i.initContent(m),!1!==s.amsLogEvent&&i.stats.logPageview(r)}}}))})})},shown:function(a){function t(a){var t=e(".scrollmarker.top",s),n=s.scrollTop();n>0?t.show():t.hide();var i=e(".scrollmarker.bottom",s);r+n>=s.get(0).scrollHeight?i.hide():i.show()}var n=a.target,s=e(".modal-viewport",n);if(s.exists()){var r=parseInt(s.css("max-height")),o=e.scrollbarWidth();"hidden"!==s.css("overflow")&&s.height()===r?(e("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",s.width()-o).hide().appendTo(s),e("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",r-20).css("width",s.width()-o).appendTo(s),s.scroll(t),s.off("resize").on("resize",t)):e(".scrollmarker",s).remove()}e("[data-ams-shown-callback]",n).each(function(){var a=i.getFunctionByName(e(this).data("ams-shown-callback"));a&&a.call(n,this)});var c,l=e(".modal-dialog",n).data("shown-callbacks");if(l)for(c=0;c<l.length;c++)l[c].call(n);if(l=i.dialog._shown_callbacks)for(c=0;c<l.length;c++)l[c].call(n);i.form.setFocus(n)},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 t=a.target;i.skin.cleanContainer(t),e("[data-ams-hidden-callback]",t).each(function(){var a=i.getFunctionByName(e(this).data("ams-hidden-callback"));a&&a.call(t,this)});var n,s=e(".modal-dialog",t).data("hide-callbacks");if(s)for(n=0;n<s.length;n++)s[n].call(t);if(s=i.dialog._hide_callbacks)for(n=0;n<s.length;n++)s[n].call(t)}},n.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"),n=a.data("ams-select2-target");e('[name="'+n+'"]',t).data("select2").val("")},select2FormatSelection:function(a,t){a instanceof Array?e(a).each(function(){"object"==typeof this?t.append(this.text):t.append(this)}):"object"==typeof a?t.append(a.text):t.append(a)},select2SelectAllHelper:function(){var a=e(this).parents("label:first"),t=e(".select2",a);t.select2("data",t.data("ams-select2-data"))},select2QueryUrlResultsCallback:function(a,t,n){switch(a.status){case"error":i.skin.messageBox("error",{title:i.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(),i.dialog.open(a.location);break;default:return{results:a.results||a,more:a.has_more||!1,context:a.context}}},select2QueryMethodSuccessCallback:function(a,t,n){var s=a.result;if("string"==typeof s)try{s=JSON.parse(s)}catch(e){}switch(s.status){case"error":i.skin.messageBox("error",{title:i.i18n.ERROR_OCCURED,content:"<h4>"+s.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":e(this).data("select2").dropdown.hide(),i.dialog.open(s.location);break;default:n.callback({results:s.results||s,more:s.has_more||!1,context:s.context})}},contextMenuHandler:function(e,a){var t=a.data();if("modal"===t.toggle)i.dialog.open(a);else{var n=a.attr("href")||t.amsUrl;if(!n||n.startsWith("javascript")||a.attr("target"))return;i.event.stop();var s=i.getFunctionByName(n);"function"==typeof s&&(n=s.call(a,e)),"function"==typeof n?n.call(a,e):(n=n.replace(/\%23/,"#"),(e=a.data("ams-target"))?i.form.confirmChangedForm(e,function(){i.skin.loadURL(n,e,a.data("ams-link-options"),a.data("ams-link-callback"))}):i.form.confirmChangedForm(function(){n.startsWith("#")?n!==location.hash&&(i.root.hasClass("mobile-view-activated")?(i.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=n},150)):window.location.hash=n):window.location=n}))}},datetimepickerDialogHiddenCallback:function(){e(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")}},n.plugins={init:function(a){function t(e,a){if(o.hasOwnProperty(e)){var t=o[e];t.css=t.css||a.css,t.callbacks.push({callback:a.callback,context:a.context}),a.register&&(t.register=!0),!1===a.async&&(t.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&&i.getCSS(a.css,e+"_css")}function n(e){var t,n,s=c.callbacks;if(s&&s.length){for(t=0;t<s.length;t++)if(n=s[t],n.callback=i.getFunctionByName(n.callback),!1!==c.register){var o=i.plugins.enabled;o.hasOwnProperty(r)?o[r].push(n):o[r]=[n]}}else!1!==c.register&&(i.plugins.enabled[r]=null);if(!0!==e&&s&&s.length&&!1!==c.async)for(t=0;t<s.length;t++)n=s[t],i.executeFunctionByName(n.callback,a,n.context)}i.plugins.initData(a);var s=[];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++)s.push(a[t])});var r,o={};e("[data-ams-plugins]",a).each(function(){var a=e(this),n=a.data("ams-plugins");if("string"==typeof n)for(var i=a.data("ams-plugins").split(/\s+/),s=0;s<i.length;s++){r=i[s];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")};t(r,o)}else for(r in n)n.hasOwnProperty(r)&&t(r,n[r])});var c;for(r in o)o.hasOwnProperty(r)&&(c=o[r],void 0===i.plugins.enabled[r]?i.getScript(c.src,n,{async:void 0===c.async||c.async}):(!function(){var e=i.plugins.enabled[r];for(l=0;l<e.length;l++){var a=e[l];a&&a.context&&!i.isInDOM(a.context)&&(e[l]=null)}}(),n(!0)));for(var l in i.plugins.enabled)if(i.plugins.enabled.hasOwnProperty(l)&&!(s.indexOf(l)>=0)){var d=i.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 i=t[n];"string"!=typeof i&&(i=JSON.stringify(i)),a.attr("data-"+n,i)}})},register:function(e,a,n){if("function"==typeof a&&(n=a,a=null),a=a||e.name,i.plugins.enabled.indexOf(a)>=0)t&&t.warn&&t.warn("Plugin "+a+" is already registered!");else if("object"==typeof e){var s=e.src;s?i.ajax.check(e.callback,s,function(t){t&&(i.plugins.enabled[a]=i.getFunctionByName(e.callback),e.css&&i.getCSS(e.css,a+"_css"),n&&i.executeFunctionByName(n))}):(i.plugins.enabled[a]=i.getFunctionByName(e.callback),e.css&&i.getCSS(e.css,a+"_css"),n&&i.executeFunctionByName(n))}else"function"==typeof e&&(i.plugins.enabled[a]=e,n&&i.executeFunctionByName(n))},enabled:{hint:function(a){var t=e(".hint:not(:parents(.nohints))",a);t.length>0&&i.ajax.check(e.fn.tipsy,i.baseURL+"ext/jquery-tipsy"+i.devext+".js",function(){i.getCSS(i.baseURL+"../css/ext/jquery-tipsy"+i.devext+".css","jquery-tipsy"),t.each(function(){var a=e(this),t=a.data(),n={html:t.amsHintHtml,title:i.getFunctionByName(t.amsHintTitleGetter)||function(){var a=e(this),n=a.attr("original-title")||a.attr(t.amsHintTitleAttr||"title")||(t.amsHintHtml?a.html():a.text());return n=n.replace(/\?_="/,"?_="+(new Date).getTime()+'"')},opacity:t.amsHintOpacity||.95,gravity:t.amsHintGravity||"sw",offset:t.amsHintOffset||0},s=e.extend({},n,t.amsHintOptions);s=i.executeFunctionByName(t.amsHintInitCallback,a,s)||s;var r=a.tipsy(s);i.executeFunctionByName(t.amsHintAfterInitCallback,a,r,s)})})},contextMenu:function(a){var t=e(".context-menu",a);t.length>0&&t.each(function(){var a=e(this),t=a.data(),n={menuSelector:t.amsContextmenuSelector,menuSelected:i.helpers.contextMenuHandler},s=e.extend({},n,t.amsContextmenuOptions);s=i.executeFunctionByName(t.amsContextmenuInitCallback,a,s)||s;var r=a.contextMenu(s);i.executeFunctionByName(t.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),t=a.parent("fieldset"),n=a.data();if(!n.amsChecker){var s=e('<label class="checkbox"></label>'),r=n.amsCheckerFieldname||"checker_"+i.generateId(),o=r.replace(/\./,"_"),c=n.amsCheckerHiddenPrefix,l=null,d=n.amsCheckerHiddenValueOn||"true",m=n.amsCheckerHiddenValueOff||"false",u=n.amsCheckerMarker||!1;c?l=e('<input type="hidden">').attr("name",c+r).val("on"===n.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(n.amsCheckerValue||!0).attr("checked","on"===n.amsCheckerState?"checked":null);n.amsCheckerReadonly?f.attr("disabled","disabled"):f.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(i.executeFunctionByName(n.amsCheckerChangeHandler,a,o),!n.amsCheckerCancelDefault){var c=f.data("ams-checker-hidden-input");o?("disable"===n.amsCheckerMode?t.removeAttr("disabled"):t.removeClass("switched"),c&&c.val(d),e("[data-required]",t).attr("required","required"),a.trigger("ams.checker.opened",[a])):("disable"===n.amsCheckerMode?t.prop("disabled","disabled"):t.addClass("switched"),c&&c.val(m),e("[data-required]",t).removeAttr("required"),a.trigger("ams.checker.closed",[a]))}}),f.appendTo(s),e(">label",a).attr("for",f.attr("id")),s.append("<i></i>").prependTo(a);var h=e("[required]",t);h.attr("data-required",!0),"on"===n.amsCheckerState?f.attr("checked",!0):("disable"===n.amsCheckerMode?t.attr("disabled","disabled"):t.addClass("switched"),h.removeAttr("required")),a.data("ams-checker","on")}})},slider:function(a){var t=e(".slider",a);t.length>0&&i.ajax.check(e.fn.slider,i.baseURL+"ext/bootstrap-slider-2.0.0"+i.devext+".js",function(){t.each(function(){var a=e(this),t=a.data(),n=e.extend({},{},a.data.amsSliderOptions);n=i.executeFunctionByName(t.amsSliderInitCallback,a,n)||n;var s=a.slider(n);i.executeFunctionByName(t.amsSliderAfterInitCallback,a,s,n)})})},draggable:function(a){var t=e(".draggable",a);t.length>0&&t.each(function(){var a=e(this),t=a.data(),n={containment:t.amsDraggableContainment,helper:i.getFunctionByName(t.amsDraggableHelper)||t.amsDraggableHelper,start:i.getFunctionByName(t.amsDraggableStart),stop:i.getFunctionByName(t.amsDraggableStop)},s=e.extend({},n,t.amsDraggableOptions);s=i.executeFunctionByName(t.amsDraggableInitCallback,a,s)||s;var r=a.draggable(s);a.disableSelection(),i.executeFunctionByName(t.amsDraggableAfterInitCallback,a,r,s)})},sortable:function(a){var t=e(".sortable",a);t.length>0&&t.each(function(){var a=e(this),t=a.data(),n={items:t.amsSortableItems,handle:t.amsSortableHandle,helper:t.amsSortableHelper,connectWith:t.amsSortableConnectwith,start:i.getFunctionByName(t.amsSortableStart),over:i.getFunctionByName(t.amsSortableOver),containment:t.amsSortableContainment,placeholder:t.amsSortablePlaceholder,stop:i.getFunctionByName(t.amsSortableStop)},s=e.extend({},n,t.amsSortableOptions);s=i.executeFunctionByName(t.amsSortableInitCallback,a,s)||s;var r=a.sortable(s);a.disableSelection(),i.executeFunctionByName(t.amsSortableAfterInitCallback,a,r,s)})},resizable:function(a){var t=e(".resizable",a);t.length>0&&t.each(function(){var a=e(this),t=a.data(),n={autoHide:!1===t.amsResizableAutohide||t.amsResizableAutohide,containment:t.amsResizableContainment,grid:t.amsResizableGrid,handles:t.amsResizableHandles,start:i.getFunctionByName(t.amsResizableStart),stop:i.getFunctionByName(t.amsResizableStop)},s=e.extend({},n,t.amsResizableOptions);s=i.executeFunctionByName(t.amsResizableInitCallback,a,s)||s;var r=a.resizable(s);a.disableSelection(),i.executeFunctionByName(t.amsResizableAfterInitCallback,a,r,s)})},typeahead:function(a){var t=e(".typeahead",a);t.length>0&&i.ajax.check(e.fn.typeahead,i.baseURL+"ext/jquery-typeahead"+i.devext+".js",function(){t.each(function(){var a=e(this),t=a.data(),n=e.extend({},{},t.amsTypeaheadOptions);n=i.executeFunctionByName(t.amsTypeaheadInitCallback,a,n)||n;var s=a.typeahead(n);i.executeFunctionByName(t.amsTypeaheadAfterInitCallback,a,s,n)})})},select2:function(a){var t=e(".select2",a);t.length>0&&i.ajax.check(e.fn.select2,i.baseURL+"ext/jquery-select2-3.5.2"+i.devext+".js",function(){t.each(function(){var a=e(this),t=a.data(),n={placeholder:t.amsSelect2Placeholder,multiple:t.amsSelect2Multiple,minimumInputLength:t.amsSelect2MinimumInputLength||0,maximumSelectionSize:t.amsSelect2MaximumSelectionSize,openOnEnter:void 0===t.amsSelect2EnterOpen||t.amsSelect2EnterOpen,allowClear:void 0===t.amsSelect2AllowClear||t.amsSelect2AllowClear,width:t.amsSelect2Width||"100%",initSelection:i.getFunctionByName(t.amsSelect2InitSelection),formatSelection:void 0===t.amsSelect2FormatSelection?i.helpers.select2FormatSelection:i.getFunctionByName(t.amsSelect2FormatSelection),formatResult:i.getFunctionByName(t.amsSelect2FormatResult),formatMatches:void 0===t.amsSelect2FormatMatches?function(e){return 1===e?i.i18n.SELECT2_MATCH:e+i.i18n.SELECT2_MATCHES}:i.getFunctionByName(t.amsSelect2FormatMatches),formatNoMatches:void 0===t.amsSelect2FormatResult?function(e){return i.i18n.SELECT2_NOMATCHES}:i.getFunctionByName(t.amsSelect2FormatResult),formatInputTooShort:void 0===t.amsSelect2FormatInputTooShort?function(e,a){var t=a-e.length;return i.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,t).replace(/\{1\}/,1===t?"":i.i18n.SELECT2_PLURAL)}:i.getFunctionByName(t.amsSelect2FormatInputTooShort),formatInputTooLong:void 0===t.amsSelect2FormatInputTooLong?function(e,a){var t=e.length-a;return i.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,t).replace(/\{1\}/,1===t?"":i.i18n.SELECT2_PLURAL)}:i.getFunctionByName(t.amsSelect2FormatInputTooLong),formatSelectionTooBig:void 0===t.amsSelect2FormatSelectionTooBig?function(e){return i.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,e).replace(/\{1\}/,1===e?"":i.i18n.SELECT2_PLURAL)}:i.getFunctionByName(t.amsSelect2FormatSelectionTooBig),formatLoadMore:void 0===t.amsSelect2FormatLoadMore?function(e){return i.i18n.SELECT2_LOADMORE}:i.getFunctionByName(t.amsSelect2FormatLoadMore),formatSearching:void 0===t.amsSelect2FormatSearching?function(){return i.i18n.SELECT2_SEARCHING}:i.getFunctionByName(t.amsSelect2FormatSearching),separator:t.amsSelect2Separator||",",tokenSeparators:t.amsSelect2TokensSeparators||[","],tokenizer:i.getFunctionByName(t.amsSelect2Tokenizer)};switch(a.context.type){case"text":case"hidden":if(!n.initSelection){var s=a.data("ams-select2-values");s&&(n.initSelection=function(a,t){var i=[];e(a.val().split(n.separator)).each(function(){i.push({id:this,text:s[this]||this})}),t(i)})}}a.attr("readonly")?"hidden"===a.attr("type")&&(n.query=function(){return[]}):t.amsSelect2Query?(n.query=i.getFunctionByName(t.amsSelect2Query),n.minimumInputLength=t.amsSelect2MinimumInputLength||1):t.amsSelect2QueryUrl?(n.ajax={url:t.amsSelect2QueryUrl,quietMillis:t.amsSelect2QuietMillis||200,type:t.amsSelect2QueryType||"POST",dataType:t.amsSelect2QueryDatatype||"json",data:function(a,n,i){var s={};return s[t.amsSelect2QueryParamName||"query"]=a,s[t.amsSelect2PageParamName||"page"]=n,s[t.amsSelect2ContextParamName||"context"]=i,e.extend({},s,t.amsSelect2QueryOptions)},results:i.helpers.select2QueryUrlResultsCallback},n.minimumInputLength=t.amsSelect2MinimumInputLength||1):t.amsSelect2QueryMethod?(n.query=function(n){var s={id:(new Date).getTime(),params:t.amsSelect2QueryParams||{},success:function(e){return i.helpers.select2QueryMethodSuccessCallback.call(a,e,"success",n)},error:i.error.show};s.params[t.amsSelect2QueryParamName||"query"]=n.term,s.params[t.amsSelect2PageParamName||"page"]=n.page,s.params[t.amsSelect2ContextParamName||"context"]=n.context,s=e.extend({},s,t.amsSelect2QueryOptions),s=i.executeFunctionByName(t.amsSelect2QueryInitCallback,a,s)||s,i.ajax.check(e.jsonRPC,i.baseURL+"ext/jquery-jsonrpc"+i.devext+".js",function(){e.jsonRPC.withOptions({endPoint:t.amsSelect2MethodTarget||i.jsonrpc.getAddr(),namespace:t.amsSelect2MethodNamespace,cache:!1},function(){e.jsonRPC.request(t.amsSelect2QueryMethod,s)})})},n.minimumInputLength=t.amsSelect2MinimumInputLength||1):t.amsSelect2Tags?n.tags=t.amsSelect2Tags:t.amsSelect2Data&&(n.data=t.amsSelect2Data),t.amsSelect2EnableFreeTags&&(n.createSearchChoice=function(e){return{id:e,text:(t.amsSelect2FreeTagsPrefix||i.i18n.SELECT2_FREETAG_PREFIX)+e}});var r=e.extend({},n,t.amsSelect2Options);r=i.executeFunctionByName(t.amsSelect2InitCallback,a,r)||r;var o=a.select2(r);i.executeFunctionByName(t.amsSelect2AfterInitCallback,a,o,r),a.hasClass("ordered")&&i.ajax.check(e.fn.select2Sortable,i.baseURL+"ext/jquery-select2-sortable"+i.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 t=e("[data-mask]",a);t.length>0&&i.ajax.check(e.fn.mask,i.baseURL+"ext/jquery-maskedinput-1.4.1"+i.devext+".js",function(){t.each(function(){var a=e(this),t=a.data(),n={placeholder:void 0===t.amsMaskeditPlaceholder?"X":t.amsMaskeditPlaceholder,complete:i.getFunctionByName(t.amsMaskeditComplete)},s=e.extend({},n,t.amsMaskeditOptions);s=i.executeFunctionByName(t.amsMaskeditInitCallback,a,s)||s;var r=a.mask(a.attr("data-mask"),s);i.executeFunctionByName(t.amsMaskeditAfterInitCallback,a,r,s)})})},inputmask:function(a){var t=e("[data-input-mask]",a);t.length>0&&i.ajax.check(e.fn.inputmask,i.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+i.devext+".js",function(){t.each(function(){var a,t=e(this),n=t.data();a="object"==typeof n.inputMask?n.inputMask:{mask:n.inputMask.toString()};var s=e.extend({},a,n.amsInputmaskOptions);s=i.executeFunctionByName(n.amsInputmaskInitCallback,t,s)||s;var r=t.inputmask(s);i.executeFunctionByName(n.amsInputmaskAfterInitCallback,t,r,s)})})},datepicker:function(a){var t=e(".datepicker",a);t.length>0&&i.ajax.check(e.fn.datetimepicker,i.baseURL+"ext/jquery-datetimepicker"+i.devext+".js",function(a){a&&(i.getCSS(i.baseURL+"../css/ext/jquery-datetimepicker"+i.devext+".css","jquery-datetimepicker"),i.dialog.registerHideCallback(i.helpers.datetimepickerDialogHiddenCallback)),t.each(function(){var a=e(this),t=a.data(),n={lang:t.amsDatetimepickerLang||i.lang,format:t.amsDatetimepickerFormat||"d/m/y",datepicker:!0,dayOfWeekStart:1,timepicker:!1,closeOnDateSelect:void 0===t.amsDatetimepickerCloseOnSelect||t.amsDatetimepickerCloseOnSelect,weeks:t.amsDatetimepickerWeeks},s=e.extend({},n,t.amsDatetimepickerOptions);s=i.executeFunctionByName(t.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);i.executeFunctionByName(t.amsDatetimepickerAfterInitCallback,a,r,s)})})},datetimepicker:function(a){var t=e(".datetimepicker",a);t.length>0&&i.ajax.check(e.fn.datetimepicker,i.baseURL+"ext/jquery-datetimepicker"+i.devext+".js",function(a){a&&(i.getCSS(i.baseURL+"../css/ext/jquery-datetimepicker"+i.devext+".css","jquery-datetimepicker"),i.dialog.registerHideCallback(i.helpers.datetimepickerDialogHiddenCallback)),t.each(function(){var a=e(this),t=a.data(),n={lang:t.amsDatetimepickerLang||i.lang,format:t.amsDatetimepickerFormat||"d/m/y H:i",datepicker:!0,dayOfWeekStart:1,timepicker:!0,closeOnDateSelect:void 0===t.amsDatetimepickerCloseOnSelect||t.amsDatetimepickerCloseOnSelect,closeOnTimeSelect:void 0===t.amsDatetimepickerCloseOnSelect||t.amsDatetimepickerCloseOnSelect,weeks:t.amsDatetimepickerWeeks},s=e.extend({},n,t.amsDatetimepickerOptions);s=i.executeFunctionByName(t.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);i.executeFunctionByName(t.amsDatetimepickerAfterInitCallback,a,r,s)})})},timepicker:function(a){var t=e(".timepicker",a);t.length>0&&i.ajax.check(e.fn.datetimepicker,i.baseURL+"ext/jquery-datetimepicker"+i.devext+".js",function(a){a&&(i.getCSS(i.baseURL+"../css/ext/jquery-datetimepicker"+i.devext+".css","jquery-datetimepicker"),i.dialog.registerHideCallback(i.helpers.datetimepickerDialogHiddenCallback)),t.each(function(){var a=e(this),t=a.data(),n={lang:t.amsDatetimepickerLang||i.lang,format:t.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===t.amsDatetimepickerCloseOnSelect||t.amsDatetimepickerCloseOnSelect},s=e.extend({},n,t.amsDatetimepickerOptions);s=i.executeFunctionByName(t.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);i.executeFunctionByName(t.amsDatetimepickerAfterInitCallback,a,r,s)})})},colorpicker:function(a){var t=e(".colorpicker",a);t.length>0&&i.ajax.check(e.fn.minicolors,i.baseURL+"ext/jquery-minicolors"+i.devext+".js",function(a){a&&i.getCSS(i.baseURL+"../css/ext/jquery-minicolors"+i.devext+".css","jquery-minicolors"),t.each(function(){var a=e(this),t=a.data(),n={position:t.amsColorpickerPosition||a.closest("label.input").data("ams-colorpicker-position")||"bottom left"},s=e.extend({},n,t.amsColorpickerOptions);s=i.executeFunctionByName(t.amsColorpickerInitCallback,a,s)||s;var r=a.minicolors(s);i.executeFunctionByName(t.amsDatetimepickerAfterInitCallback,a,r,s)})})},validate:function(a){var t=e("FORM:not([novalidate])",a);t.length>0&&i.ajax.check(e.fn.validate,i.baseURL+"ext/jquery-validate-1.11.1"+i.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)}}),i.plugins.i18n)){for(var n in i.plugins.i18n.validate)if(i.plugins.i18n.validate.hasOwnProperty(n)){var s=i.plugins.i18n.validate[n];"string"==typeof s&&s.indexOf("{0}")>-1&&(i.plugins.i18n.validate[n]=e.validator.format(s))}e.extend(e.validator.messages,i.plugins.i18n.validate)}t.each(function(){var a=e(this),t=a.data(),n={ignore:null,submitHandler:void 0!==a.attr("data-async")?void 0===t.amsFormSubmitHandler?function(){return e(".state-error",a).removeClass("state-error"),i.ajax.check(e.fn.ajaxSubmit,i.baseURL+"ext/jquery-form-3.49"+i.devext+".js"),i.form.submit(a)}:i.getFunctionByName(t.amsFormSubmitHandler):void 0,invalidHandler:void 0!==a.attr("data-async")?void 0===t.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()}}}:i.getFunctionByName(t.amsFormInvalidHandler):void 0};e("[data-ams-validate-rules]",a).each(function(a){0===a&&(n.rules={}),n.rules[e(this).attr("name")]=e(this).data("ams-validate-rules")});var s=e.extend({},n,t.amsValidateOptions);s=i.executeFunctionByName(t.amsValidateInitCallback,a,s)||s;var r=a.validate(s);i.executeFunctionByName(t.amsValidateAfterInitCallback,a,r,s)})})},datatable:function(a){var t=e(".datatable",a);t.length>0&&i.ajax.check(e.fn.dataTable,i.baseURL+"ext/jquery-dataTables-1.9.4"+i.devext+".js",function(a){i.ajax.check(e.fn.dataTableExt.oPagination.bootstrap_full,i.baseURL+"myams-dataTables"+i.devext+".js",function(){e(t).each(function(){var a,t=e(this),n=t.data(),s=(n.amsDatatableExtensions||"").split(/\s+/),r=n.amsDatatableSdom||"W"+(s.indexOf("colreorder")>=0||s.indexOf("colreorderwithresize")>=0?"R":"")+"<'dt-top-row'"+(s.indexOf("colvis")>=0?"C":"")+(!1===n.amsDatatablePagination||!1===n.amsDatatablePaginationSize?"":"L")+(!1===n.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(s.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===n.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",o=n.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",t).listattr("data-ams-datatable-sortable");for(a=0;a<u.length;a++){var f=u[a];void 0!==f?((d=m[a]||{}).bSortable=f,m[a]=d):m[a]=m[a]||{}}var h=e("th",t).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,bFilter:!1!==n.amsDatatableGlobalFilter||s.indexOf("columnfilter")>=0,bPaginate:!1!==n.amsDatatablePagination,bInfo:!1!==n.amsDatatableInfo,bSort:!1!==n.amsDatatableSort,aaSorting:o,aoColumns:m.length>0?m:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:n.amsDatatableDisplayLength||25,sPaginationType:n.amsDatatablePaginationType||"bootstrap_full",sDom:r,oLanguage:i.plugins.i18n.datatables,fnInitComplete:function(a,t){e(".ColVis_Button").addClass("btn btn-default btn-sm").html((i.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}},b=e.extend({},g,n.amsDatatableOptions),v=[],x=[],y=[];if(s.length>0)for(a=0;a<s.length;a++)switch(s[a]){case"autofill":v.push(e.fn.dataTable.AutoFill),x.push(i.baseURL+"ext/jquery-dataTables-autoFill"+i.devext+".js");break;case"columnfilter":v.push(e.fn.columnFilter),x.push(i.baseURL+"ext/jquery-dataTables-columnFilter"+i.devext+".js");break;case"colreorder":v.push(e.fn.dataTable.ColReorder),x.push(i.baseURL+"ext/jquery-dataTables-colReorder"+i.devext+".js");break;case"colreorderwithresize":v.push(window.ColReorder),x.push(i.baseURL+"ext/jquery-dataTables-colReorderWithResize"+i.devext+".js");break;case"colvis":v.push(e.fn.dataTable.ColVis),x.push(i.baseURL+"ext/jquery-dataTables-colVis"+i.devext+".js"),y.push(function(){b.oColVis=e.extend({},{activate:"click",sAlign:"right"},n.amsDatatableColvisOptions)});break;case"editable":v.push(e.fn.editable),x.push(i.baseURL+"ext/jquery-jeditable"+i.devext+".js"),v.push(e.fn.makeEditable),x.push(i.baseURL+"ext/jquery-dataTables-editable"+i.devext+".js");break;case"fixedcolumns":v.push(e.fn.dataTable.FixedColumns),x.push(i.baseURL+"ext/jquery-dataTables-fixedColumns"+i.devext+".js");break;case"fixedheader":v.push(e.fn.dataTable.Fixedheader),x.push(i.baseURL+"ext/jquery-dataTables-fixedHeader"+i.devext+".js");break;case"keytable":v.push(window.keyTable),x.push(i.baseURL+"ext/jquery-dataTables-keyTable"+i.devext+".js");break;case"rowgrouping":v.push(e.fn.rowGrouping),x.push(i.baseURL+"ext/jquery-dataTables-rowGrouping"+i.devext+".js");break;case"rowreordering":v.push(e.fn.rowReordering),x.push(i.baseURL+"ext/jquery-dataTables-rowReordering"+i.devext+".js");break;case"scroller":v.push(e.fn.dataTable.Scroller),x.push(i.baseURL+"ext/jquery-dataTables-scroller"+i.devext+".js")}y.push(function(){b=i.executeFunctionByName(n.amsDatatableInitCallback,t,b)||b;try{var r=t.dataTable(b);if(i.executeFunctionByName(n.amsDatatableAfterInitCallback,t,r,b),s.length>0)for(a=0;a<s.length;a++)switch(s[a]){case"autofill":var o=e.extend({},n.amsDatatableAutofillOptions,b.autofill);o=i.executeFunctionByName(n.amsDatatableAutofillInitCallback,t,o)||o,t.data("ams-autofill",void 0===n.amsDatatableAutofillConstructor?new e.fn.dataTable.AutoFill(t,o):i.executeFunctionByName(n.amsDatatableAutofillConstructor,t,r,o));break;case"columnfilter":var c=e.extend({},{sPlaceHolder:"head:after"},n.amsDatatableColumnfilterOptions,b.columnfilter);c=i.executeFunctionByName(n.amsDatatableColumnfilterInitCallback,t,c)||c,t.data("ams-columnfilter",void 0===n.amsDatatableColumnfilterConstructor?r.columnFilter(c):i.executeFunctionByName(n.amsDatatableColumnfilterConstructor,t,r,c));break;case"editable":var l=e.extend({},n.amsDatatableEditableOptions,b.editable);l=i.executeFunctionByName(n.amsDatatableEditableInitCallback,t,l)||l,t.data("ams-editable",void 0===n.amsDatatableEditableConstructor?t.makeEditable(l):i.executeFunctionByName(n.amsDatatableEditableConstructor,t,r,l));break;case"fixedcolumns":var d=e.extend({},n.amsDatatableFixedcolumnsOptions,b.fixedcolumns);d=i.executeFunctionByName(n.amsDatatableFixedcolumnsInitCallback,t,d)||d,t.data("ams-fixedcolumns",void 0===n.amsDatatableFixedcolumnsConstructor?new e.fn.dataTable.FixedColumns(t,d):i.executeFunctionByName(n.amsDatatableFixedcolumnsConstructor,t,r,d));break;case"fixedheader":var m=e.extend({},n.amsDatatableFixedheaderOptions,b.fixedheader);m=i.executeFunctionByName(n.amsDatatableFixedheadeInitCallback,t,m)||m,t.data("ams-fixedheader",void 0===n.amsDatatableFixedheaderConstructor?new e.fn.dataTable.FixedHeader(t,m):i.executeFunctionByName(n.amsDatatableFixedheaderConstructor,t,r,m));break;case"keytable":var u={table:t.get(0),datatable:r},f=e.extend({},u,n.amsDatatableKeytableOptions,b.keytable);f=i.executeFunctionByName(n.amsDatatableKeytableInitCallback,t,f)||f,t.data("ams-keytable",void 0===n.amsDatatableKeytableConstructor?new KeyTable(f):i.executeFunctionByName(n.amsDatatableKeytableConstructor,t,r,f));break;case"rowgrouping":var h=e.extend({},n.amsDatatableRowgroupingOptions,b.rowgrouping);h=i.executeFunctionByName(n.amsDatatableRowgroupingInitCallback,t,h)||h,t.data("ams-rowgrouping",void 0===n.amsDatatableRowgroupingConstructor?t.rowGrouping(h):i.executeFunctionByName(n.amsDatatableRowgroupingConstructor,t,r,h));break;case"rowreordering":var p=e.extend({},n.amsDatatableRowreorderingOptions,b.rowreordering);p=i.executeFunctionByName(n.amsDatatableRowreorderingInitCallback,t,p)||p,t.data("ams-rowreordering",void 0===n.amsDatatableRowreorderingConstructor?t.rowReordering(p):i.executeFunctionByName(n.amsDatatableRowreorderingConstructor,t,r,p))}if(n.amsDatatableFinalizeCallback){var g=n.amsDatatableFinalizeCallback.split(/\s+/);if(g.length>0)for(a=0;a<g.length;a++)i.executeFunctionByName(g[a],t,r,b)}}catch(e){}}),i.ajax.check(v,x,y)})})})},tablednd:function(a){var t=e(".table-dnd",a);t.length>0&&i.ajax.check(e.fn.tableDnD,i.baseURL+"ext/jquery-tablednd"+i.devext+".js",function(a){t.each(function(){var a=e(this),t=a.data();t.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 n={onDragClass:t.amsTabledndDragClass||"dragging-row",onDragStart:i.getFunctionByName(t.amsTabledndDragStart),dragHandle:t.amsTabledndDragHandle,scrollAmount:t.amsTabledndScrollAmount,onAllowDrop:t.amsTabledndAllowDrop,onDrop:i.getFunctionByName(t.amsTabledndDrop)||function(n,s){var r=t.amsTabledndDropTarget;if(r){e(s).data("ams-disabled-handlers","click");var o=[];e(n.rows).each(function(){var a=e(this).data("ams-element-name");a&&o.push(a)});var c=i.getFunctionByName(r);if("function"==typeof c)c.call(a,n,o);else{if(!r.startsWith(window.location.protocol)){var l=t.amsLocation;l&&(r=l+"/"+r)}i.ajax.post(r,{names:JSON.stringify(o)})}setTimeout(function(){e(s).removeData("ams-disabled-handlers")},50)}return!1}},s=e.extend({},n,t.amsTabledndOptions);s=i.executeFunctionByName(t.amsTabledndInitCallback,a,s)||s;var r=a.tableDnD(s);i.executeFunctionByName(t.amsTabledndAfterInitCallback,a,r,s)})})},wizard:function(a){var t=e(".wizard",a);t.length>0&&i.ajax.check(e.fn.bootstrapWizard,i.baseURL+"ext/bootstrap-wizard-1.4.2"+i.devext+".js",function(a){t.each(function(){var a=e(this),t=a.data(),n={withVisible:void 0===t.amsWizardWithVisible||t.amsWizardWithVisible,tabClass:t.amsWizardTabClass,firstSelector:t.amsWizardFirstSelector,previousSelector:t.amsWizardPreviousSelector,nextSelector:t.amsWizardNextSelector,lastSelector:t.amsWizardLastSelector,finishSelector:t.amsWizardFinishSelector,backSelector:t.amsWizardBackSelector,onInit:i.getFunctionByName(t.amsWizardInit),onShow:i.getFunctionByName(t.amsWizardShow),onNext:i.getFunctionByName(t.amsWizardNext),onPrevious:i.getFunctionByName(t.amsWizardPrevious),onFirst:i.getFunctionByName(t.amsWizardFirst),onLast:i.getFunctionByName(t.amsWizardLast),onBack:i.getFunctionByName(t.amsWizardBack),onFinish:i.getFunctionByName(t.amsWizardFinish),onTabChange:i.getFunctionByName(t.amsWizardTabChange),onTabClick:i.getFunctionByName(t.amsWizardTabClick),onTabShow:i.getFunctionByName(t.amsWizardTabShow)},s=e.extend({},n,t.amsWizardOptions);s=i.executeFunctionByName(t.amsWizardInitCallback,a,s)||s;var r=a.bootstrapWizard(s);i.executeFunctionByName(t.amsWizardAfterInitCallback,a,r,s)})})},tinymce:function(a){function t(){e(".tinymce",e(this)).each(function(){var a=tinymce.get(e(this).attr("id"));a&&a.remove()})}var n=e(".tinymce",a);if(n.length>0){var s=i.baseURL+"ext/tinymce"+(i.devmode?"/dev":"");i.ajax.check(window.tinymce,s+"/tinymce"+i.devext+".js",function(a){function r(){n.each(function(){var a=e(this),t=a.data(),n={theme:t.amsTinymceTheme||"modern",language:i.lang,plugins:["advlist autosave autolink lists link image charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime media nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern autoresize"],toolbar1:t.amsTinymceToolbar1||"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent",toolbar2:t.amsTinymceToolbar2||"forecolor backcolor emoticons | charmap link image media | fullscreen preview print | code",content_css:t.amsTinymceContentCss,formats:t.amsTinymceFormats,style_formats:t.amsTinymceStyleFormats,block_formats:t.amsTinymceBlockFormats,valid_classes:t.amsTinymceValidClasses,image_advtab:!0,image_list:i.getFunctionByName(t.amsTinymceImageList)||t.amsTinymceImageList,image_class_list:t.amsTinymceImageClassList,link_list:i.getFunctionByName(t.amsTinymceLinkList)||t.amsTinymceLinkList,link_class_list:t.amsTinymceLinkClassList,height:50,min_height:50,autoresize_min_height:50,autoresize_max_height:500,resize:!0};if(t.amsTinymceExternalPlugins){var s=t.amsTinymceExternalPlugins.split(/\s+/);for(var r in s){var o=a.data("ams-tinymce-plugin-"+s[r]);tinymce.PluginManager.load(s[r],i.getSource(o))}}var c=e.extend({},n,t.amsTinymceOptions);c=i.executeFunctionByName(t.amsTinymceInitCallback,a,c)||c;var l=a.tinymce(c);i.executeFunctionByName(t.amsTinymceAfterInitCallback,a,l,c)})}a?i.getScript(s+"/jquery.tinymce"+i.devext+".js",function(){tinymce.baseURL=s,tinymce.suffix=i.devext,i.skin.registerCleanCallback(t),r()}):r()})}},imgareaselect:function(a){var t=e(".imgareaselect",a);t.length>0&&i.ajax.check(e.fn.imgAreaSelect,i.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+i.devext+".js",function(a){a&&i.getCSS(i.baseURL+"../css/ext/jquery-imgareaselect"+i.devext+".css"),t.each(function(){var a=e(this),t=a.data(),n=t.amsImgareaselectParent?a.parents(t.amsImgareaselectParent):"body",s={instance:!0,handles:!0,parent:n,x1:t.amsImgareaselectX1||0,y1:t.amsImgareaselectY1||0,x2:t.amsImgareaselectX2||t.amsImgareaselectImageWidth,y2:t.amsImgareaselectY2||t.amsImgareaselectImageHeight,imageWidth:t.amsImgareaselectImageWidth,imageHeight:t.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:t.amsImgareaselectRatio,onSelectEnd:i.getFunctionByName(t.amsImgareaselectSelectEnd)||function(a,i){var s=t.amsImgareaselectTargetField||"image_";e('input[name="'+s+'x1"]',n).val(i.x1),e('input[name="'+s+'y1"]',n).val(i.y1),e('input[name="'+s+'x2"]',n).val(i.x2),e('input[name="'+s+'y2"]',n).val(i.y2)}},r=e.extend({},s,t.amsImgareaselectOptions);r=i.executeFunctionByName(t.amsImgareaselectInitCallback,a,r)||r;var o=a.imgAreaSelect(r);i.executeFunctionByName(t.amsImgareaselectAfterInitCallback,a,o,r),setTimeout(function(){o.update()},250)})})},fancybox:function(a){var t=e(".fancybox",a);t.length>0&&i.ajax.check(e.fn.fancybox,i.baseURL+"ext/jquery-fancybox-2.1.5"+i.devext+".js",function(a){a&&i.getCSS(i.baseURL+"../css/ext/jquery-fancybox-2.1.5"+i.devext+".css"),t.each(function(){var a=e(this),t=a.data(),n=a;t.amsFancyboxElements&&(n=e(t.amsFancyboxElements,a));var s=(t.amsFancyboxHelpers||"").split(/\s+/);if(s.length>0)for(var r=0;r<s.length;r++){var o=s[r];switch(o){case"buttons":i.ajax.check(e.fancybox.helpers.buttons,i.baseURL+"ext/fancybox-helpers/fancybox-buttons"+i.devext+".js");break;case"thumbs":i.ajax.check(e.fancybox.helpers.thumbs,i.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+i.devext+".js");break;case"media":i.ajax.check(e.fancybox.helpers.media,i.baseURL+"ext/fancybox-helpers/fancybox-media"+i.devext+".js")}}var c={type:t.amsFancyboxType,padding:t.amsFancyboxPadding||10,margin:t.amsFancyboxMargin||10,loop:t.amsFancyboxLoop,beforeLoad:i.getFunctionByName(t.amsFancyboxBeforeLoad)||function(){var a;if(t.amsFancyboxTitleGetter&&(a=i.executeFunctionByName(t.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:i.getFunctionByName(t.amsFancyboxAfterLoad),helpers:{title:{type:"inside"}}};if(s.length>0)for(r=0;r<s.length;r++)switch(o=s[r]){case"buttons":c.helpers.buttons={position:t.amsFancyboxButtonsPosition||"top"};break;case"thumbs":c.helpers.thumbs={width:t.amsFancyboxThumbsWidth||50,height:t.amsFancyboxThumbsHeight||50};break;case"media":c.helpers.media=!0}var l=e.extend({},c,t.amsFancyboxOptions);l=i.executeFunctionByName(t.amsFancyboxInitCallback,a,l)||l;var d=n.fancybox(l);i.executeFunctionByName(t.amsFancyboxAfterInitCallback,a,d,l)})})},chart:function(a){var t=e(".chart",a);t.length>0&&i.ajax.check(e.fn.plot,i.baseURL+"flot/jquery.flot"+i.devext+".js",function(){t.each(function(){var a=e(this),t=a.data(),n=(t.amsChartPlugins||"").split(/\s+/);if(n.length>0)for(var s in n){var r=n[s];(function(a){for(var t in e.plot.plugins){var n=e.plot.plugins[t];if(n.name==a)return n}return null})(r)||i.getScript(i.baseURL+"flot/jquery.flot."+r+i.devext+".js")}var o=e.extend({},{},t.amsChartOptions);o=i.executeFunctionByName(t.amsChartInitCallback,a,o)||o;var c=t.amsChartData;c=i.executeFunctionByName(t.amsChartInitData,a,c)||c;var l=a.plot(c,o);i.executeFunctionByName(t.amsChartAfterInitCallback,a,l,o)})})},graphs:function(a){var t=e(".sparkline",a);t.length>0&&i.ajax.check(i.graphs,i.baseURL+"myams-graphs"+i.devext+".js",function(){i.graphs.init(t)})},scrollbars:function(a){var t=e(".scrollbar",a);t.length>0&&i.ajax.check(e.event.special.mousewheel,i.baseURL+"ext/jquery-mousewheel.min.js",function(){i.ajax.check(e.fn.mCustomScrollbar,i.baseURL+"ext/jquery-mCustomScrollbar"+i.devext+".js",function(a){a&&i.getCSS(i.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar"),t.each(function(){var a=e(this),t=a.data(),n={theme:t.amsScrollbarTheme||"light"},s=e.extend({},n,t.amsScrollbarOptions);s=i.executeFunctionByName(t.amsScrollbarInitCallback,a,s)||s;var r=a.mCustomScrollbar(s);i.executeFunctionByName(t.amsScrollbarAfterInitCallback,a,r,s)})})})}}},n.callbacks={init:function(a){e("[data-ams-callback]",a).each(function(){var a=this,n=e(a).data(),s=i.getFunctionByName(n.amsCallback);void 0===s?n.amsCallbackSource?i.getScript(n.amsCallbackSource,function(){i.executeFunctionByName(n.amsCallback,a,n.amsCallbackOptions)}):t&&t.warn&&t.warn("Undefined callback: "+n.amsCallback):s.call(a,n.amsCallbackOptions)})},alert:function(a){var t=e(this).data(),n=e.extend({},a,t.amsAlertOptions),s=e(t.amsAlertParent||n.parent||this),r=t.amsAlertStatus||n.status||"info",o=t.amsAlertHeader||n.header,c=t.amsAlertMessage||n.message,l=t.amsAlertSubtitle||n.subtitle,d=void 0===t.amsAlertMargin?void 0!==n.margin&&n.margin:t.amsAlertMargin;i.skin.alert(s,r,o,c,l,d)},messageBox:function(a){var t=e(this).data(),n=e.extend({},a,t.amsMessageboxOptions),s=e.extend({},n,{title:t.amsMessageboxTitle||n.title||"",content:t.amsMessageboxContent||n.content||"",icon:t.amsMessageboxIcon||n.icon,number:t.amsMessageboxNumber||n.number,timeout:t.amsMessageboxTimeout||n.timeout}),r=t.amsMessageboxStatus||n.status||"info",o=i.getFunctionByName(t.amsMessageboxCallback||n.callback);i.skin.messageBox(r,s,o)},smallBox:function(a){var t=e(this).data(),n=e.extend({},a,t.amsSmallboxOptions),s=e.extend({},n,{title:t.amsSmallboxTitle||n.title||"",content:t.amsSmallboxContent||n.content||"",icon:t.amsSmallboxIcon||n.icon,iconSmall:t.amsSmallboxIconSmall||n.iconSmall,timeout:t.amsSmallboxTimeout||n.timeout}),r=t.amsSmallboxStatus||n.status||"info",o=i.getFunctionByName(t.amsSmallboxCallback||n.callback);i.skin.smallBox(r,s,o)}},n.events={init:function(a){e("[data-ams-events-handlers]",a).each(function(){var a=e(this),t=a.data("ams-events-handlers");if(t)for(var n in t)t.hasOwnProperty(n)&&a.on(n,i.getFunctionByName(t[n]))})}},n.container={changeOrder:function(a,t){e('input[name="'+e(this).data("ams-input-name")+'"]',e(this)).val(t.join(";"))},deleteElement:function(a){return function(){var a=e(this);n.skin.bigBox({title:i.i18n.WARNING,content:'<i class="text-danger fa fa-fw fa-bell"></i>&nbsp; '+i.i18n.DELETE_WARNING,status:"info",buttons:i.i18n.BTN_OK_CANCEL},function(e){if(e===i.i18n.BTN_OK){var t=a.parents("table").first(),s=t.data("ams-location")||"",r=a.parents("tr").first(),o=r.data("ams-delete-target")||t.data("ams-delete-target")||"delete-element.json",c=r.data("ams-element-name");n.ajax.post(s+"/"+o,{object_name:c},function(e,a){"success"===e.status?(t.hasClass("datatable")?t.dataTable().fnDeleteRow(r[0]):r.remove(),e.handle_json&&n.ajax.handleJSON(e)):n.ajax.handleJSON(e)})}})}}},n.skin={_setPageHeight:function(){var a=e("#main").height(),t=(i.leftPanel.height(),e(window).height()-i.navbarHeight);a>t?i.root.css("min-height",a+i.navbarHeight):i.root.css("min-height",t),i.leftPanel.css("min-height",t),i.leftPanel.css("max-height",t)},_checkMobileWidth:function(){e(window).width()<979?i.root.addClass("mobile-view-activated"):i.root.hasClass("mobile-view-activated")&&i.root.removeClass("mobile-view-activated")},_showShortcutButtons:function(){i.shortcuts.animate({height:"show"},200,"easeOutCirc"),i.root.addClass("shortcut-on")},_hideShortcutButtons:function(){i.shortcuts.animate({height:"hide"},300,"easeOutCirc"),i.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")},_initDesktopWidgets:function(t){if(i.enableWidgets){var n=e(".ams-widget",t);n.length>0&&i.ajax.check(e.fn.MyAMSWidget,i.baseURL+"myams-widgets"+i.devext+".js",function(){n.each(function(){var a=e(this),t=a.data(),n=e.extend({},{deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"},t.amsWidgetOptions);n=i.executeFunctionByName(t.amsWidgetInitcallback,a,n)||n,a.MyAMSWidget(n)}),a.MyAMSWidget.initWidgetsGrid(e(".ams-widget-grid",t))})}},_initMobileWidgets:function(e){i.enableMobile&&i.enableWidgets&&i.skin._initDesktopWidgets(e)},alert:function(a,t,n,s,r,o){"error"===t&&(t="danger"),e(".alert-"+t,a).not(".persistent").remove();var c='<div class="'+(o?"margin-10":"")+" alert alert-block alert-"+t+' 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> '+n+"</h4>"+(r?"<p>"+r+"</p>":"");if("string"==typeof s)c+="<ul><li>"+s+"</li></ul>";else if(s){c+="<ul>";for(var l in s)e.isNumeric(l)&&(c+="<li>"+s[l]+"</li>");c+="</ul>"}e(c+="</div>").prependTo(a);a.exists&&i.ajax.check(e.scrollTo,i.baseURL+"ext/jquery-scrollTo.min.js",function(){e.scrollTo(a,{offset:{top:-50}})})},bigBox:function(e,a){i.ajax.check(i.notify,i.baseURL+"myams-notify"+i.devext+".js",function(){i.notify.messageBox(e,a)})},messageBox:function(e,a,t){"object"==typeof e&&(t=a,a=e||{},e="info"),i.ajax.check(i.notify,i.baseURL+"myams-notify"+i.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,i.notify.bigBox(a,t)})},smallBox:function(e,a,t){"object"==typeof e&&(t=a,a=e||{},e="info"),i.ajax.check(i.notify,i.baseURL+"myams-notify"+i.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,i.notify.smallBox(a,t)})},_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(i.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()),i=e("<li></li>").append(t.attr("href").replace(/^#/,"")?e("<a></a>").html(n).attr("href",t.attr("href")):n);a.append(i)})},checkURL:function(){function a(a){e(".active",n).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 t,n=e("nav"),s=location.hash,r=s.replace(/^#/,"");if(r){var o=e("#content");o.exists()||(o=e("body")),(t=e('A[href="'+s+'"]',n)).exists()&&a(t),i.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")||t.attr("title")||document.title)}})}else{var c=e("[data-ams-active-menu]").data("ams-active-menu");(t=c?e('A[href="'+c+'"]',n):e('>UL >LI >A[href!="#"]',n).first()).exists()&&(a(t),c?i.skin._drawBreadCrumb():window.location.hash=t.attr("href"))}},_clean_callbacks:[],registerCleanCallback:function(e){var a=i.skin._clean_callbacks;a.indexOf(e)<0&&a.push(e)},unregisterCleanCallback:function(e){var a=i.skin._clean_callbacks,t=a.indexOf(e);t>=0&&a.splice(t,1)},cleanContainer:function(e){for(var a=i.skin._clean_callbacks,t=0;t<a.length;t++)a[t].call(e)},loadURL:function(a,t,n,s){a.startsWith("#")&&(a=a.substr(1)),"function"==typeof n?(s=n,n={}):void 0===n&&(n={}),t=e(t);var r={type:"GET",url:a,dataType:"html",cache:!1,beforeSend:function(){if(n&&n.preLoadCallback&&i.executeFunctionByName(n.preLoadCallback,this),i.skin.cleanContainer(t),t.html('<h1 class="loading"><i class="fa fa-cog fa-spin"></i> '+i.i18n.LOADING+" </h1>"),t[0]===e("#content")[0]){i.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 t.animate({scrollTop:0},"fast")},success:function(a,r,o){if(s)i.executeFunctionByName(s,this,a,r,o,n);else{var c=i.ajax.getResponse(o),l=c.contentType,d=c.data;switch(e(".loading",t).remove(),l){case"json":i.ajax.handleJSON(d,t);break;case"script":case"xml":break;case"html":case"text":default:t.parents(".hidden").removeClass("hidden"),e(".alert",t.parents(".alerts-container")).remove(),t.css({opacity:"0.0"}).html(a).removeClass("hidden").delay(50).animate({opacity:"1.0"},300),i.initContent(t),i.form.setFocus(t)}n&&n.afterLoadCallback&&i.executeFunctionByName(n.afterLoadCallback,this),i.stats.logPageview()}},error:function(e,a,n){t.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+i.i18n.ERROR+n+"</h3>"+e.responseText)},async:void 0===n.async||n.async},o=e.extend({},r,n);e.ajax(o)},setLanguage:function(e){var a=e.lang;switch(e.handler_type||"json"){case"json":var t=e.method||"setUserLanguage";i.jsonrpc.post(t,{lang:a},function(){window.location.reload(!0)});break;case"ajax":var n=e.href||"setUserLanguage";i.ajax.post(n,{lang:a},function(){window.location.reload(!0)})}},logout:function(){window.location=i.loginURL}},n.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]))}},n.initPage=function(){var a=e("body");i.root=a,i.leftPanel=e("#left-panel"),i.shortcuts=e("#shortcuts"),i.plugins.initData(a);var t=e.ajaxSettings.xhr;e.ajaxSetup({progress:i.ajax.progress,progressUpload:i.ajax.progress,xhr:function(){var e=t();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(i.ajax.start),e(document).ajaxStop(i.ajax.stop),e(document).ajaxError(i.error.ajax),i.isMobile?(i.root.addClass("mobile-detected"),i.device="mobile",i.enableFastclick&&i.ajax.check(e.fn.noClickDelay,i.baseURL+"/ext/jquery-smartclick"+i.devext+".js",function(){e("NAV UL A").noClickDelay(),e("A","#hide-menu").noClickDelay()})):(i.root.addClass("desktop-detected"),i.device="desktop"),e("#hide-menu >:first-child > A").click(function(e){a.toggleClass("hidden-menu"),e.preventDefault()}),e("#show-shortcuts").click(function(e){i.shortcuts.is(":visible")?i.skin._hideShortcutButtons():i.skin._showShortcutButtons(),e.preventDefault()}),i.shortcuts.click(function(e){i.skin._hideShortcutButtons()}),e(document).mouseup(function(e){i.shortcuts.is(e.target)||0!==i.shortcuts.has(e.target).length||i.skin._hideShortcutButtons()}),e("#search-mobile").click(function(){i.root.addClass("search-mobile")}),e("#cancel-search-js").click(function(){i.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()}),i.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 t=e(this).data("ams-url");if(t){a.preventDefault(),a.stopPropagation();var n=i.getFunctionByName(t);if("function"==typeof n&&(t=n.call(this)),"function"==typeof t)t.call(this);else{var s=e(".ajax-notifications");i.skin.loadURL(t,s)}}}),e("a","#user-menu LI.logout").click(function(a){a.preventDefault(),a.stopPropagation(),i.loginURL=e(this).attr("href"),i.skin.bigBox({title:"<i class='fa fa-sign-out txt-color-orangeDark'></i> "+i.i18n.LOGOUT+" <span class='txt-color-orangeDark'><strong>"+e("#show-shortcut").text()+"</strong></span> ?",content:i.i18n.LOGOUT_COMMENT,buttons:i.i18n.BTN_YES_NO},function(e){e===i.i18n.BTN_YES&&(i.root.addClass("animated fadeOutUp"),setTimeout(i.skin.logout,1e3))})});var n=e("nav");e("UL",n).myams_menu({accordion:!1!==n.data("ams-menu-accordion"),speed:i.menuSpeed}),e(".minifyme").click(function(a){e("BODY").toggleClass("minified"),e(this).effect("highlight",{},500),a.preventDefault()}),e("#refresh").click(function(e){i.skin.bigBox({title:"<i class='fa fa-refresh' style='color: green'></i> "+i.i18n.CLEAR_STORAGE_TITLE,content:i.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+i.i18n.BTN_CANCEL+"]["+i.i18n.BTN_OK+"]"},function(e){e===i.i18n.BTN_OK&&localStorage&&(localStorage.clear(),location.reload())}),e.preventDefault()}),a.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")}),i.ajax.check(e.resize,i.baseURL+"ext/jquery-resize"+i.devext+".js",function(){e("#main").resize(function(){i.skin._setPageHeight(),i.skin._checkMobileWidth()}),n.resize(function(){i.skin._setPageHeight()})}),i.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 t=e(a.currentTarget),n=t.data("ams-disabled-handlers");if(!0!==n&&"click"!==n&&"all"!==n){var s=t.attr("href")||t.data("ams-url");if(s&&!s.startsWith("javascript")&&!t.attr("target")&&!0!==t.data("ams-context-menu")){a.preventDefault(),a.stopPropagation();var r=i.getFunctionByName(s);if("function"==typeof r&&(s=r.call(t)),"function"==typeof s)s.call(t);else if(s=s.replace(/\%23/,"#"),a.ctrlKey)window.open(s);else{var o=t.data("ams-target");o?i.form.confirmChangedForm(o,function(){i.skin.loadURL(s,o,t.data("ams-link-options"),t.data("ams-link-callback"))}):i.form.confirmChangedForm(function(){s.startsWith("#")?s!==location.hash&&(i.root.hasClass("mobile-view-activated")?(i.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=s},50)):window.location.hash=s):window.location=s})}}}}),e(document).on("click",'a[target="_blank"]',function(a){a.preventDefault();var t=e(a.currentTarget);window.open(t.attr("href")),i.stats.logEvent(t.data("ams-stats-category")||"Navigation",t.data("ams-stats-action")||"External",t.data("ams-stats-label")||t.attr("href"))}),e(document).on("click",'a[target="_top"]',function(a){a.preventDefault(),i.form.confirmChangedForm(function(){window.location=e(a.currentTarget).attr("href")})}),e(window).on("hashchange",i.skin.checkURL)),e(document).off("click.modal").on("click",'[data-toggle="modal"]',function(a){var t=e(this),n=t.data("ams-disabled-handlers");!0!==n&&"click"!==n&&"all"!==n&&!0!==t.data("ams-context-menu")&&(!0===t.data("ams-stop-propagation")&&a.stopPropagation(),a.preventDefault(),i.dialog.open(t),t.parents("#shortcut").exists()&&setTimeout(i.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)}),e(document).on("click",'input[type="checkbox"][readonly]',function(){return!1}),e(document).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 s=t.data();if(s.amsClickHandler){!0!==s.amsStopPropagation&&!0!==s.amsClickStopPropagation||a.stopPropagation(),!0!==s.amsClickKeepDefault&&a.preventDefault();var r=i.getFunctionByName(s.amsClickHandler);void 0!==r&&r.call(t,s.amsClickHandlerOptions)}}}),e(document).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 s=t.data();if(s.amsChangeHandler){!0!==s.amsChangeKeepDefault&&a.preventDefault();var r=i.getFunctionByName(s.amsChangeHandler);void 0!==r&&r.call(t,s.amsChangeHandlerOptions)}}}}),e(document).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");a.select2("val",a.data("ams-select2-input-value").split(t.opts.separator))}),t.find(".select2").trigger("change"),e("[data-ams-reset-callback]",t).each(function(){var a=e(this),n=a.data(),s=i.getFunctionByName(n.amsResetCallback);void 0!==s&&s.call(t,a,n.amsResetCallbackOptions)})},10),i.form.setFocus(t)}),e(document).on("reset","[data-ams-reset-handler]",function(a){var t=e(this),n=t.data();if(n.amsResetHandler){!0!==n.amsResetKeepDefault&&a.preventDefault();var s=i.getFunctionByName(n.amsResetHandler);void 0!==s&&s.call(t,n.amsResetHandlerOptions)}}),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("focusin",function(a){e(a.target).closest(".mce-window").length&&a.stopImmediatePropagation()}),e("a[data-toggle=tab]",".nav-tabs").on("click",function(a){if(e(this).parent("li").hasClass("disabled"))return a.preventDefault(),!1}),e(document).on("show.bs.tab",function(a){var t=e(a.target),n=t.data();if(n.amsUrl){if(n.amsTabLoaded)return;try{t.append('<i class="fa fa-spin fa-cog margin-left-5"></i>'),i.skin.loadURL(n.amsUrl,t.attr("href"),{afterLoadCallback:function(){n.amsTabLoadOnce&&t.data("ams-tab-loaded",!0)}})}finally{e("i",t).remove()}}}),e(document).on("hide.bs.modal",function(a){var t=e(a.target);i.form.confirmChangedForm(t,function(){return t.data("modal").isShown=!0,!0},function(){return a.preventDefault(),!1})}),i.initContent(document),i.ajaxNav&&n.exists()&&i.skin.checkURL(),i.form.setFocus(document),e(window).on("beforeunload",i.form.checkBeforeUnload)},n.initContent=function(a){e(".tipsy").remove(),e("[rel=tooltip]",a).tooltip(),e("[rel=popover]",a).popover(),e("[rel=popover-hover]",a).popover({trigger:"hover"}),i.plugins.init(a),i.callbacks.init(a),i.events.init(a),i.form.init(a),"desktop"===i.device?i.skin._initDesktopWidgets(a):i.skin._initMobileWidgets(a),i.skin._setPageHeight()},n.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"},n.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"}},e(document).ready(function(){var a=(e=jQuery.noConflict())("HTML"),t=a.attr("lang")||a.attr("xml:lang");t&&!t.startsWith("en")?(n.lang=t,n.getScript(n.baseURL+"i18n/myams_"+t.substr(0,2)+".js",function(){n.initPage()})):n.initPage()})}(jQuery,this);