function renameProperty(n,t,i){return t==i?n:(n.hasOwnProperty(t)&&(n[i]=n[t],delete n[t]),n)}function customParseFloat(n){return n&&(n=parseFloat(n),!isNaN(n))?n:0}function customParseInt(n){return n&&(n=parseInt(n),!isNaN(n))?n:0}function loadAjax(n,t,i){$.ajax({url:n,method:"GET",type:i?i:"html",cache:!1,success:function(n){t&&t(n)}})}function getQueryStringParameterByName(n,t){t||(t=location.search);n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var r=new RegExp("[\\?&]"+n+"=([^]*)"),i=r.exec(t);return i===null?"":decodeURIComponent(i[1].replace(/\+/g," "))}function updateQueryStringParameter(n,t,i){var r=new RegExp("([?&])"+t+"=.*?(&|$)","i"),u=n.indexOf("?")!==-1?"&":"?";return n.match(r)?n.replace(r,"$1"+t+"="+i+"$2"):n+u+t+"="+i}function getUrlAbsolutePath(n){var t="",i=!0;if(URL)try{t=new URL(n).pathname}catch(r){i=!1}else i=!1;return i||(t="/"+n.replace(/^[a-z]{4,5}\:\/{2}[a-z]{1,}\:[0-9]{1,4}.(.*)/,"$1")),t}function openInNewTab(n){var t=window.open(n,"_blank");t.focus()}function parseDateFromString(n){return $.datepicker.parseDate($.datepicker._defaults.dateFormat,n)}function parseStringFromDate(n){return $.datepicker.formatDate($.datepicker._defaults.dateFormat,n)}function rotateImgCanvas(n,t,i){var u=document.createElement("canvas"),f=n.getContext("2d"),r=new Image;r.onload=function(){u.height=r.width;u.width=r.height;var n=u.getContext("2d");f.clearRect(0,0,r.width,r.height);n.save();n.translate(r.height/2,r.width/2);n.rotate(t*TO_RADIANS);n.drawImage(r,-(r.width/2),-(r.height/2));n.restore();i(u)};r.src=n.toDataURL("image/jpeg",1)}function reloadCanvasSmooth(n,t){var r=n.getContext("2d"),i=$("
").addClass("canvas-snapshot").css({width:n.width,height:n.height});i[0].onload=function(){r.clearRect(0,0,n.width,n.height);t(i)};i[0].src=n.toDataURL("image/png");$(n).after(i)}function cloneCanvas(n){var t=document.createElement("canvas"),i=t.getContext("2d");return t.width=n.width,t.height=n.height,i.drawImage(n,0,0),t}function signedNumber(n,t){return n?n>0?"+"+n.toFixed(t?t:0):n.toFixed(t?t:0):"0"}function secondsToTimeString(n){n=parseInt(n,10);var t=Math.floor(n/3600),i=Math.floor((n-t*3600)/60),r=n-t*3600-i*60;return t=t<=0?"":(t<10?"0":"")+t+":",i=(i<10?"0":"")+i+":",r=(r<10?"0":"")+r,t+i+r}function dataURItoBlob(n){for(var u,f,i=atob(n.split(",")[1]),e=n.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(i.length),o=new Uint8Array(r),t=0;t<\/div>",buttonClass:"form-control",nonSelectedText:"Ничего не выбрано",allSelectedText:"Выбрано все",nSelectedText:" - Выбрано"});n.find("table.sortable").each(function(){var n=$(this),t=n.find("thead th");t.each(function(i){var u=$(this),f=$('').html(u.html()),r=$('');u.empty().append(f).append(r);f.click(function(u){u.preventDefault();var f=r.hasClass("ASC")?"ASC":r.hasClass("DESC")?"DESC":"";f||(f="DESC");t.find(".sort").removeClass("ASC DESC");f=f=="DESC"?"ASC":"DESC";r.addClass(f);sortTable(i,f,n)})})});n.find("form").each(function(){var n=$(this).find(".ienumerable");n.length>0&&(n.each(function(){var t=$(this).data("inititemcustomevents"),n;t&&(n=window[t],typeof n=="function"&&$(this).find(".container_basedto").each(function(){n($(this))}));reorderIenumerableDtos($(this))}),revalidateForm($(this)))});$.each(n.find(".remove_basedto"),function(){initRemoveEvent($(this))});n.find(".new-item[data-container]").click(function(){var f=$(this).data("container"),t=$(f),o=f.replace("#container_",""),i=$("#template-"+o).html(),e=t.find(".container_basedto").length,n,r,u;i=i.replace(/\[0\]/g,"["+e+"]").replace(/\_0\_/g,"_"+e+"_");n=$(i);t.append(n);r=t.data("inititemcustomevents");r&&(u=window[r],typeof u=="function"&&u(n));initPageEvents(n);revalidateForm(n.closest("form"))});n.find(".image-uploader[data-base64inputname]").change(function(){var t=this.files,i,r,n;t&&t.length&&(r=$(this).closest("form").find('input[name="'+$(this).data("base64inputname")+'"]'),i=t[0],$(this).val(""),/^image\/\w+$/.test(i.type)?(n=new FileReader,n.readAsDataURL(i),n.onload=function(){var t=n.result.replace("data:image/png;base64,","").replace("data:image/jpeg;base64,","");r.val(t)},n.onerror=function(){window.alert("Пожалуйста выберите картинку.")}):window.alert("Пожалуйста выберите картинку."))});n.find(".search_reset").click(function(){var n=$(this).closest("form");n.find(":input[name]:not(.special_input)").val("");n.submit()});typeof initPopupSelect!="undefined"&&initPopupSelect(n);$.each(n.find(".symbol-count"),function(){var n=$(this),t=$("");t.addClass("symbol-count-counter");n.on("input",function(){var i=n.val();t.text(i.length)});n.after(t)})}function reorderIenumerableDtos(n,t){var i=n.attr("id").replace("container_","");i=i.replace("_",".");var f=n.find(".container_basedto"),r=new RegExp(i+"\\[.*?\\]\\s?"),u=new RegExp(i+"\\_.*?\\_\\s?");$.each(f,function(n){var t=$(this);t.find(":input[name]").each(function(){var e=$(this).attr("name"),o,f,s;r.test(e)&&(o=e.replace(r,i+"["+n.toString()+"]"),$(this).attr("name",o),t.find('span[data-valmsg-for="'+e+'"]').attr("data-valmsg-for",o));f=$(this).attr("id");f&&u.test(f)&&(s=f.replace(u,i+"_"+n.toString()+"_"),$(this).attr("id",s),t.find('label[for="'+f+'"]').attr("for",s))})});t&&revalidateForm(n.closest("form"))}function initRemoveEvent(n){n.click(function(){var n=$(this).closest(".ienumerable");$(this).closest(".container_basedto").remove();reorderIenumerableDtos(n,!0)})}function revalidateForm(n){n.removeData("validator");n.removeData("unobtrusiveValidation");$.validator.unobtrusive.parse(n)}function showFormErrors(n,t){var o=$(n),s,u,i,f,r,e,h,c;if(o.find("[data-valmsg-summary=true], .validation-summary-errors").remove(),t&&t.responseJSON&&t.responseJSON.ModelState){s=o.data("validator");u=[];for(i in t.responseJSON.ModelState)for(f=null,i!="this"&&(r=i,r&&r.indexOf("model.")!=-1&&(r=r.replace("model.","")),f=o.find(':input[name="'+r+'"]')),e=0;e0?s.errorList.push({element:f[0],message:t.responseJSON.ModelState[i][e]}):i=="this"&&u.push({message:t.responseJSON.ModelState[i][e]});return u&&u.length>0&&(h=$("").addClass("validation-summary-errors"),c=$("").appendTo(h),o.prepend(h),$.each(u,function(){$("").html(this.message).appendTo(c)})),s&&s.showErrors(),!0}return!1}function showConfirmModal(n){var t,i,r;if(n.ConfirmText||(n.ConfirmText="Да"),n.CloseText||(n.CloseText="Нет"),n.CloseBtnCssClass||(n.CloseBtnCssClass="default"),n.ConfirmBtnCssClass||(n.ConfirmBtnCssClass="primary"),t=$(_.template(confirmModalTemplate,{variable:"modal"})(n)),n.IsLarge&&t.find(".modal-dialog").addClass("modal-lg"),i=!1,n.ConfirmCallback&&t.find(".confirm-btn").click(function(){i=!0;t.modal("hide")}),r=!1,n.CloseCallback&&t.find(".close-btn").click(function(){r=!0;t.modal("hide")}),n.OnShow)t.on("show.bs.modal",function(t){n.OnShow(t)});if(n.OnShown)t.on("shown.bs.modal",function(t){n.OnShown(t)});t.on("hidden.bs.modal",function(t){i&&n.ConfirmCallback?n.ConfirmCallback(t):r&&n.CloseCallback&&n.CloseCallback(t);$(this).remove()});t.modal()}function readonlyFormInputs(n,t){if(n)if(t)n.removeAttr("readonly").unbind("click.readonly mousedown.readonly focus.readonly");else{n.attr("readonly","readonly");n.filter('[type="checkbox"],[type="radio"]').on("click.readonly",function(n){return n.preventDefault(),n.stopPropagation(),!1});n.filter("select").on("mousedown.readonly focus.readonly",function(n){n.preventDefault();$(this).blur()})}}function sortTable(n,t,i){function e(t){var i=$.trim($(t).children("td").eq(n).ignore(".ignore").text()).toLowerCase(),r;return i=i.replace(/\s\s+/g," "),$.isNumeric(i)?i=parseFloat(i):(r=moment(i,"DD.MM.YYYY HH:mm"),r.isValid()&&(i=r._d)),i}var u=i.children("tbody"),f=u.find("tr").get(),r=1;t&&t!="DESC"?t=="ASC"&&(r=1):r=-1;f.sort(function(n,t){var i=e(n),u=e(t);return iu?1*r:0});$.each(f,function(n,t){u.append(t)})}var _typeof,windowIsDefined,_MS_PER_DAY,TO_RADIANS,confirmModalTemplate;(function(n,t,i){typeof define=="function"&&define.amd?define(["jquery"],function(r){return i(r,n,t),r.mobile}):i(n.jQuery,n,t)})(this,document,function(n,t,i,r){(function(t){typeof define=="function"&&define.amd?define("ns",["jquery"],t):t(n)})(function(n){return n.mobile={version:"@VERSION"},n.mobile}),function(t){typeof define=="function"&&define.amd?define("defaults",["jquery","./ns"],t):t(n)}(function(n){return n.extend(n.mobile,{hideUrlBar:!0,keepNative:":jqmData(role='none'), :jqmData(role='nojs')",ajaxEnabled:!0,hashListeningEnabled:!0,linkBindingEnabled:!0,defaultPageTransition:"fade",maxTransitionWidth:!1,defaultDialogTransition:"pop",pageLoadErrorMessage:"Error Loading Page",pageLoadErrorMessageTheme:"a",phonegapNavigationEnabled:!1,autoInitializePage:!0,pushStateEnabled:!0,ignoreContentEnabled:!1,pageContainer:n(),allowCrossDomainPages:!1,dialogHashKey:"&ui-state=dialog"})}),function(t){typeof define=="function"&&define.amd?define("data",["jquery","./ns"],t):t(n)}(function(n){var i={},u=n.find,f=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,e=/:jqmData\(([^)]*)\)/g;return n.extend(n.mobile,{ns:n.mobileBackcompat===!1?"ui-":"",getAttribute:function(i,r){var u;i=i.jquery?i[0]:i;i&&i.getAttribute&&(u=i.getAttribute("data-"+n.mobile.ns+r));try{u=u==="true"?!0:u==="false"?!1:u==="null"?null:+u+""===u?+u:f.test(u)?t.JSON.parse(u):u}catch(e){}return u},nsNormalizeDict:i,nsNormalize:function(t){return i[t]||(i[t]=n.camelCase(n.mobile.ns+t))},closestPageData:function(n){return n.closest(":jqmData(role='page'), :jqmData(role='dialog')").data("mobile-page")}}),n.fn.jqmData=function(t,i){var u;return typeof t!="undefined"&&(t&&(t=n.mobile.nsNormalize(t)),u=arguments.length<2||i===r?this.data(t):this.data(t,i)),u},n.jqmData=function(t,i,r){var u;return typeof i!="undefined"&&(u=n.data(t,i?n.mobile.nsNormalize(i):i,r)),u},n.fn.jqmRemoveData=function(t){return this.removeData(n.mobile.nsNormalize(t))},n.jqmRemoveData=function(t,i){return n.removeData(t,n.mobile.nsNormalize(i))},n.find=function(t,i,r,f){return t.indexOf(":jqmData")>-1&&(t=t.replace(e,"[data-"+(n.mobile.ns||"")+"$1]")),u.call(this,t,i,r,f)},n.extend(n.find,u),n.mobile}),function(t){typeof define=="function"&&define.amd?define("jquery-ui/version",["jquery"],t):t(n)}(function(n){return n.ui=n.ui||{},n.ui.version="1.12.1"}),function(t){typeof define=="function"&&define.amd?define("jquery-ui/keycode",["jquery","./version"],t):t(n)}(function(n){return n.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),function(t){typeof define=="function"&&define.amd?define("helpers",["jquery","./ns","jquery-ui/keycode"],t):t(n)}(function(n){var r=function(t,i){var u=t.parent(),r=[],f=function(){var t=n(this),i=n.mobile.toolbar&&t.data("mobile-toolbar")?t.toolbar("option"):{position:t.attr("data-"+n.mobile.ns+"position"),updatePagePadding:t.attr("data-"+n.mobile.ns+"update-page-padding")!==!1};return i.position!=="fixed"||i.updatePagePadding!==!0},e=u.children(":jqmData(type='header')").filter(f),s=t.children(":jqmData(type='header')"),o=u.children(":jqmData(type='footer')").filter(f),h=t.children(":jqmData(type='footer')");return s.length===0&&e.length>0&&(r=r.concat(e.toArray())),h.length===0&&o.length>0&&(r=r.concat(o.toArray())),n.each(r,function(t,r){i-=n(r).outerHeight()}),Math.max(0,i)};return n.extend(n.mobile,{window:n(t),document:n(i),keyCode:n.ui.keyCode,behaviors:{},focusPage:function(n){var t=n.find("[autofocus]");t.length||(t=n.find(".ui-title").eq(0));t.length||(t=n);t.focus()},silentScroll:function(i){n.mobile.window.scrollTop()>0||(n.type(i)!=="number"&&(i=n.mobile.defaultHomeScroll),n.event.special.scrollstart.enabled=!1,setTimeout(function(){t.scrollTo(0,i);n.mobile.document.trigger("silentscroll",{x:0,y:i})},20),setTimeout(function(){n.event.special.scrollstart.enabled=!0},150))},getClosestBaseUrl:function(t){var i=n(t).closest(".ui-page").jqmData("url"),r=n.mobile.path.documentBase.hrefNoHash;return n.mobile.base.dynamicBaseEnabled&&i&&n.mobile.path.isPath(i)||(i=r),n.mobile.path.makeUrlAbsolute(i,r)},removeActiveLinkClass:function(t){!n.mobile.activeClickedLink||n.mobile.activeClickedLink.closest(".ui-page-active").length&&!t||n.mobile.activeClickedLink.removeClass("ui-button-active");n.mobile.activeClickedLink=null},enhanceable:function(n){return this.haveParents(n,"enhance")},hijackable:function(n){return this.haveParents(n,"ajax")},haveParents:function(t,i){if(!n.mobile.ignoreContentEnabled)return t;for(var h=t.length,f=n(),r,o,e,s,u=0;u0&&u.right>0&&u.top<(t.innerHeight||i.documentElement.clientHeight)&&u.left<(t.innerWidth||i.documentElement.clientWidth)}}),n.addDependents=function(t,i){var r=n(t),u=r.jqmData("dependents")||n();r.jqmData("dependents",n(u).add(i))},n.fn.extend({removeWithDependents:function(){n.removeWithDependents(this)},addDependents:function(t){n.addDependents(this,t)},getEncodedText:function(){return n("").text(this.text()).html()},jqmEnhanceable:function(){return n.mobile.enhanceable(this)},jqmHijackable:function(){return n.mobile.hijackable(this)}}),n.removeWithDependents=function(t){var i=n(t);(i.jqmData("dependents")||n()).remove();i.remove()},n.addDependents=function(t,i){var r=n(t),u=r.jqmData("dependents")||n();r.jqmData("dependents",n(u).add(i))},n.find.matches=function(t,i){return n.find(t,null,null,i)},n.find.matchesSelector=function(t,i){return n.find(i,null,null,[t]).length>0},n.mobile}),function(t){typeof define=="function"&&define.amd?define("core",["./defaults","./data","./helpers"],t):t(n)}(function(){}),function(t){typeof define=="function"&&define.amd?define("media",["jquery","./core"],t):t(n)}(function(n){return t.matchMedia=t.matchMedia||function(n){var u,i=n.documentElement,f=i.firstElementChild||i.firstChild,r=n.createElement("body"),t=n.createElement("div");return t.id="mq-test-1",t.style.cssText="position:absolute;top:-100em",r.style.background="none",r.appendChild(t),function(n){return t.innerHTML='