(function(e){var m=window.AmazonUIPageJS||window.P,g=m._namespace||m.attributeErrors,b=g?g("DetailPageImageBlockSubAssets@controller","DetailPageImageBlockSubAssets"):m;b.guardFatal?b.guardFatal(e)(b,window):b.execute(function(){e(b,window)})})(function(e,m,g){e.when("A","imageBlockUtils").register("ImageBlockModel",function(b,c){function p(b,a,q,f,d,k){c.isDefined(b)&&(h.type=b);c.isDefined(a)&&(h.index=a);c.isDefined(q)&&(h.thumbnailIndex=q);c.isDefined(f)&&(h.variant=f);c.isDefined(d)&&(h.color=
d);h.shoppableScene=k||null}function l(b){p("image",0,0,"MAIN",b||a.landingAsinColor||a.defaultColor,null)}function f(a){a=a.data;d=b.copy(h);p(a.type,a.index,a.thumbnailIndex,a.variant,a.color,a.shoppableScene)}function k(a){f(a);a=b.copy(a);a.data=b.copy(h);n.dispatch("updateView",a)}function e(){d=b.copy(h);l(h.color)}var a,n,h={},d={},m,r;return function(c,g){n=g;a=c;n.register("updateSelection",k);n.register("updateModel",f);n.register("resetModel",e);this.init=function(){l()};this.getCurrentItem=
function(){return b.copy(h)};this.getPreviousItem=function(){return b.copy(d)};this.setCurrentEvent=function(a){m=a};this.getCurrentEvent=function(){return m};this.setImmersiveViewModalInstance=function(a){r=a};this.getImmersiveViewModalInstance=function(){return r};this.updateTitle=function(b){a.title=b};this.setToPreviousItem=function(){p(d.type,d.index,d.thumbnailIndex,d.variant,d.color,d.shoppableScene)};this.setToCurrentItem=function(a){p(a.type,a.index,a.thumbnailIndex,a.variant,a.color,a.shoppableScene)}}});
"use strict";e.when("imageBlockUtils").register("ImageBlockState",function(b){return function(c,e,l){this.getImageHash=function(f){var k=l.getCurrentItem();f=b.getIndexForVariant(k.color,f||"MAIN",c);return b.getImageHash(k.color,f,c)};this.onImageUpdateForTwister=function(b){e.register("updateSelection",function(c){"swatchClick"===c.type&&"function"===typeof b&&b()})}}});"use strict";e.when("jQuery","ImageBlockModel","ImageBlockView","imageBlockUtils","ImageBlockState").register("ImageBlockController",
function(b,c,e,l,f){var k={};return function(g){var a=this;a.dispatch=function(a,c){var d=k[a];l.isDefined(d)&&b.each(d,function(a,b){b.call(m,c)})};a.register=function(a,b){l.isDefined(k[a])||(k[a]=[]);"function"===typeof b&&k[a].push(b)};a.model=new c(g,a);a.view=new e(g,a,a.model);a.api=new f(g,a,a.model);a.init=function(){a.model.init();a.view.init()};a.init()}});"use strict";e.when("jQuery","ImageBlockController","ImageBlockATF","ImageBlockBTF").register("ImageBlock",function(b,c,g,l){b=b.extend(!0,
{},g,l);var f=new c(b);e.register("ImageBlockAPI",function(){return f.api});return f})});
/* ******** */
(function(E){var v=window.AmazonUIPageJS||window.P,U=v._namespace||v.attributeErrors,m=U?U("DetailPageImageBlockSubAssets@baseViews","DetailPageImageBlockSubAssets"):v;m.guardFatal?m.guardFatal(E)(m,window):m.execute(function(){E(m,window)})})(function(E,v,U){E.when("A","jQuery","imageBlockUtils","ImageBlockLoader","postMetric","logFailedInteractionMetric","postEarlyMetric").register("ImageBlockAdditionalAltImageView",function(m,b,e,ca,l,N,F){function L(a,x,c,A,h){if(!e.isjQueryObjDefined(a.find(".a-button-selected"))){var f=
w.getCurrentItem();if(!A||"chromeless-video"!==f.type||!g.autoplayVideo){A=0;"image"===f.type&&(A=Math.max(e.getIndexForVariant(f.color,f.variant,g),0));var d=0;e.isDefined(g.heroImage[f.color])&&(d=g.heroImage[f.color].length);h=A-(x>=g.maxAlts?g.maxAlts-h-d:0);x=0<=h?x+h:A+d;x>=c&&(A=0,x=d);c=e.getImageHash(f.color,A,g);-1!==c&&(u.dispatch("updateModel",{data:{index:A,thumbnailIndex:x,variant:c.variant,type:"image",shoppableScene:c.shoppableScene}}),c=a.find(".item").get(x),e.selectGivenThumbnail(b(c),
a))}}}function G(a){if(!g.useChildVideos)return e.lazyLoadingRequired(w.getCurrentItem(),w,g)?void 0:g.videos;if(g.colorToVideo[a])return g.colorToVideo[a];var b=g.colorToAsin[a];if(b&&b.asin){var c={};c.params={asin:b.asin,productGroupID:g.productGroupID,useAiryVideoPlayer:!0,useChromelessVideoPlayer:g.useChromelessVideoPlayer,isUDP:g.isUDP};g.isDPXFeatureEnabled||(c.success=function(a){videosOnTwisterRefresh(a)},ca.load(VIDEO_AJAX_ENDPOINT,c));return g.colorToVideo&&g.colorToVideo[a]}}function t(B,
c,A){if((2===g.unrolledImageBlockTreatment||3===g.unrolledImageBlockTreatment)&&A)return B;var n=G(c),h=e.isDefined(n)&&0<n.length&&g.alwaysIncludeVideo?1:0;c=g.colorImages&&g.colorImages[c];var n=B,f=0;e.isDefined(c)&&(b.each(c,function(d,r){if(f>=g.maxAlts-h&&B<g.maxAlts+g.additionalNumberOfImageAlts){if(2===g.unrolledImageBlockTreatment||3===g.unrolledImageBlockTreatment){var c=b(".thumbItemUnrolled");c[B]?c[B].querySelector("img").src=r.thumb:b('\x3cli class\x3d"thumbItemUnrolled thumbTypeimage thumbIndex'+
d+'"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-button a-button-thumbnail a-button-toggle" id\x3d"a-autoid-'+(B+1)+'"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input" type\x3d"submit" aria-labelledby\x3d"a-autoid-'+(B+1)+'-announce"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true" id\x3d"a-autoid-'+(B+1)+'-announce"\x3e \x3cimg alt\x3d"" src\x3d"'+r.thumb+'"\x3e \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e \x3c/span\x3e\x3c/li\x3e').appendTo(b(".regularAltImageViewLayout"))}else e.createThumbnail({type:"image",
index:d,thumbnailIndex:B,variant:r.variant,shoppableScene:r.shoppableScene},r.thumb,a,"imageThumbnail");B++}f++}),N.isEnabled&&F.logAltImgRequestPlacedOnThumbnails(b,N,w),L(a,n,B,A,h));return B}function z(a,b){g.useIV&&e.isDefined(b.hiRes)&&a.css("cursor","pointer")}function D(a,c){if("image"===a.type){var A=b("#image-canvas-caption #canvasCaption"),n,h=g.staticStrings,f=g.colorImages,d=a.color,r=a.index;e.isShoppableScenesEnabled()&&a.shoppableScene?n=h.clickSceneTagsToShopProducts:c&&g.useIV?n=
h.clickToExpand:f[d]&&f[d][r].hiRes&&g.useHoverZoom?(n=g.useHoverZoomIpad?h.touchToZoom:g.useClickZoom?h.clickToZoom:h.rollOverToZoom,g.hoverZoomIndicator&&(n="\x3cimg src\x3d'"+g.staticImages.hoverZoomIcon+"'/\x3e\x26nbsp;"+n)):g.useIV&&(n=h.clickToExpand);A.html(n)}}function I(a,c){var A="a-dynamic-image";if(!g.acEnabled){var k;b.each(a.main,function(a,f){e.isDefined(k)||(k=parseFloat(f[1]/f[0])<=parseFloat(g.holderRatio)?" a-stretch-vertical":" a-stretch-horizontal")});A+=k}var h=e.getMaxDimensionsOfMainImage(a.main,
n,g),f=h[0],d=h[1],h=b("\x3cdiv\x3e\x3c/div\x3e"),f={"max-height":f,"max-width":d};h.addClass(A).css(f).attr({"data-old-hires":a.hiRes,"data-a-manual-replacement":"true",onload:c}).data("a-dynamic-image",a.main);return h}function q(a,e,b){var g="desktop-dp-atf-ib-shoppablescenes-tags-"+a;"function"==typeof uet&&uet("bb",g,{wb:1});b.attr("data-a-image-name","shoppable-scene:"+a);b=p.find(".mirai-scene-image-block-template").clone().removeClass("mirai-scene-image-block-template aok-hidden").addClass("mirai-shoppable-scene");
b.addClass("celwidget").attr("cel_widget_id",g);b.children("span").css("display","inline-block");u.dispatch("initialize-shoppable-scene",{index:a,shoppableScene:e.shoppableScene,imageSource:e.hiRes||e.large||e.lowRes,$tagPlaceholder:b.find(".mirai-scene-tag-placeholder"),$viewProductsButton:b.find(".mirai-scene-view-products-button")});"MutationObserver"in v&&(new MutationObserver(function(b,f){b.forEach(function(d){"childList"===d.type&&d.target.classList.contains("mirai-scene-image-block-tag-container")&&
1===d.addedNodes.length&&"IMG"===d.addedNodes[0].tagName&&""!==d.addedNodes[0].src&&(d=d.addedNodes[0],"function"!==typeof d.onload&&(d.onload=function(){m.trigger("shoppable-scene-image-loaded",{index:a,shoppableScene:e.shoppableScene})}),f.disconnect())})})).observe(b.find(".mirai-scene-image-block-tag-container")[0],{subtree:!0,childList:!0,attributes:!1});"function"==typeof uet&&uet("cf",g,{wb:1});return b}function y(a,b,g){g=I(a,g);a=e.isShoppableScenesEnabled()&&a.shoppableScene?q(b,a,g):p.find(".mainImageTemplate").clone().removeClass("template mainImageTemplate");
a.addClass("image item itemNo"+b+" maintain-height").attr({"data-csa-c-type":"uxElement","data-csa-c-element-type":"navigational","data-csa-c-action":"image-block-main-image-hover","data-csa-c-posy":b+1});a.find(".placeHolder").replaceWith(g);p.find(".list").append(a);m.loadImageManually(g);return a}function K(a){var b=n.css("height");null!==b&&a.find(".imgTagWrapper").css("height",b);a.addClass("selected");g.imgTagWrapperClasses&&a.find(".imgTagWrapper").addClass(g.imgTagWrapperClasses)}function M(a,
c,A,n){if((2===g.unrolledImageBlockTreatment||3===g.unrolledImageBlockTreatment)&&!n&&"unavailable"!==a.type){a=g.colorImages&&g.colorImages[A];c=b(".unrolledImg");A=G(A);var h=e.isDefined(A)&&0<A.length&&g.alwaysIncludeVideo?1:0;c.length>g.maxAlts&&c.each(function(a){a>=g.maxAlts&&b(this).remove()});e.isDefined(a)&&b.each(a,function(a,d){a<g.maxAlts-h+g.additionalNumberOfImageAlts&&a>=g.maxAlts-h&&b('\x3cli data-csa-c-action\x3d"image-block-main-image-hover" data-csa-c-element-type\x3d"navigational" data-csa-c-posy\x3d"'+
(a+h+1)+'" data-csa-c-type\x3d"uxElement" class\x3d"image item itemNo'+(a+h)+' unrolledImg imgMedia"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-declarative" data-action\x3d"main-image-click" data-csa-c-type\x3d"widget" data-csa-c-func-deps\x3d"aui-da-main-image-click" data-main-image-click\x3d"{}" data-ux-click\x3d""\x3e \x3cdiv id\x3d"imgTagWrapperId" class\x3d"imgTagWrapper"\x3e \x3cdiv id\x3d"unrolledImgNo'+(a+h)+'"\x3e \x3cdiv class\x3d"a-image-container a-dynamic-image-container greyBackground" style\x3d"width:100%; height:600px;"\x3e \x3cimg alt\x3d"" src\x3d"'+
d.large+'" data-a-hires\x3d"'+d.hiRes+'"\x3e \x3c/div\x3e \x3c/div\x3e\x3c/div\x3e\x3c/span\x3e \x3c/span\x3e\x3c/li\x3e').appendTo(b(".unrolledScrollBox .list-unrolled"))})}else if("image"===a.type||"unavailable"===a.type||"lazy-loaded"===a.type){A=e.getImageHash(a.color,a.index,g);if(-1===A)return c={data:{index:0,thumbnailIndex:0,variant:"",type:"unavailable"}},e.lazyLoadingRequired(a,w,g)||(u.dispatch("updateModel",c),e.showUnavailable(a.color)),-1;n=p.find(".item.itemNo"+a.thumbnailIndex);e.isjQueryObjDefined(n)||
(n=y(A,a.thumbnailIndex,c));K(n);u.dispatch("loadMagnifier");D(a);z(n,A);m.trigger("dp:image-block:update",A)}}function k(a){var b=w.getCurrentItem().color;g.colorImages[b]||(g.colorImages[b]=a);a={type:"updatedData",data:w.getCurrentItem()};u.dispatch("updateView",a);(b=g.colorToAsin[b])&&b.asin&&E.register(e.rankedImagesReadyEvent(b.asin))}function c(){var a=p.find(".item .imgTagWrapper"),c=e.getContainerHeight(n,g.holderRatio,g.holderMaxHeight);0<c&&(n.height(c),a.height(c));p.find("img.a-dynamic-image").each(function(){var a=
b(this);a.data("a-manual-replacement")&&m.loadDynamicImage(this);var c=a.data("a-dynamic-image"),c=e.getMaxDimensionsOfMainImage(c,n,g);a.css({"max-height":c[0]+"px","max-width":c[1]+"px"})})}function A(a){D(w.getCurrentItem(),"mouseenter"===a.type)}var R,g,w,u,a,p,n,J;return function(l,x,q,D){R=this;g=l;w=x;u=D;m.on("triggerImageAjax",k);g.colorImages[g.landingAsinColor]=g.colorImages[g.defaultColor];R.render=function(c,f,d,r,A,C,Q){p=d;a=r;n=A;J=t(f,c,C);C||(f=w.getCurrentItem(),e.lazyLoadingRequired(f,
w,g)&&u.dispatch("updateModel",{data:{type:"lazy-loaded"}}));f=w.getCurrentItem();d=!C;e.lazyLoadingRequired(f,w,g)||(b("#imageBlock").css("opacity","1"),p.css("opacity","1"),e.spinner(p,!1),p.find("li").removeClass("selected"),b("#image-canvas-caption #canvasCaption").empty(),e.hideUnavailable(),d&&p.find(".list .item").remove());M(w.getCurrentItem(),Q,c,C);return J};R.update=function(a){};g.overrideAltImageClickAction&&e.addTag("clickEnabledOnAltImages");u.register("imageHover",A);u.register("resize",
c)}});"use strict";E.when("A","jQuery","imageBlockUtils").register("ImageBlockAltImageIngressView",function(m,b,e){var v,l,N,F;return function(b,G,t,z){v=this;l=b;N=z;v.render=function(b,t,q,y,z,M,k){F=y;v=this;q=l.maxAlts;y=t;z=l.colorImages[b]?l.colorImages[b].length:0;z+=e.getVideosCount(b,l);b=l.heroImage[b];M=0;b&&(M=b.length);b=z+M;b>q&&(q=b-q,b=F.find(".altIngressTemplate").clone().removeClass("altIngressTemplate").removeClass("aok-hidden").addClass("item"),q+="+",y={type:"ingress",index:0,
thumbnailIndex:t,variant:""},b.find("#altIngressText").append(q),m.declarative.create(b,"thumb-action",y),F.append(b),y=t++);return y};v.update=function(b){"ingress"===b.data.type&&"click"===b.type&&N.dispatch("imageClick",b)}}});"use strict";E.when("A","jQuery","imageBlockUtils","ImageBlockHeroUtils").register("ImageBlockHeroImageView",function(m,b,e,v){function l(c,k,g,w){if(!e.isjQueryObjDefined(c.find(".a-button-selected"))){var u=y.getCurrentItem();if(!w||"chromeless-video"!==u.type||!q.autoplayVideo){w=
0;if("hero-image"===u.type){w=F(u.color,u.variant);if(-1===w)return;w=-1!==w?w:0}var a=k+w;a>=g&&(w=0,a=k);k=v.getHeroImageHash(q,u.color,w);-1!==k&&(K.dispatch("updateModel",{data:{index:w,thumbnailIndex:a,variant:k.variant,type:"hero-image"}}),k=c.find(".item").get(a),e.selectGivenThumbnail(b(k),c))}}}function N(c,k,g){if("hero-video"===y.getCurrentItem().type)return c;k=q.heroImage&&q.heroImage[k];var w=c;e.isDefined(k)&&(b.each(k,function(b,a){c<q.maxAlts&&(e.createThumbnail({type:"hero-image",
index:b,thumbnailIndex:c,variant:a.variant},a.thumb,M,"imageThumbnail"),c++)}),l(M,w,c,g));return c}function F(c,k){var g=q.heroImage;if(1>g.length||!e.isDefined(g[c])||!e.isDefined(k))return-1;var w=-1;b.each(g[c],function(b,a){a.variant===k&&(w=b)});return w}function L(){if(k.length&&q.repositionHeroImage){var b=v.getHeroDimParams(q,y.getCurrentItem()),c;e.isDefined(b)&&(c=e.isDefined(b.xPos)?b.xPos+"px "+b.yPos+"px ":"center "+b.yPos+"px ",k.css({"background-position":c,"background-size":b.width+
"px "+b.height+"px ","max-width":b.width+"px ","min-height":b.height+"px ",filter:"","-ms-filter":""}))}}function G(b,c,g,w){if(k.length&&b&&c){if("function"===typeof g||w){var u=new Image;u.onload=w?function(){k.css("background-image",'url("'+b+'")')}:g;u.src=b}g=c[1];var u=c[0],a;w||k.css({"background-image":'url("'+b+'")'});q.repositionHeroImage&&(c=v.getHeroDimParams(q,y.getCurrentItem(),c),e.isDefined(c)&&(g=c.width,u=c.height,a=e.isDefined(c.xPos)?c.xPos+"px "+c.yPos+"px ":"center "+c.yPos+
"px "));k.css({"background-position":a,"background-size":g+"px "+u+"px ","max-width":g+"px ","min-height":u+"px ",filter:"","-ms-filter":""})}}function t(c,e,g,k){c=v.getHeroImageHash(q,c,e);if(-1===c)return-1;e=b.map(c.main,function(b,a){return a})[0];G(e,c.main[e],g,k)}function z(b,c,e){if("hero-image"!==b.type)return-1;var k=F(b.color,y.getCurrentItem().variant),k=-1!==k?k:0;if(-1===v.getHeroImageHash(q,b.color,k))return-1;var u=y.getCurrentItem();b.thumbnailIndex=u.thumbnailIndex;b.type=u.type;
b.variant=u.variant;b.index=k;D(b,c,e)}function D(b,e,g){var l=v.getHeroImageHash(q,b.color,b.index),u;u=b&&c&&m.equals(b,c)?!0:!1;c||(c=b);if(!u&&b||e)t(b.color,b.index,e,g),c=b;k.removeClass("hide-background");m.trigger("dp:image-block:update",l)}var I,q,y,K,M,k,c={};return function(c,l,g,m){I=this;q=c;y=l;K=m;q.heroImage[q.landingAsinColor]=q.heroImage[q.defaultColor];I.render=function(c,a,e,g,l,m,A){M=g;k=b("#heroImage");c=N(a,c,m);z(y.getCurrentItem(),A,m);return c};I.update=function(b){var a=
b.data;"ingress"!==a.type&&k.addClass("hide-background");"swatchHover"===b.type?b.captured||(a.type=y.getCurrentItem().type,-1!==z(a)&&(b.captured=!0)):"hero-image"===a.type&&(D(a),"click"!==b.type&&q.usePeekHover||e.selectGivenThumbnail(b.$declarativeParent,M))};K.register("resize",L)}});"use strict";E.when("A","jQuery","imageBlockUtils","postMetric","logFailedInteractionMetric","postEarlyMetric").register("ImageBlockMagnifierView",function(m,b,e,E,l,N){function F(b){M?b.css("cursor","url('"+D.staticImages.zoomIn+
"'), auto"):(b.css("cursor","-webkit-zoom-in"),b.css("cursor","-moz-zoom-in"),b.css("cursor","zoom-in"))}function L(b){var c=b.match(/\._((\w|,|\.)+)_\.(gif|jpg|png)$/i);b={};if(e.isDefined(c))for(var c=c[1].split("_"),l=0;l<c.length;l++){var m=c[l].match(/^([A-Z]+)(\d+(\.\d+)?)$/);e.isDefined(m)&&(b[m[1]]=parseInt(m[2],10))}return b}function G(k,c){function A(){var a;c.useClickZoom?(a=c.offsetInClickZoom,a=[Math.min(1,Math.max(0,y[0]-(f[0]+a))/(f[2]-2*a)),Math.min(1,Math.max(0,y[1]-(f[1]+a))/(f[3]-
2*a))]):a=z&&z.updatePosition();if(a&&x&&x.detailSize){var b=[x.detailSize[0]-x.rect.width,x.detailSize[1]-x.rect.height];m.capabilities.rtl?x.detailImage.get(0).style.right=-(a[0]*b[0])+"px":x.detailImage.get(0).style.left=-(a[0]*b[0])+"px";x.detailImage.get(0).style.top=-(a[1]*b[1])+"px"}}function q(a){return a.offsetParent().hasClass("a-dynamic-image-container")}function g(a){var f=Q?a.originalEvent.touches[0]||a.originalEvent.changedTouches[0]:"";y=Q?[f.pageX,f.pageY]:[a.pageX,a.pageY];if(m.capabilities.rtl){var d=
b(v).width();y=Q?[d-f.pageX,f.pageY]:[d-a.pageX,a.pageY]}}function w(a){Q&&a.preventDefault();g(a);c.useClickZoom?a=[f[0],f[1],f[0]+f[2],f[1]+f[3]]:(a=z?z.offset:k.offsetParent().offset(),a=D.acEnabled?[a.left,a.top,t.width()+a.left,t.height()+a.top]:[h[0]+a.left,h[1]+a.top,h[0]+h[2]+a.left,h[1]+h[3]+a.top]);y[0]<a[0]||y[1]<a[1]||y[0]>=a[2]||y[1]>=a[3]||D.acEnabled&&!q(k)?(c.fadeMagnifier?Y||(Y=!0,I=setTimeout(function(){u(!0)},500)):c.useClickZoom||u(),G&&(G=!1,clearTimeout(K))):(G||(G=!0,K=setTimeout(function(){E.postCountMetric("dppc_hoverZoomOpened");
l.isEnabled&&N.logHoverZoomRequestServed(l)},1E3)),c.fadeMagnifier&&Y&&(Y=!1,clearTimeout(I)),A())}function u(f){f&&n.suppressMagnifier(!0);if(r&&(x&&x.hide(),z&&(z.destroy(),z=null),r=!1,Q?(k.unbind("touchmove.magnifier touchstart.magnifier touchend.magnifier"),b(document).trigger("disengaged.magnifier")):b(document).unbind("mousemove.magnifier").trigger("disengaged.magnifier"),p(),f))k.one("click.magnifier touchstart.magnifier",function(b){a(b,!0)})}function a(a,d){d&&n.suppressMagnifier(!1);if(!r&&
!P&&(0===W&&(E.postCountMetric("dppc_hoverTime",new Date-(v.ue&&v.ue.t0||0)),W=1),V[C]||(E.postCountMetric("dppc_hoverMain"),V[C]=1),h=[k.position().left,k.position().top,k.width(),k.height()],C&&(g(a),x?x.refit().show():x=new ba,c.useClickZoom||(z=z||new X),f=x.getWindowSize(),A()),r=!0,Q?(k.unbind("touchstart.magnifier touchmove.magnifier").bind("touchmove.magnifier",w).bind("touchend.magnifier",u),b(document).trigger("engaged.magnifier")):(D.acEnabled?t.unbind("mousemove.magnifier"):k.unbind("mousemove.magnifier"),
b(document).trigger("engaged.magnifier").bind("mousemove.magnifier",w)),d)){var e=b("#zoomWindow");if(0<e.length)e.one("click.magnifier touchend.magnifier",function(a){u(!0)})}}function p(){c.useHoverZoom&&(Q?k.bind("touchstart.magnifier touchmove.magnifier",a):D.acEnabled?q(k)&&t.bind("mousemove.magnifier",a):k.bind("mousemove.magnifier",a))}var n=this,t=k.offsetParent(),B={detailImageUrl:k.attr("data-old-hires"),location:"over",locationElement:k,prelaod:"ready",zIndex:50,offsetInClickZoom:50};c=
b.extend(B,c);c.adjustment=[10,0,-10,0];var x=null,z=null,y=null,h=null,f=null,d={"null":1,"":1,undefined:1},r=!1,P=!1,C=c.detailImageUrl,Q=c.useHoverZoomIpad||0,W=0,V={},X=function(){function a(b){var f=Math.round(Math.min(k.width(),x.rect.width/b));b=Math.round(Math.min(k.height(),x.rect.height/b));g.css({width:f,height:b});d=[f,b]}var f=this,d=[0,0],e=(x.detailSize&&x.detailSize[0]||5E8)/h[2],C=(x.detailSize&&x.detailSize[1]||5E8)/h[3],e=C>e?C:e;b("#magnifierLens").remove();var g=b("\x3cdiv id\x3d'magnifierLens' /\x3e").css({position:"absolute"});
c.generalImageUrls.zoomLensBackground&&g.css({backgroundImage:"url("+c.generalImageUrls.zoomLensBackground+")"});D.showMagnifierOnHover?F(g):g.css("cursor","pointer");f.updatePosition=function(){var a=[h[2]-d[0],h[3]-d[1]],b=0>=a[0]?.5:Math.max(0,Math.min(1,(y[0]-d[0]/2-h[0]-f.offset.left)/a[0])),c=0>=a[1]?.5:Math.max(0,Math.min(1,(y[1]-d[1]/2-h[1]-f.offset.top)/a[1])),e=h[0]+Math.round(b*a[0]),a=h[1]+Math.round(c*a[1]);g.get(0).style.left=e+"px";g.get(0).style.top=a+"px";return[b,c]};f.destroy=function(){g.remove()};
f.offset=k.offsetParent().offset();a(e);f.updatePosition();g.appendTo(k.parent());x.detailImage[0].complete||x.detailImage.load(function(){var b=x.detailImage.width()/h[2];a(b);f.updatePosition()})};X.preload=function(){n.preload(c.generalImageUrls.lensBackgroundUrl)};var ba=function(){function a(){var f={};if("over"===c.location){var f=c.useClickZoom,C={},r=b("#leftCol"),n=b("#centerCol"),h=b("#rightCol"),Q=b("#hover-zoom-end"),X=b("#actionPanelContainer"),p=e.isjQueryObjDefined(r)?r.outerHeight():
n.outerHeight();C.top=e.isjQueryObjDefined(r)?r.offset().top:n.offset().top;C.bottom=p+C.top;C.right=e.isjQueryObjDefined(h)?h.offset().left:X.offset().left;C.left=f?0:r.offset().left+r.outerWidth();e.isjQueryObjDefined(Q)&&Q.offset().top>C.bottom&&(C.bottom=Q.offset().top);f=C}else"right"===c.location&&(f=k.offset(),f={left:f.left+k.outerWidth(),top:f.top,right:f.left+k.outerWidth()+400,bottom:f.top+400});c.minHeightElement&&(f.bottom=Math.max(f.bottom,f.top+b(c.minHeightElement).outerHeight()));
f.bottom=Math.min(f.bottom,b(v).scrollTop()+b(v).height());f.left+=g[0];f.top+=g[1];f.right+=g[2];f.bottom+=g[3];f.width=f.right-f.left;f.height=f.bottom-f.top;c.enhancedHoverOverlay&&e.isDefined(v.pageXOffset)&&(C=b(v).width(),f.width=C-f.left+v.pageXOffset-18,f.height-=14);H.css({left:f.left,top:f.top,width:f.width,height:f.height});d.rect=f;return d}function f(a){var b=new Image;d.detailSize=[0,0];b.onload=function(){d.detailSize=[b.width,b.height];A()};b.src=a.attr("src");if(0<b.width&&0<b.height)d.detailSize=
[b.width,b.height];else if(c.detailImageSize)d.detailSize=c.detailImageSize;else{a=L(b.src);var e=h[2]/h[3];a.SS||a.AA?(a=a.SS||a.AA,d.detailSize=[a,a]):a.SX?d.detailSize=[a.SX,Math.round(a.SX/e)]:a.SY?d.detailSize=[Math.round(a.SY*e),a.SY]:a.SL&&(d.detailSize=1<=e?[a.SL,Math.round(a.SL/e)]:[Math.round(a.SL*e),a.SL])}}var d=this,g=c.adjustment;b("#zoomWindow").remove();var r={overflow:"hidden",position:"absolute",backgroundColor:"white",zIndex:c.zIndex};c.enhancedHoverOverlay&&(r.boxShadow="0 6px 8px 2px rgba(0,0,0,.25)",
r.border="1px solid #949494",r.borderColor="rgb(148,148,148)");var H=b("\x3cdiv id\x3d'zoomWindow' /\x3e").css(r);c.fadeMagnifier&&H.fadeIn(200);c.useClickZoom&&(M?H.css("cursor",'url("'+c.zoomOutIcon+'"), auto'):(H.css("cursor","-webkit-zoom-out"),H.css("cursor","-moz-zoom-out"),H.css("cursor","zoom-out")));d.updateImage=function(a){a=b("\x3cimg id\x3d'detailImg' src\x3d'"+a+"'/\x3e").css("position","absolute");d.detailImage&&d.detailImage.remove();H.append(a);b(document).trigger("updated.magnifier");
d.detailImage=a;f(d.detailImage)};d.refit=function(){a();f(d.detailImage);return d};c.fadeMagnifier?(d.show=function(){H.fadeIn(200);return d},d.hide=function(){H.fadeOut(200);return d}):(d.show=function(){H.show();return d},d.hide=function(){H.hide();return d});d.destroy=function(){H.remove();return d};d.getWindowSize=function(){return[d.rect.left,d.rect.top,d.rect.width,d.rect.height]};d.updateImage(C);a();H.appendTo(document.body)},Y=!1,I,G=!1,K;n.preload=function(a){a=b.makeArray(a);for(var f=
a.length,c=0;c<f;c++)a[c]instanceof Array?n.preload(a[c]):"string"===typeof a[c]&&a[c]&&!d[a[c]]&&(d[a[c]]=new Image,d[a[c]].src=a[c])};n.changeImage=function(a,f){r&&u();C=f;k.attr("src",a);n.preload(a);h=[k.position().left,k.position().top,k.width(),k.height()];f&&("immediately"===c.preload?n.preload(f,!0):b(v).ready(function(){n.preload(f)}),x?x.updateImage(f):k.attr("data-old-hires",f))};n.destroy=function(){D.acEnabled?t.unbind("touchstart touchstart.magnifier touchmove.magnifier mousemove.magnifier"):
k.unbind("touchstart touchstart.magnifier touchmove.magnifier mousemove.magnifier");b(document).unbind("mousemove.magnifier");z&&z.destroy();z=null;x&&x.destroy();x=null};n.detailImage=function(){return x.detailImage};n.suppressMagnifier=function(a){P=a};n.isEngaged=function(){return r};n.engageMagnifier=a;n.disengageMagnifier=u;k[0].complete?p():k.one("load",p);n.preload(k.attr("src"));v.performance&&performance.now&&v.ue&&ue.count&&ue.count("MagnifierImageDownload",performance.now());if(c.preload){var T=
c.detailImageUrl,B=function(){n.preload(T,!0);c.useClickZoom||X.preload()},H=c.preload;H.constructor!==Array&&(H=[H]);for(var Z=0;Z<H.length;Z++)if("immediately"===H[Z])B();else if(b(v)[H[Z]])b(v)[H[Z]](B);else b(v).bind(H[Z],B)}return n}function t(){if(D.useHoverZoom){var k={adjustment:[0,0,1,1],generalImageUrls:D.staticImages,location:"over",minHeightElement:"#imageBlock",preload:"ready",zIndex:199,useHoverZoomIpad:D.useHoverZoomIpad,useHoverZoom:D.useHoverZoom,useClickZoom:D.useClickZoom,fadeMagnifier:D.fadeMagnifier,
zoomOutIcon:D.staticImages.zoomOutCur,enhancedHoverOverlay:D.enhancedHoverOverlay||D.atfEnhancedHoverOverlay};y&&(y.destroy(),y=U);var c=K.find(".image.item.selected:not(.mirai-shoppable-scene) img[data-old-hires]").not("[data-old-hires\x3d'']");e.isjQueryObjDefined(c)?D.useClickZoom?(c.one("click.loadmagnifier touchstart.loadmagnifier",function(b){y=new G(c,k);y.engageMagnifier(b,!0)}),M?c.css("cursor",'url("'+D.staticImages.zoomInCur+'"), auto'):(c.css("cursor","-webkit-zoom-in"),c.css("cursor",
"-moz-zoom-in"),c.css("cursor","zoom-in"))):y=new G(c,k):l.isEnabled&&N.logHoverZoomApplicability(b,l)}}var z,D,I,q,y,K,M=navigator.userAgent.match(/msie|trident/i);return function(b,c,e,m){z=this;D=b;I=c;l.refToModel=I;q=m;z.render=function(b,c,e,a,k,n){K=e;y&&(y.destroy(),y=U)};z.update=function(b){};q.register("loadMagnifier",t);q.register("resize",t)}});"use strict";E.when("A","jQuery","imageBlockUtils","postMetric").register("ImageBlockTwisterView",function(m,b,e,E){function l(b,m,l){b=(b=l?
l:e.getColorFromState(m.getState().hovered_variations,L))&&""!==b?b:L.defaultColor;t.dispatch("updateView",{type:"swatchHover",data:{color:b}});E.postCountMetric("swatchHover")}function N(b,l,m,q){b=(b=q?q:e.getColorFromState(l.getState().selected_variations,L))&&""!==b?b:L.defaultColor;b===G.getCurrentItem().color?"function"===typeof m&&m():(t.dispatch("updateSelection",{type:"swatchClick",data:{color:b},onload:function(){var b={hasComponents:!0,components:[{name:"mainImage"}]};"function"===typeof v.markFeatureRender&&
v.markFeatureRender("imageblock",b);m()}}),E.postCountMetric("swatchClick"))}var F,L,G,t;return function(b,e,v,q){F=this;L=b;G=e;t=q;m.on("image-block-twister-swatch-hover",l);m.on("image-block-twister-swatch-click",N);F.render=function(b,e,m,k,c){};F.update=function(b){}}});"use strict";E.when("A","jQuery","imageBlockUtils","ImageBlockLoader","postMetric","logFailedInteractionMetric","postEarlyMetric").register("ImageBlockAltImageView",function(m,b,e,ca,l,N,F){function L(f,d,c,g){if(!e.isjQueryObjDefined(f.find(".a-button-selected"))){var r=
p.getCurrentItem();if(!g||"chromeless-video"!==r.type||!a.autoplayVideo)if(g=0,"image"===r.type&&(g=Math.max(D(r.color,r.variant),0)),!(r.thumbnailIndex>=a.maxAlts&&0!=g)){var h=d+g;h>=c&&(g=0,h=d);d=e.getImageHash(r.color,g,a);-1!==d&&(n.dispatch("updateModel",{data:{index:g,thumbnailIndex:h,variant:d.variant,type:"image",shoppableScene:d.shoppableScene}}),d=f.find(".item").get(h),e.selectGivenThumbnail(b(d),f))}}}function G(f,d,c){if((2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment)&&
c)return f;var g=a.colorImages&&a.colorImages[d];d=f;2!==a.unrolledImageBlockTreatment&&3!==a.unrolledImageBlockTreatment||b(".thumbItemUnrolled").each(function(f){(!b(this)[0].classList.contains("thumbTypeimage")||f>=g.length||f>=a.maxAlts)&&b(this).remove()});e.isDefined(g)&&(b.each(g,function(d,c){if(f<a.maxAlts)if(2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment){f++;var r=b(".thumbItemUnrolled");r[d]?r[d].querySelector("img").src=c.thumb:b('\x3cli class\x3d"thumbItemUnrolled thumbTypeimage thumbIndex'+
d+'"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-button a-button-thumbnail a-button-toggle" id\x3d"a-autoid-'+f+'"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input" type\x3d"submit" aria-labelledby\x3d"a-autoid-'+f+'-announce"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true" id\x3d"a-autoid-'+f+'-announce"\x3e \x3cimg alt\x3d"" src\x3d"'+c.thumb+'"\x3e \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e \x3c/span\x3e\x3c/li\x3e').appendTo(b(".regularAltImageViewLayout"))}else{var r=
{type:"image",index:d,thumbnailIndex:f,variant:c.variant,shoppableScene:c.shoppableScene},h=e.createThumbnail(r,c.thumb,x,"imageThumbnail");a.collapsibleThumbnails&&e.updateImageThumbnailOverlay(h,r,g);f++}}),N.isEnabled&&F.logAltImgRequestPlacedOnThumbnails(b,N,p),L(x,d,f,c));return f}function t(f,b){a.useIV&&e.isDefined(b.hiRes)&&f.css("cursor","pointer")}function z(f,d){if("image"===f.type){var c=b("#image-canvas-caption #canvasCaption"),g,r=a.staticStrings,h=a.colorImages,n=f.color,k=f.index;
e.isShoppableScenesEnabled()&&f.shoppableScene?g=r.clickSceneTagsToShopProducts:d&&a.useIV?g=r.clickToExpand:h[n]&&h[n][k].hiRes&&a.useHoverZoom?(g=a.useHoverZoomIpad?r.touchToZoom:a.useClickZoom?r.clickToZoom:r.rollOverToZoom,a.hoverZoomIndicator&&(g="\x3cimg src\x3d'"+a.staticImages.hoverZoomIcon+"'/\x3e\x26nbsp;"+g)):a.useIV&&(g=r.clickToExpand);c.html(g)}}function D(f,b){return e.getIndexForVariant(f,b,a)}function I(f,b,d){var c=b.thumbnailIndex,e=a.colorToAsin[b.color]&&a.colorToAsin[b.color].asin;
b="altImageHover"===d&&h&&h.altImageIdx===c&&h.asin===e&&"swatchClick"===h.event?!0:"swatchHover"===d?h&&h.asin===e&&h.event===d:h&&h.altImageIdx===c&&h.asin===e&&h.event===d;if(!b){var g="#",n=f.find(".imgTagWrapper img").get(0);n&&(g=n.src);f=new Image;f.onload=function(){if(n){n.src=g;var a=n.width,f=n.height,b=n.naturalWidth,C=n.naturalHeight;try{var H=(Math.abs(a/b*C-f)/f).toFixed(2);.01<H&&(v.ue&&((("landing"!==d||r||P)&&"swatchClick"!==d||v.ue.count("imageBlock-PC-hi_res_image_distortion",
1),"landing"===d||"swatchClick"===d)?v.ue.count("imageBlock-PC-hi_res_landing_image_distortion",1):"swatchHover"!==d||P?"altImageHover"!==d||r||(v.ue.count("imageBlock-PC-hi_res_alt_image_distortion",1),r=!0):(v.ue.count("imageBlock-PC-hi_res_swatch_hover_image_distortion",1),P=!0)),v.ueLogError&&(a={logLevel:"WARN",attribution:"imageBlock-PC-hi_res_image_distortion"},v.ueLogError("swatchHover"===d?{message:"[ImageBlock Hi-Res: Size distortion for ASIN: "+e+" Event:"+d+" Diff:"+H.toString()+"]"}:
{message:"[ImageBlock Hi-Res: Size distortion for ASIN: "+e+" at altImageIdx "+c+" Event:"+d+" Diff:"+H.toString()+"]"},a)))}catch(h){v.ueLogError&&(a={logLevel:"WARN",attribution:"imageBlock-PC-hi_res_log_distortion_catch_exception"},v.ueLogError(h,a))}}};"#"!==g&&(f.src=g);h.altImageIdx=c;h.asin=e;h.event=d}}function q(f,d){var c="a-dynamic-image";if(!a.acEnabled){var g;b.each(f.main,function(f,b){e.isDefined(g)||(g=parseFloat(b[1]/b[0])<=parseFloat(a.holderRatio)?" a-stretch-vertical":" a-stretch-horizontal")});
c+=g}var r=e.getMaxDimensionsOfMainImage(f.main,S,a),n=r[0],h=r[1],r=b("\x3cdiv\x3e\x3c/div\x3e"),n={"max-height":n,"max-width":h};r.addClass(c).css(n).attr({"data-old-hires":f.hiRes,"data-a-manual-replacement":"true",onload:d}).data("a-dynamic-image",f.main);return r}function y(a,f,b){var d="desktop-dp-atf-ib-shoppablescenes-tags-"+a;"function"==typeof uet&&uet("bb",d,{wb:1});b.attr("data-a-image-name","shoppable-scene:"+a);b=O.find(".mirai-scene-image-block-template").clone().removeClass("mirai-scene-image-block-template aok-hidden").addClass("mirai-shoppable-scene");
b.addClass("celwidget").attr("cel_widget_id",d);b.children("span").css("display","inline-block");n.dispatch("initialize-shoppable-scene",{index:a,shoppableScene:f.shoppableScene,imageSource:f.hiRes||f.large||f.lowRes,$tagPlaceholder:b.find(".mirai-scene-tag-placeholder"),$viewProductsButton:b.find(".mirai-scene-view-products-button")});"MutationObserver"in v&&(new MutationObserver(function(b,d){b.forEach(function(b){"childList"===b.type&&b.target.classList.contains("mirai-scene-image-block-tag-container")&&
1===b.addedNodes.length&&"IMG"===b.addedNodes[0].tagName&&""!==b.addedNodes[0].src&&(b=b.addedNodes[0],"function"!==typeof b.onload&&(b.onload=function(){m.trigger("shoppable-scene-image-loaded",{index:a,shoppableScene:f.shoppableScene})}),d.disconnect())})})).observe(b.find(".mirai-scene-image-block-tag-container")[0],{subtree:!0,childList:!0,attributes:!1});"function"==typeof uet&&uet("cf",d,{wb:1});return b}function K(a,f,b){b=q(a,b);a=e.isShoppableScenesEnabled()&&a.shoppableScene?y(f,a,b):O.find(".mainImageTemplate").clone().removeClass("template mainImageTemplate");
a.addClass("image item itemNo"+f+" maintain-height").attr({"data-csa-c-type":"uxElement","data-csa-c-element-type":"navigational","data-csa-c-action":"image-block-main-image-hover","data-csa-c-posy":f+1});a.find(".placeHolder").replaceWith(b);O.find(".list").append(a);m.loadImageManually(b);m.trigger("dp:image-block:imageBlockImageLoad",f);return a}function M(f){var b=S.css("height");null!==b&&f.find(".imgTagWrapper").css("height",b);f.addClass("selected");a.imgTagWrapperClasses&&f.find(".imgTagWrapper").addClass(a.imgTagWrapperClasses)}
function k(a){if(a.isUserGenerated){var f=p.getPreviousItem(),b=a.variant;e.isDefined(b)&&f.thumbnailIndex!==a.thumbnailIndex&&(N.isEnabled&&F.logAltImgRequestServed(N),l.postCountMetric("ImageThumbnailSelectedVariant:"+b),0===b.indexOf("IG")&&(l.postCountMetric("IGImageSelectedVariant:"+b),l.postCountMetric("IGImageSelectedEvent:"+a.interaction)))}}function c(f,d,c,g){if((2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment)&&!g&&"unavailable"!==f.type){if(f=a.colorImages&&a.colorImages[c],
b(".unrolledImg").each(function(a){b(this).remove()}),e.isDefined(f)&&(b.each(f,function(f,d){if(f<a.maxAlts){var c=b(".unrolledImg");c[f]?b(".unrolledImg #unrolledImgNo"+f+" img").replaceWith('\x3cimg alt\x3d"" src\x3d"'+d.large+'" data-a-hires\x3d"'+d.hiRes+'" data-a-manual-replacement\x3d"true"\x3e'):f>=c.length&&b('\x3cli data-csa-c-action\x3d"image-block-main-image-hover" data-csa-c-element-type\x3d"navigational" data-csa-c-posy\x3d"'+(f+1)+'" data-csa-c-type\x3d"uxElement" class\x3d"image item itemNo'+
f+' unrolledImg imgMedia"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-declarative" data-action\x3d"main-image-click" data-csa-c-type\x3d"widget" data-csa-c-func-deps\x3d"aui-da-main-image-click" data-main-image-click\x3d"{}" data-ux-click\x3d""\x3e \x3cdiv id\x3d"imgTagWrapperId" class\x3d"imgTagWrapper"\x3e \x3cdiv id\x3d"unrolledImgNo'+f+'"\x3e \x3cdiv class\x3d"a-image-container a-dynamic-image-container greyBackground" style\x3d"width:100%; height:600px;"\x3e \x3cimg alt\x3d"" src\x3d"'+
d.large+'" data-a-hires\x3d"'+d.hiRes+'" data-a-manual-replacement\x3d"true"\x3e \x3c/div\x3e \x3c/div\x3e\x3c/div\x3e\x3c/span\x3e \x3c/span\x3e\x3c/li\x3e').appendTo(b(".unrolledScrollBox .list-unrolled"))}}),m.loadHiResImage(document.querySelectorAll(".unrolledImg.imgMedia img")),c=e.isDefined(d)))l.postCountMetric("mainImageUpdateOnTwisterVariationClick"),d()}else if("image"===f.type||"unavailable"===f.type||"lazy-loaded"===f.type){(c=e.isDefined(d))&&l.postCountMetric("mainImageUpdateOnTwisterVariationClick");
g=e.getImageHash(f.color,f.index,a);if(-1===g)return d={data:{index:0,thumbnailIndex:0,variant:"",type:"unavailable"}},e.lazyLoadingRequired(f,p,a)||(n.dispatch("updateModel",d),e.showUnavailable(f.color)),-1;var h=O.find(".item.itemNo"+f.thumbnailIndex);e.isjQueryObjDefined(h)||(h=K(g,f.thumbnailIndex,d),c?(P=r=!1,I(h,f,"swatchClick")):I(h,f,"altImageHover"));M(h);n.dispatch("loadMagnifier");z(f);t(h,g);k(f);m.trigger("dp:image-block:update",g)}}function A(f){var b=Math.max(D(f.color,p.getCurrentItem().variant),
0),b=e.getImageHash(f.color,b,a);if(-1===b)return e.lazyLoadingRequired(f,p,a)||e.showUnavailable(f.color),-1;var d=O.find(".swatchHoverExp"),c=q(b);d.find(".imgTagWrapper").html(c);m.loadImageManually(c);l.postCountMetric("mainImageUpdateOnTwisterVariationHover");M(d);I(d,f,"swatchHover");m.trigger("dp:image-block:update",b)}function R(f,d){e.lazyLoadingRequired(f,p,a)||(b("#imageBlock").css("opacity","1"),O.css("opacity","1"),e.spinner(O,!1),O.find("li").removeClass("selected"),b("#image-canvas-caption #canvasCaption").empty(),
e.hideUnavailable(),d&&O.find(".list .item").remove())}function g(){var f=O.find(".item .imgTagWrapper"),d=e.getContainerHeight(S,a.holderRatio,a.holderMaxHeight);0<d&&(S.height(d),f.height(d));O.find("img.a-dynamic-image").each(function(){var f=b(this);f.data("a-manual-replacement")&&m.loadDynamicImage(this);var d=f.data("a-dynamic-image"),d=e.getMaxDimensionsOfMainImage(d,S,a);f.css({"max-height":d[0]+"px","max-width":d[1]+"px"})})}function w(a){z(p.getCurrentItem(),"mouseenter"===a.type)}var u,
a,p,n,J,B,x,O,S,h={},f,d=null,r=!1,P=!1;m.on("triggerImageAjax",function(f){var b=p.getCurrentItem().color;a.colorImages[b]||(a.colorImages[b]=f);f={type:"updatedData",data:p.getCurrentItem()};n.dispatch("updateView",f);(b=a.colorToAsin[b])&&b.asin&&E.register(e.rankedImagesReadyEvent(b.asin))});return function(r,h,k,m){u=this;a=r;p=h;n=m;a.colorImages[a.landingAsinColor]=a.colorImages[a.defaultColor];u.render=function(g,r,h,k,m,l,C,H){O=2!==a.unrolledImageBlockTreatment&&3!==a.unrolledImageBlockTreatment?
h:b(".unrolledScrollBox");x=k;S=m;f=G(r,g,l);l?0===r&&I(O.find(".item.itemNo0"),p.getCurrentItem(),"landing"):(r=p.getCurrentItem(),e.lazyLoadingRequired(r,p,a)&&n.dispatch("updateModel",{data:{type:"lazy-loaded"}}));R(p.getCurrentItem(),!l);2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment?"swatchClick"===H&&a&&a.colorImages?(d=a.colorImages[g],c(p.getCurrentItem(),C,g,l)):"updatedData"===H&&a&&a.colorImages&&a.colorImages[g]!==d&&(d=a.colorImages[g],c(p.getCurrentItem(),C,g,l)):
c(p.getCurrentItem(),C,g,l);return f};e.isImageBlockGridViewHoverDelayEnabled()?u.update=function(b){var d=b.data;p.setCurrentEvent(b);"ingress"!==d.type&&"swatchHover"!==b.type&&(p.setToPreviousItem(),"mouseenter"===b.type?(B&&clearTimeout(B),B=setTimeout(function(){p.setToCurrentItem(d);R(b.data,!1)},e.getHoveringDelayTimer())):"mouseleave"===b.type?B&&clearTimeout(B):"click"===b.type&&(p.setToCurrentItem(d),R(b.data,!1)));"swatchHover"===b.type?("ingress"!==d.type&&R(b.data,!1),d.color===p.getCurrentItem().color?
c(p.getCurrentItem(),null,d.color,!0):b.captured||-1===A(d)||(b.captured=!0)):"image"===d.type&&(d.interaction=b.type,d.isUserGenerated=!0,"mouseenter"===b.type?(l.postCountMetric("dpcc_imageThumbHovered_"+(d.thumbnailIndex+1)+"_"+f),J&&clearTimeout(J),J=setTimeout(function(){c(d,null,d.color,!0);a.usePeekHover||e.selectGivenThumbnail(b.$declarativeParent,x)},e.getHoveringDelayTimer())):"mouseleave"===b.type?J&&clearTimeout(J):"click"===b.type&&(c(d,null,d.color,!0),e.selectGivenThumbnail(b.$declarativeParent,
x),l.postCountMetric("dpcc_imageThumbClicked_total"),l.postCountMetric("dpcc_imageThumbClicked_"+(d.thumbnailIndex+1)+"_"+f)))}:u.update=function(b){var d=b.data;p.setCurrentEvent(b);"ingress"!==d.type&&R(b.data,!1);"swatchHover"===b.type?d.color===p.getCurrentItem().color?c(p.getCurrentItem(),null,d.color,!0):b.captured||-1===A(d)||(b.captured=!0):"image"===d.type&&(d.interaction=b.type,d.isUserGenerated=!0,"mouseenter"===b.type&&l.postCountMetric("dpcc_imageThumbHovered_"+(d.thumbnailIndex+1)+"_"+
f),c(d,null,d.color,!0),a.usePeekHover&&"click"!==b.type||(e.selectGivenThumbnail(b.$declarativeParent,x),"click"===b.type&&(l.postCountMetric("dpcc_imageThumbClicked_total"),l.postCountMetric("dpcc_imageThumbClicked_"+(d.thumbnailIndex+1)+"_"+f))))};a.overrideAltImageClickAction&&e.addTag("clickEnabledOnAltImages");n.register("imageHover",w);n.register("resize",g)}});E.when("A","jQuery","imageBlockUtils","postMetric").register("ImageBlockShoppableSceneView",function(m,b,e,v){function l(e,k){var c=
b("\x3cimg src\x3d'"+(k?q.staticImages.shoppableSceneDotHighlighted:q.staticImages.shoppableSceneDot)+"' alt\x3d''\x3e");c.css({display:k?"none":"inline-block"});c.addClass("mirai-scene-tag").addClass(k?"active-tag":"inactive-tag");return c}function N(e){var k=b("\x3cspan\x3e");m.each(e.tags,function(c){var e=b("\x3cdiv\x3e").css({position:"absolute",left:100*c.left+"%",top:100*c.top+"%",height:"auto",width:"auto"});e.append(l(c,!1));e.append(l(c,!0));e.bind("mouseenter",function(){F(b(this).find(".mirai-scene-tag[style*\x3d'display: inline-block']"))});
m.declarative.create(e,"scenes-show-details-tags-ib",{tagId:c.link});k.append(e)});return k.children()}function F(b){b.addClass("mirai-scene-dot-pulsate");m.delay(function(){b.removeClass("mirai-scene-dot-pulsate")},4E3)}function L(b,e){b.css({display:"none"});e.css({display:"inline-block"})}function G(b,e,c){b.eq(c).css({display:"inline-block"});e.eq(c).css({display:"none"})}function t(b){E.when("mirai-multi-scene-view").execute("mirai-scene-protected-image-selection",function(){m.trigger("mirai:scene-details-change",
{physicalId:b})})}function z(){var e=b("\x3cspan class\x3d'mirai-scene-view-products-button-content'\x3e"),k=b("\x3cimg class\x3d'item-tag'\x3e").attr("src",q.staticImages.shoppableSceneViewProductsButton).addClass("item-tag"),c=b("\x3cspan class\x3d'mirai-scene-view-products-button-text'\x3e");c.html(q.staticStrings.shoppableSceneViewProductsButton);return e.append(k).append(c)[0].outerHTML}function D(b){function e(){b.$tagPlaceholder.replaceWith(l);var a=l.find(".mirai-scene-tag.active-tag"),c=
l.find(".mirai-scene-tag.inactive-tag");G(a,c,0);F(l.find(".mirai-scene-tag[style*\x3d'display: inline-block']"));K=!0;b.$viewProductsButton.removeClass("aok-hidden");"function"==typeof uex&&uex("ld","desktop-dp-atf-ib-shoppablescenes-tags-"+b.index,{wb:1});u=!0;v.postCountMetric("miraiShoppableScenes_imageLoadedCount")}if(b.shoppableScene){var c=b.$viewProductsButton.find(".a-button-text");if(0===c.children().length){c.append(z());m.declarative.create(b.$viewProductsButton,"scenes-show-details-view-products-ib",
{tagId:b.shoppableScene.tags[0].link});var l=N(b.shoppableScene),t=l.find(".mirai-scene-tag.active-tag"),g=l.find(".mirai-scene-tag.inactive-tag"),w=b.shoppableScene.physicalId,u=!1;m.on("mirai:index:change",function(a){a.scenePhysicalId===w&&(a=a.selectedIndices[0],L(t,g),G(t,g,a),F(l.find(".mirai-scene-tag[style*\x3d'display: inline-block']").eq(a)),K=!0)});m.on("mirai:scene-details-change",function(a){a.physicalId!==w||K||(L(t,g),G(t,g,0),F(l.find(".mirai-scene-tag[style*\x3d'display: inline-block']")),
K=!0)});m.on("mirai:no-products-active",function(a){a.scenePhysicalId===w&&L(t,g)});m.on("mirai:set-first-product-active",function(a){a.scenePhysicalId===w&&(L(t,g),G(t,g,0))});m.on("a:image:load:shoppable-scene:"+b.index,function(){u||(e(),v.postCountMetric("miraiShoppableScenes_imageLoadedViaAuiListenerCount"))});m.on("shoppable-scene-image-loaded",function(a){a.index!=b.index||u||(e(),v.postCountMetric("miraiShoppableScenes_imageLoadedViaMiraiListenerCount"))});E.when("mirai-multi-scene-view").execute("mirai-scene-protected-side-sheet-initialization",
function(){m.trigger("mirai:scene-side-sheet-init",{icons:q.staticImages,strings:q.staticStrings});m.trigger("mirai:scene-details-init",{scene:b.shoppableScene,imageSource:b.imageSource})})}}}var I,q,y,K=!1;return function(b,l,c,m){I=this;q=b;y=m;e.isShoppableScenesEnabled()?(y.register("initialize-shoppable-scene",D),I.render=function(b,c,e,l,a,k,n){},I.update=function(b){"mouseenter"===b.type&&(b.data.shoppableScene?t(b.data.shoppableScene.physicalId):K=!1)}):(b=function(){},I.render=b,I.update=
b)}});E.now().register("ShoppableSceneWeblabProvider",function(){return{isEnabled:!0}});"use strict";E.when("A","jQuery","Airy","postMetric","ImageBlockATF","ImageBlockBTF","logFailedInteractionMetric","postEarlyMetric","ShoppableSceneWeblabProvider").register("imageBlockUtils",function(m,b,e,E,l,N,F,L,G){function t(a){return null!==a&&"undefined"!==typeof a}function z(a){var d=0;b.each(a,function(a,b){var f=parseInt(b[1],10);f>d&&(d=f)});return d}function D(a){var d=0;b.each(a,function(a,b){var f=
parseInt(b[0],10);f>d&&(d=f)});return d}function I(a,b,c){b=b.width();if(c.naturalMainImageSize)return b;a=z(a);0<a&&(b=Math.min(b,a));return b}function q(a,b,c){b=b.height();if(c.naturalMainImageSize)return b;a=D(a);0<a&&(b=Math.min(b,a));return b}function y(a){var d;b.each(a,function(a,b){t(d)||(d=b[1]/b[0])});return d||1}function K(a,d,c,g,h,l,m,q,u,t,x,w,v,B,y){var H=b.extend({},c.foresterMetadataParams);null!==g&&(H.method+="."+g);var Z=[];d.disabledViewIds&&(Z=d.disabledViewIds);y=y&&y.videoBackgroundChromefulMainView?
y.videoBackgroundChromefulMainView:"black";"unrolled-video-add"===B&&(y="transparent");return e.embed({parentElement:a[0],streamingUrls:d.url,contentId:d.mediaObjectId,contentMinAge:Number(d.minimumAge||"")||0,contentTitle:d.title,swfUrl:c.swfUrl,foresterMetadataParams:H,backgroundColor:y,flashParams:{wmode:"transparent"},slateImages:{preloadSlate:d.slateUrl,postMediaSlate:d.slateUrl},videoAds:c.videoAds,bindings:{play:function(){if("ImmersiveView"===g)p||(p=!0,E.postCountMetric("dppc_chromefulVideoPlayedIV"));
else if(n||(n=!0,E.postCountMetric("dppc_chromefulVideoPlayedPV")),!t){var a=E.buildNexusMetric("ib.thumbnailClick",u,d.mediaObjectId,d.groupType,x,w,v);E.emitNexusMetric(a)}}},cuePoints:[{values:d.durationSeconds-1,type:"position",callback:function(a,b,f){h&&(M(0,l,q),k(m))}}],disabledViewIds:Z})}function M(a,b,e){b.fadeTo(500,0,function(){c(a,e);b.fadeTo(500,1)})}function k(a){a&&a.toggle()}function c(a,d){var c=d.find("img");t(c[a])&&b(c[a]).click()}function A(a,b){x[a]=b?b:x[a];return x[a]}function R(a,
d,c){c=c||B;c=c.colorImages;if(1>c.length||!t(c[a])||!t(d))return-1;var e=-1;b.each(c[a],function(a,b){b.variant===d&&(e=a)});return e}function g(a,d,c){c=c||B;c=c.colorImages;return!(t(c)&&t(c[a])&&t(c[a][d])&&t(c[a][d].main))||1>b.map(c[a][d].main,function(a,b){return b}).length?-1:c[a][d]}function w(a,b,c,e){e.parent().css("z-index",2);0!==c&&0!==b&&(b/=c,a>b?e.css("width",b/a*100+"%"):e.css("height",a/b*100+"%"))}function u(a,d){var c;if(c=a.useIV)c=a.colorImages&&a.colorImages[d]&&0<a.colorImages[d].length?
!0:!1;F.isEnabled&&(F.IVApplicaple=c,L.logImmersiveViewApplicability(b,F));return c}function a(){return 0<b(".gridImageBlockViewLayoutIn2x4").length||0<b(".gridImageBlockViewLayoutIn2x5").length||0<b(".gridImageBlockViewLayoutIn1x7").length}var p,n,J,B=b.extend(!0,{},l,N),x={},O=0,S=0,h=/gridAltImageViewLayoutIn(\d+)x(\d+)/g;return{isDefined:t,isDefinedAndEmpty:function(a){return t(a)&&"object"===typeof a&&0===Object.keys(a).length},isUndefinedOrEmpty:function(a){return t(a)?"object"===typeof a&&
0===Object.keys(a).length:!0},isDefinedAndNotEmpty:function(a){return t(a)?"object"===typeof a&&0<Object.keys(a).length:!1},isjQueryObjDefined:function(a){return 0!==a.length},getAspectRatio:y,getMaxHeightOfMainImage:q,getMaxWidthOfMainImage:I,getMaxDimensionsOfMainImage:function(a,b,c){if(c.acEnabled)return[b.height(),b.width()];var e=q(a,b,c);b=I(a,b,c);a=y(a);c=b/a;b=Math.min(b,e*a);e=Math.min(e,c);return[e,b]},getContainerHeight:function(a,b,c){var e=a.get(0);a=0;if(t(e)){a=e.offsetWidth/b;a=
Math.min(a,c);var g;b=B.mainImageHeightPartitions;c=B.mainImageMaxSizes;if(t(c)&&t(b)){for(var h=0,n=v.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,e=0;e<b.length;e++)n>b[e]&&(h=e+1);c.length>=h&&(g=c[h])}t(g)&&(a=Math.min(g[1],a))}return a},getColorFromState:function(a,d){if(a){d=d||B;var c="";b.each(d.visualDimensions,function(b,d){a[d]&&(c+=" "+a[d])});return c&&c.substring(1)}},createThumbnail:function(b,d,c,e){var g=c.find(".template").clone().removeClass("template").addClass("item"),
h=document.createElement("img");h.src=d;g.find(".placeHolder").replaceWith(h);(d=b.heroVideoVariant)&&"hero-image"===b.type&&b.variant===d&&g.addClass("heroImageThumbnail");t(e)&&g.addClass(e);a()&&g&&(e=document.createElement("div"),e.className="imageBlockThumbnailImageGrayOverlay",h.parentNode.insertBefore(e,h));m.declarative.create(g,"thumb-action",b);g.attr&&(g.attr("data-ux-click",""),b.type&&b.type.match(/video/)?(g.attr("data-csa-c-type","uxElement"),g.attr("data-csa-c-element-type","navigational"),
g.attr("data-csa-c-action","image-block-alt-image-clickToImmersiveVideos")):(g.attr("data-csa-c-type","uxElement"),g.attr("data-csa-c-element-type","navigational"),g.attr("data-csa-c-action","image-block-alt-image-hover")),g.attr("data-csa-c-posy",b.thumbnailIndex+1));c.append(g);return g},updateImageThumbnailOverlay:function(a,b,c){a.find(".textMoreImages").append(c.length-b.thumbnailIndex+"+")},selectGivenThumbnail:function(a,b){var c=a.find(".a-button");b.find(".a-button").removeClass("a-button-selected").removeClass("a-button-focus");
c.addClass("a-button-selected").addClass("a-button-focus")},createAiryInstanceForChromeful:function(a,b,c,e,g,h,n,l){K(a,b,c,e,g,h,n,l,0,1,"","","")},createAiryInstanceForChromefulNotUseTabbedImmersiveView:K,loadMediaIntoAiry:function(a,b,c,e){a&&a.getMediaSourceInfo()!==b.url&&(e?a.loadMedia?(J={mediaSourceInfo:[b.url],contentId:b.mediaObjectId,refTag:"vse_ib_tablet_web"},a.loadMedia(J)):a.play({videoUrl:b.url,imageUrl:b.slateUrl,mimeType:"video/mp4",contentId:b.mediaObjectId,refTag:"vse_ib_tablet_web"}):
a.loadMedia?a.loadMedia({mediaSourceInfo:b.url,contentId:b.mediaObjectId,contentMinAge:Number(b.minimumAge||"")||0,contentTitle:b.title,slateImages:{preloadSlate:b.slateUrl,postMediaSlate:b.slateUrl}}):a.setInitialData({videoUrl:b.url,mimeType:"video/mp4",contentId:b.mediaObjectId,imageUrl:b.slateUrl}))},showUnavailable:function(a){a&&(b("#imageBlock .unvailableVariation").html(a),b("#imageBlock .variationUnavailable").show())},hideUnavailable:function(){b("#imageBlock .variationUnavailable").hide()},
fadeToThumbnail:M,toggleVideoCaption:k,selectThumbnail:c,spinner:function(a,c){var e=b("#imageBlock .a-spinner").parent();0===e.length&&(e=b("\x3cdiv\x3e\x3c/div\x3e").append(b("\x3cspan\x3e\x3c/span\x3e").addClass("a-spinner").addClass("a-spinner-medium")),a.append(e),e.css({position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 0)","-webkit-transform":"translate3d(-50%, -50%, 0)","z-index":"3",width:"48px",height:"48px",border:"8px solid #FFFFFF","-webkit-border-radius":"20px",
"-moz-border-radius":"20px","border-radius":"100%"}));c?e.show():e.hide();return e},rankedImagesReadyEvent:function(a){return"ranked-images-ready-for-"+a},ajaxState:A,getIndexForVariant:R,getImageHash:g,lazyLoadingRequired:function(a,b,c){b=Math.max(R(a.color,b.getCurrentItem().variant,c),0);b=-1!==g(a.color,b,c);a=c.colorToAsin[a.color]&&c.colorToAsin[a.color].asin;a=!a||"success"!==A(a);return!c.lazyLoadExperienceDisabled&&!b&&a},lazyLoadOnHoverEnabled:function(a){return!a.lazyLoadExperienceOnHoverDisabled},
updateAspectRatio:w,repositionVideoBanner:function(a,b,c,e){setTimeout(function(){var c=a.width()/a.height();w(c,16,9,b)},e||0)},getVideosCount:function(a,b){return b.useChildVideos&&b.colorToVideo[a]?b.colorToVideo[a].length:b.videos?b.videos.length:0},getVideoHash:function(a,b,c){if(c.useChildVideos){if(!t(c.colorToVideo))return-1;a=c.colorToVideo[a]}else a=c.videos;return t(a)&&t(a[b])&&t(a[b].url)?a[b]:-1},isImmersiveViewEnabled:u,playVideoInImmersiveView:function(a,b){return u(a,b)&&a.useTabbedImmersiveView},
useTabbedImmersiveView:function(a){return a.useTabbedImmersiveView},getMediaSourceInfo:function(){return t(J)?J.mediaSourceInfo[0]:""},getNilgiriServiceAjaxRequest:function(a,b,c){return{requester:"DetailPageTablet",marketplaceID:c.marketPlaceID,clientPrefix:"ImageBlock_tablet",locale:c.languageCode,page:"DetailPageTablet",placement:"ImageBlock",metadata:{shouldPreload:!1},video:{videoURL:c.url,imageURL:c.slateUrl}}},addTag:function(a){v.ue&&v.ue.tag&&v.ue.tag(a)},isShoppableScenesEnabled:function(){return G.isEnabled&&
0<b(".mirai-scene-image-block-template").length},isImageBlockGridViewDisplayEnabled:a,isImageBlockGridViewHoverDelayEnabled:function(){return 0<b(".gridImageBlockViewLayoutIn2x4").length||0<b(".gridImageBlockViewLayoutIn2x5").length},getHoveringDelayTimer:function(){return O},updateThumbnailHoverDelay:function(a){if(t(a)){O=0;var b=a.closest("li"),b=b.parent().children("li").filter(":not(.aok-hidden, .template, .pos-360)").index(b);if(-1!==b){var c;c=S;a=a.closest("ul").attr("class");a===U?c=!1:(a=
h.exec(a),null===a||3!==a.length?c=!1:(a=a[2],c=Math.floor(c/a)>Math.floor(b/a)));c&&(O=100);S=b}}}}});"use strict";E.when("A","jQuery","imageBlockUtils","ImageBlockLoader","postMetric","vse_ns_videoPlayer").register("ImageBlockVideoView",function(m,b,e,ca,l,N){function F(c,d,f,g){!a.autoplayVideo||da||a.useChromelessVideoPlayer?!e.isjQueryObjDefined(c.find(".a-button-selected"))&&(f=p.getCurrentItem(),!g||a.prioritizeVideos||"chromeless-video"===f.type&&a.autoplayVideo)&&(g=e.getVideoHash(f.color,
0,a),-1===g||f.thumbnailIndex>=a.maxAlts-1||(d+=0,n.dispatch("updateModel",{data:{index:0,thumbnailIndex:d,variant:g.variant,type:a.useChromelessVideoPlayer?"chromeless-video":"chromeful-video"}}),d=c.find(".item").get(d),e.selectGivenThumbnail(b(d),c))):(e.selectGivenThumbnail(c.find("img:last"),c),e.fadeToThumbnail(c.find("img").length-1,O,c))}function L(b){var c=p.getCurrentItem().color;if(a.useChildVideos&&!a.colorToVideo[c]){var d=function(){if(b){a.colorToVideo[c]=b;var d={type:"updatedData",
data:p.getCurrentItem()};n.dispatch("updateView",d)}};a.lazyLoadExperienceDisabled?d():E.when(e.rankedImagesReadyEvent(a.colorToAsin[c].asin)).execute(function(){d()})}}function G(b){b&&(a.notShowVideoCount=b,b={type:"updatedData",data:p.getCurrentItem()},n.dispatch("updateView",b))}function t(b){if(!a.useChildVideos)return e.lazyLoadingRequired(p.getCurrentItem(),p,a)?void 0:a.videos;if(a.colorToVideo[b])return a.colorToVideo[b];var c=a.colorToAsin[b];if(c&&c.asin){var d={};d.params={asin:c.asin,
productGroupID:a.productGroupID,useAiryVideoPlayer:!0,useChromelessVideoPlayer:a.useChromelessVideoPlayer,isUDP:a.isUDP};a.isDPXFeatureEnabled||(d.success=function(a){L(a)},ca.load("/gp/product/features/apparel-main-image/videos.html",d));return a.colorToVideo&&a.colorToVideo[b]}}function z(b){h&&null===b&&2!==a.unrolledImageBlockTreatment&&3!==a.unrolledImageBlockTreatment&&(h.hide(),B.parent().css("z-index",-1),x.hide())}function D(b,c,d){c=O.width()/O.height();var g=parseInt(b.videoWidth,10),n=
parseInt(b.videoHeight,10);e.updateAspectRatio(c,g,n,B);if(h&&"unrolled-video-add"!==d)h.show(),e.loadMediaIntoAiry(h,b,f,a.tabletWeb);else if(a.tabletWeb)h=P;else{if("unrolled-video-add"===d){h=P;return}if(null===P||P===U)T=setInterval(function(){h=P;h!==U&&null!==h&&(h.show(),e.loadMediaIntoAiry(h,b,f,a.tabletWeb),I(),k(h),clearInterval(T),T=null)},500);else if(h=P,h!==U&&null!==h){h.show();e.loadMediaIntoAiry(h,b,f,a.tabletWeb);I();k(h);return}}I();k(h)}function I(){if(2!==a.unrolledImageBlockTreatment&&
3!==a.unrolledImageBlockTreatment)if(e.useTabbedImmersiveView(a)){if(1<e.getVideosCount(p.getCurrentItem().color,a)){if(e.isDefined(S)){x.show();return}S=b('\x3ca class\x3d"more-videos"\x3e\x3c/a\x3e').attr("href","#").text(a.staticStrings.watchMoreVideos);x.find("#videoCaption").append(S);m.declarative.create(S,"videoIngressClick",d)}e.playVideoInImmersiveView(a,p.getCurrentItem().color)&&(m.declarative.create(B,"videoIngressClick",d),B.attr&&B.attr("data-ux-click",""),B.children().css("z-index",
"-1"),B.css("display","inline-block"))}else x.find("#videoCaption").text(a.staticStrings.playVideo),x.show()}function q(b,c){if("chromeful-video"===b.type||"chromeless-video"===b.type||"unrolled-video-add"===c){var d=e.getVideoHash(b.color,b.index,a);if(-1===d)return-1;"chromeful-video"===b.type&&D(d,b.thumbnailIndex+1,c)}}function y(c,f,g){if((2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment)&&g)return c;var h=t(f);f=c;var n=b(".unrolledImg"),k=e.isDefined(h)&&0<h.length&&a.alwaysIncludeVideo?
1:0;e.isDefined(h)&&0<h.length&&!a.alwaysIncludeVideo&&c===a.maxAlts&&l.postCountMetric("IBVideoDrop");n.length>a.maxAlts&&n.each(function(c){c>=a.maxAlts&&b(this).remove()});k&&c===a.maxAlts&&(2===a.unrolledImageBlockTreatment||3==a.unrolledImageBlockTreatment?(b(".thumbItemUnrolled").last().remove(),b(".unrolledImg").last().remove()):J.find(".item:last").remove(),c--);e.isDefined(h)&&(b.each(h,function(f,g){if(c<a.maxAlts){if(2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment){var n=
a.useChromelessVideoPlayer?"chromeless-video":"chromeful-video";b('\x3cli class\x3d"thumbItemUnrolled thumbType'+n+" thumbIndex"+f+'"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-button a-button-thumbnail a-button-toggle" id\x3d"a-autoid-'+c+'"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input" type\x3d"submit" aria-labelledby\x3d"a-autoid-'+c+'-announce"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true" id\x3d"a-autoid-'+c+'-announce"\x3e \x3cimg alt\x3d"" src\x3d"'+
g.thumb+'"\x3e \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e \x3c/span\x3e\x3c/li\x3e').appendTo(b("ul.regularAltImageViewLayout"));b('\x3cli data-csa-c-action\x3d"image-block-main-image-hover" data-csa-c-element-type\x3d"navigational" data-csa-c-posy\x3d"'+c+'" data-csa-c-type\x3d"uxElement" class\x3d"image item itemNo'+c+' unrolledImg videoMedia"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-declarative" data-action\x3d"main-image-click" data-csa-c-type\x3d"widget" data-csa-c-func-deps\x3d"aui-da-main-image-click" data-main-image-click\x3d"{}" data-ux-click\x3d"" \x3e \x3cdiv id\x3d"imgTagWrapperId" class\x3d"imgTagWrapper"\x3e\x3cdiv id\x3d"unrolledImgNo'+
c+'" class\x3d"videoIndex'+f+'"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/span\x3e\x3c/span\x3e\x3c/li\x3e').appendTo(b(".unrolledScrollBox .list-unrolled"));a.dp60InLastPositionUnrolledImageBlock||2!==a.dp60VideoPosition||K(b(".regularAltImageViewLayout"),a.dp60VideoPosition)}else{var n=a.useChromelessVideoPlayer?"chromeless-video":"chromeful-video",k={type:n,index:f,thumbnailIndex:c,variant:g.variant};d={type:"video-ingress",index:f,thumbnailIndex:c,variant:g.variant};e.useTabbedImmersiveView(a)&&("chromeful-video"===
n&&(aa+=" videoBlockIngress  videoBlockDarkIngress",g.thumb=g.thumb.replace("_PKmb-play-button-overlay-thumb","")),a.altsOnLeft||(aa+=" a-align-top"));e.isImageBlockGridViewDisplayEnabled()&&(aa+=" videoImageBlockGridView");e.createThumbnail(k,g.thumb,J,aa);2===a.dp60VideoPosition&&K(J,a.dp60VideoPosition);if(e.useTabbedImmersiveView(a)){M(J.find(".videoBlockIngress img"),a.videoIngressATFSlateThumbURL);var k=1<h.length?"multiple-videos":"one-video",m=!0===a.notShowVideoCount?a.staticStrings.multipleVideos:
1<h.length?h.length+" "+a.staticStrings.multipleVideos:a.staticStrings.singleVideo;m&&J.find(".videoBlockIngress").append(J.find("#videoCount_template").clone().text(m).attr("id","videoCount")).addClass(k)}k=l.buildNexusMetric("ib.thumbnailImpression",c+1,g.mediaObjectId,g.groupType,Q,C,W,V);l.emitNexusMetric(k);k=l.buildNexusMetric("ib.thumbnailRender",c+1,g.mediaObjectId,g.groupType,Q,C,W,V);l.emitNexusMetric(k);ea||(ea=!0,l.postCountMetric("chromeless-video"===n?"dppc_chromelessVideoAvailable":
"dppc_chromefulVideoAvailable"))}c++}if(e.useTabbedImmersiveView(a))return!1}),F(J,f,c,g),a.imageBlockRenderingStartTime&&l.postTimeMetric("vse_desktop_ib_video_ingress_enable_duration",m.now()-a.imageBlockRenderingStartTime));return c}function K(c,d){if(0!==d)if(2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment){var e=a.useChromelessVideoPlayer?"chromeless-video":"chromeful-video",f=c.children(".thumbTypeimage"),e=c.children(".thumbType"+e);f&&e&&f[d-1]&&b(f[d-1]).before(e[0]);
e=b(".unrolledScrollBox .list-unrolled");f=e.children(".unrolledImg.imgMedia");e=e.children(".unrolledImg.videoMedia");f&&e&&f[d-1]&&b(f[d-1]).before(e[0]);b(".unrolledScrollBox .list-unrolled").children(".unrolledImg").each(function(a){for(var c=null,d=0;d<this.classList.length;d++)this.classList[d].includes("itemNo")&&(c=d);null!==c&&b(this).removeClass(this.classList[c]).addClass("itemNo"+a);this.querySelectorAll("div")[1].id="unrolledImgNo"+a})}else f=c.children(".imageThumbnail"),e=c.children(".videoBlockIngress"),
f&&e&&f[d-1]&&b(f[d-1]).before(e[0])}function M(a,b){var c=a.attr("src");if(c&&b){a.attr("src",b);var d=new Image;d.onload=function(b){a.attr("src",c)};d.src=c}}function k(b){a.autoplayVideo&&b&&!da&&(e.toggleVideoCaption(x),b.setVolume(0),b.show(),b.play(),da=!0)}function c(c){h&&h.pause();c.data=d;c.clickTimeStamp=c.$event.timeStamp;var e="a"===c.targetTag?"dpcc_videoIngressLink":"dpcc_videoIngressSlate";n.dispatch("imageClick",c);l.postTimeMetric("dpcc_vse_videoingressclick",c.$event.timeStamp);
c=l.buildNexusMetric("ib.thumbnailClick",c.data.thumbnailIndex+1,a.videos[0].mediaObjectId,a.videos[0].groupType,Q,C,W,V);l.emitNexusMetric(c);l.postCountMetric(e);b("#main-video-container .vjs-control-bar").css("display","none");b("#main-video-container .vjs-poster").css("display","inline-block")}function A(a){null!==h&&h!==U&&(h.frame&&h.frame.remove(),h=null,P.frame&&P.frame.remove(),P=null);P=a.player;b("#main-video-container .vse-airy-container.vse-player-container").css("min-width","auto");
P.hide=function(){P.pause();m.$("#main-video-container").find(".vse-player-container").hide()};P.show=function(){m.$("#main-video-container").find(".vse-player-container").show()};P.getMediaSourceInfo=function(){return e.getMediaSourceInfo()}}function R(d,f,g,h,n,k){z(k);B=null!==k?b("#unrolledImgNo"+k.thumbnailIndex):h.find("#main-video-container");x=null!==k?"":B.parent().find("#video-canvas-caption");O=null!==k?b(".unrolledScrollBox"):b("#main-image-container");null===k&&e.isImageBlockGridViewDisplayEnabled()&&
(B.addClass("videoCenter"),h.find("#video-outer-container").addClass("videoWrapperCenter"));Q=v.location.href;d=p.getCurrentItem().color;!0===n?C=a.mediaAsin:(C=a.colorToAsin[d]&&a.colorToAsin[d].asin,C=e.isDefined(C)?C:a.mediaAsin);a.useChromelessVideoPlayer||B.addClass("chromeful-container");null!==k?q(k,"unrolled-video-add"):q(p.getCurrentItem(),"");e.useTabbedImmersiveView(a)&&m.declarative("videoIngressClick",["click"],c);if(-1!==l&&null!==k){d=p.getCurrentItem().color;var l=e.getVideoHash(d,
k.index,a);N.get(m,"#unrolledImgNo"+k.thumbnailIndex,{requester:"MediaBlockSoftlines",marketplaceID:l.marketPlaceID,clientPrefix:"mbSoftlines"+k.thumbnailIndex,locale:l.languageCode,page:"Detail",metadata:{placementcontext:"mb_sl",alwaysSetInitialVideo:!1},placement:"ImageBlock",video:{videoURL:l.url,imageURL:l.slateUrl}},function(){m.$("#unrolledImgNo"+k.thumbnailIndex).find(".vse-player-container").show()},function(){m.$("#imageBlock #altImages ul").find("li.videoThumbnail").hide()})}}function g(a,
b){function c(a){a=Math.floor((J.width()-1)/g);a=d?a-1:a;b.slice(a).hide();b.slice(0,a).show();b.removeClass("overlayRestOfImages");a<b.length&&b.eq(a-1).addClass("overlayRestOfImages")}var d=0!=J.find(".item.videoThumbnail").length,e=b.eq(0).width(),f=b.eq(1).position().left-b.eq(0).position().left-e,g=e+f;c();a.register("resize",c)}function w(a){var b=J.find(".item.imageThumbnail");if(!(1>=b.length)){var c=b.eq(0).find("img").get(0);c!==U&&c.decode().then(function(){g(a,b)})}}var u,a,p,n,J,B,x,
O,S,h,f,d,r,P,C,Q,W,V,X,ba,Y,ea=!1,da=!1,aa="videoThumbnail",T=null;return function(c,g,h,k){u=this;a=c;p=g;n=k;f=a.airyConfig;W=a.contentWeblab&&a.contentWeblab+":"+a.contentWeblabTreatment;a.colorToVideo={};a.colorToVideo[a.landingAsinColor]=a.colorToVideo[a.defaultColor]=a.videos;a.tabletWeb?(X="tablet",V="applicationType.ImageBlock.vse_ib_tablet_web"):m.capabilities.tablet?(X="tablet",m.capabilities.isAmazonApp&&(V="applicationType.ImageBlock.vse_ib_tablet_app")):(X="desktop",V="desktop_web.ImageBlock.vse_ib_iv");
u.render=function(c,d,f,g,h,k){null!==T&&(clearInterval(T),T=null,B.parent().css("z-index",-1),x.hide());var l=[];if(2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment){J=b("ul.regularAltImageViewLayout");r=y(d,c,k);l=[];d=b(".thumbItemUnrolled").filter(function(){return this.classList.contains("thumbTypechromeful-video")||this.classList.contains("thumbTypechromeless-video")});for(var q=0;q<d.length;q++){var u=d[q].classList.contains("thumbTypechromeful-video")?"chromeful-video":
"chromeless-video",t=Number(d[q].classList[2].slice(10)),v=b(".thumbItemUnrolled").index(d[q]);l.push({color:c,thumbnailIndex:v,type:u,varient:"MAIN",index:t})}for(q=0;q<l.length;q++)R(c,f,g,h,k,l[q])}else J=g,r=y(d,c,k),R(c,f,g,h,k,null),c=p.getCurrentItem().color,f=e.getVideoHash(c,0,a),-1!==f&&(c=a.tabletWeb?e.getNilgiriServiceAjaxRequest(a,c,f):{requester:"MediaBlockSoftlines",marketplaceID:f.marketPlaceID,clientPrefix:"mbSoftlines",locale:f.languageCode,page:"Detail",metadata:{placementcontext:"mb_sl",
alwaysSetInitialVideo:!1},placement:"ImageBlock",video:{videoURL:f.url,imageURL:f.slateUrl}},N.get(m,"#main-video-container",c,function(){m.$("#main-video-container").find(".vse-player-container").hide()},function(){m.$("#imageBlock #altImages ul").find("li.videoThumbnail").hide()}));a.collapsibleThumbnails&&w(n);return r};e.isImageBlockGridViewHoverDelayEnabled()?u.update=function(b){null!==T&&(clearInterval(T),T=null,B.parent().css("z-index",-1),x.hide());var c=b.data;"ingress"===c.type||"swatchHover"===
b.type||e.lazyLoadingRequired(c,p,a)||(p.setToPreviousItem(),"mouseenter"===b.type?(Y&&clearTimeout(Y),Y=setTimeout(function(){p.setToCurrentItem(c);z(null)},e.getHoveringDelayTimer())):"mouseleave"===b.type?Y&&clearTimeout(Y):"click"===b.type&&(p.setToCurrentItem(c),z(null)));if("swatchHover"===b.type)"ingress"===c.type||e.lazyLoadingRequired(c,p,a)||z(null),c.color===p.getCurrentItem().color?q(p.getCurrentItem(),""):b.captured||e.lazyLoadingRequired(c,p,a)&&!e.lazyLoadOnHoverEnabled(a)&&q(p.getCurrentItem(),
"");else if("chromeful-video"===c.type||"chromeless-video"===c.type){var f=e.getVideoHash(c.color,c.index,a);"mouseenter"===b.type?(l.postCountMetric("dpcc_videoThumbHovered_"+(c.thumbnailIndex+1)+"_"+r),"chromeless-video"===c.type&&(f=l.buildNexusMetric("ib.thumbnailHover",c.thumbnailIndex+1,f.mediaObjectId,f.groupType,Q,C,W,V),l.emitNexusMetric(f)),ba&&clearTimeout(ba),ba=setTimeout(function(){q(c,"");!a.usePeekHover&&m.$(b.$currentTarget).closest("li").hasClass("videoThumbnail")&&e.selectGivenThumbnail(b.$declarativeParent,
J)},e.getHoveringDelayTimer())):"mouseleave"===b.type?ba&&clearTimeout(ba):"click"===b.type&&(q(c,""),m.$(b.$currentTarget).closest("li").hasClass("videoThumbnail")&&(e.selectGivenThumbnail(b.$declarativeParent,J),f=l.buildNexusMetric("ib.thumbnailClick",c.thumbnailIndex+1,f.mediaObjectId,f.groupType,Q,C,W,V),(!e.useTabbedImmersiveView(a)&&"chromeless-video"===c.type||"tablet"==X)&&l.emitNexusMetric(f),e.useTabbedImmersiveView(a)&&(l.emitNexusMetric(f),l.postCountMetric("dpcc_videoThumbClicked_"+
(c.thumbnailIndex+1)+"_"+r),d.action="videoIngressClick",d.clickTimeStamp=b.$event.timeStamp,d.$event=b.$event,d.$currentTarget=b.$currentTarget,n.dispatch("videoIngressClick",d),l.postTimeMetric("dpcc_vse_videoingressclick",b.$event.timeStamp))))}}:u.update=function(b){null!==T&&(clearInterval(T),T=null,B.parent().css("z-index",-1),x.hide());var c=b.data;"ingress"===c.type||e.lazyLoadingRequired(c,p,a)||z(null);if("swatchHover"===b.type)c.color===p.getCurrentItem().color?q(p.getCurrentItem(),""):
b.captured||e.lazyLoadingRequired(c,p,a)&&!e.lazyLoadOnHoverEnabled(a)&&q(p.getCurrentItem(),"");else if("chromeful-video"===c.type||"chromeless-video"===c.type){var f=e.getVideoHash(c.color,c.index,a);if("mouseenter"===b.type&&(l.postCountMetric("dpcc_videoThumbHovered_"+(c.thumbnailIndex+1)+"_"+r),"chromeless-video"===c.type)){var g=l.buildNexusMetric("ib.thumbnailHover",c.thumbnailIndex+1,f.mediaObjectId,f.groupType,Q,C,W,V);l.emitNexusMetric(g)}q(c,"");a.usePeekHover&&"click"!==b.type||!m.$(b.$currentTarget).closest("li").hasClass("videoThumbnail")||
(e.selectGivenThumbnail(b.$declarativeParent,J),"click"===b.type&&(f=l.buildNexusMetric("ib.thumbnailClick",c.thumbnailIndex+1,f.mediaObjectId,f.groupType,Q,C,W,V),(!e.useTabbedImmersiveView(a)&&"chromeless-video"===c.type||"tablet"==X)&&l.emitNexusMetric(f),e.useTabbedImmersiveView(a)&&(l.emitNexusMetric(f),l.postCountMetric("dpcc_videoThumbClicked_"+(c.thumbnailIndex+1)+"_"+r),d.action="videoIngressClick",d.clickTimeStamp=b.$event.timeStamp,d.$event=b.$event,d.$currentTarget=b.$currentTarget,n.dispatch("videoIngressClick",
d),l.postTimeMetric("dpcc_vse_videoingressclick",b.$event.timeStamp))))}};a.isDPXFeatureEnabled&&(m.on("triggerVideoAjax",L),m.on("notShowVideoCountAjax",G));m.on("vsePlayer-imageblock_tablet",A);m.on("vsePlayer-mbsoftlines",A)}});"use strict";E.when("ImageBlockBTF","postMetric").register("ImageBlockInitViews",function(m,b){function e(b,e,F,L,G){function t(a){"click"===a.type&&L.postCountMetric("thumbClick");"click"===a.type&&w.overrideAltImageClickAction?u.dispatch("thumbActionClick",a):u.dispatch("updateSelection",
a)}function z(a){w.useClickZoom||u.dispatch("imageClick",a)}function D(a){w.useClickZoom||u.dispatch("imageHover",a)}function I(a){u.dispatch("button360Click",a)}function q(c){!F.isDefined(c)||"swatchClick"!==c.type&&"updatedData"!==c.type?(g.update(c),"swatchHover"!==c.type&&a.getPreviousItem().thumbnailIndex!==c.data.thumbnailIndex&&L.postCountMetric(c.data.type+"ThumbnailSelected"),b.trigger("image-block-thumbnail-selected",c.data)):(g.render(c.data.color,!1,c.onload,c.type),c={hasComponents:!0,
components:[{name:"mainimage"},{name:"thumbnail"}]},"function"===typeof v.markFeatureRender&&v.markFeatureRender("imageblock",c))}function y(a){u.dispatch("resize",a)}function K(a){F.selectThumbnail(a,p)}function M(){"function"===typeof v.markFeatureInteractive&&v.markFeatureInteractive("imageblock",{hasComponents:!0,components:[{name:"mainimage",events:["click"],alwaysInteractive:!0}]})}function k(){w.interactiveCallJSPEnabled||("function"===typeof v.markFeatureInteractive&&v.markFeatureInteractive("imageblock",
{hasComponents:!0,components:[{name:"mainimage",events:["hover"],alwaysInteractive:!0},{name:"thumbnail",events:["click","hover"],alwaysInteractive:!0}]}),1===m.useIV?E.when("a-modal").execute(function(){M()}):M());w.disableHoverOnAltImages||b.declarative("thumb-action",["mouseenter","mouseleave"],t);b.declarative("thumb-action",["click"],t);b.declarative("main-image-click",["click"],z);b.declarative("main-image-click",["mouseenter","mouseleave"],D);b.declarative("button-360-click",["click"],I);b.on("resize",
y)}function c(a){var b=a.data,c;b&&"ingress"!==b.type&&"click"===a.type&&(c=a);return c}function A(b){var c=a.getCurrentItem(),e={type:"click"};e.$declarativeParent=b;e.data=c;return e}function R(a){F.isImageBlockGridViewHoverDelayEnabled()&&"mouseenter"===a.type&&F.updateThumbnailHoverDelay(a.$target)}var g,w,u,a,p;return function(b,l,m){g=this;w=b;u=l;a=m;p=e("#imageBlock #altImages ul");var t=e("#imageBlock .canvas"),y=e("#main-image-container"),z;g.subViews=[];for(l=0;l<G.length;l++)g.subViews.push(new G[l](b,
m,g,u));g.render=function(b,c,d,k){var l=0;p.find(".item").remove();b=b||a.getCurrentItem().color;e.each(g.subViews,function(a,e){l=(2===w.unrolledImageBlockTreatment||3===w.unrolledImageBlockTreatment?e.render(b,l,t,p,y,c,d,k):e.render(b,l,t,p,y,c,d))||l});var m=p.find(".a-button-selected").closest(".a-declarative");z=A(m)};g.init=function(){p=e("#imageBlock #altImages ul");var a=p.find(".a-button-selected").closest(".a-declarative"),b=a.data("action"),a=a.data(b)||{};a.color=w.landingAsinColor||
w.defaultColor;u.dispatch("updateModel",{data:a});g.render(a.color,!0);w.isDebug&&v.console&&console.log(w);u.register("updateView",q);u.register("selectThumbnail",K);k()};g.update=function(a){R(a);e.each(g.subViews,function(b,c){c.update(a)});w.usePeekHover&&("mouseleave"===a.type?u.dispatch("updateSelection",z):"click"===a.type&&(z=c(a)||z))}}}var U=["A","jQuery","imageBlockUtils","postMetric"].concat(m.views);E.when.apply(E,U).register("ImageBlockView",function(){for(var b=arguments[0],m=arguments[1],
v=arguments[2],E=arguments[3],G=[],t=4,z=arguments.length;t<z;t++)G.push(arguments[t]);return e(b,m,v,E,G)})})});
/* ******** */
(function(B){var q=window.AmazonUIPageJS||window.P,sa=q._namespace||q.attributeErrors,c=sa?sa("DetailPageImageBlockSubAssets@immersiveViews","DetailPageImageBlockSubAssets"):q;c.guardFatal?c.guardFatal(B)(c,window):c.execute(function(){B(c,window)})})(function(B,q,sa){B.when("A","jQuery").register("ImageBlockImmersiveViewDimensionIngress",function(c,b){var a;return function(b,c,fa,n){a=this;a.render=function(){};a.update=function(){}}});"use strict";B.when("A","jQuery","imageBlockUtils","postMetric",
"imageBlockImmersiveViewUtils").register("ImageBlockImmersiveViewImages",function(c,b,a,C,e){function fa(){e.populateTitle(f.find("#ivTitle"),160,I)}function n(){var b=p.getCurrentItem().color;D=I.colorImages[b];z=I.heroImage[b];w=E=0;a.isDefined(z)&&(w=z.length);a.isDefined(D)&&(E=D.length)}function t(a){return a.hiRes||a.large||a.main[a.main.length-1]}function q(){var a=f.find("#ivStage").find("#ivLargeImage"),b=a.width(),c=a.height(),e=a.find(".fullscreen");e.removeAttr("style");var p=e.width(),
l=e.height();0<e.length&&(e[0].naturalWidth&&(p=e[0].naturalWidth),e[0].naturalHeight&&(l=e[0].naturalHeight));a.css("cursor","auto");var p=0===p?1:p,l=0===l?1:l,n=Math.min(b/p,c/l),w=l*n,z=p*n;1>n?(y?a.css("cursor","url('"+I.staticImages.zoomIn+"'), auto"):(a.css("cursor","-webkit-zoom-in"),a.css("cursor","-moz-zoom-in"),a.css("cursor","zoom-in")),k=!0):k=!1;p=Math.min(z,p);l=Math.min(w-20,l);e.css({"margin-top":(c-l)/2,"margin-left":(b-p)/2,height:l,width:p});a.css("visibility","visible");J=!1}
function B(a){var b=f.find("#ivLargeImage");b.css("visibility","hidden");b.empty();e.animateStageIn(b);b.append(a);q()}function R(p){f.find("#ivLargeImage").css("display","none");f.find("#ivLargeImage").css("display","block");var k;"hero-image"===p?a.isDefined(z)&&(k=t(z[x.index])):a.isDefined(D)&&(k=t(D[x.index]));if(a.isDefined(k)){f.find(".fullscreen").remove();var l=b("\x3cimg\x3e").attr("src",k).addClass("fullscreen"),n=f.find("#ivLargeImage");e.animateStageOut(n,function(){l.load(function(){B(l);
c.trigger("dp:image-block:imageBlockImmersiveImageLoad",x.index)});if(l[0].complete)B(l),c.trigger("dp:image-block:imageBlockImmersiveImageLoad",x.index);else{n.empty();var a=(n.height()-104)/2,f=(n.width()-80)/2;b("\x3cimg\x3e").attr("src",I.staticImages.spinner).css({position:"relative",top:a+"px",left:f+"px"}).appendTo(n)}})}}function S(a){f.find(".ivThumb").removeClass("selected");a.addClass("selected");a.hasClass("ivHeroImage")?x.type="hero-image":x.type="image";x.index=a.attr("id").split("_")[1];
R(x.type);C.postCountMetric("dpcc_iv_thumbCLick_"+(parseInt(x.index,10)+1)+"_"+(w+E))}function L(){f.delegate(".ivThumb","click",function(){var a=b(this);S(a)})}function M(a,b){return 0<b?b/2:Math.min(0,Math.max(b,a))}function T(a){var b=U.top-(a.pageY-u[1])*l;a=M(U.left-(a.pageX-u[0])*l,G.left);b=M(b,G.top);f.find(".fullscreen").css({left:a,top:b})}function Y(){f.delegate("#ivLargeImage","click",function(a){if(J)q();else if(k){f.find(".fullscreen").removeAttr("style");if(k){var b=f.find("#ivLargeImage"),
e=b.find(".fullscreen");y?b.css("cursor","url('"+I.staticImages.zoomOut+"'), auto"):(b.css("cursor","-webkit-zoom-out"),b.css("cursor","-moz-zoom-out"),b.css("cursor","zoom-out"));J=!0;var p=f.find("#ivLargeImage");G.left=p.width()-e.width();G.top=p.height()-e.height();var p=b.height()/2,c=b.width()/2;u=[b.offset().left+c,b.offset().top+p];U.top=p-e.height()/2;U.left=c-e.width()/2;e.css({position:"relative",left:U.left,top:U.top});l=Math.max(e.height()/b.height(),e.width()/b.width())}T(a);C.postCountMetric("dpcc_iv_largeImageCLick")}});
f.delegate("#ivLargeImage","mousemove",function(a){J&&T(a)})}function ca(){f.find("#ivLargeImage").empty()}function X(c){if(V){f=b("#ivMain");n();x=p.getCurrentItem();fa();e.populateVariationSelection(f.find("#ivVariationSelection"));c=f.find("#ivThumbs");c.find(".ivRow").not(".placeholder").remove();for(var k=w+E,l=0,t=0;l<k;)for(var u=c.find(".ivRow.placeholder").clone().removeClass("placeholder").appendTo(c),C=0;4>C&&l<k;C++,l++,t++)if(t<w){var q=z[l].thumb,y=c.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("ivHeroImage").attr({id:"ivHeroImage_"+
l,"data-csa-c-type":"item","data-csa-c-component":"imageBlock","data-csa-c-content-id":"image-block-immersive-view-hero-image","data-csa-c-posy":l+1}).appendTo(u);y.find(".ivThumbImage").css("background",'url("'+e.getResizedThumbnailURL(q)+'") center no-repeat')}else t>=w&&t<E+w&&(q=D[l-w].thumb,y=c.find(".ivThumb.placeholder").clone().removeClass("placeholder").attr({id:"ivImage_"+(l-w),"data-csa-c-type":"item","data-csa-c-component":"imageBlock","data-csa-c-content-id":"image-block-immersive-view-alt-image",
"data-csa-c-posy":l-w+1}).appendTo(u),y.find(".ivThumbImage").css("background",'url("'+e.getResizedThumbnailURL(q)+'") center no-repeat'));N();V=!1}else fa();c=b("#ivImagesTab").height();f.css("height",c);k=f.find("#ivTitle").outerHeight(!0);l=f.find("#ivVariationSelection").outerHeight(!0);t=f.find("#ivThumbs");u=e.getDimension(t,"margin-top")+e.getDimension(t,"margin-bottom");t.css("height",c-k-l-u);f.find("#ivLargeImage").css("height",c);c=f.find("#ivStage");k=f[0]&&f[0].getBoundingClientRect&&
Math.floor(f[0].getBoundingClientRect().width)||f.width();c.css("width",k-e.getDimension(f,"padding-left")-e.getDimension(f,"padding-right")-f.find("#ivThumbColumn").width()-e.getDimension(c,"margin-left")-e.getDimension(c,"margin-right"));x=p.getCurrentItem();c="hero-image"===x.type?f.find("#ivHeroImage_"+x.index):"image"===x.type?f.find("#ivImage_"+x.index):a.isDefined(z)?f.find("#ivHeroImage_"+x.index):f.find("#ivImage_"+x.index);a.isjQueryObjDefined(c)||(c=f.find("#ivImage_0"));S(c)}var da,I,
p,f,z,D,w,E,x,y=navigator.userAgent.match(/msie|trident/i),V=!0,J=!1,k=!1,G={},U={},l,u,V=!0,N=c.once(function(){L();Y();e.attachImmersiveViewResizeHandler(X);e.attachTabDeselectHandler("ivImagesTab",ca)});return function(a,c,f,k){da=this;I=a;p=c;da.render=function(a,c,f,k,p,l){V=!0;n();0===w+E?e.hideTabHeading("ivImagesTabHeading"):e.unhideTabHeading("ivImagesTabHeading");1===w+E?b("#ivThumbs").hide():b("#ivThumbs").show()};da.update=function(a){};e.attachTabSelectHandler("ivImagesTab",X)}});"use strict";
B.when("A","jQuery","imageBlockUtils","postMetric","logFailedInteractionMetric","postEarlyMetric","imageBlockImmersiveViewUtils").register("ImageBlockTabbedImmersiveView",function(c,b,a,C,e,fa,n){function t(){var a=L.getImmersiveViewModalInstance().$container.find(".a-popover-wrapper"),e=a.find(".a-popover-inner"),a=a.height()-n.getDimension(e,"padding-top")-n.getDimension(e,"padding-bottom");b("#iv-tab-view-container").css("height",a);Y=b("#iv-tab-view-container ul.iv-tab-views li").filter(function(){return"none"!==
b(this).css("display")}).length;1<Y?(b("#iv-tab-view-container ul.iv-tab-views li").parent().show(),e=b("#iv-tab-view-container ul.iv-tab-views li").parent().height(),a-=e):b("#iv-tab-view-container ul.iv-tab-views li").parent().hide();b("#iv-tab-view-container .iv-tab-content").css("height",a);c.trigger("dp:image-block:immersive-view:resize")}function ka(){c.trigger("dp:image-block:immersive-view:reset")}function ba(p){if(a.isImmersiveViewEnabled(S,L.getCurrentItem().color))if(X){var f=p.$event.originalEvent;
f.acknowledge&&f.acknowledge(p.$currentTarget[0]);e.isEnabled&&fa.logImmersiveViewRequestServed(e);C.postCountMetric("dppc_immersiveViewOpened");a.isDefined(p)&&("button-360-click"===p.action?b("#iv360TabHeading").click():"videoIngressClick"===p.action?(ca=p.clickTimeStamp,b("#ivVideosTabHeading").click()):"showroomIngressClick"===p.action?(ca=p.clickTimeStamp,b("#ivShowroomTabHeading").click()):b("#ivImagesTabHeading").click());f=L.getImmersiveViewModalInstance();if(a.isDefined(f))f.show();else{p=
b("#auiImmersiveViewDiv");var f=Math.min(Math.max(b(q).height()-150,540),1080),n=Math.min(Math.max(b(q).width()-75,990),1980),f=X.create(p,{name:"immersiveView",activate:"onclick",width:n,height:f,popoverLabel:"ImmersiveView",hideHeader:!0});L.setImmersiveViewModalInstance(f);p.click()}T&&(T=!1,da(),c.trigger("dp:image-block:immersive-view:init"))}else q.performance&&performance.now&&q.ue&&ue.count&&ue.count("DPIBClickFailedInteractionCount",(ue.count("DPIBClickFailedInteractionCount")||0)+1);else C.postCountMetric("immersiveViewNotExistsClickCount")}
var R,S,L,M,T=!0,Y=0,ca,X;B.when("a-modal").execute(function(a){X=a});var da=c.once(function(){c.on("a:popover:afterUpdatePosition:immersiveView",t);c.on("a:popover:afterShow:immersiveView",t);c.on("a:popover:afterHide:immersiveView",ka)}),I=c.once(function(){var a=b("#iv-tab-view-container ul.iv-tab-views li");a.bind("click",function(e){var n=a.filter(".iv-active");n.attr("id")!==b(this).attr("id")&&c.trigger("dp:ivTabs:"+n.find("a").attr("data-iv-tab-view")+":deselect",e);a.removeClass("iv-active");
b(this).addClass("iv-active");b("#iv-tab-view-container .iv-tab-content").hide();n=b(this).find("a").attr("data-iv-tab-view");b("#"+n).show();"ivVideosTab"===n&&(e.clickTimeStamp=ca||e.timeStamp);c.trigger("dp:ivTabs:"+n+":select",e);C.postCountMetric("dppc_"+n);return!1})});return function(b,f,n,t){R=this;S=b;L=f;e.refToModel=L;M=t;R.render=function(a,b,c,e,f,n){C.postCountMetric("dpcc_altThumbs_"+b);T=!0};R.update=function(a){};R.getTitle=function(){};R.getVariationSelectionInfo=function(){};I();
a.isImmersiveViewEnabled(S,L.getCurrentItem().color)||a.addTag("immersiveViewNotAvailable");M.register("imageClick",ba);M.register("button360Click",ba);S.collapsibleThumbnails&&c.declarative("thumb-action",["click"],function(a){a.$declarativeParent.hasClass("overlayRestOfImages")&&ba(a)});a.useTabbedImmersiveView(S)&&(M.register("videoIngressClick",ba),M.register("showroomIngressClick",ba))}});"use strict";B.when("A","jQuery","imageBlockUtils","ImageBlockLoader","postMetric","logFailedInteractionMetric",
"postEarlyMetric","imageBlockImmersiveViewUtils").register("ImageBlockImmersiveView",function(c,b,a,C,e,fa,n,t){function ka(d){return d.hiRes||d.large||d.main[d.main.length-1]}function ba(){g.find("#ivTitle").click(function(){ia.hide()})}function R(){r=Pa?{type:"360-spin"}:O.getCurrentItem()}function S(){var d=g.find("#ivStage"),a=ia.$container.find(".a-popover-wrapper"),b=a.find(".a-popover-inner"),a=a.height()-t.getDimension(b,"padding-top")-t.getDimension(b,"padding-bottom");g.css("height",a);
var b=g.find("#ivTitle").outerHeight(!0),h=g.find("#ivVariationSelection").outerHeight(!0),c=g.find("#ivMediaSelection").outerHeight(!0),e=g.find("#ivThumbs"),k=t.getDimension(e,"margin-top")+t.getDimension(e,"margin-bottom");e.css("height",a-b-h-c-k);g.find("#ivLargeImage").css("height",a);d.css("width",g.width()-t.getDimension(g,"padding-left")-t.getDimension(g,"padding-right")-g.find("#ivThumbColumn").width()-t.getDimension(d,"margin-left")-t.getDimension(d,"margin-right"))}function L(){g.find("#ivMediaSelect").change(function(){var d=
b(this).val();"all"===d?(g.find("#ivVideoList").hide(),g.find("#ivThumbs").show(),g.find(".ivThumbVideo").show(),"chromeful-video"===r.type&&g.find("#ivVideo_"+r.index).click()):"images"===d?(g.find("#ivVideoList").hide(),g.find("#ivThumbs").show(),g.find(".ivThumbVideo").hide(),"chromeful-video"===r.type&&(0===W&&0===H?g.find("#iv360").click():0===W?g.find("#ivHeroImage_0").click():g.find("#ivImage_0").click())):"videos"===d&&(g.find("#ivVideoList").show(),g.find("#ivThumbs").hide(),"chromeful-video"!==
r.type?g.find("#ivVideoList_0").click():g.find("#ivVideoList_"+r.index).click())})}function M(){var d=g.find("#ivStage").find("#ivLargeImage"),a=d.width(),b=d.height(),h=d.find(".fullscreen");h.removeAttr("style");var c=h.width(),e=h.height();0<h.length&&(h[0].naturalWidth&&(c=h[0].naturalWidth),h[0].naturalHeight&&(e=h[0].naturalHeight));d.css("cursor","auto");var c=0===c?1:c,e=0===e?1:e,k=Math.min(a/c,b/e),l=e*k,f=c*k;1>k?(Qa?d.css("cursor","url('"+m.staticImages.zoomIn+"'), auto"):(d.css("cursor",
"-webkit-zoom-in"),d.css("cursor","-moz-zoom-in"),d.css("cursor","zoom-in")),Aa=!0):Aa=!1;c=Math.min(f,c);e=Math.min(l-20,e);h.css({"margin-top":(b-e)/2,"margin-left":(a-c)/2,height:e,width:c});d.css("visibility","visible");Ba=!1}function T(d){var a=g.find("#ivLargeImage");a.css("visibility","hidden");a.empty();t.animateStageIn(a);a.append(d);M()}function Y(){A&&A.pause();g.find("#ivLarge360").css("display","none");g.find("#ivLargeVideo").css("display","none");g.find("#ivLargeImage").css("display",
"none");z()}function ca(d){Y();g.find("#ivLargeImage").css("display","block");var h;"hero-image"===d?a.isDefined(ga)&&(h=ka(ga[r.index])):a.isDefined(ja)&&(h=ka(ja[r.index]));if(a.isDefined(h)){g.find(".fullscreen").remove();var c=b("\x3cimg\x3e").attr("src",h).addClass("fullscreen"),e=g.find("#ivLargeImage");t.animateStageOut(e,function(){c.load(function(){T(c)});if(c[0].complete)T(c);else{e.empty();var d=(e.height()-104)/2,a=(e.width()-80)/2;b("\x3cimg\x3e").attr("src",m.staticImages.spinner).css({position:"relative",
top:d+"px",left:a+"px"}).appendTo(e)}})}}function X(){var d=parseInt(r.index,10)+1;d>=ea.length||g.find("#ivVideo_"+d).click()}function da(){var d;a.isDefined(ea)&&(d=ea[r.index]);if(a.isDefined(d)){Y();var h=g.find("#ivLargeVideo").css("display","block");A?(A.isDetached()&&A.attach(h[0]),a.loadMediaIntoAiry(A,d,xa,m.tabletWeb),A.show()):(A=a.createAiryInstanceForChromeful(h,d,xa,"ImmersiveView"),xa.enableContinuousPlay&&A.bind("ended",X));A.play({isAsync:!0})}}function I(){R();var d;d="hero-image"===
r.type?g.find("#ivHeroImage_"+r.index):"image"===r.type?g.find("#ivImage_"+r.index):"chromeful-video"===r.type||"chromeless-video"===r.type?g.find("#ivVideo_"+r.index):"360-spin"===r.type?g.find("#iv360"):a.isDefined(ga)?g.find("#ivHeroImage_"+r.index):g.find("#ivImage_"+r.index);a.isjQueryObjDefined(d)||(d=g.find("#ivImage_0"));p(d)}function p(d){g.find(".ivThumb").removeClass("selected");d.addClass("selected");d.hasClass("ivThumbVideo")?(r.type="chromeful-video",r.index=d.attr("id").split("_")[1],
da()):d.hasClass("ivHeroImage")?(r.type="hero-image",r.index=d.attr("id").split("_")[1],ca(r.type)):d.hasClass("iv360Image")?(r.type="360-spin",r.index=0,f()):(r.type="image",r.index=d.attr("id").split("_")[1],ca(r.type))}function f(){Y();g.find("#ivLarge360").css("display","block");y();var d=g.find("#ivLarge360");d.css({opacity:0});setTimeout(function(){d.css({opacity:.4});t.animateStageIn(d)},200);w();e.postCountMetric("dppc_click360");ta=Date.now()}function z(){0<ta&&(D("dppc_duration360",Date.now()-
ta),ta=0)}function D(d,a){q.ue&&q.ue.count(d,a)}function w(){if(0<qa){var d=g.find(".iv360Hint");d.removeClass("iv360HintFaded");d.animate({opacity:1},200)}}function E(d,a){if(qa<d.length){var h=b("\x3cimg /\x3e").css({display:"block",width:6*pa+"px",height:ua+"px"});h.hide();a.append(h);h.get(0).onload=function(){a.closest(document.documentElement).length&&(qa++,1===qa&&(w(),0<ta&&D("dppc_loadTime360",Date.now()-ta)),0<Ha&&D("dppc_perSpriteloadTime360",Date.now()-Ha),g.find("#iv360Spinner").hide(),
h.show(),ya=5*F.imageLocations[Math.floor(za/F.imageLocations[0].length)][za%F.imageLocations[0].length],E(d,a))};h.attr("src",d[qa].replace(/(\._SP)\d+(,)\d+/,"$1"+va+"$2"+wa));Ha=Date.now()}}function x(d){if(a.isDefined(F.spriteWidthSizes)&&0<F.spriteWidthSizes.length){var h=F.spriteWidthSizes,b=h.length,e=h[0],c=h[b-1];if(d<=e)return e;if(d>c)return c;for(e=0;e<b;e++)if(d>h[e]&&d<=h[e+1])return h[e+1]}else return d}function y(){var d=g.find("#ivLarge360");d.children("#image-360-sprites").length||
(d.append("\x3cdiv id\x3d'image-360-sprites'\x3e\x3c/div\x3e"),d.css({"margin-left":0,"margin-top":0,width:d.parent().width(),height:d.parent().height(),overflow:"hidden",position:"relative","-ms-user-select":"none","-webkit-user-select":"none","-mos-user-select":"none"}),b("\x3cimg\x3e").attr("src",m.staticImages.spinnerNoLabel).attr("id","iv360Spinner").css({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"block"}).appendTo(d),Ia=!0,V())}function V(){if(a.isDefined(F.spriteURLs)&&
a.isDefined(g)&&Ia&&!Ja){var d=g.find("#ivLarge360"),h=b("\x3cdiv\x3e").addClass("iv360Hint").css({position:"absolute",width:"100%",bottom:0,opacity:0,display:"block"});a.isDefined(F.staticImages.hint360)&&b("\x3cimg\x3e").css({"margin-left":"auto","margin-right":"auto",display:"block"}).attr("src",F.staticImages.hint360).appendTo(h);b("\x3cdiv\x3e").css({"text-align":"center"}).text(m.staticStrings.dragToSpin).appendTo(h);h.appendTo(d);var h=F.imageWidth,e=F.imageHeight,c=d.parent().width(),f=d.parent().height(),
r=0,n=0;h/e>c/f?(va=x(c),wa=Math.round(e/h*va),pa=Math.ceil(c),ua=Math.ceil(wa/va*c),n=(f-ua)/2):(wa=x(f),va=Math.round(h/e*wa),ua=Math.ceil(f),pa=Math.ceil(va/wa*f),r=(c-pa)/2);d.css({"margin-left":r,"margin-top":n,width:pa+"px",height:ua+"px",overflow:"hidden",position:"relative"});d.children("#image-360-sprites").css("width",6*pa+"px");E(F.spriteURLs,g.find("#image-360-sprites"),0);h=g.find("#ivLarge360");h.bind("mousedown",U);h.bind("touchstart",J);h.bind("touchmove",k);h.bind("touchend",G);b(document).bind("mousemove",
l);b(document).bind("mouseup",u);a.isDefined(m.staticImages.grab)&&d.css("cursor","url('"+m.staticImages.grab+"'), auto");Ja=!0}}function J(d){Ca=!0;Ka=d.originalEvent.targetTouches[0].clientX}function k(d){Ca&&(N(d.originalEvent.targetTouches[0].clientX-Ka),Ka=d.originalEvent.targetTouches[0].clientX)}function G(d){Ca&&(Ca=!1)}function U(d){Da=!0;La=d.originalEvent.clientX;a.isDefined(m.staticImages.grabbing)&&(d=g.find("#ivLarge360"),d.css("cursor","url('"+m.staticImages.grabbing+"'), auto"),d.parents(".a-declarative").last().css("cursor",
"url('"+m.staticImages.grabbing+"'), auto"));return!1}function l(d){Da&&(N(d.originalEvent.clientX-La),La=d.originalEvent.clientX)}function u(d){Da&&(Da=!1,a.isDefined(m.staticImages.grab)&&(d=g.find("#ivLarge360"),d.css("cursor","url('"+m.staticImages.grab+"'), auto"),d.parents(".a-declarative").last().css("cursor","auto")))}function N(d){for(d=ya-=d/pa*180;0>d;)d+=360;for(;360<d;)d-=360;ya=d;var h;d=360;for(var b=0;b<qa;b++)for(var e=0;e<F.imageLocations[b].length;e++){var c=Math.abs(ya-5*F.imageLocations[b][e]);
c<d&&(d=c,h=b*F.imageLocations[0].length+e)}h!==za&&(d=Math.floor(h/F.imageLocations[0].length),d!==Math.floor(za/F.imageLocations[0].length)&&(a.isDefined(Ma)||(Ma=document.createElement("canvas").getContext("2d")),b=g.find("#image-360-sprites").children(),Ma.drawImage(b[d],0,0)),d=g.find(".iv360Hint").not(".iv360HintFaded"),a.isDefined(d)&&(d.addClass("iv360HintFaded"),d.animate({opacity:0},750)));za=h;d=h%F.imageLocations[0].length*-1*pa;h=-1*Math.floor(h/F.imageLocations[0].length)*ua;b=g.find("#ivLarge360").children("#image-360-sprites");
b.css("-webkit-transform","translate3d("+d+"px, "+h+"px, 0)");b.css("transform","translate3d("+d+"px, "+h+"px, 0)")}function K(){g.delegate(".ivThumb","click",function(){var d=b(this);p(d)});g.delegate(".ivThumbVideoListOuter","click",function(){g.find(".ivThumbVideoListOuter").removeClass("selected");var d=b(this);d.addClass("selected");r.type="chromeful-video";r.index=d.attr("id").split("_")[1];da()})}function Z(){A&&!A.isDetached()&&(xa.volume=A.getVolume(),A.detach(),!document.all||q.atob||document.addEventListener||
(A=null));g.find("#ivLargeImage").empty();z()}function P(d,a){return 0<a?a/2:Math.min(0,Math.max(a,d))}function ha(a){var h=ra.left-(a.pageX-Ea[0])*Fa;c.capabilities.rtl&&(h=ra.left-(b(q).width()-a.pageX-Ea[0])*Fa);a=ra.top-(a.pageY-Ea[1])*Fa;h=P(h,Ga.left);a=P(a,Ga.top);g.find(".fullscreen").css({left:h,top:a})}function na(){g.delegate("#ivLargeImage","click",function(a){if(Ba)M();else if(Aa){g.find(".fullscreen").removeAttr("style");if(Aa){var h=g.find("#ivLargeImage"),b=h.find(".fullscreen");Qa?
h.css("cursor","url('"+m.staticImages.zoomOut+"'), auto"):(h.css("cursor","-webkit-zoom-out"),h.css("cursor","-moz-zoom-out"),h.css("cursor","zoom-out"));Ba=!0;var e=g.find("#ivLargeImage");Ga.left=e.width()-b.width();Ga.top=e.height()-b.height();var e=h.height()/2,c=h.width()/2;Ea=[h.offset().left+c,h.offset().top+e];ra.top=e-b.height()/2;ra.left=c-b.width()/2;b.css({position:"relative",left:ra.left,top:ra.top});Fa=Math.max(b.height()/h.height(),b.width()/h.width())}ha(a)}});g.delegate("#ivLargeImage",
"mousemove",function(a){Ba&&ha(a)})}function la(d){if(a.isImmersiveViewEnabled(m,O.getCurrentItem().color))if(Na){var k=d.$event.originalEvent;k.acknowledge&&k.acknowledge(d.$currentTarget[0]);Pa=a.isDefined(d)&&"button-360-click"===d.action;fa.isEnabled&&n.logImmersiveViewRequestServed(fa);e.postCountMetric("dppc_immersiveViewOpened");if(a.isDefined(ia))ia.show();else{d=b("#auiImmersiveViewDiv");var k=b(q).height()-150,f=b(q).width()-75;ia=Na.create(d,{name:"immersiveView",activate:"onclick",width:f,
height:k,popoverLabel:"ImmersiveView",hideHeader:!0});d.click()}if(Oa){g=b("#ivMain");d=O.getCurrentItem().color;ja=m.colorImages[d];ga=m.heroImage[d];ea=m.useChildVideos?m.colorToVideo[d]:m.videos;Ra=Q()&&m.spin360ColorEnabled[d];F=Q()?m.spin360ColorData[d]:sa;R();ma=H=h=W=0;a.isDefined(ga)&&(H=ga.length);a.isDefined(ja)&&(W=ja.length);a.isDefined(ea)&&(h=ea.length);Ra&&(ma=1);t.populateTitle(g.find("#ivTitle"),45,m);t.populateVariationSelection(g.find("#ivVariationSelection"));d=g.find("#ivMediaSelect");
0===W+ma||0===h?(d.parent().hide(),g.find("#ivThumbs").addClass("noMediaSelection")):(d.empty(),b("\x3coption/\x3e").attr("value","all").prop("selected",!0).text(m.staticStrings.allMedia+" ("+(H+W+ma+h)+")").appendTo(d),b("\x3coption/\x3e").attr("value","images").text(m.staticStrings.images+" ("+(H+W+ma)+")").appendTo(d),b("\x3coption/\x3e").attr("value","videos").text(m.staticStrings.videos+" ("+h+")").appendTo(d),d.parent().show(),d.val("all"));d=g.find("#ivThumbs");d.find(".ivRow").not(".placeholder").remove();
for(var k=H+W+h+ma,l=f=0;f<k;)for(var r=d.find(".ivRow.placeholder").clone().removeClass("placeholder").appendTo(d),p=0;3>p&&f<k;p++,f++,l++)if(l<H){var v=ga[f].thumb,A=d.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("ivHeroImage").attr("id","ivHeroImage_"+f).appendTo(r);A.find(".ivThumbImage").css("background",'url("'+t.getResizedThumbnailURL(v)+'") center no-repeat')}else if(l>=H&&l<W+H)v=ja[f-H].thumb,A=d.find(".ivThumb.placeholder").clone().removeClass("placeholder").attr("id",
"ivImage_"+(f-H)).appendTo(r),A.find(".ivThumbImage").css("background",'url("'+t.getResizedThumbnailURL(v)+'") center no-repeat');else if(l>=H+W&&l<W+H+ma)A=d.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("iv360Image").attr("id","iv360").appendTo(r),A.find(".ivThumbImage").css("background",'url("'+(a.isDefined(m.staticImages.icon360)?t.getResizedThumbnailURL(m.staticImages.icon360,!0):"")+'") center no-repeat');else if(v=ea[f-W-H-ma],A=d.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("ivThumbVideo").attr("id",
"ivVideo_"+(f-W-H-ma)).appendTo(r),A.find(".ivThumbImage").css("background",'url("'+v.thumbUrl+'") center no-repeat'),a.isDefined(v)){var u={position:"triggerTop"},w=g.find("#ivThumbs").find(".ivThumbVideoPopover.placeholder").clone().removeClass("placeholder");w.find(".ivVideoPopoverTitle").text(v.title);w.find(".ivVideoPopoverDuration").text(v.durationTimestamp);u.inlineContent=w[0];c.declarative.create(A,"a-tooltip",u)}d=g.find("#ivVideoList");d.find(".ivThumbVideoListOuter").not(".placeholder").remove();
k=d.find(".placeholder");for(f=0;f<h;f++)l=ea[f],r=k.clone().removeClass("placeholder").appendTo(d),r.attr("id","ivVideoList_"+f),r.find(".ivThumbImage").css("background",'url("'+l.thumbUrl+'") center no-repeat'),r.find(".ivThumbTitle").text(l.title),r.find(".ivThumbDuration").text(l.durationTimestamp);g.find("#ivLarge360").empty();qa=0;Ja=Ia=!1;xa=m.airyConfig;Oa=!1;Sa()}}else q.performance&&performance.now&&q.ue&&ue.count&&ue.count("DPIBClickFailedInteractionCount",(ue.count("DPIBClickFailedInteractionCount")||
0)+1);else e.postCountMetric("immersiveViewNotExistsClickCount")}function oa(h){var b=m.colorToAsin[h],c={},g=500;if(b&&b.asin){c.params={asin:b.asin};var f="360"+b.asin,k=Date.now();c.success=function(b){D("dppc_asyncRequestTime360",Date.now()-k);b&&a.isDefined(b.spin360.spin360Model)?(a.ajaxState(f,"success"),m.spin360ColorData[h]=b.spin360.spin360Model,h===O.getCurrentItem().color&&(F=m.spin360ColorData[h],V())):c.error()};c.error=function(){e.postCountMetric("dppc_asyncFailed360");D("dppc_asyncRequestTime360",
Date.now()-k);g*=2;16E3>=g?setTimeout(function(){k=Date.now();C.load("/gp/product/features/apparel-main-image/360.html",c)},g):a.ajaxState(f,"fail")};a.ajaxState(f)&&"fail"!==a.ajaxState(f)||(C.load("/gp/product/features/apparel-main-image/360.html",c),a.ajaxState(f,"sent"))}}function Q(){return a.isDefined(m.spin360ConfigEnabled)&&m.spin360ConfigEnabled}var aa,m,O,v,ia,g,ga,ja,ea,H,W,h,ma,r,A,xa,F,Ra,pa,ua,wa,va,La,Ka,Pa=!1,Ia=!1,Ja=!1,ya=0,za=0,ta=0,Ha=0,Da=!1,Ca=!1,qa=0,Ma,Qa=navigator.userAgent.match(/msie|trident/i),
Oa=!0,Ba=!1,Aa=!1,Ga={},ra={},Fa,Ea,Na;B.when("a-modal").execute(function(a){Na=a});var Sa=c.once(function(){L();K();na();c.on("a:popover:afterUpdatePosition:immersiveView",S);c.on("a:popover:afterShow:immersiveView",I);c.on("a:popover:afterHide:immersiveView",Z);ba()});return function(h,g,f,k){aa=this;m=h;O=g;fa.refToModel=O;v=k;Q()&&(m.spin360ColorData[m.landingAsinColor]=m.spin360ColorData[m.defaultColor],m.spin360ColorEnabled[m.landingAsinColor]=m.spin360ColorEnabled[m.defaultColor]);a.isDefined(m.staticImages.icon360)&&
b("#imageBlock #altImages ul").find(".360IngressTemplate").find("img").attr("src",t.addStyleCodeToURL(m.staticImages.icon360,"_FMpng_RI_"));aa.render=function(h,d,b,g,f,k){Oa=!0;Q()&&m.spin360ColorEnabled[h]&&!a.isDefined(m.spin360ColorData[h])&&(m.spin360ColorData[h]={},oa(h));a.isImmersiveViewEnabled(m,O.getCurrentItem().color)&&Q()&&m.spin360ColorEnabled[h]&&(d===m.maxAlts&&(h=g.find(".item.imageThumbnail"),b=g.find(".item.videoThumbnail"),a.isDefined(b)&&1<b.length?b.last().remove():h.last().remove(),
d--),h=g.find(".360IngressTemplate").clone().removeClass("360IngressTemplate").removeClass("aok-hidden").addClass("item"),c.declarative.create(h,"button-360-click"),g.append(h),d++,e.postCountMetric("dppc_display360"));return d};aa.update=function(a){};a.isImmersiveViewEnabled(m,O.getCurrentItem().color)||a.addTag("immersiveViewNotAvailable");v.register("imageClick",la);v.register("button360Click",la)}});"use strict";B.when("A","jQuery","imageBlockUtils","ImageBlockLoader","nexusLogger360","postMetric",
"imageBlockImmersiveViewUtils","hit-spin360-feature-data","hit-spin360-constants").register("ImageBlockImmersiveView360",function(c,b,a,C,e,q,n,t,B){function ba(){var a=b("#iv360Tab").height();l.css("height",a);var e=l.find("#ivTitle360").outerHeight(!0),c=l.find("#ivVariationSelection360").outerHeight(!0),g=l.find("#ivThumbs360"),f=n.getDimension(g,"margin-top")+n.getDimension(g,"margin-bottom");g.css("height",a-e-c-f);a=l.find("#ivStage360");e=l[0]&&l[0].getBoundingClientRect&&Math.floor(l[0].getBoundingClientRect().width)||
l.width();a.css("width",e-n.getDimension(l,"padding-left")-n.getDimension(l,"padding-right")-l.find("#ivThumbColumn360").width()-n.getDimension(a,"margin-left")-n.getDimension(a,"margin-right"))}function R(){T();var a=l.find("#ivLarge360");a.css({opacity:0});setTimeout(function(){a.css({opacity:.4});n.animateStageIn(a)},200);S()}function S(){if(0<g){var a=l.find(".iv360Hint");a.removeClass("iv360HintFaded");a.animate({opacity:1},200)}}function L(a,c){if(g<a.length){var f=b("\x3cimg /\x3e").css({display:"block",
width:6*N+"px",height:K+"px"});f.hide();c.append(f);f.get(0).onload=function(){c.closest(document.documentElement).length&&(g++,1===g&&(S(),0<m&&(e.time("dppc_loadTime360",Date.now()-m,k.mediaAsin),q.postTimeMetric("dppc_loadTime360",Date.now()-m))),0<O&&(e.time("dppc_perSpriteloadTime360",Date.now()-O,k.mediaAsin),q.postTimeMetric("dppc_perSpriteloadTime360",Date.now()-O)),l.find("#iv360Spinner").hide(),f.show(),Q=5*u.imageLocations[Math.floor(aa/u.imageLocations[0].length)][aa%u.imageLocations[0].length],
L(a,c))};f.attr("src",a[g].replace(/(\._SP)\d+(,)\d+/,"$1"+P+"$2"+Z));O=Date.now()}}function M(h){if(a.isDefined(u.spriteWidthSizes)&&0<u.spriteWidthSizes.length){var b=u.spriteWidthSizes,e=b.length,c=b[0],g=b[e-1];if(h<=c)return c;if(h>g)return g;for(c=0;c<e;c++)if(h>b[c]&&h<=b[c+1])return b[c+1]}else return h}function T(){var a=l.find("#ivLarge360");a.children("#image-360-sprites").length||(a.append("\x3cdiv id\x3d'image-360-sprites'\x3e\x3c/div\x3e"),a.css({"margin-left":0,"margin-top":0,width:a.parent().width(),
height:a.parent().height(),overflow:"hidden",position:"relative","-ms-user-select":"none","-webkit-user-select":"none","-mos-user-select":"none"}),b("\x3cimg\x3e").attr("src",k.staticImages.spinnerNoLabel).attr("id","iv360Spinner").css({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"block"}).appendTo(a),la=!0,Y())}function Y(){if(a.isDefined(u.spriteURLs)&&a.isDefined(l)&&la&&!oa){var h=l.find("#ivLarge360"),c=b("\x3cdiv\x3e").addClass("iv360Hint").css({position:"absolute",
width:"100%",bottom:0,opacity:0,display:"block"});a.isDefined(u.staticImages.hint360)&&b("\x3cimg\x3e").css({"margin-left":"auto","margin-right":"auto",display:"block"}).attr("src",u.staticImages.hint360).appendTo(c);b("\x3cdiv\x3e").css({"text-align":"center"}).text(k.staticStrings.dragToSpin).appendTo(c);c.appendTo(h);var c=u.imageWidth,e=u.imageHeight,g=h.parent().width(),v=h.parent().height(),m=0,n=0;c/e>g/v?(P=M(g),Z=Math.round(e/c*P),N=Math.ceil(g),K=Math.ceil(Z/P*g),n=(v-K)/2):(Z=M(v),P=Math.round(c/
e*Z),K=Math.ceil(v),N=Math.ceil(P/Z*v),m=(g-N)/2);h.css({"margin-left":m,"margin-top":n,width:N+"px",height:K+"px",overflow:"hidden",position:"relative"});h.children("#image-360-sprites").css("width",6*N+"px");L(u.spriteURLs,l.find("#image-360-sprites"),0);c=l.find("#ivLarge360");c.bind("mousedown",I);c.bind("touchstart",ca);c.bind("touchmove",X);c.bind("touchend",da);b(document).bind("mousemove",p);b(document).bind("mouseup",f);a.isDefined(k.staticImages.grab)&&h.css("cursor","url('"+k.staticImages.grab+
"'), auto");oa=!0}}function ca(a){ia=!0;na=a.originalEvent.targetTouches[0].clientX}function X(a){ia&&(z(a.originalEvent.targetTouches[0].clientX-na),na=a.originalEvent.targetTouches[0].clientX)}function da(a){ia&&(ia=!1)}function I(h){v=!0;ha=h.originalEvent.clientX;a.isDefined(k.staticImages.grabbing)&&(h=l.find("#ivLarge360"),h.css("cursor","url('"+k.staticImages.grabbing+"'), auto"),h.parents(".a-declarative").last().css("cursor","url('"+k.staticImages.grabbing+"'), auto"));return!1}function p(a){v&&
(z(a.originalEvent.clientX-ha),ha=a.originalEvent.clientX)}function f(b){v&&(v=!1,a.isDefined(k.staticImages.grab)&&(b=l.find("#ivLarge360"),b.css("cursor","url('"+k.staticImages.grab+"'), auto"),b.parents(".a-declarative").last().css("cursor","auto")))}function z(b){Q-=b/N*180;ja&&(e.count("dppc_360dragToSpin",k.mediaAsin),q.postCountMetric("dppc_360dragToSpin"));ja=!1;for(b=Q;0>b;)b+=360;for(;360<b;)b-=360;Q=b;var c;b=360;for(var f=0;f<g;f++)for(var v=0;v<u.imageLocations[f].length;v++){var m=Math.abs(Q-
5*u.imageLocations[f][v]);m<b&&(b=m,c=f*u.imageLocations[0].length+v)}c!==aa&&(b=Math.floor(c/u.imageLocations[0].length),b!==Math.floor(aa/u.imageLocations[0].length)&&(a.isDefined(ga)||(ga=document.createElement("canvas").getContext("2d")),f=l.find("#image-360-sprites").children(),ga.drawImage(f[b],0,0)),b=l.find(".iv360Hint").not(".iv360HintFaded"),a.isDefined(b)&&(b.addClass("iv360HintFaded"),b.animate({opacity:0},750)));aa=c;b=c%u.imageLocations[0].length*-1*N;c=-1*Math.floor(c/u.imageLocations[0].length)*
K;f=l.find("#ivLarge360").children("#image-360-sprites");f.css("-webkit-transform","translate3d("+b+"px, "+c+"px, 0)");f.css("transform","translate3d("+b+"px, "+c+"px, 0)")}function D(){if(H){l=b("#ivMain360");var a=G.getCurrentItem().color;E()&&x(a);u=E()?k.spin360ColorData[a]:sa;n.populateTitle(l.find("#ivTitle360"),160,k);n.populateVariationSelection(l.find("#ivVariationSelection360"));l.find("#ivLarge360").empty();g=0;oa=la=!1;aa=Q=0;W();H=!1}0!==b("#iv360Tab").height()&&(n.detachImmersiveViewResizeHandler(D),
ba(),R(),m=Date.now(),ea=ja=!0,e.count("dppc_click360",k.mediaAsin),q.postCountMetric("dppc_click360"))}function w(b,c,g){b=k.colorToAsin[g];var f={},l=500;if(!b||!b.asin)if(g===k.defaultColor)b={asin:k.winningAsin};else return;f.params={asin:b.asin};var v="360"+b.asin,m=Date.now();f.success=function(b){e.time("dppc_asyncRequestTime360",Date.now()-m,k.mediaAsin);q.postTimeMetric("dppc_asyncRequestTime360",Date.now()-m);b&&a.isDefined(b.spin360)?((b=b.spin360.spin360Model)&&t.setData(b),a.ajaxState(v,
"success")):f.error()};f.error=function(){e.count("dppc_asyncFailedTransient360",k.mediaAsin);q.postCountMetric("dppc_asyncFailedTransient360");e.time("dppc_asyncRequestTime360",Date.now()-m,k.mediaAsin);q.postTimeMetric("dppc_asyncRequestTime360",Date.now()-m);l*=2;16E3>=l?setTimeout(function(){m=Date.now();C.load("/gp/product/features/apparel-main-image/360.html",f)},l):(e.count("dppc_asyncFailed360",k.mediaAsin),q.postCountMetric("dppc_asyncFailed360"),a.ajaxState(v,"fail"))};a.ajaxState(v)&&"fail"!==
a.ajaxState(v)||(C.load("/gp/product/features/apparel-main-image/360.html",f),a.ajaxState(v,"sent"))}function E(){return k&&a.isDefined(k.spin360ConfigEnabled)&&k.spin360ConfigEnabled}function x(b){return a.isDefinedAndNotEmpty(k.spin360ColorData[b])?!0:a.isDefined(k.spin360LazyLoadEnabled)&&k.spin360LazyLoadEnabled}function y(){ea&&(e.time("dppc_duration360",Date.now()-m,k.mediaAsin),q.postTimeMetric("dppc_duration360",Date.now()-m),ea=!1)}function V(a){a=k.colorToAsin[a.color]&&k.colorToAsin[a.color].asin;
a||(a=k.mediaAsin);return a}var J,k,G,U,l,u,N,K,Z,P,ha,na,la=!1,oa=!1,Q=0,aa=0,m=0,O=0,v=!1,ia=!1,g=0,ga,ja=!0,ea=!1,H=!0,W=c.once(function(){n.attachImmersiveViewResizeHandler(D);n.attachImmersiveViewResizeHandler(ba);n.attachImmersiveViewResetHandler(y);n.attachTabDeselectHandler("iv360Tab",y)});return function(f,g,l,v){J=this;k=f;G=g;U=v;f=k.landingAsinColor;g=k.defaultColor;a.isDefined(k.staticImages.icon360)&&b("#imageBlock #altImages ul").find(".360IngressTemplate").find("img").attr("src",n.addStyleCodeToURL(k.staticImages.icon360,
"_FMpng_RI_"));E()&&(k.spin360ColorData||(k.spin360ColorData={}),f===g&&a.isDefinedAndEmpty(k.spin360ColorData[g])&&delete k.spin360ColorData[g]);c.on(B.TWISTER_DATA_EVENT,function(a){V(G.getCurrentItem())===a&&(u=t.getData(a),Y(),a={type:"updatedData",data:G.getCurrentItem()},U.dispatch("updateView",a))});J.render=function(f,g,h,l,v,m){H=!0;!E()||a.isDefinedAndEmpty(k.spin360ColorData[f])&&!t.getData(V(G.getCurrentItem()))?n.hideTabHeading("iv360TabHeading"):(k.spin360ColorData[f]=t.getData(V(G.getCurrentItem())),
a.isDefinedAndNotEmpty(k.spin360ColorData[f])?(b("#ivThumbs360").hide(),n.unhideTabHeading("iv360TabHeading"),a.isImmersiveViewEnabled(k,G.getCurrentItem().color)&&E()&&x(f)&&(g===k.maxAlts&&(f=l.find(".item.imageThumbnail"),g=l.find(".item.videoThumbnail"),a.isDefined(g)&&1<g.length?g.last().remove():f.last().remove()),f=l.find(".360IngressTemplate").clone().removeClass("360IngressTemplate").removeClass("aok-hidden").addClass("item"),c.declarative.create(f,"button-360-click"),l.append(f),e.count("dppc_display360",
k.mediaAsin),q.postCountMetric("dppc_display360"))):a.isDefined(k.spin360LazyLoadEnabled)&&k.spin360LazyLoadEnabled?(k.spin360ColorData[f]={},n.hideTabHeading("iv360TabHeading"),w(l,g,f)):n.hideTabHeading("iv360TabHeading"))};J.update=function(a){};n.attachTabSelectHandler("iv360Tab",D)}});B.register("nexusLogger360",function(){return{count:function(c,b){q.ue&&q.ue.event({asin:b,metricName:c,metricValue:1},"hit-360","hit360.clientEvent.3")},time:function(c,b,a){q.ue&&q.ue.event({asin:a,metricName:c,
metricValue:b},"hit-360","hit360.clientEvent.3")}}});B.register("hit-spin360-constants",function(){return{TWISTER_DATA_EVENT:"spin360TwisterData"}});B.when("A","hit-spin360-constants").register("hit-spin360-feature-data",function(c,b){var a={};return{setData:function(q){var e=q.asin;a[e]||(a[e]=q,c.trigger(b.TWISTER_DATA_EVENT,e))},getData:function(b){return a[b]}}});"use strict";B.when("postMetric").register("ImageBlockImmersiveViewShowroom",function(c){function b(){this.render=function(){};this.update=
function(){}}return function(a,q,e,fa){var n=!1,t=new b;B.now("showroom-image-block-view").execute("showroom-image-block-view-decider",function(b){b!==sa&&(n=!0,t=new b(a,q,e,fa))});a&&!0===a.showroomEnabled&&!1===n&&c.postCountMetric("showroom:atf:imageBlock:hiddenDueToAssetsNotPresentInTime");return t}});"use strict";B.when("A","jQuery","imageBlockUtils","postMetric","imageBlockImmersiveViewUtils","vse_ns_preLoaderHook","vse_ns_lazyLoaderHook").register("ImageBlockImmersiveViewVideos",function(c,
b,a,C,e,B,n){function t(){w.delegate(".ivThumb","click",function(){var a=b(this);w.find(".ivThumb").removeClass("selected");a.addClass("selected");a.hasClass("ivThumbVideo")&&(E.type="chromeful-video",E.index=a.attr("id").split("_")[1])})}function ka(){if(P){var a=b("#ivVideosTab").height();w.css("height",a);var c=w.find(".vse-lb-container");x=a-e.getDimension(c,"padding-top")-e.getDimension(c,"padding-bottom");c.css({"max-height":a,overflow:"hidden"});if(u){w.css({"max-width":Math.floor(1.77*x)});
return}var a=w.find(".vse-player-container"),c=w.find(".vse-video-action-strip"),f=w.find(".vse-lb-video-metadata"),k=Math.floor(x-e.getDimension(f,"height")-e.getDimension(c,"height")),l=Math.floor(1.77*k);a.css({"max-height":k,"max-width":l,marginLeft:"auto",marginRight:"auto"});f.css({"max-width":l,marginLeft:"auto",marginRight:"auto"});c.css({"max-width":l,marginLeft:"auto",marginRight:"auto"})}N&&(a=w.find(".vse-vertical-scroll"),c=e.getDimension(a,"margin-top")+e.getDimension(a,"margin-bottom"),
a.css("max-height",x-c))}function ba(){R();y&&y.pause();K=!1;U=!0;G=null;Z=!0;P=!1}function R(){K=!1;y&&y.pause()}function S(e){G=e.clickTimeStamp?e.clickTimeStamp:c.now();a.isDefined(D)&&(D.eventTimestamp=G);K=!0;l&&(n.get(c,"#ivVideoBlock",z,m,O),w=b("#ivVideoBlock"),f.getCurrentItem(),E=f.getCurrentItem(),oa(),X());ka();l=!1;T()}function L(a){l&&(w=b("#ivVideoBlock"),f.getCurrentItem(),E=f.getCurrentItem(),oa());K&&T();ka()}function M(a){y=a.player;C.postTimeMetric("vse_ib_desktop_player_initialisation_duration",
c.now()-la);p.imageBlockRenderingStartTime&&C.postTimeMetric("vse_ib_desktop_time_to_player_interactive",c.now()-p.imageBlockRenderingStartTime);P&&(X(),T())}function T(){if(y&&K&&(w.find(".vse-lb-container").animate({opacity:1},200),y.play(D),C.postCountMetric("dpcc_vse_videoBlock_video_played"),U)){var a=q.ue;a&&(a=a.count("dpcc_vse_videoingressclick"),a=(new Date).getTime()-a,C.postTimeMetric("dpcc_vse_vitff",a),U=!1)}}function Y(){c.trigger("vse:detailpage-imageblock:page:lightBoxClosed")}function ca(a){V=
a.popover.$popover;P=!0;X()}function X(){if(P&&Z&&K&&y){V.addClass(c.$(V).find(".vse-lb-container").data("cssClass"));var a=D;ha&&(a=na,ha=!1);c.trigger("vse:detailpage-imageblock:page:lightBoxOpened",{lightBoxId:"ivVideoBlock",assetSpec:a});ka();Z=!1}}function da(a){document.getElementsByClassName("videoBlockIngress")[0].click();na=a;ha=!0}var I,p,f,z,D,w,E,x,y,V,J,k,G,U=!0,l=!0,u=!1,N=!1,K=!1,Z=!0,P=!1,ha=!1,na,la=0,oa=c.once(function(){t();e.attachImmersiveViewResizeHandler(L);e.attachTabDeselectHandler("ivVideosTab",
R);e.attachImmersiveViewResetHandler(ba)}),Q=function(c,e,g){b("#ivVideoBlockSpinner").addClass("aok-hidden");C.postCountMetric("dpcc_vse_videoBlock_preload_failed_"+e.placement);c=f.getCurrentItem().color;c=a.getVideoHash(c,0,p);y||(y=a.createAiryInstanceForChromeful(b("#ivVideoBlock"),c,p.airyConfig,"ImmersiveView"));u=!0;b("#ivVideoBlock").css({"max-width":1.77*x,margin:"0 auto"});K&&u&&y.play({isAsync:!0})},aa=function(a,c,e){l||n.get(a,"#ivVideoBlock",z,m,O);b("#ivVideoBlockSpinner").addClass("aok-hidden")},
m=function(a,b,c){N=!0;ka()},O=function(a,b,c){C.postCountMetric("dpcc_vse_videoBlock_lazyload_failed_"+b.pageContext.placement+"_"+b.configuration.type)};return function(b,m,g,n){I=this;p=b;f=m;I.render=function(b,g,m,n,h,q){b=f.getCurrentItem().color;g=a.getVideoHash(b,0,p);!0===q?J=p.mediaAsin:(J=p.colorToAsin[b]&&p.colorToAsin[b].asin,J=a.isDefined(J)?J:p.mediaAsin);k=null!==p.vseVideoDataSourceTreatment&&"T1"===p.vseVideoDataSourceTreatment?"ASIN":"physicalID";l=!0;-1===g?e.hideTabHeading("ivVideosTabHeading"):
(e.unhideTabHeading("ivVideosTabHeading"),z={page:"DetailPage",placement:"ImageBlock",device:"Desktop",marketplaceID:g.marketPlaceID,locale:g.languageCode,product:{contentID:J,contentIDType:"ASIN"},video:{contentID:g.mediaObjectId,contentIDType:k,videoURL:g.url,imageURL:g.slateUrl},requestId:p.dpRequestId,metadata:{ProductTitle:p.title}},D={videoUrl:z.video.videoURL,contentId:z.video.contentID,duration:0,vendorCode:"",eventTimestamp:a.isDefined(G)?G:c.now(),imageUrl:z.video.imageURL,productAsin:z.product.contentID,
index:0},a.isDefinedAndNotEmpty(y)&&(y.destroy(),y=null),la=c.now(),B.get(c,"#ivVideoBlock",z,aa,Q))};I.update=function(a){};e.attachTabSelectHandler("ivVideosTab",S);c.on("vsePlayer-detailpage-imageblock",M);c.on("a:popover:afterShow:immersiveView",ca);c.on("a:popover:beforeHide:immersiveView",Y);c.on("detailpage-imageblock-leave-pip",da)}})});
/* ******** */
(function(b){var f=window.AmazonUIPageJS||window.P,h=f._namespace||f.attributeErrors,a=h?h("DetailPageImageBlockSubAssets@logging","DetailPageImageBlockSubAssets"):f;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,f,h){b.when("A","postMetric","ready").execute("feature-bullets-tailoring-metrics",function(a,c){try{var d=a.$,e=d("#featurebullets_feature_div"),k=d("#productOverview_feature_div");if(e&&0<e.length&&(c.postCountMetric("FeatureBulletsRendered.GV"),k&&
0<k.length)){c.postCountMetric("FeatureBulletsRenderedWithPO.GV");var g=d("#featurebullets_feature_div .a-expander-container");g&&0<g.length&&"feature-bullets-expander"===g.data("aExpanderName")&&(c.postCountMetric("FeatureBulletsRenderedCollapsed.GV"),a.on("a:expander:feature-bullets-expander:toggle:expand",function(a){c.postCountMetric("FeatureBulletsInteraction.Expanded")}),a.on("a:expander:feature-bullets-expander:toggle:collapse",function(a){c.postCountMetric("FeatureBulletsInteraction.Collapsed")}))}}catch(l){b.log("Feature bullets metric logging failed with error: ( "+
l+" )","ERROR","FeatureBulletsTailoringMetrics")}});"use strict";b.when("A","ImageBlockATF","ImageBlockBTF","imageBlockUtils","postMetric").execute(function(a,c,d,e,k){var g=[0,50,100,500,1E3,2E3,3E3,3500];(function(){var a=d.colorImages,c=0,b;for(b in a)a[b]&&a[b].length&&(c+=a[b].length);a="image_size_bucket:gt"+g[g.length-1];for(b=1;b<g.length;b++)if(c<=g[b]){a="image_size_bucket:"+g[b-1]+"-"+g[b];break}k.postCountMetric(a);e.addTag(a)})();(function(){var a=c.colorImages;a&&a.initial&&a.initial.length&&
(a=a.initial.length,f.ue&&ue.count&&ue.count("altImageCount",a))})();(function(){var a=d.lazyLoadExperienceDisabled;e.isDefined(d.lazyLoadExperienceDisabled)&&!a&&(k.postCountMetric("lazyLoadingExperienceOnTwisterUpdateEnabled"),e.addTag("lazyLoadingExperienceOnTwisterUpdateEnabled"))})()});"use strict";b.register("logFailedInteractionMetric",function(){return{isEnabled:!1}});b.register("postEarlyMetric",function(){return null});"use strict";b.register("postMetric",function(){return{postCountMetric:function(a){if("undefined"!==
typeof a){var c=f.ue;if(c){var b=c.count(a)||0;c.count(a,b+1)}}},postTimeMetric:function(a,c){if("undefined"!==typeof a&&"undefined"!==typeof c){var b=f.ue;b&&b.count(a,c)}},emitNexusMetric:function(a){f.ue&&ue.event&&ue.event(a,"VSEImageBlockEvents","vse.VSEImageBlockEvents.3",{ssd:!1})},buildNexusMetric:function(a,b,d,e,k,g,f,h){return{eventSource:"IBCarousel",placementContext:h,clientId:"VSE",userAgentData:navigator.userAgent,titleSessionId:"0",eventName:a,intPayload:b,videoAsin:d,videoAsinList:"",
groupType:e,pageUrl:k,pageAsin:g,weblabIds:f}}}});b.when("A","get-resource-time","postMetric","afterLoad").execute(function(a,b,d){var e=a.state("desktop-landing-image-data");e&&(e=a.values(e),b=b.getResourceTimeByName("img",e),a.each(b,function(a){a&&(a.responseEnd!=h&&d.postCountMetric("ibDesktopLandingImageDownloadTime",f.parseInt(a.responseEnd)),a.transferSize!=h&&(0===a.transferSize?d.postCountMetric("ibDesktopLandingImageCached",1):(d.postCountMetric("ibDesktopLandingImageSizeInBytes",f.parseInt(a.transferSize)),
d.postCountMetric("ibDesktopLandingImageNotCached",1))))}))})});
/* ******** */
(function(l){var g=window.AmazonUIPageJS||window.P,m=g._namespace||g.attributeErrors,e=m?m("DetailPageImageBlockSubAssets@utils","DetailPageImageBlockSubAssets"):g;e.guardFatal?e.guardFatal(l)(e,window):e.execute(function(){l(e,window)})})(function(l,g,m){l.when("ImageBlockATF","atf").register("ImageBlockAiryLoader",function(e){function f(c){c&&(l.load.js(c),g.performance&&performance.now&&g.ue&&ue.count&&ue.count("DPAiryDownloadStartTime",g.parseInt(performance.now())))}function k(c){c&&l.load.css(c)}
var c=e.airyConfig;c===m?l.when("ImageBlockBTF").execute(function(e){c=e.airyConfig;f(c.jsUrl);k(c.cssUrl)}):(f(c.jsUrl),k(c.cssUrl))});"use strict";l.when("A","jQuery").execute(function(e,f){e.on("a:image:load:landingImage",function(){g.performance&&performance.now&&g.ue&&ue.count&&ue.count("DPLandingImageHighResDownloadTime",performance.now())});e.loadDynamicImage(f("#landingImage"))});"use strict";l.when("jQuery","imageBlockUtils").register("ImageBlockHeroUtils",function(e,f){function k(a,d){var b;
if(d.repositionHeroImage){b=a[1];var c=a[0];if(768>=(g.innerHeight||document.documentElement.clientHeight||document.body.clientHeight))b*=.7,c*=.7;else{var e=((g.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-1024)/256,e=Math.max(Math.min(e,1),0);b*=.7+.3*e;c*=.7+.3*e}b=[b,c]}return b}function c(a,d,b){var c;if(b.repositionHeroImage){var e=g.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;b=b.heroFocalPoint;if(f.isDefined(b)){c=Math.max((e-
Math.min(1500,a))/2,0);var k=Math.max((e-a)/2,0);c-=k;e=Math.max(Math.min(e,1500),1024);c=c+(e-420-23)/2-a/d[1]*b}}return c}function h(a,d,b){a=a.heroImage;return!(f.isDefined(a)&&f.isDefined(a[d])&&f.isDefined(a[d][b])&&f.isDefined(a[d][b].main))||1>e.map(a[d][b].main,function(a,b){return b}).length?-1:a[d][b]}return{getHeroImageHash:h,getHeroDimParams:function(a,d,b){if(a.repositionHeroImage){if(!f.isDefined(b)){b=h(a,d.color,d.index);if(-1===b)return;d=e.map(b.main,function(a,b){return b})[0];
b=b.main[d]}d=k(b,a);a=c(d[0],b,a);return{height:d[1],width:d[0],xPos:a,yPos:75}}}}});"use strict";l.when("A","jQuery","imageBlockUtils").register("imageBlockImmersiveViewUtils",function(e,f,k){function c(a,d){var b=e.copy(a);if(k.isDefined(a)&&a.length>d){try{for(var c=-1,h=0;h<a.length;h++){var f=a.charAt(h);if(" "===f||"."===f||"?"===f||";"===f||","===f||":"===f)c=h;if(h===d-4){b=a.substring(0,-1===c?h:c);break}}}catch(g){b=a.substring(0,d-3)}b+="..."}return b}function h(a,d){var b=a.lastIndexOf(".");
return a="_"===a.charAt(b-1)?a.substring(0,b-1)+d+a.substring(b):a.substring(0,b)+"."+d+a.substring(b)}return{getDimension:function(a,d){var b=parseInt(a.css(d),10);return isNaN(b)?0:b},attachTabSelectHandler:function(a,d){e.on("dp:ivTabs:"+a+":select",d)},attachTabDeselectHandler:function(a,d){e.on("dp:ivTabs:"+a+":deselect",d)},attachImmersiveViewResizeHandler:function(a){e.on("dp:image-block:immersive-view:resize",a)},detachImmersiveViewResizeHandler:function(a){e.off("dp:image-block:immersive-view:resize",
a)},attachImmersiveViewResetHandler:function(a){e.on("a:popover:afterHide:immersiveView",a)},hideTabHeading:function(a){f("#"+a).hide()},unhideTabHeading:function(a){f("#"+a).show()},addStyleCodeToURL:h,getResizedThumbnailURL:function(a,d){a=a.replace(/\._(AA|SS)\d+_/,"").replace(/\._SX\d+_SY\d+_CR,0,0,\d+,\d+_/,"");a=a.replace(/\._(US)\d+_/,"").replace(/\._SR\d+,\d+_/,"").replace(/\._SP[0-9,C]+_/,"");a=a.replace(/\._CB\d+_SS\d+_/,"");var b="_AA50_";d&&(b+="FMpng_RI_");return h(a,b)},populateVariationSelection:function(a){if(k.isDefined(g.DetailPage)&&
k.isDefined(g.DetailPage.StateController)){a.empty();var d=g.DetailPage.StateController.getState(),b=d.variation_label_order,c;for(c in b)if(b.hasOwnProperty(c)){var e=b[c],h=d.selected_variations[e],e=d.variation_display_labels[e];h&&f("\x3cdiv/\x3e").addClass("ivVariations").text(e+":"+h).appendTo(a)}}},populateTitle:function(a,d,b){a.html(b.title);a.attr("title",a.text());a.html(c(b.title,d))},animateStageIn:function(a){a.animate({opacity:1},200)},animateStageOut:function(a,c){a.animate({opacity:.4},
100,c)},logError:function(a,c,b,e){g.ueLogError&&g.ueLogError(e,{logLevel:a,attribution:c,message:b})}}});"use strict";l.when("A").register("ImageBlockLoader",function(e){return{load:function(f,k){k=k||{};k.timeout=k.timeout||4E3;e.ajax(f,k)}}});"use strict";l.when("postMetric","imageBlockImmersiveViewUtils").execute("vse-ns-ajax-calls",function(e,f){l.register("vse_ns_preLoaderHook",function(){function k(c,h){try{var a=c.A,d=c.block,b=c.request,g=c.handleFailure,l=c.handleSuccess,r=a.$;h--;var n=
3-h-1,p=a.now();a.ajax("/vap/ew/componentbuilder",{params:b,paramsFormat:"json",crossDomain:!0,method:"post",contentType:"application/json",timeout:b.timeout||5E3,withCredentials:!0,success:function(c){var h=a.now()-p;e.postTimeMetric("vse_preLoaderHook:success:",h);e.postCountMetric("vse_preLoaderHook:success:"+b.page+":"+b.placement+":"+n);r(d).html(c);l(a,b,c)},error:function(d){e.postCountMetric("vse_preLoaderHook:error:"+b.page+":"+b.placement+":"+n);(0===d.http.status||500<=d.http.status&&599>=
d.http.status)&&0<h?k(c,h):(e.postCountMetric("vse_preLoaderHook:error:",1),g(a,b,d))}})}catch(q){f.logError("FATAL","vse_ns_desktop","[vse_ns_preLoaderHook] ",q)}}return{get:function(c,e,a,d,b){k({A:c,block:e,request:a,handleFailure:b,handleSuccess:d},3)}}});l.register("vse_ns_lazyLoaderHook",function(){function k(c,h,a){try{var d=c.A,b=c.context,g=c.handleFailure,l=c.handleSuccess;h.attr("data-configuration");var r=atob(h.attr("data-configuration")),n=JSON.parse(r),p={pageContext:b,configuration:n},
q=d.now();a--;var m=3-a-1;d.ajax("/vap/ew/subcomponent/"+n.type,{params:p,paramsFormat:"json",method:"post",contentType:"application/json",timeout:b.timeout||5E3,withCredentials:!0,success:function(a){var c=d.now()-q;e.postTimeMetric("vse_lazyLoaderHook:success:",c);e.postCountMetric("vse_lazyLoaderHook:success:"+b.page+":"+b.placement+":"+n.type+":"+m);h.html(a);l(d,p,a)},error:function(f){e.postCountMetric("vse_lazyLoaderHook:error:"+b.page+":"+b.placement+":"+n.type+":"+m);(0===f.http.status||
500<=f.http.status&&599>=f.http.status)&&0<a?k(c,h,a):(e.postCountMetric("vse_lazyLoaderHook:error:",1),g(d,p,f))}})}catch(u){f.logError("FATAL","vse_ns_desktop","[vse_ns_lazyLoaderHook] ",u)}}return{get:function(c,e,a,d,b){var f=c.$;f(e+" div[data-configuration]").each(function(){k({A:c,context:a,handleFailure:b,handleSuccess:d},f(this),3)})}}});l.register("vse_ns_videoPlayer",function(){function k(c,h,a){try{var d=c.A,b=c.block,g=c.request,l=c.handleFailure,m=c.handleSuccess,n=d.$;a--;var p=3-a-
1,q=d.now();d.ajax("/vap/ew/subcomponent/vseplayer",{params:g,paramsFormat:"json",crossDomain:!0,method:"post",contentType:"application/json",timeout:g.timeout||5E3,withCredentials:!0,success:function(a){var c=d.now()-q;e.postTimeMetric("vse_lightPlayerLoaderHook:success:",c);e.postCountMetric("vse_lightPlayerLoaderHook:success:"+g.page+":"+g.placement+":"+p);n(b).html(a);m(d,g,a)},error:function(b){e.postCountMetric("vse_lightPlayerLoaderHook:error:"+g.page+":"+g.placement+":"+p);(0===b.http.status||
500<=b.http.status&&599>=b.http.status)&&0<a?k(c,a):(e.postCountMetric("vse_lightPlayerLoaderHook:error:",1),l(d,g,b))}})}catch(t){f.logError("FATAL","vse_ns_lightPlayer","[vse_ns_lightPlayerLoaderHook] ",t)}}return{get:function(c,e,a,d,b){k({A:c,block:e,request:a,handleFailure:b,handleSuccess:d},3)}}})})});
/* ******** */
(function(k){var d=window.AmazonUIPageJS||window.P,p=d._namespace||d.attributeErrors,b=p?p("DetailPageShowroomImageBlockAssets",""):d;b.guardFatal?b.guardFatal(k)(b,window):b.execute(function(){k(b,window)})})(function(k,d,p){k.when("A","imageBlockUtils","showroom-lite-atf-feature-data","showroom-image-block-detail-page-rendering","showroom-image-block-constants","showroom-image-block-metrics").register("showroom-image-block-view",function(b,f,m,g,e,a){function c(h){h.interaction===p.MOUSE_ENTER&&
h.type===e.SHOWROOM_THUMBNAIL_TYPE&&g.isShowroomMainImageHidden()&&a.addOne(a.COUNTER_NAMES.SHOWROOM_IMAGEBLOCK_THUMBNAIL_HOVER)}function d(b,e){var d=new Date;b.interaction=e.type;b.isUserGenerated=!0;if(f.isImageBlockGridViewHoverDelayEnabled()){if("mouseenter"===e.type&&m.isDataValidForAsin(u(b))&&(c(b),q&&clearTimeout(q),q=setTimeout(function(){var a=m.getDataForAsin(u(b)).imageData;g.updateMainImage(h,a,r);g.showShowroomMainImage(h);n.usePeekHover||f.selectGivenThumbnail(e.$declarativeParent,
x)},f.getHoveringDelayTimer())),"mouseleave"===e.type&&q&&clearTimeout(q),"click"===e.type){if(m.isDataValidForAsin(u(b))){var l=m.getDataForAsin(u(b)).imageData;g.updateMainImage(h,l,r);g.showShowroomMainImage(h)}f.selectGivenThumbnail(e.$declarativeParent,x);f.useTabbedImmersiveView(n)&&g.handleShowroomThumbnailClick(e)}}else m.isDataValidForAsin(u(b))&&(c(b),l=m.getDataForAsin(u(b)).imageData,g.updateMainImage(h,l,r),g.showShowroomMainImage(h)),n.usePeekHover&&"click"!==e.type||(f.selectGivenThumbnail(e.$declarativeParent,
x),"click"===e.type&&f.useTabbedImmersiveView(n)&&g.handleShowroomThumbnailClick(e));a.logValue(a.TIMER_NAMES.SHOWROOM_IMAGEBLOCK_LATENCY_UPDATE_HANDLE_THUMBNAIL_EVENT,new Date-d)}function u(a){a=n.colorToAsin[a.color].asin;a||(a=n.mediaAsin);return a}var k=void 0,n=void 0,l=void 0,r=void 0,x=void 0,h=void 0,y=void 0,q=void 0,v=void 0,p={SWATCH_HOVER:"swatchHover",MOUSE_ENTER:"mouseenter"};return function(c,q,t,z){t=new Date;k=this;n=c;l=q;r=z;b.on(e.TWISTER_DATA_EVENT,function(a){u(l.getCurrentItem())===
a&&(a={type:"updatedData",data:l.getCurrentItem()},r.dispatch("updateView",a))});k.render=function(e,f,c,d,k,q){e=new Date;x=d;h=k.find("#main-showroom-container");h.parent().find("#showroom-canvas-caption");b.$("#main-image-container");try{var w=u(l.getCurrentItem());if(m.isDataValidForAsin(w)){var p=new Date,t=m.getDataForAsin(w);g.refresh(r,t.asin,t.defaultStageId);a.logValue(a.TIMER_NAMES.SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_GET_DATA_FOR_ASIN,new Date-p);if(!q){var B=new Date;g.updateMainImage(h,
t.imageData,r);a.logValue(a.TIMER_NAMES.SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_UPDATE_MAIN_IMAGE,new Date-B)}var v=new Date;f=g.createThumbnail(n,d,f,t.imageData);a.logValue(a.TIMER_NAMES.SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_CREATE_THUMBNAIL,new Date-v);var z=new Date;b.$("#ivShowroomTabHeading").removeClass("aok-hidden");a.logValue(a.TIMER_NAMES.SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_UNHIDE_TAB_HEADING,new Date-z);if(w!==y){var A=new Date;a.addOne(a.COUNTER_NAMES.SHOWROOM_IMAGEBLOCK_FEATURE_RENDERED);var C=
a.createShowroomAtfEvent(t.defaultStageId,w,a.EVENT_NAMES.IMAGEBLOCK_LOAD,a.STATUS_TYPES.SUCCESS);a.logShowroomAtfEvent(C);y=w;a.logValue(a.TIMER_NAMES.SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_LOG_EVENT,new Date-A)}}else b.$("#ivShowroomTabHeading").addClass("aok-hidden")}catch(E){b.$("#ivShowroomTabHeading").addClass("aok-hidden")}a.logValue(a.TIMER_NAMES.SHOWROOM_IMAGEBLOCK_LATENCY_RENDER,new Date-e);return f};k.update=function(b){var r=new Date;try{var c=b.data;l.setCurrentEvent(b);c.type===e.SHOWROOM_THUMBNAIL_TYPE?
d(c,b):c.type!==e.SHOWROOM_MAIN_IMAGE_TYPE&&(b.type===p.SWATCH_HOVER?c.color===l.getCurrentItem().color&&l.getCurrentItem().type===e.SHOWROOM_THUMBNAIL_TYPE?g.showShowroomMainImage(h):g.hideShowroomMainImage(h):f.isImageBlockGridViewHoverDelayEnabled()?(l.setToPreviousItem(),"mouseenter"===b.type&&(v&&clearTimeout(v),v=setTimeout(function(){l.setToCurrentItem(c);g.hideShowroomMainImage(h)},f.getHoveringDelayTimer())),"mouseleave"===b.type&&v&&clearTimeout(v),"click"===b.type&&(l.setToCurrentItem(c),
g.hideShowroomMainImage(h))):g.hideShowroomMainImage(h))}catch(D){}a.logValue(a.TIMER_NAMES.SHOWROOM_IMAGEBLOCK_LATENCY_UPDATE,new Date-r)};(c=document.getElementById("ivShowroomTabHeading"))&&c.addEventListener("click",function(b){a.addOne(a.COUNTER_NAMES.TAB_SELECT);b=m.getDataForAsin(y).defaultStageId;b=a.createShowroomAtfEvent(b,y,a.EVENT_NAMES.IMMERSIVE_VIEW_TAB_CLICK,a.STATUS_TYPES.SUCCESS);a.logShowroomAtfEvent(b)});a.logValue(a.TIMER_NAMES.SHOWROOM_IMAGEBLOCK_LATENCY_INVOKE,new Date-t)}});
"use strict";k.register("showroom-image-block-constants",function(){return{SHOWROOM_THUMBNAIL_TYPE:"showroom-image",SHOWROOM_MAIN_IMAGE_TYPE:"showroom-main-image",TWISTER_DATA_EVENT:"showroomTwisterData",STRING_IDS:{MAIN_IMAGE_OVERLAY_TEXT:"showroom_dp_imageblock_atf_main_image_overlay_text",MAIN_IMAGE_OVERLAY_BUTTON_TEXT:"showroom_dp_imageblock_atf_main_image_overlay_text_T2",MAIN_IMAGE_OVERLAY_ICON_URL:"showroom_dp_imageblock_atf_main_image_overlay_icon_url"}}});"use strict";k.when("A","jQuery",
"imageBlockUtils","showroom-lite-atf-feature-data","showroom-image-block-constants","showroom-image-block-metrics").register("showroom-image-block-detail-page-rendering",function(b,f,m,g,e,a){function c(b){a.addOne(a.COUNTER_NAMES.SHOWROOM_IMAGEBLOCK_MAIN_IMAGE_SELECT);var c=a.createShowroomAtfEvent(n,k,a.EVENT_NAMES.IMAGEBLOCK_MAIN_IMAGE_CLICK,a.STATUS_TYPES.SUCCESS);a.logShowroomAtfEvent(c);d(b)}function d(a){a.action="showroomIngressClick";a.data=l;p.dispatch("showroomIngressClick",a)}var k,p,
n,l;return{createThumbnail:function(a,b,c,f){c===a.maxAlts&&(b.find(".item.imageThumbnail").last().remove(),c--);l={type:"showroomIngress",index:0,thumbnailIndex:c,variant:f.variant};m.createThumbnail({type:e.SHOWROOM_THUMBNAIL_TYPE,index:0,thumbnailIndex:c,variant:f.variant},f.thumb,b,"showroom-imageblock-thumbnail");c++;return c},updateMainImage:function(a,d){var h=a.find("#showroom-main-image");h.length?h.attr("src",d.hiRes):(h=f(('\x3cdiv id\x3d"showroom-main-image-container"\x3e                    \x3cimg src\x3d"'+
d.hiRes+'" id\x3d"showroom-main-image"/\x3e                \x3c/div\x3e').trim()),h.appendTo(a),b.declarative.create(a,"showroom-image-action",l),b.declarative("showroom-image-action",["click"],c),h.addClass("image-gradient-hue"),d=g.getStringValue(e.STRING_IDS.MAIN_IMAGE_OVERLAY_TEXT),h=g.getStringValue(e.STRING_IDS.MAIN_IMAGE_OVERLAY_BUTTON_TEXT),f(('\x3cdiv id\x3d"showroom-main-image-overlay-container"\x3e                    \x3cdiv style\x3d"padding-bottom: 7px;width: 40%;"\x3e                        \x3cspan id\x3d"showroom-main-image-overlay-subtext"\x3e'+
d+'\x3c/span\x3e                    \x3c/div\x3e                    \x3cspan class\x3d"a-button a-button-base"\x3e                        \x3cspan class\x3d"a-button-inner"\x3e                            \x3cinput class\x3d"a-button-input"\x3e                            \x3cspan class\x3d"a-button-text" id\x3d"showroom-main-image-overlay-button"\x3e                                \x3cimg id\x3d"showroom-main-image-overlay-icon" src\x3d"https://m.media-amazon.com/images/G/01/showroom/icon-lightbulb._CB628497379_.png"/\x3e'+
h+"\n                            \x3c/span\x3e                        \x3c/span\x3e                    \x3c/span\x3e                \x3c/div\x3e").trim()).appendTo(a))},hideShowroomMainImage:function(a){a.parent().css("z-index",-1);a.parent().addClass("aok-hidden")},showShowroomMainImage:function(a){a.parent().css("z-index",2);a.parent().removeClass("aok-hidden")},isShowroomMainImageHidden:function(){return f("#showroom-outer-container").hasClass("aok-hidden")},handleShowroomIngressClick:d,handleShowroomThumbnailClick:function(b){a.addOne(a.COUNTER_NAMES.SHOWROOM_IMAGEBLOCK_THUMBNAIL_SELECT);
var c=a.createShowroomAtfEvent(n,k,a.EVENT_NAMES.IMAGEBLOCK_THUMBNAIL_CLICK,a.STATUS_TYPES.SUCCESS);a.logShowroomAtfEvent(c);d(b)},handleShowroomMainImageClick:c,refresh:function(a,b,c){p=a;k=b;n=c}}});"use strict";k.when("A").register("showroom-image-block-metrics",function(b){return{EVENT_NAMES:{IMAGEBLOCK_LOAD:"srm_atf_imageBlock_load",IMAGEBLOCK_THUMBNAIL_CLICK:"srm_atf_thumbnail_click",IMAGEBLOCK_MAIN_IMAGE_CLICK:"srm_atf_main_image_click",IMMERSIVE_VIEW_TAB_CLICK:"srm_atf_iv_tab_click"},COUNTER_NAMES:{SHOWROOM_IMAGEBLOCK_FEATURE_RENDERED:"showroom:atf:imageBlock:feature:render",
SHOWROOM_IMAGEBLOCK_THUMBNAIL_HOVER:"showroom:atf:imageBlock:thumbnail:hover",SHOWROOM_IMAGEBLOCK_THUMBNAIL_SELECT:"showroom:atf:imageBlock:thumbnail:select",SHOWROOM_IMAGEBLOCK_MAIN_IMAGE_SELECT:"showroom:atf:imageBlock:mainImage:select",SHOWROOM_IMAGEBLOCK_FAILED_TO_INITIALIZED_WEBLAB_TRIGGER:"showroom:atf:imageBlock:failedToInitializeWeblabTrigger",TAB_SELECT:"showroom:atf:tab:select"},STATUS_TYPES:{SUCCESS:"success",ERROR:"error"},TIMER_NAMES:{SHOWROOM_IMAGEBLOCK_LATENCY_INVOKE:"showroom:atf:imageBlock:latency:invoke",
SHOWROOM_IMAGEBLOCK_LATENCY_LOAD:"showroom:atf:imageBlock:latency:load",SHOWROOM_IMAGEBLOCK_LATENCY_RENDER:"showroom:atf:imageBlock:latency:render",SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_GET_DATA_FOR_ASIN:"showroom:atf:imageBlock:latency:render:getDataForAsin",SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_UPDATE_MAIN_IMAGE:"showroom:atf:imageBlock:latency:render:updateMainImage",SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_CREATE_THUMBNAIL:"showroom:atf:imageBlock:latency:render:createThumbnail",SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_UTIL_CREATE_THUMBNAIL:"showroom:atf:imageBlock:latency:render:utilCreateThumbnail",
SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_UNHIDE_TAB_HEADING:"showroom:atf:imageBlock:latency:render:unhideTabHeading",SHOWROOM_IMAGEBLOCK_LATENCY_RENDER_LOG_EVENT:"showroom:atf:imageBlock:latency:render:logEvent",SHOWROOM_IMAGEBLOCK_LATENCY_UPDATE:"showroom:atf:imageBlock:latency:update",SHOWROOM_IMAGEBLOCK_LATENCY_UPDATE_HANDLE_THUMBNAIL_EVENT:"showroom:atf:imageBlock:latency:update:handleThumbnailEvent"},addOne:function(b){try{if(d.ue&&b){var f=(d.ue.count(b)||0)+1;d.ue.count(b,f)}}catch(g){}},logValue:function(b,
m){try{d.ue&&b&&"number"===typeof m&&d.ue.count(b,m)}catch(g){}},createShowroomAtfEvent:function(f,d,g,e){var a={};a.showroomId=f;a.asin=d;a.eventType=g;a.status=e;a.device=b.capabilities?b.capabilities.isAmazonApp?"AmazonApp":b.capabilities.mobile?"mobile":b.capabilities.tablet?"tablet":"desktop":"";a.userAgent=navigator?navigator.userAgent:"";a.producerId="showroom_atf";a.schemaId="com.amazon.showroom.ingress.clientEvent.3";return a},logShowroomAtfEvent:function(b){try{d.ue&&d.ue.event&&b&&d.ue.event(b,
"showroom_atf","com.amazon.showroom.ingress.clientEvent.3")}catch(m){}}}});"use strict";k.when("A","showroom-image-block-constants").register("showroom-lite-atf-feature-data",function(b,d){function f(){return e[a]}function g(a){return a in e}var e={},a;return{setData:function(c){c&&c.asin&&c.imageDomain&&c.defaultCollageUrl&&c.defaultStageId&&Array.isArray(c.itemMainImagePhysicalIds)&&(a=c.asin,g(c.asin)||(e[c.asin]=c,b.trigger(d.TWISTER_DATA_EVENT,c.asin)))},getDataForCurrentAsin:f,getDataForAsin:function(a){return e[a]},
getStringValue:function(a){return f().displayStrings?f().displayStrings[a]:""},isDataValidForAsin:g}})});
/* ******** */
