$(document).ready(function(){
/* position pitch wings */
function e(){var t=75;3e3<$(window).width()&&(t=80);var i=$(".pitchgraph").width(),e=Math.floor(.73*i-t);$(".arrow").css("bottom",e+"px")}
/* Maximize drill container */
function t(){$(".maximize").toggleClass("icon-max icon-minimize"),$(".drillcontainer").addClass("maximized"),$(".drillcontainer").stop().animate({left:25,width:$("#monitorwrapper").width()+5},400,function(){var t=$(".drillcontainer").height();$("#monitorwrapper").stop().animate({height:t+50}),e()})}
/* Minimize drill container */function i(){$(".maximize").toggleClass("icon-max icon-minimize"),$(".drillcontainer").removeClass("maximized");var t=$("#titletd").width()+$("#actiontd").width()+90,i=$("#monitorwrapper").width()-t+30;$(".drillcontainer").stop().animate({left:t,width:i},400,function(){var t=$(".drillcontainer").height();$("#monitorwrapper").stop().animate({height:t+50}),e()})}var n=!1;$(window).scroll(function(){console.log(n)});
/* Alert notifications */
var o=new hullabaloo;o.send("OneView loaded successfully","success"),setTimeout(function(){o.send("Please update you details","info")},4e3),setTimeout(function(){o.send("You have 15 new tickets","warning")},8e3),$("li.dropdown.notifications a").on("click",function(t){$("li.dropdown.notifications").removeClass("show"),$("li.dropdown.notifications .dropdown-menu").removeClass("show"),$(this).parent().addClass("show"),$(this).siblings(".dropdown-menu").addClass("show")}),$("body").on("click",function(t){$("li.dropdown.notifications").is(t.target)||0!==$("li.dropdown.notifications").has(t.target).length||0!==$(".open").has(t.target).length||($("li.dropdown.notifications").removeClass("show"),$("li.dropdown.notifications .dropdown-menu").removeClass("show"))}),e(),
/* Expand/compress tags panel */
$("#expandtags").click(function(){$("#tags, #graphwrapper").toggleClass("expanded")}),
/* change icon in filter input and clear on click*/
$(".material-input input").focus(function(){$(this).siblings("i").addClass("icon-close"),$(this).siblings("i").removeClass("icon-filter"),$(this).siblings("i").removeClass("icon-search"),$(this).siblings("i.icon-close").removeClass("disabled"),$(this).siblings("i").click(function(){$(this).siblings("input").val(""),$(this).addClass("disabled"),$(this).addClass("icon-filter"),$(this).removeClass("icon-close")})}),$(".material-input input:not(.unitsearch)").focusout(function(){""==$(this).val()&&($(this).siblings("i.icon-close").addClass("disabled"),$(this).siblings("i.icon-close").addClass("icon-filter"),$(this).siblings("i.icon-close").removeClass("icon-close"))}),$(".material-input .unitsearch").focusout(function(){""==$(this).val()&&($(this).siblings("i.icon-close").addClass("icon-search"),$(this).siblings("i.icon-close").removeClass("icon-close"))}),$("#newuserModal .material-input input").focus(function(){$(this).siblings(".icon-details").show(),$(this).siblings(".validationIconStackWrapper").show(),$(this).addClass("alertborder")}),$("#newuserModal .material-input input").focusout(function(){$(this).siblings(".icon-details").hide(),$(this).siblings(".validationIconStackWrapper").hide(),$(this).removeClass("alertborder")}),
/* input Error demo */
/*
   $(".material-input input").focus(function () {
       //$(this).siblings("error").slideDown();
       $(this).siblings("error").addClass("shown");
       $(this).closest("th").animate({
           height: 71
       }, 200);
   
       
   });
   
   $(".material-input input").focusout(function () {
       //$(this).siblings("error").slideUp();
       $(this).siblings("error").removeClass("shown");
       $(this).closest("th").animate({
           height: 61
       }, 200);
   
   });*/
$("input").focus(function(){$(this).next("inlineerror").addClass("shown");
/*$(this).closest("th").animate({
            height: 71
        }, 200);*/}),
/* Ticket Modal */
$(".icon-createticket").click(function(){$("#ticketModal").modal({show:!0})}),$("#ticketModal").modal({show:!0}),
/* Reports modal */
$(".reportPeriodOk").click(function(){$("#reportModal").modal({show:!0}),$(".reportloading").delay("6000").fadeOut("500",function(){$(".reportloadsuccess").fadeIn("800"),$("#reportModalLabel").text("Report loaded")})}),$("#cancelReport").click(function(){$("#reportModal").modal("hide")}),
/* Loader icon */
$(".loader").delay("1000").fadeOut("500",function(){$(".status h1").fadeIn("500",function(){$(".status h2").fadeIn("400"),$(".status h6").fadeIn("400")}),$(".hiddenwhileloading").fadeIn("800")}),
/* show all alarm types and recipients */
$("#showallalarms").click(function(){$("#selectednotificationwrapper").toggleClass("fullheight"),$("#notificationwrapper").toggleClass("fullheight"),$("#showallalarms span").text(function(t,i){return"Show all"===i?"Show less":"Show all"})}),
/* settings panel */
$(".settings").click(function(){$("#settings").toggleClass("active")}),
/* Show drill container */
$(".detailbtn").click(function(){n=!0,$(".detailbtn").removeClass("active"),$(".detailbtn").addClass("inactive"),$(".drill-drop").addClass("inactive"),$(".datarow").removeClass("active"),$(this).removeClass("inactive").addClass("active"),$(this).closest(".datarow").addClass("active"),$("#filterbuttons").fadeOut()}),$(".detailbtn").click(function(){var t=$(".drillcontainer").height(),i=$("#titletd").width()+$("#actiontd").width()+90,e=$("#monitorwrapper").width()-i;console.log(i+"|"+t+"|"+n),$("#tablewrapper").stop().animate({},1e3,function(){$(".closeDetail").fadeIn(500,function(){}),$("#tablewrapper").stop().animate({width:340},1e3),
//$('#filterbuttons').slideUp("fast");
$("#tablewrapper").height(t-30),$("#tablewrapper").css("overflow-y","scroll")}),$(".drillcontainer").stop().animate({left:i+25,width:e},1e3,function(){$("#monitorwrapper").stop().animate({},300)})}),
/* Hide Drillcontainer */
$(".closeDetail").click(function(){n=!1,$(".detailbtn").removeClass("active"),$(".detailbtn").removeClass("inactive"),$(".datarow").removeClass("active"),$(".drillcontainer").stop().animate({left:"100%"},400,function(){}),$("#tablewrapper").stop().animate({width:"100%",height:"100%"},400,function(){$(".closeDetail").fadeOut(500,function(){}),$("#tablewrapper").css("overflow-y","hidden"),$("#filterbuttons").fadeIn("slow")}),$("#monitorwrapper").stop().animate({height:"auto",overflow:"hidden"},300)}),$(".maximize").click(function(){return(this.tog=!this.tog)?t():i()}),
/* Full screen drill container */
$(function(){function t(){var t=screenfull.element;$("#status").text("Is fullscreen: "+screenfull.isFullscreen),t&&$("#element").text("Element: "+t.localName+(t.id?"#"+t.id:"")),screenfull.isFullscreen||($("#external-iframe").remove(),document.body.style.overflow="auto")}if($("#supported").text("Supported/allowed: "+!!screenfull.enabled),!screenfull.enabled)return!1;$("#request").click(function(){screenfull.request($("#container")[0])}),$("#exit").click(function(){screenfull.exit()}),screenfull.on("change",t),t()}),
/* Switch color theme */
$("#themeswitch").click(function(){$("body").toggleClass("theme-light theme-dark")}),$(".tree-toggle").click(function(){$(this).parent().parent().children("ul.tree").toggle(200)}),$(function(){$(".tree-toggle").parent().parent().children("ul.tree").toggle(200)})
/* Open configuration error modal on load with # */,$(function(){-1!=window.location.href.indexOf("#error")&&$("#configerrorModal").modal("show")}),
/* resize and scroll on unit details sidebar demo */
$(function(){$window=$(window),$window.scroll(function(){var t=$("#monitorwrapper").offset().top-66,i=$(window).scrollTop()-146+"px";if(console.log("hit |"+t+"|"+$(window).scrollTop()),$window.scrollTop()>=t&&!0===n){$("#tablewrapper").css("transform","translateY("+i+")"),$("#tablewrapper").css("height","calc(100vh - 146px)");var e=$("#monitorwrapper").height()+20,o=$("#unitdetails").height()+20;o<e?$("#unitdetails").css("height",e+"px"):$("#monitorwrapper").css("height",o+"px")}else $("#tablewrapper").css("height","auto"),$("#unitdetails").css("height","auto"),$("#monitorwrapper").css("height","auto")})})}),
/* set height of report sidebar*/
$(function(){var t=$(".reportcontent .col-12").height();$(".reportsidebar").css("height",t+63)}),
/* Tooltip */
$(function(){$('[data-toggle="tooltip"]').tooltip()}),
/* Tooltip custom class */
$(function(){if(void 0===$.fn.tooltip.Constructor)throw new Error("Bootstrap Tooltip must be included first!");var t=$.fn.tooltip.Constructor;
// add customClass option to Bootstrap Tooltip
$.extend(t.Default,{customClass:""});var i=t.prototype.show;t.prototype.show=function(){if(
// invoke parent method
i.apply(this,Array.prototype.slice.apply(arguments)),this.config.customClass){var t=this.getTipElement();$(t).addClass(this.config.customClass)}}});