function checkScroll(){$(window).width()>960&&(topOfFooter=$("footer._shared-footer").position().top,scrollDistanceFromTopOfDoc=$(document).scrollTop()+570,scrollDistanceFromTopOfFooter=scrollDistanceFromTopOfDoc-topOfFooter,scrollDistanceFromTopOfDoc>topOfFooter?$("#navSecondary").css("margin-top",0-scrollDistanceFromTopOfFooter):$("#navSecondary").css("margin-top",0))}function GetCountries(n,t){$(n).empty();$(n).append('<option value="0" selected disabled>-- Select Country --<\/option>');try{$.ajax({type:"POST",url:"/Json/GetCountries",dataType:"json",complete:function(i){i!=undefined&&(i.responseJSON!=undefined&&(i=i.responseJSON),i!=undefined&&i.length>0&&($.each(i,function(t,i){$(n).append('<option value="'+i.CountryID+'">'+i.Name+"<\/option>")}),n!=undefined&&n.length>0&&GetProvinces(n,t)))}})}catch(i){return console.log(i),!1}}function GetProvinces(n,t){if($(t).empty(),$(t).append('<option value="0" selected disabled>-- Select State/Province --<\/option>'),n!=undefined&&n!=null){var i=$(n).val();try{$.ajax({type:"POST",url:"/Json/GetProvinces",dataType:"json",data:{languageCode:"en-US",id:i},complete:function(n){n!=undefined&&(n.responseJSON!=undefined&&(n=n.responseJSON),n!=undefined&&n.length>0&&$.each(n,function(n,i){$(t).append('<option value="'+i.ProvinceID+'">'+i.Name+"<\/option>")}))}})}catch(r){return console.log(r),!1}}}function FormSubmission(n){var i,r,u,f,t;this.email=n;this.AddEmail=function(n){this.email=n};this.AddFirstName=function(n){this.firstname=n};this.AddLastName=function(n){this.lastname=n};this.AddPhone=function(n){this.phone=n};this.AddCompany=function(n){this.company=n};this.AddJobTitle=function(n){this.jobtitle=n};this.AddAddress=function(n){this.address=n};this.AddPostalCode=function(n){this.postalcode=n};this.AddCity=function(n){this.city=n};i=0;r="";this.AddCountry=function(n){n!=undefined&&(this.countryID=Helpers.GetDDLSelectedIndex(Helpers.ReturnDomEl(n)),this.countryName=Helpers.GetDDLSelectedText(Helpers.ReturnDomEl(n)))};u=0;f="";this.AddProvince=function(n){n!=undefined&&(this.provinceID=Helpers.GetDDLSelectedIndex(Helpers.ReturnDomEl(n)),this.provinceName=Helpers.GetDDLSelectedText(Helpers.ReturnDomEl(n)))};t={};this.AddCustomField=function(n,i){n.length>0&&(t[n]=i)};this.Submit=function(n,i,r){if(n!=null&&n.length>1)try{$.ajax({type:"POST",url:"/Json/SaveFormSubmission",dataType:"json",data:{formcode:n,email:this.email,firstname:this.firstname,lastname:this.lastname,jobtitle:this.jobtitle,company:this.company,phone:this.phone,address:this.address,postalcode:this.postalcode,city:this.city,province:this.provinceID,country:this.countryID,customfields:Helpers.PrintCustomFields(t)},complete:function(n){n!=undefined||n.length>0?i(n):r(n)},error:function(n){r(n)}})}catch(u){return console.log(u),!1}else return!1};this.SendEmail=function(n,i,r,u){var f=new Date,h=f.getMonth()+1+"/"+f.getDate()+"/"+f.getFullYear()+" "+f.getHours()+":"+f.getMinutes()+":"+f.getSeconds(),e,o,s;(i==undefined||i.length<=0)&&(i="");try{e='{ "datetime":"'+h+'","email":"'+this.email+'","firstname":"'+this.firstname+'","lastname":"'+this.lastname+'","phone":"'+this.phone+'","jobtitle":"'+this.jobtitle+'","company":"'+this.company+'","phone":"'+this.phone+'","address":"'+this.address+'","postalcode":"'+this.postalcode+'","city":"'+this.city+'","country":"'+this.countryName+'","province":"'+this.provinceName+'" }';e=JSON.parse(e);o=Helpers.PrintCustomFields(t);o=JSON.parse(o);s=$.extend({},e,o);s=JSON.stringify(s);$.ajax({type:"POST",url:"/Json/SendEmailTemplateFromJSON",dataType:"json",data:{templateCode:n,emailTo:i,fields:s},complete:function(n){n!=undefined||n.length>0?r(n):u(n)},error:function(n){u(n)}})}catch(c){return console.log(c),!1}}}function GetCourses(n,t){$("#lblExtraMessage").text("");$(n).empty();$(n).append('<option value="0" selected disabled>-- Select Course --<\/option>');$(courseDeliveryDD).empty();$(courseDeliveryDD).append('<option value="0" selected disabled>-- Select Delivery Type --<\/option>');$(t).empty();$(t).append('<option value="0" selected disabled>-- Select Course Dates --<\/option>');$(txtPrice).val("");$(txtQuantity).val("1");var i=$("#CountryDDL option:selected").text();$.ajax({type:"POST",url:"/Json/GetCoursesForQuotes",data:{country:i,included:"true"},dataType:"json",complete:function(t){t!=undefined&&(t.responseJSON!=undefined&&(t=t.responseJSON),t!=undefined&&t.length>0&&$.each(t,function(t,i){$(n).append('<option value="'+i.CourseID+"@"+i.Link+'">'+i.Name+"<\/option>")}))},error:function(n,t,i){console.log(t);console.log(i)}});console.log("RQ Clicked")}function GetDeliveryTypes(n,t){var i;if($("#lblExtraMessage").text(""),console.log("In GetDeliveryTypes"),$(t).empty(),$(t).append('<option value="0" selected disabled>-- Select Delivery Type --<\/option>'),$(courseScheduleDD).empty(),$(courseScheduleDD).append('<option value="0" selected disabled>-- Select Course Dates --<\/option>'),$("#lblCurrency").text(""),$("#txtPrice").val(""),$(txtQuantity).val("1"),i=$("#courseNameDD option:selected").text(),n!=undefined&&n!=null){var f=$(n).val(),r=$("#CountryDDL option:selected").text(),e=$(n).val(),u=n.value.substring(0,n.value.indexOf("@"));$.ajax({type:"POST",url:"/Json/GetCoursesDeliveryTypes",data:{courseId:u,country:r},dataType:"json",complete:function(n){n!=undefined&&(n.responseJSON!=undefined&&(n=n.responseJSON,console.log(n)),n!=undefined&&n.length>0&&($("#divCourseDeliveryDD").show(),$.each(n,function(n,i){$(t).append('<option value="'+i.DeliveryTypeID+'">'+i.Code+"<\/option>")})))},error:function(n,t,i){console.log(t);console.log(i)}})}}function GetSchedules(n,t,i){if(console.log("In GetSchedules..."),$(i).empty(),$(i).append('<option value="0" selected disabled>-- Select Course Dates --<\/option>'),$("#txtPrice").val(""),$(txtQuantity).val("1"),$("#lblExtraMessage").text(""),t!=undefined&&t!=null){var r=$(t).val(),f=n.value.substring(0,n.value.indexOf("@")),u="/Json/GetSchedules",e=$("#CountryDDL option:selected").text();r=="1"&&(u="/Json/GetPrice");$.ajax({type:"POST",url:u,data:{courseId:f,deliveryTypeID:r,country:e,included:"true"},dataType:"json",complete:function(t){t!=undefined&&(t.responseJSON!=undefined&&(t=t.responseJSON,console.log(t)),t!=undefined&&t.length>0?$.each(t,function(t,u){r=="1"?($("#divScheduleDD").hide(),$("#lblCurrency").text(u.CurrencyCode),r=="1"&&n.selectedOptions[0].label=="IT Service Management Essentials"?($("#txtPrice").val(u.Price),$("#lblExtraMessage").html("&nbsp;&nbsp;&nbsp;Special Offer Until April 7")):$("#txtPrice").val(u.Price)):($("#divScheduleDD").show(),$(i).append('<option value="'+u.EventDetailID+'">'+u.Schedule+"<\/option>"))}):$("#divScheduleDD").hide())},error:function(n,t,i){console.log(t);console.log(i)}})}}function GetPrice(n,t,i){if(console.log("In GetPrice..."),t!=undefined&&t!=null){var u=$("#CountryDDL option:selected").text(),r=$(n).val();r!=="1"&&(i=t.value);console.log("courseId: "+i);console.log("deliveryTypeID: "+r);$.ajax({type:"POST",url:"/Json/GetPrice",data:{courseId:i,deliveryTypeID:r,country:u,included:"true"},dataType:"json",complete:function(n){n!=undefined&&(n.responseJSON!=undefined&&(n=n.responseJSON,console.log(n)),n!=undefined&&n.length>0&&($("#lblCurrency").text(n[0].CurrencyCode),$("#txtPrice").val(n[0].Price)))},error:function(n,t,i){console.log(t);console.log(i)}})}}function ProcessQuote(){console.log("In ProcessQuote");var t=$("#FirstNamePP").val(),i=$("#LastNamePP").val(),r=$("#JobTitlePP").val(),u=$("#CompanyPP").val(),f=$("#AddressPP").val(),e=$("#CityPP").val(),o=$("#CountryDDL option:selected").text(),s=$("#ProvinceDDL option:selected").text(),h=$("#PostalCodePP").val(),c=$("#PhonePP").val(),l=$("#EmailPP").val(),n=[];$("#tblCourses TBODY TR").each(function(){var i=$(this),t={};t.Name=i.find("TD").eq(0).html();t.Schedule=i.find("TD").eq(1).html();t.Quantity=i.find("TD").eq(2).html();t.UnitPrice=i.find("TD").eq(3).html();t.TotalPrice=i.find("TD").eq(4).html();t.Notes=i.find("TD").eq(5).html();t.EventDetailID=i.find("TD").eq(7).html();n.push(t)});try{$.ajax({type:"POST",url:"/json/ProcessQuote",data:{firstname:t,lastname:i,jobtitle:r,company:u,address:f,city:e,country:o,province:s,postalcode:h,phone:c,email:l,courses:JSON.stringify(n)},dataType:"json",complete:function(){$("#divStatus").html("<h4>Thank you for requesting a quote. You will shortly receive the quote in your email.<\/h4>");$("#tblCourses > tbody").html("");$("#txtQuantity").val("1");$("#txtPrice").val("");$("#txtNotes").val("")}})}catch(a){return console.log(a),!1}}function GetEventPasses(n){console.log("in GetEventPasses(...)");$(n).empty();$(n).append('<option value="0" selected disabled>-- Select Event Pass --<\/option>');try{$.ajax({type:"POST",url:"/JsonEvents/GetEventPasses",data:{included:"false"},dataType:"json",complete:function(t){t!=undefined&&(t.responseJSON!=undefined&&(t=t.responseJSON),t!=undefined&&t.length>0&&$.each(t,function(t,i){$(n).append('<option value="'+i.EventID+'">'+i.Name+"<\/option>")}))}})}catch(t){return console.log(t),!1}}function GetHotelDates(){var n=$("#passesDD option:selected");console.log("In GetHotelDates() -> PASS:"+n.val());n.val()=="252"?($("#spanResortPrice").text("$2495 USD"),$("#spanResortFeesAndTaxesInfo").text("($39 resort fee + $35.72 tax) per night.")):n.val()=="253"?($("#spanResortPrice").text("$2695 USD"),$("#spanResortFeesAndTaxesInfo").text("($39 resort fee + $35.72 tax) per night.")):n.val()=="254"&&($("#spanResortPrice").text("$2995 USD"),$("#spanResortFeesAndTaxesInfo").text("($39 resort fee + $35.72 tax) per night."));$("#tblHotels").find("[id^=txtNights]").val("0");$("#tblHotels").find("[id^=spanTotalPrice]").text("")}function ProcessEventsQuote(){console.log("In ProcessEventsQuote()");var t=$("#FirstNamePP").val(),i=$("#LastNamePP").val(),r=$("#JobTitlePP").val(),u=$("#CompanyPP").val(),f=$("#AddressPP").val(),e=$("#CityPP").val(),o=$("#CountryDDL option:selected").text(),s=$("#ProvinceDDL option:selected").text(),h=$("#PostalCodePP").val(),c=$("#PhonePP").val(),l=$("#EmailPP").val(),a=$("#txtNotes").val(),n=[];$("#tblBookings TBODY TR").each(function(){var i=$(this),t={};t.Pass=i.find("TD").eq(0).html();t.Qty=i.find("TD").eq(1).html();t.UnitPrice=i.find("TD").eq(2).html();t.TotalPrice=i.find("TD").eq(3).html();t.Type=i.find("TD").eq(5).html();t.ResortFee="39.00";t.TaxPerNight="35.72";n.push(t)});try{$.ajax({type:"POST",url:"/JsonEvents/ProcessQuote",data:{firstname:t,lastname:i,jobtitle:r,company:u,address:f,city:e,country:o,province:s,postalcode:h,phone:c,email:l,notes:a,hotels:JSON.stringify(n)},dataType:"json",complete:function(){$("#divStatus").html("<h4>Thank you for requesting a quote. You will shortly receive the quote in your email.<\/h4>");$("#tblBookings > tbody").html("");$("#txtNotes").val("");$("#passesDD").val("0");$("#spanResortPrice").text("");$("#spanResortFeesAndTaxesInfo").text("");$("#txtQuantityPasses").val("1");clearCourseSelection()}})}catch(v){return console.log(v),!1}}function GetUpcomingCourses(n,t){console.log("in GetUpcomingCourses(...)");try{$.ajax({type:"POST",url:"/Json/GetUpcomingCourses",data:{numMonths:n,languageCode:t},dataType:"json",complete:function(n){if(n!=undefined&&(n.responseJSON!=undefined&&(n=n.responseJSON),n!=undefined&&n.length>0)){let t="";$.each(n,function(n,i){let r=convertToJavaScriptDate(i.StartDate).toLocaleString("default",{month:"long"}),a=convertToJavaScriptDate(i.StartDate).toLocaleString("default",{weekday:"short"}),v=convertToJavaScriptDate(i.StartDate).toLocaleString("default",{day:"2-digit"}),y=convertToJavaScriptDate(i.StartDate).toLocaleString("default",{day:"2-digit"}),p=convertToJavaScriptDate(i.EndDate).toLocaleString("default",{day:"2-digit"});if(t!=r){console.log("Create new column");const n=document.createElement("div");n.id="div"+r;n.innerHTML="<span class='month-heading'>"+r+"<\/span>";n.className="col-lg-4 table";$("#divMainRow").append(n)}t=r;const u=document.createElement("div");u.className="row";const e=document.createElement("div");e.className="col-lg-3";const o=document.createElement("div");o.className="col-lg-9";const f=document.createElement("div");f.className="event virtual";const s=document.createElement("div");s.className="event-day";s.innerText=a;const h=document.createElement("div");h.className="event-num";h.innerText=v;f.append(s);f.append(h);const l=document.createElement("div");l.innerText=r+" "+y+" - "+p;const c=document.createElement("div");c.innerHTML=i.Name+"\n";c.append(l);e.append(f);o.append(c);u.append(e);u.append(o);$("#div"+r).append(u);$("#div"+r).append("<br />")})}}})}catch(i){return console.log(i),!1}}function convertToJavaScriptDate(n){var t=/Date\(([^)]+)\)/.exec(n);return new Date(parseFloat(t[1]))}function GetAllConferences(n){try{$.ajax({type:"POST",url:"/Json/getAllConferences",data:{confType:n},dataType:"json",complete:function(n){n!=undefined&&n.responseJSON!=undefined&&(n=n.responseJSON,console.log(n))}})}catch(t){return console.log(t),!1}}var Helpers={Admin:{GetRandomColor:function(){for(var n="#",t=0;t<6;t++)n+="0123456789ABCDEF"[Math.floor(Math.random()*16)];return n},PickerDDL:{OnChange:function(n,t,i,r){$(t).html("");Helpers.Load.Loader(t,!0,!0,!1);Helpers.Load.Url(n,t,i,r)}}},Alert:{Show:function(n,t,i,r,u,f){var e,o;if((f==undefined||f==null)&&(f=!0),n!=undefined&&n!=null){for(e=0,$(n+" .alert").length>0&&(e=$(n+" .alert").length);$(n+" #"+e).length!=0;)e++;o="";o+=u?'<div id="'+e+'" class="alert alert-dismissible alert-'+t+'"><button type="button" class="close" data-dismiss="alert">&times;<\/button>':'<div id="'+e+'" class="alert custom-alert alert-'+t+'">';o+='<p class="m-0"><strong>'+i+"<\/strong> "+r+"<\/p><\/div>";$(n).prepend(o);f&&$(n+" #"+e).fadeTo(9e3,500).slideUp(500,function(){$(n+" #"+e).slideUp(500,Helpers.Alert.Remove($(n+" #"+e)))})}},Remove:function(n){n.remove()}},Base:{ReturnDomEl:function(n){if(n!=null&&n!=undefined)return n[0]},UpdateImage:function(n,t){if(n.files!=undefined&&n.files[0]!=undefined){var i=new FileReader;i.onload=function(n){$("#"+t).attr("src",n.target.result).height(50);document.getElementById(t).style.display="block"};i.readAsDataURL(n.files[0])}},DisableButton:function(n,t,i){if(n!=undefined){$(n+" button").prop("disabled",!0);$(n).css("cursor","unset");(i==undefined||i==null)&&(i="Processing...");var r="<i class='fa fa-spinner fa-spin fa-fw text-white'><\/i>";r=t!=undefined&&t==!0?r+$(n).html():r+i;$(n+" button[type=button]").html(r);$(n+" button[type=submit]").html(r)}},GetQueryStringValues:function(n){var u=[],i,t=document.URL.split("?")[1],r;if(t!=undefined)for(t=t.split("&"),r=0;r<t.length;r++)i=t[r].split("="),u.push(i[1]),u[i[0]]=i[1];return u[n]},StripHtml:function(n){var t=document.createElement("div");return t.innerHTML=n,"'"+t.textContent+"'"||"'"+t.innerText+"'"||""},ScrollNav:function(){$(window).on("scroll",function(){$("#navSecondary").length&&$("#eventlist").length?($(window).scrollTop()>1?($(window).width()<960?$(".sub-fixed-top").addClass("sub-fixed-push"):$("#eventlist").addClass("offset-4"),$("#navPrimary").addClass("fixed-top"),$("#navSecondary").addClass("sub-fixed-top")):($(window).width()>960&&($(".sub-fixed-top").removeClass("sub-fixed-push"),$("#eventlist").removeClass("offset-4")),$(".sub-fixed-top").removeClass("sub-fixed-push"),$("#navPrimary").removeClass("fixed-top"),$("#navSecondary").removeClass("sub-fixed-top")),checkScroll()):$("#navSecondary").length?$(window).scrollTop()>96?($(window).width()<960&&$(".sub-fixed-top").addClass("sub-fixed-push"),$("#navSecondary").addClass("sub-fixed-top")):($(window).width()>960&&$(".sub-fixed-top").removeClass("sub-fixed-push"),$(".sub-fixed-top").removeClass("sub-fixed-push"),$("#navSecondary").removeClass("sub-fixed-top")):$(window).scrollTop()>96?($(window).width()<960&&$(".sub-fixed-top").addClass("sub-fixed-push"),$("#navPrimary").addClass("fixed-top")):($(window).width()>960&&$(".sub-fixed-top").removeClass("sub-fixed-push"),$(".sub-fixed-top").removeClass("sub-fixed-push"),$("#navPrimary").removeClass("fixed-top"))})},SetElHeights:function(n){var t=$("."+n).map(function(){return $(this).height()}).get(),i=Math.max.apply(null,t);$("."+n).height(i)},CleanStr:function(n){return n.replace(/ /g,"-").replace(/\//g,"_")},OpenURL:function(n,t){n!=undefined&&n.length>0&&(t==undefined||t==!1?window.open(n):window.open(n,"_blank"))}},Cookie:{GetCookie:function(n){for(var t,r=encodeURIComponent(n)+"=",u=document.cookie.split(";"),i=0;i<u.length;i++){for(t=u[i];t.charAt(0)===" ";)t=t.substring(1,t.length);if(t.indexOf(r)===0)return decodeURIComponent(t.substring(r.length,t.length))}return null},SaveCookie:function(n,t,i){var u,r;i?(r=new Date,r.setTime(r.getTime()+i*864e5),u="; expires="+r.toGMTString()):u="";document.cookie=encodeURIComponent(n)+"="+encodeURIComponent(t)+u+"; path=/"}},Form:{PrintCustomFields:function(n){if(n!=null&&n!=undefined){var t=JSON.stringify(n);return t!=null&&t!=undefined?t:""}},GetDDLSelectedIndex:function(n){return n!=null&&n!=undefined?n.options[n.selectedIndex].value:(console.log("Drop down list object is null or undefind"),0)},GetDDLSelectedText:function(n){return n!=null&&n!=undefined?n.options[n.selectedIndex].text:(console.log("Drop down list object is null or undefind"),"")},CopyToClipboard:function(n,t){var i=!0,r;n!=undefined&&n.length>0&&(navigator.clipboard!=undefined?navigator.clipboard.writeText(n).then(function(){i=!0},function(){i=!1}):window.clipboardData&&window.clipboardData.setData("Text",n));r='<i class="text-danger"><i class="fa fa-2x fa-times"><\/i><\/i>';i&&(r='<i class="text-success"><i class="fa fa-2x fa-check"><\/i><\/i>');t!=undefined&&$(t).html(r)},CopyValueToClipboard:function(n){var t=!0;return n!=undefined&&n.length>0&&(navigator.clipboard!=undefined?navigator.clipboard.writeText(n).then(function(){t=!0},function(){t=!1}):window.clipboardData&&window.clipboardData.setData("Text",n)),t}},JsTree:{OnReady:function(n,t,i,r){var u,f;i?($(n).find(".jstree-icon").addClass("d-none"),$(n).find("ul").addClass("nav-tabs d-flex"),$(n).find("li").addClass("nav-item"),$(n).find("a").addClass("nav-link d-block"),$(n).find("a").css("padding","0.5rem 1rem"),$(n).find("a").css("height","100%"),u=0,u=$(n).find("li").eq(0).attr("id"),t.instance.open_node([u]),t.instance.select_node([u]),GetDocuments(u)):(f=location.hash.substr(1),f.length>0?setTimeout(function(){t.instance.open_node(f);t.instance.select_node(f)},500):Helpers.JsTree.OnHeaderClick(r))},OnChange:function(n,t){for(var r=0,u="",e=[],o=[],i=0,f=n.selected.length;i<f;i++)e.push(n.instance.get_node(n.selected[i]).text),o.push(n.instance.get_node(n.selected[i]).id);r=o;u=e;$(t+" #selected-text").html(u.join(", "));typeof table!="undefined"&&table!=""&&table.destroy();GetDocuments(r)},OnHeaderClick:function(n){$("#selected-text").html("&nbsp;");GetDocuments(n)}},Load:{Refresh:function(n,t,i){Helpers.Load.Url(t,n,'<div class="mt-2 alert bg-warning" role="alert">No items found.<\/div>',i)},Url:function(n,t,i,r){$.ajax({url:n,type:"GET",contentType:"application/json; charset=utf-8",dataType:"json",complete:function(n){if(n.HasErrors!=undefined&&n.HasErrors==!1||n.statusText=="OK"||n.status==200)n.responseJSON!=undefined?$(t).html(n.responseJSON):n.responseText!=undefined&&n.responseText.length>1?$(t).html(n.responseText):i!=undefined&&$(t).html(i);else{var u="Unknown error has occured while loading the list.";n.Error!=undefined?u=n.Error:n.responseText!=undefined?u=n.responseText:n.statusText!=undefined&&(u=n.statusText,Helpers.Alert.Show(t,"danger","Oops!",u,!0))}r!=undefined&&r instanceof Function&&r()}})},Loader:function(n,t,i,r){var u,f;n!=undefined&&n!=null?t?(u='<div class="loading"><div class="loader"><\/div><\/div>',r?$(n).append(u):$(n).html(u),i&&$(n).find(".loading").css("background","rgba(0,0,0,0.2)"),$(n).find(".loading").css("display","block")):(f=$(n),f!=undefined&&$(f).find(".loading").remove()):$(".loading").remove()}},Modal:{Full:{Build:function(n,t,i,r,u,f,e){$(".modal").attr("id","Modal-"+n.replace(" ","-"));$(".modal").attr("aria-label","Modal-"+n.replace(" ","-"));$(".modal-title").html(t);r&&u!=null?($(".modal-footer").html(u),$(".modal-footer").show()):$(".modal-footer").hide();f=="sm"?$(".modal-dialog").addClass("modal-sm"):$(".modal-dialog").addClass("modal-lg");e==!1||e=="false"||e=="min"?(this.ScreenToggle(!1),$("#screen-toggle").hide()):e==!0||e=="true"||e=="max"||e=="maximize"?(this.ScreenToggle(!0),$("#screen-toggle").show()):$("#screen-toggle").show();i!=undefined?$(".modal-body").load(i,function(i,r){if(r=="error"){n.toLowerCase()=="errormodal"?(i.length>0&&(i=" ("+i+")"),Helpers.Alert.Show(".modal-content","danger","Oops!","Error occured while loading the modal.",!0)):Helpers.Modal.Full.Build("Error",t,"/Error/Index/500");return}Helpers.Modal.Show()}):Helpers.Alert.Show(".modal-content","danger","Oops!","Invalid modal target.",!0)},ScreenToggle:function(n){n==!1?($(".shared-modal").removeClass("modal-fullscreen"),$("#screen-toggle").html('<i class="fa fa-window-maximize"><\/i>')):n==!0?($(".shared-modal").addClass("modal-fullscreen"),$("#screen-toggle").html('<i class="fa fa-window-restore"><\/i>')):($(".shared-modal").toggleClass("modal-fullscreen"),$(".shared-modal").hasClass("modal-fullscreen")?$("#screen-toggle").html('<i class="fa fa-window-restore"><\/i>'):$("#screen-toggle").html('<i class="fa fa-window-maximize"><\/i>'))}},YesNo:{Build:function(n,t,i,r,u){$(".modal").attr("id","Modal-"+n.replace(" ","-"));$(".modal").attr("aria-label","Modal-"+n.replace(" ","-"));$(".modal-title").html(t);$(".modal-body").html(i);$(".modal-footer").html('<button type="button" class="btn btn-secondary" data-dismiss="modal">No<\/button><button type="button" class="btn btn-primary delete">Yes<\/button>');$(".modal-footer").show();$(".modal .delete").attr("onclick",r);u=="sm"?($(".modal-dialog").removeClass("modal-lg"),$(".modal-dialog").addClass("modal-sm")):u=="md"||u==undefined?($(".modal-dialog").removeClass("modal-sm"),$(".modal-dialog").removeClass("modal-lg")):($(".modal-dialog").removeClass("modal-sm"),$(".modal-dialog").addClass("modal-lg"))}},SlideOut:{Build:function(n,t,i){$(n).append('<div class="slideout text-white card" style="display:none;"><\/div>');Helpers.Load.Loader(n+" .slideout",!0,!0);Helpers.Load.Url(t,n+" .slideout",i,function(){$(n+" .slideout").append('<div class="form-group position-absolute" style="right: 0; top: 0;"><button class="close m-2" type="button" onclick="Helpers.Modal.SlideOut.Remove(\'#tab-content-area\');"><span aria-hidden="true">×<\/span><\/button><\/div>')})},Show:function(n){$(n+" .slideout").show();$(n+" .slideout").animate({width:"100%",opacity:"1"},50)},Remove:function(n){n!=""&&n!=undefined&&n!=null?$(n+" .slideout").length>0&&$(n+" .slideout").animate({width:"0px",opacity:"0"},100).promise().done(setTimeout(function(){$(n).find(".slideout").remove()},1e3)):$(".slideout").animate({width:"0px",opacity:"0"},100).promise().done(setTimeout(function(){$(".slideout").remove()},1e3))},BuildYesNo:function(n,t,i,r){$(n).append('<div class="slideout text-white card" style="display:none;"><\/div>');Helpers.Load.Loader(n+" .slideout",!0,!0);i='<div class="form-group position-absolute" style="right: 0; top: 0;">   <button class="close m-2" type="button" onclick="Helpers.Modal.SlideOut.Remove(\'#tab-content-area\');"><span aria-hidden="true">×<\/span><\/button><\/div><div class="row">   <div class="col">'+t+'<\/div><\/div><div class="alert alert-danger">'+i+'<\/div><div class="row">   <div class="col btn-group">       <button type="button" class="btn btn-secondary col-3" onclick="Helpers.Modal.SlideOut.Remove(\'#tab-content-area\');">No<\/button>       <button type="button" class="btn btn-primary col-3 confirm-yes">Yes<\/button>   <\/div><\/div>';$(n+" .slideout").html(i);$(".slideout .confirm-yes").attr("onclick",r)}},Show:function(){$(".modal").modal("show")},Hide:function(){$(".modal").modal("hide")}},PrintCustomFields:function(n){if(n!=null&&n!=undefined){var t=JSON.stringify(n);return t!=null&&t!=undefined?t:""}},ReturnDomEl:function(n){if(n!=null&&n!=undefined)return n[0]},GetDDLSelectedIndex:function(n){return n!=null&&n!=undefined?n.options[n.selectedIndex].value:(console.log("Drop down list object is null or undefined"),0)},GetDDLSelectedText:function(n){return n!=null&&n!=undefined?n.options[n.selectedIndex].text:(console.log("Drop down list object is null or undefind"),"")}},Loader;$(function(){$.ajaxSetup({cache:!1});$(".modal").on("show.bs.modal",function(){$(".popover").popover("hide")});$(".modal").on("hidden.bs.modal",function(){Helpers.Modal.SlideOut.Remove(".modal-content")})}),function(n){"function"==typeof define&&define.amd?define(["jquery"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,i){return t||(t=window),i||(i="undefined"!=typeof window?require("jquery"):require("jquery")(t)),n(i,t,t.document)}:n(jQuery,window,document)}(function(n,t,i,r){function lt(t){var i,r,u={};n.each(t,function(n){(i=n.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(i[1]+" ")&&(r=n.replace(i[0],i[2].toLowerCase()),u[r]=n,"o"===i[1]&&lt(t[n]))});t._hungarianMap=u}function nt(t,i,u){t._hungarianMap||lt(t);var f;n.each(i,function(e){f=t._hungarianMap[e];f!==r&&(u||i[f]===r)&&("o"===f.charAt(0)?(i[f]||(i[f]={}),n.extend(!0,i[f],i[e]),nt(t[f],i[f],u)):i[f]=i[e])})}function ir(n){var t=u.defaults.oLanguage,i=n.sZeroRecords;!n.sEmptyTable&&i&&"No data available in table"===t.sEmptyTable&&k(n,n,"sZeroRecords","sEmptyTable");!n.sLoadingRecords&&i&&"Loading..."===t.sLoadingRecords&&k(n,n,"sZeroRecords","sLoadingRecords");n.sInfoThousands&&(n.sThousands=n.sInfoThousands);(n=n.sDecimal)&&ue(n)}function au(n){if(p(n,"ordering","bSort"),p(n,"orderMulti","bSortMulti"),p(n,"orderClasses","bSortClasses"),p(n,"orderCellsTop","bSortCellsTop"),p(n,"order","aaSorting"),p(n,"orderFixed","aaSortingFixed"),p(n,"paging","bPaginate"),p(n,"pagingType","sPaginationType"),p(n,"pageLength","iDisplayLength"),p(n,"searching","bFilter"),"boolean"==typeof n.sScrollX&&(n.sScrollX=n.sScrollX?"100%":""),"boolean"==typeof n.scrollX&&(n.scrollX=n.scrollX?"100%":""),n=n.aoSearchCols)for(var t=0,i=n.length;t<i;t++)n[t]&&nt(u.models.oSearch,n[t])}function vu(t){p(t,"orderable","bSortable");p(t,"orderData","aDataSort");p(t,"orderSequence","asSorting");p(t,"orderDataType","sortDataType");var i=t.aDataSort;"number"!=typeof i||n.isArray(i)||(t.aDataSort=[i])}function yu(i){var r;if(!u.__browser){r={};u.__browser=r;var e=n("<div/>").css({position:"fixed",top:0,left:-1*n(t).scrollLeft(),height:1,width:1,overflow:"hidden"}).append(n("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(n("<div/>").css({width:"100%",height:10}))).appendTo("body"),f=e.children(),o=f.children();r.barWidth=f[0].offsetWidth-f[0].clientWidth;r.bScrollOversize=100===o[0].offsetWidth&&100!==f[0].clientWidth;r.bScrollbarLeft=1!==Math.round(o.offset().left);r.bBounding=e[0].getBoundingClientRect().width?!0:!1;e.remove()}n.extend(i.oBrowser,u.__browser);i.oScroll.iBarWidth=u.__browser.barWidth}function pu(n,t,i,u,f,e){var o,s=!1;for(i!==r&&(o=i,s=!0);u!==f;)n.hasOwnProperty(u)&&(o=s?t(o,n[u],u,n):n[u],s=!0,u+=e);return o}function rr(t,r){var f=u.defaults.column,e=t.aoColumns.length,f=n.extend({},u.models.oColumn,f,{nTh:r?r:i.createElement("th"),sTitle:f.sTitle?f.sTitle:r?r.innerHTML:"",aDataSort:f.aDataSort?f.aDataSort:[e],mData:f.mData?f.mData:e,idx:e});t.aoColumns.push(f);f=t.aoPreSearchCols;f[e]=n.extend({},u.models.oSearch,f[e]);fi(t,e,n(r).data())}function fi(t,i,f){var i=t.aoColumns[i],e=t.oClasses,s=n(i.nTh),h;i.sWidthOrig||(i.sWidthOrig=s.attr("width")||null,h=(s.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/),h&&(i.sWidthOrig=h[1]));f!==r&&null!==f&&(vu(f),nt(u.defaults.column,f),f.mDataProp!==r&&!f.mData&&(f.mData=f.mDataProp),f.sType&&(i._sManualType=f.sType),f.className&&!f.sClass&&(f.sClass=f.className),n.extend(i,f),k(i,f,"sWidth","sWidthOrig"),f.iDataSort!==r&&(i.aDataSort=[f.iDataSort]),k(i,f,"aDataSort"));var o=i.mData,l=ft(o),c=i.mRender?ft(i.mRender):null,f=function(n){return"string"==typeof n&&-1!==n.indexOf("@")};i._bAttrSrc=n.isPlainObject(o)&&(f(o.sort)||f(o.type)||f(o.filter));i._setter=null;i.fnGetData=function(n,t,i){var u=l(n,t,r,i);return c&&t?c(u,t,n,i):u};i.fnSetData=function(n,t,i){return et(o)(n,t,i)};"number"!=typeof o&&(t._rowReadObject=!0);t.oFeatures.bSort||(i.bSortable=!1,s.addClass(e.sSortableNone));t=-1!==n.inArray("asc",i.asSorting);f=-1!==n.inArray("desc",i.asSorting);!i.bSortable||!t&&!f?(i.sSortingClass=e.sSortableNone,i.sSortingClassJUI=""):t&&!f?(i.sSortingClass=e.sSortableAsc,i.sSortingClassJUI=e.sSortJUIAscAllowed):!t&&f?(i.sSortingClass=e.sSortableDesc,i.sSortingClassJUI=e.sSortJUIDescAllowed):(i.sSortingClass=e.sSortable,i.sSortingClassJUI=e.sSortJUI)}function at(n){var t,i,r;if(!1!==n.oFeatures.bAutoWidth)for(t=n.aoColumns,vr(n),i=0,r=t.length;i<r;i++)t[i].nTh.style.width=t[i].sWidth;t=n.oScroll;(""!==t.sY||""!==t.sX)&&yi(n);o(n,null,"column-sizing",[n])}function vt(n,t){var i=ei(n,"bVisible");return"number"==typeof i[t]?i[t]:null}function yt(t,i){var r=ei(t,"bVisible"),r=n.inArray(i,r);return-1!==r?r:null}function pt(t){var i=0;return n.each(t.aoColumns,function(t,r){r.bVisible&&"none"!==n(r.nTh).css("display")&&i++}),i}function ei(t,i){var r=[];return n.map(t.aoColumns,function(n,t){n[i]&&r.push(t)}),r}function ur(n){for(var c=n.aoColumns,p=n.aoData,h=u.ext.type.detect,e,a,i,v,t,o,s,f=0,l=c.length;f<l;f++)if(t=c[f],s=[],!t.sType&&t._sManualType)t.sType=t._sManualType;else if(!t.sType){for(e=0,a=h.length;e<a;e++){for(i=0,v=p.length;i<v;i++){if(s[i]===r&&(s[i]=y(n,i,f,"type")),o=h[e](s[i],n),!o&&e!==h.length-1)break;if("html"===o)break}if(o){t.sType=o;break}}t.sType||(t.sType="string")}}function wu(t,i,u,f){var s,o,a,c,v,h,l=t.aoColumns,e;if(i)for(s=i.length-1;0<=s;s--)for(h=i[s],e=h.targets!==r?h.targets:h.aTargets,n.isArray(e)||(e=[e]),o=0,a=e.length;o<a;o++)if("number"==typeof e[o]&&0<=e[o]){for(;l.length<=e[o];)rr(t);f(e[o],h)}else if("number"==typeof e[o]&&0>e[o])f(l.length+e[o],h);else if("string"==typeof e[o])for(c=0,v=l.length;c<v;c++)("_all"==e[o]||n(l[c].nTh).hasClass(e[o]))&&f(c,h);if(u)for(s=0,t=u.length;s<t;s++)f(s,u[s])}function rt(t,i,f,e){var o=t.aoData.length,s=n.extend(!0,{},u.models.oRow,{src:f?"dom":"data",idx:o});s._aData=i;t.aoData.push(s);for(var c=t.aoColumns,h=0,l=c.length;h<l;h++)c[h].sType=null;return t.aiDisplayMaster.push(o),i=t.rowIdFn(i),i!==r&&(t.aIds[i]=s),(f||!t.oFeatures.bDeferRender)&&sr(t,o,f,e),o}function oi(t,i){var r;return i instanceof n||(i=n(i)),i.map(function(n,i){return r=or(t,i),rt(t,r.data,i,r.cells)})}function y(n,t,i,u){var h=n.iDraw,e=n.aoColumns[i],s=n.aoData[t]._aData,o=e.sDefaultContent,f=e.fnGetData(s,u,{settings:n,row:t,col:i});if(f===r)return n.iDrawError!=h&&null===o&&(tt(n,0,"Requested unknown parameter "+("function"==typeof e.mData?"{function}":"'"+e.mData+"'")+" for row "+t+", column "+i,4),n.iDrawError=h),o;if((f===s||null===f)&&null!==o&&u!==r)f=o;else if("function"==typeof f)return f.call(s);return null===f&&"display"==u?"":f}function bu(n,t,i,r){n.aoColumns[i].fnSetData(n.aoData[t]._aData,r,{settings:n,row:t,col:i})}function fr(t){return n.map(t.match(/(\\.|[^\.])+/g)||[""],function(n){return n.replace(/\\\./g,".")})}function ft(t){var i,u;return n.isPlainObject(t)?(i={},n.each(t,function(n,t){t&&(i[n]=ft(t))}),function(n,t,u,f){var e=i[t]||i._;return e!==r?e(n,t,u,f):n}):null===t?function(n){return n}:"function"==typeof t?function(n,i,r,u){return t(n,i,r,u)}:"string"==typeof t&&(-1!==t.indexOf(".")||-1!==t.indexOf("[")||-1!==t.indexOf("("))?(u=function(t,i,f){var s,o,e,h;if(""!==f)for(o=fr(f),e=0,h=o.length;e<h;e++){if(f=o[e].match(ii),s=o[e].match(ct),f){if(o[e]=o[e].replace(ii,""),""!==o[e]&&(t=t[o[e]]),s=[],o.splice(0,e+1),o=o.join("."),n.isArray(t))for(e=0,h=t.length;e<h;e++)s.push(u(t[e],i,o));t=f[0].substring(1,f[0].length-1);t=""===t?s:s.join(t);break}else if(s){o[e]=o[e].replace(ct,"");t=t[o[e]]();continue}if(null===t||t[o[e]]===r)return r;t=t[o[e]]}return t},function(n,i){return u(n,i,t)}):function(n){return n[t]}}function et(t){if(n.isPlainObject(t))return et(t._);if(null===t)return function(){};if("function"==typeof t)return function(n,i,r){t(n,"set",i,r)};if("string"==typeof t&&(-1!==t.indexOf(".")||-1!==t.indexOf("[")||-1!==t.indexOf("("))){var i=function(t,u,f){var f=fr(f),o,h,s,e,c;for(o=f[f.length-1],e=0,c=f.length-1;e<c;e++){if(h=f[e].match(ii),s=f[e].match(ct),h){if(f[e]=f[e].replace(ii,""),t[f[e]]=[],o=f.slice(),o.splice(0,e+1),h=o.join("."),n.isArray(u))for(s=0,c=u.length;s<c;s++)o={},i(o,u[s],h),t[f[e]].push(o);else t[f[e]]=u;return}s&&(f[e]=f[e].replace(ct,""),t=t[f[e]](u));(null===t[f[e]]||t[f[e]]===r)&&(t[f[e]]={});t=t[f[e]]}o.match(ct)?t[o.replace(ct,"")](u):t[o.replace(ii,"")]=u};return function(n,r){return i(n,r,t)}}return function(n,i){n[t]=i}}function er(n){return b(n.aoData,"_aData")}function si(n){n.aoData.length=0;n.aiDisplayMaster.length=0;n.aiDisplay.length=0;n.aIds={}}function hi(n,t,i){for(var f=-1,u=0,e=n.length;u<e;u++)n[u]==t?f=u:n[u]>t&&n[u]--;-1!=f&&i===r&&n.splice(f,1)}function wt(n,t,i,u){var f=n.aoData[t],s,e=function(i,r){for(;i.childNodes.length;)i.removeChild(i.firstChild);i.innerHTML=y(n,t,r,"display")},o;if("dom"!==i&&(i&&"auto"!==i||"dom"!==f.src)){if(o=f.anCells,o)if(u!==r)e(o[u],u);else for(i=0,s=o.length;i<s;i++)e(o[i],i)}else f._aData=or(n,f,u,u===r?r:f._aData).data;if(f._aSortData=null,f._aFilterData=null,e=n.aoColumns,u!==r)e[u].sType=null;else{for(i=0,s=e.length;i<s;i++)e[i].sType=null;hr(n,f)}}function or(t,i,u,f){var s=[],e=i.firstChild,h,o,c=0,l,p=t.aoColumns,v=t._rowReadObject,f=f!==r?f:v?{}:[],a=function(n,t){if("string"==typeof n){var i=n.indexOf("@");-1!==i&&(i=n.substring(i+1),et(n)(f,t.getAttribute(i)))}},y=function(t){(u===r||u===c)&&(o=p[c],l=n.trim(t.innerHTML),o&&o._bAttrSrc?(et(o.mData._)(f,l),a(o.mData.sort,t),a(o.mData.type,t),a(o.mData.filter,t)):v?(o._setter||(o._setter=et(o.mData)),o._setter(f,l)):f[c]=l);c++};if(e)for(;e;)h=e.nodeName.toUpperCase(),("TD"==h||"TH"==h)&&(y(e),s.push(e)),e=e.nextSibling;else for(s=i.anCells,e=0,h=s.length;e<h;e++)y(s[e]);return(i=i.firstChild?i:i.nTr)&&(i=i.getAttribute("id"))&&et(t.rowId)(f,i),{data:f,cells:s}}function sr(t,r,u,f){var c=t.aoData[r],a=c._aData,v=[],l,h,e,s,p;if(null===c.nTr){for(l=u||i.createElement("tr"),c.nTr=l,c.anCells=v,l._DT_RowIndex=r,hr(t,c),s=0,p=t.aoColumns.length;s<p;s++)e=t.aoColumns[s],h=u?f[s]:i.createElement(e.sCellType),h._DT_CellIndex={row:r,column:s},v.push(h),u&&!e.mRender&&e.mData===s||n.isPlainObject(e.mData)&&e.mData._===s+".display"||(h.innerHTML=y(t,r,s,"display")),e.sClass&&(h.className+=" "+e.sClass),e.bVisible&&!u?l.appendChild(h):!e.bVisible&&u&&h.parentNode.removeChild(h),e.fnCreatedCell&&e.fnCreatedCell.call(t.oInstance,h,y(t,r,s),a,r,s);o(t,"aoRowCreatedCallback",null,[l,a,r])}c.nTr.setAttribute("role","row")}function hr(t,i){var f=i.nTr,r=i._aData,u;f&&(u=t.rowIdFn(r),u&&(f.id=u),r.DT_RowClass&&(u=r.DT_RowClass.split(" "),i.__rowc=i.__rowc?di(i.__rowc.concat(u)):u,n(f).removeClass(i.__rowc.join(" ")).addClass(r.DT_RowClass)),r.DT_RowAttr&&n(f).attr(r.DT_RowAttr),r.DT_RowData&&n(f).data(r.DT_RowData))}function ku(t){var r,e,u,c,i,f=t.nTHead,l=t.nTFoot,o=0===n("th, td",f).length,s=t.oClasses,h=t.aoColumns;for(o&&(c=n("<tr/>").appendTo(f)),r=0,e=h.length;r<e;r++)i=h[r],u=n(i.nTh).addClass(i.sClass),o&&u.appendTo(c),t.oFeatures.bSort&&(u.addClass(i.sSortingClass),!1!==i.bSortable&&(u.attr("tabindex",t.iTabIndex).attr("aria-controls",t.sTableId),pr(t,i.nTh,r))),i.sTitle!=u[0].innerHTML&&u.html(i.sTitle),kr(t,"header")(t,u,i,s);if(o&&kt(t.aoHeader,f),n(f).find(">tr").attr("role","row"),n(f).find(">tr>th, >tr>td").addClass(s.sHeaderTH),n(l).find(">tr>th, >tr>td").addClass(s.sFooterTH),null!==l)for(t=t.aoFooter[0],r=0,e=t.length;r<e;r++)i=h[r],i.nTf=t[r].cell,i.sClass&&n(i.nTf).addClass(i.sClass)}function bt(t,i,u){var f,l,e,o=[],c=[],s=t.aoColumns.length,h;if(i){for(u===r&&(u=!1),f=0,l=i.length;f<l;f++){for(o[f]=i[f].slice(),o[f].nTr=i[f].nTr,e=s-1;0<=e;e--)t.aoColumns[e].bVisible||u||o[f].splice(e,1);c.push([])}for(f=0,l=o.length;f<l;f++){if(t=o[f].nTr)for(;e=t.firstChild;)t.removeChild(e);for(e=0,i=o[f].length;e<i;e++)if(h=s=1,c[f][e]===r){for(t.appendChild(o[f][e].cell),c[f][e]=1;o[f+s]!==r&&o[f][e].cell==o[f+s][e].cell;)c[f+s][e]=1,s++;for(;o[f][e+h]!==r&&o[f][e].cell==o[f][e+h].cell;){for(u=0;u<s;u++)c[f+u][e+h]=1;h++}n(o[f][e].cell).attr("rowspan",s).attr("colspan",h)}}}}function ut(t){var l=o(t,"aoPreDrawCallback","preDraw",[t]),i,y,e,s,p;if(-1!==n.inArray(!1,l))w(t,!1);else{var l=[],f=0,h=t.asStripeClasses,b=h.length,c=t.oLanguage,i=t.iInitDisplayStart,u="ssp"==v(t),a=t.aiDisplay;if(t.bDrawing=!0,i!==r&&-1!==i&&(t._iDisplayStart=u?i:i>=t.fnRecordsDisplay()?0:i,t.iInitDisplayStart=-1),i=t._iDisplayStart,y=t.fnDisplayEnd(),t.bDeferLoading)t.bDeferLoading=!1,t.iDraw++,w(t,!1);else if(u){if(!t.bDestroying&&!gu(t))return}else t.iDraw++;if(0!==a.length)for(c=u?t.aoData.length:y,u=u?0:i;u<c;u++)e=a[u],s=t.aoData[e],null===s.nTr&&sr(t,e),e=s.nTr,0!==b&&(p=h[f%b],s._sRowStripe!=p&&(n(e).removeClass(s._sRowStripe).addClass(p),s._sRowStripe=p)),o(t,"aoRowCallback",null,[e,s._aData,f,u]),l.push(e),f++;else f=c.sZeroRecords,1==t.iDraw&&"ajax"==v(t)?f=c.sLoadingRecords:c.sEmptyTable&&0===t.fnRecordsTotal()&&(f=c.sEmptyTable),l[0]=n("<tr/>",{"class":b?h[0]:""}).append(n("<td />",{valign:"top",colSpan:pt(t),"class":t.oClasses.sRowEmpty}).html(f))[0];o(t,"aoHeaderCallback","header",[n(t.nTHead).children("tr")[0],er(t),i,y,a]);o(t,"aoFooterCallback","footer",[n(t.nTFoot).children("tr")[0],er(t),i,y,a]);h=n(t.nTBody);h.children().detach();h.append(n(l));o(t,"aoDrawCallback","draw",[t]);t.bSorted=!1;t.bFiltered=!1;t.bDrawing=!1}}function ot(n,t){var i=n.oFeatures,r=i.bFilter;i.bSort&&gf(n);r?dt(n,n.oPreviousSearch):n.aiDisplay=n.aiDisplayMaster.slice();!0!==t&&(n._iDisplayStart=0);n._drawHold=t;ut(n);n._drawHold=!1}function du(t){var v=t.oClasses,y=n(t.nTable),y=n("<div/>").insertBefore(y),l=t.oFeatures,c=n("<div/>",{id:t.sTableId+"_wrapper","class":v.sWrapper+(t.nTFoot?"":" "+v.sNoFooter)}),a,e,r,i,o,f,s,h;for(t.nHolding=y[0],t.nTableWrapper=c[0],t.nTableReinsertBefore=t.nTable.nextSibling,a=t.sDom.split(""),h=0;h<a.length;h++){if(e=null,r=a[h],"<"==r){if(i=n("<div/>")[0],o=a[h+1],"'"==o||'"'==o){for(f="",s=2;a[h+s]!=o;)f+=a[h+s],s++;"H"==f?f=v.sJUIHeader:"F"==f&&(f=v.sJUIFooter);-1!=f.indexOf(".")?(o=f.split("."),i.id=o[0].substr(1,o[0].length-1),i.className=o[1]):"#"==f.charAt(0)?i.id=f.substr(1,f.length-1):i.className=f;h+=s}c.append(i);c=n(i)}else if(">"==r)c=c.parent();else if("l"==r&&l.bPaginate&&l.bLengthChange)e=vf(t);else if("f"==r&&l.bFilter)e=rf(t);else if("r"==r&&l.bProcessing)e=pf(t);else if("t"==r)e=wf(t);else if("i"==r&&l.bInfo)e=cf(t);else if("p"==r&&l.bPaginate)e=yf(t);else if(0!==u.ext.feature.length)for(i=u.ext.feature,s=0,o=i.length;s<o;s++)if(r==i[s].cFeature){e=i[s].fnInit(t);break}e&&(i=t.aanFeatures,i[r]||(i[r]=[]),i[r].push(e),c.append(e))}y.replaceWith(c);t.nHolding=null}function kt(t,i){var c=n(i).children("tr"),l,u,r,f,s,h,a,e,o,v;for(t.splice(0,t.length),r=0,h=c.length;r<h;r++)t.push([]);for(r=0,h=c.length;r<h;r++)for(l=c[r],u=l.firstChild;u;){if("TD"==u.nodeName.toUpperCase()||"TH"==u.nodeName.toUpperCase()){for(e=1*u.getAttribute("colspan"),o=1*u.getAttribute("rowspan"),e=!e||0===e||1===e?1:e,o=!o||0===o||1===o?1:o,f=0,s=t[r];s[f];)f++;for(a=f,v=1===e?!0:!1,s=0;s<e;s++)for(f=0;f<o;f++)t[r+f][a+s]={cell:u,unique:v},t[r+f].nTr=l}u=u.nextSibling}}function ci(n,t,i){var u=[],t,f,r,e;for(i||(i=n.aoHeader,t&&(i=[],kt(i,t))),t=0,f=i.length;t<f;t++)for(r=0,e=i[t].length;r<e;r++)!i[t][r].unique||u[r]&&n.bSortCellsTop||(u[r]=i[t][r].cell);return u}function li(t,i,r){var e,c,f,i;o(t,"aoServerParams","serverParams",[i]);i&&n.isArray(i)&&(e={},c=/(.*?)\[\]$/,n.each(i,function(n,t){var i=t.name.match(c);i?(i=i[0],e[i]||(e[i]=[]),e[i].push(t.value)):e[t.name]=t.value}),i=e);var s,u=t.ajax,l=t.oInstance,h=function(n){o(t,null,"xhr",[t,n,t.jqXHR]);r(n)};n.isPlainObject(u)&&u.data&&(s=u.data,f=n.isFunction(s)?s(i,t):s,i=n.isFunction(s)&&f?f:n.extend(!0,i,f),delete u.data);f={data:i,success:function(n){var i=n.error||n.sError;i&&tt(t,0,i);t.json=n;h(n)},dataType:"json",cache:!1,type:t.sServerMethod,error:function(i,r){var u=o(t,null,"xhr",[t,null,t.jqXHR]);-1===n.inArray(!0,u)&&("parsererror"==r?tt(t,0,"Invalid JSON response",1):4===i.readyState&&tt(t,0,"Ajax error",7));w(t,!1)}};t.oAjaxData=i;o(t,null,"preXhr",[t,i]);t.fnServerData?t.fnServerData.call(l,t.sAjaxSource,n.map(i,function(n,t){return{name:t,value:n}}),h,t):t.sAjaxSource||"string"==typeof u?t.jqXHR=n.ajax(n.extend(f,{url:u||t.sAjaxSource})):n.isFunction(u)?t.jqXHR=u.call(l,i,h,t):(t.jqXHR=n.ajax(n.extend(f,u)),u.data=s)}function gu(n){return n.bAjaxDataGet?(n.iDraw++,w(n,!0),li(n,nf(n),function(t){tf(n,t)}),!1):!0}function nf(t){var e=t.aoColumns,v=e.length,s=t.oFeatures,l=t.oPreviousSearch,p=t.aoPreSearchCols,r,a=[],o,f,h,y=st(t),i,c;for(r=t._iDisplayStart,o=!1!==s.bPaginate?t._iDisplayLength:-1,i=function(n,t){a.push({name:n,value:t})},i("sEcho",t.iDraw),i("iColumns",v),i("sColumns",b(e,"sName").join(",")),i("iDisplayStart",r),i("iDisplayLength",o),c={draw:t.iDraw,columns:[],order:[],start:r,length:o,search:{value:l.sSearch,regex:l.bRegex}},r=0;r<v;r++)f=e[r],h=p[r],o="function"==typeof f.mData?"function":f.mData,c.columns.push({data:o,name:f.sName,searchable:f.bSearchable,orderable:f.bSortable,search:{value:h.sSearch,regex:h.bRegex}}),i("mDataProp_"+r,o),s.bFilter&&(i("sSearch_"+r,h.sSearch),i("bRegex_"+r,h.bRegex),i("bSearchable_"+r,f.bSearchable)),s.bSort&&i("bSortable_"+r,f.bSortable);return s.bFilter&&(i("sSearch",l.sSearch),i("bRegex",l.bRegex)),s.bSort&&(n.each(y,function(n,t){c.order.push({column:t.col,dir:t.dir});i("iSortCol_"+n,t.col);i("sSortDir_"+n,t.dir)}),i("iSortingCols",y.length)),e=u.ext.legacy.ajax,null===e?t.sAjaxSource?a:c:e?a:c}function tf(n,t){var f=ai(n,t),i=t.sEcho!==r?t.sEcho:t.draw,u=t.iTotalRecords!==r?t.iTotalRecords:t.recordsTotal,e=t.iTotalDisplayRecords!==r?t.iTotalDisplayRecords:t.recordsFiltered;if(i){if(1*i<n.iDraw)return;n.iDraw=1*i}for(si(n),n._iRecordsTotal=parseInt(u,10),n._iRecordsDisplay=parseInt(e,10),i=0,u=f.length;i<u;i++)rt(n,f[i]);n.aiDisplay=n.aiDisplayMaster.slice();n.bAjaxDataGet=!1;ut(n);n._bInitComplete||vi(n,t);n.bAjaxDataGet=!0;w(n,!1)}function ai(t,i){var u=n.isPlainObject(t.ajax)&&t.ajax.dataSrc!==r?t.ajax.dataSrc:t.sAjaxDataProp;return"data"===u?i.aaData||i[u]:""!==u?ft(u)(i):i}function rf(t){var u=t.oClasses,s=t.sTableId,h=t.oLanguage,r=t.oPreviousSearch,o=t.aanFeatures,f='<input type="search" class="'+u.sFilterInput+'"/>',e=h.sSearch,e=e.match(/_INPUT_/)?e.replace("_INPUT_",f):e+f,u=n("<div/>",{id:o.f?null:s+"_filter","class":u.sFilter}).append(n("<label/>").append(e)),o=function(){var n=this.value?this.value:"";n!=r.sSearch&&(dt(t,{sSearch:n,bRegex:r.bRegex,bSmart:r.bSmart,bCaseInsensitive:r.bCaseInsensitive}),t._iDisplayStart=0,ut(t))},f=null!==t.searchDelay?t.searchDelay:"ssp"===v(t)?400:0,c=n("input",u).val(r.sSearch).attr("placeholder",h.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",f?iu(o,f):o).on("keypress.DT",function(n){if(13==n.keyCode)return!1}).attr("aria-controls",s);n(t.nTable).on("search.dt.DT",function(n,u){if(t===u)try{c[0]!==i.activeElement&&c.val(r.sSearch)}catch(f){}});return u[0]}function dt(n,t,i){var f=n.oPreviousSearch,u=n.aoPreSearchCols,e=function(n){f.sSearch=n.sSearch;f.bRegex=n.bRegex;f.bSmart=n.bSmart;f.bCaseInsensitive=n.bCaseInsensitive};if(ur(n),"ssp"!=v(n)){for(ef(n,t.sSearch,i,t.bEscapeRegex!==r?!t.bEscapeRegex:t.bRegex,t.bSmart,t.bCaseInsensitive),e(t),t=0;t<u.length;t++)ff(n,u[t].sSearch,t,u[t].bEscapeRegex!==r?!u[t].bEscapeRegex:u[t].bRegex,u[t].bSmart,u[t].bCaseInsensitive);uf(n)}else e(t);n.bFiltered=!0;o(n,null,"search",[n])}function uf(t){for(var s=u.ext.search,i=t.aiDisplay,e,r,o=0,c=s.length;o<c;o++){for(var h=[],f=0,l=i.length;f<l;f++)r=i[f],e=t.aoData[r],s[o](t,e._aFilterData,r,e._aData,f)&&h.push(r);i.length=0;n.merge(i,h)}}function ff(n,t,i,r,u,f){if(""!==t){for(var o=[],e=n.aiDisplay,r=cr(t,r,u,f),u=0;u<e.length;u++)t=n.aoData[e[u]]._aFilterData[i],r.test(t)&&o.push(e[u]);n.aiDisplay=o}}function ef(n,t,i,r,f,e){var r=cr(t,r,f,e),e=n.oPreviousSearch.sSearch,o=n.aiDisplayMaster,s,f=[];if(0!==u.ext.search.length&&(i=!0),s=of(n),0>=t.length)n.aiDisplay=o.slice();else{for((s||i||e.length>t.length||0!==t.indexOf(e)||n.bSorted)&&(n.aiDisplay=o.slice()),t=n.aiDisplay,i=0;i<t.length;i++)r.test(n.aoData[t[i]]._sFilterRow)&&f.push(t[i]);n.aiDisplay=f}}function cr(t,i,r,u){return t=i?t:tu(t),r&&(t="^(?=.*?"+n.map(t.match(/"[^"]+"|[^ ]+/g)||[""],function(n){if('"'===n.charAt(0))var t=n.match(/^"(.*)"$/),n=t?t[1]:n;return n.replace('"',"")}).join(")(?=.*?")+").*$"),RegExp(t,u?"i":"")}function of(n){var s=n.aoColumns,i,r,f,h,c,e,t,o,l=u.ext.type.search;for(i=!1,r=0,h=n.aoData.length;r<h;r++)if(o=n.aoData[r],!o._aFilterData){for(e=[],f=0,c=s.length;f<c;f++)i=s[f],i.bSearchable?(t=y(n,r,f,"filter"),l[i.sType]&&(t=l[i.sType](t)),null===t&&(t=""),"string"!=typeof t&&t.toString&&(t=t.toString())):t="",t.indexOf&&-1!==t.indexOf("&")&&(gi.innerHTML=t,t=we?gi.textContent:gi.innerText),t.replace&&(t=t.replace(/[\r\n]/g,"")),e.push(t);o._aFilterData=e;o._sFilterRow=e.join("  ");i=!0}return i}function sf(n){return{search:n.sSearch,smart:n.bSmart,regex:n.bRegex,caseInsensitive:n.bCaseInsensitive}}function hf(n){return{sSearch:n.search,bSmart:n.smart,bRegex:n.regex,bCaseInsensitive:n.caseInsensitive}}function cf(t){var i=t.sTableId,r=t.aanFeatures.i,u=n("<div/>",{"class":t.oClasses.sInfo,id:r?null:i+"_info"});return r||(t.aoDrawCallback.push({fn:lf,sName:"information"}),u.attr("role","status").attr("aria-live","polite"),n(t.nTable).attr("aria-describedby",i+"_info")),u[0]}function lf(t){var f=t.aanFeatures.i;if(0!==f.length){var i=t.oLanguage,o=t._iDisplayStart+1,s=t.fnDisplayEnd(),e=t.fnRecordsTotal(),u=t.fnRecordsDisplay(),r=u?i.sInfo:i.sInfoEmpty;u!==e&&(r+=" "+i.sInfoFiltered);r+=i.sInfoPostFix;r=af(t,r);i=i.fnInfoCallback;null!==i&&(r=i.call(t.oInstance,t,o,s,e,u,r));n(f).html(r)}}function af(n,t){var i=n.fnFormatNumber,u=n._iDisplayStart+1,r=n._iDisplayLength,f=n.fnRecordsDisplay(),e=-1===r;return t.replace(/_START_/g,i.call(n,u)).replace(/_END_/g,i.call(n,n.fnDisplayEnd())).replace(/_MAX_/g,i.call(n,n.fnRecordsTotal())).replace(/_TOTAL_/g,i.call(n,f)).replace(/_PAGE_/g,i.call(n,e?1:Math.ceil(u/r))).replace(/_PAGES_/g,i.call(n,e?1:Math.ceil(f/r)))}function gt(n){var t,r,e=n.iInitDisplayStart,i=n.aoColumns,u,f;if(r=n.oFeatures,f=n.bDeferLoading,n.bInitialised){for(du(n),ku(n),bt(n,n.aoHeader),bt(n,n.aoFooter),w(n,!0),r.bAutoWidth&&vr(n),t=0,r=i.length;t<r;t++)u=i[t],u.sWidth&&(u.nTh.style.width=h(u.sWidth));o(n,null,"preInit",[n]);ot(n);i=v(n);("ssp"!=i||f)&&("ajax"==i?li(n,[],function(i){var r=ai(n,i);for(t=0;t<r.length;t++)rt(n,r[t]);n.iInitDisplayStart=e;ot(n);w(n,!1);vi(n,i)},n):(w(n,!1),vi(n)))}else setTimeout(function(){gt(n)},200)}function vi(n,t){n._bInitComplete=!0;(t||n.oInit.aaData)&&at(n);o(n,null,"plugin-init",[n,t]);o(n,"aoInitComplete","init",[n,t])}function lr(n,t){var i=parseInt(t,10);n._iDisplayLength=i;br(n);o(n,null,"length",[n,i])}function vf(t){for(var r,o=t.oClasses,e=t.sTableId,i=t.aLengthMenu,f=n.isArray(i[0]),s=f?i[0]:i,i=f?i[1]:i,f=n("<select/>",{name:e+"_length","aria-controls":e,"class":o.sLengthSelect}),u=0,h=s.length;u<h;u++)f[0][u]=new Option(i[u],s[u]);r=n("<div><label/><\/div>").addClass(o.sLength);t.aanFeatures.l||(r[0].id=e+"_length");r.children().append(t.oLanguage.sLengthMenu.replace("_MENU_",f[0].outerHTML));n("select",r).val(t._iDisplayLength).on("change.DT",function(){lr(t,n(this).val());ut(t)});n(t.nTable).on("length.dt.DT",function(i,u,f){t===u&&n("select",r).val(f)});return r[0]}function yf(t){var i=t.sPaginationType,r=u.ext.pager[i],e="function"==typeof r,o=function(n){ut(n)},i=n("<div/>").addClass(t.oClasses.sPaging+i)[0],f=t.aanFeatures;return e||r.fnInit(t,i,o),f.p||(i.id=t.sTableId+"_paginate",t.aoDrawCallback.push({fn:function(n){if(e)for(var u=n._iDisplayStart,i=n._iDisplayLength,s=n.fnRecordsDisplay(),t=-1===i,u=t?0:Math.ceil(u/i),i=t?1:Math.ceil(s/i),s=r(u,i),t=0,h=f.p.length;t<h;t++)kr(n,"pageButton")(n,f.p[t],t,s,u,i);else r.fnUpdate(n,o)},sName:"pagination"})),i}function ar(n,t,i){var r=n._iDisplayStart,u=n._iDisplayLength,f=n.fnRecordsDisplay();return 0===f||-1===u?r=0:"number"==typeof t?(r=t*u,r>f&&(r=0)):"first"==t?r=0:"previous"==t?(r=0<=u?r-u:0,0>r&&(r=0)):"next"==t?r+u<f&&(r+=u):"last"==t?r=Math.floor((f-1)/u)*u:tt(n,0,"Unknown paging action: "+t,5),t=n._iDisplayStart!==r,n._iDisplayStart=r,t&&(o(n,null,"page",[n]),i&&ut(n)),t}function pf(t){return n("<div/>",{id:t.aanFeatures.r?null:t.sTableId+"_processing","class":t.oClasses.sProcessing}).html(t.oLanguage.sProcessing).insertBefore(t.nTable)[0]}function w(t,i){t.oFeatures.bProcessing&&n(t.aanFeatures.r).css("display",i?"block":"none");o(t,null,"processing",[t,i])}function wf(t){var i=n(t.nTable),f;if(i.attr("role","grid"),f=t.oScroll,""===f.sX&&""===f.sY)return t.nTable;var r=f.sX,c=f.sY,u=t.oClasses,s=i.children("caption"),l=s.length?s[0]._captionSide:null,e=n(i[0].cloneNode(!1)),y=n(i[0].cloneNode(!1)),o=i.children("tfoot");o.length||(o=null);e=n("<div/>",{"class":u.sScrollWrapper}).append(n("<div/>",{"class":u.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:r?r?h(r):null:"100%"}).append(n("<div/>",{"class":u.sScrollHeadInner}).css({"box-sizing":"content-box",width:f.sXInner||"100%"}).append(e.removeAttr("id").css("margin-left",0).append("top"===l?s:null).append(i.children("thead"))))).append(n("<div/>",{"class":u.sScrollBody}).css({position:"relative",overflow:"auto",width:r?h(r):null}).append(i));o&&e.append(n("<div/>",{"class":u.sScrollFoot}).css({overflow:"hidden",border:0,width:r?r?h(r):null:"100%"}).append(n("<div/>",{"class":u.sScrollFootInner}).append(y.removeAttr("id").css("margin-left",0).append("bottom"===l?s:null).append(i.children("tfoot")))));var i=e.children(),a=i[0],u=i[1],v=o?i[2]:null;if(r)n(u).on("scroll.DT",function(){var n=this.scrollLeft;a.scrollLeft=n;o&&(v.scrollLeft=n)});return n(u).css(c&&f.bCollapse?"max-height":"height",c),t.nScrollHead=a,t.nScrollBody=u,t.nScrollFoot=v,t.aoDrawCallback.push({fn:yi,sName:"scrolling"}),e[0]}function yi(t){var f=t.oScroll,s=f.sX,v=f.sXInner,p=f.sY,f=f.iBarWidth,e=n(t.nScrollHead),pt=e[0].style,u=e.children("div"),et=u[0].style,wt=u.children("table"),u=t.nScrollBody,y=n(u),nt=u.style,it=n(t.nScrollFoot).children("div"),bt=it.children("table"),w=n(t.nTHead),i=n(t.nTable),ot=i[0],k=ot.style,c=t.nTFoot?n(t.nTFoot):null,st=t.oBrowser,rt=st.bScrollOversize,kt=b(t.aoColumns,"nTh"),l,o,a,d,ut=[],ft=[],ht=[],ct=[],lt,yt=function(n){n=n.style;n.paddingTop="0";n.paddingBottom="0";n.borderTopWidth="0";n.borderBottomWidth="0";n.height=0};o=u.scrollHeight>u.clientHeight;t.scrollBarVis!==o&&t.scrollBarVis!==r?(t.scrollBarVis=o,at(t)):(t.scrollBarVis=o,i.children("thead, tfoot").remove(),c&&(a=c.clone().prependTo(i),l=c.find("tr"),a=a.find("tr")),d=w.clone().prependTo(i),w=w.find("tr"),o=d.find("tr"),d.find("th, td").removeAttr("tabindex"),s||(nt.width="100%",e[0].style.width="100%"),n.each(ci(t,d),function(n,i){lt=vt(t,n);i.style.width=t.aoColumns[lt].sWidth}),c&&g(function(n){n.style.width=""},a),e=i.outerWidth(),""===s?(k.width="100%",rt&&(i.find("tbody").height()>u.offsetHeight||"scroll"==y.css("overflow-y"))&&(k.width=h(i.outerWidth()-f)),e=i.outerWidth()):""!==v&&(k.width=h(v),e=i.outerWidth()),g(yt,o),g(function(t){ht.push(t.innerHTML);ut.push(h(n(t).css("width")))},o),g(function(t,i){n.inArray(t,kt)!==-1&&(t.style.width=ut[i])},w),n(o).height(0),c&&(g(yt,a),g(function(t){ct.push(t.innerHTML);ft.push(h(n(t).css("width")))},a),g(function(n,t){n.style.width=ft[t]},l),n(a).height(0)),g(function(n,t){n.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+ht[t]+"<\/div>";n.style.width=ut[t]},o),c&&g(function(n,t){n.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+ct[t]+"<\/div>";n.style.width=ft[t]},a),i.outerWidth()<e?(l=u.scrollHeight>u.offsetHeight||"scroll"==y.css("overflow-y")?e+f:e,rt&&(u.scrollHeight>u.offsetHeight||"scroll"==y.css("overflow-y"))&&(k.width=h(l-f)),(""===s||""!==v)&&tt(t,1,"Possible column misalignment",6)):l="100%",nt.width=h(l),pt.width=h(l),c&&(t.nScrollFoot.style.width=h(l)),!p&&rt&&(nt.height=h(ot.offsetHeight+f)),s=i.outerWidth(),wt[0].style.width=h(s),et.width=h(s),v=i.height()>u.clientHeight||"scroll"==y.css("overflow-y"),p="padding"+(st.bScrollbarLeft?"Left":"Right"),et[p]=v?f+"px":"0px",c&&(bt[0].style.width=h(s),it[0].style.width=h(s),it[0].style[p]=v?f+"px":"0px"),i.children("colgroup").insertBefore(i.children("thead")),y.scroll(),(t.bSorted||t.bFiltered)&&!t._drawHold&&(u.scrollTop=0))}function g(n,t,i){for(var e=0,u=0,o=t.length,r,f;u<o;){for(r=t[u].firstChild,f=i?i[u].firstChild:null;r;)1===r.nodeType&&(i?n(r,f,e):n(r,e),e++),r=r.nextSibling,f=i?f.nextSibling:null;u++}}function vr(i){var s=i.nTable,a=i.aoColumns,p=i.oScroll,v=p.sY,y=p.sX,b=p.sXInner,u=a.length,o=ei(i,"bVisible"),c=n("th",i.nTHead),l=s.getAttribute("width"),e=s.parentNode,w=!1,r,f,k=i.oBrowser,p=k.bScrollOversize,d;for((r=s.style.width)&&-1!==r.indexOf("%")&&(l=r),r=0;r<o.length;r++)f=a[o[r]],null!==f.sWidth&&(f.sWidth=bf(f.sWidthOrig,e),w=!0);if(!p&&(w||y||v||u!=pt(i)||u!=c.length)){for(u=n(s).clone().css("visibility","hidden").removeAttr("id"),u.find("tbody tr").remove(),d=n("<tr/>").appendTo(u.find("tbody")),u.find("thead, tfoot").remove(),u.append(n(i.nTHead).clone()).append(n(i.nTFoot).clone()),u.find("tfoot th, tfoot td").css("width",""),c=ci(i,u.find("thead")[0]),r=0;r<o.length;r++)f=a[o[r]],c[r].style.width=null!==f.sWidthOrig&&""!==f.sWidthOrig?h(f.sWidthOrig):"",f.sWidthOrig&&y&&n(c[r]).append(n("<div/>").css({width:f.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(i.aoData.length)for(r=0;r<o.length;r++)w=o[r],f=a[w],n(kf(i,w)).clone(!1).append(f.sContentPadding).appendTo(d);for(n("[name]",u).removeAttr("name"),f=n("<div/>").css(y||v?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(u).appendTo(e),y&&b?u.width(b):y?(u.css("width","auto"),u.removeAttr("width"),u.width()<e.clientWidth&&l&&u.width(e.clientWidth)):v?u.width(e.clientWidth):l&&u.width(l),r=v=0;r<o.length;r++)e=n(c[r]),b=e.outerWidth()-e.width(),e=k.bBounding?Math.ceil(c[r].getBoundingClientRect().width):e.outerWidth(),v+=e,a[o[r]].sWidth=h(e-b);s.style.width=h(v);f.remove()}else for(r=0;r<u;r++)o=vt(i,r),null!==o&&(a[o].sWidth=h(c.eq(r).width()));l&&(s.style.width=h(l));(l||y)&&!i._reszEvt&&(s=function(){n(t).on("resize.DT-"+i.sInstance,iu(function(){at(i)}))},p?setTimeout(s,1e3):s(),i._reszEvt=!0)}function bf(t,r){if(!t)return 0;var u=n("<div/>").css("width",h(t)).appendTo(r||i.body),f=u[0].offsetWidth;return u.remove(),f}function kf(t,i){var r=df(t,i),u;return 0>r?null:(u=t.aoData[r],u.nTr?u.anCells[i]:n("<td/>").html(y(t,r,i,"display"))[0])}function df(n,t){for(var i,u=-1,f=-1,r=0,e=n.aoData.length;r<e;r++)i=y(n,r,t,"display")+"",i=i.replace(be,""),i=i.replace(/&nbsp;/g," "),i.length>u&&(u=i.length,f=r);return f}function h(n){return null===n?"0px":"number"==typeof n?0>n?"0px":n+"px":n.match(/\d$/)?n+"px":n}function st(t){var i,o,a=[],h=t.aoColumns,e,s,c,l,f;for(i=t.aaSortingFixed,o=n.isPlainObject(i),f=[],e=function(t){t.length&&!n.isArray(t[0])?f.push(t):n.merge(f,t)},n.isArray(i)&&e(i),o&&i.pre&&e(i.pre),e(t.aaSorting),o&&i.post&&e(i.post),t=0;t<f.length;t++)for(l=f[t][0],e=h[l].aDataSort,i=0,o=e.length;i<o;i++)s=e[i],c=h[s].sType||"string",f[t]._idx===r&&(f[t]._idx=n.inArray(f[t][1],h[s].asSorting)),a.push({src:l,col:s,dir:f[t][1],index:f[t]._idx,type:c,formatter:u.ext.type.order[c+"-pre"]});return a}function gf(n){var t,f,r=[],h=u.ext.type.order,e=n.aoData,c=0,s,o=n.aiDisplayMaster,i;for(ur(n),i=st(n),t=0,f=i.length;t<f;t++)s=i[t],s.formatter&&c++,te(n,s.col);if("ssp"!=v(n)&&0!==i.length){for(t=0,f=o.length;t<f;t++)r[o[t]]=t;c===i.length?o.sort(function(n,t){for(var u,f,s,h=i.length,c=e[n]._aSortData,l=e[t]._aSortData,o=0;o<h;o++)if(s=i[o],u=c[s.col],f=l[s.col],u=u<f?-1:u>f?1:0,0!==u)return"asc"===s.dir?u:-u;return u=r[n],f=r[t],u<f?-1:u>f?1:0}):o.sort(function(n,t){for(var u,o,f,c=i.length,l=e[n]._aSortData,a=e[t]._aSortData,s=0;s<c;s++)if(f=i[s],u=l[f.col],o=a[f.col],f=h[f.type+"-"+f.dir]||h["string-"+f.dir],u=f(u,o),0!==u)return u;return u=r[n],o=r[t],u<o?-1:u>o?1:0})}n.bSorted=!0}function ne(n){for(var u,f,e,t,o=n.aoColumns,i=st(n),n=n.oLanguage.oAria,r=0,s=o.length;r<s;r++)t=o[r],u=t.asSorting,e=t.sTitle.replace(/<.*?>/g,""),f=t.nTh,f.removeAttribute("aria-sort"),t.bSortable&&(0<i.length&&i[0].col==r?(f.setAttribute("aria-sort","asc"==i[0].dir?"ascending":"descending"),t=u[i[0].index+1]||u[0]):t=u[0],e+="asc"===t?n.sSortAscending:n.sSortDescending),f.setAttribute("aria-label",e)}function yr(t,i,u,f){var e=t.aaSorting,o=t.aoColumns[i].asSorting,s=function(t,i){var u=t._idx;return u===r&&(u=n.inArray(t[1],o)),u+1<o.length?u+1:i?null:0};"number"==typeof e[0]&&(e=t.aaSorting=[e]);u&&t.oFeatures.bSortMulti?(u=n.inArray(i,b(e,"0")),-1!==u?(i=s(e[u],!0),null===i&&1===e.length&&(i=0),null===i?e.splice(u,1):(e[u][1]=o[i],e[u]._idx=i)):(e.push([i,o[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==i?(i=s(e[0]),e.length=1,e[0][1]=o[i],e[0]._idx=i):(e.length=0,e.push([i,o[0]]),e[0]._idx=0);ot(t);"function"==typeof f&&f(t)}function pr(n,t,i,r){var u=n.aoColumns[i];wr(t,{},function(t){!1!==u.bSortable&&(n.oFeatures.bProcessing?(w(n,!0),setTimeout(function(){yr(n,i,t.shiftKey,r);"ssp"!==v(n)&&w(n,!1)},0)):yr(n,i,t.shiftKey,r))})}function pi(t){var e=t.aLastSort,o=t.oClasses.sSortColumn,f=st(t),i=t.oFeatures,r,u;if(i.bSort&&i.bSortClasses){for(i=0,r=e.length;i<r;i++)u=e[i].src,n(b(t.aoData,"anCells",u)).removeClass(o+(2>i?i+1:3));for(i=0,r=f.length;i<r;i++)u=f[i].src,n(b(t.aoData,"anCells",u)).addClass(o+(2>i?i+1:3))}t.aLastSort=f}function te(n,t){var i=n.aoColumns[t],f=u.ext.order[i.sSortDataType],o;f&&(o=f.call(n.oInstance,n,t,yt(n,t)));for(var e,s=u.ext.type.order[i.sType+"-pre"],r=0,h=n.aoData.length;r<h;r++)(i=n.aoData[r],i._aSortData||(i._aSortData=[]),!i._aSortData[t]||f)&&(e=f?o[r]:y(n,r,t,"sort"),i._aSortData[t]=s?s(e):e)}function wi(t){if(t.oFeatures.bStateSave&&!t.bDestroying){var i={time:+new Date,start:t._iDisplayStart,length:t._iDisplayLength,order:n.extend(!0,[],t.aaSorting),search:sf(t.oPreviousSearch),columns:n.map(t.aoColumns,function(n,i){return{visible:n.bVisible,search:sf(t.aoPreSearchCols[i])}})};o(t,"aoStateSaveParams","stateSaveParams",[t,i]);t.oSavedState=i;t.fnStateSaveCallback.call(t.oInstance,t,i)}}function ie(t,i,u){var f,h,e=t.aoColumns,i=function(i){if(i&&i.time){var s=o(t,"aoStateLoadParams","stateLoadParams",[t,i]);if(-1===n.inArray(!1,s)&&(s=t.iStateDuration,!(0<s&&i.time<+new Date-1e3*s)&&!(i.columns&&e.length!==i.columns.length))){if(t.oLoadedState=n.extend(!0,{},i),i.start!==r&&(t._iDisplayStart=i.start,t.iInitDisplayStart=i.start),i.length!==r&&(t._iDisplayLength=i.length),i.order!==r&&(t.aaSorting=[],n.each(i.order,function(n,i){t.aaSorting.push(i[0]>=e.length?[0,i[1]]:i)})),i.search!==r&&n.extend(t.oPreviousSearch,hf(i.search)),i.columns)for(f=0,h=i.columns.length;f<h;f++)s=i.columns[f],s.visible!==r&&(e[f].bVisible=s.visible),s.search!==r&&n.extend(t.aoPreSearchCols[f],hf(s.search));o(t,"aoStateLoaded","stateLoaded",[t,i])}}u()},s;t.oFeatures.bStateSave?(s=t.fnStateLoadCallback.call(t.oInstance,t,i),s!==r&&i(s)):u()}function bi(t){var i=u.settings,t=n.inArray(t,b(i,"nTable"));return-1!==t?i[t]:null}function tt(n,i,r,f){if(r="DataTables warning: "+(n?"table id="+n.sTableId+" - ":"")+r,f&&(r+=". For more information about this error, please see http://datatables.net/tn/"+f),i)t.console&&console.log&&console.log(r);else if(i=u.ext,i=i.sErrMode||i.errMode,n&&o(n,null,"error",[n,f,r]),"alert"==i)alert(r);else{if("throw"==i)throw Error(r);"function"==typeof i&&i(n,f,r)}}function k(t,i,u,f){n.isArray(u)?n.each(u,function(r,u){n.isArray(u)?k(t,i,u[0],u[1]):k(t,i,u)}):(f===r&&(f=u),i[u]!==r&&(t[f]=i[u]))}function re(t,i,r){var f;for(var u in i)i.hasOwnProperty(u)&&(f=i[u],n.isPlainObject(f)?(n.isPlainObject(t[u])||(t[u]={}),n.extend(!0,t[u],f)):t[u]=r&&"data"!==u&&"aaData"!==u&&n.isArray(f)?f.slice():f);return t}function wr(t,i,r){n(t).on("click.DT",i,function(n){t.blur();r(n)}).on("keypress.DT",i,function(n){13===n.which&&(n.preventDefault(),r(n))}).on("selectstart.DT",function(){return!1})}function a(n,t,i,r){i&&n[t].push({fn:i,sName:r})}function o(t,i,r,u){var f=[];return i&&(f=n.map(t[i].slice().reverse(),function(n){return n.fn.apply(t.oInstance,u)})),null!==r&&(i=n.Event(r+".dt"),n(t.nTable).trigger(i,u),f.push(i.result)),f}function br(n){var t=n._iDisplayStart,r=n.fnDisplayEnd(),i=n._iDisplayLength;t>=r&&(t=r-i);t-=t%i;(-1===i||0>t)&&(t=0);n._iDisplayStart=t}function kr(t,i){var r=t.renderer,f=u.ext.renderer[i];return n.isPlainObject(r)&&r[i]?f[r[i]]||f._:"string"==typeof r?f[r]||f._:f._}function v(n){return n.oFeatures.bServerSide?"ssp":n.ajax||n.sAjaxSource?"ajax":"dom"}function ni(n,t){var i=[],i=cu.numbers_length,r=Math.floor(i/2);return t<=i?i=ht(0,t):n<=r?(i=ht(0,i-2),i.push("ellipsis"),i.push(t-1)):(n>=t-1-r?i=ht(t-(i-2),t):(i=ht(n-r+2,n+r-1),i.push("ellipsis"),i.push(t-1)),i.splice(0,0,"ellipsis"),i.splice(0,0,0)),i.DT_el="span",i}function ue(t){n.each({num:function(n){return ui(n,t)},"num-fmt":function(n){return ui(n,t,gr)},"html-num":function(n){return ui(n,t,ki)},"html-num-fmt":function(n){return ui(n,t,ki,gr)}},function(n,i){c.type.order[n+t+"-pre"]=i;n.match(/^html\-/)&&(c.type.search[n+t]=c.type.search.html)})}function fe(n){return function(){var t=[bi(this[u.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return u.ext.internal[n].apply(this,t)}}var u=function(t){var f;this.$=function(n,t){return this.api(!0).$(n,t)};this._=function(n,t){return this.api(!0).rows(n,t).data()};this.api=function(n){return n?new e(bi(this[c.iApiIndex])):new e(this)};this.fnAddData=function(t,i){var u=this.api(!0),f=n.isArray(t)&&(n.isArray(t[0])||n.isPlainObject(t[0]))?u.rows.add(t):u.row.add(t);return(i===r||i)&&u.draw(),f.flatten().toArray()};this.fnAdjustColumnSizing=function(n){var t=this.api(!0).columns.adjust(),i=t.settings()[0],u=i.oScroll;n===r||n?t.draw(!1):(""!==u.sX||""!==u.sY)&&yi(i)};this.fnClearTable=function(n){var t=this.api(!0).clear();(n===r||n)&&t.draw()};this.fnClose=function(n){this.api(!0).row(n).child.hide()};this.fnDeleteRow=function(n,t,i){var u=this.api(!0),n=u.rows(n),f=n.settings()[0],e=f.aoData[n[0][0]];return n.remove(),t&&t.call(this,f,e),(i===r||i)&&u.draw(),e};this.fnDestroy=function(n){this.api(!0).destroy(n)};this.fnDraw=function(n){this.api(!0).draw(n)};this.fnFilter=function(n,t,i,u,f,e){f=this.api(!0);null===t||t===r?f.search(n,i,u,e):f.column(t).search(n,i,u,e);f.draw()};this.fnGetData=function(n,t){var i=this.api(!0),u;return n!==r?(u=n.nodeName?n.nodeName.toLowerCase():"",t!==r||"td"==u||"th"==u?i.cell(n,t).data():i.row(n).data()||null):i.data().toArray()};this.fnGetNodes=function(n){var t=this.api(!0);return n!==r?t.row(n).node():t.rows().nodes().flatten().toArray()};this.fnGetPosition=function(n){var i=this.api(!0),t=n.nodeName.toUpperCase();return"TR"==t?i.row(n).index():"TD"==t||"TH"==t?(n=i.cell(n).index(),[n.row,n.columnVisible,n.column]):null};this.fnIsOpen=function(n){return this.api(!0).row(n).child.isShown()};this.fnOpen=function(n,t,i){return this.api(!0).row(n).child(t,i).show().child()[0]};this.fnPageChange=function(n,t){var i=this.api(!0).page(n);(t===r||t)&&i.draw(!1)};this.fnSetColumnVis=function(n,t,i){n=this.api(!0).column(n).visible(t);(i===r||i)&&n.columns.adjust().draw()};this.fnSettings=function(){return bi(this[c.iApiIndex])};this.fnSort=function(n){this.api(!0).order(n).draw()};this.fnSortListener=function(n,t,i){this.api(!0).order.listener(n,t,i)};this.fnUpdate=function(n,t,i,u,f){var e=this.api(!0);return i===r||null===i?e.row(t).data(n):e.cell(t,i).data(n),(f===r||f)&&e.columns.adjust(),(u===r||u)&&e.draw(),0};this.fnVersionCheck=c.fnVersionCheck;var i=this,s=t===r,h=this.length;s&&(t={});this.oApi=this.internal=c.internal;for(f in u.ext.internal)f&&(this[f]=fe(f));return this.each(function(){var c={},e=1<h?re(c,t,!0):t,l=0,d,c=this.getAttribute("id"),ht=!1,y=u.defaults,p=n(this),w,b,ct,f,g,it,et,ut,ot;if("table"!=this.nodeName.toLowerCase())tt(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{for(au(y),vu(y.column),nt(y,y,!0),nt(y.column,y.column,!0),nt(y,n.extend(e,p.data())),w=u.settings,l=0,d=w.length;l<d;l++){if(b=w[l],b.nTable==this||b.nTHead.parentNode==this||b.nTFoot&&b.nTFoot.parentNode==this){if(ct=e.bRetrieve!==r?e.bRetrieve:y.bRetrieve,s||ct)return b.oInstance;if(e.bDestroy!==r?e.bDestroy:y.bDestroy){b.oInstance.fnDestroy();break}else{tt(b,0,"Cannot reinitialise DataTable",3);return}}if(b.sTableId==this.id){w.splice(l,1);break}}if((null===c||""===c)&&(this.id=c="DataTables_Table_"+u.ext._unique++),f=n.extend(!0,{},u.models.oSettings,{sDestroyWidth:p[0].style.width,sInstance:c,sTableId:c}),f.nTable=this,f.oApi=i.internal,f.oInit=e,w.push(f),f.oInstance=1===i.length?i:p.dataTable(),au(e),e.oLanguage&&ir(e.oLanguage),e.aLengthMenu&&!e.iDisplayLength&&(e.iDisplayLength=n.isArray(e.aLengthMenu[0])?e.aLengthMenu[0][0]:e.aLengthMenu[0]),e=re(n.extend(!0,{},y),e),k(f.oFeatures,e,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" ")),k(f,e,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]),k(f.oScroll,e,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),k(f.oLanguage,e,"fnInfoCallback"),a(f,"aoDrawCallback",e.fnDrawCallback,"user"),a(f,"aoServerParams",e.fnServerParams,"user"),a(f,"aoStateSaveParams",e.fnStateSaveParams,"user"),a(f,"aoStateLoadParams",e.fnStateLoadParams,"user"),a(f,"aoStateLoaded",e.fnStateLoaded,"user"),a(f,"aoRowCallback",e.fnRowCallback,"user"),a(f,"aoRowCreatedCallback",e.fnCreatedRow,"user"),a(f,"aoHeaderCallback",e.fnHeaderCallback,"user"),a(f,"aoFooterCallback",e.fnFooterCallback,"user"),a(f,"aoInitComplete",e.fnInitComplete,"user"),a(f,"aoPreDrawCallback",e.fnPreDrawCallback,"user"),f.rowIdFn=ft(e.rowId),yu(f),g=f.oClasses,e.bJQueryUI?(n.extend(g,u.ext.oJUIClasses,e.oClasses),e.sDom===y.sDom&&"lfrtip"===y.sDom&&(f.sDom='<"H"lfr>t<"F"ip>'),f.renderer)?n.isPlainObject(f.renderer)&&!f.renderer.header&&(f.renderer.header="jqueryui"):f.renderer="jqueryui":n.extend(g,u.ext.classes,e.oClasses),p.addClass(g.sTable),f.iInitDisplayStart===r&&(f.iInitDisplayStart=e.iDisplayStart,f._iDisplayStart=e.iDisplayStart),null!==e.iDeferLoading&&(f.bDeferLoading=!0,c=n.isArray(e.iDeferLoading),f._iRecordsDisplay=c?e.iDeferLoading[0]:e.iDeferLoading,f._iRecordsTotal=c?e.iDeferLoading[1]:e.iDeferLoading),it=f.oLanguage,n.extend(!0,it,e.oLanguage),it.sUrl&&(n.ajax({dataType:"json",url:it.sUrl,success:function(t){ir(t);nt(y.oLanguage,t);n.extend(!0,it,t);gt(f)},error:function(){gt(f)}}),ht=!0),null===e.asStripeClasses&&(f.asStripeClasses=[g.sStripeOdd,g.sStripeEven]),c=f.asStripeClasses,et=p.children("tbody").find("tr").eq(0),-1!==n.inArray(!0,n.map(c,function(n){return et.hasClass(n)}))&&(n("tbody tr",this).removeClass(c.join(" ")),f.asDestroyStripes=c.slice()),c=[],w=this.getElementsByTagName("thead"),0!==w.length&&(kt(f.aoHeader,w[0]),c=ci(f)),null===e.aoColumns)for(w=[],l=0,d=c.length;l<d;l++)w.push(null);else w=e.aoColumns;for(l=0,d=w.length;l<d;l++)rr(f,c?c[l]:null);wu(f,e.aoColumnDefs,w,function(n,t){fi(f,n,t)});et.length&&(ut=function(n,t){return n.getAttribute("data-"+t)!==null?t:null},n(et[0]).children("th, td").each(function(n,t){var e=f.aoColumns[n],i,u;e.mData===n&&(i=ut(t,"sort")||ut(t,"order"),u=ut(t,"filter")||ut(t,"search"),(i!==null||u!==null)&&(e.mData={_:n+".display",sort:i!==null?n+".@data-"+i:r,type:i!==null?n+".@data-"+i:r,filter:u!==null?n+".@data-"+u:r},fi(f,n)))}));ot=f.oFeatures;c=function(){var i,t;if(e.aaSorting===r)for(i=f.aaSorting,l=0,d=i.length;l<d;l++)i[l][1]=f.aoColumns[l].asSorting[0];if(pi(f),ot.bSort&&a(f,"aoDrawCallback",function(){if(f.bSorted){var t=st(f),i={};n.each(t,function(n,t){i[t.src]=t.dir});o(f,null,"order",[f,t,i]);ne(f)}}),a(f,"aoDrawCallback",function(){(f.bSorted||v(f)==="ssp"||ot.bDeferRender)&&pi(f)},"sc"),i=p.children("caption").each(function(){this._captionSide=n(this).css("caption-side")}),t=p.children("thead"),t.length===0&&(t=n("<thead/>").appendTo(p)),f.nTHead=t[0],t=p.children("tbody"),t.length===0&&(t=n("<tbody/>").appendTo(p)),f.nTBody=t[0],t=p.children("tfoot"),t.length===0&&i.length>0&&(f.oScroll.sX!==""||f.oScroll.sY!=="")&&(t=n("<tfoot/>").appendTo(p)),t.length===0||t.children().length===0?p.addClass(g.sNoFooter):t.length>0&&(f.nTFoot=t[0],kt(f.aoFooter,f.nTFoot)),e.aaData)for(l=0;l<e.aaData.length;l++)rt(f,e.aaData[l]);else(f.bDeferLoading||v(f)=="dom")&&oi(f,n(f.nTBody).children("tr"));f.aiDisplay=f.aiDisplayMaster.slice();f.bInitialised=!0;ht===!1&&gt(f)};e.bStateSave?(ot.bStateSave=!0,a(f,"aoDrawCallback",wi,"state_save"),ie(f,e,c)):c()}}),i=null,this},c,e,f,s,dr={},ee=/[\r\n]/g,ki=/<.*?>/g,ye=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,pe=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),gr=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,it=function(n){return!n||!0===n||"-"===n?!0:!1},oe=function(n){var t=parseInt(n,10);return!isNaN(t)&&isFinite(n)?t:null},se=function(n,t){return dr[t]||(dr[t]=RegExp(tu(t),"g")),"string"==typeof n&&"."!==t?n.replace(/\./g,"").replace(dr[t],"."):n},nu=function(n,t,i){var r="string"==typeof n;return it(n)?!0:(t&&r&&(n=se(n,t)),i&&r&&(n=n.replace(gr,"")),!isNaN(parseFloat(n))&&isFinite(n))},he=function(n,t,i){return it(n)?!0:(it(n)||"string"==typeof n)?nu(n.replace(ki,""),t,i)?!0:null:null},b=function(n,t,i){var f=[],u=0,e=n.length;if(i!==r)for(;u<e;u++)n[u]&&n[u][t]&&f.push(n[u][t][i]);else for(;u<e;u++)n[u]&&f.push(n[u][t]);return f},ti=function(n,t,i,u){var e=[],f=0,o=t.length;if(u!==r)for(;f<o;f++)n[t[f]][i]&&e.push(n[t[f]][i][u]);else for(;f<o;f++)e.push(n[t[f]][i]);return e},ht=function(n,t){var f=[],u,i;for(t===r?(t=0,u=n):(u=t,t=n),i=t;i<u;i++)f.push(i);return f},ce=function(n){for(var i=[],t=0,r=n.length;t<r;t++)n[t]&&i.push(n[t]);return i},di=function(n){var t;n:{if(!(2>n.length)){t=n.slice().sort();for(var r=t[0],i=1,f=t.length;i<f;i++){if(t[i]===r){t=!1;break n}r=t[i]}}t=!0}if(t)return n.slice();t=[];var f=n.length,u,e=0,i=0;n:for(;i<f;i++){for(r=n[i],u=0;u<e;u++)if(t[u]===r)continue n;t.push(r);e++}return t},ru,tr,ou,ae,su,cu,ui,lu;u.util={throttle:function(n,t){var u=t!==r?t:200,i,f;return function(){var t=this,e=+new Date,o=arguments;i&&e<i+u?(clearTimeout(f),f=setTimeout(function(){i=r;n.apply(t,o)},u)):(i=e,n.apply(t,o))}},escapeRegex:function(n){return n.replace(pe,"\\$1")}};var p=function(n,t,i){n[t]!==r&&(n[i]=n[t])},ii=/\[.*?\]$/,ct=/\(\)$/,tu=u.util.escapeRegex,gi=n("<div>")[0],we=gi.textContent!==r,be=/<.*?>/g,iu=u.util.throttle,le=[],l=Array.prototype,ke=function(t){var i,r,f=u.settings,e=n.map(f,function(n){return n.nTable});if(t){if(t.nTable&&t.oApi)return[t];if(t.nodeName&&"table"===t.nodeName.toLowerCase())return i=n.inArray(t,e),-1!==i?[f[i]]:null;if(t&&"function"==typeof t.settings)return t.settings().toArray();"string"==typeof t?r=n(t):t instanceof n&&(r=t)}else return[];if(r)return r.map(function(){return i=n.inArray(this,e),-1!==i?f[i]:null}).toArray()};e=function(t,i){var r,f,u,o;if(!(this instanceof e))return new e(t,i);if(r=[],f=function(n){(n=ke(n))&&(r=r.concat(n))},n.isArray(t))for(u=0,o=t.length;u<o;u++)f(t[u]);else f(t);this.context=di(r);i&&n.merge(this,i);this.selector={rows:null,cols:null,opts:null};e.extend(this,this,le)};u.Api=e;n.extend(e.prototype,{any:function(){return 0!==this.count()},concat:l.concat,context:[],count:function(){return this.flatten().length},each:function(n){for(var t=0,i=this.length;t<i;t++)n.call(this,this[t],t,this);return this},eq:function(n){var t=this.context;return t.length>n?new e(t[n],this[n]):null},filter:function(n){var i=[],t,r;if(l.filter)i=l.filter.call(this,n,this);else for(t=0,r=this.length;t<r;t++)n.call(this,this[t],t,this)&&i.push(this[t]);return new e(this.context,i)},flatten:function(){var n=[];return new e(this.context,n.concat.apply(n,this.toArray()))},join:l.join,indexOf:l.indexOf||function(n,t){for(var i=t||0,r=this.length;i<r;i++)if(this[i]===n)return i;return-1},iterator:function(n,t,i,u){var h=[],o,f,y,c,p,s=this.context,w,v,a=this.selector,l;for("string"==typeof n&&(u=i,i=t,t=n,n=!1),f=0,y=s.length;f<y;f++)if(l=new e(s[f]),"table"===t)o=i.call(l,s[f],f),o!==r&&h.push(o);else if("columns"===t||"rows"===t)o=i.call(l,s[f],this[f],f),o!==r&&h.push(o);else if("column"===t||"column-rows"===t||"row"===t||"cell"===t)for(v=this[f],"column-rows"===t&&(w=nr(s[f],a.opts)),c=0,p=v.length;c<p;c++)o=v[c],o="cell"===t?i.call(l,s[f],o.row,o.column,f,c):i.call(l,s[f],o,f,c,w),o!==r&&h.push(o);return h.length||u?(n=new e(s,n?h.concat.apply([],h):h),t=n.selector,t.rows=a.rows,t.cols=a.cols,t.opts=a.opts,n):this},lastIndexOf:l.lastIndexOf||function(){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(n){var i=[],t,r;if(l.map)i=l.map.call(this,n,this);else for(t=0,r=this.length;t<r;t++)i.push(n.call(this,this[t],t));return new e(this.context,i)},pluck:function(n){return this.map(function(t){return t[n]})},pop:l.pop,push:l.push,reduce:l.reduce||function(n,t){return pu(this,n,t,0,this.length,1)},reduceRight:l.reduceRight||function(n,t){return pu(this,n,t,this.length-1,-1,-1)},reverse:l.reverse,selector:null,shift:l.shift,slice:function(){return new e(this.context,this)},sort:l.sort,splice:l.splice,toArray:function(){return l.slice.call(this)},to$:function(){return n(this)},toJQuery:function(){return n(this)},unique:function(){return new e(this.context,di(this))},unshift:l.unshift});e.extend=function(t,i,r){if(r.length&&i&&(i instanceof e||i.__dt_wrapper))for(var u,s=function(n,t,i){return function(){var r=t.apply(n,arguments);return e.extend(r,r,i.methodExt),r}},f=0,o=r.length;f<o;f++)u=r[f],i[u.name]="function"==typeof u.val?s(t,u.val,u):n.isPlainObject(u.val)?{}:u.val,i[u.name].__dt_wrapper=!0,e.extend(t,i[u.name],u.propExt)};e.register=f=function(t,i){var u,o,r,l;if(n.isArray(t))for(u=0,o=t.length;u<o;u++)e.register(t[u],i);else for(var s=t.split("."),f=le,h,c,u=0,o=s.length;u<o;u++){h=(c=-1!==s[u].indexOf("()"))?s[u].replace("()",""):s[u];n:{for(r=0,l=f.length;r<l;r++)if(f[r].name===h){r=f[r];break n}r=null}r||(r={name:h,val:{},methodExt:[],propExt:[]},f.push(r));u===o-1?r.val=i:f=c?r.methodExt:r.propExt}};e.registerPlural=s=function(t,i,u){e.register(t,u);e.register(i,function(){var t=u.apply(this,arguments);return t===this?this:t instanceof e?t.length?n.isArray(t[0])?new e(t.context,t[0]):t[0]:r:t})};f("tables()",function(t){var i,r,u,t;return t?(i=e,r=this.context,"number"==typeof t?t=[r[t]]:(u=n.map(r,function(n){return n.nTable}),t=n(u).filter(t).map(function(){var t=n.inArray(this,u);return r[t]}).toArray()),i=new i(t)):i=this,i});f("table()",function(n){var n=this.tables(n),t=n.context;return t.length?new e(t[0]):n});s("tables().nodes()","table().node()",function(){return this.iterator("table",function(n){return n.nTable},1)});s("tables().body()","table().body()",function(){return this.iterator("table",function(n){return n.nTBody},1)});s("tables().header()","table().header()",function(){return this.iterator("table",function(n){return n.nTHead},1)});s("tables().footer()","table().footer()",function(){return this.iterator("table",function(n){return n.nTFoot},1)});s("tables().containers()","table().container()",function(){return this.iterator("table",function(n){return n.nTableWrapper},1)});f("draw()",function(n){return this.iterator("table",function(t){"page"===n?ut(t):("string"==typeof n&&(n="full-hold"===n?!1:!0),ot(t,!1===n))})});f("page()",function(n){return n===r?this.page.info().page:this.iterator("table",function(t){ar(t,n)})});f("page.info()",function(){if(0===this.context.length)return r;var n=this.context[0],i=n._iDisplayStart,t=n.oFeatures.bPaginate?n._iDisplayLength:-1,u=n.fnRecordsDisplay(),f=-1===t;return{page:f?0:Math.floor(i/t),pages:f?1:Math.ceil(u/t),start:i,end:n.fnDisplayEnd(),length:t,recordsTotal:n.fnRecordsTotal(),recordsDisplay:u,serverSide:"ssp"===v(n)}});f("page.len()",function(n){return n===r?0!==this.context.length?this.context[0]._iDisplayLength:r:this.iterator("table",function(t){lr(t,n)})});ru=function(n,t,i){var u,r;if(i){u=new e(n);u.one("draw",function(){i(u.ajax.json())})}"ssp"==v(n)?ot(n,t):(w(n,!0),r=n.jqXHR,r&&4!==r.readyState&&r.abort(),li(n,[],function(i){si(n);for(var i=ai(n,i),r=0,u=i.length;r<u;r++)rt(n,i[r]);ot(n,t);w(n,!1)}))};f("ajax.json()",function(){var n=this.context;if(0<n.length)return n[0].json});f("ajax.params()",function(){var n=this.context;if(0<n.length)return n[0].oAjaxData});f("ajax.reload()",function(n,t){return this.iterator("table",function(i){ru(i,!1===t,n)})});f("ajax.url()",function(t){var i=this.context;return t===r?0===i.length?r:(i=i[0],i.ajax?n.isPlainObject(i.ajax)?i.ajax.url:i.ajax:i.sAjaxSource):this.iterator("table",function(i){n.isPlainObject(i.ajax)?i.ajax.url=t:i.ajax=t})});f("ajax.url().load()",function(n,t){return this.iterator("table",function(i){ru(i,!1===t,n)})});var uu=function(t,i,u,f,e){var h=[],v,l,o,a,s,y;for(o=typeof i,i&&"string"!==o&&"function"!==o&&i.length!==r||(i=[i]),o=0,a=i.length;o<a;o++)for(l=i[o]&&i[o].split&&!i[o].match(/[\[\(:]/)?i[o].split(","):[i[o]],s=0,y=l.length;s<y;s++)(v=u("string"==typeof l[s]?n.trim(l[s]):l[s]))&&v.length&&(h=h.concat(v));if(t=c.selector[t],t.length)for(o=0,a=t.length;o<a;o++)h=t[o](f,e,h);return di(h)},fu=function(t){return t||(t={}),t.filter&&t.search===r&&(t.search=t.filter),n.extend({search:"none",order:"current",page:"all"},t)},eu=function(n){for(var t=0,i=n.length;t<i;t++)if(0<n[t].length)return n[0]=n[t],n[0].length=1,n.length=1,n.context=[n.context[t]],n;return n.length=0,n},nr=function(t,i){var r,u,e,o=[],s=t.aiDisplay,f;if(r=t.aiDisplayMaster,f=i.search,u=i.order,e=i.page,"ssp"==v(t))return"removed"===f?[]:ht(0,r.length);if("current"==e)for(r=t._iDisplayStart,u=t.fnDisplayEnd();r<u;r++)o.push(s[r]);else if("current"==u||"applied"==u)o="none"==f?r.slice():"applied"==f?s.slice():n.map(r,function(t){return-1===n.inArray(t,s)?t:null});else if("index"==u||"original"==u)for(r=0,u=t.aoData.length;r<u;r++)"none"==f?o.push(r):(e=n.inArray(r,s),(-1===e&&"removed"==f||0<=e&&"applied"==f)&&o.push(r));return o};f("rows()",function(t,i){t===r?t="":n.isPlainObject(t)&&(i=t,t="");var i=fu(i),u=this.iterator("table",function(u){var e=i,f;return uu("row",t,function(t){var i=oe(t),o;return i!==null&&!e?[i]:(f||(f=nr(u,e)),i!==null&&n.inArray(i,f)!==-1)?[i]:t===null||t===r||t===""?f:typeof t=="function"?n.map(f,function(n){var i=u.aoData[n];return t(n,i._aData,i.nTr)?n:null}):(i=ce(ti(u.aoData,f,"nTr")),t.nodeName)?t._DT_RowIndex!==r?[t._DT_RowIndex]:t._DT_CellIndex?[t._DT_CellIndex.row]:(i=n(t).closest("*[data-dt-row]"),i.length?[i.data("dt-row")]:[]):typeof t=="string"&&t.charAt(0)==="#"&&(o=u.aIds[t.replace(/^#/,"")],o!==r)?[o.idx]:n(i).filter(t).map(function(){return this._DT_RowIndex}).toArray()},u,e)},1);return u.selector.rows=t,u.selector.opts=i,u});f("rows().nodes()",function(){return this.iterator("row",function(n,t){return n.aoData[t].nTr||r},1)});f("rows().data()",function(){return this.iterator(!0,"rows",function(n,t){return ti(n.aoData,t,"_aData")},1)});s("rows().cache()","row().cache()",function(n){return this.iterator("row",function(t,i){var r=t.aoData[i];return"search"===n?r._aFilterData:r._aSortData},1)});s("rows().invalidate()","row().invalidate()",function(n){return this.iterator("row",function(t,i){wt(t,i,n)})});s("rows().indexes()","row().index()",function(){return this.iterator("row",function(n,t){return t},1)});s("rows().ids()","row().id()",function(n){for(var r,f,o,u=[],i=this.context,t=0,s=i.length;t<s;t++)for(r=0,f=this[t].length;r<f;r++)o=i[t].rowIdFn(i[t].aoData[this[t][r]]._aData),u.push((!0===n?"#":"")+o);return new e(i,u)});s("rows().remove()","row().remove()",function(){var n=this;return this.iterator("row",function(t,i,u){var o=t.aoData,l=o[i],e,h,f,c,s;for(o.splice(i,1),e=0,h=o.length;e<h;e++)if(f=o[e],s=f.anCells,null!==f.nTr&&(f.nTr._DT_RowIndex=e),null!==s)for(f=0,c=s.length;f<c;f++)s[f]._DT_CellIndex.row=e;hi(t.aiDisplayMaster,i);hi(t.aiDisplay,i);hi(n[u],i,!1);br(t);i=t.rowIdFn(l._aData);i!==r&&delete t.aIds[i]}),this.iterator("table",function(n){for(var t=0,i=n.aoData.length;t<i;t++)n.aoData[t].idx=t}),this});f("rows.add()",function(t){var r=this.iterator("table",function(n){for(var i,u=[],r=0,f=t.length;r<f;r++)i=t[r],i.nodeName&&"TR"===i.nodeName.toUpperCase()?u.push(oi(n,i)[0]):u.push(rt(n,i));return u},1),i=this.rows(-1);return i.pop(),n.merge(i,r),i});f("row()",function(n,t){return eu(this.rows(n,t))});f("row().data()",function(n){var t=this.context;return n===r?t.length&&this.length?t[0].aoData[this[0]]._aData:r:(t[0].aoData[this[0]]._aData=n,wt(t[0],this[0],"data"),this)});f("row().node()",function(){var n=this.context;return n.length&&this.length?n[0].aoData[this[0]].nTr||null:null});f("row.add()",function(t){t instanceof n&&t.length&&(t=t[0]);var i=this.iterator("table",function(n){return t.nodeName&&"TR"===t.nodeName.toUpperCase()?oi(n,t)[0]:rt(n,t)});return this.row(i[0])});tr=function(n,t){var i=n.context;i.length&&(i=i[0].aoData[t!==r?t:n[0]])&&i._details&&(i._details.remove(),i._detailsShow=r,i._details=r)};ou=function(n,t){var o=n.context,i;if(o.length&&n.length&&(i=o[0].aoData[n[0]],i._details)){(i._detailsShow=t)?i._details.insertAfter(i.nTr):i._details.detach();var f=o[0],r=new e(f),u=f.aoData;r.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<b(u,"_details").length&&(r.on("draw.dt.DT_details",function(n,t){f===t&&r.rows({page:"current"}).eq(0).each(function(n){n=u[n];n._detailsShow&&n._details.insertAfter(n.nTr)})}),r.on("column-visibility.dt.DT_details",function(n,t){if(f===t)for(var i,e=pt(t),r=0,o=u.length;r<o;r++)i=u[r],i._details&&i._details.children("td[colspan]").attr("colspan",e)}),r.on("destroy.dt.DT_details",function(n,t){if(f===t)for(var i=0,e=u.length;i<e;i++)u[i]._details&&tr(r,i)}))}};f("row().child()",function(t,i){var u=this.context;if(t===r)return u.length&&this.length?u[0].aoData[this[0]]._details:r;if(!0===t)this.child.show();else if(!1===t)tr(this);else if(u.length&&this.length){var o=u[0],u=u[0].aoData[this[0]],f=[],e=function(t,i){if(n.isArray(t)||t instanceof n)for(var r=0,u=t.length;r<u;r++)e(t[r],i);else t.nodeName&&"tr"===t.nodeName.toLowerCase()?f.push(t):(r=n("<tr><td/><\/tr>").addClass(i),n("td",r).addClass(i).html(t)[0].colSpan=pt(o),f.push(r[0]))};e(t,i);u._details&&u._details.detach();u._details=n(f);u._detailsShow&&u._details.insertAfter(u.nTr)}return this});f(["row().child.show()","row().child().show()"],function(){return ou(this,!0),this});f(["row().child.hide()","row().child().hide()"],function(){return ou(this,!1),this});f(["row().child.remove()","row().child().remove()"],function(){return tr(this),this});f("row().child.isShown()",function(){var n=this.context;return n.length&&this.length?n[0].aoData[this[0]]._detailsShow||!1:!1});ae=/^([^:]+):(name|visIdx|visible)$/;su=function(n,t,i,r,u){for(var i=[],r=0,f=u.length;r<f;r++)i.push(y(n,u[r],t));return i};f("columns()",function(t,i){t===r?t="":n.isPlainObject(t)&&(i=t,t="");var i=fu(i),u=this.iterator("table",function(r){var o=t,e=i,u=r.aoColumns,s=b(u,"sName"),f=b(u,"nTh");return uu("column",o,function(t){var i=oe(t),c,o,h;if(t==="")return ht(u.length);if(i!==null)return[i>=0?i:u.length+i];if(typeof t=="function")return c=nr(r,e),n.map(u,function(n,i){return t(i,su(r,i,0,0,c),f[i])?i:null});if(o=typeof t=="string"?t.match(ae):"",o)switch(o[2]){case"visIdx":case"visible":return(i=parseInt(o[1],10),i<0)?(h=n.map(u,function(n,t){return n.bVisible?t:null}),[h[h.length+i]]):[vt(r,i)];case"name":return n.map(s,function(n,t){return n===o[1]?t:null});default:return[]}return t.nodeName&&t._DT_CellIndex?[t._DT_CellIndex.column]:(i=n(f).filter(t).map(function(){return n.inArray(this,f)}).toArray(),i.length||!t.nodeName)?i:(i=n(t).closest("*[data-dt-column]"),i.length?[i.data("dt-column")]:[])},r,e)},1);return u.selector.cols=t,u.selector.opts=i,u});s("columns().header()","column().header()",function(){return this.iterator("column",function(n,t){return n.aoColumns[t].nTh},1)});s("columns().footer()","column().footer()",function(){return this.iterator("column",function(n,t){return n.aoColumns[t].nTf},1)});s("columns().data()","column().data()",function(){return this.iterator("column-rows",su,1)});s("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(n,t){return n.aoColumns[t].mData},1)});s("columns().cache()","column().cache()",function(n){return this.iterator("column-rows",function(t,i,r,u,f){return ti(t.aoData,f,"search"===n?"_aFilterData":"_aSortData",i)},1)});s("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(n,t,i,r,u){return ti(n.aoData,u,"anCells",t)},1)});s("columns().visible()","column().visible()",function(t,i){var u=this.iterator("column",function(i,u){var l;if(t===r)return i.aoColumns[u].bVisible;var f=i.aoColumns,h=f[u],o=i.aoData,e,c,s;if(t!==r&&h.bVisible!==t){if(t)for(l=n.inArray(!0,b(f,"bVisible"),u+1),e=0,c=o.length;e<c;e++)s=o[e].nTr,f=o[e].anCells,s&&s.insertBefore(f[u],f[l]||null);else n(b(i.aoData,"anCells",u)).detach();h.bVisible=t;bt(i,i.aoHeader);bt(i,i.aoFooter);wi(i)}});return t!==r&&(this.iterator("column",function(n,r){o(n,null,"column-visibility",[n,r,t,i])}),(i===r||i)&&this.columns.adjust()),u});s("columns().indexes()","column().index()",function(n){return this.iterator("column",function(t,i){return"visible"===n?yt(t,i):i},1)});f("columns.adjust()",function(){return this.iterator("table",function(n){at(n)},1)});f("column.index()",function(n,t){if(0!==this.context.length){var i=this.context[0];if("fromVisible"===n||"toData"===n)return vt(i,t);if("fromData"===n||"toVisible"===n)return yt(i,t)}});f("column()",function(n,t){return eu(this.columns(n,t))});f("cells()",function(t,i,u){if(n.isPlainObject(t)&&(t.row===r?(u=t,t=null):(u=i,i=null)),n.isPlainObject(i)&&(u=i,i=null),null===i||i===r)return this.iterator("table",function(i){var w=t,a=fu(u),v=i.aoData,l=nr(i,a),b=ce(ti(v,l,"anCells")),k=n([].concat.apply([],b)),o,d=i.aoColumns.length,s,h,p,e,c,f;return uu("cell",w,function(t){var u=typeof t=="function";if(t===null||t===r||u){for(s=[],h=0,p=l.length;h<p;h++)for(o=l[h],e=0;e<d;e++)c={row:o,column:e},u?(f=v[o],t(c,y(i,o,e),f.anCells?f.anCells[e]:null)&&s.push(c)):s.push(c);return s}return n.isPlainObject(t)?[t]:(u=k.filter(t).map(function(n,t){return{row:t._DT_CellIndex.row,column:t._DT_CellIndex.column}}).toArray(),u.length||!t.nodeName)?u:(f=n(t).closest("*[data-dt-row]"),f.length?[{row:f.data("dt-row"),column:f.data("dt-column")}]:[])},i,a)});var s=this.columns(i,u),h=this.rows(t,u),o,f,c,e,l,a=this.iterator("table",function(n,t){for(o=[],f=0,c=h[t].length;f<c;f++)for(e=0,l=s[t].length;e<l;e++)o.push({row:h[t][f],column:s[t][e]});return o},1);return n.extend(a.selector,{cols:i,rows:t,opts:u}),a});s("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(n,t,i){return(n=n.aoData[t])&&n.anCells?n.anCells[i]:r},1)});f("cells().data()",function(){return this.iterator("cell",function(n,t,i){return y(n,t,i)},1)});s("cells().cache()","cell().cache()",function(n){return n="search"===n?"_aFilterData":"_aSortData",this.iterator("cell",function(t,i,r){return t.aoData[i][n][r]},1)});s("cells().render()","cell().render()",function(n){return this.iterator("cell",function(t,i,r){return y(t,i,r,n)},1)});s("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(n,t,i){return{row:t,column:i,columnVisible:yt(n,i)}},1)});s("cells().invalidate()","cell().invalidate()",function(n){return this.iterator("cell",function(t,i,r){wt(t,i,n,r)})});f("cell()",function(n,t,i){return eu(this.cells(n,t,i))});f("cell().data()",function(n){var i=this.context,t=this[0];return n===r?i.length&&t.length?y(i[0],t[0].row,t[0].column):r:(bu(i[0],t[0].row,t[0].column,n),wt(i[0],t[0].row,"data",t[0].column),this)});f("order()",function(t,i){var u=this.context;return t===r?0!==u.length?u[0].aaSorting:r:("number"==typeof t?t=[[t,i]]:t.length&&!n.isArray(t[0])&&(t=Array.prototype.slice.call(arguments)),this.iterator("table",function(n){n.aaSorting=t.slice()}))});f("order.listener()",function(n,t,i){return this.iterator("table",function(r){pr(r,n,t,i)})});f("order.fixed()",function(t){if(!t){var i=this.context,i=i.length?i[0].aaSortingFixed:r;return n.isArray(i)?{pre:i}:i}return this.iterator("table",function(i){i.aaSortingFixed=n.extend(!0,{},t)})});f(["columns().order()","column().order()"],function(t){var i=this;return this.iterator("table",function(r,u){var f=[];n.each(i[u],function(n,i){f.push([i,t])});r.aaSorting=f})});f("search()",function(t,i,u,f){var e=this.context;return t===r?0!==e.length?e[0].oPreviousSearch.sSearch:r:this.iterator("table",function(r){r.oFeatures.bFilter&&dt(r,n.extend({},r.oPreviousSearch,{sSearch:t+"",bRegex:null===i?!1:i,bSmart:null===u?!0:u,bCaseInsensitive:null===f?!0:f}),1)})});s("columns().search()","column().search()",function(t,i,u,f){return this.iterator("column",function(e,o){var s=e.aoPreSearchCols;if(t===r)return s[o].sSearch;e.oFeatures.bFilter&&(n.extend(s[o],{sSearch:t+"",bRegex:null===i?!1:i,bSmart:null===u?!0:u,bCaseInsensitive:null===f?!0:f}),dt(e,e.oPreviousSearch,1))})});f("state()",function(){return this.context.length?this.context[0].oSavedState:null});f("state.clear()",function(){return this.iterator("table",function(n){n.fnStateSaveCallback.call(n.oInstance,n,{})})});f("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});f("state.save()",function(){return this.iterator("table",function(n){wi(n)})});u.versionCheck=u.fnVersionCheck=function(n){for(var f=u.version.split("."),n=n.split("."),i,r,t=0,e=n.length;t<e;t++)if(i=parseInt(f[t],10)||0,r=parseInt(n[t],10)||0,i!==r)return i>r;return!0};u.isDataTable=u.fnIsDataTable=function(t){var i=n(t).get(0),r=!1;return t instanceof u.Api?!0:(n.each(u.settings,function(t,u){var f=u.nScrollHead?n("table",u.nScrollHead)[0]:null,e=u.nScrollFoot?n("table",u.nScrollFoot)[0]:null;(u.nTable===i||f===i||e===i)&&(r=!0)}),r)};u.tables=u.fnTables=function(t){var r=!1,i;return n.isPlainObject(t)&&(r=t.api,t=t.visible),i=n.map(u.settings,function(i){if(!t||t&&n(i.nTable).is(":visible"))return i.nTable}),r?new e(i):i};u.camelToHungarian=nt;f("$()",function(t,i){var r=this.rows(i).nodes(),r=n(r);return n([].concat(r.filter(t).toArray(),r.find(t).toArray()))});n.each(["on","one","off"],function(t,i){f(i+"()",function(){var t=Array.prototype.slice.call(arguments),r;return t[0]=n.map(t[0].split(/\s/),function(n){return n.match(/\.dt\b/)?n:n+".dt"}).join(" "),r=n(this.tables().nodes()),r[i].apply(r,t),this})});f("clear()",function(){return this.iterator("table",function(n){si(n)})});f("settings()",function(){return new e(this.context,this.context)});f("init()",function(){var n=this.context;return n.length?n[0].oInit:null});f("data()",function(){return this.iterator("table",function(n){return b(n.aoData,"_aData")}).flatten()});f("destroy()",function(i){return i=i||!1,this.iterator("table",function(r){var c=r.nTableWrapper.parentNode,f=r.oClasses,l=r.nTable,a=r.nTBody,s=r.nTHead,v=r.nTFoot,h=n(l),a=n(a),y=n(r.nTableWrapper),p=n.map(r.aoData,function(n){return n.nTr}),w;r.bDestroying=!0;o(r,"aoDestroyCallback","destroy",[r]);i||new e(r).columns().visible(!0);y.off(".DT").find(":not(tbody *)").off(".DT");n(t).off(".DT-"+r.sInstance);l!=s.parentNode&&(h.children("thead").detach(),h.append(s));v&&l!=v.parentNode&&(h.children("tfoot").detach(),h.append(v));r.aaSorting=[];r.aaSortingFixed=[];pi(r);n(p).removeClass(r.asStripeClasses.join(" "));n("th, td",s).removeClass(f.sSortable+" "+f.sSortableAsc+" "+f.sSortableDesc+" "+f.sSortableNone);r.bJUI&&(n("th span."+f.sSortIcon+", td span."+f.sSortIcon,s).detach(),n("th, td",s).each(function(){var t=n("div."+f.sSortJUIWrapper,this);n(this).append(t.contents());t.detach()}));a.children().detach();a.append(p);s=i?"remove":"detach";h[s]();y[s]();!i&&c&&(c.insertBefore(l,r.nTableReinsertBefore),h.css("width",r.sDestroyWidth).removeClass(f.sTable),(w=r.asDestroyStripes.length)&&a.children().each(function(t){n(this).addClass(r.asDestroyStripes[t%w])}));c=n.inArray(r,u.settings);-1!==c&&u.settings.splice(c,1)})});n.each(["column","row","cell"],function(n,t){f(t+"s().every()",function(n){var i=this.selector.opts,u=this;return this.iterator(t,function(f,e,o,s,h){n.call(u[t](e,"cell"===t?o:i,"cell"===t?i:r),e,o,s,h)})})});f("i18n()",function(t,i,u){var f=this.context[0],t=ft(t)(f.oLanguage);return t===r&&(t=i),u!==r&&n.isPlainObject(t)&&(t=t[u]!==r?t[u]:t._),t.replace("%d",u)});u.version="1.10.15";u.settings=[];u.models={};u.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};u.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};u.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};u.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(n){return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(n){try{return JSON.parse((-1===n.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+n.sInstance+"_"+location.pathname))}catch(t){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(n,t){try{(-1===n.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+n.sInstance+"_"+location.pathname,JSON.stringify(t))}catch(i){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:n.extend({},u.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};lt(u.defaults);u.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};lt(u.defaults.column);u.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:r,oAjaxData:r,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==v(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==v(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var n=this._iDisplayLength,t=this._iDisplayStart,r=t+n,i=this.aiDisplay.length,u=this.oFeatures,f=u.bPaginate;return u.bServerSide?!1===f||-1===n?t+i:Math.min(t+n,this._iRecordsDisplay):!f||r>i||-1===n?i:r},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};u.ext=c={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:u.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:u.version};n.extend(c,{afnFiltering:c.search,aTypes:c.type.detect,ofnSearch:c.type.search,oSort:c.type.order,afnSortData:c.order,aoFeatures:c.feature,oApi:c.internal,oStdClasses:c.classes,oPagination:c.pager});n.extend(u.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var hu="",hu="",d=hu+"ui-state-default",ri=hu+"css_right ui-icon ui-icon-",ve=hu+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";return n.extend(u.ext.oJUIClasses,u.ext.classes,{sPageButton:"fg-button ui-button "+d,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:d+" sorting_asc",sSortDesc:d+" sorting_desc",sSortable:d+" sorting",sSortableAsc:d+" sorting_asc_disabled",sSortableDesc:d+" sorting_desc_disabled",sSortableNone:d+" sorting_disabled",sSortJUIAsc:ri+"triangle-1-n",sSortJUIDesc:ri+"triangle-1-s",sSortJUI:ri+"carat-2-n-s",sSortJUIAscAllowed:ri+"carat-1-n",sSortJUIDescAllowed:ri+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+d,sScrollFoot:"dataTables_scrollFoot "+d,sHeaderTH:d,sFooterTH:d,sJUIHeader:ve+" ui-corner-tl ui-corner-tr",sJUIFooter:ve+" ui-corner-bl ui-corner-br"}),cu=u.ext.pager,n.extend(cu,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(n,t){return[ni(n,t)]},simple_numbers:function(n,t){return["previous",ni(n,t),"next"]},full_numbers:function(n,t){return["first","previous",ni(n,t),"next","last"]},first_last_numbers:function(n,t){return["first",ni(n,t),"last"]},_numbers:ni,numbers_length:7}),n.extend(!0,u.ext.renderer,{pageButton:{_:function(t,u,f,e,o,s){var l=t.oClasses,a=t.oLanguage.oPaginate,w=t.oLanguage.oAria.paginate||{},h,c,y=0,p=function(i,r){for(var v,u,k=function(n){ar(t,n.data.action,!0)},e=0,b=r.length;e<b;e++)if(u=r[e],n.isArray(u))v=n("<"+(u.DT_el||"div")+"/>").appendTo(i),p(v,u);else{h=null;c="";switch(u){case"ellipsis":i.append('<span class="ellipsis">&#x2026;<\/span>');break;case"first":h=a.sFirst;c=u+(o>0?"":" "+l.sPageButtonDisabled);break;case"previous":h=a.sPrevious;c=u+(o>0?"":" "+l.sPageButtonDisabled);break;case"next":h=a.sNext;c=u+(o<s-1?"":" "+l.sPageButtonDisabled);break;case"last":h=a.sLast;c=u+(o<s-1?"":" "+l.sPageButtonDisabled);break;default:h=u+1;c=o===u?l.sPageButtonActive:""}h!==null&&(v=n("<a>",{"class":l.sPageButton+" "+c,"aria-controls":t.sTableId,"aria-label":w[u],"data-dt-idx":y,tabindex:t.iTabIndex,id:f===0&&typeof u=="string"?t.sTableId+"_"+u:null}).html(h).appendTo(i),wr(v,{action:u},k),y++)}},v;try{v=n(u).find(i.activeElement).data("dt-idx")}catch(b){}p(n(u).empty(),e);v!==r&&n(u).find("[data-dt-idx="+v+"]").focus()}}}),n.extend(u.ext.type.detect,[function(n,t){var i=t.oLanguage.sDecimal;return nu(n,i)?"num"+i:null},function(n){if(n&&!(n instanceof Date)&&!ye.test(n))return null;var t=Date.parse(n);return null!==t&&!isNaN(t)||it(n)?"date":null},function(n,t){var i=t.oLanguage.sDecimal;return nu(n,i,!0)?"num-fmt"+i:null},function(n,t){var i=t.oLanguage.sDecimal;return he(n,i)?"html-num"+i:null},function(n,t){var i=t.oLanguage.sDecimal;return he(n,i,!0)?"html-num-fmt"+i:null},function(n){return it(n)||"string"==typeof n&&-1!==n.indexOf("<")?"html":null}]),n.extend(u.ext.type.search,{html:function(n){return it(n)?n:"string"==typeof n?n.replace(ee," ").replace(ki,""):""},string:function(n){return it(n)?n:"string"==typeof n?n.replace(ee," "):n}}),ui=function(n,t,i,r){return 0!==n&&(!n||"-"===n)?-Infinity:(t&&(n=se(n,t)),n.replace&&(i&&(n=n.replace(i,"")),r&&(n=n.replace(r,""))),1*n)},n.extend(c.type.order,{"date-pre":function(n){return Date.parse(n)||-Infinity},"html-pre":function(n){return it(n)?"":n.replace?n.replace(/<.*?>/g,"").toLowerCase():n+""},"string-pre":function(n){return it(n)?"":"string"==typeof n?n.toLowerCase():n.toString?n.toString():""},"string-asc":function(n,t){return n<t?-1:n>t?1:0},"string-desc":function(n,t){return n<t?1:n>t?-1:0}}),ue(""),n.extend(!0,u.ext.renderer,{header:{_:function(t,i,r,u){n(t.nTable).on("order.dt.DT",function(n,f,e,o){t===f&&(n=r.idx,i.removeClass(r.sSortingClass+" "+u.sSortAsc+" "+u.sSortDesc).addClass(o[n]=="asc"?u.sSortAsc:o[n]=="desc"?u.sSortDesc:r.sSortingClass))})},jqueryui:function(t,i,r,u){n("<div/>").addClass(u.sSortJUIWrapper).append(i.contents()).append(n("<span/>").addClass(u.sSortIcon+" "+r.sSortingClassJUI)).appendTo(i);n(t.nTable).on("order.dt.DT",function(n,f,e,o){t===f&&(n=r.idx,i.removeClass(u.sSortAsc+" "+u.sSortDesc).addClass(o[n]=="asc"?u.sSortAsc:o[n]=="desc"?u.sSortDesc:r.sSortingClass),i.find("span."+u.sSortIcon).removeClass(u.sSortJUIAsc+" "+u.sSortJUIDesc+" "+u.sSortJUI+" "+u.sSortJUIAscAllowed+" "+u.sSortJUIDescAllowed).addClass(o[n]=="asc"?u.sSortJUIAsc:o[n]=="desc"?u.sSortJUIDesc:r.sSortingClassJUI))})}}}),lu=function(n){return"string"==typeof n?n.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):n},u.render={number:function(n,t,i,r,u){return{display:function(f){if("number"!=typeof f&&"string"!=typeof f)return f;var o=0>f?"-":"",e=parseFloat(f);return isNaN(e)?lu(f):(e=e.toFixed(i),f=Math.abs(e),e=parseInt(f,10),f=i?t+(f-e).toFixed(i).substring(2):"",o+(r||"")+e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,n)+f+(u||""))}}},text:function(){return{display:lu}}},n.extend(u.ext.internal,{_fnExternApiFunc:fe,_fnBuildAjax:li,_fnAjaxUpdate:gu,_fnAjaxParameters:nf,_fnAjaxUpdateDraw:tf,_fnAjaxDataSrc:ai,_fnAddColumn:rr,_fnColumnOptions:fi,_fnAdjustColumnSizing:at,_fnVisibleToColumnIndex:vt,_fnColumnIndexToVisible:yt,_fnVisbleColumns:pt,_fnGetColumns:ei,_fnColumnTypes:ur,_fnApplyColumnDefs:wu,_fnHungarianMap:lt,_fnCamelToHungarian:nt,_fnLanguageCompat:ir,_fnBrowserDetect:yu,_fnAddData:rt,_fnAddTr:oi,_fnNodeToDataIndex:function(n,t){return t._DT_RowIndex!==r?t._DT_RowIndex:null},_fnNodeToColumnIndex:function(t,i,r){return n.inArray(r,t.aoData[i].anCells)},_fnGetCellData:y,_fnSetCellData:bu,_fnSplitObjNotation:fr,_fnGetObjectDataFn:ft,_fnSetObjectDataFn:et,_fnGetDataMaster:er,_fnClearTable:si,_fnDeleteIndex:hi,_fnInvalidate:wt,_fnGetRowElements:or,_fnCreateTr:sr,_fnBuildHead:ku,_fnDrawHead:bt,_fnDraw:ut,_fnReDraw:ot,_fnAddOptionsHtml:du,_fnDetectHeader:kt,_fnGetUniqueThs:ci,_fnFeatureHtmlFilter:rf,_fnFilterComplete:dt,_fnFilterCustom:uf,_fnFilterColumn:ff,_fnFilter:ef,_fnFilterCreateSearch:cr,_fnEscapeRegex:tu,_fnFilterData:of,_fnFeatureHtmlInfo:cf,_fnUpdateInfo:lf,_fnInfoMacros:af,_fnInitialise:gt,_fnInitComplete:vi,_fnLengthChange:lr,_fnFeatureHtmlLength:vf,_fnFeatureHtmlPaginate:yf,_fnPageChange:ar,_fnFeatureHtmlProcessing:pf,_fnProcessingDisplay:w,_fnFeatureHtmlTable:wf,_fnScrollDraw:yi,_fnApplyToChildren:g,_fnCalculateColumnWidths:vr,_fnThrottle:iu,_fnConvertToWidth:bf,_fnGetWidestNode:kf,_fnGetMaxLenString:df,_fnStringToCss:h,_fnSortFlatten:st,_fnSort:gf,_fnSortAria:ne,_fnSortListener:yr,_fnSortAttachListener:pr,_fnSortingClasses:pi,_fnSortData:te,_fnSaveState:wi,_fnLoadState:ie,_fnSettingsFromNode:bi,_fnLog:tt,_fnMap:k,_fnBindAction:wr,_fnCallbackReg:a,_fnCallbackFire:o,_fnLengthOverflow:br,_fnRenderer:kr,_fnDataSource:v,_fnRowAttributes:hr,_fnCalculateEnd:function(){}}),n.fn.dataTable=u,u.$=n,n.fn.dataTableSettings=u.settings,n.fn.dataTableExt=u.ext,n.fn.DataTable=function(t){return n(this).dataTable(t).api()},n.each(u,function(t,i){n.fn.DataTable[t]=i}),n.fn.dataTable});!function(n){"use strict";"function"==typeof define&&define.amd?define(["jquery"],n):n("object"==typeof exports?require("jquery"):jQuery)}(function(n,t){"use strict";var c,l,o,v;if(!n.jstree){var p=0,f=!1,u=!1,e=!1,y=[],a=n("script:last").attr("src"),i=window.document,h=i.createElement("LI"),r,s;if(h.setAttribute("role","treeitem"),r=i.createElement("I"),r.className="jstree-icon jstree-ocl",r.setAttribute("role","presentation"),h.appendChild(r),r=i.createElement("A"),r.className="jstree-anchor",r.setAttribute("href","#"),r.setAttribute("tabindex","-1"),s=i.createElement("I"),s.className="jstree-icon jstree-themeicon",s.setAttribute("role","presentation"),r.appendChild(s),h.appendChild(r),r=s=null,n.jstree={version:"3.1.1",defaults:{plugins:[]},plugins:{},path:a&&-1!==a.indexOf("/")?a.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g},n.jstree.create=function(t,i){var r=new n.jstree.core(++p),u=i;return i=n.extend(!0,{},n.jstree.defaults,i),u&&u.plugins&&(i.plugins=u.plugins),n.each(i.plugins,function(n,t){"core"!==n&&(r=r.plugin(t,i[t]))}),n(t).data("jstree",r),r.init(t,i),r},n.jstree.destroy=function(){n(".jstree:jstree").jstree("destroy");n(i).off(".jstree")},n.jstree.core=function(n){this._id=n;this._cnt=0;this._wrk=null;this._data={core:{themes:{name:!1,dots:!1,icons:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},n.jstree.reference=function(t){var r=null,i=null;if(!t||!t.id||t.tagName&&t.nodeType||(t=t.id),!i||!i.length)try{i=n(t)}catch(u){}if(!i||!i.length)try{i=n("#"+t.replace(n.jstree.idregex,"\\$&"))}catch(u){}return i&&i.length&&(i=i.closest(".jstree")).length&&(i=i.data("jstree"))?r=i:n(".jstree").each(function(){var i=n(this).data("jstree");if(i&&i._model.data[t])return(r=i,!1)}),r},n.fn.jstree=function(i){var u="string"==typeof i,f=Array.prototype.slice.call(arguments,1),r=null;return i!==!0||this.length?(this.each(function(){var e=n.jstree.reference(this),o=u&&e?e[i]:null;return r=u&&o?o.apply(e,f):null,e||u||i!==t&&!n.isPlainObject(i)||n.jstree.create(this,i),(e&&!u||i===!0)&&(r=e||!1),null!==r&&r!==t?!1:void 0}),null!==r&&r!==t?r:this):!1},n.expr[":"].jstree=n.expr.createPseudo(function(){return function(i){return n(i).hasClass("jstree")&&n(i).data("jstree")!==t}}),n.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:n.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0},n.jstree.core.prototype={plugin:function(t,i){var r=n.jstree.plugins[t];return r?(this._data[t]={},r.prototype=this,new r(i,this)):this},init:function(t,i){this._model={data:{"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}};this.element=n(t).addClass("jstree jstree-"+this._id);this.settings=i;this._data.core.ready=!1;this._data.core.loaded=!1;this._data.core.rtl="rtl"===this.element.css("direction");this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl");this.element.attr("role","tree");this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0);this.element.attr("tabindex")||this.element.attr("tabindex","0");this.bind();this.trigger("init");this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0);this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove();this.element.html("<ul class='jstree-container-ul jstree-children' role='group'><li id='j"+this._id+"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='tree-item'><i class='jstree-icon jstree-ocl'><\/i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'><\/i>"+this.get_string("Loading ...")+"<\/a><\/li><\/ul>");this.element.attr("aria-activedescendant","j"+this._id+"_loading");this._data.core.li_height=this.get_container_ul().children("li").first().height()||24;this.trigger("loading");this.load_node("#")},destroy:function(n){if(this._wrk)try{window.URL.revokeObjectURL(this._wrk);this._wrk=null}catch(t){}n||this.element.empty();this.teardown()},teardown:function(){this.unbind();this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")});this.element=null},bind:function(){var t="",r=null,u=0;this.element.on("dblclick.jstree",function(){if(i.selection&&i.selection.empty)i.selection.empty();else if(window.getSelection){var n=window.getSelection();try{n.removeAllRanges();n.collapse()}catch(t){}}}).on("mousedown.jstree",n.proxy(function(n){n.target===this.element[0]&&(n.preventDefault(),u=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(n){n.preventDefault()}).on("click.jstree",".jstree-ocl",n.proxy(function(n){this.toggle_node(n.target)},this)).on("dblclick.jstree",".jstree-anchor",n.proxy(function(n){this.settings.core.dblclick_toggle&&this.toggle_node(n.target)},this)).on("click.jstree",".jstree-anchor",n.proxy(function(t){t.preventDefault();t.currentTarget!==i.activeElement&&n(t.currentTarget).focus();this.activate_node(t.currentTarget,t)},this)).on("keydown.jstree",".jstree-anchor",n.proxy(function(t){if("INPUT"===t.target.tagName||32!==t.which&&13!==t.which&&(t.shiftKey||t.ctrlKey||t.altKey||t.metaKey))return!0;var i=null;switch(this._data.core.rtl&&(37===t.which?t.which=39:39===t.which&&(t.which=37)),t.which){case 32:t.ctrlKey&&(t.type="click",n(t.currentTarget).trigger(t));break;case 13:t.type="click";n(t.currentTarget).trigger(t);break;case 37:t.preventDefault();this.is_open(t.currentTarget)?this.close_node(t.currentTarget):(i=this.get_parent(t.currentTarget),i&&"#"!==i.id&&this.get_node(i,!0).children(".jstree-anchor").focus());break;case 38:t.preventDefault();i=this.get_prev_dom(t.currentTarget);i&&i.length&&i.children(".jstree-anchor").focus();break;case 39:t.preventDefault();this.is_closed(t.currentTarget)?this.open_node(t.currentTarget,function(n){this.get_node(n,!0).children(".jstree-anchor").focus()}):this.is_open(t.currentTarget)&&(i=this.get_node(t.currentTarget,!0).children(".jstree-children")[0],i&&n(this._firstChild(i)).children(".jstree-anchor").focus());break;case 40:t.preventDefault();i=this.get_next_dom(t.currentTarget);i&&i.length&&i.children(".jstree-anchor").focus();break;case 106:this.open_all();break;case 36:t.preventDefault();i=this._firstChild(this.get_container_ul()[0]);i&&n(i).children(".jstree-anchor").filter(":visible").focus();break;case 35:t.preventDefault();this.element.find(".jstree-anchor").filter(":visible").last().focus()}},this)).on("load_node.jstree",n.proxy(function(t,i){i.status&&("#"!==i.node.id||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(n.proxy(function(){if(this.element&&!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){for(var i=[],t=0,r=this._data.core.selected.length;r>t;t++)i=i.concat(this._model.data[this._data.core.selected[t]].parents);for(i=n.vakata.array_unique(i),t=0,r=i.length;r>t;t++)this.open_node(i[t],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this),0))},this)).on("keypress.jstree",n.proxy(function(u){if("INPUT"===u.target.tagName)return!0;r&&clearTimeout(r);r=setTimeout(function(){t=""},500);var o=String.fromCharCode(u.which).toLowerCase(),e=this.element.find(".jstree-anchor").filter(":visible"),s=e.index(i.activeElement)||0,f=!1;if(t+=o,t.length>1){if(e.slice(s).each(n.proxy(function(i,r){if(0===n(r).text().toLowerCase().indexOf(t))return(n(r).focus(),f=!0,!1)},this)),f)return;if(e.slice(0,s).each(n.proxy(function(i,r){if(0===n(r).text().toLowerCase().indexOf(t))return(n(r).focus(),f=!0,!1)},this)),f)return}if(new RegExp("^"+o+"+$").test(t)){if(e.slice(s+1).each(n.proxy(function(t,i){if(n(i).text().toLowerCase().charAt(0)===o)return(n(i).focus(),f=!0,!1)},this)),f)return;if(e.slice(0,s+1).each(n.proxy(function(t,i){if(n(i).text().toLowerCase().charAt(0)===o)return(n(i).focus(),f=!0,!1)},this)),f)return}},this)).on("init.jstree",n.proxy(function(){var n=this.settings.core.themes;this._data.core.themes.dots=n.dots;this._data.core.themes.stripes=n.stripes;this._data.core.themes.icons=n.icons;this.set_theme(n.name||"default",n.url);this.set_theme_variant(n.variant)},this)).on("loading.jstree",n.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"]();this[this._data.core.themes.icons?"show_icons":"hide_icons"]();this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]()},this)).on("blur.jstree",".jstree-anchor",n.proxy(function(t){this._data.core.focused=null;n(t.currentTarget).filter(".jstree-hovered").mouseleave();this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",n.proxy(function(t){var i=this.get_node(t.currentTarget);i&&i.id&&(this._data.core.focused=i.id);this.element.find(".jstree-hovered").not(t.currentTarget).mouseleave();n(t.currentTarget).mouseenter();this.element.attr("tabindex","-1")},this)).on("focus.jstree",n.proxy(function(){if(+new Date-u>500&&!this._data.core.focused){u=0;var n=this.get_node(this.element.attr("aria-activedescendant"),!0);n&&n.find("> .jstree-anchor").focus()}},this)).on("mouseenter.jstree",".jstree-anchor",n.proxy(function(n){this.hover_node(n.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",n.proxy(function(n){this.dehover_node(n.currentTarget)},this))},unbind:function(){this.element.off(".jstree");n(i).off(".jstree-"+this._id)},trigger:function(n,t){t||(t={});t.instance=this;this.element.triggerHandler(n.replace(".jstree","")+".jstree",t)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(t){var i=this.settings.core.strings;return n.isFunction(i)?i.call(this,t):i&&i[t]?i[t]:t},_firstChild:function(n){for(n=n?n.firstChild:null;null!==n&&1!==n.nodeType;)n=n.nextSibling;return n},_nextSibling:function(n){for(n=n?n.nextSibling:null;null!==n&&1!==n.nodeType;)n=n.nextSibling;return n},_previousSibling:function(n){for(n=n?n.previousSibling:null;null!==n&&1!==n.nodeType;)n=n.previousSibling;return n},get_node:function(t,i){t&&t.id&&(t=t.id);var r;try{if(this._model.data[t])t=this._model.data[t];else if("string"==typeof t&&this._model.data[t.replace(/^#/,"")])t=this._model.data[t.replace(/^#/,"")];else if("string"==typeof t&&(r=n("#"+t.replace(n.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[r.closest(".jstree-node").attr("id")])t=this._model.data[r.closest(".jstree-node").attr("id")];else if((r=n(t,this.element)).length&&this._model.data[r.closest(".jstree-node").attr("id")])t=this._model.data[r.closest(".jstree-node").attr("id")];else{if(!(r=n(t,this.element)).length||!r.hasClass("jstree"))return!1;t=this._model.data["#"]}return i&&(t="#"===t.id?this.element:n("#"+t.id.replace(n.jstree.idregex,"\\$&"),this.element)),t}catch(u){return!1}},get_path:function(n,t,i){if(n=n.parents?n:this.get_node(n),!n||"#"===n.id||!n.parents)return!1;var u,f,r=[];for(r.push(i?n.id:n.text),u=0,f=n.parents.length;f>u;u++)r.push(i?n.parents[u]:this.get_text(n.parents[u]));return r=r.reverse().slice(1),t?r.join(t):r},get_next_dom:function(t,i){var r;if(t=this.get_node(t,!0),t[0]===this.element[0]){for(r=this._firstChild(this.get_container_ul()[0]);r&&0===r.offsetHeight;)r=this._nextSibling(r);return r?n(r):!1}if(!t||!t.length)return!1;if(i){r=t[0];do r=this._nextSibling(r);while(r&&0===r.offsetHeight);return r?n(r):!1}if(t.hasClass("jstree-open")){for(r=this._firstChild(t.children(".jstree-children")[0]);r&&0===r.offsetHeight;)r=this._nextSibling(r);if(null!==r)return n(r)}r=t[0];do r=this._nextSibling(r);while(r&&0===r.offsetHeight);return null!==r?n(r):t.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first()},get_prev_dom:function(t,i){var r;if(t=this.get_node(t,!0),t[0]===this.element[0]){for(r=this.get_container_ul()[0].lastChild;r&&0===r.offsetHeight;)r=this._previousSibling(r);return r?n(r):!1}if(!t||!t.length)return!1;if(i){r=t[0];do r=this._previousSibling(r);while(r&&0===r.offsetHeight);return r?n(r):!1}r=t[0];do r=this._previousSibling(r);while(r&&0===r.offsetHeight);if(null!==r){for(t=n(r);t.hasClass("jstree-open");)t=t.children(".jstree-children").first().children(".jstree-node:visible:last");return t}return r=t[0].parentNode.parentNode,r&&r.className&&-1!==r.className.indexOf("jstree-node")?n(r):!1},get_parent:function(n){return n=this.get_node(n),n&&"#"!==n.id?n.parent:!1},get_children_dom:function(n){return n=this.get_node(n,!0),n[0]===this.element[0]?this.get_container_ul().children(".jstree-node"):n&&n.length?n.children(".jstree-children").children(".jstree-node"):!1},is_parent:function(n){return n=this.get_node(n),n&&(n.state.loaded===!1||n.children.length>0)},is_loaded:function(n){return n=this.get_node(n),n&&n.state.loaded},is_loading:function(n){return n=this.get_node(n),n&&n.state&&n.state.loading},is_open:function(n){return n=this.get_node(n),n&&n.state.opened},is_closed:function(n){return n=this.get_node(n),n&&this.is_parent(n)&&!n.state.opened},is_leaf:function(n){return!this.is_parent(n)},load_node:function(t,i){var r,f,u,e,o;if(n.isArray(t))return this._load_nodes(t.slice(),i),!0;if(t=this.get_node(t),!t)return i&&i.call(this,t,!1),!1;if(t.state.loaded){for(t.state.loaded=!1,r=0,f=t.children_d.length;f>r;r++){for(u=0,e=t.parents.length;e>u;u++)this._model.data[t.parents[u]].children_d=n.vakata.array_remove_item(this._model.data[t.parents[u]].children_d,t.children_d[r]);this._model.data[t.children_d[r]].state.selected&&(o=!0,this._data.core.selected=n.vakata.array_remove_item(this._data.core.selected,t.children_d[r]));delete this._model.data[t.children_d[r]]}t.children=[];t.children_d=[];o&&this.trigger("changed",{action:"load_node",node:t,selected:this._data.core.selected})}return t.state.failed=!1,t.state.loading=!0,this.get_node(t,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(t,n.proxy(function(n){t=this._model.data[t.id];t.state.loading=!1;t.state.loaded=n;t.state.failed=!t.state.loaded;var r=this.get_node(t,!0);t.state.loaded&&!t.children.length&&r&&r.length&&!r.hasClass("jstree-leaf")&&r.removeClass("jstree-closed jstree-open").addClass("jstree-leaf");r.removeClass("jstree-loading").attr("aria-busy",!1);this.trigger("load_node",{node:t,status:n});i&&i.call(this,t,n)},this)),!0},_load_nodes:function(n,t,i){for(var e=!0,s=function(){this._load_nodes(n,t,!0)},u=this._model.data,o=[],r=0,f=n.length;f>r;r++)!u[n[r]]||(u[n[r]].state.loaded||u[n[r]].state.failed)&&i||(this.is_loading(n[r])||this.load_node(n[r],s),e=!1);if(e){for(r=0,f=n.length;f>r;r++)u[n[r]]&&u[n[r]].state.loaded&&o.push(n[r]);t&&!t.done&&(t.call(this,o),t.done=!0)}},load_all:function(n,t){if(n||(n="#"),n=this.get_node(n),!n)return!1;var u=[],f=this._model.data,r=f[n.id].children_d,i,e;for(n.state&&!n.state.loaded&&u.push(n.id),i=0,e=r.length;e>i;i++)f[r[i]]&&f[r[i]].state&&!f[r[i]].state.loaded&&u.push(r[i]);u.length?this._load_nodes(u,function(){this.load_all(n,t)}):(t&&t.call(this,n),this.trigger("load_all",{node:n}))},_load_node:function(t,i){var r=this.settings.core.data,u;return r?n.isFunction(r)?r.call(this,t,n.proxy(function(r){r===!1&&i.call(this,!1);this["string"==typeof r?"_append_html_data":"_append_json_data"](t,"string"==typeof r?n(n.parseHTML(r)).filter(function(){return 3!==this.nodeType}):r,function(n){i.call(this,n)})},this)):"object"==typeof r?r.url?(r=n.extend(!0,{},r),n.isFunction(r.url)&&(r.url=r.url.call(this,t)),n.isFunction(r.data)&&(r.data=r.data.call(this,t)),n.ajax(r).done(n.proxy(function(r,u,f){var e=f.getResponseHeader("Content-Type");return e&&-1!==e.indexOf("json")||"object"==typeof r?this._append_json_data(t,r,function(n){i.call(this,n)}):e&&-1!==e.indexOf("html")||"string"==typeof r?this._append_html_data(t,n(n.parseHTML(r)).filter(function(){return 3!==this.nodeType}),function(n){i.call(this,n)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:f})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1))},this)).fail(n.proxy(function(n){i.call(this,!1);this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:n})};this.settings.core.error.call(this,this._data.core.last_error)},this))):(u=n.isArray(r)||n.isPlainObject(r)?JSON.parse(JSON.stringify(r)):r,"#"===t.id?this._append_json_data(t,u,function(n){i.call(this,n)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:t.id})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1))):"string"==typeof r?"#"===t.id?this._append_html_data(t,n(n.parseHTML(r)).filter(function(){return 3!==this.nodeType}),function(n){i.call(this,n)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:t.id})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1)):i.call(this,!1):"#"===t.id?this._append_html_data(t,this._data.core.original_container_html.clone(!0),function(n){i.call(this,n)}):i.call(this,!1)},_node_changed:function(n){n=this.get_node(n);n&&this._model.changed.push(n.id)},_append_html_data:function(t,i,r){t=this.get_node(t);t.children=[];t.children_d=[];var a=i.is("ul")?i.children():i,o=t.id,c=[],u=[],s=this._model.data,f=s[o],v=this._data.core.selected.length,e,h,l;for(a.each(n.proxy(function(t,i){e=this._parse_model_from_html(n(i),o,f.parents.concat());e&&(c.push(e),u.push(e),s[e].children_d.length&&(u=u.concat(s[e].children_d)))},this)),f.children=c,f.children_d=u,h=0,l=f.parents.length;l>h;h++)s[f.parents[h]].children_d=s[f.parents[h]].children_d.concat(u);this.trigger("model",{nodes:u,parent:o});"#"!==o?(this._node_changed(o),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0));this._data.core.selected.length!==v&&this.trigger("changed",{action:"model",selected:this._data.core.selected});r.call(this,!0)},_append_json_data:function(t,i,r,u){if(null!==this.element){t=this.get_node(t);t.children=[];t.children_d=[];i.d&&(i=i.d,"string"==typeof i&&(i=JSON.parse(i)));n.isArray(i)||(i=[i]);var f=null,e={df:this._model.default_state,dat:i,par:t.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},o=function(n,t){n.data&&(n=n.data);var u=n.dat,c=n.par,y=[],o=[],l=[],h=n.df,k=n.t_id,v=n.t_cnt,r=n.m,f=r[c],p=n.sel,s,i,e,a,w=function(n,i,u){u=u?u.concat():[];i&&u.unshift(i);var c=n.id.toString(),e,a,o,s,f={id:c,text:n.text||"",icon:n.icon!==t?n.icon:!0,parent:i,parents:u,children:n.children||[],children_d:n.children_d||[],data:n.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(e in h)h.hasOwnProperty(e)&&(f.state[e]=h[e]);if(n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(f.icon=n.data.jstree.icon),(f.icon===t||null===f.icon||""===f.icon)&&(f.icon=!0),n&&n.data&&(f.data=n.data,n.data.jstree))for(e in n.data.jstree)n.data.jstree.hasOwnProperty(e)&&(f.state[e]=n.data.jstree[e]);if(n&&"object"==typeof n.state)for(e in n.state)n.state.hasOwnProperty(e)&&(f.state[e]=n.state[e]);if(n&&"object"==typeof n.li_attr)for(e in n.li_attr)n.li_attr.hasOwnProperty(e)&&(f.li_attr[e]=n.li_attr[e]);if(f.li_attr.id||(f.li_attr.id=c),n&&"object"==typeof n.a_attr)for(e in n.a_attr)n.a_attr.hasOwnProperty(e)&&(f.a_attr[e]=n.a_attr[e]);for(n&&n.children&&n.children===!0&&(f.state.loaded=!1,f.children=[],f.children_d=[]),r[f.id]=f,e=0,a=f.children.length;a>e;e++)o=w(r[f.children[e]],f.id,u),s=r[o],f.children_d.push(o),s.children_d.length&&(f.children_d=f.children_d.concat(s.children_d));return delete n.data,delete n.children,r[f.id].original=n,f.state.selected&&l.push(f.id),f.id},b=function(n,i,u){u=u?u.concat():[];i&&u.unshift(i);var o=!1,e,a,s,c,f;do o="j"+k+"_"+ ++v;while(r[o]);f={id:!1,text:"string"==typeof n?n:"",icon:"object"==typeof n&&n.icon!==t?n.icon:!0,parent:i,parents:u,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(e in h)h.hasOwnProperty(e)&&(f.state[e]=h[e]);if(n&&n.id&&(f.id=n.id.toString()),n&&n.text&&(f.text=n.text),n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(f.icon=n.data.jstree.icon),(f.icon===t||null===f.icon||""===f.icon)&&(f.icon=!0),n&&n.data&&(f.data=n.data,n.data.jstree))for(e in n.data.jstree)n.data.jstree.hasOwnProperty(e)&&(f.state[e]=n.data.jstree[e]);if(n&&"object"==typeof n.state)for(e in n.state)n.state.hasOwnProperty(e)&&(f.state[e]=n.state[e]);if(n&&"object"==typeof n.li_attr)for(e in n.li_attr)n.li_attr.hasOwnProperty(e)&&(f.li_attr[e]=n.li_attr[e]);if(f.li_attr.id&&!f.id&&(f.id=f.li_attr.id.toString()),f.id||(f.id=o),f.li_attr.id||(f.li_attr.id=f.id),n&&"object"==typeof n.a_attr)for(e in n.a_attr)n.a_attr.hasOwnProperty(e)&&(f.a_attr[e]=n.a_attr[e]);if(n&&n.children&&n.children.length){for(e=0,a=n.children.length;a>e;e++)s=b(n.children[e],f.id,u),c=r[s],f.children.push(s),c.children_d.length&&(f.children_d=f.children_d.concat(c.children_d));f.children_d=f.children_d.concat(f.children)}return n&&n.children&&n.children===!0&&(f.state.loaded=!1,f.children=[],f.children_d=[]),delete n.data,delete n.children,f.original=n,r[f.id]=f,f.state.selected&&l.push(f.id),f.id};if(u.length&&u[0].id!==t&&u[0].parent!==t){for(i=0,e=u.length;e>i;i++)u[i].children||(u[i].children=[]),r[u[i].id.toString()]=u[i];for(i=0,e=u.length;e>i;i++)r[u[i].parent.toString()].children.push(u[i].id.toString()),f.children_d.push(u[i].id.toString());for(i=0,e=f.children.length;e>i;i++)s=w(r[f.children[i]],c,f.parents.concat()),o.push(s),r[s].children_d.length&&(o=o.concat(r[s].children_d));for(i=0,e=f.parents.length;e>i;i++)r[f.parents[i]].children_d=r[f.parents[i]].children_d.concat(o);a={cnt:v,mod:r,sel:p,par:c,dpc:o,add:l}}else{for(i=0,e=u.length;e>i;i++)s=b(u[i],c,f.parents.concat()),s&&(y.push(s),o.push(s),r[s].children_d.length&&(o=o.concat(r[s].children_d)));for(f.children=y,f.children_d=o,i=0,e=f.parents.length;e>i;i++)r[f.parents[i]].children_d=r[f.parents[i]].children_d.concat(o);a={cnt:v,mod:r,sel:p,par:c,dpc:o,add:l}}return"undefined"!=typeof window&&"undefined"!=typeof document?a:void postMessage(a)},s=function(t,i){if(null!==this.element){if(this._cnt=t.cnt,this._model.data=t.mod,i){var u,o,h=t.add,f=t.sel,e=this._data.core.selected.slice(),s=this._model.data;if(f.length!==e.length||n.vakata.array_unique(f.concat(e)).length!==f.length){for(u=0,o=f.length;o>u;u++)-1===n.inArray(f[u],h)&&-1===n.inArray(f[u],e)&&(s[f[u]].state.selected=!1);for(u=0,o=e.length;o>u;u++)-1===n.inArray(e[u],f)&&(s[e[u]].state.selected=!0)}}t.add.length&&(this._data.core.selected=this._data.core.selected.concat(t.add));this.trigger("model",{nodes:t.dpc,parent:t.par});"#"!==t.par?(this._node_changed(t.par),this.redraw()):this.redraw(!0);t.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected});r.call(this,!0)}};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{null===this._wrk&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+o.toString()],{type:"text/javascript"})));!this._data.core.working||u?(this._data.core.working=!0,f=new window.Worker(this._wrk),f.onmessage=n.proxy(function(n){s.call(this,n.data,!0);try{f.terminate();f=null}catch(t){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1},this),e.par?f.postMessage(e):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([t,i,r,!0])}catch(h){s.call(this,o(e),!1);this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else s.call(this,o(e),!1)}},_parse_model_from_html:function(i,r,u){u=u?[].concat(u):[];r&&u.unshift(r);var s,h,l=this._model.data,f={id:!1,text:!1,icon:!0,parent:r,parents:u,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},o,e,c;for(o in this._model.default_state)this._model.default_state.hasOwnProperty(o)&&(f.state[o]=this._model.default_state[o]);if(e=n.vakata.attributes(i,!0),n.each(e,function(t,i){return i=n.trim(i),i.length?(f.li_attr[t]=i,void("id"===t&&(f.id=i.toString()))):!0}),e=i.children("a").first(),e.length&&(e=n.vakata.attributes(e,!0),n.each(e,function(t,i){i=n.trim(i);i.length&&(f.a_attr[t]=i)})),e=i.children("a").first().length?i.children("a").first().clone():i.clone(),e.children("ins, i, ul").remove(),e=e.html(),e=n("<div />").html(e),f.text=this.settings.core.force_text?e.text():e.html(),e=i.data(),f.data=e?n.extend(!0,{},e):null,f.state.opened=i.hasClass("jstree-open"),f.state.selected=i.children("a").hasClass("jstree-clicked"),f.state.disabled=i.children("a").hasClass("jstree-disabled"),f.data&&f.data.jstree)for(o in f.data.jstree)f.data.jstree.hasOwnProperty(o)&&(f.state[o]=f.data.jstree[o]);e=i.children("a").children(".jstree-themeicon");e.length&&(f.icon=e.hasClass("jstree-themeicon-hidden")?!1:e.attr("rel"));f.state.icon!==t&&(f.icon=f.state.icon);(f.icon===t||null===f.icon||""===f.icon)&&(f.icon=!0);e=i.children("ul").children("li");do c="j"+this._id+"_"+ ++this._cnt;while(l[c]);return f.id=f.li_attr.id?f.li_attr.id.toString():c,e.length?(e.each(n.proxy(function(t,i){s=this._parse_model_from_html(n(i),f.id,u);h=this._model.data[s];f.children.push(s);h.children_d.length&&(f.children_d=f.children_d.concat(h.children_d))},this)),f.children_d=f.children_d.concat(f.children)):i.hasClass("jstree-closed")&&(f.state.loaded=!1),f.li_attr["class"]&&(f.li_attr["class"]=f.li_attr["class"].replace("jstree-closed","").replace("jstree-open","")),f.a_attr["class"]&&(f.a_attr["class"]=f.a_attr["class"].replace("jstree-clicked","").replace("jstree-disabled","")),l[f.id]=f,f.state.selected&&this._data.core.selected.push(f.id),f.id},_parse_model_from_flat_json:function(n,i,r){r=r?r.concat():[];i&&r.unshift(i);var c=n.id.toString(),e=this._model.data,o=this._model.default_state,f,l,s,h,u={id:c,text:n.text||"",icon:n.icon!==t?n.icon:!0,parent:i,parents:r,children:n.children||[],children_d:n.children_d||[],data:n.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in o)o.hasOwnProperty(f)&&(u.state[f]=o[f]);if(n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(u.icon=n.data.jstree.icon),(u.icon===t||null===u.icon||""===u.icon)&&(u.icon=!0),n&&n.data&&(u.data=n.data,n.data.jstree))for(f in n.data.jstree)n.data.jstree.hasOwnProperty(f)&&(u.state[f]=n.data.jstree[f]);if(n&&"object"==typeof n.state)for(f in n.state)n.state.hasOwnProperty(f)&&(u.state[f]=n.state[f]);if(n&&"object"==typeof n.li_attr)for(f in n.li_attr)n.li_attr.hasOwnProperty(f)&&(u.li_attr[f]=n.li_attr[f]);if(u.li_attr.id||(u.li_attr.id=c),n&&"object"==typeof n.a_attr)for(f in n.a_attr)n.a_attr.hasOwnProperty(f)&&(u.a_attr[f]=n.a_attr[f]);for(n&&n.children&&n.children===!0&&(u.state.loaded=!1,u.children=[],u.children_d=[]),e[u.id]=u,f=0,l=u.children.length;l>f;f++)s=this._parse_model_from_flat_json(e[u.children[f]],u.id,r),h=e[s],u.children_d.push(s),h.children_d.length&&(u.children_d=u.children_d.concat(h.children_d));return delete n.data,delete n.children,e[u.id].original=n,u.state.selected&&this._data.core.selected.push(u.id),u.id},_parse_model_from_json:function(n,i,r){r=r?r.concat():[];i&&r.unshift(i);var e=!1,f,l,o,s,h=this._model.data,c=this._model.default_state,u;do e="j"+this._id+"_"+ ++this._cnt;while(h[e]);u={id:!1,text:"string"==typeof n?n:"",icon:"object"==typeof n&&n.icon!==t?n.icon:!0,parent:i,parents:r,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in c)c.hasOwnProperty(f)&&(u.state[f]=c[f]);if(n&&n.id&&(u.id=n.id.toString()),n&&n.text&&(u.text=n.text),n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(u.icon=n.data.jstree.icon),(u.icon===t||null===u.icon||""===u.icon)&&(u.icon=!0),n&&n.data&&(u.data=n.data,n.data.jstree))for(f in n.data.jstree)n.data.jstree.hasOwnProperty(f)&&(u.state[f]=n.data.jstree[f]);if(n&&"object"==typeof n.state)for(f in n.state)n.state.hasOwnProperty(f)&&(u.state[f]=n.state[f]);if(n&&"object"==typeof n.li_attr)for(f in n.li_attr)n.li_attr.hasOwnProperty(f)&&(u.li_attr[f]=n.li_attr[f]);if(u.li_attr.id&&!u.id&&(u.id=u.li_attr.id.toString()),u.id||(u.id=e),u.li_attr.id||(u.li_attr.id=u.id),n&&"object"==typeof n.a_attr)for(f in n.a_attr)n.a_attr.hasOwnProperty(f)&&(u.a_attr[f]=n.a_attr[f]);if(n&&n.children&&n.children.length){for(f=0,l=n.children.length;l>f;f++)o=this._parse_model_from_json(n.children[f],u.id,r),s=h[o],u.children.push(o),s.children_d.length&&(u.children_d=u.children_d.concat(s.children_d));u.children_d=u.children_d.concat(u.children)}return n&&n.children&&n.children===!0&&(u.state.loaded=!1,u.children=[],u.children_d=[]),delete n.data,delete n.children,u.original=n,h[u.id]=u,u.state.selected&&this._data.core.selected.push(u.id),u.id},_redraw:function(){for(var u=this._model.force_full_redraw?this._model.data["#"].children.concat([]):this._model.changed.concat([]),t=i.createElement("UL"),n,e=this._data.core.focused,r=0,f=u.length;f>r;r++)n=this.redraw_node(u[r],!0,this._model.force_full_redraw),n&&this._model.force_full_redraw&&t.appendChild(n);this._model.force_full_redraw&&(t.className=this.get_container_ul()[0].className,t.setAttribute("role","group"),this.element.empty().append(t));null!==e&&(n=this.get_node(e,!0),n&&n.length&&n.children(".jstree-anchor")[0]!==i.activeElement?n.children(".jstree-anchor").focus():this._data.core.focused=null);this._model.force_full_redraw=!1;this._model.changed=[];this.trigger("redraw",{nodes:u})},redraw:function(n){n&&(this._model.force_full_redraw=!0);this._redraw()},draw_children:function(n){var t=this.get_node(n),u=!1,f=!1,r=!1,e=i;if(!t)return!1;if("#"===t.id)return this.redraw(!0);if(n=this.get_node(n,!0),!n||!n.length)return!1;if(n.children(".jstree-children").remove(),n=n[0],t.children.length&&t.state.loaded){for(r=e.createElement("UL"),r.setAttribute("role","group"),r.className="jstree-children",u=0,f=t.children.length;f>u;u++)r.appendChild(this.redraw_node(t.children[u],!0,!0));n.appendChild(r)}},redraw_node:function(t,r,u,f){var e=this.get_node(t),o=!1,p=!1,w=!1,s=!1,c=!1,v=!1,l="",b=i,y=this._model.data,k=!1,a=null,d=0,g=0;if(!e)return!1;if("#"===e.id)return this.redraw(!0);if(r=r||0===e.children.length,t=i.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(e.id[0])?"\\3"+e.id[0]+" "+e.id.substr(1).replace(n.jstree.idregex,"\\$&"):e.id.replace(n.jstree.idregex,"\\$&"))):i.getElementById(e.id))t=n(t),u||(o=t.parent().parent()[0],o===this.element[0]&&(o=null),p=t.index()),r||!e.children.length||t.children(".jstree-children").length||(r=!0),r||(w=t.children(".jstree-children")[0]),k=t.children(".jstree-anchor")[0]===i.activeElement,t.remove();else if(r=!0,!u){if(o="#"!==e.parent?n("#"+e.parent.replace(n.jstree.idregex,"\\$&"),this.element)[0]:null,!(null===o||o&&y[e.parent].state.opened))return!1;p=n.inArray(e.id,null===o?y["#"].children:y[e.parent].children)}t=h.cloneNode(!0);l="jstree-node ";for(s in e.li_attr)if(e.li_attr.hasOwnProperty(s)){if("id"===s)continue;"class"!==s?t.setAttribute(s,e.li_attr[s]):l+=e.li_attr[s]}e.a_attr.id||(e.a_attr.id=e.id+"_anchor");t.setAttribute("aria-selected",!!e.state.selected);t.setAttribute("aria-level",e.parents.length);t.setAttribute("aria-labelledby",e.a_attr.id);e.state.disabled&&t.setAttribute("aria-disabled",!0);e.state.loaded&&!e.children.length?l+=" jstree-leaf":(l+=e.state.opened&&e.state.loaded?" jstree-open":" jstree-closed",t.setAttribute("aria-expanded",e.state.opened&&e.state.loaded));null!==e.parent&&y[e.parent].children[y[e.parent].children.length-1]===e.id&&(l+=" jstree-last");t.id=e.id;t.className=l;l=(e.state.selected?" jstree-clicked":"")+(e.state.disabled?" jstree-disabled":"");for(c in e.a_attr)if(e.a_attr.hasOwnProperty(c)){if("href"===c&&"#"===e.a_attr[c])continue;"class"!==c?t.childNodes[1].setAttribute(c,e.a_attr[c]):l+=" "+e.a_attr[c]}if(l.length&&(t.childNodes[1].className="jstree-anchor "+l),(e.icon&&e.icon!==!0||e.icon===!1)&&(e.icon===!1?t.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===e.icon.indexOf("/")&&-1===e.icon.indexOf(".")?t.childNodes[1].childNodes[0].className+=" "+e.icon+" jstree-themeicon-custom":(t.childNodes[1].childNodes[0].style.backgroundImage="url("+e.icon+")",t.childNodes[1].childNodes[0].style.backgroundPosition="center center",t.childNodes[1].childNodes[0].style.backgroundSize="auto",t.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?t.childNodes[1].appendChild(b.createTextNode(e.text)):t.childNodes[1].innerHTML+=e.text,r&&e.children.length&&(e.state.opened||f)&&e.state.loaded){for(v=b.createElement("UL"),v.setAttribute("role","group"),v.className="jstree-children",s=0,c=e.children.length;c>s;s++)v.appendChild(this.redraw_node(e.children[s],r,!0));t.appendChild(v)}if(w&&t.appendChild(w),!u){for(o||(o=this.element[0]),s=0,c=o.childNodes.length;c>s;s++)if(o.childNodes[s]&&o.childNodes[s].className&&-1!==o.childNodes[s].className.indexOf("jstree-children")){a=o.childNodes[s];break}a||(a=b.createElement("UL"),a.setAttribute("role","group"),a.className="jstree-children",o.appendChild(a));o=a;p<o.childNodes.length?o.insertBefore(t,o.childNodes[p]):o.appendChild(t);k&&(d=this.element[0].scrollTop,g=this.element[0].scrollLeft,t.childNodes[1].focus(),this.element[0].scrollTop=d,this.element[0].scrollLeft=g)}return e.state.opened&&!e.state.loaded&&(e.state.opened=!1,setTimeout(n.proxy(function(){this.open_node(e.id,!1,0)},this),0)),t},open_node:function(i,r,u){var e,o,f,s;if(n.isArray(i)){for(i=i.slice(),e=0,o=i.length;o>e;e++)this.open_node(i[e],r,u);return!0}if(i=this.get_node(i),!i||"#"===i.id)return!1;if(u=u===t?this.settings.core.animation:u,!this.is_closed(i))return r&&r.call(this,i,!1),!1;if(this.is_loaded(i))f=this.get_node(i,!0),s=this,f.length&&(u&&f.children(".jstree-children").length&&f.children(".jstree-children").stop(!0,!0),i.children.length&&!this._firstChild(f.children(".jstree-children")[0])&&this.draw_children(i),u?(this.trigger("before_open",{node:i}),f.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(u,function(){this.style.display="";s.trigger("after_open",{node:i})})):(this.trigger("before_open",{node:i}),f[0].className=f[0].className.replace("jstree-closed","jstree-open"),f[0].setAttribute("aria-expanded",!0))),i.state.opened=!0,r&&r.call(this,i,!0),f.length||this.trigger("before_open",{node:i}),this.trigger("open_node",{node:i}),u&&f.length||this.trigger("after_open",{node:i});else{if(this.is_loading(i))return setTimeout(n.proxy(function(){this.open_node(i,r,u)},this),500);this.load_node(i,function(n,t){return t?this.open_node(n,r,u):r?r.call(this,n,!1):!1})}},_open_to:function(t){if(t=this.get_node(t),!t||"#"===t.id)return!1;for(var u=t.parents,i=0,r=u.length;r>i;i+=1)"#"!==i&&this.open_node(u[i],!1,0);return n("#"+t.id.replace(n.jstree.idregex,"\\$&"),this.element)},close_node:function(i,r){var f,e,o,u;if(n.isArray(i)){for(i=i.slice(),f=0,e=i.length;e>f;f++)this.close_node(i[f],r);return!0}return i=this.get_node(i),i&&"#"!==i.id?this.is_closed(i)?!1:(r=r===t?this.settings.core.animation:r,o=this,u=this.get_node(i,!0),u.length&&(r?u.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(r,function(){this.style.display="";u.children(".jstree-children").remove();o.trigger("after_close",{node:i})}):(u[0].className=u[0].className.replace("jstree-open","jstree-closed"),u.attr("aria-expanded",!1).children(".jstree-children").remove())),i.state.opened=!1,this.trigger("close_node",{node:i}),void(r&&u.length||this.trigger("after_close",{node:i}))):!1},toggle_node:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;r>i;i++)this.toggle_node(t[i]);return!0}return this.is_closed(t)?this.open_node(t):this.is_open(t)?this.close_node(t):void 0},open_all:function(n,t,i){if(n||(n="#"),n=this.get_node(n),!n)return!1;var r="#"===n.id?this.get_container_ul():this.get_node(n,!0),u,f,e;if(!r.length){for(u=0,f=n.children_d.length;f>u;u++)this.is_closed(this._model.data[n.children_d[u]])&&(this._model.data[n.children_d[u]].state.opened=!0);return this.trigger("open_all",{node:n})}i=i||r;e=this;r=this.is_closed(n)?r.find(".jstree-closed").addBack():r.find(".jstree-closed");r.each(function(){e.open_node(this,function(n,r){r&&this.is_parent(n)&&this.open_all(n,t,i)},t||0)});0===i.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(i)})},close_all:function(t,i){if(t||(t="#"),t=this.get_node(t),!t)return!1;var r="#"===t.id?this.get_container_ul():this.get_node(t,!0),e=this,u,f;if(!r.length){for(u=0,f=t.children_d.length;f>u;u++)this._model.data[t.children_d[u]].state.opened=!1;return this.trigger("close_all",{node:t})}r=this.is_open(t)?r.find(".jstree-open").addBack():r.find(".jstree-open");n(r.get().reverse()).each(function(){e.close_node(this,i||0)});this.trigger("close_all",{node:t})},is_disabled:function(n){return n=this.get_node(n),n&&n.state&&n.state.disabled},enable_node:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;r>i;i++)this.enable_node(t[i]);return!0}return t=this.get_node(t),t&&"#"!==t.id?(t.state.disabled=!1,this.get_node(t,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),void this.trigger("enable_node",{node:t})):!1},disable_node:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;r>i;i++)this.disable_node(t[i]);return!0}return t=this.get_node(t),t&&"#"!==t.id?(t.state.disabled=!0,this.get_node(t,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),void this.trigger("disable_node",{node:t})):!1},activate_node:function(n,i){if(this.is_disabled(n))return!1;if(this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==t?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null),!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(i.metaKey||i.ctrlKey||i.shiftKey)&&(!i.shiftKey||this._data.core.last_clicked&&this.get_parent(n)&&this.get_parent(n)===this._data.core.last_clicked.parent))if(i.shiftKey){for(var e=this.get_node(n).id,o=this._data.core.last_clicked.id,u=this.get_node(this._data.core.last_clicked.parent).children,f=!1,r=0,s=u.length;s>r;r+=1)u[r]===e&&(f=!f),u[r]===o&&(f=!f),this.is_disabled(u[r])||!f&&u[r]!==e&&u[r]!==o?this.deselect_node(u[r],!0,i):this.select_node(u[r],!0,!1,i);this.trigger("changed",{action:"select_node",node:this.get_node(n),selected:this._data.core.selected,event:i})}else this.is_selected(n)?this.deselect_node(n,!1,i):this.select_node(n,!1,!1,i);else!this.settings.core.multiple&&(i.metaKey||i.ctrlKey||i.shiftKey)&&this.is_selected(n)?this.deselect_node(n,!1,i):(this.deselect_all(!0),this.select_node(n,!1,!1,i),this._data.core.last_clicked=this.get_node(n));this.trigger("activate_node",{node:this.get_node(n)})},hover_node:function(n){if(n=this.get_node(n,!0),!n||!n.length||n.children(".jstree-hovered").length)return!1;var t=this.element.find(".jstree-hovered"),i=this.element;t&&t.length&&this.dehover_node(t);n.children(".jstree-anchor").addClass("jstree-hovered");this.trigger("hover_node",{node:this.get_node(n)});setTimeout(function(){i.attr("aria-activedescendant",n[0].id)},0)},dehover_node:function(n){return n=this.get_node(n,!0),n&&n.length&&n.children(".jstree-hovered").length?(n.children(".jstree-anchor").removeClass("jstree-hovered"),void this.trigger("dehover_node",{node:this.get_node(n)})):!1},select_node:function(t,i,r,u){var f,e,o;if(n.isArray(t)){for(t=t.slice(),e=0,o=t.length;o>e;e++)this.select_node(t[e],i,r,u);return!0}return t=this.get_node(t),t&&"#"!==t.id?(f=this.get_node(t,!0),void(t.state.selected||(t.state.selected=!0,this._data.core.selected.push(t.id),r||(f=this._open_to(t)),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:t,selected:this._data.core.selected,event:u}),i||this.trigger("changed",{action:"select_node",node:t,selected:this._data.core.selected,event:u})))):!1},deselect_node:function(t,i,r){var u,e,f;if(n.isArray(t)){for(t=t.slice(),u=0,e=t.length;e>u;u++)this.deselect_node(t[u],i,r);return!0}return t=this.get_node(t),t&&"#"!==t.id?(f=this.get_node(t,!0),void(t.state.selected&&(t.state.selected=!1,this._data.core.selected=n.vakata.array_remove_item(this._data.core.selected,t.id),f.length&&f.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:t,selected:this._data.core.selected,event:r}),i||this.trigger("changed",{action:"deselect_node",node:t,selected:this._data.core.selected,event:r})))):!1},select_all:function(n){var r=this._data.core.selected.concat([]),t,i;for(this._data.core.selected=this._model.data["#"].children_d.concat(),t=0,i=this._data.core.selected.length;i>t;t++)this._model.data[this._data.core.selected[t]]&&(this._model.data[this._data.core.selected[t]].state.selected=!0);this.redraw(!0);this.trigger("select_all",{selected:this._data.core.selected});n||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:r})},deselect_all:function(n){for(var i=this._data.core.selected.concat([]),t=0,r=this._data.core.selected.length;r>t;t++)this._model.data[this._data.core.selected[t]]&&(this._model.data[this._data.core.selected[t]].state.selected=!1);this._data.core.selected=[];this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1);this.trigger("deselect_all",{selected:this._data.core.selected,node:i});n||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:i})},is_selected:function(n){return n=this.get_node(n),n&&"#"!==n.id?n.state.selected:!1},get_selected:function(t){return t?n.map(this._data.core.selected,n.proxy(function(n){return this.get_node(n)},this)):this._data.core.selected.slice()},get_top_selected:function(t){for(var r=this.get_selected(!0),u={},f,o,i=0,e=r.length;e>i;i++)u[r[i].id]=r[i];for(i=0,e=r.length;e>i;i++)for(f=0,o=r[i].children_d.length;o>f;f++)u[r[i].children_d[f]]&&delete u[r[i].children_d[f]];r=[];for(i in u)u.hasOwnProperty(i)&&r.push(i);return t?n.map(r,n.proxy(function(n){return this.get_node(n)},this)):r},get_bottom_selected:function(t){for(var r=this.get_selected(!0),u=[],i=0,f=r.length;f>i;i++)r[i].children.length||u.push(r[i].id);return t?n.map(u,n.proxy(function(n){return this.get_node(n)},this)):u},get_state:function(){var t={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}};for(var n in this._model.data)this._model.data.hasOwnProperty(n)&&"#"!==n&&(this._model.data[n].state.opened&&t.core.open.push(n),this._model.data[n].state.selected&&t.core.selected.push(n));return t},set_state:function(i,r){if(i){if(i.core){var f,u;if(i.core.open)return n.isArray(i.core.open)&&i.core.open.length?this._load_nodes(i.core.open,function(n){this.open_node(n,!1,0);delete i.core.open;this.set_state(i,r)},!0):(delete i.core.open,this.set_state(i,r)),!1;if(i.core.scroll)return i.core.scroll&&i.core.scroll.left!==t&&this.element.scrollLeft(i.core.scroll.left),i.core.scroll&&i.core.scroll.top!==t&&this.element.scrollTop(i.core.scroll.top),delete i.core.scroll,this.set_state(i,r),!1;if(i.core.selected)return f=this,this.deselect_all(),n.each(i.core.selected,function(n,t){f.select_node(t,!1,!0)}),delete i.core.selected,this.set_state(i,r),!1;for(u in i)i.hasOwnProperty(u)&&"core"!==u&&-1===n.inArray(u,this.settings.plugins)&&delete i[u];if(n.isEmptyObject(i.core))return delete i.core,this.set_state(i,r),!1}return n.isEmptyObject(i)?(i=null,r&&r.call(this),this.trigger("set_state"),!1):!0}return!1},refresh:function(t,i){this._data.core.state=i===!0?{}:this.get_state();i&&n.isFunction(i)&&(this._data.core.state=i.call(this,this._data.core.state));this._cnt=0;this._model.data={"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}};var r=this.get_container_ul()[0].className;t||(this.element.html("<ul class='"+r+"' role='group'><li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><i class='jstree-icon jstree-ocl'><\/i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'><\/i>"+this.get_string("Loading ...")+"<\/a><\/li><\/ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading"));this.load_node("#",function(t,i){i&&(this.get_container_ul()[0].className=r,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(n.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")}));this._data.core.state=null})},refresh_node:function(t){if(t=this.get_node(t),!t||"#"===t.id)return!1;var i=[],r=[],u=this._data.core.selected.concat([]);r.push(t.id);t.state.opened===!0&&i.push(t.id);this.get_node(t,!0).find(".jstree-open").each(function(){i.push(this.id)});this._load_nodes(r,n.proxy(function(n){this.open_node(i,!1,0);this.select_node(this._data.core.selected);this.trigger("refresh_node",{node:t,nodes:n})},this))},set_id:function(t,i){if(t=this.get_node(t),!t||"#"===t.id)return!1;var r,f,u=this._model.data;for(i=i.toString(),u[t.parent].children[n.inArray(t.id,u[t.parent].children)]=i,r=0,f=t.parents.length;f>r;r++)u[t.parents[r]].children_d[n.inArray(t.id,u[t.parents[r]].children_d)]=i;for(r=0,f=t.children.length;f>r;r++)u[t.children[r]].parent=i;for(r=0,f=t.children_d.length;f>r;r++)u[t.children_d[r]].parents[n.inArray(t.id,u[t.children_d[r]].parents)]=i;return r=n.inArray(t.id,this._data.core.selected),-1!==r&&(this._data.core.selected[r]=i),r=this.get_node(t.id,!0),r&&(r.attr("id",i).children(".jstree-anchor").attr("id",i+"_anchor").end().attr("aria-labelledby",i+"_anchor"),this.element.attr("aria-activedescendant")===t.id&&this.element.attr("aria-activedescendant",i)),delete u[t.id],t.id=i,t.li_attr.id=i,u[i]=t,!0},get_text:function(n){return n=this.get_node(n),n&&"#"!==n.id?n.text:!1},set_text:function(t,i){var r,u;if(n.isArray(t)){for(t=t.slice(),r=0,u=t.length;u>r;r++)this.set_text(t[r],i);return!0}return t=this.get_node(t),t&&"#"!==t.id?(t.text=i,this.get_node(t,!0).length&&this.redraw_node(t.id),this.trigger("set_text",{obj:t,text:i}),!0):!1},get_json:function(t,i,r){if(t=this.get_node(t||"#"),!t)return!1;i&&i.flat&&!r&&(r=[]);var u={id:t.id,text:t.text,icon:this.get_icon(t),li_attr:n.extend(!0,{},t.li_attr),a_attr:n.extend(!0,{},t.a_attr),state:{},data:i&&i.no_data?!1:n.extend(!0,{},t.data)},f,e;if(i&&i.flat?u.parent=t.parent:u.children=[],!i||!i.no_state)for(f in t.state)t.state.hasOwnProperty(f)&&(u.state[f]=t.state[f]);if(i&&i.no_id&&(delete u.id,u.li_attr&&u.li_attr.id&&delete u.li_attr.id,u.a_attr&&u.a_attr.id&&delete u.a_attr.id),i&&i.flat&&"#"!==t.id&&r.push(u),!i||!i.no_children)for(f=0,e=t.children.length;e>f;f++)i&&i.flat?this.get_json(t.children[f],i,r):u.children.push(this.get_json(t.children[f],i));return i&&i.flat?r:"#"===t.id?u.children:u},create_node:function(i,r,u,f,e){if(null===i&&(i="#"),i=this.get_node(i),!i)return!1;if(u=u===t?"last":u,!u.toString().match(/^(before|after)$/)&&!e&&!this.is_loaded(i))return this.load_node(i,function(){this.create_node(i,r,u,f,!0)});r||(r={text:this.get_string("New node")});"string"==typeof r&&(r={text:r});r.text===t&&(r.text=this.get_string("New node"));var o,h,s,c;switch("#"===i.id&&("before"===u&&(u="first"),"after"===u&&(u="last")),u){case"before":o=this.get_node(i.parent);u=n.inArray(i.id,o.children);i=o;break;case"after":o=this.get_node(i.parent);u=n.inArray(i.id,o.children)+1;i=o;break;case"inside":case"first":u=0;break;case"last":u=i.children.length;break;default:u||(u=0)}if(u>i.children.length&&(u=i.children.length),r.id||(r.id=!0),!this.check("create_node",r,i,u))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(r.id===!0&&delete r.id,r=this._parse_model_from_json(r,i.id,i.parents.concat()),!r)return!1;for(o=this.get_node(r),h=[],h.push(r),h=h.concat(o.children_d),this.trigger("model",{nodes:h,parent:i.id}),i.children_d=i.children_d.concat(h),s=0,c=i.parents.length;c>s;s++)this._model.data[i.parents[s]].children_d=this._model.data[i.parents[s]].children_d.concat(h);for(r=o,o=[],s=0,c=i.children.length;c>s;s++)o[s>=u?s+1:s]=i.children[s];return o[u]=r.id,i.children=o,this.redraw_node(i,!0),f&&f.call(this,this.get_node(r)),this.trigger("create_node",{node:this.get_node(r),parent:i.id,position:u}),r.id},rename_node:function(t,i){var r,u,f;if(n.isArray(t)){for(t=t.slice(),r=0,u=t.length;u>r;r++)this.rename_node(t[r],i);return!0}return t=this.get_node(t),t&&"#"!==t.id?(f=t.text,this.check("rename_node",t,this.get_parent(t),i)?(this.set_text(t,i),this.trigger("rename_node",{node:t,text:i,old:f}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1)):!1},delete_node:function(t){var o,c,u,i,f,e,l,r,s,h;if(n.isArray(t)){for(t=t.slice(),o=0,c=t.length;c>o;o++)this.delete_node(t[o]);return!0}if(t=this.get_node(t),!t||"#"===t.id)return!1;if(u=this.get_node(t.parent),i=n.inArray(t.id,u.children),h=!1,!this.check("delete_node",t,u,i))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==i&&(u.children=n.vakata.array_remove(u.children,i)),f=t.children_d.concat([]),f.push(t.id),r=0,s=f.length;s>r;r++){for(e=0,l=t.parents.length;l>e;e++)i=n.inArray(f[r],this._model.data[t.parents[e]].children_d),-1!==i&&(this._model.data[t.parents[e]].children_d=n.vakata.array_remove(this._model.data[t.parents[e]].children_d,i));this._model.data[f[r]].state.selected&&(h=!0,i=n.inArray(f[r],this._data.core.selected),-1!==i&&(this._data.core.selected=n.vakata.array_remove(this._data.core.selected,i)))}for(this.trigger("delete_node",{node:t,parent:u.id}),h&&this.trigger("changed",{action:"delete_node",node:t,selected:this._data.core.selected,parent:u.id}),r=0,s=f.length;s>r;r++)delete this._model.data[f[r]];return this.redraw_node(u,!0),!0},check:function(t,i,r,u,f){i=i&&i.id?i:this.get_node(i);r=r&&r.id?r:this.get_node(r);var e=t.match(/^move_node|copy_node|create_node$/i)?r:i,o=this.settings.core.check_callback;return"move_node"!==t&&"copy_node"!==t||f&&f.is_multi||i.id!==r.id&&n.inArray(i.id,r.children)!==u&&-1===n.inArray(r.id,i.children_d)?(e&&e.data&&(e=e.data),e&&e.functions&&(e.functions[t]===!1||e.functions[t]===!0)?(e.functions[t]===!1&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+t,data:JSON.stringify({chk:t,pos:u,obj:i&&i.id?i.id:!1,par:r&&r.id?r.id:!1})}),e.functions[t]):o===!1||n.isFunction(o)&&o.call(this,t,i,r,u,f)===!1||o&&o[t]===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+t,data:JSON.stringify({chk:t,pos:u,obj:i&&i.id?i.id:!1,par:r&&r.id?r.id:!1})},!1):!0):(this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:t,pos:u,obj:i&&i.id?i.id:!1,par:r&&r.id?r.id:!1})},!1)},last_error:function(){return this._data.core.last_error},move_node:function(i,r,u,f,e,o,s){var k,d,y,g,l,c,nt,v,a,h,p,b,tt,w;if(r=this.get_node(r),u=u===t?0:u,!r)return!1;if(!u.toString().match(/^(before|after)$/)&&!e&&!this.is_loaded(r))return this.load_node(r,function(){this.move_node(i,r,u,f,!0,!1,s)});if(n.isArray(i)){if(1!==i.length){for(k=0,d=i.length;d>k;k++)(a=this.move_node(i[k],r,u,f,e,!1,s))&&(r=a,u="after");return this.redraw(),!0}i=i[0]}if(i=i&&i.id?i:this.get_node(i),!i||"#"===i.id)return!1;if(y=(i.parent||"#").toString(),l=u.toString().match(/^(before|after)$/)&&"#"!==r.id?this.get_node(r.parent):r,c=s?s:this._model.data[i.id]?this:n.jstree.reference(i.id),nt=!c||!c._id||this._id!==c._id,g=c&&c._id&&y&&c._model.data[y]&&c._model.data[y].children?n.inArray(i.id,c._model.data[y].children):-1,c&&c._id&&(i=c._model.data[i.id]),nt)return(a=this.copy_node(i,r,u,f,e,!1,s))?(c&&c.delete_node(i),a):!1;switch("#"===r.id&&("before"===u&&(u="first"),"after"===u&&(u="last")),u){case"before":u=n.inArray(r.id,l.children);break;case"after":u=n.inArray(r.id,l.children)+1;break;case"inside":case"first":u=0;break;case"last":u=l.children.length;break;default:u||(u=0)}if(u>l.children.length&&(u=l.children.length),!this.check("move_node",i,l,u,{core:!0,origin:s,is_multi:c&&c._id&&c._id!==this._id,is_foreign:!c||!c._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(i.parent===l.id){for(v=l.children.concat(),a=n.inArray(i.id,v),-1!==a&&(v=n.vakata.array_remove(v,a),u>a&&u--),a=[],h=0,p=v.length;p>h;h++)a[h>=u?h+1:h]=v[h];a[u]=i.id;l.children=a;this._node_changed(l.id);this.redraw("#"===l.id)}else{for(a=i.children_d.concat(),a.push(i.id),h=0,p=i.parents.length;p>h;h++){for(v=[],w=c._model.data[i.parents[h]].children_d,b=0,tt=w.length;tt>b;b++)-1===n.inArray(w[b],a)&&v.push(w[b]);c._model.data[i.parents[h]].children_d=v}for(c._model.data[y].children=n.vakata.array_remove_item(c._model.data[y].children,i.id),h=0,p=l.parents.length;p>h;h++)this._model.data[l.parents[h]].children_d=this._model.data[l.parents[h]].children_d.concat(a);for(v=[],h=0,p=l.children.length;p>h;h++)v[h>=u?h+1:h]=l.children[h];for(v[u]=i.id,l.children=v,l.children_d.push(i.id),l.children_d=l.children_d.concat(i.children_d),i.parent=l.id,a=l.parents.concat(),a.unshift(l.id),w=i.parents.length,i.parents=a,a=a.concat(),h=0,p=i.children_d.length;p>h;h++)this._model.data[i.children_d[h]].parents=this._model.data[i.children_d[h]].parents.slice(0,-1*w),Array.prototype.push.apply(this._model.data[i.children_d[h]].parents,a);("#"===y||"#"===l.id)&&(this._model.force_full_redraw=!0);this._model.force_full_redraw||(this._node_changed(y),this._node_changed(l.id));o||this.redraw()}return f&&f.call(this,i,l,u),this.trigger("move_node",{node:i,parent:l.id,position:u,old_parent:y,old_position:g,is_multi:c&&c._id&&c._id!==this._id,is_foreign:!c||!c._id,old_instance:c,new_instance:this}),i.id},copy_node:function(i,r,u,f,e,o,s){var w,k,v,a,l,b,y,p,c,h,d;if(r=this.get_node(r),u=u===t?0:u,!r)return!1;if(!u.toString().match(/^(before|after)$/)&&!e&&!this.is_loaded(r))return this.load_node(r,function(){this.copy_node(i,r,u,f,!0,!1,s)});if(n.isArray(i)){if(1!==i.length){for(w=0,k=i.length;k>w;w++)(a=this.copy_node(i[w],r,u,f,e,!0,s))&&(r=a,u="after");return this.redraw(),!0}i=i[0]}if(i=i&&i.id?i:this.get_node(i),!i||"#"===i.id)return!1;switch(p=(i.parent||"#").toString(),c=u.toString().match(/^(before|after)$/)&&"#"!==r.id?this.get_node(r.parent):r,h=s?s:this._model.data[i.id]?this:n.jstree.reference(i.id),d=!h||!h._id||this._id!==h._id,h&&h._id&&(i=h._model.data[i.id]),"#"===r.id&&("before"===u&&(u="first"),"after"===u&&(u="last")),u){case"before":u=n.inArray(r.id,c.children);break;case"after":u=n.inArray(r.id,c.children)+1;break;case"inside":case"first":u=0;break;case"last":u=c.children.length;break;default:u||(u=0)}if(u>c.children.length&&(u=c.children.length),!this.check("copy_node",i,c,u,{core:!0,origin:s,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if((y=h?h.get_json(i,{no_id:!0,no_data:!0,no_state:!0}):i,!y)||(y.id===!0&&delete y.id,y=this._parse_model_from_json(y,c.id,c.parents.concat()),!y))return!1;for(a=this.get_node(y),i&&i.state&&i.state.loaded===!1&&(a.state.loaded=!1),v=[],v.push(y),v=v.concat(a.children_d),this.trigger("model",{nodes:v,parent:c.id}),l=0,b=c.parents.length;b>l;l++)this._model.data[c.parents[l]].children_d=this._model.data[c.parents[l]].children_d.concat(v);for(v=[],l=0,b=c.children.length;b>l;l++)v[l>=u?l+1:l]=c.children[l];return v[u]=a.id,c.children=v,c.children_d.push(a.id),c.children_d=c.children_d.concat(a.children_d),"#"===c.id&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(c.id),o||this.redraw("#"===c.id),f&&f.call(this,a,c,u),this.trigger("copy_node",{node:a,original:i,parent:c.id,position:u,old_parent:p,old_position:h&&h._id&&p&&h._model.data[p]&&h._model.data[p].children?n.inArray(i.id,h._model.data[p].children):-1,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id,old_instance:h,new_instance:this}),a.id},cut:function(t){if(t||(t=this._data.core.selected.concat()),n.isArray(t)||(t=[t]),!t.length)return!1;for(var o=[],i,r=0,s=t.length;s>r;r++)i=this.get_node(t[r]),i&&i.id&&"#"!==i.id&&o.push(i);return o.length?(f=o,e=this,u="move_node",void this.trigger("cut",{node:t})):!1},copy:function(t){if(t||(t=this._data.core.selected.concat()),n.isArray(t)||(t=[t]),!t.length)return!1;for(var o=[],i,r=0,s=t.length;s>r;r++)i=this.get_node(t[r]),i&&i.id&&"#"!==i.id&&o.push(i);return o.length?(f=o,e=this,u="copy_node",void this.trigger("copy",{node:t})):!1},get_buffer:function(){return{mode:u,node:f,inst:e}},can_paste:function(){return u!==!1&&f!==!1},paste:function(n,t){return n=this.get_node(n),n&&u&&u.match(/^(copy_node|move_node)$/)&&f?(this[u](f,n,t,!1,!1,!1,e)&&this.trigger("paste",{parent:n.id,node:f,mode:u}),f=!1,u=!1,void(e=!1)):!1},clear_buffer:function(){f=!1;u=!1;e=!1;this.trigger("clear_buffer")},edit:function(t,i,r){var a,h,u,e,f,o,s,c,l;return(t=this.get_node(t))?this.settings.core.check_callback===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_07",reason:"Could not edit node because of check_callback"},this.settings.core.error.call(this,this._data.core.last_error),!1):(l=t,i="string"==typeof i?i:t.text,this.set_text(t,""),t=this._open_to(t),l.text=i,a=this._data.core.rtl,h=this.element.width(),u=t.children(".jstree-anchor"),e=n("<span>"),f=i,o=n("<div />",{css:{position:"absolute",top:"-200px",left:a?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),s=n("<input />",{value:f,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:n.proxy(function(){var c=e.children(".jstree-rename-input"),i=c.val(),h=this.settings.core.force_text,s;""===i&&(i=f);o.remove();e.replaceWith(u);e.remove();f=h?f:n("<div><\/div>").append(n.parseHTML(f)).html();this.set_text(t,f);s=!!this.rename_node(t,h?n("<div><\/div>").text(i).text():n("<div><\/div>").append(n.parseHTML(i)).html());s||this.set_text(t,f);r&&r.call(this,l,s)},this),keydown:function(n){var t=n.which;27===t&&(this.value=f);(27===t||13===t||37===t||38===t||39===t||40===t||32===t)&&n.stopImmediatePropagation();(27===t||13===t)&&(n.preventDefault(),this.blur())},click:function(n){n.stopImmediatePropagation()},mousedown:function(n){n.stopImmediatePropagation()},keyup:function(){s.width(Math.min(o.text("pW"+this.value).width(),h))},keypress:function(n){if(13===n.which)return!1}}),c={fontFamily:u.css("fontFamily")||"",fontSize:u.css("fontSize")||"",fontWeight:u.css("fontWeight")||"",fontStyle:u.css("fontStyle")||"",fontStretch:u.css("fontStretch")||"",fontVariant:u.css("fontVariant")||"",letterSpacing:u.css("letterSpacing")||"",wordSpacing:u.css("wordSpacing")||""},e.attr("class",u.attr("class")).append(u.contents().clone()).append(s),u.replaceWith(e),o.css(c),void s.css(c).width(Math.min(o.text("pW"+s[0].value).width(),h))[0].select()):!1},set_theme:function(t,i){if(!t)return!1;if(i===!0){var r=this.settings.core.themes.dir;r||(r=n.jstree.path+"/themes");i=r+"/"+t+"/style.css"}i&&-1===n.inArray(i,y)&&(n("head").append('<link rel="stylesheet" href="'+i+'" type="text/css" />'),y.push(i));this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name);this._data.core.themes.name=t;this.element.addClass("jstree-"+t);this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+t+"-responsive");this.trigger("set_theme",{theme:t})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(n){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant);this._data.core.themes.variant=n;n&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0;this.get_container_ul().addClass("jstree-striped")},hide_stripes:function(){this._data.core.themes.stripes=!1;this.get_container_ul().removeClass("jstree-striped")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0;this.get_container_ul().removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1;this.get_container_ul().addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0;this.get_container_ul().removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1;this.get_container_ul().addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(i,r){var e,o,f,u;if(n.isArray(i)){for(i=i.slice(),e=0,o=i.length;o>e;e++)this.set_icon(i[e],r);return!0}return i=this.get_node(i),i&&"#"!==i.id?(u=i.icon,i.icon=r===!0||null===r||r===t||""===r?!0:r,f=this.get_node(i,!0).children(".jstree-anchor").children(".jstree-themeicon"),r===!1?this.hide_icon(i):r===!0||null===r||r===t||""===r?(f.removeClass("jstree-themeicon-custom "+u).css("background","").removeAttr("rel"),u===!1&&this.show_icon(i)):-1===r.indexOf("/")&&-1===r.indexOf(".")?(f.removeClass(u).css("background",""),f.addClass(r+" jstree-themeicon-custom").attr("rel",r),u===!1&&this.show_icon(i)):(f.removeClass(u).css("background",""),f.addClass("jstree-themeicon-custom").css("background","url('"+r+"') center center no-repeat").attr("rel",r),u===!1&&this.show_icon(i)),!0):!1},get_icon:function(n){return n=this.get_node(n),n&&"#"!==n.id?n.icon:!1},hide_icon:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;r>i;i++)this.hide_icon(t[i]);return!0}return t=this.get_node(t),t&&"#"!==t?(t.icon=!1,this.get_node(t,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0):!1},show_icon:function(t){var i,u,r;if(n.isArray(t)){for(t=t.slice(),i=0,u=t.length;u>i;i++)this.show_icon(t[i]);return!0}return t=this.get_node(t),t&&"#"!==t?(r=this.get_node(t,!0),t.icon=r.length?r.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"):!0,t.icon||(t.icon=!0),r.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0):!1}},n.vakata={},n.vakata.attributes=function(t,i){t=n(t)[0];var r=i?{}:[];return t&&t.attributes&&n.each(t.attributes,function(t,u){-1===n.inArray(u.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==u.value&&""!==n.trim(u.value)&&(i?r[u.name]=u.value:r.push(u.name))}),r},n.vakata.array_unique=function(n){for(var r=[],f={},i=0,u=n.length;u>i;i++)f[n[i]]===t&&(r.push(n[i]),f[n[i]]=!0);return r},n.vakata.array_remove=function(n,t,i){var r=n.slice((i||t)+1||n.length);return n.length=0>t?n.length+t:t,n.push.apply(n,r),n},n.vakata.array_remove_item=function(t,i){var r=n.inArray(i,t);return-1!==r?n.vakata.array_remove(t,r):t},c=i.createElement("I"),c.className="jstree-icon jstree-checkbox",c.setAttribute("role","presentation"),n.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0,cascade:"",tie_selection:!0},n.jstree.plugins.checkbox=function(i,r){this.bind=function(){r.bind.call(this);this._data.checkbox.uto=!1;this._data.checkbox.selected=[];this.settings.checkbox.three_state&&(this.settings.checkbox.cascade="up+down+undetermined");this.element.on("init.jstree",n.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible;this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked");this.settings.checkbox.tie_selection&&this.element.addClass("jstree-checkbox-selection")},this)).on("loading.jstree",n.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this));-1!==this.settings.checkbox.cascade.indexOf("undetermined")&&this.element.on("changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",n.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto);this._data.checkbox.uto=setTimeout(n.proxy(this._undetermined,this),50)},this));this.settings.checkbox.tie_selection||this.element.on("model.jstree",n.proxy(function(n,t){for(var u=this._model.data,e=u[t.parent],r=t.nodes,i=0,f=r.length;f>i;i++)u[r[i]].state.checked=u[r[i]].original&&u[r[i]].original.state&&u[r[i]].original.state.checked,u[r[i]].state.checked&&this._data.checkbox.selected.push(r[i])},this));(-1!==this.settings.checkbox.cascade.indexOf("up")||-1!==this.settings.checkbox.cascade.indexOf("down"))&&this.element.on("model.jstree",n.proxy(function(t,i){var e=this._model.data,u=e[i.parent],s=i.nodes,c=[],v,r,o,h,l,a,y=this.settings.checkbox.cascade,f=this.settings.checkbox.tie_selection;if(-1!==y.indexOf("down"))if(u.state[f?"selected":"checked"]){for(r=0,o=s.length;o>r;r++)e[s[r]].state[f?"selected":"checked"]=!0;this._data[f?"core":"checkbox"].selected=this._data[f?"core":"checkbox"].selected.concat(s)}else for(r=0,o=s.length;o>r;r++)if(e[s[r]].state[f?"selected":"checked"]){for(h=0,l=e[s[r]].children_d.length;l>h;h++)e[e[s[r]].children_d[h]].state[f?"selected":"checked"]=!0;this._data[f?"core":"checkbox"].selected=this._data[f?"core":"checkbox"].selected.concat(e[s[r]].children_d)}if(-1!==y.indexOf("up")){for(r=0,o=u.children_d.length;o>r;r++)e[u.children_d[r]].children.length||c.push(e[u.children_d[r]].parent);for(c=n.vakata.array_unique(c),h=0,l=c.length;l>h;h++)for(u=e[c[h]];u&&"#"!==u.id;){for(v=0,r=0,o=u.children.length;o>r;r++)v+=e[u.children[r]].state[f?"selected":"checked"];if(v!==o)break;u.state[f?"selected":"checked"]=!0;this._data[f?"core":"checkbox"].selected.push(u.id);a=this.get_node(u,!0);a&&a.length&&a.attr("aria-selected",!0).children(".jstree-anchor").addClass(f?"jstree-clicked":"jstree-checked");u=this.get_node(u.parent)}}this._data[f?"core":"checkbox"].selected=n.vakata.array_unique(this._data[f?"core":"checkbox"].selected)},this)).on(this.settings.checkbox.tie_selection?"select_node.jstree":"check_node.jstree",n.proxy(function(t,i){var o=i.node,l=this._model.data,u=this.get_node(o.parent),a=this.get_node(o,!0),f,s,h,r,c=this.settings.checkbox.cascade,e=this.settings.checkbox.tie_selection;if(-1!==c.indexOf("down"))for(this._data[e?"core":"checkbox"].selected=n.vakata.array_unique(this._data[e?"core":"checkbox"].selected.concat(o.children_d)),f=0,s=o.children_d.length;s>f;f++)r=l[o.children_d[f]],r.state[e?"selected":"checked"]=!0,r&&r.original&&r.original.state&&r.original.state.undetermined&&(r.original.state.undetermined=!1);if(-1!==c.indexOf("up"))while(u&&"#"!==u.id){for(h=0,f=0,s=u.children.length;s>f;f++)h+=l[u.children[f]].state[e?"selected":"checked"];if(h!==s)break;u.state[e?"selected":"checked"]=!0;this._data[e?"core":"checkbox"].selected.push(u.id);r=this.get_node(u,!0);r&&r.length&&r.attr("aria-selected",!0).children(".jstree-anchor").addClass(e?"jstree-clicked":"jstree-checked");u=this.get_node(u.parent)}-1!==c.indexOf("down")&&a.length&&a.find(".jstree-anchor").addClass(e?"jstree-clicked":"jstree-checked").parent().attr("aria-selected",!0)},this)).on(this.settings.checkbox.tie_selection?"deselect_all.jstree":"uncheck_all.jstree",n.proxy(function(){for(var i=this.get_node("#"),u=this._model.data,n,t=0,r=i.children_d.length;r>t;t++)n=u[i.children_d[t]],n&&n.original&&n.original.state&&n.original.state.undetermined&&(n.original.state.undetermined=!1)},this)).on(this.settings.checkbox.tie_selection?"deselect_node.jstree":"uncheck_node.jstree",n.proxy(function(t,i){var f=i.node,h=this.get_node(f,!0),u,o,r,s=this.settings.checkbox.cascade,e=this.settings.checkbox.tie_selection;if(f&&f.original&&f.original.state&&f.original.state.undetermined&&(f.original.state.undetermined=!1),-1!==s.indexOf("down"))for(u=0,o=f.children_d.length;o>u;u++)r=this._model.data[f.children_d[u]],r.state[e?"selected":"checked"]=!1,r&&r.original&&r.original.state&&r.original.state.undetermined&&(r.original.state.undetermined=!1);if(-1!==s.indexOf("up"))for(u=0,o=f.parents.length;o>u;u++)r=this._model.data[f.parents[u]],r.state[e?"selected":"checked"]=!1,r&&r.original&&r.original.state&&r.original.state.undetermined&&(r.original.state.undetermined=!1),r=this.get_node(f.parents[u],!0),r&&r.length&&r.attr("aria-selected",!1).children(".jstree-anchor").removeClass(e?"jstree-clicked":"jstree-checked");for(r=[],u=0,o=this._data[e?"core":"checkbox"].selected.length;o>u;u++)-1!==s.indexOf("down")&&-1!==n.inArray(this._data[e?"core":"checkbox"].selected[u],f.children_d)||-1!==s.indexOf("up")&&-1!==n.inArray(this._data[e?"core":"checkbox"].selected[u],f.parents)||r.push(this._data[e?"core":"checkbox"].selected[u]);this._data[e?"core":"checkbox"].selected=n.vakata.array_unique(r);-1!==s.indexOf("down")&&h.length&&h.find(".jstree-anchor").removeClass(e?"jstree-clicked":"jstree-checked").parent().attr("aria-selected",!1)},this));-1!==this.settings.checkbox.cascade.indexOf("up")&&this.element.on("delete_node.jstree",n.proxy(function(n,t){for(var i=this.get_node(t.parent),s=this._model.data,r,e,o,u,f=this.settings.checkbox.tie_selection;i&&"#"!==i.id;){for(o=0,r=0,e=i.children.length;e>r;r++)o+=s[i.children[r]].state[f?"selected":"checked"];if(o!==e)break;i.state[f?"selected":"checked"]=!0;this._data[f?"core":"checkbox"].selected.push(i.id);u=this.get_node(i,!0);u&&u.length&&u.attr("aria-selected",!0).children(".jstree-anchor").addClass(f?"jstree-clicked":"jstree-checked");i=this.get_node(i.parent)}},this)).on("move_node.jstree",n.proxy(function(t,i){var c=i.is_multi,l=i.old_parent,a=this.get_node(i.parent),h=this._model.data,r,o,e,s,f,u=this.settings.checkbox.tie_selection;if(!c)for(r=this.get_node(l);r&&"#"!==r.id;){for(o=0,e=0,s=r.children.length;s>e;e++)o+=h[r.children[e]].state[u?"selected":"checked"];if(o!==s)break;r.state[u?"selected":"checked"]=!0;this._data[u?"core":"checkbox"].selected.push(r.id);f=this.get_node(r,!0);f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass(u?"jstree-clicked":"jstree-checked");r=this.get_node(r.parent)}for(r=a;r&&"#"!==r.id;){for(o=0,e=0,s=r.children.length;s>e;e++)o+=h[r.children[e]].state[u?"selected":"checked"];if(o===s)r.state[u?"selected":"checked"]||(r.state[u?"selected":"checked"]=!0,this._data[u?"core":"checkbox"].selected.push(r.id),f=this.get_node(r,!0),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass(u?"jstree-clicked":"jstree-checked"));else{if(!r.state[u?"selected":"checked"])break;r.state[u?"selected":"checked"]=!1;this._data[u?"core":"checkbox"].selected=n.vakata.array_remove_item(this._data[u?"core":"checkbox"].selected,r.id);f=this.get_node(r,!0);f&&f.length&&f.attr("aria-selected",!1).children(".jstree-anchor").removeClass(u?"jstree-clicked":"jstree-checked")}r=this.get_node(r.parent)}},this))};this._undetermined=function(){if(null!==this.element){for(var n,s,u={},f=this._model.data,h=this.settings.checkbox.tie_selection,r=this._data[h?"core":"checkbox"].selected,e=[],c=this,i=0,o=r.length;o>i;i++)if(f[r[i]]&&f[r[i]].parents)for(n=0,s=f[r[i]].parents.length;s>n;n++)u[f[r[i]].parents[n]]===t&&"#"!==f[r[i]].parents[n]&&(u[f[r[i]].parents[n]]=!0,e.push(f[r[i]].parents[n]));for(this.element.find(".jstree-closed").not(":has(.jstree-children)").each(function(){var r=c.get_node(this),h;if(r.state.loaded){for(i=0,o=r.children_d.length;o>i;i++)if(h=f[r.children_d[i]],!h.state.loaded&&h.original&&h.original.state&&h.original.state.undetermined&&h.original.state.undetermined===!0)for(u[h.id]===t&&"#"!==h.id&&(u[h.id]=!0,e.push(h.id)),n=0,s=h.parents.length;s>n;n++)u[h.parents[n]]===t&&"#"!==h.parents[n]&&(u[h.parents[n]]=!0,e.push(h.parents[n]))}else if(r.original&&r.original.state&&r.original.state.undetermined&&r.original.state.undetermined===!0)for(u[r.id]===t&&"#"!==r.id&&(u[r.id]=!0,e.push(r.id)),n=0,s=r.parents.length;s>n;n++)u[r.parents[n]]===t&&"#"!==r.parents[n]&&(u[r.parents[n]]=!0,e.push(r.parents[n]))}),this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),i=0,o=e.length;o>i;i++)f[e[i]].state[h?"selected":"checked"]||(r=this.get_node(e[i],!0),r&&r.length&&r.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined"))}};this.redraw_node=function(t,i,u){if(t=r.redraw_node.apply(this,arguments)){for(var e=null,f=0,o=t.childNodes.length;o>f;f++)if(t.childNodes[f]&&t.childNodes[f].className&&-1!==t.childNodes[f].className.indexOf("jstree-anchor")){e=t.childNodes[f];break}e&&(!this.settings.checkbox.tie_selection&&this._model.data[t.id].state.checked&&(e.className+=" jstree-checked"),e.insertBefore(c.cloneNode(!1),e.childNodes[0]))}return u||-1===this.settings.checkbox.cascade.indexOf("undetermined")||(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(n.proxy(this._undetermined,this),50)),t};this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0;this.get_container_ul().removeClass("jstree-no-checkboxes")};this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1;this.get_container_ul().addClass("jstree-no-checkboxes")};this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()};this.is_undetermined=function(t){t=this.get_node(t);var r=this.settings.checkbox.cascade,i,u,f=this.settings.checkbox.tie_selection,o=this._data[f?"core":"checkbox"].selected,e=this._model.data;if(!t||t.state[f?"selected":"checked"]===!0||-1===r.indexOf("undetermined")||-1===r.indexOf("down")&&-1===r.indexOf("up"))return!1;if(!t.state.loaded&&t.original.state.undetermined===!0)return!0;for(i=0,u=t.children_d.length;u>i;i++)if(-1!==n.inArray(t.children_d[i],o)||!e[t.children_d[i]].state.loaded&&e[t.children_d[i]].original.state.undetermined)return!0;return!1};this.activate_node=function(t,i){return this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||n(i.target).hasClass("jstree-checkbox"))&&(i.ctrlKey=!0),this.settings.checkbox.tie_selection||!this.settings.checkbox.whole_node&&!n(i.target).hasClass("jstree-checkbox")?r.activate_node.call(this,t,i):this.is_disabled(t)?!1:(this.is_checked(t)?this.uncheck_node(t,i):this.check_node(t,i),void this.trigger("activate_node",{node:this.get_node(t)}))};this.check_node=function(t,i){if(this.settings.checkbox.tie_selection)return this.select_node(t,!1,!0,i);var r,u,f;if(n.isArray(t)){for(t=t.slice(),u=0,f=t.length;f>u;u++)this.check_node(t[u],i);return!0}return t=this.get_node(t),t&&"#"!==t.id?(r=this.get_node(t,!0),void(t.state.checked||(t.state.checked=!0,this._data.checkbox.selected.push(t.id),r&&r.length&&r.children(".jstree-anchor").addClass("jstree-checked"),this.trigger("check_node",{node:t,selected:this._data.checkbox.selected,event:i})))):!1};this.uncheck_node=function(t,i){if(this.settings.checkbox.tie_selection)return this.deselect_node(t,!1,i);var r,f,u;if(n.isArray(t)){for(t=t.slice(),r=0,f=t.length;f>r;r++)this.uncheck_node(t[r],i);return!0}return t=this.get_node(t),t&&"#"!==t.id?(u=this.get_node(t,!0),void(t.state.checked&&(t.state.checked=!1,this._data.checkbox.selected=n.vakata.array_remove_item(this._data.checkbox.selected,t.id),u.length&&u.children(".jstree-anchor").removeClass("jstree-checked"),this.trigger("uncheck_node",{node:t,selected:this._data.checkbox.selected,event:i})))):!1};this.check_all=function(){if(this.settings.checkbox.tie_selection)return this.select_all();var i=this._data.checkbox.selected.concat([]),n,t;for(this._data.checkbox.selected=this._model.data["#"].children_d.concat(),n=0,t=this._data.checkbox.selected.length;t>n;n++)this._model.data[this._data.checkbox.selected[n]]&&(this._model.data[this._data.checkbox.selected[n]].state.checked=!0);this.redraw(!0);this.trigger("check_all",{selected:this._data.checkbox.selected})};this.uncheck_all=function(){if(this.settings.checkbox.tie_selection)return this.deselect_all();for(var i=this._data.checkbox.selected.concat([]),n=0,t=this._data.checkbox.selected.length;t>n;n++)this._model.data[this._data.checkbox.selected[n]]&&(this._model.data[this._data.checkbox.selected[n]].state.checked=!1);this._data.checkbox.selected=[];this.element.find(".jstree-checked").removeClass("jstree-checked");this.trigger("uncheck_all",{selected:this._data.checkbox.selected,node:i})};this.is_checked=function(n){return this.settings.checkbox.tie_selection?this.is_selected(n):(n=this.get_node(n),n&&"#"!==n.id?n.state.checked:!1)};this.get_checked=function(t){return this.settings.checkbox.tie_selection?this.get_selected(t):t?n.map(this._data.checkbox.selected,n.proxy(function(n){return this.get_node(n)},this)):this._data.checkbox.selected};this.get_top_checked=function(t){if(this.settings.checkbox.tie_selection)return this.get_top_selected(t);for(var r=this.get_checked(!0),u={},f,o,i=0,e=r.length;e>i;i++)u[r[i].id]=r[i];for(i=0,e=r.length;e>i;i++)for(f=0,o=r[i].children_d.length;o>f;f++)u[r[i].children_d[f]]&&delete u[r[i].children_d[f]];r=[];for(i in u)u.hasOwnProperty(i)&&r.push(i);return t?n.map(r,n.proxy(function(n){return this.get_node(n)},this)):r};this.get_bottom_checked=function(t){if(this.settings.checkbox.tie_selection)return this.get_bottom_selected(t);for(var r=this.get_checked(!0),u=[],i=0,f=r.length;f>i;i++)r[i].children.length||u.push(r[i].id);return t?n.map(u,n.proxy(function(n){return this.get_node(n)},this)):u};this.load_node=function(t){var u,f,e,i;if(!n.isArray(t)&&!this.settings.checkbox.tie_selection&&(i=this.get_node(t),i&&i.state.loaded))for(u=0,f=i.children_d.length;f>u;u++)this._model.data[i.children_d[u]].state.checked&&(e=!0,this._data.checkbox.selected=n.vakata.array_remove_item(this._data.checkbox.selected,i.children_d[u]));return r.load_node.apply(this,arguments)};this.get_state=function(){var n=r.get_state.apply(this,arguments);return this.settings.checkbox.tie_selection?n:(n.checkbox=this._data.checkbox.selected.slice(),n)};this.set_state=function(t,i){var u=r.set_state.apply(this,arguments),f;return u&&t.checkbox?(this.settings.checkbox.tie_selection||(this.uncheck_all(),f=this,n.each(t.checkbox,function(n,t){f.check_node(t)})),delete t.checkbox,this.set_state(t,i),!1):u}},n.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.create_node(r,{},"last",function(n){setTimeout(function(){i.edit(n)},0)})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.edit(r)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.delete_node(i.is_selected(r)?i.get_selected():r)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.cut(i.is_selected(r)?i.get_top_selected():r)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.copy(i.is_selected(r)?i.get_top_selected():r)}},paste:{separator_before:!1,icon:!1,_disabled:function(t){return!n.jstree.reference(t.reference).can_paste()},separator_after:!1,label:"Paste",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.paste(r)}}}}}}},n.jstree.plugins.contextmenu=function(r,u){this.bind=function(){u.bind.call(this);var r=0,t=null,f,e;this.element.on("contextmenu.jstree",".jstree-anchor",n.proxy(function(n,i){n.preventDefault();r=n.ctrlKey?+new Date:0;(i||t)&&(r=+new Date+1e4);t&&clearTimeout(t);this.is_loading(n.currentTarget)||this.show_contextmenu(n.currentTarget,n.pageX,n.pageY,n)},this)).on("click.jstree",".jstree-anchor",n.proxy(function(){this._data.contextmenu.visible&&(!r||+new Date-r>250)&&n.vakata.context.hide();r=0},this)).on("touchstart.jstree",".jstree-anchor",function(i){i.originalEvent&&i.originalEvent.changedTouches&&i.originalEvent.changedTouches[0]&&(f=i.pageX,e=i.pageY,t=setTimeout(function(){n(i.currentTarget).trigger("contextmenu",!0)},750))}).on("touchmove.vakata.jstree",function(n){t&&n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]&&(Math.abs(f-n.pageX)>50||Math.abs(e-n.pageY)>50)&&clearTimeout(t)}).on("touchend.vakata.jstree",function(){t&&clearTimeout(t)});n(i).on("context_hide.vakata.jstree",n.proxy(function(){this._data.contextmenu.visible=!1},this))};this.teardown=function(){this._data.contextmenu.visible&&n.vakata.context.hide();u.teardown.call(this)};this.show_contextmenu=function(i,r,u,f){if(i=this.get_node(i),!i||"#"===i.id)return!1;var s=this.settings.contextmenu,h=this.get_node(i,!0),c=h.children(".jstree-anchor"),o=!1,e=!1;(s.show_at_node||r===t||u===t)&&(o=c.offset(),r=o.left,u=o.top+this._data.core.li_height);this.settings.contextmenu.select_node&&!this.is_selected(i)&&this.activate_node(i,f);e=s.items;n.isFunction(e)&&(e=e.call(this,i,n.proxy(function(n){this._show_contextmenu(i,r,u,n)},this)));n.isPlainObject(e)&&this._show_contextmenu(i,r,u,e)};this._show_contextmenu=function(t,r,u,f){var e=this.get_node(t,!0),o=e.children(".jstree-anchor");n(i).one("context_show.vakata.jstree",n.proxy(function(t,i){var r="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";n(i.element).addClass(r)},this));this._data.contextmenu.visible=!0;n.vakata.context.show(o,{x:r,y:u},f);this.trigger("show_contextmenu",{node:t,x:r,y:u})}},function(n){var r=!1,t={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};n.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(r){n(i).triggerHandler("context_"+r+".vakata",{reference:t.reference,element:t.element,position:{x:t.position_x,y:t.position_y}})},_execute:function(i){return i=t.items[i],i&&(!i._disabled||n.isFunction(i._disabled)&&!i._disabled({item:i,reference:t.reference,element:t.element}))&&i.action?i.action.call(null,{item:i,reference:t.reference,element:t.element,position:{x:t.position_x,y:t.position_y}}):!1},_parse:function(i,r){if(!i)return!1;r||(t.html="",t.items=[]);var u="",f=!1,e;return r&&(u+="<ul>"),n.each(i,function(i,r){return r?(t.items.push(r),!f&&r.separator_before&&(u+="<li class='vakata-context-separator'><a href='#' "+(n.vakata.context.settings.icons?"":'style="margin-left:0px;"')+">&#160;<\/a><\/li>"),f=!1,u+="<li class='"+(r._class||"")+(r._disabled===!0||n.isFunction(r._disabled)&&r._disabled({item:r,reference:t.reference,element:t.element})?" vakata-contextmenu-disabled ":"")+"' "+(r.shortcut?" data-shortcut='"+r.shortcut+"' ":"")+">",u+="<a href='#' rel='"+(t.items.length-1)+"'>",n.vakata.context.settings.icons&&(u+="<i ",r.icon&&(u+=-1!==r.icon.indexOf("/")||-1!==r.icon.indexOf(".")?" style='background:url(\""+r.icon+"\") center center no-repeat' ":" class='"+r.icon+"' "),u+="><\/i><span class='vakata-contextmenu-sep'>&#160;<\/span>"),u+=(n.isFunction(r.label)?r.label({item:i,reference:t.reference,element:t.element}):r.label)+(r.shortcut?' <span class="vakata-contextmenu-shortcut vakata-contextmenu-shortcut-'+r.shortcut+'">'+(r.shortcut_label||"")+"<\/span>":"")+"<\/a>",r.submenu&&(e=n.vakata.context._parse(r.submenu,!0),e&&(u+=e)),u+="<\/li>",void(r.separator_after&&(u+="<li class='vakata-context-separator'><a href='#' "+(n.vakata.context.settings.icons?"":'style="margin-left:0px;"')+">&#160;<\/a><\/li>",f=!0))):!0}),u=u.replace(/<li class\='vakata-context-separator'\><\/li\>$/,""),r&&(u+="<\/ul>"),r||(t.html=u,n.vakata.context._trigger("parse")),u.length>10?u:!1},_show_submenu:function(t){if(t=n(t),t.length&&t.children("ul").length){var i=t.children("ul"),u=t.offset().left+t.outerWidth(),e=t.offset().top,f=i.width(),o=i.height(),s=n(window).width()+n(window).scrollLeft(),h=n(window).height()+n(window).scrollTop();r?t[u-(f+10+t.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):t[u+f+10>s?"addClass":"removeClass"]("vakata-context-right");e+o+10>h&&i.css("bottom","-1px");i.show()}},show:function(i,u,f){var h,o,e,s,c,l,a,v;switch(t.element&&t.element.length&&t.element.width(""),!0){case!u&&!i:return!1;case!!u&&!!i:t.reference=i;t.position_x=u.x;t.position_y=u.y;break;case!u&&!!i:t.reference=i;h=i.offset();t.position_x=h.left+i.outerHeight();t.position_y=h.top;break;case!!u&&!i:t.position_x=u.x;t.position_y=u.y}i&&!f&&n(i).data("vakata_contextmenu")&&(f=n(i).data("vakata_contextmenu"));n.vakata.context._parse(f)&&t.element.html(t.html);t.items.length&&(t.element.appendTo("body"),o=t.element,e=t.position_x,s=t.position_y,c=o.width(),l=o.height(),a=n(window).width()+n(window).scrollLeft(),v=n(window).height()+n(window).scrollTop(),r&&(e-=o.outerWidth()-n(i).outerWidth(),e<n(window).scrollLeft()+20&&(e=n(window).scrollLeft()+20)),e+c+20>a&&(e=a-(c+20)),s+l+20>v&&(s=v-(l+20)),t.element.css({left:e,top:s}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),t.is_visible=!0,n.vakata.context._trigger("show"))},hide:function(){t.is_visible&&(t.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),t.is_visible=!1,n.vakata.context._trigger("hide"))}};n(function(){r="rtl"===n("body").css("direction");var u=!1;t.element=n("<ul class='vakata-context'><\/ul>");t.element.on("mouseenter","li",function(i){i.stopImmediatePropagation();n.contains(this,i.relatedTarget)||(u&&clearTimeout(u),t.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),n(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),n.vakata.context._show_submenu(this))}).on("mouseleave","li",function(t){n.contains(this,t.relatedTarget)||n(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(){n(this).find(".vakata-context-hover").removeClass("vakata-context-hover");n.vakata.context.settings.hide_onmouseleave&&(u=setTimeout(function(){return function(){n.vakata.context.hide()}}(this),n.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(t){t.preventDefault();n(this).blur().parent().hasClass("vakata-context-disabled")||n.vakata.context._execute(n(this).attr("rel"))===!1||n.vakata.context.hide()}).on("keydown","a",function(i){var r=null;switch(i.which){case 13:case 32:i.type="mouseup";i.preventDefault();n(i.currentTarget).trigger(i);break;case 37:t.is_visible&&(t.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 38:t.is_visible&&(r=t.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),r.length||(r=t.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),r.addClass("vakata-context-hover").children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 39:t.is_visible&&(t.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 40:t.is_visible&&(r=t.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),r.length||(r=t.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),r.addClass("vakata-context-hover").children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 27:n.vakata.context.hide();i.preventDefault()}}).on("keydown",function(n){n.preventDefault();var i=t.element.find(".vakata-contextmenu-shortcut-"+n.which).parent();i.parent().not(".vakata-context-disabled")&&i.click()});n(i).on("mousedown.vakata.jstree",function(i){t.is_visible&&!n.contains(t.element[0],i.target)&&n.vakata.context.hide()}).on("context_show.vakata.jstree",function(){t.element.find("li:has(ul)").children("a").addClass("vakata-context-parent");r&&t.element.addClass("vakata-context-rtl").css("direction","rtl");t.element.find("ul").hide().end()})})}(n),n.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0,large_drop_target:!1,large_drag_target:!1},n.jstree.plugins.dnd=function(t,i){this.bind=function(){i.bind.call(this);this.element.on("mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",n.proxy(function(t){if(this.settings.dnd.large_drag_target&&n(t.target).closest(".jstree-node")[0]!==t.currentTarget||"touchstart"===t.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var i=this.get_node(t.target),r=this.is_selected(i)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,u=r>1?r+" "+this.get_string("nodes"):this.get_text(t.currentTarget);return this.settings.core.force_text&&(u=n.vakata.html.escape(u)),i&&i.id&&"#"!==i.id&&(1===t.which||"touchstart"===t.type)&&(this.settings.dnd.is_draggable===!0||n.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,r>1?this.get_top_selected(!0):[i]))?(this.element.trigger("mousedown.jstree"),n.vakata.dnd.start(t,{jstree:!0,origin:this,obj:this.get_node(i,!0),nodes:r>1?this.get_top_selected():[i.id]},'<div id="jstree-dnd" class="jstree-'+this.get_theme()+" jstree-"+this.get_theme()+"-"+this.get_theme_variant()+" "+(this.settings.core.themes.responsive?" jstree-dnd-responsive":"")+'"><i class="jstree-icon jstree-er"><\/i>'+u+'<ins class="jstree-copy" style="display:none;">+<\/ins><\/div>')):void 0},this))}},n(function(){var t=!1,u=!1,f=!1,r=n('<div id="jstree-marker">&#160;<\/div>').hide();n(i).on("dnd_start.vakata.jstree",function(n,i){t=!1;i&&i.data&&i.data.jstree&&r.appendTo("body")}).on("dnd_move.vakata.jstree",function(i,e){if(f&&clearTimeout(f),e&&e.data&&e.data.jstree&&(!e.event.target.id||"jstree-marker"!==e.event.target.id)){var o=n.jstree.reference(e.event.target),s=!1,l=!1,b=!1,k,d,a,v,y,g,c,h,nt,it,tt,rt,p,w;if(o&&o._data&&o._data.dnd)if(r.attr("class","jstree-"+o.get_theme()+(o.settings.core.themes.responsive?" jstree-dnd-responsive":"")),e.helper.children().attr("class","jstree-"+o.get_theme()+" jstree-"+o.get_theme()+"-"+o.get_theme_variant()+" "+(o.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[e.data.origin&&(e.data.origin.settings.dnd.always_copy||e.data.origin.settings.dnd.copy&&(e.event.metaKey||e.event.ctrlKey))?"show":"hide"](),e.event.target!==o.element[0]&&e.event.target!==o.get_container_ul()[0]||0!==o.get_container_ul().children().length){if(s=o.settings.dnd.large_drop_target?n(e.event.target).closest(".jstree-node").children(".jstree-anchor"):n(e.event.target).closest(".jstree-anchor"),s&&s.length&&s.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(l=s.offset(),b=e.event.pageY-l.top,a=s.outerHeight(),g=a/3>b?["b","i","a"]:b>a-a/3?["a","i","b"]:b>a/2?["i","a","b"]:["i","b","a"],n.each(g,function(i,b){switch(b){case"b":k=l.left-6;d=l.top;v=o.get_parent(s);y=s.parent().index();break;case"i":p=o.settings.dnd.inside_pos;w=o.get_node(s.parent());k=l.left-2;d=l.top+a/2+1;v=w.id;y="first"===p?0:"last"===p?w.children.length:Math.min(p,w.children.length);break;case"a":k=l.left-6;d=l.top+a;v=o.get_parent(s);y=s.parent().index()+1}for(c=!0,h=0,nt=e.data.nodes.length;nt>h;h++)if(it=e.data.origin&&(e.data.origin.settings.dnd.always_copy||e.data.origin.settings.dnd.copy&&(e.event.metaKey||e.event.ctrlKey))?"copy_node":"move_node",tt=y,"move_node"===it&&"a"===b&&e.data.origin&&e.data.origin===o&&v===o.get_parent(e.data.nodes[h])&&(rt=o.get_node(v),tt>n.inArray(e.data.nodes[h],rt.children)&&(tt-=1)),c=c&&(o&&o.settings&&o.settings.dnd&&o.settings.dnd.check_while_dragging===!1||o.check(it,e.data.origin&&e.data.origin!==o?e.data.origin.get_node(e.data.nodes[h]):e.data.nodes[h],v,tt,{dnd:!0,ref:o.get_node(s.parent()),pos:b,origin:e.data.origin,is_multi:e.data.origin&&e.data.origin!==o,is_foreign:!e.data.origin})),!c){o&&o.last_error&&(u=o.last_error());break}return"i"===b&&s.parent().is(".jstree-closed")&&o.settings.dnd.open_timeout&&(f=setTimeout(function(n,t){return function(){n.open_node(t)}}(o,s),o.settings.dnd.open_timeout)),c?(t={ins:o,par:v,pos:"i"!==b||"last"!==p||0!==y||o.is_loaded(w)?y:"last"},r.css({left:k+"px",top:d+"px"}).show(),e.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),u={},g=!0,!1):void 0}),g===!0))return}else{for(c=!0,h=0,nt=e.data.nodes.length;nt>h;h++)if(c=c&&o.check(e.data.origin&&(e.data.origin.settings.dnd.always_copy||e.data.origin.settings.dnd.copy&&(e.event.metaKey||e.event.ctrlKey))?"copy_node":"move_node",e.data.origin&&e.data.origin!==o?e.data.origin.get_node(e.data.nodes[h]):e.data.nodes[h],"#","last",{dnd:!0,ref:o.get_node("#"),pos:"i",origin:e.data.origin,is_multi:e.data.origin&&e.data.origin!==o,is_foreign:!e.data.origin}),!c)break;if(c)return t={ins:o,par:"#",pos:"last"},r.hide(),void e.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok")}t=!1;e.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er");r.hide()}}).on("dnd_scroll.vakata.jstree",function(n,i){i&&i.data&&i.data.jstree&&(r.hide(),t=!1,i.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er"))}).on("dnd_stop.vakata.jstree",function(i,e){if(f&&clearTimeout(f),e&&e.data&&e.data.jstree){r.hide().detach();var o,s,h=[];if(t){for(o=0,s=e.data.nodes.length;s>o;o++)h[o]=e.data.origin?e.data.origin.get_node(e.data.nodes[o]):e.data.nodes[o];t.ins[e.data.origin&&(e.data.origin.settings.dnd.always_copy||e.data.origin.settings.dnd.copy&&(e.event.metaKey||e.event.ctrlKey))?"copy_node":"move_node"](h,t.par,t.pos,!1,!1,!1,e.data.origin)}else o=n(e.event.target).closest(".jstree"),o.length&&u&&u.error&&"check"===u.error&&(o=o.jstree(!0),o&&o.settings.core.error.call(this,u))}}).on("keyup.jstree keydown.jstree",function(t,i){i=n.vakata.dnd._get();i&&i.data&&i.data.jstree&&i.helper.find(".jstree-copy").first()[i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(t.metaKey||t.ctrlKey))?"show":"hide"]()})}),function(n){n.vakata.html={div:n("<div />"),escape:function(t){return n.vakata.html.div.text(t).html()},strip:function(t){return n.vakata.html.div.empty().append(n.parseHTML(t)).text()}};var t={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};n.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:50},_trigger:function(t,r){var u=n.vakata.dnd._get();u.event=r;n(i).triggerHandler("dnd_"+t+".vakata",u)},_get:function(){return{data:t.data,element:t.element,helper:t.helper}},_clean:function(){t.helper&&t.helper.remove();t.scroll_i&&(clearInterval(t.scroll_i),t.scroll_i=!1);t={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};n(i).off("mousemove.vakata.jstree touchmove.vakata.jstree",n.vakata.dnd.drag);n(i).off("mouseup.vakata.jstree touchend.vakata.jstree",n.vakata.dnd.stop)},_scroll:function(i){if(!t.scroll_e||!t.scroll_l&&!t.scroll_t)return t.scroll_i&&(clearInterval(t.scroll_i),t.scroll_i=!1),!1;if(!t.scroll_i)return t.scroll_i=setInterval(n.vakata.dnd._scroll,100),!1;if(i===!0)return!1;var r=t.scroll_e.scrollTop(),u=t.scroll_e.scrollLeft();t.scroll_e.scrollTop(r+t.scroll_t*n.vakata.dnd.settings.scroll_speed);t.scroll_e.scrollLeft(u+t.scroll_l*n.vakata.dnd.settings.scroll_speed);(r!==t.scroll_e.scrollTop()||u!==t.scroll_e.scrollLeft())&&n.vakata.dnd._trigger("scroll",t.scroll_e)},start:function(r,u,f){"touchstart"===r.type&&r.originalEvent&&r.originalEvent.changedTouches&&r.originalEvent.changedTouches[0]&&(r.pageX=r.originalEvent.changedTouches[0].pageX,r.pageY=r.originalEvent.changedTouches[0].pageY,r.target=i.elementFromPoint(r.originalEvent.changedTouches[0].pageX-window.pageXOffset,r.originalEvent.changedTouches[0].pageY-window.pageYOffset));t.is_drag&&n.vakata.dnd.stop({});try{r.currentTarget.unselectable="on";r.currentTarget.onselectstart=function(){return!1};r.currentTarget.style&&(r.currentTarget.style.MozUserSelect="none")}catch(e){}return t.init_x=r.pageX,t.init_y=r.pageY,t.data=u,t.is_down=!0,t.element=r.currentTarget,t.target=r.target,t.is_touch="touchstart"===r.type,f!==!1&&(t.helper=n("<div id='vakata-dnd'><\/div>").html(f).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),n(i).on("mousemove.vakata.jstree touchmove.vakata.jstree",n.vakata.dnd.drag),n(i).on("mouseup.vakata.jstree touchend.vakata.jstree",n.vakata.dnd.stop),!1},drag:function(r){if("touchmove"===r.type&&r.originalEvent&&r.originalEvent.changedTouches&&r.originalEvent.changedTouches[0]&&(r.pageX=r.originalEvent.changedTouches[0].pageX,r.pageY=r.originalEvent.changedTouches[0].pageY,r.target=i.elementFromPoint(r.originalEvent.changedTouches[0].pageX-window.pageXOffset,r.originalEvent.changedTouches[0].pageY-window.pageYOffset)),t.is_down){if(!t.is_drag){if(!(Math.abs(r.pageX-t.init_x)>(t.is_touch?n.vakata.dnd.settings.threshold_touch:n.vakata.dnd.settings.threshold)||Math.abs(r.pageY-t.init_y)>(t.is_touch?n.vakata.dnd.settings.threshold_touch:n.vakata.dnd.settings.threshold)))return;t.helper&&(t.helper.appendTo("body"),t.helper_w=t.helper.outerWidth());t.is_drag=!0;n.vakata.dnd._trigger("start",r)}var u=!1,l=!1,f=!1,o=!1,e=!1,s=!1,a=!1,v=!1,h=!1,c=!1;return t.scroll_t=0,t.scroll_l=0,t.scroll_e=!1,n(n(r.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(n(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var u=n(this),i=u.offset();return this.scrollHeight>this.offsetHeight&&(i.top+u.height()-r.pageY<n.vakata.dnd.settings.scroll_proximity&&(t.scroll_t=1),r.pageY-i.top<n.vakata.dnd.settings.scroll_proximity&&(t.scroll_t=-1)),this.scrollWidth>this.offsetWidth&&(i.left+u.width()-r.pageX<n.vakata.dnd.settings.scroll_proximity&&(t.scroll_l=1),r.pageX-i.left<n.vakata.dnd.settings.scroll_proximity&&(t.scroll_l=-1)),t.scroll_t||t.scroll_l?(t.scroll_e=n(this),!1):void 0}),t.scroll_e||(u=n(i),l=n(window),f=u.height(),o=l.height(),e=u.width(),s=l.width(),a=u.scrollTop(),v=u.scrollLeft(),f>o&&r.pageY-a<n.vakata.dnd.settings.scroll_proximity&&(t.scroll_t=-1),f>o&&o-(r.pageY-a)<n.vakata.dnd.settings.scroll_proximity&&(t.scroll_t=1),e>s&&r.pageX-v<n.vakata.dnd.settings.scroll_proximity&&(t.scroll_l=-1),e>s&&s-(r.pageX-v)<n.vakata.dnd.settings.scroll_proximity&&(t.scroll_l=1),(t.scroll_t||t.scroll_l)&&(t.scroll_e=u)),t.scroll_e&&n.vakata.dnd._scroll(!0),t.helper&&(h=parseInt(r.pageY+n.vakata.dnd.settings.helper_top,10),c=parseInt(r.pageX+n.vakata.dnd.settings.helper_left,10),f&&h+25>f&&(h=f-50),e&&c+t.helper_w>e&&(c=e-(t.helper_w+2)),t.helper.css({left:c+"px",top:h+"px"})),n.vakata.dnd._trigger("move",r),!1}},stop:function(r){if("touchend"===r.type&&r.originalEvent&&r.originalEvent.changedTouches&&r.originalEvent.changedTouches[0]&&(r.pageX=r.originalEvent.changedTouches[0].pageX,r.pageY=r.originalEvent.changedTouches[0].pageY,r.target=i.elementFromPoint(r.originalEvent.changedTouches[0].pageX-window.pageXOffset,r.originalEvent.changedTouches[0].pageY-window.pageYOffset)),t.is_drag)n.vakata.dnd._trigger("stop",r);else if("touchend"===r.type&&r.target===t.target){var u=setTimeout(function(){n(r.target).click()},100);n(r.target).one("click",function(){u&&clearTimeout(u)})}return n.vakata.dnd._clean(),!1}}}(n),n.jstree.defaults.massload=null,n.jstree.plugins.massload=function(t,i){this.init=function(n,t){i.init.call(this,n,t);this._data.massload={}};this._load_nodes=function(t,r,u){var f=this.settings.massload;return u&&!n.isEmptyObject(this._data.massload)?i._load_nodes.call(this,t,r,u):n.isFunction(f)?f.call(this,t,n.proxy(function(n){if(n)for(var f in n)n.hasOwnProperty(f)&&(this._data.massload[f]=n[f]);i._load_nodes.call(this,t,r,u)},this)):"object"==typeof f&&f&&f.url?(f=n.extend(!0,{},f),n.isFunction(f.url)&&(f.url=f.url.call(this,t)),n.isFunction(f.data)&&(f.data=f.data.call(this,t)),n.ajax(f).done(n.proxy(function(n){if(n)for(var f in n)n.hasOwnProperty(f)&&(this._data.massload[f]=n[f]);i._load_nodes.call(this,t,r,u)},this)).fail(n.proxy(function(){i._load_nodes.call(this,t,r,u)},this))):i._load_nodes.call(this,t,r,u)};this._load_node=function(t,r){var u=this._data.massload[t.id];return u?this["string"==typeof u?"_append_html_data":"_append_json_data"](t,"string"==typeof u?n(n.parseHTML(u)).filter(function(){return 3!==this.nodeType}):u,function(n){r.call(this,n);delete this._data.massload[t.id]}):i._load_node.call(this,t,r)}},n.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,show_only_matches_children:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},n.jstree.plugins.search=function(i,r){this.bind=function(){r.bind.call(this);this._data.search.str="";this._data.search.dom=n();this._data.search.res=[];this._data.search.opn=[];this._data.search.som=!1;this._data.search.smc=!1;this.element.on("before_open.jstree",n.proxy(function(){var r,f,i=this._data.search.res,t=[],u=n();if(i&&i.length&&(this._data.search.dom=n(this.element[0].querySelectorAll("#"+n.map(i,function(t){return-1!=="0123456789".indexOf(t[0])?"\\3"+t[0]+" "+t.substr(1).replace(n.jstree.idregex,"\\$&"):t.replace(n.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this._data.search.som&&this._data.search.res.length)){for(r=0,f=i.length;f>r;r++)t=t.concat(this.get_node(i[r]).parents);t=n.vakata.array_remove_item(n.vakata.array_unique(t),"#");u=t.length?n(this.element[0].querySelectorAll("#"+n.map(t,function(t){return-1!=="0123456789".indexOf(t[0])?"\\3"+t[0]+" "+t.substr(1).replace(n.jstree.idregex,"\\$&"):t.replace(n.jstree.idregex,"\\$&")}).join(", #"))):n();this.element.find(".jstree-node").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last");u=u.add(this._data.search.dom);this._data.search.smc&&this._data.search.dom.children(".jstree-children").find(".jstree-node").show();u.parentsUntil(".jstree").addBack().show().filter(".jstree-children").each(function(){n(this).children(".jstree-node:visible").eq(-1).addClass("jstree-last")})}},this)).on("search.jstree",n.proxy(function(t,i){this._data.search.som&&i.nodes.length&&(this.element.find(".jstree-node").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last"),this._data.search.smc&&i.nodes.children(".jstree-children").find(".jstree-node").show(),i.nodes.parentsUntil(".jstree").addBack().show().filter(".jstree-children").each(function(){n(this).children(".jstree-node:visible").eq(-1).addClass("jstree-last")}))},this)).on("clear_search.jstree",n.proxy(function(n,t){this._data.search.som&&t.nodes.length&&this.element.find(".jstree-node").css("display","").filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last")},this))};this.search=function(i,r,u,f,e,o){if(i===!1||""===n.trim(i.toString()))return this.clear_search();f=this.get_node(f);f=f&&f.id?f.id:null;i=i.toString();var h=this.settings.search,s=h.ajax?h.ajax:!1,a=this._model.data,v=null,c=[],l=[];return this._data.search.res.length&&!e&&this.clear_search(),u===t&&(u=h.show_only_matches),o===t&&(o=h.show_only_matches_children),r||s===!1?(e||(this._data.search.str=i,this._data.search.dom=n(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=u,this._data.search.smc=o),v=new n.vakata.search(i,!0,{caseSensitive:h.case_sensitive,fuzzy:h.fuzzy}),n.each(a[f?f:"#"].children_d,function(n,t){var r=a[t];r.text&&(h.search_callback&&h.search_callback.call(this,i,r)||!h.search_callback&&v.search(r.text).isMatch)&&(!h.search_leaves_only||r.state.loaded&&0===r.children.length)&&(c.push(t),l=l.concat(r.parents))}),c.length&&(l=n.vakata.array_unique(l),this._search_open(l),e?(this._data.search.dom=this._data.search.dom.add(n(this.element[0].querySelectorAll("#"+n.map(c,function(t){return-1!=="0123456789".indexOf(t[0])?"\\3"+t[0]+" "+t.substr(1).replace(n.jstree.idregex,"\\$&"):t.replace(n.jstree.idregex,"\\$&")}).join(", #")))),this._data.search.res=n.vakata.array_unique(this._data.search.res.concat(c))):(this._data.search.dom=n(this.element[0].querySelectorAll("#"+n.map(c,function(t){return-1!=="0123456789".indexOf(t[0])?"\\3"+t[0]+" "+t.substr(1).replace(n.jstree.idregex,"\\$&"):t.replace(n.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.res=c),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")),void this.trigger("search",{nodes:this._data.search.dom,str:i,res:this._data.search.res,show_only_matches:u})):n.isFunction(s)?s.call(this,i,n.proxy(function(t){t&&t.d&&(t=t.d);this._load_nodes(n.isArray(t)?n.vakata.array_unique(t):[],function(){this.search(i,!0,u,f,e)},!0)},this),f):(s=n.extend({},s),s.data||(s.data={}),s.data.str=i,f&&(s.data.inside=f),n.ajax(s).fail(n.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(s)};this.settings.core.error.call(this,this._data.core.last_error)},this)).done(n.proxy(function(t){t&&t.d&&(t=t.d);this._load_nodes(n.isArray(t)?n.vakata.array_unique(t):[],function(){this.search(i,!0,u,f,e)},!0)},this)))};this.clear_search=function(){this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search");this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0);this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res});this._data.search.str="";this._data.search.res=[];this._data.search.opn=[];this._data.search.dom=n()};this._search_open=function(t){var i=this;n.each(t.concat([]),function(r,u){if("#"===u)return!0;try{u=n("#"+u.replace(n.jstree.idregex,"\\$&"),i.element)}catch(f){}u&&u.length&&i.is_closed(u)&&(i._data.search.opn.push(u[0].id),i.open_node(u,function(){i._search_open(t)},0))})}},function(n){n.vakata.search=function(t,i,r){r=r||{};r=n.extend({},n.vakata.search.defaults,r);r.fuzzy!==!1&&(r.fuzzy=!0);t=r.caseSensitive?t:t.toLowerCase();var f=r.location,s=r.distance,l=r.threshold,u=t.length,h,c,e,o;return u>32&&(r.fuzzy=!1),r.fuzzy&&(h=1<<u-1,c=function(){for(var i={},n=0,n=0;u>n;n++)i[t.charAt(n)]=0;for(n=0;u>n;n++)i[t.charAt(n)]|=1<<u-n-1;return i}(),e=function(n,t){var i=n/u,r=Math.abs(f-t);return s?i+r/s:r?1:i}),o=function(n){if(n=r.caseSensitive?n:n.toLowerCase(),t===n||-1!==n.indexOf(t))return{isMatch:!0,score:0};if(!r.fuzzy)return{isMatch:!1,score:1};var a,i,tt=n.length,v=l,o=n.indexOf(t,f),p,s,w=u+tt,b,g,k,y,nt,d=1,it=[];for(-1!==o&&(v=Math.min(e(0,o),v),o=n.lastIndexOf(t,f+u),-1!==o&&(v=Math.min(e(0,o),v))),o=-1,a=0;u>a;a++){for(p=0,s=w;s>p;)e(a,f+s)<=v?p=s:w=s,s=Math.floor((w-p)/2+p);for(w=s,g=Math.max(1,f-s+1),k=Math.min(f+s,tt)+u,y=new Array(k+2),y[k+1]=(1<<a)-1,i=k;i>=g;i--)if(nt=c[n.charAt(i-1)],y[i]=0===a?(y[i+1]<<1|1)&nt:(y[i+1]<<1|1)&nt|(b[i+1]|b[i])<<1|1|b[i+1],y[i]&h&&(d=e(a,i-1),v>=d)){if(v=d,o=i-1,it.push(o),!(o>f))break;g=Math.max(1,2*f-o)}if(e(a+1,f)>v)break;b=y}return{isMatch:o>=0,score:d}},i===!0?{search:o}:o(i)};n.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1}}(n),n.jstree.defaults.sort=function(n,t){return this.get_text(n)>this.get_text(t)?1:-1},n.jstree.plugins.sort=function(t,i){this.bind=function(){i.bind.call(this);this.element.on("model.jstree",n.proxy(function(n,t){this.sort(t.parent,!0)},this)).on("rename_node.jstree create_node.jstree",n.proxy(function(n,t){this.sort(t.parent||t.node.parent,!1);this.redraw_node(t.parent||t.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",n.proxy(function(n,t){this.sort(t.parent,!1);this.redraw_node(t.parent,!0)},this))};this.sort=function(t,i){var r,u;if(t=this.get_node(t),t&&t.children&&t.children.length&&(t.children.sort(n.proxy(this.settings.sort,this)),i))for(r=0,u=t.children_d.length;u>r;r++)this.sort(t.children_d[r],!1)}},l=!1,n.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree",ttl:!1,filter:!1},n.jstree.plugins.state=function(t,i){this.bind=function(){i.bind.call(this);var t=n.proxy(function(){this.element.on(this.settings.state.events,n.proxy(function(){l&&clearTimeout(l);l=setTimeout(n.proxy(function(){this.save_state()},this),100)},this));this.trigger("state_ready")},this);this.element.on("ready.jstree",n.proxy(function(){this.element.one("restore_state.jstree",t);this.restore_state()||t()},this))};this.save_state=function(){var t={state:this.get_state(),ttl:this.settings.state.ttl,sec:+new Date};n.vakata.storage.set(this.settings.state.key,JSON.stringify(t))};this.restore_state=function(){var t=n.vakata.storage.get(this.settings.state.key);if(t)try{t=JSON.parse(t)}catch(i){return!1}return t&&t.ttl&&t.sec&&+new Date-t.sec>t.ttl?!1:(t&&t.state&&(t=t.state),t&&n.isFunction(this.settings.state.filter)&&(t=this.settings.state.filter.call(this,t)),t?(this.element.one("set_state.jstree",function(i,r){r.instance.trigger("restore_state",{state:n.extend(!0,{},t)})}),this.set_state(t),!0):!1)};this.clear_state=function(){return n.vakata.storage.del(this.settings.state.key)}},function(n){n.vakata.storage={set:function(n,t){return window.localStorage.setItem(n,t)},get:function(n){return window.localStorage.getItem(n)},del:function(n){return window.localStorage.removeItem(n)}}}(n),n.jstree.defaults.types={"#":{},"default":{}},n.jstree.plugins.types=function(i,r){this.init=function(n,i){var u,f;if(i&&i.types&&i.types["default"])for(u in i.types)if("default"!==u&&"#"!==u&&i.types.hasOwnProperty(u))for(f in i.types["default"])i.types["default"].hasOwnProperty(f)&&i.types[u][f]===t&&(i.types[u][f]=i.types["default"][f]);r.init.call(this,n,i);this._model.data["#"].type="#"};this.refresh=function(n,t){r.refresh.call(this,n,t);this._model.data["#"].type="#"};this.bind=function(){this.element.on("model.jstree",n.proxy(function(n,i){for(var u=this._model.data,f=i.nodes,o=this.settings.types,e="default",r=0,s=f.length;s>r;r++)e="default",u[f[r]].original&&u[f[r]].original.type&&o[u[f[r]].original.type]&&(e=u[f[r]].original.type),u[f[r]].data&&u[f[r]].data.jstree&&u[f[r]].data.jstree.type&&o[u[f[r]].data.jstree.type]&&(e=u[f[r]].data.jstree.type),u[f[r]].type=e,u[f[r]].icon===!0&&o[e].icon!==t&&(u[f[r]].icon=o[e].icon);u["#"].type="#"},this));r.bind.call(this)};this.get_json=function(t,i,u){var e,s,o=this._model.data,h=i?n.extend(!0,{},i,{no_id:!1}):{},f=r.get_json.call(this,t,h,u);if(f===!1)return!1;if(n.isArray(f))for(e=0,s=f.length;s>e;e++)f[e].type=f[e].id&&o[f[e].id]&&o[f[e].id].type?o[f[e].id].type:"default",i&&i.no_id&&(delete f[e].id,f[e].li_attr&&f[e].li_attr.id&&delete f[e].li_attr.id,f[e].a_attr&&f[e].a_attr.id&&delete f[e].a_attr.id);else f.type=f.id&&o[f.id]&&o[f.id].type?o[f.id].type:"default",i&&i.no_id&&(f=this._delete_ids(f));return f};this._delete_ids=function(t){if(n.isArray(t)){for(var i=0,r=t.length;r>i;i++)t[i]=this._delete_ids(t[i]);return t}return delete t.id,t.li_attr&&t.li_attr.id&&delete t.li_attr.id,t.a_attr&&t.a_attr.id&&delete t.a_attr.id,t.children&&n.isArray(t.children)&&(t.children=this._delete_ids(t.children)),t};this.check=function(i,u,f,e,o){if(r.check.call(this,i,u,f,e,o)===!1)return!1;u=u&&u.id?u:this.get_node(u);f=f&&f.id?f:this.get_node(f);var c=u&&u.id?o&&o.origin?o.origin:n.jstree.reference(u.id):null,s,h,l,a;switch(c=c&&c._model&&c._model.data?c._model.data:null,i){case"create_node":case"move_node":case"copy_node":if("move_node"!==i||-1===n.inArray(u.id,f.children)){if(s=this.get_rules(f),s.max_children!==t&&-1!==s.max_children&&s.max_children===f.children.length)return this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+i,data:JSON.stringify({chk:i,pos:e,obj:u&&u.id?u.id:!1,par:f&&f.id?f.id:!1})},!1;if(s.valid_children!==t&&-1!==s.valid_children&&-1===n.inArray(u.type||"default",s.valid_children))return this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+i,data:JSON.stringify({chk:i,pos:e,obj:u&&u.id?u.id:!1,par:f&&f.id?f.id:!1})},!1;if(c&&u.children_d&&u.parents){for(h=0,l=0,a=u.children_d.length;a>l;l++)h=Math.max(h,c[u.children_d[l]].parents.length);h=h-u.parents.length+1}(0>=h||h===t)&&(h=1);do{if(s.max_depth!==t&&-1!==s.max_depth&&s.max_depth<h)return this._data.core.last_error={error:"check",plugin:"types",id:"types_03",reason:"max_depth prevents function: "+i,data:JSON.stringify({chk:i,pos:e,obj:u&&u.id?u.id:!1,par:f&&f.id?f.id:!1})},!1;f=this.get_node(f.parent);s=this.get_rules(f);h++}while(f)}}return!0};this.get_rules=function(n){if(n=this.get_node(n),!n)return!1;var i=this.get_type(n,!0);return i.max_depth===t&&(i.max_depth=-1),i.max_children===t&&(i.max_children=-1),i.valid_children===t&&(i.valid_children=-1),i};this.get_type=function(t,i){return t=this.get_node(t),t?i?n.extend({type:t.type},this.settings.types[t.type]):t.type:!1};this.set_type=function(i,r){var u,f,s,e,o;if(n.isArray(i)){for(i=i.slice(),f=0,s=i.length;s>f;f++)this.set_type(i[f],r);return!0}return u=this.settings.types,i=this.get_node(i),u[r]&&i?(e=i.type,o=this.get_icon(i),i.type=r,(o===!0||u[e]&&u[e].icon!==t&&o===u[e].icon)&&this.set_icon(i,u[r].icon!==t?u[r].icon:!0),!0):!1}},n.jstree.defaults.unique={case_sensitive:!1,duplicate:function(n,t){return n+" ("+t+")"}},n.jstree.plugins.unique=function(i,r){this.check=function(t,i,u,f,e){if(r.check.call(this,t,i,u,f,e)===!1)return!1;if(i=i&&i.id?i:this.get_node(i),u=u&&u.id?u:this.get_node(u),!u||!u.children)return!0;for(var s="rename_node"===t?f:i.text,h=[],c=this.settings.unique.case_sensitive,l=this._model.data,o=0,a=u.children.length;a>o;o++)h.push(c?l[u.children[o]].text:l[u.children[o]].text.toLowerCase());switch(c||(s=s.toLowerCase()),t){case"delete_node":return!0;case"rename_node":return o=-1===n.inArray(s,h)||i.text&&i.text[c?"toString":"toLowerCase"]()===s,o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o;case"create_node":return o=-1===n.inArray(s,h),o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_04",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o;case"copy_node":return o=-1===n.inArray(s,h),o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_02",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o;case"move_node":return o=i.parent===u.id&&(!e||!e.is_multi)||-1===n.inArray(s,h),o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_03",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o}return!0};this.create_node=function(i,u,f,e,o){if(!u||u.text===t){if((null===i&&(i="#"),i=this.get_node(i),!i)||(f=f===t?"last":f,!f.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(i)))return r.create_node.call(this,i,u,f,e,o);u||(u={});var l,h,c,s,a,v=this._model.data,y=this.settings.unique.case_sensitive,p=this.settings.unique.duplicate;for(h=l=this.get_string("New node"),c=[],s=0,a=i.children.length;a>s;s++)c.push(y?v[i.children[s]].text:v[i.children[s]].text.toLowerCase());for(s=1;-1!==n.inArray(y?h:h.toLowerCase(),c);)h=p.call(this,l,++s).toString();u.text=h}return r.create_node.call(this,i,u,f,e,o)}},o=i.createElement("DIV"),o.setAttribute("unselectable","on"),o.setAttribute("role","presentation"),o.className="jstree-wholerow",o.innerHTML="&#160;",n.jstree.plugins.wholerow=function(t,i){this.bind=function(){i.bind.call(this);this.element.on("ready.jstree set_state.jstree",n.proxy(function(){this.hide_dots()},this)).on("init.jstree loading.jstree ready.jstree",n.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",n.proxy(function(){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",n.proxy(function(n,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");for(var i=!1,r=0,u=t.selected.length;u>r;r++)i=this.get_node(t.selected[r],!0),i&&i.length&&i.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",n.proxy(function(n,t){this.get_node(t.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",n.proxy(function(n,t){"hover_node"===n.type&&this.is_disabled(t.node)||this.get_node(t.node,!0).children(".jstree-wholerow")["hover_node"===n.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",n.proxy(function(t){t.preventDefault();var i=n.Event("contextmenu",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,pageX:t.pageX,pageY:t.pageY});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i)},this)).on("click.jstree",".jstree-wholerow",function(t){t.stopImmediatePropagation();var i=n.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",n.proxy(function(t){t.stopImmediatePropagation();var i=n.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",n.proxy(function(n){return n.stopImmediatePropagation(),this.is_disabled(n.currentTarget)||this.hover_node(n.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",n.proxy(function(n){this.dehover_node(n.currentTarget)},this))};this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove();i.teardown.call(this)};this.redraw_node=function(t){if(t=i.redraw_node.apply(this,arguments)){var r=o.cloneNode(!0);-1!==n.inArray(t.id,this._data.core.selected)&&(r.className+=" jstree-wholerow-clicked");this._data.core.focused&&this._data.core.focused===t.id&&(r.className+=" jstree-wholerow-hovered");t.insertBefore(r,t.childNodes[0])}return t}},i.registerElement&&Object&&Object.create){v=Object.create(HTMLElement.prototype);v.createdCallback=function(){var i={core:{},plugins:[]};for(var t in n.jstree.plugins)n.jstree.plugins.hasOwnProperty(t)&&this.attributes[t]&&(i.plugins.push(t),this.getAttribute(t)&&JSON.parse(this.getAttribute(t))&&(i[t]=JSON.parse(this.getAttribute(t))));for(t in n.jstree.defaults.core)n.jstree.defaults.core.hasOwnProperty(t)&&this.attributes[t]&&(i.core[t]=JSON.parse(this.getAttribute(t))||this.getAttribute(t));n(this).jstree(i)};try{i.registerElement("vakata-jstree",{prototype:v})}catch(w){}}}});Loader={Show:function(n){$("#"+n).append('<div class="loader"><\/div>')},Hide:function(n){if(n!=undefined&&n!=null){var t=$("#"+n);if(t!=undefined){t.find(".loader").remove();return}}$(".loader").remove()}}