function resizeApexWindow(){var n=$(document).width(),t;n>=992?(t=n-$(".ContentContainer").width()-$(".ContentContainer").position().left,$("li.navbar-right, div.navbar-form.navbar-right").css("right",t+"px"),$("li.navbar-right a").css("padding-right","0")):$("li.navbar-right").css("right","auto")}function sizeIntenseDebateFrame(){try{$("#iframeDebate").AutoSizeIFrame();$("#iframeDebate").off("mouseover");$("#iframeDebate").on("mouseover",function(){$(this).contents().find(".idc-r").unbind("click").bind("click",function(){$("#iframeDebate").AutoSizeIFrame({offset:200})});$(this).contents().find("#IDCPostNav, #IDCColumnEmailLabel, #IDCColumnEmailReply, #IDCommentsHeadLogin").hide()})}catch(n){}return!1}function onPageLoad(){microsoft.applications.telemetry.LogManager.initialize(_defaultAriaTenantId);defaultApexLogger=new microsoft.applications.telemetry.Logger}var lpMTagConfig,defaultApexLogger,ApexMainViewModel,apexMainViewModel,clienttelemetry_build,Microsoft,sct,microsoft;ApexVideoHandler=function(){var n=!1,o=function(n,t){var i={options:{autoplay:!0,mute:!1,loop:!1,market:"en-us",playFullScreen:!1},metadata:{videoId:n}};MsOnePlayer.render(t,i,function(n){n.addPlayerEventListener(function(n){console.log("player event: "+JSON.stringify(n))})})},t=function(){$.each($(".apexEmbedPlayer iframe"),function(n,t){$(t)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")})},s=function(){if($(".apexEmbedPlayer").length==0)return!1;$(".apexEmbedPlayer iframe").attr("src","");$(".apexEmbedPlayer").on("click",function(n){var i=n.target,r=$(i).attr("op_videoId");if(r==null||r==""||r=="OnePlayerIDValue"){t();var u=$(i).attr("videoId"),s=$(i).attr("width"),h=$(i).attr("height"),f="//www.youtube.com/embed/"+u+"?rel=0&amp;modestbranding=1&amp;showinfo=1&amp;controls=1&amp;autoplay=1&amp;enablejsapi=1&amp;version=3&amp;playerapiid=ytplayer";$(i).html('<iframe src=""><\/iframe>');$(i.children).attr({src:f,width:"100%",height:"100%"});$(i).off("click")}else{var u=r,s=$(i).attr("width"),h=$(i).attr("height"),e=$(i).attr("id");$(i.children).attr({width:"100%",height:"100%"});o(u,e);$(i).off("click")}});$(".apexEmbedPlayer").on("keypress",function(n){var t=n.target,i="#"+$(t).attr("id"),r=n.which;if(r==13)return $(i).click(),!1})},i=function(){n!=!1&&($(".abOverlayBox").css({display:"block",left:($(window).width()-$(".abOverlayBox").width())/2,top:($(window).height()-$(".abOverlayBox").height())/2-20+$(this).scrollTop(),position:"absolute","z-index":"2002"}),$(".abOverlayBgCover").css({display:"block",width:$(document).width(),height:$(document).height(),"z-index":"2001"}))},r=function(t){n=!0;var e=u()+145,o=f()+50,s='<iframe id="iframeVideo" name="iframeVideo" scrolling="no" src="" width="'+o+'"px" height="'+e+'"px" frameborder="0" style="margin-bottom: 8px;"><\/iframe>';$("#iframeVideo").length===0&&$(s).appendTo("#abOverlayVideo");$("body").width()<550?$(".abOverlayBox").css({width:360,height:310,left:5}):$(".abOverlayBox").css({width:605,height:470});window.top.$("#iframeVideo").css("visibility","visible");window.top.$("#iframeVideo").attr("src",t);i();$(".abOverlayBgCover").css({opacity:0}).animate({opacity:.6,backgroundColor:"#000"});var r=navigator.userAgent.toLowerCase(),h=r.indexOf("chrome")>-1,c=r.indexOf("safari")>-1;return(h||c)&&$("#abOverlayVideo").css("margin-top","10px"),$("span#abOverlayClose").focus(),!1},h=function(){$("#railHelpInputs").attr("query")=="_popup_video_"&&window.close();n=!1;$(".abOverlayBox").css("display","none");$(".abOverlayBgCover").animate({opacity:0},null,null,function(){$(this).hide()});window.top.$("#iframeVideo").css("visibility","hidden");window.top.$("#iframeVideo").attr("src","");var t=$("span#abOverlayClose").data("element");$(t).focus();$("span#abOverlayClose").data("element","")},u=function(){var n=325;return $("body").width()<550&&(n=155),n},f=function(){var n=550;return $("body").width()<550&&(n=300),n},e=function(n){var s,h;$("span#abOverlayClose").data("element",n.target);var t=$(n.target).attr("videoId"),i=$(n.target).attr("op_videoId"),e=$(n.target).attr("project"),o=$(n.target).attr("language"),c=u(),l=f();return t===undefined&&(t=$(n.target).parent().attr("videoId"),i=$(n.target).parent().attr("op_videoId")),s="&random="+(new Date).getTime()+Math.floor(Math.random()*1e6),window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),e==undefined&&(e=apexMainViewModel.projectFolder()),o==undefined&&(o=apexMainViewModel.language()),h=window.location.origin+"/resources/neutral/ApexOnePlayerVideoHandler.htm?uuid="+t+"&opid="+i+"&prd="+e+"&mkt="+o+"&w="+l+"&h="+c+s,(i==null||i==""||i=="OnePlayerIDValue")&&(h=window.location.origin+"/resources/neutral/ApexYoutubeVideoHandler.htm?uuid="+t+"&w="+l+"&h="+c+s),r(h,n.target),(apexMainViewModel.projectFolder()!=null||apexMainViewModel.projectFolder()!=undefined)&&ApexInstrumentHandler.LogAria("Browser",apexMainViewModel.projectFolder(),apexMainViewModel.language(),t,"","","Video",""),!1};return{DoOverlayOpen:r,DoOverlayClose:h,ShowOverlay:function(){i()},ShowVideo:function(n){return e(n)},PauseEmbedVideos:t,InitEmbedVideos:s,Init:function(){$(".abLaunchVideo").off("click");$(".abLaunchVideo").on("click",function(n){return e(n)});$("div.apexContentTile span.abLaunchVideo, #abOverlayClose").off("keypress");$("div.apexContentTile span.abLaunchVideo, #abOverlayClose").on("keypress",function(n){n.which===13&&$(n.target).trigger("click")});$("a#abOverlayClose, span#abOverlayClose").off("click");$("a#abOverlayClose, span#abOverlayClose").on("click",function(){ApexVideoHandler.DoOverlayClose()});$("#abOverlayClose").off("click");$("#abOverlayClose").on("click",function(){ApexVideoHandler.DoOverlayClose()})}}}();ApexButtonHandler=function(){var n=function(){$("#railContent div.apexButtonLink.uberProduct").off("click");$("#railContent div.apexButtonLink.uberProduct").on("click",function(n){var i,r,u,t,f;return(n.preventDefault&&n.preventDefault(),n.stopPropagation&&n.stopPropagation(),i=$(n.target).closest(".uberProduct"),r=$(i).attr("secretkey"),r==undefined)?!1:(u=$(i).attr("project"),t=$(i).attr("language"),(t==undefined||t!=apexMainViewModel.language())&&(t=apexMainViewModel.language()),f="apex/"+u+"/"+t+"/"+r,document.location.hash=f,!1)});$("#railContent div.apexButtonLink.uberResource").off("click");$("#railContent div.apexButtonLink.uberResource").on("click",function(n){var i,r,f,e,t,u;return(n.preventDefault&&n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.preventDefault&&n.preventDefault(),n.stopPropagation&&n.stopPropagation(),i=$(n.target).closest(".uberResource"),r=$(i).attr("secretkey"),r==undefined)?!1:(f=r.split(":"),f.length==2?(u="https://go.microsoft.com/fwlink/?linkid="+f[1],window.open(u,"_uberResourceWindow")):(e=$(i).attr("project"),t=$(i).attr("language"),(t==undefined||t!=apexMainViewModel.language())&&(t=apexMainViewModel.language()),u="apex/"+e+"/"+t+"/"+r,document.location.hash=u),!1)});return!1};return{Init:n}}();ApexTabHandler=function(){var n=function(){if($("#railContent div.apexTab").length<=0)return!1;$("#railContent button.apexTabLink").off("click");$("#railContent button.apexTabLink").on("click",function(n){var t,i;n.preventDefault&&n.preventDefault();n.stopPropagation&&n.stopPropagation();ApexVideoHandler.PauseEmbedVideos();t=$(n.target).closest('button[class^="apexTabLink"]');$(t).siblings().removeClass("active");$(t).siblings().removeAttr("aria-current");$(t).addClass("active");$(t).attr("aria-current","tab");i=$(t).attr("tabcontentid");$(t).parent().siblings().hide();$(t).parent().siblings("#"+i).show()});var n=!1;return $("#railContent button.apexTabLink").each(function(){if($(this).hasClass("active")){var t=$(this).attr("tabcontentid");$("#railContent div.apexTab #"+t).show();n=!0}}),n==!1&&($("#railContent button.apexTabLink")[0].addClass("active"),$("#railContent button.apexTabLink")[0].attr("aria-current","tab"),$("#railContent div.apexTabContent")[0].show()),!1};return{Init:n}}();ApexFeedbackHandler=function(){var n="Sorry about that",t="Thanks for the feedback!",r=function(i){try{if(i==null||i==undefined)return!1;typeof i.Submit!="undefined"&&$("#apex-feedback-answer-button").html(i.Submit);typeof i.Helpful!="undefined"&&$("#apex-feedback-title").html(i.Helpful);typeof i.Improve!="undefined"&&$("#apex-feedback-question").html(i.Improve);typeof i.Yes!="undefined"&&$("#apex-feedback-yes").html(i.Yes);typeof i.No!="undefined"&&$("#apex-feedback-no").html(i.No);typeof i.Sorry!="undefined"&&(n=i.Sorry);typeof i.Thanks!="undefined"&&(t=i.Thanks)}catch(r){}},u=function(){return'<div id="apex-topic-feedback" aria-live="assertive">\t<div class="begin">\t\t<div id="apex-feedback-title">Was this helpful?<\/div>\t\t<div id="apex-feedback-question">How can we improve it?<\/div>\t\t<div class="apex-feedback-button">\t\t\t<button id="apex-feedback-yes" title="yes" aria-labelledby="apex-feedback-title" type="button">Yes<\/button><button id="apex-feedback-no" title="no" aria-labelledby="apex-feedback-title" type="button">No<\/button>\t\t<\/div>\t\t<div class="apex-feedback-answer">\t\t\t<textarea id="apex-feedback-answer-text" aria-label="How can we improve it?" name="article_feedback_comment"><\/textarea>\t\t\t<button id="apex-feedback-answer-button" type="button">Submit<\/button>        <\/div > \t<\/div><\/div>'},f=function(){$("#apex-feedback-yes").off("click");$("#apex-feedback-yes").on("click",function(){i("brwoser",apexMainViewModel.projectFolder(),apexMainViewModel.language(),apexMainViewModel.query(),"YES","NONE",apexMainViewModel.topicFileName(),"full-browser")});$("#apex-feedback-no").off("click");$("#apex-feedback-no").on("click",function(){e();$("#apex-feedback-answer-text").focus()});$("#apex-feedback-answer-button").off("click");$("#apex-feedback-answer-button").on("click",function(){i("brwoser",apexMainViewModel.projectFolder(),apexMainViewModel.language(),apexMainViewModel.query(),"NO",$.trim($("#apex-feedback-answer-text").val()),apexMainViewModel.topicFileName(),"full-browser")})},e=function(){$("#apex-topic-feedback div:first").hasClass("mid")&&$("#apex-topic-feedback div:first").hasClass("end")||$("#apex-topic-feedback div:first").removeClass("begin").addClass("mid");$("#apex-feedback-title").html(n)},i=function(n,i,r,u,f,e,o,s){$("#apex-topic-feedback div:first").hasClass("end")||$("#apex-topic-feedback div:first").removeClass("begin").removeClass("mid").addClass("end");$("#apex-feedback-title").html(t);ApexInstrumentHandler.Feedback(n,i,r,u,f,e,o,s)};return{BindEvents:f,FeedbackHtml:u,UpdateLocStrings:r}}();ApexInstrumentHandler=function(){var n=function(n,t,i,r,u,f,e,o){r=r==null||r===""?"NONE":r;u=u==null||u===""?"NONE":u;f=f==null||f===""?"NONE":f.toString();e=e==null||e===""?"NONE":e;o=o==null||o===""?"NONE":o;defaultApexLogger.logEvent({name:"Help",properties:[{key:"Button_Clicked",value:"SendEvents"},{key:"Source",value:n},{key:"Project",value:t},{key:"Language",value:i},{key:"Filename",value:u},{key:"Row",value:f},{key:"Query",value:r},{key:"View",value:o},{key:"LogType",value:e},{key:"IsMobileDevice",value:_isMobileDevice},{key:"MobileDeviceModel",value:_mobileDeviceModel},{key:"MobileDeviceManufacturer",value:_mobileDeviceManufacturer},{key:"BrowserPlatform",value:_browserPlatform},{key:"BrowserName",value:_browserName},{key:"BrowswerVersion",value:_browswerVersion},{key:"UrlReferrer",value:_urlReferrer}]})},t=function(n,t,i,r,u,f,e,o){r=r==null||r===""?"NONE":r;u=u==null||u===""?"NONE":u;f=f==null||f===""?"NONE":f;e=e==null||e===""?"NONE":e;o=o==null||o===""?"NONE":o;defaultApexLogger.logEvent({name:"feedback",properties:[{key:"Button_Clicked",value:"SendEvents"},{key:"Source",value:n},{key:"Project",value:t},{key:"Language",value:i},{key:"Filename",value:e},{key:"Answer",value:u},{key:"answerText",value:f},{key:"Query",value:r},{key:"View",value:o},{key:"IsMobileDevice",value:_isMobileDevice},{key:"MobileDeviceModel",value:_mobileDeviceModel},{key:"MobileDeviceManufacturer",value:_mobileDeviceManufacturer},{key:"BrowserPlatform",value:_browserPlatform},{key:"BrowserName",value:_browserName},{key:"BrowswerVersion",value:_browswerVersion},{key:"UrlReferrer",value:_urlReferrer}]})};return{LogAria:n,Feedback:t}}();ApexCookieBannerHandler=function(){function n(){i();$("body").css("padding-top","");$("#apexbody .header").css("margin-top","")}function t(){siteConsent.isConsentRequired&&siteConsent.manageConsent()}function i(){siteConsent.getConsentFor(WcpConsent.consentCategories.Analytics)?(function(n,t,i,r,u,f,e){n.GoogleAnalyticsObject=u;n[u]=n[u]||function(){(n[u].q=n[u].q||[]).push(arguments)};n[u].l=1*new Date;f=t.createElement(i);e=t.getElementsByTagName(i)[0];f.async=1;f.src=r;e.parentNode.insertBefore(f,e)}(window,document,"script","https://www.google-analytics.com/analytics.js","ga"),ga("create","UA-87760037-1","auto"),ga("send","pageview")):siteConsent.getConsentFor(WcpConsent.consentCategories.Analytics)||(document.cookie="_ga= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",document.cookie="_gat= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",document.cookie="_gid= ; expires = Thu, 01 Jan 1970 00:00:00 GMT")}return{OnConsentChanged:n,ManageConsent:t}}(),function(n,t){n.fn.exists=function(){return this.length!==0};n.fn.ExpanderList=function(t){var i=n(this);i.addClass("expando-list");i.children().each(function(){var i=n(this);i.Expander(t)})};n.fn.Expander=function(i){var o=n.extend({},n.fn.Expander.defaults,i),u=n(this),r,f,e;u.addClass("expando");r=u.children().first();f=r.next();r.addClass("expando-head").attr("aria-expanded","false");r.wrapInner('<span class="head">');e=u.attr("expanded")=="true";f.addClass("expando-body").attr("role","region");e&&u.prevAll(".expando").children(".expando-head-active").length==0?(r.addClass("expando-head-active").attr("aria-expanded","true"),f.addClass("expando-body-active")):(r.attr("aria-expanded","false"),f.hide());r.bind("mouseenter.expander",function(){n(this).addClass("expando-hover")});r.bind("mouseleave.expander",function(){n(this).removeClass("expando-hover")});r.bind("click",function(i){var r;i.preventDefault&&i.preventDefault();var u=n(this),f=n(this).next(),e=!1;typeof s!=t||s!=null||s!=="";u.hasClass("expando-head-active")&&(e=!0);r=u.parents(".expando-list");r.exists()||(r=u.parents(".expando"));o.Multiple?e&&(f.slideUp(500),f.removeClass("expando-body-active").addClass("expando-body"),u.removeClass("expando-head-active").attr("aria-expanded","false")):(r.find(".expando-body-active").slideUp(500),r.find(".expando-body-active").removeClass("expando-body-active").addClass("expando-body"),r.find(".expando-head-active").removeClass("expando-head-active").attr("aria-expanded","false"));e||(u.addClass("expando-head-active").attr("aria-expanded","true"),f.addClass("expando-body-active"),f.slideDown(500))})};n.fn.ApexDropDown=function(){n(".apex_dropdown_content").hide();n(".apex_dropdown_list_master").length!=0?(n(".apex_dropdown_list_child").hide(),n(".apex_dropdown .apex_dropdown_list_master option[selected]").each(function(t,i){var r="#"+n(i).parent().parent().attr("id"),u=n(r+" .apex_dropdown_list_master option[selected]").attr("ddid"),e,f;u!=null&&(n(r+" .apex_dropdown_list_child").hide(),n(r+" .apex_dropdown_list_child[ddid="+u+"]").show(),n(r+" .apex_dropdown_content div[ddid]").hide(),n(r+" .apex_dropdown_content").show(),e=n(r+" .apex_dropdown_list_child[ddid="+u+"] option[selected]").attr("ddid"),e&&(f=r+' .apex_dropdown_content div[ddid="'+n(r+" .apex_dropdown_list_child[ddid="+u+"] option[selected]").attr("ddid")+'"]',n(r+" .apex_dropdown_content").hide(),n(f).show(),n(n(f).parent()).show()))}),n(".apex_dropdown .apex_dropdown_list_master").bind("change",function(t){var i="#"+n(t.target).parent().attr("id"),r=n(t.target.options[t.target.selectedIndex]).attr("ddid"),f,u;n(i+" .apex_dropdown_list_child").hide();n(i+" .apex_dropdown_list_child[ddid="+r+"]").show();n(i+" .apex_dropdown_content div[ddid]").hide();n(i+" .apex_dropdown_content").show();f=n(i+" .apex_dropdown_list_child[ddid="+r+"] option:selected").attr("ddid");f&&(u=i+' .apex_dropdown_content div[ddid="'+n(i+" .apex_dropdown_list_child[ddid="+r+"] option:selected").attr("ddid")+'"]',n(i+" .apex_dropdown_content").hide(),n(u).show(),n(n(u).parent()).show())}),n(".apex_dropdown .apex_dropdown_list_child").bind("change",function(t){var i="#"+n(t.target).parent().attr("id"),u=n(t.target.options[t.target.selectedIndex]).attr("ddid"),f,r;n(i+" .apex_dropdown_content div[ddid]").hide();n(i+" .apex_dropdown_content").show();f=n(i+' .apex_dropdown_content div[ddid="'+u+'"]');f&&(r=i+' .apex_dropdown_content div[ddid="'+u+'"]',n(i+" .apex_dropdown_content").hide(),n(r).show(),n(n(r).parent()).show())})):(n(".apex_dropdown .apex_dropdown_list option[selected]").each(function(t,i){var r="#"+n(i).parent().parent().attr("id"),u=n(r+" .apex_dropdown_list option[selected]").attr("ddid"),f;u!=null&&(n(r+" .apex_dropdown_content div[ddid]").hide(),n(r+" .apex_dropdown_content").show(),f=r+' .apex_dropdown_content div[ddid="'+u+'"]',n(f).show())}),n(".apex_dropdown .apex_dropdown_list").bind("change",function(t){var i="#"+n(t.target).parent().attr("id"),r;n(i+" .apex_dropdown_content div[ddid]").hide();n(i+" .apex_dropdown_content").show();r=i+' .apex_dropdown_content div[ddid="'+n(t.target.options[t.target.selectedIndex]).attr("ddid")+'"]';n(r).show()}))};n.fn.ExpanderList.defaults={Multiple:"false"}}(jQuery);ApexMainViewModel=function(){var n=this,r=-1,t=1,i;n.projectId=ko.observable();n.project=ko.observable();n.projectFolder=ko.observable();n.projectTitle=ko.observable();n.projectTheme=ko.observable();n.language=ko.observable();n.query=ko.observable();n.topicFileName=ko.observable();n.currentNavId=ko.observable();n.currentSubNavId=ko.observable();n.theme=ko.observable();n.errorTopic=ko.observable();n.customSearchClass=ko.observable();n.navItems=ko.observable();n.navItemsData=ko.observable();n.chosenNavId=ko.observable();n.topicData=ko.observable();n.topicFeedback=ko.observable();n.searchTopicsStack=ko.observableArray([[]]);n.searchTopics=ko.observableArray([]);n.searchTopicsHistory=ko.observableArray([]);n.continuationToken=ko.observable();n.searchVideos=ko.observableArray([]);n.termToSearch=ko.observable("");n.showSearchPanel=ko.observable(!1);n.showMoreVideo=ko.observable(!1);n.showVideoPanel=ko.observable(!1);n.clickableHeader=ko.observable(!1);n.showRelatedTopicsRight=ko.observable(!1);n.currentSupportMarket=ko.observable();n.locStrings=ko.observable();n.showNavGroupPanel=ko.observable(!1);n.showNavPanel=ko.observable(!1);n.showViewMoreButton=ko.observable(!1);n.showRelatedTopicsPanel=ko.observable(!1);n.showRightRail=ko.observable(null);n.showRelatedVideosPanel=ko.observable(!1);n.showRelatedSupportPanel=ko.observable(!1);n.relatedTopicsTitle=ko.observable("");n.relatedVideosTitle=ko.observable("");n.relatedSupportPanel=ko.observable("");n.navGroupsItem=ko.observable();n.relatedTopicsItem=ko.observable();n.relatedVideosItem=ko.observable();n.relatedVideosItem=ko.observable();n.newToProductUrl=ko.observable();n.videoDirectoryUrl=ko.observable();n.scriptVersion=ko.observable();n.coreCSSUrl=ko.observable();n.defaultUrl=ko.observable();n.defaultTopicId=ko.observable();n.projectAlias=ko.observable();n.showExternalInfoLabel=ko.observable(!1);n.anchor=ko.observable();n.nav=ko.observable();n.breadcrumbItem=ko.observable();n.showBreadcrumbItem=ko.observable();n.setViewMoreCount=function(n){var f=window.location.href,r,u;i=$(window).scrollTop();r=i+"~"+t;u={result:r,data:n};localStorage.setItem(f,JSON.stringify(u))};n.populateUILabels=function(t){var i,r,u,f,e,o,s;if(t!=undefined&&t!=null){i=t.LocStrings.Search;r=n.projectFolder().toLowerCase()+"_Search";typeof t.LocStrings[r]!="undefined"&&(i=t.LocStrings[r]);$("#searchquery").attr("placeholder",i);try{t.LocStrings.ExternalInfoHead.length!=0&&n.showExternalInfoLabel()?$("#externalInfoHead, #externalInfoSearchHead").html(t.LocStrings.ExternalInfoHead):$("#externalInfoHead, #externalInfoSearchHead").hide();t.LocStrings.ExternalInfoFooter.length!=0&&n.showExternalInfoLabel()?$("#externalInfoFooter, #externalInfoSearchFooter").html(t.LocStrings.ExternalInfoFooter):$("#externalInfoFooter, #externalInfoSearchFooter").hide();t.LocStrings.SearchResultsFor.length!=0?(u=encodeURIComponent($("#searchquery").val()),$("#searchHeading").text(t.LocStrings.SearchResultsFor+" "+decodeURIComponent(u))):$("#searchHeading").hide()}catch(h){$("#externalInfoHead, #externalInfoSearchHead, #searchHeading").hide();$("#externalInfoFooter, #externalInfoSearchFooter").hide()}t.LocStrings.Video1!=undefined&&$("#VideoLabel").html(t.LocStrings.Video1);t.LocStrings.SeeMoreVideo!=undefined&&$("#more-videos").html(t.LocStrings.SeeMoreVideo);t.Footer.Support.Name.length!=0&&$("#supportLabel").html(t.Footer.Support.Name);t.Footer.Support.Url.length!=0?$("#supportLabel").attr("href",t.Footer.Support.Url):$("#supportLabel").hide();t.Footer.Privacy.Url.length!=0?($("#privacyLabel").html(t.Footer.Privacy.Name),$("#privacyLabel").attr("href",t.Footer.Privacy.Url)):$("#privacyLabel").hide();t.Footer.Legal.Url.length!=0?($("#lagalLabel").html(t.Footer.Legal.Name),$("#lagalLabel").attr("href",t.Footer.Legal.Url)):$("#lagalLabel").hide();t.Footer.Trademarks.Url.length!=0?($("#tradeMarkLabel").html(t.Footer.Trademarks.Name),$("#tradeMarkLabel").attr("href",t.Footer.Trademarks.Url)):$("#tradeMarkLabel").hide();t.Footer.BingYahooId.Name.length!=0&&$("#bingYahooLabel").html(t.Footer.BingYahooId.Name);t.Footer.BingYahooId.Url.length!=0?(f=n.currentSupportMarket()==undefined?"en-us":n.currentSupportMarket(),e="/#Apex/"+n.projectAlias()+"/"+n.language()+"/"+t.Footer.BingYahooId.Url+"/"+f,$("#bingYahooLabel").attr("href",e)):$("#bingYahooLabel").hide();t.HeaderNavItems!=null&&(o=t.HeaderNavItems.length,s=t.HeaderNavItems[o-1],s.SupportOption.URL.length==0?$(".supportApex").hide():$(".supportApex").show())}};n.loadMoreSearchTopics=function(i){var r,u;if(i!=undefined&&i!=null)if(r=i.continuationToken(),i.searchTopicsStack().length>0){var f=i.searchTopicsStack().pop(),e=i.searchTopics(),o=e.concat(f);i.searchTopics(o);t++;n.setViewMoreCount(JSON.parse(n.searchTopicsHistory()));u=r||i.searchTopicsStack().length>0;n.showViewMoreButton(u)}else i.continuationToken()&&(n.showViewMoreButton(!0),n.sendApexTokenRequest(i.project(),i.language(),i.query(),r))};n.onEnterKeyForSearch=function(n,t){if(t.which===13)return t.target.click(),!1};n.setScrollPositionForHistory=function(){var r=1,u=window.location.href,n;try{var n=JSON.parse(localStorage.getItem(u)),f=n.data,t=n.result,i=t.split("~");i.length==2&&(scrollTop=i[0],r=parseInt(i[1]));t=$(this).scrollTop()+"~"+r;n={result:t,data:f};localStorage.setItem(u,JSON.stringify(n))}catch(e){}};n.getToContent=function(t){$("#apex_search input#searchquery").val("");n.setScrollPositionForHistory();ApexInstrumentHandler.LogAria("Browser",n.projectFolder(),n.language(),t.SecretKey,t.Filename,t.Row,"Result","");document.location.hash=t.Href.replace("/#","");n.getWindowsOrigin()&&(window.location.href=window.location.origin+"/"+window.location.hash)};n.onEnterKeyForVideo=function(t,i){i.target.id=="more-videos"?($("#railContent .VideoRow.hide").each(function(n,t){return($(t).removeClass("hide").addClass("show"),n>=2)?!1:!0}),$("#railContent .VideoRow.hide").length==0&&$(".more-videos").hide()):n.getToVideo(t,i)};n.getToVideo=function(n,t){$(".abOverlayClose").focus();ApexVideoHandler.ShowVideo(t);$("#abOverlayClose").off("click");$("#abOverlayClose").on("click",function(){ApexVideoHandler.DoOverlayClose()})};n.getToLogData=function(t,i){var u=$(i.target.parentElement).attr("row"),r="";switch(u){case"400":r="NewToBingAds - Link";break;case"600":r="Forum - Link";break;case"700":r="Sign-In - Link";break;case"701":r="Sign-Up - Link";break;case"800":r="All Video Library - Link"}return r!=""&&ApexInstrumentHandler.LogAria(n.projectFolder(),n.projectFolder(),n.language(),r,"",u,"Page"),!0};n.setNavItem=function(n,t){var i,r;$("ul.apex-menu > li:visible").removeClass("active").removeAttr("aria-current");$("ul.apex-menu > li.dropdown").removeClass("active").removeAttr("aria-current");$("ul.apex-menu > li.dropdown > ul.dropdown-menu > li").removeClass("active").removeAttr("aria-current");try{i=$("ul.apex-menu > li:visible")[n];$(i).addClass("active").attr("aria-current","true");$("ul.apex-menu > li.active .active").removeClass("active");r=$("ul.apex-menu > li.active li")[t];$(r).addClass("active").attr("aria-current","true")}catch(u){}};n.goToNavItem=function(t,i){var u,r,f,e;if(t.URL==null){$(i.target.parentElement).addClass("active").siblings().removeClass("active");u=/ext(\d*)/;r=t.SecretKey;try{f=r.match(u)[1];r=f}catch(o){}document.location.hash="apex/"+n.projectAlias()+"/"+n.language()+"/"+r+"/"+t.SortOrder}else $(i.target.parentElement).removeClass("active"),e=document.location.hash,window.open(t.URL),document.location.hash=e;n.getWindowsOrigin()&&(window.location.href=window.location.origin+"/"+window.location.hash)};n.goToSubNavItem=function(t,i){var u,r,f;$(i.target).parent().parent().parent().addClass("active").siblings().removeClass("active");u=/ext(\d*)/;r=t.SecretKey;try{f=r.match(u)[1];r=f}catch(e){}document.location.hash="apex/"+n.projectAlias()+"/"+n.language()+"/"+r+"/"+t.SortOrder;n.getWindowsOrigin()&&(window.location.href=window.location.origin+"/"+window.location.hash)};n.windowsOrigin=function(){return window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),window.location.origin};n.setProjectTheme=function(t,i){var r,u,f,e,o;try{r=n.projectTheme().toLowerCase();$("#apex-link-css-id").length==1&&$("#apex-link-css-id").remove();r!="metro"&&(u=n.windowsOrigin()+"/Resources/content/styles/apex."+r+".css",f=$("<link id='apex-link-css-id' rel='stylesheet' type='text/css' href='"+u+"'>"),$("head").append(f));(i==null||i==undefined)&&(i="main");e="apex-"+i+"-img";o="apex-"+t+"-img";$("a.navbar-brand").removeClass(e.toLowerCase());$("a.navbar-brand").addClass(o.toLowerCase())}catch(s){}};n.searchTerm=function(){var r,f,u;if(n.termToSearch($("input#searchquery").val()),n.termToSearch()=="")return!1;r=n.termToSearch()+"";$("ul.ui-autocomplete").is(":visible")&&$("#apex_search input#searchquery").autocomplete("close");$(".apex-menu .active").removeClass("active");f="int:"+n.projectFolder()+":"+n.language()+":"+r;ApexInstrumentHandler.LogAria("Browser",n.projectFolder(),n.language(),n.termToSearch(),"","","Search","");r=encodeURIComponent(r);u=window.location.hash;document.location.hash="apex/"+n.projectAlias()+"/"+n.language()+"/"+r;n.getWindowsOrigin()&&(window.location.href=window.location.origin+"/"+window.location.hash);u!=window.location.href&&(i=0,t=1)};n.clearTerm=function(t,i){i.preventDefault&&i.preventDefault();i.stopPropagation&&i.stopPropagation();$("ul.ui-autocomplete").is(":visible")&&$("#apex_search input#searchquery").autocomplete("close");n.termToSearch("")};n.getToAnchor=function(n){var t=$("html").find(n),i;t.length>0&&(t.hasClass("expando-head")&&(t.hasClass("expando-head-active")||$(t).trigger("click")),i=t.offset().top-$(".head2").height()-80,$("html, body").stop().animate({scrollTop:i},1e3))};n.getNoEchoWizard=function(){var n=null;return $("#railContent .secret_keywords, #railContent .keywords").each(function(){var t=/ab_noID+/g.exec($(this).html());t!==null&&t.length>0&&(n=t[0])}),n};n.getWindowsOrigin=function(){return $("#apexQueryParams").length==1?(window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),!0):!1};n.attachCommentsService=function(){};n.displayLoadingDialog=function(){$("#railContent").empty();var n='<div style="position:absolute; top:40%; height:10em; left:40%" ><p><img src="'+ab_glb.CDNEndPoint+'/resources/rightrail/images/busy.gif?v=1.0" alt="content" width="25px" height="25px" style="vertical-align:middle"/>&nbsp;&nbsp;loading<\/p><\/div><\/body>';$("#railContent").html(n)};n.hideLoadingDialog=function(){$("#railContent").hide()};n.sendApexTokenRequest=function(i,r,u,f){var e;e={token:JSON.stringify(f),project:i,language:r,query:u};$.ajax({url:"/api/ContinuationToken",type:"GET",data:e,cache:!0,success:function(i){var u,r,f,e,o,s,h;i.Content==null&&i.Topics!==null&&i.Topics.length>0&&(u=JSON.parse(n.searchTopicsHistory()),r=u.concat(i.TopicsHistory),n.searchTopicsHistory(JSON.stringify(r)),f=n.searchTopics(),i.Topics.reverse(),e=i.Topics.pop(),o=f.concat(e),n.searchTopics(o),n.searchTopicsStack(i.Topics),n.continuationToken(i.ContinuationToken),t++,n.setViewMoreCount(r),s=i.ContinuationToken,h=s!=null||i.Topics.length.length>0,n.showViewMoreButton(h))}})};n.sendApexRequest=function(i,r,u,f,e,o){var s,a;if(t=1,$("span#abOverlayClose:visible")&&ApexVideoHandler.DoOverlayClose(),n.anchor(o),n.nav(f),e!=undefined&&e.substring(0,1)==="#"&&(o=e,e="",n.anchor(o)),$("#apexQueryParams").length==1&&typeof i=="undefined"&&(i=$("#apexQueryParams").attr("projectId"),r=$("#apexQueryParams").attr("language"),u=$("#apexQueryParams").attr("query")),f==undefined&&(f=""),s=window.location.href,localStorage.getItem(s)){var c=JSON.parse(localStorage.getItem(s)),v=c.result,l=c.data,h=v.split("~");h.length==2&&(scrollTop=h[0],t=parseInt(h[1]));l!=null&&n.searchTopicsHistory(JSON.stringify(l))}a={id:i,language:r,query:u,nav:f,market:e};$("#searchHeading").html("");$("#railContentLoading").show();$.ajax({url:"/api/apexv2api",type:"GET",data:a,cache:!0,success:n.handlerApexV2ApiSuccess}).always(function(){$("#railContentLoading").hide()})};n.getApexOnDemandContent=function(n,t){if($(".ApexOndemandContent").length!=0){var i=$(".ApexOndemandContent").attr("ondemand_filename")+".htm",r={project:n,language:t,filename:i};$.ajax({url:"/api/apexv2api/ApexRawContent",data:r,cache:!0,success:function(n){$(".ApexOndemandContent").parent().append(n)}})}};n.redirectDocMS=function(n){if(n!=null&&n.Content!=null&&n.Content.RedirectUrl!==""){var t='<meta http-equiv="refresh" content="0; url='+n.Content.RedirectUrl+'" />';$(t).appendTo($("html head"))}};n.handlerApexV2ApiSuccess=function(u){var v,h,p,it,w,b,rt,ut,k,l,s,o,d,c,g,ft,e;n.redirectDocMS(u);var nt="-1",a=!1,f=n.anchor();if($("#apexQueryParams").length==1&&typeof id=="undefined"&&(a=!0),v=window.location.href,h=-1,$(window).scrollTop(0),localStorage.getItem(v)){var et=JSON.parse(localStorage.getItem(v)),tt=et.result,y=tt.split("~");y.length==2&&(h=y[0],t=parseInt(y[1]));i=h}if(p=!1,it=n.projectFolder(),a==!1&&(window.document.title=u.ProjectTitle),n.projectId(u.ProjectId),n.projectFolder(u.Project),n.project(u.Project.replace("_"," ")),n.projectTitle(u.ProjectTitle),n.scriptVersion(u.ScriptVersion),n.coreCSSUrl("~/Resources/content/styles/apex.core.css?v="+u.ScriptVersion),u.ProjectId==2?n.defaultUrl(""):n.defaultUrl("/#Apex/"+u.ProjectAlias+"/"+u.Language+"/"+u.DefaultTopicId+"/0"),n.defaultTopicId(u.DefaultTopicId),n.projectAlias(u.ProjectAlias),n.showSearchPanel(!1),n.clickableHeader(u.ClickableHeader),n.showRelatedTopicsRight(u.ShowRelatedTopicsRight),n.projectTheme(u.ProjectTheme),n.setProjectTheme(u.Project,it),n.projectTheme(u.ProjectTheme),n.language(u.Language),n.query(u.Query),n.locStrings(u.LocStrings),n.showRelatedSupportPanel(!1),n.showNavGroupPanel(!0),n.showNavPanel(!0),n.showRelatedTopicsPanel(!1),n.showRightRail(null),n.showRelatedVideosPanel(!1),n.errorTopic(!1),n.customSearchClass("SearchBoxDefault"),w=u.CustomSearchTopicKeys.split(","),w.length>0&&$.inArray(u.Query,w)>-1&&n.customSearchClass("SearchBoxCustom"),n.projectId()==2&&n.customSearchClass("SearchBoxUberHome"),n.navItemsData()==undefined?(n.navItemsData(u.HeaderNavItems),n.navItems(u.HeaderNavItems)):(n.navItemsData(null),n.navItems(null)),u.HeaderNavItems!=null?(n.navItemsData(u.HeaderNavItems),n.navItems(u.HeaderNavItems),n.showNavPanel(u.HeaderNavItems.length>0)):n.showNavPanel(!1),n.showVideoPanel(!1),n.newToProductUrl(null),u.ProjectId!=2&&(n.relatedSupportPanel(u.SupportRail),u.SupportRail!=null&&u.SupportRail.NewToProdTopicId!=null&&u.SupportRail.NewToProdTopicId.Url.length!=0&&(c=n.currentSupportMarket()==undefined?"en-us":n.currentSupportMarket(),e="/#Apex/"+u.ProjectAlias+"/"+u.Language+"/"+u.SupportRail.NewToProdTopicId.Url+"/"+c,n.newToProductUrl(e))),b=!1,u.Content==null){if(n.topicData(null),n.topicFeedback(null),n.navGroupsItem(null),n.relatedTopicsItem(null),n.relatedVideosItem(null),n.topicFileName(null),n.customSearchClass("SearchBoxDefault"),n.breadcrumbItem(null),n.showBreadcrumbItem(!1),u.Topics!==null){n.searchTopicsHistory()!=undefined&&n.searchTopicsHistory()!=null&&n.searchTopicsHistory().length>0?(u.Topics=JSON.parse(n.searchTopicsHistory()),n.setViewMoreCount(u.Topics),u.Topics.reverse(),$("#apex_search input#searchquery").val(n.query())):(n.searchTopicsHistory(JSON.stringify(u.TopicsHistory)),n.setViewMoreCount(u.TopicsHistory),u.Topics.reverse());try{rt=u.Topics.pop();n.searchTopics(rt)}catch(ht){}if(ut=t-1,u.Topics.length>0){for(o=0;o<ut;o++){var ot=u.Topics.pop(),st=n.searchTopics(),tt=st.concat(ot);n.searchTopics(tt)}n.searchTopicsStack(u.Topics);n.continuationToken(u.ContinuationToken)}n.showViewMoreButton(u.ContinuationToken||u.Topics.length>0)}u.Videos!==null&&u.Videos.length>0&&(n.showVideoPanel(!0),n.searchVideos(u.Videos),n.showMoreVideo(u.Videos.length>3));f!=undefined&&f!=null&&f.length>0&&(k=f.split(":"),k.length==2&&k[0]=="#ext"&&n.showExternalInfoLabel(!0));n.showSearchPanel(!0);$(".apex-menu").is(":hidden")&&$(".navbar-toggle").trigger("click");$(".SearchRow a.GLOSSARY_LINK").replaceWith(function(n,t){return"<span>"+t+"<\/span>"});$(window).scrollTop(h)}else{if(n.topicFeedback(null),n.topicData(u.Content.Content),window.document.title=u.Content.Title.replace(/<[^>]+>/g,""),n.showNavGroupPanel(!1),nav=u.Content.Nav,nt=u.Content.SubNav,n.topicFileName(u.Content.Filename),u.Content.Success?u.ShowFeedback==!0&&u.DefaultTopicId!=u.Query&&(b=!0,n.topicFeedback(ApexFeedbackHandler.FeedbackHtml())):n.errorTopic(!u.Content.Success),$("#apex_search input#searchquery").val(""),u.Content.NavGroups!=null&&u.Content.NavGroups.length>0&&(n.showNavGroupPanel(!0),n.showRelatedTopicsPanel(!1),n.showRightRail(null),n.showRelatedVideosPanel(!1),n.navGroupsItem(u.Content.NavGroups),n.relatedTopicsItem(null),n.relatedVideosItem(null),n.relatedTopicsTitle(""),n.relatedVideosTitle(""),l=$(".masonry-container"),l.masonry({columnWidth:".item",itemSelector:".item"}),l.masonry("destroy"),l.masonry()),u.Content.BreadCrumbItems!=null&&u.Content.BreadCrumbItems.length!=0&&u.ShowBreadCrumb?(s=u.Content.BreadCrumbItems.map(function(n){var t=Object.assign({},n);return t.Url=n.SecretKey!=null?"#apex/"+u.ProjectAlias+"/"+u.Language+"/"+n.SecretKey+"/"+u.NavItemName:"",t}),s[s.length-1].SecretKey!=u.Query&&u.Content.NavGroups==null&&s.push({Name:u.Content.Title,NameInEnglish:"",SecretKey:u.Query,Url:""}),n.breadcrumbItem(s),n.showBreadcrumbItem(!0)):(n.breadcrumbItem(null),n.showBreadcrumbItem(!1)),u.Content.RelatedTopics!=null&&u.Content.RelatedTopics.length>=0){if(n.showNavGroupPanel(!1),n.showRightRail(u.Content.IncludeRightRail&&u.Content.Success),n.showRelatedTopicsPanel(u.Content.RelatedTopics.length>0&&u.Content.Success),n.showRelatedVideosPanel(u.Content.RelatedVideos.length>0&&u.Content.Success),p=u.SupportRail!=null&&u.SupportRail.Forum.Url==""&&u.SupportRail.NewToProdImage.Url==""&&u.SupportRail.SignIn.Url==""&&u.SupportRail.SignUp.Url=="",n.showRelatedSupportPanel(!p&&u.Content.Success),n.navGroupsItem(null),n.relatedTopicsItem(u.Content.RelatedTopics),n.relatedTopicsTitle(u.Content.RelatedTopicFeature),u.Content.RelatedVideos!=null&&window.location.protocol=="https:")for(o=0;o<u.Content.RelatedVideos.length;o++)d=u.Content.RelatedVideos[0].ThumbNail,d.toLowerCase().indexOf("http")<0&&(u.Content.RelatedVideos[0].ThumbNail=n.windowsOrigin()+d);n.relatedVideosItem(u.Content.RelatedVideos);n.relatedVideosTitle(u.LocStrings.RelatedVideo);u.SupportRail.VideoDirectoryTopicId.Url.length!=0?(c=n.currentSupportMarket()==undefined?"en-us":n.currentSupportMarket(),e="/#Apex/"+n.projectAlias()+"/"+n.language()+"/"+u.SupportRail.VideoDirectoryTopicId.Url+"/"+c,n.videoDirectoryUrl(e)):n.videoDirectoryUrl(null);showIntenseDebate=!0}f!=undefined&&f!=null&&f.length>0&&(g=f.split(":"),g.length==1?n.getToAnchor(f):g[0]=="#ext"&&n.showExternalInfoLabel(!0));ApexVideoHandler.Init();ApexTabHandler.Init();ApexButtonHandler.Init();ApexVideoHandler.InitEmbedVideos();$.fn.ApexDropDown();$(".GLOSSARY_LINK").tooltip({tooltipClass:"apex-tooltip"});$("div.zoomableImage").click(function(){$(this).toggleClass("on");$(this).children(":first").toggleClass("on")});$("img.apexImgZoomable").click(function(n){n.preventDefault&&n.preventDefault();n.stopPropagation&&n.stopPropagation();$(this).toggleClass("on");$(this).parent().toggleClass("on")});$(".expando > a > span > .expando-head-bg").each(function(){$(this).parent().after(this)})}r!=n.projectId()&&(r=n.projectId(),ft=n.projectFolder()=="main"?"bing_ads":n.projectFolder(),e="/Resources/targeted/"+ft+"/"+n.language()+"/apex_suggestions.json?v=1.0.0",$("#searchquery").suggestionBox({filter:!1,widthAdjustment:-8,leftOffset:0,topOffset:1}).loadSuggestions(e));n.populateUILabels(u);n.setNavItem(n.nav(),nt);$("#ab_support_chat #lpButton3").off("DOMNodeInserted");$("#ab_support_chat #lpButton3").on("DOMNodeInserted",function(n){var t=$(n.target).attr("onclick");t.indexOf("return false;")<=0&&$(n.target).attr("onclick",t+" return false;")});a&&$("[href^='#apex']").each(function(t,i){var u=$(i).attr("href"),r;n.getWindowsOrigin();r=document.location.origin==undefined?document.location.host:document.location.origin;$(i).attr("href",r+"/"+u)});resizeApexWindow();b&&(ApexFeedbackHandler.BindEvents(),ApexFeedbackHandler.UpdateLocStrings(u.LocStrings));$("input#searchquery").focus();setTimeout(n.getApexOnDemandContent(u.Project,u.Language),2e3)};Sammy(function(){this.get("#:apex/:project/:language/:query/:nav/:market/:anchor",function(){if(n.chosenNavId(this.params.nav),n.currentNavId(this.params.nav),n.showExternalInfoLabel(!1),n.searchTopicsStack(null),n.continuationToken(null),n.searchTopics(null),n.searchTopicsHistory(null),n.searchVideos(null),n.sendApexRequest(this.params.project,this.params.language,this.params.query,this.params.nav,this.params.market,this.params.anchor),n.projectFolder()!=null&&n.projectFolder()!=undefined){var i="int:"+n.projectFolder()+":"+this.params.language+":"+this.params.query,t=this.params.anchor.split(":");t.length==2?ApexInstrumentHandler.LogAria(n.projectFolder(),n.projectFolder(),n.language(),this.params.query,"","","Page",t[1]):ApexInstrumentHandler.LogAria("Browser",n.projectFolder(),n.language(),this.params.query,"","","Anchor",t)}});this.get("#:apex/:project/:language/:query/:nav/:market",function(){var t=this.params.market;n.chosenNavId(this.params.nav);n.currentNavId(this.params.nav);n.showExternalInfoLabel(!1);n.searchTopicsStack(null);n.continuationToken(null);n.searchTopics(null);n.searchTopicsHistory(null);n.searchVideos(null);n.sendApexRequest(this.params.project,this.params.language,this.params.query,this.params.nav,t);n.projectFolder()!=null&&n.projectFolder()!=undefined&&ApexInstrumentHandler.LogAria("Browser",n.projectFolder(),this.params.language,this.params.query,"","","Page","")});this.get("#:apex/:project/:language/:query/:nav",function(){$(".in,.open").removeClass("in open");n.chosenNavId(this.params.nav);n.currentNavId(this.params.nav);n.showExternalInfoLabel(!1);n.searchTopicsStack(null);n.continuationToken(null);n.searchTopics(null);n.searchTopicsHistory(null);n.searchVideos(null);var t=this.params.nav.split("-"),t=this.params.nav.split("-"),r="",i="";t.length==2?(r=t[1],i=t[0]):i=this.params.nav;n.sendApexRequest(this.params.project,this.params.language,this.params.query,i);n.projectFolder()!=null&&n.projectFolder()!=undefined&&ApexInstrumentHandler.LogAria("Browser",n.projectFolder(),this.params.language,this.params.query,"",r,"Page","")});this.get("#:apex/:project/:language/:query",function(){n.showExternalInfoLabel(!1);var t=this.params.query;t.length==5&&/^[n][0-9]{4}/.test(t)?n.termToSearch(""):n.termToSearch(t);n.searchTopicsStack(null);n.searchTopics(null);n.searchTopicsHistory(null);n.continuationToken(null);n.searchVideos(null);n.sendApexRequest(this.params.project,this.params.language,this.params.query,"")});this.get("#:apex/:project/:language",function(){n.showExternalInfoLabel(!1);var t=n.defaultTopicId();t!=undefined&&(t.length==5&&/^[n][0-9]{4}/.test(t)?n.termToSearch(""):n.termToSearch(t));n.searchTopicsStack(null);n.searchTopics(null);n.searchTopicsHistory(null);n.continuationToken(null);n.searchVideos(null);n.sendApexRequest(this.params.project,this.params.language,"","")});this.get("",function(){n.showExternalInfoLabel(!1);n.sendApexRequest()});this.get(/.*/,function(){})}).run()};ko.bindingHandlers.insertText={init:function(n,t){var i=document.createElement("span"),r=n.firstChild;n.insertBefore(i,r);ko.applyBindingsToNode(i,{text:t()})}};ko.bindingHandlers.executeOnEnter={init:function(n,t,i,r){var u=t();$(n).keypress(function(n){return n.which===13?(u.call(r),!1):!0})}};ko.bindingHandlers.executeOnEnterForClick={init:function(n,t){var i=t();$(n).keypress(function(n){return n.which===13?($(n.target).trigger("click"),!1):!0})}};ko.bindingHandlers.autoComplete={init:function(n,t){var r=t(),u=r.selected,f=r.options,i=function(t,i){t.preventDefault();$(n).val(i.item.label);typeof i.item!="undefined"&&u(i.item)};$(n).autocomplete({source:f,select:function(n,t){i(n,t)},focus:function(n,t){i(n,t)},change:function(n,t){i(n,t)}})}};apexMainViewModel=new ApexMainViewModel;ko.applyBindings(apexMainViewModel);var apexSearchFocus=function(n){var t=n.val(),i=$(n).attr("title");t==i&&(n.val(""),n.removeClass("watermark"))},apexSearchBlur=function(n){var t=n.val();(t==null||t.length==0)&&(n.val($(n).attr("title")),n.hasClass("watermark")||n.addClass("watermark"))},keydownEscHandler=function(n){n.which===27&&$("#apex-suggestion-box").css("display")!=="none"&&($("#apex-suggestion-box").css("display","none"),$("input#searchquery").focus(),$("input#searchquery").attr("aria-activedescendant",""),$("#announce-suggestions").html(""))},apexTrapFocus=function(n,t){if(n!==null&&t!==null&&n.length==1&&t.length==1){$(n).off("keydown");$(n).on("keydown",function(i){var r=i.keyCode||i.which;r==9&&i.shiftKey&&document.activeElement.id===$(n).attr("id")&&(i.preventDefault&&i.preventDefault(),$(t).focus())});$(t).off("keydown");$(t).on("keydown",function(i){var r=i.keyCode||i.which;r!=9||i.shiftKey||(i.preventDefault&&i.preventDefault(),document.activeElement.id===$(t).attr("id")&&$(n).focus())})}},tabToSuggestions=function(){var n=$("input#searchquery"),t=$("#apex-suggestion-box");n.keydown(function(i){if(n.val()!=""&&t.is(":visible")&&i.which===9){i.preventDefault&&i.preventDefault();$("input#searchquery").blur();t.css("display","block");var r=$("#apex-suggestion-box-list li").length+" suggestions found, use tab to review";$("#announce-suggestions").html(r);$("#apex-suggestion-box-list li:first a").focus()}})};$(document).ready(function(){localStorage.clear();$(".GLOSSARY_LINK").tooltip({tooltipClass:"apex-tooltip"});$(".nav li").off("click");$(".nav li").on("click",function(n){$(".active").removeClass("active");$(this).addClass("active");n.preventDefault()});$(".more-videos").off("click");$(".more-videos").on("click",function(){$("#railContent .VideoRow.hide").each(function(n,t){return($(t).removeClass("hide").addClass("show"),n>=2)?!1:!0});$("#railContent .VideoRow.hide").length==0&&$(".more-videos").hide()});$("#apex_search input#searchsubmit").off("click");$("#apex_search input#searchsubmit").on("click",function(){$(this).hasClass("clearbutton")?($("#apex_search input#searchsubmit").removeClass("clearbutton").attr({tabindex:"-1","aria-hidden":"true"}),$("#apex_search input#searchquery").val("").focus()):apexMainViewModel.searchTerm()});$("#apex_search input#searchquery").off("input");$("#apex_search input#searchquery").on("input",function(){$("#apex_search input#searchquery").val()?$("#apex_search input#searchsubmit").addClass("clearbutton").attr({tabindex:"0","aria-hidden":"false"}):$("#apex_search input#searchsubmit").removeClass("clearbutton").attr({tabindex:"-1","aria-hidden":"true"})});$("#apex_search input#searchquery").focus(function(){tabToSuggestions()});$(document).off("keydown",keydownEscHandler);$(document).on("keydown",keydownEscHandler);$(window).resize(function(){resizeApexWindow()});WcpConsent.init("en-US","cookie-banner",function(n,t){if(n!=undefined)return error;siteConsent=t;siteConsent.isConsentRequired&&($("#cookie-banner #wcpConsentBannerCtrl").is(":visible")&&($("body").css("padding-top","115px"),$("#apexbody .header").css("margin-top","66px")),$("#cookieManageConsent").show())},ApexCookieBannerHandler.OnConsentChanged)});var _megaInstIdKey="mega",toggleElementDisplay=function(n){var t;typeof n=="object"?t=n.id:typeof n=="string"&&(t=n);t!=""&&t!=null&&($("#"+t).toggle(),t.indexOf(_megaInstIdKey)>-1)},toggleImg=function(n,t,i){var r=$("#"+n);if(r.length>0){var u=t.lastIndexOf("/"),f=u!=-1?t.substring(u+1,t.length):t,e=r.attr("src");r.attr("src",e.indexOf(f)>-1?i:t)}},ApexHelper=function(){return{}};(function(n){n.fn.AutoSizeIFrame=function(t){return n.fn.AutoSizeIFrame.glb.opts=n.extend({},n.fn.AutoSizeIFrame.defaults,t),n.fn.AutoSizeIFrame.glb.myThis=this,n.fn.AutoSizeIFrame.glb.resizeTimeout=null,n.fn.AutoSizeIFrame.glb.resizeCount=0,this.each(function(){var t=n(this);if(t[0].tagName===undefined||t[0].tagName.toLowerCase()!=="iframe")return!1;resizeMaxTry=n.fn.AutoSizeIFrame.glb.opts.resizeMaxTry;n.fn.AutoSizeIFrame.glb.myThis.elem=t;n.fn.AutoSizeIFrame.resizeIframe();n(elem).on("load",function(){n.fn.AutoSizeIFrame.resizeIframe(t)});return t.data("AutoSizeIFrame",n.fn.AutoSizeIFrame.glb.myThis),!0})};var r=function(){var r,f,u;try{r=n.fn.AutoSizeIFrame.glb.myThis.elem;i(r);f=200;r.css("height")===f+"px"&&i();r.get(0).contentWindow.document.body!==null?(u=n(r.get(0).contentWindow.document).height(),u<=f?t(r):u>f&&r.height(u).css("height",u+n.fn.AutoSizeIFrame.glb.opts.offset)):t(r)}catch(e){}},t=function(t){var i=3e3;n.fn.AutoSizeIFrame.glb.resizeCount<=n.fn.AutoSizeIFrame.glb.opts.resizeMaxTry?(n.fn.AutoSizeIFrame.glb.resizeCount++,n.fn.AutoSizeIFrame.glb.resizeTimeout=setTimeout("$.fn.AutoSizeIFrame.resizeIframe()",n.fn.AutoSizeIFrame.glb.opts.resizeWaitTime)):(clearTimeout(n.fn.AutoSizeIFrame.glb.resizeTimeout),n.fn.AutoSizeIFrame.glb.resizeCount=0,t.height(i).css("height",i))},u=function(n){window.console&&window.console.log&&window.console.log(n)},i=function(n){n.css("height","").removeAttr("height")};n.fn.AutoSizeIFrame.resizeIframe=function(){r();n(".idc-r").off("click");n(".idc-r").on("click",function(){})};n.fn.AutoSizeIFrame.glb={opts:null,myThis:null,resizeTimeout:null,resizeCount:0};n.fn.AutoSizeIFrame.defaults={resizeMaxTry:5,resizeWaitTime:100,offset:0}})(jQuery),function(n){n.fn.suggestionBox=function(t){function s(){g="#";f=-1;u.find("li").removeClass("selected")}function ft(){var n=u.find("li").size();f===n-1?s():f++}function et(){f>0?f--:f==-1?f=u.find("li").size()-1:s()}function ot(){u.css("display","none");window.location=g}function st(t){tt=r.val();n.ajax({url:t,data:nt,dataType:"json",success:function(n){var t=!0,u=f;e.results&&n.results&&(t=JSON.stringify(e.results[f])!==JSON.stringify(n.results[f]));w(n);ut();u>-1&&r.val()===tt&&!t&&(f=u);i.ajaxSuccess(n)},error:function(n){i.ajaxError(n)}})}function ht(t){var i=n(t.target).parent("li");return i.parent().children().index(i)}function c(){var t=o(r,"border-bottom-width")+o(r,"border-top-width"),f=o(r,"padding-bottom")+o(r,"padding-top"),n=r.offset().top;n==0&&(n=124);u.css({position:"fixed",left:r.offset().left+i.leftOffset,top:n+(r.height()+t+f+i.topOffset)})}function o(n,t){return parseInt(n.css(t).replace("px",""))}function h(){i.fadeOut?u.fadeOut():u.css("display","none");s();n("#announce-suggestions").html("No suggestions available. Suggestion list hidden.");n(".apex_search_box input#searchquery").attr("aria-expanded","false")}function it(){c();i.fadeIn?u.fadeIn():u.css("display","block");n(".apex_search_box input#searchquery").attr("aria-expanded","true")}function rt(){var n=ct()+i.widthAdjustment;i.menuWidth=="auto"?u.css({"min-width":n}):i.menuWidth=="constrain"&&u.css({width:n})}function ct(){return r.width()+o(r,"border-left-width")+o(r,"border-right-width")+o(r,"padding-left")+o(r,"padding-right")}function lt(t){var r='<ul id="apex-suggestion-box-list" role="listbox">',f=apexMainViewModel.project()=="main"?"ads":apexMainViewModel.projectAlias(),u=apexMainViewModel.project()=="main"?"bing_ads":apexMainViewModel.projectFolder();return n.each(t.results,function(t,e){var s,o;if(e.suggestion&&e.url)y=!0,s="",e.attr&&n.each(e.attr,function(n,t){for(var r=Object.keys(t),i=0;i<r.length;i++)s+=r[i]+'="'+t[r[i]]+'" '}),e.video==""?r+='<li role="listitem"><span class="apex-topic"/><span><a href="/#apex/'+f+"/"+apexMainViewModel.language()+"/"+e.url+"/"+e.nav+'" id="suggestion-'+e.url+'" class="apex-suggestion-item" tabindex="0" role="option" secretkey="'+e.url+'">'+e.suggestion+"<\/a><\/span><\/li>":(o=e.video.split("~"),r+=o.length==2&&o[1]!==undefined?'<li role="listitem"><span class="apex-video" videoid="'+o[0]+'" op_videoid="'+o[1]+'" project="'+u+'" language="'+apexMainViewModel.language()+'"/><span class="apex-video-text"><a href="#"  id="suggestion-'+e.url+'" class="apex-suggestion-item" tabindex="0" role="option" videoid="'+o[0]+'" op_videoid="'+o[1]+'" project="'+u+'" language="'+apexMainViewModel.language()+'">'+e.suggestion+"<\/a><\/span><\/li>":'<li role="listitem"><span class="apex-video" videoid="'+e.video+'" project="'+u+'" language="'+apexMainViewModel.language()+'"/><span class="apex-video-text"><a href="#" id="suggestion-'+e.url+'" class="apex-suggestion-item" tabindex="0" role="option" videoid="'+e.video+'" project="'+u+'" language="'+apexMainViewModel.language()+'">'+e.suggestion+"<\/a><\/span><\/li>");else return!1;if(t===i.results-1)return!1}),r+="<\/ul>"}function ut(){var t,f,o,c,l;if(s(),y=!1,t=i.filter?vt(r.val()):e,t&&t.results&&(f=lt(t)),p){if(y){u.html(f);n("#apex-suggestion-box-list li span[videoid], #apex-suggestion-box-list li a[videoid]").off("click");n("#apex-suggestion-box-list li span[videoid], #apex-suggestion-box-list li a[videoid]").on("click",function(n){n.preventDefault();ApexVideoHandler.ShowVideo(n)});rt();it();o=n("#apex-suggestion-box-list li").length+" suggestions found, use tab to review";n("#announce-suggestions").html(o)}else i.showNoSuggestionsMessage&&r.val().length>0?(rt(),it(),u.html('<div id="no-suggestions">'+i.noSuggestionsMessage+"<\/div>")):h();c=n("#apex-suggestion-box-list li:first a");l=n("#apex-suggestion-box-list li:last a");apexTrapFocus(c,l);n("#apex-suggestion-box-list li a").focus(function(){n("input#searchquery").attr("aria-activedescendant",n(this).attr("id"))});n("#apex-suggestion-box-list li a").blur(function(t){setTimeout(function(){document.activeElement.className!=t.target.className&&(h(),n(".apex_search_box input#searchquery").attr("aria-activedescendant",""))},1)})}else h()}function w(t){t&&t.results.length>0?(e=t instanceof Object?t:n.parseJSON(t),i.filter=!0):(e={},i.filter=!1)}function at(t){n.ajax({url:t,dataType:"json",success:function(n){w(n)},error:function(n){console.log(n)}})}function vt(t){var r,u,f;return(t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),filterPattern=i.filterPattern.replace("{INPUT}",t),!t)?{}:(e&&e.results&&(u=new RegExp(filterPattern,"i"),r=n.grep(e.results,function(n){return u.test(n.suggestion)})),i.sort&&r.sort(i.sort),f=JSON.stringify({results:r}),n.parseJSON(f))}var r=this,i=n.extend({topOffset:0,leftOffset:0,widthAdjustment:0,delay:400,heading:"Suggestions",results:10,fadeIn:!0,fadeOut:!1,menuWidth:"auto",showNoSuggestionsMessage:!1,noSuggestionsMessage:"No Suggestions Found",filter:!1,filterPattern:"({INPUT})",ajaxError:function(n){console.log(n)},ajaxSuccess:function(){},enterKeyAction:function(){ot()},paramName:"search"},t),u;n("#apex-suggestion-box").length>0&&n("#apex-suggestion-box").remove();n("body").append('<div id="apex-suggestion-box"><\/div><div id="announce-suggestions" class="screen-reader-only" aria-live="assertive" tabindex="-1" aria-hidden="true"><\/div>');r.attr("autocomplete","off");u=n("#apex-suggestion-box");c();var l=13,b=38,k=40,d=27,f=-1,g="#",a=!1,v=null,y=!1,p=!1,nt={},e={},tt;u.on({mousemove:function(n){n.target.nodeName==="A"&&(f=ht(n),a=!0)},mouseout:function(n){n.target.nodeName==="A"&&(a=!1,s())},click:function(n){n.target.nodeName==="A"&&u.css("display","none")}});r.on({blur:function(){p=!1;a||h()},focus:function(){p=!0},keyup:function(n){n.which!==b&&n.which!==k&&n.which!==d&&n.which!==l?(i.url&&(s(),v&&clearTimeout(v)),i.url&&(nt[i.paramName]=r.val(),v=setTimeout(function(){st(i.url)},i.delay)),i.filter&&ut()):n.which==l&&h()},keydown:function(n){u.css("display")!=="none"&&(n.which==k&&(n.preventDefault(),ft()),n.which==b&&(n.preventDefault(),et()),n.which===l&&f>-1&&(n.preventDefault(),i.enterKeyAction()),n.which==d&&(n.preventDefault(),h()))},paste:function(){setTimeout(function(){r.keyup()},200)}});return n(window).resize(function(){c()}),n(window).scroll(function(){c();var t=parseInt(n("#apex-suggestion-box").css("top"),10),i=n(window).scrollTop(),r=t-i;n("#apex-suggestion-box").css("top",r)}),{loadSuggestions:function(n){return at(n),this},addSuggestions:function(n){return w(n),this}}}}(jQuery);window.onload=onPageLoad,function(n){n.version="2.1.3"}(clienttelemetry_build||(clienttelemetry_build={})),function(n){(function(n){var t,i;(function(n){n[n.BT_STOP=0]="BT_STOP";n[n.BT_STOP_BASE=1]="BT_STOP_BASE";n[n.BT_BOOL=2]="BT_BOOL";n[n.BT_UINT8=3]="BT_UINT8";n[n.BT_UINT16=4]="BT_UINT16";n[n.BT_UINT32=5]="BT_UINT32";n[n.BT_UINT64=6]="BT_UINT64";n[n.BT_FLOAT=7]="BT_FLOAT";n[n.BT_DOUBLE=8]="BT_DOUBLE";n[n.BT_STRING=9]="BT_STRING";n[n.BT_STRUCT=10]="BT_STRUCT";n[n.BT_LIST=11]="BT_LIST";n[n.BT_SET=12]="BT_SET";n[n.BT_MAP=13]="BT_MAP";n[n.BT_INT8=14]="BT_INT8";n[n.BT_INT16=15]="BT_INT16";n[n.BT_INT32=16]="BT_INT32";n[n.BT_INT64=17]="BT_INT64";n[n.BT_WSTRING=18]="BT_WSTRING";n[n.BT_UNAVAILABLE=127]="BT_UNAVAILABLE"})(n.BondDataType||(n.BondDataType={}));t=n.BondDataType,function(n){n[n.MARSHALED_PROTOCOL=0]="MARSHALED_PROTOCOL";n[n.MAFIA_PROTOCOL=17997]="MAFIA_PROTOCOL";n[n.COMPACT_PROTOCOL=16963]="COMPACT_PROTOCOL";n[n.JSON_PROTOCOL=21322]="JSON_PROTOCOL";n[n.PRETTY_JSON_PROTOCOL=20554]="PRETTY_JSON_PROTOCOL";n[n.SIMPLE_PROTOCOL=20563]="SIMPLE_PROTOCOL"}(n.ProtocolType||(n.ProtocolType={}));i=n.ProtocolType})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){(function(n){(function(n){var i=function(){function n(){this._buffer=[]}return n.prototype.Add=function(n){for(var t=0;t<this._buffer.length;++t)if(this._buffer[t]==n)break;t==this._buffer.length&&this._buffer.push(n)},n.prototype.Count=function(){return this._buffer.length},n.prototype.GetBuffer=function(){return this._buffer},n}(),t;n.Set=i;t=function(){function n(){this._buffer=[]}return n.prototype.Add=function(n,t){this._getIndex(n)==-1&&this._buffer.push({Key:n,Value:t})},n.prototype.AddOrReplace=function(n,t){var i=this._getIndex(n);i>=0?this._buffer[i]={Key:n,Value:t}:this._buffer.push({Key:n,Value:t})},n.prototype.Remove=function(n){var t=this._getIndex(n);t>=0&&this._buffer.splice(t,1)},n.prototype.Count=function(){return this._buffer.length},n.prototype.GetBuffer=function(){return this._buffer},n.prototype._getIndex=function(n){for(var t=0,i=-1;t<this._buffer.length;++t)if(this._buffer[t].Key==n){i=t;break}return i},n}();n.Map=t})(n.Collections||(n.Collections={}));var t=n.Collections})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){(function(t){var r,u,i;(function(n){var h=function(){function n(){}return n.GetBytes=function(n){for(var t,i=[],r=0;r<n.length;++r)t=n.charCodeAt(r),t<128?i.push(t):t<2048?i.push(192|t>>6,128|t&63):t<55296||t>=57344?i.push(224|t>>12,128|t>>6&63,128|t&63):(t=65536+((t&1023)<<10|n.charCodeAt(++r)&1023),i.push(240|t>>18,128|t>>12&63,128|t>>6&63,128|t&63));return i},n}(),r,u,f,e,o,s;n.Utf8=h;r=function(){function n(){}return n.GetString=function(n){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=[],f=n.length%3,r,e=function(n){return[t.charAt(n>>18&63),t.charAt(n>>12&63),t.charAt(n>>6&63),t.charAt(n&63)].join("")},u=0,o=n.length-f;u<o;u+=3)r=(n[u]<<16)+(n[u+1]<<8)+n[u+2],i.push(e(r));switch(f){case 1:r=n[n.length-1];i.push(t.charAt(r>>2));i.push(t.charAt(r<<4&63));i.push("==");break;case 2:r=(n[n.length-2]<<8)+n[n.length-1];i.push(t.charAt(r>>10));i.push(t.charAt(r>>4&63));i.push(t.charAt(r<<2&63));i.push("=")}return i.join("")},n}();n.Base64=r;u=function(){function n(){}return n.GetBytes=function(n){for(var t=[];n&4294967168;)t.push(n&127|128),n>>>=7;return t.push(n&127),t},n}();n.Varint=u;f=function(){function n(){}return n.GetBytes=function(n){for(var t=n.low,i=n.high,r=[];i||4294967168&t;)r.push(t&127|128),t=(i&127)<<25|t>>>7,i>>>=7;return r.push(t&127),r},n}();n.Varint64=f;e=function(){function n(){}return n.GetBytes=function(n){var u,f,r;if(t.BrowserChecker.IsDataViewSupport()){for(u=new DataView(new ArrayBuffer(4)),u.setFloat32(0,n,!0),f=[],r=0;r<4;++r)f.push(u.getUint8(r));return f}return i.ConvertNumberToArray(n,!1)},n}();n.Float=e;o=function(){function n(){}return n.GetBytes=function(n){var u,f,r;if(t.BrowserChecker.IsDataViewSupport()){for(u=new DataView(new ArrayBuffer(8)),u.setFloat64(0,n,!0),f=[],r=0;r<8;++r)f.push(u.getUint8(r));return f}return i.ConvertNumberToArray(n,!0)},n}();n.Double=o;s=function(){function n(){}return n.EncodeZigzag16=function(n){return n=t.Number.ToInt16(n),n<<1^n>>15},n.EncodeZigzag32=function(n){return n=t.Number.ToInt32(n),n<<1^n>>31},n.EncodeZigzag64=function(n){var f=n.low,e=n.high,r=e<<1|f>>>31,u=f<<1,i;return e&2147483648&&(r=~r,u=~u),i=new t.UInt64("0"),i.low=u,i.high=r,i},n}();n.Zigzag=s})(t.Encoding||(t.Encoding={}));r=t.Encoding,function(r){var h=function(){function n(){}return n.GetString=function(n){for(var t,u,f,r=[],i=0;i<n.length;++i)if(t=n[i],t<=191)r.push(String.fromCharCode(t));else if(t<=223)u=n[++i],r.push(String.fromCharCode((t&31)<<6|u&63));else if(t<=239)u=n[++i],f=n[++i],r.push(String.fromCharCode((t&15)<<12|(u&63)<<6|f&63));else{var u=n[++i],f=n[++i],e=n[++i];t=(t&7)<<18|(u&63)<<12|(f&63)<<6|e&63;t-=65536;r.push(String.fromCharCode(55296|t>>10&1023));r.push(String.fromCharCode(56320|t&1023))}return r.join("")},n}(),u,f,e,o,s;r.Utf8=h;u=function(){function n(){}return n.GetBytes=function(n){for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=[],t=0;t<n.length;++t){var o=i.indexOf(n.charAt(t++)),f=i.indexOf(n.charAt(t++)),u=i.indexOf(n.charAt(t++)),e=i.indexOf(n.charAt(t));r.push(o<<2|f>>4);u>=0&&(r.push(f<<4&240|u>>2),e>=0&&r.push(u<<6&192|e))}return r},n}();r.Base64=u;f=function(){function t(){}return t.GetInt64=function(t){var i=new n.Bond.Int64("0"),r=this._Read(t);return i.low=r[0],r.length>1&&(i.high=r[1]),i},t.GetNumber=function(n){return this._Read(n)[0]},t._Read=function(n){for(var f=[],r=0,u=!0,i=0,t;u;)if(t=n.shift(),u=(t&128)!=0,t=t&127,i<28)r|=t<<i,i+=7;else{r|=t<<i;f.push(r);r=t>>4;i=3;break}while(u)if(t=n.shift(),u=(t&128)!=0,t=t&127,r|=t<<i,i+=7,i>=32)break;return f.push(r),f},t}();r.Varint=f;e=function(){function n(){}return n.GetNumber=function(n){var u,r;if(t.BrowserChecker.IsDataViewSupport()){for(u=new DataView(new ArrayBuffer(4)),r=0;r<4;++r)u.setUint8(r,n[r]);return u.getFloat32(0,!0)}return i.ConvertArrayToNumber(n,!1)},n}();r.Float=e;o=function(){function n(){}return n.GetNumber=function(n){var u,r;if(t.BrowserChecker.IsDataViewSupport()){for(u=new DataView(new ArrayBuffer(8)),r=0;r<8;++r)u.setUint8(r,n[r]);return u.getFloat64(0,!0)}return i.ConvertArrayToNumber(n,!0)},n}();r.Double=o;s=function(){function t(){}return t.DecodeZigzag16=function(n){return((65535&n)>>>1^-(n&1))<<16>>16},t.DecodeZigzag32=function(n){return n>>>1^-(n&1)},t.DecodeZigzag64=function(t){var f=t.high&1,u=t.high>>>1,e=t.low&1,i=t.low>>>1,r;return i=f<<31|i,e&&(i^=4294967295,u^=4294967295),r=new n.Bond.UInt64("0"),r.low=i,r.high=u,r},t}();r.Zigzag=s}(t.Decoding||(t.Decoding={}));u=t.Decoding;i=function(){function n(){}return n.ConvertNumberToArray=function(n,t){var r,h,v,f,s,e;if(!n)return t?this._doubleZero:this._floatZero;var w=t?11:8,p=t?52:23,o=(1<<w-1)-1,b=1-o,k=o,y=n<0?1:0;n=Math.abs(n);for(var c=Math.floor(n),l=n-c,a=2*(o+2)+p,u=new Array(a),i=0;i<a;)u[i++]=0;for(i=o+2;i&&c;)u[--i]=c%2,c=Math.floor(c/2);for(i=o+1;i<a-1&&l>0;)l*=2,l>=1?(u[++i]=1,--l):u[++i]=0;for(r=0;r<a&&!u[r];++r);if(h=o+1-r,v=r+p,u[v+1]){for(i=v;i>r;--i)if(u[i]=1-u[i])break;i==r&&++h}if(h>k||c)return y?t?this._doubleNegInifinity:this._floatNegInifinity:t?this._doubleInifinity:this._floatInifinity;if(h<b)return t?this._doubleZero:this._floatZero;if(t){for(f=0,i=0;i<20;++i)f=f<<1|u[++r];for(s=0;i<52;++i)s=s<<1|u[++r];return f|=h+o<<20,f=y<<31|f&2147483647,[s&255,s>>8&255,s>>16&255,s>>>24,f&255,f>>8&255,f>>16&255,f>>>24]}for(e=0,i=0;i<23;++i)e=e<<1|u[++r];return e|=h+o<<23,e=y<<31|e&2147483647,[e&255,e>>8&255,e>>16&255,e>>>24]},n.ConvertArrayToNumber=function(n,i){var c=i?11:8,l=(1<<c-1)-1,a=(n[i?7:3]&128)!=0,e=i?(n[7]&127)<<4|(n[6]&240)>>4:(n[3]&127)<<1|(n[2]&128)>>7,u,f,o,s,h,r;if(e==255)throw new t.Exception("Not a valid float/double buffer.");if(u=1,f=1,i){if(o=(n[6]&15)<<28|(n[5]&255)<<20|(n[4]&255)<<12,s=n[3]<<24|(n[2]&255)<<16|(n[1]&255)<<8|n[0]&255,!e&&!o&&!s)return 0;for(r=0;r<20;++r)f/=2,o<0&&(u+=f),o<<=1;for(r=0;r<32;++r)f/=2,s<0&&(u+=f),s<<=1}else{if(h=(n[2]&127)<<25|(n[1]&255)<<17|(n[0]&255)<<9,!e&&!h)return 0;for(r=0;r<23;++r)f/=2,h<0&&(u+=f),h<<=1}return u*=Math.pow(2,e-l),a?0-u:u},n._floatZero=[0,0,0,0],n._doubleZero=[0,0,0,0,0,0,0,0],n._floatInifinity=[0,0,128,127],n._floatNegInifinity=[0,0,128,255],n._doubleInifinity=[0,0,0,0,0,0,240,127],n._doubleNegInifinity=[0,0,0,0,0,0,240,255],n}()})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){(function(n){(function(t){var i=function(){function t(){this._buffer=[]}return t.prototype.WriteByte=function(t){this._buffer.push(n.Number.ToByte(t))},t.prototype.Write=function(n,t,i){while(i--)this.WriteByte(n[t++])},t.prototype.GetBuffer=function(){return this._buffer},t}();t.MemoryStream=i})(n.IO||(n.IO={}));var t=n.IO})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){(function(n){var c=function(){function n(n,t){this.Type=n;this.Id=t}return n}(),t,i,r,u,f,e,o,s,h;n.FieldTag=c;t=function(){function n(n,t){this.ElementType=n;this.Size=t}return n}();n.ContainerTag=t;i=function(){function n(n,t,i){this.KeyType=n;this.ValueType=t;this.Size=i}return n}();n.KeyValueContainerTag=i;r=function(){function n(){}return n}();n.Bonded=r;u=function(){function n(n){this.low=0;this.high=0;this.low=parseInt(n);this.low<0&&(this.high=-1)}return n.prototype.Equals=function(t){var i=new n(t);return this.low==i.low&&this.high==i.high},n}();n.Int64=u;f=function(){function n(n){this.low=0;this.high=0;this.low=parseInt(n)}return n.prototype.Equals=function(t){var i=new n(t);return this.low==i.low&&this.high==i.high},n}();n.UInt64=f;e=function(){function n(){}return n.ToByte=function(n){return this.ToUInt8(n)},n.ToInt8=function(n){var t=(n&128)<<24>>24;return n&127|t},n.ToInt16=function(n){var t=(n&32768)<<16>>16;return n&32767|t},n.ToInt32=function(n){var t=n&2147483648;return n&2147483647|t},n.ToUInt8=function(n){return n&255},n.ToUInt16=function(n){return n&65535},n.ToUInt32=function(n){return n&4294967295},n}();n.Number=e;o=function(){function n(n){this.Message=n}return n}();n.Exception=o;s=function(){function n(){}return n}();n.KeyValuePair=s;h=function(){function n(){}return n.IsDataViewSupport=function(){return typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"},n}();n.BrowserChecker=h})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){(function(n){var i=function(){function t(n){this._stream=n}return t.prototype.WriteBlob=function(n){this._stream.Write(n,0,n.length)},t.prototype.WriteBool=function(n){this._stream.WriteByte(n?1:0)},t.prototype.WriteContainerBegin=function(n,t){this.WriteUInt8(t);this.WriteUInt32(n)},t.prototype.WriteMapContainerBegin=function(n,t,i){this.WriteUInt8(t);this.WriteUInt8(i);this.WriteUInt32(n)},t.prototype.WriteContainerEnd=function(){},t.prototype.WriteDouble=function(t){var i=n.Encoding.Double.GetBytes(t);this._stream.Write(i,0,i.length)},t.prototype.WriteFloat=function(t){var i=n.Encoding.Float.GetBytes(t);this._stream.Write(i,0,i.length)},t.prototype.WriteFieldBegin=function(n,t){t<=5?this._stream.WriteByte(n|t<<5):t<=255?(this._stream.WriteByte(n|192),this._stream.WriteByte(t)):(this._stream.WriteByte(n|224),this._stream.WriteByte(t),this._stream.WriteByte(t>>8))},t.prototype.WriteFieldEnd=function(){},t.prototype.WriteFieldOmitted=function(){},t.prototype.WriteInt16=function(t){t=n.Encoding.Zigzag.EncodeZigzag16(t);this.WriteUInt16(t)},t.prototype.WriteInt32=function(t){t=n.Encoding.Zigzag.EncodeZigzag32(t);this.WriteUInt32(t)},t.prototype.WriteInt64=function(t){this.WriteUInt64(n.Encoding.Zigzag.EncodeZigzag64(t))},t.prototype.WriteInt8=function(t){this._stream.WriteByte(n.Number.ToInt8(t))},t.prototype.WriteString=function(t){if(t=="")this.WriteUInt32(0);else{var i=n.Encoding.Utf8.GetBytes(t);this.WriteUInt32(i.length);this._stream.Write(i,0,i.length)}},t.prototype.WriteStructBegin=function(){},t.prototype.WriteStructEnd=function(n){this.WriteUInt8(n?1:0)},t.prototype.WriteUInt16=function(t){var i=n.Encoding.Varint.GetBytes(n.Number.ToUInt16(t));this._stream.Write(i,0,i.length)},t.prototype.WriteUInt32=function(t){var i=n.Encoding.Varint.GetBytes(n.Number.ToUInt32(t));this._stream.Write(i,0,i.length)},t.prototype.WriteUInt64=function(t){var i=n.Encoding.Varint64.GetBytes(t);this._stream.Write(i,0,i.length)},t.prototype.WriteUInt8=function(t){this._stream.WriteByte(n.Number.ToUInt8(t))},t.prototype.WriteWString=function(n){var t,i;for(this.WriteUInt32(n.length),t=0;t<n.length;++t)i=n.charCodeAt(t),this._stream.WriteByte(i),this._stream.WriteByte(i>>>8)},t}(),t;n.CompactBinaryProtocolWriter=i;t=function(){function n(){}return n}();n.CompactBinaryProtocolReader=t})(n.Bond||(n.Bond={}));var t=n.Bond}(Microsoft||(Microsoft={})),function(n){var t=function(){function n(){}return n.IsSafari=function(){return n._isSafari===null&&n._DetectBrowser(),n._isSafari},n.ajax=function(t){var i=n._createConnection(),r,u;if(!i.setRequestHeader&&t.headers){r="read-from-query-string-instead-of-headers=true";for(u in t.headers)r+="&",r+=encodeURIComponent(u),r+="=",r+=encodeURIComponent(t.headers[u]);t.url+=t.url.indexOf("?")<0?"?":"&";t.url+=r}if(i.open(t.type,t.url),i.setRequestHeader&&t.headers)for(u in t.headers)i.setRequestHeader(u,t.headers[u]);t.complete&&(i.onload=function(){typeof i.status=="undefined"&&(i.status=200);t.complete(i)},i.ontimeout=function(){typeof i.status=="undefined"&&(i.status=500);t.complete(i)},i.onerror=function(){t.complete(i)});i.send(t.data)},n.keys=function(n){var t,i;if(Object.keys)return Object.keys(n);t=[];for(i in n)n.hasOwnProperty(i)&&t.push(i);return t},n.IsUsingXDomainRequest=function(){if(n._usingXDomainRequest==null){var t=new XMLHttpRequest;n._usingXDomainRequest=typeof t.withCredentials=="undefined"&&typeof XDomainRequest!="undefined"?!0:!1}return n._usingXDomainRequest},n._createConnection=function(){var t=new XMLHttpRequest;return n.IsUsingXDomainRequest()?new XDomainRequest:t},n._DetectBrowser=function(){var t=navigator.userAgent.toLowerCase();n._isSafari=t.indexOf("safari")>=0&&t.indexOf("chrome")<0?!0:!1},n._isSafari=null,n._usingXDomainRequest=null,n}();n.Utils=t}(sct||(sct={})),function(n){(function(n){(function(n){(function(t){var i=function(){function n(){}return n.GetGuid=function(){var n=function(){return Math.floor((1+Math.random())*65536).toString(16).substring(1,5)};return[n(),n(),"-",n(),n(),"-",n(),"-",n(),n()].join("")},n.GetTimeStamp=function(){var t=(new Date).getTime(),n=new Microsoft.Bond.Int64("0");return n.low=t&4294967295,n.high=Math.floor(t/4294967296),n},n.GetTimeStampWithValue=function(n){var t=new Microsoft.Bond.Int64("0");return t.low=n&4294967295,t.high=Math.floor(n/4294967296),t},n}(),o,s,h,r,u,f,e;t.utils=i,function(n){n[n.NotSet=0]="NotSet";n[n.Event=1]="Event";n[n.PerformanceCounter=2]="PerformanceCounter";n[n.Anomaly=3]="Anomaly";n[n.Prediction=4]="Prediction";n[n.TraceLog=5]="TraceLog";n[n.EventSourceLog=6]="EventSourceLog";n[n.HttpLog=7]="HttpLog";n[n.PerformanceCounterAzure=8]="PerformanceCounterAzure";n[n.PerformanceCounterGfs=9]="PerformanceCounterGfs"}(t.RecordType||(t.RecordType={}));o=t.RecordType,function(n){n[n.NotSet=0]="NotSet";n[n.O365=1]="O365";n[n.SkypeBI=2]="SkypeBI";n[n.SkypeData=3]="SkypeData"}(t.PIIScrubber||(t.PIIScrubber={}));s=t.PIIScrubber,function(n){n[n.NotSet=0]="NotSet";n[n.DistinguishedName=1]="DistinguishedName";n[n.GenericData=2]="GenericData";n[n.IPV4Address=3]="IPV4Address";n[n.IPv6Address=4]="IPv6Address";n[n.MailSubject=5]="MailSubject";n[n.PhoneNumber=6]="PhoneNumber";n[n.QueryString=7]="QueryString";n[n.SipAddress=8]="SipAddress";n[n.SmtpAddress=9]="SmtpAddress";n[n.Identity=10]="Identity";n[n.Uri=11]="Uri";n[n.Fqdn=12]="Fqdn";n[n.IPV4AddressLegacy=13]="IPV4AddressLegacy"}(t.PIIKind||(t.PIIKind={}));h=t.PIIKind;r=function(){function n(){this.ScrubType=0;this.Kind=0;this.RawContent=""}return n.prototype.Write=function(n){this.WriteImpl(n,!1)},n.prototype.WriteImpl=function(n,t){n.WriteStructBegin(null,t);this.ScrubType!=0?(n.WriteFieldBegin(16,1,null),n.WriteInt32(this.ScrubType),n.WriteFieldEnd()):n.WriteFieldOmitted(16,1,null);this.Kind!=0?(n.WriteFieldBegin(16,2,null),n.WriteInt32(this.Kind),n.WriteFieldEnd()):n.WriteFieldOmitted(16,2,null);this.RawContent!=""?(n.WriteFieldBegin(9,3,null),n.WriteString(this.RawContent),n.WriteFieldEnd()):n.WriteFieldOmitted(9,3,null);n.WriteStructEnd(t)},n.prototype.Read=function(n){this.ReadImpl(n,!1)},n.prototype.ReadImpl=function(){},n}();t.PII=r;u=function(){function t(){this.Id=i.GetGuid();this.Timestamp=i.GetTimeStamp();this.Type="";this.EventType="";this.Extension=new Microsoft.Bond.Collections.Map;this.RecordType=0;this.PIIExtensions=new Microsoft.Bond.Collections.Map}return t.prototype.AddOrReplacePII=function(t,i,r){var u=new n.datamodels.PII;u.RawContent=i;u.Kind=r;u.ScrubType=1;this.PIIExtensions.AddOrReplace(t,u)},t.prototype.Write=function(n){this.WriteImpl(n,!1)},t.prototype.WriteImpl=function(n,t){var i,r;if(n.WriteStructBegin(null,t),this.Id!=""?(n.WriteFieldBegin(9,1,null),n.WriteString(this.Id),n.WriteFieldEnd()):n.WriteFieldOmitted(9,1,null),this.Timestamp.Equals("0")?n.WriteFieldOmitted(17,3,null):(n.WriteFieldBegin(17,3,null),n.WriteInt64(this.Timestamp),n.WriteFieldEnd()),this.Type!=""?(n.WriteFieldBegin(9,5,null),n.WriteString(this.Type),n.WriteFieldEnd()):n.WriteFieldOmitted(9,5,null),this.EventType!=""?(n.WriteFieldBegin(9,6,null),n.WriteString(this.EventType),n.WriteFieldEnd()):n.WriteFieldOmitted(9,6,null),this.Extension.Count()){for(n.WriteFieldBegin(13,13,null),n.WriteMapContainerBegin(this.Extension.Count(),9,9),i=0;i<this.Extension.GetBuffer().length;++i)n.WriteString(this.Extension.GetBuffer()[i].Key),n.WriteString(this.Extension.GetBuffer()[i].Value);n.WriteContainerEnd();n.WriteFieldEnd()}else n.WriteFieldOmitted(13,13,null);if(this.RecordType!=0?(n.WriteFieldBegin(16,24,null),n.WriteInt32(this.RecordType),n.WriteFieldEnd()):n.WriteFieldOmitted(16,24,null),this.PIIExtensions.Count()){for(n.WriteFieldBegin(13,30,null),n.WriteMapContainerBegin(this.PIIExtensions.Count(),9,10),r=0;r<this.PIIExtensions.GetBuffer().length;++r)n.WriteString(this.PIIExtensions.GetBuffer()[r].Key),this.PIIExtensions.GetBuffer()[r].Value.WriteImpl(n,!1);n.WriteContainerEnd();n.WriteFieldEnd()}else n.WriteFieldOmitted(13,30,null);n.WriteStructEnd(t)},t.prototype.Read=function(n){this.ReadImpl(n,!1)},t.prototype.ReadImpl=function(){},t}();t.Record=u;f=function(){function n(){this.Source="";this.DataPackageId="";this.Timestamp=new Microsoft.Bond.Int64("0");this.Records=[]}return n.prototype.Write=function(n){this.WriteImpl(n,!1)},n.prototype.WriteImpl=function(n,t){if(n.WriteStructBegin(null,t),this.Source!=""?(n.WriteFieldBegin(9,2,null),n.WriteString(this.Source),n.WriteFieldEnd()):n.WriteFieldOmitted(9,2,null),this.DataPackageId!=""?(n.WriteFieldBegin(9,5,null),n.WriteString(this.DataPackageId),n.WriteFieldEnd()):n.WriteFieldOmitted(9,5,null),this.Timestamp.Equals("0")?n.WriteFieldOmitted(17,6,null):(n.WriteFieldBegin(17,6,null),n.WriteInt64(this.Timestamp),n.WriteFieldEnd()),this.Records.length){n.WriteFieldBegin(11,8,null);n.WriteContainerBegin(this.Records.length,10);for(var i=0;i<this.Records.length;++i)this.Records[i].WriteImpl(n,!1);n.WriteContainerEnd();n.WriteFieldEnd()}else n.WriteFieldOmitted(11,8,null);n.WriteStructEnd(t)},n.prototype.Read=function(n){this.ReadImpl(n,!1)},n.prototype.ReadImpl=function(){},n}();t.DataPackage=f;e=function(){function n(){this.DataPackages=[];this.RequestRetryCount=0}return n.prototype.Write=function(n){this.WriteImpl(n,!1)},n.prototype.WriteImpl=function(n,t){if(n.WriteStructBegin(null,t),this.DataPackages.length){n.WriteFieldBegin(11,1,null);n.WriteContainerBegin(this.DataPackages.length,10);for(var i=0;i<this.DataPackages.length;++i)this.DataPackages[i].WriteImpl(n,!1);n.WriteContainerEnd();n.WriteFieldEnd()}else n.WriteFieldOmitted(11,1,null);this.RequestRetryCount!=0?(n.WriteFieldBegin(16,2,null),n.WriteInt32(this.RequestRetryCount),n.WriteFieldEnd()):n.WriteFieldOmitted(16,2,null);n.WriteStructEnd(t)},n.prototype.Read=function(n){this.ReadImpl(n,!1)},n.prototype.ReadImpl=function(){},n}();t.ClientToCollectorRequest=e})(n.datamodels||(n.datamodels={}));var t=n.datamodels})(n.telemetry||(n.telemetry={}));var t=n.telemetry})(n.applications||(n.applications={}));var t=n.applications}(microsoft||(microsoft={})),function(n){(function(n){(function(n){(function(t){var h,c,i,u,f,r,e,o,s;(function(n){n[n.SENT=0]="SENT";n[n.SEND_FAILED=1]="SEND_FAILED"})(t.CallbackEventType||(t.CallbackEventType={}));h=t.CallbackEventType,function(n){n[n.DATARV_ERROR_OK=0]="DATARV_ERROR_OK";n[n.DATARV_ERROR_INVALID_EVENT=1]="DATARV_ERROR_INVALID_EVENT";n[n.DATARV_ERROR_INVALID_CONFIG=2]="DATARV_ERROR_INVALID_CONFIG";n[n.DATARV_ERROR_INVALID_DEPENDENCIES=3]="DATARV_ERROR_INVALID_DEPENDENCIES";n[n.DATARV_ERROR_INVALID_STATUS=4]="DATARV_ERROR_INVALID_STATUS";n[n.DATARV_ERROR_INVALID_ARG=5]="DATARV_ERROR_INVALID_ARG"}(t.DATARV_ERROR||(t.DATARV_ERROR={}));c=t.DATARV_ERROR;i=function(){function n(n){this._errorCode=0;this._errorCode=n}return n.prototype.ErrorCode=function(){return this._errorCode},n.prototype.toString=function(){switch(this._errorCode){case 0:return"DATARV_ERROR_OK";case 1:return"Event is invalid. Either event.Id is empty, or event.Timestamp is empty, or event.EventType is empty.";case 2:return"Invalid configuration. CollectorUrl is missing.";case 3:return"DATARV_ERROR_INVALID_DEPENDENCIES";case 4:return"Telemetry Manager is not initialized.";case 5:return"TenantToken is null or empty, or events is null.";default:return"Unknown error"}},n}();t.Exception=i;u=function(){function n(){}return n}();t.TelemetryConfig=u;f=function(){function n(){}return n.CreateTelemetryManager=function(){return new o},n}();t.TelemetryManagerFactory=f;r=function(){function n(){}return n.MaxPackageSizeInBytes=function(){return 3e6},n.TimeIntervalForNextSendInMS=function(){return 2e3},n}(),function(n){n[n.Created=0]="Created";n[n.Initialized=1]="Initialized";n[n.Started=2]="Started"}(e||(e={}));o=function(){function t(){this._MaxPackageSizeInBytes=r.MaxPackageSizeInBytes();this._listeners=[];this._status=0;this._ecsClient=null;this._etag=null;this._ecsCallback=null;this._testServerResponseHook=null}return t.prototype.Initialize=function(n){if(this._status!=0)throw new i(4);if(!n||!n.collectorUrl)throw new i(2);this._config=n;this._Reset();this._status=1;n.ecsClient&&(this._Verbose("ECS object assigned. Do integration"),this._ecsClient=n.ecsClient);this._Verbose("Initialize() done")},t.prototype.AddListener=function(n){if(this._status<1)throw new i(4);this._Verbose(["AddListener(), status: ",this._status," old length: ",this._listeners.length," func: ",n].join(""));for(var t=0;t<this._listeners.length;++t)if(this._listeners[t]==n){this._Verbose("the listener has been added already, index: "+t);return}this._listeners.push(n);this._Verbose("AddListener() done, the new length: "+this._listeners.length)},t.prototype.RemoveListener=function(n){if(this._status<1)throw new i(4);this._Verbose(["RemoveListener(), status: ",this._status," old length: ",this._listeners.length," func: ",n].join(""));for(var t=0;t<this._listeners.length;++t)if(this._listeners[t]==n){this._listeners.length==1?this._listeners=[]:t==this._listeners.length-1?this._listeners.pop():this._listeners[t]=this._listeners.pop();this._Verbose(["this listener has been found, index: ",t,"new length: ",this._listeners.length].join(""));return}this._Verbose("listener isn't been found, new length"+this._listeners.length)},t.prototype.Start=function(){if(this._status<1)throw new i(4);this._Verbose(["Start(), status:",this._status,"tag:",t._tag].join(" "));this._status>=2&&this._Verbose("Start() already, ignore");this._ecsClient&&(this._ecsCallback=this._CreateEcsCallback(),this._ecsClient.AddListener(this._ecsCallback),this._etag=this._ecsClient.GetETag());++t._tag;this._status=2;this._Verbose(["Start() done, status: ",this._status,"tag: ",t._tag].join(""))},t.prototype.Stop=function(){if(this._status<1)throw new i(4);if(this._Verbose("Stop(), status: "+this._status),this._status==1){this._Verbose("Stop() already, ignore");return}this._Reset();this._status=1;this._Verbose("Stop() done, status: "+this._status)},t.prototype.SendAsync=function(n,r){if(this._status<1)throw new i(4);if(this._Verbose(["SendAsync(), status:",this._status,"tenantToken:",n,"count:",r.length].join(" ")),this._status<2)return this._Info("SendAsync(), not started, ignore, return false"),!1;if(!n||!r){this._Error("SendAsync(), tenantToken or events is null or empty");throw new i(5);}for(var u=0;u<r.length;++u)if(!r[u].Id||!t._eventTypeRegex.test(r[u].EventType)||r[u].Timestamp.Equals("0")){this._Error(["eventId:",r[u].Id,"eventType:",r[u].EventType,"timestamp high:",r[u].Timestamp.high,"timestamp low:",r[u].Timestamp.low].join(""));throw new i(1);}return this._eventsCache.AddEvents(n,r),this._Verbose(["SendAsync(), currentTimer: ",this._timer,"eventsCacheIsEmpty",this._eventsCache.IsEmpty()].join(" ")),this._eventsCache.IsEmpty()||this._timer||this._ScheduleTimer(!1),this._Verbose("SendAsync() done"),!0},t.prototype._WorkThread=function(){var e=this,n,i,f,r,u;try{if(this._Verbose("_WorkThread, status: "+this._status),this._status<2){this._Verbose("_WorkThread, status is not started, return");return}if(n=this._eventsCache.DequeuEvents(),n==null){this._Verbose("_WorkThread, No events found, return");this._CleanTimer();return}if(i=this._PackEvents(n.tenantToken,n.events),this._eventsCache.AddEvents(n.tenantToken,i.remainedEvents),this._testServerResponseHook){f=this._testServerResponseHook();setTimeout(this._SendCallback(u,n.tenantToken,i.sendEvents,f),100);return}r={type:"POST",url:this._config.collectorUrl,processData:!1,headers:{"content-type":"application/bond-compact-binary","Client-ID":"NO_AUTH"},complete:function(t){return e._SendCallback(u,n.tenantToken,i.sendEvents,t)}};sct.Utils.IsSafari()||typeof Uint8Array=="undefined"?(this._Verbose("Uint8Array is undefined, send with base64 encode."),r.data=Microsoft.Bond.Encoding.Base64.GetString(i.buffer),r.headers={"content-type":"application/bond-compact-binary","content-encoding":"base64","Client-ID":"NO_AUTH"}):(this._Verbose("Uint8Array is defined, send with binary format directly."),r.data=new Uint8Array(i.buffer));n.tenantToken&&(r.headers["x-apikey"]=n.tenantToken);u=t._tag;this._lastActiveTime=(new Date).getTime();sct.Utils.ajax(r);this._Verbose("_Workthread, send via jquery, tag: "+u)}catch(o){this._Error("_WorkThread, exception: "+o)}},t.prototype._PackEvents=function(t,i){var e,u,f,r,o;for(this._Verbose("_PackageEvents, total Count: "+i.length),e=new n.datamodels.ClientToCollectorRequest,u=new n.datamodels.DataPackage,u.Source="JS_default_source",u.DataPackageId=n.datamodels.utils.GetGuid(),u.Timestamp=n.datamodels.utils.GetTimeStamp(),r=i,i=[];;){if(u.Records=[],u.Records.push.apply(u.Records,r),e.DataPackages=[],e.DataPackages.push(u),f=this._Serialize(e),this._Verbose(["_PackageEvents, sendEvents.length:",r.length,"buffer.length:",f.length,"MaxPackageSize:",this._MaxPackageSizeInBytes].join("")),r.length==1||f.length<this._MaxPackageSizeInBytes)break;o=r.splice(0,Math.floor(r.length/2));this._Verbose("_PackageEvents, too large, package again");i.push.apply(i,r);r=o}return this._Verbose(["_PakcageEvents done, sendEventsCount:",r.length,"buffer.length:",f.length,"remained events:",i.length].join("")),{buffer:f,sendEvents:r,remainedEvents:i}},t.prototype._Serialize=function(n){var t=new Microsoft.Bond.IO.MemoryStream,i=new Microsoft.Bond.CompactBinaryProtocolWriter(t);return n.Write(i),t.GetBuffer()},t.prototype._SendCallback=function(n,i,r,u){var e,f;if(this._Verbose(["_SendCallback","tag:",n,"current tag:",t._tag,"tenantToken:",i,"events count:",r.length,"jqXHR:",u].join("")),e=u!=null&&u.status>=200&&u.status<300,this._status<2||n<t._tag){this._Verbose("_SendCallback, is not started, or tag is not the same, return");return}if(!e&&(!u||u.status&&u.status!=400)){this._Verbose("retry statusCode: "+(u?u.status:0));this._eventsCache.AddEvents(i,r);this._ScheduleTimer(!0);return}for(f=0;f<this._listeners.length;++f)this._listeners[f](e?0:1,u?u.status:0,i,r);this._eventsCache.IsEmpty()?(this._Verbose("eventsCache is empty, stop schedule"),this._CleanTimer()):(this._Verbose("eventsCache is not empty, schedule for next run"),this._ScheduleTimer(!1))},t.prototype._CleanTimer=function(){this._Verbose("_CleanTimer(), timer: "+this._timer);this._timer&&(clearTimeout(this._timer),this._timer=null)},t.prototype._ScheduleTimer=function(n){var i=this,t;if(this._Verbose("_ScheduleTimer: isRetry: "+n),this._CleanTimer(),n)this._Verbose("_ScheduleTimer, current factor: "+this._rescheduleFactor),t=Math.floor(5*this._rescheduleFactor*(1+Math.random())),this._timer=setTimeout(function(){return i._WorkThread()},t*1e3),this._Verbose("_ScheduleTimer, next try (s): "+t),this._rescheduleFactor<<=1,this._rescheduleFactor>64&&(this._rescheduleFactor=1);else{var t=0,f=(new Date).getTime(),u=f-this._lastActiveTime;t=u>r.TimeIntervalForNextSendInMS()?0:r.TimeIntervalForNextSendInMS()-u;this._timer=setTimeout(function(){return i._WorkThread()},t);this._Verbose("_ScheduleTimer, next try: "+t);this._rescheduleFactor=1}},t.prototype._Verbose=function(n){this._config.log&&this._config.log.Verbose("[TelemetryManagerImpl]: "+n)},t.prototype._Info=function(n){this._config.log&&this._config.log.Info("[TelemetryManagerImpl]: "+n)},t.prototype._Error=function(n){this._config.log&&this._config.log.Error("[TelemetryManagerImpl]: "+n)},t.prototype._Reset=function(){this._Verbose("Reset()");this._CleanTimer();this._lastActiveTime=0;this._rescheduleFactor=1;this._sendingEvents=[];this._eventsCache=new s;this._ecsClient&&(this._ecsClient.RemoveListener(this._ecsCallback),this._ecsCallback=null)},t.prototype._CreateEcsCallback=function(){var n=this;return function(t){t==0&&(n._etag=n._ecsClient.GetETag())}},t.prototype.__GetListenerArray=function(){return this._listeners},t.prototype.__GetTotalEventsCount=function(){return this._eventsCache.GetTotalEventsCount()},t.prototype.__IsScheduled=function(){return this._timer!=null},t.prototype.__ChageMaxPackageSizeInKB=function(n){this._MaxPackageSizeInBytes=n*1024},t.prototype.__SetTestServerResponseHook=function(n){this._testServerResponseHook=n},t._eventTypeRegex=/^[a-zA-Z0-9]([a-zA-Z0-9]|_){2,98}[a-zA-Z0-9]$/,t._tag=0,t}();s=function(){function n(){this._events={};this._tokens=[]}return n.prototype.AddEvents=function(n,t){t.length&&(this._events[n]||(this._events[n]=[],this._tokens.push(n)),this._events[n].push.apply(this._events[n],t))},n.prototype.IsEmpty=function(){return this._tokens.length==0},n.prototype.DequeuEvents=function(){if(this._tokens.length==0)return null;var n=this._tokens.shift(),t=this._events[n];return delete this._events[n],{tenantToken:n,events:t}},n.prototype.GetTotalEventsCount=function(){var n=0;for(var t in this._events)n+=this._events[t].length;return n},n}()})(n._sender||(n._sender={}));var t=n._sender})(n.telemetry||(n.telemetry={}));var t=n.telemetry})(n.applications||(n.applications={}));var t=n.applications}(microsoft||(microsoft={})),function(n){(function(n){(function(n){var t=n._sender.TelemetryManagerFactory.CreateTelemetryManager(),r=function(){function r(){}return r.initialize=function(n){if(!this._initialized){if(!n)throw new i(1);this._defaultToken=n;this._config.collectorUrl||(this._config.collectorUrl="https://pipe.skype.com/Collector/3.0/");t.Initialize(this._config);t.Start();this._initialized=!0}},r.addCallbackListener=function(n){this._initialized&&t.AddListener(n)},r.isInitialized=function(){return this._initialized},r.getDefaultToken=function(){return this._defaultToken},r.__setCollectorUrlToInt=function(){this._config.collectorUrl="https://pipe.int.trafficmanager.net/Collector/3.0/"},r.__backToUninitialized=function(){this._config=new n._sender.TelemetryConfig;t=n._sender.TelemetryManagerFactory.CreateTelemetryManager();this._initialized=!1},r._initialized=!1,r._defaultToken=null,r._config=new n._sender.TelemetryConfig,r}(),f,u,e,o,i;n.LogManager=r;f=function(){function f(t){this._initId=n.datamodels.utils.GetGuid();this._sequence=0;this._tenantToken=null;this._contextProperties=new u;this._tenantToken=t?t:r.getDefaultToken()}return f.prototype.logEvent=function(n){if(r.isInitialized()){if(!n.name)throw new i(2);var t=this._createEventRecord(n.name,"Custom");this._addCustomPropertiesToEvent(t,n);this._sendRecord(t)}},f.prototype.setContext=function(n,t,i){this._contextProperties.setProperty(n,t,i)},f.prototype._createEventRecord=function(t,i){var r=new n.datamodels.Record,u;return r.EventType=t.toString().toLowerCase(),r.Type=i,r.Extension.Add("EventInfo.Source","JS_default_source"),r.Extension.Add("EventInfo.InitId",this._initId),this._sequence++,r.Extension.Add("EventInfo.Sequence",this._sequence.toString()),r.Extension.Add("EventInfo.Name",t.toString().toLowerCase()),u=new Date,r.Timestamp=n.datamodels.utils.GetTimeStampWithValue(u.getTime()),r.Extension.Add("EventInfo.Time",u.toISOString()),r.Extension.Add("EventInfo.SdkVersion","ACT-JS-"+clienttelemetry_build.version),r},f.prototype._addCustomPropertiesToEvent=function(n,t){this._addEventPropertiesToEvent(n,this._contextProperties);this._addEventPropertiesToEvent(n,t)},f.prototype._addEventPropertiesToEvent=function(t,i){var r,u;if(i.timestamp&&i.timestamp>=new Date("1/1/2000").getTime()&&(t.Timestamp=n.datamodels.utils.GetTimeStampWithValue(i.timestamp),t.Extension.AddOrReplace("EventInfo.Time",new Date(i.timestamp).toISOString())),r=i.properties,r&&r.length>0)for(u=0;u<r.length;u++)r[u].key&&typeof r[u].key=="string"&&r[u].value&&typeof r[u].value=="string"&&(this._isPii(r[u].pii)?(t.AddOrReplacePII(r[u].key,r[u].value,r[u].pii),t.Extension.Remove(r[u].key)):(t.Extension.AddOrReplace(r[u].key,r[u].value),t.PIIExtensions.Remove(r[u].key)))},f.prototype._isPii=function(t){var i,r;if(t==(null||undefined||0))return!1;i=!1;for(r in n.datamodels.PIIKind)isNaN(r)||r==t&&(i=!0);return i},f.prototype._sendRecord=function(n){t.SendAsync(this._tenantToken,[n])},f}();n.Logger=f;u=function(){function n(){this.name=null;this.timestamp=null;this.properties=[]}return n.prototype.setProperty=function(t,r,u){if(!t||!n._propertyNameRegex.test(t))throw new i(3);r&&(u?this.properties.push({key:t,value:r.toString(),pii:u!=0?u:null}):this.properties.push({key:t,value:r.toString(),pii:null}))},n._propertyNameRegex=/^[a-zA-Z0-9](([a-zA-Z0-9|_|.]){0,98}[a-zA-Z0-9])?$/,n}();n.EventProperties=u;e=function(){function n(){this.key=null;this.value=null;this.pii=null}return n}();n.Property=e,function(n){n[n.INVALID_TENANT_TOKEN=1]="INVALID_TENANT_TOKEN";n[n.MISSING_EVENT_PROPERTIES_NAME=2]="MISSING_EVENT_PROPERTIES_NAME";n[n.INVALID_PROPERTY_NAME=3]="INVALID_PROPERTY_NAME"}(n.TelemetryError||(n.TelemetryError={}));o=n.TelemetryError;i=function(){function n(n){this.errorCode=null;this.errorCode=n}return n.prototype.ErrorCode=function(){return this.errorCode},n.prototype.toString=function(){switch(this.errorCode){case 1:return"Invalid tenant token";case 2:return"Eventproperties.name can not be null or empty";case 3:return"Invalid Key. Key does not conform to regular expression ^[a-zA-Z0-9]([a-zA-Z0-9]|_|.){2,198}[a-zA-Z0-9]$";default:return"Unknown error"}},n}();n.Exception=i})(n.telemetry||(n.telemetry={}));var t=n.telemetry})(n.applications||(n.applications={}));var t=n.applications}(microsoft||(microsoft={}))