function fp_reload(){location.reload()}function fp_popupControlChangeTitle(n,t){alert($(t).parents(".modal-dialog").first().find(".modal-title").html(n));$(t).parents(".modal-dialog").first().find(".modal-title").html(n)}function GreateIframe(n){console.log("params",n.blocklistID);var t="/Flexpage/GetPopup?blocklistID="+(n.blocklistID?n.blocklistID:0)+"&number="+ ++fp_popup_number+"&blockAfter="+(n.blockAfter?n.blockAfter:0)+"&pageUrl="+(n.url?n.url:"")+"&OneButtonText="+(n.OneButtonText?n.OneButtonText:"")+"&allowSave="+(typeof n.allowSave=="undefined"?1:n.allowSave)+"&parameters="+n.parameters;return $("<iframe/>",{id:"dialog-iframe",css:{position:"fixed",top:0,left:0,width:"100%",height:"100%",border:0,"z-index":1050},src:t})}function fp_popupControlOpen(n,t){console.log(n);window.flexpage=window.flexpage||{};window.flexpage.params=n;window.flexpage.onCancel=t;window.flexpage.onClose=function(){$("#dialog-iframe").remove()};var i=GreateIframe(n),r=i.appendTo("body"),u=r.ajaxError(function(){$("#dialog-iframe").remove();GreateIframe(n).appendTo("body")})}function fp_UpdateLastUpdated(n,t){$(".modal-lastUpdated .lastUpdatedAt").text(" "+n+" ");$(".modal-lastUpdated .lastUpdatedBy").text(" "+t);$(".modal-lastUpdated").removeClass("hidden")}function _toConsumableArray(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return Array.from(n)}function fp_initSetting(n,t){n&&(fp_settings[n]=t)}function fp_deleteBlock(n,t,i,r){if(!fp_settings.deleteBlockUrl){alert("Delete block url is not configured");return}fp_ConfirmDialog("Delete","Are you sure you want to delete the block?",function(){$.ajax({url:fp_settings.deleteBlockUrl,data:{blockID:t,blockName:i,blocklistID:r},type:"post",cache:!1,success:function(){$(n).parents(".flexpage-blockWrapper").first().detach()},error:function(){}})})}function fp_deleteNewsRecord(n,t){if(!fp_settings.deleteBlockUrl){alert("Delete block url is not configured");return}fp_ConfirmDialog("Delete","Are you sure you want to delete the news?",function(){$.ajax({url:fp_settings.deleteBlockUrl,data:{blockID:t,blockName:"Event"},type:"post",cache:!1,success:function(){$(n).parents(".newsRec-container").first().detach()},error:function(){}})})}function fp_moveBlock(n,t,i){if(!fp_settings.moveBlockUrl){alert("Url for move block is not configured");return}fp_ConfirmDialog("Move block","Are you sure want to move the block?",function(){$.ajax({url:fp_settings.moveBlockUrl,data:{blockID:n,blocklistID:t,direction:i},type:"post",cache:!1,success:function(){location.reload()},error:function(){}})})}function fp_StoreFromHtmlEditorToHidden(n){eval('$("#'+n+'_CurrentText").val(fp_HtmlEditor_'+n+".GetHtml());")}function fp_ConfirmDialog(n,t,i,r){$("body > #fp_confirm_dialog").detach();var u=$('<div class="modal fade" id="fp_confirm_dialog" tabindex="-1" role="dialog" ><\/div>').append($('<div class="modal-dialog mini"><\/div>').append($('<div class="modal-content"><\/div>').append($('<div class="modal-header"><\/div>').append($('<h3 class="modal-title"><\/h3>').html(n))).append($('<div class="modal-body"><\/div>').append($("<p>").html(t))).append($('<div class="modal-footer"><\/div>').append($('<div class="col-md-6 pull-right right"><\/div>').append($('<a href="javascript:void(0)" data-dismiss="modal" class="ok_btn">OK<\/a>')).append($('<a href="javascript:void(0)" data-dismiss="modal" aria-label="Close">CANCEL<\/a>')))))).appendTo($("body"));$("body > #fp_confirm_dialog .ok_btn").on("click",i);if(r)$('body > #fp_confirm_dialog [aria-label="Close"]').on("click",r);$("body > #fp_confirm_dialog").modal()}function fp_WarningDialog(n,t,i){$("body > #fp_confirm_dialog").detach();var r=$('<div class="modal fade" id="fp_confirm_dialog" tabindex="-1" role="dialog" ><\/div>').append($('<div class="modal-dialog mini"><\/div>').append($('<div class="modal-content"><\/div>').append($('<div class="modal-header"><\/div>').append($('<h3 class="modal-title"><\/h3>').html(n))).append($('<div class="modal-body"><\/div>').append($("<p>").html(t))).append($('<div class="modal-footer"><\/div>').append($('<div class="col-md-6 pull-right right"><\/div>').append($('<a href="javascript:void(0)" data-dismiss="modal" class="ok_btn">OK<\/a>')))))).appendTo($("body"));$("body > #fp_confirm_dialog .ok_btn").on("click",i);$("body > #fp_confirm_dialog").modal()}function fp_TwoButtonsDialog(n,t,i,r,u){$("body > #fp_twoButtons_dialog").detach();var f=$('<div class="modal fade" id="fp_twoButtons_dialog" tabindex="-1" role="dialog" ><\/div>').append($('<div class="modal-dialog mini"><\/div>').append($('<div class="modal-content"><\/div>').append($('<div class="modal-header"><\/div>').append($('<h3 class="modal-title"><\/h3>').html(n))).append($('<div class="modal-body"><\/div>').append($("<p>").html(t))).append($('<div class="modal-footer"><\/div>').append($('<div class="col-md-6 pull-right right"><\/div>').append($('<a href="javascript:void(0)" data-dismiss="modal" class="first_btn">'+i+"<\/a > ")).append($('<a href="javascript:void(0)" data-dismiss="modal" class="second_btn">'+r+"<\/a > ")).append($('<a href="javascript:void(0)" data-dismiss="modal" aria-label="Close">CANCEL<\/a>')))))).appendTo($("body"));$("body > #fp_twoButtons_dialog .first_btn").on("click",function(){u(0)});$("body > #fp_twoButtons_dialog .second_btn").on("click",function(){u(1)});$("body > #fp_twoButtons_dialog").modal()}function fp_reload(){location.reload()}function fp_toggleTabVisibility(n,t){if(!fp_settings.toggleTabVisibilityUrl){alert("Url for toggle tab visibility is not configured");return}$.ajax({url:fp_settings.toggleTabVisibilityUrl,data:{tabID:t},type:"post",cache:!1,success:function(t){$(n).children("img").attr("src",t)},error:function(){}})}function fp_toggleBlockVisibility(n,t){if(!fp_settings.toggleBlockVisibilityUrl){alert("Url for toggle block visibility is not configured");return}$.ajax({url:fp_settings.toggleBlockVisibilityUrl,data:{blockID:t},type:"post",cache:!1,success:function(t){t=="True"?($(n).children("img.flexpage-icon-menu__show").show(t),$(n).children("img.flexpage-icon-menu__hide").hide(t)):($(n).children("img.flexpage-icon-menu__show").hide(t),$(n).children("img.flexpage-icon-menu__hide").show(t))},error:function(){}})}function fp_cutBlock(n,t){if(!fp_settings.cutBlockUrl){alert("Url to cut block is not configured");return}fp_ConfirmDialog("Cut block","Are you sure want to cut the block?",function(){$.ajax({url:fp_settings.cutBlockUrl,data:{blockID:n,blocklistID:t},type:"post",cache:!1,success:function(){fp_reload()},error:function(){}})})}function fp_copyBlock(n,t){if(!fp_settings.copyBlockUrl){alert("Url to copy block is not configured");return}fp_ConfirmDialog("Copy block","Are you sure want to copy the block?",function(){$.ajax({url:fp_settings.copyBlockUrl,data:{blockID:n,blocklistID:t},type:"post",cache:!1,success:function(){fp_reload()},error:function(){}})})}function fp_PasteBlock(n,t){if(!fp_settings.pasteBlockUrl){alert("Url to paste block is not configured");return}fp_ConfirmDialog("Paste block","Are you sure want to paste the block?",function(){$.ajax({url:fp_settings.pasteBlockUrl,data:{pasteafterID:n,targetBlocklistID:t},type:"post",cache:!1,success:function(){fp_reload()},error:function(){}})})}function fp_addToRss(n){if(!fp_settings.addToRssUrl){alert("Url to enable rss is not configured");return}fp_ConfirmDialog("RSS","Are you sure want to change RSS?",function(){$.ajax({url:fp_settings.addToRssUrl,data:{blockID:n},type:"post",cache:!1,success:function(){fp_reload()},error:function(){}})})}function fp_sliderCheckBoxClicked(n){var t=$(n).find("input[type=checkbox]");t.prop("checked",!t.prop("checked"))}function fp_emailScrambling_encodeElement(n){return unescape(n)}function fp_emailScrambling_descriptElement(n){var t=document.getElementById(n);t!=null&&t.title!=""&&(t.innerHTML=fp_emailScrambling_encodeElement(t.title.replace(/(.{2})/g,"%$1")),t.title="")}function deleteRowInDevexpressGrid(n,t){fp_ConfirmDialog("Delete","Are you sure you want to delete?",function(){n.DeleteRow(t)})}function magnifierShow(n){var r,t,i;n!=window.enteredObject&&(enteredObject=n,document.getElementById("previewDiv")==null||document.getElementById("previewDiv").style.display!="")&&(document.getElementById("magnifier")==null||document.getElementById("magnifier").style.display!="")&&(r=$(n).data("preview"),(document.getElementById("magnifier")==null||document.getElementById("magnifier")==undefined)&&(t=document.createElement("div"),t.style.width="32px",t.style.height="32px",t.style.display="none",t.innerHTML="<img src='/Content/Images/magnifier.png'/>",t.id="magnifier",t.style.zIndex="4",t.style.cursor="pointer",n.appendChild(t)),$(n).append($("<div>",{"class":"tiled-content-hover"})),$(n).find(".tiled-content-name").show(),i=document.getElementById("magnifier"),i.onclick=function(){pdfPreviewShow(r)},i.style.position="absolute",i.style.top="95px",i.style.left="58px",i.style.display="")}function magnifierHide(n,t,i){var r,u,e,o,f;if(i)document.getElementById("magnifier")!=null&&(f=document.getElementById("magnifier"),f.parentNode.removeChild(f),enteredObject=null,$(".tiled-content-hover").remove(),$(n).find(".tiled-content-name").hide());else{var s=findPosY(n),h=findPosX(n),c=s+190,l=h+140;if(t=t||t,t.pageX==null&&t.clientX!=null&&(r=document.documentElement,u=document.body,t.pageX=t.clientX+(r&&r.scrollLeft||u&&u.scrollLeft||0)-(r&&r.clientLeft||u&&u.clientLeft||0),t.pageY=t.clientY+(r&&r.scrollTop||u&&u.scrollTop||0)-(r&&r.clientTop||u&&u.clientTop||0)),e=t.pageX,o=t.pageY,e>h&&e<l&&o>s&&o<c)return;n==window.enteredObject&&(enteredObject=null);document.getElementById("magnifier")!=null&&(f=document.getElementById("magnifier"),f.parentNode.removeChild(f),$(".tiled-content-hover").remove(),$(n).find(".tiled-content-name").hide())}}function pdfPreviewShow(n){var i,t,u,r,f;(document.getElementById("previewDiv")==null||document.getElementById("previewDiv")==undefined)&&(i=document.createElement("div"),i.style.display="none",i.id="previewDiv",document.body.appendChild(i));t=document.getElementById("previewDiv");t.innerHTML="<img src='"+n+"' onclick='pdfPreviewHide();'/>";t.style.position="absolute";u=getWindowSize();r=getScrollXY();t.style.left=u[0]/2-270+"px";t.style.top=r[1]+"px";t.style.zIndex="1001";f=document.getElementById("disablingDiv");f.onclick=function(){pdfPreviewHide()};t.style.display="";showSplash(r[1]+"px")}function pdfPreviewHide(){if(document.getElementById("previewDiv")!=null){var n=document.getElementById("previewDiv");n.style.display="none"}hideSplash();magnifierHide(null,null,!0)}function findPosY(n){var t=0;if(n.offsetParent)for(;;){if(t+=n.offsetTop,!n.offsetParent)break;n=n.offsetParent}else n.y&&(t+=n.y);return t}function findPosX(n){var t=0;if(n.offsetParent)for(;;){if(t+=n.offsetLeft,!n.offsetParent)break;n=n.offsetParent}else n.x&&(t+=n.x);return t}function getWindowSize(){var n=0,t=0;return typeof innerWidth=="number"?(n=window.innerWidth,t=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(n=document.documentElement.clientWidth,t=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(n=document.body.clientWidth,t=document.body.clientHeight),[n,t]}function getScrollXY(){var n=0,t=0;return typeof pageYOffset=="number"?(t=window.pageYOffset,n=window.pageXOffset):document.body&&(document.body.scrollLeft||document.body.scrollTop)?(t=document.body.scrollTop,n=document.body.scrollLeft):document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)&&(t=document.documentElement.scrollTop,n=document.documentElement.scrollLeft),[n,t]}function showSplash(){var n=document.getElementById("disablingDiv");n.style.height=document.body.scrollHeight+"px";n.style.display=""}function hideSplash(){var n=document.getElementById("disablingDiv");n.style.display="none"}function wndsize(){var n=0,t=0;return window.innerWidth?(n=window.innerWidth,t=window.innerHeight):document.documentElement.clientWidth==0?(n=document.body.clientWidth,t=document.body.clientHeight):(n=document.documentElement.clientWidth,t=document.documentElement.clientHeight),{width:n,height:t}}function fp_PopupTogglePleaseWaitDiv(n,t){n!="[object Object]"&&$(n).first().parents(".modal-dialog").first().children(".fp_popupPleaseWaitDiv").css("display",t)}function fp_AjaxFormComplete(n){n!="[object Object]"&&(fp_PopupTogglePleaseWaitDiv(n,"none"),$(n).scrollLeft(fp_popupScrollLeftPosition),$(n).scrollTop(fp_popupScrollTopPosition));fp_reinitTooltip()}function fp_PostAjaxForm(n,t,i){var r,u,f,e;if(typeof fp_prePostAjaxForm!="undefined"&&fp_prePostAjaxForm(),fp_PopupTogglePleaseWaitDiv(n,"block"),r=jQuery(n).find("form").first(),fp_popupScrollLeftPosition=$(n).scrollLeft(),fp_popupScrollTopPosition=$(n).scrollTop(),t)for(u in t)r.append('<input type="hidden" name="'+u+'" value="'+t[u]+'"/>');return f="fp_AjaxFormComplete('"+n+"'); ",i&&(f+=i),e="fp_processUpdateFailure",r.attr("data-ajax-success",f),r.attr("data-ajax-failure",e),r.submit(),!1}function fp_processUpdateFailure(n){var t=n.responseJSON,r="",i,u,f;if(t)for(i in t){u="";for(f in t[i].errors)u+=" "+t[i].errors[f];r+=t[i].key+":"+u+"\n"}else r=n.responseText&&$(n.responseText).text().trim().split(".")[0]&&$(n.responseText).text().trim().split(".")[0].indexOf("font-family:")<0?$(n.responseText).text().trim().split(".")[0]:n.statusText;displayPopupMessage(r);$("#fp_popupPleaseWaitDiv").css("display","none")}function displayPopupMessage(n){var t=document.getElementById("popup-message-area"),i=document.getElementById("popup-message-area-text");t&&(t.style.display="block");i&&(i.innerHTML=n)}function fp_reinitTooltip(){jQuery(".modal-body").ready(function(){jQuery('[data-toggle="tooltip"]').tooltip({placement:"top"})})}function fp_popupControlEndLoad(){}function fp_popupControlChangeTitle(n,t){$(t).parents(".modal-dialog").first().find(".modal-title").html(n)}function fp_popupControlRefresh(n,t,i){var r=$(n).parents(".modal-dialog").first().parent();t.command=="save"?fp_popupControlRefreshSave(r,t,i):_fp_popupControlCommand(r,t,i)}function fp_popupControlRefreshSave(n,t){var u=n.find('input[type="hidden"][name="IDPostfix"]').val(),i=n.find('input[type="hidden"][name="BlocklistID"]').val(),r=n.find('input[type="hidden"][name="BlockAfter"]').val();$.ajax({url:"/Admin/Update"+t.blockType,data:{command:"save",BlockType:t.blockType,BlocklistID:i,BlockAfter:r,BlockAlias:"#create new#"},type:"post",cache:!1,success:function(){window.parent.location.reload()},error:function(){}})}function _fp_popupControlCommand(n,t,i){n.find('div[name="fp_PopupContent"]').html("");n.find(".modal-footer").html("");n.find('input[type="hidden"][name="Command"]').val(t.command);n.find('input[type="hidden"][name="BlockType"]').val(t.blockType);t.blockID===undefined&&(t.blockID=-1);isNaN(parseInt(t.blockID))&&(t.blockID=-1);n.find('input[type="hidden"][name="ID"]').val(t.blockID);n.find('input[type="hidden"][name="BlockAlias"]').val(t.blockAlias);n.find('input[type="hidden"][name="Parameters"]').val(t.parameters);n.find('input[type="hidden"][name="Title"]').val(t.title);var r=n.find('input[type="hidden"][name="BlocklistID"]');"blocklistID"in t&&r.val(t.blocklistID);n.find('input[type="hidden"][name="Controller"]').val(t.controller);n.find('input[type="hidden"][name="Action"]').val(t.action);n.find('input[type="hidden"][name="Url"]').val(t.url);n.find('input[type="hidden"][name="AllowSave"]').val(t.allowSave);t.alwaysCallOnClose&&n.attr("fp_prop_alwaysOnClose","1");n.unbind("hide.bs.modal").on("hide.bs.modal",function(n){var t=$(n.target);t.hasClass("not-removable")||t.detach();i!==undefined&&i()});fp_PostAjaxForm("#"+n.attr("id")+" .modal-body",{},"fp_popupControlEndLoad()")}function fp_blockEventAfterClose(){if(window.parent.flexpage.onCancel)window.parent.flexpage.onCancel(!0);window.parent.flexpage.onClose()}function fp_PopupContent_Complete(n){if(n&&n.responseText&&n.responseText[0]=="{"){var t=JSON.parse(n.responseText);t.redirectTo&&(window.location.href=t.redirectTo)}}function fp_saveBlock(n,t,i,r,u){function f(){if(u){if($("#fp_BlockEditorSaveAndRefreshBtn_"+n).hasClass("disabled"))return;$("#fp_BlockEditorSaveAndRefreshBtn_"+n).addClass("disabled")}else{if($("#fp_BlockEditorSaveBtn_"+n).hasClass("disabled"))return;$("#fp_BlockEditorSaveBtn_"+n).addClass("disabled")}$("#fp_popupPleaseWaitDiv").css("display","block");var f={};typeof fp_preSaveBlock!="undefined"&&(f=fp_preSaveBlock());window.parent.flexpage.fp_afterPreSaveBlock!==undefined&&window.parent.flexpage.fp_afterPreSaveBlock(f);SaveSarvice.show(function(){fp_PostAjaxForm("#fp_BlockEditorContainer_"+n,{command:"save",BlocklistID:t,BlockAfter:i,Parameters:r},u?"fp_closePopUpAndRefresh()":"fp_closePopUp(true)")})}r.search("dirtyConfirm")!=-1?fp_checkDirty(n,f,function(){}):f()}function fp_AfterSave(n){if(window.parent)if(window.parent.flexpage.onCancel){window.parent.flexpage.onCancel(!0);window.parent.flexpage.onClose()}else window.parent.location.reload();else $("#flexpage-popup-control_"+n).modal("toggle")}function fp_checkDirty(n,t,i){let r=!1;$("#fp_PopupContent_"+n).find("[fortraking]").each(function(){let n=$(this).attr("id");n&&(r=IsFormDirty(n))});r?fp_ConfirmDialog("Close popup","Unsaved changes will be lost.<\/br>Are you sure you want to close the window ?",function(){t()},i):t()}function fp_beforeClosePopUp(n,t){return fp_checkDirty(t,function(){fp_closePopUp(n)}),!1}function IsFormDirty(n){let t=!1;return $("#"+n+" .tracker-dirty").length!==0&&(t=!0),t}function fp_closePopUp(n){$("[id^='flexpage-popup-control']").modal("hide");$("[id^='flexpage-popup-control']").collapse();fp_blockEventAfterClose(n)}function fp_closePopUpAndRefresh(){setTimeout(()=>{$("[id^='flexpage-popup-control']").modal("hide"),$("[id^='flexpage-popup-control']").collapse()},5e3);window.parent.location.reload()}function fp_ControlsForTracking(n){n.forEach(function(n){$(n).addClass("tracked")})}function fp_UpdateLastUpdated(n,t){$(".modal-lastUpdated .lastUpdatedAt").text(" "+n+" ");$(".modal-lastUpdated .lastUpdatedBy").text(" "+t);$(".modal-lastUpdated").removeClass("hidden")}function fp_stylemanager_addnew(){$(".fp_stylemanager-addnew .btn").prop("disabled",!0);$("table.fp_styleManager-grid tbody tr.fp_styleManager_0").removeClass("hidden");$(".tableFixHead")[0].scrollTop=$(".tableFixHead")[0].scrollHeight}function fp_stylemanager_addUpdate(n){var t=$("table.fp_styleManager-grid tbody tr.fp_styleManager_"+n),r=$(t).find('.Name input[type="text"]'),u=$(t).find(".CustomCSS textarea"),f,i,e;($(r).removeClass("field-validation-error"),$(u).removeClass("field-validation-error"),f=0,($(r).val()==""||$(r).val()==null)&&($(r).addClass("field-validation-error"),f=1),($(u).val()==""||$(u).val()==null)&&($(u).addClass("field-validation-error"),f=1),f==0)&&(i={},e=$(t).find('input[type="text"], textarea,input[type="checkbox"]'),e.each(function(){var n=$(this).attr("name").split(".").pop(),t=$(this).val();n=="DisableCustomCss"&&(t=$(this).prop("checked"));i[n]=t}),i.IsDefaultStyle=!1,i.ID=n,$.ajax({url:"/CSSSettings/SaveCSSSettings",data:{model:i},type:"POST",success:function(n){$(".fp_stylemanager-addnew .btn").prop("disabled",!1);i.ID>0?($(t).find(".fp_styleEdit").addClass("hidden"),$(t).find(".Name .fp_styleSet").text($(t).find(".Name .fp_styleEdit").val()),$(t).find(".DisableCustomCss .fp_styleSet").text($(t).find(".DisableCustomCss .fp_styleEdit").prop("checked").toString().substring(0,1).toUpperCase()+$(t).find(".DisableCustomCss .fp_styleEdit").prop("checked").toString().substring(1)),$(t).find(".CustomCSS .fp_styleSet").text($(t).find(".CustomCSS .fp_styleEdit").val()),$(t).find(".fp_styleSet").show()):($("table.fp_styleManager-grid tbody tr.fp_styleManager_0").find('input[type="text"], textarea').val(""),$("table.fp_styleManager-grid tbody tr.fp_styleManager_0").find('input[type="checkbox"]').prop("checked",!1),$("table.fp_styleManager-grid tbody tr.fp_styleManager_0").addClass("hidden"),$("table.fp_styleManager-grid tbody tr:last").before(n))}}))}function fp_stylemanager_edit(n){var t=$("table.fp_styleManager-grid tbody tr.fp_styleManager_"+n);$(t).find(".fp_styleEdit").removeClass("hidden");$(t).find(".fp_styleSet").hide();$(".fp_stylemanager-addnew .btn").prop("disabled",!0)}function fp_stylemanager_cancel(n){if(n>0){$(".fp_styleEdit").removeClass("field-validation-error");var t=$("table.fp_styleManager-grid tbody tr.fp_styleManager_"+n);$(t).find(".Name .fp_styleEdit").val($(t).find(".Name .fp_styleSet").text());$(t).find(".DisableCustomCss .fp_styleEdit").prop("checked",$(t).find(".DisableCustomCss .fp_styleSet").text().toLowerCase()=="true");$(t).find(".CustomCSS .fp_styleEdit").val($(t).find(".CustomCSS .fp_styleSet").text());$(t).find(".fp_styleEdit").addClass("hidden");$(t).find(".fp_styleSet").show()}else $(".fp_styleEdit input").removeClass("field-validation-error"),$(".fp_styleEdit textarea").removeClass("field-validation-error"),$("table.fp_styleManager-grid tbody tr.fp_styleManager_0").find('input[type="text"], textarea').val(""),$("table.fp_styleManager-grid tbody tr.fp_styleManager_0").find('input[type="checkbox"]').prop("checked",!1),$("table.fp_styleManager-grid tbody tr.fp_styleManager_0").addClass("hidden");$(".fp_stylemanager-addnew .btn").prop("disabled",!1)}function fp_stylemanager_delete(n){fp_ConfirmDialog("Delete","Are you sure you want to delete this style ?",function(){$.ajax({url:"/CSSSettings/DeleteCSSSettings",data:{ID:n},type:"POST",success:function(){$("table.fp_styleManager-grid tbody tr.fp_styleManager_"+n).remove()}})})}var fp_popup_number,fp_settings,fp_loadScripts,fp_popupScrollLeftPosition,fp_popupScrollTopPosition,SaveSarvice,CalendarActionTypeEnum,flexpageCalendar,StatusProperty,fp_selectedFileId,fp_selectedFileName;!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){"use strict";var a=!1,p=!1,d=0,g=2e3,s=0,i=n,t=document,r=window,f=i(r),h=[],e=r.requestAnimationFrame||r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||!1,v=r.cancelAnimationFrame||r.webkitCancelAnimationFrame||r.mozCancelAnimationFrame||!1,w,c,l;e?r.cancelAnimationFrame||(v=function(){}):(w=0,e=function(n){var t=(new Date).getTime(),i=Math.max(0,16-(t-w)),u=r.setTimeout(function(){n(t+i)},i);return w=t+i,u},v=function(n){r.clearTimeout(n)});var o=r.MutationObserver||r.WebKitMutationObserver||!1,u=Date.now||function(){return(new Date).getTime()},k={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:40,mousescrollstep:27,touchbehavior:!1,emulatetouch:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var n=t.currentScript||function(){var n=t.getElementsByTagName("script");return!!n.length&&n[n.length-1]}(),i=n?n.src.split("?")[0]:"";return i.split("/").length>0?i.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1},b=!1,nt=function(){if(b)return b;var u=t.createElement("DIV"),i=u.style,e=navigator.userAgent,f=navigator.platform,n={};return n.haspointerlock="pointerLockElement"in t||"webkitPointerLockElement"in t||"mozPointerLockElement"in t,n.isopera="opera"in r,n.isopera12=n.isopera&&"getUserMedia"in navigator,n.isoperamini="[object OperaMini]"===Object.prototype.toString.call(r.operamini),n.isie="all"in t&&"attachEvent"in u&&!n.isopera,n.isieold=n.isie&&!("msInterpolationMode"in i),n.isie7=n.isie&&!n.isieold&&(!("documentMode"in t)||7===t.documentMode),n.isie8=n.isie&&"documentMode"in t&&8===t.documentMode,n.isie9=n.isie&&"performance"in r&&9===t.documentMode,n.isie10=n.isie&&"performance"in r&&10===t.documentMode,n.isie11="msRequestFullscreen"in u&&t.documentMode>=11,n.ismsedge="msCredentials"in r,n.ismozilla="MozAppearance"in i,n.iswebkit=!n.ismsedge&&"WebkitAppearance"in i,n.ischrome=n.iswebkit&&"chrome"in r,n.ischrome38=n.ischrome&&"touchAction"in i,n.ischrome22=!n.ischrome38&&n.ischrome&&n.haspointerlock,n.ischrome26=!n.ischrome38&&n.ischrome&&"transition"in i,n.cantouch="ontouchstart"in t.documentElement||"ontouchstart"in r,n.hasw3ctouch=(r.PointerEvent||!1)&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),n.hasmstouch=!n.hasw3ctouch&&(r.MSPointerEvent||!1),n.ismac=/^mac$/i.test(f),n.isios=n.cantouch&&/iphone|ipad|ipod/i.test(f),n.isios4=n.isios&&!("seal"in Object),n.isios7=n.isios&&"webkitHidden"in t,n.isios8=n.isios&&"hidden"in t,n.isios10=n.isios&&r.Proxy,n.isandroid=/android/i.test(e),n.haseventlistener="addEventListener"in u,n.trstyle=!1,n.hastransform=!1,n.hastranslate3d=!1,n.transitionstyle=!1,n.hastransition=!1,n.transitionend=!1,n.trstyle="transform",n.hastransform="transform"in i||function(){for(var r=["msTransform","webkitTransform","MozTransform","OTransform"],t=0,u=r.length;t<u;t++)if(void 0!==i[r[t]]){n.trstyle=r[t];break}n.hastransform=!!n.trstyle}(),n.hastransform&&(i[n.trstyle]="translate3d(1px,2px,3px)",n.hastranslate3d=/translate3d/.test(i[n.trstyle])),n.transitionstyle="transition",n.prefixstyle="",n.transitionend="transitionend",n.hastransition="transition"in i||function(){n.transitionend=!1;for(var r=["webkitTransition","msTransition","MozTransition","OTransition","OTransition","KhtmlTransition"],u=["-webkit-","-ms-","-moz-","-o-","-o","-khtml-"],f=["webkitTransitionEnd","msTransitionEnd","transitionend","otransitionend","oTransitionEnd","KhtmlTransitionEnd"],t=0,e=r.length;t<e;t++)if(r[t]in i){n.transitionstyle=r[t];n.prefixstyle=u[t];n.transitionend=f[t];break}n.ischrome26&&(n.prefixstyle=u[1]);n.hastransition=n.transitionstyle}(),n.cursorgrabvalue=function(){var u=["grab","-webkit-grab","-moz-grab"],t,f,r;for((n.ischrome&&!n.ischrome38||n.isie)&&(u=[]),t=0,f=u.length;t<f;t++)if(r=u[t],i.cursor=r,i.cursor==r)return r;return"url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize"}(),n.hasmousecapture="setCapture"in u,n.hasMutationObserver=!1!==o,u=null,b=n,n},tt=function(n,c){function pt(){var n=l.doc.css(w.trstyle);return!(!n||"matrix"!=n.substr(0,6))&&n.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/)}function ti(){var n=l.win,t;if("zIndex"in n)return n.zIndex();for(;n.length>0;){if(9==n[0].nodeType)return!1;if(t=n.css("zIndex"),!isNaN(t)&&0!==t)return parseInt(t);n=n.parent()}return!1}function rt(n,t,i){var u=n.css(t),r=parseFloat(u),f;return isNaN(r)?(f=3==(r=kt[u]||0)?i?l.win.outerHeight()-l.win.innerHeight():l.win.outerWidth()-l.win.innerWidth():1,l.isie8&&r&&(r+=1),f?r:0):r}function wt(n,t,i,u){l._bind(n,t,function(u){var f={original:u=u||r.event,target:u.target||u.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==u.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){return u.preventDefault?u.preventDefault():u.returnValue=!1,!1},stopImmediatePropagation:function(){u.stopImmediatePropagation?u.stopImmediatePropagation():u.cancelBubble=!0}};return"mousewheel"==t?(u.wheelDeltaX&&(f.deltaX=-.025*u.wheelDeltaX),u.wheelDeltaY&&(f.deltaY=-.025*u.wheelDeltaY),!f.deltaY&&!f.deltaX&&(f.deltaY=-.025*u.wheelDelta)):f.deltaY=u.detail,i.call(n,f)},u)}function ct(n,t,i,r){var s,e,f,o;if(l.scrollrunning||(l.newscrolly=l.getScrollTop(),l.newscrollx=l.getScrollLeft(),vt=u()),s=u()-vt,vt=u(),s>350?et=1:et+=(2-et)/10,n=n*et|0,t=t*et|0,n){if(r)if(n<0){if(l.getScrollLeft()>=l.page.maxw)return!0}else if(l.getScrollLeft()<=0)return!0;e=n>0?1:-1;ni!==e&&(l.scrollmom&&l.scrollmom.stop(),l.newscrollx=l.getScrollLeft(),ni=e);l.lastdeltax-=n}if(t){if(function(){var n=l.getScrollTop();if(t<0){if(n>=l.page.maxh)return!0}else if(n<=0)return!0}()){if(y.nativeparentscrolling&&i&&!l.ispage&&!l.zoomactive)return!0;f=l.view.h>>1;l.newscrolly<-f?(l.newscrolly=-f,t=-1):l.newscrolly>l.page.maxh+f?(l.newscrolly=l.page.maxh+f,t=1):t=0}o=t>0?1:-1;gt!==o&&(l.scrollmom&&l.scrollmom.stop(),l.newscrolly=l.getScrollTop(),gt=o);l.lastdeltay-=t}(t||n)&&l.synched("relativexy",function(){var t=l.lastdeltay+l.newscrolly,n;l.lastdeltay=0;n=l.lastdeltax+l.newscrollx;l.lastdeltax=0;l.rail.drag||l.doScrollPos(n,t)})}function bt(n,t,i){var r,u;return!(i||!yt)||(0===n.deltaMode?(r=-n.deltaX*(y.mousescrollstep/54)|0,u=-n.deltaY*(y.mousescrollstep/54)|0):1===n.deltaMode&&(r=-n.deltaX*y.mousescrollstep*50/80|0,u=-n.deltaY*y.mousescrollstep*50/80|0),t&&y.oneaxismousemode&&0===r&&u&&(r=u,u=0,i&&(r<0?l.getScrollLeft()>=l.page.maxw:l.getScrollLeft()<=0)&&(u=r,r=0)),l.isrtlmode&&(r=-r),ct(r,u,i,!0)?void(i&&(yt=!0)):(yt=!1,n.stopImmediatePropagation(),n.preventDefault()))}var l=this,ut,y,ot,ft,b,w,st,lt,kt,tt,at,dt,ht;if(this.version="3.7.6",this.name="nicescroll",this.me=c,ut=i("body"),y=this.opt={doc:ut,win:!1},i.extend(y,k),y.snapbackspeed=80,n)for(ot in y)void 0!==n[ot]&&(y[ot]=n[ot]);if((y.disablemutationobserver&&(o=!1),this.doc=y.doc,this.iddoc=this.doc&&this.doc[0]?this.doc[0].id||"":"",this.ispage=/^BODY|HTML/.test(y.win?y.win[0].nodeName:this.doc[0].nodeName),this.haswrapper=!1!==y.win,this.win=y.win||(this.ispage?f:this.doc),this.docscroll=this.ispage&&!this.haswrapper?f:this.win,this.body=ut,this.viewport=!1,this.isfixed=!1,this.iframe=!1,this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName,this.istextarea="TEXTAREA"==this.win[0].nodeName,this.forcescreen=!1,this.canshowonmouseevent="scroll"!=y.autohidemode,this.onmousedown=!1,this.onmouseup=!1,this.onmousemove=!1,this.onmousewheel=!1,this.onkeypress=!1,this.ongesturezoom=!1,this.onclick=!1,this.onscrollstart=!1,this.onscrollend=!1,this.onscrollcancel=!1,this.onzoomin=!1,this.onzoomout=!1,this.view=!1,this.page=!1,this.scroll={x:0,y:0},this.scrollratio={x:0,y:0},this.cursorheight=20,this.scrollvaluemax=0,"auto"==y.rtlmode)?(ft=this.win[0]==r?this.body:this.win,b=ft.css("writing-mode")||ft.css("-webkit-writing-mode")||ft.css("-ms-writing-mode")||ft.css("-moz-writing-mode"),"horizontal-tb"==b||"lr-tb"==b||""===b?(this.isrtlmode="rtl"==ft.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==b||"tb"==b||"tb-rl"==b||"rl-tb"==b,this.isvertical="vertical-rl"==b||"tb"==b||"tb-rl"==b)):(this.isrtlmode=!0===y.rtlmode,this.isvertical=!1),this.scrollrunning=!1,this.scrollmom=!1,this.observer=!1,this.observerremover=!1,this.observerbody=!1,!1!==y.scrollbarid)this.id=y.scrollbarid;else do this.id="ascrail"+g++;while(t.getElementById(this.id));if(this.rail=!1,this.cursor=!1,this.cursorfreezed=!1,this.selectiondrag=!1,this.zoom=!1,this.zoomactive=!1,this.hasfocus=!1,this.hasmousefocus=!1,this.railslocked=!1,this.locked=!1,this.hidden=!1,this.cursoractive=!0,this.wheelprevented=!1,this.overflowx=y.overflowx,this.overflowy=y.overflowy,this.nativescrollingarea=!1,this.checkarea=0,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltax=0,this.lastdeltay=0,this.detected=nt(),w=i.extend({},this.detected),this.canhwscroll=w.hastransform&&y.hwacceleration,this.ishwscroll=this.canhwscroll&&l.haswrapper,this.hasreversehr=this.isrtlmode?this.isvertical?!(w.iswebkit||w.isie||w.isie11):!(w.iswebkit||w.isie&&!w.isie10&&!w.isie11):!1,this.istouchcapable=!1,w.cantouch||!w.hasw3ctouch&&!w.hasmstouch?!w.cantouch||w.isios||w.isandroid||!w.iswebkit&&!w.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0,y.enablemouselockapi||(w.hasmousecapture=!1,w.haspointerlock=!1),this.debounced=function(n,t,i){l&&(l.delaylist[n]||!1||(l.delaylist[n]={h:e(function(){l.delaylist[n].fn.call(l);l.delaylist[n]=!1},i)},t.call(l)),l.delaylist[n].fn=t)},this.synched=function(n,t){l.synclist[n]?l.synclist[n]=t:(l.synclist[n]=t,e(function(){l&&(l.synclist[n]&&l.synclist[n].call(l),l.synclist[n]=null)}))},this.unsynched=function(n){l.synclist[n]&&(l.synclist[n]=!1)},this.css=function(n,t){for(var i in t)l.saved.css.push([n,i,n.css(i)]),n.css(i,t[i])},this.scrollTop=function(n){return void 0===n?l.getScrollTop():l.setScrollTop(n)},this.scrollLeft=function(n){return void 0===n?l.getScrollLeft():l.setScrollLeft(n)},st=function(n,t,i,r,f,e,o){this.st=n;this.ed=t;this.spd=i;this.p1=r||0;this.p2=f||1;this.p3=e||0;this.p4=o||1;this.ts=u();this.df=t-n},(st.prototype={B2:function(n){return 3*(1-n)*(1-n)*n},B3:function(n){return 3*(1-n)*n*n},B4:function(n){return n*n*n},getPos:function(){return(u()-this.ts)/this.spd},getNow:function(){var n=(u()-this.ts)/this.spd,t=this.B2(n)+this.B3(n)+this.B4(n);return n>=1?this.ed:this.st+this.df*t|0},update:function(n,t){return this.st=this.getNow(),this.ed=n,this.spd=t,this.ts=u(),this.df=this.ed-this.st,this}},this.ishwscroll)?(this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},w.hastranslate3d&&w.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getScrollTop=function(n){if(!n){var t=pt();if(t)return 16==t.length?-t[13]:-t[5];if(l.timerscroll&&l.timerscroll.bz)return l.timerscroll.bz.getNow()}return l.doc.translate.y},this.getScrollLeft=function(n){if(!n){var t=pt();if(t)return 16==t.length?-t[12]:-t[4];if(l.timerscroll&&l.timerscroll.bh)return l.timerscroll.bh.getNow()}return l.doc.translate.x},this.notifyScrollEvent=function(n){var i=t.createEvent("UIEvents");i.initUIEvent("scroll",!1,!1,r,1);i.niceevent=!0;n.dispatchEvent(i)},lt=this.isrtlmode?1:-1,w.hastranslate3d&&y.enabletranslate3d?(this.setScrollTop=function(n,t){l.doc.translate.y=n;l.doc.translate.ty=-1*n+"px";l.doc.css(w.trstyle,"translate3d("+l.doc.translate.tx+","+l.doc.translate.ty+",0)");t||l.notifyScrollEvent(l.win[0])},this.setScrollLeft=function(n,t){l.doc.translate.x=n;l.doc.translate.tx=n*lt+"px";l.doc.css(w.trstyle,"translate3d("+l.doc.translate.tx+","+l.doc.translate.ty+",0)");t||l.notifyScrollEvent(l.win[0])}):(this.setScrollTop=function(n,t){l.doc.translate.y=n;l.doc.translate.ty=-1*n+"px";l.doc.css(w.trstyle,"translate("+l.doc.translate.tx+","+l.doc.translate.ty+")");t||l.notifyScrollEvent(l.win[0])},this.setScrollLeft=function(n,t){l.doc.translate.x=n;l.doc.translate.tx=n*lt+"px";l.doc.css(w.trstyle,"translate("+l.doc.translate.tx+","+l.doc.translate.ty+")");t||l.notifyScrollEvent(l.win[0])})):(this.getScrollTop=function(){return l.docscroll.scrollTop()},this.setScrollTop=function(n){l.docscroll.scrollTop(n)},this.getScrollLeft=function(){return l.hasreversehr?l.detected.ismozilla?l.page.maxw-Math.abs(l.docscroll.scrollLeft()):l.page.maxw-l.docscroll.scrollLeft():l.docscroll.scrollLeft()},this.setScrollLeft=function(n){return setTimeout(function(){if(l)return l.hasreversehr&&(n=l.detected.ismozilla?-(l.page.maxw-n):l.page.maxw-n),l.docscroll.scrollLeft(n)},1)}),this.getTarget=function(n){return!!n&&(n.target?n.target:!!n.srcElement&&n.srcElement)},this.hasParent=function(n,t){if(!n)return!1;for(var i=n.target||n.srcElement||n||!1;i&&i.id!=t;)i=i.parentNode||!1;return!1!==i},kt={thin:1,medium:3,thick:5},this.getDocumentScrollOffset=function(){return{top:r.pageYOffset||t.documentElement.scrollTop,left:r.pageXOffset||t.documentElement.scrollLeft}},this.getOffset=function(){var n,i,t,r;return l.isfixed?(n=l.win.offset(),i=l.getDocumentScrollOffset(),n.top-=i.top,n.left-=i.left,n):(t=l.win.offset(),!l.viewport)?t:(r=l.viewport.offset(),{top:t.top-r.top,left:t.left-r.left})},this.updateScrollBar=function(n){var t,i,r,u,f;l.ishwscroll?(l.rail.css({height:l.win.innerHeight()-(y.railpadding.top+y.railpadding.bottom)}),l.railh&&l.railh.css({width:l.win.innerWidth()-(y.railpadding.left+y.railpadding.right)})):(r=l.getOffset(),(t={top:r.top,left:r.left-(y.railpadding.left+y.railpadding.right)},t.top+=rt(l.win,"border-top-width",!0),t.left+=l.rail.align?l.win.outerWidth()-rt(l.win,"border-right-width")-l.rail.width:rt(l.win,"border-left-width"),(i=y.railoffset)&&(i.top&&(t.top+=i.top),i.left&&(t.left+=i.left)),l.railslocked||l.rail.css({top:t.top,left:t.left,height:(n?n.h:l.win.innerHeight())-(y.railpadding.top+y.railpadding.bottom)}),l.zoom&&l.zoom.css({top:t.top+1,left:1==l.rail.align?t.left-20:t.left+l.rail.width+4}),l.railh&&!l.railslocked)&&(t={top:r.top,left:r.left},(i=y.railhoffset)&&(i.top&&(t.top+=i.top),i.left&&(t.left+=i.left)),u=l.railh.align?t.top+rt(l.win,"border-top-width",!0)+l.win.innerHeight()-l.railh.height:t.top+rt(l.win,"border-top-width",!0),f=t.left+rt(l.win,"border-left-width"),l.railh.css({top:u-(y.railpadding.top+y.railpadding.bottom),left:f,width:l.railh.width})))},this.doRailClick=function(n,i,r){var u,e,f,o;l.railslocked||(l.cancelEvent(n),"pageY"in n||(n.pageX=n.clientX+t.documentElement.scrollLeft,n.pageY=n.clientY+t.documentElement.scrollTop),i?(u=r?l.doScrollLeft:l.doScrollTop,f=r?(n.pageX-l.railh.offset().left-l.cursorwidth/2)*l.scrollratio.x:(n.pageY-l.rail.offset().top-l.cursorheight/2)*l.scrollratio.y,l.unsynched("relativexy"),u(0|f)):(u=r?l.doScrollLeftBy:l.doScrollBy,f=r?l.scroll.x:l.scroll.y,o=r?n.pageX-l.railh.offset().left:n.pageY-l.rail.offset().top,e=r?l.view.w:l.view.h,u(f>=o?e:-e)))},l.newscrolly=l.newscrollx=0,l.hasanimationframe="requestAnimationFrame"in r,l.hascancelanimationframe="cancelAnimationFrame"in r,l.hasborderbox=!1,this.init=function(){var v,g,e,n,ot,tt,rt,st,c,u,b,nt,ht,k,ft,ct,lt,h,et;if((l.saved.css=[],w.isoperamini)||w.isandroid&&!("hidden"in t))return!0;if(y.emulatetouch=y.emulatetouch||y.touchbehavior,l.hasborderbox=r.getComputedStyle&&"border-box"===r.getComputedStyle(t.body)["box-sizing"],v={"overflow-y":"hidden"},(w.isie11||w.isie10)&&(v["-ms-overflow-style"]="none"),l.ishwscroll&&(this.doc.css(w.transitionstyle,w.prefixstyle+"transform 0ms ease-out"),w.transitionend&&l.bind(l.doc,w.transitionend,l.onScrollTransitionEnd,!1)),l.zindex="auto",l.zindex=l.ispage||"auto"!=y.zindex?y.zindex:ti()||"auto",!l.ispage&&"auto"!=l.zindex&&l.zindex>s&&(s=l.zindex),l.isie&&0===l.zindex&&"auto"==y.zindex&&(l.zindex="auto"),!l.ispage||!w.isieold){g=l.docscroll;l.ispage&&(g=l.haswrapper?l.win:l.doc);l.css(g,v);l.ispage&&(w.isie11||w.isie)&&l.css(i("html"),v);!w.isios||l.ispage||l.haswrapper||l.css(ut,{"-webkit-overflow-scrolling":"touch"});e=i(t.createElement("div"));e.css({position:"relative",top:0,float:"right",width:y.cursorwidth,height:0,"background-color":y.cursorcolor,border:y.cursorborder,"background-clip":"padding-box","-webkit-border-radius":y.cursorborderradius,"-moz-border-radius":y.cursorborderradius,"border-radius":y.cursorborderradius});e.addClass("nicescroll-cursors");l.cursor=e;n=i(t.createElement("div"));n.attr("id",l.id);n.addClass("nicescroll-rails nicescroll-rails-vr");rt=["left","right","top","bottom"];for(st in rt)tt=rt[st],(ot=y.railpadding[tt]||0)&&n.css("padding-"+tt,ot+"px");n.append(e);n.width=Math.max(parseFloat(y.cursorwidth),e.outerWidth());n.css({width:n.width+"px",zIndex:l.zindex,background:y.background,cursor:"default"});n.visibility=!0;n.scrollable=!0;n.align="left"==y.railalign?0:1;l.rail=n;l.rail.drag=!1;c=!1;!y.boxzoom||l.ispage||w.isieold||(c=t.createElement("div"),l.bind(c,"click",l.doZoom),l.bind(c,"mouseenter",function(){l.zoom.css("opacity",y.cursoropacitymax)}),l.bind(c,"mouseleave",function(){l.zoom.css("opacity",y.cursoropacitymin)}),l.zoom=i(c),l.zoom.css({cursor:"pointer",zIndex:l.zindex,backgroundImage:"url("+y.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"}),y.dblclickzoom&&l.bind(l.win,"dblclick",l.doZoom),w.cantouch&&y.gesturezoom&&(l.ongesturezoom=function(n){return n.scale>1.5&&l.doZoomIn(n),n.scale<.8&&l.doZoomOut(n),l.cancelEvent(n)},l.bind(l.win,"gestureend",l.ongesturezoom)));l.railh=!1;(y.horizrailenabled&&(l.css(g,{overflowX:"hidden"}),(e=i(t.createElement("div"))).css({position:"absolute",top:0,height:y.cursorwidth,width:0,backgroundColor:y.cursorcolor,border:y.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":y.cursorborderradius,"-moz-border-radius":y.cursorborderradius,"border-radius":y.cursorborderradius}),w.isieold&&e.css("overflow","hidden"),e.addClass("nicescroll-cursors"),l.cursorh=e,(u=i(t.createElement("div"))).attr("id",l.id+"-hr"),u.addClass("nicescroll-rails nicescroll-rails-hr"),u.height=Math.max(parseFloat(y.cursorwidth),e.outerHeight()),u.css({height:u.height+"px",zIndex:l.zindex,background:y.background}),u.append(e),u.visibility=!0,u.scrollable=!0,u.align="top"==y.railvalign?0:1,l.railh=u,l.railh.drag=!1),l.ispage)?(n.css({position:"fixed",top:0,height:"100%"}),n.css(n.align?{right:0}:{left:0}),l.body.append(n),l.railh&&(u.css({position:"fixed",left:0,width:"100%"}),u.css(u.align?{bottom:0}:{top:0}),l.body.append(u))):(l.ishwscroll?("static"==l.win.css("position")&&l.css(l.win,{position:"relative"}),b="HTML"==l.win[0].nodeName?l.body:l.win,i(b).scrollTop(0).scrollLeft(0),l.zoom&&(l.zoom.css({position:"absolute",top:1,right:0,"margin-right":n.width+4}),b.append(l.zoom)),n.css({position:"absolute",top:0}),n.css(n.align?{right:0}:{left:0}),b.append(n),u&&(u.css({position:"absolute",left:0,bottom:0}),u.css(u.align?{bottom:0}:{top:0}),b.append(u))):(l.isfixed="fixed"==l.win.css("position"),nt=l.isfixed?"fixed":"absolute",l.isfixed||(l.viewport=l.getViewport(l.win[0])),l.viewport&&(l.body=l.viewport,/fixed|absolute/.test(l.viewport.css("position"))||l.css(l.viewport,{position:"relative"})),n.css({position:nt}),l.zoom&&l.zoom.css({position:nt}),l.updateScrollBar(),l.body.append(n),l.zoom&&l.body.append(l.zoom),l.railh&&(u.css({position:nt}),l.body.append(u))),w.isios&&l.css(l.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),y.disableoutline&&(w.isie&&l.win.attr("hideFocus","true"),w.iswebkit&&l.win.css("outline","none")));(!1===y.autohidemode?(l.autohidedom=!1,l.rail.css({opacity:y.cursoropacitymax}),l.railh&&l.railh.css({opacity:y.cursoropacitymax})):!0===y.autohidemode||"leave"===y.autohidemode?(l.autohidedom=i().add(l.rail),w.isie8&&(l.autohidedom=l.autohidedom.add(l.cursor)),l.railh&&(l.autohidedom=l.autohidedom.add(l.railh)),l.railh&&w.isie8&&(l.autohidedom=l.autohidedom.add(l.cursorh))):"scroll"==y.autohidemode?(l.autohidedom=i().add(l.rail),l.railh&&(l.autohidedom=l.autohidedom.add(l.railh))):"cursor"==y.autohidemode?(l.autohidedom=i().add(l.cursor),l.railh&&(l.autohidedom=l.autohidedom.add(l.cursorh))):"hidden"==y.autohidemode&&(l.autohidedom=!1,l.hide(),l.railslocked=!1),w.cantouch||l.istouchcapable||y.emulatetouch||w.hasmstouch)&&(l.scrollmom=new it(l),l.ontouchstart=function(n){var t,e,r,u;if(l.locked||n.pointerType&&("mouse"===n.pointerType||n.pointerType===n.MSPOINTER_TYPE_MOUSE))return!1;if(l.hasmoving=!1,l.scrollmom.timer&&(l.triggerScrollEnd(),l.scrollmom.stop()),!l.railslocked){if(t=l.getTarget(n),t&&/INPUT/i.test(t.nodeName)&&/range/i.test(t.type))return l.stopPropagation(n);if(e="mousedown"===n.type,(!("clientX"in n)&&"changedTouches"in n&&(n.clientX=n.changedTouches[0].clientX,n.clientY=n.changedTouches[0].clientY),l.forcescreen)&&(r=n,(n={original:n.original?n.original:n}).clientX=r.screenX,n.clientY=r.screenY),l.rail.drag={x:n.clientX,y:n.clientY,sx:l.scroll.x,sy:l.scroll.y,st:l.getScrollTop(),sl:l.getScrollLeft(),pt:2,dl:!1,tg:t},l.ispage||!y.directionlockdeadzone)l.rail.drag.dl="f";else{var o={w:f.width(),h:f.height()},s=l.getContentSize(),h=s.h-o.h,c=s.w-o.w;l.rail.drag.ck=l.rail.scrollable&&!l.railh.scrollable?h>0&&"v":!l.rail.scrollable&&l.railh.scrollable?c>0&&"h":!1}if(y.emulatetouch&&l.isiframe&&w.isie&&(u=l.win.position(),l.rail.drag.x+=u.left,l.rail.drag.y+=u.top),l.hasmoving=!1,l.lastmouseup=!1,l.scrollmom.reset(n.clientX,n.clientY),t&&e){if(!/INPUT|SELECT|BUTTON|TEXTAREA/i.test(t.nodeName))return w.hasmousecapture&&t.setCapture(),y.emulatetouch?(t.onclick&&!t._onclick&&(t._onclick=t.onclick,t.onclick=function(n){if(l.hasmoving)return!1;t._onclick.call(this,n)}),l.cancelEvent(n)):l.stopPropagation(n);/SUBMIT|CANCEL|BUTTON/i.test(i(t).attr("type"))&&(l.preventclick={tg:t,click:!1})}}},l.ontouchend=function(n){if(!l.rail.drag)return!0;if(2==l.rail.drag.pt){if(n.pointerType&&("mouse"===n.pointerType||n.pointerType===n.MSPOINTER_TYPE_MOUSE))return!1;l.rail.drag=!1;var i="mouseup"===n.type;if(l.hasmoving&&(l.scrollmom.doMomentum(),l.lastmouseup=!0,l.hideCursor(),w.hasmousecapture&&t.releaseCapture(),i))return l.cancelEvent(n)}else if(1==l.rail.drag.pt)return l.onmouseup(n)},ht=y.emulatetouch&&l.isiframe&&!w.hasmousecapture,k=.3*y.directionlockdeadzone|0,l.ontouchmove=function(n,i){var c,a,v,r;if(!l.rail.drag||n.targetTouches&&y.preventmultitouchscrolling&&n.targetTouches.length>1||n.pointerType&&("mouse"===n.pointerType||n.pointerType===n.MSPOINTER_TYPE_MOUSE))return!0;if(2==l.rail.drag.pt){"changedTouches"in n&&(n.clientX=n.changedTouches[0].clientX,n.clientY=n.changedTouches[0].clientY);(a=c=0,ht&&!i)&&(v=l.win.position(),a=-v.left,c=-v.top);var s=n.clientY+c,b=s-l.rail.drag.y,h=n.clientX+a,p=h-l.rail.drag.x,u=l.rail.drag.st-b;if(l.ishwscroll&&y.bouncescroll)u<0?u=Math.round(u/2):u>l.page.maxh&&(u=l.page.maxh+Math.round((u-l.page.maxh)/2));else if(u<0?(u=0,s=0):u>l.page.maxh&&(u=l.page.maxh,s=0),0===s&&!l.hasmoving)return l.ispage||(l.rail.drag=!1),!0;if(r=l.getScrollLeft(),l.railh&&l.railh.scrollable&&(r=l.isrtlmode?p-l.rail.drag.sl:l.rail.drag.sl-p,l.ishwscroll&&y.bouncescroll?r<0?r=Math.round(r/2):r>l.page.maxw&&(r=l.page.maxw+Math.round((r-l.page.maxw)/2)):(r<0&&(r=0,h=0),r>l.page.maxw&&(r=l.page.maxw,h=0))),!l.hasmoving){if(l.rail.drag.y===n.clientY&&l.rail.drag.x===n.clientX)return l.cancelEvent(n);var e=Math.abs(b),o=Math.abs(p),f=y.directionlockdeadzone;if(l.rail.drag.ck?"v"==l.rail.drag.ck?o>f&&e<=k?l.rail.drag=!1:e>f&&(l.rail.drag.dl="v"):"h"==l.rail.drag.ck&&(e>f&&o<=k?l.rail.drag=!1:o>f&&(l.rail.drag.dl="h")):e>f&&o>f?l.rail.drag.dl="f":e>f?l.rail.drag.dl=o>k?"f":"v":o>f&&(l.rail.drag.dl=e>k?"f":"h"),!l.rail.drag.dl)return l.cancelEvent(n);l.triggerScrollStart(n.clientX,n.clientY,0,0,0);l.hasmoving=!0}return l.preventclick&&!l.preventclick.click&&(l.preventclick.click=l.preventclick.tg.onclick||!1,l.preventclick.tg.onclick=l.onpreventclick),l.rail.drag.dl&&("v"==l.rail.drag.dl?r=l.rail.drag.sl:"h"==l.rail.drag.dl&&(u=l.rail.drag.st)),l.synched("touchmove",function(){l.rail.drag&&2==l.rail.drag.pt&&(l.prepareTransition&&l.resetTransition(),l.rail.scrollable&&l.setScrollTop(u),l.scrollmom.update(h,s),l.railh&&l.railh.scrollable?(l.setScrollLeft(r),l.showCursor(u,r)):l.showCursor(u),w.isie10&&t.selection.clear())}),l.cancelEvent(n)}if(1==l.rail.drag.pt)return l.onmousemove(n)},l.ontouchstartCursor=function(n,t){if(!l.rail.drag||3==l.rail.drag.pt){if(l.locked)return l.cancelEvent(n);l.cancelScroll();l.rail.drag={x:n.touches[0].clientX,y:n.touches[0].clientY,sx:l.scroll.x,sy:l.scroll.y,pt:3,hr:!!t};var i=l.getTarget(n);return!l.ispage&&w.hasmousecapture&&i.setCapture(),l.isiframe&&!w.hasmousecapture&&(l.saved.csspointerevents=l.doc.css("pointer-events"),l.css(l.doc,{"pointer-events":"none"})),l.cancelEvent(n)}},l.ontouchendCursor=function(n){if(l.rail.drag)return(w.hasmousecapture&&t.releaseCapture(),l.isiframe&&!w.hasmousecapture&&l.doc.css("pointer-events",l.saved.csspointerevents),3!=l.rail.drag.pt)?void 0:(l.rail.drag=!1,l.cancelEvent(n))},l.ontouchmoveCursor=function(n){var t,i;if(l.rail.drag)return 3!=l.rail.drag.pt?void 0:((l.cursorfreezed=!0,l.rail.drag.hr)?(l.scroll.x=l.rail.drag.sx+(n.touches[0].clientX-l.rail.drag.x),l.scroll.x<0&&(l.scroll.x=0),t=l.scrollvaluemaxw,l.scroll.x>t&&(l.scroll.x=t)):(l.scroll.y=l.rail.drag.sy+(n.touches[0].clientY-l.rail.drag.y),l.scroll.y<0&&(l.scroll.y=0),i=l.scrollvaluemax,l.scroll.y>i&&(l.scroll.y=i)),l.synched("touchmove",function(){l.rail.drag&&3==l.rail.drag.pt&&(l.showCursor(),l.rail.drag.hr?l.doScrollLeft(Math.round(l.scroll.x*l.scrollratio.x),y.cursordragspeed):l.doScrollTop(Math.round(l.scroll.y*l.scrollratio.y),y.cursordragspeed))}),l.cancelEvent(n))});(l.onmousedown=function(n,t){if(!l.rail.drag||1==l.rail.drag.pt){if(l.railslocked)return l.cancelEvent(n);l.cancelScroll();l.rail.drag={x:n.clientX,y:n.clientY,sx:l.scroll.x,sy:l.scroll.y,pt:1,hr:t||!1};var i=l.getTarget(n);return w.hasmousecapture&&i.setCapture(),l.isiframe&&!w.hasmousecapture&&(l.saved.csspointerevents=l.doc.css("pointer-events"),l.css(l.doc,{"pointer-events":"none"})),l.hasmoving=!1,l.cancelEvent(n)}},l.onmouseup=function(n){if(l.rail.drag)return 1!=l.rail.drag.pt||(w.hasmousecapture&&t.releaseCapture(),l.isiframe&&!w.hasmousecapture&&l.doc.css("pointer-events",l.saved.csspointerevents),l.rail.drag=!1,l.cursorfreezed=!1,l.hasmoving&&l.triggerScrollEnd(),l.cancelEvent(n))},l.onmousemove=function(n){var t,i;if(l.rail.drag)return 1!==l.rail.drag.pt?void 0:w.ischrome&&0===n.which?l.onmouseup(n):((l.cursorfreezed=!0,l.hasmoving||l.triggerScrollStart(n.clientX,n.clientY,0,0,0),l.hasmoving=!0,l.rail.drag.hr)?(l.scroll.x=l.rail.drag.sx+(n.clientX-l.rail.drag.x),l.scroll.x<0&&(l.scroll.x=0),t=l.scrollvaluemaxw,l.scroll.x>t&&(l.scroll.x=t)):(l.scroll.y=l.rail.drag.sy+(n.clientY-l.rail.drag.y),l.scroll.y<0&&(l.scroll.y=0),i=l.scrollvaluemax,l.scroll.y>i&&(l.scroll.y=i)),l.synched("mousemove",function(){l.cursorfreezed&&(l.showCursor(),l.rail.drag.hr?l.scrollLeft(Math.round(l.scroll.x*l.scrollratio.x)):l.scrollTop(Math.round(l.scroll.y*l.scrollratio.y)))}),l.cancelEvent(n));l.checkarea=0},w.cantouch||y.emulatetouch)?(l.onpreventclick=function(n){if(l.preventclick)return l.preventclick.tg.onclick=l.preventclick.click,l.preventclick=!1,l.cancelEvent(n)},l.onclick=!w.isios&&function(n){return!l.lastmouseup||(l.lastmouseup=!1,l.cancelEvent(n))},y.grabcursorenabled&&w.cursorgrabvalue&&(l.css(l.ispage?l.doc:l.win,{cursor:w.cursorgrabvalue}),l.css(l.rail,{cursor:w.cursorgrabvalue}))):(ft=function(n){var i,t,r;l.selectiondrag&&(n&&(i=l.win.outerHeight(),t=n.pageY-l.selectiondrag.top,t>0&&t<i&&(t=0),t>=i&&(t-=i),l.selectiondrag.df=t),0!==l.selectiondrag.df&&(r=l.selectiondrag.df/-3|0,l.doScrollBy(r),l.debounced("doselectionscroll",function(){ft()},50)))},l.hasTextSelected="getSelection"in t?function(){return t.getSelection().rangeCount>0}:"selection"in t?function(){return"None"!=t.selection.type}:function(){return!1},l.onselectionstart=function(){l.ispage||(l.selectiondrag=l.win.offset())},l.onselectionend=function(){l.selectiondrag=!1},l.onselectiondrag=function(n){l.selectiondrag&&l.hasTextSelected()&&l.debounced("selectionscroll",function(){ft(n)},250)});(w.hasw3ctouch?(l.css(l.ispage?i("html"):l.win,{"touch-action":"none"}),l.css(l.rail,{"touch-action":"none"}),l.css(l.cursor,{"touch-action":"none"}),l.bind(l.win,"pointerdown",l.ontouchstart),l.bind(t,"pointerup",l.ontouchend),l.delegate(t,"pointermove",l.ontouchmove)):w.hasmstouch?(l.css(l.ispage?i("html"):l.win,{"-ms-touch-action":"none"}),l.css(l.rail,{"-ms-touch-action":"none"}),l.css(l.cursor,{"-ms-touch-action":"none"}),l.bind(l.win,"MSPointerDown",l.ontouchstart),l.bind(t,"MSPointerUp",l.ontouchend),l.delegate(t,"MSPointerMove",l.ontouchmove),l.bind(l.cursor,"MSGestureHold",function(n){n.preventDefault()}),l.bind(l.cursor,"contextmenu",function(n){n.preventDefault()})):w.cantouch&&(l.bind(l.win,"touchstart",l.ontouchstart,!1,!0),l.bind(t,"touchend",l.ontouchend,!1,!0),l.bind(t,"touchcancel",l.ontouchend,!1,!0),l.delegate(t,"touchmove",l.ontouchmove,!1,!0)),y.emulatetouch&&(l.bind(l.win,"mousedown",l.ontouchstart,!1,!0),l.bind(t,"mouseup",l.ontouchend,!1,!0),l.bind(t,"mousemove",l.ontouchmove,!1,!0)),(y.cursordragontouch||!w.cantouch&&!y.emulatetouch)&&(l.rail.css({cursor:"default"}),l.railh&&l.railh.css({cursor:"default"}),l.jqbind(l.rail,"mouseenter",function(){if(!l.ispage&&!l.win.is(":visible"))return!1;l.canshowonmouseevent&&l.showCursor();l.rail.active=!0}),l.jqbind(l.rail,"mouseleave",function(){l.rail.active=!1;l.rail.drag||l.hideCursor()}),y.sensitiverail&&(l.bind(l.rail,"click",function(n){l.doRailClick(n,!1,!1)}),l.bind(l.rail,"dblclick",function(n){l.doRailClick(n,!0,!1)}),l.bind(l.cursor,"click",function(n){l.cancelEvent(n)}),l.bind(l.cursor,"dblclick",function(n){l.cancelEvent(n)})),l.railh&&(l.jqbind(l.railh,"mouseenter",function(){if(!l.ispage&&!l.win.is(":visible"))return!1;l.canshowonmouseevent&&l.showCursor();l.rail.active=!0}),l.jqbind(l.railh,"mouseleave",function(){l.rail.active=!1;l.rail.drag||l.hideCursor()}),y.sensitiverail&&(l.bind(l.railh,"click",function(n){l.doRailClick(n,!1,!0)}),l.bind(l.railh,"dblclick",function(n){l.doRailClick(n,!0,!0)}),l.bind(l.cursorh,"click",function(n){l.cancelEvent(n)}),l.bind(l.cursorh,"dblclick",function(n){l.cancelEvent(n)})))),y.cursordragontouch&&(this.istouchcapable||w.cantouch)&&(l.bind(l.cursor,"touchstart",l.ontouchstartCursor),l.bind(l.cursor,"touchmove",l.ontouchmoveCursor),l.bind(l.cursor,"touchend",l.ontouchendCursor),l.cursorh&&l.bind(l.cursorh,"touchstart",function(n){l.ontouchstartCursor(n,!0)}),l.cursorh&&l.bind(l.cursorh,"touchmove",l.ontouchmoveCursor),l.cursorh&&l.bind(l.cursorh,"touchend",l.ontouchendCursor)),y.emulatetouch||w.isandroid||w.isios?(l.bind(w.hasmousecapture?l.win:t,"mouseup",l.ontouchend),l.onclick&&l.bind(t,"click",l.onclick),y.cursordragontouch?(l.bind(l.cursor,"mousedown",l.onmousedown),l.bind(l.cursor,"mouseup",l.onmouseup),l.cursorh&&l.bind(l.cursorh,"mousedown",function(n){l.onmousedown(n,!0)}),l.cursorh&&l.bind(l.cursorh,"mouseup",l.onmouseup)):(l.bind(l.rail,"mousedown",function(n){n.preventDefault()}),l.railh&&l.bind(l.railh,"mousedown",function(n){n.preventDefault()}))):(l.bind(w.hasmousecapture?l.win:t,"mouseup",l.onmouseup),l.bind(t,"mousemove",l.onmousemove),l.onclick&&l.bind(t,"click",l.onclick),l.bind(l.cursor,"mousedown",l.onmousedown),l.bind(l.cursor,"mouseup",l.onmouseup),l.railh&&(l.bind(l.cursorh,"mousedown",function(n){l.onmousedown(n,!0)}),l.bind(l.cursorh,"mouseup",l.onmouseup)),!l.ispage&&y.enablescrollonselection&&(l.bind(l.win[0],"mousedown",l.onselectionstart),l.bind(t,"mouseup",l.onselectionend),l.bind(l.cursor,"mouseup",l.onselectionend),l.cursorh&&l.bind(l.cursorh,"mouseup",l.onselectionend),l.bind(t,"mousemove",l.onselectiondrag)),l.zoom&&(l.jqbind(l.zoom,"mouseenter",function(){l.canshowonmouseevent&&l.showCursor();l.rail.active=!0}),l.jqbind(l.zoom,"mouseleave",function(){l.rail.active=!1;l.rail.drag||l.hideCursor()}))),y.enablemousewheel&&(l.isiframe||l.mousewheel(w.isie&&l.ispage?t:l.win,l.onmousewheel),l.mousewheel(l.rail,l.onmousewheel),l.railh&&l.mousewheel(l.railh,l.onmousewheelhr)),l.ispage||w.cantouch||/HTML|^BODY/.test(l.win[0].nodeName)||(l.win.attr("tabindex")||l.win.attr({tabindex:++d}),l.bind(l.win,"focus",function(n){a=l.getTarget(n).id||l.getTarget(n)||!1;l.hasfocus=!0;l.canshowonmouseevent&&l.noticeCursor()}),l.bind(l.win,"blur",function(){a=!1;l.hasfocus=!1}),l.bind(l.win,"mouseenter",function(n){p=l.getTarget(n).id||l.getTarget(n)||!1;l.hasmousefocus=!0;l.canshowonmouseevent&&l.noticeCursor()}),l.bind(l.win,"mouseleave",function(){p=!1;l.hasmousefocus=!1;l.rail.drag||l.hideCursor()})),l.onkeypress=function(n){var u,e;if(l.railslocked&&0===l.page.maxh||(n=n||r.event,u=l.getTarget(n),u&&/INPUT|TEXTAREA|SELECT|OPTION/.test(u.nodeName)&&(!(u.getAttribute("type")||u.type||!1)||!/submit|button|cancel/i.tp))||i(u).attr("contenteditable"))return!0;if(l.hasfocus||l.hasmousefocus&&!a||l.ispage&&!a&&!p){if(e=n.keyCode,l.railslocked&&27!=e)return l.cancelEvent(n);var f=n.ctrlKey||!1,o=n.shiftKey||!1,t=!1;switch(e){case 38:case 63233:l.doScrollBy(72);t=!0;break;case 40:case 63235:l.doScrollBy(-72);t=!0;break;case 37:case 63232:l.railh&&(f?l.doScrollLeft(0):l.doScrollLeftBy(72),t=!0);break;case 39:case 63234:l.railh&&(f?l.doScrollLeft(l.page.maxw):l.doScrollLeftBy(-72),t=!0);break;case 33:case 63276:l.doScrollBy(l.view.h);t=!0;break;case 34:case 63277:l.doScrollBy(-l.view.h);t=!0;break;case 36:case 63273:l.railh&&f?l.doScrollPos(0,0):l.doScrollTo(0);t=!0;break;case 35:case 63275:l.railh&&f?l.doScrollPos(l.page.maxw,l.page.maxh):l.doScrollTo(l.page.maxh);t=!0;break;case 32:y.spacebarenabled&&(o?l.doScrollBy(l.view.h):l.doScrollBy(-l.view.h),t=!0);break;case 27:l.zoomactive&&(l.doZoom(),t=!0)}if(t)return l.cancelEvent(n)}},y.enablekeyboard&&l.bind(t,w.isopera&&!w.isopera12?"keypress":"keydown",l.onkeypress),l.bind(t,"keydown",function(n){(n.ctrlKey||!1)&&(l.wheelprevented=!0)}),l.bind(t,"keyup",function(n){n.ctrlKey||!1||(l.wheelprevented=!1)}),l.bind(r,"blur",function(){l.wheelprevented=!1}),l.bind(r,"resize",l.onscreenresize),l.bind(r,"orientationchange",l.onscreenresize),l.bind(r,"load",l.lazyResize),!w.ischrome||l.ispage||l.haswrapper)||(ct=l.win.attr("style"),lt=parseFloat(l.win.css("width"))+1,l.win.css("width",lt),l.synched("chromefix",function(){l.win.attr("style",ct)}));(l.onAttributeChange=function(){l.lazyResize(l.isieold?250:30)},!y.enableobserver||(l.isie11||!1===o||(l.observerbody=new o(function(n){if(n.forEach(function(n){if("attributes"==n.type)return ut.hasClass("modal-open")&&ut.hasClass("modal-dialog")&&!i.contains(i(".modal-dialog")[0],l.doc[0])?l.hide():l.show()}),l.me.clientWidth!=l.page.width||l.me.clientHeight!=l.page.height)return l.lazyResize(30)}),l.observerbody.observe(t.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),l.ispage||l.haswrapper))||(h=l.win[0],!1!==o?(l.observer=new o(function(n){n.forEach(l.onAttributeChange)}),l.observer.observe(h,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),l.observerremover=new o(function(n){n.forEach(function(n){if(n.removedNodes.length>0)for(var t in n.removedNodes)if(l&&n.removedNodes[t]===h)return l.remove()})}),l.observerremover.observe(h.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(l.bind(h,w.isie&&!w.isie9?"propertychange":"DOMAttrModified",l.onAttributeChange),w.isie9&&h.attachEvent("onpropertychange",l.onAttributeChange),l.bind(h,"DOMNodeRemoved",function(n){n.target===h&&l.remove()})));!l.ispage&&y.boxzoom&&l.bind(r,"resize",l.resizeZoom);l.istextarea&&(l.bind(l.win,"keydown",l.lazyResize),l.bind(l.win,"mouseup",l.lazyResize));l.lazyResize(30)}"IFRAME"==this.doc[0].nodeName&&(et=function(){var n,t;l.iframexd=!1;try{(n="contentDocument"in this?this.contentDocument:this.contentWindow._doc).domain}catch(v){l.iframexd=!0;n=!1}if(l.iframexd)return"console"in r&&console.log("NiceScroll error: policy restriced iframe"),!0;(l.forcescreen=!0,l.isiframe&&(l.iframe={doc:i(n),html:l.doc.contents().find("html")[0],body:l.doc.contents().find("body")[0]},l.getContentSize=function(){return{w:Math.max(l.iframe.html.scrollWidth,l.iframe.body.scrollWidth),h:Math.max(l.iframe.html.scrollHeight,l.iframe.body.scrollHeight)}},l.docscroll=i(l.iframe.body)),w.isios||!y.iframeautoresize||l.isiframe)||(l.win.scrollTop(0),l.doc.height(""),t=Math.max(n.getElementsByTagName("html")[0].scrollHeight,n.body.scrollHeight),l.doc.height(t));l.lazyResize(30);l.css(i(l.iframe.body),v);w.isios&&l.haswrapper&&l.css(i(n.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?l.bind(this.contentWindow,"scroll",l.onscroll):l.bind(n,"scroll",l.onscroll);y.enablemousewheel&&l.mousewheel(n,l.onmousewheel);y.enablekeyboard&&l.bind(n,w.isopera?"keypress":"keydown",l.onkeypress);w.cantouch?(l.bind(n,"touchstart",l.ontouchstart),l.bind(n,"touchmove",l.ontouchmove)):y.emulatetouch&&(l.bind(n,"mousedown",l.ontouchstart),l.bind(n,"mousemove",function(n){return l.ontouchmove(n,!0)}),y.grabcursorenabled&&w.cursorgrabvalue&&l.css(i(n.body),{cursor:w.cursorgrabvalue}));l.bind(n,"mouseup",l.ontouchend);l.zoom&&(y.dblclickzoom&&l.bind(n,"dblclick",l.doZoom),l.ongesturezoom&&l.bind(n,"gestureend",l.ongesturezoom))},this.doc[0].readyState&&"complete"===this.doc[0].readyState&&setTimeout(function(){et.call(l.doc[0],!1)},500),l.bind(this.doc,"load",et))},this.showCursor=function(n,t){if(l.cursortimeout&&(clearTimeout(l.cursortimeout),l.cursortimeout=0),l.rail){if(l.autohidedom&&(l.autohidedom.stop().css({opacity:y.cursoropacitymax}),l.cursoractive=!0),l.rail.drag&&1==l.rail.drag.pt||(void 0!==n&&!1!==n&&(l.scroll.y=n/l.scrollratio.y|0),void 0!==t&&(l.scroll.x=t/l.scrollratio.x|0)),l.cursor.css({height:l.cursorheight,top:l.scroll.y}),l.cursorh){var i=l.hasreversehr?l.scrollvaluemaxw-l.scroll.x:l.scroll.x;l.cursorh.css({width:l.cursorwidth,left:!l.rail.align&&l.rail.visibility?i+l.rail.width:i});l.cursoractive=!0}l.zoom&&l.zoom.stop().css({opacity:y.cursoropacitymax})}},this.hideCursor=function(n){l.cursortimeout||l.rail&&l.autohidedom&&(l.hasmousefocus&&"leave"===y.autohidemode||(l.cursortimeout=setTimeout(function(){l.rail.active&&l.showonmouseevent||(l.autohidedom.stop().animate({opacity:y.cursoropacitymin}),l.zoom&&l.zoom.stop().animate({opacity:y.cursoropacitymin}),l.cursoractive=!1);l.cursortimeout=0},n||y.hidecursordelay)))},this.noticeCursor=function(n,t,i){l.showCursor(t,i);l.rail.active||l.hideCursor(n)},this.getContentSize=l.ispage?function(){return{w:Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),h:Math.max(t.body.scrollHeight,t.documentElement.scrollHeight)}}:l.haswrapper?function(){return{w:l.doc[0].offsetWidth,h:l.doc[0].offsetHeight}}:function(){return{w:l.docscroll[0].scrollWidth,h:l.docscroll[0].scrollHeight}},this.onResize=function(n,t){var i,r;if(!l||!l.win)return!1;var u=l.page.maxh,f=l.page.maxw,e=l.view.h,o=l.view.w;if(l.view={w:l.ispage?l.win.width():l.win[0].clientWidth,h:l.ispage?l.win.height():l.win[0].clientHeight},l.page=t||l.getContentSize(),l.page.maxh=Math.max(0,l.page.h-l.view.h),l.page.maxw=Math.max(0,l.page.w-l.view.w),l.page.maxh==u&&l.page.maxw==f&&l.view.w==o&&l.view.h==e){if(l.ispage||(i=l.win.offset(),l.lastposition&&(r=l.lastposition,r.top==i.top&&r.left==i.left)))return l;l.lastposition=i}return 0===l.page.maxh?(l.hideRail(),l.scrollvaluemax=0,l.scroll.y=0,l.scrollratio.y=0,l.cursorheight=0,l.setScrollTop(0),l.rail&&(l.rail.scrollable=!1)):(l.page.maxh-=y.railpadding.top+y.railpadding.bottom,l.rail.scrollable=!0),0===l.page.maxw?(l.hideRailHr(),l.scrollvaluemaxw=0,l.scroll.x=0,l.scrollratio.x=0,l.cursorwidth=0,l.setScrollLeft(0),l.railh&&(l.railh.scrollable=!1)):(l.page.maxw-=y.railpadding.left+y.railpadding.right,l.railh&&(l.railh.scrollable=y.horizrailenabled)),l.railslocked=l.locked||0===l.page.maxh&&0===l.page.maxw,l.railslocked?(l.ispage||l.updateScrollBar(l.view),!1):(l.hidden||(l.rail.visibility||l.showRail(),l.railh&&!l.railh.visibility&&l.showRailHr()),l.istextarea&&l.win.css("resize")&&"none"!=l.win.css("resize")&&(l.view.h-=20),l.cursorheight=Math.min(l.view.h,Math.round(l.view.h*(l.view.h/l.page.h))),l.cursorheight=y.cursorfixedheight?y.cursorfixedheight:Math.max(y.cursorminheight,l.cursorheight),l.cursorwidth=Math.min(l.view.w,Math.round(l.view.w*(l.view.w/l.page.w))),l.cursorwidth=y.cursorfixedheight?y.cursorfixedheight:Math.max(y.cursorminheight,l.cursorwidth),l.scrollvaluemax=l.view.h-l.cursorheight-(y.railpadding.top+y.railpadding.bottom),l.hasborderbox||(l.scrollvaluemax-=l.cursor[0].offsetHeight-l.cursor[0].clientHeight),l.railh&&(l.railh.width=l.page.maxh>0?l.view.w-l.rail.width:l.view.w,l.scrollvaluemaxw=l.railh.width-l.cursorwidth-(y.railpadding.left+y.railpadding.right)),l.ispage||l.updateScrollBar(l.view),l.scrollratio={x:l.page.maxw/l.scrollvaluemaxw,y:l.page.maxh/l.scrollvaluemax},l.getScrollTop()>l.page.maxh?l.doScrollTop(l.page.maxh):(l.scroll.y=l.getScrollTop()/l.scrollratio.y|0,l.scroll.x=l.getScrollLeft()/l.scrollratio.x|0,l.cursoractive&&l.noticeCursor()),l.scroll.y&&0===l.getScrollTop()&&l.doScrollTo(l.scroll.y*l.scrollratio.y|0),l)},this.resize=l.onResize,tt=0,this.onscreenresize=function(){clearTimeout(tt);var n=!l.ispage&&!l.haswrapper;n&&l.hideRails();tt=setTimeout(function(){l&&(n&&l.showRails(),l.resize());tt=0},120)},this.lazyResize=function(n){return clearTimeout(tt),n=isNaN(n)?240:n,tt=setTimeout(function(){l&&l.resize();tt=0},n),l},this.jqbind=function(n,t,r){l.events.push({e:n,n:t,f:r,q:!0});i(n).on(t,r)},this.mousewheel=function(n,i,r){var u="jquery"in n?n[0]:n,f;"onwheel"in t.createElement("div")?l._bind(u,"wheel",i,r||!1):(f=void 0!==t.onmousewheel?"mousewheel":"DOMMouseScroll",wt(u,f,i,r||!1),"DOMMouseScroll"==f&&wt(u,"MozMousePixelScroll",i,r||!1))},at=!1,w.haseventlistener){try{dt=Object.defineProperty({},"passive",{get:function(){at=!0}});r.addEventListener("test",null,dt)}catch(n){}this.stopPropagation=function(n){return!!n&&((n=n.original?n.original:n).stopPropagation(),!1)};this.cancelEvent=function(n){return n.cancelable&&n.preventDefault(),n.stopImmediatePropagation(),n.preventManipulation&&n.preventManipulation(),!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},r.constructor.prototype.addEventListener=t.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(n,t){this.attachEvent("on"+n,t)},r.constructor.prototype.removeEventListener=t.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(n,t){this.detachEvent("on"+n,t)},this.cancelEvent=function(n){return(n=n||r.event)&&(n.cancelBubble=!0,n.cancel=!0,n.returnValue=!1),!1},this.stopPropagation=function(n){return(n=n||r.event)&&(n.cancelBubble=!0),!1};this.delegate=function(n,t,i,r,u){var f=h[t]||!1;f||(f={a:[],l:[],f:function(n){for(var i=f.l,r=!1,t=i.length-1;t>=0;t--)if(!1===(r=i[t].call(n.target,n)))return!1;return r}},l.bind(n,t,f.f,r,u),h[t]=f);l.ispage?(f.a=[l.id].concat(f.a),f.l=[i].concat(f.l)):(f.a.push(l.id),f.l.push(i))};this.undelegate=function(n,t){var i=h[t]||!1,r,u;if(i&&i.l)for(r=0,u=i.l.length;r<u;r++)i.a[r]===l.id&&(i.a.splice(r),i.l.splice(r),0===i.a.length&&(l._unbind(n,t,i.l.f),h[t]=null))};this.bind=function(n,t,i,r,u){var f="jquery"in n?n[0]:n;l._bind(f,t,i,r||!1,u||!1)};this._bind=function(n,t,i,r,u){l.events.push({e:n,n:t,f:i,b:r,q:!1});at&&u?n.addEventListener(t,i,{passive:!1,capture:r}):n.addEventListener(t,i,r||!1)};this._unbind=function(n,t,i,r){h[t]?l.undelegate(n,t,i,r):n.removeEventListener(t,i,r)};this.unbindAll=function(){for(var n,t=0;t<l.events.length;t++)n=l.events[t],n.q?n.e.unbind(n.n,n.f):l._unbind(n.e,n.n,n.f,n.b)};this.showRails=function(){return l.showRail().showRailHr()};this.showRail=function(){return 0===l.page.maxh||!l.ispage&&"none"==l.win.css("display")||(l.rail.visibility=!0,l.rail.css("display","block")),l};this.showRailHr=function(){return l.railh&&(0===l.page.maxw||!l.ispage&&"none"==l.win.css("display")||(l.railh.visibility=!0,l.railh.css("display","block"))),l};this.hideRails=function(){return l.hideRail().hideRailHr()};this.hideRail=function(){return l.rail.visibility=!1,l.rail.css("display","none"),l};this.hideRailHr=function(){return l.railh&&(l.railh.visibility=!1,l.railh.css("display","none")),l};this.show=function(){return l.hidden=!1,l.railslocked=!1,l.showRails()};this.hide=function(){return l.hidden=!0,l.railslocked=!0,l.hideRails()};this.toggle=function(){return l.hidden?l.show():l.hide()};this.remove=function(){var u,r,t,n,f;l.stop();l.cursortimeout&&clearTimeout(l.cursortimeout);for(u in l.delaylist)l.delaylist[u]&&v(l.delaylist[u].h);for(l.doZoomOut(),l.unbindAll(),w.isie9&&l.win[0].detachEvent("onpropertychange",l.onAttributeChange),!1!==l.observer&&l.observer.disconnect(),!1!==l.observerremover&&l.observerremover.disconnect(),!1!==l.observerbody&&l.observerbody.disconnect(),l.events=null,l.cursor&&l.cursor.remove(),l.cursorh&&l.cursorh.remove(),l.rail&&l.rail.remove(),l.railh&&l.railh.remove(),l.zoom&&l.zoom.remove(),r=0;r<l.saved.css.length;r++)t=l.saved.css[r],t[0].css(t[1],void 0===t[2]?"":t[2]);l.saved=!1;l.me.data("__nicescroll","");n=i.nicescroll;n.each(function(t){if(this&&this.id===l.id){delete n[t];for(var i=++t;i<n.length;i++,t++)n[t]=n[i];--n.length&&delete n[n.length]}});for(f in l)l[f]=null,delete l[f];l=null};this.scrollstart=function(n){return this.onscrollstart=n,l};this.scrollend=function(n){return this.onscrollend=n,l};this.scrollcancel=function(n){return this.onscrollcancel=n,l};this.zoomin=function(n){return this.onzoomin=n,l};this.zoomout=function(n){return this.onzoomout=n,l};this.isScrollable=function(n){var t=n.target?n.target:n,r,u;if("OPTION"==t.nodeName)return!0;for(;t&&1==t.nodeType&&t!==this.me[0]&&!/^BODY|HTML/.test(t.nodeName);){if(r=i(t),u=r.css("overflowY")||r.css("overflowX")||r.css("overflow")||"",/scroll|auto/.test(u))return t.clientHeight!=t.scrollHeight;t=!!t.parentNode&&t.parentNode}return!1};this.getViewport=function(n){for(var r,u,t=!(!n||!n.parentNode)&&n.parentNode;t&&1==t.nodeType&&!/^BODY|HTML/.test(t.nodeName);){if((r=i(t),/fixed|absolute/.test(r.css("position")))||(u=r.css("overflowY")||r.css("overflowX")||r.css("overflow")||"",/scroll|auto/.test(u)&&t.clientHeight!=t.scrollHeight)||r.getNiceScroll().length>0)return r;t=!!t.parentNode&&t.parentNode}return!1};this.triggerScrollStart=function(n,t,i,r,u){if(l.onscrollstart){var f={type:"scrollstart",current:{x:n,y:t},request:{x:i,y:r},end:{x:l.newscrollx,y:l.newscrolly},speed:u};l.onscrollstart.call(l,f)}};this.triggerScrollEnd=function(){if(l.onscrollend){var n=l.getScrollLeft(),t=l.getScrollTop(),i={type:"scrollend",current:{x:n,y:t},end:{x:n,y:t}};l.onscrollend.call(l,i)}};var gt=0,ni=0,vt=0,et=1,yt=!1;(this.onmousewheel=function(n){var t,i,r;return l.wheelprevented||l.locked?!1:l.railslocked?(l.debounced("checkunlock",l.resize,250),!1):l.rail.drag?l.cancelEvent(n):("auto"===y.oneaxismousemode&&0!==n.deltaX&&(y.oneaxismousemode=!1),y.oneaxismousemode&&0===n.deltaX&&!l.rail.scrollable)?!l.railh||!l.railh.scrollable||l.onmousewheelhr(n):(t=u(),i=!1,y.preservenativescrolling&&l.checkarea+600<t&&(l.nativescrollingarea=l.isScrollable(n),i=!0),l.checkarea=t,l.nativescrollingarea)?!0:(r=bt(n,!1,i),r&&(l.checkarea=0),r)},this.onmousewheelhr=function(n){if(!l.wheelprevented){if(l.railslocked||!l.railh.scrollable)return!0;if(l.rail.drag)return l.cancelEvent(n);var t=u(),i=!1;return y.preservenativescrolling&&l.checkarea+600<t&&(l.nativescrollingarea=l.isScrollable(n),i=!0),l.checkarea=t,!!l.nativescrollingarea||(l.railslocked?l.cancelEvent(n):bt(n,!0,i))}},this.stop=function(){return l.cancelScroll(),l.scrollmon&&l.scrollmon.stop(),l.cursorfreezed=!1,l.scroll.y=Math.round(l.getScrollTop()*(1/l.scrollratio.y)),l.noticeCursor(),l},this.getTransitionSpeed=function(n){return 80+n/72*y.scrollspeed|0},y.smoothscroll)?l.ishwscroll&&w.hastransition&&y.usetransition&&y.smoothscroll?(ht="",this.resetTransition=function(){ht="";l.doc.css(w.prefixstyle+"transition-duration","0ms")},this.prepareTransition=function(n,t){var r=t?n:l.getTransitionSpeed(n),i=r+"ms";return ht!==i&&(ht=i,l.doc.css(w.prefixstyle+"transition-duration",i)),r},this.doScrollLeft=function(n,t){var i=l.scrollrunning?l.newscrolly:l.getScrollTop();l.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=l.scrollrunning?l.newscrollx:l.getScrollLeft();l.doScrollPos(i,n,t)},this.cursorupdate={running:!1,start:function(){var n=this,t;n.running||(n.running=!0,t=function(){n.running&&e(t);l.showCursor(l.getScrollTop(),l.getScrollLeft());l.notifyScrollEvent(l.win[0])},e(t))},stop:function(){this.running=!1}},this.doScrollPos=function(n,t){var u=l.getScrollTop(),f=l.getScrollLeft(),s,r;if(((l.newscrolly-u)*(t-u)<0||(l.newscrollx-f)*(n-f)<0)&&l.cancelScroll(),y.bouncescroll?(t<0?t=t/2|0:t>l.page.maxh&&(t=l.page.maxh+(t-l.page.maxh)/2|0),n<0?n=n/2|0:n>l.page.maxw&&(n=l.page.maxw+(n-l.page.maxw)/2|0)):(t<0?t=0:t>l.page.maxh&&(t=l.page.maxh),n<0?n=0:n>l.page.maxw&&(n=l.page.maxw)),l.scrollrunning&&n==l.newscrollx&&t==l.newscrolly)return!1;l.newscrolly=t;l.newscrollx=n;var e=l.getScrollTop(),o=l.getScrollLeft(),i={};i.x=n-o;i.y=t-e;s=0|Math.sqrt(i.x*i.x+i.y*i.y);r=l.prepareTransition(s);l.scrollrunning||(l.scrollrunning=!0,l.triggerScrollStart(o,e,n,t,r),l.cursorupdate.start());l.scrollendtrapped=!0;w.transitionend||(l.scrollendtrapped&&clearTimeout(l.scrollendtrapped),l.scrollendtrapped=setTimeout(l.onScrollTransitionEnd,r));l.setScrollTop(l.newscrolly);l.setScrollLeft(l.newscrollx)},this.cancelScroll=function(){if(!l.scrollendtrapped)return!0;var n=l.getScrollTop(),t=l.getScrollLeft();return l.scrollrunning=!1,w.transitionend||clearTimeout(w.transitionend),l.scrollendtrapped=!1,l.resetTransition(),l.setScrollTop(n),l.railh&&l.setScrollLeft(t),l.timerscroll&&l.timerscroll.tm&&clearInterval(l.timerscroll.tm),l.timerscroll=!1,l.cursorfreezed=!1,l.cursorupdate.stop(),l.showCursor(n,t),l},this.onScrollTransitionEnd=function(){if(l.scrollendtrapped){var n=l.getScrollTop(),t=l.getScrollLeft();if(n<0?n=0:n>l.page.maxh&&(n=l.page.maxh),t<0?t=0:t>l.page.maxw&&(t=l.page.maxw),n!=l.newscrolly||t!=l.newscrollx)return l.doScrollPos(t,n,y.snapbackspeed);l.scrollrunning&&l.triggerScrollEnd();l.scrollrunning=!1;l.scrollendtrapped=!1;l.resetTransition();l.timerscroll=!1;l.setScrollTop(n);l.railh&&l.setScrollLeft(t);l.cursorupdate.stop();l.noticeCursor(!1,n,t);l.cursorfreezed=!1}}):(this.doScrollLeft=function(n,t){var i=l.scrollrunning?l.newscrolly:l.getScrollTop();l.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=l.scrollrunning?l.newscrollx:l.getScrollLeft();l.doScrollPos(i,n,t)},this.doScrollPos=function(n,t){var i=l.getScrollTop(),r=l.getScrollLeft(),f,c,o,s,h;if(((l.newscrolly-i)*(t-i)<0||(l.newscrollx-r)*(n-r)<0)&&l.cancelScroll(),f=!1,l.bouncescroll&&l.rail.visibility||(t<0?(t=0,f=!0):t>l.page.maxh&&(t=l.page.maxh,f=!0)),l.bouncescroll&&l.railh.visibility||(n<0?(n=0,f=!0):n>l.page.maxw&&(n=l.page.maxw,f=!0)),l.scrollrunning&&l.newscrolly===t&&l.newscrollx===n)return!0;l.newscrolly=t;l.newscrollx=n;l.dst={};l.dst.x=n-r;l.dst.y=t-i;l.dst.px=r;l.dst.py=i;c=0|Math.sqrt(l.dst.x*l.dst.x+l.dst.y*l.dst.y);o=l.getTransitionSpeed(c);l.bzscroll={};s=f?1:.58;l.bzscroll.x=new st(r,l.newscrollx,o,0,0,s,1);l.bzscroll.y=new st(i,l.newscrolly,o,0,0,s,1);u();h=function(){if(l.scrollrunning){var n=l.bzscroll.y.getPos();l.setScrollLeft(l.bzscroll.x.getNow());l.setScrollTop(l.bzscroll.y.getNow());n<=1?l.timer=e(h):(l.scrollrunning=!1,l.timer=0,l.triggerScrollEnd())}};l.scrollrunning||(l.triggerScrollStart(r,i,n,t,o),l.scrollrunning=!0,l.timer=e(h))},this.cancelScroll=function(){return l.timer&&v(l.timer),l.timer=0,l.bzscroll=!1,l.scrollrunning=!1,l}):(this.doScrollLeft=function(n,t){var i=l.getScrollTop();l.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=l.getScrollLeft();l.doScrollPos(i,n,t)},this.doScrollPos=function(n,t){var r=n>l.page.maxw?l.page.maxw:n,i;r<0&&(r=0);i=t>l.page.maxh?l.page.maxh:t;i<0&&(i=0);l.synched("scroll",function(){l.setScrollTop(i);l.setScrollLeft(r)})},this.cancelScroll=function(){});this.doScrollBy=function(n){ct(0,n)};this.doScrollLeftBy=function(n){ct(n,0)};this.doScrollTo=function(n,t){var i=t?Math.round(n*l.scrollratio.y):n;i<0?i=0:i>l.page.maxh&&(i=l.page.maxh);l.cursorfreezed=!1;l.doScrollTop(n)};this.checkContentSize=function(){var n=l.getContentSize();n.h==l.page.h&&n.w==l.page.w||l.resize(!1,n)};l.onscroll=function(){l.rail.drag||l.cursorfreezed||l.synched("scroll",function(){l.scroll.y=Math.round(l.getScrollTop()/l.scrollratio.y);l.railh&&(l.scroll.x=Math.round(l.getScrollLeft()/l.scrollratio.x));l.noticeCursor()})};l.bind(l.docscroll,"scroll",l.onscroll);this.doZoomIn=function(n){var i,r,e,t,u;if(!l.zoomactive){l.zoomactive=!0;l.zoomrestore={style:{}};i=["position","top","left","zIndex","backgroundColor","marginTop","marginBottom","marginLeft","marginRight"];r=l.win[0].style;for(e in i)t=i[e],l.zoomrestore.style[t]=void 0!==r[t]?r[t]:"";return l.zoomrestore.style.width=l.win.css("width"),l.zoomrestore.style.height=l.win.css("height"),l.zoomrestore.padding={w:l.win.outerWidth()-l.win.width(),h:l.win.outerHeight()-l.win.height()},w.isios4&&(l.zoomrestore.scrollTop=f.scrollTop(),f.scrollTop(0)),l.win.css({position:w.isios4?"absolute":"fixed",top:0,left:0,zIndex:s+100,margin:0}),u=l.win.css("backgroundColor"),(""===u||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(u))&&l.win.css("backgroundColor","#fff"),l.rail.css({zIndex:s+101}),l.zoom.css({zIndex:s+102}),l.zoom.css("backgroundPosition","0 -18px"),l.resizeZoom(),l.onzoomin&&l.onzoomin.call(l),l.cancelEvent(n)}};this.doZoomOut=function(n){if(l.zoomactive)return l.zoomactive=!1,l.win.css("margin",""),l.win.css(l.zoomrestore.style),w.isios4&&f.scrollTop(l.zoomrestore.scrollTop),l.rail.css({"z-index":l.zindex}),l.zoom.css({"z-index":l.zindex}),l.zoomrestore=!1,l.zoom.css("backgroundPosition","0 0"),l.onResize(),l.onzoomout&&l.onzoomout.call(l),l.cancelEvent(n)};this.doZoom=function(n){return l.zoomactive?l.doZoomOut(n):l.doZoomIn(n)};this.resizeZoom=function(){if(l.zoomactive){var n=l.getScrollTop();l.win.css({width:f.width()-l.zoomrestore.padding.w+"px",height:f.height()-l.zoomrestore.padding.h+"px"});l.onResize();l.setScrollTop(Math.min(l.page.maxh,n))}};this.init();i.nicescroll.push(this)},it=function(n){var t=this;this.nc=n;this.lastx=0;this.lasty=0;this.speedx=0;this.speedy=0;this.lasttime=0;this.steptime=0;this.snapx=!1;this.snapy=!1;this.demulx=0;this.demuly=0;this.lastscrollx=-1;this.lastscrolly=-1;this.chkx=0;this.chky=0;this.timer=0;this.reset=function(n,i){t.stop();t.steptime=0;t.lasttime=u();t.speedx=0;t.speedy=0;t.lastx=n;t.lasty=i;t.lastscrollx=-1;t.lastscrolly=-1};this.update=function(n,i){var r=u();t.steptime=r-t.lasttime;t.lasttime=r;var f=i-t.lasty,e=n-t.lastx,o=t.nc.getScrollTop()+f,s=t.nc.getScrollLeft()+e;t.snapx=s<0||s>t.nc.page.maxw;t.snapy=o<0||o>t.nc.page.maxh;t.speedx=e;t.speedy=f;t.lastx=n;t.lasty=i};this.stop=function(){t.nc.unsynched("domomentum2d");t.timer&&clearTimeout(t.timer);t.timer=0;t.lastscrollx=-1;t.lastscrolly=-1};this.doSnapy=function(n,i){var r=!1;i<0?(i=0,r=!0):i>t.nc.page.maxh&&(i=t.nc.page.maxh,r=!0);n<0?(n=0,r=!0):n>t.nc.page.maxw&&(n=t.nc.page.maxw,r=!0);r?t.nc.doScrollPos(n,i,t.nc.opt.snapbackspeed):t.nc.triggerScrollEnd()};this.doMomentum=function(n){var o=u(),l=n?o+n:t.lasttime,a=t.nc.getScrollLeft(),v=t.nc.getScrollTop(),s=t.nc.page.maxh,h=t.nc.page.maxw,e,y,p,f,c;if(t.speedx=h>0?Math.min(60,t.speedx):0,t.speedy=s>0?Math.min(60,t.speedy):0,e=l&&o-l<=60,(v<0||v>s||a<0||a>h)&&(e=!1),y=!(!t.speedy||!e)&&t.speedy,p=!(!t.speedx||!e)&&t.speedx,y||p){f=Math.max(16,t.steptime);f>50&&(c=f/50,t.speedx*=c,t.speedy*=c,f=50);t.demulxy=0;t.lastscrollx=t.nc.getScrollLeft();t.chkx=t.lastscrollx;t.lastscrolly=t.nc.getScrollTop();t.chky=t.lastscrolly;var i=t.lastscrollx,r=t.lastscrolly,w=function(){var n=u()-o>600?.04:.02;t.speedx&&(i=Math.floor(t.lastscrollx-t.speedx*(1-t.demulxy)),t.lastscrollx=i,(i<0||i>h)&&(n=.1));t.speedy&&(r=Math.floor(t.lastscrolly-t.speedy*(1-t.demulxy)),t.lastscrolly=r,(r<0||r>s)&&(n=.1));t.demulxy=Math.min(1,t.demulxy+n);t.nc.synched("domomentum2d",function(){t.speedx&&(t.nc.getScrollLeft(),t.chkx=i,t.nc.setScrollLeft(i));t.speedy&&(t.nc.getScrollTop(),t.chky=r,t.nc.setScrollTop(r));t.timer||(t.nc.hideCursor(),t.doSnapy(i,r))});t.demulxy<1?t.timer=setTimeout(w,f):(t.stop(),t.nc.hideCursor(),t.doSnapy(i,r))};w()}else t.doSnapy(t.nc.getScrollLeft(),t.nc.getScrollTop())}},y=n.fn.scrollTop;n.cssHooks.pageYOffset={get:function(n){var t=i.data(n,"__nicescroll")||!1;return t&&t.ishwscroll?t.getScrollTop():y.call(n)},set:function(n,t){var r=i.data(n,"__nicescroll")||!1;return r&&r.ishwscroll?r.setScrollTop(parseInt(t)):y.call(n,t),this}};n.fn.scrollTop=function(n){if(void 0===n){var t=!!this[0]&&(i.data(this[0],"__nicescroll")||!1);return t&&t.ishwscroll?t.getScrollTop():y.call(this)}return this.each(function(){var t=i.data(this,"__nicescroll")||!1;t&&t.ishwscroll?t.setScrollTop(parseInt(n)):y.call(i(this),n)})};c=n.fn.scrollLeft;i.cssHooks.pageXOffset={get:function(n){var t=i.data(n,"__nicescroll")||!1;return t&&t.ishwscroll?t.getScrollLeft():c.call(n)},set:function(n,t){var r=i.data(n,"__nicescroll")||!1;return r&&r.ishwscroll?r.setScrollLeft(parseInt(t)):c.call(n,t),this}};n.fn.scrollLeft=function(n){if(void 0===n){var t=!!this[0]&&(i.data(this[0],"__nicescroll")||!1);return t&&t.ishwscroll?t.getScrollLeft():c.call(this)}return this.each(function(){var t=i.data(this,"__nicescroll")||!1;t&&t.ishwscroll?t.setScrollLeft(parseInt(n)):c.call(i(this),n)})};l=function(n){var t=this,r,u;if(this.length=0,this.name="nicescrollarray",this.each=function(n){return i.each(t,n),t},this.push=function(n){t[t.length]=n;t.length++},this.eq=function(n){return t[n]},n)for(r=0;r<n.length;r++)u=i.data(n[r],"__nicescroll")||!1,u&&(this[this.length]=u,this.length++);return this};!function(n,t,i){for(var r=0,u=t.length;r<u;r++)i(n,t[r])}(l.prototype,["show","hide","toggle","onResize","resize","remove","stop","doScrollPos"],function(n,t){n[t]=function(){var n=arguments;return this.each(function(){this[t].apply(this,n)})}});n.fn.getNiceScroll=function(n){return void 0===n?new l(this):this[n]&&i.data(this[n],"__nicescroll")||!1};(n.expr.pseudos||n.expr[":"]).nicescroll=function(n){return void 0!==i.data(n,"__nicescroll")};i.fn.niceScroll=function(n,t){void 0!==t||"object"!=typeof n||"jquery"in n||(t=n,n=!1);var r=new l;return this.each(function(){var f=i(this),u=i.extend({},t),o,e;n&&(o=i(n),u.doc=o.length>1?i(n,f):o,u.win=f);!("doc"in u)||"win"in u||(u.win=f);e=f.data("__nicescroll")||!1;e||(u.doc=u.doc||f,e=new tt(u,f),f.data("__nicescroll",e));r.push(e)}),1===r.length?r[0]:r};r.NiceScroll={getjQuery:function(){return n}};i.nicescroll||(i.nicescroll=new l,i.nicescroll.options=k)});fp_popup_number=0;Array.from||(Array.from=function(){var t=Object.prototype.toString,n=function(n){return typeof n=="function"||t.call(n)==="[object Function]"},i=function(n){var t=Number(n);return isNaN(t)?0:t===0||!isFinite(t)?t:(t>0?1:-1)*Math.floor(Math.abs(t))},r=Math.pow(2,53)-1,u=function(n){var t=i(n);return Math.min(Math.max(t,0),r)};return function(t){var h=this,c=Object(t),i,o;if(t==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");if(i=arguments.length>1?arguments[1]:void undefined,typeof i!="undefined"){if(!n(i))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(o=arguments[2])}for(var f=u(c.length),s=n(h)?Object(new h(f)):new Array(f),r=0,e;r<f;)e=c[r],s[r]=i?typeof o=="undefined"?i(e,r):i.call(o,e,r):e,r+=1;return s.length=f,s}}());fp_settings=fp_settings||{};fp_loadScripts=function fp_loadScripts(n,t,i){var f,r,u,e;fp_settings.debug===!0&&n.substring(n.length-7,n.length-2)===".min."&&(n=n.substring(0,n.length-6)+"js");f=document.getElementsByTagName("head")[0];r=[].concat(_toConsumableArray(f.getElementsByTagName("script")));r=r.filter(function(t){return t.getAttribute("src")===n});r.length===0&&(u=document.createElement("script"),u.src=n,u.type="text/javascript",document.getElementsByTagName("head")[0].appendChild(u));t&&i&&(fp_settings.debug==!0,e=window[t],typeof e!="undefined"?(fp_settings.debug==!0&&console.log("loaded: "+t),i()):(fp_settings.debug==!0&&console.log("no load: "+t),setTimeout(function(){fp_loadScripts(n,t,i)},1500)))};jQuery(document).ready(function(){jQuery("span[fpscrambledmail][id][title]").each(function(n,t){fp_emailScrambling_descriptElement(jQuery(t).prop("id"))});$("div").on("dblclick",function(n){if(!$(n.target).is("input")){$(this).css({"-webkit-user-select":"auto","-moz-user-select":"auto","-ms-user-select":"auto","user-select":"auto"});$("div .selectable").not(this).not("input").css({"-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"});window.getSelection().removeAllRanges();var t=document.createRange();t.selectNodeContents(n.target);window.getSelection().addRange(t)}});$(document).on("dblclick",function(n){$(n.target).closest("div").length||$("div").css({"-webkit-user-select":"auto","-moz-user-select":"auto","-ms-user-select":"auto","user-select":"auto"})})});window.previewTimeout=null;window.enteredObject=null;SaveSarvice=function(){var t=!1,n="Do you want to Save?";return{show:function(i){t?fp_ConfirmDialog("Save",n,function(){i()}):i()},needShow:function(i,r){t=i;r&&(n=r)},setMessage:function(t){n=t}}}();$(function(){$(".fp_insertBlockLine").click(function(){$(this).css("visibility","hidden");$(this).parent().children(".fp_insertBlock").slideDown("slow")});$(".fp_insertBlock a").click(function(){var n=$(this);$(this).parent().parent().children(".fp_insertBlock").fadeOut("slow",function(){n.parent().parent().children(".fp_insertBlockLine").css("visibility","visible")})})});CalendarActionTypeEnum={AddEvent:0,EditEvent:1,CategoryGrid:2,EventGrid:3,AddCategory:4,DeleteCategory:5,EditCategory:6,ShowEvents:7,ShowPopupEvents:8};flexpageCalendar={calendarContainer:"#calendar-block-edit",getCalendarContainerListMode:function(){return this.calendarContainer+" .list-mode"},getCalendarBlockSelector:function(n){return $("#calendar-block-edit "+n)},refreshCategoryGrid:function(){window.fp_CalendarBlock_Grid&&fp_CalendarBlock_Grid.Refresh();window.fp_CalendarEventBlock_Grid&&fp_CalendarEventBlock_Grid.Refresh()},fp_Calendar_CustomButtonClick:function(n,t){t.buttonID=="btnDelete"?fp_ConfirmDialog("Delete","Are you sure you want to delete the event?",function(){n.DeleteRow(t.visibleIndex)}):t.buttonID=="btnEdit"&&flexpageCalendar.openDialogAddEvent(n.GetRowKey(t.visibleIndex))},fp_Calendar_CustomEventButtonClick:function(n,t){var i=this;t.buttonID=="btnDelete"?fp_ConfirmDialog("Delete","Are you sure you want to delete the category?",function(){n.DeleteRow(t.visibleIndex)}):t.buttonID=="btnEdit"&&flexpageCalendar.addEditCategoryToCalendar(n.GetRowKey(t.visibleIndex));n.PerformCallback()},selectListMode:function(n,t){t?(n.css({"background-color":"rgb(213, 213, 213)","border-radius":"10px"}),n.find("img").css({display:"block",margin:"0 auto"}),n.find(".img-main").hide(),n.find(".img-hover").css({margin:"0 auto",display:"block"}),n.find("a").css("color","rgb(35, 89, 142)")):(n.css({"background-color":"transparent","border-radius":"10px"}),n.find("img").css({display:"block",margin:"0 auto"}),n.find(".img-hover").hide(),n.find(".img-main").css({margin:"0 auto",display:"block"}),n.find("a").css("color","#979797"))},selectDefault:function(){for(var t=$(this.getCalendarContainerListMode()),n=0;n<t.length;n++)this.selectListMode(t.eq(n),t.eq(n).data("select"))},openDialogAddEvent:function(n){fp_popupControlOpen({command:"edit",blockType:"CalendarEvent",blockID:n,alwaysCallOnClose:!0},function(){})},openDialogCategory:function(n){var t=this;t.getPleaseWaitDiv().show();window.flexpage=window.flexpage||{};window.flexpage.onClose=function(){window.fp_CalendarBlock_Grid&&fp_CalendarEventBlock_Grid.Refresh();window.fp_CalendarEventBlock_Grid&&fp_CalendarEventBlock_Grid.Refresh();$("#dialog-iframe").remove();t.getPleaseWaitDiv().hide()};this.openIframe("/CalendarBlock/Categories?command="+CalendarActionTypeEnum.AddCategory+"&id="+n)},openDialogShowEvents:function(n,t){window.flexpage=window.flexpage||{};window.flexpage.isSaveEven=!1;window.flexpage.onClose=function(){$("#dialog-iframe").remove();window.flexpage.isSaveEven&&location.reload(!1)};this.openIframe("/CalendarBlock/CalendarEventPopup?command="+CalendarActionTypeEnum.ShowPopupEvents+"&date="+n.toISOString()+"&id="+t)},openIframe:function(n){$("<iframe/>",{id:"dialog-iframe",css:{position:"fixed",top:0,left:0,width:"100%",height:"100%",border:0,"z-index":12001},src:n}).appendTo($("body"))},getPleaseWaitDiv:function(){return $("#pleaseWaitDiv")},sendAjax:function(n,t,i,r){r||(r="CalendarBlock");var u=this;this.getPleaseWaitDiv().show();$.ajax({url:"/"+r+"/"+n,type:"POST",data:t,success:function(n){i(n);u.getPleaseWaitDiv().hide();u.refreshCategoryGrid()}})},getCategoryContent:function(){return $("#AddCalendarCategoryContent")},getSpeed:function(){return 1e3},addEditCategoryToCalendar:function(n){var t=this;t.getPleaseWaitDiv().show();window.flexpage=window.flexpage||{};window.flexpage.onClose=function(){window.fp_CalendarBlock_Grid&&fp_CalendarEventBlock_Grid.Refresh();window.fp_CalendarEventBlock_Grid&&fp_CalendarEventBlock_Grid.Refresh();$("#dialog-iframe").remove();t.getPleaseWaitDiv().hide()};this.openIframe("/CalendarBlock/Categories?command="+CalendarActionTypeEnum.EditCategory+"&id="+n)},getDataFromCategoryForm:function(){return $("#CategoryForm").serialize()},getCalendarAddEditDayForm:function(){return $(".table-calendar #CalendarAddEditDayForm").serialize()},saveCategory:function(){if($("#Name_CurrentLocalization").val().trim()==""){alert("Event name is empty!");return}var n=this;this.sendAjax("AddEditCategory",n.getDataFromCategoryForm(),function(){$("#flexpage-popup-control_1").modal("hide");setTimeout(function(){window.parent.flexpage.onClose()},1e3)})},saveAddNewEvent:function(){if(StartDate.GetDate()>EndDate.GetDate()){alert("Invalid time interval");return}if($(".table-calendar #CalendarAddEditDayForm #Title_CurrentLocalization").val().trim()==""){alert("Title is empty!");return}if($(".table-calendar #CalendarAddEditDayForm #Place_CurrentLocalization").val().trim()==""){alert("Place is empty!");return}$("#Notes_Texts_"+this.GetSelectedLangCode()+"_").val(fp_HtmlEditor_Notes.GetHtml());$("#Notes_CurrentText").val(fp_HtmlEditor_Notes.GetHtml());this.sendAjax("CalendarAddEditDay",this.getCalendarAddEditDayForm(),function(){var n=$("#flexpage-popup-control_"+$(".table-calendar #CalendarAddEditDayForm").data("id"));n.modal("hide");setTimeout(function(){window.parent.flexpage.onClose()},1e3)})},changeLanguageCategory:function(n,t){$("#Name_Localizations_"+this.GetSelectedLangCode()+"_").val($("#Name_CurrentLocalization").val());var i=this,r=this.getDataFromCategoryForm()+"&lang="+t;this.sendAjax("ChangeLanguageCategory",r,function(n){i.getCalendarBlockSelector(".modal-body").html(n);i.getCalendarBlockSelector(".event-colorpicker").colorpicker();$("#Name_CurrentLocalization").val($("#Name_Localizations_"+t+"_").val())})},GetSelectedLangCode:function(){return $(".languages .language-selected").data("code")},changeLanguageDay:function(n,t){$("#Title_Localizations_"+this.GetSelectedLangCode()+"_").val($("#Title_CurrentLocalization").val());$("#Place_Localizations_"+this.GetSelectedLangCode()+"_").val($("#Place_CurrentLocalization").val());$("#Notes_Texts_"+this.GetSelectedLangCode()+"_").val(fp_HtmlEditor_Notes.GetHtml());$("#Notes_CurrentText").val(fp_HtmlEditor_Notes.GetHtml());$("#HiddenInputDay #NewLanguageCode").val(t);this.sendAjax("ChangeLanguageEvent",this.getCalendarAddEditDayForm(),function(n){$(".table-calendar .modal-body").html(n);$("#Title_CurrentLocalization").val($("#Title_Localizations_"+t+"_").val());$("#Place_CurrentLocalization").val($("#Place_Localizations_"+t+"_").val());$("#Place_CurrentLocalization").val($("#Place_Localizations_"+t+"_").val());fp_HtmlEditor_Notes.SetHtml($("#Notes_Texts_"+t+"_").val());$(".modal-body").ready(function(){$('[data-toggle="tooltip"]').tooltip({placement:"top"})})})},deleteEvent:function(n,t,i){var r=this;fp_ConfirmDialog("Delete","Are you sure you want to delete the event?",function(){r.sendAjax("DeleteEvent",{id:n},function(){r.updateListEvents(t,i)},"Events")})},favoriteEvent:function(n,t,i){var r=this;fp_ConfirmDialog("Add to favorites","Are you sure you want to add this event to favorites?",function(){console.log("favoriteEvent");var u=document.referrer;u+=u.includes("?")?"&":"?";u+="calendarDate="+n+"&calendarID="+t;r.sendAjax("AddEventToFavorites",{date:n,calendarID:t,eventID:i,url:u},function(n){$(".table-celendar-event-popup #partialEvents").html(n);flexpageCalendar.repositionEventPopup()})})},updateListEvents:function(n,t){this.sendAjax("CalendarEventPopup",{command:CalendarActionTypeEnum.ShowEvents,date:n,id:t},function(n){$(".table-celendar-event-popup #partialEvents").html(n);flexpageCalendar.repositionEventPopup()})},repositionEventPopup:function(){var t=flexpageCalendar.getCalendarBlockSelector(".modal"),n=flexpageCalendar.getCalendarBlockSelector(".modal-dialog");t.css("display","block");n.css("margin-top",Math.max(0,($(window).height()-n.height())/2))},showMultiMonthMode:function(n){n.val()==="1"?$("#MultiMonth").fadeIn():$("#MultiMonth").fadeOut()},dateTitiel:{}};$(function(){$("body").on("click",flexpageCalendar.calendarContainer+" #btnAddNewEvent",function(){flexpageCalendar.openDialogAddEvent(-1)});$("body").on("click",flexpageCalendar.calendarContainer+" #AddNewCategoryToCalendar",function(){flexpageCalendar.openDialogCategory(-1)});$("body").on("click",flexpageCalendar.calendarContainer+" #saveCategory",function(){flexpageCalendar.saveCategory()});$("body").on("click",".table-calendar #saveAddNewEvent",function(){window.parent.flexpage.isSaveEven=!0;flexpageCalendar.saveAddNewEvent()});$("body").on("mouseover",flexpageCalendar.getCalendarContainerListMode(),function(){flexpageCalendar.selectListMode($(this),!0)});$("body").on("mouseout",flexpageCalendar.getCalendarContainerListMode(),function(){$(this).data("select")===!1&&flexpageCalendar.selectListMode($(this),!1)});$("body").on("click",flexpageCalendar.getCalendarContainerListMode(),function(){flexpageCalendar.selectListMode($(flexpageCalendar.getCalendarContainerListMode()),!1);flexpageCalendar.selectListMode($(this),!0);$(flexpageCalendar.getCalendarContainerListMode()).data("select",!1);$(this).data("select",!0);$("#hiddenListMode").val($(this).find("a[data-target]").data("target"))});$("body").on("change",flexpageCalendar.calendarContainer+" #ddlMultiMonthViewMode",function(){flexpageCalendar.showMultiMonthMode($(this))})});$(document).ready(function(){var n;if(typeof queryString!="undefined"){var f=queryString.split("&"),t=undefined,i=undefined,r="",u="";for(n=0;n<f.length;n++)chunks=f[n].split("="),r=chunks[0].trim().toLowerCase(),u=chunks[1],r==="calendarid"?i=u:r==="calendardate"&&(t=new Date(u));i!==undefined&&t!==undefined&&flexpageCalendar.openDialogShowEvents(t,i)}});StatusProperty={New:0,Removed:1,Existing:2};typeof fp_selectedfileId=="undefined"&&(fp_selectedFileId=null);typeof fp_selectedFileName=="undefined"&&(fp_selectedFileName=null);var ObjectProperties=function(){this.id=-1;this.value="";this.status=StatusProperty.New;this.enabled=!0},ObjectPropertiesRequest=function(){this.objectId=-1;this.properties=[]},AddEditCustomPropertyService=function(){function t(t,r){for(var e,f=n.properties,u=0;u<f.length;u++)if(f[u].id==t){f[u].status==StatusProperty.Removed&&(f[u].status=StatusProperty.New);return}e=new ObjectProperties;e.id=t;e.status=r?r:StatusProperty.New;n.properties.push(e);i()}function u(i){for(var u=n.properties,r=0;r<u.length;r++)if(u[r].id==i){u[r].status=StatusProperty.Removed;return}t(i,StatusProperty.Removed)}function i(){n.objectId=n.objectId>0?n.objectId:$("#Properties_ObjectID").val();var t=n.properties;$(".EditInput").each(function(){var propertyId=$(this).data("id"),propertyValue,enabled=!0,i,property;try{enabled=eval("EnabledCheckBox"+propertyId).GetValue()}catch(e){}if($(this).children().first().attr("role")=="checkbox")switch($(this).find("input").val()){case"C":propertyValue="true";break;case"U":propertyValue="false"}else $(this).find("#html"+propertyId).length>0?(propertyValue=eval("html"+propertyId).GetHtml(),propertyValue=encodeURI(propertyValue)):propertyValue=$(this).length>0&&$(this)[0].id=="tokenBox"+propertyId?eval("tokenBox"+propertyId).GetValue():$(this).find("input").val();for(i=0;i<t.length;i++)if(t[i].id==propertyId){t[i].value=propertyValue;return}propertyId&&(property=new ObjectProperties,property.id=propertyId,property.status=enabled==!1?StatusProperty.Removed:StatusProperty.Existing,property.value=propertyValue,property.enabled=enabled,n.properties.push(property))});$(r).val(JSON.stringify(n))}var r="#EditProperties",n=new ObjectPropertiesRequest;return{SetNewPropertyId:function(n){n&&t(n,StatusProperty.New)},SetExistingPropertyId:function(n){n&&t(n,StatusProperty.Existing)},SetDeletePropertyId:function(n){n&&u(n)},GetProperties:function(){return i(),$(r).val()},UpdateGrid:function(){$.post("/Flexpage/AddCustomProperty",{propertiesRequest:AddEditCustomPropertyService.GetProperties()}).done(function(n){$("#properties .content-grid #BrowserCustomPropertiesGrid").html(n)})},GenerateProperties:function(){i()}}}(),EditCustomProperty=function(){function s(n,t,i,r,u){$("<iframe/>",{id:"dialog-iframe",css:{position:"fixed",top:0,left:0,width:"100%",height:"100%",border:0,"z-index":12001},src:u+"?typeProperty="+n+"&objectPropertyID="+t+"&folderID="+r+"&objectID="+i}).appendTo($("body"))}function h(n,t){var i=[],r;if(n&&n.val()&&n.val().length>0&&(i=n.val().split(",")),i.length>0)for(r=0;r<i.length;r++)if(i[r]==t)return;i.push(t);n.val(i.join(","))}function c(n,t){var i=[],r;if(n&&n.val()&&n.val().length>0&&(i=n.val().split(",")),i.length>0)for(r=0;r<i.length;r++)if(i[r]==t){i.splice(r,1);break}n.val(i.join(","))}function w(n){i=$("#IsSelect");h(i,n)}function b(n){i=$("#IsSelect");c(i,n)}function l(t){n=$("#IsDefault");h(n,t)}function a(t){n=$("#IsDefault");c(n,t)}function f(n){var u={Id:n[0],EmailNotification:n[1],Abbreviation:n[2]},i;for(r=u.Id,i=0;i<t.length;i++)if(t[i].Id==u.Id){v(t[i]);return}v(u);t.push(u)}function e(n){$(".grid-select-row").removeClass("grid-select-row");$("#fp_webSite_DXDataRow"+n).addClass("grid-select-row")}function v(n){$("#Abbreviation").val(n.Abbreviation);$("#EmailNotification").prop("checked",!1);$("#EmailNotification[value="+n.EmailNotification+"]").prop("checked",!0)}function k(){return i=$("#IsSelect"),i&&i.val()&&i.val().split(",")||""}function d(){return n=$("#IsDefault"),n&&n.val()&&n.val().split(",")||""}function g(n){return typeof n.pageY=="undefined"&&(n.pageY=n.event.htmlEvent.pageY),typeof n.pageX=="undefined"&&(n.pageX=n.event.htmlEvent.pageX),n.$contextMenu=$("#PopupMenuCustomProperties"),PopupMenuCustomProperties.ShowAtPos(n.pageX,n.pageY),n}function y(){u("DeleteProperty",!1)}function nt(){u("DeleteProperty",!0)}function p(){u("EditProperty",!1)}function tt(){u("EditProperty",!0)}function u(n,t){if(typeof PopupMenuCustomProperties!="undefined"){var i=PopupMenuCustomProperties.GetItemByName(n);i&&i.SetEnabled(t)}}function it(n){fp_popupControlOpen({command:"edit",blockType:"CustomPropertyAdd",blockAlias:"CustomPropertyAdd",blockID:"0",OneButtonText:"OK",parameters:n},function(){y();p();AddEditCustomPropertyService.UpdateGrid()})}function rt(n){for(var t=0;t<n.length;t++)AddEditCustomPropertyService.SetExistingPropertyId(n[t]);return AddEditCustomPropertyService.GetProperties()}var ut=this,i=$("#IsSelect"),n=$("#IsDefault"),t=[],r=0,o=0;return{ShowAllAvailableProperties:function(n,t){var r=$(n.target).is(":checked"),i=[];$("#сontactDetailsCustomProperties"+t+"_DXMainTable [data-field='Title']").each(function(index,elem){var title=$(elem),propertyId=title.attr("data-idprop"),propertyValue=$("#сontactDetailsCustomProperties"+t+"_DXMainTable .EditInput[data-id="+propertyId+"]"),enabled;if($(propertyValue).children().first().attr("role")=="checkbox")switch($(propertyValue).find("input").val()){case"C":propertyValue="true";break;case"U":propertyValue="false"}else $(propertyValue).find("#html"+propertyId).length>0?(propertyValue=eval("html"+propertyId).GetHtml(),propertyValue=encodeURI(propertyValue)):propertyValue=$(propertyValue).find("input").val();enabled=$("#сontactDetailsCustomProperties"+t+"_DXMainTable [aria-checked]")[index];i.push({ID:propertyId,Title:$(title).text(),DisplayValue:propertyValue?propertyValue:"",Enabled:enabled?enabled.checked:!0})});$.ajax({url:"/flexpage/ShowAllAvailableProperties",data:{VisibleEnabled:r,model:{ObjectID:t,properties:i}},method:"POST",success:function(n){$("#BrowserCustomPropertiesGrid").html(n)},error:function(){}})},showDialog:function(n,t,i){window.flexpage=window.flexpage||{};window.flexpage.isSaveEven=!1;window.flexpage.onClose=function(){$("#dialog-iframe").remove();window.flexpage.isSaveEven&&location.reload(!1)};s(n,t,null,i,"/flexpage/CustomProperty_ShowEditDialog")},showDialogHtml:function(n,t,i){window.flexpage=window.flexpage||{};window.flexpage.isSaveEven=!1;window.flexpage.onClose=function(){$("#dialog-iframe").remove();window.flexpage.isSaveEven&&location.reload(!1)};s(n,t,i,null,"/flexpage/CustomProperty_ShowHtml");window.flexpage=window.flexpage||{};window.flexpage.fp_afterPreSaveBlock=function(res){var name="html"+t;eval(name).SetValue(res.Value)}},selectRow:function(t,i,r,u,o,s){e(i);f([s,r,u]);t.GetCheckState()==="Checked"?(w(s),n=$("#IsDefault"),n&&n.val()&&n.val().length!=0||(l(s),o.SetChecked(!0))):($.inArray(s+"",d())>=0&&(a(s),o.SetChecked(!1)),b(s))},defaultRow:function(t,i,r,u,o){e(i);f([o,r,u]);t.GetCheckState()==="Checked"?(n=$("#IsDefault"),n&&n.val()&&n.val().length>0||$.inArray(o+"",k())<0?t.SetCheckState("Unchecked"):l(o)):a(o)},loadProperty:function(n,t){e(t.visibleIndex);n.GetRowValues(t.visibleIndex,"Id;EmailNotification;Abbreviation",f)},OnChangeAbbreviation:function(n){if(!(r<0))for(var i=0;i<t.length;i++)if(t[i].Id==r){t[i].Abbreviation=n;return}},OnChangeEmailNotification:function(n){if(!(r<0))for(var i=0;i<t.length;i++)if(t[i].Id==r){t[i].EmailNotification=n;return}},GetData:function(){return JSON.stringify(t)},SetData:function(n){var r,i;if(n)for(t=JSON.parse(n),r=["None","Warn","Push"],i=0;i<t.length;i++)t[i].EmailNotification=r[t[i].EmailNotification]},popupMenuItemClick:function(n,t){var i=[],r=$(".property-values");r.each(function(){i.push($(this).data("idprop"))});t.item.name=="AddProperty"?(window.flexpage.SetNewPropertyId=AddEditCustomPropertyService.SetNewPropertyId,it(rt(i))):t.item.name=="DeleteProperty"&&fp_ConfirmDialog("Delete","Are you sure want to delete this?",function(){AddEditCustomPropertyService.SetDeletePropertyId(o);y();p();AddEditCustomPropertyService.UpdateGrid()})},contextMenu:function(n,t){return g({pageY:t.pageY,pageX:t.pageX,event:t}),!1},OnSelectionChanged:function(n,t,i){objectId=i;t.isSelected&&(o=n.GetRowKey(t.visibleIndex),nt(),tt())}}}();!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(t,i){return void 0===i&&(i="undefined"!=typeof window?require("jquery"):require("jquery")(t)),n(i),i}:n(jQuery)}(function(n){var t=function(){var t;return n&&n.fn&&n.fn.select2&&n.fn.select2.amd&&(t=n.fn.select2.amd),function(){if(!t||!t.requirejs){t?i=t:t={};var n,i,r;!function(t){function e(n,t){return tt.call(n,t)}function c(n,t){var e,o,s,u,h,y,c,p,i,l,w,b,r=t&&t.split("/"),a=f.map,v=a&&a["*"]||{};if(n){for(n=n.split("/"),h=n.length-1,f.nodeIdCompat&&k.test(n[h])&&(n[h]=n[h].replace(k,"")),"."===n[0].charAt(0)&&r&&(b=r.slice(0,r.length-1),n=b.concat(n)),i=0;i<n.length;i++)if("."===(w=n[i]))n.splice(i,1),i-=1;else if(".."===w){if(0===i||1===i&&".."===n[2]||".."===n[i-1])continue;i>0&&(n.splice(i-1,2),i-=2)}n=n.join("/")}if((r||v)&&a){for(e=n.split("/"),i=e.length;i>0;i-=1){if(o=e.slice(0,i).join("/"),r)for(l=r.length;l>0;l-=1)if((s=a[r.slice(0,l).join("/")])&&(s=s[o])){u=s;y=i;break}if(u)break;!c&&v&&v[o]&&(c=v[o],p=i)}!u&&c&&(u=c,y=p);u&&(e.splice(0,y,u),n=e.join("/"))}return n}function w(n,i){return function(){var r=it.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),o.apply(t,r.concat([n,i]))}}function d(n){return function(t){return c(t,n)}}function g(n){return function(t){u[n]=t}}function l(n){if(e(h,n)){var i=h[n];delete h[n];p[n]=!0;a.apply(t,i)}if(!e(u,n)&&!e(p,n))throw new Error("No "+n);return u[n]}function v(n){var i,t=n?n.indexOf("!"):-1;return t>-1&&(i=n.substring(0,t),n=n.substring(t+1,n.length)),[i,n]}function b(n){return n?v(n):[]}function nt(n){return function(){return f&&f.config&&f.config[n]||{}}}var a,o,y,s,u={},h={},f={},p={},tt=Object.prototype.hasOwnProperty,it=[].slice,k=/\.js$/;y=function(n,t){var r,u=v(n),i=u[0],f=t[1];return n=u[1],i&&(i=c(i,f),r=l(i)),i?n=r&&r.normalize?r.normalize(n,d(f)):c(n,f):(n=c(n,f),u=v(n),i=u[0],n=u[1],i&&(r=l(i))),{f:i?i+"!"+n:n,n:n,pr:i,p:r}};s={require:function(n){return w(n)},exports:function(n){var t=u[n];return void 0!==t?t:u[n]={}},module:function(n){return{id:n,uri:"",exports:u[n],config:nt(n)}}};a=function(n,i,r,f){var v,o,d,k,c,nt,tt,a=[],it=typeof r;if(f=f||n,nt=b(f),"undefined"===it||"function"===it){for(i=!i.length&&r.length?["require","exports","module"]:i,c=0;c<i.length;c+=1)if(k=y(i[c],nt),"require"===(o=k.f))a[c]=s.require(n);else if("exports"===o)a[c]=s.exports(n),tt=!0;else if("module"===o)v=a[c]=s.module(n);else if(e(u,o)||e(h,o)||e(p,o))a[c]=l(o);else{if(!k.p)throw new Error(n+" missing "+o);k.p.load(k.n,w(f,!0),g(o),{});a[c]=u[o]}d=r?r.apply(u[n],a):void 0;n&&(v&&v.exports!==t&&v.exports!==u[n]?u[n]=v.exports:d===t&&tt||(u[n]=d))}else n&&(u[n]=r)};n=i=o=function(n,i,r,u,e){if("string"==typeof n)return s[n]?s[n](i):l(y(n,b(i)).f);if(!n.splice){if(f=n,f.deps&&o(f.deps,f.callback),!i)return;i.splice?(n=i,i=r,r=null):n=t}return i=i||function(){},"function"==typeof r&&(r=u,u=e),u?a(t,n,i,r):setTimeout(function(){a(t,n,i,r)},4),o};o.config=function(n){return o(n)};n._defined=u;r=function(n,t,i){if("string"!=typeof n)throw new Error("See almond README: incorrect module build, no module name");t.splice||(i=t,t=[]);e(u,n)||e(h,n)||(h[n]=[n,t,i])};r.amd={jQuery:!0}}();t.requirejs=n;t.require=i;t.define=r}}(),t.define("almond",function(){}),t.define("jquery",[],function(){var t=n||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(n){function r(n){var i=n.prototype,r=[];for(var t in i)"function"==typeof i[t]&&"constructor"!==t&&r.push(t);return r}var t={},i;return t.Extend=function(n,t){function r(){this.constructor=n}var u={}.hasOwnProperty;for(var i in t)u.call(t,i)&&(n[i]=t[i]);return r.prototype=t.prototype,n.prototype=new r,n.__super__=t.prototype,n},t.Decorate=function(n,t){function i(){var r=Array.prototype.unshift,u=t.prototype.constructor.length,i=n.prototype.constructor;u>0&&(r.call(arguments,n.prototype.constructor),i=t.prototype.constructor);i.apply(this,arguments)}function l(){this.constructor=i}var s=r(t),h=r(n),u,e,c,f,o;for(t.displayName=n.displayName,i.prototype=new l,u=0;u<h.length;u++)e=h[u],i.prototype[e]=n.prototype[e];for(c=function(n){var r=function(){},u;return n in i.prototype&&(r=i.prototype[n]),u=t.prototype[n],function(){return Array.prototype.unshift.call(arguments,r),u.apply(this,arguments)}},f=0;f<s.length;f++)o=s[f],i.prototype[o]=c(o);return i},i=function(){this.listeners={}},i.prototype.on=function(n,t){this.listeners=this.listeners||{};n in this.listeners?this.listeners[n].push(t):this.listeners[n]=[t]},i.prototype.trigger=function(n){var i=Array.prototype.slice,t=i.call(arguments,1);this.listeners=this.listeners||{};null==t&&(t=[]);0===t.length&&t.push({});t[0]._type=n;n in this.listeners&&this.invoke(this.listeners[n],i.call(arguments,1));"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(n,t){for(var i=0,r=n.length;i<r;i++)n[i].apply(this,t)},t.Observable=i,t.generateChars=function(n){for(var t="",i=0;i<n;i++)t+=Math.floor(36*Math.random()).toString(36);return t},t.bind=function(n,t){return function(){n.apply(t,arguments)}},t._convertData=function(n){var f,r,i,u,t;for(f in n)if(r=f.split("-"),i=n,1!==r.length){for(u=0;u<r.length;u++)t=r[u],t=t.substring(0,1).toLowerCase()+t.substring(1),t in i||(i[t]={}),u==r.length-1&&(i[t]=n[f]),i=i[t];delete n[f]}return n},t.hasScroll=function(t,i){var u=n(i),f=i.style.overflowX,r=i.style.overflowY;return(f!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===f||"scroll"===r||u.innerHeight()<i.scrollHeight||u.innerWidth()<i.scrollWidth)},t.escapeMarkup=function(n){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof n?n:String(n).replace(/[&<>"'\/\\]/g,function(n){return t[n]})},t.appendMany=function(t,i){if("1.7"===n.fn.jquery.substr(0,3)){var r=n();n.map(i,function(n){r=r.add(n)});i=r}t.append(i)},t}),t.define("select2/results",["jquery","./utils"],function(n,t){function i(n,t,r){this.$element=n;this.data=r;this.options=t;i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=n('<ul class="select2-results__options" role="tree"><\/ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(t){var u=this.options.get("escapeMarkup"),i,r;this.clear();this.hideLoading();i=n('<li role="treeitem" aria-live="assertive" class="select2-results__option"><\/li>');r=this.options.get("translations").get(t.message);i.append(u(r(t.args)));i[0].className+=" select2-results__message";this.$results.append(i)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(n){var i,t,r,u;if(this.hideLoading(),i=[],null==n.results||0===n.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));for(n.results=this.sort(n.results),t=0;t<n.results.length;t++)r=n.results[t],u=this.option(r),i.push(u);this.$results.append(i)},i.prototype.position=function(n,t){t.find(".select2-results").append(n)},i.prototype.sort=function(n){return this.options.get("sorter")(n)},i.prototype.highlightFirstItem=function(){var n=this.$results.find(".select2-results__option[aria-selected]"),t=n.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):n.first().trigger("mouseenter");this.ensureHighlightVisible()},i.prototype.setClasses=function(){var t=this;this.data.current(function(i){var r=n.map(i,function(n){return n.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var i=n(this),t=n.data(this,"data"),u=""+t.id;null!=t.element&&t.element.selected||null==t.element&&n.inArray(u,r)>-1?i.attr("aria-selected","true"):i.attr("aria-selected","false")})})},i.prototype.showLoading=function(n){this.hideLoading();var i=this.options.get("translations").get("searching"),r={disabled:!0,loading:!0,text:i(n)},t=this.option(r);t.className+=" loading-results";this.$results.prepend(t)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(t){var r=document.createElement("li"),i,e,c,o,u,s,f,l,a,h;r.className="select2-results__option";i={role:"treeitem","aria-selected":"false"};t.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true");null==t.id&&delete i["aria-selected"];null!=t._resultId&&(r.id=t._resultId);t.title&&(r.title=t.title);t.children&&(i.role="group",i["aria-label"]=t.text,delete i["aria-selected"]);for(e in i)c=i[e],r.setAttribute(e,c);if(t.children){for(o=n(r),u=document.createElement("strong"),u.className="select2-results__group",n(u),this.template(t,u),s=[],f=0;f<t.children.length;f++)l=t.children[f],a=this.option(l),s.push(a);h=n("<ul><\/ul>",{"class":"select2-results__options select2-results__options--nested"});h.append(s);o.append(u);o.append(h)}else this.template(t,r);return n.data(r,"data",t),r},i.prototype.bind=function(t){var i=this,r=t.id+"-results";this.$results.attr("id",r);t.on("results:all",function(n){i.clear();i.append(n.data);t.isOpen()&&(i.setClasses(),i.highlightFirstItem())});t.on("results:append",function(n){i.append(n.data);t.isOpen()&&i.setClasses()});t.on("query",function(n){i.hideMessages();i.showLoading(n)});t.on("select",function(){t.isOpen()&&(i.setClasses(),i.highlightFirstItem())});t.on("unselect",function(){t.isOpen()&&(i.setClasses(),i.highlightFirstItem())});t.on("open",function(){i.$results.attr("aria-expanded","true");i.$results.attr("aria-hidden","false");i.setClasses();i.ensureHighlightVisible()});t.on("close",function(){i.$results.attr("aria-expanded","false");i.$results.attr("aria-hidden","true");i.$results.removeAttr("aria-activedescendant")});t.on("results:toggle",function(){var n=i.getHighlightedResults();0!==n.length&&n.trigger("mouseup")});t.on("results:select",function(){var n=i.getHighlightedResults(),t;0!==n.length&&(t=n.data("data"),"true"==n.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:t}))});t.on("results:previous",function(){var r=i.getHighlightedResults(),u=i.$results.find("[aria-selected]"),f=u.index(r),n,t;if(0!==f){n=f-1;0===r.length&&(n=0);t=u.eq(n);t.trigger("mouseenter");var e=i.$results.offset().top,o=t.offset().top,s=i.$results.scrollTop()+(o-e);0===n?i.$results.scrollTop(0):o-e<0&&i.$results.scrollTop(s)}});t.on("results:next",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),o=t.index(e),r=o+1,n;if(!(r>=t.length)){n=t.eq(r);n.trigger("mouseenter");var u=i.$results.offset().top+i.$results.outerHeight(!1),f=n.offset().top+n.outerHeight(!1),s=i.$results.scrollTop()+f-u;0===r?i.$results.scrollTop(0):f>u&&i.$results.scrollTop(s)}});t.on("results:focus",function(n){n.element.addClass("select2-results__option--highlighted")});t.on("results:message",function(n){i.displayMessage(n)});n.fn.mousewheel&&this.$results.on("mousewheel",function(n){var t=i.$results.scrollTop(),r=i.$results.get(0).scrollHeight-t+n.deltaY,u=n.deltaY>0&&t-n.deltaY<=0,f=n.deltaY<0&&r<=i.$results.height();u?(i.$results.scrollTop(0),n.preventDefault(),n.stopPropagation()):f&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),n.preventDefault(),n.stopPropagation())});this.$results.on("mouseup",".select2-results__option[aria-selected]",function(t){var r=n(this),u=r.data("data");if("true"===r.attr("aria-selected"))return void(i.options.get("multiple")?i.trigger("unselect",{originalEvent:t,data:u}):i.trigger("close",{}));i.trigger("select",{originalEvent:t,data:u})});this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var t=n(this).data("data");i.getHighlightedResults().removeClass("select2-results__option--highlighted");i.trigger("results:focus",{data:t,element:n(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var n=this.getHighlightedResults();if(0!==n.length){var f=this.$results.find("[aria-selected]"),e=f.index(n),t=this.$results.offset().top,i=n.offset().top,r=this.$results.scrollTop()+(i-t),u=i-t;r-=2*n.outerHeight(!1);e<=2?this.$results.scrollTop(0):(u>this.$results.outerHeight()||u<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(t,i){var u=this.options.get("templateResult"),f=this.options.get("escapeMarkup"),r=u(t,i);null==r?i.style.display="none":"string"==typeof r?i.innerHTML=f(r):n(i).append(r)},i}),t.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),t.define("select2/selection/base",["jquery","../utils","../keys"],function(n,t,i){function r(n,t){this.$element=n;this.options=t;r.__super__.constructor.call(this)}return t.Extend(r,t.Observable),r.prototype.render=function(){var t=n('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"><\/span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},r.prototype.bind=function(n){var t=this,r=(n.id,n.id+"-results");this.container=n;this.$selection.on("focus",function(n){t.trigger("focus",n)});this.$selection.on("blur",function(n){t._handleBlur(n)});this.$selection.on("keydown",function(n){t.trigger("keypress",n);n.which===i.SPACE&&n.preventDefault()});n.on("results:focus",function(n){t.$selection.attr("aria-activedescendant",n.data._resultId)});n.on("selection:update",function(n){t.update(n.data)});n.on("open",function(){t.$selection.attr("aria-expanded","true");t.$selection.attr("aria-owns",r);t._attachCloseHandler(n)});n.on("close",function(){t.$selection.attr("aria-expanded","false");t.$selection.removeAttr("aria-activedescendant");t.$selection.removeAttr("aria-owns");t.$selection.focus();t._detachCloseHandler(n)});n.on("enable",function(){t.$selection.attr("tabindex",t._tabindex)});n.on("disable",function(){t.$selection.attr("tabindex","-1")})},r.prototype._handleBlur=function(t){var i=this;window.setTimeout(function(){document.activeElement==i.$selection[0]||n.contains(i.$selection[0],document.activeElement)||i.trigger("blur",t)},1)},r.prototype._attachCloseHandler=function(t){n(document.body).on("mousedown.select2."+t.id,function(t){var i=n(t.target),r=i.closest(".select2");n(".select2.select2-container--open").each(function(){var t=n(this);this!=r[0]&&t.data("element").select2("close")})})},r.prototype._detachCloseHandler=function(t){n(document.body).off("mousedown.select2."+t.id)},r.prototype.position=function(n,t){t.find(".selection").append(n)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.");},r}),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(n,t,i){function r(){r.__super__.constructor.apply(this,arguments)}return i.Extend(r,t),r.prototype.render=function(){var n=r.__super__.render.call(this);return n.addClass("select2-selection--single"),n.html('<span class="select2-selection__rendered"><\/span><span class="select2-selection__arrow" role="presentation"><b role="presentation"><\/b><\/span>'),n},r.prototype.bind=function(n){var t=this,i;r.__super__.bind.apply(this,arguments);i=n.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i);this.$selection.attr("aria-labelledby",i);this.$selection.on("mousedown",function(n){1===n.which&&t.trigger("toggle",{originalEvent:n})});this.$selection.on("focus",function(){});this.$selection.on("blur",function(){});n.on("focus",function(){n.isOpen()||t.$selection.focus()});n.on("selection:update",function(n){t.update(n.data)})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(n,t){var i=this.options.get("templateSelection");return this.options.get("escapeMarkup")(i(n,t))},r.prototype.selectionContainer=function(){return n("<span><\/span>")},r.prototype.update=function(n){if(0===n.length)return void this.clear();var t=n[0],i=this.$selection.find(".select2-selection__rendered"),r=this.display(t,i);i.empty().append(r);i.prop("title",t.title||t.text)},r}),t.define("select2/selection/multiple",["jquery","./base","../utils"],function(n,t,i){function r(){r.__super__.constructor.apply(this,arguments)}return i.Extend(r,t),r.prototype.render=function(){var n=r.__super__.render.call(this);return n.addClass("select2-selection--multiple"),n.html('<ul class="select2-selection__rendered"><\/ul>'),n},r.prototype.bind=function(){var t=this;r.__super__.bind.apply(this,arguments);this.$selection.on("click",function(n){t.trigger("toggle",{originalEvent:n})});this.$selection.on("click",".select2-selection__choice__remove",function(i){if(!t.options.get("disabled")){var r=n(this),u=r.parent(),f=u.data("data");t.trigger("unselect",{originalEvent:i,data:f})}})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(n,t){var i=this.options.get("templateSelection");return this.options.get("escapeMarkup")(i(n,t))},r.prototype.selectionContainer=function(){return n('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;<\/span><\/li>')},r.prototype.update=function(n){var f,r,e;if(this.clear(),0!==n.length){for(f=[],r=0;r<n.length;r++){var u=n[r],t=this.selectionContainer(),o=this.display(u,t);t.append(o);t.prop("title",u.title||u.text);t.data("data",u);f.push(t)}e=this.$selection.find(".select2-selection__rendered");i.appendMany(e,f)}},r}),t.define("select2/selection/placeholder",["../utils"],function(){function n(n,t,i){this.placeholder=this.normalizePlaceholder(i.get("placeholder"));n.call(this,t,i)}return n.prototype.normalizePlaceholder=function(n,t){return"string"==typeof t&&(t={id:"",text:t}),t},n.prototype.createPlaceholder=function(n,t){var i=this.selectionContainer();return i.html(this.display(t)),i.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),i},n.prototype.update=function(n,t){var r=1==t.length&&t[0].id!=this.placeholder.id,i;if(t.length>1||r)return n.call(this,t);this.clear();i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},n}),t.define("select2/selection/allowClear",["jquery","../keys"],function(n,t){function i(){}return i.prototype.bind=function(n,t,i){var r=this;n.call(this,t,i);null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option.");this.$selection.on("mousedown",".select2-selection__clear",function(n){r._handleClear(n)});t.on("keypress",function(n){r._handleKeyboardClear(n,t)})},i.prototype._handleClear=function(n,t){var r,u,i,f;if(!this.options.get("disabled")&&(r=this.$selection.find(".select2-selection__clear"),0!==r.length)){for(t.stopPropagation(),u=r.data("data"),i=0;i<u.length;i++)if(f={data:u[i]},this.trigger("unselect",f),f.prevented)return;this.$element.val(this.placeholder.id).trigger("change");this.trigger("toggle",{})}},i.prototype._handleKeyboardClear=function(n,i,r){r.isOpen()||i.which!=t.DELETE&&i.which!=t.BACKSPACE||this._handleClear(i)},i.prototype.update=function(t,i){if(t.call(this,i),!(this.$selection.find(".select2-selection__placeholder").length>0||0===i.length)){var r=n('<span class="select2-selection__clear">&times;<\/span>');r.data("data",i);this.$selection.find(".select2-selection__rendered").prepend(r)}},i}),t.define("select2/selection/search",["jquery","../utils","../keys"],function(n,t,i){function r(n,t,i){n.call(this,t,i)}return r.prototype.render=function(t){var i=n('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /><\/li>'),r;return this.$searchContainer=i,this.$search=i.find("input"),r=t.call(this),this._transferTabIndex(),r},r.prototype.bind=function(n,t,r){var u=this,f,e;n.call(this,t,r);t.on("open",function(){u.$search.trigger("focus")});t.on("close",function(){u.$search.val("");u.$search.removeAttr("aria-activedescendant");u.$search.trigger("focus")});t.on("enable",function(){u.$search.prop("disabled",!1);u._transferTabIndex()});t.on("disable",function(){u.$search.prop("disabled",!0)});t.on("focus",function(){u.$search.trigger("focus")});t.on("results:focus",function(n){u.$search.attr("aria-activedescendant",n.id)});this.$selection.on("focusin",".select2-search--inline",function(n){u.trigger("focus",n)});this.$selection.on("focusout",".select2-search--inline",function(n){u._handleBlur(n)});this.$selection.on("keydown",".select2-search--inline",function(n){var t,r;(n.stopPropagation(),u.trigger("keypress",n),u._keyUpPrevented=n.isDefaultPrevented(),n.which===i.BACKSPACE&&""===u.$search.val())&&(t=u.$searchContainer.prev(".select2-selection__choice"),t.length>0&&(r=t.data("data"),u.searchRemoveChoice(r),n.preventDefault()))});f=document.documentMode;e=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(){if(e)return void u.$selection.off("input.search input.searchcheck");u.$selection.off("keyup.search")});this.$selection.on("keyup.search input.search",".select2-search--inline",function(n){if(e&&"input"===n.type)return void u.$selection.off("input.search input.searchcheck");var t=n.which;t!=i.SHIFT&&t!=i.CTRL&&t!=i.ALT&&t!=i.TAB&&u.handleSearch(n)})},r.prototype._transferTabIndex=function(){this.$search.attr("tabindex",this.$selection.attr("tabindex"));this.$selection.attr("tabindex","-1")},r.prototype.createPlaceholder=function(n,t){this.$search.attr("placeholder",t.text)},r.prototype.update=function(n,t){var i=this.$search[0]==document.activeElement;this.$search.attr("placeholder","");n.call(this,t);this.$selection.find(".select2-selection__rendered").append(this.$searchContainer);this.resizeSearch();i&&this.$search.focus()},r.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var n=this.$search.val();this.trigger("query",{term:n})}this._keyUpPrevented=!1},r.prototype.searchRemoveChoice=function(n,t){this.trigger("unselect",{data:t});this.$search.val(t.text);this.handleSearch()},r.prototype.resizeSearch=function(){this.$search.css("width","25px");var n="";n=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").innerWidth():.75*(this.$search.val().length+1)+"em";this.$search.css("width",n)},r}),t.define("select2/selection/eventRelay",["jquery"],function(n){function t(){}return t.prototype.bind=function(t,i,r){var u=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],e=["opening","closing","selecting","unselecting"];t.call(this,i,r);i.on("*",function(t,i){if(-1!==n.inArray(t,f)){i=i||{};var r=n.Event("select2:"+t,{params:i});u.$element.trigger(r);-1!==n.inArray(t,e)&&(i.prevented=r.isDefaultPrevented())}})},t}),t.define("select2/translation",["jquery","require"],function(n,t){function i(n){this.dict=n||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(n){return this.dict[n]},i.prototype.extend=function(t){this.dict=n.extend({},t.all(),this.dict)},i._cache={},i.loadPath=function(n){if(!(n in i._cache)){var r=t(n);i._cache[n]=r}return new i(i._cache[n])},i}),t.define("select2/diacritics",[],function(){return{"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),t.define("select2/data/base",["../utils"],function(n){function t(){t.__super__.constructor.call(this)}return n.Extend(t,n.Observable),t.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.");},t.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.");},t.prototype.bind=function(){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,i){var r=t.id+"-result-";return r+=n.generateChars(4),r+=null!=i.id?"-"+i.id.toString():"-"+n.generateChars(4),r},t}),t.define("select2/data/select",["./base","../utils","jquery"],function(n,t,i){function r(n,t){this.$element=n;this.options=t;r.__super__.constructor.call(this)}return t.Extend(r,n),r.prototype.current=function(n){var t=[],r=this;this.$element.find(":selected").each(function(){var n=i(this),u=r.item(n);t.push(u)});n(t)},r.prototype.select=function(n){var t=this,r;if(n.selected=!0,i(n.element).is("option"))return n.element.selected=!0,void this.$element.trigger("change");this.$element.prop("multiple")?this.current(function(r){var f=[],u,e;for(n=[n],n.push.apply(n,r),u=0;u<n.length;u++)e=n[u].id,-1===i.inArray(e,f)&&f.push(e);t.$element.val(f);t.$element.trigger("change")}):(r=n.id,this.$element.val(r),this.$element.trigger("change"))},r.prototype.unselect=function(n){var t=this;if(this.$element.prop("multiple")){if(n.selected=!1,i(n.element).is("option"))return n.element.selected=!1,void this.$element.trigger("change");this.current(function(r){for(var e,u=[],f=0;f<r.length;f++)e=r[f].id,e!==n.id&&-1===i.inArray(e,u)&&u.push(e);t.$element.val(u);t.$element.trigger("change")})}},r.prototype.bind=function(n){var t=this;this.container=n;n.on("select",function(n){t.select(n.data)});n.on("unselect",function(n){t.unselect(n.data)})},r.prototype.destroy=function(){this.$element.find("*").each(function(){i.removeData(this,"data")})},r.prototype.query=function(n,t){var r=[],u=this;this.$element.children().each(function(){var t=i(this),e,f;(t.is("option")||t.is("optgroup"))&&(e=u.item(t),f=u.matches(n,e),null!==f&&r.push(f))});t({results:r})},r.prototype.addOptions=function(n){t.appendMany(this.$element,n)},r.prototype.option=function(n){var t,u,r;return n.children?(t=document.createElement("optgroup"),t.label=n.text):(t=document.createElement("option"),void 0!==t.textContent?t.textContent=n.text:t.innerText=n.text),void 0!==n.id&&(t.value=n.id),n.disabled&&(t.disabled=!0),n.selected&&(t.selected=!0),n.title&&(t.title=n.title),u=i(t),r=this._normalizeItem(n),r.element=t,i.data(t,"data",r),u},r.prototype.item=function(n){var t={},e,o;if(null!=(t=i.data(n[0],"data")))return t;if(n.is("option"))t={id:n.val(),text:n.text(),disabled:n.prop("disabled"),selected:n.prop("selected"),title:n.prop("title")};else if(n.is("optgroup")){t={text:n.prop("label"),children:[],title:n.prop("title")};for(var u=n.children("option"),f=[],r=0;r<u.length;r++)e=i(u[r]),o=this.item(e),f.push(o);t.children=f}return t=this._normalizeItem(t),t.element=n[0],i.data(n[0],"data",t),t},r.prototype._normalizeItem=function(n){i.isPlainObject(n)||(n={id:n,text:n});n=i.extend({},{text:""},n);return null!=n.id&&(n.id=n.id.toString()),null!=n.text&&(n.text=n.text.toString()),null==n._resultId&&n.id&&null!=this.container&&(n._resultId=this.generateResultId(this.container,n)),i.extend({},{selected:!1,disabled:!1},n)},r.prototype.matches=function(n,t){return this.options.get("matcher")(n,t)},r}),t.define("select2/data/array",["./select","../utils","jquery"],function(n,t,i){function r(n,t){var i=t.get("data")||[];r.__super__.constructor.call(this,n,t);this.addOptions(this.convertToOptions(i))}return t.Extend(r,n),r.prototype.select=function(n){var t=this.$element.find("option").filter(function(t,i){return i.value==n.id.toString()});0===t.length&&(t=this.option(n),this.addOptions(t));r.__super__.select.call(this,n)},r.prototype.convertToOptions=function(n){function c(n){return function(){return i(this).val()==n.id}}for(var r,f,h,l=this,e=this.$element.find("option"),a=e.map(function(){return l.item(i(this)).id}).get(),o=[],u=0;u<n.length;u++)if(r=this._normalizeItem(n[u]),i.inArray(r.id,a)>=0){var s=e.filter(c(r)),v=this.item(s),y=i.extend(!0,{},r,v),p=this.option(y);s.replaceWith(p)}else f=this.option(r),r.children&&(h=this.convertToOptions(r.children),t.appendMany(f,h)),o.push(f);return o},r}),t.define("select2/data/ajax",["./array","../utils","jquery"],function(n,t,i){function r(n,t){this.ajaxOptions=this._applyDefaults(t.get("ajax"));null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults);r.__super__.constructor.call(this,n,t)}return t.Extend(r,n),r.prototype._applyDefaults=function(n){var t={data:function(n){return i.extend({},n,{q:n.term})},transport:function(n,t,r){var u=i.ajax(n);return u.then(t),u.fail(r),u}};return i.extend({},t,n,!0)},r.prototype.processResults=function(n){return n},r.prototype.query=function(n,t){function f(){var f=r.transport(r,function(r){var f=u.processResults(r,n);u.options.get("debug")&&window.console&&console.error&&(f&&f.results&&i.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response."));t(f)},function(){f.status&&"0"===f.status||u.trigger("results:message",{message:"errorLoading"})});u._request=f}var u=this,r;null!=this._request&&(i.isFunction(this._request.abort)&&this._request.abort(),this._request=null);r=i.extend({type:"GET"},this.ajaxOptions);"function"==typeof r.url&&(r.url=r.url.call(this.$element,n));"function"==typeof r.data&&(r.data=r.data.call(this.$element,n));this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(f,this.ajaxOptions.delay)):f()},r}),t.define("select2/data/tags",["jquery"],function(n){function t(t,i,r){var f=r.get("tags"),o=r.get("createTag"),e,u;if(void 0!==o&&(this.createTag=o),e=r.get("insertTag"),void 0!==e&&(this.insertTag=e),t.call(this,i,r),n.isArray(f))for(u=0;u<f.length;u++){var s=f[u],h=this._normalizeItem(s),c=this.option(h);this.$element.append(c)}}return t.prototype.query=function(n,t,i){function u(n,f){for(var s,l,h,c,e=n.results,o=0;o<e.length;o++)if(s=e[o],l=null!=s.children&&!u({results:s.children},!0),(s.text||"").toUpperCase()===(t.term||"").toUpperCase()||l)return!f&&(n.data=e,void i(n));if(f)return!0;h=r.createTag(t);null!=h&&(c=r.option(h),c.attr("data-select2-tag",!0),r.addOptions([c]),r.insertTag(e,h));n.results=e;i(n)}var r=this;if(this._removeOldTags(),null==t.term||null!=t.page)return void n.call(this,t,i);n.call(this,t,u)},t.prototype.createTag=function(t,i){var r=n.trim(i.term);return""===r?null:{id:r,text:r}},t.prototype.insertTag=function(n,t,i){t.unshift(i)},t.prototype._removeOldTags=function(){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||n(this).remove()})},t}),t.define("select2/data/tokenizer",["jquery"],function(n){function t(n,t,i){var r=i.get("tokenizer");void 0!==r&&(this.tokenizer=r);n.call(this,t,i)}return t.prototype.bind=function(n,t,i){n.call(this,t,i);this.$search=t.dropdown.$search||t.selection.$search||i.find(".select2-search__field")},t.prototype.query=function(t,i,r){function e(t){var i=u._normalizeItem(t),r;u.$element.find("option").filter(function(){return n(this).val()===i.id}).length||(r=u.option(i),r.attr("data-select2-tag",!0),u._removeOldTags(),u.addOptions([r]));o(i)}function o(n){u.trigger("select",{data:n})}var u=this,f;i.term=i.term||"";f=this.tokenizer(i,this.options,e);f.term!==i.term&&(this.$search.length&&(this.$search.val(f.term),this.$search.focus()),i.term=f.term);t.call(this,i,r)},t.prototype.tokenizer=function(t,i,r,u){for(var o,h=r.get("tokenSeparators")||[],e=i.term,f=0,c=this.createTag||function(n){return{id:n.term,text:n.term}};f<e.length;)if(o=e[f],-1!==n.inArray(o,h)){var l=e.substr(0,f),a=n.extend({},i,{term:l}),s=c(a);null!=s?(u(s),e=e.substr(f+1)||"",f=0):f++}else f++;return{term:e}},t}),t.define("select2/data/minimumInputLength",[],function(){function n(n,t,i){this.minimumInputLength=i.get("minimumInputLength");n.call(this,t,i)}return n.prototype.query=function(n,t,i){if(t.term=t.term||"",t.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}});n.call(this,t,i)},n}),t.define("select2/data/maximumInputLength",[],function(){function n(n,t,i){this.maximumInputLength=i.get("maximumInputLength");n.call(this,t,i)}return n.prototype.query=function(n,t,i){if(t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}});n.call(this,t,i)},n}),t.define("select2/data/maximumSelectionLength",[],function(){function n(n,t,i){this.maximumSelectionLength=i.get("maximumSelectionLength");n.call(this,t,i)}return n.prototype.query=function(n,t,i){var r=this;this.current(function(u){var f=null!=u?u.length:0;if(r.maximumSelectionLength>0&&f>=r.maximumSelectionLength)return void r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}});n.call(r,t,i)})},n}),t.define("select2/dropdown",["jquery","./utils"],function(n,t){function i(n,t){this.$element=n;this.options=t;i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=n('<span class="select2-dropdown"><span class="select2-results"><\/span><\/span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},i.prototype.bind=function(){},i.prototype.position=function(){},i.prototype.destroy=function(){this.$dropdown.remove()},i}),t.define("select2/dropdown/search",["jquery","../utils"],function(n){function t(){}return t.prototype.render=function(t){var r=t.call(this),i=n('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /><\/span>');return this.$searchContainer=i,this.$search=i.find("input"),r.prepend(i),r},t.prototype.bind=function(t,i,r){var u=this;t.call(this,i,r);this.$search.on("keydown",function(n){u.trigger("keypress",n);u._keyUpPrevented=n.isDefaultPrevented()});this.$search.on("input",function(){n(this).off("keyup")});this.$search.on("keyup input",function(n){u.handleSearch(n)});i.on("open",function(){u.$search.attr("tabindex",0);u.$search.focus();window.setTimeout(function(){u.$search.focus()},0)});i.on("close",function(){u.$search.attr("tabindex",-1);u.$search.val("")});i.on("focus",function(){i.isOpen()||u.$search.focus()});i.on("results:all",function(n){(null==n.query.term||""===n.query.term)&&(u.showSearch(n)?u.$searchContainer.removeClass("select2-search--hide"):u.$searchContainer.addClass("select2-search--hide"))})},t.prototype.handleSearch=function(){if(!this._keyUpPrevented){var n=this.$search.val();this.trigger("query",{term:n})}this._keyUpPrevented=!1},t.prototype.showSearch=function(){return!0},t}),t.define("select2/dropdown/hidePlaceholder",[],function(){function n(n,t,i,r){this.placeholder=this.normalizePlaceholder(i.get("placeholder"));n.call(this,t,i,r)}return n.prototype.append=function(n,t){t.results=this.removePlaceholder(t.results);n.call(this,t)},n.prototype.normalizePlaceholder=function(n,t){return"string"==typeof t&&(t={id:"",text:t}),t},n.prototype.removePlaceholder=function(n,t){for(var u,r=t.slice(0),i=t.length-1;i>=0;i--)u=t[i],this.placeholder.id===u.id&&r.splice(i,1);return r},n}),t.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function t(n,t,i,r){this.lastParams={};n.call(this,t,i,r);this.$loadingMore=this.createLoadingMore();this.loading=!1}return t.prototype.append=function(n,t){this.$loadingMore.remove();this.loading=!1;n.call(this,t);this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,i,r){var u=this;t.call(this,i,r);i.on("query",function(n){u.lastParams=n;u.loading=!0});i.on("query:append",function(n){u.lastParams=n;u.loading=!0});this.$results.on("scroll",function(){var t=n.contains(document.documentElement,u.$loadingMore[0]);!u.loading&&t&&u.$results.offset().top+u.$results.outerHeight(!1)+50>=u.$loadingMore.offset().top+u.$loadingMore.outerHeight(!1)&&u.loadMore()})},t.prototype.loadMore=function(){this.loading=!0;var t=n.extend({},{page:1},this.lastParams);t.page++;this.trigger("query:append",t)},t.prototype.showLoadingMore=function(n,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=n('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"><\/li>'),i=this.options.get("translations").get("loadingMore");return t.html(i(this.lastParams)),t},t}),t.define("select2/dropdown/attachBody",["jquery","../utils"],function(n,t){function i(t,i,r){this.$dropdownParent=r.get("dropdownParent")||n(document.body);t.call(this,i,r)}return i.prototype.bind=function(n,t,i){var r=this,u=!1;n.call(this,t,i);t.on("open",function(){r._showDropdown();r._attachPositioningHandler(t);u||(u=!0,t.on("results:all",function(){r._positionDropdown();r._resizeDropdown()}),t.on("results:append",function(){r._positionDropdown();r._resizeDropdown()}))});t.on("close",function(){r._hideDropdown();r._detachPositioningHandler(t)});this.$dropdownContainer.on("mousedown",function(n){n.stopPropagation()})},i.prototype.destroy=function(n){n.call(this);this.$dropdownContainer.remove()},i.prototype.position=function(n,t,i){t.attr("class",i.attr("class"));t.removeClass("select2");t.addClass("select2-container--open");t.css({position:"absolute",top:-999999});this.$container=i},i.prototype.render=function(t){var i=n("<span><\/span>"),r=t.call(this);return i.append(r),this.$dropdownContainer=i,i},i.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},i.prototype._attachPositioningHandler=function(i,r){var u=this,f="scroll.select2."+r.id,o="resize.select2."+r.id,s="orientationchange.select2."+r.id,e=this.$container.parents().filter(t.hasScroll);e.each(function(){n(this).data("select2-scroll-position",{x:n(this).scrollLeft(),y:n(this).scrollTop()})});e.on(f,function(){var t=n(this).data("select2-scroll-position");n(this).scrollTop(t.y)});n(window).on(f+" "+o+" "+s,function(){u._positionDropdown();u._resizeDropdown()})},i.prototype._detachPositioningHandler=function(i,r){var u="scroll.select2."+r.id,f="resize.select2."+r.id,e="orientationchange.select2."+r.id;this.$container.parents().filter(t.hasScroll).off(u);n(window).off(u+" "+f+" "+e)},i.prototype._positionDropdown=function(){var s=n(window),u=this.$dropdown.hasClass("select2-dropdown--above"),v=this.$dropdown.hasClass("select2-dropdown--below"),t=null,i=this.$container.offset(),r,o;i.bottom=i.top+this.$container.outerHeight(!1);r={height:this.$container.outerHeight(!1)};r.top=i.top;r.bottom=i.top+r.height;var h={height:this.$dropdown.outerHeight(!1)},c={top:s.scrollTop(),bottom:s.scrollTop()+s.height()},l=c.top<i.top-h.height,a=c.bottom>i.bottom+h.height,f={left:i.left,top:r.bottom},e=this.$dropdownParent;"static"===e.css("position")&&(e=e.offsetParent());o=e.offset();f.top-=o.top;f.left-=o.left;u||v||(t="below");a||!l||u?!l&&a&&u&&(t="below"):t="above";("above"==t||u&&"below"!==t)&&(f.top=r.top-o.top-h.height);null!=t&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+t),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+t));this.$dropdownContainer.css(f)},i.prototype._resizeDropdown=function(){var n={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(n.minWidth=n.width,n.position="relative",n.width="auto");this.$dropdown.css(n)},i.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent);this._positionDropdown();this._resizeDropdown()},i}),t.define("select2/dropdown/minimumResultsForSearch",[],function(){function n(t){for(var u,i=0,r=0;r<t.length;r++)u=t[r],u.children?i+=n(u.children):i++;return i}function t(n,t,i,r){this.minimumResultsForSearch=i.get("minimumResultsForSearch");this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0);n.call(this,t,i,r)}return t.prototype.showSearch=function(t,i){return!(n(i.data.results)<this.minimumResultsForSearch)&&t.call(this,i)},t}),t.define("select2/dropdown/selectOnClose",[],function(){function n(){}return n.prototype.bind=function(n,t,i){var r=this;n.call(this,t,i);t.on("close",function(n){r._handleSelectOnClose(n)})},n.prototype._handleSelectOnClose=function(n,t){var r,u,i;t&&null!=t.originalSelect2Event&&(r=t.originalSelect2Event,"select"===r._type||"unselect"===r._type)||(u=this.getHighlightedResults(),u.length<1||(i=u.data("data"),null!=i.element&&i.element.selected||null==i.element&&i.selected||this.trigger("select",{data:i})))},n}),t.define("select2/dropdown/closeOnSelect",[],function(){function n(){}return n.prototype.bind=function(n,t,i){var r=this;n.call(this,t,i);t.on("select",function(n){r._selectTriggered(n)});t.on("unselect",function(n){r._selectTriggered(n)})},n.prototype._selectTriggered=function(n,t){var i=t.originalEvent;i&&i.ctrlKey||this.trigger("close",{originalEvent:i,originalSelect2Event:t})},n}),t.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(n){var t=n.input.length-n.maximum,i="Please delete "+t+" character";return 1!=t&&(i+="s"),i},inputTooShort:function(n){return"Please enter "+(n.minimum-n.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(n){var t="You can only select "+n.maximum+" item";return 1!=n.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot){function st(){this.reset()}return st.prototype.apply=function(l){var vt,yt,pt,wt,bt,kt,dt,ct,lt,st,ot,ht,gt,at;if((l=n.extend(!0,{},this.defaults,l),null==l.dataAdapter)&&((l.dataAdapter=null!=l.ajax?y:null!=l.data?v:a,l.minimumInputLength>0&&(l.dataAdapter=h.Decorate(l.dataAdapter,b)),l.maximumInputLength>0&&(l.dataAdapter=h.Decorate(l.dataAdapter,k)),l.maximumSelectionLength>0&&(l.dataAdapter=h.Decorate(l.dataAdapter,d)),l.tags&&(l.dataAdapter=h.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=h.Decorate(l.dataAdapter,w)),null!=l.query)&&(vt=t(l.amdBase+"compat/query"),l.dataAdapter=h.Decorate(l.dataAdapter,vt)),null!=l.initSelection&&(yt=t(l.amdBase+"compat/initSelection"),l.dataAdapter=h.Decorate(l.dataAdapter,yt))),(null==l.resultsAdapter&&(l.resultsAdapter=i,null!=l.ajax&&(l.resultsAdapter=h.Decorate(l.resultsAdapter,it)),null!=l.placeholder&&(l.resultsAdapter=h.Decorate(l.resultsAdapter,tt)),l.selectOnClose&&(l.resultsAdapter=h.Decorate(l.resultsAdapter,ft))),null==l.dropdownAdapter)&&(l.multiple?l.dropdownAdapter=g:(pt=h.Decorate(g,nt),l.dropdownAdapter=pt),(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=h.Decorate(l.dropdownAdapter,ut)),l.closeOnSelect&&(l.dropdownAdapter=h.Decorate(l.dropdownAdapter,et)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass)&&(wt=t(l.amdBase+"compat/dropdownCss"),l.dropdownAdapter=h.Decorate(l.dropdownAdapter,wt)),l.dropdownAdapter=h.Decorate(l.dropdownAdapter,rt)),null==l.selectionAdapter&&((l.selectionAdapter=l.multiple?u:r,null!=l.placeholder&&(l.selectionAdapter=h.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=h.Decorate(l.selectionAdapter,e)),l.multiple&&(l.selectionAdapter=h.Decorate(l.selectionAdapter,o)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass)&&(bt=t(l.amdBase+"compat/containerCss"),l.selectionAdapter=h.Decorate(l.selectionAdapter,bt)),l.selectionAdapter=h.Decorate(l.selectionAdapter,s)),"string"==typeof l.language&&(l.language.indexOf("-")>0?(kt=l.language.split("-"),dt=kt[0],l.language=[l.language,dt]):l.language=[l.language]),n.isArray(l.language)){for(ct=new c,l.language.push("en"),lt=l.language,st=0;st<lt.length;st++){ot=lt[st];ht={};try{ht=c.loadPath(ot)}catch(n){try{ot=this.defaults.amdLanguageBase+ot;ht=c.loadPath(ot)}catch(n){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+ot+'" could not be automatically loaded. A fallback will be used instead.');continue}}ct.extend(ht)}l.translations=ct}else gt=c.loadPath(this.defaults.amdLanguageBase+"en"),at=new c(l.language),at.extend(gt),l.translations=at;return l},st.prototype.reset=function(){function i(n){function t(n){return l[n]||n}return n.replace(/[^\u0000-\u007E]/g,t)}function t(r,u){var f,e,o,s;if(""===n.trim(r.term))return u;if(u.children&&u.children.length>0){for(f=n.extend(!0,{},u),e=u.children.length-1;e>=0;e--)null==t(r,u.children[e])&&f.children.splice(e,1);return f.children.length>0?f:t(r,f)}return o=i(u.text).toUpperCase(),s=i(r.term).toUpperCase(),o.indexOf(s)>-1?u:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:h.escapeMarkup,language:ot,matcher:t,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(n){return n},templateResult:function(n){return n.text},templateSelection:function(n){return n.text},theme:"default",width:"resolve"}},st.prototype.set=function(t,i){var f=n.camelCase(t),r={},u;r[f]=i;u=h._convertData(r);n.extend(this.defaults,u)},new st}),t.define("select2/options",["require","jquery","./defaults","./utils"],function(n,t,i,r){function u(t,u){if(this.options=t,null!=u&&this.fromElement(u),this.options=i.apply(this.options),u&&u.is("input")){var f=n(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=r.Decorate(this.options.dataAdapter,f)}}return u.prototype.fromElement=function(n){var e=["select2"],f,u,i;null==this.options.multiple&&(this.options.multiple=n.prop("multiple"));null==this.options.disabled&&(this.options.disabled=n.prop("disabled"));null==this.options.language&&(n.prop("lang")?this.options.language=n.prop("lang").toLowerCase():n.closest("[lang]").prop("lang")&&(this.options.language=n.closest("[lang]").prop("lang")));null==this.options.dir&&(this.options.dir=n.prop("dir")?n.prop("dir"):n.closest("[dir]").prop("dir")?n.closest("[dir]").prop("dir"):"ltr");n.prop("disabled",this.options.disabled);n.prop("multiple",this.options.multiple);n.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),n.data("data",n.data("select2Tags")),n.data("tags",!0));n.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),n.attr("ajax--url",n.data("ajaxUrl")),n.data("ajax--url",n.data("ajaxUrl")));f={};f=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&n[0].dataset?t.extend(!0,{},n[0].dataset,n.data()):n.data();u=t.extend(!0,{},f);u=r._convertData(u);for(i in u)t.inArray(i,e)>-1||(t.isPlainObject(this.options[i])?t.extend(this.options[i],u[i]):this.options[i]=u[i]);return this},u.prototype.get=function(n){return this.options[n]},u.prototype.set=function(n,t){this.options[n]=t},u}),t.define("select2/core",["jquery","./options","./utils","./keys"],function(n,t,i,r){var u=function(n,i){var f,e,r,o,s,h,c;null!=n.data("select2")&&n.data("select2").destroy();this.$element=n;this.id=this._generateId(n);i=i||{};this.options=new t(i,n);u.__super__.constructor.call(this);f=n.attr("tabindex")||0;n.data("old-tabindex",f);n.attr("tabindex","-1");e=this.options.get("dataAdapter");this.dataAdapter=new e(n,this.options);r=this.render();this._placeContainer(r);o=this.options.get("selectionAdapter");this.selection=new o(n,this.options);this.$selection=this.selection.render();this.selection.position(this.$selection,r);s=this.options.get("dropdownAdapter");this.dropdown=new s(n,this.options);this.$dropdown=this.dropdown.render();this.dropdown.position(this.$dropdown,r);h=this.options.get("resultsAdapter");this.results=new h(n,this.options,this.dataAdapter);this.$results=this.results.render();this.results.position(this.$results,this.$dropdown);c=this;this._bindAdapters();this._registerDomEvents();this._registerDataEvents();this._registerSelectionEvents();this._registerDropdownEvents();this._registerResultsEvents();this._registerEvents();this.dataAdapter.current(function(n){c.trigger("selection:update",{data:n})});n.addClass("select2-hidden-accessible");n.attr("aria-hidden","true");this._syncAttributes();n.data("select2",this)};return i.Extend(u,i.Observable),u.prototype._generateId=function(n){var t="";return t=null!=n.attr("id")?n.attr("id"):null!=n.attr("name")?n.attr("name")+"-"+i.generateChars(2):i.generateChars(4),t=t.replace(/(:|\.|\[|\]|,)/g,""),t="select2-"+t},u.prototype._placeContainer=function(n){n.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&n.css("width",t)},u.prototype._resolveWidth=function(n,t){var r,u,f,s,i;if("resolve"==t)return r=this._resolveWidth(n,"style"),null!=r?r:this._resolveWidth(n,"element");if("element"==t)return u=n.outerWidth(!1),u<=0?"auto":u+"px";if("style"==t){if(f=n.attr("style"),"string"!=typeof f)return null;for(var o=f.split(";"),e=0,h=o.length;e<h;e+=1)if(s=o[e].replace(/\s/g,""),i=s.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==i&&i.length>=1)return i[1];return null}return t},u.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container);this.selection.bind(this,this.$container);this.dropdown.bind(this,this.$container);this.results.bind(this,this.$container)},u.prototype._registerDomEvents=function(){var t=this,r;this.$element.on("change.select2",function(){t.dataAdapter.current(function(n){t.trigger("selection:update",{data:n})})});this.$element.on("focus.select2",function(n){t.trigger("focus",n)});this._syncA=i.bind(this._syncAttributes,this);this._syncS=i.bind(this._syncSubtree,this);this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=r?(this._observer=new r(function(i){n.each(i,t._syncA);n.each(i,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},u.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(t,i){n.trigger(t,i)})},u.prototype._registerSelectionEvents=function(){var t=this,i=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()});this.selection.on("focus",function(n){t.focus(n)});this.selection.on("*",function(r,u){-1===n.inArray(r,i)&&t.trigger(r,u)})},u.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(t,i){n.trigger(t,i)})},u.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(t,i){n.trigger(t,i)})},u.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container.addClass("select2-container--open")});this.on("close",function(){n.$container.removeClass("select2-container--open")});this.on("enable",function(){n.$container.removeClass("select2-container--disabled")});this.on("disable",function(){n.$container.addClass("select2-container--disabled")});this.on("blur",function(){n.$container.removeClass("select2-container--focus")});this.on("query",function(t){n.isOpen()||n.trigger("open",{});this.dataAdapter.query(t,function(i){n.trigger("results:all",{data:i,query:t})})});this.on("query:append",function(t){this.dataAdapter.query(t,function(i){n.trigger("results:append",{data:i,query:t})})});this.on("keypress",function(t){var i=t.which;n.isOpen()?i===r.ESC||i===r.TAB||i===r.UP&&t.altKey?(n.close(),t.preventDefault()):i===r.ENTER?(n.trigger("results:select",{}),t.preventDefault()):i===r.SPACE&&t.ctrlKey?(n.trigger("results:toggle",{}),t.preventDefault()):i===r.UP?(n.trigger("results:previous",{}),t.preventDefault()):i===r.DOWN&&(n.trigger("results:next",{}),t.preventDefault()):(i===r.ENTER||i===r.SPACE||i===r.DOWN&&t.altKey)&&(n.open(),t.preventDefault())})},u.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled"));this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},u.prototype._syncSubtree=function(n,t){var i=!1,f=this,r,u;if(!n||!n.target||"OPTION"===n.target.nodeName||"OPTGROUP"===n.target.nodeName){if(t)if(t.addedNodes&&t.addedNodes.length>0)for(r=0;r<t.addedNodes.length;r++)u=t.addedNodes[r],u.selected&&(i=!0);else t.removedNodes&&t.removedNodes.length>0&&(i=!0);else i=!0;i&&this.dataAdapter.current(function(n){f.trigger("selection:update",{data:n})})}},u.prototype.trigger=function(n,t){var r=u.__super__.trigger,f={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"},e,i;if((void 0===t&&(t={}),n in f)&&(e=f[n],i={prevented:!1,name:n,args:t},r.call(this,e,i),i.prevented))return void(t.prevented=!0);r.call(this,n,t)},u.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},u.prototype.open=function(){this.isOpen()||this.trigger("query",{})},u.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},u.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},u.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},u.prototype.focus=function(){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},u.prototype.enable=function(n){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.');null!=n&&0!==n.length||(n=[!0]);var t=!n[0];this.$element.prop("disabled",t)},u.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var n=[];return this.dataAdapter.current(function(t){n=t}),n},u.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var i=t[0];n.isArray(i)&&(i=n.map(i,function(n){return n.toString()}));this.$element.val(i).trigger("change")},u.prototype.destroy=function(){this.$container.remove();this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA);null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1));this._syncA=null;this._syncS=null;this.$element.off(".select2");this.$element.attr("tabindex",this.$element.data("old-tabindex"));this.$element.removeClass("select2-hidden-accessible");this.$element.attr("aria-hidden","false");this.$element.removeData("select2");this.dataAdapter.destroy();this.selection.destroy();this.dropdown.destroy();this.results.destroy();this.dataAdapter=null;this.selection=null;this.dropdown=null;this.results=null},u.prototype.render=function(){var t=n('<span class="select2 select2-container"><span class="selection"><\/span><span class="dropdown-wrapper" aria-hidden="true"><\/span><\/span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),t.data("element",this.$element),t},u}),t.define("jquery-mousewheel",["jquery"],function(n){return n}),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(n,t,i,r){if(null==n.fn.select2){var u=["open","close","destroy"];n.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var r=n.extend(!0,{},t);new i(n(this),r)}),this;if("string"==typeof t){var r,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var i=n(this).data("select2");null==i&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2.");r=i[t].apply(i,f)}),n.inArray(t,u)>-1?this:r}throw new Error("Invalid arguments for Select2: "+t);}}return null==n.fn.select2.defaults&&(n.fn.select2.defaults=r),i}),{define:t.define,require:t.require}}(),i=t.require("jquery.select2");return n.fn.select2.amd=t,i})