var WSEditorsController=function(){function n(){}return n.CallBackPanelDisableEditors=function(n){this.SetEnableEditorsInContainer(n.GetMainElement(),!1)},n.SetEnableEditorsInContainer=function(n,t){ASPxClientControl.GetControlCollection().ProcessControlsInContainer(n,function(n){typeof n.SetEnabled=="function"&&n.SetEnabled(t)})},n.TextEditGotFocus=function(n){var t=n.GetCaptionCell();t!=null&&t.classList.remove("Invisible")},n.TextEditLostFocus=function(n){var i=n.GetValue(),t;n.nullText!=""&&(i==null||i=="")&&(t=n.GetCaptionCell(),t!=null&&t.classList.add("Invisible"))},n}(),ZeroGuid="00000000-0000-0000-0000-000000000000",CountryStateController=function(){function n(n,t,i){this.statesData=n;this.countryControl=t;this.stateControl=i;t.SelectedIndexChanged.AddHandler(this.CountryChanged.bind(this));t.Validation.AddHandler(this.CountryValidate.bind(this));t.Init.AddHandler(this.CountryInit.bind(this));i.SelectedIndexChanged.AddHandler(this.StateChanged.bind(this));i.Validation.AddHandler(this.StateValidation.bind(this))}return n.prototype.CountryInit=function(n){var i=this.stateControl.GetSelectedItem(),t;i==null?(t=n.GetSelectedItem(),t!=null&&this.UpdateStatesCollectionForCountry(t.value)):i.value==ZeroGuid&&this.StatesRemoveButNA()},n.prototype.CountryChanged=function(n){var t=n.GetSelectedItem();t!=null&&this.UpdateStatesCollectionForCountry(t.value)},n.prototype.CountryValidate=function(n,t){t.isValid=n.GetSelectedItem()!=null},n.prototype.StateChanged=function(n){var t=n.GetSelectedItem(),i,r;if(t!=null)if(t.value=="10000000-0000-0000-0000-000000000001")n.SetSelectedItem(null),n.HideDropDown();else{if(i=this.countryControl.GetSelectedItem(),t.value==ZeroGuid){i!=null&&this.IsStateRequired(i.value)&&this.countryControl.SetSelectedItem(null);return}r=this.statesData[t.value].CountryId;this.countryControl.SetSelectedItem(this.countryControl.FindItemByValue(r))}},n.prototype.StateValidation=function(n,t){var r=this.countryControl.GetSelectedItem(),i=n.GetSelectedItem();t.isValid=r==null&&i==null||i!=null},n.prototype.UpdateStatesCollectionForCountry=function(n){if(this.IsStateRequired(n)){this.stateControl.ClearItems();this.stateControl.BeginUpdate();for(var t in this.statesData)this.statesData[t].CountryId==n&&this.stateControl.AddItem(this.statesData[t].Name,t);this.stateControl.SetSelectedIndex(-1);this.stateControl.EndUpdate()}else this.stateControl.ClearItems(),this.stateControl.BeginUpdate(),this.stateControl.AddItem("N/A",ZeroGuid),this.stateControl.SetSelectedIndex(0),this.stateControl.EndUpdate()},n.prototype.IsStateRequired=function(n){for(var t in this.statesData)if(this.statesData[t].CountryId==n)return!0;return!1},n.prototype.StatesRemoveButNA=function(){this.stateControl.BeginUpdate();for(var n=this.stateControl.GetItemCount()-1;n>0;n--)this.stateControl.RemoveItem(n);this.stateControl.EndUpdate()},n}(),LightBoxController=function(){function n(){var t=this,n=document.getElementById("LightBox");n!=null&&(this.pages=n.querySelectorAll("[data-lightbox-page]"),this.pages.forEach(function(n){n.classList.contains("Current")||n.classList.add("Right");n.querySelectorAll("[data-lightbox-action-showpage]").forEach(function(n){n.addEventListener("click",function(i){i.preventDefault();t.ShowPage(n.getAttribute("data-lightbox-action-showpage"))})})}))}return n.prototype.ShowPage=function(n){var t=null,i=null,u=-1,f=-1,r=0;(this.pages.forEach(function(e){e.getAttribute("data-lightbox-page")==n&&(t=e,u=r);e.classList.contains("Current")&&(i=e,f=r);r++}),t!=null)&&i!=t&&(i.classList.remove("Current"),f<u?i.classList.add("Left"):i.classList.add("Right"),t.classList.remove("Right"),t.classList.remove("Left"),t.classList.add("Current"))},n}(),PerfectScrollerController=function(){function n(){var n=this,t;this.busy=!1;this.processedElements=[];this.Initialize(document.documentElement);window.addEventListener("hashchange",function(){if(console.log("hashchange"),n.busy){n.busy=!1;return}console.log("hashchange scroll");n.ScrollToAnchor(n.GetHash())});t=this.GetHash();t!=null&&t!==""&&(this.SetHash(""),window.addEventListener("DOMContentLoaded",function(){n.ScrollToAnchor(t)}))}return Object.defineProperty(n.prototype,"LongScrollDelta",{get:function(){return 1500},enumerable:!1,configurable:!0}),n.prototype.Initialize=function(n){var t=this;n.querySelectorAll('a[href^="#"]:not([href="#"])').forEach(function(n){t.processedElements.indexOf(n)==-1&&(t.processedElements.push(n),n.addEventListener("click",function(i){i.preventDefault();t.ScrollToAnchor(n.getAttribute("href").substr(1))}))});n.querySelectorAll("a[data-scroll-to]").forEach(function(n){t.processedElements.indexOf(n)==-1&&(t.processedElements.push(n),n.addEventListener("click",function(i){i.preventDefault();t.ScrollTo(document.querySelector('[data-anchor="'+n.getAttribute("data-scroll-to")+'"]'))}))})},n.prototype.SetHash=function(n){history?history.pushState(undefined,undefined,"#"+n):location.replace("#"+n)},n.prototype.GetHash=function(){return document.location.hash.length>1?document.location.hash.substr(1):null},n.prototype.ScrollTo=function(n){var r=this,u,t,f,i;n!=null&&(this.busy=!0,u=document.$scrollTop,t=this.GetScrollTo(n),Math.abs(u-t)>this.LongScrollDelta&&(f=u>t?t+this.LongScrollDelta:t-this.LongScrollDelta,window.scrollTo(0,f)),i=n.getAttribute("name"),i=i!=null?i:"",this.SmoothScrollToPosition(t,300,function(){i!=""&&r.GetHash()!=i&&(r.busy=!0,n.setAttribute("name",""),r.SetHash(i),n.setAttribute("name",i));t=r.GetScrollTo(n);document.$scrollTop!=t&&r.SmoothScrollToPosition(t,100)}))},n.prototype.ScrollToAnchor=function(n){n!=null&&this.ScrollTo(document.querySelector('a[name="'+n+'"]'))},n.prototype.GetScrollTo=function(n){var i,r,t,u;if(n!=null){if(i=n,n.getAttribute("data-anchor")==null&&(i=i.nextElementSibling),i==null&&(i=n),r=i.getBoundingClientRect().top-document.documentElement.getBoundingClientRect().top-parseInt(getComputedStyle(i).marginTop,10),n.previousElementSibling==null){for(t=n.parentElement;t!=null&&t.previousElementSibling==null;)t=t.parentElement;t!=null&&(r-=parseInt(getComputedStyle(t).paddingTop,10),r-=Math.min(parseInt(getComputedStyle(t).marginTop,10),20))}return document.querySelectorAll(".Fixed").forEach(function(n){getComputedStyle(n).position=="fixed"&&(r-=n.offsetHeight)}),u=0,document.querySelectorAll(".sys-fixed").forEach(function(n){for(var t=n.previousElementSibling;t!=null&&t.getAttribute("data-control")!=="FixedBarPlaceholder";)t=t.previousElementSibling;t!=null&&t.scrollTop<r&&(u+=t.offsetHeight)}),r-u+1}},n.prototype.SmoothScrollToPosition=function(n,t,i){var f=this;i===void 0&&(i=null);document.dispatchEvent(document.createCustomEvent("scrollingstarted"));var e=document.$scrollTop,s=n-e,u=0,o=16,h=function(n,t,i,r){return i*Math.sqrt(1-(n=n/r-1)*n)+t},r=function(){u+=o;window.scrollTo(0,h(u,e,s,t));u<t?window.requestAnimationFrame?window.requestAnimationFrame(r):setTimeout(r,o):(document.dispatchEvent(document.createCustomEvent("scrollingended")),f.busy=!1,i!=null&&i.call(f))};this.busy=!0;window.requestAnimationFrame?window.requestAnimationFrame(r):r()},n}(),VideoController=function(){function n(){var n=this;document.querySelectorAll(".NativeVideo").forEach(function(t){var i=t.querySelector("video");i!=null&&(i.addEventListener("play",n.OnVideoStarted.bind(n,t)),i.addEventListener("pause",n.OnVideoPaused.bind(n,t)),i.addEventListener("ended",n.OnVideoEnded.bind(n,t)),t.addEventListener("click",n.VideoClick.bind(n,t,i)))})}return n.prototype.VideoClick=function(n,t){!t.paused&&!t.ended&&t.currentTime>0?t.pause():(n.classList.add("Playing"),t.play())},n.prototype.OnVideoPaused=function(n){n.classList.remove("Playing")},n.prototype.OnVideoEnded=function(n){n.classList.remove("Playing")},n.prototype.OnVideoStarted=function(n){n.classList.add("Playing")},n}()