!function(n,t){function v(n,t,r){var e=n.children(),o=!1,u,s,f;for(n.empty(),u=0,s=e.length;s>u;u++){if(f=e.eq(u),n.append(f),r&&n.append(r),i(n,t)){f.remove();o=!0;break}r&&r.detach()}return o}function e(t,r,u,f,o){var s=!1,h="table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style",c="script";return t.contents().detach().each(function(){var a=this,l=n(a);if("undefined"==typeof a||3==a.nodeType&&0==n.trim(a.data).length)return!0;if(l.is(c))t.append(l);else{if(s)return!0;t.append(l);o&&t[t.is(h)?"after":"append"](o);i(u,f)&&(s=3==a.nodeType?y(l,r,u,f,o):e(l,r,u,f,o),s||(l.detach(),s=!0));s||o&&o.detach()}}),s}function y(t,u,e,h,c){var l=t[0],nt,k,d;if(!l)return!1;var y=s(l),tt=-1!==y.indexOf(" ")?" ":"　",p="letter"==h.wrap?"":tt,a=y.split(p),g=-1,w=-1,b=0,v=a.length-1;for(h.fallbackToLetter&&0==b&&0==v&&(p="",a=y.split(p),v=a.length-1);v>=b&&(0!=b||0!=v);){if(nt=Math.floor((b+v)/2),nt==w)break;w=nt;f(l,a.slice(0,w+1).join(p)+h.ellipsis);i(e,h)?(v=w,h.fallbackToLetter&&0==b&&0==v&&(p="",a=a[0].split(p),g=-1,w=-1,b=0,v=a.length-1)):(g=w,b=w)}return-1==g||1==a.length&&0==a[0].length?(k=t.parent(),t.detach(),d=c&&c.closest(k).length?c.length:0,k.contents().length>d?l=r(k.contents().eq(-1-d),u):(l=r(k,u,!0),d||k.detach()),l&&(y=o(s(l),h),f(l,y),d&&c&&n(l).parent().append(c))):(y=o(a.slice(0,g+1).join(p),h),f(l,y)),!0}function i(n,t){return n.innerHeight()>t.maxHeight}function o(t,i){for(;n.inArray(t.slice(-1),i.lastCharacter.remove)>-1;)t=t.slice(0,-1);return n.inArray(t.slice(-1),i.lastCharacter.noEllipsis)<0&&(t+=i.ellipsis),t}function u(n){return{width:n.innerWidth(),height:n.innerHeight()}}function f(n,t){n.innerText?n.innerText=t:n.nodeValue?n.nodeValue=t:n.textContent&&(n.textContent=t)}function s(n){return n.innerText?n.innerText:n.nodeValue?n.nodeValue:n.textContent?n.textContent:""}function h(n){do n=n.previousSibling;while(n&&1!==n.nodeType&&3!==n.nodeType);return n}function r(t,i,u){var f,e=t&&t[0];if(e){if(!u){if(3===e.nodeType)return e;if(n.trim(t.text()))return r(t.contents().last(),i)}for(f=h(e);!f;){if(t=t.parent(),t.is(i)||!t.length)return!1;f=h(t[0])}if(f)return r(n(f),i)}return!1}function p(t,i){return t?"string"==typeof t?(t=n(t,i),t.length?t:!1):t.jquery?t:!1:!1}function w(n){for(var t,r=n.innerHeight(),u=["paddingTop","paddingBottom"],i=0,f=u.length;f>i;i++)t=parseInt(n.css(u[i]),10),isNaN(t)&&(t=0),r-=t;return r}var c,l,a;n.fn.dotdotdot||(n.fn.dotdotdot=function(t){var r;if(0==this.length)return n.fn.dotdotdot.debug('No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){n(this).dotdotdot(t)});r=this;r.data("dotdotdot")&&r.trigger("destroy.dot");r.data("dotdotdot-style",r.attr("style")||"");r.css("word-wrap","break-word");"nowrap"===r.css("white-space")&&r.css("white-space","normal");r.bind_events=function(){return r.bind("update.dot",function(t,u){t.preventDefault();t.stopPropagation();f.maxHeight="number"==typeof f.height?f.height:w(r);f.maxHeight+=f.tolerance;"undefined"!=typeof u&&(("string"==typeof u||u instanceof HTMLElement)&&(u=n("<div />").append(u).contents()),u instanceof n&&(h=u));s=r.wrapInner('<div class="dotdotdot" />').children();s.contents().detach().end().append(h.clone(!0)).find("br").replaceWith("  <br />  ").end().css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var c=!1,l=!1;return o.afterElement&&(c=o.afterElement.clone(!0),c.show(),o.afterElement.detach()),i(s,f)&&(l="children"==f.wrap?v(s,f,c):e(s,r,s,f,c)),s.replaceWith(s.contents()),s=null,n.isFunction(f.callback)&&f.callback.call(r[0],l,h),o.isTruncated=l,l}).bind("isTruncated.dot",function(n,t){return n.preventDefault(),n.stopPropagation(),"function"==typeof t&&t.call(r[0],o.isTruncated),o.isTruncated}).bind("originalContent.dot",function(n,t){return n.preventDefault(),n.stopPropagation(),"function"==typeof t&&t.call(r[0],h),h}).bind("destroy.dot",function(n){n.preventDefault();n.stopPropagation();r.unwatch().unbind_events().contents().detach().end().append(h).attr("style",r.data("dotdotdot-style")||"").data("dotdotdot",!1)}),r};r.unbind_events=function(){return r.unbind(".dot"),r};r.watch=function(){if(r.unwatch(),"window"==f.watch){var t=n(window),i=t.width(),e=t.height();t.bind("resize.dot"+o.dotId,function(){i==t.width()&&e==t.height()&&f.windowResizeFix||(i=t.width(),e=t.height(),l&&clearInterval(l),l=setTimeout(function(){r.trigger("update.dot")},10))})}else a=u(r),l=setInterval(function(){var n=u(r);(a.width!=n.width||a.height!=n.height)&&(r.trigger("update.dot"),a=u(r))},100);return r};r.unwatch=function(){return n(window).unbind("resize.dot"+o.dotId),l&&clearInterval(l),r};var h=r.contents(),f=n.extend(!0,{},n.fn.dotdotdot.defaults,t),o={},a={},l=null,s=null;return f.lastCharacter.remove instanceof Array||(f.lastCharacter.remove=n.fn.dotdotdot.defaultArrays.lastCharacter.remove),f.lastCharacter.noEllipsis instanceof Array||(f.lastCharacter.noEllipsis=n.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),o.afterElement=p(f.after,r),o.isTruncated=!1,o.dotId=c++,r.data("dotdotdot",!0).bind_events().trigger("update.dot"),f.watch&&r.watch(),r},n.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0},n.fn.dotdotdot.defaultArrays={lastCharacter:{remove:[" ","　",",",";",".","!","?"],noEllipsis:[]}},n.fn.dotdotdot.debug=function(){},c=1,l=n.fn.html,n.fn.html=function(i){return i!=t&&!n.isFunction(i)&&this.data("dotdotdot")?this.trigger("update",[i]):l.apply(this,arguments)},a=n.fn.text,n.fn.text=function(i){return i!=t&&!n.isFunction(i)&&this.data("dotdotdot")?(i=n("<div />").text(i).html(),this.trigger("update",[i])):a.apply(this,arguments)})}(jQuery),function(n,t){return n.viewModel=null,n.QuickviewViewModel=function(i){function s(n,t,i){var f=shopHq.images.SECURE_IMAGE_PATH,o=n.lastIndexOf("/")+1,s=n.lastIndexOf("?"),e,h,c;if(s<o&&(s=n.indexOf("&",o)),e=n.substring(o,s),h=u(),i){c=h===null?r.AvailabilityStatus():h.AvailabilityStatus();switch(c){case 1:f+="soldout_2008_overlay_1?$product=ShopHQ/"+e+"&$"+t+"x"+t+"_jpg$&op_sharpen=1";break;case 4:f+="almostgone_2015_overlay_1?$product=ShopHQ/"+e+"&$"+t+"x"+t+"_jpg$&op_sharpen=1";break;default:f+=e+"?DefaultImage=1&$"+t+"x"+t+"_jpg$&op_sharpen=1"}}else f+=e+"?DefaultImage=1&$"+t+"x"+t+"_jpg$&op_sharpen=1";return f}function v(n){r.skuMessage("");var i=!1;n!=null&&r.DeliveryOptions().length>0&&t.map(n.AutoDeliveryPrograms(),function(u,f){t.map(r.DeliveryOptions(),function(t,u){r.DeliveryOptions()[u].Value()===n.AutoDeliveryPrograms()[f].ProgramId()&&(i=!0)})});(n==null||r.DeliveryOptions().length>0)&&(r.Colors().length>0&&r.selectedColorValue()==null&&r.Sizes().length>0&&r.selectedSizeValue()==null?r.skuMessage("Please select color and size"):r.Colors().length>0&&r.selectedColorValue()==null?r.skuMessage("Please select color"):r.Sizes().length>0&&r.selectedSizeValue()==null?r.skuMessage("Please select size"):i&&r.DeliveryOptions().length>0&&parseInt(r.selectedDeliveryOption())<-1&&r.skuMessage("Please select a valid Subscription"));n!=null&&n.AvailabilityStatus()!==0&&n.AvailabilityStatus()!==4&&r.skuMessage("This combination is not available");r.skuMessage().length>0&&(t("#btnAddToCart")!=undefined&&t("#btnAddToCart").prop("disabled",!1),t("#abbtnAddToCart")!=undefined&&t("#abbtnAddToCart").prop("disabled",!1),t("#btnAccept")!=undefined&&t("#btnAccept").prop("disabled",!1),t("#btnDecline")!=undefined&&t("#btnDecline").prop("disabled",!1))}function b(){var t,i,n;if(f=null,e=null,r.Colors().length>0){for(f=[],t=0;t<r.Colors().length;t++)f[r.Colors()[t].Value()]={Skus:[],AvailableSkuCount:0,AlmostGoneSkuCount:0};r.Colors().length==1&&(r.selectedColorValue(r.Colors()[0].Value()),r.selectedColorText(r.Colors()[0].Text()))}if(r.Sizes().length>0){for(e=[],t=0;t<r.Sizes().length;t++)e[r.Sizes()[t].Value()]={Skus:[],AvailableSkuCount:0,AlmostGoneSkuCount:0};r.Sizes().length==1&&(r.selectedSizeText(r.Sizes()[0].Value()),r.selectedSizeValue(r.Sizes()[0].Text()))}for(t=0;t<r.Skus().length;t++)n=r.Skus()[t],f!==null&&f!==""&&n.ColorCode()!==null&&n.ColorCode()!=="00000"&&(i=f[n.ColorCode()],i.Skus[i.Skus.length]=n,n.AvailabilityStatus()===0&&i.AvailableSkuCount++,n.AvailabilityStatus()===4&&i.AlmostGoneSkuCount++),e!==null&&e!==""&&n.SizeCode()!==null&&n.SizeCode()!=="00000"&&(i=e[n.SizeCode()],i.Skus[i.Skus.length]=n,n.AvailabilityStatus()===0&&i.AvailableSkuCount++,n.AvailabilityStatus()===4&&i.AlmostGoneSkuCount++);(f==null||Object.keys(f).length==1)&&e==null&&r.DeliveryOptions().length>0?r.deliveryProgramOptions(r.DeliveryOptions()):r.deliveryProgramOptions.removeAll()}function k(){h("Colors",f);h("Sizes",e)}function w(n){var i,u,t;if(n.AutoDeliveryPrograms()!==null){for(r.deliveryProgramOptions.removeAll(),t=0;t<r.DeliveryOptions().length;t++)i=r.DeliveryOptions()[t],(i.Value()=="-2"||i.Value()=="-1")&&r.deliveryProgramOptions.push(i);for(u=0;u<n.AutoDeliveryPrograms().length;u++)for(t=0;t<r.DeliveryOptions().length;t++)r.DeliveryOptions()[t].Value()===n.AutoDeliveryPrograms()[u].ProgramId()&&r.deliveryProgramOptions.push(r.DeliveryOptions()[t])}}function h(n,t){for(var i,u=0;u<r[n]().length;u++)i=r[n]()[u],t[i.Value()].AlmostGoneSkuCount===t[i.Value()].Skus.length?i.Text(t[i.Value()].Skus[0][n.substring(0,n.length-1)+"Text"]()+" - Almost Gone"):t[i.Value()].AvailableSkuCount===0&&t[i.Value()].AlmostGoneSkuCount===0?i.Text(t[i.Value()].Skus[0][n.substring(0,n.length-1)+"Text"]()+" - Sold Out"):i.Text(t[i.Value()].Skus[0][n.substring(0,n.length-1)+"Text"]())}function c(n,t,i){switch(i.AvailabilityStatus()){case 1:n.Text(i[t+"Text"]()+" - Sold Out");break;case 4:n.Text(i[t+"Text"]()+" - Almost Gone");break;default:n.Text(i[t+"Text"]())}}function d(n,t){var i=n.Price();return n.PromotionType()==="PWP"?i!==-1&&(n.PriceDiscountType()===1?i=t.Price()-i/100*t.Price():n.PriceDiscountType()!==0&&(i=t.Price()-i)):i===0&&n.PromotionType()==="GWP"&&i--,i}function y(){var i=t.cookie("Basket1204"),n="",r;i&&i.indexOf("1=")>=0&&(n=i.substring(2).split("|")[0],t.isNumeric(n)&&(r=document.getElementById("CartQuantity"),r&&(r.innerHTML=n==1?n+" item":n+" items")))}function u(){for(var t=r.selectedSizeValue()===undefined?"00000":r.selectedSizeValue(),i=r.selectedColorValue()===undefined?"00000":r.selectedColorValue(),n=0;n<r.Skus().length;n++)if(i===r.Skus()[n].ColorCode()&&(t===r.Skus()[n].SizeCode()||r.Sizes().length===0))return r.Skus()[n];return null}function g(n){var i,r,t,u;if(n!==undefined&&n!==null){for(n=n.replace(/^\s+|\s+$/g,""),n=n.toLowerCase(),i="ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;",r="aaaaaeeeeeiiiiooooouuuunc------",t=0,u=i.length;t<u;t++)n=n.replace(new RegExp(i.charAt(t),"g"),r.charAt(t));n=n.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}return n}var r=this,f=null,e=null,o=0,l=0,p=4,a=!1;return ko.mapping.fromJS(i,{},r),r.setUIProperties=function(){shopHq.pageUtils.isKiosk()?(p=1,a=!0):(p=4,a=!1)},r.productDisplayText=ko.computed(function(){return this.OfferCode()+" - "+this.Title()},this),r.learnMoreLink=ko.computed(function(){return"/Product/"+g(this.Title())+"/"+this.OfferCode()+"?track=-10102&ciid=11281"},this),r.selectedColorText=ko.observable(),r.selectedColorValue=ko.observable(),r.deliveryProgramOptions=ko.observableArray(),r.selectedColorValue.subscribe(function(n){var f,t,i,o,s;if(r.skuMessage(""),r.skuMessageWishList(""),e!==null){if(f=u(),n==null)h("Sizes",e);else for(i=0;i<r.Sizes().length;i++)for(t=0;t<e[r.Sizes()[i].Value()].Skus.length;t++)o=e[r.Sizes()[i].Value()].Skus[t],o.ColorCode()===r.selectedColorValue()&&c(r.Sizes()[i],"Size",o);if(f!=null){for(f.AvailabilityStatus()!==0&&f.AvailabilityStatus()!==4?r.Colors().length>1&&r.Sizes().length>1?r.skuMessage("This combination is not available"):r.skuMessage("This option is not available"):r.skuMessage(""),t=0;t<r.Colors().length;t++)if(r.Colors()[t].Value()===r.selectedColorValue())break;c(r.Colors()[t],"Color",f)}}n!=null&&n!=""&&r.DeliveryOptions().length>0&&(r.deliveryProgramOptions.removeAll(),s=u(),s!=null&&w(s))}),r.selectedSizeText=ko.observable(),r.selectedSizeValue=ko.observable(),r.selectedSizeValue.subscribe(function(n){var e,t,i,o,s;if(r.skuMessage(""),r.skuMessageWishList(""),f!==null){for(e=u(),i=0;i<r.Colors().length;i++)if(n==null)h("Colors",f);else for(t=0;t<f[r.Colors()[i].Value()].Skus.length;t++)o=f[r.Colors()[i].Value()].Skus[t],o.SizeCode()===r.selectedSizeValue()&&c(r.Colors()[i],"Color",o);if(e!=null){for(e.AvailabilityStatus()!==0&&e.AvailabilityStatus()!==4?r.Colors().length>1&&r.Sizes().length>1?r.skuMessage("This combination is not available"):r.skuMessage("This option is not available"):r.skuMessage(""),t=0;t<r.Sizes().length;t++)if(r.Sizes()[t].Value()===r.selectedSizeValue())break;c(r.Sizes()[t],"Size",e)}}n!=null&&n!=""&&r.DeliveryOptions().length>0&&(r.deliveryProgramOptions.removeAll(),s=u(),s!=null&&w(s))}),r.selectedDeliveryOption=ko.observable(),r.displayPrice=ko.computed(function(){var n=u(),t,i;if(n===null&&r.Price.Low()!==r.Price.High())return r.Price.Low()<0?"FREE":"$"+shopHq.pageUtils.parseMoneyToString(r.Price.Low())+" - $"+shopHq.pageUtils.parseMoneyToString(r.Price.High());if(t=0,n!==null){if(n.AutoDeliveryPrograms()!==null&&n.AutoDeliveryPrograms()!==undefined&&n.AutoDeliveryPrograms().length>0)for(i=0;i<n.AutoDeliveryPrograms().length;i++)n.AutoDeliveryPrograms()[i].ProgramId()===r.selectedDeliveryOption()&&(t=n.AutoDeliveryPrograms()[i].Price());t===0&&(t=n.Price())}else t=r.Price.Low();return t<0?"FREE":"$"+shopHq.pageUtils.parseMoneyToString(t)},this),r.paymentTermVar=ko.computed(function(){var n=u(),t=0,i;if(n!==null&&n!==undefined){if(n.AutoDeliveryPrograms()!==null&&n.AutoDeliveryPrograms()!==undefined&&n.AutoDeliveryPrograms().length>0)for(i=0;i<n.AutoDeliveryPrograms().length;i++)n.AutoDeliveryPrograms()[i].ProgramId()===r.selectedDeliveryOption()&&(t=n.AutoDeliveryPrograms()[i].PaymentTerm());t===0&&(t=r.PaymentTerm())}else t=r.PaymentTerm();return t},this),r.valuePayPrice=ko.computed(function(){var n=u(),t=0,i;if(n===null&&r.ValuePayPrice.Low()!==r.ValuePayPrice.High())return"$"+shopHq.pageUtils.parseMoneyToString(r.ValuePayPrice.Low())+" - $"+shopHq.pageUtils.parseMoneyToString(r.ValuePayPrice.High());if(n!==null&&n!==undefined){if(n.AutoDeliveryPrograms()!==null&&n.AutoDeliveryPrograms()!==undefined&&n.AutoDeliveryPrograms().length>0)for(i=0;i<n.AutoDeliveryPrograms().length;i++)n.AutoDeliveryPrograms()[i].ProgramId()===r.selectedDeliveryOption()&&(t=n.AutoDeliveryPrograms()[i].ValuePayPrice());t===0&&(t=n.ValuePayPrice())}else t=r.ValuePayPrice.Low();return"$"+shopHq.pageUtils.parseMoneyToString(t)},this),r.isPromotion=ko.observable(!1),r.isQuickBuy=ko.observable(!1),r.skuMessage=ko.observable(),r.skuMessageWishList=ko.observable(),r.promoMessage=ko.observable(),r.selectedImage=ko.observable(),r.selectedParentImage=ko.observable(),r.selectedChild1Image=ko.observable(),r.selectedChild2Image=ko.observable(),r.selectedChild3Image=ko.observable(),r.selectedChild4Image=ko.observable(),r.selectedChild5Image=ko.observable(),r.promoHeader=ko.observable(),r.parentPromotionList=ko.observable(),r.parentPayMode=ko.observable(),r.dataLayerMethod=ko.observable(),r.WishListItem=ko.observableArray(),r.dotdotdot=null,r.displayMiniCart=!1,r.parentOfferCode=null,r.promotionIndex=-1,r.cartUrl=null,r.load=function(n,i,h){t("#spinner-overlay").spin();var c="/api/Product/Detail/"+n;t.getJSON(c,function(u){var p,h,ut;if(f=null,e=null,t("#product-photos-carousel .item").length>1&&t("#product-photos-carousel .item").each(function(n){t("#product-photos-carousel").trigger("remove.owl.carousel",n)}),t("#color-carousel .item").length>1&&t("#color-carousel .item").each(function(n){t("#color-carousel").trigger("remove.owl.carousel",n)}),t("#product-photos-carousel-prev-mobile .item").length>1&&t("#product-photos-carousel-prev-mobile .item").each(function(n){t("#product-photos-carousel-prev-mobile").trigger("remove.owl.carousel",n)}),ko.mapping.fromJS(u,{},r),r.selectedColorValue(""),r.selectedSizeValue(""),r.AdditionalPhotos().length>0&&(r.setSelectedImage(s(r.AdditionalPhotos()[0].Url(),400),!0),a)){for(h=0;h<r.AdditionalPhotos().length;h++)r.AdditionalPhotos()[h].Url(s(r.AdditionalPhotos()[h].Url(),400,!1));for(h=0;h<r.ColorSwatches().length;h++)r.ColorSwatches()[h].Url(s(r.ColorSwatches()[h].Url(),100))}if(o=i,l=n,r.parentOfferCode===null&&(r.parentOfferCode=n),r.promotionIndex>-1&&r.parentPromotionList().length>0){for(p=0,h=0;h<r.Skus().length;h++)p=d(r.parentPromotionList()[r.promotionIndex],r.Skus()[h]),r.Skus()[h].Price(p);r.Price.Low(p);r.Price.High(p)}if(b(),k(),r.isPromotion()){if(t("#panelOne").collapse("show"),t("#panelTwo").collapse("hide"),r.promotionIndex<=0){var rt=t("#cart"),v=rt.find(".cart-images"),c=t("#child-item-images"),y=t("#child-item-images img").length,w=null,g=null,nt=null,tt=null,it=null;y==1?(w=v.find("#child-item1"),g=v.find("#child-item2"),nt=v.find("#child-item3"),tt=v.find("#child-item4"),it=c.find("#child-item5")):y==2?(w=v.find("#child-item1"),g=v.find("#child-item2"),nt=v.find("#child-item3"),tt=c.find("#child-item4"),it=c.find("#child-item5")):y==3?(w=v.find("#child-item1"),g=v.find("#child-item2"),nt=c.find("#child-item3"),tt=c.find("#child-item4"),it=c.find("#child-item5")):y==4&&(w=v.find("#child-item1"),g=c.find("#child-item2"),nt=c.find("#child-item3"),tt=c.find("#child-item4"),it=c.find("#child-item5"));(y==1||y==2||y==3||y==4)&&(w.appendTo(c),g.appendTo(c),nt.appendTo(c),tt.appendTo(c),it.appendTo(c));ut=rt.find(".cart-message");ut.text("Item Added")}}else t("#panelOne").collapse("hide"),t("#panelTwo").collapse("show")}).done(function(){var n=t("#quick-view-dialog");if(r.ExternalVendorLandingPageUrl()!=null&&r.ExternalVendorLandingPageUrl()!==""){n.hide();t("#QuickViewModal").modal("hide");window.location=r.ExternalVendorLandingPageUrl();return}t("#btnAccept")!=undefined&&t("#btnAccept").prop("disabled",!1);t("#btnDecline")!=undefined&&t("#btnDecline").prop("disabled",!1);t("#quick-view-product-notfound").hide();t("#product-photos-carousel .item").each(function(n){t("#product-photos-carousel").trigger("add.owl.carousel",[t(this),n])});t("#product-photos-carousel").trigger("refresh.owl.carousel");t("#color-carousel .item").length>1&&(t("#color-carousel .item").each(function(n){t("#color-carousel").trigger("add.owl.carousel",[t(this),n])}),t("#color-carousel").trigger("refresh.owl.carousel"));t("#product-photos-carousel-prev-mobile .item").each(function(n){n!=null&&t("#product-photos-carousel-prev-mobile").trigger("add.owl.carousel",[t(this),n])});t("#product-photos-carousel-prev-mobile").trigger("refresh.owl.carousel");t("#product-photos-carousel-prev-mobile .item").each(function(n){n!=null&&t("#product-photos-carousel-prev-mobile").trigger("add.owl.carousel",[t(this),n])});t("#product-photos-carousel-prev-mobile").trigger("refresh.owl.carousel");r.AdditionalPhotos().length<=4?(t("#product-photos-carousel-next").hide(),t("#product-photos-carousel-prev").hide()):(t("#product-photos-carousel-next").show(),t("#product-photos-carousel-prev").show());r.ColorSwatches().length<=4?(t("#color-carousel-next").hide(),t("#color-carousel-prev").hide(),t("#color-options").addClass("quickview-sku-row-noprev"),t("#color-options").removeClass("quickview-sku-row-withprev")):(t("#color-carousel-next").show(),t("#color-carousel-prev").show(),t("#color-options").removeClass("quickview-sku-row-noprev"),t("#color-options").addClass("quickview-sku-row-withprev"));t("#quick-view-product-notfound").hide();t("#color-carousel img").each(function(n){if(this.getAttribute("data-colorcode")!==null&&this.getAttribute("data-colorcode")==h){var i=this.getAttribute("alt"),f=this.getAttribute("data-colorcode");r.selectedColorValue(h);r.setSelectedImage(s(this.src,400),!0);r.selectedColorText(i);t("#quickViewColorLabel").text(i);u();t("#product-photos-carousel").trigger("owl.goTo",0);t("#color-carousel").trigger("to.owl.carousel",n);t(this).removeClass("sku-img").addClass("color-selected")}});n.show();t("#QuickViewModal").modal("show");r.photoCarousel=t("#product-photos-carousel-prev-mobile").owlCarousel({items:1,loop:!1,dots:!0});dataLayerQuickViewLoad&&dataLayerQuickViewLoad()}).fail(function(){var n=t("#quick-view-dialog");n.hide();t("#quick-view-product-notfound").show();t("#QuickViewModal").modal("show")}).always(function(){t("#spinner-overlay").spin(!1)})},r.close=function(){if(t("#spinner-overlay").spin(!1),t("#btnAddToCart")!=undefined&&t("#btnAddToCart").prop("disabled",!1),t("#abbtnAddToCart")!=undefined&&t("#abbtnAddToCart").prop("disabled",!1),r.parentPromotionList()!==null&&r.parentPromotionList()!==undefined&&r.parentPromotionList().length>0&&r.promotionIndex<r.parentPromotionList().length-1){t("#QuickViewModal").modal("hide").on("hidden.bs.modal",function(){r.declineOffer();t("#QuickViewModal").modal("hide").off("hidden.bs.modal");return});t("#QuickViewModal").modal("hide")}else{t("#QuickViewModal").modal("hide");r.parentPromotionList()!==null&&r.parentPromotionList()!==undefined&&r.parentPromotionList().length>0&&r.promotionIndex<=r.parentPromotionList().length&&r.cartUrl==""&&(r.cartUrl=r.isQuickBuy()?"/Checkout/QuickBuy?returnStatus=0&cm_re=GN-_-CART-_-N":"/cart/minicart/?returnStatus=0&cm_re=GN-_-CART-_-N");var i=t("#description-header").find("span > i.fa");i.hasClass("fa-minus")&&i.removeClass("fa-minus").addClass("fa-plus");n.viewModel.displayMiniCart?shopHq.minicart.displayMiniCart(r.cartUrl):!n.viewModel.displayMiniCart&&r.isQuickBuy()&&r.cartUrl!==null&&r.cartUrl!==undefined&&r.cartUrl!==""&&(window.location=r.cartUrl);r.promotionIndex=-1;r.cartUrl=null;r.parentOfferCode=null;r.isPromotion(!1);r.isQuickBuy(!1);r.promoMessage("");r.promoHeader("");r.displayMiniCart=!1;r.parentPromotionList(null);ko.mapping.resetDefaultOptions()}},r.setSelectedImage=function(n,t){var i=s(n,400,t);r.selectedImage(i)},r.addToCart=function(){var n,i,f,e;t("#btnAddToCart")!=undefined&&t("#btnAddToCart").prop("disabled",!0);t("#btnAccept")!=undefined&&t("#btnAccept").prop("disabled",!0);t("#btnDecline")!=undefined&&t("#btnDecline").prop("disabled",!0);n=u();v(n);i="";i=n==null?r.DeliveryOptions().length>0&&parseInt(r.selectedDeliveryOption())==-1?"-1":"":n.Id();i!==""&&r.skuMessage()===""&&(r.displayMiniCart=!0,f="",r.DeliveryOptions().length>0&&parseInt(r.selectedDeliveryOption())>0&&(f=r.selectedDeliveryOption()),e="/cart/AddItem?carttype=1&offercode="+r.OfferCode()+"&skuid="+i+"&qty=1&programId="+f+"&warrantyType=&ispromoitem=false&itemType=Normal&parentBasketItemId=0&paymode=0",t.get(e,function(n){n!==null&&n!==undefined&&n!==""&&(n.Status=="6"?(shopHq.quickview.viewModel.parentOfferCode=r.OfferCode(),shopHq.quickview.viewModel.parentPromotionList(r.Promotions()),shopHq.quickview.viewModel.promotionIndex++,shopHq.quickview.viewModel.promoMessage(r.Promotions()[0].PromotionMessage()),shopHq.quickview.viewModel.selectedParentImage(r.selectedImage()),shopHq.quickview.viewModel.isPromotion(!0),shopHq.quickview.viewModel.isQuickBuy(!1),shopHq.quickview.viewModel.dataLayerMethod("QuickView"),shopHq.quickview.viewModel.cartUrl="",r.Promotions()[0].PromotionType()=="PWP"?r.Promotions()[0].IsBMSM()==!0?shopHq.quickview.viewModel.promoHeader("Would you like to buy more and save more?"):shopHq.quickview.viewModel.promoHeader("Would you like to add this item and save?"):shopHq.quickview.viewModel.promoHeader("Would you like this gift with your purchase?"),shopHq.quickview.viewModel.load(r.Promotions()[0].OfferCode(),n.BasketItemId)):n.Status=="3"?window.location="/cart?returnStatus="+n.Status:((n.Status=="0"||n.Status=="4")&&y(),r.cartUrl="/cart/MiniCart?returnStatus="+n.Status,r.close()))}))},r.abaddToCart=function(){var n,i,f,e;t("#spinner-overlay").spin(!0);t("#abbtnAddToCart")!=undefined&&t("#abbtnAddToCart").prop("disabled",!0);n=u();v(n);i="";i=n==null?r.DeliveryOptions().length>0&&parseInt(r.selectedDeliveryOption())==-1?"-1":"":n.Id();i!==""&&r.skuMessage()===""&&(r.displayMiniCart=!0,f="",r.DeliveryOptions().length>0&&parseInt(r.selectedDeliveryOption())>0&&(f=r.selectedDeliveryOption()),e="/cart/AddItem?carttype=1&offercode="+r.OfferCode()+"&skuid="+i+"&qty=1&programId="+f+"&warrantyType=&ispromoitem=false&itemType=Normal&parentBasketItemId=0&paymode=0",t.get(e,function(n){if(n!==null&&n!==undefined&&n!=="")if(n.Status=="6"){t("#QuickViewModal").modal("hide");var i="/Product/PromotionDetail/"+r.OfferCode();t.get(i,function(i){shopHq.promotionview.viewModel.selectedParentOfferCode(r.OfferCode());shopHq.promotionview.viewModel.selectedParentImage(r.selectedImage());shopHq.promotionview.viewModel.isQuickBuy(!1);shopHq.promotionview.viewModel.displayMiniCart(!0);shopHq.promotionview.viewModel.load(n.BasketItemId,i);t("#spinner-overlay").spin(!1)})}else n.Status=="3"?window.location="/cart?returnStatus="+n.Status:((n.Status=="0"||n.Status=="4")&&y(),r.cartUrl="/cart/MiniCart?returnStatus="+n.Status,r.close())}))},r.acceptOffer=function(){var n,i;if(t("#btnAddToCart")!=undefined&&t("#btnAddToCart").prop("disabled",!0),t("#btnAccept")!=undefined&&t("#btnAccept").prop("disabled",!0),t("#btnDecline")!=undefined&&t("#btnDecline").prop("disabled",!0),n=u(),v(n),n!=null&&r.skuMessage()===""){var f=r.parentPromotionList()[r.promotionIndex],s="",e=0;r.parentPayMode()>0&&r.PaymentTerm()>1&&f.PromotionType()!="GWP"&&(e=1);i="";r.DeliveryOptions().length>0&&parseInt(r.selectedDeliveryOption())>0&&(i=r.selectedDeliveryOption());s=r.isQuickBuy()?"/cart/AddItem?carttype=2&offercode="+l+"&skuid="+n.Id()+"&qty=1&programId="+i+"&warrantyType=&ispromoitem=true&itemType="+f.PromotionType()+"&parentBasketItemId="+o+"&paymode="+e:"/cart/AddItem?carttype=1&offercode="+l+"&skuid="+n.Id()+"&qty=1&programId="+i+"&warrantyType=&ispromoitem=true&itemType="+f.PromotionType()+"&parentBasketItemId="+o+"&paymode="+e;t.get(s,function(n){var e,f;if(y(),r.promotionIndex++,r.promotionIndex<r.parentPromotionList().length)if(r.promoMessage(r.parentPromotionList()[r.promotionIndex].PromotionMessage()),r.parentPromotionList()[r.promotionIndex].PromotionType()=="GWP"&&r.parentPromotionList()[r.promotionIndex].IsSingleSKU()==!0)r.close();else{var u=t("#cart"),s=u.find(".cart-images"),h=u.find(".cart-message"),i=u.find(".cart-images img").length;i==1?shopHq.quickview.viewModel.selectedChild1Image(r.selectedImage()):i==2?shopHq.quickview.viewModel.selectedChild2Image(r.selectedImage()):i==3?shopHq.quickview.viewModel.selectedChild3Image(r.selectedImage()):i==4?shopHq.quickview.viewModel.selectedChild4Image(r.selectedImage()):i==5&&shopHq.quickview.viewModel.selectedChild5Image(r.selectedImage());e=t("#child-item-images");f=e.find("img:eq(0)");f.attr("width","75").attr("height","75");f.appendTo(s);h.text("Items Added");r.parentPromotionList()[r.promotionIndex].PromotionType()=="PWP"?r.parentPromotionList()[r.promotionIndex].IsBMSM()==!0?shopHq.quickview.viewModel.promoHeader("Would you like to buy more and save more?"):shopHq.quickview.viewModel.promoHeader("Would you like to add this item and save?"):shopHq.quickview.viewModel.promoHeader("Would you like this gift with your purchase?");r.load(r.parentPromotionList()[r.promotionIndex].OfferCode(),o)}else r.cartUrl=r.isQuickBuy()?"/Checkout/QuickBuy?returnStatus="+n.Status:"/cart/MiniCart?returnStatus="+n.Status,r.close()})}},r.declineOffer=function(){t("#btnAddToCart")!=undefined&&t("#btnAddToCart").prop("disabled",!0);t("#btnAccept")!=undefined&&t("#btnAccept").prop("disabled",!0);t("#btnDecline")!=undefined&&t("#btnDecline").prop("disabled",!0);r.parentPromotionList()!==null&&r.parentPromotionList()!==undefined&&r.parentPromotionList().length>0&&r.promotionIndex===r.parentPromotionList().length-1?r.close():(r.promotionIndex++,r.promoMessage(r.parentPromotionList()[r.promotionIndex].PromotionMessage()),r.parentPromotionList()[r.promotionIndex].PromotionType()=="PWP"?r.parentPromotionList()[r.promotionIndex].IsBMSM()==!0?shopHq.quickview.viewModel.promoHeader("Would you like to buy more and save more?"):shopHq.quickview.viewModel.promoHeader("Would you like to add this item and save?"):shopHq.quickview.viewModel.promoHeader("Would you like this gift with your purchase?"),r.parentPromotionList()[r.promotionIndex].PromotionType()=="GWP"&&r.parentPromotionList()[r.promotionIndex].IsSingleSKU()==!0?r.close():r.load(r.parentPromotionList()[r.promotionIndex].OfferCode(),o))},r.adprogramChange=function(){r.displayPrice()},r.selectedSku=u,r.checkWishlist=ko.computed(function(){var i=u(),n;if(i!==null&&i!==undefined)for(n=0;n<r.WishListItem().length;n++){if(i.Id()===r.WishListItem()[n].SkuId)return t("#WishListItemId").val(r.WishListItem()[n].WishListItemId),!0;t("#WishListItemId").val("0")}},this),r.loadWishlist=ko.computed({read:function(){},write:function(n){var t,i;if(n!==null&&n!==undefined){for(t=0;t<n.length;t++)i={WishListItemId:n[t].WishListItemId,SkuId:n[t].SkuId},r.WishListItem.push(i);console.log(r.WishListItem())}}},this),r.setWishlist=ko.computed({read:function(){},write:function(n){if(n!==null&&n!==undefined){var t={WishListItemId:n.WishListItemId,SkuId:n.SkuId};r.WishListItem.push(t);console.log(r.WishListItem())}}},this),r.deleteWishlist=function(n){r.WishListItem.remove(function(t){return t.WishListItemId==n});console.log(r.WishListItem())},r.validateWishlistSelection=function(){r.skuMessageWishList("");var n=u(),i=!1;n!=null&&r.DeliveryOptions().length>0&&t.map(n.AutoDeliveryPrograms(),function(u,f){t.map(r.DeliveryOptions(),function(t,u){r.DeliveryOptions()[u].Value()===n.AutoDeliveryPrograms()[f].ProgramId()&&(i=!0)})});(n==null||r.DeliveryOptions().length>0)&&(r.Colors().length>0&&r.selectedColorValue()==null&&r.Sizes().length>0&&r.selectedSizeValue()==null?r.skuMessageWishList("Please select color and size"):r.Colors().length>0&&r.selectedColorValue()==null?r.skuMessageWishList("Please select color"):r.Sizes().length>0&&r.selectedSizeValue()==null?r.skuMessageWishList("Please select size"):i&&r.DeliveryOptions().length>0&&parseInt(r.selectedDeliveryOption())<-1&&r.skuMessageWishList("Please select a valid Subscription"));n!=null&&n.AvailabilityStatus()!==0&&n.AvailabilityStatus()!==4&&r.skuMessageWishList("This combination is not available")},r.validateWishlistSelection=function(){r.skuMessageWishList("");var n=u();(n==null||r.DeliveryOptions().length>0)&&(r.Colors().length>0&&r.selectedColorValue()==null&&r.Sizes().length>0&&r.selectedSizeValue()==null?r.skuMessageWishList("Please select color and size"):r.Colors().length>0&&r.selectedColorValue()==null?r.skuMessageWishList("Please select color"):r.Sizes().length>0&&r.selectedSizeValue()==null?r.skuMessageWishList("Please select size"):r.DeliveryOptions().length>0&&parseInt(r.selectedDeliveryOption())<-1&&r.skuMessageWishList("Please select a valid Subscription"));n!=null&&n.AvailabilityStatus()!==0&&n.AvailabilityStatus()!==4&&r.skuMessageWishList("This combination is not available")},r},t(document).ready(function(){ko.bindingHandlers.selectedText={init:function(n,i){var u=i(),r=t("option:selected",n);u(r.val()==""?"":r.text().replace(" - Sold Out","").replace(" - Almost Gone",""));t(n).change(function(){r=t("option:selected",this);u(r.val()==""?"":r.text().replace(" - Sold Out","").replace(" - Almost Gone",""))})},update:function(i,r){var u=ko.utils.unwrapObservable(r());t("option",i).filter(function(n){return u===""&&n===0?!0:t(this).text().replace(" - Sold Out","").replace(" - Almost Gone","")===u}).prop("selected","selected");i.id==="quickViewColorDropDown"&&n.viewModel.selectedColorValue(i.value)}};ko.bindingHandlers.owlCarouselInitiator={init:function(n){t("#"+n.id).owlCarousel({items:4,loop:!1,margin:5,dots:!1,responsive:{0:{items:2},600:{items:3},1e3:{items:4}}})}};ko.applyBindings(n.viewModel,document.getElementById("QuickViewModal"));t("#color-carousel-prev").addClass("carousel-disable");t("#color-carousel").on("initialized.owl.carousel changed.owl.carousel refreshed.owl.carousel",function(n){if(n.namespace){var i=n.relatedTarget,u=n.target,r=i.current();r==i.maximum()?(t("#color-carousel-prev").addClass("carousel-enable"),t("#color-carousel-prev").removeClass("carousel-disable"),t("#color-carousel-next").addClass("carousel-disable"),t("#color-carousel-next").removeClass("carousel-enable")):r==i.minimum()?(t("#color-carousel-next").addClass("carousel-enable"),t("#color-carousel-next").removeClass("carousel-disable"),t("#color-carousel-prev").addClass("carousel-disable"),t("#color-carousel-prev").removeClass("carousel-enable")):(t("#color-carousel-prev").addClass("carousel-enable"),t("#color-carousel-prev").removeClass("carousel-disable"),t("#color-carousel-next").addClass("carousel-enable"),t("#color-carousel-next").removeClass("carousel-disable"))}});t("#color-carousel").on("initialized.owl.carousel changed.owl.carousel refreshed.owl.carousel",function(n){if(n.namespace){var i=n.relatedTarget,u=n.target,r=i.current();r==i.maximum()?(t("#color-carousel-prev").addClass("carousel-enable"),t("#color-carousel-prev").removeClass("carousel-disable"),t("#color-carousel-next").addClass("carousel-disable"),t("#color-carousel-next").removeClass("carousel-enable")):r==i.minimum()?(t("#color-carousel-next").addClass("carousel-enable"),t("#color-carousel-next").removeClass("carousel-disable"),t("#color-carousel-prev").addClass("carousel-disable"),t("#color-carousel-prev").removeClass("carousel-enable")):(t("#color-carousel-prev").addClass("carousel-enable"),t("#color-carousel-prev").removeClass("carousel-disable"),t("#color-carousel-next").addClass("carousel-enable"),t("#color-carousel-next").removeClass("carousel-disable"))}});t(document).on("click",".addQuickViewLink, .addWLQuickViewLink",function(n){var r,u,i;n.preventDefault();r=t(this).attr("data-offercode");u=t(this).attr("data-colorcode");t("#WishListedCount").val(t(this).attr("data-wlcount"));i=t(this).hasClass("addQuickViewLink")?!1:!0;i&&t("#IsLoggedIn").val()=="true"||!i?shopHq.quickview.viewModel.load(r,0,u):window.location.href="https://"+document.location.hostname+"/Account/Login?ReturnUrl="+window.location.pathname+window.location.search+""})}),n}(shopHq.quickview=shopHq.quickview||{},jQuery),function(n,t){return n.enableMiniCart=null,n.miniCartPosition=null,n.close=function(){t("#dvMiniCart").dialog("close")},n.updateProtectionPlan=function(n,i,r){t(i).prop("checked")?(t("#dvWarranty-"+n+" .warranty-checkbox").prop("checked",!1),t(i).prop("checked",!0)):r="";t.ajax({async:!1,dataType:"json",type:"GET",url:"/cart/UpdateSppFromMiniCart/?basketitemid="+n+"&warrantyType="+encodeURIComponent(r)}).done(function(i){i!=""&&(i.ProductTotal=="$0.00"?this.goToCart():(t("#dvMiniCart").find("#minicart-subtotal-"+n).html(i.ProductTotal),t("#dvMiniCart").find("#minicart-order-total").html(i.OrderTotal)))}).fail(function(n,t,i){console&&console.log(i)}).always(function(){})},n.displayMiniCart=function(n){t("#spinner-overlay").spin();t.ajax({url:n,type:"GET",cache:!1}).done(function(n){t("#dvMiniCart").html(n);t("#dvMiniCart").show();t("#MiniCartModal").modal("show")}).fail(function(n,t,i){console&&console.log(i)}).always(function(){t("#spinner-overlay").spin(!1);isSubmitted=!1})},n.updateCartItemsInGlobalNav=function(n){n===1?(t("#cart-items-count").html(n),t("#cart-items-count:contains('item')").html(n+" item")):(t("#cart-items-count").html(n),t("#cart-items-count:contains('item')").html(n+" items"));t("#mobile-cart-quantity").html(n);n>0?t("#mobile-cart-quantity").show():t("#mobile-cart-quantity").hide()},n.goToCart=function(){document.location.href="//"+document.location.host+"/Checkout/"},n}(shopHq.minicart=shopHq.minicart||{},jQuery);Date.$VERSION=1.02;Date.LZ=function(n){return(n<0||n>9?"":"0")+n};Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.monthAbbreviations=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.dayAbbreviations=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Date.preferAmericanFormat=!0;Date.prototype.getFullYear||(Date.prototype.getFullYear=function(){var n=this.getYear();return n<1900?n+1900:n});Date.parseString=function(n,t){var d,v,g,b,l,e,k;if(typeof t=="undefined"||t==null||t==""){var nt=["M/d/y","M-d-y","M.d.y","M/d","M-d"],tt=["d/M/y","d-M-y","d.M.y","d/M","d-M"],it=[["y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d","MMM-d","d-MMM"],Date.preferAmericanFormat?nt:tt,Date.preferAmericanFormat?tt:nt];for(e=0;e<it.length;e++)for(d=it[e],v=0;v<d.length;v++)if(g=Date.parseString(n,d[v]),g!=null)return g;return null}this.isInteger=function(n){for(var t=0;t<n.length;t++)if("1234567890".indexOf(n.charAt(t))==-1)return!1;return!0};this.getInt=function(n,t,i,r){for(var f,u=r;u>=i;u--){if(f=n.substring(t,t+u),f.length<i)return null;if(this.isInteger(f))return f}return null};n=n+"";t=t+"";for(var r=0,a=0,rt="",i="",y,p,o=(new Date).getFullYear(),f=1,s=1,u=0,h=0,c=0,w="";a<t.length;){for(rt=t.charAt(a),i="";t.charAt(a)==rt&&a<t.length;)i+=t.charAt(a++);if(i=="yyyy"||i=="yy"||i=="y"){if(i=="yyyy"&&(y=4,p=4),i=="yy"&&(y=2,p=2),i=="y"&&(y=2,p=4),o=this.getInt(n,r,y,p),o==null)return null;r+=o.length;o.length==2&&(o=o>70?1900+ +o:2e3+ +o)}else if(i=="MMM"||i=="NNN"){for(f=0,l=i=="MMM"?Date.monthNames.concat(Date.monthAbbreviations):Date.monthAbbreviations,e=0;e<l.length;e++)if(b=l[e],n.substring(r,r+b.length).toLowerCase()==b.toLowerCase()){f=e%12+1;r+=b.length;break}if(f<1||f>12)return null}else if(i=="EE"||i=="E"){for(l=i=="EE"?Date.dayNames:Date.dayAbbreviations,e=0;e<l.length;e++)if(k=l[e],n.substring(r,r+k.length).toLowerCase()==k.toLowerCase()){r+=k.length;break}}else if(i=="MM"||i=="M"){if(f=this.getInt(n,r,i.length,2),f==null||f<1||f>12)return null;r+=f.length}else if(i=="dd"||i=="d"){if(s=this.getInt(n,r,i.length,2),s==null||s<1||s>31)return null;r+=s.length}else if(i=="hh"||i=="h"){if(u=this.getInt(n,r,i.length,2),u==null||u<1||u>12)return null;r+=u.length}else if(i=="HH"||i=="H"){if(u=this.getInt(n,r,i.length,2),u==null||u<0||u>23)return null;r+=u.length}else if(i=="KK"||i=="K"){if(u=this.getInt(n,r,i.length,2),u==null||u<0||u>11)return null;r+=u.length;u++}else if(i=="kk"||i=="k"){if(u=this.getInt(n,r,i.length,2),u==null||u<1||u>24)return null;r+=u.length;u--}else if(i=="mm"||i=="m"){if(h=this.getInt(n,r,i.length,2),h==null||h<0||h>59)return null;r+=h.length}else if(i=="ss"||i=="s"){if(c=this.getInt(n,r,i.length,2),c==null||c<0||c>59)return null;r+=c.length}else if(i=="a"){if(n.substring(r,r+2).toLowerCase()=="am")w="AM";else if(n.substring(r,r+2).toLowerCase()=="pm")w="PM";else return null;r+=2}else{if(n.substring(r,r+i.length)!=i)return null;r+=i.length}}if(r!=n.length)return null;if(f==2)if(o%4==0&&o%100!=0||o%400==0){if(s>29)return null}else if(s>28)return null;return(f==4||f==6||f==9||f==11)&&s>30?null:(u<12&&w=="PM"?u=+u+12:u>11&&w=="AM"&&(u-=12),new Date(o,f-1,s,u,h,c))};Date.isValid=function(n,t){return Date.parseString(n,t)!=null};Date.prototype.isBefore=function(n){return n==null?!1:this.getTime()<n.getTime()};Date.prototype.isAfter=function(n){return n==null?!1:this.getTime()>n.getTime()};Date.prototype.equals=function(n){return n==null?!1:this.getTime()==n.getTime()};Date.prototype.equalsIgnoreTime=function(n){if(n==null)return!1;var t=new Date(this.getTime()).clearTime(),i=new Date(n.getTime()).clearTime();return t.getTime()==i.getTime()};Date.prototype.format=function(n){n=n+"";var e="",u=0,s="",f="",r=this.getYear()+"",o=this.getMonth()+1,h=this.getDate(),c=this.getDay(),i=this.getHours(),l=this.getMinutes(),a=this.getSeconds(),t={};for(r.length<4&&(r=""+(+r+1900)),t.y=""+r,t.yyyy=r,t.yy=r.substring(2,4),t.M=o,t.MM=Date.LZ(o),t.MMM=Date.monthNames[o-1],t.NNN=Date.monthAbbreviations[o-1],t.d=h,t.dd=Date.LZ(h),t.E=Date.dayAbbreviations[c],t.EE=Date.dayNames[c],t.H=i,t.HH=Date.LZ(i),t.h=i==0?12:i>12?i-12:i,t.hh=Date.LZ(t.h),t.K=t.h-1,t.k=t.H+1,t.KK=Date.LZ(t.K),t.kk=Date.LZ(t.k),t.a=i>11?"PM":"AM",t.m=l,t.mm=Date.LZ(l),t.s=a,t.ss=Date.LZ(a);u<n.length;){for(s=n.charAt(u),f="";n.charAt(u)==s&&u<n.length;)f+=n.charAt(u++);e=typeof t[f]!="undefined"?e+t[f]:e+f}return e};Date.prototype.getDayName=function(){return Date.dayNames[this.getDay()]};Date.prototype.getDayAbbreviation=function(){return Date.dayAbbreviations[this.getDay()]};Date.prototype.getMonthName=function(){return Date.monthNames[this.getMonth()]};Date.prototype.getMonthAbbreviation=function(){return Date.monthAbbreviations[this.getMonth()]};Date.prototype.clearTime=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.add=function(n,t){if(typeof n=="undefined"||n==null||typeof t=="undefined"||t==null)return this;if(t=+t,n=="y")this.setFullYear(this.getFullYear()+t);else if(n=="M")this.setMonth(this.getMonth()+t);else if(n=="d")this.setDate(this.getDate()+t);else if(n=="w")for(var i=t>0?1:-1;t!=0;){for(this.add("d",i);this.getDay()==0||this.getDay()==6;)this.add("d",i);t-=i}else n=="h"?this.setHours(this.getHours()+t):n=="m"?this.setMinutes(this.getMinutes()+t):n=="s"&&this.setSeconds(this.getSeconds()+t);return this},function(n,t){function f(n){var i,r,t,u;if(n!==undefined&&n!==null){for(n=n.replace(/^\s+|\s+$/g,""),n=n.toLowerCase(),i="ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;",r="aaaaaeeeeeiiiiooooouuuunc------",t=0,u=i.length;t<u;t++)n=n.replace(new RegExp(i.charAt(t),"g"),r.charAt(t));n=n.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}return n}function r(i,r){t("#videoPlayer_loadingDiv").show();t.get(n.offerDataService+"/"+i).done(function(n){r.call(this,n)}).fail(function(n,t,i){u("Temporarily unable to display product details.");console&&console.log(i)}).always(function(){t("#videoPlayer_loadingDiv").hide()})}function e(n){var i="",f={playerName:"shophqplayer",actions:[]},e=function(n){shopHq.onAir.updateCurrentOfferDetailsData(n)};t.each(n.ShowOffers,function(t,r){r.StartTime===0&&(i=n.ShowOffers[t].OfferCode);f.actions.push({startTime:r.StartTime,duration:r.Duration,enabled:r.StartTime>0,callback:function(t){o(n.ShowOffers[t].OfferCode)}})});i!==""&&r(i,e);var h=new Date(parseInt(n.ShowDate.slice(6,-2),10)),s={VideoShow:n.ShowName,VideoDuration:3600,VideoAutoplay:!0,VideoType:"SHOW VIDEO",VideoPlayer:"jwplayer"},u={flashStream:n.FlashUrl,hlsStream:n.HlsUrl,playerName:"shophqplayer",start:0,duration:0,ccText:n.ClosedCaptionUrl,title:n.ShowName,aspectratio:"16:9",width:"100%",onTimeConfig:f,eventData:s,isLiveStream:!1};shopHq.video.useHTML5Player()?(u.playerName="evinehtml5player",shopHq.video.watchOnDemandVideoInHTML5Player(u)):shopHq.video.watchOnDemandVideo(u)}function o(n){var t=function(n){shopHq.onAir.updateCurrentOfferDetailsData(n)};r(n,t)}function s(n,i){var u=t.trim(t(".show-name").text()),f={VideoProduct:n.OfferCode,VideoShow:u,VideoDuration:n.Duration,VideoAutoplay:!0,VideoType:"PRODUCT VIDEO",VideoPlayer:"jwplayer"},r={flashStream:n.FlashVideoUrl,hlsStream:n.HlsVideoUrl,playerName:"shophqplayer",start:n.StartTime,duration:n.Duration,ccText:n.ClosedCaptionUrl,title:i,aspectratio:"16:9",width:"100%",eventData:f,isLiveStream:!1};shopHq.video.useHTML5Player()?(r.playerName="evinehtml5player",shopHq.video.watchOnDemandVideoInHTML5Player(r)):shopHq.video.watchOnDemandVideo(r)}function h(){var r,u;if(owl!=null){var n=t("#videoPlayer_ProductDescription span")[0].innerHTML,i=t("#videoPlayer_ProductDescription span")[1].innerHTML,f=t("#videoPlayer_ProductImage")[0].src,e=t("#videoPlayer_LearnMore")[0].href.replace(/(.*OnAirNowPg)(.*OnAirNowPg)(.*)/,function(n,t,i,r){return t.replace("OnAirNowPg","OnAirLastPg1")+i.replace("OnAirNowPg","OnAirLastPg1")+r}),o=n+" | "+i,s=t("#videoPlayer_CurrentPriceLabel")[0].innerHTML,h=t("#videoPlayer_CurrentPrice")[0].innerHTML,c="#videoPlayer_Overlay$"[0].css;n!==null&&n!==undefined&&n!==""&&(r=t("#last-items-aired-carousel .learn-more-container a"),t.each(r,function(n,t){t.href=t.href.replace(/(.*OnAirLastPg)([0-9]+)(.*OnAirLastPg)([0-9]+)(.*)/,function(n,t,i,r,u,f){var e=parseInt(i)+1;return t+e+r+e+f})}),u='<div class="item"><div class="flip-panel"><div class="'+c+'"><\/div><img alt="'+n+'" class="img-responsive" src="'+f+'" title="'+o+'"><div class="overlay-content"><div class="product-description"><b>'+n+"<\/b> - <span>"+i+"<\/span><\/div><div><b>"+s+": "+h+'<\/b><div class="learn-more-container"><a class="btn btn-primary" href="'+e+'">Learn More<\/a><\/div><\/div><\/div><\/div><\/div><\/div>',owl.trigger("add.owl.carousel",[u,0]),owl.trigger("remove.owl.carousel",12),owl.trigger("refresh.owl.carousel"))}}function c(i,r){t.get(n.watchLiveService).done(function(n){i.call(this,n)}).fail(function(n,t,i){u("Temporarily unable begin live stream, please try again.");console&&console.log(i)}).always(function(){r.call()})}function u(n){t("#videoPlayer_error").html(n).show();t("#videoPlayer_LearnMore").addClass("disabled")}function l(n){var t="";switch(n){case 1:t="ET";break;case 0:t="CT";break;case-1:t="MT";break;case-2:t="PT";break;default:t="ET"}return t}function v(n){i!==null?t.each(i,function(t,i){i.enabled&&Math.floor(n.position)===i.position&&(i.enabled=!1)}):n.duration&&(i={twentyFive:{enabled:!0,position:Math.floor(n.duration*.25)},fifty:{enabled:!0,position:Math.floor(n.duration*.5)},oneHundred:{enabled:!0,position:Math.floor(n.duration)-1}})}function y(){t.each(i,function(n,t){t.enabled=!0})}t(function(){function i(){document.title!==n&&(document.title=n)}var n=document.title,r;document.attachEvent?document.attachEvent("onpropertychange",function(n){n.propertyName==="title"&&document.title!==""&&i()}):document.addEventListener&&(r=t("title")[0],r.addEventListener("DOMSubtreeModified",i))});n.productVideoSearchUrl="";n.flashLiveStreamUrl="";n.hlsLiveStreamUrl="";n.flashOpenCaptionLiveStreamUrl="";n.hlsOpenCaptionLiveStreamUrl="";n.offerDataService="";n.showDataService="";n.watchLiveService="";n.liveStreamIsInPlayer=!0;n.watchOnDemandOfferVideo=function(i,u){var f=function(n){shopHq.onAir.updateCurrentOfferDetailsData(n,u);s(n,n.OfferCode+" - "+n.TopLine,u);document.getElementById("videoPlayer_NowPlaying").innerHTML=n.OfferCode+" - "+n.TopLine};r(i,f);t.connection.hub.stop();t("#watch-us-live").removeAttr("disabled");t("#on-air-disclaimer-text").show();n.liveStreamIsInPlayer=!1};n.watchShowOnDemand=function(i){t.get(n.showDataService+"/"+i).done(function(n){e(n);document.getElementById("videoPlayer_NowPlaying").innerHTML=n.ShowName}).fail(function(n,t,i){u("Temporarily unable to play show, please try again later.");console&&console.log(i)});t.connection.hub.stop();t("#watch-us-live").removeAttr("disabled");t("#on-air-disclaimer-text").show();n.liveStreamIsInPlayer=!1};n.updateCurrentOfferDetailsData=function(i,r){var e,o,s;if(r=r||{},i.OfferFound)t("#videoPlayer_error").hide(),t("#videoPlayer_LearnMore").removeClass("disabled");else{document.getElementById("videoPlayer_ProductImage").src="//images.shophq.com/is/image/ShopHQ/NotFound?DefaultImage=1&$150x150_jpg$";u("Product information is currently unavailable.");return}t("#videoPlayer_ProductDescription span")[0].innerHTML=i.OfferCode;t("#videoPlayer_ProductDescription span")[1].innerHTML=i.TopLine;document.getElementById("videoPlayer_ProductImage").src=i.ImageUrl;document.getElementById("videoPlayer_ProductImage").alt=i.OfferCode+" - "+i.TopLine;i.AvailabilityStatusCssClass!==""&&t("#videoPlayer_Availability").addClass(i.AvailabilityStatusCssClass);i.PercentSavedFrom>0?(document.getElementById("videoPlayer_CurrentPriceLabel").innerHTML=i.PriceLabel+":",document.getElementById("videoPlayer_CurrentPrice").innerHTML=i.CurrentPrice,document.getElementById("videoPlayer_SaveAmt").innerHTML=i.PercentSaved,document.getElementById("videoPlayer_RegularPrice").innerHTML=i.RegularPrice,document.getElementById("videoPlayer_SaveAmt").className="saveContainer",document.getElementById("videoPlayer_RegularPriceContainer").className=""):(document.getElementById("videoPlayer_CurrentPriceLabel").innerHTML=i.PriceLabel+":",document.getElementById("videoPlayer_CurrentPrice").innerHTML=i.CurrentPrice,document.getElementById("videoPlayer_SaveAmt").className="hide",document.getElementById("videoPlayer_RegularPriceContainer").className="hide");document.getElementById("videoPlayer_ShippingAmt").innerHTML=i.ShippingHandlingPrice;e=t.trim(document.getElementById("videoPlayer_NowPlaying").innerHTML.split("|")[0]);r.learnMore?o=n.isCategoryPage?r.learnMore.replace("OnAirProd","OnAirNowProd","g"):r.learnMore.replace("OnAirSearch","OnAirNowSearch","g"):(e=e.split("%").join(""),s="OnAirNowPg-_-"+e+"-_-"+i.OfferCode,o="icid="+s+"&cm_re="+s);document.getElementById("videoPlayer_LearnMore").href="/Product/"+f(i.TopLine)+"/"+i.OfferCode+"?"+o};n.watchLive=function(i){t.cookie("jwplayer.captionLabel",null,{path:"/"});var u={VideoAutoplay:i,VideoType:"LIVE STREAM",VideoPlayer:"jwplayer"},r={playerName:"shophqplayer",aspectratio:"16:9",width:"100%",autoStart:i,hlsStream:shopHq.onAir.flashOpenCaptionLiveStreamUrl,eventData:u,isLiveStream:!0};shopHq.pageUtils.isIE11&&(Hls===undefined||!Hls.isSupported())?(t("#divJWPlayer").hide(),t("#divHTML5Player").show(),r.playerName="evinehtml5player",t("#"+r.playerName).addClass("video-js").addClass("vjs-default-skin").addClass("vjs-16-9"),shopHq.video.watchLiveInVideoJS(r)):shopHq.video.useHTML5Player()?(t("#divJWPlayer").hide(),t("#divHTML5Player").show(),r.playerName="evinehtml5player",shopHq.video.watchLiveInHTML5Player(r)):shopHq.video.watchLive(r);t("#watch-us-live").attr("disabled",!0);t("#on-air-disclaimer-text").hide();n.liveStreamIsInPlayer=!0};n.onWatchLiveClick=function(){var n=function(n){shopHq.onAir.watchLive(!0);t("#videoPlayer_NowPlaying").html(n.NowPlayingShow+" | "+n.CurrentShowTime);shopHq.onAir.updateCurrentOfferDetailsData(n.OnAirItem)},i=function(){t("#videoPlayer_loadingDiv").hide();t.connection.hub.start()};t("#videoPlayer_loadingDiv").show();c(n,i)};n.setPlayerTitle=function(n,i){var r=t.cookieKey("Permanent1204","TimeZone");r!=null&&(r=parseInt(r),i.add("h",r-1));t("#videoPlayer_NowPlaying").html(n+" | "+i.format("EE, MMM d, yyyy h:mm a")+" "+l(r))};n.onWatchLiveItemChanged=function(i){try{var r=new Date(i.NowPlayingShowTime);n.setPlayerTitle(i.NowPlayingShow,r);t("#videoPlayer_ProductDescription span")[0].innerHTML!==i.OnAirItem.OfferCode&&(h(),shopHq.onAir.updateCurrentOfferDetailsData(i.OnAirItem),shopHq.pageUtils.flashBackground(t("#on-air-product-details"),"223,191,211"))}catch(u){console&&console.log("Error updating live item: "+u.message)}};n.watchDemoVideo=function(u,f){var e,o;t.connection.hub.stop();r(u.offerCode,function(n){shopHq.onAir.updateCurrentOfferDetailsData(n,f)});e={VideoProduct:u.offerCode,VideoAutoplay:!0,VideoType:"DEMO VIDEO",VideoPlayer:"jwplayer"};i=null;o={playerName:"shophqplayer",aspectratio:"16:9",width:"100%",autostart:!0,flashStream:u.flashStream,hlsStream:u.hlsStream,title:u.title,onTime:function(n){v(n)},onSeek:y,eventData:e,isLiveStream:!1};shopHq.video.watchOnDemandVideo(o);document.getElementById("videoPlayer_NowPlaying").innerHTML=u.title;t("#watch-us-live").removeAttr("disabled");t("#on-air-disclaimer-text").hide();n.liveStreamIsInPlayer=!1};n.loadShowProducts=function(i,r,u){var f=t("#TimeZone_SelectedId option:selected").text();t("#show-products").is(".first-load")?t("#show-products").show():t("#show-products").spin();t.get("/OnAir/ShowProductsForProgramGuide/"+i+"/"+f,{forProgramGuide:r}).done(function(i){if(shopHq.pageUtils.initalizeImageRefresh(i,"#show-products"),u!==undefined||u!==null){t(".show-product-details").remove();t(".content-row-"+u).find("#show-products-"+u).length<2&&t(".content-row-"+u).find(".pg-modal-body").html("<div id=show-products-"+u+"><\/div>");t("#show-products-"+u).replaceWith(i);let n=window.matchMedia("only screen and (max-width: 760px)").matches;t("#pg-mobile-items-carousel").remove();t("#pg-mobile-item-carousel-prev").remove();t("#pg-mobile-item-carousel-next").remove();n&&t("#show-products").replaceWith(i)}else t("#show-products").replaceWith(i);t("#show-products a.product-description").dotdotdot({height:30});n.displayProductRatings()}).fail(function(n,i,r){t("#show-products").hide();console&&console.log(r)}).always(function(){t("#show-products").spin(!1)})};n.searchProductsWithVideo=function(n,i){return n=t.trim(n),n!==""&&n!=="Search Videos"?i&&(document.location="/onair/ProductVideo/"+n+"#content"):alert("Please enter a valid search term or Item #"),!1};n.loadShowProductsWeekly=function(i,r){var u=t("#TimeZone_SelectedId option:selected").text();t("#show-products").is(".first-load")?t("#show-products").show():t("#show-products").spin();t.get("/OnAir/ShowProducts/"+i+"/"+u,{forProgramGuide:r}).done(function(i){shopHq.pageUtils.initalizeImageRefresh(i,"#show-products");t("#show-products").replaceWith(i);t("#show-products a.product-description").dotdotdot({height:30});n.displayProductRatings()}).fail(function(n,i,r){t("#show-products").hide();console&&console.log(r)}).always(function(){t("#show-products").spin(!1)})};n.searchProductsWithVideoWeekly=function(n,i){return n=t.trim(n),n!==""&&n!=="Search Videos"?i&&(document.location=shopHq.onAir.productVideoSearchUrl+"/"+n+"#content"):alert("Please enter a valid search term or Item #"),!1};n.displayProductRatings=function(){var n=[],i=t("div.on-air-content div[id^='BVRRInlineRating']");i.each(function(t,i){n[t]=i.id.substring(i.id.indexOf("-")+1)});n.length>0&&$BV.ui("rr","inline_ratings",{productIds:n,containerPrefix:"BVRRInlineRating"})};n.displayChannelsAjax=function(n){var i="/channelfinder";i=i+"/"+n;(n>0||n!=null)&&t.ajax({url:i,type:"get"}).done(function(n){t("#ChannelData").html(n)}).fail(function(){t("#ChannelData").html(null)})};var i=null;return n.RedirectToUrl=function(n){window.location.href=n},n}(shopHq.onAir=shopHq.onAir||{},jQuery),function(n){n.cookie&&(n.cookieKey=function(t,r,u,f){for(var s=new RegExp("(?:([^=]+)=([^&]*)&?)","ig"),e=null,o=[],h=n.cookie(t);e=s.exec(h);)if(r.toLowerCase()==e[1].toLowerCase())if(u)o.push([e[1],u]);else return e[2];else u&&o.push([e[1],e[2]]);if(u){for(updatedValue="",sep="",i=0;i<o;i++)updatedValue+=sep+o[i][0]+"="+o[i][1],sep="&";n.cookie(t,updatedValue,f)}else return null})}(jQuery,document),function(n){function t(t,i){var u,f,r,e,s,o,h,c,l;if(this.carouselRoot=n(t),r=this,this._b=this._a=!1,this._e=this._d=this._c="",this._f,this._g,this._h,this._i,this._j,this._k=0,this.settings=n.extend({},n.fn.touchCarousel.defaults,i),this._l=this.carouselRoot.find(".touchcarousel-container"),this._m=this._l[0].style,this._n=this._l.wrap(n('<div class="touchcarousel-wrapper" />')).parent(),e=this._l.find(".touchcarousel-item"),this.items=[],this.numItems=e.length,u=navigator.userAgent.toLowerCase(),f=/(chrome)[ \/]([\w.]+)/.exec(u)||/(webkit)[ \/]([\w.]+)/.exec(u)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(u)||/(msie) ([\w.]+)/.exec(u)||0>u.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(u)||[],u=f[1]||"",f=f[2]||"0",s={},u&&(s[u]=!0,s.version=f),s.chrome&&(s.webkit=!0),r._o=s,this._p,this._q=!1,this._t=this._s=this._r=0,this._w=this._v=this._u=!1,"ontouchstart"in window?(this.hasTouch=!0,this._c="touchstart.rs",this._d="touchmove.rs",this._e="touchend.rs",this._x=this.settings.baseTouchFriction):(this.hasTouch=!1,this._x=this.settings.baseMouseFriction,this.settings.dragUsingMouse?(this._c="mousedown.rs",this._d="mousemove.rs",this._e="mouseup.rs",this._y,this._z,u=r._o,u.msie||u.opera?this._y=this._z="move":u.mozilla&&(this._y="-moz-grab",this._z="-moz-grabbing"),this._a1()):this._n.addClass("auto-cursor")),(this.hasTouch||this.settings.useWebkit3d)&&"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix&&(this._l.css({"-webkit-transform-origin":"0 0","-webkit-transform":"translateZ(0)"}),this._w=!0),this._w?(this._b1="-webkit-transform",this._c1="translate3d(",this._d1="px, 0, 0)"):(this._b1="left",this._c1="",this._d1="px"),this.hasTouch&&(this.settings.directionNavAutoHide=!1),this.settings.directionNav||(this._f1=this._e1=this.settings.loopItems?!0:!1,this.settings.loopItems=!0),c=0,e.eq(this.numItems-1).addClass("last"),e.each(function(t){if(h=n(this),o={},o.item=h,o.index=t,o.posX=c,o.width=h.outerWidth(!0)||r.settings.itemFallbackWidth,c+=o.width,this.hasTouch){var i;h.find("a").each(function(){i=n(this);i.data("tc-href",i.attr("href"));i.data("tc-target",i.attr("target"));i.attr("href","#");i.bind("click",function(t){if(t.preventDefault(),r._q)return!1;t=n(this).data("tc-href");var i=n(this).data("tc-target");!i||"_g1"===i.toLowerCase()?window.location.href=t:window.open(t)})})}else h.find("a").bind("click.touchcarousel",function(n){if(r._q)return n.preventDefault(),!1});h.find(".non-draggable").bind(r._c,function(n){r._q=!1;n.stopImmediatePropagation()});r.items.push(o)}),this._h1=this._f=c,this._i1=0<this.settings.itemsPerMove?this.settings.itemsPerMove:1,this.settings.pagingNav){if(this._j1=this.settings.snapToItems=!0,this._k1=Math.ceil(this.numItems/this._i1),this._l1=0,this.settings.pagingNavControls){for(this._m1=n('<div class="tc-paging-container"><div class="tc-paging-centerer"><div class="tc-paging-centerer-inside"><\/div><\/div><\/div>'),e=this._m1.find(".tc-paging-centerer-inside"),f=1;f<=this._k1;f++)u=n('<a class="tc-paging-item" href="#">'+f+"<\/a>").data("tc-id",f),f===this._l1+1&&u.addClass("current"),e.append(u);this._n1=e.find(".tc-paging-item").click(function(t){t.preventDefault();r.goTo((n(t.currentTarget).data("tc-id")-1)*r._i1)});this._n.after(this._m1)}}else this._j1=!1;this._l.css({width:c});this.settings.directionNav&&(this._n.after("<a href='#' class='arrow-holder left'><span class='arrow-icon left'><\/span><\/a> <a href='#' class='arrow-holder right'><span class='arrow-icon right'><\/span><\/a>"),this.arrowLeft=this.carouselRoot.find(".arrow-holder.left"),this.arrowRight=this.carouselRoot.find(".arrow-holder.right"),1>this.arrowLeft.length||1>this.arrowRight.length?this.settings.directionNav=!1:this.settings.directionNavAutoHide&&(this.arrowLeft.hide(),this.arrowRight.hide(),this.carouselRoot.one("mousemove.arrowshover",function(){r.arrowLeft.fadeIn("fast");r.arrowRight.fadeIn("fast")}),this.carouselRoot.hover(function(){r.arrowLeft.fadeIn("fast");r.arrowRight.fadeIn("fast")},function(){r.arrowLeft.fadeOut("fast");r.arrowRight.fadeOut("fast")})),this._p1(0),this.settings.directionNav&&(this.arrowRight.click(function(n){n.preventDefault();(!r.settings.loopItems||r._u)&&r._f1||r.next()}),this.arrowLeft.click(function(n){n.preventDefault();(!r.settings.loopItems||r._u)&&r._e1||r.prev()})));this.carouselWidth;this._q1="onorientationchange"in window?"orientationchange.touchcarousel":"resize.touchcarousel";n(window).bind(this._q1,function(){l&&clearTimeout(l);l=setTimeout(function(){r.updateCarouselSize(!1)},100)});this.settings.scrollbar?(this._r1=n("<div class='scrollbar-holder'><div class='scrollbar"+("light"===this.settings.scrollbarTheme.toLowerCase()?" light":" dark")+"'><\/div><\/div>"),this._r1.appendTo(this.carouselRoot),this.scrollbarJQ=this._r1.find(".scrollbar"),this._s1="",this._t1=this.scrollbarJQ[0].style,this._u1=0,this.settings.scrollbarAutoHide?(this._v1=!1,this.scrollbarJQ.css("opacity",0)):this._v1=!0):this.settings.scrollbarAutoHide=!1;this.updateCarouselSize(!0);this._n.bind(this._c,function(n){r._w1(n)});this.settings.autoplay&&0<this.settings.autoplayDelay?(this._x1=!1,this.autoplayTimer="",this.wasAutoplayRunning=!0,this.hasTouch||this.carouselRoot.hover(function(){r._x1=!0;r._y1()},function(){r._x1=!1;r._z1()}),this.autoplay=!0,this._a2()):this.autoplay=!1;this.settings.keyboardNav&&n(document).bind("keydown.touchcarousel",function(n){r._u||(37===n.keyCode?r.prev():39===n.keyCode&&r.next())});this.carouselRoot.css("overflow","visible")}t.prototype={goTo:function(n,t){var i=this.items[n];i&&(!t&&this.autoplay&&this.settings.autoplayStopAtAction&&this.stopAutoplay(),this._b2(n),this.endPos=this._c2(),i=-i.posX,0<i?i=0:i<this.carouselWidth-this._h1&&(i=this.carouselWidth-this._h1),this.animateTo(i,this.settings.transitionSpeed,"easeInOutSine"))},next:function(n){var i=this._c2(),t=this._d2(i).index;this._j1?(i=this._l1+1,t=i>this._k1-1?this.settings.loopItems?0:(this._k1-1)*this._i1:i*this._i1):(t+=this._i1,this.settings.loopItems&&i<=this.carouselWidth-this._h1&&(t=0),t>this.numItems-1&&(t=this.numItems-1));this.goTo(t,n)},prev:function(n){var t=this._c2(),i=this._d2(t).index;this._j1?(t=this._l1-1,i=0>t?this.settings.loopItems?(this._k1-1)*this._i1:0:t*this._i1):(i-=this._i1,0>i&&(i=this.settings.loopItems?0>t?0:this.numItems-1:0));this.goTo(i,n)},getCurrentId:function(){return this._d2(this._c2()).index},setXPos:function(n,t){t?this._t1[this._b1]=this._c1+n+this._d1:this._m[this._b1]=this._c1+n+this._d1},stopAutoplay:function(){this._y1();this.wasAutoplayRunning=this.autoplay=!1},resumeAutoplay:function(){this.autoplay=!0;this.wasAutoplayRunning||this._z1()},updateCarouselSize:function(n){var t,i;if(this.carouselWidth=this.carouselRoot.width(),this.settings.scrollToLast){if(t=0,this._j1)if(i=this.numItems%this._i1,0<i)for(i=this.numItems-i;i<this.numItems;i++)t+=this.items[i].width;else t=this.carouselWidth;else t=this.items[this.numItems-1].width;this._h1=this._f+this.carouselWidth-t}else this._h1=this._f;if(this.settings.scrollbar&&(t=Math.round(this._r1.width()/(this._h1/this.carouselWidth)),this.scrollbarJQ.css("width",t),this._u1=this._r1.width()-t),!this.settings.scrollToLast){if(this.carouselWidth>=this._f){this._v=!0;this.settings.loopItems||(this._f1=!0,this.arrowRight.addClass("disabled"),this._e1=!0,this.arrowLeft.addClass("disabled"));this.setXPos(0);return}this._v&&(this._e1=this._f1=this._v=!1,this.arrowRight.removeClass("disabled"),this.arrowLeft.removeClass("disabled"))}n||(n=this.endPos=this._c2(),0<n?n=0:n<this.carouselWidth-this._h1&&(n=this.carouselWidth-this._h1),this.animateTo(n,300,"easeInOutSine"))},animateTo:function(t,i,r,u,f,e,o){function k(){s._b=!1;s._a2();s.settings.scrollbarAutoHide&&s._g2();null!==s.settings.onAnimComplete&&s.settings.onAnimComplete.call(s)}var v,y,p;null!==this.settings.onAnimStart&&this.settings.onAnimStart.call(this);this.autoplay&&this.autoplayTimer&&(this.wasAutoplayRunning=!0,this._y1());this._e2();var s=this,a=this.settings.scrollbar,h=s._b1,c=s._c1,l=s._d1,d={containerPos:this.endPos},w={containerPos:t},b={containerPos:f};f=u?f:t;v=s._m;s._b=!0;a&&(y=this._t1,p=s._h1-s.carouselWidth,this.settings.scrollbarAutoHide&&(this._v1||this._f2()));this._p1(f);this._p=n(d).animate(w,{duration:i,easing:r,step:function(){a&&(y[h]=c+Math.round(s._u1*(-this.containerPos/p))+l);v[h]=c+Math.round(this.containerPos)+l},complete:function(){u?s._p=n(w).animate(b,{duration:e,easing:o,step:function(){a&&(y[h]=c+Math.round(s._u1*(-this.containerPos/p))+l);v[h]=c+Math.round(this.containerPos)+l},complete:function(){a&&(y[h]=c+Math.round(s._u1*(-b.containerPos/p))+l);v[h]=c+Math.round(b.containerPos)+l;k()}}):(a&&(y[h]=c+Math.round(s._u1*(-w.containerPos/p))+l),v[h]=c+Math.round(w.containerPos)+l,k())}})},destroy:function(){this.stopAutoplay();this._n.unbind(this._c);n(document).unbind(this._d).unbind(this._e);n(window).unbind(this._q1);this.settings.keyboardNav&&n(document).unbind("keydown.touchcarousel");this.carouselRoot.remove()},_b2:function(n){this._j1&&(this._l1=n=this._h2(n),this.settings.pagingNavControls&&(this._n1.removeClass("current"),this._n1.eq(n).addClass("current")))},_h2:function(n){for(var i=this._i1,t=0;t<this._k1;t++)if(n>=t*i&&n<t*i+i)return t;return 0>n?0:n>=this._k1?this._k1-1:!1},_i2:function(){this.settings.loopItems||(this._e1?(this._e1=!1,this.arrowLeft.removeClass("disabled")):this._f1&&(this._f1=!1,this.arrowRight.removeClass("disabled")))},_o1:function(){this._e1||this.settings.loopItems||(this._e1=!0,this.arrowLeft.addClass("disabled"),this._f1&&(this._f1=!1,this.arrowRight.removeClass("disabled")))},_j2:function(){this._f1||this.settings.loopItems||(this._f1=!0,this.arrowRight.addClass("disabled"),this._e1&&(this._e1=!1,this.arrowLeft.removeClass("disabled")))},_d2:function(n){n=-n;for(var t,i=0;i<this.numItems;i++)if(t=this.items[i],n>=t.posX&&n<t.posX+t.width)return t;return-1},_a2:function(){this.autoplay&&this.wasAutoplayRunning&&(this._x1||this._z1(),this.wasAutoplayRunning=!1)},_g2:function(){var n=this;this._v1=!1;this._s1&&clearTimeout(this._s1);this._s1=setTimeout(function(){n.scrollbarJQ.animate({opacity:0},150,"linear")},450)},_f2:function(){this._v1=!0;this._s1&&clearTimeout(this._s1);this.scrollbarJQ.stop().animate({opacity:1},150,"linear")},_e2:function(){this._p&&this._p.stop()},_z1:function(){if(this.autoplay){var n=this;this.autoplayTimer||(this.autoplayTimer=setInterval(function(){n._k2||n._b||n.next(!0)},this.settings.autoplayDelay))}},_y1:function(){this.autoplayTimer&&(clearInterval(this.autoplayTimer),this.autoplayTimer="")},_c2:function(n){return n=n?this.scrollbarJQ:this._l,this._w?(n=n.css("-webkit-transform").replace(/^matrix\(/i,"").split(/, |\)$/g),parseInt(n[4],10)):Math.round(n.position().left)},_w1:function(t){var i,r;if(!this._k2){if(this.autoplay&&this.settings.autoplayStopAtAction&&this.stopAutoplay(),this._e2(),this.settings.scrollbarAutoHide&&this._f2(),this.hasTouch)if(this._a=!1,(i=t.originalEvent.touches)&&0<i.length)i=i[0];else return!1;else i=t,t.preventDefault();this._l2();this._k2=!0;r=this;this._w&&r._l.css({"-webkit-transition-duration":"0","-webkit-transition-property":"none"});n(document).bind(this._d,function(n){r._m2(n)});n(document).bind(this._e,function(n){r._n2(n)});this._o2=this._c2();this._i=i.clientX;this._q=!1;this._k=t.timeStamp||(new Date).getTime();this._t=0;this._s=this._r=i.clientX;this._p2=i.clientY}},_m2:function(n){var r=n.timeStamp||(new Date).getTime(),t,i;if(this.hasTouch){if(this._a||(t=n.originalEvent.touches,1<t.length))return!1;if(t=t[0],Math.abs(t.clientY-this._p2)>Math.abs(t.clientX-this._r)+3)return this.settings.lockAxis&&(this._a=!0),!1}else t=n;return n.preventDefault(),this._j=t.clientX,this._q2=this._r2,n=t.clientX-this._s,this._q2!=n&&(this._r2=n),0!=n&&(i=this._o2+this._t,0<=i?(n/=4,this._o1()):i<=this.carouselWidth-this._h1?(this._j2(),n/=4):this._i2(),this._t+=n,this.setXPos(i),this.settings.scrollbar&&this.setXPos(this._u1*(-i/(this._h1-this.carouselWidth)),!0)),this._s=t.clientX,350<r-this._k&&(this._k=r,this._i=t.clientX),null!==this.settings.onDragStart&&this.settings.onDragStart.call(this),!1},_n2:function(t){var e,f,i,r;if(this._k2){if(e=this,this._k2=!1,this._a1(),this.endPos=this._c2(),this.isdrag=!1,n(document).unbind(this._d).unbind(this._e),this.endPos==this._o2){this._q=!1;this.settings.scrollbarAutoHide&&this._g2();return}if(this._q=!0,f=this._j-this._i,t=Math.max(40,(t.timeStamp||(new Date).getTime())-this._k),i=.5,t=Math.abs(f)/t,r=function(n){return 0<n?n=0:n<e.carouselWidth-e._h1&&(n=e.carouselWidth-e._h1),n},this.settings.snapToItems){this.autoplay&&this.settings.autoplayStopAtAction&&this.stopAutoplay();var f=Boolean(0<this._r-this._s),i=r(this._c2()),u=this._d2(i).index;this._j1?(f&&(i=Math.max(i-this.carouselWidth-1,1-e._h1),u=this._d2(i).index,void 0===u&&(u=this.numItems-1)),u=this._h2(u)*this._i1):u+=f?this._i1:-this._i1+1;u=f?Math.min(u,this.numItems-1):Math.max(u,0);i=this.items[u];this._b2(u);i&&(i=r(-i.posX),r=Math.abs(this.endPos-i),t=Math.max(1.08*r/t,150),u=Boolean(180>t),r*=.08,f&&(r*=-1),this.animateTo(u?i+r:i,Math.min(t,400),"easeOutSine",u,i,300,"easeOutCubic"))}else r=0,2>=t?(i=3.5*this._x,r=0):2<t&&3>=t?(i=4*this._x,r=200):3<t&&(r=300,4<t&&(t=4,r=400,i=6*this._x),i=5*this._x),f=2*t*t/(2*i)*(0>f?-1:1),i=2*t/i+r,0<this.endPos+f?0<this.endPos?this.animateTo(0,800,"easeOutCubic"):this.animateTo(this.carouselWidth/10*((r+200)/1e3),1.1*Math.abs(this.endPos)/t,"easeOutSine",!0,0,400,"easeOutCubic"):this.endPos+f<this.carouselWidth-this._h1?this.endPos<this.carouselWidth-this._h1?this.animateTo(this.carouselWidth-this._h1,800,"easeOutCubic"):this.animateTo(this.carouselWidth-this._h1-this.carouselWidth/10*((r+200)/1e3),1.1*Math.abs(this.carouselWidth-this._h1-this.endPos)/t,"easeOutSine",!0,this.carouselWidth-this._h1,400,"easeOutCubic"):this.animateTo(this.endPos+f,i,"easeOutCubic");null!==this.settings.onDragRelease&&this.settings.onDragRelease.call(this)}return!1},_p1:function(n){void 0===n&&(n=this._c2());this.settings.loopItems||(0<=n?this._o1():n<=this.carouselWidth-this._h1?this._j2():this._i2())},_a1:function(){this._y?this._n.css("cursor",this._y):(this._n.removeClass("grabbing-cursor"),this._n.addClass("grab-cursor"))},_l2:function(){this._z?this._n.css("cursor",this._z):(this._n.removeClass("grab-cursor"),this._n.addClass("grabbing-cursor"))}};n.fn.touchCarousel=function(i){return this.each(function(){var r=new t(n(this),i);n(this).data("touchCarousel",r)})};n.fn.touchCarousel.defaults={itemsPerMove:1,snapToItems:!1,pagingNav:!1,pagingNavControls:!0,autoplay:!1,autoplayDelay:3e3,autoplayStopAtAction:!0,scrollbar:!0,scrollbarAutoHide:!1,scrollbarTheme:"dark",transitionSpeed:600,directionNav:!0,directionNavAutoHide:!1,loopItems:!1,keyboardNav:!1,dragUsingMouse:!0,scrollToLast:!1,itemFallbackWidth:500,baseMouseFriction:.0012,baseTouchFriction:.0008,lockAxis:!0,useWebkit3d:!1,onAnimStart:null,onAnimComplete:null,onDragStart:null,onDragRelease:null};n.fn.touchCarousel.settings={};n.extend(jQuery.easing,{easeInOutSine:function(n,t,i,r,u){return-r/2*(Math.cos(Math.PI*t/u)-1)+i},easeOutSine:function(n,t,i,r,u){return r*Math.sin(t/u*(Math.PI/2))+i},easeOutCubic:function(n,t,i,r,u){return r*((t=t/u-1)*t*t+1)+i}})}(jQuery),function(n,t){function a(n){var t=videojs(n.playerName);t.src({src:n.hlsStream.replace("http://","https://"),type:"application/x-mpegURL"});t.play()}function v(n){var t=!0;return(shopHq.pageUtils.isAndroid()||shopHq.pageUtils.isIPad()||shopHq.pageUtils.isIPhone())&&n.hlsStream===""&&(e(n.playerName,"Our apologies, video playback is not supported on this device."),t=!1),t}function y(){return[{image:s,title:"ShopHQ",sources:[{file:r.hlsStream.replace("http://","https://"),type:"hls"}]}]}function u(n,t){n.on(Hls.Events.MEDIA_ATTACHED,function(){console.log("video and hls.js are now bound together !");n.loadSource(t.hlsStream.replace("http://","https://"));n.on(Hls.Events.MANIFEST_PARSED,function(n,t){console.log("manifest loaded, found "+t.levels.length+" quality level")})});n.on(Hls.Events.ERROR,function(t,i){if(i.fatal)switch(i.type){case Hls.ErrorTypes.NETWORK_ERROR:n.destroy();break;case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover");n.recoverMediaError();break;default:console.log("fatal error encountered.");n.destroy()}});var i=document.getElementById(t.playerName);n.attachMedia(i)}function f(n){function i(n,t){var u=jwplayer(t.playerName),i=jQuery.extend({},t.eventData);i.VideoDurationWatched=u.getPosition()-r;i.VideoName=u.getPlaylistItem().file;console.log({name:n,data:i});jQuery(window).trigger(n,i)}var e=30,u=0,f=0,r=0,t;try{t=jwplayer(n.playerName);t.on("play",function(){i("dataLayerVideoStart",n)});t.on("complete",function(){i("dataLayerVideoEnd",n)});t.on("pause",function(){i("dataLayerVideoPause",n)});t.on("seek",function(){i("dataLayerVideoSeek",n)});t.on("captionsChange",function(){i("dataLayerVideoCaptions",n)});t.on("resize",function(){i("dataLayerVideoResize",n)});t.on("volume",function(){i("dataLayerVideoVolume",n)});t.on("time",function(o){var s=Math.floor(t.getPosition()),h,c;n.isLiveStream&&(r===0&&(r=Math.floor(t.getPosition())),s=s-r);s%e==0&&s!==u&&(console.log(s),u=s,i("dataLayerVideoDurationWatched",n));n.eventData&&n.eventData.VideoDuration>0&&(h=Math.floor(o.position/n.eventData.VideoDuration*100),h%25==0&&h!==f&&(f=h,c=jQuery.extend(!0,{},n),c.eventData.VideoPercentComplete=h,i("dataLayerVideoPercentWatched",c)))})}catch(o){console.log("dataLayer - dataLayerTracking "+o)}}function p(n){var i=!0,t;return(shopHq.pageUtils.isAndroid()||shopHq.pageUtils.isIPad()||shopHq.pageUtils.isIPhone())&&(n.hlsStream||(t="Our apologies, video playback is not supported on this device.",n.flashStream&&(t="Our apologies, flash video playback is not supported on this device. This video can be viewed on a device that supports flash."),e(n.playerName,t),i=!1)),i}function e(n,t){var r=document.getElementById(n),i;r.innerHTML="";r.className="offerVideoNotSupported";i=document.createElement("p");i.className="offerVideoNotText";i.innerHTML=t;r.appendChild(i)}function o(n,i){i?t("#"+n).parent().removeClass("live-stream"):t("#"+n).parent().addClass("live-stream")}jwplayer.key="hX0jjG+BDvcGEMff3FIWDHhz9QtD3xn63JxiebW++8c=";var s="/images/global/cc/EVINE_loading_bg.jpg",h="/images/store1/videoplayers/EVINE_preloader.png",c="16:9",i="html5",l="glow",r;return n.watchLive=function(n){if(v(n)){r=n;jwplayer(n.playerName).stop();var t=jwplayer(n.playerName).getCurrentCaptions()||0,u=y(t);if(n.aspectratio||(n.aspectratio=c),jwplayer(n.playerName).setup({playlist:u,mute:n.mute,autostart:n.autoStart,primary:i,hlshtml:!0,smoothing:!0,width:n.width,aspectratio:n.aspectratio}),n.onReady)jwplayer(n.playerName).on("ready",function(){n.onReady.call(this)});if(n.onPlay)jwplayer(n.playerName).on("play",n.onPlay);f(n)}},n.watchLiveInHTML5Player=function(n){if(o(n.playerName,!1),Hls.isSupported()){var t=new Hls;u(t,n)}},n.watchLiveInVideoJS=function(n){shopHq.pageUtils.loadCSS("/scripts/videoJS/6.2.0/video-js.css");shopHq.pageUtils.loadJS("/scripts/videoJS/6.2.0/video.min.js",function(){shopHq.pageUtils.loadJS("/scripts/videoJS/6.2.0/flashfallback/videojs-flash.min.js",function(){shopHq.pageUtils.loadJS("/scripts/videoJS/6.2.0/flashfallback/videojs-contrib-hls.min.js",function(){a(n)})})})},n.watchOnDemandVideo=function(n){var r=n.start+n.duration,t="";if(p(n)&&n.hlsStream!==null&&n.hlsStream!==""){if(n.hlsStream&&(t=n.hlsStream.replace("http://","https://")),jwplayer(n.playerName).setup({mute:n.mute,title:n.title,primary:i,autostart:n.autoStart!==!1,playlist:[{image:h,sources:[{type:"hls",file:t}]}],hlshtml:!0,skin:{name:l},width:n.width,aspectratio:n.aspectratio}),n.onTimeConfig&&shopHq.video.registerOnTimeAction(n.onTimeConfig),n.onTime)jwplayer(n.playerName).on("time",n.onTime);if(n.onPlay)jwplayer(n.playerName).on("play",n.onPlay);if(n.onComplete)jwplayer(n.playerName).on("complete",n.onComplete);if(n.onPause)jwplayer(n.playerName).on("pause",n.onPause);if(n.onVolume)jwplayer(n.playerName).on("volume",n.onVolume);if(n.onResize)jwplayer(n.playerName).on("resize",n.onResize);if(n.onSeek)jwplayer(n.playerName).on("seek",n.onSeek);if(n.onCaptionsChange)jwplayer(n.playerName).on("captionsChange",n.onCaptionsChange);f(n)}},n.watchOnDemandVideoInHTML5Player=function(n){var r;if(o(n.playerName,!0),Hls.isSupported()){var t={},f=n.start+n.duration,i="";n.hlsStream&&(i=n.hlsStream.replace("http://","https://"),t.startPosition=12,n.hlsStream=i);r=new Hls(t);u(r,n)}},n.registerOnTimeAction=function(n){function i(n,t){return n.startTime<=t.position&&n.startTime+t.duration>t.position&&n.enabled}jwplayer(n.playerName).on("time",function(r){t.each(n.actions,function(n,t){i(t,r)&&(t.enabled=!1,t.callback(n))})});jwplayer(n.playerName).on("seek",function(){t.each(n.actions,function(n,t){t.enabled=!0})})},n.useHTML5Player=function(){return!1},n}(shopHq.video=shopHq.video||{},jQuery),function(n,t,i){function v(t,i){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(f)==="string"&&r.transports[f]||(i.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(i.log("No transports remain within the specified transport array."),t=null)}else if(r.transports[t]||t==="auto"){if(t==="auto"&&r._.ieVersion<=8)return["longPolling"]}else i.log("Invalid transport: "+t.toString()+"."),t=null;return t}function y(n){return n==="http:"?80:n==="https:"?443:void 0}function h(n,t){return t.match(/:\d+$/)?t:t+":"+y(n)}function p(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1};u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())};u.clear=function(){r=[]}}var f={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorDuringStartRequest:"Error during start request. Stopping the connection.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server.  Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection."};if(typeof n!="function")throw new Error(f.nojQuery);var r,c,s=t.document.readyState==="complete",e=n(t),l="__Negotiate Aborted__",u={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},w=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},o=function(t,i,r){return i===t.state?(t.state=r,n(t).triggerHandler(u.onStateChanged,[{oldState:i,newState:r}]),!0):!1},b=function(n){return n.state===r.connectionState.disconnected},a=function(n){return n._.keepAliveData.activated&&n.transport.supportsKeepAlive(n)},k=function(i){var f,e;i._.configuredStopReconnectingTimeout||(e=function(t){var i=r._.format(r.resources.reconnectTimeout,t.disconnectTimeout);t.log(i);n(t).triggerHandler(u.onError,[r._.error(i,"TimeoutException")]);t.stop(!1,!1)},i.reconnecting(function(){var n=this;n.state===r.connectionState.reconnecting&&(f=t.setTimeout(function(){e(n)},n.disconnectTimeout))}),i.stateChanged(function(n){n.oldState===r.connectionState.reconnecting&&t.clearTimeout(f)}),i._.configuredStopReconnectingTimeout=!0)};r=function(n,t,i){return new r.fn.init(n,t,i)};r._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var i,n;return t.navigator.appName==="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}(),error:function(n,t,i){var r=new Error(n);return r.source=t,typeof i!="undefined"&&(r.context=i),r},transportError:function(n,t,r,u){var f=this.error(n,r,u);return f.transport=t?t.name:i,f},format:function(){for(var t=arguments[0],n=0;n<arguments.length-1;n++)t=t.replace("{"+n+"}",arguments[n+1]);return t},firefoxMajorVersion:function(n){var t=n.match(/Firefox\/(\d+)/);return!t||!t.length||t.length<2?0:parseInt(t[1],10)},configurePingInterval:function(i){var f=i._.config,e=function(t){n(i).triggerHandler(u.onError,[t])};f&&!i._.pingIntervalId&&f.pingInterval&&(i._.pingIntervalId=t.setInterval(function(){r.transports._logic.pingServer(i).fail(e)},f.pingInterval))}};r.events=u;r.resources=f;r.ajaxDefaults={processData:!0,timeout:null,async:!0,global:!1,cache:!1};r.changeState=o;r.isDisconnecting=b;r.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4};r.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.");}};e.load(function(){s=!0});r.fn=r.prototype={init:function(t,i,r){var f=n(this);this.url=t;this.qs=i;this.lastError=null;this._={keepAliveData:{},connectingMessageBuffer:new p(this,function(n){f.triggerHandler(u.onReceived,[n])}),lastMessageAt:(new Date).getTime(),lastActiveAt:(new Date).getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0};typeof r=="boolean"&&(this.logging=r)},_parseResponse:function(n){var t=this;return n?typeof n=="string"?t.json.parse(n):n:n},_originalJson:t.JSON,json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),r=r||t.location,i.indexOf("http")!==0)?!1:(u=t.document.createElement("a"),u.href=i,u.protocol+h(u.protocol,u.host)!==r.protocol+h(r.protocol,r.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:r.connectionState.disconnected,clientProtocol:"1.5",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(i,h){var c=this,y={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},d,p=c._deferral||n.Deferred(),w=t.document.createElement("a"),b,g;if(c.lastError=null,c._deferral=p,!c.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(n.type(i)==="function"?h=i:n.type(i)==="object"&&(n.extend(y,i),n.type(y.callback)==="function"&&(h=y.callback)),y.transport=v(y.transport,c),!y.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");return(c._.config=y,!s&&y.waitForPageLoad===!0)?(c._.deferredStartHandler=function(){c.start(i,h)},e.bind("load",c._.deferredStartHandler),p.promise()):c.state===r.connectionState.connecting?p.promise():o(c,r.connectionState.disconnected,r.connectionState.connecting)===!1?(p.resolve(c),p.promise()):(k(c),w.href=c.url,w.protocol&&w.protocol!==":"?(c.protocol=w.protocol,c.host=w.host):(c.protocol=t.document.location.protocol,c.host=w.host||t.document.location.host),c.baseUrl=c.protocol+"//"+c.host,c.wsProtocol=c.protocol==="https:"?"wss://":"ws://",y.transport==="auto"&&y.jsonp===!0&&(y.transport="longPolling"),c.url.indexOf("//")===0&&(c.url=t.location.protocol+c.url,c.log("Protocol relative URL detected, normalizing it to '"+c.url+"'.")),this.isCrossDomain(c.url)&&(c.log("Auto detected cross domain url."),y.transport==="auto"&&(y.transport=["webSockets","serverSentEvents","longPolling"]),typeof y.withCredentials=="undefined"&&(y.withCredentials=!0),y.jsonp||(y.jsonp=!n.support.cors,y.jsonp&&c.log("Using jsonp because this browser doesn't support CORS.")),c.contentType=r._.defaultContentType),c.withCredentials=y.withCredentials,c.ajaxDataType=y.jsonp?"jsonp":"text",n(c).bind(u.onStart,function(){n.type(h)==="function"&&h.call(c);p.resolve(c)}),c._.initHandler=r.transports._logic.initHandler(c),d=function(i,s){var l=r._.error(f.noTransportOnInit);if(s=s||0,s>=i.length){s===0?c.log("No transports supported by the server were selected."):s===1?c.log("No fallback transports were selected."):c.log("Fallback transports exhausted.");n(c).triggerHandler(u.onError,[l]);p.reject(l);c.stop();return}if(c.state!==r.connectionState.disconnected){var y=i[s],h=r.transports[y],v=function(){d(i,s+1)};c.transport=h;try{c._.initHandler.start(h,function(){var i=r._.firefoxMajorVersion(t.navigator.userAgent)>=11,f=!!c.withCredentials&&i;c.log("The start request succeeded. Transitioning to the connected state.");a(c)&&r.transports._logic.monitorKeepAlive(c);r.transports._logic.startHeartbeat(c);r._.configurePingInterval(c);o(c,r.connectionState.connecting,r.connectionState.connected)||c.log("WARNING! The connection was not in the connecting state.");c._.connectingMessageBuffer.drain();n(c).triggerHandler(u.onStart);e.bind("unload",function(){c.log("Window unloading, stopping the connection.");c.stop(f)});i&&e.bind("beforeunload",function(){t.setTimeout(function(){c.stop(f)},0)})},v)}catch(w){c.log(h.name+" transport threw '"+w.message+"' when attempting to start.");v()}}},b=c.url+"/negotiate",g=function(t,i){var e=r._.error(f.errorOnNegotiate,t,i._.negotiateRequest);n(i).triggerHandler(u.onError,e);p.reject(e);i.stop()},n(c).triggerHandler(u.onStarting),b=r.transports._logic.prepareQueryString(c,b),c.log("Negotiating with '"+b+"'."),c._.negotiateRequest=r.transports._logic.ajax(c,{url:b,error:function(n,t){t!==l?g(n,c):p.reject(r._.error(f.stoppedWhileNegotiating,null,c._.negotiateRequest))},success:function(t){var i,e,h,o=[],s=[];try{i=c._parseResponse(t)}catch(l){g(r._.error(f.errorParsingNegotiateResponse,l),c);return}if(e=c._.keepAliveData,c.appRelativeUrl=i.Url,c.id=i.ConnectionId,c.token=i.ConnectionToken,c.webSocketServerUrl=i.WebSocketServerUrl,c._.pollTimeout=i.ConnectionTimeout*1e3+1e4,c.disconnectTimeout=i.DisconnectTimeout*1e3,c._.totalTransportConnectTimeout=c.transportConnectTimeout+i.TransportConnectTimeout*1e3,i.KeepAliveTimeout?(e.activated=!0,e.timeout=i.KeepAliveTimeout*1e3,e.timeoutWarning=e.timeout*c.keepAliveWarnAt,c._.beatInterval=(e.timeout-e.timeoutWarning)/3):e.activated=!1,c.reconnectWindow=c.disconnectTimeout+(e.timeout||0),!i.ProtocolVersion||i.ProtocolVersion!==c.clientProtocol){h=r._.error(r._.format(f.protocolIncompatible,c.clientProtocol,i.ProtocolVersion));n(c).triggerHandler(u.onError,[h]);p.reject(h);return}n.each(r.transports,function(n){if(n.indexOf("_")===0||n==="webSockets"&&!i.TryWebSockets)return!0;s.push(n)});n.isArray(y.transport)?n.each(y.transport,function(t,i){n.inArray(i,s)>=0&&o.push(i)}):y.transport==="auto"?o=s:n.inArray(y.transport,s)>=0&&o.push(y.transport);d(o)}}),p.promise())},starting:function(t){var i=this;return n(i).bind(u.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===r.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(t.state===r.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(u.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(u.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(u.onError,function(n,r,u){i.lastError=r;t.call(i,r,u)}),i},disconnected:function(t){var i=this;return n(i).bind(u.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(u.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(u.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(u.onReconnect,function(){t.call(i)}),i},stop:function(i,h){var c=this,v=c._deferral;if(c._.deferredStartHandler&&e.unbind("load",c._.deferredStartHandler),delete c._.config,delete c._.deferredStartHandler,!s&&(!c._.config||c._.config.waitForPageLoad===!0)){c.log("Stopping connection prior to negotiate.");v&&v.reject(r._.error(f.stoppedWhileLoading));return}if(c.state!==r.connectionState.disconnected)return c.log("Stopping connection."),o(c,c.state,r.connectionState.disconnected),t.clearTimeout(c._.beatHandle),t.clearInterval(c._.pingIntervalId),c.transport&&(c.transport.stop(c),h!==!1&&c.transport.abort(c,i),a(c)&&r.transports._logic.stopMonitoringKeepAlive(c),c.transport=null),c._.negotiateRequest&&(c._.negotiateRequest.abort(l),delete c._.negotiateRequest),c._.initHandler&&c._.initHandler.stop(),n(c).triggerHandler(u.onDisconnect),delete c._deferral,delete c.messageId,delete c.groupsToken,delete c.id,delete c._.pingIntervalId,delete c._.lastMessageAt,delete c._.lastActiveAt,c._.connectingMessageBuffer.clear(),c},log:function(n){w(n,this.logging)}};r.fn.init.prototype=r.fn;r.noConflict=function(){return n.connection===r&&(n.connection=c),r};n.connection&&(c=n.connection);n.connection=n.signalR=r}(window.jQuery,window),function(n,t,i){function o(n){n._.keepAliveData.monitoring&&c(n);u.markActive(n)&&(n._.beatHandle=t.setTimeout(function(){o(n)},n._.beatInterval))}function c(t){var i=t._.keepAliveData,u;t.state===r.connectionState.connected&&(u=(new Date).getTime()-t._.lastMessageAt,u>=i.timeout?(t.log("Keep alive timed out.  Notifying transport that connection has been lost."),t.transport.lostConnection(t)):u>=i.timeoutWarning?i.userNotified||(t.log("Keep alive has been missed, connection may be dead/slow."),n(t).triggerHandler(f.onConnectionSlow),i.userNotified=!0):i.userNotified=!1)}function e(n,t){var i=n.url+t;return n.transport&&(i+="?transport="+n.transport.name),u.prepareQueryString(n,i)}function s(n){this.connection=n;this.startRequested=!1;this.startCompleted=!1;this.connectionStopped=!1}var r=n.signalR,f=n.signalR.events,l=n.signalR.changeState,h="__Start Aborted__",u;r.transports={};s.prototype={start:function(n,r,u){var f=this,e=f.connection,o=!1;if(f.startRequested||f.connectionStopped){e.log("WARNING! "+n.name+" transport cannot be started. Initialization ongoing or completed.");return}e.log(n.name+" transport starting.");f.transportTimeoutHandle=t.setTimeout(function(){o||(o=!0,e.log(n.name+" transport timed out when trying to connect."),f.transportFailed(n,i,u))},e._.totalTransportConnectTimeout);n.start(e,function(){o||f.initReceived(n,r)},function(t){return o||(o=!0,f.transportFailed(n,t,u)),!f.startCompleted||f.connectionStopped})},stop:function(){this.connectionStopped=!0;t.clearTimeout(this.transportTimeoutHandle);r.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(n,i){var u=this,f=u.connection;if(u.startRequested){f.log("WARNING! The client received multiple init messages.");return}u.connectionStopped||(u.startRequested=!0,t.clearTimeout(u.transportTimeoutHandle),f.log(n.name+" transport connected. Initiating start request."),r.transports._logic.ajaxStart(f,function(){u.startCompleted=!0;i()}))},transportFailed:function(i,u,e){var o=this.connection,h=o._deferral,s;this.connectionStopped||(t.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||(s=r._.error(r.resources.errorDuringStartRequest,u),o.log(i.name+" transport failed during the start request. Stopping the connection."),n(o).triggerHandler(f.onError,[s]),h&&h.reject(s),o.stop()):(i.stop(o),o.log(i.name+" transport failed to connect. Attempting to fall back."),e()))}};u=r.transports._logic={ajax:function(t,i){return n.ajax(n.extend(!0,{},n.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:t.withCredentials},contentType:t.contentType,dataType:t.ajaxDataType},i))},pingServer:function(t){var e,f,i=n.Deferred();return t.transport?(e=t.url+"/ping",e=u.addQs(e,t.qs),f=u.ajax(t,{url:e,success:function(n){var u;try{u=t._parseResponse(n)}catch(e){i.reject(r._.transportError(r.resources.pingServerFailedParse,t.transport,e,f));t.stop();return}u.Response==="pong"?i.resolve():i.reject(r._.transportError(r._.format(r.resources.pingServerFailedInvalidResponse,n),t.transport,null,f))},error:function(n){n.status===401||n.status===403?(i.reject(r._.transportError(r._.format(r.resources.pingServerFailedStatusCode,n.status),t.transport,n,f)),t.stop()):i.reject(r._.transportError(r.resources.pingServerFailed,t.transport,n,f))}})):i.reject(r._.transportError(r.resources.noConnectionTransport,t.transport)),i.promise()},prepareQueryString:function(n,i){var r;return r=u.addQs(i,"clientProtocol="+n.clientProtocol),r=u.addQs(r,n.qs),n.token&&(r+="&connectionToken="+t.encodeURIComponent(n.token)),n.data&&(r+="&connectionData="+t.encodeURIComponent(n.data)),r},addQs:function(t,i){var r=t.indexOf("?")!==-1?"&":"?",u;if(!i)return t;if(typeof i=="object")return t+r+n.param(i);if(typeof i=="string")return u=i.charAt(0),(u==="?"||u==="&")&&(r=""),t+r+i;throw new Error("Query string property must be either a string or object.");},getUrl:function(n,i,r,f,e){var h=i==="webSockets"?"":n.baseUrl,o=h+n.appRelativeUrl,s="transport="+i;return!e&&n.groupsToken&&(s+="&groupsToken="+t.encodeURIComponent(n.groupsToken)),r?(o+=f?"/poll":"/reconnect",!e&&n.messageId&&(s+="&messageId="+t.encodeURIComponent(n.messageId))):o+="/connect",o+="?"+s,o=u.prepareQueryString(n,o),e||(o+="&tid="+Math.floor(Math.random()*11)),o},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!="undefined"?!0:!1,ShouldReconnect:typeof n.T!="undefined"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},stringifySend:function(n,t){return typeof t=="string"||typeof t=="undefined"||t===null?t:n.json.stringify(t)},ajaxSend:function(t,i){var h=u.stringifySend(t,i),c=e(t,"/send"),o,s=function(t,u){n(u).triggerHandler(f.onError,[r._.transportError(r.resources.sendFailed,u.transport,t,o),i])};return o=u.ajax(t,{url:c,type:t.ajaxDataType==="jsonp"?"GET":"POST",contentType:r._.defaultContentType,data:{data:h},success:function(n){var i;if(n){try{i=t._parseResponse(n)}catch(r){s(r,t);t.stop();return}u.triggerReceived(t,i)}},error:function(n,i){i!=="abort"&&i!=="parsererror"&&s(n,t)}})},ajaxAbort:function(n,t){if(typeof n.transport!="undefined"){t=typeof t=="undefined"?!0:t;var i=e(n,"/abort");u.ajax(n,{url:i,async:t,timeout:1e3,type:"POST"});n.log("Fired ajax abort async = "+t+".")}},ajaxStart:function(t,i){var s=function(n){var i=t._deferral;i&&i.reject(n)},o=function(i){t.log("The start request failed. Stopping the connection.");n(t).triggerHandler(f.onError,[i]);s(i);t.stop()};t._.startRequest=u.ajax(t,{url:e(t,"/start"),success:function(n,u,f){var e;try{e=t._parseResponse(n)}catch(s){o(r._.error(r._.format(r.resources.errorParsingStartResponse,n),s,f));return}e.Response==="started"?i():o(r._.error(r._.format(r.resources.invalidStartResponse,n),null,f))},error:function(n,i,u){i!==h?o(r._.error(r.resources.errorDuringStartRequest,u,n)):(t.log("The start request aborted because connection.stop() was called."),s(r._.error(r.resources.stoppedDuringStartRequest,null,n)))}})},tryAbortStartRequest:function(n){n._.startRequest&&(n._.startRequest.abort(h),delete n._.startRequest)},tryInitialize:function(n,t){n.Initialized&&t()},triggerReceived:function(t,i){t._.connectingMessageBuffer.tryBuffer(i)||n(t).triggerHandler(f.onReceived,[i])},processMessages:function(t,i,r){var f;u.markLastMessage(t);i&&(f=u.maximizePersistentResponse(i),u.updateGroups(t,f.GroupsToken),f.MessageId&&(t.messageId=f.MessageId),f.Messages&&(n.each(f.Messages,function(n,i){u.triggerReceived(t,i)}),u.tryInitialize(f,r)))},monitorKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring?t.log("Tried to monitor keep alive but it's already being monitored."):(i.monitoring=!0,u.markLastMessage(t),t._.keepAliveData.reconnectKeepAliveUpdate=function(){u.markLastMessage(t)},n(t).bind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t.log("Now monitoring keep alive with a warning timeout of "+i.timeoutWarning+", keep alive timeout of "+i.timeout+" and disconnecting timeout of "+t.disconnectTimeout))},stopMonitoringKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t._.keepAliveData={},t.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(n){n._.lastActiveAt=(new Date).getTime();o(n)},markLastMessage:function(n){n._.lastMessageAt=(new Date).getTime()},markActive:function(n){return u.verifyLastActive(n)?(n._.lastActiveAt=(new Date).getTime(),!0):!1},isConnectedOrReconnecting:function(n){return n.state===r.connectionState.connected||n.state===r.connectionState.reconnecting},ensureReconnectingState:function(t){return l(t,r.connectionState.connected,r.connectionState.reconnecting)===!0&&n(t).triggerHandler(f.onReconnecting),t.state===r.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},verifyLastActive:function(t){if((new Date).getTime()-t._.lastActiveAt>=t.reconnectWindow){var i=r._.format(r.resources.reconnectWindowTimeout,new Date(t._.lastActiveAt),t.reconnectWindow);return t.log(i),n(t).triggerHandler(f.onError,[r._.error(i,"TimeoutException")]),t.stop(!1,!1),!1}return!0},reconnect:function(n,i){var f=r.transports[i];if(u.isConnectedOrReconnecting(n)&&!n._.reconnectTimeout){if(!u.verifyLastActive(n))return;n._.reconnectTimeout=t.setTimeout(function(){u.verifyLastActive(n)&&(f.stop(n),u.ensureReconnectingState(n)&&(n.log(i+" reconnecting."),f.start(n)))},n.reconnectDelay)}},handleParseFailure:function(t,i,u,e,o){var s=r._.transportError(r._.format(r.resources.parseFailed,i),t.transport,u,o);e&&e(s)?t.log("Failed to parse server response while attempting to connect."):(n(t).triggerHandler(f.onError,[s]),t.stop())},initHandler:function(n){return new s(n)},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(t,f){var e=i.stringifySend(t,f);try{t.socket.send(e)}catch(o){n(t).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketsInvalidState,t.transport,o,t.socket),f])}},start:function(e,o,s){var h,c=!1,l=this,a=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,a),e.log("Connecting to websocket endpoint '"+h+"'."),e.socket=new t.WebSocket(h),e.socket.onopen=function(){c=!0;e.log("Websocket opened.");i.clearReconnectTimeout(e);f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){var i;this===e.socket&&(c&&typeof t.wasClean!="undefined"&&t.wasClean===!1?(i=r._.transportError(r.resources.webSocketClosed,e.transport,t),e.log("Unclean disconnect from websocket: "+(t.reason||"[no reason given]."))):e.log("Websocket closed."),s&&s(i)||(i&&n(e).triggerHandler(u.onError,[i]),l.reconnect(e)))},e.socket.onmessage=function(t){var r;try{r=e._parseResponse(t.data)}catch(u){i.handleParseFailure(e,t.data,u,s,t);return}r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):i.triggerReceived(e,r))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n);n.socket&&(n.log("Closing the Websocket."),n.socket.close(),n.socket=null)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var i=n.signalR,u=n.signalR.events,e=n.signalR.changeState,r=i.transports._logic,f=function(n){t.clearTimeout(n._.reconnectAttemptTimeoutHandle);delete n._.reconnectAttemptTimeoutHandle};i.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(o,s,h){var c=this,l=!1,a=n(o),v=!s,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}y=r.getUrl(o,this.name,v);try{o.log("Attempting to connect to SSE endpoint '"+y+"'.");o.eventSource=new t.EventSource(y,{withCredentials:o.withCredentials})}catch(p){o.log("EventSource failed trying to connect with error "+p.Message+".");h?h():(a.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceFailedToConnect,o.transport,p)]),v&&c.reconnect(o));return}v&&(o._.reconnectAttemptTimeoutHandle=t.setTimeout(function(){l===!1&&o.eventSource.readyState!==t.EventSource.OPEN&&c.reconnect(o)},c.timeOut));o.eventSource.addEventListener("open",function(){o.log("EventSource connected.");f(o);r.clearReconnectTimeout(o);l===!1&&(l=!0,e(o,i.connectionState.reconnecting,i.connectionState.connected)===!0&&a.triggerHandler(u.onReconnect))},!1);o.eventSource.addEventListener("message",function(n){var t;if(n.data!=="initialized"){try{t=o._parseResponse(n.data)}catch(i){r.handleParseFailure(o,n.data,i,h,n);return}r.processMessages(o,t,s)}},!1);o.eventSource.addEventListener("error",function(n){var r=i._.transportError(i.resources.eventSourceError,o.transport,n);this===o.eventSource&&(h&&h(r)||(o.log("EventSource readyState: "+o.eventSource.readyState+"."),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending."),c.reconnect(o)):(o.log("EventSource error."),a.triggerHandler(u.onError,[r]))))},!1)},reconnect:function(n){r.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){r.ajaxSend(n,t)},stop:function(n){f(n);r.clearReconnectTimeout(n);n&&n.eventSource&&(n.log("EventSource calling close()."),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){r.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var r=n.signalR,e=n.signalR.events,o=n.signalR.changeState,i=r.transports._logic,u=function(){var n=t.document.createElement("iframe");return n.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),n},f=function(){var i=null,f=1e3,n=0;return{prevent:function(){r._.ieVersion<=8&&(n===0&&(i=t.setInterval(function(){var n=u();t.document.body.appendChild(n);t.document.body.removeChild(n);n=null},f)),n++)},cancel:function(){n===1&&t.clearInterval(i);n>0&&n--}}}();r.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(n,r,e){var l=this,s=i.foreverFrame.count+=1,h,o=u(),c=function(){n.log("Forever frame iframe finished loading and is no longer receiving messages.");e&&e()||l.reconnect(n)};if(t.EventSource){e&&(n.log("Forever Frame is not supported by SignalR on browsers with SSE support."),e());return}o.setAttribute("data-signalr-connection-id",n.id);f.prevent();h=i.getUrl(n,this.name);h+="&frameId="+s;t.document.documentElement.appendChild(o);n.log("Binding to iframe's load event.");o.addEventListener?o.addEventListener("load",c,!1):o.attachEvent&&o.attachEvent("onload",c);o.src=h;i.foreverFrame.connections[s]=n;n.frame=o;n.frameId=s;r&&(n.onSuccess=function(){n.log("Iframe transport started.");r()})},reconnect:function(n){var r=this;i.isConnectedOrReconnecting(n)&&i.verifyLastActive(n)&&t.setTimeout(function(){if(i.verifyLastActive(n)&&n.frame&&i.ensureReconnectingState(n)){var u=n.frame,t=i.getUrl(n,r.name,!0)+"&frameId="+n.frameId;n.log("Updating iframe src to '"+t+"'.");u.src=t}},n.reconnectDelay)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},receive:function(t,u){var f,e,o;if(t.json!==t._originalJson&&(u=t._originalJson.stringify(u)),o=t._parseResponse(u),i.processMessages(t,o,t.onSuccess),t.state===n.signalR.connectionState.connected&&(t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>r.transports.foreverFrame.iframeClearThreshold&&(t.frameMessageCount=0,f=t.frame.contentWindow||t.frame.contentDocument,f&&f.document&&f.document.body)))for(e=f.document.body;e.firstChild;)e.removeChild(e.firstChild)},stop:function(n){var r=null;if(f.cancel(),n.frame){if(n.frame.stop)n.frame.stop();else try{r=n.frame.contentWindow||n.frame.contentDocument;r.document&&r.document.execCommand&&r.document.execCommand("Stop")}catch(u){n.log("Error occured when stopping foreverFrame transport. Message = "+u.message+".")}n.frame.parentNode===t.document.body&&t.document.body.removeChild(n.frame);delete i.foreverFrame.connections[n.frameId];n.frame=null;n.frameId=null;delete n.frame;delete n.frameId;delete n.onSuccess;delete n.frameMessageCount;n.log("Stopping forever frame.")}},abort:function(n,t){i.ajaxAbort(n,t)},getConnection:function(n){return i.foreverFrame.connections[n]},started:function(t){o(t,r.connectionState.reconnecting,r.connectionState.connected)===!0&&n(t).triggerHandler(e.onReconnect)}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,e=n.signalR.changeState,f=n.signalR.isDisconnecting,i=r.transports._logic;r.transports.longPolling={name:"longPolling",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(o,s,h){var a=this,v=function(){v=n.noop;o.log("LongPolling connected.");s()},y=function(n){return h(n)?(o.log("LongPolling failed to connect."),!0):!1},c=o._,l=0,p=function(i){t.clearTimeout(c.reconnectTimeoutId);c.reconnectTimeoutId=null;e(i,r.connectionState.reconnecting,r.connectionState.connected)===!0&&(i.log("Raising the reconnect event"),n(i).triggerHandler(u.onReconnect))},w=36e5;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop());o.messageId=null;c.reconnectTimeoutId=null;c.pollTimeoutId=t.setTimeout(function(){(function e(s,h){var g=s.messageId,nt=g===null,k=!nt,tt=!h,d=i.getUrl(s,a.name,k,tt,!0),b={};(s.messageId&&(b.messageId=s.messageId),s.groupsToken&&(b.groupsToken=s.groupsToken),f(s)!==!0)&&(o.log("Opening long polling request to '"+d+"'."),s.pollXhr=i.ajax(o,{xhrFields:{onprogress:function(){i.markLastMessage(o)}},url:d,type:"POST",contentType:r._.defaultContentType,data:b,timeout:o._.pollTimeout,success:function(r){var h,w=0,u,a;o.log("Long poll complete.");l=0;try{h=o._parseResponse(r)}catch(b){i.handleParseFailure(s,r,b,y,s.pollXhr);return}(c.reconnectTimeoutId!==null&&p(s),h&&(u=i.maximizePersistentResponse(h)),i.processMessages(s,h,v),u&&n.type(u.LongPollDelay)==="number"&&(w=u.LongPollDelay),f(s)!==!0)&&(a=u&&u.ShouldReconnect,!a||i.ensureReconnectingState(s))&&(w>0?c.pollTimeoutId=t.setTimeout(function(){e(s,a)},w):e(s,a))},error:function(f,h){var v=r._.transportError(r.resources.longPollFailed,o.transport,f,s.pollXhr);if(t.clearTimeout(c.reconnectTimeoutId),c.reconnectTimeoutId=null,h==="abort"){o.log("Aborted xhr request.");return}if(!y(v)){if(l++,o.state!==r.connectionState.reconnecting&&(o.log("An error occurred using longPolling. Status = "+h+".  Response = "+f.responseText+"."),n(s).triggerHandler(u.onError,[v])),(o.state===r.connectionState.connected||o.state===r.connectionState.reconnecting)&&!i.verifyLastActive(o))return;if(!i.ensureReconnectingState(s))return;c.pollTimeoutId=t.setTimeout(function(){e(s,!0)},a.reconnectDelay)}}}),k&&h===!0&&(c.reconnectTimeoutId=t.setTimeout(function(){p(s)},Math.min(1e3*(Math.pow(2,l)-1),w))))})(o)},250)},lostConnection:function(n){n.pollXhr&&n.pollXhr.abort("lostConnection")},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){t.clearTimeout(n._.pollTimeoutId);t.clearTimeout(n._.reconnectTimeoutId);delete n._.pollTimeoutId;delete n._.reconnectTimeoutId;n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n){function r(n){return n+s}function e(n,t,i){for(var f=n.length,u=[],r=0;r<f;r+=1)n.hasOwnProperty(r)&&(u[r]=t.call(i,n[r],r,n));return u}function o(t){return n.isFunction(t)?null:n.type(t)==="undefined"?null:t}function u(n){for(var t in n)if(n.hasOwnProperty(t))return!0;return!1}function f(n,t){var i=n._.invocationCallbacks,r,f;u(i)&&n.log("Clearing hub invocation callbacks with error: "+t+".");n._.invocationCallbackId=0;delete n._.invocationCallbacks;n._.invocationCallbacks={};for(f in i)r=i[f],r.method.call(r.scope,{E:t})}function i(n,t){return new i.fn.init(n,t)}function t(i,r){var u={qs:null,logging:!1,useDefaultPath:!0};return n.extend(u,r),(!i||u.useDefaultPath)&&(i=(i||"")+"/signalr"),new t.fn.init(i,u)}var s=".hubProxy",h=n.signalR;i.fn=i.prototype={init:function(n,t){this.state={};this.connection=n;this.hubName=t;this._={callbackMap:{}}},constructor:i,hasSubscriptions:function(){return u(this._.callbackMap)},on:function(t,i){var u=this,f=u._.callbackMap;return t=t.toLowerCase(),f[t]||(f[t]={}),f[t][i]=function(n,t){i.apply(u,t)},n(u).bind(r(t),f[t][i]),u},off:function(t,i){var e=this,o=e._.callbackMap,f;return t=t.toLowerCase(),f=o[t],f&&(f[i]?(n(e).unbind(r(t),f[i]),delete f[i],u(f)||delete o[t]):i||(n(e).unbind(r(t)),delete o[t])),e},invoke:function(t){var i=this,r=i.connection,s=n.makeArray(arguments).slice(1),c=e(s,o),f={H:i.hubName,M:t,A:c,I:r._.invocationCallbackId},u=n.Deferred(),l=function(f){var e=i._maximizeHubResponse(f),s,o;n.extend(i.state,e.State);e.Progress?u.notifyWith?u.notifyWith(i,[e.Progress.Data]):r._.progressjQueryVersionLogged||(r.log("A hub method invocation progress update was received but the version of jQuery in use ("+n.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."),r._.progressjQueryVersionLogged=!0):e.Error?(e.StackTrace&&r.log(e.Error+"\n"+e.StackTrace+"."),s=e.IsHubException?"HubException":"Exception",o=h._.error(e.Error,s),o.data=e.ErrorData,r.log(i.hubName+"."+t+" failed to execute. Error: "+o.message),u.rejectWith(i,[o])):(r.log("Invoked "+i.hubName+"."+t),u.resolveWith(i,[e.Result]))};return r._.invocationCallbacks[r._.invocationCallbackId.toString()]={scope:i,method:l},r._.invocationCallbackId+=1,n.isEmptyObject(i.state)||(f.S=i.state),r.log("Invoking "+i.hubName+"."+t),r.send(f),u.promise()},_maximizeHubResponse:function(n){return{State:n.S,Result:n.R,Progress:n.P?{Id:n.P.I,Data:n.P.D}:null,Id:n.I,IsHubException:n.H,Error:n.E,StackTrace:n.T,ErrorData:n.D}}};i.fn.init.prototype=i.fn;t.fn=t.prototype=n.connection();t.fn.init=function(t,i){var e={qs:null,logging:!1,useDefaultPath:!0},u=this;n.extend(e,i);n.signalR.fn.init.call(u,t,e.qs,e.logging);u.proxies={};u._.invocationCallbackId=0;u._.invocationCallbacks={};u.received(function(t){var f,o,e,i,s,h;t&&(typeof t.P!="undefined"?(e=t.P.I.toString(),i=u._.invocationCallbacks[e],i&&i.method.call(i.scope,t)):typeof t.I!="undefined"?(e=t.I.toString(),i=u._.invocationCallbacks[e],i&&(u._.invocationCallbacks[e]=null,delete u._.invocationCallbacks[e],i.method.call(i.scope,t))):(f=this._maximizeClientHubInvocation(t),u.log("Triggering client hub event '"+f.Method+"' on hub '"+f.Hub+"'."),s=f.Hub.toLowerCase(),h=f.Method.toLowerCase(),o=this.proxies[s],n.extend(o.state,f.State),n(o).triggerHandler(r(h),[f.Args])))});u.error(function(n,t){var i,r;t&&(i=t.I,r=u._.invocationCallbacks[i],r&&(u._.invocationCallbacks[i]=null,delete u._.invocationCallbacks[i],r.method.call(r.scope,{E:n})))});u.reconnecting(function(){u.transport&&u.transport.name==="webSockets"&&f(u,"Connection started reconnecting before invocation result was received.")});u.disconnected(function(){f(u,"Connection was disconnected before invocation result was received.")})};t.fn._maximizeClientHubInvocation=function(n){return{Hub:n.H,Method:n.M,Args:n.A,State:n.S}};t.fn._registerSubscribedHubs=function(){var t=this;t._subscribedToHubs||(t._subscribedToHubs=!0,t.starting(function(){var i=[];n.each(t.proxies,function(n){this.hasSubscriptions()&&(i.push({name:n}),t.log("Client subscribed to hub '"+n+"'."))});i.length===0&&t.log("No hubs have been subscribed to.  The client will not receive data from hubs.  To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to.");t.data=t.json.stringify(i)}))};t.fn.createHubProxy=function(n){n=n.toLowerCase();var t=this.proxies[n];return t||(t=i(this,n),this.proxies[n]=t),this._registerSubscribedHubs(),t};t.fn.init.prototype=t.fn;n.hubConnection=t}(window.jQuery,window),function(n){n.signalR.version="2.2.0"}(window.jQuery),function(n,t,i){function v(t,i){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(f)==="string"&&r.transports[f]||(i.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(i.log("No transports remain within the specified transport array."),t=null)}else if(r.transports[t]||t==="auto"){if(t==="auto"&&r._.ieVersion<=8)return["longPolling"]}else i.log("Invalid transport: "+t.toString()+"."),t=null;return t}function y(n){return n==="http:"?80:n==="https:"?443:void 0}function h(n,t){return t.match(/:\d+$/)?t:t+":"+y(n)}function p(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1};u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())};u.clear=function(){r=[]}}var f={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorDuringStartRequest:"Error during start request. Stopping the connection.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server.  Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection."};if(typeof n!="function")throw new Error(f.nojQuery);var r,c,o=t.document.readyState==="complete",e=n(t),l="__Negotiate Aborted__",u={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},w=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},s=function(t,i,r){return i===t.state?(t.state=r,n(t).triggerHandler(u.onStateChanged,[{oldState:i,newState:r}]),!0):!1},b=function(n){return n.state===r.connectionState.disconnected},a=function(n){return n._.keepAliveData.activated&&n.transport.supportsKeepAlive(n)},k=function(i){var f,e;i._.configuredStopReconnectingTimeout||(e=function(t){var i=r._.format(r.resources.reconnectTimeout,t.disconnectTimeout);t.log(i);n(t).triggerHandler(u.onError,[r._.error(i,"TimeoutException")]);t.stop(!1,!1)},i.reconnecting(function(){var n=this;n.state===r.connectionState.reconnecting&&(f=t.setTimeout(function(){e(n)},n.disconnectTimeout))}),i.stateChanged(function(n){n.oldState===r.connectionState.reconnecting&&t.clearTimeout(f)}),i._.configuredStopReconnectingTimeout=!0)};if(r=function(n,t,i){return new r.fn.init(n,t,i)},r._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var i,n;return t.navigator.appName==="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}(),error:function(n,t,i){var r=new Error(n);return r.source=t,typeof i!="undefined"&&(r.context=i),r},transportError:function(n,t,r,u){var f=this.error(n,r,u);return f.transport=t?t.name:i,f},format:function(){for(var t=arguments[0],n=0;n<arguments.length-1;n++)t=t.replace("{"+n+"}",arguments[n+1]);return t},firefoxMajorVersion:function(n){var t=n.match(/Firefox\/(\d+)/);return!t||!t.length||t.length<2?0:parseInt(t[1],10)},configurePingInterval:function(i){var f=i._.config,e=function(t){n(i).triggerHandler(u.onError,[t])};f&&!i._.pingIntervalId&&f.pingInterval&&(i._.pingIntervalId=t.setInterval(function(){r.transports._logic.pingServer(i).fail(e)},f.pingInterval))}},r.events=u,r.resources=f,r.ajaxDefaults={processData:!0,timeout:null,async:!0,global:!1,cache:!1},r.changeState=s,r.isDisconnecting=b,r.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},r.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.");}},typeof e.on=="function")e.on("load",function(){o=!0});else e.load(function(){o=!0});r.fn=r.prototype={init:function(t,i,r){var f=n(this);this.url=t;this.qs=i;this.lastError=null;this._={keepAliveData:{},connectingMessageBuffer:new p(this,function(n){f.triggerHandler(u.onReceived,[n])}),lastMessageAt:(new Date).getTime(),lastActiveAt:(new Date).getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0};typeof r=="boolean"&&(this.logging=r)},_parseResponse:function(n){var t=this;return n?typeof n=="string"?t.json.parse(n):n:n},_originalJson:t.JSON,json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),r=r||t.location,i.indexOf("http")!==0)?!1:(u=t.document.createElement("a"),u.href=i,u.protocol+h(u.protocol,u.host)!==r.protocol+h(r.protocol,r.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:r.connectionState.disconnected,clientProtocol:"1.5",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(i,h){var c=this,y={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},d,p=c._deferral||n.Deferred(),w=t.document.createElement("a"),b,g;if(c.lastError=null,c._deferral=p,!c.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(n.type(i)==="function"?h=i:n.type(i)==="object"&&(n.extend(y,i),n.type(y.callback)==="function"&&(h=y.callback)),y.transport=v(y.transport,c),!y.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");return(c._.config=y,!o&&y.waitForPageLoad===!0)?(c._.deferredStartHandler=function(){c.start(i,h)},e.bind("load",c._.deferredStartHandler),p.promise()):c.state===r.connectionState.connecting?p.promise():s(c,r.connectionState.disconnected,r.connectionState.connecting)===!1?(p.resolve(c),p.promise()):(k(c),w.href=c.url,w.protocol&&w.protocol!==":"?(c.protocol=w.protocol,c.host=w.host):(c.protocol=t.document.location.protocol,c.host=w.host||t.document.location.host),c.baseUrl=c.protocol+"//"+c.host,c.wsProtocol=c.protocol==="https:"?"wss://":"ws://",y.transport==="auto"&&y.jsonp===!0&&(y.transport="longPolling"),c.url.indexOf("//")===0&&(c.url=t.location.protocol+c.url,c.log("Protocol relative URL detected, normalizing it to '"+c.url+"'.")),this.isCrossDomain(c.url)&&(c.log("Auto detected cross domain url."),y.transport==="auto"&&(y.transport=["webSockets","serverSentEvents","longPolling"]),typeof y.withCredentials=="undefined"&&(y.withCredentials=!0),y.jsonp||(y.jsonp=!n.support.cors,y.jsonp&&c.log("Using jsonp because this browser doesn't support CORS.")),c.contentType=r._.defaultContentType),c.withCredentials=y.withCredentials,c.ajaxDataType=y.jsonp?"jsonp":"text",n(c).bind(u.onStart,function(){n.type(h)==="function"&&h.call(c);p.resolve(c)}),c._.initHandler=r.transports._logic.initHandler(c),d=function(i,o){var l=r._.error(f.noTransportOnInit);if(o=o||0,o>=i.length){o===0?c.log("No transports supported by the server were selected."):o===1?c.log("No fallback transports were selected."):c.log("Fallback transports exhausted.");n(c).triggerHandler(u.onError,[l]);p.reject(l);c.stop();return}if(c.state!==r.connectionState.disconnected){var y=i[o],h=r.transports[y],v=function(){d(i,o+1)};c.transport=h;try{c._.initHandler.start(h,function(){var i=r._.firefoxMajorVersion(t.navigator.userAgent)>=11,f=!!c.withCredentials&&i;c.log("The start request succeeded. Transitioning to the connected state.");a(c)&&r.transports._logic.monitorKeepAlive(c);r.transports._logic.startHeartbeat(c);r._.configurePingInterval(c);s(c,r.connectionState.connecting,r.connectionState.connected)||c.log("WARNING! The connection was not in the connecting state.");c._.connectingMessageBuffer.drain();n(c).triggerHandler(u.onStart);e.bind("unload",function(){c.log("Window unloading, stopping the connection.");c.stop(f)});i&&e.bind("beforeunload",function(){t.setTimeout(function(){c.stop(f)},0)})},v)}catch(w){c.log(h.name+" transport threw '"+w.message+"' when attempting to start.");v()}}},b=c.url+"/negotiate",g=function(t,i){var e=r._.error(f.errorOnNegotiate,t,i._.negotiateRequest);n(i).triggerHandler(u.onError,e);p.reject(e);i.stop()},n(c).triggerHandler(u.onStarting),b=r.transports._logic.prepareQueryString(c,b),c.log("Negotiating with '"+b+"'."),c._.negotiateRequest=r.transports._logic.ajax(c,{url:b,error:function(n,t){t!==l?g(n,c):p.reject(r._.error(f.stoppedWhileNegotiating,null,c._.negotiateRequest))},success:function(t){var i,e,h,o=[],s=[];try{i=c._parseResponse(t)}catch(l){g(r._.error(f.errorParsingNegotiateResponse,l),c);return}if(e=c._.keepAliveData,c.appRelativeUrl=i.Url,c.id=i.ConnectionId,c.token=i.ConnectionToken,c.webSocketServerUrl=i.WebSocketServerUrl,c._.pollTimeout=i.ConnectionTimeout*1e3+1e4,c.disconnectTimeout=i.DisconnectTimeout*1e3,c._.totalTransportConnectTimeout=c.transportConnectTimeout+i.TransportConnectTimeout*1e3,i.KeepAliveTimeout?(e.activated=!0,e.timeout=i.KeepAliveTimeout*1e3,e.timeoutWarning=e.timeout*c.keepAliveWarnAt,c._.beatInterval=(e.timeout-e.timeoutWarning)/3):e.activated=!1,c.reconnectWindow=c.disconnectTimeout+(e.timeout||0),!i.ProtocolVersion||i.ProtocolVersion!==c.clientProtocol){h=r._.error(r._.format(f.protocolIncompatible,c.clientProtocol,i.ProtocolVersion));n(c).triggerHandler(u.onError,[h]);p.reject(h);return}n.each(r.transports,function(n){if(n.indexOf("_")===0||n==="webSockets"&&!i.TryWebSockets)return!0;s.push(n)});n.isArray(y.transport)?n.each(y.transport,function(t,i){n.inArray(i,s)>=0&&o.push(i)}):y.transport==="auto"?o=s:n.inArray(y.transport,s)>=0&&o.push(y.transport);d(o)}}),p.promise())},starting:function(t){var i=this;return n(i).bind(u.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===r.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(t.state===r.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(u.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(u.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(u.onError,function(n,r,u){i.lastError=r;t.call(i,r,u)}),i},disconnected:function(t){var i=this;return n(i).bind(u.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(u.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(u.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(u.onReconnect,function(){t.call(i)}),i},stop:function(i,h){var c=this,v=c._deferral;if(c._.deferredStartHandler&&e.unbind("load",c._.deferredStartHandler),delete c._.config,delete c._.deferredStartHandler,!o&&(!c._.config||c._.config.waitForPageLoad===!0)){c.log("Stopping connection prior to negotiate.");v&&v.reject(r._.error(f.stoppedWhileLoading));return}if(c.state!==r.connectionState.disconnected)return c.log("Stopping connection."),t.clearTimeout(c._.beatHandle),t.clearInterval(c._.pingIntervalId),c.transport&&(c.transport.stop(c),h!==!1&&c.transport.abort(c,i),a(c)&&r.transports._logic.stopMonitoringKeepAlive(c),c.transport=null),c._.negotiateRequest&&(c._.negotiateRequest.abort(l),delete c._.negotiateRequest),c._.initHandler&&c._.initHandler.stop(),delete c._deferral,delete c.messageId,delete c.groupsToken,delete c.id,delete c._.pingIntervalId,delete c._.lastMessageAt,delete c._.lastActiveAt,c._.connectingMessageBuffer.clear(),n(c).unbind(u.onStart),s(c,c.state,r.connectionState.disconnected),n(c).triggerHandler(u.onDisconnect),c},log:function(n){w(n,this.logging)}};r.fn.init.prototype=r.fn;r.noConflict=function(){return n.connection===r&&(n.connection=c),r};n.connection&&(c=n.connection);n.connection=n.signalR=r}(window.jQuery,window),function(n,t,i){function o(n){n._.keepAliveData.monitoring&&c(n);u.markActive(n)&&(n._.beatHandle=t.setTimeout(function(){o(n)},n._.beatInterval))}function c(t){var i=t._.keepAliveData,u;t.state===r.connectionState.connected&&(u=(new Date).getTime()-t._.lastMessageAt,u>=i.timeout?(t.log("Keep alive timed out.  Notifying transport that connection has been lost."),t.transport.lostConnection(t)):u>=i.timeoutWarning?i.userNotified||(t.log("Keep alive has been missed, connection may be dead/slow."),n(t).triggerHandler(f.onConnectionSlow),i.userNotified=!0):i.userNotified=!1)}function e(n,t){var i=n.url+t;return n.transport&&(i+="?transport="+n.transport.name),u.prepareQueryString(n,i)}function s(n){this.connection=n;this.startRequested=!1;this.startCompleted=!1;this.connectionStopped=!1}var r=n.signalR,f=n.signalR.events,l=n.signalR.changeState,h="__Start Aborted__",u;r.transports={};s.prototype={start:function(n,r,u){var f=this,e=f.connection,o=!1;if(f.startRequested||f.connectionStopped){e.log("WARNING! "+n.name+" transport cannot be started. Initialization ongoing or completed.");return}e.log(n.name+" transport starting.");n.start(e,function(){o||f.initReceived(n,r)},function(t){return o||(o=!0,f.transportFailed(n,t,u)),!f.startCompleted||f.connectionStopped});f.transportTimeoutHandle=t.setTimeout(function(){o||(o=!0,e.log(n.name+" transport timed out when trying to connect."),f.transportFailed(n,i,u))},e._.totalTransportConnectTimeout)},stop:function(){this.connectionStopped=!0;t.clearTimeout(this.transportTimeoutHandle);r.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(n,i){var u=this,f=u.connection;if(u.startRequested){f.log("WARNING! The client received multiple init messages.");return}u.connectionStopped||(u.startRequested=!0,t.clearTimeout(u.transportTimeoutHandle),f.log(n.name+" transport connected. Initiating start request."),r.transports._logic.ajaxStart(f,function(){u.startCompleted=!0;i()}))},transportFailed:function(i,u,e){var o=this.connection,h=o._deferral,s;this.connectionStopped||(t.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||(s=r._.error(r.resources.errorDuringStartRequest,u),o.log(i.name+" transport failed during the start request. Stopping the connection."),n(o).triggerHandler(f.onError,[s]),h&&h.reject(s),o.stop()):(i.stop(o),o.log(i.name+" transport failed to connect. Attempting to fall back."),e()))}};u=r.transports._logic={ajax:function(t,i){return n.ajax(n.extend(!0,{},n.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:t.withCredentials},contentType:t.contentType,dataType:t.ajaxDataType},i))},pingServer:function(t){var e,f,i=n.Deferred();return t.transport?(e=t.url+"/ping",e=u.addQs(e,t.qs),f=u.ajax(t,{url:e,success:function(n){var u;try{u=t._parseResponse(n)}catch(e){i.reject(r._.transportError(r.resources.pingServerFailedParse,t.transport,e,f));t.stop();return}u.Response==="pong"?i.resolve():i.reject(r._.transportError(r._.format(r.resources.pingServerFailedInvalidResponse,n),t.transport,null,f))},error:function(n){n.status===401||n.status===403?(i.reject(r._.transportError(r._.format(r.resources.pingServerFailedStatusCode,n.status),t.transport,n,f)),t.stop()):i.reject(r._.transportError(r.resources.pingServerFailed,t.transport,n,f))}})):i.reject(r._.transportError(r.resources.noConnectionTransport,t.transport)),i.promise()},prepareQueryString:function(n,i){var r;return r=u.addQs(i,"clientProtocol="+n.clientProtocol),r=u.addQs(r,n.qs),n.token&&(r+="&connectionToken="+t.encodeURIComponent(n.token)),n.data&&(r+="&connectionData="+t.encodeURIComponent(n.data)),r},addQs:function(t,i){var r=t.indexOf("?")!==-1?"&":"?",u;if(!i)return t;if(typeof i=="object")return t+r+n.param(i);if(typeof i=="string")return u=i.charAt(0),(u==="?"||u==="&")&&(r=""),t+r+i;throw new Error("Query string property must be either a string or object.");},getUrl:function(n,i,r,f,e){var h=i==="webSockets"?"":n.baseUrl,o=h+n.appRelativeUrl,s="transport="+i;return!e&&n.groupsToken&&(s+="&groupsToken="+t.encodeURIComponent(n.groupsToken)),r?(o+=f?"/poll":"/reconnect",!e&&n.messageId&&(s+="&messageId="+t.encodeURIComponent(n.messageId))):o+="/connect",o+="?"+s,o=u.prepareQueryString(n,o),e||(o+="&tid="+Math.floor(Math.random()*11)),o},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!="undefined"?!0:!1,ShouldReconnect:typeof n.T!="undefined"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},stringifySend:function(n,t){return typeof t=="string"||typeof t=="undefined"||t===null?t:n.json.stringify(t)},ajaxSend:function(t,i){var h=u.stringifySend(t,i),c=e(t,"/send"),o,s=function(t,u){n(u).triggerHandler(f.onError,[r._.transportError(r.resources.sendFailed,u.transport,t,o),i])};return o=u.ajax(t,{url:c,type:t.ajaxDataType==="jsonp"?"GET":"POST",contentType:r._.defaultContentType,data:{data:h},success:function(n){var i;if(n){try{i=t._parseResponse(n)}catch(r){s(r,t);t.stop();return}u.triggerReceived(t,i)}},error:function(n,i){i!=="abort"&&i!=="parsererror"&&s(n,t)}})},ajaxAbort:function(n,t){if(typeof n.transport!="undefined"){t=typeof t=="undefined"?!0:t;var i=e(n,"/abort");u.ajax(n,{url:i,async:t,timeout:1e3,type:"POST"});n.log("Fired ajax abort async = "+t+".")}},ajaxStart:function(t,i){var s=function(n){var i=t._deferral;i&&i.reject(n)},o=function(i){t.log("The start request failed. Stopping the connection.");n(t).triggerHandler(f.onError,[i]);s(i);t.stop()};t._.startRequest=u.ajax(t,{url:e(t,"/start"),success:function(n,u,f){var e;try{e=t._parseResponse(n)}catch(s){o(r._.error(r._.format(r.resources.errorParsingStartResponse,n),s,f));return}e.Response==="started"?i():o(r._.error(r._.format(r.resources.invalidStartResponse,n),null,f))},error:function(n,i,u){i!==h?o(r._.error(r.resources.errorDuringStartRequest,u,n)):(t.log("The start request aborted because connection.stop() was called."),s(r._.error(r.resources.stoppedDuringStartRequest,null,n)))}})},tryAbortStartRequest:function(n){n._.startRequest&&(n._.startRequest.abort(h),delete n._.startRequest)},tryInitialize:function(n,t,i){t.Initialized&&i?i():t.Initialized&&n.log("WARNING! The client received an init message after reconnecting.")},triggerReceived:function(t,i){t._.connectingMessageBuffer.tryBuffer(i)||n(t).triggerHandler(f.onReceived,[i])},processMessages:function(t,i,r){var f;u.markLastMessage(t);i&&(f=u.maximizePersistentResponse(i),u.updateGroups(t,f.GroupsToken),f.MessageId&&(t.messageId=f.MessageId),f.Messages&&(n.each(f.Messages,function(n,i){u.triggerReceived(t,i)}),u.tryInitialize(t,f,r)))},monitorKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring?t.log("Tried to monitor keep alive but it's already being monitored."):(i.monitoring=!0,u.markLastMessage(t),t._.keepAliveData.reconnectKeepAliveUpdate=function(){u.markLastMessage(t)},n(t).bind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t.log("Now monitoring keep alive with a warning timeout of "+i.timeoutWarning+", keep alive timeout of "+i.timeout+" and disconnecting timeout of "+t.disconnectTimeout))},stopMonitoringKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t._.keepAliveData={},t.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(n){n._.lastActiveAt=(new Date).getTime();o(n)},markLastMessage:function(n){n._.lastMessageAt=(new Date).getTime()},markActive:function(n){return u.verifyLastActive(n)?(n._.lastActiveAt=(new Date).getTime(),!0):!1},isConnectedOrReconnecting:function(n){return n.state===r.connectionState.connected||n.state===r.connectionState.reconnecting},ensureReconnectingState:function(t){return l(t,r.connectionState.connected,r.connectionState.reconnecting)===!0&&n(t).triggerHandler(f.onReconnecting),t.state===r.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},verifyLastActive:function(t){if((new Date).getTime()-t._.lastActiveAt>=t.reconnectWindow){var i=r._.format(r.resources.reconnectWindowTimeout,new Date(t._.lastActiveAt),t.reconnectWindow);return t.log(i),n(t).triggerHandler(f.onError,[r._.error(i,"TimeoutException")]),t.stop(!1,!1),!1}return!0},reconnect:function(n,i){var f=r.transports[i];if(u.isConnectedOrReconnecting(n)&&!n._.reconnectTimeout){if(!u.verifyLastActive(n))return;n._.reconnectTimeout=t.setTimeout(function(){u.verifyLastActive(n)&&(f.stop(n),u.ensureReconnectingState(n)&&(n.log(i+" reconnecting."),f.start(n)))},n.reconnectDelay)}},handleParseFailure:function(t,i,u,e,o){var s=r._.transportError(r._.format(r.resources.parseFailed,i),t.transport,u,o);e&&e(s)?t.log("Failed to parse server response while attempting to connect."):(n(t).triggerHandler(f.onError,[s]),t.stop())},initHandler:function(n){return new s(n)},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(t,f){var e=i.stringifySend(t,f);try{t.socket.send(e)}catch(o){n(t).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketsInvalidState,t.transport,o,t.socket),f])}},start:function(e,o,s){var h,c=!1,l=this,a=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,a),e.log("Connecting to websocket endpoint '"+h+"'."),e.socket=new t.WebSocket(h),e.socket.onopen=function(){c=!0;e.log("Websocket opened.");i.clearReconnectTimeout(e);f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){var i;this===e.socket&&(c&&typeof t.wasClean!="undefined"&&t.wasClean===!1?(i=r._.transportError(r.resources.webSocketClosed,e.transport,t),e.log("Unclean disconnect from websocket: "+(t.reason||"[no reason given]."))):e.log("Websocket closed."),s&&s(i)||(i&&n(e).triggerHandler(u.onError,[i]),l.reconnect(e)))},e.socket.onmessage=function(t){var r;try{r=e._parseResponse(t.data)}catch(u){i.handleParseFailure(e,t.data,u,s,t);return}r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):i.triggerReceived(e,r))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n);n.socket&&(n.log("Closing the Websocket."),n.socket.close(),n.socket=null)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var i=n.signalR,u=n.signalR.events,e=n.signalR.changeState,r=i.transports._logic,f=function(n){t.clearTimeout(n._.reconnectAttemptTimeoutHandle);delete n._.reconnectAttemptTimeoutHandle};i.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(o,s,h){var c=this,l=!1,a=n(o),v=!s,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}y=r.getUrl(o,this.name,v);try{o.log("Attempting to connect to SSE endpoint '"+y+"'.");o.eventSource=new t.EventSource(y,{withCredentials:o.withCredentials})}catch(p){o.log("EventSource failed trying to connect with error "+p.Message+".");h?h():(a.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceFailedToConnect,o.transport,p)]),v&&c.reconnect(o));return}v&&(o._.reconnectAttemptTimeoutHandle=t.setTimeout(function(){l===!1&&o.eventSource.readyState!==t.EventSource.OPEN&&c.reconnect(o)},c.timeOut));o.eventSource.addEventListener("open",function(){o.log("EventSource connected.");f(o);r.clearReconnectTimeout(o);l===!1&&(l=!0,e(o,i.connectionState.reconnecting,i.connectionState.connected)===!0&&a.triggerHandler(u.onReconnect))},!1);o.eventSource.addEventListener("message",function(n){var t;if(n.data!=="initialized"){try{t=o._parseResponse(n.data)}catch(i){r.handleParseFailure(o,n.data,i,h,n);return}r.processMessages(o,t,s)}},!1);o.eventSource.addEventListener("error",function(n){var r=i._.transportError(i.resources.eventSourceError,o.transport,n);this===o.eventSource&&(h&&h(r)||(o.log("EventSource readyState: "+o.eventSource.readyState+"."),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending."),c.reconnect(o)):(o.log("EventSource error."),a.triggerHandler(u.onError,[r]))))},!1)},reconnect:function(n){r.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){r.ajaxSend(n,t)},stop:function(n){f(n);r.clearReconnectTimeout(n);n&&n.eventSource&&(n.log("EventSource calling close()."),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){r.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var r=n.signalR,e=n.signalR.events,o=n.signalR.changeState,i=r.transports._logic,u=function(){var n=t.document.createElement("iframe");return n.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),n},f=function(){var i=null,f=1e3,n=0;return{prevent:function(){r._.ieVersion<=8&&(n===0&&(i=t.setInterval(function(){var n=u();t.document.body.appendChild(n);t.document.body.removeChild(n);n=null},f)),n++)},cancel:function(){n===1&&t.clearInterval(i);n>0&&n--}}}();r.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(n,r,e){var l=this,s=i.foreverFrame.count+=1,h,o=u(),c=function(){n.log("Forever frame iframe finished loading and is no longer receiving messages.");e&&e()||l.reconnect(n)};if(t.EventSource){e&&(n.log("Forever Frame is not supported by SignalR on browsers with SSE support."),e());return}o.setAttribute("data-signalr-connection-id",n.id);f.prevent();h=i.getUrl(n,this.name);h+="&frameId="+s;t.document.documentElement.appendChild(o);n.log("Binding to iframe's load event.");o.addEventListener?o.addEventListener("load",c,!1):o.attachEvent&&o.attachEvent("onload",c);o.src=h;i.foreverFrame.connections[s]=n;n.frame=o;n.frameId=s;r&&(n.onSuccess=function(){n.log("Iframe transport started.");r()})},reconnect:function(n){var r=this;i.isConnectedOrReconnecting(n)&&i.verifyLastActive(n)&&t.setTimeout(function(){if(i.verifyLastActive(n)&&n.frame&&i.ensureReconnectingState(n)){var u=n.frame,t=i.getUrl(n,r.name,!0)+"&frameId="+n.frameId;n.log("Updating iframe src to '"+t+"'.");u.src=t}},n.reconnectDelay)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},receive:function(t,u){var f,e,o;if(t.json!==t._originalJson&&(u=t._originalJson.stringify(u)),o=t._parseResponse(u),i.processMessages(t,o,t.onSuccess),t.state===n.signalR.connectionState.connected&&(t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>r.transports.foreverFrame.iframeClearThreshold&&(t.frameMessageCount=0,f=t.frame.contentWindow||t.frame.contentDocument,f&&f.document&&f.document.body)))for(e=f.document.body;e.firstChild;)e.removeChild(e.firstChild)},stop:function(n){var r=null;if(f.cancel(),n.frame){if(n.frame.stop)n.frame.stop();else try{r=n.frame.contentWindow||n.frame.contentDocument;r.document&&r.document.execCommand&&r.document.execCommand("Stop")}catch(u){n.log("Error occurred when stopping foreverFrame transport. Message = "+u.message+".")}n.frame.parentNode===t.document.documentElement&&t.document.documentElement.removeChild(n.frame);delete i.foreverFrame.connections[n.frameId];n.frame=null;n.frameId=null;delete n.frame;delete n.frameId;delete n.onSuccess;delete n.frameMessageCount;n.log("Stopping forever frame.")}},abort:function(n,t){i.ajaxAbort(n,t)},getConnection:function(n){return i.foreverFrame.connections[n]},started:function(t){o(t,r.connectionState.reconnecting,r.connectionState.connected)===!0&&n(t).triggerHandler(e.onReconnect)}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,e=n.signalR.changeState,f=n.signalR.isDisconnecting,i=r.transports._logic;r.transports.longPolling={name:"longPolling",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(o,s,h){var a=this,v=function(){v=n.noop;o.log("LongPolling connected.");s?s():o.log("WARNING! The client received an init message after reconnecting.")},y=function(n){return h(n)?(o.log("LongPolling failed to connect."),!0):!1},c=o._,l=0,p=function(i){t.clearTimeout(c.reconnectTimeoutId);c.reconnectTimeoutId=null;e(i,r.connectionState.reconnecting,r.connectionState.connected)===!0&&(i.log("Raising the reconnect event"),n(i).triggerHandler(u.onReconnect))},w=36e5;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop());o.messageId=null;c.reconnectTimeoutId=null;c.pollTimeoutId=t.setTimeout(function(){(function e(s,h){var g=s.messageId,nt=g===null,k=!nt,tt=!h,d=i.getUrl(s,a.name,k,tt,!0),b={};(s.messageId&&(b.messageId=s.messageId),s.groupsToken&&(b.groupsToken=s.groupsToken),f(s)!==!0)&&(o.log("Opening long polling request to '"+d+"'."),s.pollXhr=i.ajax(o,{xhrFields:{onprogress:function(){i.markLastMessage(o)}},url:d,type:"POST",contentType:r._.defaultContentType,data:b,timeout:o._.pollTimeout,success:function(r){var h,w=0,u,a;o.log("Long poll complete.");l=0;try{h=o._parseResponse(r)}catch(b){i.handleParseFailure(s,r,b,y,s.pollXhr);return}(c.reconnectTimeoutId!==null&&p(s),h&&(u=i.maximizePersistentResponse(h)),i.processMessages(s,h,v),u&&n.type(u.LongPollDelay)==="number"&&(w=u.LongPollDelay),f(s)!==!0)&&(a=u&&u.ShouldReconnect,!a||i.ensureReconnectingState(s))&&(w>0?c.pollTimeoutId=t.setTimeout(function(){e(s,a)},w):e(s,a))},error:function(f,h){var v=r._.transportError(r.resources.longPollFailed,o.transport,f,s.pollXhr);if(t.clearTimeout(c.reconnectTimeoutId),c.reconnectTimeoutId=null,h==="abort"){o.log("Aborted xhr request.");return}if(!y(v)){if(l++,o.state!==r.connectionState.reconnecting&&(o.log("An error occurred using longPolling. Status = "+h+".  Response = "+f.responseText+"."),n(s).triggerHandler(u.onError,[v])),(o.state===r.connectionState.connected||o.state===r.connectionState.reconnecting)&&!i.verifyLastActive(o))return;if(!i.ensureReconnectingState(s))return;c.pollTimeoutId=t.setTimeout(function(){e(s,!0)},a.reconnectDelay)}}}),k&&h===!0&&(c.reconnectTimeoutId=t.setTimeout(function(){p(s)},Math.min(1e3*(Math.pow(2,l)-1),w))))})(o)},250)},lostConnection:function(n){n.pollXhr&&n.pollXhr.abort("lostConnection")},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){t.clearTimeout(n._.pollTimeoutId);t.clearTimeout(n._.reconnectTimeoutId);delete n._.pollTimeoutId;delete n._.reconnectTimeoutId;n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n){function r(n){return n+s}function e(n,t,i){for(var f=n.length,u=[],r=0;r<f;r+=1)n.hasOwnProperty(r)&&(u[r]=t.call(i,n[r],r,n));return u}function o(t){return n.isFunction(t)?null:n.type(t)==="undefined"?null:t}function u(n){for(var t in n)if(n.hasOwnProperty(t))return!0;return!1}function f(n,t){var i=n._.invocationCallbacks,r,f;u(i)&&n.log("Clearing hub invocation callbacks with error: "+t+".");n._.invocationCallbackId=0;delete n._.invocationCallbacks;n._.invocationCallbacks={};for(f in i)r=i[f],r.method.call(r.scope,{E:t})}function i(n,t){return new i.fn.init(n,t)}function t(i,r){var u={qs:null,logging:!1,useDefaultPath:!0};return n.extend(u,r),(!i||u.useDefaultPath)&&(i=(i||"")+"/signalr"),new t.fn.init(i,u)}var s=".hubProxy",h=n.signalR;i.fn=i.prototype={init:function(n,t){this.state={};this.connection=n;this.hubName=t;this._={callbackMap:{}}},constructor:i,hasSubscriptions:function(){return u(this._.callbackMap)},on:function(t,i){var u=this,f=u._.callbackMap;return t=t.toLowerCase(),f[t]||(f[t]={}),f[t][i]=function(n,t){i.apply(u,t)},n(u).bind(r(t),f[t][i]),u},off:function(t,i){var e=this,o=e._.callbackMap,f;return t=t.toLowerCase(),f=o[t],f&&(f[i]?(n(e).unbind(r(t),f[i]),delete f[i],u(f)||delete o[t]):i||(n(e).unbind(r(t)),delete o[t])),e},invoke:function(t){var i=this,r=i.connection,s=n.makeArray(arguments).slice(1),c=e(s,o),f={H:i.hubName,M:t,A:c,I:r._.invocationCallbackId},u=n.Deferred(),l=function(f){var e=i._maximizeHubResponse(f),s,o;n.extend(i.state,e.State);e.Progress?u.notifyWith?u.notifyWith(i,[e.Progress.Data]):r._.progressjQueryVersionLogged||(r.log("A hub method invocation progress update was received but the version of jQuery in use ("+n.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."),r._.progressjQueryVersionLogged=!0):e.Error?(e.StackTrace&&r.log(e.Error+"\n"+e.StackTrace+"."),s=e.IsHubException?"HubException":"Exception",o=h._.error(e.Error,s),o.data=e.ErrorData,r.log(i.hubName+"."+t+" failed to execute. Error: "+o.message),u.rejectWith(i,[o])):(r.log("Invoked "+i.hubName+"."+t),u.resolveWith(i,[e.Result]))};return r._.invocationCallbacks[r._.invocationCallbackId.toString()]={scope:i,method:l},r._.invocationCallbackId+=1,n.isEmptyObject(i.state)||(f.S=i.state),r.log("Invoking "+i.hubName+"."+t),r.send(f),u.promise()},_maximizeHubResponse:function(n){return{State:n.S,Result:n.R,Progress:n.P?{Id:n.P.I,Data:n.P.D}:null,Id:n.I,IsHubException:n.H,Error:n.E,StackTrace:n.T,ErrorData:n.D}}};i.fn.init.prototype=i.fn;t.fn=t.prototype=n.connection();t.fn.init=function(t,i){var e={qs:null,logging:!1,useDefaultPath:!0},u=this;n.extend(e,i);n.signalR.fn.init.call(u,t,e.qs,e.logging);u.proxies={};u._.invocationCallbackId=0;u._.invocationCallbacks={};u.received(function(t){var f,o,e,i,s,h;t&&(typeof t.P!="undefined"?(e=t.P.I.toString(),i=u._.invocationCallbacks[e],i&&i.method.call(i.scope,t)):typeof t.I!="undefined"?(e=t.I.toString(),i=u._.invocationCallbacks[e],i&&(u._.invocationCallbacks[e]=null,delete u._.invocationCallbacks[e],i.method.call(i.scope,t))):(f=this._maximizeClientHubInvocation(t),u.log("Triggering client hub event '"+f.Method+"' on hub '"+f.Hub+"'."),s=f.Hub.toLowerCase(),h=f.Method.toLowerCase(),o=this.proxies[s],n.extend(o.state,f.State),n(o).triggerHandler(r(h),[f.Args])))});u.error(function(n,t){var i,r;t&&(i=t.I,r=u._.invocationCallbacks[i],r&&(u._.invocationCallbacks[i]=null,delete u._.invocationCallbacks[i],r.method.call(r.scope,{E:n})))});u.reconnecting(function(){u.transport&&u.transport.name==="webSockets"&&f(u,"Connection started reconnecting before invocation result was received.")});u.disconnected(function(){f(u,"Connection was disconnected before invocation result was received.")})};t.fn._maximizeClientHubInvocation=function(n){return{Hub:n.H,Method:n.M,Args:n.A,State:n.S}};t.fn._registerSubscribedHubs=function(){var t=this;t._subscribedToHubs||(t._subscribedToHubs=!0,t.starting(function(){var i=[];n.each(t.proxies,function(n){this.hasSubscriptions()&&(i.push({name:n}),t.log("Client subscribed to hub '"+n+"'."))});i.length===0&&t.log("No hubs have been subscribed to.  The client will not receive data from hubs.  To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to.");t.data=t.json.stringify(i)}))};t.fn.createHubProxy=function(n){n=n.toLowerCase();var t=this.proxies[n];return t||(t=i(this,n),this.proxies[n]=t),this._registerSubscribedHubs(),t};t.fn.init.prototype=t.fn;n.hubConnection=t}(window.jQuery,window),function(n){n.signalR.version="2.2.2"}(window.jQuery)