var Query,Dell;shopApp.directive("ngModelOnblur",function(){return{restrict:"A",require:"ngModel",link:function(n,t,i,r){i.type!=="radio"&&i.type!=="checkbox"&&(t.unbind("input").unbind("keydown").unbind("change"),t.bind("blur",function(){n.$apply(function(){r.$setViewValue(t.val())})}))}}});shopApp.service("httpBackgroundService",["$http",function(n){n.defaults.useXDomain=!0;delete n.defaults.headers.common["X-Requested-With"];this.getProductFamilyNextLevelData=function(t,i,r){var u=new Query({baseurl:t,success:i,error:r});u.get(n)};this.validateServicetag=function(t,i,r){var u=new Query({baseurl:t,success:i,error:r});u.get(n)}}]);shopApp.controller("pfydController",["$scope","$http","httpBackgroundService",function(n,t,i){"use strict";n.showLoadingIconServiceTag=!1;n.showLoadingIconPartNumber=!1;n.showLoadingIconFamily=!1;var r=function(){$(".alertMsg").hide();$("#lvl1-active").show();$("#lvl1-hyper-active").hide();$("#lvl2-active").hide();$("#mlvl1-active").show();$("#mlvl1-hyper-active").hide();$("#mlvl2-active").hide();n.model=rawModelData;n.prevSelectedProductProductFamily=jQuery.extend(!0,{},rawModelData.ProductFamily);n.curSelectedProductName="";n.serviceTagInput="";n.partNumInput=""}();n.onCategoryDropdownClick=function(t){var r=t.category.Title,i;$("#selectedItemTitle").text(r);typeof dellmetrics_trackdata=="function"&&window.dellmetrics_trackdata("pfydcatsel:"+r.toLowerCase());i=t.category.CTA;!i||n.redirectToResult(i)};n.onServicetagSearchClick=function(){var t,r;n.showLoadingIconServiceTag=!0;n.hideServicetagErrorMessage();t=n.serviceTagInput.trim();typeof dellmetrics_trackdata=="function"&&window.dellmetrics_trackdata("pfydsvcsearch:"+t);n.isValidatServiceTag(t)?(r=$("#stValidationBtn").data("validation-api").trim(),r=r.replace("{st}",t),i.validateServicetag(r,function(i){n.STValidation=i.data;n.showLoadingIconServiceTag=!1;!i||!i.data||i.data.Status!=!0?n.showServicetagErrorMessage('"'+t+'"',i.data.Message):n.redirectToResult(i.data.ServiceTagValidationInfo.CTA)},function(){n.showServicetagErrorMessage()})):n.showServicetagErrorMessage(null,"Please enter valid Service Tag")};n.onPartNumberProductNameSearchClick=function(){if(n.showLoadingIconPartNumber=!0,typeof dellmetrics_trackdata=="function"&&window.dellmetrics_trackdata("pfydpartsearch:"+n.partNumInput.trim()),!n.partNumInput||!n.partNumInput.trim())n.showLoadingIconPartNumber=!1,n.showSearchErrorMessage(null,"Plase enter valid Product name or Part number");else{var t=$("#partNumSearch").data("search-uri").trim();t=t.replace("{searchString}",encodeURIComponent(n.partNumInput.trim()));n.showLoadingIconPartNumber=!1;n.redirectToResult(t)}};n.redirectToResult=function(n){window.location.href=n};n.createErrorObject=function(t,i){var r={};return r.Message_icon="icon-small-alertnotice",r.Message_title=!t?"Warning!":t,r.Type="attention",r.Message=!i?"We apologize for the inconvenience, however an error has occurred and we cannot proceed. Please try again later.":i,n.showLoadingIconPartNumber=!1,n.showLoadingIconServiceTag=!1,n.showLoadingIconFamily=!1,r};n.showServicetagErrorMessage=function(t,i){n.STValidation=n.createErrorObject(t,i);$("#stValidationMsg").show();$("#stValidationMsgMb").show()};n.hideServicetagErrorMessage=function(){$("#stValidationMsg").hide();$("#stValidationMsgMb").hide()};n.showSearchErrorMessage=function(t,i){n.partValidationMsg=n.createErrorObject(t,i);$("#partValidationMsg").show();$("#partValidationMsgMb").show()};n.hideSearchErrorMessage=function(){$("#partValidationMsg").hide();$("#partValidationMsgMb").hide()};n.isValidatServiceTag=function(n){return!n||n.search("^[a-zA-Z0-9]*$")==-1?!1:!0};n.onProductFamilyItemClick=function(t){n.showLoadingIconFamily=!0;var r=t.product.CTA;!r||r.toLowerCase().indexOf("pfydresults/")==-1?i.getProductFamilyNextLevelData(r,function(i){n.curSelectedProductName=t.product.Title;n.model.ProductFamily.ProductFamilies=i.data.ProductFamilies;$("#lvl1-active").hide();$("#lvl1-hyper-active").show();$("#lvl2-active").show();$("#mlvl1-active").hide();$("#mlvl1-hyper-active").show();$("#mlvl2-active").show();n.showLoadingIconFamily=!1},function(){n.showLoadingIconFamily=!1;alert("We apologize for the inconvenience, however an error has occurred and we cannot proceed. Please try again later.")}):(r=r.replace("/{st}",""),n.showLoadingIconFamily=!1,n.redirectToResult(r))};n.onPrevProductFamilyClicked=function(){n.showLoadingIconFamily=!0;n.model.ProductFamily=jQuery.extend(!0,{},n.prevSelectedProductProductFamily);n.curSelectedProductName="";$("#lvl1-active").show();$("#lvl1-hyper-active").hide();$("#lvl2-active").hide();$("#mlvl1-active").show();$("#mlvl1-hyper-active").hide();$("#mlvl2-active").hide();n.showLoadingIconFamily=!1};n.onServicetagInputChanged=function(){};n.onPartNumInputChanged=function(){}}]);Query=function(n){var t=serverUrls.apiServiceUrl;$.extend(this,n)};!function(n){n.get=function(n){var t=this;!!this.finalUrl||this.prepare();n.get(this.finalUrl).then(function(n){t.result=n;!t.success||t.success(n)},function(n){t.result=n;!t.error||t.error(n)})};n.post=function(n,t,i){var r=this;!!this.finalUrl||prepare();n.post(this.finalUrl,t,i).then(function(n){r.result=n;!r.success||r.success(n)},function(n){r.result=n;!r.error||r.error(n)})};n.put=function(){!!this.finalUrl||prepare()};n.delete=function(){!!this.finalUrl||prepare()};n.prepare=function(){this.baseurl=this.buildUrl();this.urlDomainBuilder()};n.urlDomainBuilder=function(){this.finalUrl=serverUrls.apiServiceUrl+this.baseurl};n.buildUrl=function(){var t,n,i;return this.baseurl==null?null:(this.params?(n="",_.each(_.keys(this.params),function(t,i){i==0?n=t+"="+this.params[t]:n+="&"+t+"="+this.params[t]},this),n?(i=this.baseurl.indexOf("?")==-1?"?":"",t=this.baseurl+i+n):t=this.baseurl):t=this.baseurl,t)}}(Query.prototype);Dell=window.Dell||{};Dell.Transactional=Dell.Transactional||{};Dell.Transactional.PfydCarousel=Dell.Transactional.PfydCarousel||{},function(n){(function(){this.init=function(){var t=n("#pfydCarousel"),o=t.width(),s=parseInt(t.find(".stack").css("margin-left"),10)+parseInt(t.find(".stack").css("margin-right"),10),h=t.find(".stack").width()+s,u=t.find(".stack").length,f=Math.floor(o/h),c=t.find(".item").eq(0).find(".stack").length,e,r,i;if(f>c){for(e=t.find(".stack"),r="