function createDeviceRotationEvent(){window.addEventListener("resize",function(){waitForFinalEvent(function(){setupDeviceOrientation()},200,Math.random().toString())},!1)}function setupDeviceOrientation(){var n=PROACTIVE_CHAT.GetSessionKey("contactDrawerState"),t=$(window).width()-($(".contact-drawer").offset().left+$(".contact-drawer").outerWidth());window.innerHeight>window.innerWidth?(isObjOnObj()||n!=="open"||PROACTIVE_CHAT.OpenProactiveChatDrawer(!0,!1),isObjOnObj()&&n==="closed"&&PROACTIVE_CHAT.CloseProactiveChatDrawer()):(n==="open"&&t!==0&&PROACTIVE_CHAT.OpenProactiveChatDrawer(!0,!1),n==="closed"&&t===0&&PROACTIVE_CHAT.OpenProactiveChatDrawer(!0,!1))}function isObjOnObj(){var n=document.getElementById("smalldevicesChatIcon"),t=document.getElementById("contact-drawer"),i=t.offsetLeft,r=t.offsetLeft+t.offsetWidth,u=n.offsetLeft,f=n.offsetLeft+n.offsetWidth,e=t.offsetTop,o=t.offsetTop+t.offsetHeight,s=n.offsetTop,h=n.offsetTop+n.offsetHeight;return u>r||fo||hi&&ui&&fe&&se&&h1?i:"auto",t.attr("width",i)),f||(r=t.height(),r=r&&r>1?r:"auto",t.attr("height",r)))})}function f(t,i){var f=t||n("img.lazy"),e=i!==undefined?i:!0,u=null;r(f);f.lazyload({effect:"fadeIn",threshold:200,failure_limit:5,skip_invisible:e,appear:function(){var t=n(this);u!=null&&(clearTimeout(u),u=null);u=setTimeout(function(){t.trigger("lazy.img.load.complete")},500)}});f.trigger("scroll")}function o(){var t=n("img.ondemand");r(t);t.each(function(){var t=n(this),i=t.attr("data-ondemand"),r=t.attr("data-eventtype"),u=n("[data-"+i+"]");u.off(r+".ondemand").on(r+".ondemand",function(){var t=n('img[data-ondemand="'+i+'"]');t.each(function(){var t=n(this),i;n.inviewport(t,{})&&(i=t.attr("data-original"),t.attr("src",i),t.removeAttr("data-original"))})})})}function s(n){for(var i,r=0,u=n.length;r0?(u?(r.css({position:"fixed",left:"50%","margin-left":-t(r).width()/2}),o=t(n).width()-(r.offset().left+r.outerWidth())):o=-260,h=o==-260?"+=260px":"+="+(o+260)+"px",r.removeAttr("style"),r.addClass("animating").css("right","-260px").animate({right:h},f)):(u?(r.css({position:"fixed",bottom:"0"}),l=0):l="-"+e,h=l=="-"+e?"+="+e+"px":"+="+e+"px",r.removeAttr("style"),r.addClass("animating").css("bottom","-"+e+"px").animate({bottom:h},f));setTimeout(function(){r.removeClass("animating");g.addClass("dellmetrics-chatdrawerclose")},f);c("contactDrawerState","open",s);a="contactDrawerAutoOpenCount";i&&(a="contactDrawerClickedOpenCount");tt(a)},bt=function(){clearTimeout(p);var u,i=t(n).width()-(r.offset().left+r.outerWidth());t(".contact-drawer").offset().left>0?(u=i===0?"-=260px":"-="+(i+260)+"px",r.addClass("animating").css("right",i).animate({right:u},f)):r.addClass("animating").animate({bottom:"-="+e},f);setTimeout(function(){r.removeClass("animating");g.removeClass("dellmetrics-chatdrawerclose");r.removeClass("is-open");nt.removeClass("is-open")},f);c("contactDrawerState","closed",s)},w=function(){var n=!0,t=o("contactDrawerIsHardClosed");return t&&(n=!1),n},kt=function(n){clearTimeout(p);var t=o("contactDrawerClickedOpenCount"),i=typeof t=="undefined"?!0:!1;p=setTimeout(function(){w()&&ut(!1,i)},n)},ft=function(n){return n===undefined||n==null||n.length<=0?!0:!1},dt=function(){var n=(typeof apiBaseUrl!="undefined"?apiBaseUrl:serverUrls.apiServiceUrl)+"personalization/getusercontext";t.ajax({url:n,xhrFields:{withCredentials:!0},success:function(n){if(n){var i="";_contactDrawerConfig&&(n.WarmState?(i=_contactDrawerConfig.MicroContent.PersonalizedLabelWithCategoryName,ft(i)&&(i=_contactDrawerConfig.MicroContent.PersonalizedLabelWithoutCategoryName),i=ft(i)?_contactDrawerConfig.MicroContent.SubtitleLabel:i.replace("{0}",n.DisplayName)):i=_contactDrawerConfig.MicroContent.SubtitleLabel);t("#chat-drawer-personalize-message-subtitle").html(i)}else t("#chat-drawer-personalize-message-subtitle").html(_contactDrawerConfig.MicroContent.SubtitleLabel)},error:function(){t("#chat-drawer-personalize-message-subtitle").html(_contactDrawerConfig.MicroContent.SubtitleLabel)}})},gt=function(){if(!n.MoxieData){n.MoxieData={};var t=Dell.Metrics.sc;MoxieData.country=t.country;MoxieData.language=t.language;MoxieData.segment=t.segment.indexOf("gen")!==-1?"corp":t.segment}},et=function(){if(!b){gt();var n=document.createElement("script");n.src=_contactDrawerConfig.MoxieConciergeUrl;n.type="text/javascript";n.setAttribute("data-concierge-host",_contactDrawerConfig.MoxieHost);n.setAttribute("data-client",_contactDrawerConfig.MoxieTenant);n.setAttribute("concierge","1");n.setAttribute("defer","true");document.getElementsByTagName("body")[0].appendChild(n);b=!0}},ni=function(n){for(var t,r=n+"=",u=document.cookie.split(";"),i=0;i0)i.on("click",function(n){n.preventDefault();r.addClass("cd__drawer-moxie-loading");k=!0;var t=it();t?(r.removeClass("cd__drawer-moxie-loading"),rt(t)):(r.addClass("cd__drawer-moxie-loading"),et())})}};return y&&(n.addEventListener("GoMoxie:conciergeReady",at),n.addEventListener("unload",ui)),i.Init=function(){if(i.SetSessionKey("contactDrawerState","closed",i.StorageExpirationTime),createDeviceRotationEvent(),chatDrawerPersonalizeMessageEnabled==="True"&&dt(),fi(y),u&&!(u<=0)&&d&&!(h<=0))if(_contactDrawerConfig.EnabledBehavior.PopOutOnLoad)i.OpenAndCloseProactiveChatDrawer(),setInterval(function(){i.OpenAndCloseProactiveChatDrawer()},u+h);else var n=setTimeout(function(){i.OpenAndCloseProactiveChatDrawer();clearTimeout(n);setInterval(function(){i.OpenAndCloseProactiveChatDrawer()},u+h)},u)},i.ClearSession=function(){yt()},i.SetSessionKey=function(n,t,i){c(n,t,i)},i.GetSessionKey=function(n){return o(n)},i.ClearSessionKey=function(n){pt(n)},i.IsExistingSession=function(){return wt()},i.OpenAndCloseProactiveChatDrawer=function(){var n=i.AreBizRulesMet(),r=t("#nit-alme-window-root").is(":visible");n&&!r&&(i.OpenProactiveChatDrawer(!1,!1),setTimeout(function(){i.CloseProactiveChatDrawer()},h))},i.OpenProactiveChatDrawer=function(n,t){ut(n,t)},i.CloseProactiveChatDrawer=function(){bt()},i.IncrementDrawerOpenCounter=function(n){tt(n)},i.ResetTimeOut=function(){kt(u);u=setTimeout(function(){w&&i.OpenProactiveChatDrawer(!1,!1)},h)},i.AreBizRulesMet=function(){return w()},i.StorageExpirationTime=function(){return s},i.DrawerAutoOpenTimeToWait=function(){return u},i}(window,$);waitForFinalEvent=function(){var n={};return function(t,i,r){r||(r="Don't call this twice without a uniqueId");n[r]&&clearTimeout(n[r]);n[r]=setTimeout(t,i)}}();$(".contact-drawer-tab, .smalldevices-chat-icon").on("click",function(n){var t=$(this),i=t.parent(),r=PROACTIVE_CHAT.GetSessionKey("contactDrawerState");if(i.hasClass("animating")){n.preventDefault();n.stopImmediatePropagation();return}r==="closed"?PROACTIVE_CHAT.OpenProactiveChatDrawer(!0,!1):PROACTIVE_CHAT.CloseProactiveChatDrawer();PROACTIVE_CHAT.SetSessionKey("contactDrawerIsHardClosed",!0,PROACTIVE_CHAT.StorageExpirationTime())});$(".hide-drawer").on("click",function(){var t=$(".contact-drawer").offset().left,n;t>0?(n=$(window).width()-($(".contact-drawer").offset().left+$(".contact-drawer").outerWidth()),$(".contact-drawer").removeAttr("style"),$(".contact-drawer").css({right:n}),PROACTIVE_CHAT.CloseProactiveChatDrawer()):PROACTIVE_CHAT.CloseProactiveChatDrawer();PROACTIVE_CHAT.SetSessionKey("contactDrawerIsHardClosed",!0,PROACTIVE_CHAT.StorageExpirationTime())});_contactDrawerConfig&&PROACTIVE_CHAT.Init()