(function(v){var u=window.AmazonUIPageJS||window.P,B=u._namespace||u.attributeErrors,f=B?B("DetailPageDesktopTwisterAssets",""):u;f.guardFatal?f.guardFatal(v)(f,window):f.execute(function(){v(f,window)})})(function(v,u,B){v.when("A","new-desktop-twister-view","desktop-twister-widgets-factory","desktop-twister-slot-manager","desktop-twister-dynamic-style","desktop-twister-utils","desktop-twister-dropdown","desktop-twister-logger","twister-js-init-dpx-data","twister-plus-desktop-twister-mark-render").register("desktop-twister-view-initialiser",
function(f,m,t,p,d,r,q,y,z){var x=z?z.inlineTwisterData||{}:{};x.inlineTwisterEnabled&&(y=new y,new m(z,t.Row,q,p,d,r,y),!x.shouldDelayRegistrationWithTwisterCore&&f.trigger("desktop-twister-view-initialized"))});"use strict";v.when("A","desktop-twister-constants","3p-promise").register("new-desktop-twister-view",function(f,m,t){var p=f.$;return function(d,r,q,y,z,x,I){function v(){"function"===typeof u.markFeatureInteractive&&u.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"twister-plus-new-desktopTwister"}]})}
function n(){if(!A)return 0===d.unselectedDimCount;var a=c();return!!A.util.getAsinFromSelectionInfo(a)}function b(a,c,b,e,l,g,h,n,k,f,d){return{text:a,image:c||"",name:b,id:f+"_"+b,selected:e,slotHtm:l,showSlot:g,isVisible:h,unavailable:n,defaultSlotUnavailable:L,asin:k,pageUrl:d}}function a(a,c){var b=M.unselectedDimensionPrompt||"",e=d&&d.variationDisplayLabels?d.variationDisplayLabels[a]:"",l=d&&d.variationValues?d.variationValues[a][c]:"";return{dimKey:a,titleSelectorPrefix:"inline-twister-dim-title-",
titleValueSelector:"inline-twister-dim-title-value",mainText:e,subText:-1!==c?l:b.replace("###dimension",e||"")}}function c(){if(!A){var a=[];f.each(h.dimList,function(c){a.push({dimKey:c,val:d.selectedVariationValues?d.selectedVariationValues[c]:-1})});return a}return A.state()}function e(){return f.map(h.dimList,function(a,c){if(!h.isSingletonMap[a]&&!h.rows[a].dimType)return new t(function(b){k(h.rows[a],a,c);b()})})}function k(a,c,e){var l=h.inlineTwisterData.slotsEnabledDimensions,g=!!((h.dimList.length===
l.length?l[e]:l[0])&&n(c));e=d.variationValues[c];var k=a.getInitialVisibleSwatchList(),w=[];f.each(e,function(a,e){a=b(a,N[c+"::"+e],e,h.initSelectionState[c].val===e,k[e]?k[e].slotHtm:"",g,k[e]&&k[e].isVisible,k[e]&&k[e].unavailable,B,c,G[c]?G[c][a]:null);w.push(a)});h.swatches[c]=w}function l(){f.each(h.rows,function(a){h.isSingletonMap[a.dimKey]||a.dimType||(a.createDisplaySwatches(),h.textSwatchMap[a.dimKey]&&a.toggleSwatch.alignTextSwatches())})}function g(){function e(a,c,e){var l,g,k,n=a.expanderContent.find(".inline-twister-swatch:not(.aok-hidden):not(.swatch-prototype)"),
w=d.variationValues[c]||[],K=h.inlineTwisterData.inlineVariationsSize,q=-1,D=[],m=null;-1===K&&(q=parseInt(a.expanderContent.attr("data-swatchCountPerRow"))||n.length);f.each(n,function(n,h){var f=parseInt(n.getAttribute("data-idxInToggleSwatchList")),d="true"===n.getAttribute("data-initiallySelected"),C="true"===n.getAttribute("data-initiallyUnavailable");l=n.getAttribute("data-asin");g=f;k=w[f]||"";f=N[c+"::"+g];var F=k;d=b(F,f,g,d,"",e,!0,C,l,c,G[c]?G[c][F]:null);a.toggleSwatch&&(C=a.toggleSwatch.createSwatch(d,
n),d.isVisible=C.isVisible);D.push(d);-1!==K&&-1===q&&(n=n.getBoundingClientRect().top,null===m?m=n:n!==m&&(q=h))});h.inlineVariationsSize[c]=n.length;a.toggleSwatch&&a.toggleSwatch.setNumberOfSwatchesPerRow(q);return D}function l(a,c){var e=!(!a||!n(c)),b=h.rows[c].getInitialVisibleSwatchList();e&&f.each(b,function(e){if(!e.unavailable){var b=h.slotManager.get(e.asin,c,h.noOfLoadingIndicator,F,e.isImageSwatch);e.updateSlotNode({showSlot:a,slotHtm:b},c)}})}function g(a,e,b){return{divMetadata:{dimIndex:h.dimIndexMap[a],
dimValueIndex:e},eventType:b,subType:m.DP_STATE_VIEW_SUBTYPE,dimensionsMap:h.dimensionsMap,currDimCombId:x.getCurrDimCombId(c(),m.CHAR_UNDERSCORE)}}var k=c(),D=0,z={},y=h.inlineTwisterData.slotsEnabledDimensions;p.each(k,function(a,c){z[c.dimKey]=c;h.dimIndexMap[c.dimKey]=a;h.dimensionsMap[a]=c.dimKey});h.initSelectionState=z;p.each(h.dimList,function(e,b){var g=z[b].val;e=C(b);g=a(b,g);var n=-1!==O.indexOf(b),k={handleDimensionExpansion:function(a,e,g){b=a.dimKey;if(g){a=B;g={};J[b]?(g=w(h.swatches[b],
e,b,c(),!n),h.indexTranslationMap[b]=g,a={swatches:h.swatches[b]}):(l(e,b),J[b]=!0);var k=h.rows[b];k.setState(a,g,E,null,!1);H(e,k,b);h.logger.logDimensionExpanded(b)}else h.logger.logDimensionCollapsed(b)}};h.textSwatchMap[b]=e;e={showSlot:!1,dimKey:b,inlineTwisterData:h.inlineTwisterData};d.variationValues[b].length>d.inlineTwisterData.numberOfSwatchPerDimension?(e={dimName:b,currDimCombId:x.getCurrDimCombId(c(),m.CHAR_UNDERSCORE)},e=new q(d,e)):e=new r("inline-twister-row-",g,e,k,h.logger);h.rows[b]=
e;D+=1});0===h.inlineTwisterData.numberOfDimensionsExpanded&&(v(),P=!0);D=0;p.each(h.dimList,function(a,b){function l(a){if(a){var c=parseInt(a[m.STRING_DIM_VALUE_INDEX],10);E=b=a[m.STRING_DIM_KEY];a={dimKey:b,val:c};u.newTwisterInteractionStartTime=new Date;h.twister.metaData(g(b,c,m.viewEvents.CLICK));h.twister.dimensionChanged(a);h.logger.logDimensionValueClick()}}var k=h.textSwatchMap[b],f=[];a=h.dimList.length===y.length?y[D]:y[0];var w=-1!==O.indexOf(b),q=h.rows[b];h.showSlotMap[b]=a;var C=
-1!==d.singletonDimensionKeys.indexOf(b);h.isSingletonMap[b]=C;D+=1;!C&&q&&(C=!(!a||!n(b)),k={name:b,swatches:f,isTextSwatch:k,onChange:function(a,c,e){if(c){var l=parseInt(c.buttonName,10);b=c.buttonGroupName;a[l]&&a[l].selected&&h.logger.logSelectedSwatchClick();E=b;a={dimKey:b,val:l};u.newTwisterInteractionStartTime=new Date;h.twister.metaData(g(b,l,m.viewEvents.CLICK));h.twister.dimensionChanged(a);h.logger.logDimensionValueClick();e&&h.logger.logDimValueClickAfterAutoUpdate()}},onHover:function(a,
b){var e=b.data;b=b.type;var l=[];if(e){if(b===m.viewEvents.MOUSE_ENTER){var n=parseInt(e.name,10);l.push({dimKey:a,val:n})}else l=c();A&&(h.twister.metaData(g(a,n,b)),h.twister.dimensionPeek(l));E=a}},totalSwatchCount:(d.variationValues[b]||[]).length,preserveNaturalSwatchOrder:w},f={handleWindowResize:function(a){A&&H(h.showSlotMap[a],h.rows[a],a)}},q.dimType&&"dropdown"===q.dimType?q.initialize({onDropdownChange:l}):(q.initializeComponents(k,a,f),f=e(q,b,C),h.swatches[b]=f))});P||v()}function C(a){var c=
!0;(h.inlineTwisterData.disableImageSwatch===B?0:h.inlineTwisterData.disableImageSwatch)||(c=!h.inlineTwisterData.imageDimensionKeysMap[a]);return c}function w(a,c,b,e,l,g){var k=!(!c||!n(b));c=A.util.getDimAvailability(b,e);var d={},w=0,q=-1;p.each(e,function(a,c){c.dimKey===b&&(q=c.val)});-1!==q&&(l&&(d[q]=w),w++);f.each(c.available,function(c){a[c.index]=a[c.index]||{};var e=a[c.index];e.unavailable=!1;var n=e.isVisible,f=""!==e.image;e.slotHtm=k&&n?h.slotManager.get(c.asin,b,h.noOfLoadingIndicator,
F,f,g):e.slotHtm||"";l&&q!==c.index&&(d[c.index]=w);e.showSlot=k;e.selected||w++});f.each(c.unavailable,function(c){a[c.index]=a[c.index]||{};var e=a[c.index];e.unavailable=!0;l&&(e.isVisible=w<h.inlineVariationsSize[b]);e.slotHtm=k?L:"";l&&(d[c.index]=w);e.showSlot=k;w++});J[b]=!0;return d}function H(a,c,b){a&&(h.slotManager.resetMinSlotHeight(b),a=c.toggleSwatch.getSlotNodes(),D(a,b),h.slotManager.updateSlotHeight(b))}function D(a,c){h.slotManager.resetSlotHeight(c);f.each(a,function(a,b){f.each(a,
function(a){h.slotManager.setState(a,c,b)})})}function F(a){H(!0,h.rows[a],a)}var h=this,A=B;this.data=d;this.noOfLoadingIndicator=1;this.dimList=d.reorderedDimensionListKeys||[];this.dimensionsMap=[];this.logger=I;this.inlineTwisterData=d?d.inlineTwisterData||{}:{};this.swatches={};var M=this.inlineTwisterData&&this.inlineTwisterData.stringTranslationMap?this.inlineTwisterData.stringTranslationMap:{},L='\x3cspan class\x3d"a-size-small default-slot-unavailable"\x3e'+(M.defaultSlotUnavailableString||
"")+"\x3c/span\x3e",N=d.imageHashMap||{},G=d.dimensionPageLoadUrls||{};this.rows={};this.isSingletonMap={};this.indexTranslationMap={};this.textSwatchMap={};var E;this.initSelectionState={};this.inlineVariationsSize={};this.dimIndexMap={};this.showSlotMap={};var O=h.inlineTwisterData.dimsWithSwatchReorderingDisabled||[],J={},P=!1;(function(){var a=h.logger.createFunctionTimerInstance("desktopTwisterInitTime");a.start();g();a.stop()})();f.on("register-desktop-twister-with-twisterCore",function(b,g){A=
b;h.logger.registerTwisterCore(A);b=c();var n=h.inlineTwisterData.slotsEnabledDimensions,k={};p.each(b,function(a,c){k[c.dimKey]=c});A.slotsDimSum.addDefaultQueryParameter("showFancyPrice",h.inlineTwisterData.showFancyPrice);A.slotsDimSum.addDefaultQueryParameter("twisterFlavor",m.DESKTOP_TWISTER_FLAVOR);h.slotManager=new y(A,z,h.logger,h.inlineTwisterData);var q=0;f.each(h.rows,function(c){function b(b){var n={};var k=b.selected().selectionInfo();p.each(k,function(a,c){n[c.dimKey]=c});var d=n[e].val;
b=h.swatches[e];b[d]=b[d]||{};b[l]=b[l]||{};b[l].selected=!1;b[d].selected=!0;l=d;w(b,g,e,k,!1,g);k=a(e,d);d={swatches:b};var q=f.filter(b,function(a){return a.isVisible});b.length===q.length&&(h.inlineVariationsSize[e]=b.length);c.setState(d,{},E,k,!1);H(g,c,e);f.each(h.rows,function(a){h.isSingletonMap[a.dimKey]||a.dimType||(a.toggleSwatch.repopulateDisplaySwatches(),h.textSwatchMap[a.dimKey]&&a.toggleSwatch.alignTextSwatches())})}if(!h.isSingletonMap[c.dimKey]){c.dimType||c.postInitialize();var e=
c.dimKey,l=k[e].val;C(e);var g=h.dimList.length===n.length?n[q]:n[0];h.twister=A.registerActive({viewAttribution:"DetailPage",viewName:"DesktopTwisterRowView_"+e},c.dimType&&"dropdown"===c.dimType?{updateView:function(a,b){var e={};e={};var l={};"VARIATION_CHANGE"===a&&(e=b.selected(),e=x.getDimensionValuesData(e.selInfo,d),l=x.constructEventInfo(d,A,m.viewEvents.CLICK,b,e),f.delay(function(){c.updateView(l)}))}}:{updateView:function(l,g){var k={};"VARIATION_CHANGE"===l?f.delay(function(){b(g)}):
"VARIATION_PEEK"===l&&(l=g.peek().selectionInfo(),p.each(l,function(a,c){k[c.dimKey]=c}),l=k[e].val,l=a(e,l),E===e&&c.title.setState(l))}})}q++});t.all(e()).then(function(){l()});f.trigger("desktop-twister-twisterCore-initialized",h);g.then(function(){f.each(h.rows,function(a){a.activatePageRefresh()})})})}});"use strict";v.when("A").register("desktop-twister-constants",function(f){return{AJAX_CALL_TIMEOUT:2E4,DIMENSION_VALUE:"DimensionValue###",DISPLAY_VALUE:"DisplayValue###",SWATCH_DATA:"SwatchData###",
DESKTOP_TWISTER_FLAVOR:"twisterPlusDesktopConfigurator",MAX_DIMENSION_FLAVOUR_CAP:3,POPOVER_DELAY:500,MAX_INLINE_ROWS:7,SIDE_SHEET_ANIMATION_SPEED:300,SIDE_SHEET_PADDING:32,TEXT_SWATCH_MARGIN_RIGHT:6,CONFIGURED_SLOTS:["price","ms3","twisterPrimeWardrobe","twisterAvailability","deliveryPromise"],DP_STATE_VIEW_SUBTYPE:"DETAILPAGE_STATE_VIEW_METADATA",CHAR_UNDERSCORE:"_",CHAR_ASTERISK:"*",ID_SELECTOR:"#",INDEX_FOR_SELECT_OPTION:"-1",DEFAULT_SCROLLER_WIDTH:20,BORDER_WIDTH:2,TEXT_ALIGNMENT_LIMIT:400,DEFAULT_TEXT_SWATCH_SPACING:16,
DEFAULT_IMAGE_SWATCH_SPACING:8,REDUCED_IMAGE_SWATCH_SPACING:4,TWISTER_DIMENSION_VIEW_DROPDOWN:"dropdown",NATIVE_DROPDOWN_DIV_PREFIX:"#native_",DROPDOWN_DIV_NAME:"dropdown_selected_",STRING_EVENT_TYPE:"eventType",STRING_EVENT_DATA:"eventData",STRING_DIMENSION_SELECTION_DATA:"dimensionSelectionData",STRING_DIM_NAME:"dimName",STRING_DIM_ORDER:"dimOrder",STRING_DIM_INDEX:"dimIndex",STRING_DIM_KEY:"dimKey",STRING_DIM_VALUE_INDEX:"dimValueIndex",STRING_UNAVAILABLE_POPOVER_STRING_VALUE:"unavailablePopOverStringValue",
STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE:"currentlyUnavailablePopOverStringValue",CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED:"isCurrentlyUnavailableWeblabEnabled",EVENT_TYPE_DROPDOWN_CHANGE:"dropdownChange",AUI_DROPDOWN_EVENT_PREFIX:"a:dropdown:selected:",STRING_IS_SELECTED:"isSelected",STRING_IS_REQUIRED:"isRequired",STRING_STYLE:"style",CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION:"dropdownSelect",STRING_CSS_CLASS:"css_class",STRING_NATIVE_CSS_CLASS:"native_css_class",STRING_HTML_CONTENT:"html_content",
CLASS_FOR_DROPDOWN_UNAVAILABLE:"dropdownUnavailable",CLASS_FOR_DROPDOWN_CURRENTLY_UNAVAILABLE:"dropdownCurrentlyUnavailable",STYLE_CLASS_TYPE_FOR_SELECTED:"selected",STYLE_CLASS_TYPE_FOR_UNAVAILABLE:"unavailable",STYLE_CLASS_TYPE_FOR_AVAILABLE:"available",STYLE_CLASS_TYPE_FOR_INVALID:"invalid",STRING_DISPLAY_CONFIG_STYLES_DATA:"displayConfigStylesData",TWISTER_CURRENT_ASIN:"currentAsin",INIT_DATA_DELETED_LANDING_ASIN_INFO:"deletedLandingAsinInfo",STRING_DIM_COMB_ID:"dimCombID",STRING_EVENT_DIV_METADATA:"divMetaData",
STRING_EVENT_DIM_INFO:"eventDimInfo",viewEvents:{MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",CLICK:"click",DROPDOWN_CHANGE:"dropdownChange",TWISTER_REFRESH:"twisterRefresh"},sideSheetSelectors:{EXPANDER_CONTENT_PREFIX:"#inline-twister-expander-content-",SEC_VIEW_DIMENSION_VALUE_LIST:" #tp-inline-twister-dim-values-container",DIMENSION_VALUES_LIST:" .dimension-values-list",DIMENSION_VALUES_LIST_ODD_CHILD:" .dimension-values-list \x3e :nth-child(odd)",DIMENSION_VALUES_LIST_EVEN_CHILD:" .dimension-values-list \x3e :nth-child(even)",
LIST_ITEM_CIRCULAR_IMAGE:".dimension-value-list-item-circular-image",CIRCULAR_IMAGE_SWATCH_BUTTON:".circle-image-swatch-button",LIST_ITEM_SQUARE_IMAGE:".dimension-value-list-item-square-image",SQUARE_IMAGE_SWATCH_BUTTON:".image-swatch-button",TEXT_LIST_ITEM:".swatch-list-item-text",TEXT_SWATCH_BUTTON:".text-swatch-button",TEXT_SWATCH_BUTTON_WITH_SLOTS:".text-swatch-button-with-slots",IMAGE_SELECTOR:".swatch-image",SEC_VIEW_TOGGLE_BUTTON_PREFIX:"sec_",DELAY:200},widgetSelectors:{EXPANDER_CONTENT_PREFIX:"#inline-twister-expander-content-",
EXPANDER_HEADER_PREFIX:"#inline-twister-expander-header-",DIMENSION_EXPANDER_ICON_PREFIX:"#dimension-expander-icon-",DIMENSION_EXPANDER_ICON_WRAPPER:".dimension-expander-icon-wrapper",EXPANDED_DIMENSION_TEXT_PREFIX:"#inline-twister-expanded-dimension-text-",COLLAPSED_DIMENSION_TEXT_PREFIX:"#inline-twister-collapsed-dimension-text-",AUTO_NOTIFICATION_EXPANDED:"#inline-twister-auto-notification-expanded",AUTO_NOTIFICATION_COLLAPSED:"#inline-twister-auto-notification-collapsed",IMAGE_THUMBNAIL:".dimension-collapsed-image-thumbnail",
SWATCH_NODE_SELECTOR:".inline-twister-swatch",SLOT_NODE_SELECTOR:".dimension-slot-info",TOGGLE_BUTTON_SELECTOR:".a-button-toggle",IMAGE_SELECTOR:".swatch-image",DIMENSION_VALUES_LIST:".dimension-values-list",IMAGE_SWATCH_HORIZONTAL:".image-swatch-button-with-slots-horizontal",IMAGE_SWATCH_VERTICAL:".image-swatch-button-with-slots",IMAGE_SWATCH_WITH_NO_SLOT:".image-swatch-button",IMAGE_SWATCH_FALLBACK:".image-swatch-button-fallback"},classes:{A_COLOR_ATTAINABLE:"a-color-attainable",AOK_HIDDEN:"aok-hidden",
DIMENSION_EXPANDER_CONTENT_EXPAND:"dimension-expander-content-expand",ROTATE:"rotate",A_BUTTON_UNAVAILABLE:"a-button-unavailable",A_BUTTON_SELECTED:"a-button-selected",A_BUTTON_FOCUS:"a-button-focus",ROW_IDENTIFIER_PREFIX:"desktop-twister-dim-row-"},cssConstants:{BG_COLOR:"background-color",GREEN_BG_COLOR:"#D9EED9",WHITE_BG_COLOR:"white"},loggingConstants:{ATTRIBUTION:"TwisterPlusNewDesktopTwister",ERROR:"ERROR"}}});"use strict";v.when("A").register("desktop-twister-logger",function(f){function m(){if(!(this instanceof
m))return new m;d||(d=this);return d}function t(d){if("undefined"!==typeof u.csa){var f=u.csa("Events",{producerId:"dp-rpcx"}),q=r.count(d)||0;f("log",{schemaId:"dpRpcx.CSALoggingSchema.5",eventName:d,valueToLog:q},{ent:"all"})}}var p=f.$,d,r=u.ue;m.prototype={registerTwisterCore:function(d){this.twisterCore=d},logCSMDataOnLanding:function(){var d=0,f=0,m=0,x=this.twisterCore.util,v=x.tvm.dimensionInfo,u=this.twisterCore.state().length,n=Object.keys(x.tvm.dimCombinations).length;p.each(v,function(b,
a){b=a.dimKey;x.isRequiredDim(b)&&m++;x.isSingletonDim(b)?f++:d++});r&&r.count&&(r.count("dpMobileTwisterDropdownPresent",d),t("dpMobileTwisterDropdownPresent"),r.count("dpMbileTwisterSingletonDim",f),t("dpMbileTwisterSingletonDim"),r.count("dpMobileTwisterRequiredDim",m),t("dpMobileTwisterRequiredDim"),r.count("dpMobileTwisterDimSize",u),t("dpMobileTwisterDimSize"),r.count("dpMobileTwisterFamilySize",n),t("dpMobileTwisterFamilySize"),r.count("twisterPlus.inlineTwisterGV",1),t("twisterPlus.inlineTwisterGV"))},
logCSMTagsOnLanding:function(d){function q(a,c,b){var e=[];if(c===b)e.push(""),a=a[c],f.$.isArray(a)?f.each(a,function(a,c){e.push(a)}):e.push(a);else{var l=Math.floor((c+b)/2);c=q.call(this,a,c,l);var g=q.call(this,a,l+1,b);f.each(c,function(a,c){f.each(g,function(c,b){e.push(""===a?c:""===c?a:a+":"+c)})})}return e}function m(a){a&&p.push(a)}var r=this,p=[],t=!0,n=!0,b=[0,3,8,25,50,100,1E3,5E3],a=Object.keys(this.twisterCore.util.tvm.dimCombinations).length;if(d.dimensionList){var c="variation_dimension:"+
d.dimensionList.length;f.each(d.dimensionList,function(a,c){r.addCSMTag(a)})}for(var e=1;e<b.length;e++)if(a<=b[e]){var k="family_size_bucket:"+b[e-1]+"-"+b[e];break}else e===b.length-1&&(k="family_size_bucket:gt"+b[e]);d.dimensionInfo&&f.each(d.dimensionInfo,function(a,c){a.isSingleton||(t=!1)});b=t?"SingletonFamily":"DesktopTwister";d.initDimCombination&&f.each(d.initDimCombination,function(a,c){-1===a.val&&(n=!1)});m(c);m(k);m(b);n&&m("defaultSelection");d=q.call(this,p,0,p.length-1);(function(a){var c=
this;f.each(a,function(a,b){a&&c.addCSMTag(a)})}).call(this,d)},createFunctionTimerInstance:function(d){var f=this;return{eventType:d,start:function(){this.startTime=Date.now()},stop:function(){this.startTime&&f.logCounter(this.eventType,Date.now()-this.startTime)}}},addCSMTag:function(d){u.ue&&u.ue.tag&&u.ue.tag(d)},logCounter:function(d,f){r&&r.count&&(f===B?r.count(d,(r.count(d)||0)+1):r.count(d,f),t(d))},logBottomSheetPageUpdate:function(d){this.logCounter("twisterPlus.inlineTwisterPageUpdate")},
logSelectedSwatchClick:function(){this.logCounter("twisterPlus.inlineTwister.selectedSwatchClick")},logDimensionValueClick:function(){this.logCounter("dpmobiletwisterclickOndimval")},logDimensionCollapsed:function(d){this.logCounter("twisterPlus.inlineTwister.dimCollapse."+d)},logDimensionExpanded:function(d){this.logCounter("twisterPlus.inlineTwister.dimExpand."+d)},logDimExpansionAfterAutoUpdate:function(){this.logCounter("twisterPlus.inlineTwister.dimExpansionAfterAutoUpdate")},logDimValueClickAfterAutoUpdate:function(){this.logCounter("twisterPlus.inlineTwister.dimValueClickAfterAutoUpdate")},
logAvailabilitySlotRender:function(){this.logCounter("twisterPlus.inlineTwister.availabilitySlotRender")},logPPUSlotRender:function(){this.logCounter("twisterPlus.inlineTwister.ppuSlotRender")},logPrimeSlotRender:function(){this.logCounter("twisterPlus.inlineTwister.primeSlotRender")},logPriceSlotRender:function(){this.logCounter("twisterPlus.inlineTwister.priceSlotRender")},logDeliverySlotRender:function(){this.logCounter("twisterPlus.inlineTwister.deliverySlotRender")},logReviewsSlotRender:function(){this.logCounter("twisterPlus.inlineTwister.reviewsSlotRender")}};
return m});"use strict";v.when("A").register("desktop-twister-dynamic-style",function(f){function m(d,f){this.name=d;this.styleNode;this.rules=f||[];this.pendingRefresh}var t=f.$,p={};m.prototype={refresh:function(){var d=t("\x3cdiv /\x3e",{html:"\x26shy;\x3cstyle\x3e"+this.rules.join(" ")+"\x3c/style\x3e"});this.styleNode?(this.styleNode.replaceWith(d),delete this.styleNode,this.styleNode=d):(this.styleNode=d,this.styleNode.appendTo("body"))}};return{addCSSRules:function(d,f){p[d]?p[d].rules=f||
[]:p[d]=new m(d,f);p[d].refresh()}}});"use strict";v.when("A","desktop-twister-constants","desktop-twister-register").register("desktop-twister-slot-manager",function(f,m,t){function p(d,b,a,c){this.twisterCore=d;this.batch={};this.currentBatch;this.maxSlotHeight={};this.minSlotHeight={};this.evenSlotHeight={};this.dynamicStyle=b;this.slotIdentifierMap={};this.logger=a;this.auiPriceSize=c&&c.auiPriceSize?c.auiPriceSize:"m";this.currentlyUnavailableMessage=c&&c.stringTranslationMap?c.stringTranslationMap.currentlyUnavailableMessage:
"";this.desktopTwisterSlots=c&&c.desktopTwisterSlots?c.desktopTwisterSlots:[]}function d(d,b,a,c){b=this.batch;var e=this;b[d]=b[d]||[];b[d].push(a);clearTimeout(this.currentBatch);this.currentBatch=setTimeout(function(){var a=f.map(e.batch,function(a,c){return c});e.twisterCore.slotsDimSum.get(a,function(a){var b=e.batch[a.ASIN];b&&(v.each(b,function(c,b){b(a)}),delete e.batch[a.ASIN]);x(e.batch)&&(b=Object.keys(e.maxSlotHeight),f.each(b,function(a){c(a)}))})},0)}function r(d,b,a,c){a[b]=a[b]||{};
a[b].uniqueCount=a[b].uniqueCount||0;var e="inline-twister-dimsum-loading-"+b+"-"+a[b].uniqueCount;a[b].uniqueCount+=1;return{loadingHtm:'\x3cdiv class\x3d"'+e+(d?c?" loading-indicator-1":" loading-indicator-2":"")+'"\x3e\x3cdiv\x3e\x3c/div\x3e\x3c/div\x3e',promise:function(a){var c=v("."+e+":not(.loading-indicator-in-popover)").parent();c.length&&c.html(a)}}}function q(d){return d.replace(/\n/g,"").replace(/[\t ]+</g,"\x3c").replace(/>[\t ]+</g,"\x3e\x3c").replace(/>[\t ]+$/g,"\x3e")}function y(d,
b){return q(u.default.call(this,d.content.twisterSlotDiv,b))}function z(d,b){if(!d||0===d.length)return b;if(0<d.find(".loading-indicator-1").length)return d[0].scrollHeight;if(0===d.find(".defaultSlotUnavailable").length)return b;d=d[0].scrollHeight;b<d&&(b=d);return b}function x(d){for(var b in d)if(d.hasOwnProperty(b))return!1;return!0}var v=f.$,u={default:function(d,b){d=v("\x3cdiv\x3e"+d+"\x3c/div\x3e");var a=d.find(".price_slot_ppu"),c=d.find("#ms3slot"),e=d.find("#twisterAvailability"),k=d.find("#deliveryPromisePrefix"),
l=d.find(".variationReviewsSection"),g=this.desktopTwisterSlots,f=d.find(".twister_swatch_price"),n=d.find(".apex_on_twister_price");0<e.length&&(0===f.length&&0===n.length?(e.parent().find(".a-size-medium").removeClass("a-size-medium").addClass("a-size-small"),e.parent().find(".a-size-mini").removeClass("a-size-mini").addClass("a-size-small"),e.parent().find(".a-size-large").removeClass("a-size-large").addClass("a-size-small")):-1===g.indexOf("twisterAvailability")&&e.parent().addClass("aok-hidden"),
b&&this.logger.logAvailabilitySlotRender());0<f.length?(-1===g.indexOf("apexPrice")&&f.addClass("aok-hidden"),f.addClass("inline-twister-swatch-price"),e=d.find(".a-price"),0<e.length?e[0].dataset&&(e[0].dataset.aSize=this.auiPriceSize):(f.find(".a-size-small").removeClass("a-size-small").addClass("a-size-base").addClass("a-color-base"),f.find(".a-size-mini").removeClass("a-size-mini").addClass("a-size-base").addClass("a-color-base"),f.find(".a-size-large").removeClass("a-size-large").addClass("a-size-base").addClass("a-color-base")),
e="a-size-small",f.find(".olpWrapper").removeClass("a-size-mini a-size-micro a-size-medium a-size-large a-size-base a-color-base").addClass(e),a.length&&(e="twister-plus-inline-twister-ppu a-size-micro",a.removeClass("a-size-mini a-size-small a-size-medium a-size-large a-size-base a-color-base").addClass(e),b&&this.logger.logPPUSlotRender()),b&&this.logger.logPriceSlotRender()):(f=d.find("#sndbox-mobile-twister-price"),0<f.length&&b&&this.logger.logPriceSlotRender());c.length&&(c.find(".a-icon-mini").removeClass("a-icon-mini").addClass("a-icon-small"),
-1===g.indexOf("ms3")&&c.addClass("aok-hidden"),b&&this.logger.logPrimeSlotRender());0<k.length&&(k.removeClass("a-size-small a-color-secondary").addClass("a-color-base"),-1===g.indexOf("deliveryPromise")&&k.parent().addClass("aok-hidden"),k.find("br").remove(),a=k.find("b"),0===a.length&&(a=k.find("span")),a.length&&(c=" "+q(a.text()),a.addClass("aok-hidden"),k.append('\x3cspan style\x3d"font-weight: bold;"\x3e'+c+"\x3c/span\x3e")),b&&this.logger.logDeliverySlotRender());0<l.length&&(l.removeClass("a-spacing-micro a-spacing-top-micro").addClass("a-spacing-none a-spacing-top-none"),
-1===g.indexOf("variationReviews")&&l.addClass("aok-hidden"),b&&this.logger.logReviewsSlotRender());t.executeModifiers(d);return d.html()}};p.prototype={get:function(f,b,a,c,e){var k=this,l=this.twisterCore.slotsDimSum.get([f]);if(l[f])return y.call(k,l[f].Value,!1);var g=r(a,b,k.slotIdentifierMap,e);d.call(this,f,b,function(a){g.promise(y.call(k,a.Value,!0))},c);return g.loadingHtm},setState:function(d,b,a){this.minSlotHeight[b]||(this.minSlotHeight[b]=[]);this.maxSlotHeight[b]||(this.maxSlotHeight[b]=
[]);this.evenSlotHeight[b]||(this.evenSlotHeight[b]=0);this.minSlotHeight[b][a]=this.minSlotHeight[b][a]||0;this.minSlotHeight[b][a]=z(d,this.minSlotHeight[b][a]);this.maxSlotHeight[b][a]=this.maxSlotHeight[b][a]||0;var c=this.maxSlotHeight[b];var e=this.maxSlotHeight[b][a];!d||0===d.length||0<d.find(".loading-indicator-1").length||(d=d[0].scrollHeight,e<d&&(e=d));c[a]=e;this.maxSlotHeight[b][a]=this.maxSlotHeight[b][a]>this.minSlotHeight[b][a]?this.maxSlotHeight[b][a]:this.minSlotHeight[b][a];this.evenSlotHeight[b]=
this.maxSlotHeight[b][a]>this.evenSlotHeight[b]?this.maxSlotHeight[b][a]:this.evenSlotHeight[b]},updateSlotHeight:function(d){var b=[],a=this.evenSlotHeight[d],c;f.each(this.maxSlotHeight[d],function(e,k){b.push("#inline-twister-expander-content-"+d+" .desktop-twister-dim-row-"+k+" .dimension-slot-info {height: "+a+"px;}");c="twister-plus-desktop-twister-slot-height-"});this.dynamicStyle.addCSSRules(c+d,b)},resetMinSlotHeight:function(d){this.minSlotHeight[d]||(this.minSlotHeight[d]=[]);this.minSlotHeight[d]=
f.map(this.minSlotHeight[d],function(){return 0})},resetSlotHeight:function(d){this.maxSlotHeight[d]=[];this.minSlotHeight[d]=[];this.evenSlotHeight[d]=0;this.dynamicStyle.addCSSRules("twister-plus-desktop-twister-slot-height-"+d,[])}};return p});"use strict";v.when("A").register("desktop-twister-register",function(){var f=[];return{registerModifier:function(m){f.push(m)},executeModifiers:function(m){f.forEach(function(f){f.modify&&"function"===typeof f.modify&&f.modify(m)})}}});"use strict";v.when("A",
"desktop-twister-constants").register("desktop-twister-utils",function(f,m){function t(d,f){for(var q=[],p=0;p<d.length;p++){var r=d[p].val;-1===r&&(r=m.CHAR_ASTERISK);q.push(String(r))}return f?q.join(f):q}function p(d,f){var q={},p=B;if(f){var r=f[m.TWISTER_CURRENT_ASIN],t=f[m.INIT_DATA_DELETED_LANDING_ASIN_INFO];t&&r===t.asin&&(p=t.dimValues)}for(r=0;r<f.dimensions.length;r++)t=f.variationValues[d[r].dimKey][d[r].val],!t&&p&&p[r]&&(t=p[r]),q[r]=t;return q}return{getCurrDimCombId:t,constructEventInfo:function(d,
f,q,v,u,x){var r=f.state(),y={},n={},b=[],a=f.tvm.dimensionList,c=f.tvm.dimensionDisplayText;if("undefined"!==typeof c&&"undefined"!==typeof a)for(var e in a){var k=a[e];b[e]=c[k]}d={dimensionDisplayMap:b,dimensionsMap:d.dimensions,dimensionValuesData:u?u:p(r,d)};y[m.STRING_DIM_COMB_ID]=t(q===m.viewEvents.MOUSE_ENTER&&x?x:r,m.CHAR_UNDERSCORE);y[m.STRING_EVENT_TYPE]=q;n[m.STRING_EVENT_DIV_METADATA]=v;n[m.STRING_EVENT_DIM_INFO]=d;q=m.STRING_DIMENSION_SELECTION_DATA;v=f.util.dimensionMetaData;x=[];for(d=
0;d<f.tvm.dimensionList.length;d++)u={},a=b=0,-1!==r[d].val&&(a=1),v[r[d].dimKey].isRequired&&(b=1),u[m.STRING_IS_REQUIRED]=b,u[m.STRING_IS_SELECTED]=a,x[d]=u;n[q]=x;y[m.STRING_EVENT_DATA]=n;return y},getDimensionValuesData:p}});"use strict";v.when("A","desktop-twister-constants").register("desktop-twister-widgets-factory",function(f,m){var t=f.$,p=m.widgetSelectors,d=m.classes,r=m.cssConstants,q=m.loggingConstants;m=function(){function d(b,a,c){c=c&&0<c.length?c:b.find(".a-button");a?(c.addClass("text-swatch-button-with-slots").removeClass("text-swatch-button"),
b.find("hr").show(),b.find("hr").removeClass("aok-hidden"),b.find(p.SLOT_NODE_SELECTOR).show(),b.find(p.SLOT_NODE_SELECTOR).removeClass("aok-hidden")):(c.removeClass("text-swatch-button-with-slots").addClass("text-swatch-button"),b.find("hr").hide(),b.find("hr").addClass("aok-hidden"),b.find(p.SLOT_NODE_SELECTOR).hide(),b.find(p.SLOT_NODE_SELECTOR).addClass("aok-hidden"))}return{alignTextSwatches:function(b,a){var c=0,e;f.each(b,function(b){b.domNode&&(b.isVisible||a)&&(b.domNode.attr("data-idxInToggleSwatchList"),
e=b.domNode,b=e.find(".swatch-title-text-display"),b.length&&b[0].style.removeProperty("height"),b=b?b.height():0,c<b&&(c=b))});f.each(b,function(b){b.domNode&&(b.isVisible||a)&&(b.domNode.attr("data-idxInToggleSwatchList"),e=b.domNode,e.find(".swatch-title-text-display").height(c))})},createSwatch:function(b,a,c,e,f,l){var g=!a.unavailable,k=a.isVisible,w=a.selected,m=a.showSlot,n=a.slotHtm;c="#"+c;if(f.length)return f=f.clone(),f.removeClass("swatch-prototype"),f.attr("data-idxInToggleSwatchList",
e),e=f.find(c).attr("id",a.id),f.find(c+"-announce").attr("id",a.id+"-announce"),f.find("input").attr({name:a.name,"aria-labelledby":a.id+"-announce"}),f.find("text"===b?".swatch-title-text-display":"square_image"===b?".swatch-title-text":".swatch-text").text(a.text),g||e.addClass("a-button-unavailable"),w&&e.addClass("a-button-selected"),"text"!==b&&(w=f.find(".swatch-image"),w.addClass("inline-twister-manual-load"),w.attr({"data-a-image-source":a.image||"",id:"inline-twister-image-"+a.name,alt:a.text})),
w=f.find(".dimension-slot-info"),w.length&&(w.attr("id","dimension-slot-info-"+a.name),m?g?0<n.length&&w.html(n):w.html(a.defaultSlotUnavailable):f.find("text"===b?".slots-padding":".dimension-slot-info").addClass("aok-hidden"),"text"===b&&d(f,m,e)),l.append(f),k||f.addClass("aok-hidden"),f},updateSlotSectionInTextSwatch:d,updateSlotSectionInImageSwatch:function(b,a){var c=b.find(p.IMAGE_SWATCH_HORIZONTAL);0===c.length&&(c=b.find(p.IMAGE_SWATCH_VERTICAL),0===c.length&&(c=b.find(p.IMAGE_SWATCH_WITH_NO_SLOT)));
b=b.find(p.IMAGE_SWATCH_FALLBACK);a?(b.addClass("aok-hidden"),c.removeClass("aok-hidden")):(c.addClass("aok-hidden"),b.removeClass("aok-hidden"))}}}();var y=function(m){function b(a,c,b,d,f,g,n){this.id=a.id;this.unavailable=!!a.unavailable;this.selected=!!a.selected;this.showSlot=a.showSlot;this.slotHtm=a.slotHtm;this.isImageSwatch=!c;this.asin=a.asin;this.pageUrl=a.pageUrl;var e=c?"text":a.isCirclularImageSwatch?"circular_image":"square_image";this.domNode=n?t(n):m.createSwatch(e,a,b,d,f,g);this.isVisible=
a.isVisible;this.popoverImage=a.popoverImage;this.isSlotVisible=!0;this.slotNodeIdentifier=c?".slots-padding":".dimension-slot-info";this.title=a.text;this.name=a.name;this.subscribeToHoverEvent(b)}b.prototype={setState:function(a,c,b){this.selected=!!a.selected;this.updateAvailablity(a);this.updateSlotNode(a);this.updateVisibility(a);this.updateSwatchIndexInDomNode(b);return this},getSlotNode:function(){this.slotNode||(this.slotNode=this.domNode.find(p.SLOT_NODE_SELECTOR));return this.slotNode},
updateSlotNode:function(a){this.slotNode||(this.slotNode=this.domNode.find(p.SLOT_NODE_SELECTOR));this.showSlot!==a.showSlot&&((this.showSlot=a.showSlot)?this.domNode.find(this.slotNodeIdentifier).removeClass("aok-hidden"):this.domNode.find(this.slotNodeIdentifier).addClass("aok-hidden"),this.isImageSwatch?m.updateSlotSectionInImageSwatch(this.domNode,this.showSlot):m.updateSlotSectionInTextSwatch(this.domNode,this.showSlot));this.slotHtm!==a.slotHtm&&(this.slotNode.html(a.slotHtm),this.slotHtm=a.slotHtm)},
updateAvailablity:function(a){this.toggleButton||(this.toggleButton=this.domNode.find(p.TOGGLE_BUTTON_SELECTOR));(this.unavailable=a.unavailable)?this.toggleButton.addClass(d.A_BUTTON_UNAVAILABLE):this.toggleButton.removeClass(d.A_BUTTON_UNAVAILABLE)},updateSelection:function(){this.toggleButton||(this.toggleButton=this.domNode.find(p.TOGGLE_BUTTON_SELECTOR));this.selected?(this.toggleButton.addClass(d.A_BUTTON_SELECTED),this.toggleButton.removeClass(d.A_BUTTON_UNAVAILABLE)):(this.toggleButton.removeClass(d.A_BUTTON_SELECTED),
this.toggleButton.removeClass(d.A_BUTTON_FOCUS))},updateVisibility:function(a){a.isVisible?this.domNode.removeClass(d.AOK_HIDDEN):this.domNode.addClass(d.AOK_HIDDEN);this.isVisible=a.isVisible},subscribeToHoverEvent:function(a){a="desktop-twister-swatch-hover:"+a;try{f.declarative.remove(this.domNode,a),f.declarative.create(this.domNode,a,{})}catch(c){v.log("Hover event subscribe failed with error: "+this.name,q.ERROR,q.ATTRIBUTION)}},updateSwatchIndexInDomNode:function(a){this.domNode&&this.domNode.attr("data-idxInToggleSwatchList",
a)},getTopPosition:function(){var a=this.domNode.position();return this.topPosition=a?a.top:0}};return b}(m),z=function(m,b){function a(a,b,d,l){var c=this;this.isTextSwatch=a.isTextSwatch;this.name=a.name;this.domNode=t(p.EXPANDER_CONTENT_PREFIX+a.name);this.title=l;this.selectedSwatch=null;this.swatches={};this.orderedSwatchList=[];this.initialVisibleSwatchList={};this.swatchIdxOrder=[];this.isPageRefreshActive=!1;this.totalSwatchCount=a.totalSwatchCount||0;this.onChange=a.onChange;this.hoverHandler=
a.onHover;this.isUserInteracting=!1;this.autoNotificationCallback=b.autoNotificationCallback;this.rowContainer=d;this.swatchListContainer=this.domNode.find(p.DIMENSION_VALUES_LIST);this.markAutoUpdated=!1;this.windowResizeCallback=b.windowResizeCallback;this.preserveNaturalSwatchOrder=a.preserveNaturalSwatchOrder;this.displaySwatches=[];this.numberOfSwatchesPerRow=0;this.swatchPrototypeNode=t("#"+a.name).closest(p.SWATCH_NODE_SELECTOR);this.swatchPrototypeNodeParent=this.swatchPrototypeNode.parent();
f.on("a:button-group:"+this.name+":toggle",function(a){var b=parseInt(a.selectedButton.buttonName,10),e=c.swatches[b];e?c.isPageRefreshActive?(c.isUserInteracting=!0,b=e.unavailable,e.updateSelection(),c.autoNotificationCallback&&c.autoNotificationCallback(b,!0),c.onChange&&c.onChange(c.swatches,a.selectedButton,c.markAutoUpdated),c.setAutoUpdated(!1)):e.pageUrl&&(u.location.href=e.pageUrl):(a="Selected swatch not found on toggle button click. Value clicked: "+b+" ; Swatch length: "+Object.keys(c.swatches).length,
v.log(a,q.ERROR,q.ATTRIBUTION))});this.registerHoverDeclarative("desktop-twister-swatch-hover:"+a.name);if(this.isTextSwatch)f.on("resize",function(){0<c.displaySwatches.length&&(c.repopulateDisplaySwatches(),c.alignTextSwatches(),"function"===typeof c.windowResizeCallback&&c.windowResizeCallback(c.name))})}a.prototype={setState:function(a,e,d){var c=this,g,k=[],m=[],n=[];f.objectIsEmpty(e)||(f.each(e,function(e,d){if(!c.swatches[d]&&a.swatches[d].isVisible){var f=new b(a.swatches[d],c.isTextSwatch,
c.name,d,c.swatchPrototypeNode,c.swatchPrototypeNodeParent);f.subscribeToHoverEvent(c.name);c.swatches[d]=f;!c.isTextSwatch&&c.swatches[d]&&c.swatches[d].domNode&&n.push(c.swatches[d].domNode.find(".inline-twister-manual-load")[0])}m[e]=d}),this.swatchIdxOrder=m,d||(this.resetToggleSwatchContainer(),this.displaySwatches=[]),f.each(this.swatchIdxOrder,function(a,b){if(a=c.swatches[a])a&&c.swatchListContainer.append(a.domNode),a&&a.subscribeToHoverEvent(c.name),c.addToDisplaySwatches(a,c.displaySwatches)}));
f.each(a.swatches,function(a,e){c.swatches[e]?(g=a.selected?c.swatches[e]:g,c.swatches[e].selected=!!a.selected,k.push({index:e,data:a})):(a.isVisible&&(c.swatches[e]=new b(a,c.isTextSwatch,c.name,e,c.swatchPrototypeNode,c.swatchPrototypeNodeParent),c.swatches[e].subscribeToHoverEvent(c.name),c.addToDisplaySwatches(c.swatches[e],c.displaySwatches),!c.isTextSwatch&&c.swatches[e]&&c.swatches[e].domNode&&n.push(c.swatches[e].domNode.find(".inline-twister-manual-load")[0])),a.selected&&(g=c.swatches[e]))});
this.selectedSwatch&&this.selectedSwatch.updateSelection();g&&g.updateSelection();f.each(k,function(a,b){c.swatches[a.index].setState(a.data,c.name,a.index)});this.isTextSwatch&&(f.objectIsEmpty(e)||this.alignTextSwatches());c.selectedSwatch&&g&&c.selectedSwatch!==g&&!c.isUserInteracting&&c.autoNotificationCallback(!0);c.selectedSwatch=g;c.isUserInteracting=!1;n.length&&f.loadImageManually(n);return this},getSlotNodes:function(){return f.map(this.displaySwatches,function(a){return f.map(a,function(a){return a.getSlotNode()})})},
alignTextSwatches:function(a){f.each(this.displaySwatches,function(c){m.alignTextSwatches(c,a)})},resetToggleSwatchContainer:function(){var a=t(this.domNode.find(".a-button-list").children()[0]);this.swatchListContainer.html("");this.swatchListContainer.append(a)},setAutoUpdated:function(a){this.markAutoUpdated=a},getInitialVisibleSwatchList:function(){return this.initialVisibleSwatchList},getNumberOfSwatchesPerRow:function(){return this.numberOfSwatchesPerRow},setNumberOfSwatchesPerRow:function(a){a&&
(this.numberOfSwatchesPerRow=a)},createSwatch:function(a,e){e=new b(a,this.isTextSwatch,this.name,a.name,this.swatchPrototypeNode,this.swatchPrototypeNodeParent,e);this.swatches[a.name]=e;this.initialVisibleSwatchList[a.name]=e;this.selectedSwatch=a.selected?e:this.selectedSwatch;this.orderedSwatchList.push(e);return e},registerHoverDeclarative:function(a){var c=this;f.declarative(a,"mouseenter mouseleave",function(a){var b=a.$currentTarget[0].getAttribute("data-idxInToggleSwatchList");b=c.getSwatch(b);
a.data={slotNode:a.$currentTarget.find(b.slotNodeIdentifier),showImageInPopOver:b.isImageSwatch&&!!b.popoverImage,unavailable:b.unavailable,showSlot:b.showSlot,selected:b.selected,title:b.title,name:b.name,id:b.id,image:b.popoverImage};c.hoverHandler(c.name,a)})},activatePageRefresh:function(){this.isPageRefreshActive=!0;this.domNode.find(".page-load-link").remove()},getSwatch:function(a){return this.swatches[a]?this.swatches[a]:{}},addToDisplaySwatches:function(a,b){var c=a.domNode[0].getBoundingClientRect();
if(0===b.length)b.push([a]);else{var e=b[b.length-1],f=e[0].domNode[0].getBoundingClientRect();c.top===f.top?e.push(a):b.push([a])}this.removeSwatchRowIdentifier(a);c=d.ROW_IDENTIFIER_PREFIX;a.domNode&&a.domNode.addClass(c+(b.length-1).toString())},repopulateDisplaySwatches:function(){if(0!==this.displaySwatches.length){var a=[],b=0,k,l=this;f.each(this.displaySwatches,function(c,e){f.each(c,function(c,e){0===a.length?a.push([c]):0===b?(k=a[0][a[0].length-1],c.getTopPosition()!==k.getTopPosition()?
(b=a[0].length,l.numberOfSwatchesPerRow=b,l.addToDisplaySwatches(c,a)):(a[0].push(c),l.removeSwatchRowIdentifier(c),c.domNode&&c.domNode.addClass(d.ROW_IDENTIFIER_PREFIX+(0).toString()))):l.addToDisplaySwatches(c,a)})});0===b&&(this.numberOfSwatchesPerRow=b=a[0].length);this.displaySwatches=a}},removeSwatchRowIdentifier:function(a){a.domNode&&a.domNode.removeClass(function(a,b){return(b.match(/(^|\s)desktop-twister-dim-row-\S+/g)||[]).join(" ")})},createDisplaySwatches:function(){var a=this;f.each(this.orderedSwatchList,
function(b){a.addToDisplaySwatches(b,a.displaySwatches)})},removeMisplacedSwatch:function(){var a=this.displaySwatches[this.displaySwatches.length-1],b=a[a.length-1],d=b.name;b.domNode&&b.domNode.remove();delete this.swatches[d];this.selectedSwatch&&this.selectedSwatch.name===d&&(this.selectedSwatch=null);1<a.length?a.pop():this.displaySwatches.pop()}};return a}(m,y),x=function(d){function b(a){this.mainText=a.mainText;this.subText=a.subText;this.dimKey=a.dimKey;this.titleSelectorPrefix=a.titleSelectorPrefix;
this.titleValueSelector=a.titleValueSelector;this.domNode=t("#"+this.titleSelectorPrefix+this.dimKey)}b.prototype={refresh:function(){this.domNode.find("."+this.titleValueSelector).text(this.subText);this.domNode.removeClass("twister-plus-inline-twister-dim-required twister-plus-inline-twister-dim-required-delay")},setState:function(a){return f.equals(a,t.extend({},this))?this:(t.extend(this,a),this.refresh())},getData:function(){return{mainText:this.mainText,subText:this.subText}}};return b}(m),
I=function(m,b,a){function c(a,c,l,g,m){function e(){n=n||k.domNode.find(".dimension-heading");n.css(r.BG_COLOR,r.GREEN_BG_COLOR);f.delay(function(){f.animate(n,{"background-color":r.WHITE_BG_COLOR},200)},1E3)}var k=this;this.stringTranslationMap=l.inlineTwisterData?l.inlineTwisterData.stringTranslationMap:{};this.title=c?new b(c):null;this.dimKey=l.dimKey;this.domNode=t("#"+a+this.dimKey);this.showSlot=l.showSlot;this.logger=m;this.expanderContent=k.domNode.find(p.EXPANDER_CONTENT_PREFIX+this.dimKey);
this.rowCallbacks=g;this.autoNotificationExpanded=k.domNode.find(p.AUTO_NOTIFICATION_EXPANDED);this.autoNotificationExpandedText=k.autoNotificationExpanded.text();var n;this.autoNotificationCallback=function(a,b){var c=k.autoNotificationExpandedText;a?k.isExpanded&&b?(k.autoNotificationExpanded.find("."+d.A_COLOR_ATTAINABLE).html(c),k.autoNotificationExpanded.removeClass(d.AOK_HIDDEN)):(e(),k.setAutoUpdated(!0)):k.hideAutoNotification()}}c.prototype={setState:function(a,b,c,d,f){a&&this.toggleSwatch&&
this.toggleSwatch.setState(a,b,f);d&&this.title&&this.title.setState(d)},getInitialVisibleSwatchList:function(){return this.toggleSwatch?this.toggleSwatch.getInitialVisibleSwatchList():{}},activatePageRefresh:function(){this.toggleSwatch&&this.toggleSwatch.activatePageRefresh()},setAutoUpdated:function(a){this.markAutoUpdated=a;this.toggleSwatch&&this.toggleSwatch.setAutoUpdated(a)},hideAutoNotification:function(){this.autoNotificationExpanded.addClass(d.AOK_HIDDEN)},createDisplaySwatches:function(){this.toggleSwatch&&
this.toggleSwatch.createDisplaySwatches()},initializeComponents:function(b,c,d){if(!this.toggleSwatch&&b){var e=this.title.getData();this.toggleSwatch=new a(b,{windowResizeCallback:d.handleWindowResize,autoNotificationCallback:this.autoNotificationCallback},this.domNode,e.mainText)}this.isTextSwatch=b?b.isTextSwatch:!0;this.rowCallbacks=f.extend(this.rowCallbacks,d);this.totalSwatchCount=b?b.totalSwatchCount:0;this.showSlot=c},postInitialize:function(){this.isTwisterCoreInitialized=!0;this.rowCallbacks.handleDimensionExpansion({dimKey:this.dimKey},
this.showSlot,!0)}};return c}(m,x,z),Q=function(){v.when("A","a-dropdown","desktop-twister-constants").register("desktop-twister-dropdown",function(d,b,a){v.when("a-dropdown-handlers").execute("mark-dropdown-interactive-time",function(){"function"===typeof u.markFeatureInteractive&&u.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"dropdown"}]})});return function(c,e){function f(){var b=a.DROPDOWN_DIV_NAME+g.dimKey;var c=function(b){var c={};c[a.STRING_DIM_KEY]=g.dimKey;b=b?b.value:
B;c[a.STRING_DIM_VALUE_INDEX]=b?parseInt(b.split(",")[0]):B;g.dropdownChange(c)};v.when("A").execute(function(d){d.on(a.AUI_DROPDOWN_EVENT_PREFIX+b,c)})}function m(a,b){var c;d.each(a,function(a,d){a===b&&(c=d)});return c}var g=this,n=d.$;g.dimType=a.TWISTER_DIMENSION_VIEW_DROPDOWN;g.AuiDropdownHandle=b;g.dimKey;g.dimStyleData;g.dimMap;g.dimNameDisplayString;g.dimValuesDisplayData;g.dropdownChange;g.unavailableString;g.currentlyUnavailableString;g.domNode;g.dimType=a.TWISTER_DIMENSION_VIEW_DROPDOWN;
g.optionsUpdatedOnLanding=!1;g.initialize=function(b){g.dimKey=e[a.STRING_DIM_NAME];g.dimMap=c.dimensions;g.dimNameDisplayString=c.variationDisplayLabels[g.dimKey];g.dimValuesDisplayData=c.variationValues[g.dimKey];g.dropdownChange=b.onDropdownChange;g.displayConfigStylesData=c[a.STRING_DISPLAY_CONFIG_STYLES_DATA];g.unavailableString=c[a.STRING_UNAVAILABLE_POPOVER_STRING_VALUE];g.currentlyUnavailableString=c[a.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE];f()};g.activatePageRefresh=function(){this.isPageRefreshActive=
!0;if("undefined"!==typeof TwisterNonJs)for(var a=u.TwisterNonJs.handleDropDown.length,b=0;b<a;b++)u.TwisterNonJs.handleDropDown[b]=function(){}};g.updateView=function(b){switch(b[a.STRING_EVENT_TYPE]){case a.viewEvents.DROPDOWN_CHANGE:case a.viewEvents.CLICK:case a.viewEvents.TWISTER_REFRESH:var d=a.ID_SELECTOR+g.dimKey+a.CHAR_UNDERSCORE+a.INDEX_FOR_SELECT_OPTION;var f=a.NATIVE_DROPDOWN_DIV_PREFIX+a.DROPDOWN_DIV_NAME+g.dimKey,k=n(f).val().split(",")[0],h=b[a.STRING_EVENT_TYPE];var l=b.eventData.dimensionSelectionData;
b=b&&b.dimCombID?b.dimCombID:e.currDimCombId;var p=m(g.dimMap,g.dimKey);var q=g.dimValuesDisplayData.length;var r=g.displayConfigStylesData,t=b.split("_");b=[];for(var v=t.slice(0),u,w,x=0;x<q;x++){w={};if(t[p]===x.toString())u=a.STYLE_CLASS_TYPE_FOR_SELECTED;else{v[p]=x;u=v.join("_");var y=!0;c.dimensionToAsinMap[u]||(y=!1);u=(u=y)?a.STYLE_CLASS_TYPE_FOR_AVAILABLE:a.STYLE_CLASS_TYPE_FOR_INVALID}u=r.dropdown[u];w.style=u;b[x]=w}l&&0===l[p][a.STRING_IS_SELECTED]&&k!==a.INDEX_FOR_SELECT_OPTION&&"undefined"!==
typeof g.AuiDropdownHandle&&g.AuiDropdownHandle.getSelect(f).val("-1");h!==a.viewEvents.CLICK&&h!==a.viewEvents.DROPDOWN_CHANGE||0!==l[p][a.STRING_IS_REQUIRED]||1!==l[p][a.STRING_IS_SELECTED]||n(d).remove();k=0;for(h=b.length;k<h;k++)if(l=b[k],d=a.NATIVE_DROPDOWN_DIV_PREFIX+g.dimKey+a.CHAR_UNDERSCORE+k,p=l[a.STRING_STYLE],l=n(d).get(0).className,p===a.CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION&&(q=n(d).attr("value"),n(f).val()!==q&&g.AuiDropdownHandle.getSelect(f).val(q)),l!==p||l===a.CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION)try{q=
{};l!==p&&(q[a.STRING_CSS_CLASS]=p,q[a.STRING_NATIVE_CSS_CLASS]=p);var z=q;0!==Object.keys(z).length&&g.AuiDropdownHandle.updateOption(d,z)}catch(R){}}}}})}();return{Swatch:y,ToggleSwatch:z,Title:x,Row:I,utils:m,Dropdown:Q}})});
/* ******** */
(function(m){var p=window.AmazonUIPageJS||window.P,n=p._namespace||p.attributeErrors,g=n?n("TwisterCoreAsset",""):p;g.guardFatal?g.guardFatal(m)(g,window):g.execute(function(){m(g,window)})})(function(m,p,n){m.when("twister-variation-matrix","twister-dim-util","twister-state-machine","twister-metadata","twister-view-controller","twister-dispatcher","twister-actions","twister-slots-dimsum","twister-dimsum").register("TwisterCore",function(g,l,f,e,a,b,c,d,k){function h(c,h){this.tvm=new g(c);this.util=
new l(this.tvm);this.tsm=new f(this.tvm,this.util,c.initDimCombination);this.dimSum=new k(c.config.ajaxTimeout,c.config.ajaxUrlParams,c.config.deviceType,h);this.slotsDimSum=new d(c.config.ajaxTimeout,c.config.ajaxUrlParams,c.config.deviceType);var q=this;b.registerStore("twister-state-machine",function(b,c){q.tsm.accept(b,c).THEN(function(c){a.publishView(b,c)}).ELSE()});var u=new e;b.registerStore("twister-metadata",function(b,c){u.process(b,c,function(c){a.publishView(b,c)})})}function q(a,d){var k=
a.viewAttribution+"_"+a.viewName+"_"+d;return function(a){try{var h=c.create(d,a);b.dispatch(d,h)}catch(e){p.ueLogError&&p.ueLogError(e,{logLevel:"ERROR",attribution:"Twister_view_"+k,message:"This error is caused by the Twister view - "+k+" while updating the TwisterCore"})}}}h.prototype={registerActive:function(b,c){a.register(b.viewAttribution+"_"+b.viewName,!0,c.updateView);return{dimensionChanged:q(b,"VARIATION_CHANGE"),dimensionPeek:q(b,"VARIATION_PEEK"),metaData:q(b,"METADATA")}},registerPassive:function(b,
c){a.register(b.viewAttribution+"_"+b.viewName,!1,c.updateView);return{metaData:q(b,"METADATA")}},state:function(){return this.tsm.currentState().selected().selectionInfo()}};return h});"use strict";m.when("A").register("twister-actions",function(g){var l=g.$,f={VARIATION_CHANGE:function(e){return e=l.isArray(e)?e:[e]},VARIATION_PEEK:function(e){return e},VARIATION_SEQUENCE_ALTER:function(){},INIT_SEQUENCE_ALTER_DATA:function(e){return e},METADATA:function(e){return e}};return{create:function(e,a){return f[e]?
f[e](a):!1}}});"use strict";m.when("A","publisherSubscriber").register("twister-dispatcher",function(g,l){function f(){f=1;return this}var e=g.$,a=new l,f=0,b=[];return{registerStore:function(b,d){a.register(b,d);return this},deregisterStore:function(b){a.deRegister(b);return this},dispatch:function(c,d){f?b.push(arguments):a.publish(c,d);return this},hold:f,release:function(){e.each(b,function(b,d){a.publish.apply(a,d)});f=0;return this}}});"use strict";m.when("A","publisherSubscriber").register("twister-view-controller",
function(g,l){function f(){e?a.push(arguments):(e=1,b.publish.apply(b,arguments),c.publish.apply(c,arguments),e=0,a.length&&f.apply(this,a.shift()));return this}var e=0,a=[],b=new l,c=new l;return{register:function(a,k,h){k?b.register(a,h):c.register(a,h);return this},deRegister:function(a,k){k?b.deRegister(a):c.deRegister(a);return this},publishView:f}});"use strict";m.when("A").register("twister-dimsel-api",function(g){function l(e){var a=this;this.dimSelectionMap={};this.selInfo=e;f.each(e,function(b,
c){a.dimSelectionMap[c.dimKey]=c.val})}var f=g.$;l.prototype={matches:function(e){e=e.selectionInfo();for(var a=0;a<e.length;a++){var b=e[a].dimKey;if(!(b in this.dimSelectionMap)||this.dimSelectionMap[b]!==e[a].val)return!1}return!0},selectionInfo:function(){return g.copy(this.selInfo)}};return l});"use strict";m.when("A","twister-dimsel-api").register("twister-dim-util",function(g,l){function f(a){this.tvm=a;this.dimensionMetaData={};var b=[];a=a.dimensionInfo;for(var c=0;c<a.length;c++){b.push(a[c].dimKey);
var d={};d.isRequired=a[c].isRequired;d.isSingleton=a[c].isSingleton;d.dimOrder=c;d.size=a[c].size;this.dimensionMetaData[a[c].dimKey]=d}}var e=g.$;f.prototype={createSelectionInfo:function(a){return new l(a)},extendSelectionInfo:function(a,b,c){var d=c||0===c,k={},h=[];e.each(b.selectionInfo(),function(b,a){k[a.dimKey]=a.val});e.each(a.selectionInfo(),function(b,a){b=a.dimKey;a=d?c:a.val;b in k&&(a=k[b]);h.push({dimKey:b,val:a})});return new l(h)},createNextDimSelection:function(a,b){var c=[],d=
b.selectionInfo(),k=this;e.each(a.split(":"),function(b,a){var e=d[b].dimKey;a=parseInt(a,10);k.dimensionMetaData[e].isRequired&&a!==d[b].val&&(a=-1);c.push({dimKey:e,val:a})});return new l(c)},getDimScore:function(a,b){var c=0,d=a.split(":"),k=this;e.each(b.selectionInfo(),function(b,a){var e=a.dimKey;a=a.val;var f=parseInt(d[b],10);b=d.length-b;a===f?(c+=200*b,k.dimensionMetaData[e].isRequired&&(c+=2E4)):c+=100-Math.round(Math.abs(a-f)/k.dimensionMetaData[e].size*100)});return c},isSingletonDim:function(a){return this.dimensionMetaData[a]?
this.dimensionMetaData[a].isSingleton:!1},isRequiredDim:function(a){return this.dimensionMetaData[a]?this.dimensionMetaData[a].isRequired:!1},getDimensionInfo:function(){return this.tvm.dimensionInfo},getDimAvailability:function(a,b){b=b.selectionInfo?b:this.createSelectionInfo(b);var c=[],d=[],k=this.tvm.dimensionList,h=this.tvm.dimtoValueMap[a],f=this.createSelectionInfo([{dimKey:a,val:-1}]);b=this.tvm.fetch(this.extendSelectionInfo(b,f).selectionInfo());var g={},l=this;e.each(b,function(b,c){g[c.split(":")[k.indexOf(a)]]=
l.tvm.dimCombinations[c]});e.each(h,function(b,a){b in g?c.push({index:b,asin:g[b],label:a}):d.push({index:b,label:a})});return{available:c,unavailable:d}},getUnselectedDims:function(a){var b={};e.each(a,function(a,c){b[c.dimKey]=c.val});a=[];var c=this.tvm.dimensionList,d;for(d in c)if(c.hasOwnProperty(d)){var k=c[d];if(b[k]===n||-1===b[k])this.isSingletonDim(k)?b[k]=0:a.push(k)}return a},showDimSum:function(a,b){b=this.getUnselectedDims(b);return!b||0===b.length||1===b.length&&b[0]===a?1:0},isFullySelected:function(a){var b=
!0;"string"===typeof a&&(a=this.getSelectionInfoFromDimComb(a));a=a.selectionInfo?a.selectionInfo():a;if(a.length!=this.tvm.dimensionList.length)return!1;e.each(a,function(a,d){-1===d.val&&(b=!1)});return b},createDimensionSelectionMap:function(a){var b={},c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];b[d.dimKey]=d.val}return b},getSelectedDimKeys:function(a){var b=this.tvm.dimensionList,c=[],d;for(d in b)if(b.hasOwnProperty(d)){var e=a[b[d]];"undefined"===typeof e||-1==e?c.push("*"):c.push(e)}return c},
getValidDimCombination:function(a,b){var c,d=this,k=0,h=0;a=this.tvm.fetch(a);e.each(a,function(a,e){h=d.getDimScore(e,b);h>k&&(c=a,k=h)});return a[c]},getAsinFromSelectionInfo:function(a,b){var c;"undefined"==typeof b||b?a=this.createDimensionSelectionMap(a):(c=g.copy(a),a=this.getValidDimCombination(c,this.createSelectionInfo(a)),"undefined"!=typeof a&&e.each(a.split(":"),function(b,a){a=parseInt(a,10);c[b].val=a}),a=this.createDimensionSelectionMap(c));a=this.getSelectedDimKeys(a).join(":");return this.tvm.dimCombinations[a]},
getSelectionInfoFromSelectedVariationValuesMap:function(a){var b=[],c;for(c in this.tvm.dimensionList){var d={},e=this.tvm.dimensionList[c];d.dimKey=e;d.val=a[e];b.push(d)}return b},getSelectionInfoFromDimComb:function(a){var b=[];a=a.split("_");for(var c in this.tvm.dimensionList){var d={},e=a[c];d.dimKey=this.tvm.dimensionList[c];d.val="X"===e||"*"===e?-1:parseInt(e,10);b.push(d)}return b},getDimensionDisplayText:function(a){return this.tvm.dimensionDisplayText[a]},getDimensionValueFromIndex:function(a,
b){return(this.tvm.dimtoValueMap[a]||[])[b]},getSelectionInfoFromDimIndexAndValue:function(a,b){var c=[],d={};d.dimKey=this.tvm.dimensionList[a];d.val="X"===b||"*"===b?-1:parseInt(b,10);c.push(d);return c},predictNextState:function(a,b){var c=this.extendSelectionInfo(a,b);if(function(b){var a;e.each(b.selectionInfo(),function(b,c){a=-1===c.val});return a}(b)||this.tvm.exists(c.selectionInfo()))return c;a=this.extendSelectionInfo(a,b,-1);a=this.tvm.fetch(a.selectionInfo());for(var d=b=0,k,h=0;h<a.length;h++)d=
this.getDimScore(a[h],c),d>b&&(k=h,b=d);k=a[k];return"undefined"!=typeof k?this.createNextDimSelection(k,c):c},getAsinToCorrespondingDimensionIndexMap:function(a){var b={};e.each(this.tvm.dimCombinations,function(c,d){b[d]=parseInt(c.split(":")[a-1])});return b}};return f});"use strict";m.when("A","twister-core-store-utils","dp-sort-filter-api").register("variations-reorder",function(g,l,f){return function(e){function a(b){return"undefined"!==typeof b&&"undefined"!==typeof g?(k=g.alterSequence(b),
!0):!1}function b(b){if("undefined"!==typeof b&&"undefined"!==typeof b.alterData){var a=e.getDefaultAsinList();d=b.slotRowNumber?b.slotRowNumber:n;h=e.getAsinToCorrespondingDimensionIndexMap(d);g=new c.SortFilterMain(b.alterData,a,h);return!0}return!1}var c=this,d,k=[],h={};this.StoreUtils=l;this.SortFilterMain=f;var g;this.accept=function(c,d){switch(c){case "VARIATIONS_REORDER":c=this.StoreUtils.branch(a(d),this.getReorderedAsinsList);break;case "UPDATE_VARIATIONS_REORDER_DATA":c=this.StoreUtils.branch(b(d));
break;default:c=this.StoreUtils.branch(!1)}return c};this.getReorderedAsinsList=function(){return k}}});"use strict";m.when("A","url-builder").register("twister-dimsum",function(g,l){function f(a,b,c,d){this.cache;d&&(this.cache=new d);this.ajaxTimeout=a;this.batchLimit=10;this.ajaxUrlParams=b;this.ajaxUrl="/gp/product/ajax?asinList\x3d###asinString###\x26vs\x3d1\x26experienceId\x3dtwisterDimensionSlotsSecondaryView\x26asin\x3d###asin###"+(b||"");this.ajaxUrl=c?this.ajaxUrl+("\x26deviceType\x3d"+
c):this.ajaxUrl+("\x26deviceType\x3d"+(g.capabilities.isAmazonApp?"mobileApp":"mobile"));(a=g.state("pwState"))&&a.isTryState&&(this.ajaxUrl=l.addUrlParams(this.ajaxUrl,{isTryState:"true"}))}var e=g.$;f.prototype={get:function(a,b,c){function d(b){var a=b-this.batchLimit;0<a&&d.call(this,a);if(b=l.slice(0>a?0:a,b).join(","))a=new URLSearchParams(this.ajaxUrlParams),a=a.get("parentAsin")?a.get("parentAsin"):null,b=this.ajaxUrl.replace("###asinString###",b).replace("###asin###",a),g.ajax(b,{chunk:k,
timeout:this.ajaxTimeout})}function k(a){if(a)for(var d in a){if(a.hasOwnProperty(d)){var e=a[d];if(e&&e.asin){if(f){var k=h(e.asin,c);f.put(k,e)}b&&b(e)}}}else m.log("Twister slots returning empty response for secondary view.","FATAL")}function h(b,a){var c=b;g.objectIsEmpty(a)||(c={asin:b},e.extend(!0,c,a));return c}var f=this.cache,l=[],n={};e.each(a,function(a,d){a=h(d,c);f&&f.get(a)?b?b(f.get(a)):n[d]=f.get(a):l.push(d)});if(!b)return n;d.call(this,l.length)}};return f});"use strict";m.when("A").register("twister-slots-dimsum",
function(g){function l(a,c,d){this.cache=e;this.ajaxTimeout=a;this.batchLimit=8;this.ajaxUrlParams=c;this.ajaxUrl="/gp/product/ajax?isDimensionSlotsAjax\x3d1\x26asinList\x3d###asinString###\x26vs\x3d1\x26experienceId\x3dtwisterDimensionSlotsDefault\x26asin\x3d###asin###"+(c||"");d&&(this.ajaxUrl+="\x26deviceType\x3d"+d);this.defaultQuerryParamsObj={};this.defaultAddedQueryParamString=""}var f=g.$,e={},a={};l.prototype={get:function(b,c){function d(a){a=new URLSearchParams(a);return a.get("parentAsin")?
a.get("parentAsin"):null}function e(a){a=new URLSearchParams(a);return a.get("isAssemblyVariationsEnabled")?a.get("isAssemblyVariationsEnabled"):null}function h(a){var b=a-this.batchLimit,c="",f=[];0<b&&h.call(this,b);f=t.slice(0>b?0:b,a);f=f.map(function(a){return encodeURIComponent(a)});if(c=f.join(","))a=d(this.ajaxUrlParams),b=e(this.ajaxUrlParams),c=this.ajaxUrl.replace("###asinString###",c),c=b?c.replace("###asin###",a):c.replace("###asin###",f[0]),c+="\x26"+this.defaultAddedQueryParamString,
g.ajax(c,{chunk:p.bind(this),timeout:this.ajaxTimeout,cache:!0,error:l.apply(null,f)})}function l(){var b=arguments;return function(){g.each(b,function(b){delete a[b]})}}function p(b){if(b&&b.ASIN){var d=b.ASIN;r[d]=b;for(c&&c(b);a[d]&&a[d].length;)a[d].pop()(b);delete a[d]}else m.log("Twister slots returning empty response.","FATAL","undefined"!=typeof this.defaultQuerryParamsObj?this.defaultQuerryParamsObj.twisterFlavor:n)}var r=this.cache,t=[],u={};f.each(b,function(b,d){r[d]?c?c(r[d]):u[d]=r[d]:
a[d]&&c?a[d].push(c):c&&(t.push(d),a[d]=[])});if(!c)return u;t.length&&h.call(this,t.length)},addDefaultQueryParameter:function(a,c){var d=!1;c!==n&&(this.defaultQuerryParamsObj[a]=c,this.defaultAddedQueryParamString=f.param(this.defaultQuerryParamsObj),d=!0);return d},getBatchSize:function(){return 8}};return l});"use strict";m.register("twister-metadata",function(){function g(){this.config={}}g.prototype={process:function(g,f,e){"METADATA"===g&&e(f)}};return g});"use strict";m.when("A").register("publisherSubscriber",
function(g){function l(){this.Subscribers=[];this.Names=[]}var f=g.$;l.prototype={register:function(e,a){if(-1<g.indexOfArray(this.Names,e))return!1;this.Names.push(e);this.Subscribers.push({name:e,handler:a})},deRegister:function(e){var a=g.indexOfArray(this.Names,e),b=this,c=function(a,c){if(a.name===e)return b.Subscribers.splice(c,1),!0};return-1<a?(this.Names.splice(a,1),[].some?this.Subscribers.some(c):f.each(this.Subscribers,function(a,b){c(b,a)}),!0):!1},publish:function(){var e=arguments;
f.each(this.Subscribers,function(a,b){setTimeout(function(){b.handler.apply(null,e)},0)})}};return l});"use strict";m.when("jQuery").register("twister-state-machine",function(g){return function(g,f,e){function a(a,b){this.selected=function(){return a};this.peek=function(){return b}}function b(a,b){return{THEN:function(c){a&&c&&c(b());return this},ELSE:function(c){a||c&&c(b());return this}}}var c,d;this.accept=function(e,h){switch(e){case "VARIATION_PEEK":var g=f.createSelectionInfo(h);e=c();e.peek().matches(g)?
h=!1:(-1===h.val?h=new a(c.selected(),c.selected()):(h=f.predictNextState(e.peek(),g),h=new a(e.selected(),h)),d=h,h=!0);h=b(h,this.currentState);break;case "VARIATION_CHANGE":e=c();h=f.createSelectionInfo(h);g=f.getDimensionInfo();e.selected().matches(h)?h=!1:(h=h.selectionInfo().length!==g.length?f.predictNextState(e.selected(),h):h,d=new a(h,h),h=!0);h=b(h,this.currentState);break;default:h=b(!1)}return h};c=this.currentState=function(){return d};d=new a(f.createSelectionInfo(e),f.createSelectionInfo(e))}});
"use strict";m.register("twister-core-store-utils",function(g){return{branch:function(g,f){return{THEN:function(e){if(g&&e){var a=f?f():g;e(a)}return this},ELSE:function(e){if(!g&&e){var a=f?f():g;e(a)}return this}}}}});"use strict";m.when("A").register("twister-variation-matrix",function(g){function l(b){b=g.copy(b);var c=this;this.dimCombinations=b.dimCombinations;this.validCombinatonString=" "+g.keys(b.dimCombinations).join("  ")+" ";this.dimensionInfo=b.dimensionInfo;this.dimensionList=b.dimensionList;
this.dimensionDisplayText=b.dimensionDisplayText;this.config=b.config;this.dimInfoMap={};a.each(this.dimensionInfo,function(a,b){var e=b.dimKey,f={};f.size=b.size;f.dimOrder=a;c.dimInfoMap[e]=f});this.dimtoValueMap=b.dimtoValueMap}function f(b){b=a.map(b,function(a){a=a.val;return-1===a?"\\d+":""+a}).join(":");return new RegExp("\\s"+b+"\\s","gm")}function e(b){return a.map(b,function(a){return""+a.val}).join(":")}var a=g.$;l.prototype={fetch:function(b){b=f(b);b=this.validCombinatonString.match(b)||
[];return b=a.map(b,function(b){return a.trim(b)})},exists:function(a){return e(a)in this.dimCombinations}};return l});"use strict";m.when("A","jQuery").register("url-builder",function(g,l){function f(a,c){var d;if(a&&c&&"object"==typeof c){d=a;var e="?";g.each(c,function(a,b){a=c[b];d+=e+b+"\x3d"+a;e="\x26"})}return d}function e(a){var c;a&&(c=a.split("?")[0]);return c}function a(a){var c={};a&&(a=a.split("?"),1<a.length&&(a=a[1].split("\x26"),g.each(a,function(a,b){a=a.split("\x3d");c[a[0]]=a[1]})));
return c}return{addUrlParams:function(b,c){var d=b;b&&c&&"object"==typeof c&&(d=e(b),b=a(b),b=l.extend(b,c),d=f(d,b));return d},removeUrlParams:function(b,c){var d=b;if(b&&c&&"object"==typeof c){var d=e(b),k=a(b);g.each(c,function(a,b){delete k[a]});d=f(d,k)}return d}}})});
/* ******** */
(function(m){var w=window.AmazonUIPageJS||window.P,q=w._namespace||w.attributeErrors,e=q?q("DetailPageTwisterViewAsset",""):w;e.guardFatal?e.guardFatal(m)(e,window):e.execute(function(){m(e,window)})})(function(m,w,q){m.when("A","dp-refresh-handler","view-util","twister-string-constants","dp-interactive-page-refresh-handler","twister-dimension-subview-promise-handler","page-refresh-custom-params-handler").register("page-refresh-view",function(e,K,t,g,v,r,A){function x(r,d,x){function B(a){return{chunk:function(b){var a=
b.ASIN,l=b.Value;b=b.FeatureName;if(!k.hiddenFeatures[b]){var c=b,f,d;try{c&&l&&l.content&&(d=l.content[c],"undefined"!==typeof d&&(f=u("#"+c),f.html(d).removeClass("js-feature-refresh-overlay").css({opacity:""})))}catch(h){c=c||"NoFeatureName",y.logFatal(h,{message:"Error in feature"+c})}k.twisterRefreshHandler.stampFeature(c,a);"twister-slot-price_feature_div"==b&&(a=l?l.content:null,f=u(".swatchSelect .twisterSwatchPrice").html(),l=u(".swatchSelect .price_slot_ppu").html(),f&&a&&a.priceToSet&&
(f=e.trim(f),a.priceToSet!==f&&(u(".swatchSelect .twisterSwatchPrice").html(a.priceToSet),C("twisterUpdatePriceMismatch"))),l&&a&&a.hasPricePerUnit&&a.pricePerUnitDisplay&&(l=e.trim(l),a.pricePerUnitDisplay!==l&&(u(".swatchSelect .price_slot_ppu").html(a.pricePerUnitDisplay),C("twisterUpdatePricePerUnitMismatch"))))}},success:function(a,n,l){G.stop();C("twisterUpdateSuccess");v.updateRenderTime()},error:function(a,n,l){Twister.$("#variations-overlay").hide();C("twisterUpdateFailure");y.logFatal("Error occurred for twister refresh call in desktop");
Twister.showErrorMessageOnFailure&&(alert(Twister.errorMessageOnFailure),location.reload())},abort:function(a){y.logFatal("Twister refresh Ajax aborted for desktop call"+a)},timeout:4E4}}function z(a,b,n,l,c){var f=[];"parent"===a?(b=E(b,l,"parent",c),f.parent=b,b=E(n,l,"partial",c),f.partial=b):(b=E(n,l,a,c),f[a]=b);return f}function h(a,b,n,l,c){for(var f in a)if(a.hasOwnProperty(f)){if("full"===f){var d=n.dimensionType,h=k.twisterUtil.getDimensionInfo().length,B=n.dimensionDisplayType,p=n.newAsin,
g=c&&(e.state("dp-twister-csm")||{}).updateCSMPageTypeId;k.twisterRefreshHandler.startMeasurement(p,d,h,B,g?p:q,g?["is-twister","parentAsin-"+F]:q)}d=a[f].twisterRefreshParams;h=a[f].notifyClientParams;if(c){G.start();var t=!1;k.twisterRefreshHandler.doPageRefresh(null,d,b,l,function(a){a&&!a.isNewRequest&&(H(f),t=!0)},function(){!t&&H(f)})}N(h.asin,h.id,f,c)}}function H(a){u(k.config[a].affectedFeatures).addClass("js-feature-refresh-overlay").css({opacity:.5})}function p(){u.each(d.contextMetaData,
function(a,b){var n={};b=b.elementList||[];var l=b.length,c=[];n.click={};n.mouseOver={};for(var f=0;f<l;f++){var d=u("#"+(b[f].divToUpdate||b[f].dtu));c.push("#"+(b[f].divToUpdate||b[f].dtu));if(d.length&&(b[f].customClientFunction||b[f].ccf)){if(b[f].updateOnHover||b[f].uoh)n.mouseOver[b[f].divToUpdate||b[f].dtu]=d.attr("customfunctionname");n.click[b[f].divToUpdate||b[f].dtu]=d.attr("customfunctionname")}}k.config[a].affectedFeatures=c.join(",");k.config[a].clientFeatures=n})}function N(a,b,n,
l){var c="",c=l?g.EVENT_TYPE_CLICK:g.EVENT_TYPE_MOUSEOVER;u.each(k.config[n].clientFeatures[c],function(c,l){try{var n=function(){k.twisterRefreshHandler.stampImageLoad(a)};(function(){var a={};a.P=m;(function(){eval("var P \x3d this.P;");eval("0, "+l)(b,DetailPage.StateController,n)}).call(a)})()}catch(d){y.logFatal("Client feature - "+c+", threw and exception :- "+d)}})}function E(a,b,n,l){if(/(?=.{0,512}$)^([A-Z]{2})_([A-Za-z]+)_([0-9]+)#([A-Za-z0-9\-\_\#\:\|]*$)/g.test(a)){var c=!0,f=encodeURIComponent(a);
a=F}var d={},h={};d.asinList=a;c&&(d.customizationToken=f);d.id="parent"===n?a:"partial"===l?b:a;d.mType=n;d=O(n,d);n=!1;(l=e.state("pwState"))&&(n=l.isTryState);n&&(d.isTryState=n);P(d,A.getCustomPageRefreshParams(a)||{});d=k.twisterRefreshHandler.createCustomParamsMap({},d);h.asin=a;h.id=b;return{twisterRefreshParams:d,notifyClientParams:h}}function P(a,b){e.each(b,function(b,d){a[d]=b})}function O(a,b){u.each(d.contextMetaData[a].mTypeSpecificURLParams,function(a,d){b[a]=d});return b}function Q(a){a=
k.twisterUtil.getSelectionInfoFromSelectedVariationValuesMap(a.selected_variation_values);k.twisterUtil.isFullySelected(a)?k.currentPageSelectionState="full":k.currentPageSelectionState="partial"}function R(a){var b={};b.config=a.measurement;b.dimensionDisplayType=a.dimensionsDisplayType;b.storeID=a.storeID;b.productGroupID=a.productGroupID;return b}function S(a){a=a.immutableURLPrefix;var b=null;a&&-1!=a.indexOf("?")&&(a=a.split("?")[1],0<a.length&&(b={},a=a.split("\x26"),e.each(a,function(a){a=
a.split("\x3d");b[a[0]]=a[1]})),b.isFlushing=2,b.dpEnvironment=Twister.dpEnvironment);return b}function I(a,b){var d;"partial"===a&&"partial"===b&&(d="partial");"partial"===a&&"full"===b&&(d="full");"full"===a&&"partial"===b&&(d="parent");"full"===a&&"full"===b&&(d="full");return d}var k=this,F=d.parent_asin,D=w.ue,J="",y=new x("dpTwisterPageRefreshView"),G=y.createFunctionTimer(y.eventTypes.TWISTER_GREY_OVERLAY_TIME_DESKTOP);this.twisterUtil=r.util;this.twisterFeatureName="Twister";this.currentPageSelectionState;
this.twisterRefreshHandler;this.config={partial:{},full:{},parent:{},master:{}};this.hiddenFeatures={intermediateEOS:1,EOS:1};k.viewUtil=new t(r);k.subType;var C=function(a){D&&D.count&&D.count(a,(D.count(a)||0)+1)};(function(){Q(d);p();var a={featureName:k.twisterFeatureName},b=R(d);k.twisterRefreshHandler=new K(a,null,b);a=S(d.twisterUpdateURLInfo);k.twisterRefreshHandler.addParams(a);A.initialize();r.registerPassive({viewAttribution:"DetailPage",viewName:"WebTwisterRefreshView"},{updateView:function(a,
b){var c={};if(a!==g.METADATA){var c={},f;f=q;if(b)switch(a){case g.VARIATION_CHANGE:f=b.selected().selInfo;break;case g.VARIATION_PEEK:f=b.peek().selInfo}c.selectionInfo=f;c.dimensionCombination=k.viewUtil.getCurrDimCombId(c.selectionInfo,"_","X");f=k.twisterUtil.isFullySelected(c.dimensionCombination);c.childAsin=k.twisterUtil.getAsinFromSelectionInfo(c.selectionInfo,f);c.newPageSelectionState=f?"full":"partial";c.mTypeForRefresh=I(k.currentPageSelectionState,c.newPageSelectionState);c.newAsin=
"parent"===c.mTypeForRefresh?F:c.childAsin;c.doNotAbort="parent"===c.mTypeForRefresh?!0:!1;c.twisterCallListParams=z(c.mTypeForRefresh,c.newAsin,c.childAsin,c.dimensionCombination,c.newPageSelectionState);c.optionsForTwisterRefresh=B(b);c.pageRefreshMeasure={newAsin:c.newAsin,dimensionType:J,dimensionDisplayType:d.dimensionsDisplayType}}switch(a){case g.VARIATION_CHANGE:k.subType!==g.PRODUCTIZED_VIEW_SUBTYPE&&(h(c.twisterCallListParams,c.optionsForTwisterRefresh,c.pageRefreshMeasure,c.doNotAbort,
!0),k.currentPageSelectionState=c.newPageSelectionState,k.subType=q);break;case g.METADATA:switch(b.subType){case g.DP_STATE_VIEW_SUBTYPE:J=b.divMetadata.dimDisplayType;break;case g.PRODUCTIZED_VIEW_SUBTYPE:k.subType=b.subType,c.dimensionCombination=b.newDimCombID,c.childAsin=b.childAsin,c.newAsin=b.newAsin,c.newPageSelectionState=k.twisterUtil.isFullySelected(c.dimensionCombination)?"full":"partial",c.mTypeForRefresh=I(k.currentPageSelectionState,c.newPageSelectionState),c.doNotAbort="parent"===
c.mTypeForRefresh?!0:!1,c.twisterCallListParams=z(c.mTypeForRefresh,c.newAsin,c.childAsin,c.dimensionCombination,c.newPageSelectionState),c.optionsForTwisterRefresh=B(b),c.pageRefreshMeasure={newAsin:c.newAsin,dimensionType:b.divMetaData?b.divMetaData.dimDisplayType:q,dimensionDisplayType:d.dimensionsDisplayType},h(c.twisterCallListParams,c.optionsForTwisterRefresh,c.pageRefreshMeasure,c.doNotAbort,!0),k.currentPageSelectionState=c.newPageSelectionState}}}})})()}var u=e.$;r.registerDimensionSubView("page-refresh-view",
x);return x});m.when("A").register("twister-common-constants",function(e){return{FAMILY_SIZE_BUCKET_LIMITS:[0,3,8,25,50,100,1E3,5E3],DEFAULT_SELECTION_TAG:"defaultSelection",BottomSheet:{TRIGGERING_CRITERION_BOTTOMSHEET_OPEN:"onBottomsheetOpen",BOTTOM_SHEET_SELECTOR:"#twister_bottom_sheet",OVERFLOW_THRESHOLD:8,BOTTOM_SHEET_INIT_TIME:"dpBottomSheetInitTime",PREFETCH_AJAX_CALLS_COMPLETED_EVENT:"prefetchAjaxCallsCompleted"},SortingFiltering:{PRICE_SORT_TOGGLE_SWITCH_CLICK_ON_METRIC:"DPBottomSheetSortingToggleSwitchClickOn",
PRICE_SORT_TOGGLE_SWITCH_CLICK_OFF_METRIC:"DPBottomSheetSortingToggleSwitchClickOff",PRICE_SORT_TOGGLE_SWITCH_ENABLED_STATUS_METRIC:"DPBottomSheetPriceSortingToggleSwitchEnabledStatus",PRIME_FILTER_TOGGLE_SWITCH_CLICK_ON_METRIC:"DPBottomSheetPrimeFilteringToggleSwitchClickOn",PRIME_FILTER_TOGGLE_SWITCH_CLICK_OFF_METRIC:"DPBottomSheetPrimeFilteringToggleSwitchClickOff",PRIME_FILTER_TOGGLE_SWITCH_ENABLED_STATUS_METRIC:"DPBottomSheetPrimeFilteringToggleSwitchEnabledStatus",SORTING_TYPE_PRICE:"price",
SORTING_TYPE_UNSORTED:"unsorted",PREFETCH_AJAX_CALLS_COMPLETED_EVENT:"prefetchAjaxCallsCompleted",TOGGLE_SWITCH_STATE_OFF:"off",TOGGLE_SWITCH_STATE_ON:"on",PRICE_SORTING_ENABLED_PARAMETER:"priceSortingEnabled",PRICE_SORTING_PRIORITY_NAME_PARAMETER:"priceSortingPriorityName",ALTER_TYPE_NAME_PRICE:"price",ALTER_TYPE_NAME_PRIME:"prime",ALTER_SUB_TYPE_ENABLE:"enable",ALTER_SUB_TYPE_DISABLE:"disable",ALTER_TYPE_SORT:"sort",ALTER_TYPE_FILTER:"filter",PRICE_SORT_TOGGLE_SWITCH_SELECTOR:".priceSortToggleSwitch",
PRIME_FILTER_TOGGLE_SWITCH_SELECTOR:".primeFilterToggleSwitch",EXPERIMENT_PRICE_SORTING:"priceSorting",EXPERIMENT_PRIME_FILTERING:"primeFiltering",ATTRIBUTE_PRICE_SORTING_PRIORITY:"priorityName",ATTRIBUTE_SORT_BY_PRICE_STRING:"sortByPriceString",ATTRIBUTE_SORTED_BY_PRICE_STRING:"sortedByPriceString",ATTRIBUTE_TOOL_NAME:"toolName",TOOL_TYPE_TOGGLE_SWITCH:"toggleSwitch"}}});m.when("A").register("page-refresh-custom-params-handler",function(e){var m={};return{initialize:function(){e.on("updateCustomPageRefreshParams",
function(e,g,v){e&&g&&null!==v&&v!==q&&(m[e]||(m[e]={}),m[e][g]=v)})},getCustomPageRefreshParams:function(e){return m[e]||{}}}});"use strict";m.when("A","a-sheet","jQuery","ready").execute(function(e,m,t){e.on("a:sheet:afterShow:bottom_sheet_mediaMatrix",function(){var e=t("#mediaMatrix_bottomSheet_view_div").find("#format-picker-scroller"),m=e.find("#selected-format"),r=m.offset().left,q=Math.abs(m.width()),m=Math.max(document.documentElement.clientWidth,w.innerWidth||0),q=m-q,x=e.scrollLeft();(r>
q||0>=r)&&e.scrollLeft(x+r-m/3)})});m.when("A","view-util","twister-string-constants").register("hover-refresh-view",function(e,w,t){var g=e.$;return function(v,r,A){function x(){e.each(r.contextMetaData,function(e,m){var h={};e=e.elementList||[];var g=e.length;h.mouseOver=[];for(var p=0;p<g;p++)(e[p].customClientFunction||e[p].ccf)&&(e[p].updateOnHover||e[p].uoh)&&h.mouseOver.push(e[p].divToUpdate||e[p].dtu);d.clientFeatures[m]=h})}function u(q,z){e.each(d.clientFeatures[z][t.EVENT_TYPE_MOUSEOVER],
function(d){try{var e=g("#"+d),p;e.length&&(p=e.attr("customfunctionname"),function(){var d={};d.P=m;(function(){eval("var P \x3d this.P;");eval("0, "+p)(q,DetailPage.StateController)}).call(d)}())}catch(z){M.logFatal("Client feature - "+feature+", threw and exception :- "+z)}})}function L(e){e=d.twisterUtil.getSelectionInfoFromSelectedVariationValuesMap(e.selected_variation_values);d.twisterUtil.isFullySelected(e)?d.currentPageSelectionState="full":d.currentPageSelectionState="partial"}var d=this,
M=new A("dpTwisterHoverRefreshView");this.twisterUtil=v.util;this.twisterFeatureName="TwisterHover";this.currentPageSelectionState;this.clientFeatures={partial:{},full:{},parent:{},master:{}};d.viewUtil=new w(v);d.subType=q;(function(){function m(e){e=d.viewUtil.getCurrDimCombId(e,"_","X");var h=d.twisterUtil.isFullySelected(e)?"full":"partial",g,p=d.currentPageSelectionState;"partial"===p&&"partial"===h&&(g="partial");"partial"===p&&"full"===h&&(g="full");"full"===p&&"partial"===h&&(g="parent");
"full"===p&&"full"===h&&(g="full");h=[g];"parent"===g&&(h=["parent","partial"]);return{clientFeatureToRefresh:h,dimensionCombination:e}}L(r);x();v.registerPassive({viewAttribution:"DetailPageTwister",viewName:"WebTwisterHoverRefreshView"},{updateView:function(g,h){switch(g){case t.VARIATION_PEEK:var r={};g=h.peek().selInfo;r=m(g);e.each(r.clientFeatureToRefresh,function(d){u(r.dimensionCombination,d)});case t.VARIATION_CHANGE:d.subType!==t.PRODUCTIZED_VIEW_SUBTYPE&&(g=h.selected().selInfo,h=d.viewUtil.getCurrDimCombId(g,
"_","X"),d.currentPageSelectionState=d.twisterUtil.isFullySelected(h)?"full":"partial",d.subType=q);break;case t.METADATA:switch(h.subType){case t.PRODUCTIZED_VIEW_SUBTYPE:d.subType=h.subType,d.currentPageSelectionState=d.twisterUtil.isFullySelected(h.newDimCombID)?"full":"partial"}}}})})()}})});
/* ******** */
(function(x){var w=window.AmazonUIPageJS||window.P,z=w._namespace||w.attributeErrors,r=z?z("DetailPageTwisterAssets",""):w;r.guardFatal?r.guardFatal(x)(r,window):r.execute(function(){x(r,window)})})(function(x,w,z){x.when("A","jQuery","dp-js-logger","dp-ajax-prefetch-metrics").register("dp-ajax-prefetch",function(r,e,a,b){function p(a,g,d,c,n,q){this.scope=a;this.uniqueId=g;this.url=d;this.options=c;this.context=n;this.status=0;this.selected=!1;this.error=this.successData=this.xhr=this._status=z;
this.chunks=[];this.doNotAbort=q||!1;this.prefetchMetrics=b.getInstance(this.scope)}var l=new a("dpAjaxPrefetch");p.prototype._callback=function(a,g,d,c,b){"function"===typeof a&&a.call(self,g,d,c,b)};p.prototype._canAbort=function(){return!this.doNotAbort&&1===this.status};p.prototype._isAborted=function(){return 3===this.status};p.prototype._getUniqueId=function(){return this.uniqueId};p.prototype._abort=function(){if(1===this.status)try{this.ajaxRequestRefence.abort(),this.status=3}catch(a){l.logFatal(a,
{message:" Could not abort ajax request."})}};p.prototype._flushChunkData=function(){var a=this;a.chunks.length&&e.map(a.chunks,function(g){a._callback(a.options.chunk,g,a.context)})};p.prototype._request=function(){var a=this;a.ajaxRequestRefence=r.get(a.url,{params:a.options.params,success:function(g,d,c){a.status=4;a.successData=g;a._status=d;a.xhr=c;a.selected&&a._callback(a.options.success,g,d,c,a.context)},error:function(g,d,c){a.status=2;a.xhr=g;a._status=d;a.error=c;a.selected&&a._callback(a.options.error,
g,d,c,a.context)},abort:function(g){a.status=3;a.xhr=g;a.selected&&a._callback(a.options.abort,g,a.context)},chunk:function(g){g&&(a.chunks.push(g),a.selected&&a._callback(a.options.chunk,g,a.context))},timeout:a.options.timeout||4E4})};p.prototype.prefetchContent=function(){this.prefetchMetrics.predicted(this.uniqueId);0===this.status&&(this.status=1,this._request())};p.prototype.getContent=function(a){a&&this.prefetchMetrics.selected(this.uniqueId);p._abortPrefetchesExcept(this);this.selected=!0;
0===this.status?(this.status=1,this._request()):1===this.status?this._flushChunkData():4===this.status&&(this._flushChunkData(),this._callback(this.options.success,this.successData,this._status,this.xhr,this.context),r.trigger("a:pageUpdate"))};p._objects={};p._abortPrefetchesExcept=function(a){e.each(p._objects[a.scope],function(g,d){d._canAbort()&&g!==a._getUniqueId()&&d._abort()})};p.getInstance=function(a,g,d,c,b,q){if(!a||!g||!d||"object"!==typeof c)throw"Incorrect parameter passed.";p._objects[a]=
p._objects[a]||{};var e=p._objects[a][g];e&&e._isAborted()&&(delete p._objects[a][g],e=z);e||(p._objects[a][g]=new p(a,g,d,c,b,q,this));return p._objects[a][g]};return p});x.when("A","jQuery","dp-ajax-prefetch","twister-utils","dp-js-logger").register("dimensional-summary-module",function(r,e,a,b,p){var l=new p("dpDimensionalSummary");return function(a){function g(a){f.initData.fnToDetermineSelectedVariations?"function"===typeof f.initData.fnToDetermineSelectedVariations&&(f.currentDimCombOnGlance=
f.initData.fnToDetermineSelectedVariations.call(f)):(f.glanceViewSelectedDims=q.StateController.getState().selected_variations,f.currentDimCombOnGlance=q.StateController.getState().currentDimCombID);return a?f.currentDimCombOnGlance.split("_"):f.currentDimCombOnGlance}function d(a,c){for(var h="",m,C,k=0,d=a.length;k<d;k++)h=h+(0<k?",":"")+a[k];var g=E.extend(g,b.getQueryParams({psc:1})),g=E.extend(g,{parentAsin:q.StateController.getState().parent_asin,productGroupId:q.StateController.getState().productGroupID});
f.initData.globalAjaxParameters&&(g=E.extend(g,f.initData.globalAjaxParameters));e.isPWBadgeEnabled&&(g.isPWBadgeEnabled=1);g&&(C=E.param(g));h&&(a=!e.multiDimensionWeblabEnabled||"dropdown"!==c.dimType.toLowerCase()&&"swatch"!==c.dimType.toLowerCase()?c.dimType:"Dropdown",m="/gp/twister/dimension?asinList\x3d"+h+"\x26isDimensionSlotsAjax\x3d1\x26dimSubType\x3d"+c.dimSubType+"\x26dimType\x3d"+a+(C?"\x26"+C:""));return m}function c(a){for(var c,h=0,m=a.length;h<m;h++)c=c+(0<h?",":"")+a[h];return c}
function n(a,m,h){e.isPWBadgeEnabled&&w.ue&&w.ue.count&&w.ue.count("Twister:DimensionSlotsAjax",(w.ue.count("Twister:DimensionSlotsAjax")||0)+1);c(a);a=d(a,h);var g={};h.params&&(g.params=h.params);g.chunk=function(a,k){var c;(c=(c=(c=(c=a&&"JSON"===a.Type)&&typeof("undefined"!==a.Value))&&typeof("undefined"!==a.Value.content))&&typeof("undefined"!==a.Value.content.twisterSlotDiv))?(h.executeChunk===z?h.chunk(a,k):h.executeChunk()&&h.chunk(a,k),f.asinDimSumCache[a.ASIN]=a):l.logFatal("The received data does not contain required properties.",
{message:"[Twister]Invalid data received."})};g.success=function(a,k,c,m){h.success&&b.typeChecker.isFunction(h.success)&&h.success(a,k,c,m)};g.error=function(a,k,c){h.error&&b.typeChecker.isFunction(h.error)&&h.error(a,k,c)};g.abort=function(a){h.abort&&b.typeChecker.isFunction(h.abort)&&h.abort(a)};g.timeout=6E4;r.get(a,{success:function(a,k,c){g.success(a,k,c,m)},chunk:function(a){g.chunk(a,m)},error:function(a,k,c){g.error(a,k,c)},abort:function(a){g.abort(a)}})}var q=w.DetailPage,e=w.Twister,
f=this,E=r.$;f.initData=a;f.scopePrefix="dpDimSum";f.symbolForTriggeringDim="*";f.uniqueID="";f.urlPrefix="";f.asinDataCache={};f.glanceViewSelectedDims="";f.currentDimCombOnGlance="";f.mapOfDimToAsinMaps={};f.mapOfAsinToDimMaps={};f.asinDimSumCache={};f.scope=f.scopePrefix+"_"+f.initData.scopeSuffix;f.dimensionsList=f.initData.dimensionsList;f.dimensionValuesList=f.initData.dimensionValuesList;f.dimensionCombinationToASINMap=f.initData.dimensionCombinationToASINMap;g();f.fetchDimSumData=function(a){if(a.dimTriggeringDimSum&&
b.typeChecker.isString(a.dimTriggeringDimSum))var c=a.dimTriggeringDimSum;else throw"Wrong parameter passes to DimSumModule "+f.scope;var h=r.indexOfArray(f.dimensionsList,c);if(a){if(!a.asinList||!b.typeChecker.isArray(a.asinList))throw"Wrong parameter passed to DimSumModule "+f.scope;if(!a.chunk||!b.typeChecker.isFunction(a.chunk))throw"Wrong parameter passed to DimSumModule "+f.scope;}else throw"Error : No options for dimSum";c={dimIndexTriggeringDimSum:h};c.dimCombOnPage=g();var m=g(!0).slice(0);
m[h]=f.symbolForTriggeringDim;h=m.join("_");c.hashKey=h;for(var d=a.asinList,h=[],m=[],k=0,q=d.length;k<q;k++){var u=d[k];u&&(f.asinDimSumCache&&f.asinDimSumCache[u]?m.push(u):h.push(u))}d=[];d.asinListForServer=h;d.asinListForCache=m;0<d.asinListForServer.length&&n(d.asinListForServer,c,a);if(0<d.asinListForCache.length){h=d.asinListForCache;d=0;for(k=h.length;d<k;d++)m=h[d],a.chunk(f.asinDimSumCache[m],c);h.length===a.asinList.length&&a.success(z,z,z,c)}}}});x.when("A","twister-string-constants").register("twister-modal-resize-helper",
function(r,e){return function(){function a(a,d){a.each(function(a,g){a=m(g);-1===g.className.indexOf(d)&&(a.outerWidth()>e.width&&(e.width=a.outerWidth()),a.outerHeight()>e.height&&(e.height=a.outerHeight()))});return e}var b=w.Twister,e={width:0,height:0},l=this,m=r.$;l.getGlanceSwatchesInRow=function(a,d){d&&d.fixModalSwatchesForThinWidths();a=m("#twister_feature_div "+a);var c=0,b=0;0<a.length&&(b=a.get(0).getBoundingClientRect().top,c++);for(var q=1,e=a.length;q<e;q++){var f=a.get(q).getBoundingClientRect();
if(5<Math.abs(b-f.top))break;else c++}d&&d.resizeSwatchesForThinWidths();return c};l.fixSize=function(g,d,c,n,q){g.removeClass("twisterSwatchWrapper");var e=a(g,n),f=w.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(q!==z){var E=q.twisterModalDiv.outerWidth(),p=l.getGlanceSwatchesInRow(d,q),t=g.first().width(),t=p*(e.width-t);0<t&&0<p&&q.setModalWidth(E+t)}g.addClass("twisterSwatchWrapper");b.isIE8()?(g.each(function(a,c){m(c).css({"min-height":e.height+"px","min-width":e.width+
"px"})}),1100<f&&m("."+n).css({height:e.height+"px"})):m("#"+c).html(d+" { min-height:"+e.height+"px; min-width:"+e.width+"px; } ."+n+" { height: "+e.height+"px;}");l.resetBestSize()};l.resetBestSize=function(){e={width:0,height:0}}}});x.when("A").register("evdd-utils",function(r){return function(){this.PopulateEVDD=function(e,a,b,p){var l={},m,g;for(m in e)if(g=b[m],"undefined"!=typeof g){var d=g[1];p===g[0]&&(l[d]=e[m])}"function"===typeof a.dimensionViewHandlersMap[1].updateViewWithPriceInfo&&
a.dimensionViewHandlersMap[1].updateViewWithPriceInfo(l)}}});x.when("A").register("scroll-event-handler",function(r){return function(e,a,b){if(a){var p=r.$,l,m=(new Date).getTime();p(a).bind("scroll",function(a){var d=Date.now();l&&d-m<e&&clearTimeout(l);m=d;l=setTimeout(function(){b(a)},e)})}}});x.when("A").register("twister-data-translator",function(r){function e(b){var e=[],l=b.selected_variation_values;a.each(b.dimensions,function(a,g){l.hasOwnProperty(g)&&e.push({dimKey:g,val:l[g]})});return e}
var a=r.$;return{getTranslatedData:function(a){var p={},l={},m=a.deviceType,g=a.ajaxTimeout;l.ajaxUrlParams=a.ajaxUrlParams;l.deviceType=m;l.ajaxTimeout=g;p.config=l;var l={},m=a.dimToAsinMapData,d;for(d in m)if(m.hasOwnProperty(d)){var g=m[d],c=d.split("_").join(":");l[c]=g}p.dimCombinations=l;p.dimensionDisplayText=a.variationDisplayLabels;d=[];l=a.dimensions;m=a.dimensionSelectionData;g=a.variation_values;for(c=0;c<l.length;c++){var n={},q=l[c];n.dimKey=q;n.isRequired=m[c].isRequired?!0:!1;n.size=
g[q].length;d.push(n)}p.dimensionInfo=d;p.dimensionList=a.dimensions;p.dimtoValueMap=a.variation_values;p.initDimCombination=e(a);return p}}});x.when("A").register("twister-availabilty-cache",function(r){return function(e,a){function b(a,g){var d=a+":"+g,c=a.split("_"),n=c.length,q=-1,e;if(null!==l.asinToRenderCache[d]&&l.asinToRenderCache[d]!==z)return l.asinToRenderCache[d];l.intermediateAsinToRenderCache[d]=!0;for(d=0;d<n;d++)if("X"===c[d]){q=d;break}if(-1===q)return e=null,null!=l.twisterVariationsData.dimToAsinMapData[a]&&
(e=l.twisterVariationsData.dimToAsinMapData[a]),e;a=l.twisterVariationsData.dimensionValuesData[q].length;for(var f=0;f<a&&(c[q]=f,n=c.join("_"),d=n+":"+g,l.intermediateAsinToRenderCache.hasOwnProperty(d)||(e=b(n,g),null===e||e===z));f++);return e}function p(a){for(var g in l.intermediateAsinToRenderCache)l.asinToRenderCache[g]=a,delete l.intermediateAsinToRenderCache[g];l.intermediateAsinToRenderCache={}}var l=this;l.twisterVariationsData=e;l.dimensionHierarchyData=a.dimensionHierarchyData;l.isHierarchicalPivoting=
a.hierarchicalPivoting;l.dimAvailabilityCache={};l.dimCurrentAvailabilityCache={};l.asinToRenderCache={};l.intermediateAsinToRenderCache={};l.isUpdateCacheReq=!1;l.isDimCombinationCurrentlyAvailable=function(a){if(l.dimCurrentAvailabilityCache[a])return l.dimCurrentAvailabilityCache[a];var g=!0;l.twisterVariationsData.currentlyUnavailableDimensions.includes(a)&&(g=!1);return l.dimCurrentAvailabilityCache[a]=g};l.resetAvailabilityCache=function(){l.dimAvailabilityCache={}};l.isDimCombinationAvailable=
function(a){var g=a.split("_"),d,c=-1,b,q;d=g.length;if(null!==l.dimAvailabilityCache[a]&&l.dimAvailabilityCache[a]!==z)return l.dimAvailabilityCache[a];for(q=0;q<d;q++)if("X"===g[q]){c=q;break}if(-1===c)return b=!1,null!==l.twisterVariationsData.dimToAsinMapData[a]&&l.twisterVariationsData.dimToAsinMapData[a]!==z&&(b=!0),l.dimAvailabilityCache[a]=b;d=l.twisterVariationsData.dimensionValuesData[c].length;for(var e=0;e<d&&(g[c]=e,q=g.join("_"),null!==l.dimAvailabilityCache[q]&&l.dimAvailabilityCache[q]!==
z?b=l.dimAvailabilityCache[q]:(b=l.isDimCombinationAvailable(q),l.dimAvailabilityCache[q]=b),!b);e++);return l.dimAvailabilityCache[a]=b};l.gAsinToRender=function(a,g){var d=null,c,n,q=a.split("_"),e=q.length;c=a+":"+g;if(null!==l.asinToRenderCache[c]&&l.asinToRenderCache[c]!==z)return l.isUpdateCacheReq&&(p(l.asinToRenderCache[c]),l.isUpdateCacheReq=!1),l.asinToRenderCache[c];l.isUpdateCacheReq||(l.isUpdateCacheReq=!0);l.intermediateAsinToRenderCache.hasOwnProperty(c)||(d=b(a,g));if(null!==d&&d!==
z)return l.isUpdateCacheReq&&("X"===q[g]?(l.asinToRenderCache[c]=d,l.intermediateAsinToRenderCache={}):p(d),l.isUpdateCacheReq=!1),d;for(a=0;a<e;a++)if(c=l.isHierarchicalPivoting&&l.dimensionHierarchyData&&l.dimensionHierarchyData[a]<l.dimensionHierarchyData[g],a!==g&&"X"!==q[a]&&!c&&(d=q[a],q[a]="X",c=q.join("_"),n=c+":"+g,q[a]=d,!l.intermediateAsinToRenderCache.hasOwnProperty(n)&&(d=b(c,g),null!==d&&d!==z)))return l.isUpdateCacheReq&&(p(d),l.isUpdateCacheReq=!1),d;d=-1;for(a=0;a<e;a++)if(c=l.isHierarchicalPivoting&&
l.dimensionHierarchyData&&l.dimensionHierarchyData[a]<l.dimensionHierarchyData[g],"X"!==q[a]&&a!==g&&!c){d=a;break}if(-1===d)return"";q[d]="X";c=q.join("_");return l.gAsinToRender(c,g)}}});x.when("A","twister-string-constants").register("twister-utils",function(r,e){var a=w.DetailPage,b=r.$,p=this,l={};p.windowWidth=w.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;p.immersiveTwisterOverlay=b("#"+e.TWISTER_FEATURE_DIV_ID+" #"+e.IMMERSIVE_TWISTER_OVERLAY);p.twisterFeatureDiv=
b("#"+e.TWISTER_FEATURE_DIV_ID);(function(){for(var a="Array Object String Date RegExp Function Boolean Number Null Undefined".split(" "),g=0,d=a.length;g<d;g++)l["is"+a[g]]=function(a){return function(d){return Object.prototype.toString.call(d).slice(8,-1)===a}}(a[g])})();return{enableTwisterDiv:function(){p.immersiveTwisterOverlay.css({opacity:"0",position:"absolute",width:"0px",height:"0px"})},disableTwisterDiv:function(){var a=p.twisterFeatureDiv.get(0).clientWidth,g=p.twisterFeatureDiv.get(0).clientHeight;
p.immersiveTwisterOverlay.css({opacity:"0.8",position:"absolute",width:a,height:g,"background-color":"white","z-index":10})},isSwatchSelected:function(a,g){var d=w.Twister.isImmersiveExperience?"."+e.TWISTER_SWATCH_CLASS_PREFIX+g.dimensionsMap[a[e.STRING_DIM_INDEX]]+"_"+a[e.STRING_DIM_VALUE_INDEX]:"#"+g.dimensionsMap[a[e.STRING_DIM_INDEX]]+"_"+a[e.STRING_DIM_VALUE_INDEX],c;if(r.$(d).is("li")){d=r.$(d);!w.Twister.isImmersiveExperience||0<d.length||(d=r.$("."+e.TWISTER_SWATCH_CLASS_PREFIX+g.dimensionsMap[a[e.STRING_DIM_INDEX]]+
"_"+a[e.STRING_DIM_VALUE_INDEX]));a=d.get(0).className.split(" ");g=0;for(d=a.length;g<d;g++){var b=a[g];if(0===b.indexOf("swatch")){c=b;break}}c!==e.CLASS_FOR_SWATCH_UNAVAILABLE_HOVER&&c!==e.CLASS_FOR_SWATCH_UNAVAILABLE||r.$("#twisterPopover.twisterPopoverSkin").hide();return c===e.CLASS_FOR_SWATCH_SELECT}return!1},isPartialState:function(b){for(var g=a.StateController.getState().currentDimCombID.split("_"),d=!1,c=0;c<b;c++)if("X"===g[c]){d=!0;break}return d},getProductizedTwisterSelectionFromDivMetaData:function(a,
g){var d=[],c=a.dimIndex,b=a.dimValueIndex;for(a=0;a<g.length;a++)if(c===parseInt(a,10)){c={};c.dimKey=g[a];c.val=parseInt(b,10);d.push(c);break}return d},getProductizedTwisterSelectionFromDimComb:function(a,g){var d=[];a=a.replace(/X/g,"-1").split("_");for(var c=0;c<g.length;c++){var b={},q=a[c];b.dimKey=g[c];b.val=parseInt(q,10);d.push(b)}return d},getImmersivePartialStateBannerContent:function(a,g){var d="",c=w.Twister.immersivePartialStateMessage,b=a.dimensionSelectionData;a=a.dimensionsDisplay;
for(var q=0;q<b.length;q++)q!==g&&0===b[q][e.STRING_IS_SELECTED]&&(d=d?d+", "+a[q]:a[q]);w.Twister.isPWBadgeEnabled&&(d=d.toLowerCase());return c.replace("dimName",d)},getImmersiveFullStateBannerContent:function(b,g){var d="",c=w.Twister.immersiveFullySelectedStateMessage,n=b.dimensionSelectionData,q=b.dimensions;b=b.dimensionsDisplay;for(var p=a.StateController.getState().selected_variations,f=0;f<n.length;f++)f!==g&&1===n[f][e.STRING_IS_SELECTED]&&(d=d?d+", "+b[f]+" "+p[q[f]]:b[f]+" "+p[q[f]]);
return c.replace("dimName",d)},isSmallerWidthScreen:function(){return 1100>p.windowWidth?1:0},getAttachedClass:function(a,g){a=a[e.STRING_DIM_VALUE_INDEX];var d="#"+g+"_"+a;if(r.$(d).is("li")){var c,d=r.$(d);!w.Twister.isImmersiveExperience||0<d.length||(d=b("."+e.TWISTER_SWATCH_CLASS_PREFIX+g+"_"+a));g=d.get(0).className.split(" ");a=0;for(d=g.length;a<d;a++){var n=g[a];if(0===n.indexOf("swatch")){c=n;break}}return c}d=w.Twister.isImmersiveExperience?e.IMMERSIVE_DROPDOWN_ROW_PREFIX+g+"_"+a:e.NATIVE_DROPDOWN_DIV_PREFIX+
g+"_"+a;return r.$(d).attr("class")},htmlUnescape:function(a){return String(a).replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"\x3c").replace(/&gt;/g,"\x3e").replace(/&amp;/g,"\x26")},getDimStyleData:function(a,b,d,c,n){a=a.split("_");for(var q=[],p=a.slice(0),f,E,l,t=!1,h=0;h<b;h++)l={},a[d]===h.toString()?f=e.STYLE_CLASS_TYPE_FOR_SELECTED:(p[d]=h,f=p.join("_"),(E=c.isDimCombinationAvailable(f))&&(t=c.isDimCombinationCurrentlyAvailable(f)),f=E?t?e.STYLE_CLASS_TYPE_FOR_AVAILABLE:e.STYLE_CLASS_TYPE_FOR_UNAVAILABLE:
e.STYLE_CLASS_TYPE_FOR_INAVLID),f=n[f],l.style=f,q[h]=l;return q},getVisibleTableRows:function(a,g){var d=[],c=a.getBoundingClientRect();g||(g=b(a).find("tr"));if(g.length)for(a=0;a<g.length;a++){var n=g.get(a),q=n.getBoundingClientRect(),e=(q.bottom-q.top)/2,f=c.bottom+e;c.top-e<q.top&&f>q.bottom&&d.push(n);if(c.bottom<q.top)break}return d},reconstructCombinationWithDimValue:function(a,b,d){if(!a)return a;var c=a.split(e.CHAR_UNDERSCORE);if(b>=c.length)return a;c[b]=d;return c.join(e.CHAR_UNDERSCORE)},
isTouchDevice:function(){return r.capabilities.touch},isTouchOnlyDevice:function(){return"undefined"!==typeof w.touchDeviceDetected&&w.touchDeviceDetected},typeChecker:l,getQueryParams:function(a){a=a===z?{}:a;var g={},d=decodeURIComponent(w.location.href).match(/^.*?\?(.*?)(#.*)?$/);if(null===d||2>d.length||d[1]===z)return{};d=d[1].split("\x26");b.each(d,function(c,b){c=b.split("\x3d");2>c.length||a.hasOwnProperty(c[0])||(g[c[0]]=c[1])});return g},stringTrim:function(a){var b=/^\s+/,d=/\s+$/;return String.prototype.trim?
String.prototype.trim.call(a):a.replace(b,"").replace(d,"")},checkPWBadge:function(a,g){if(!g||a!==z){var d=!1,c=r.state("pwState");c&&(d=c.isTryState);var n,q,e,f;g?(e=a.find(".pwTryBadge"),f=a.find(".pwBuyBadge"),c=a.find(".pwPrice")):(e=b(".pwTryBadge"),f=b(".pwBuyBadge"),c=b(".pwPrice"));d&&e.length?(n=e,q=f,c.length&&c.removeClass("aok-hidden"),a=e.parent(),c=a.find(".pwPrimeBadge"),c.length&&c.addClass("aok-hidden"),g=a.find(".buyBoxPrice"),a=a.find(".deal-price"),g.length&&g.addClass("aok-hidden"),
a.length&&a.addClass("aok-hidden")):e.length&&(q=e,n=f,g?(d=a.find(".pwPrimeBadge"),g=a.find(".buyBoxPrice"),a=a.find(".deal-price")):(d=b(".pwPrimeBadge"),g=b(".buyBoxPrice"),a=b(".deal-price")),d.length&&d.removeClass("aok-hidden"),g.length&&g.removeClass("aok-hidden"),a.length&&a.removeClass("aok-hidden"),c.length&&c.addClass("aok-hidden"));n&&n.length&&n.removeClass("aok-hidden");q&&q.length&&q.addClass("aok-hidden")}}}});x.when("A","twister-string-constants").register("aui-style-override",function(r,
e){return{doOverride:function(a,b){"a-button-group"===b.parent("ul").data("action")&&(b=b.find(".a-button.a-button-toggle"),b.length&&(a===e.CLASS_FOR_SWATCH_UNAVAILABLE?b.removeClass(e.AUI_CLASS_FOR_SWATCH_SELECT).addClass(e.AUI_CLASS_FOR_SWATCH_UNAVAILABLE):b.removeClass(e.AUI_CLASS_FOR_SWATCH_UNAVAILABLE),a===e.CLASS_FOR_SWATCH_SELECT?b.addClass(e.AUI_CLASS_FOR_SWATCH_SELECT):b.removeClass(e.AUI_CLASS_FOR_SWATCH_SELECT)))},ingressOverride:function(a){"a-button-group"===a.parent("ul").data("action")&&
(a=a.find(".a-button.a-button-toggle"),a.length&&a.removeClass(e.AUI_CLASS_FOR_SWATCH_SELECT))}}});x.when("A").register("twister-thumbnailModule",function(r){var e=r.$;return{attach:function(a){var b=e("#dropdown_selected_thumbnail_"+a);a=e("#dropdown_selected_"+a+" .a-button-inner");0<b.length&&0<a.length&&(b.detach(),a.append(b),"#"!==b.attr("src")&&b.show())},update:function(a){var b=encodeURIComponent(e("#native_dropdown_selected_"+a).val().split(",")[0]);"undefined"!==typeof b&&"-1"!==b&&(b=
e("#native_"+a+"_"+b),b=0<b.length?b.attr("data-a-image-source"):"",a=e("#dropdown_selected_thumbnail_"+a),0<a.length&&""!==b?(a.attr("src",b),a.show()):a.hide())},preloadAllThumbnails:function(a){if(a){var b=e("#native_dropdown_selected_"+a+" option");a=e("#dropdown_selected_"+a).attr("data-a-class");b&&a&&-1!==a.indexOf("twister-image-dropdown")&&e.each(b,function(a,b){if(a=b.getAttribute("data-a-image-source"))(new Image).src=a})}}}});x.when("A","twister-string-constants","scroll-event-handler").execute(function(r,
e,a){(function(b){function e(a){function d(g,f){g=b(f).get(0).getBoundingClientRect();f=a.$window.get(0).getBoundingClientRect();var n=f.right-f.left,h=f.bottom-f.top;return f.top<g.top&&g.top<f.top+h&&f.left<g.left&&g.left<f.left+n}g=!1;for(var q=0,l=a.selector.length;q<l;q++){var f=[];a.blockIsAppear!==z&&a.blockIsAppear()||(f=b(a.selector[q]).filter(function(){return b(this).is(d)}).not(m));0<f.length&&(r.trigger(a.eventToBeTriggered,[f.clone()]),m=m.add(f))}}var l=[],m=b(),g=!1,d={interval:250,
force_process:!1};b.fn.extend({appearedInTwisterImmersiveView:function(c){var n=b.extend({},d,c||{}),q=this.selector||this;n.selector=[];n.selector[0]=q;var m=function(){g||(g=!0,setTimeout(function(){e(n)},n.interval))};new a(200,c.$scrollHandlerDiv,m);c.$window.resize(m);n.force_process&&setTimeout(function(){e(n)},n.interval);l.push(q);return b(q)},forceAppear:function(a){var g=b.extend({},d,a||{});a=this.selector||this;g.selector=[];g.selector[0]=a;setTimeout(function(){e(g)},g.interval)},invalidateAppearedAlreadyCache:function(a){m=
m.not(this.selector)}})})(r.$)});x.when("A").register("accessibility-helper",function(r){function e(){clearTimeout(b.timeout);b.innerHTML="";b.timeout=setTimeout(function(){b.innerHTML=b.textString},10)}var a=r.$,b={};a(document).ready(function(){b=document.createElement("div");null!=b&&(b.className="twisterAccess",a(b).attr("aria-live","polite"),a(b).attr("aria-atomic","true"),document.body.appendChild(b))});return{announceText:function(a){null!=b&&(b.textString=a,setTimeout(e,0))}}});x.when("A").register("twister-expander",
function(r){return function(e){function a(){"function"===typeof t.synchronousPreCollapseCallback&&t.synchronousPreCollapseCallback();t.logger.logImpression(t.logger.eventTypes.COLLAPSE_BUTTON_CLICK,B);t.expanderSection.height();t.expanderSection.animate({height:t.minHeightForExpandedSection},{duration:t.scrollAnimationDuration,queue:!1,complete:function(){t.expanderSection.css("overflow-y","hidden");t.expanderSection.css("overflow","hidden");t.expanderHidesVariation&&!t.expanderButtonPostCollapse||
t.expanderButton.removeClass("aok-hidden");"function"===typeof t.synchronousPostCollapseCallback&&t.synchronousPostCollapseCallback()}});t.expanderSection.animate({scrollTop:0},{duration:t.scrollAnimationDuration,queue:!1});g.isCollapsed=!0;t.expanderHidesVariation?p():t.collapseButton.addClass("aok-hidden");g.handleVariationSwap()}function b(){f.hasClass("aok-hidden")&&(f.removeClass("aok-hidden"),t.expanderButton.prev().insertAfter(n))}function p(){g.isCollapsed?(t.collapseButton.addClass("aok-hidden"),
t.expanderHidesVariation&&G.addClass("aok-hidden"),t.expanderButtonPostCollapse||t.expanderButton.removeClass("aok-hidden")):(t.expanderButton.addClass("aok-hidden"),G.removeClass("aok-hidden"),t.collapseButton.removeClass("aok-hidden"))}function l(){E.bind("click",function(c){t.expanderButton[0].id===c.currentTarget.id||g.isCollapsed||a()})}var m=r.$,g=this,d,c,n,q,G,f,E=m(".expanderButton"),B,t={minHeightForExpandedSection:50,maxHeightForExpandedSection:100,maxHeightForExpandedSectionInView:null,
scrollAnimationDuration:500,expanderSection:null,useExpanderScrollView:!0,minAsinsForExpandedView:null,expanderButtonReplacementIndex:null,dimValuePrefix:null,initSelectedID:null,swatchImageSize:null,swatchImageMargin:null,expanderButton:null,collapseButton:null,expanderHidesVariation:!0,expanderButtonPostCollapse:!1,synchronousPreExpanderCallback:null,synchronousPostExpanderCallback:null,synchronousPreCollapseCallback:null,synchronousPostCollapseCallback:null,dimDisplayType:null,logger:null,dimOrder:null};
g.handleExpand=function(){"function"===typeof t.synchronousPreExpanderCallback&&t.synchronousPreExpanderCallback();t.logger.logImpression(t.logger.eventTypes.EXPAND_BUTTON_CLICK,B);var a=t.expanderSection.height();g.isCollapsed=!1;g.handleVariationSwap();t.expanderHidesVariation?p():t.expanderButton.addClass("aok-hidden");if(t.useExpanderScrollView)t.expanderSection.height(a).animate({height:t.maxHeightForExpandedSection},{duration:t.scrollAnimationDuration,queue:!1,complete:function(){t.expanderSection.css("overflow-y",
"auto");g.scrollVariationIntoView();t.expanderHidesVariation||t.collapseButton.removeClass("aok-hidden");"function"===typeof t.synchronousPostExpanderCallback&&t.synchronousPostExpanderCallback()}});else{var c=t.expanderSection.css("height","auto").height();t.expanderSection.height(a).animate({height:c},{duration:t.scrollAnimationDuration,queue:!1,complete:function(){t.expanderHidesVariation||t.collapseButton.removeClass("aok-hidden");"function"===typeof t.synchronousPostExpanderCallback&&t.synchronousPostExpanderCallback()}})}};
g.handleVariationSwap=function(a){g.isCollapsed&&(d>=q||t.expanderHidesVariation&&f.hasClass("aok-hidden")&&c.is(f))?(a&&b(),a=f,d===q&&t.expanderHidesVariation?(G.removeClass("aok-hidden"),n=f):d===q+1&&t.expanderHidesVariation?(G.addClass("aok-hidden"),n=t.expanderButton):d===q-1&&t.expanderHidesVariation?(f.removeClass("aok-hidden"),a=G,n=m(t.dimValuePrefix+(d-1))):t.expanderHidesVariation?(G.addClass("aok-hidden"),n=m(t.dimValuePrefix+(d-1))):n=d===q?t.expanderButton:m(t.dimValuePrefix+(d-1)),
c.insertBefore(t.expanderButton),a.addClass("aok-hidden")):g.isCollapsed||b()};g.scrollVariationIntoView=function(){var a=c.offset().top,b=t.expanderSection.offset().top,d=t.expanderSection.scrollTop(),a=a-b,d=d+a;0>a?t.expanderSection.animate({scrollTop:d},{duration:t.scrollAnimationDuration,queue:!1}):a>t.maxHeightForExpandedSectionInView&&(d-=t.swatchImageSize+t.swatchImageMargin,t.expanderSection.animate({scrollTop:d},{duration:t.scrollAnimationDuration,queue:!1}))};g.updateSelectedVariation=
function(a,b){null!=b&&(c=b);null!=a&&(d=a.split("_")[t.dimOrder])};(function(){e&&m.extend(t,e);if(!t.collapseButton)throw"Expander collapseButton should not be null";if(!t.expanderButton)throw"Expander expanderButton should not be null";if(!t.expanderSection)throw"Expander expanderSection should not be null";if(!t.initSelectedID)throw"Expander initSelectedID should not be null";if(!t.minAsinsForExpandedView)throw"Expander minAsinsForExpandedView should not be null";if(!t.dimValuePrefix)throw"Expander dimValuePrefix should not be null";
if(!t.swatchImageSize)throw"Expander swatchImageSize should not be null";if(!t.swatchImageMargin)throw"Expander swatchImageMargin should not be null";if(!t.expanderButtonReplacementIndex)throw"Expander expanderButtonReplacementIndex should not be null";if(!t.dimDisplayType)throw"Expander dimDisplayType should not be null";if(!t.logger)throw"Expander Logger should not be null";t.dimOrder||(t.dimOrder=0);B={dimDisplayType:t.dimDisplayType};t.logger.logImpression(t.logger.eventTypes.EXPANDER,B);q=t.expanderButtonReplacementIndex;
G=m(t.dimValuePrefix+q);f=m(t.dimValuePrefix+(q-1));d=t.initSelectedID.split("_")[t.dimOrder];c=m(t.dimValuePrefix+t.initSelectedID.split("_")[t.dimOrder]);g.isCollapsed=!0;t.expanderButton.click(function(){g.handleExpand()});t.collapseButton.click(function(){a()});l();g.handleVariationSwap()})()}});x.when("A","twister-string-constants","migrated-views").register("view-util",function(r,e,a){function b(a){l.tvm=a.tvm;l.util=a.util}var p=r.$,l=this;b.isViewsEligibleForMigration=function(b){for(var g=
!0,d=a.getMigratedViews(),c=0,n=b[e.INIT_DATA_DIMENSIONS_MAP].length;c<n;c++){var q="undefined"!==typeof b[e.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP]?b[e.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][c]:z;if(!0===g&&q!==z)g=-1!==r.indexOfArray(d,q);else{g=!1;break}}return g};b.prototype={variationData:{getAsinToDimIndexMapData:function(){var a={},b=l.tvm.dimCombinations,d,c,n;for(d in b)b.hasOwnProperty(d)&&(n=d.split(e.CHAR_COLON),c=b[d],n=p.map(n,function(a){return parseInt(a)}),a[c]=n);return a},getDimToAsinMapData:function(){var a=
{},b=l.tvm.dimCombinations,d,c,n;for(d in b)b.hasOwnProperty(d)&&(n=d.split(e.CHAR_COLON).join(e.CHAR_UNDERSCORE),c=b[d],a[n]=c);return a},getDimensionValuesData:function(){var a=[],b=l.tvm.dimtoValueMap;p.each(l.tvm.dimensionList,function(d,c){a.push(b[c])});return a},getDimensionValuesDisplay:function(){var a=this,b={},d=this.getAsinToDimIndexMapData();p.each(d,function(c,d){var q=[];p.each(d,function(c,b){c=a.getDimValueByDimIndex(c,b);q.push(c)});b[c]=q});return b},getDimValueByDimIndex:function(a,
b){var d=z,c=l.tvm.dimInfoMap,n=l.tvm.dimtoValueMap;p.each(c,function(q,e){c.hasOwnProperty(q)&&e.dimOrder===a&&n[q]!==z&&(d=n[q][b])});return d}},getTwisterState:function(a){for(var b=[],d={dimKey:z,val:z},c=0;c<l.tvm.dimensionList.length;c++)if(a&&(d.dimKey=l.tvm.dimensionList[c],parseInt(a.dimIndex,10)===c)){d.val=a.dimValueIndex;b.push(d);break}return b},getCurrDimCombId:function(a,b,d){for(var c=[],n=0;n<l.tvm.dimensionList.length;n++){var q=a[n].val;-1===q&&(q=d?d:e.CHAR_ASTERISK);c.push(String(q))}return b?
c.join(b):c},getDimensionSelectionData:function(a,b){for(var d=[],c=0;c<l.tvm.dimensionList.length;c++){var n={},q=0,p=0;-1!==b[c].val&&(p=1);a[b[c].dimKey].isRequired&&(q=1);n[e.STRING_IS_REQUIRED]=q;n[e.STRING_IS_SELECTED]=p;d[c]=n}return d},getDimDisplayMap:function(){var a=[],b=l.tvm.dimensionList,d=l.tvm.dimensionDisplayText,c;if("undefined"!==typeof d&&"undefined"!==typeof b)for(var n in b)c=b[n],a[n]=d[c];return a},getDimensionValuesData:function(a,b){var d={},c=z;if(b){var n=b[e.TWISTER_CURRENT_ASIN];
(b=b[e.INIT_DATA_DELETED_LANDING_ASIN_INFO])&&n===b.asin&&(c=b.dimValues)}for(n=0;n<l.tvm.dimensionList.length;n++)b=l.tvm.dimtoValueMap[a[n].dimKey][a[n].val],!b&&c&&c[n]&&(b=c[n]),d[n]=b;return d},getDimNameByOrder:function(a){a=Number(a);var b=z;p.each(l.tvm.dimInfoMap,function(d,c){if(c.dimOrder===a)return b=d,!1});return b},isAlreadySelected:function(a,b){var d=!1,c=parseInt(b.dimValueIndex,10),n=this.getDimNameByOrder(parseInt(b.dimIndex,10));if(n)p.each(a,function(a,b){b.dimKey===n&&(d=b.val===
c?!0:!1)});else return!1;return d},initializeTwisterInteractionStartTime:function(){w.newTwisterInteractionStartTime=new Date},isDimensionSelected:function(a,b){return(a=l.tvm.dimensionList[a])&&(b=l.util.getUnselectedDims(b))&&0<b.length?-1===p.inArray(a,b):!1},createAccessibilityText:function(a,b){var d=b[e.STRING_ACCESSIBILITY_CURRENT_SELECTION],c=this.getDimensionValuesData(a,b);a=l.tvm.dimensionList;var n=this.getDimDisplayMap(l.tvm),q=[];p.each(a,function(a,b){q.push(n[a]+" \x3d "+c[a])});return d+
q.join(" , ")},getDimensionValuesDisplayData:function(a,b){var d;if(b){var c=b[e.INIT_DATA_DELETED_LANDING_ASIN_INFO];(d=b[e.INIT_DATA_DIMENSION_VALUES_DISPLAY_DATA][a])||a!==c.asin||(d=c.dimValues)}return d||[]}};return b});x.when("A").register("dp-js-logger-service",function(r){return function(e,a,b,p){function l(a,b,c){b=b||{};"string"===typeof a&&(b.message+=a,a=z);b.logLevel=c;w.ueLogError&&w.ueLogError(a,b)}function m(){var b=a.getDataToUploadOnUnload();g.logCounters(b);return null}var g=this,
d=w.Twister,c=b!==z&&null!==b?b:"";p=p||!1;this.logFatal=function(a,b){l(a,b,"FATAL")};this.logError=function(a,b){l(a,b,"ERROR")};this.logCounter=function(a,b){a=""===c?a:c+":"+a;w.ue&&w.ue.count&&ue.count(a,b)};this.logCounters=function(a){e.each(a,function(a,b){a=c+":"+b.name;"undefined"!==typeof d&&d.printConsoleLogs&&x.log("Logging metric: "+a+" -\x3e "+b.value,"WARN","DPJSLogger");w.ue&&w.ue.count&&ue.count(a,b.value)})};this.consoleLog=function(a){w.console&&"undefined"!==typeof d&&d.printConsoleLogs&&
x.log(a,"WARN","DPJSLogger")};this.init=function(){if(p)if("undefined"!==typeof w.ue.onunload)w.ue.onunload(m);else e(w).bind("beforeunload",m)}}});x.when("A","dp-js-logger-service","twister-string-constants").register("dp-js-logger",function(r,e,a){var b=w.Twister;return function(p,l,m){function g(b){if(!b)return null;var c=l?l.jsInteractionEnabledTime:Date.now();return(b[a.TWISTER_EVENT_DATA_TIME]||Date.now())-c}function d(a){if(a.hasOwnProperty("getMetricData"))return a.getMetricData();var b=a.stringVal;
a=a.hasOwnProperty("getUploadValue")?a.getUploadValue():a.hasOwnProperty("currentValue")?a.currentValue:a.initValue;return isNaN(a)?null:{value:a,name:b}}var c=this,n=r.$,q;this.createFunctionTimer=function(a){return{eventType:a,start:function(){this.startTime=Date.now()},stop:function(){c.logImpression(this.eventType,{duration:Date.now()-this.startTime})}}};this.eventTypes={CLICK:{metricList:["M_CLICK_COUNT","M_FIRST_CLICK","M_VARIANTS_CLICKED"]},UNAVAILABLE_SWATCH_HOVER:{metricList:["UNAVAILABLE_SWATCH_HOVER_COUNT"]},
CURRENTLY_UNAVAILABLE_SWATCH_HOVER:{metricList:["CURRENTLY_UNAVAILABLE_SWATCH_HOVER_COUNT"]},UNAVAILABLE_SWATCH_TABLET_CLICK:{metricList:["UNAVAILABLE_SWATCH_TABLET_CLICK_COUNT"]},UNAVAILABLE_SWATCH_PC_CLICK:{metricList:["UNAVAILABLE_SWATCH_PC_CLICK_COUNT"]},TWISTER_UNAVAILABILITY_NOTIFIER:{metricList:["UNAVAILABILE_VARIATIONS_COUNT","IS_UNAVAILABLITY_PRESENT"]},HOVER:{metricList:["M_HOVER_COUNT","M_FIRST_HOVER"]},HOVER_OUT:[],CACHE_HIT:{metricList:["M_CACHE_HIT","M_CACHE_USED"]},CACHE_MISS:{metricList:["M_CACHE_MISS",
"M_CACHE_USED"]},PAGE_UNLOAD:{metricList:["M_CACHE_UNUSED","M_CACHE_HIT_RATIO","M_CACHE_USED_RATIO"]},REQ_DIM_CHANGED:{metricList:["M_OTHER_REQ_DIM_SELECTED_COUNT","M_REQ_DIM_CHANGE_COUNT"]},DIM_SUM_LOAD:{metricList:["M_DIM_SUM_LOAD"]},CLICK_NA:{metricList:["M_NA_CLICK_COUNT"]},DIM_INIT:{metricList:["M_DIM_PAGENATION_COUNT"]},SCROLL:{metricList:["M_VIEWED_DIM_COUNT"]},CLICK_VARIATION:{metricList:["M_DIM_CLICK_VIEWED_DIM_COUNT"]},EXPAND_BUTTON_CLICK:{metricList:["EXPAND_BUTTON_CLICK_COUNT"]},COLLAPSE_BUTTON_CLICK:{metricList:["COLLAPSE_BUTTON_CLICK_COUNT"]},
EXPANDER:{metricList:["EXPANDER_COUNT"]},HISTORY_API_SUPPORTED:{metricList:["M_HISTORY_API_SUPPORTED"]},HISTORY_API_NOT_SUPPORTED:{metricList:["M_HISTORY_API_NOT_SUPPORTED"]},TWISTER_GREY_OVERLAY_TIME_DESKTOP:{metricList:["M_TWISTER_GREY_OVERLAY_TIME_DESKTOP"]}};var G=function(c,d){this.stringVal=d;this.initValue=NaN;this.deferLogging=!0;this.pagenationCountName=c;this.updateFunction=function(c){var d;d=25*Math.ceil(c[a.TWISTER_EVENT_DATA_PERCENTAGE]/25);var f=c[a.TWISTER_EVENT_DATA_DIV_METADATA][a.STRING_DIM_INDEX];
this.metrics||(this.metrics={});this.metrics[f]||(this.metrics[f]={});(this.metrics[f].percentage||0)<d&&(this.metrics[f].percentage=d);this.metrics[f].pageCount=c[a.TWISTER_EVENT_DATA_COUNT];this.metrics[f].dimDisplayType=c[a.TWISTER_EVENT_DATA_DISPLAY_TYPE];"undefined"!==typeof b&&b.printConsoleLogs&&x.log(this.stringVal+": index - "+f+" page - "+this.metrics[f].pageCount+" percentage - "+this.metrics[f].percentage,"WARN","DPJSLogger")};this.getMetricData=function(){if(this.metrics){var a=[],b=
this;n.each(this.metrics,function(c,d){c=b.pagenationCountName+d.pageCount;d.dimDisplayType&&(c=d.dimDisplayType+":"+c);a.push({name:c+"_"+(b.stringVal+d.percentage),value:1})});return a}}},f={M_CACHE_HIT:{stringVal:"CacheHit",initValue:0,deferLogging:!0,updateFunction:function(a){this.currentValue=0<this.currentValue?this.currentValue+1:1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("incrementing cacheHit count to "+this.currentValue,"WARN","DPJSLogger")}},M_CACHE_MISS:{stringVal:"CacheMiss",
initValue:0,deferLogging:!0,updateFunction:function(a){this.currentValue=0<this.currentValue?this.currentValue+1:1}},M_CACHE_HIT_RATIO:{stringVal:"CacheHitRatio",initValue:NaN,deferLogging:!0,updateFunction:function(a){a=c.getMetricCurrentValue("M_CACHE_HIT");var b=c.getMetricCurrentValue("M_CACHE_MISS");if(a||b)this.currentValue=Math.round(a/(a+b)*100)}},M_CACHE_USED:{stringVal:"CacheUsed",initValue:0,deferLogging:!0,updateFunction:function(a){this.currentValue||(this.currentValue=this.initValue,
this.usedIdCache={});a=a.id;this.usedIdCache.hasOwnProperty(a)||(this.currentValue++,this.usedIdCache[a]=!0)}},M_CACHE_UNUSED:{stringVal:"CacheUnused",initValue:0,deferLogging:!0,updateFunction:function(a){if(l)a=l.twisterModel.pageRefresh.getModelCacheSize("full")-c.getMetricCurrentValue("M_CACHE_USED"),this.currentValue=0>a?0:a;else throw"EventController undefined";}},M_CACHE_USED_RATIO:{stringVal:"CacheUsedRatio",initValue:NaN,deferLogging:!0,updateFunction:function(a){a=c.getMetricCurrentValue("M_CACHE_USED");
var b=c.getMetricCurrentValue("M_CACHE_UNUSED");if(a||b)this.currentValue=Math.round(a/(a+b)*100)}},M_FIRST_CLICK:{stringVal:"FirstClick",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.firstClickLogged||(this.currentValue=g(a),"undefined"!==typeof b&&b.printConsoleLogs&&x.log("first click \x3d "+this.currentValue,"WARN","DPJSLogger"),this.firstClickLogged=!0)}},M_CLICK_COUNT:{stringVal:"ClickCount",initValue:0,deferLogging:!1,updateFunction:function(a){this.currentValue=1;"undefined"!==
typeof b&&b.printConsoleLogs&&x.log("incrementing click count to "+this.currentValue,"WARN","DPJSLogger")}},M_VARIANTS_CLICKED:{stringVal:"VariantsClicked",initValue:0,deferLogging:!0,updateFunction:function(a){a=a.divMetaData;this.lastClickedDivMetaData&&a&&this.lastClickedDivMetaData.dimIndex===a.dimIndex&&this.lastClickedDivMetaData.dimValueIndex===a.dimValueIndex||(this.lastClickedDivMetaData=a,this.currentValue=0<this.currentValue?this.currentValue+1:1,"undefined"!==typeof b&&b.printConsoleLogs&&
x.log("incrementing variants click count to "+this.currentValue,"WARN","DPJSLogger"))}},M_HOVER_COUNT:{stringVal:"HoverCount",initValue:0,deferLogging:!0,updateFunction:function(a){a=a.divMetaData;this.lastHoveredDivMetaData&&a&&this.lastHoveredDivMetaData.dimIndex===a.dimIndex&&this.lastHoveredDivMetaData.dimValueIndex===a.dimValueIndex||(this.lastHoveredDivMetaData=a,this.currentValue=0<this.currentValue?this.currentValue+1:1,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("incrementing hover count to "+
this.currentValue,"WARN","DPJSLogger"))}},M_FIRST_HOVER:{stringVal:"FirstHover",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.firstHoverLogged||(this.currentValue=g(a),"undefined"!==typeof b&&b.printConsoleLogs&&x.log("first hover \x3d "+this.currentValue,"WARN","DPJSLogger"),this.firstHoverLogged=!0)}},M_OTHER_REQ_DIM_SELECTED_COUNT:{stringVal:"OtherReqDimSelectedCount",initValue:NaN,deferLogging:!0,updateFunction:function(a){var c=a.newReqDimValueIndex;a=a.oldReqDimValueIndex;"X"===
c?this.currentValue||(this.lastReqDimValueIndex=a,this.currentValue=0):this.lastReqDimValueIndex!==c&&(this.lastReqDimValueIndex=c,this.currentValue||0===this.currentValue?this.currentValue++:"X"===a?this.currentValue=0:this.currentValue=1,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("OtherReqDimSelectedCount incremented to : "+this.currentValue,"WARN","DPJSLogger"))}},M_REQ_DIM_CHANGE_COUNT:{stringVal:"ReqDimChangeCount",initValue:0,deferLogging:!0,updateFunction:function(a){this.currentValue?
(this.currentValue++,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("ReqDimChangeCount incremented to : "+this.currentValue,"WARN","DPJSLogger")):this.currentValue=1}},M_DIM_SUM_LOAD:{stringVal:"DimSumLoadingDuration",initValue:NaN,deferLogging:!1,updateFunction:function(c){this.currentValue=c[a.TWISTER_EVENT_DATA_DURATION];"undefined"!==typeof b&&b.printConsoleLogs&&x.log("DimSumLoadingDuration: "+this.currentValue,"WARN","DPJSLogger")}},M_TWISTER_GREY_OVERLAY_TIME_DESKTOP:{stringVal:"DPTwisterGreyOverlayDesktopDuration",
initValue:NaN,deferLogging:!1,updateFunction:function(c){this.currentValue=c[a.TWISTER_EVENT_DATA_DURATION];"undefined"!==typeof b&&b.printConsoleLogs&&x.log("DPTwisterGreyOverlayDesktopDuration: "+this.currentValue,"WARN","DPJSLogger")}},M_NA_CLICK_COUNT:{stringVal:"NAClickCount",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("NAClick incremented to: "+this.currentValue,"WARN","DPJSLogger")}},M_DIM_PAGENATION_COUNT:{stringVal:"DimPageCount",
initValue:1,deferLogging:!1,updateFunction:function(c){this.pageCount=c[a.TWISTER_EVENT_DATA_COUNT]||1;this.dimDisplayType=c[a.TWISTER_EVENT_DATA_DISPLAY_TYPE];"undefined"!==typeof b&&b.printConsoleLogs&&x.log("DimPageCount: "+this.pageCount,"WARN","DPJSLogger")},getMetricData:function(){var a=this.stringVal+(this.pageCount||1);this.dimDisplayType&&(a=this.dimDisplayType+":"+a);return{name:a,value:1}}},M_VIEWED_DIM_COUNT:new G("DimPageCount","ViewedVariationCount"),M_DIM_CLICK_VIEWED_DIM_COUNT:new G("DimPageCount",
"ViewedVariationCountBeforeClick"),EXPAND_BUTTON_CLICK_COUNT:{stringVal:"ExpandButtonClickCount",initValue:0,deferLogging:!0,updateFunction:function(c){this.dimDisplayType=c[a.TWISTER_EVENT_DATA_DISPLAY_TYPE];this.currentValue?(this.currentValue++,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("Expand Button Click Count incremented to : "+this.currentValue,"WARN","DPJSLogger")):this.currentValue=1},getMetricData:function(){var a=this.stringVal;this.dimDisplayType&&(a=this.dimDisplayType+":"+a);
return{name:a,value:this.currentValue}}},COLLAPSE_BUTTON_CLICK_COUNT:{stringVal:"CollapseButtonClickCount",initValue:0,deferLogging:!0,updateFunction:function(c){this.dimDisplayType=c[a.TWISTER_EVENT_DATA_DISPLAY_TYPE];this.currentValue?(this.currentValue++,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("Collapse Button Click Count incremented to : "+this.currentValue,"WARN","DPJSLogger")):this.currentValue=1},getMetricData:function(){var a=this.stringVal;this.dimDisplayType&&(a=this.dimDisplayType+
":"+a);return{name:a,value:this.currentValue}}},EXPANDER_COUNT:{stringVal:"ExpanderCount",initValue:0,deferLogging:!0,updateFunction:function(c){this.dimDisplayType=c[a.TWISTER_EVENT_DATA_DISPLAY_TYPE];this.currentValue?(this.currentValue++,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("Expander Count incremented to : "+this.currentValue,"WARN","DPJSLogger")):this.currentValue=1},getMetricData:function(){var a=this.stringVal;this.dimDisplayType&&(a=this.dimDisplayType+":"+a);return{name:a,value:this.currentValue}}},
IS_UNAVAILABLITY_PRESENT:{stringVal:"UnavailabilityPresent",initValue:NaN,deferLogging:!0,updateFunction:function(a){"undefined"===typeof this.currentValue&&(this.currentValue=0,0<a.noOfUnavailableVariations&&(this.currentValue=1),"undefined"!==typeof b&&b.printConsoleLogs&&x.log("IsUnavailabilityPresent : "+this.currentValue,"WARN","DPJSLogger"))}},UNAVAILABILE_VARIATIONS_COUNT:{stringVal:"UnavailableVariations",initValue:NaN,deferLogging:!0,updateFunction:function(a){"undefined"==typeof this.currentValue&&
(this.currentValue=a.noOfUnavailableVariations,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("Possible unavailable variations present are : "+this.currentValue,"WARN","DPJSLogger"))}},UNAVAILABLE_SWATCH_HOVER_COUNT:{stringVal:"UnavailableSwatchHover",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("UnavailableSwatchHoverCount is incremented to : "+this.currentValue,"WARN","DPJSLogger")}},CURRENTLY_UNAVAILABLE_SWATCH_HOVER_COUNT:{stringVal:"CurrentlyUnavailableSwatchHover",
initValue:NaN,deferLogging:!0,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("CurrentlyUnavailableSwatchHoverCount is incremented to : "+this.currentValue,"WARN","DPJSLogger")}},UNAVAILABLE_SWATCH_PC_CLICK_COUNT:{stringVal:"UnavailableSwatchPCClick",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("UnavailableSwatchPCClickCount is incremented to : "+
this.currentValue,"WARN","DPJSLogger")}},UNAVAILABLE_SWATCH_TABLET_CLICK_COUNT:{stringVal:"UnavailableSwatchTabletClick",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("UnavailableSwatchTabletClickCount is incremented to : "+this.currentValue,"WARN","DPJSLogger")}},M_HISTORY_API_SUPPORTED:{stringVal:"HistoryAPISupported",initValue:0,deferLogging:!1,updateFunction:function(a){this.currentValue=(this.currentValue||
0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("History API is supported in the browser : "+this.currentValue,"WARN","DPJSLogger")}},M_HISTORY_API_NOT_SUPPORTED:{stringVal:"HistoryAPINotSupported",initValue:0,deferLogging:!1,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("History API is not supported in the browser : "+this.currentValue,"WARN","DPJSLogger")}}};this.logImpression=function(a,c){try{n.each(a.metricList,
function(a,h){try{var g=f[h];g.updateFunction(c);f[h].deferLogging||q.logCounters(Array(d(g)))}catch(C){"undefined"!==typeof b&&b.printConsoleLogs&&x.log("metricUpdate failing for metric \x3d "+h,"WARN","DPJSLogger")}})}catch(g){"undefined"!==typeof b&&b.printConsoleLogs&&x.log("logImpression failed","ERROR","DPJSLogger")}};this.logFatal=function(a,b){q&&q.logFatal(a,b)};this.logError=function(a,b){q&&q.logFatal(a,b)};this.logCounter=function(a,b){q.logCounter(a,b)};this.addCSMTag=function(a){w.ue&&
w.ue.tag&&w.ue.tag(a)};this.consoleLog=function(a){q&&q.logFatal(a)};this.logPresenceOfUnavailability=function(a,b){a=a.num_total_variations;b=b.dimensionValuesData;for(var c=1,d=b.length,f=0;f<d;f++)c*=b[f].length;this.logImpression(this.eventTypes.TWISTER_UNAVAILABILITY_NOTIFIER,{noOfUnavailableVariations:c-a})};this.logUnavailableSwatchClick=function(){this.logImpression(this.eventTypes.CLICK_NA,null);var a=this.eventTypes.UNAVAILABLE_SWATCH_PC_CLICK;"undefined"!==typeof b&&b.isTabletWeb&&(a=this.eventTypes.UNAVAILABLE_SWATCH_TABLET_CLICK);
this.logImpression(a,null)};this.getDataToUploadOnUnload=function(a){this.logImpression(this.eventTypes.PAGE_UNLOAD);var b=[];n.each(f,function(a,c){try{if(c.deferLogging){var f=d(c);f&&(n.isArray(f)?b=n.merge(f,b):b.push(f))}}catch(C){}});return b};this.getMetricCurrentValue=function(a){try{return f[a].hasOwnProperty("currentValue")?f[a].currentValue:f[a].initValue}catch(b){return f[a].initValue}};q=new e(n,c,p,m);q.init()}});x.when("A","jQuery").register("detail-page-state-controller",function(){return function(){this.state=
{};this.getState=function(){return this.state};this.setState=function(r,e){r&&e&&(this.state[r]=e)}}});x.when("A","jQuery").register("detail-page-framework",function(){return{callbacks:{},registerCallback:function(r,e,a){"after_redraw"!==r&&"asin_select"!==r||"sims-widget"!==e&&"session-similarities"!==e&&"purchase-similarities"!==e&&"buyxgety"!==e||(this.callbacks[e+"_feature_div"]=a)},registerFeature:function(){},registerFeatureConfig:function(){}}});x.when("A","jQuery","dp-js-logger").register("dp-ajax-prefetch-metrics",
function(r,e,a){function b(a){this.scope="dpPre"+a;this.data={}}new a("PrefetchMetrics");b.prototype._count=function(a,b){a=this.scope+a;var e;w.ue&&w.ue.count&&(e="undefined"!==typeof b?(e=ue.count(a,b))||b:(e=ue.count(a))||0);return e};b.prototype._incrementCounter=function(a){this._count(a,(this._count(a)||0)+1)};b.prototype._record=function(a,b,e){this.data[b]=this.data[b]||{};this.data[b][a]||(this.data[b][a]=e||(new Date).getTime(),"predicted"===a?this._incrementCounter("Predicted"):"selected"===
a&&this.data[b].predicted?(a=this.data[b].selected-this.data[b].predicted,this.data[b].lookahead=a,this._incrementCounter("PredictedSelect"),this._count("LookAhead"+this._count("PredictedSelect"),a),this._count("LookAhead",a)):"selected"!==a||this.data[b].predicted||this._incrementCounter("UnpredictedSelect"))};b.prototype.setCounter=function(a,b){this._count(a,b)};b.prototype.predicted=function(a,b){this._record("predicted",a,b)};b.prototype.selected=function(a,b){this._record("selected",a,b)};b._allInstances=
{};b.getInstance=function(a){if(!a)throw"Undefind scope. scope is a required parameter";b._allInstances[a]||(b._allInstances[a]=new b(a));return b._allInstances[a]};return b});x.when("A","twister-string-constants","twister-variations-data","parent-view","twister-view","twister-model","twister-model-new","twister-state","twister-availabilty-cache","twister-utils","evdd-utils","dp-js-logger","TwisterCore","twister-data-translator","twister-productization-view","view-util","detail-page-state-controller-view",
"hover-refresh-view","twister-dimension-subview-promise-handler").register("twister-controller",function(r,e,a,b,p,l,m,g,d,c,n,q,G,f,E,B,t,h,y){return function(C){var k=this;k.logger=new q(null,this);var D=f.getTranslatedData(C),u=C.inlineTwisterData&&C.inlineTwisterData.inlineTwisterEnabled,v=!(!C.inlineTwisterData||!C.inlineTwisterData.shouldDelayRegistrationWithTwisterCore);k.twisterCore=function(a){var b=z;if(u||a!==z)b=new G(a);return b}(D);(function(){k.twisterCore!==z&&(k.productizationView=
new E(k.twisterCore),k.hoverRefreshView=new h(k.twisterCore,C,q),y.getDimensionSubViewPromise("page-refresh-view").then(function(a){k.pageRefreshView=new a(k.twisterCore,C,q)}))})();C[e.IS_PAGE_ELIGIBLE_FOR_PRODUCTIZATION]=u||B.isViewsEligibleForMigration(C);k.twisterJSInitData=C;k.twisterVariationsData=new a(C,k.twisterCore);k.twisterAvailabilityCache=new d(k.twisterVariationsData,C);k.initTwisterState=new g(C,k.twisterVariationsData,k.twisterAvailabilityCache);u?(k.pageRefreshViewPromise=y.getDimensionSubViewPromise("page-refresh-view"),
k.detailPageStateControllerView=new t(C,k.twisterCore),D=void 0):k.twisterCore!==z&&C[e.IS_PAGE_ELIGIBLE_FOR_PRODUCTIZATION]?(k.detailPageStateControllerView=new t(C,k.twisterCore),D=new b(k,C,k.twisterVariationsData,k.twisterAvailabilityCache,k.twisterCore)):D=new p(k,k.initTwisterState,C,k.twisterVariationsData,k.twisterAvailabilityCache);k.twisterView=D;r.on("desktop-twister-view-initialized",function(){r.trigger("register-desktop-twister-with-twisterCore",k.twisterCore,k.pageRefreshViewPromise)});
r.on("desktop-twister-twisterCore-initialized",function(a){k.twisterView=a;k.twisterModel=new m(k,C,k.twisterVariationsData,k.productizationView);x.register("desktop-twister-model")});v?x.when("ImageBlockController","desktop-twister-view-initialiser").execute("register-desktop-twister-with-twisterCore",function(){r.trigger("register-desktop-twister-with-twisterCore",k.twisterCore,k.pageRefreshViewPromise)}):r.trigger("register-desktop-twister-with-twisterCore",k.twisterCore,k.pageRefreshViewPromise);
x.register("desktop-twister",function(){return k.twisterCore});u||(k.twisterModel=new m(k,C,k.twisterVariationsData,k.productizationView),x.register("desktop-twister-model"));k.jsInteractionEnabledTime=Date.now();k.logger.logPresenceOfUnavailability(C,k.twisterVariationsData);k.onInitializeTwister=function(){!u&&k.twisterView.onInitializeTwister()};k.populateEVDD=function(a){var b=k.twisterView,c=k.twisterVariationsData.asinToDimIndexMapData,d=k.twisterModel.twisterState.getMaster();a&&b.isAllViewsInitialized().then(function(){(new n).PopulateEVDD(a,
b,c,d)})};k.handleClick=function(a){k.divMetaData=a;k.logger.logImpression(k.logger.eventTypes.CLICK,{divMetaData:a});var b=k.initTwisterState.getCurrentDimCombID(),d=c.reconstructCombinationWithDimValue(b,a.dimIndex,a.dimValueIndex);w.newTwisterInteractionStartTime=new Date;c.isSwatchSelected(a,k.twisterVariationsData)||b===d||(k.enableMouseOut=0,k.twisterModel.handleClick(a),k.twisterAvailabilityCache.isDimCombinationAvailable(d)||k.logger.logUnavailableSwatchClick())};k.handleExternalViewClick=
function(a,b){try{k.handleClick(a)}catch(c){(new q(b,this)).logFatal(c,{message:"[Failed to hand over click event of external view]"})}};k.handleMouseOver=function(a){if("undefined"!==typeof w.touchDeviceDetected&&w.touchDeviceDetected)return k.handleClick(a),!0;k.logger.logImpression(k.logger.eventTypes.HOVER,{divMetaData:a});k.enableMouseOut=1;k.twisterModel.handleMouseOver(a);return!0};k.handleExternalViewMouseOver=function(a,b){try{k.handleMouseOver(a)}catch(c){(new q(b,this)).logFatal(c,{message:"[Failed to hand over mouse over event of external view]"})}};
k.handleMouseOut=function(a,b,c){1===k.enableMouseOut&&k.twisterModel.handleMouseOut(a,b,c)};k.handleExternalViewMouseOut=function(a,b,c,d){try{k.handleMouseOut(a,b,c)}catch(h){(new q(d,this)).logFatal(h,{message:"[Failed to hand over mouse out event of external view]"})}};k.handleDropdownOnChange=function(a,b){w.newTwisterInteractionStartTime=new Date;k.logger.logImpression(k.logger.eventTypes.CLICK,{divMetaData:b});k.twisterModel.twisterState.setPreHoverData(b);k.twisterModel.handleDropdownChange(b)};
k.registerExternalView=function(a,b){k.twisterModel.registerExternalView(a,b)}}});x.when("3p-promise").register("twister-dimension-subview-promise-handler",function(r){var e={};return{getDimensionSubViewPromise:function(a){if(e[a])return e[a].viewConstructor;e[a]={viewConstructor:null};var b=new r(function(b,l){e[a].resolve=b});return e[a].viewConstructor=b},registerDimensionSubView:function(a,b){e[a]?e[a].resolve(b):e[a]={viewConstructor:r.resolve(b)}}}});x.when("twister-dimension-subview-promise-handler",
"twister-string-constants").register("twister-dimension-view-promise-factory",function(r,e){function a(a,p,l){this.dimCount=l;this.dimensionDisplayType=a[e.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][l];this.dimensionDisplaySubType=a[e.INIT_DATA_DIMENSIONS_DISPLAY_SUB_TYPE_MAP][l];this.dimName=a[e.INIT_DATA_DIMENSIONS_MAP][l];this.dimensionsMap=a[e.INIT_DATA_DIMENSIONS_MAP];this.dimensionDisplayString=a[e.INIT_DATA_DIMENSIONS_DISPLAY][l];this.dimensionValuesData=p.dimensionValuesData[l];this.displayConfigStylesData=
p.displayConfigStylesData[this.dimensionDisplayType];this.twisterVariationsData=p;this.isIconPresentForDimensionValue=function(){var m=[];if("undefined"!==typeof a[e.DIMENSION_VALUE_HAS_ICON])m=a[e.DIMENSION_VALUE_HAS_ICON][l];else for(var g=0;g<p.dimensionValuesData[l].length;g++)m.push(0);return m}}return{registerDimensionSubView:function(a,e){r.registerDimensionSubView(a,e)},getDimensionSubViewPromise:function(b,p,l,m,g,d){return r.getDimensionSubViewPromise(b[e.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][l]).then(function(c){var n=
new a(b,p,l),q={};q[e.STRING_DIM_ORDER]=n.dimCount;q[e.STRING_DIM_NAME]=n.dimName;q[e.STRING_DIMENSIONS_MAP]=n.dimensionsMap;q[e.STRING_DIMENSION_DISPLAY_STRING]=n.dimensionDisplayString;q[e.STRING_DIMENSION_VALUES_DATA]=n.dimensionValuesData;q[e.STRING_DISPLAY_CONFIG_STYLES_DATA]=n.displayConfigStylesData;q[e.STRING_TWISTER_CONTROLLER_HANDLE]=m;q[e.STRING_TWISTER_INITIAL_STATE_KEY]=g;q[e.STRING_TWISTER_AVAILABILITY_CACHE]=g!==z?g.twisterAvailabilityCache:d!==z?d.twisterAvailabilityCache:z;q[e.STRING_TWISTER_VARIATION_DATA]=
n.twisterVariationsData;q[e.STRING_IS_SLOTS_ENABLED]=w.Twister[e.STRING_IS_SLOTS_ENABLED]&&w.Twister[e.STRING_IS_SLOTS_ENABLED][n.dimCount];q[e.DIMENSION_VALUE_HAS_ICON]=n.isIconPresentForDimensionValue();q[e.DIMENSION_SUB_TYPE]=n.dimensionDisplaySubType;q[e.PRODUCTIZED_PARENT_VIEW]=d;q[e.PRODUCTIZED_VIEW_UTIL]=d?d.viewUtil:z;return new c(b,q)})}}});x.when("A","twister-shelf","twister-counter","twister-vodd","twister-beaconized-evdd","twister-native-evdd","twister-dimension-views-swatch","twister-dimension-views-dropdown",
"twister-dimension-views-singleton","twister-string-constants","view-util").register("twister-dimension-view-factory",function(r,e,a,b,p,l,m,g,d,c,n){function q(a,b,c){this.dimCount=c;this.dimensionDisplayType=a.dimensionsDisplayType[c];this.dimensionDisplaySubType=a.dimensionsDisplaySubType[c];this.dimName=a.dimensions[c];this.dimensionsMap=a.dimensions;this.dimensionDisplayString=a.dimensionsDisplay[c];this.dimensionValuesData=b.dimensionValuesData[c];this.displayConfigStylesData=b.displayConfigStylesData[this.dimensionDisplayType];
this.twisterVariationsData=b;this.isIconPresentForDimensionValue=function(){var d=[];if("undefined"!==typeof a.isIconPresentForDimensionValue)d=a.isIconPresentForDimensionValue[c];else for(var f=0;f<b.dimensionValuesData[c].length;f++)d.push(0);return d}}var G=w.Twister,f=r.$;return{getDimensionSubViewObject:function(n,r,t,h,y,C){t=new q(n,r,t);r={};r[c.STRING_DIM_ORDER]=t.dimCount;r[c.STRING_DIM_NAME]=t.dimName;r[c.STRING_DIMENSIONS_MAP]=t.dimensionsMap;r[c.STRING_DIMENSION_DISPLAY_STRING]=t.dimensionDisplayString;
r[c.STRING_DIMENSION_VALUES_DATA]=t.dimensionValuesData;r[c.STRING_DISPLAY_CONFIG_STYLES_DATA]=t.displayConfigStylesData;r[c.STRING_TWISTER_CONTROLLER_HANDLE]=h;r[c.STRING_TWISTER_INITIAL_STATE_KEY]=y;r[c.STRING_TWISTER_AVAILABILITY_CACHE]=y!==z?y.twisterAvailabilityCache:C!==z?C.twisterAvailabilityCache:z;r[c.STRING_TWISTER_VARIATION_DATA]=t.twisterVariationsData;r.isSlotsEnabled=f.isArray(G.isSlotsEnabled)?G.isSlotsEnabled[t.dimCount]:z;r.isIconPresentForDimensionValue=t.isIconPresentForDimensionValue();
r.dimensionDisplaySubType=t.dimensionDisplaySubType;r[c.PRODUCTIZED_PARENT_VIEW]=C;r[c.PRODUCTIZED_VIEW_UTIL]=C?C.viewUtil:z;a:switch(t.dimensionDisplayType){case c.TWISTER_DIMENSION_VIEW_SWATCH:h=m;break;case c.TWISTER_DIMENSION_VIEW_DROPDOWN:h=g;break;case c.TWISTER_DIMENSION_VIEW_SINGLETON:h=d;break;case c.TWISTER_DIMENSION_VIEW_EVDD:h=f("html").hasClass("a-lt-ie8")?l:p;break;case c.TWISTER_DIMENSION_VIEW_VODD:h=b;break;case c.TWISTER_DIMENSION_VIEW_COUNTER:h=a;break;case c.TWISTER_DIMENSION_VIEW_SHELF:h=
e;break;default:h=z;break a}return new h(n,r)}}});x.when("A").execute(function(){"function"===typeof uet&&uet("bb","clickToTwister",{wb:1})});x.when("twisterModule").execute(function(r){"function"===typeof uex&&"function"===typeof uet&&(uet("be","clickToTwister",{wb:1}),uet("be","TwisterAUIWait",{wb:1}),uex("ld","clickToTwister",{wb:1}),uex("ld","TwisterAUIWait",{wb:1}))});x.when("A","twister-string-constants","twister-js-init-dpx-data","twister-controller","page-refresh-manager","dimensional-summary-module",
"dp-js-logger","twister-common-constants").register("twister-init",function(r,e,a,b,p,l,m,g){w.DetailPage={};var d={};w.Twister={};var c=w.Twister,n=w.DetailPage;c.$=r.$;c.DimensionViews={};var q=new m("dpTwister");c.isIEBrowser=function(a){return a.browser.msie||!!navigator.userAgent.match(/Trident/)};c.isIE8=function(){var a=c.A.$;return a("html").hasClass("a-lt-ie9")};c.A=r;(function(){if(!r.$.isEmptyObject(a)){var b=a.updateDivLists;c.dpEnvironment=a.dpEnvironment;c.isInstaTwisterEnabled=!0;d.productTypeName=
a.ajaxUrlParams.match("productTypeDefinition\x3d[A-Za-z_]+")?a.ajaxUrlParams.match("productTypeDefinition\x3d[A-Za-z_]+")[0].split("\x3d")[1]:null;c.productTypeName=d.productTypeName;d.storeID=a.ajaxUrlParams.match("storeId\x3d[A-Za-z1-9_]+")?a.ajaxUrlParams.match("storeId\x3d[A-Za-z1-9_]+")[0].split("\x3d")[1]:null;d.productGroupID=a.ajaxUrlParams.match("productGroupId\x3d[A-Za-z_]+")?a.ajaxUrlParams.match("productGroupId\x3d[A-Za-z_]+")[0].split("\x3d")[1]:null;a.ajaxUrlParams.match("productTypeDefinition")&&
!d.productTypeName&&q.logCounter("productTypeNameNullInJsInit",1);a.ajaxUrlParams.match("storeId")&&!d.storeID&&q.logCounter("storeIDNullInJsInit",1);a.ajaxUrlParams.match("productGroupId")&&!d.productGroupID&&q.logCounter("productGroupIDNullInJsInit",1);c.isImmersiveViewEnabled=a.isImmersiveViewEnabledOnDim?a.isImmersiveViewEnabledOnDim:a.isImmersiveViewEnabled;c.isSlotsEnabled=a.isSlotsEnabled;c.isPWBadgeEnabled=a.isPWBadgeEnabled?a.isPWBadgeEnabled:!1;c.isImmersiveViewEnabledOnPage=a.isImmersiveViewEnabled;
c.isImmersiveExperience=a.isImmersiveExperience?a.isImmersiveExperience:a.isImmersiveViewEnabled;c.multiDimensionWeblabEnabled=a.multiDimensionWeblabEnabled?a.multiDimensionWeblabEnabled:!1;c.immersivePartialStateMessage=a.immersivePartialStateMessage?a.immersivePartialStateMessage:"";c.immersiveFullySelectedStateMessage=a.immersiveFullySelectedStateMessage?a.immersiveFullySelectedStateMessage:"";c.immersiveBannersPresent=a.immersiveBannersPresent?a.immersiveBannersPresent:!1;c.globalAjaxParameters=
{};c.isTabletWeb=a.isTabletWeb;c.isAssemblyVariationsEnabled=a.isAssemblyVariationsEnabled?a.isAssemblyVariationsEnabled:!1;var f=a.contextMetaData;d.contextMetaData=a.contextMetaData;var g=f.full,n=f.master,m=f.parent,f=f.partial;d.inlineTwisterData=a.inlineTwisterData||{};var h=d.inlineTwisterData.inlineTwisterEnabled,l=d.inlineTwisterData.inlineTwisterEnabled;(d.dimensionsDisplayType=a.dimensionsDisplayType)||q.logCounter("dpxDisplayTypePropertyUndefined",1);d[e.STRING_UNAVAILABLE_POPOVER_STRING_VALUE]=
a[e.STRING_UNAVAILABLE_POPOVER_STRING_VALUE]?a[e.STRING_UNAVAILABLE_POPOVER_STRING_VALUE]:"";d[e.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE]=a[e.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE]?a[e.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE]:"";d.currentlyUnavailableAsins=a.currentlyUnavailableAsins?a.currentlyUnavailableAsins:[];d.dimensionSelectionData=a.dimensionSelectionData;d.dimensionsDisplaySubType=a.dimensionsDisplaySubType?a.dimensionsDisplaySubType:[];d.ajaxUrlParams=a.ajaxUrlParams;
d.displayTypeProperties=a.displayTypeProperties?a.displayTypeProperties:[];d.maxSwatchesForImmersiveView=a.maxSwatchesForImmersiveView?a.maxSwatchesForImmersiveView:[];d[e.INIT_DATA_PW_ENABLED_DIMENSION_MAP]=a[e.INIT_DATA_PW_ENABLED_DIMENSION_MAP]?a[e.INIT_DATA_PW_ENABLED_DIMENSION_MAP]:[];l||h||!d.dimensionsDisplayType||"counter"!==d.dimensionsDisplayType[0]||"undefined"!==typeof a.displayTypeProperties[0].expandedViewEnabled||(d.useCounterConfig=!0,d.expandedViewEnabled=a.expandedViewEnabled?a.expandedViewEnabled:
[],d.minAsinForExpandedView=a.minAsinForExpandedView?a.minAsinForExpandedView:[],d.minAsinForExpandedScroll=a.minAsinForExpandedScroll?a.minAsinForExpandedScroll:[]);if("undefined"!==typeof a.twisterUpdateURLInfo){var h=a.twisterUpdateURLInfo,l=h.immutableURLPrefix,C=h.immutableParams,k=a.twisterUpdateURLInfo.immutableParams,D;for(D in k)if("function"!==typeof k.hasOwnProperty||k.hasOwnProperty(D))l+=(-1===l.indexOf("?")?"?":"\x26")+D+"\x3d"+k[D],C[D]=k[D];h.immutableURLPrefix=l;c.globalAjaxParameters=
k;d.twisterUpdateURLInfo=a.twisterUpdateURLInfo}d.dimToAsinMapData=a.dimensionToAsinMap;d.asinToDimIndexMapData=a.asinToDimensionIndexMap;d.dimensionValuesData=a.dimensionValuesData;d.variation_values=a.variationValues;d.asin_variation_values=a.asinVariationValues;d.reactId=a.reactId;d.currentDimCombID=a.currentDimensionCombinationId;d.selected_variation_values=a.selectedVariationValues;d.dimensionHierarchyData=a.dimensionHierarchyData;d.topHierarchicalDimensionIndex=a.topHierarchicalDimensionIndex;
d.hierarchicalPivoting=a.hierarchicalPivoting;d.isIconPresentForDimensionValue=a.isIconPresentForDimensionValue;d.singletonDimensionKeys=a.singletonDimensionKeys;d.current_asin=a.currentAsin;d.parent_asin=a.parentAsin;d.deletedLandingAsinInfo=a.deletedLandingAsinInfo;d.num_total_variations=a.num_total_variations;d.dimensions=a.dimensions;d.unselectedDimCount=a.unselectedDimCount;d.selected_variations=a.selected_variations||{};d.dimensionValuesDisplayData=a.dimensionValuesDisplayData;d.prirotizeReqPrefetch=
a.prioritizeReqPrefetch;d.num_variation_dimensions=a.num_variation_dimensions;d.num_total_variations=a.num_total_variations;d.dimensionsDisplay=a.dimensionsDisplay||{};d.variationDisplayLabels=a.variationDisplayLabels;null!=b.full&&(g.elementList=null!=g.elementList?b.full.concat(g.elementList):b.full);null!=b.master&&(n.elementList=null!=n.elementList?b.master.concat(n.elementList):b.master);null!=b.parent&&(m.elementList=null!=m.elementList?b.parent.concat(m.elementList):b.parent);null!=b.partial&&
(f.elementList=null!=f.elementList?b.partial.concat(f.elementList):b.partial)}})();d.ajaxTimeout=a.ajaxTimeout;d.displayConfigStylesData=a.displayConfigStylesData;d.keysToPopulateDetailPageStateController=a.keysToPopulateDetailPageStateController;d.twisterAccessibilityCurrentSelection=a.twisterAccessibilityCurrentSelection;c.remainingAjaxCalls=0;c.errorMessageOnFailure="We are sorry.  Amazon has encountered an error.  Please try again.";d.deviceType=a.deviceType;c.deviceType=d.deviceType;c.useAui=
1;c.useAuiAjax=1;d.measurement=a.measurement;c.atfMarkerCount=d.measurement.atf.count;c.cfMarkerCount=d.measurement.cf.count;c.cfImageLongPollTag=d.measurement.cf.longPollImageTag;c.cfHtmlLongPollTag=d.measurement.cf.longPollHtmlTag;w.twisterController=new b(d);(function(){var a={};a.dimensionsList=d.dimensions;a.dimensionValuesList=d.dimensionValuesData;a.dimensionCombinationToASINMap=d.dimToAsinMapData;a.scopeSuffix="twister";a.globalAjaxParameters=c.globalAjaxParameters;c.dimensionalSummaryModule=
new l(a)})();(function(a){function b(a,c,k){var d=[];if(c===k)d.push(""),a=a[c],r.$.isArray(a)?r.each(a,function(a,b){d.push(a)}):d.push(a);else{var h=Math.floor((c+k)/2);c=b(a,c,h);var g=b(a,h+1,k);r.each(c,function(a,b){r.each(g,function(b,c){d.push(""===a?b:""===b?a:a+":"+b)})})}return d}var c=[],d=g.FAMILY_SIZE_BUCKET_LIMITS,n=g.DEFAULT_SELECTION_TAG,h=[],m=!0,C,k;a.dimensions&&(C="variation_dimension:"+a.dimensions.length,r.each(a.dimensions,function(a,b){q.addCSMTag(a)}));if(a.dimToAsinMapData){var D=
0,u;for(u in a.dimToAsinMapData)a.dimToAsinMapData.hasOwnProperty(u)&&D++;q.logCounter("numberOfChildAsins",D);for(u=1;u<d.length;u++)if(D<=d[u]){k="family_size_bucket:"+d[u-1]+"-"+d[u];break}else u===d.length-1&&(k="family_size_bucket:gt"+d[u])}a.dimensionsDisplayType&&r.each(a.dimensionsDisplayType,function(b,c){-1===h.indexOf(b)&&h.push(b);b===e.TWISTER_DIMENSION_VIEW_SWATCH&&a.dimensionsDisplaySubType&&(b="s"+a.dimensionsDisplaySubType[c],-1===h.indexOf(b)&&h.push(b))});a.dimensionSelectionData&&
r.each(a.dimensionSelectionData,function(a,b){a.isSelected||(m=!1)});C&&c.push(C);k&&c.push(k);h&&c.push(h);m&&n&&c.push(n);(function(a){r.each(a,function(a,b){a&&q.addCSMTag(a)})})(b(c,0,c.length-1))})(d);(function(a){var b={};a.extend(b,{ajaxReadyState:{NONE:-1,UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},ajaxHandlerCode:{OK:0,IGNORE:1,RETRY:2,RELOAD:3,TIMEOUT:4,ABORT:5,FATAL:6,INVALID_RESP:7,INCOMPLETE_RESP:8,PAGELET_FATAL:9,DEBUG_NOAJAX:10},serverCode:{ERROR:-1,OK:200,TIMEOUT:408},shouldReload:function(a){return!1}});
w.AJAXFlushUtils=b})(r.$);(function(){"undefined"!=typeof amznJQ?amznJQ.declareAvailable("newTwister"):x.register("newTwister",function(){return w.newTwister});x.register("twisterModule",function(){return{getState:function(){return n.StateController.getState()}}});"undefined"!=typeof amznJQ?(amznJQ.declareAvailable("pageRefreshJS"),amznJQ.declareAvailable("dpf")):(x.register("pageRefreshJS",function(){return w.pageRefreshJS}),x.register("dpf",function(){return w.pageRefreshJS}))})();if("function"===
typeof w.twisterController.onInitializeTwister)w.twisterController.onInitializeTwister();return c});x.when("A","twister-state","twister-utils","detail-page-framework","twister-string-constants","dp-js-logger").register("twister-model",function(r,e,a,b,p,l){return function(e,g,d,c,n){function q(a,b,c){b=0;try{for(;b<h.externalViews.length;)h.externalViews[b].updateView(a,h.twisterState,c),b++}catch(d){(new l(h.externalViewNames[b])).logFatal(d,{message:"[Failed to update external view from TwisterModel]"})}}
function p(a){var b,c,d,g,e,n=h.twisterState.parentASIN,q;a?(b=h.twisterState.reactId,c=h.twisterState.hoveredReactId,d=h.twisterState.unselectedDimCount,g=0<=h.twisterState.hoveredDimCombID.search(/X/)?1:0,e=h.twisterState.hoveredAsin):(b=h.twisterState.previousReactId,c=h.twisterState.reactId,d=h.twisterState.previousPartialState,g=h.twisterState.partialState,e=h.twisterState.getCurrentASIN());q=h.twisterVariationsData.asinToDimIndexMapData[e];h.twisterVariationsData.useMS&&q&&e&&f(h.fetchMasterIDList,
"m"+q[0],e,0,a);0===g?(f(h.fetchFullIDList,e,e,0,a),h.prioritizeReqPrefetch=0):0===d?(f(h.fetchPartialIDList,c,e,0,a),f(h.fetchParentIDList,n,n,0,a),h.prioritizeReqPrefetch=1):b!==c&&f(h.fetchPartialIDList,c,e,0,a)}function f(a,b,c,d,f){f||(f=0);1!==h.idsList[b]&&b&&c&&(!h.prefetchFixWeblab||c!==h.twisterState.parentASIN||"full"!==a.type)&&a&&(h.idsList[b]=1,a.data.push({id:b,asin:c,isPrefetch:d,isHover:f}))}function r(a){a||(a=0);var b=[];0<h.fetchParentIDList.data.length&&b.push({type:"parent",
idList:h.fetchParentIDList.data});0<h.fetchPartialIDList.data.length&&b.push({type:"partial",idList:h.fetchPartialIDList.data});0<h.fetchFullIDList.data.length&&b.push({type:"full",idList:h.fetchFullIDList.data});0<h.fetchMasterIDList.data.length&&b.push({type:"master",idList:h.fetchMasterIDList.data});0<b.length&&(a||h.pageRefresh.measurement.stampCustomMetrics("ns",h.twisterState.currentASIN),h.pageRefresh.react(b,a));h.fetchParentIDList.data=[];h.fetchPartialIDList.data=[];h.fetchFullIDList.data=
[];h.fetchMasterIDList.data=[];h.idsList={};h.prefetchCount=0}function B(b,c){for(var k={},d,f=0;f<c.length;f++)d=null,h.twisterState.isDimSelected(f)&&(d=c[f],"(Please Select)"===d&&(d=null)),null!==d&&(d=a.htmlUnescape(d)),k[h.viewHandle.dimensionsMap[f]]=d;t.StateController.setState(b+"_variations",k)}var t=w.DetailPage,h=this;h.twisterControllerHandle=e;h.pageRefresh=g;h.twisterJSInitData=d;h.twisterVariationsData=c;h.twisterAvailabilityCache=n;h.twisterState;h.prefetchCount=0;h.preHoverClass=
"";h.fetchParentIDList={type:"parent",data:[]};h.fetchPartialIDList={type:"partial",data:[]};h.fetchFullIDList={type:"full",data:[]};h.fetchMasterIDList={type:"master",data:[]};h.idsList={};h.prefetchFixWeblab=0;h.prioritizeReqPrefetch=0;h.externalViews=[];h.externalViewNames=[];h.registerExternalView=function(a,b){try{h.externalViews.push(a),h.externalViewNames.push(b)}catch(c){(new l(b)).logFatal(c,{message:"[Failed to register external view with TwisterModel]"})}};h.handleMouseOver=function(b){var c;
null!==b&&(h.twisterState.updateStateOnMouseOver(b),!a.isSwatchSelected(b,h.twisterVariationsData)||h.twisterVariationsData.useMS)&&(c=h.twisterVariationsData.getDimensionValuesDisplayData(h.twisterState.hoveredAsin),h.twisterVariationsData.useMS||B("hovered",c),this.viewHandle.updateView(b,h.twisterState,"mouseOver"),q(b,h.twisterState,"mouseOver"),p(1),r(1))};h.handleDropdownChange=function(a){h.handleClick(a)};h.handleClick=function(c,d,k){var f=k?"mouseOut":"click",g,e,n=0;g=d;e=h.twisterState.getCurrentASIN();
h.twisterVariationsData.useMS&&c&&a.isSwatchSelected(c,h.twisterVariationsData)&&(n=1);k||(k=0);if(null!==g||null!==c)if(g=h.twisterState.updateStateOnClick(c,d,f)){g=h.twisterState.getCurrentASIN();if(!k&&e!==g&&!h.twisterState.partialState&&b.callbacks["sims-widget_feature_div"])b.callbacks["sims-widget_feature_div"](t.StateController.getState());h.twisterState.partialState||k||h.pageRefresh.measurement.start(g);e=h.twisterVariationsData.getDimensionValuesDisplayData(g);B("selected",e);B("hovered",
e);h.twisterState.partialState||k||h.pageRefresh.measurement.stampCustomMetrics("bb",g);h.viewHandle.updateView({},h.twisterState,f);q(c,h.twisterState,f);h.twisterState.partialState||k||h.pageRefresh.measurement.stampCustomMetrics("be",g);1!==n&&(p(k),r(k))}};h.handleMouseOut=function(b,c,k){c=h.twisterState.getCurrentASIN();!h.twisterVariationsData.useMS&&a.isSwatchSelected(b,h.twisterVariationsData)||h.handleClick(null,c,1)};(function(){var a;h.twisterJSInitData&&(h.twisterState=h.twisterControllerHandle.initTwisterState,
h.MAX_PREFETCH_COUNT=h.twisterJSInitData.prefetchCount,h.prioritizeReqPrefetch=h.twisterJSInitData.prioritizeReqPrefetch,h.prefetchFixWeblab=h.twisterJSInitData.prefetchFixWeblab,a=h.twisterState.getCurrentASIN(),a=h.twisterVariationsData.getDimensionValuesDisplayData(a),h.viewHandle||(h.viewHandle=h.twisterControllerHandle.twisterView),B("selected",a),B("hovered",a));h.pageRefresh.init(h.twisterJSInitData.storeID,h.twisterJSInitData.productGroupID)})()}});x.when("A","jQuery","twister-state","twister-utils",
"twister-string-constants","page-refresh:controller","accessibility-helper","dp-js-logger").register("twister-model-new",function(r,e,a,b,p,l,m,g){return function(a,c,e,q){function G(a,b,c){b=0;try{for(;b<y.externalViews.length;)y.externalViews[b].updateView(a,y.twisterState,c),b++}catch(d){(new g(y.externalViewNames[b])).logFatal(d,{message:"[Failed to update external view from TwisterModel]"})}}function f(a,c,d,f){function g(a){var b=[];r.each(a.variation_label_order,function(c){a.selected_variations[c]&&
b.push(a.variation_display_labels[c]+" \x3d "+a.selected_variations[c])});return y.twisterJSInitData[p.STRING_ACCESSIBILITY_CURRENT_SELECTION]+b.join(" , ")}if(c&&b.isSwatchSelected(c,y.twisterVariationsData))return!1;if(y.twisterState.updateStateOnClick(c,d,f,a)){d=y.twisterVariationsData.getDimensionValuesDisplayData(d);B(f);t("selected",d);t("hovered",d);y.viewHandle.updateView(c,y.twisterState,f);G(c,y.twisterState,f);switch(f){case p.EVENT_TYPE_DROPDOWN_CHANGE:case p.EVENT_TYPE_CLICK:c=g(h.StateController.getState()),
m.announceText(c)}f===p.EVENT_TYPE_CLICK||f===p.EVENT_TYPE_DROPDOWN_CHANGE?(f=y.twisterState.getProductizedTwisterSelection(a.newDimCombID),q&&q.handleClick(f,a)):l.updatePage(a,f);return!0}}function E(a,b,c,d,f){if(a&&1<y.twisterVariationsData.dimensionsMap.length){y.viewHandle.updateViewAfterTwisterUpdate(c,y.twisterState,f);a=0;try{for(;a<y.externalViews.length;)y.externalViews[a].updateViewAfterTwisterUpdate(c,y.twisterState,f),a++}catch(h){(new g(y.externalViewNames[a])).logFatal(h,{message:"[Failed to update external view after twister update from TwisterModel]"})}}}
function B(a){if(a===p.EVENT_TYPE_CLICK||a===p.EVENT_TYPE_DROPDOWN_CHANGE){a=y.twisterState.getCurrentDimCombID().split("_");for(var b={},c=0,d=y.twisterState.dimensionSelectionData.length;c<d;c++)b[y.twisterState.twisterJSInitData.dimensions[c]]="1"===y.twisterState.dimensionSelectionData[c].isRequired&&"0"===y.twisterState.dimensionSelectionData[c].isSelected&&"X"===a[c]?"-1":a[c];h.StateController.setState("selected_variation_values",b)}}function t(a,b){for(var c={},d,f=0;f<b.length;f++)d=null,
y.twisterState.isDimSelected(f)&&(d=b[f],"(Please Select)"===d&&(d=null)),c[y.viewHandle.dimensionsMap[f]]=d;h.StateController.setState(a+"_variations",c)}var h=w.DetailPage,y=this;y.twisterControllerHandle=a;y.twisterJSInitData=c;y.twisterVariationsData=e;y.pageRefresh=l.page;y.twisterState;y.externalViews=[];y.externalViewNames=[];y.registerExternalView=function(a,b){try{y.externalViews.push(a),y.externalViewNames.push(b)}catch(c){(new g(b)).logFatal(c,{message:"[Failed to register external view with TwisterModel]"})}};
y.prefetch=function(a,b){a=y.twisterState.getRequestContext(a,!0);l.prefetchPage(a,b)};y.handleMouseOver=function(a){if(!a||!b.isSwatchSelected(a,y.twisterVariationsData)){var c=y.twisterState.getHoverContext(a);y.twisterState.updateStateOnMouseOver(a,c);var d=y.twisterVariationsData.getDimensionValuesDisplayData(c.newAsin);t("hovered",d);h.StateController.setState("hovered_asin",c.newAsin);this.viewHandle.updateView(a,y.twisterState,p.EVENT_TYPE_MOUSEOVER);G(a,y.twisterState,p.EVENT_TYPE_MOUSEOVER);
l.updatePage(c,p.EVENT_TYPE_MOUSEOVER)}};y.handleClick=function(a){var b=y.twisterState.getRequestContext(a),c=f(b,a,b.childAsin,p.EVENT_TYPE_CLICK);E(c,b,a,b.childAsin,p.EVENT_TYPE_CLICK)};y.handleMouseOut=function(a){a=y.twisterState.getCurrentContext(a);f(a,null,a.currentAsin,p.EVENT_TYPE_MOUSEOUT)};y.handleDropdownChange=function(a){var b=y.twisterState.getRequestContext(a);f(b,a,b.childAsin,p.EVENT_TYPE_DROPDOWN_CHANGE);E(b,a,b.childAsin,p.EVENT_TYPE_DROPDOWN_CHANGE)};(function(){if(y.twisterJSInitData){y.viewHandle||
(y.viewHandle=y.twisterControllerHandle.twisterView);y.twisterState=y.twisterControllerHandle.initTwisterState;var a=y.twisterState.getCurrentASIN(),a=y.twisterVariationsData.getDimensionValuesDisplayData(a);t("selected",a);t("hovered",a);l.init(c);r.on("dp:twister:prefetch",function(a,b){y.prefetch(a,b)})}})()}});x.when("A","twister-utils","detail-page-state-controller","twister-string-constants").register("twister-state",function(r,e,a,b){return function(p,l,m){function g(a){a.mType===b.MTYPE_PARENT&&
a.relatedContext&&(a=a.relatedContext);return a}function d(a,d,f){var h=y.extend(!0,{},a);h.mType=b.MTYPE_MASTER;h.id="m"+f[0];h.relatedContext=a;h.doNotAbort=!0;h.url=c(h,d,[]);h.uniqueID=q(h,[]);return h}function c(a,b,c){var d=h.twisterJSInitData.twisterUpdateURLInfo,f=d.immutableURLPrefix,g=d.immutableParams,d=d.mutableParams,e;e=y.extend(!0,{},d,h.twisterJSInitData.contextMetaData[a.mType].mTypeSpecificURLParams);if(null!=c)for(var q=0,m=c.length;q<m;q++){var l=c[q];if(!g.hasOwnProperty(l.key)){var p=
l.key,r=l.value;e[p]=r;l.isPersistent&&(d[p]=r)}}for(var E in e)null!=e[E]&&(f+="\x26"+E+"\x3d"+e[E]);f+="\x26asinList\x3d"+a.newAsin+"\x26isFlushing\x3d2\x26dpEnvironment\x3d"+t.dpEnvironment+"\x26id\x3d"+a.id+"\x26mType\x3d"+a.mType;b&&(f+="\x26prefetchRequest\x3d1");n()&&(f+="\x26isTryState\x3dtrue");return f}function n(){var a=!1,b=r.state("pwState");b&&(a=b.isTryState);return a}function q(a,b){var c="",d=a.mType,f=[],g=y.extend(!0,{},h.twisterJSInitData.twisterUpdateURLInfo.mutableParams);if(null!=
b)for(var e=0,q=b.length;e<q;e++){var m=b[e];g[m.key]=m.value}for(var t in g)g.hasOwnProperty(t)&&f.push(t);f.sort();e=0;for(b=f.length;e<b;e++)q=f[e],null!=q&&null!=g&&(c+=q+"\x3d"+g[q]+"\x26");c+="mType\x3d"+d+"\x26id\x3d"+a.id;n()&&(c+="\x26isTryState\x3dtrue");return c}function G(a){var c=a[b.STRING_DIM_INDEX],d=a[b.STRING_DIM_VALUE_INDEX];a=h.getCurrentDimCombID().split("_");a[c]=-1===d?"X":d;a=a.join("_");return h.twisterAvailabilityCache.gAsinToRender(a,c)}function f(a,c){var d=h.getCurrentDimCombID().split("_"),
f=d.length,g=h.twisterVariationsData.asinToDimIndexMapData[a];a=-1;var e;if(g)g=g.slice(0);else for(g=[],e=0;e<f;e++)g[e]="X";null!==c&&c!==z&&(a=c[b.STRING_DIM_INDEX]);for(var n=0;n<f;n++)(e=h.dimensionSelectionData[n][b.STRING_IS_REQUIRED])&&n!==parseInt(a)&&parseInt(g[n])!==parseInt(d[n])&&(g[n]="X",h.sizeSwatch&&0!==h.partialState&&(h.dimensionSelectionData[n][b.STRING_IS_SELECTED]=0)),-1!==parseInt(a)&&-1===parseInt(c[b.STRING_DIM_VALUE_INDEX])&&(g[a]="X");return g.join("_")}function E(a,c){a=
a.split("_");for(var d=0;d<h.dimensionSelectionData.length;d++)1===h.dimensionSelectionData[d][b.STRING_IS_REQUIRED]&&0!==c&&(a[d]="X");return a.join("_")}var B=w.DetailPage,t=w.Twister,h=this,y=r.$;h.twisterJSInitData=p;h.twisterVariationsData=l;h.twisterAvailabilityCache=m;h.parentASIN="";h.currentASIN="";h.dimensionSelectionData={};h.unselectedDimCount=-1;h.master="";h.currentDimCombID="";h.preHoverClass="";h.hoveredReactId="";h.hoveredAsin="";h.hoveredDimCombID="";h.partialState="";h.previousPartialState=
"";h.previousReactId="";h.previousAsin="";h.sizeSwatch=!1;h.setMaster=function(a){h.master=a};h.getMaster=function(){return h.master};h.getCurrentASIN=function(){return h.currentASIN};h.setCurrentASIN=function(a){a&&(h.currentASIN=a)};h.getCurrentDimCombID=function(){return h.currentDimCombID};h.setCurrentDimCombID=function(a){a&&(h.currentDimCombID=a)};h.isDimSelected=function(a){return 1===h.dimensionSelectionData[a][b.STRING_IS_SELECTED]};h.setPreHoverData=function(a){h.useMS||(h.preHoverClass=
e.getAttachedClass(a,h.twisterVariationsData.dimensionsMap[a[b.STRING_DIM_INDEX]]))};h.updateStateOnMouseOver=function(a,c){var d,g;a&&"0"===a[b.STRING_DIM_INDEX]&&h.setMaster(a[b.STRING_DIM_VALUE_INDEX]);d=c&&c.childAsin||G(a);g=h.unselectedDimCount;if(""===d){if(0>=g)return;d=h.getCurrentASIN()}h.hoveredAsin=d;d=c&&c.newDimCombID||f(h.hoveredAsin,a);h.hoveredDimCombID=d;g=0<=d.search(/X/)?1:0;c=c&&c.reactID||E(d,g);h.hoveredReactId=c;h.setPreHoverData(a)};h.updateStateOnClick=function(a,c,d,g){var e;
h.previousAsin=h.getCurrentASIN();c=c||g&&g.childAsin||G(a);a&&a[b.STRING_DIM_INDEX]&&"0"===a[b.STRING_DIM_INDEX]&&h.setMaster(a[b.STRING_DIM_VALUE_INDEX]);e=h.unselectedDimCount;h.previousPartialState=e;if(""===c){if(0>=e)return!1;c=h.getCurrentASIN()}e=g&&g.newDimCombID||f(c,a);if(b.EVENT_TYPE_CLICK===d||b.EVENT_TYPE_DROPDOWN_CHANGE===d){var n=a[b.STRING_DIM_INDEX];d="undefined"!==typeof h.preHoverClass&&(-1!==h.preHoverClass.indexOf(b.CLASS_FOR_SWATCH_UNAVAILABLE)||-1!==h.preHoverClass.indexOf(b.CLASS_FOR_DROPDOWN_UNAVAILABLE));
var q=e.split("_"),m=h.currentDimCombID.split("_");q[n]="*";m[n]="*";n=q.join("_");m=m.join("_");n!==m&&(d=!0);if(d||-1===a[b.STRING_DIM_VALUE_INDEX])for(var m=e.split("_"),q=0,t=h.dimensionSelectionData.length;q<t;q++)n=h.dimensionSelectionData[q],"X"===m[q]&&1===n[b.STRING_IS_SELECTED]&&(n[b.STRING_IS_SELECTED]=0,h.unselectedDimCount++);B.StateController.setState("isUnavailableInOldDimCombId",d?"true":"false");d=a[b.STRING_DIM_INDEX];null!==a&&a!==z&&(d=h.dimensionSelectionData[d],0===d[b.STRING_IS_SELECTED]&&
-1!==parseInt(a[b.STRING_DIM_VALUE_INDEX])&&(d[b.STRING_IS_SELECTED]=1,h.unselectedDimCount--,0>h.unselectedDimCount&&(h.unselectedDimCount=0)));a=h.unselectedDimCount;h.previousReactId=h.reactId}else a=0<=e.search(/X/)?1:0,h.previousReactId=h.hoveredReactId;g=g&&g.reactID||E(e,a);h.partialState=a;h.setCurrentASIN(c);h.setCurrentDimCombID(e);h.reactId=g;B.StateController.setState("current_asin",h.getCurrentASIN());B.StateController.setState("currentDimCombID",h.getCurrentDimCombID());B.StateController.setState("reactId",
h.reactId);B.StateController.setState("dimensionSelectionData",h.dimensionSelectionData);return!0};h.getCurrentContext=function(){var a=h.getRequestContext();return g(a)};h.getHoverContext=function(a){a=h.getRequestContext(a);return g(a)};h.getProductizedTwisterSelection=function(a){return"string"===typeof a?e.getProductizedTwisterSelectionFromDimComb(a,h.twisterJSInitData.dimensions):e.getProductizedTwisterSelectionFromDivMetaData(a,h.twisterJSInitData.dimensions)};h.getRequestContext=function(a,
k){var g=h.getCurrentASIN(),e=h.parentASIN,n;n=a&&G(a)||g;var m=h.getCurrentDimCombID(),t=f(n,a),l=0<=m.search(/X/)?1:0,p=0<=t.search(/X/)?b.MTYPE_PARTIAL:b.MTYPE_FULL;l||p!==b.MTYPE_PARTIAL||(p=b.MTYPE_PARENT);var l=p!==b.MTYPE_FULL?1:0,r=E(t,l);a={divMetaData:a,currentAsin:g,newAsin:n,childAsin:n,currentDimCombID:m,newDimCombID:t,reactID:r,partialState:l,mType:p,id:0<=r.search(/X/)?r:n};if(h.useMS&&n){if(e=h.twisterVariationsData.asinToDimIndexMapData[n])a.relatedContext=d(a,k,e),a.doNotAbort=!0}else p===
b.MTYPE_PARENT&&(n=y.extend(!0,{},a),n.mType=b.MTYPE_PARTIAL,n.relatedContext=a,n.url=c(n,k,[]),n.doNotAbort=!0,n.uniqueID=q(n,[]),a.relatedContext=n,a.id=e,a.newAsin=e,a.doNotAbort=!0);a.url=c(a,k,[]);a.uniqueID=q(a,[]);return a};h.getRequestContextForExternalTwisterUpdates=function(a){var f=h.getCurrentASIN(),g=h.getCurrentDimCombID();g.search(/X/);var e=0<=g.search(/X/)?b.MTYPE_PARTIAL:b.MTYPE_FULL,n=e!==b.MTYPE_FULL?1:0,m=E(g,n),g={divMetaData:{},currentAsin:f,newAsin:f,childAsin:f,currentDimCombID:g,
newDimCombID:g,reactID:m,partialState:n,mType:e,id:0<=m.search(/X/)?m:f};h.useMS&&f&&(f=h.twisterVariationsData.asinToDimIndexMapData[f])&&(g.relatedContext=d(g,0,f),g.doNotAbort=!0);g.url=c(g,0,a);g.uniqueID=q(g,a);return g};(function(){var c=h.twisterJSInitData,d=c.keysToPopulateDetailPageStateController,f;if(c){B.StateController=new a;for(var g=0,e=d.length;g<e;g++)f=d[g],B.StateController.setState(f,c[f]);B.StateController.setState("variation_display_labels",c[b.INIT_DATA_VARIATIONS_DISPLAY_LABELS]);
B.StateController.setState("variation_label_order",c[b.INIT_DATA_DIMENSIONS_MAP]);h.currentASIN=c.current_asin;h.parentASIN=c.parent_asin;h.dimensionSelectionData=c.dimensionSelectionData;h.unselectedDimCount=c.unselectedDimCount;h.currentDimCombID=c.currentDimCombID;h.reactId=c.reactId;h.storeID=c.storeId;h.productGroupID=c.productGroupId;h.useMS=c[b.STRING_USE_MS];h.useMS&&h.currentASIN&&h.twisterVariationsData.asinToDimIndexMapData[h.currentASIN]&&h.setMaster(h.twisterVariationsData.asinToDimIndexMapData[h.currentASIN][0]);
y("#sizeSwatch").length&&(h.sizeSwatch=!0)}})()}});x.when("A","twister-string-constants","view-util").register("twister-variations-data",function(r,e,a){return function(b,p){function l(a,b){var c=[];r.each(b,function(b){null!==a[b]&&a[b]!==z?c.push(a[b].join("_")):x.log("Currently unavailable ASIN "+b+" not found in dimension combination","ERROR","TwisterCurrentlyUnavailableExperiment")});return c}var m=this;m.dimensionValuesDisplay={};m.deletedLandingAsinInfo;m.dimToAsinMapData;m.dimensionValuesData;
m.asinToDimIndexMapData;m.dimensionsDisplayType;m.displayConfigStylesData;m.dimensionsMap;m.twisterCore=p;m.currentlyUnavailableAsins;m.currentlyUnavailableDimensions;m.getDimensionValuesDisplayData=function(a){var b=m.dimensionValuesDisplay[a];b||a!==m.deletedLandingAsinInfo.asin||(b=m.deletedLandingAsinInfo.dimValues);return b};(function(){if(m.twisterCore!==z&&b[e.IS_PAGE_ELIGIBLE_FOR_PRODUCTIZATION]){var g=(new a(m.twisterCore)).variationData;m.asinToDimIndexMapData=g.getAsinToDimIndexMapData();
m.dimToAsinMapData=g.getDimToAsinMapData();m.dimensionsMap=m.twisterCore.tvm.dimensionList;m.dimensionValuesData=g.getDimensionValuesData();m.dimensionValuesDisplay=g.getDimensionValuesDisplay()}else m.dimToAsinMapData=b[e.INIT_DATA_DIM_TO_ASIN_MAP],m.dimensionsMap=b[e.INIT_DATA_DIMENSIONS_MAP],m.dimensionValuesData=b[e.STRING_DIMENSION_VALUES_DATA],m.asinToDimIndexMapData=b[e.INIT_DATA_ASIN_TO_DIM_INDEX_MAP],m.dimensionValuesDisplay=b[e.INIT_DATA_DIMENSION_VALUES_DISPLAY_DATA];m.dimensionsDisplayType=
b[e.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP];m.deletedLandingAsinInfo=b[e.INIT_DATA_DELETED_LANDING_ASIN_INFO];m.displayConfigStylesData=b[e.STRING_DISPLAY_CONFIG_STYLES_DATA];m.currentlyUnavailableAsins=b[e.CURRENTLY_UNAVAILABLE_ASINS];m.currentlyUnavailableDimensions=b[e.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED]?l(b[e.INIT_DATA_ASIN_TO_DIM_INDEX_MAP],b[e.CURRENTLY_UNAVAILABLE_ASINS]):[]})()}});x.when("A").register("twister-string-constants",function(r){return{YES:"YES",NO:"NO",MTYPE_PARENT:"parent",
MTYPE_PARTIAL:"partial",MTYPE_FULL:"full",MTYPE_MASTER:"master",AUI_DROPDOWN_EVENT_PREFIX:"a:dropdown:selected:",AUI_EVENT_FOR_SWATCHTHUMB:"swatchthumb-action",CHAR_COLON:":",CHAR_SEMICOLON:";",CHAR_UNDERSCORE:"_",CHAR_ASTERISK:"*",CHAR_CROSS:"X",CLASS_FOR_DROPDOWN_UNAVAILABLE:"dropdownUnavailable",CLASS_FOR_DROPDOWN_CURRENTLY_UNAVAILABLE:"dropdownCurrentlyUnavailable",CLASS_FOR_NEW_TWISTER_EVDD:"#newTwisterEVDD",CLASS_FOR_NON_JS_EVDD:"#nonJSEVDD",CLASS_FOR_SWATCH_AVAILABLE:"swatchAvailable",CLASS_FOR_SWATCH_HOVER:"swatchHover",
CLASS_FOR_SWATCH_SELECT:"swatchSelect",CLASS_FOR_SWATCH_SELECT_CURRENTLY_UNAVAILABLE:"swatchSelectCurrentlyUnavailable",CLASS_FOR_SWATCH_UNAVAILABLE:"swatchUnavailable",CLASS_FOR_SWATCH_UNAVAILABLE_HOVER:"swatchUnavailableHover",CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE:"swatchCurrentlyUnavailable",CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE_HOVER:"swatchCurrentlyUnavailableHover",AUI_CLASS_FOR_SWATCH_UNAVAILABLE:"a-button-unavailable",AUI_CLASS_FOR_SWATCH_SELECT:"a-button-selected",CLASS_FOR_VODD_AVAILABLE:"voddAvailable",
CLASS_FOR_VODD_HOVER:"voddHover",CLASS_FOR_VODD_SELECT:"voddSelect",CLASS_FOR_VODD_UNAVAILABLE:"voddUnavailable",CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION:"dropdownSelect",DROPDOWN_DIV_NAME:"dropdown_selected_",EVENT_TYPE_SHOWPOPOVER:"showPopover",EVENT_TYPE_HIDEPOPOVER:"hidePopover",EVENT_TYPE_UPDATEPOPOVERPOSITION:"updatePopoverPosition",EVENT_TYPE_DROPDOWN_CHANGE:"dropdownChange",EVENT_TYPE_CLICK:"click",EVENT_TYPE_TWISTER_REFRESH:"twisterRefresh",EVENT_TYPE_MOUSEENTER:"mouseenter",EVENT_TYPE_MOUSELEAVE:"mouseleave",
EVENT_TYPE_MOUSEDOWN:"mousedown",EVENT_TYPE_MOUSEOUT:"mouseOut",EVENT_TYPE_MOUSEOVER:"mouseOver",EVENT_TYPE_TOUCHSTART:"touchstart",EVENT_TYPE_TOUCHEND:"touchend",EVENT_TYPE_TOUCHMOVE:"touchmove",EVENT_TYPE_KEYPRESS:"keypress",ID_SELECTOR:"#",CLASS_SELECTOR:".",TWISTER_POPOVER:"twisterPopover",INDEX_FOR_SELECT_OPTION:"-1",INIT_DATA_ASIN_TO_DIM_INDEX_MAP:"asinToDimIndexMapData",INIT_DATA_DELETED_LANDING_ASIN_INFO:"deletedLandingAsinInfo",INIT_DATA_PW_ENABLED_DIMENSION_MAP:"pwEnabledDimensionMap",INIT_DATA_DIM_TO_ASIN_MAP:"dimToAsinMapData",
INIT_DATA_DIMENSION_VALUES_DISPLAY_DATA:"dimensionValuesDisplayData",INIT_DATA_DIMENSIONS_DISPLAY:"dimensionsDisplay",INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP:"dimensionsDisplayType",INIT_DATA_DIMENSIONS_DISPLAY_SUB_TYPE_MAP:"dimensionsDisplaySubType",INIT_DATA_DIMENSIONS_MAP:"dimensions",INIT_DATA_VARIATIONS_DISPLAY_LABELS:"variationDisplayLabels",INIT_DATA_MAX_POPOVER_HEIGHT:"maxPopoverHeight",INIT_DATA_VISIBLE_ROW_COUNT:"visibleRowCount",INIT_DATA_POPOVER_POSITION:"popoverPosition",INIT_DATA_ANIMATE_BUTTON_CONTENT:"animateButtonContent",
INIT_DATA_DISPLAY_TYPE_PROPERTIES:"displayTypeProperties",NATIVE_DROPDOWN_DIV_PREFIX:"#native_",STRING_CSS_CLASS:"css_class",STRING_DIM_COMB_ID:"dimCombID",CURR_DIM_COMB_ID:"currentDimCombID",CURRENTLY_UNAVAILABLE_ASINS:"currentlyUnavailableAsins",STRING_DIM_DATA:"dimData",STRING_DIM_INDEX:"dimIndex",STRING_DIM_NAME:"dimName",STRING_DIM_ORDER:"dimOrder",STRING_DIM_VALUE_INDEX:"dimValueIndex",STRING_DIMENSION_DISPLAY_MAP:"dimensionDisplayMap",STRING_DIMENSION_DISPLAY_STRING:"dimensionDisplayString",
STRING_DIMENSION_SELECTION_DATA:"dimensionSelectionData",STRING_DIMENSION_VALUES_DATA:"dimensionValuesData",STRING_DIMENSION_VALUES_DATA_GLOBAL:"dimensionValuesDataGlobal",STRING_DIMENSIONS_MAP:"dimensionsMap",STRING_DISPLAY_CONFIG_STYLES_DATA:"displayConfigStylesData",STRING_PRIME_WARDROBE_ASINS:"pwASINs",STRING_EVENT_DATA:"eventData",STRING_EVENT_DIM_DATA:"dimData",STRING_EVENT_DIM_INFO:"eventDimInfo",STRING_EVENT_DIV_METADATA:"divMetaData",STRING_EVENT_POPOVER_DATA:"popoverData",STRING_EVENT_TYPE:"eventType",
STRING_HIDE_POPOVER:"hidePopover",STRING_HOVER_MS:"hoverMS",STRING_HTML_CONTENT:"html_content",STRING_IS_REQUIRED:"isRequired",STRING_IS_SELECTED:"isSelected",STRING_IS_SLOTS_ENABLED:"isSlotsEnabled",STRING_NATIVE_CSS_CLASS:"native_css_class",STRING_SHOW_DIM_SECOND_UNAVAILABLE_POPOVER:"showDimSecondUnavailablePopover",STRING_STYLE:"style",STRING_TWISTER_CONTROLLER_HANDLE:"twisterControllerHandle",STRING_TWISTER_AVAILABILITY_CACHE:"twisterAvailabilityCache",STRING_TWISTER_VARIATION_DATA:"twisterVariationData",
STRING_TWISTER_INITIAL_STATE_KEY:"twisterInitialState",STRING_UNAVAILABLE_POPOVER_STRING_VALUE:"unavailablePopOverStringValue",STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE:"currentlyUnavailablePopOverStringValue",STRING_PW_UNAVAILABLE_POPOVER_STRING_VALUE:"pwUnavailableMessage",STRING_ACCESSIBILITY_CURRENT_SELECTION:"twisterAccessibilityCurrentSelection",STRING_USE_MS:"useMS",STRING_CLASS_NAME:"className",STYLE_CLASS_TYPE_FOR_AVAILABLE:"available",STYLE_CLASS_TYPE_FOR_INAVLID:"invalid",STYLE_CLASS_TYPE_FOR_SELECTED:"selected",
STYLE_CLASS_TYPE_FOR_UNAVAILABLE:"unavailable",TWISTER_DIMENSION_VIEW_DROPDOWN:"dropdown",TWISTER_DIMENSION_VIEW_EVDD:"etdd",TWISTER_DIMENSION_VIEW_SINGLETON:"singleton",TWISTER_DIMENSION_VIEW_SWATCH:"swatch",TWISTER_DIMENSION_VIEW_VODD:"vodd",TWISTER_DIMENSION_VIEW_COUNTER:"counter",TWISTER_DIMENSION_VIEW_SHELF:"shelf",TWISTER_EVENT_DATA_DIV_METADATA:"divMetaData",TWISTER_EVENT_DATA_DISPLAY_TYPE:"dimDisplayType",TWISTER_EVENT_DATA_TIME:"time",TWISTER_EVENT_DATA_DURATION:"duration",TWISTER_EVENT_DATA_COUNT:"count",
TWISTER_EVENT_DATA_PERCENTAGE:"percentage",TWISTER_EVENT_DATA_DIM_INDEX:"dimIndex",TWISTER_DIMENSION_VIEW_SWATCH_VARIATION:"variation",MODAL_SWATCH_PREFIX:"modal_",STRING_MAX_SWATCHES_IMMERSIVE_VIEW:"maxSwatchesForImmersiveView",TWISTER_SWATCH_CLASS_PREFIX:"twister_",PRICE_SLOT_CLASS_NAME:"twister_swatch_price",CLASS_FOR_PRICE_BASE:"a-color-base",CLASS_FOR_PRICE_SECONDARY:"a-color-secondary",CLASS_FOR_PRICE_SELECTED:"a-color-price",TWISTER_MODAL_ID_PREFIX:"twister_modal_",TWISTER_INGRESS_ID_PREFIX:"twister_ingress_",
AUI_EVENT_FOR_INGRESS_PREFIX:"twister-ingress-click-",TWISTER_FEATURE_DIV_ID:"twister_feature_div",IMMERSIVE_TWISTER_OVERLAY:"immersiveTwisterOverlay",CENTER_COL_DIV_ID:"centerCol",MODAL_CONTENTDIV_PREFIX:"twister_modal_innerDiv_",MODAL_HEADER_PREFIX:"twister_modal_header_",IMMERSIVE_DROPDOWN_ROW_PREFIX:"twister_idd_",DYNAMIC_STYLE_RULES_ID:"twisterSwatchWrapperDynaStyle",CLASSNAME_FOR_STYLERBOTTOM:"twisterModal_stylerBottom",CLASSNAME_FOR_STYLERTOP:"twisterModal_stylerTop",CLASSNAME_FOR_SWATCH:"twisterSwatchWrapper",
CLASSNAME_FOR_INGRESS:"twisterIngressWrapper",AUI_EVENT_CLOSE_MODAL_PREFIX:"close-twisterModal-",AUI_EVENT_VISIBILITY_PREFIX:"twister-appear-",CLASSNAME_FOR_THIN_WIDTH_OVERRIDE:"thinWidthOverride",DIMENSION_SUB_TYPE:"dimensionDisplaySubType",AUI_EVENT_FOR_COUNTER:"twister_counter-action",EXPANDED_VIEW_ENABLED:"expandedViewEnabled",MIN_HEIGHT_EXPANDED_SECTION:"minHeightForExpandedSection",MAX_HEIGHT_EXPANDED_SECTION:"maxHeightForExpandedSection",MIN_ASINS_FOR_EXPANDED_VIEW:"minAsinForExpandedView",
MIN_ASINS_FOR_EXPANDED_VIEW_TEXT:"minAsinForExpandedViewText",MIN_ASINS_FOR_EXPANDED_VIEW_IMAGE:"minAsinForExpandedViewImage",MIN_ASINS_FOR_EXPANDED_SCROLL:"minAsinForExpandedScroll",MIN_ASINS_FOR_EXPANDED_SCROLL_TEXT:"minAsinForExpandedScrollText",MIN_ASINS_FOR_EXPANDED_SCROLL_IMAGE:"minAsinForExpandedScrollImage",SUFFIX_FOR_DROPDOWN_PANEL_PLACEHOLDER:"_placeHolderDivForDD",DIMENSION_VALUE_HAS_ICON:"isIconPresentForDimensionValue",HIDDEN_DIMENSION_DISPLAY_TYPE:"hidden",PRODUCTIZATION_ENABLED:"isProductizationEnabled",
PRODUCTIZATION_VIEW_ENABLED:"isViewProductizationEnabled",PRODUCTIZED_PARENT_VIEW:"parentView",PRODUCTIZED_VIEW_UTIL:"viewUtil",VARIATION_CHANGE:"VARIATION_CHANGE",VARIATION_PEEK:"VARIATION_PEEK",METADATA:"METADATA",PRODUCTIZED_VIEW_SUBTYPE:"PRODUCTIZED_VIEW_METADATA",DP_STATE_VIEW_SUBTYPE:"DETAILPAGE_STATE_VIEW_METADATA",IS_PAGE_ELIGIBLE_FOR_PRODUCTIZATION:"isPageEligibleForProductizationMigration",TWISTER_CURRENT_ASIN:"current_asin",CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED:"isCurrentlyUnavailableWeblabEnabled"}});
x.when("A","twisterModule","dp-js-logger").register("twister-view-registry",function(r,e,a){var b=this;b.logger=new a("DpTwisterViewRegistry");var p=r.createClass({init:function(a,b){this.twisterControllerHandle=a;this.externalViewName=b;this.dimensions=a.twisterJSInitData.dimensions;this.dimensionToAsinMap=a.twisterJSInitData.dimToAsinMapData;this.dimensionValues=a.twisterJSInitData.dimensionValuesData;this.dimensionAsinToValuesMap=a.twisterJSInitData.dimensionValuesDisplayData;this.variationValues=
a.twisterJSInitData.variation_values;this.asinVariationValues=a.twisterJSInitData.asin_variation_values;this.parentAsin=a.twisterJSInitData.parent_asin;this.currentDimCombID=a.twisterJSInitData.currentDimCombID;this.currentAsin=a.twisterJSInitData.current_asin;this.isConsolesOrAccessories=a.twisterJSInitData.isConsolesOrAccessories;this.ajaxUrlParams=a.twisterJSInitData.ajaxUrlParams;this.getControllerInterface=function(){function b(a,d,g){return{dimIndex:a,dimValueIndex:d,dimDisplayType:g}}return{handleClick:function(c,
g,e){c=b(c,g,e);a.handleExternalViewClick(c,this.externalViewName)},handleMouseOver:function(c,g,e){c=b(c,g,e);a.handleExternalViewMouseOver(c,this.externalViewName)},handleMouseOut:function(c,g,e){c=b(g);a.handleExternalViewMouseOut(c,c.dimIndex,c.dimValueIndex,this.externalViewName)}}}},updateView:function(a,b,d){},updateViewAfterTwisterUpdate:function(a,b,d){}}),l=w.twisterController;this.createAndRegisterExternalView=function(a){var g=new p(l,a);l.registerExternalView(g,a);b.logger.logCounter("TwisterExternalView_"+
a,1);return g};return this});x.when("A","jQuery","twisterModule","dp-js-logger","page-refresh:controller","twister-controller","twister-state","twister-string-constants","desktop-twister-model").register("detailPage:RefreshHandler",function(r,e,a,b,p,l,m,g){var d=w.twisterController.twisterModel.twisterState,c=new b("dpPageRegreshHandler"),n={},q=function(a){var b=this;b.clientId=a;b.doPageRefresh=function(e){if(!Array.isArray(e))throw"Incorrect parameters passed to doPageRefresh for clientId "+b.clientId;
e=d.getRequestContextForExternalTwisterUpdates(e);try{p.updatePage(e,g.EVENT_TYPE_CLICK)}catch(n){c.logFatal(n,{message:" Error doing page-refresh for clientId "+a})}};b.getURLParamObject=function(a,c,d){if(!a||null==d)throw"Incorrect parameters passed to getURLParams for clientId "+b.clientId;return{key:encodeURIComponent(a),value:encodeURIComponent(c),isPersistent:d}}};return{getHandlerInstance:function(a){if(null===a||""===a)throw"Incorrect clientID passed to getHandlerInstance of dpRefreshHandler";
n[a]||(n[a]=new q(a));return n[a]}}});x.when("A","jQuery","detailPage:RefreshHandler","twister-string-constants").register("your-module-name",function(r,e,a,b){w.handleClickForMyButton=function(){for(var b=[],e="",m=0,g=arguments.length;m<g;m++){var d=arguments[m];0===m?(e=d,e=a.getHandlerInstance(e)):(d=e.getURLParamObject(d[0],d[1],d[2]),b.push(d))}e.doPageRefresh(b)}});x.when("A","jQuery","dp-ajax-prefetch","detail-page-framework","dp-js-logger","twister-string-constants","page-refresh:meta-cache",
"page-refresh:page").register("page-refresh:controller",function(r,e,a,b,p,l,m,g){var d=w.DetailPage,c=w.Twister,n={intermediateEOS:1,EOS:1},q=new p("dpTwister");return new function(){function p(a,b){if(!(1<b.recordImpressionPending)){var c=b.impressionCallbackData&&b.impressionCallbackData.relatedRequestID,d="/gp/twister/impression.html/?relatedRequestID\x3d"+c;c?r.delay(function(){r.get(d,{success:function(a){q.logCounter("dpTwisterImpression",1)},timeout:4E4,error:function(a,b,c){q.logCounter("dpTwisterImpressionFailed",
1)}})},1500):q.logFatal("prefetchRequestId does not exists. twister prefetch ajax requests are not returning the metadata.");b.recordImpressionPending++;m.set(a,b)}}function f(a,b,c){"undefined"===typeof b.forceFullPrefetch&&(b.forceFullPrefetch=c||l.NO,m.set(a,b));return b.forceFullPrefetch===l.NO&&h.metadata[a.mType]&&!h.metadata[a.mType].fullyPrefetchable}function E(a,b){B(a,function(a){g.executeClientFeatures(a,b)})}function B(a,b){var c=[a];a.relatedContext&&c.push(a.relatedContext);e.each(c,
function(a,c){b.apply(h,[c])})}function t(b,c){B(b,function(b){g.fadeInFeatures(b);var d=b.uniqueID,e=b.url,n=m.get(b);h.newPrefetchWeblab&&n.prefetchSent&&f(b,n)&&(d+="_prefetch_1",e+="\x26prefetchParam\x3d1",n.hotFeaturesPending=!0);n.requestSent=!0;m.set(b,n);n=h.newPrefetchWeblab&&c===l.EVENT_TYPE_CLICK;a.getInstance("dpTwister",d,e,y,b,b.doNotAbort).getContent(n)})}var h=this;h.metadata={};h.newPrefetchWeblab=!1;h.page=g;h.twisterPSCParam="psc";var y={chunk:function(a,b){var c=a.ASIN,d=a.Value;
a=a.FeatureName;if(!n[a]){var f=m.get(b);"twister-request-metadata"===a?(f.impressionCallbackData=r.parseJSON(d.content[a]),m.set(b,f)):g.refreshFeature(c,a,d)}},success:function(b,c,d,f){b=m.get(f);b.hotFeaturesPending&&(b.hotFeaturesPending=!1,m.set(f,b),a.getInstance("dpTwister",f.uniqueID+"_prefetch_2",f.url+"\x26prefetchParam\x3d2",y,f,f.doNotAbort).getContent());b.recordImpressionPending&&p(f,b)},error:function(a,b,d){c.$("#variations-overlay").hide();c.showErrorMessageOnFailure&&(x.log(c.errorMessageOnFailure,
"ERROR","PageRefreshController"),location.reload());q.logFatal(b+" "+d)},abort:function(a){q.logFatal(" Ajax aborted: "+a)},timeout:4E4};h.prefetchPage=function(b,c){B(b,function(b){var d=b.uniqueID,g=b.url,h=m.get(b);h.requestSent||(f(b,h,c)&&(d+="_prefetch_1",g+="\x26prefetchParam\x3d1"),h.prefetchSent=!0,h.recordImpressionPending=h.recordImpressionPending||1,h.requestSent=!0,m.set(b,h),a.getInstance("dpTwister",d,g,y,b,b.doNotAbort).prefetchContent())})};h.updatePage=function(a,c){if(c===l.EVENT_TYPE_CLICK||
c===l.EVENT_TYPE_DROPDOWN_CHANGE){if(!a.partialState){if(b.callbacks["sims-widget_feature_div"])b.callbacks["sims-widget_feature_div"](d.StateController.getState());g.startMeasurement(a)}t(a,c)}E(a,c)};h.reloadPage=function(a){var b;if(w.location.search){b=w.location.search;var c={};b=b.substring(b.indexOf("?")+1).split("\x26");for(var d=0;d<b.length;d++){var f=b[d].split("\x3d");f[0]&&0<=f[0].length&&(c[decodeURIComponent(f[0])]=decodeURIComponent(f[1]))}b=c}var g,c="/dp/"+a.childAsin;a.partialState?
b[h.twisterPSCParam]&&delete b[h.twisterPSCParam]:b[h.twisterPSCParam]=1;(a="?"+e.param(b))&&c&&(g=c+a);w.location.href=g};h.init=function(a){e.each(a.contextMetaData,function(a,b){if(b.elementList){for(var c=b.elementList.length,d=!0,f=0;f<c;f++)if(!b.elementList[f].isPrefetchable&&!b.elementList[f].isp){d=!1;break}h.metadata[a]||(h.metadata[a]={});h.metadata[a].fullyPrefetchable=d}});g.init(a)}}});x.when("A","jQuery","page-refresh-measurement","twister-string-constants","dp-js-logger").register("page-refresh:page",
function(r,e,a,b,p){var l=new p("dpTwister");return new function(){var m=this;m.measurement=z;m.config={partial:{},full:{},parent:{},master:{}};m.dimensionsDisplayType=z;m.initializeMeasurement=function(b){var d=b.measurement;m.dimensionsDisplayType=b.dimensionsDisplayType;m.measurement=new a(e,d.atf.marker,d.cf.marker);m.measurement.init(b.storeID,b.productGroupID)};m.init=function(a){m.initializeMeasurement(a);e.each(a.contextMetaData,function(a,c){var g=[],q={};c=c.elementList||[];var l=c.length;
q[b.EVENT_TYPE_MOUSEOVER]={};q[b.EVENT_TYPE_CLICK]={};for(var f=0;f<l;f++){var p=e("#"+(c[f].divToUpdate||c[f].dtu));g.push("#"+(c[f].divToUpdate||c[f].dtu));if(p.length&&(c[f].customClientFunction||c[f].ccf)){if(c[f].updateOnHover||c[f].uoh)q[b.EVENT_TYPE_MOUSEOVER][c[f].divToUpdate||c[f].dtu]=p.attr("customfunctionname");q[b.EVENT_TYPE_CLICK][c[f].divToUpdate||c[f].dtu]=p.attr("customfunctionname")}}m.config[a].affectedFeatures=g.join(",");m.config[a].clientFeatures=q})};m.startMeasurement=function(a){var d,
c,e=m.dimensionsDisplayType;null!=a.divMetaData&&(d=a.divMetaData.dimDisplayType);"undefined"!==typeof a.currentDimCombID&&(c=a.currentDimCombID.split(b.CHAR_UNDERSCORE).length);this.measurement.start(a.newAsin,d,c,e)};m.fadeInFeatures=function(a){e(this.config[a.mType].affectedFeatures).css({opacity:.5})};m.executeClientFeatures=function(a,d){e.each(m.config[a.mType].clientFeatures[d===b.EVENT_TYPE_CLICK||d===b.EVENT_TYPE_DROPDOWN_CHANGE?b.EVENT_TYPE_CLICK:b.EVENT_TYPE_MOUSEOVER],function(b,d){try{b=
z,b=eval("0, "+d),b(a.reactID,w.DetailPage.StateController,function(){m.measurement.stampImageLoad(a.newAsin)})}catch(e){l.logFatal(e)}})};m.refreshFeature=function(a,b,c){var n,q;try{b&&c&&c.content&&(q=c.content[b],"undefined"!==typeof q&&(n=e("#"+b),n.html(q),n.css({opacity:""})))}catch(m){b=b||"NoFeatureName",l.logFatal(m,{message:" Error in feature "+b})}this.measurement.stampFeature(b,a)}}});x.when("twister-string-constants").register("page-refresh:meta-cache",function(r){return{data:{},set:function(e,
a){return(e=this.getKey(e))?this.data[e]=a:z},get:function(e){e=this.getKey(e);return this.data[e]||{}},getKey:function(e){var a;e&&e.newAsin&&(a=e.mType===r.MTYPE_PARENT?e.mType+e.newAsin:e.mType===r.MTYPE_MASTER?e.mType+e.id:e.mType+e.newAsin+e.reactID);if(!a)throw"Twister PageRefresh::MetaCache:getKey incorrect context passed.";return a}}});x.when("A","jQuery").register("page-refresh-ajax-scope",function(r,e){return function(a,b,e){var l=w.Twister;this.scopeName=b;this.url=e;ues("t0",b,w.newTwisterInteractionStartTime);
ues("ctb",b,"1");this.signalMarker=function(a){!this.markers[a]||0>=this.markers[a].conditions||0===--this.markers[a].conditions&&"function"===typeof this.markers[a].handler&&this.markers[a].handler()};this.addlongPoleTag=function(a,b){a=a.toLowerCase();this.markers[a]&&0===this.markers[a].conditions&&0===this.markers[a].conditions&&w.ue&&"function"===typeof ue.tag&&ue.tag(b)};this.postData=function(){var b=this.scopeName;a.ajax({url:this.url,dataType:"text",timeout:4E4,error:function(){},success:function(a,
c,e){ues("id",b,a);uex("ld",b)}})};var m=this;this.markers={image:{conditions:1,handler:function(){uet("ne",b);m.signalMarker("af")}},af:{conditions:l.atfMarkerCount?l.atfMarkerCount:2,handler:function(){uet("af",b);uet("cf",b);m.signalMarker("cf")}},cf:{conditions:l.cfMarkerCount?l.cfMarkerCount:2,handler:function(){uet("cf",b);m.postData()}}}}});x.when("A","jQuery").register("page-refresh-cache",function(r,e){return function(){this.data={};this.getValue=function(a,b){return null==this.data[a]?null:
b?this.data[a][b]:this.data[a]};this.setValue=function(a,b,e){if(null==this.data[a]||this.data[a].pending)this.data[a]={};this.data[a][b]=e};this.clear=function(a){this.data[a]=null}}});x.when("A","jQuery","page-refresh-refresh","page-refresh-measurement","page-refresh-model","detail-page-framework").register("page-refresh-manager",function(r,e,a,b,p,l){return function(e,g,d,c,n){var q=w.Twister;this.$=e;this.model={};this.refresh=new a(e,c,n);this.contextMetaData=g;this.measurement=new b(e,d.atfMarker,
d.cfMarker);this.init=function(a,b){for(var c in this.contextMetaData)this.model[c]=new p(e,this.contextMetaData[c].AJAXUrl,this.contextMetaData[c].elementList,c.toString());this.measurement.init(a,b)};this.getModelCacheSize=function(a){var b=0;this.model.hasOwnProperty(a)&&e.each(this.model[a].cache.data,function(a,c){c.hasOwnProperty("cacheStatus")&&("preFetched"!==c.cacheStatus&&"completeFetched"!==c.cacheStatus||b++)});return b};this.react=function(a,b){for(var c in this.model)b||this.model[c].finishAjaxCall(this.model[c].currentRequestId,
1);c=0;for(var d=a.length;c<d;c++){var e=a[c];b||this.model[e.type].finishAjaxCall(this.model[e.type].currentRequestId,2);var h=this.model[e.type].getUpdateData(this,e);this.refresh.startRefresh(h);this.model[e.type].makePendingCallBacks()}};this.pageRefreshHandler=function(a,b,c,d){if(!d.noRefresh)for(var g in d.content)try{this.refresh.doRefresh(g,d.content[g]);if(c.isFinishRefreshReq)if(this.refresh.finishRefresh(g),"session-similarities_feature_div"===g||"purchase-similarities_feature_div"===
g||"buyxgety_feature_div"===g){if(l.callbacks[g])l.callbacks[g]()}else"zeroes-buy-box_feature_div"===g&&q.isIEBrowser(e)&&e("#"+g).css({opacity:"",zoom:1});this.measurement.stampFeature(b,a)}catch(h){}}}});x.when("A","jQuery","page-refresh-ajax-scope").register("page-refresh-measurement",function(r,e,a){return function(b,e,l){var m=w.Twister;this.atfMarker=e;this.cfMarker=l;this.scopeCount={};this.ajaxScopes={};this.url="";this.init=function(a,b){this.url="/gp/twister/dynamic-update/ajax-measurement.html/?s\x3d"+
a+"\x26pgid\x3d"+b+"\x26deviceType\x3d"+m.deviceType;m.isInstaTwisterEnabled&&(this.url+="\x26ptd\x3d"+m.productTypeName)};this.start=function(e,d,c,n){if(w.ue){this.scopeCount[e]||(this.scopeCount[e]=0);var q=e+(this.scopeCount[e]+1);this.scopeCount[e]++;var m=this.url;d&&(m+="\x26dimensionType\x3d"+d);"undefined"!==typeof c&&(m+="\x26dimensionCount\x3d"+c);"undefined"!==typeof n&&(m+="\x26dimensionsDisplayType\x3d"+n);this.ajaxScopes[e]=new a(b,q,m)}};this.stampImageLoad=function(a){this.ajaxScopes[a]&&
(this.ajaxScopes[a].signalMarker("image"),m.cfImageLongPollTag&&this.ajaxScopes[a].addlongPoleTag("cf",m.cfImageLongPollTag))};this.stampFeature=function(a,b){this.ajaxScopes[b]&&(a===this.atfMarker&&this.ajaxScopes[b].signalMarker("af"),a===this.cfMarker&&(this.ajaxScopes[b].signalMarker("cf"),m.cfHtmlLongPollTag&&this.ajaxScopes[b].addlongPoleTag("cf",m.cfHtmlLongPollTag)))};this.stampCustomMetrics=function(a,b){this.ajaxScopes[b]&&uet(a,this.ajaxScopes[b].scopeName)}}});x.when("A","jQuery","page-refresh-cache").register("page-refresh-model",
function(r,e,a){return function(b,e,l,m){var g=w.Twister,d=w.DetailPage;this.$=b;this.pendingCallBacks={};this.pendingCallBacksASIN="";this.cache=new a;this.AJAXUrl=e;this.AJAXRequests={};this.requestIdHash={};this.elementList=l;this.currentRequestId=null;this.pendingCallbacksList={};this.immediateCallbacksList=[];this.elementsToRefresh=[];this.modelType=m;this.getNewRequestId=function(){for(var a=0;100>a;a++){var b=a.toString();if(!this.requestIdHash.hasOwnProperty(b))return this.requestIdHash[b]=
!0,b}};this.removeRequestId=function(a){"string"!=typeof a&&(a=a.toString());this.requestIdHash.hasOwnProperty(a)&&delete this.requestIdHash[a]};this.executeActionItems=function(a,b,d,e,f){d=d.divToUpdate||d.dtu;for(var g=0,m=a.length;g<m;g++){var l=a[g];if("addToImmediate"===l)l={},l.id=b,l.key=d,this.immediateCallbacksList.push(l);else if("addToElementsRefresh"===l||"addToElementsRefreshWithLoading"===l)f.push(d+("addToElementsRefreshWithLoading"===l?",loadingBar":""));else if("updateCache"===l)l=
{handler:this,callbackType:"updateCache"},this.addToPendingCallbacksList(b,d,l);else if("customClientFunction"===l){var l={handler:this,callbackType:"customClientFunction"},h={};h.refreshHandler=e;l.callbackParams=h;this.addToPendingCallbacksList(b,d,l)}else if("doRefreshAndFinish"===l||"doRefresh"===l)l={},l.handler=e,l.callbackType="doRefresh",h={isFinishRefreshReq:1},l.callbackParams=h,this.addToPendingCallbacksList(b,d,l)}};this.getAjaxCallContext=function(a,b,d,e,f,g){b=[];var m=f=0,l="notFetched";
this.cache.getValue(a,"cacheStatus")&&(l=this.cache.getValue(a,"cacheStatus"));for(var h=0,p=this.elementList.length;h<p;h++){var r=this.elementList[h],k=r.divToUpdate||r.dtu,w=[],u=1,v=0,x=0,z=0;if("0"===r.isPrefetchable||"0"===r.isp)u=0,m=1;if("1"===r.customClientFunction||"1"===r.ccf)v=1,u=0;if("1"===r.updateOnHover||"1"===r.uoh)x=1;if("1"===r.loadingBar||"1"===r.lb)z=1;if(!g||x){if(d)if(v||!u||this.cache.getValue(a,k))continue;else w.push("updateCache"),f||(f=1);else v?(w.push("customClientFunction"),
w.push("addToImmediate")):this.cache.getValue(a,k)?(w.push("doRefresh"),w.push("addToImmediate")):(w.push("updateCache"),w.push("doRefreshAndFinish"),z?w.push("addToElementsRefreshWithLoading"):w.push("addToElementsRefresh"),f||(f=1));(1===d&&"preFetched"===l||0===d&&"completeFetched"===l||1===d&&"completeFetched"===l)&&1===f&&(f=0);this.executeActionItems(w,a,r,e,b)}}(1===d&&"preFetched"===l||0===d&&"completeFetched"===l||1===d&&"completeFetched"===l)&&1===f&&(f=0);g&&f&&(f=0);f&&this.cache.setValue(a,
"cacheStatus",d?m?"preFetching":"completeFetching":"preFetched"===l?"hotFeaturesFetching":"completeFetching");a={};a.isAjaxCallReq=f;a.elementsToRefresh=b;return a};this.getUpdateData=function(a,b){var d=b.idList;b=[];for(var e=[],f=[],g=[],l=0,m,h,p,r,k,w=1,u=0,v=d.length;u<v;u++){h=d[u].id;p=d[u].asin;r=d[u].isPrefetch;m=d[u].requiredDivs;m=this.getAjaxCallContext(h,p,r,a,m,d[u].isHover);k=m.elementsToRefresh;for(var x=0,z=k.length;x<z;x++)g.push(k[x]);if(m.isAjaxCallReq){l=1;r=r?1:"hotFeaturesFetching"===
this.cache.getValue(h,"cacheStatus")?2:0;if(0===r||2===r)w=0;e.push(h);f.push(p);b.push(r)}}if(l){d={};d.asinList=f.join(",");d.id=e.join(",");d.prefetchParam=b.join(",");d.managerHandler=a;d.modelType=this.modelType;d.containsOnlyPrefetches=w;try{this.doAjaxCall(d)}catch(K){}}this.elementsToRefresh=g.slice();return g};this.makeCallback=function(a,b,d,e){var f=d.handler,g=d.callbackType;d=d.callbackParams;null==e&&(e=this.cache.getValue(a,b));if("function"==typeof f)f(a,b,d,e);else if("doRefresh"===
g)f.pageRefreshHandler(a,b,d,e);else if("customClientFunction"===g)try{f.callCustomClientFunction(a,b,d,e)}catch(l){}else"updateCache"===g&&f.updateCache(a,b,d,e)};this.makePendingCallBacks=function(a,b,d){var e;if(a){if("object"===typeof this.pendingCallbacksList[a])if(b){e=this.pendingCallbacksList[a][b];if(!e){e=[];var f={handler:this,callbackType:"updateCache"};e.push(f)}for(var g=0,l=e.length;g<l;g++){f=e[g];try{this.makeCallback(a,b,f,d)}catch(h){}}this.pendingCallbacksList[a][b]&&delete this.pendingCallbacksList[a][b]}else{for(var m in this.pendingCallbacksList[a])for(e=
this.pendingCallbacksList[a][m],g=0,l=e.length;g<l;g++)f=e[g],this.makeCallback(a,b,f,d);delete this.pendingCallbacksList[a]}}else{a=0;for(l=this.immediateCallbacksList.length;a<l;a++)b=this.immediateCallbacksList[a],this.makePendingCallBacks(b.id,b.key,null);this.immediateCallbacksList=[]}};this.addToPendingCallbacksList=function(a,b,d){this.pendingCallbacksList.hasOwnProperty(a)||(this.pendingCallbacksList[a]={});this.pendingCallbacksList[a].hasOwnProperty(b)||(this.pendingCallbacksList[a][b]=[]);
this.pendingCallbacksList[a][b].push(d)};this.doAjaxCall=function(a){g.remainingAjaxCalls+=1;var b=this.getNewRequestId();this.currentRequestId=b;var d=a.managerHandler,e=this.AJAXUrl+a.asinList+"\x26isFlushing\x3d2\x26id\x3d"+a.id+"\x26prefetchParam\x3d"+a.prefetchParam+"\x26mType\x3d"+a.modelType;g.isInstaTwisterEnabled&&(e+="\x26dpEnvironment\x3d"+g.dpEnvironment);var f={};if(g.useAuiAjax){var l=this,e=g.A.ajax(e,{method:"get",chunk:function(a){l.AJAXHandler(null,a,w.AJAXFlushUtils.ajaxReadyState.LOADING)},
success:function(){l.AJAXHandler(null,null,w.AJAXFlushUtils.ajaxReadyState.DONE);--g.remainingAjaxCalls;0===g.remainingAjaxCalls&&g.$("#variations-overlay").hide()},error:function(){g.$("#variations-overlay").hide();--g.remainingAjaxCalls;g.printConsoleLogs&&x.log("ajax call failed","ERROR","AjaxErrorHandler")},timeout:4E4});f.streamingXhrRef=e}f.ajaxParams=a;f.managerHandler=d;this.AJAXRequests[b]=f};this.abortAllAjaxCalls=function(){for(var a in this.requestIdHash)this.finishAjaxCall(a,!0)};this.finishAjaxCall=
function(a,b){if(a){var d=this.AJAXRequests[a],e=d.streamingXhrRef,f=d.ajaxParams,d=f.id.split(","),f=f.containsOnlyPrefetches;if(1!==b||!f){this.pendingCallbacksList={};this.immediateCallbacksList=[];if(b)for(e&&"function"===typeof e.abort&&e.abort(w.AJAXFlushUtils.ajaxHandlerCode.ABORT),e=0,f=d.length;e<f;e++)if(this.cache.getValue(d[e])){var g=this.cache.getValue(d[e],"cacheStatus");"preFetching"===g||"completeFetching"===g?b?this.cache.clear(d[e]):this.cache.setValue(d[e],"cacheStatus","preFetching"===
g?"preFetched":"completeFetched"):"hotFeaturesFetching"===g&&this.cache.setValue(d[e],"cacheStatus",b?"preFetched":"completeFetched")}this.elementsToRefresh=[];this.removeRequestId(a);delete this.AJAXRequests[a];this.currentRequestId=null}}};this.updateCache=function(a,b,d,e){"intermediateEOS"===b||"EOS"===b?(b=this.cache.getValue(a,"cacheStatus"),"preFetching"===b?this.cache.setValue(a,"cacheStatus","preFetched"):"completeFetching"!==b&&"hotFeaturesFetching"!==b||this.cache.setValue(a,"cacheStatus",
"completeFetched")):this.cache.setValue(a,b,e)};this.callCustomClientFunction=function(a,e,l,m){var f=b("#"+e).attr("customFunctionName");if(f){var p=l.refreshHandler,r=d.StateController.getState().current_asin;m=function(){p.measurement.stampImageLoad(r)};l=g.useAui?m:null;if(f=g.useAui?eval("var customFunction \x3d "+f+"; customFunction")(a,d.StateController,l):eval(f)(a,d.StateController,l)){l={isFinishRefreshReq:0};if(!g.useAui){var t;if("twister-main-image"===e&&r){t=document.getElementById("main-image");
if(!t){var h=document.getElementById("main_image_0");h&&(t=(t=h.getElementsByTagName("img"))?t[0]:null)}t&&(t.onload=m)}}p.pageRefreshHandler(a,e,l,f);g.useAui||-1<navigator.userAgent.toLowerCase().indexOf("chrome")&&t&&t.complete&&m()}}};this.AJAXHandler=function(a,b,d){if(d===w.AJAXFlushUtils.ajaxReadyState.DONE)return this.finishAjaxCall(this.currentRequestId,0),w.AJAXFlushUtils.ajaxHandlerCode.OK;for(a=0;1>a;a++){var e=b;d=e.ASIN;b=e.Value;e=e.FeatureName;"intermediateEOS"===e||"EOS"===e?this.updateCache(d,
e,null,b):this.makePendingCallBacks(d,e,b)}return w.AJAXFlushUtils.ajaxHandlerCode.OK};this.AJAXErrorHandler=function(a,b,d){(a=a.xhrStatus)||(a=d);return a}}});x.when("A","jQuery").register("page-refresh-refresh",function(r,e){return function(a,b,e){this.$=a;this.loadingBarHtml=b;this.loadingBarHtml2=e;this.doRefresh=function(b,e){a("#"+b).html(e)};this.startRefresh=function(b){if(b)for(var e=0,g=b.length;e<g;e++){var d=b[e].split(","),c=d[0],n=!0,q=!1;if("buy-box_feature_div"===c||"more-buying-choices_feature_div"===
c||"session-similarities_feature_div"===c&&a.browser.msie)n=!1;1<d.length&&("loadingBar"===d[1]||"lb"===d[1])&&(q=!0);n&&a("#"+c).css("opacity","0.5");q&&this.appendLoadingBar(c)}};this.appendLoadingBar=function(b){var e=a("#"+b);"moreBuyingChoices_feature_div"===b||e.attr("loadingBarSet")||(e.attr("loadingBarSet","1"),"more-buying-choices_feature_div"===b?(e=a("#more-buying-choice-content-div"),e.html(this.loadingBarHtml2)):(b=e.find("h2, h1, b"),0<b.length&&(b=a(b[0]),b.css({display:"inline",padding:"0px"}),
b.after(a(this.loadingBarHtml)))))};this.finishRefresh=function(b){var e=!0,g=!0;"buy-box_feature_div"===b&&(g=e=!1);if("session-similarities_feature_div"===b&&a.browser.msie||"more-buying-choices_feature_div"===b)e=!1;var d="0";"more-buying-choices_feature_div"===b&&(d="1");e&&a("#"+b).css({opacity:"",zoom:d});g&&a("#"+b).removeAttr("loadingBarSet")}}});x.when("A","twisterModule","dp-js-logger").execute(function(r,e,a){var b=w.DetailPage,p=w.Twister,l=r.$;e=new a(null,this,!0);var m=z;w.history&&
w.history.replaceState?(e.logImpression(e.eventTypes.HISTORY_API_SUPPORTED,null),r.on("a:pageUpdate",function(){m||(m=r.state("URL-Refresh-State"));if(m&&m.isUrlRefreshEnable&&b&&b.StateController&&"function"===typeof b.StateController.getState){var a=b.StateController.getState()||{},d=p&&p.isAssemblyVariationsEnabled,c=a.current_asin;if(c){for(var e=w.location.search,q={},e=e.substring(e.indexOf("?")+1).split("\x26"),x=0;x<e.length;x++){var f=e[x].split("\x3d");f[0]&&0<=f[0].length&&(q[decodeURIComponent(f[0])]=
decodeURIComponent(f[1]))}d&&(e=c.lastIndexOf("#"),q.customId=-1!==e?c.slice(e+1):c,/(?=.{0,512}$)^([A-Z]{2})_([A-Za-z]+)_([0-9]+)#([A-Za-z0-9\-\_\#\:\|]*$)/g.test(c)?q.customizationToken=c:"customizationToken"in q&&q.customizationToken.startsWith("MC_Custom_1#")?(e=q.customizationToken,x=e.lastIndexOf("#"),f=c.substring(x+1),0>x||(q.customizationToken=e.substring(0,x+1)+f)):q.customizationToken="MC_Assembly_1#"+c);"th"in q||(q.th=1);"psc"in q&&delete q.psc;x=e=!1;for(f=0;f<a.dimensionSelectionData.length;f++){var E=
a.dimensionSelectionData[f];if(1===parseInt(E.isRequired,10)&&(x=!0,0===parseInt(E.isSelected,10))){e=!0;break}}!e&&x&&(q.psc=1);a=(a=l.param(q))&&0<a.length?"?"+a:a;d=d?w.location.pathname:w.location.pathname.replace(new RegExp(m.landingAsin,"i"),c);w.history.replaceState({},document.title,d+a);m.landingAsin=c}}})):e.logImpression(e.eventTypes.HISTORY_API_NOT_SUPPORTED,null)});x.when("A","twister-string-constants").register("twister-productization-view",function(r,e){return function(a){var b=this;
b.twister=z;b.twisterUtil=a.util;b.handleClick=function(a,b){b.subType=e.PRODUCTIZED_VIEW_SUBTYPE;this.twister.metaData(b);this.twister.dimensionChanged(a)};(function(){b.twister=a.registerActive({viewAttribution:"DetailPage",viewName:"TwisterDesktopProductizationView"},{updateView:function(a,b){}})})()}});x.when("A","a-dropdown","twister-thumbnailModule","twister-utils","twister-string-constants","dp-js-logger","twister-dimension-view-promise-factory").register("twister-dimension-views-dropdown",
function(r,e,a,b,p,l,m){function g(d,c){function g(){var a=p.DROPDOWN_DIV_NAME+f.dimName,b;b=function(a){var b={};b[p.STRING_DIM_INDEX]=f.dimOrder;var c=a?a.value:z;b[p.STRING_DIM_VALUE_INDEX]=c?parseInt(c.split(",")[0]):z;f.logger.logImpression(f.logger.eventTypes.CLICK,{divMetaData:b});var c=t?t.handleDropdownChange:z,d=f.twisterControllerHandle.handleDropdownOnChange;c!==z?(f.logger.logCounter("Twister.dropdown.productized.event",1),c.call(t,b,a,p.EVENT_TYPE_DROPDOWN_CHANGE)):(f.logger.logCounter("Twister.dropdown.event",
1),d.call(f.twisterControllerHandle,a,b))};x.when("A").execute(function(c){c.on(p.AUI_DROPDOWN_EVENT_PREFIX+a,b)})}function m(){for(var a,b=0,c=f.dimensionsMap.length;b<c;b++)a=f.dimensionsMap[b],f.thumbnailHandle.attach(a),f.thumbnailHandle.preloadAllThumbnails(a)}function G(a){var c,d,e,g;e=p.ID_SELECTOR+f.dimName+p.CHAR_UNDERSCORE+p.INDEX_FOR_SELECT_OPTION;var n=p.NATIVE_DROPDOWN_DIV_PREFIX+p.DROPDOWN_DIV_NAME+f.dimName,m=E(n).val().split(",")[0],l=a[p.STRING_EVENT_TYPE],q=a[p.STRING_EVENT_DATA],
t=q?q[p.STRING_DIMENSION_SELECTION_DATA]:z;d=a.dimCombID;var r;a=a.optionsUpdatedOnLanding!==z?a.optionsUpdatedOnLanding:!0;q=b.getDimStyleData(d,f.dimValuesDisplayData.length,f.dimOrder,f.twisterAvailabilityCache,f.displayConfigStylesData);f.isCurrentlyUnavailableWeblabEnabled&&(r=f.twisterAvailabilityCache.isDimCombinationCurrentlyAvailable(d));t&&0===t[f.dimOrder][p.STRING_IS_SELECTED]&&m!==p.INDEX_FOR_SELECT_OPTION&&"undefined"!==typeof f.AuiDropdownHandle&&f.AuiDropdownHandle.getSelect(n).val("-1");
l!==p.EVENT_TYPE_CLICK&&l!==p.EVENT_TYPE_DROPDOWN_CHANGE||0!==t[f.dimOrder][p.STRING_IS_REQUIRED]||1!==t[f.dimOrder][p.STRING_IS_SELECTED]||E(e).remove();m=0;for(t=q.length;m<t;m++)if(d=q[m],e=p.NATIVE_DROPDOWN_DIV_PREFIX+f.dimName+p.CHAR_UNDERSCORE+m,c=d[p.STRING_STYLE],d=E(e).get(0).className,c===p.CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION&&(g=E(e).attr("value"),E(n).val()!==g&&f.AuiDropdownHandle.getSelect(n).val(g)),d!==c||d===p.CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION||!a)try{var w;g=m;var x=r,B=
{};d!==c&&(B[p.STRING_CSS_CLASS]=c,B[p.STRING_NATIVE_CSS_CLASS]=c);if(f.isCurrentlyUnavailableWeblabEnabled){var G=f.dimValuesDisplayData[g];if(c===p.CLASS_FOR_DROPDOWN_UNAVAILABLE)E("#popover-unavailable-string-text")[0].innerText=f.unavailableString,G+=E("#popover-unavailable-string-text")[0].outerHTML;else if(c===p.CLASS_FOR_DROPDOWN_CURRENTLY_UNAVAILABLE||c===p.CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION&&!x)E("#popover-currently-unavailable-string-text")[0].innerText=f.currentlyUnavailableString,
G+=E("#popover-currently-unavailable-string-text")[0].outerHTML;B[p.STRING_HTML_CONTENT]=G}w=B;0!==Object.keys(w).length&&f.AuiDropdownHandle.updateOption(e,w)}catch(U){}f.isTablet&&(l===p.EVENT_TYPE_CLICK||l===p.EVENT_TYPE_DROPDOWN_CHANGE)&&f.thumbnailHandle&&f.thumbnailHandle.update(f.dimName)}var f=this,E=r.$,B=c[p.STRING_TWISTER_VARIATION_DATA],t=c[p.PRODUCTIZED_PARENT_VIEW];f.dimType=p.TWISTER_DIMENSION_VIEW_DROPDOWN;f.AuiDropdownHandle=e;f.thumbnailHandle=a;f.dimName;f.dimOrder;f.dimStyleData;
f.dimensionsMap;f.dimNameDisplayString;f.dimValuesDisplayData;f.twisterControllerHandle;f.isTablet;f.unavailableString;f.currentlyUnavailableString;f.isCurrentlyUnavailableWeblabEnabled;f.logger=new l("TwisterDimensionViewsDropdown",this,!0);f.dimType=p.TWISTER_DIMENSION_VIEW_DROPDOWN;f.optionsUpdatedOnLanding=!1;f.initialize=function(){f.twisterAvailabilityCache=c[p.STRING_TWISTER_AVAILABILITY_CACHE];f.dimOrder=c[p.STRING_DIM_ORDER];f.dimName=c[p.STRING_DIM_NAME];f.dimensionsMap=B.dimensionsMap;
f.dimNameDisplayString=c[p.STRING_DIMENSION_DISPLAY_STRING];f.dimValuesDisplayData=B.dimensionValuesData[f.dimOrder];f.twisterControllerHandle=c[p.STRING_TWISTER_CONTROLLER_HANDLE];f.displayConfigStylesData=c[p.STRING_DISPLAY_CONFIG_STYLES_DATA];f.initialTwisterState=c[p.STRING_TWISTER_INITIAL_STATE_KEY];f.isTablet=d.isTablet;f.unavailableString=d[p.STRING_UNAVAILABLE_POPOVER_STRING_VALUE];f.currentlyUnavailableString=d[p.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE];f.isCurrentlyUnavailableWeblabEnabled=
d[p.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED];var a=t?t.getCurrDimCombId():f.initialTwisterState.getCurrentDimCombID();f.dimStyleData=b.getDimStyleData(a,f.dimValuesDisplayData.length,f.dimOrder,f.twisterAvailabilityCache,f.displayConfigStylesData);g();f.isTablet&&m();if(f.isCurrentlyUnavailableWeblabEnabled)r.on("a:popover:beforeShow:dropdown_selected_"+f.dimName,function(a){f.optionsUpdatedOnLanding||(a={},a.optionsUpdatedOnLanding=f.optionsUpdatedOnLanding,a.dimCombID=t?t.getCurrDimCombId():
f.initialTwisterState.getCurrentDimCombID(),G(a),f.optionsUpdatedOnLanding=!0)})};f.removePageLayoutUrls=function(){if("undefined"!==typeof TwisterNonJs)for(var a=w.TwisterNonJs.handleDropDown.length,b=0;b<a;b++)w.TwisterNonJs.handleDropDown[b]=function(){}};f.updateView=function(a){switch(a[p.STRING_EVENT_TYPE]){case p.EVENT_TYPE_MOUSELEAVE:case p.EVENT_TYPE_DROPDOWN_CHANGE:case p.EVENT_TYPE_CLICK:G(a);break;case p.EVENT_TYPE_TWISTER_REFRESH:G(a)}}}x.when("a-dropdown-handlers").execute("mark-dropdown-interactive-time",
function(){"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"dropdown"}]})});m.registerDimensionSubView(p.TWISTER_DIMENSION_VIEW_DROPDOWN,g);return g});x.when("A","twister-string-constants","twister-dimension-view-promise-factory").register("twister-dimension-views-singleton",function(r,e,a){function b(a,b){this.dimType=e.TWISTER_DIMENSION_VIEW_SINGLETON;this.initialize=function(){};this.updateView=function(a){}}a.registerDimensionSubView(e.TWISTER_DIMENSION_VIEW_SINGLETON,
b);return b});x.when("A","twister-dimension-views-unavailablePopover","twister-utils","twister-string-constants","aui-style-override","dp-js-logger","twister-dimension-view-promise-factory","a-truncate").register("twister-dimension-views-swatch",function(r,e,a,b,p,l,m,g){function d(c,d){function m(a,b,c,d){c!==z?(v.logger.logCounter("Twister.swatch.productized.event",1),c.call(K,a,b)):(v.logger.logCounter("Twister.swatch.event",1),d.call(v.twisterControllerHandle,a,a.dimIndex,a.dimValueIndex))}function G(){var a=
b.AUI_EVENT_FOR_SWATCHTHUMB;"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"swatch",events:["hover"]}]});r.declarative(a,[b.EVENT_TYPE_CLICK,b.EVENT_TYPE_MOUSEENTER,b.EVENT_TYPE_MOUSELEAVE,b.EVENT_TYPE_MOUSEDOWN,b.EVENT_TYPE_TOUCHSTART],function(a){if(a.type===b.EVENT_TYPE_CLICK){var c=a.data;a=a.type;v.logger.logImpression(v.logger.eventTypes.CLICK,{divMetaData:c});m(c,a,K?K.handleClick:z,v.twisterControllerHandle.handleClick)}else a.type===
b.EVENT_TYPE_MOUSEENTER?(c=a.data,a=a.type,v.logger.logImpression(v.logger.eventTypes.HOVER,{divMetaData:c}),m(c,a,K?K.handleMouseOver:z,v.twisterControllerHandle.handleMouseOver)):a.type===b.EVENT_TYPE_MOUSELEAVE?m(a.data,a.type,K?K.handleMouseOut:z,v.twisterControllerHandle.handleMouseOut):!v.newPrefetchWeblab||a.type!==b.EVENT_TYPE_MOUSEDOWN&&a.type!==b.EVENT_TYPE_TOUCHSTART||(v.logger.logCounter("Twister.swatch.mouseDownEvent",1),v.twisterControllerHandle&&v.twisterControllerHandle.handleClickPrediction(a.data,
"T1"===v.newPrefetchWeblab?b.YES:b.NO))})}function f(){for(var a,c,d=0,e=v.dimData.length;d<e;d++)if(a=v.dimData[d],c=y(d))a=a[b.STRING_STYLE],C(d,c,a),k(d,a)}function E(a,c){var d=D.StateController.getState().selected_variations,e=D.StateController.getState()[b.STRING_DIMENSION_SELECTION_DATA],f=F("#variation_"+v.dimName+" .selection"),g=F("#variation_"+v.dimName).find(".a-truncate");c?(f.addClass("hover"),0<g.length?(f.text(a),a=v.AUITruncate.get(g),a.getIfTextFits()||a.update()):f.html(a)):(c=
F("#variation_"+v.dimName+" .selection"),F("#"+b.TWISTER_MODAL_ID_PREFIX+v.dimName+" .selection"),v.sizeSwatch?(f="",t(e,v.dimOrder)&&""===a||(null==d[v.dimName]?B(e,v.dimOrder)&&(f=a):f=d[v.dimName]),c.html(f).removeClass("hover")):(f.removeClass("hover"),0<g.length?(f.text(a),a=v.AUITruncate.get(g),a.getIfTextFits()||a.update()):f.html(a)))}function B(a,c){var d=!1;1===a[c][b.STRING_IS_SELECTED]&&(d=!0);return d}function t(a,c){var d=!1;1===a[c][b.STRING_IS_REQUIRED]&&(d=!0);return d}function h(a,
c,d,f){F(b.ID_SELECTOR+v.dimName+b.CHAR_UNDERSCORE+a).each(function(g,h){g=v.dimName+b.CHAR_UNDERSCORE+a+b.CHAR_UNDERSCORE+g;var k=d===b.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE||c===b.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE||c===b.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE_HOVER;!v.twisterJSInitData[b.STRING_HIDE_POPOVER]||v.isCurrentlyUnavailableWeblabEnabled&&k?e.setTooltip(f,d,F(h),g,v.twisterJSInitData,v.dimOrder):e.setAriaLabel(f,d,F(h),g,v.twisterJSInitData,v.dimOrder)})}function y(a){a=F(b.ID_SELECTOR+
v.dimName+b.CHAR_UNDERSCORE+a);var c;if(0<a.length){a=a.get(0).className.split(" ");for(var d=0,e=a.length;d<e;d++){var f=a[d];if(0===f.indexOf("swatch")){c=f;break}}}return c}function C(a,c,d){a=F(b.ID_SELECTOR+v.dimName+b.CHAR_UNDERSCORE+a);c!==d&&F(a).removeClass(c).addClass(d);p.doOverride(d,a)}function k(a,d){a=F(b.ID_SELECTOR+v.dimName+b.CHAR_UNDERSCORE+a+"_price");var c=b.CLASS_FOR_PRICE_SECONDARY;if(d===b.CLASS_FOR_SWATCH_SELECT||d===b.CLASS_FOR_SWATCH_UNAVAILABLE_HOVER||d===b.CLASS_FOR_SWATCH_HOVER)c=
b.CLASS_FOR_PRICE_SELECTED;a.length&&a.removeClass(b.CLASS_FOR_PRICE_SECONDARY+" "+b.CLASS_FOR_PRICE_SELECTED).addClass(c)}var D=w.DetailPage,u=w.Twister,v=this,F=r.$,J=d[b.STRING_TWISTER_VARIATION_DATA],K=d[b.PRODUCTIZED_PARENT_VIEW];v.dimSubType="";v.dimName;v.dimOrder;v.dimData;v.dimensionsMap;v.dimNameDisplayString;v.dimValuesDisplayData;v.twisterControllerHandle;v.isCurrentlyUnavailableWeblabEnabled;v.finalLimitForSwatches;v.twisterJSInitData=c;v.newPrefetchWeblab=!1;v.landingDimCombId;v.logger=
new l("TwisterDimensionViewsSwatch",this,!0);v.sizeSwatch=!1;v.dimType=b.TWISTER_DIMENSION_VIEW_SWATCH;v.AUITruncate=g;v.initialize=function(){v.twisterAvailabilityCache=d[b.STRING_TWISTER_AVAILABILITY_CACHE];v.isSlotsEnabled=d.isSlotsEnabled;v.newPrefetchWeblab=c.newPrefetchWeblab;v.dimOrder=d[b.STRING_DIM_ORDER];v.dimensionsMap=J.dimensionsMap;v.dimName=d[b.STRING_DIM_NAME];v.dimNameDisplayString=d[b.STRING_DIMENSION_DISPLAY_STRING];v.dimValuesDisplayData=J.dimensionValuesData[v.dimOrder];v.displayConfigStylesData=
d[b.STRING_DISPLAY_CONFIG_STYLES_DATA];v.twisterControllerHandle=d[b.STRING_TWISTER_CONTROLLER_HANDLE];v.initialTwisterState=d[b.STRING_TWISTER_INITIAL_STATE_KEY];v.isCurrentlyUnavailableWeblabEnabled=c[b.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED];var e=K?K.getCurrDimCombId():v.initialTwisterState.getCurrentDimCombID();v.dimData=a.getDimStyleData(e,v.dimValuesDisplayData.length,v.dimOrder,v.twisterAvailabilityCache,v.displayConfigStylesData);v.dimSubType=d.dimensionDisplaySubType;G();f();v.swatchWrapper=
".twisterSwatchWrapper_"+v.dimOrder;v.swatchDynaWrapper="twisterSwatchWrapperDynaStyle_"+v.dimOrder;v.$swatches=F(v.swatchWrapper);v.twisterDimmedOpacity=.2;F("#sizeSwatch").length&&(v.sizeSwatch=!0);v.landingDimCombId=D.StateController.getState().currentDimCombID;F(".variations .swatchOuter a").each(function(){var a=r.$(v).contents();F(v).replaceWith(a)})};v.removePageLayoutUrls=function(){F("#twister .swatches a").remove()};v.updateView=function(d){if(d[b.STRING_EVENT_TYPE]===b.EVENT_TYPE_MOUSEOVER||
d[b.STRING_EVENT_TYPE]===b.EVENT_TYPE_MOUSEENTER){var c,e,f,g,n=d[b.STRING_EVENT_DATA],m=n[b.STRING_EVENT_DIM_INFO],l=m[b.STRING_DIMENSION_VALUES_DATA]!==z?m[b.STRING_DIMENSION_VALUES_DATA][v.dimOrder]:"",q=d.dimCombID;d=n[b.STRING_EVENT_DIV_METADATA][b.STRING_DIM_INDEX];n=q.split(b.CHAR_UNDERSCORE)[d];if(parseInt(v.dimOrder)===parseInt(d)){m=y(n);q=a.getDimStyleData(q,v.dimValuesDisplayData.length,v.dimOrder,v.twisterAvailabilityCache,v.displayConfigStylesData);E(l,!0);m===b.CLASS_FOR_SWATCH_UNAVAILABLE&&
v.logger.logImpression(v.logger.eventTypes.UNAVAILABLE_SWATCH_HOVER,null);m===b.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE&&v.logger.logImpression(v.logger.eventTypes.CURRENTLY_UNAVAILABLE_SWATCH_HOVER,null);for(var l=0,p=q.length;l<p;l++)c=q[l],c=c[b.STRING_STYLE],e=y(l),f=e===b.CLASS_FOR_SWATCH_SELECT?!0:!1,g=parseInt(d)===parseInt(v.dimOrder)&&parseInt(n)===parseInt(l)?!0:!1,f||m===b.CLASS_FOR_SWATCH_UNAVAILABLE&&!g||(c===b.CLASS_FOR_SWATCH_SELECT&&(c=e===b.CLASS_FOR_SWATCH_UNAVAILABLE?b.CLASS_FOR_SWATCH_UNAVAILABLE_HOVER:
v.isCurrentlyUnavailableWeblabEnabled&&e===b.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE?b.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE_HOVER:b.CLASS_FOR_SWATCH_HOVER,k(l,c)),C(l,e,c))}}else for(n=d[b.STRING_EVENT_DATA],m=n[b.STRING_EVENT_DIM_INFO],l=m[b.STRING_DIMENSION_VALUES_DATA]!==z?m[b.STRING_DIMENSION_VALUES_DATA][v.dimOrder]:"",n=n[b.STRING_DIMENSION_SELECTION_DATA],q=d.dimCombID,m=a.getDimStyleData(q,v.dimValuesDisplayData.length,v.dimOrder,v.twisterAvailabilityCache,v.displayConfigStylesData),v.sizeSwatch?
(p=q.split("_")[0],q=t(n,v.dimOrder),c=B(n,v.dimOrder),"X"===p&&q&&c||E(l,!1)):E(l,!1),e=0,f=m.length;e<f;e++)if(l=m[e],p=l[b.STRING_STYLE],0===n[v.dimOrder][b.STRING_IS_SELECTED]&&p===b.CLASS_FOR_SWATCH_SELECT&&(p=b.CLASS_FOR_SWATCH_AVAILABLE),c=y(e),v.sizeSwatch&&(q=t(n,v.dimOrder),g=!B(n,v.dimOrder),c===b.CLASS_FOR_SWATCH_SELECT&&l[b.STRING_STYLE]===b.CLASS_FOR_SWATCH_SELECT&&q&&g&&(p=l[b.STRING_STYLE])),c){v.sizeSwatch&&(q=t(n,v.dimOrder),c!==b.CLASS_FOR_SWATCH_SELECT&&c!==b.CLASS_FOR_SWATCH_HOVER||
!q||p!==b.CLASS_FOR_SWATCH_UNAVAILABLE||E("",!1));c=y(e);C(e,c,p);switch(d[b.STRING_EVENT_TYPE]){case b.EVENT_TYPE_DROPDOWN_CHANGE:case b.EVENT_TYPE_CLICK:h(e,c,p,d)}k(e,p)}};x.when("twister-lazy-load-data").execute(function(c){if(c.context.dimKey===v.dimName){var d=D.StateController.getState().currentDimCombID,e=v.landingDimCombId.split("_"),d=d.split("_");e[v.dimOrder]="*";d[v.dimOrder]="*";d=d.join("_");e=e.join("_");if(d===e){var f=c.context;c=c.responseData.split("\x26\x26\x26");F("#"+b.TWISTER_FEATURE_DIV_ID).css("opacity",
.2);F.each(c,function(b,c){var d;if(""!==a.stringTrim(c))try{d=F.parseJSON(c)}catch(e){}else d=c;b=d;c=F(document.querySelectorAll('[data-defaultAsin\x3d"'+b.ASIN+'"]'));d=c.find(" .twisterSlotDiv");if(0<d.length){d.css("display","");if(u.multiDimensionWeblabEnabled){for(var g="",h=0;b.Value.content.twisterSlotDiv[h];)"IMAGE"===f.dimSubType&&(g+="\x3cdiv\x3e"),g+=b.Value.content.twisterSlotDiv[h],"IMAGE"===f.dimSubType&&(g+="\x3c/div\x3e"),h++;d.html(g)}else d.html(b.Value.content.twisterSlotDiv);
c.removeAttr("data-defaultAsin")}});F("#"+b.TWISTER_FEATURE_DIV_ID).css("opacity",1)}}})}m.registerDimensionSubView(b.TWISTER_DIMENSION_VIEW_SWATCH,d);return d});x.when("A","twister-string-constants","dp-js-logger").register("twister-vodd-override-behavior",function(r,e,a){this.VoddOverride=r.createClass({test:!1,shouldGetNextAvailableAsin:function(a,e){return!1},getSupplementString:function(a,e,l,m){return""}});this.voddOverrideBehavior=new this.VoddOverride;this.externalFeatureName="";this.setExternalOverrideBehavior=
function(b,e){try{this.voddOverrideBehavior=b,this.externalFeatureName=e}catch(l){(new a(e)).logFatal(l,{message:"[Override behavior for VODD failed]"})}};this.getVoddOverrideBehavior=function(){return this.voddOverrideBehavior};return this});x.when("A","twister-string-constants","a-tooltip","accessibility-helper").register("twister-dimension-views-unavailablePopover",function(r,e,a,b){function p(a,b,d,c,n){var l=a[e.STRING_EVENT_DATA];a=l[e.STRING_EVENT_DIM_INFO][e.STRING_DIMENSION_DISPLAY_MAP];
var p=l[e.STRING_EVENT_DIV_METADATA],l=l[e.STRING_DIMENSION_SELECTION_DATA];d=d||p[e.STRING_DIM_INDEX];var p=b[e.STRING_SHOW_DIM_SECOND_UNAVAILABLE_POPOVER],f=b[e.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED],r=b[e.STRING_UNAVAILABLE_POPOVER_STRING_VALUE];f&&c===e.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE&&(r=b[e.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE]);if(f)n=r;else{b=r;c="";for(f=0;f<l.length;f++)f!==parseInt(d,10)&&1===l[f][e.STRING_IS_SELECTED]&&(c=c?c+", "+a[f]:a[f]);n||(c="\x3cstrong\x3e"+
c+"\x3c/strong\x3e");n=p?b+" "+c:c+" "+b}return n}function l(a){a=a.popover;var e="";a&&a.getContent()&&(e=a.getContent().text());e&&b.announceText(e)}return{setTooltip:function(b,g,d,c,n,q){d=d.find("button");d.length&&(b=p(b,n,q,g),n=n[e.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED],a.remove(d),r.off("a:popover:show:TwisterDimViewUnavailableTooltip"+c,l),g===e.CLASS_FOR_SWATCH_UNAVAILABLE||n&&g===e.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE)&&(a.create(d,{position:"triggerTop",content:b,inlineContent:b,
name:"TwisterDimViewUnavailableTooltip"+c}),r.on("a:popover:show:TwisterDimViewUnavailableTooltip"+c,l))},setAriaLabel:function(a,b,d,c,n,l){d=d.find("button");c=n[e.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED];d.length&&(d.attr("aria-label",""),b===e.CLASS_FOR_SWATCH_UNAVAILABLE||c&&b===e.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE)&&(a=(d.text().trim()||d.find("img").attr("alt"))+". "+p(a,n,l,b,!0),d.attr("aria-label",a))}}});x.when("A","twister-utils","twister-string-constants","twister-expander",
"dp-js-logger","twister-dimension-view-promise-factory","legacy-popover").register("twister-counter",function(r,e,a,b,p,l){function m(g,d){function c(){L=new b({minHeightForExpandedSection:55,maxHeightForExpandedSection:155,maxHeightForExpandedSectionInView:101,scrollAnimationDuration:500,expanderSection:K,useExpanderScrollView:M>=k.minAsinsForExpandedScroll-1,minAsinsForExpandedView:k.minAsinsForExpandedView,expanderButtonReplacementIndex:k.minAsinsForExpandedView-2,dimValuePrefix:J,initSelectedID:k.currDimCombID,
swatchImageSize:54,swatchImageMargin:10,expanderButton:u,collapseButton:v,dimDisplayType:"counter",logger:S,dimOrder:k.dimOrder,synchronousPostExpanderCallback:function(){r.trigger("TwisterCounterExpanded")},synchronousPostCollapseCallback:function(){r.trigger("TwisterCounterCollapsed")}})}function l(){var b=a.AUI_EVENT_FOR_COUNTER;"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"counter",events:["hover"]}]});if(e.isTouchDevice()){var c=
!1,d="";r.declarative(b,[a.EVENT_TYPE_CLICK,a.EVENT_TYPE_TOUCHSTART,a.EVENT_TYPE_TOUCHEND,a.EVENT_TYPE_TOUCHMOVE],function(b){b.data&&(b.data.dimDisplayType=a.TWISTER_DIMENSION_VIEW_COUNTER);b.type===a.EVENT_TYPE_CLICK?x(b):b.type===a.EVENT_TYPE_TOUCHSTART?(d=b.data.dimValueSelectedID,c=!1):b.type===a.EVENT_TYPE_TOUCHMOVE?c=!0:b.type!==a.EVENT_TYPE_TOUCHEND||c||d!==b.data.dimValueSelectedID||(d="",c=!1,b.type=a.EVENT_TYPE_CLICK,x(b));I=!1})}else r.declarative(b,[a.EVENT_TYPE_CLICK,a.EVENT_TYPE_MOUSEENTER,
a.EVENT_TYPE_MOUSELEAVE],function(b){b.data&&(b.data.dimDisplayType=a.TWISTER_DIMENSION_VIEW_COUNTER);if(b.type===a.EVENT_TYPE_CLICK)x(b);else if(b.type===a.EVENT_TYPE_MOUSEENTER){var c=m(b.data);y(c,b.type,k.parentView?k.parentView.handleMouseOver:z,k.twisterControllerHandle.handleMouseOver,null);b=b.data[a.STRING_DIM_VALUE_INDEX];D(J+b).css("cursor","pointer");b!==k.currDimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]&&(D(J+b).css("z-index",1),E(!0,b),F.html(k.dimValuesDisplayData[b]))}else b.type===
a.EVENT_TYPE_MOUSELEAVE&&(c=m(b.data),y(c,b.type,k.parentView?k.parentView.handleMouseOut:z,k.twisterControllerHandle.handleMouseOut,c[a.STRING_DIM_VALUE_INDEX]),b=b.data[a.STRING_DIM_VALUE_INDEX],b!==k.currDimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]&&(D(J+b).css("z-index",0),E(!1,b),F.html(k.dimValuesDisplayData[k.currDimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]])));I=!1})}function m(b){return{dimIndex:k.dimOrder,dimValueIndex:b?t(b.dimValueSelectedID):null,dimDisplayType:a.TWISTER_DIMENSION_VIEW_COUNTER,
dimValueSelectedID:b.dimValueSelectedID}}function x(b){N=D(a.ID_SELECTOR+b.data.dimValueSelectedID);var c=e.reconstructCombinationWithDimValue(k.currDimCombID,b.data[a.TWISTER_EVENT_DATA_DIM_INDEX],b.data[a.STRING_DIM_VALUE_INDEX]),d=m(b.data);k.currDimCombID!==c&&y(d,b.type,k.parentView?k.parentView.handleClick:z,k.twisterControllerHandle.handleClick,d[a.STRING_DIM_VALUE_INDEX])}function f(b){var c=b[a.STRING_EVENT_DATA][a.STRING_EVENT_DIV_METADATA][a.TWISTER_EVENT_DATA_DISPLAY_TYPE];R=D(J+b.dimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]);
(U=D(".vodd-dim-wrapper").length)&&R.hasClass("counter_unavailable")&&c===a.TWISTER_DIMENSION_VIEW_COUNTER&&r.animate(D(".vodd-dim-wrapper"),{scale:1.1},150,"ease-in",function(){r.animate(D(".vodd-dim-wrapper"),{scale:1},100,"ease-out",function(){})})}function E(a,b){b=D(J+b);a?b.addClass("hoverSwatch"):b.removeClass("hoverSwatch")}function B(){"undefined"===typeof k.$variationList&&(k.$variationList=D("#"+a.TWISTER_DIMENSION_VIEW_COUNTER+"-"+k.dimName+" .counterSwatch"));for(var b=k.$variationList,
c=k.parentView?k.parentView.getCurrDimCombId():k.initialTwisterState.getCurrentDimCombID(),d=parseInt(k.dimOrder),f=[],g=0;g<b.length;g++){5===f.length&&(h(f),f=[]);var l=t(b[g].id),l=e.reconstructCombinationWithDimValue(c,d,l);(l=k.dimensionToAsinMap[l])?f.push(l):D(b[g]).addClass("counter_unavailable")}0<f.length&&h(f)}function t(b){if(!b)return-1;b=b.split(a.CHAR_UNDERSCORE);return b[b.length-1]}function h(a){var b=S.createFunctionTimer(S.eventTypes.DIM_SUM_LOAD);b.start();var c=function(){b.stop()};
0<a.length&&C.dimensionalSummaryModule.fetchDimSumData({indices:z,asinList:a,dimTriggeringDimSum:k.dimName,dimSubType:k.dimSubType,dimType:k.dimType,chunk:function(a){var b=parseInt(A[a.ASIN][parseInt(k.dimOrder)]),b=D(J+b);0<a.Value.content.twisterSlotDiv.length&&b.removeClass("counter_unavailable")},success:function(a,b,d,e){c()},error:c,abort:c})}function y(a,b,c,d,e){c!==z&&"function"===typeof c?c.call(k.parentView,a,b):"function"===typeof d&&d.call(k.twisterControllerHandle,a,k.dimOrder,e)}var C=
w.Twister,k=this,D=r.$,u=D(a.ID_SELECTOR+"expanderButton"),v=D(a.ID_SELECTOR+"collapseButton"),F,J,K,M,I,N,O,R,U,L,S,A,H=d[a.STRING_TWISTER_VARIATION_DATA];k.dimType=a.TWISTER_DIMENSION_VIEW_COUNTER;k.initialize=function(){k.twisterAvailabilityCache=d[a.STRING_TWISTER_AVAILABILITY_CACHE];k.parentView=d[a.PRODUCTIZED_PARENT_VIEW];k.twisterJSInitData=g;k.viewUtil=d[a.PRODUCTIZED_VIEW_UTIL];k.dimensionToAsinMap=H.dimToAsinMapData;k.dimOrder=d[a.STRING_DIM_ORDER];k.dimName=d[a.STRING_DIM_NAME];k.dimensionsMap=
d[a.STRING_DIMENSIONS_MAP];k.dimNameDisplayString=d[a.STRING_DIMENSION_DISPLAY_STRING];k.dimValuesDisplayData=d[a.STRING_DIMENSION_VALUES_DATA];k.twisterControllerHandle=d[a.STRING_TWISTER_CONTROLLER_HANDLE];k.initialTwisterState=d[a.STRING_TWISTER_INITIAL_STATE_KEY];g.useCounterConfig?(k.expandedViewEnabled=g[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][k.dimOrder][a.EXPANDED_VIEW_ENABLED],k.minAsinsForExpandedView=g[a.MIN_ASINS_FOR_EXPANDED_VIEW],k.minAsinsForExpandedScroll=g[a.MIN_ASINS_FOR_EXPANDED_SCROLL]):
(k.displayTypeProperties=g[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][k.dimOrder],k.expandedViewEnabled=k.displayTypeProperties[a.EXPANDED_VIEW_ENABLED],k.minAsinsForExpandedView=k.displayTypeProperties[a.MIN_ASINS_FOR_EXPANDED_VIEW],k.minAsinsForExpandedScroll=k.displayTypeProperties[a.MIN_ASINS_FOR_EXPANDED_SCROLL]);k.dimSubType=d.dimensionDisplaySubType;k.currDimCombID=k.parentView?k.parentView.getCurrDimCombId():k.initialTwisterState.getCurrentDimCombID();S=new p("DPTwisterCounterView");A=H.asinToDimIndexMapData;
F=D(a.ID_SELECTOR+"counter-label-"+k.dimName+" .selection");J=a.ID_SELECTOR+k.dimName+a.CHAR_UNDERSCORE;K=D(a.ID_SELECTOR+"counterSwatchSection-"+k.dimName);M=k.dimValuesDisplayData.length;O=D(J+k.currDimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]);N=D(J+k.currDimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]);I=!1;l();k.expandedViewEnabled&&M>=k.minAsinsForExpandedView&&c();w.CounterScenesController&&w.CounterScenesController.registerCounter(k)};k.removePageLayoutUrls=function(){D(".counterSwatch").each(function(a){a=
D(this);a.parent().is("a")&&a.unwrap()})};k.updateView=function(b){if(b[a.STRING_EVENT_TYPE]===a.EVENT_TYPE_CLICK&&k.currDimCombID!==b[a.STRING_DIM_COMB_ID]){var c=b[a.STRING_EVENT_DATA][a.STRING_EVENT_DIM_INFO][a.STRING_DIMENSION_VALUES_DATA][k.dimOrder];O.css("z-index",0);N.css("z-index",1);F.html(c);N=D(J+b.dimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]);N.removeClass("hoverSwatch");O.removeClass("selectedSwatch");N.addClass("selectedSwatch");f(b);B();k.currDimCombID=b[a.STRING_DIM_COMB_ID];r.trigger("counter:select",
k.currDimCombID);null!=L&&(L.updateSelectedVariation(k.currDimCombID,N),L.isCollapsed&&I&&L.handleVariationSwap(I),L.isCollapsed?L.handleVariationSwap(!0):L.scrollVariationIntoView());O=N}};k.selectCounterVariationAtIndex=function(a){I=!0;D(J+a).children().click()};k.getCurrentSelectedIndex=function(){return parseInt(k.currDimCombID,10)};k.expandCounter=function(){null!=L&&L.isCollapsed&&L.handleExpand()};k.onInitializeTwister=function(){B()}}l.registerDimensionSubView(a.TWISTER_DIMENSION_VIEW_COUNTER,
m);return m});x.when("A","twister-utils","twister-string-constants","twister-expander","dp-js-logger","twister-dimension-view-promise-factory").register("twister-shelf",function(r,e,a,b,p,l){function m(g,d){function c(a){"undefined"!==a&&w.ue&&w.ue.tag&&w.ue.tag(a)}function l(a){var b=w.ue;if(b){var c=b.count(a)||0;b.count(a,c+1)}}function m(){return u.parentView?u.parentView.getCurrDimCombId():u.initialTwisterState.getCurrentDimCombID()}function x(){T=new b({minHeightForExpandedSection:u.minHeightForExpandedSection,
maxHeightForExpandedSection:u.maxHeightForExpandedSection,maxHeightForExpandedSectionInView:u.maxHeightForExpandedSection-74,scrollAnimationDuration:500,expanderSection:I,useExpanderScrollView:N>=u.minAsinsForExpandedScroll-1,minAsinsForExpandedView:u.minAsinsForExpandedView,expanderButtonReplacementIndex:u.expanderButtonReplacementIndex,dimValuePrefix:M,initSelectedID:u.currDimCombID,swatchImageSize:74,swatchImageMargin:17,expanderButton:F,collapseButton:J,expanderHidesVariation:u.expanderHidesVariation,
dimDisplayType:"shelf",logger:L,dimOrder:u.dimOrder,expanderButtonPostCollapse:u.expanderButtonPostCollapse,synchronousPreExpanderCallback:function(){I.removeClass("twisterShelf_isCollapsed");I.removeClass("twisterShelf_isCollapsedAnimated");I.addClass("twisterShelf_isExpanded");I.addClass("twisterShelf_isExpandedAnimated");t()},synchronousPostExpanderCallback:function(){B();I.removeClass("twisterShelf_isExpandedAnimated");r.trigger("TwisterShelfExpanded");u.dualDimension&&l("dualDimshelfExpanded")},
synchronousPreCollapseCallback:function(){I.removeClass("twisterShelf_isExpanded");I.removeClass("twisterShelf_isExpandedAnimated");I.addClass("twisterShelf_isCollapsed");I.addClass("twisterShelf_isCollapsedAnimated");t()},synchronousPostCollapseCallback:function(){B();I.removeClass("twisterShelf_isCollapsedAnimated");r.trigger("TwisterShelfCollapsed")}})}function f(b){if(!b)return-1;b=b.split(a.CHAR_UNDERSCORE);return b[b.length-1]}function E(b){return{dimIndex:u.dimOrder,dimValueIndex:b?f(b.id):
null,dimDisplayType:a.TWISTER_DIMENSION_VIEW_SHELF,dimValueSelectedID:b.id}}function B(){t();"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"shelf",events:["hover"]}]});O.bind(a.EVENT_TYPE_CLICK,function(b){var c=E(b.currentTarget);b=b.type;H=v(a.ID_SELECTOR+c.dimValueSelectedID);var d=e.reconstructCombinationWithDimValue(u.currDimCombID,c.dimIndex,c.dimValueIndex);u.currDimCombID!==d&&k(c,b,u.parentView?u.parentView.handleClick:
z,u.twisterControllerHandle.handleClick,null)});e.isTouchDevice()||(O.bind(a.EVENT_TYPE_MOUSEENTER,function(b){var c=E(b.currentTarget);k(c,b.type,u.parentView?u.parentView.handleMouseOver:z,u.twisterControllerHandle.handleMouseOver,null);b=c[a.STRING_DIM_VALUE_INDEX];c=v(M+b);c.css("cursor","pointer");b!==u.currDimCombID.split(a.CHAR_UNDERSCORE)[u.dimOrder]&&(c.addClass("hoverSwatch"),K.html(u.dimValuesDisplayData[b]))}),O.bind(a.EVENT_TYPE_MOUSELEAVE,function(b){var c=E(b.currentTarget);k(c,b.type,
u.parentView?u.parentView.handleMouseOut:z,u.twisterControllerHandle.handleMouseOut,c[a.STRING_DIM_VALUE_INDEX]);b=c[a.STRING_DIM_VALUE_INDEX];c=v(M+b);b!==u.currDimCombID.split(a.CHAR_UNDERSCORE)[u.dimOrder]&&(c.removeClass("hoverSwatch"),K.html(u.dimValuesDisplayData[u.currDimCombID.split(a.CHAR_UNDERSCORE)[u.dimOrder]]))}))}function t(){O.unbind(a.EVENT_TYPE_CLICK);e.isTouchDevice()||(O.unbind(a.EVENT_TYPE_MOUSEENTER),O.unbind(a.EVENT_TYPE_MOUSELEAVE))}function h(b){var c=b[a.STRING_EVENT_DATA][a.STRING_EVENT_DIV_METADATA][a.TWISTER_EVENT_DATA_DISPLAY_TYPE];
S=v(M+b.dimCombID.split(a.CHAR_UNDERSCORE)[u.dimOrder]);(A=v(".vodd-dim-wrapper").length)&&S.hasClass("shelf_unavailable")&&c===a.TWISTER_DIMENSION_VIEW_SHELF&&r.animate(v(".vodd-dim-wrapper"),{scale:1.1},150,"ease-in",function(){r.animate(v(".vodd-dim-wrapper"),{scale:1},100,"ease-out",function(){})})}function y(b){"undefined"===typeof u.$variationList&&(u.$variationList=v("#"+a.TWISTER_DIMENSION_VIEW_SHELF+"-"+u.dimName+" .twisterShelf_swatch"));for(var c=u.$variationList,d=m(),g=parseInt(u.dimOrder),
h=[],k=0;k<c.length;k++){5===h.length&&(C(h),h=[]);var l=f(c[k].id),l=e.reconstructCombinationWithDimValue(d,g,l);if(l=u.dimensionToAsinMap[l])b?v(".twisterShelf_container #"+u.dimName+"_"+R[l]+" .twisterShelf_infoSection_slots").length||(h.push(l),W+=1):(h.push(l),W+=1);else{var l=v(c[k]),n,p=c[k];n=m().split(a.CHAR_UNDERSCORE);var t=[],r=parseInt(u.dimOrder),p=parseInt(f(p.id));n[r]=p;if(u.parentView)var y=String(n[r]),w=u.parentView.twisterCore,p=u.parentView.twisterCore.util,y=w.util.predictNextState(w.util.createSelectionInfo(w.state()),
w.util.createSelectionInfo(w.util.getSelectionInfoFromDimIndexAndValue(r,y))),p=p.getAsinFromSelectionInfo(y.selectionInfo());else p=u.twisterControllerHandle.twisterAvailabilityCache.gAsinToRender(n.join(a.CHAR_UNDERSCORE),r);if(p=R[p])for(y=0;y<n.length;y++)r!==y&&U[y]!==a.HIDDEN_DIMENSION_DISPLAY_TYPE&&t.push(u.dimensionValuesList[y][p[y]]);n=t.join(", ");l.addClass("shelf_unavailable");"undefined"!==typeof n?(t=l.find(".unavailableV2"),t.find(".variation-combination-text").html(n),l.find(".unavailable-text").removeClass("aok-hidden"),
l.find(".shelf_loading_placeholder").hide(),t.removeClass("aok-hidden"),l.find(".twisterShelf_infoSection").empty().addClass("aok-hidden")):(l.find(".shelf_loading_placeholder").hide(),l.find(".outofstock-text").removeClass("aok-hidden"),l.find(".shelf-outofstock").removeClass("aok-hidden"))}}0<h.length&&C(h)}function C(b){var d=L.createFunctionTimer(L.eventTypes.DIM_SUM_LOAD);d.start();var e=function(){d.stop();fa+=b.length;fa===W&&u.dualDimension&&c("twisterDualDimPlaceholderRemove")};0<b.length&&
D.dimensionalSummaryModule.fetchDimSumData({indices:z,asinList:b,dimTriggeringDimSum:u.dimName,dimSubType:u.dimSubType,dimType:u.dimType,chunk:function(b){if(b&&"object"===typeof b){var c=parseInt(R[b.ASIN][parseInt(u.dimOrder)]),c=v(M+c);if(b.Value&&b.Value.content&&b.Value.content.twisterSlotDiv){var d=v.trim(b.Value.content.twisterSlotDiv);if(0<d.length){c.removeClass("shelf_unavailable");c.find(".unavailableV2").addClass("aok-hidden");c.find(".outofstock-text").addClass("aok-hidden");c.find(".shelf-outofstock").addClass("aok-hidden");
c.find(".unavailable-text").addClass("aok-hidden");b=c.find(".twisterShelf_infoSection");b.empty();b.addClass("aok-hidden");b.append(d);var d=c.find(".twisterShelf_infoSection .price_slot_ppu, .twisterShelf_infoSection .deal_slot_ppu"),e=c.find(".twisterShelf_infoSection .sampling_twister_message"),f=c.find(".twisterShelf_infoSection .sampling_twister_price"),g=c.find(".twisterShelf_infoSection .twister_swatch_price");if(d.length||e.length){var h=v("\x3cp\x3e\x3c/p\x3e");e.length&&f.length?(g.length&&
f.empty(),d.empty(),h.append(e)):h.append(d);b.append(h);d=c.find(".twisterShelf_infoSection i");c=c.find(".twisterShelf_infoSection .olpWrapper");e=v(".twisterShelf_swatchSection.twisterShelf_isCollapsed");d.length&&c.length&&e.length&&b.addClass("hasAllItems")}b.removeClass("aok-hidden");d=I.find(".twisterShelf_swatch.selectedSwatch .twisterShelf_infoSection");d.length&&(c=d.find("[id*\x3d_price]"),d=d.find(".a-size-mini.[class*\x3d_slot_ppu]"),c.length&&c.hasClass(a.CLASS_FOR_PRICE_SECONDARY)&&
c.removeClass(a.CLASS_FOR_PRICE_SECONDARY).addClass(a.CLASS_FOR_PRICE_SELECTED),d.length&&d.addClass(a.CLASS_FOR_PRICE_SELECTED));u.dualDimensionShelf&&(c=b.find(".twister_swatch_price").find(".a-size-mini"),d=c.text().replace(/\s+/g,"").length,b.find("i").length&&7<d&&c.addClass("twisterShelf_dual_dim_price_long"))}}}},success:function(a,b,c,d){e()},error:e,abort:e})}function k(a,b,c,d,e){c!==z&&"function"===typeof c?c.call(u.parentView,a,b):"function"===typeof d&&d.call(u.twisterControllerHandle,
a,u.dimOrder,e)}var D=w.Twister,u=this,v=r.$,F,J,K,M,I,N,O,R,U,L,S,A,H,P,T,W=0,fa=0,X=d[a.STRING_TWISTER_VARIATION_DATA];u.dimType=a.TWISTER_DIMENSION_VIEW_SHELF;u.initialize=function(){u.twisterAvailabilityCache=d[a.STRING_TWISTER_AVAILABILITY_CACHE];u.dimOrder=d[a.STRING_DIM_ORDER];u.parentView=d[a.PRODUCTIZED_PARENT_VIEW];u.twisterJSInitData=g;u.viewUtil=d[a.PRODUCTIZED_VIEW_UTIL];u.expandedViewEnabled=g[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][u.dimOrder][a.EXPANDED_VIEW_ENABLED];u.dimensionToAsinMap=
X.dimToAsinMapData;u.dimName=d[a.STRING_DIM_NAME];u.dimensionsMap=d[a.STRING_DIMENSIONS_MAP];u.dimNameDisplayString=d[a.STRING_DIMENSION_DISPLAY_STRING];u.dimValuesDisplayData=d[a.STRING_DIMENSION_VALUES_DATA];u.initialTwisterState=d[a.STRING_TWISTER_INITIAL_STATE_KEY];u.twisterControllerHandle=d[a.STRING_TWISTER_CONTROLLER_HANDLE];"IMAGE"===d[a.DIMENSION_SUB_TYPE]?(u.minAsinsForExpandedView=g[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][u.dimOrder][a.MIN_ASINS_FOR_EXPANDED_VIEW_IMAGE],u.minAsinsForExpandedScroll=
g[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][u.dimOrder][a.MIN_ASINS_FOR_EXPANDED_SCROLL_IMAGE]):(u.minAsinsForExpandedView=g[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][u.dimOrder][a.MIN_ASINS_FOR_EXPANDED_VIEW_TEXT],u.minAsinsForExpandedScroll=g[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][u.dimOrder][a.MIN_ASINS_FOR_EXPANDED_SCROLL_TEXT]);u.dualDimension=v(".dualDim-Swatch").length;u.dualDimension?(u.expanderButtonReplacementIndex=u.minAsinsForExpandedView-2,u.expanderHidesVariation=!0,u.expanderButtonPostCollapse=
!0,u.dualDimensionShelf=!0,u.minHeightForExpandedSection=89,u.maxHeightForExpandedSection=209,c("twisterDualDimPlaceholderShow2")):(u.expanderButtonReplacementIndex=u.minAsinsForExpandedView-1,u.expanderHidesVariation=!1,u.expanderButtonPostCollapse=!1,u.dualDimensionShelf=!1,u.minHeightForExpandedSection=g[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][u.dimOrder][a.MIN_HEIGHT_EXPANDED_SECTION],u.maxHeightForExpandedSection=g[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][u.dimOrder][a.MAX_HEIGHT_EXPANDED_SECTION]);
u.dimSubType=d[a.DIMENSION_SUB_TYPE];u.currDimCombID=m();L=new p("DPTwisterShelfView");U=X.dimensionsDisplayType;R=X.asinToDimIndexMapData;u.dimensionValuesList=X.dimensionValuesData;O=v(a.ID_SELECTOR+"shelfSwatchSection-"+u.dimName+" .twisterShelf_swatch");K=v(a.ID_SELECTOR+"shelf-label-"+u.dimName+" .twisterShelf_dimension_label span");M=a.ID_SELECTOR+u.dimName+a.CHAR_UNDERSCORE;I=v(a.ID_SELECTOR+"shelfSwatchSection-"+u.dimName);N=u.dimValuesDisplayData.length;P=v(M+u.currDimCombID.split(a.CHAR_UNDERSCORE)[u.dimOrder]);
H=v(M+u.currDimCombID.split(a.CHAR_UNDERSCORE)[u.dimOrder]);F=v(a.ID_SELECTOR+"shelfSwatchSection-"+u.dimName+" .expanderButton");J=v(a.ID_SELECTOR+"shelfSwatchSection-"+u.dimName+" .collapseButton");B();u.expandedViewEnabled&&N>=u.minAsinsForExpandedView&&x()};u.removePageLayoutUrls=function(){v(".twisterShelf_swatch").each(function(a){a=v(this);a.parent().is("a")&&a.unwrap()})};u.updateView=function(b){if(b[a.STRING_EVENT_TYPE]===a.EVENT_TYPE_CLICK&&u.currDimCombID!==b[a.STRING_DIM_COMB_ID]){for(var c=
b[a.STRING_EVENT_DATA][a.STRING_EVENT_DIM_INFO][a.STRING_DIMENSION_VALUES_DATA][u.dimOrder],d=0;d<u.$variationList.length;d++){var e=v(u.$variationList[d]);e.find("twisterShelf_infoSection").addClass("shelf_loading_placeholder");e.find("twisterShelf_infoSection").removeClass("aok-hidden");e.find("twisterShelf_infoSection").addClass("twisterShelf_placeholder_price");e.find("twisterShelf_infoSection").addClass("twisterShelf_placeholder_badge");e.find("unavailableV2").addClass("aok-hidden");e.find("twister_swatch_price").addClass("aok-hidden")}K.html(c);
H=v(M+b.dimCombID.split(a.CHAR_UNDERSCORE)[u.dimOrder]);H.removeClass("hoverSwatch");P.removeClass("selectedSwatch");H.addClass("selectedSwatch");h(b);y(!1);u.dualDimension&&l("dualDimShelfVariationDoubleClick");u.currDimCombID=b[a.STRING_DIM_COMB_ID];null!=T&&(T.updateSelectedVariation(u.currDimCombID,H),T.isCollapsed?T.handleVariationSwap(!0):T.scrollVariationIntoView());P=H}};u.onInitializeTwister=function(){r.loadDescendantImagesManually(I);y(!1)}}l.registerDimensionSubView(a.TWISTER_DIMENSION_VIEW_SHELF,
m);return m});x.when("A","a-popover","twister-string-constants","twister-utils").register("twister-vodd-popover",function(r,e,a,b){return function(p){function l(a,b){f.eventListener&&f.eventListener.handlePopoverEvent&&f.eventListener.handlePopoverEvent(a,b)}function m(b){l(a.EVENT_TYPE_SHOWPOPOVER,b);var d="bottom"===f.displayPosition?"vodd-modified-popover":"vodd-modified-top-popover";b.popover.$container.hasClass(d)||b.popover.$container.addClass(d);c(b.popover.$container)}function g(b){l(a.EVENT_TYPE_HIDEPOPOVER,
b);b.popover.$trigger.blur()}function d(b){c(b.popover.$container);l(a.EVENT_TYPE_UPDATEPOPOVERPOSITION,b)}function c(a){var b=x.get(0).getBoundingClientRect(),c,d;w.pageYOffset?(c=w.pageYOffset,d=w.pageXOffset):"CSS1Compat"===(document.compatMode||"")?(c=document.documentElement.scrollTop,d=document.documentElement.scrollLeft):(c=document.body.scrollTop,d=document.body.scrollLeft);c="bottom"===f.displayPosition?b.bottom+c:b.top+c-a.height();var e=b.right-b.left,b=b.left+d;a&&a.css({top:c+"px",left:b+
"px",width:e+"px"})}var n,q=r.$,x,f={name:null,trigger:null,eventListener:null,displayPosition:"bottom",positionOnTwisterContainer:!0};this.getHandle=function(){return n};p&&q.extend(f,p);if(!f.name)throw"Popover name should not be null";if(!f.trigger)throw"Popover trigger should not be null";(function(){var a="triggerBottom";"top"===f.displayPosition&&(a="triggerTop");a={closeButton:!1,closeButtonLabel:"close",position:a,name:f.name,popoverLabel:f.name,padding:"none",activate:b.isTouchDevice()?"onmouseover":
"onclick"};f.height&&q.extend(a,{height:f.height});n=e.create(f.trigger,a)})();(function(){"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"vodd"}]});r.on("a:popover:afterShow:"+f.name,m);r.on("a:popover:afterHide:"+f.name,g);r.on("a:popover:afterUpdatePosition:"+f.name,d);var a=function(){n&&n.isActive()&&c(n.$container)};r.on("a:pageUpdate",a);q(w).resize(a)})();x=f.positionOnTwisterContainer?q("#twister"):f.trigger}});x.when("A",
"twister-utils","twister-string-constants","scroll-event-handler","twister-vodd-popover","twister-vodd-override-behavior","dp-js-logger","twister-dimension-view-promise-factory").register("twister-vodd",function(r,e,a,b,p,l,m,g){function d(c,d){function g(){return A.parentView?A.parentView.getCurrDimCombId():A.initialTwisterState.getCurrentDimCombID()}function G(){var a=100*parseInt(A.dimensionOrder),b=a,c=function(a,b,c){a.addClass("animation-start");setTimeout(function(){a.animate({top:c||"0px"},
{duration:300,complete:function(){H(this).removeClass("animation-start")}})},b)};ba.length&&ba.parent("td").is(":visible")&&(c(ba.parent("td"),a,"5px"),b=a+50);c(ia.parent("td"),b,"5px")}function f(){ja=a.ID_SELECTOR+"vodd-button-"+A.dimensionName;na=a.ID_SELECTOR+"vodd-singleton-"+A.dimensionName;ra=a.CLASS_SELECTOR+"vodd-button-label-"+A.dimensionName;sa=a.CLASS_SELECTOR+"vodd-button-icon-"+A.dimensionName;ua=a.ID_SELECTOR+"vodd-table-"+A.dimensionName;ta=a.ID_SELECTOR+"dimension-button-img-"+A.dimensionName;
oa=a.ID_SELECTOR+A.dimensionName+a.CHAR_UNDERSCORE;va="vodd-popover-"+A.dimensionName;var b=parseInt(A.dimensionOrder),d=c[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES];d&&H.isArray(d)&&d.length>b&&(b=d[b],b[a.INIT_DATA_VISIBLE_ROW_COUNT]&&(ca=b[a.INIT_DATA_VISIBLE_ROW_COUNT]),b[a.INIT_DATA_MAX_POPOVER_HEIGHT]&&(ka=b[a.INIT_DATA_MAX_POPOVER_HEIGHT]),b[a.INIT_DATA_ANIMATE_BUTTON_CONTENT]&&(wa=b[a.INIT_DATA_ANIMATE_BUTTON_CONTENT]),b[a.INIT_DATA_POPOVER_POSITION]&&(xa=b[a.INIT_DATA_POPOVER_POSITION]))}function E(b){if(V){var c=
V.length/A.dimensionsMap.length*100,c={divMetaData:D(null),count:Math.ceil(A.dimensionsMap.length/ca),percentage:Math.floor(c),dimDisplayType:a.TWISTER_DIMENSION_VIEW_VODD};da.logImpression(b,c)}}function B(){2===fa&&1===X&&(qa=!1);var b={trigger:A.dimensionButton,name:va,eventListener:A,displayPosition:xa,positionOnTwisterContainer:qa},c=Q.find("tr").not(".aok-hidden");c.length&&c.length>ca&&ka&&"undefined"!==typeof ka&&H.extend(b,{height:ka});P=new p(b);A.dimensionButton.bind(e.isTouchDevice()?
a.EVENT_TYPE_TOUCHEND:a.EVENT_TYPE_CLICK,function(a){if(P&&P.getHandle()&&P.getHandle().isActive())return P.getHandle().hide(),!1;da.logImpression(Z.CLICK,{time:Date.now()});e.isTouchDevice()&&A.dimensionButton.trigger("mouseenter")})}function t(a,b){var c=da.createFunctionTimer(Z.DIM_SUM_LOAD);c.start();S.dimensionalSummaryModule&&S.dimensionalSummaryModule.fetchDimSumData({indices:b,asinList:a,dimTriggeringDimSum:A.dimensionName,dimSubType:A.dimSubType,dimType:A.dimType,chunk:function(a){if(a&&
"object"===typeof a){var b=ea[a.ASIN][parseInt(A.dimensionOrder)],b=Q.find(oa+b);if(a.Value&&a.Value.content&&a.Value.content.twisterSlotDiv){var c=H.trim(a.Value.content.twisterSlotDiv);0<c.length&&(b.find(".vodd-loading-placeholder").hide(),K(b),a=b.find(".dimension-details"),a.append(c),b=a.find(".twister_swatch_price").parent(),b.is("div")&&!b.attr("class")&&(b=y(b),b.find(".a-size-mini").addClass("a-size-small").removeClass("a-size-mini"),b.addClass("a-color-price")),a=a.find(".sns-data-slot").parent(),
a.is("div")&&!a.attr("class")&&y(a))}}},success:function(a,b,d,e){c.stop()},error:function(){c.stop()},abort:function(){c.stop()}})}function h(b){var c=g(),d=parseInt(A.dimensionOrder),f=[],h=[];V||(V=[]);var n=l.getVoddOverrideBehavior();A.voddOverrideEnabled=!0;try{A.shouldFetchNextAvailableAsin=n.shouldGetNextAvailableAsin(A.dimensionOrder,A.dimensionsMap)}catch(p){var u=new m(n.externalFeatureName),v={message:"[shouldFetchNextAvailableAsin failed for VODD Twister Override]"};u.logFatal(p,v)}for(var y=
0;y<b.length;y++){7===f.length&&(t(f,h),f=[],h=[]);var w=k(b[y].id),u=e.reconstructCombinationWithDimValue(c,d,w),x=pa[u];0>r.indexOfArray(V,w)&&V.push(w);null==x&&A.shouldFetchNextAvailableAsin&&(u=g().split(a.CHAR_UNDERSCORE),d=parseInt(A.dimensionOrder),u[d]=w,x=N(u,d));if(x){if(A.voddOverrideEnabled){var C="";try{C=n.getSupplementString(x,pa,ea,W)}catch(p){u=new m(n.externalFeatureName),v={message:"[getSupplementString failed for VODD Twister Override]"},u.logFatal(p,v)}H(b[y]).find(".supplementString").remove();
H(b[y]).find(".dimension-display-text").append('\x3cspan class\x3d"supplementString a-size-mini"\x3e'+C+"\x3c/span\x3e")}h.push(w);f.push(x)}}0<f.length&&t(f,h)}function y(a){var b=a.prev(),c=a.children();a.remove();b.after(c);return c}function C(a){a=e.getVisibleTableRows(a.currentTarget,Q.find("tr"));h(a)}function k(b){if(!b)return-1;b=b.split(a.CHAR_UNDERSCORE);return b[b.length-1]}function D(b){return{dimIndex:A.dimensionOrder,dimValueIndex:b?k(b.id):null,dimDisplayType:a.TWISTER_DIMENSION_VIEW_VODD}}
function u(a){E(Z.CLICK_VARIATION);ha||E(Z.SCROLL);ha=!0;V=null;var b=D(a.currentTarget),c=g(),d=e.reconstructCombinationWithDimValue(c,b.dimIndex,b.dimValueIndex);d!==c&&(R(),J(b,a.type,A.parentView?A.parentView.handleClick:z,A.twisterControllerHandle.handleClick,null));P&&P.getHandle()&&P.getHandle().hide();b={dimensionOrder:A.dimensionOrder,dimensionValueIndex:b.dimValueIndex,isSelectedDimValueAvailable:aa.dimToAsinMapData[d]?!0:!1};H(a.currentTarget).trigger("TwisterVODD.dimensionRowClick",b)}
function v(a){H(a.currentTarget).addClass("vodd-row-hovered");var b=D(a.currentTarget);J(b,a.type,A.parentView?A.parentView.handleMouseOver:z,A.twisterControllerHandle.handleMouseOver,null)}function F(a){H(a.currentTarget).removeClass("vodd-row-hovered");var b=D(a.currentTarget);J(b,a.type,A.parentView?A.parentView.handleMouseOut:z,A.twisterControllerHandle.handleMouseOut,k(a.currentTarget.id))}function J(a,b,c,d,e){c!==z?c.call(A.parentView,a,b):d.call(A.twisterControllerHandle,a,A.dimensionOrder,
e)}function K(a){a.find(".dimension-slots .availability-message").nextAll().remove()}function M(b,c){if(c)b.find(".unavailable-text").hide(),b.find(".vodd-loading-placeholder").show();else{b.find(".vodd-loading-placeholder").hide();b.find(".unavailableV2").removeClass("aok-hidden");c=g().split(a.CHAR_UNDERSCORE);var d=[],e=parseInt(A.dimensionOrder),f=k(b[0].id);c[e]=f;f=N(c,e);if(f=ea[f])for(var h=0;h<c.length;h++)e!==h&&ya[h]!==a.HIDDEN_DIMENSION_DISPLAY_TYPE&&d.push(W[h][f[h]]);if(c=d.join(", "))b.find(".unavailable-text").show(),
b.find(".variation-combination-text").text(c);var l;a:{c=0;d=parseInt(A.dimensionOrder);e=parseInt(k(b[0].id));for(l in ea)if(parseInt(ea[l][d])===e&&1<++c){l=!0;break a}l=!1}l||b.find(".variation-more-text").hide()}K(b)}function I(b){Y.sort(function(c,d){c=k(c.id);d=k(d.id);if(b[c][a.STRING_STYLE]!==b[d][a.STRING_STYLE]){if(b[c][a.STRING_STYLE]===a.CLASS_FOR_VODD_UNAVAILABLE)return 1;if(b[d][a.STRING_STYLE]===a.CLASS_FOR_VODD_UNAVAILABLE)return-1}return c-d});Y.detach().appendTo(Q)}function N(b,
c){if(A.parentView){var d=String(b[c]),e=A.parentView.twisterCore;b=A.parentView.twisterCore.util;c=e.util.predictNextState(e.util.createSelectionInfo(e.state()),e.util.createSelectionInfo(e.util.getSelectionInfoFromDimIndexAndValue(c,d)));c=b.getAsinFromSelectionInfo(c.selectionInfo())}else c=A.twisterControllerHandle.twisterAvailabilityCache.gAsinToRender(b.join(a.CHAR_UNDERSCORE),c);return c}function O(a){var b=Q.find("tr").not(".aok-hidden");a=b.index(a);var c=b.length-ca;a>c?(a=c,0>a&&(a=0)):
a=0===a?a:a-1;b=b.slice(a,a+ca);h(b)}function R(){Y.unbind(a.EVENT_TYPE_CLICK,u);e.isTouchDevice()||Y.unbind(a.EVENT_TYPE_MOUSEENTER,v).unbind(a.EVENT_TYPE_MOUSELEAVE,F)}function U(b,c,d){var f=b;if(L()){var g=b.split(a.CHAR_UNDERSCORE);b=A.dimensionOrder;for(var g=g.slice(0),h=0;h<la.length;h++)b!==h&&la[b]<la[h]&&(g[h]="X",f=g.join("_"))}b=f;f=e.getDimStyleData(f,A.dimValuesDisplayData.length,A.dimensionOrder,A.twisterAvailabilityCache,A.displayConfigStylesData);I(f);var k=null;b=f.length;for(g=
0;g<f.length;g++){var h=f[g],l=Q.find(oa+g);if(h[a.STRING_STYLE]===a.CLASS_FOR_VODD_SELECT){if(k=l,l.addClass("vodd-row-selected"),A.dimensionValueHasIcon[g]?(ia.text(""),ma.attr("class","background-sprite "+A.dimValuesDisplayData[g].replace(/\s/g,""))):(ma.attr("class",""),ia.text(A.dimValuesDisplayData[g])),ba.length){var n=l.find("img.vodd-dimension-img");(n=0<n.length?n.attr("src"):null)&&ba.attr("src",n).show()}}else l.removeClass("vodd-row-selected");l.removeClass("vodd-row-hovered");1<A.dimensionsMap.length&&
M(l,h[a.STRING_STYLE]!==a.CLASS_FOR_VODD_UNAVAILABLE);L(d)&&(h[a.STRING_STYLE]===a.CLASS_FOR_VODD_UNAVAILABLE?(l.addClass("aok-hidden"),--b):l.removeClass("aok-hidden"))}L(d)&&(1>=b?(H(ja).addClass("aok-hidden"),H(na).removeClass("aok-hidden")):(H(na).addClass("aok-hidden"),H(ja).removeClass("aok-hidden")));c?r.on.load(function(){O(k)}):O(k)}function L(){var a=!1;za&&Aa!==parseInt(A.dimensionOrder)&&(a=!0);return a}var S=w.Twister,A=this,H=r.$,P,T,W,fa,X,qa=!0,ga,Y,Q,ba,ia,ma,ra,sa,ta,ja,na,ua,oa,
va,ca=0,xa="bottom",wa=!1,ka,ha=!1,V,pa,ya,ea,da,Z,aa=d[a.STRING_TWISTER_VARIATION_DATA],la,za,Aa;A.dimType=a.TWISTER_DIMENSION_VIEW_VODD;A.initialize=function(){A.twisterAvailabilityCache=d[a.STRING_TWISTER_AVAILABILITY_CACHE];A.dimensionOrder=d[a.STRING_DIM_ORDER];A.parentView=d[a.PRODUCTIZED_PARENT_VIEW];A.twisterJSInitData=c;A.viewUtil=d[a.PRODUCTIZED_VIEW_UTIL];A.displayConfigStylesData=d[a.STRING_DISPLAY_CONFIG_STYLES_DATA];A.dimSubType=d[a.DIMENSION_SUB_TYPE];A.dimensionValueHasIcon=d[a.DIMENSION_VALUE_HAS_ICON];
A.initialTwisterState=d[a.STRING_TWISTER_INITIAL_STATE_KEY];A.twisterControllerHandle=d[a.STRING_TWISTER_CONTROLLER_HANDLE];A.dimensionsMap=aa.dimensionsMap;A.dimensionName=A.dimensionsMap[A.dimensionOrder];A.dimValuesDisplayData=aa.dimensionValuesData[A.dimensionOrder];fa=A.dimensionsMap.length;W=aa.dimensionValuesData;pa=aa.dimToAsinMapData;da=new m("DPTwisterVODDView");Z=da.eventTypes;ya=aa.dimensionsDisplayType;ea=aa.asinToDimIndexMapData;X=H(".vodd-dim-wrapper").size();la=c.dimensionHierarchyData;
za=c.hierarchicalPivoting;Aa=c.topHierarchicalDimensionIndex;f();A.dimensionButton=H(ja);Q=H(ua);Y=Q.find("tr");ba=H(ta);ia=H(ra);ma=H(sa);da.logImpression(Z.DIM_INIT,{count:Math.ceil(A.dimensionsMap.length/ca),dimDisplayType:a.TWISTER_DIMENSION_VIEW_VODD});wa&&x.when("A","ready").execute(function(a){w.setTimeout(function(){G()},1E3)})};A.onInitializeTwister=function(){U(g(),!0,null);r.loadDescendantImagesManually(Q);B()};A.handlePopoverEvent=function(c,d){c===a.EVENT_TYPE_SHOWPOPOVER?(R(),Y.bind(a.EVENT_TYPE_CLICK,
u),e.isTouchDevice()||Y.bind(a.EVENT_TYPE_MOUSEENTER,v).bind(a.EVENT_TYPE_MOUSELEAVE,F),ha=!1,c=d.popover.$trigger,d={popover:d},c.addClass("highlighted"),c.trigger("TwisterVODD.showPopup",d),T||(ga=Q.closest(".a-popover-inner"),T=new b(200,ga,C)),d=Q.find("tr.vodd-row-selected"),ga&&ga.length&&d.length&&ga.scrollTop(d.get(0).offsetTop-33)):c===a.EVENT_TYPE_HIDEPOPOVER?(c=d.popover.$trigger,d={popover:d},ha||(E(Z.SCROLL),V=null),ha=!0,H(c).removeClass("highlighted"),c.trigger("TwisterVODD.hidePopup",
d)):c===a.EVENT_TYPE_UPDATEPOPOVERPOSITION&&d.popover.$trigger.trigger("TwisterVODD.updatePopupPosition",{popover:d})};A.updateView=function(b){b[a.STRING_EVENT_TYPE]===a.EVENT_TYPE_CLICK&&U(b[a.STRING_DIM_COMB_ID],!1,b[a.STRING_EVENT_DATA][a.STRING_EVENT_DIV_METADATA])};A.showVariationSelection=function(){e.isTouchDevice()||A.dimensionButton.trigger("click")}}g.registerDimensionSubView(a.TWISTER_DIMENSION_VIEW_VODD,d);return d});x.when("A","twister-utils","twister-string-constants").register("twister-beaconized-evdd",
function(r,e,a){return function(b,p){function l(){var a=q(x).height(),a={localContent:f,location:"bottom",showOnHover:!1,showCloseButton:!1,skin:null,clone:!1,controlCallbacks:!0,locationOffset:[-2,-(8+a)],closeEventInclude:"CLICK_OUTSIDE",forceAlignment:!0,group:"DonsBoxDropDowns",width:null};"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"evdd"}]});t=q(x).amazonPopoverTrigger(a);q(document).bind("touchend click",function(){y=
!1;t.amznPopoverHide()})}function m(a){y=!0;a=a.currentTarget.id.split("_");n.twisterControllerHandle.handleClick({dimIndex:n.dimOrder,dimValueIndex:a[a.length-1]});y&&(t.amznPopoverHide(),y=!1);return!1}function g(a){q(a.currentTarget).addClass("evdd-row-hovered")}function d(a){q(a.currentTarget).removeClass("evdd-row-hovered");return!1}function c(a){q(a.currentTarget).removeClass("evdd-row-hovered");m(a);return!1}var n=this,q=r.$,x,f,z,B,t,h={},y=!1;n.dimType="etdd";n.dimNameDisplayString;n.dimData;
n.dimensionsMap;n.dimNameDisplayString;n.dimValuesDisplayData;n.dimName;n.dimOrder;n.isMasterDim=!1;n.initialize=function(){var b;n.dimOrder=p[a.STRING_DIM_ORDER];n.dimName=p[a.STRING_DIM_NAME];n.dimensionsMap=p[a.STRING_DIMENSIONS_MAP];n.dimNameDisplayString=p[a.STRING_DIMENSION_DISPLAY_STRING];n.dimValuesDisplayData=p[a.STRING_DIMENSION_VALUES_DATA];n.displayConfigStylesData=p[a.STRING_DISPLAY_CONFIG_STYLES_DATA];n.twisterControllerHandle=p[a.STRING_TWISTER_CONTROLLER_HANDLE];n.initialTwisterState=
p[a.STRING_TWISTER_INITIAL_STATE_KEY];b=n.initialTwisterState.getCurrentDimCombID();n.dimData=e.getDimStyleData(b,n.dimValuesDisplayData.length,n.dimOrder,n.twisterControllerHandle.twisterAvailabilityCache,n.displayConfigStylesData);n.isMasterDim=!1;"0"===n.dimOrder&&(n.isMasterDim=!0);n.dimNameDisplayString=p[a.STRING_DIMENSION_DISPLAY_STRING];x="#evdd-button-"+n.dimName;f="#evdd-table-wrapper-"+n.dimName;z="#evdd-singleton-"+n.dimName;h.invalid=n.isMasterDim?"evdd-row-default":"evdd-row-hidden";
h.available="evdd-row-default";h.selected="evdd-row-selected";B="evdd-hidden evdd-row-hovered evdd-row-hidden evdd-row-default evdd-row-selected";l();for(var k=0,r=n.dimData.length;k<r;k++)b="#"+n.dimName+"_"+k,q(b).bind("click",m).bind("touchend",c).bind("touchstart",g).bind("mouseenter",g).bind("mouseleave",d)};n.updateView=function(a){var b=e.getDimStyleData(a.dimCombID,n.dimValuesDisplayData.length,n.dimOrder,n.twisterControllerHandle.twisterAvailabilityCache,n.displayConfigStylesData),c,d,f,
g;a=0;g="";t.amznPopoverHide();y=!1;for(var l=0,m=b.length;l<m;l++)c=b[l],d=h[c.style],f="#"+n.dimName+"_"+l,"evdd-row-selected"===d&&(g=l,g=n.dimValuesDisplayData[g]),"available"!==c.style&&"selected"!==c.style||a++,c=q(f),c.removeClass(B).addClass(d),c.find(".evdd-row-snake-wrapper").show(),c.find(".evdd-row-price-info-wrapper").html(""),c.find(".evdd-row-prime-badge-wrapper").html("");b=!1;n.isMasterDim||1!==a||(b=!0);a=b;q(x).find("button").text(g);q(z).text(g);a?(q(x).addClass("evdd-hidden"),
q(z).removeClass("evdd-hidden")):(q(z).addClass("evdd-hidden"),q(x).removeClass("evdd-hidden"))};n.updateViewWithPriceInfo=function(a){var b,c,d;for(b in a)c=a[b],d="#"+n.dimName+"_"+b,d=q(d),d.find(".evdd-row-snake-wrapper").hide(),d.find(".evdd-row-price-info-wrapper").html(c[2]),d.find(".evdd-row-prime-badge-wrapper").html(c[3])}}});x.when("A","twister-utils","twister-string-constants").register("twister-native-evdd",function(r,e,a){return function(b,p){function l(){var a=g(d).val(),a=parseInt(a.split(",")[0]);
m.twisterControllerHandle.handleClick({dimIndex:m.dimOrder,dimValueIndex:a})}var m=this,g=r.$,d;m.dimType="etdd";m.dimNameDisplayString;m.dimName;m.dimOrder;m.isMasterDim=!1;m.initialize=function(){m.dimOrder=p[a.STRING_DIM_ORDER];m.dimName=p[a.STRING_DIM_NAME];m.dimValuesDisplayData=p[a.STRING_DIMENSION_VALUES_DATA];m.isMasterDim=!1;"0"===m.dimOrder&&(m.isMasterDim=!0);m.dimNameDisplayString=p[a.STRING_DIMENSION_DISPLAY_STRING];m.displayConfigStylesData=p[a.STRING_DISPLAY_CONFIG_STYLES_DATA];m.twisterControllerHandle=
p[a.STRING_TWISTER_CONTROLLER_HANDLE];d="#evdd-select-"+m.dimName;"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"etdd"}]});g(d).change(l)};m.updateView=function(a){a=e.getDimStyleData(a.dimCombID,m.dimValuesDisplayData.length,m.dimOrder,m.twisterControllerHandle.twisterAvailabilityCache,m.displayConfigStylesData);var b,l="",p;g(d).empty();for(var f=0,r=a.length;f<r;f++)if(b=a[f],b=b.style,"invalid"!==b||m.isMasterDim)b="selected"===
b?"selected":"",p="#native-"+m.dimName+"_"+f,b='\x3coption id\x3d"'+p+'" value\x3d"'+f+'," '+b+"\x3e"+m.dimValuesDisplayData[f]+"\x3c/option\x3e",l+=b;g(d).html(l)}}});x.when("A","twister-dimension-view-promise-factory","twister-string-constants","3p-promise","twister-dimension-subview-promise-handler").register("twister-view",function(r,e,a,b,p){return function(l,m,g,d,c){function n(a){for(var b,c=[],d=0,g=f.dimensionsMap.length;d<g;d++)b=e.getDimensionSubViewPromise(f.twisterJSInitData,f.twisterVariationsData,
d.toString(10),f.twisterControllerHandle,a),c.push(b);return c}function q(b){var c=p.getDimensionSubViewPromise("page-refresh-view");r.each(b,function(a,b){a.initialize();f.dimensionViewHandlersMap[b]=a});c.then(function(a){r.each(b,function(a,b){a.removePageLayoutUrls!==z&&a.removePageLayoutUrls()});x("#twisterNonJsData").html("")});x(a.CLASS_FOR_NON_JS_EVDD).hide();x(a.CLASS_FOR_NEW_TWISTER_EVDD).show();f.updateView({},f.twisterControllerHandle.initTwisterState,a.EVENT_TYPE_CLICK);f.onInitializeTwister()}
function w(b,c,d,e,f){var g={},l={};g[a.STRING_EVENT_TYPE]=b;g[a.STRING_DIM_COMB_ID]=c;l[a.STRING_EVENT_DIV_METADATA]=d;l[a.STRING_EVENT_DIM_INFO]=e;l[a.STRING_DIMENSION_SELECTION_DATA]=f;g[a.STRING_EVENT_DATA]=l;return g}var f=this,x=r.$;f.twisterControllerHandle=l;f.twisterJSInitData=g;f.twisterVariationsData=d;f.twisterAvailabilityCache=c;f.dimensionsMap={};f.dimensionDisplayMap={};f.dimensionDisplayTypeMap={};f.dimensionViewHandlersMap={};f.isAllViewsInitializedPromise=null;f.updateView=function(b,
c,d){var e={},g,k=c.dimensionSelectionData;d===a.EVENT_TYPE_MOUSEOVER?(g=c.hoveredAsin,c=c.hoveredDimCombID):(g=c.getCurrentASIN(),c=c.getCurrentDimCombID());e[a.STRING_DIMENSION_VALUES_DATA]=f.twisterVariationsData.getDimensionValuesDisplayData(g);e[a.STRING_DIMENSION_DISPLAY_MAP]=f.dimensionDisplayMap;e[a.STRING_DIMENSIONS_MAP]=f.dimensionsMap;b=w(d,c,b,e,k);d=0;for(e=f.dimensionsMap.length;d<e;d++)f.dimensionViewHandlersMap[d].updateView(b)};f.updateViewAfterTwisterUpdate=function(b,c,d){var e=
{},g=c.dimensionSelectionData;c.getCurrentASIN();c=c.getCurrentDimCombID();e[a.STRING_DIMENSION_DISPLAY_MAP]=f.dimensionDisplayMap;e[a.STRING_DIMENSIONS_MAP]=f.dimensionsMap;b=w(d,c,b,e,g);if(d===a.EVENT_TYPE_DROPDOWN_CHANGE||d===a.EVENT_TYPE_CLICK)for(d=0,e=f.dimensionsMap.length;d<e;d++)f.dimensionViewHandlersMap[d].updateViewAfterTwisterUpdate&&f.dimensionViewHandlersMap[d].updateViewAfterTwisterUpdate(b)};f.onInitializeTwister=function(){"undefined"!==typeof f.dimensionViewHandlersMap&&f.dimensionViewHandlersMap&&
x.each(f.dimensionViewHandlersMap,function(a,b){if("function"===typeof b.onInitializeTwister)b.onInitializeTwister()})};f.isAllViewsInitialized=function(){return f.isAllViewsInitializedPromise};f.isAllViewsInitializedPromise=function(c){for(var d=f.twisterJSInitData,e=d[a.INIT_DATA_DIMENSIONS_MAP].length,g=[],l=[],k=[],m=0,p=0;p<e;p++)d[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP]&&d[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][p]!==a.HIDDEN_DIMENSION_DISPLAY_TYPE&&(g[m]=d[a.INIT_DATA_DIMENSIONS_MAP][p],
l[m]=d[a.INIT_DATA_DIMENSIONS_DISPLAY][p],k[m]=d[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][p],m++);f.dimensionsMap=g;f.dimensionDisplayMap=l;f.dimensionDisplayTypeMap=k;var r=n(c);return new b(function(a){b.all(r).then(function(b){q(b);a()})})}(m)}});x.when("A","twister-string-constants").register("migrated-views",function(r,e){var a=[e.TWISTER_DIMENSION_VIEW_VODD,e.TWISTER_DIMENSION_VIEW_SWATCH,e.TWISTER_DIMENSION_VIEW_DROPDOWN,e.TWISTER_DIMENSION_VIEW_SHELF,e.TWISTER_DIMENSION_VIEW_COUNTER];return{getMigratedViews:function(){return a}}});
x.when("A","twister-dimension-view-promise-factory","twister-string-constants","view-util","twister-utils","accessibility-helper","dp-js-logger","3p-promise","twister-dimension-subview-promise-handler").register("parent-view",function(r,e,a,b,p,l,m,g,d){return function(c,n,q,w,f){function x(){for(var b,c=0,d=[],g=0,h=f.tvm.dimensionList.length;g<h;g++)k.twisterJSInitData[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP]&&k.twisterJSInitData[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][g]!==a.HIDDEN_DIMENSION_DISPLAY_TYPE&&
(k.dimensionDisplayTypeMap[g]=k.twisterJSInitData[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][g],k.dimensionsMap[g]=k.twisterJSInitData[a.INIT_DATA_DIMENSIONS_MAP][g],b=e.getDimensionSubViewPromise(k.twisterJSInitData,k.twisterVariationsData,g.toString(10),k.twisterControllerHandle,z,k),d.push(b),k.dimensionSubViewIndexMap[c++]=g);return d}function B(b){var c=d.getDimensionSubViewPromise("page-refresh-view");r.each(b,function(a,b){a.initialize();k.dimensionViewHandlersMap[k.dimensionSubViewIndexMap[b]]=
a});c.then(function(a){r.each(b,function(a,b){a.removePageLayoutUrls!==z&&a.removePageLayoutUrls()});D("#twisterNonJsData").html("")});D(a.CLASS_FOR_NON_JS_EVDD).hide();D(a.CLASS_FOR_NEW_TWISTER_EVDD).show();t();k.updateView(a.EVENT_TYPE_CLICK);k.onInitializeTwister()}function t(){var a=h();k.twister=f.registerActive({viewAttribution:"DetailPage",viewName:"TwisterDesktopView"},a)}function h(){return{updateView:function(b,c){switch(b){case a.VARIATION_CHANGE:c=c.selected();b=k.viewUtil.getDimensionValuesData(c.selInfo,
k.twisterJSInitData);k.updateView(k.eventType,k.divMetaData,b);if(k.eventType===a.EVENT_TYPE_DROPDOWN_CHANGE||k.eventType===a.EVENT_TYPE_CLICK)c=k.viewUtil.createAccessibilityText(c.selInfo,k.twisterJSInitData),l.announceText(c),k.updateViewAfterTwisterUpdate(k.divMetaData,k.eventType,b);break;case a.VARIATION_PEEK:c=c.peek(),b=k.viewUtil.getDimensionValuesData(c.selInfo,k.twisterJSInitData),k.updateView(k.eventType,k.divMetaData,b,c.selInfo)}}}}function y(){return{divMetadata:k.divMetaData,eventType:k.eventType,
subType:a.DP_STATE_VIEW_SUBTYPE,dimensionsMap:k.dimensionsMap,currDimCombId:k.viewUtil.getCurrDimCombId(f.state(),a.CHAR_UNDERSCORE)}}function C(b,c,d,e){var g=f.state(),h={},l={};d={dimensionDisplayMap:k.viewUtil.getDimDisplayMap(),dimensionsMap:k.dimensionsMap,dimensionValuesData:d?d:k.viewUtil.getDimensionValuesData(g,k.twisterJSInitData)};h[a.STRING_DIM_COMB_ID]=k.viewUtil.getCurrDimCombId(b===a.EVENT_TYPE_MOUSEENTER&&e?e:g,a.CHAR_UNDERSCORE,a.CHAR_CROSS);h[a.STRING_EVENT_TYPE]=b;l[a.STRING_EVENT_DIV_METADATA]=
c;l[a.STRING_EVENT_DIM_INFO]=d;l[a.STRING_DIMENSION_SELECTION_DATA]=k.viewUtil.getDimensionSelectionData(f.util.dimensionMetaData,g);h[a.STRING_EVENT_DATA]=l;return h}var k=this,D=r.$;k.twisterControllerHandle=c;k.twisterJSInitData=n;k.twisterVariationsData=q;k.twisterAvailabilityCache=w;k.viewUtil=new b(f);k.deletedLandingAsinInfo=n[a.INIT_DATA_DELETED_LANDING_ASIN_INFO];k.dimensionsMap=[];k.dimensionDisplayTypeMap={};k.dimensionViewHandlersMap={};k.dimensionSubViewIndexMap={};k.divMetaData={};k.eventType=
"";k.twisterCore=f;k.enableMouseOut;k.isAllViewsInitializedPromise=null;k.logger=new m("dpTwister",this,!0);k.handleClick=function(a,b){k.viewUtil.initializeTwisterInteractionStartTime();var c=f.state();k.divMetaData=a;k.eventType=b;if(k.viewUtil.isAlreadySelected(c,a))return!1;b=k.viewUtil.getTwisterState(a);k.twister.metaData(y());k.twister.dimensionChanged(b);k.logger.logImpression(k.logger.eventTypes.CLICK,{divMetaData:a});return b};k.getCurrDimCombId=function(){return k.viewUtil.getCurrDimCombId(f.state(),
a.CHAR_UNDERSCORE)};k.handleDropdownChange=function(a,b,c){k.handleClick(a,c)};k.handleMouseOver=function(b,c){if(p.isTouchOnlyDevice())return k.handleClick(b,a.EVENT_TYPE_CLICK),!0;k.divMetaData=b;k.eventType=c;c=f.state();k.enableMouseOut=1;if(k.viewUtil.isAlreadySelected(c,b))return!1;c=k.viewUtil.getTwisterState(b);k.twister.metaData(y());k.twister.dimensionPeek(c);k.logger.logImpression(k.logger.eventTypes.HOVER,{divMetaData:b});return c};k.handleMouseOut=function(a,b){k.divMetaData=a;k.eventType=
b;a=k.viewUtil.getTwisterState(a);return 1===k.enableMouseOut?(k.enableMouseOut=0,k.twister.metaData(y()),k.twister.dimensionPeek(f.state()),a):!1};k.updateView=function(a,b,c,d){a=C(a,b,c,d);b=0;for(c=k.dimensionsMap.length;b<c;b++)k.dimensionViewHandlersMap[b].updateView(a);return a};k.updateViewAfterTwisterUpdate=function(b,c,d){b=C(c,b,d);if(c===a.EVENT_TYPE_DROPDOWN_CHANGE||c===a.EVENT_TYPE_CLICK)for(c=0,d=k.dimensionsMap.length;c<d;c++)"function"===typeof k.dimensionViewHandlersMap[c].updateViewAfterTwisterUpdate&&
k.dimensionViewHandlersMap[c].updateViewAfterTwisterUpdate(b);return b};k.onInitializeTwister=function(){"undefined"!==typeof k.dimensionViewHandlersMap&&k.dimensionViewHandlersMap&&D.each(k.dimensionViewHandlersMap,function(a,b){if("function"===typeof b.onInitializeTwister)b.onInitializeTwister()})};k.isAllViewsInitialized=function(){return k.isAllViewsInitializedPromise};k.isAllViewsInitializedPromise=function(){var a=x();return new g(function(b){g.all(a).then(function(a){B(a);b()})})}()}});x.when("A",
"twister-string-constants","detail-page-state-controller","view-util","twister-utils","dp-js-logger").register("detail-page-state-controller-view",function(r,e,a,b,p,l){return function(a,g){function d(){return{updateView:function(b,d){var r=g.util,k;switch(b){case e.METADATA:d.subType===e.DP_STATE_VIEW_SUBTYPE&&(f=d.divMetadata,z=d.dimensionsMap,B=d.currDimCombId);break;case e.VARIATION_CHANGE:d=d.selected();b=r.isFullySelected(d);r=r.getAsinFromSelectionInfo(d.selInfo,b);k=t.getDimensionValuesDisplayData(r,
a);b=t.getCurrDimCombId(d.selInfo,e.CHAR_UNDERSCORE,e.CHAR_CROSS);var x=g.util;if(q.eventType===e.EVENT_TYPE_CLICK||q.eventType===e.EVENT_TYPE_DROPDOWN_CHANGE){for(var u=t.getCurrDimCombId(d.selInfo),v={},F=0,G=z.length;F<G;F++)"1"===x.isRequiredDim(z[F])&&f.dimIndex===F&&"*"===u[F]?v[z[F]]="-1":v[z[F]]=u[F];l.StateController.setState("selected_variation_values",v)}c("selected",k,d.selInfo);c("hovered",k,d.selInfo);l.StateController.setState("current_asin",r);l.StateController.setState("currentDimCombID",
b);l.StateController.setState("reactId",b);l.StateController.setState("dimensionSelectionData",t.getDimensionSelectionData(g.util.dimensionMetaData,d.selInfo));k=f[e.STRING_DIM_INDEX];d=p.getAttachedClass(f,t.getDimNameByOrder(k));d="undefined"!==typeof d&&(-1!==d.indexOf(e.CLASS_FOR_SWATCH_UNAVAILABLE)||-1!==d.indexOf(e.CLASS_FOR_DROPDOWN_UNAVAILABLE));u=b.split(e.CHAR_UNDERSCORE);x=B.split(e.CHAR_UNDERSCORE);u[k]=e.CHAR_ASTERISK;x[k]=e.CHAR_ASTERISK;k=u.join(e.CHAR_UNDERSCORE);x=x.join(e.CHAR_UNDERSCORE);
k!==x&&(d=!0);l.StateController.setState("isUnavailableInOldDimCombId",d?"true":"false");w.twisterController&&w.twisterController.twisterModel&&w.twisterController.twisterModel.twisterState&&(d=w.twisterController.twisterModel.twisterState,d.currentDimCombID=b,d.currentASIN=r);break;case e.VARIATION_PEEK:d=d.peek(),b=r.isFullySelected(d),r=r.getAsinFromSelectionInfo(d.selInfo,b),k=t.getDimensionValuesDisplayData(r,a),a.useMS&&(!f||f.dimDisplayType!==e.TWISTER_DIMENSION_VIEW_VODD&&f.dimDisplayType!==
e.TWISTER_DIMENSION_VIEW_SHELF&&f.dimDisplayType!==e.TWISTER_DIMENSION_VIEW_COUNTER)||c("hovered",k,d.selInfo),l.StateController.setState("hovered_asin",r)}}}}function c(b,c,d){var f={};x.each(c,function(b,c){t.isDimensionSelected(b,d)&&"(Please Select)"===c&&(c=null);f[a[e.INIT_DATA_DIMENSIONS_MAP][b]]=c});l.StateController.setState(b+"_variations",f)}var l=w.DetailPage,q=this,x=r.$,f={},z={},B="",t=new b(g);(function(){var a=d();q.twister=g.registerActive({viewAttribution:"DetailPage",viewName:"DPStateControllerView"},
a)})()}});x.when("A","twister-string-constants","twister-dimension-view-promise-factory","twister-native-evdd","twister-beaconized-evdd").register("twister-evdd",function(r,e,a,b,p){r=r.$;if(r("html").hasClass("a-lt-ie8"))return a.registerDimensionSubView(e.TWISTER_DIMENSION_VIEW_EVDD,b),b;a.registerDimensionSubView(e.TWISTER_DIMENSION_VIEW_EVDD,p);return p})});
/* ******** */
(function(l){var c=window.AmazonUIPageJS||window.P,m=c._namespace||c.attributeErrors,e=m?m("PageRefreshAsset",""):c;e.guardFatal?e.guardFatal(l)(e,window):e.execute(function(){l(e,window)})})(function(l,c,m){l.when("A","page-refresh-state","web-ajax-utility","alt-page-refresh-measurement","dp-interactive-page-refresh-handler","dp-click-to-ci-utils").register("page-refresh-handler",function(e,f,h,b,d,a){var g={},k=e.$,p=m,n="",r=function(b,g){var c=this;c.clientId=b;c.persistentParams={};c.pageRefreshUrlParams=
"";c.deviceType="";c.doPageRefresh=function(g,c,k,f,l,m){g=r(g,c);d.createInteractivityObjectForTwisterUpdate();var q;q=h.getInstance(b,g,{success:function(){var b=arguments[arguments.length-1];b&&!b.isResponseFromCache?p&&n&&(b=q.xhr.http.getResponseHeader("x-amz-rid"),p.setRequestId(n,b),n=""):a.logCounter("CachedTwisterMetric-Desktop");k.success.apply(null,arguments);e.trigger("PageRefresh:Success")},chunk:k.chunk,failure:k.failure,error:k.error,abort:k.abort},f);"function"===typeof l&&l.call(null,
{isNewRequest:0===q.status});q.getContent();"function"===typeof m&&m.call(null)};c.addParams=function(a){c.persistentParams=k.extend(!0,c.persistentParams,a);return!0};c.removeParams=function(a){e.each(a,function(a,b){delete c.persistentParams[a]});return!0};c.createCustomParamsMap=function(a,b){var g={Persistent:{},"Non-Persistent":{}};k.each(a,function(a,b){g.Persistent[a]=b});k.each(b,function(a,b){g["Non-Persistent"][a]=b});return g};c.startMeasurement=function(a,b,g,c,k,d){n=a;p&&p.start(a,b,
g,c,k,d)};c.stampImageLoad=function(a){p&&p.stampImageLoad(a)};c.stampFeature=function(a,b){p&&p.stampFeature(a,b)};var r=function(a,b){c.persistentParams=k.extend(!0,c.persistentParams,b.Persistent);var n={};k.extend(!0,n,c.persistentParams,b["Non-Persistent"]);b=g;var d=e.contains(b,"?");b=b+(d?"\x26":"?")+((a?"asin\x3d"+a:"")+(c.pageRefreshUrlParams?c.pageRefreshUrlParams:""));for(var f in n)null!=n[f]&&(a=n[f],d=b.slice(-1),b+="?"===d||"\x26"===d?"":"\x26",b+=f+"\x3d"+a);return b};(function(){var a=
f.pageRefreshData;c.pageRefreshUrlParams=a.pageRefreshUrlParams;c.deviceType=a.deviceType})()};return{getHandlerInstance:function(a,d,e){(null==a||""===a)&&c.ueLogError&&c.ueLogError({message:"Invalid ClientId"},{logLevel:"FATAL",attribution:"PageRefreshAPI",message:"Invalid ClientId passed to getHandlerInstance of dpRefreshHandler"});g[a]||(g[a]=new r(a,d));!p&&e&&(d=e.config,p=new b(k,d.atf.marker,d.cf.marker),p.setStoreId(n,e.storeID));return g[a]}}});"use strict";l.when("A","page-refresh-handler").register("dp-refresh-handler",
function(e,f){function h(b,c,a){this.featureTriggeringRefresh=b.featureName;this.deviceType=(this.deviceTypeStateData=e.state("detail-page-device-type"))&&this.deviceTypeStateData.deviceType?this.deviceTypeStateData.deviceType:"web";this.pageRefreshUrl=c&&c.pageRefreshUrl?c.pageRefreshUrl:"/gp/twister/ajaxv2";this.clientId="PageRefresh_"+this.deviceType+"_Client";this.DPRefreshHandler=f.getHandlerInstance(this.clientId,this.pageRefreshUrl,a)}h.prototype={doPageRefresh:function(b,d,a,g,k,e){try{this.DPRefreshHandler.doPageRefresh(b,
d,a,g,k,e)}catch(n){c.ueLogError&&c.ueLogError(n,{logLevel:"ERROR",attribution:this.featureTriggeringRefresh,message:"This error is caused by the doPageRefresh method triggered by - "+this.featureTriggeringRefresh})}},createCustomParamsMap:function(b,d){var a={};try{a=this.DPRefreshHandler.createCustomParamsMap(b,d)}catch(g){c.ueLogError&&c.ueLogError(g,{logLevel:"ERROR",attribution:this.featureTriggeringRefresh,message:"This error is caused by the createCustompParamsMap method triggered by - "+this.featureTriggeringRefresh})}return a},
addParams:function(b){return b&&"object"==typeof b?this.DPRefreshHandler.addParams(b):!1},removeParams:function(b){return b&&"object"==typeof b?this.DPRefreshHandler.removeParams(b):!1},startMeasurement:function(b,d,a,g,k,e){try{this.DPRefreshHandler.startMeasurement(b,d,a,g,k,e)}catch(n){c.ueLogError&&c.ueLogError(n,{logLevel:"ERROR",attribution:this.featureTriggeringRefresh,message:"This error is caused by the startMeasurement method triggered by - "+this.featureTriggeringRefresh})}},stampImageLoad:function(b){try{this.DPRefreshHandler.stampImageLoad(b)}catch(d){c.ueLogError&&
c.ueLogError(d,{logLevel:"ERROR",attribution:this.featureTriggeringRefresh,message:"This error is caused by the startMeasurement method triggered by - "+this.featureTriggeringRefresh})}},stampFeature:function(b,d){try{this.DPRefreshHandler.stampFeature(b,d)}catch(a){c.ueLogError&&c.ueLogError(a,{logLevel:"ERROR",attribution:this.featureTriggeringRefresh,message:"This error is caused by the startMeasurement method triggered by - "+this.featureTriggeringRefresh})}}};return h});l.when("A","jQuery","dp-interactive-page-refresh-handler",
"dp-click-to-ci-utils").register("alt-page-refresh-ajax-scope",function(e,f,h,b){return function(d,a,g,k){this.scopeName=a;this.customPageTypeId=g;this.customTags=k;this.storeId="";this.CFmarked=this.requestIdAvailable=!1;ues("t0",a,c.newTwisterInteractionStartTime);ues("ctb",a,"1");this.signalMarker=function(a){!this.markers[a]||0>=this.markers[a].conditions||0===--this.markers[a].conditions&&"function"==typeof this.markers[a].handler&&this.markers[a].handler()};this.addlongPoleTag=function(a,b){a=
a.toLowerCase();this.markers[a]&&0==this.markers[a].conditions&&0==this.markers[a].conditions&&c.ue&&"function"===typeof ue.tag&&ue.tag(b)};this.markClickToCI=function(){var a=this,g=h.getClickToCIMetric();g&&g.then(function(g){uet("fn",a.scopeName,m,g.interactiveTime);a.requestIdAvailable&&uex("ld",lScopeName);b.logCounter("TTISuccessCountForTwisterUpdate")}).catch(function(a){b.logCounter("TTIFailureCountForTwisterUpdate")})};this.setStoreId=function(a){a&&(this.storeId=a)};this.setRequestId=function(a){a&&
(this.CFmarked=this.requestIdAvailable=!0,this.postData(a))};this.postData=function(a){var b=this.scopeName,g=this.customPageTypeId,k=this.customTags;c.ue&&ue.tag&&(c.ue_pty&&ue.tag(c.ue_pty),c.ue_spty&&ue.tag(c.ue_spty),ue.tag(c.ue_spty),ue.tag("main"),ue.tag(this.storeID),ue.tag("clientOnly"));if(this.requestIdAvailable&&this.CFmarked){ues("id",b,a);var d;g!==m&&(d=c.ue_pti,c.ue_pti=g);if(k!==m)for(a=0;a<k.length;a++)ue.tag(k[a]);uex("ld",b);g!==m&&(c.ue_pti=d)}};var f=this;this.markers={image:{conditions:1,
handler:function(){uet("ne",a);f.signalMarker("af")}},af:{conditions:Twister.atfMarkerCount?Twister.atfMarkerCount:2,handler:function(){e.trigger("PageRefresh:ATF");uet("af",a);uet("cf",a);f.signalMarker("cf");h.updateCriticalFeatures();f.markClickToCI()}},cf:{conditions:Twister.cfMarkerCount?Twister.cfMarkerCount:2,handler:function(){e.trigger("PageRefresh:CF");uet("cf",a);this.CFmarked=!0;f.postData()}}}}});l.when("A","jQuery","alt-page-refresh-ajax-scope").register("alt-page-refresh-measurement",
function(e,f,h){return function(b,d,a){this.atfMarker=d;this.cfMarker=a;this.scopeCount={};this.ajaxScopes={};this.start=function(a,k,d,e,f,l){c.ue&&(this.scopeCount[a]||(this.scopeCount[a]=0),k=a+(this.scopeCount[a]+1),this.scopeCount[a]++,this.ajaxScopes[a]=new h(b,k,f,l))};this.setRequestId=function(a,b){this.ajaxScopes[a]&&this.ajaxScopes[a].setRequestId(b)};this.setStoreId=function(a,b){this.ajaxScopes[a]&&this.ajaxScopes[a].setStoreId(requestId)};this.stampImageLoad=function(a){this.ajaxScopes[a]&&
(this.ajaxScopes[a].signalMarker("image"),Twister.cfImageLongPollTag&&this.ajaxScopes[a].addlongPoleTag("cf",Twister.cfImageLongPollTag))};this.stampFeature=function(a,b){this.ajaxScopes[b]?(a===this.atfMarker&&this.ajaxScopes[b].signalMarker("af"),a===this.cfMarker&&(this.ajaxScopes[b].signalMarker("cf"),Twister.cfHtmlLongPollTag&&this.ajaxScopes[b].addlongPoleTag("cf",Twister.cfHtmlLongPollTag))):a===this.cfMarker&&e.trigger("PageRefresh:AjaxCallCompletedButCFMarkingNotDone")};this.stampCustomMetrics=
function(a,b){this.ajaxScopes[b]&&uet(a,this.ajaxScopes[b].scopeName)}}});l.when("A","ready").register("page-refresh-state",function(c){var f=c.state("page-refresh-data");c=c.state("detail-page-device-type");var h={};"undefined"!==typeof f&&(h.pageRefreshUrlParams=f.pageRefreshUrlParams);"undefined"!==typeof c&&(h.deviceType=c.deviceType);return{pageRefreshData:h}});l.when("A","jQuery","dp-js-logger").register("web-ajax-utility",function(e,f,h){function b(a,b,c,d){this.scope=a;this.url=b;this.options=
c;this.status=0;this.selected=!1;this.error=this.successData=this.xhr=this._status=m;this.chunks=[];this.doNotAbort=d||!1}var d=new h("WebAjaxUtility");b._objects={};b.prototype._callback=function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);"function"===typeof a&&a.apply(self,b)};b.prototype._canAbort=function(){return!this.doNotAbort&&1===this.status};b.prototype._isAborted=function(){return 3===this.status};b.prototype._getUrl=function(){return this.url};b.prototype._abort=function(){if(1===
this.status)try{this.ajaxRequestRefence.abort(),this.status=3}catch(a){d.logFatal(a,{message:" Could not abort ajax request."})}};b.prototype._flushChunkData=function(){var a=this;a.chunks.length&&f.map(a.chunks,function(b){a._callback(a.options.chunk,b)})};b.prototype._request=function(){var a=this,b=c.performance&&performance.now,d=m,f=m;b&&(d=performance.now());a.ajaxRequestRefence=e.get(a.url,{params:a.options.params,success:function(h,l,m){a.status=4;b&&(f=performance.now());a.successData=h;
a._status=l;a.xhr=m;a.selected&&a._callback(a.options.success,h,l,m,{isResponseFromCache:!1});e.trigger("TwisterRefresh:Success");c.ue&&ue.count&&d&&f&&ue.count("TwisterApiCall",f-d)},error:function(b,c,d){a.status=2;a.xhr=b;a._status=c;a.error=d;a.selected&&a._callback(a.options.error,b,c,d)},abort:function(b){a.status=3;a.xhr=b;a.selected&&a._callback(a.options.abort,b)},chunk:function(b){b&&(a.chunks.push(b),a.selected&&a._callback(a.options.chunk,b))},timeout:a.options.timeout||4E4})};b.prototype.getContent=
function(){b._abortRequestsExcept(this);this.selected=!0;0===this.status?(this.status=1,this._request()):1===this.status?this._flushChunkData():4===this.status&&(this._flushChunkData(),this._callback(this.options.success,this.successData,this._status,this.xhr,{isResponseFromCache:!0}),e.trigger("a:pageUpdate"),e.trigger("TwisterRefresh:Success"))};b._abortRequestsExcept=function(a){f.each(b._objects[a.scope],function(b,c){c._canAbort()&&b!==a._getUrl()&&c._abort()})};b.getInstance=function(a,c,d,
f){if(!a||!c||"object"!==typeof d)throw"Incorrect parameter passed.";b._objects[a]=b._objects[a]||{};var e=b._objects[a][c];e&&e._isAborted()&&(delete b._objects[a][c],e=m);e||(b._objects[a][c]=new b(a,c,d,f,this));return b._objects[a][c]};return b});l.when("A").register("state-aware-critical-features",function(c){return function(){var c=[];this.add=function(e,b){for(var d=e.featureName,a=!1,g=0;g<c.length;g++)if(c[g].featureName===d){a=!0;break}if(a)throw"Critical Feature "+e.featureName+" already registered for State Aware Messaging!";
e={};e.featureName=d;e.callback=b;c.push(e)};this.getAllCriticalFeatures=function(){return c}}});l.when("A","state-aware-parameter-handler").register("state-aware-feature-consolidator",function(c,f){return{getStateAwareParameters:function(){return f.getStateAwareParameters()}}});l.when("A","state-aware-critical-features","state-aware-parameters").register("state-aware-parameter-handler",function(e,f,h){return new function(){var b=new f,d=new h;this.registerCriticalFeature=function(a,d){try{if("function"===
typeof d)b.add(a,d);else throw"callback needs to be a function!";}catch(e){c.ueLogError&&c.ueLogError(e,{logLevel:"ERROR",attribution:a.featureName,message:"StateAwareExceptionMessaging:- This error is caused by the feature "+a.featureName+" while registering itself as a critical feature for State Aware Messaging. "+e})}};this.getStateAwareParameters=function(){for(var a=b.getAllCriticalFeatures(),e=0;e<a.length;e++){var f=a[e],h=f.featureName,f=f.callback.apply();try{d.putParameters(h,f)}catch(l){c.ueLogError&&
c.ueLogError(l,{logLevel:"ERROR",attribution:h,message:"StateAwareMessaging:- This error is caused by the feature "+h+" while injecting state aware parameters. "+l})}}return d.getAllStateAwareParameters()}}});l.when("A").register("state-aware-parameters",function(){return function(){var c={};this.putParameters=function(f,h){var b=!0;for(feature in c)if(c.hasOwnProperty(feature)&&f!==feature){var d=this.getParameters(feature);if(b){var b=h,a=!1;for(paramKey in b)if(b.hasOwnProperty(paramKey)&&d.hasOwnProperty(paramKey)){a=
!0;break}b=!a}}if(b)for(paramKey in h)h.hasOwnProperty(paramKey)&&(d=h[paramKey],c[f]||(c[f]={}),c[f][paramKey]=d);else throw"Duplicate Parameters found for other Critical Feature!";};this.getParameters=function(f){return c[f]};this.getAllStateAwareParameters=function(){var f={},h;for(h in c)if(c.hasOwnProperty(h)){var b=this.getParameters(h),d;for(d in b)b.hasOwnProperty(d)&&(f[d]=b[d])}return f}}});l.when("A").register("page-refresh-utils",function(e){var f=e.$,h={intermediateEOS:1,EOS:1};return{fadeInFeatures:function(b){f.each(b,
function(a,c){"#"!==c[0]&&(b[a]="#"+c)});var c=b.join(",");f(c).addClass("js-feature-refresh-overlay").css("opacity",.5)},refreshFeature:function(b){var d=b.Value;b=b.FeatureName;if(!h[b]){var a,e;try{b&&d&&d.content&&(e=d.content[b],"undefined"!==typeof e&&(a=f("#"+b),a.html(e),a.removeClass("js-feature-refresh-overlay"),a.css("opacity","")))}catch(k){d={message:"Error in feature"+(b||"NoFeatureName"),logLevel:"FATAL"},c.ueLogError&&c.ueLogError(k,d)}}},removeOverlayForAllFeatures:function(b){b=
f("body").find(".js-feature-refresh-overlay");for(var c=0;c<b.length;c++)f(b[c]).removeClass("js-feature-refresh-overlay").css("opacity","")}}})});
/* ******** */
(function(k){var g=window.AmazonUIPageJS||window.P,l=g._namespace||g.attributeErrors,b=l?l("CertifiedRefurbishedDetailPageAssets",""):g;b.guardFatal?b.guardFatal(k)(b,window):b.execute(function(){k(b,window)})})(function(k,g,l){k.when("A").register("renewed-side-sheet",function(b){for(var a=b.$,f={},e=1;4>=e;e++)f[e]={$content:a("#renewed-tabular-buybox-side-sheet-content-"+e),$background:a("#renewed-tabular-buybox-side-sheet-background-"+e)};b.declarative("show-renewed-side-sheet","click",function(a){var d=
f[a.data.tier].$content;b.show(d);b.animationFrameDelay(function(){d.addClass("renewed-side-sheet-content-display");b.show(f[a.data.tier].$background)})});b.declarative("close-renewed-side-sheet","click",function(a){var d=f[a.data.tier].$content;d.removeClass("renewed-side-sheet-content-display");b.hide(f[a.data.tier].$background);d.one("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd",function(){b.hide(d)})})});k.when("A","jQuery").register("renewed-offer-consistency",function(b,a){function f(c){var a=
b.$("#offerDisplayGroupTabSet #tab_heading_desktop_buybox_group_2");a.length&&0===a.index()&&(c+=1);return c}function e(c){b.$("div.renewedOfferConsistency").children().css("display","none");c=b.$(".renewedOfferConsistencyIndex_"+c);var d=a("#productSpecifications_dp_warranty_and_support");"undefined"===c||0===c.length?d.css("display",""):(c.css("display","block"),d.css("display","none"))}try{var h=a("#buybox .a-accordion-active");if("undefined"===typeof h||!h||"undefined"===typeof h[0]||!h[0]||"undefined"===
typeof h[0].id||!h[0].id)return;var d=b.$(h).index();d=f(d);e(d)}catch(c){g.ueLogError&&g.ueLogError(c,{logLevel:"ERROR",attribution:"renewed_offer_consistency",message:"[Error initializing renewed offer consistency ]"})}b.on("a:accordion:buybox-accordion:select",function(c){try{if("undefined"!==typeof c&&c&&"undefined"!==typeof c.selectedRow&&c.selectedRow&&"undefined"!==typeof c.selectedRow.$row&&c.selectedRow.$row){var a=b.$(c.selectedRow.$row).index();a=f(a);e(a)}}catch(m){g.ueLogError&&g.ueLogError(m,
{logLevel:"ERROR",attribution:"renewed_offer_consistency",message:"[Error responding to MOD change in renewed offer consistency ]"})}})});"use strict";k.when("A","atf").register("detailPageRefurbishedProductJourneyVideo-constants",function(b){return{UNDEFINED:"undefined",VIDEO_HIDDEN_LOCALE_FIELD:"#detailPageRefurbishedProductJourneyVideoLocale",VIDEO_HIDDEN_MARKETPLACE_ID_FIELD:"#detailPageRefurbishedProductJourneyVideoMarketPlaceId",VIDEO_HIDDEN_URL_FIELD:"#detailPageRefurbishedProductJourneyVideoUrl",
VIDEO_HIDDEN_THUMBNAIL_IMAGE_FIELD:"#detailPageRefurbishedProductJourneyVideoThumbnailImage",VIDEO_CONTAINER_ELEMENT_DP_ATF:"#detailPageRefurbishedProductJourneyVideo-video",VIDEO_CONTAINER_ELEMENT_DP_BTF:"#detailPageRefurbishedProductJourneyVideoBTF-video",VIDEO_CONTAINER_ELEMENT_DP_OUTER_SECONDARY_VIEW:"#detailPageRefurbishedProductJourneyVideoBTF-video-outer-secondary",VIDEO_CONTAINER_ELEMENT_DP_OUTER_PRIMARY_VIEW:"#detailPageRefurbishedProductJourneyVideoBTF-video-outer-primary",VIDEO_CONTAINER_ELEMENT_DP_INNER_SECONDARY_VIEW:"#detailPageRefurbishedProductJourneyVideoBTF-video-inner-secondary",
VIDEO_CONTAINER_ELEMENT_DP_INNER_PRIMARY_VIEW:"#detailPageRefurbishedProductJourneyVideoBTF-video-inner-primary",VIDEO_CLIENT_PREFIX:"renewed",VIDEO_REQUESTER_ID:"INRenewed",VIDEO_AJAX_REQUEST_PAGE:"Detail",VIDEO_AJAX_REQUEST_PLACEMENT:"detailPageRefurbishedProductJourneyVideo",VIDEO_AJAX_REQUEST_PARAMS_FORMAT:"json",VIDEO_AJAX_REQUEST_METHOD:"post",VIDEO_AJAX_REQUEST_CONTENT_TYPE:"application/json",VIDEO_AJAX_REQUEST_ENDPOINT:"/vap/ew/subcomponent/vseplayer",VSE_PREFIX:"vsePlayer-",VSE_FULL_SCREEN_CHANGE:"-fullscreenchange",
VSE_PLAYER_LOADED:"-playerLoaded",VIDEO_LOADED_SUCCESS_METRIC:"detailPageRefurbishedProductJourneyVideo.videoLoadedT1",VIDEO_LOADED_FAILURE_METRIC:"detailPageRefurbishedProductJourneyVideo.videoLoadFailedT1",REFURBISHED_BADGE_BOTTOM_SHEET_AFTER_SHOW:"a:sheet:afterShow:detailPageRefurbishedProductJourneyVideoBottomSheet",REFURBISHED_BADGE_POPOVER_AFTER_SHOW:"a:popover:afterShow:detailPageRefurbishedProductJourneyVideoBottomSheet",REFURBISHED_BADGE_BOTTOM_SHEET_AFTER_HIDE:"a:sheet:afterHide:detailPageRefurbishedProductJourneyVideoBottomSheet",
REFURBISHED_BADGE_POPOVER_AFTER_HIDE:"a:popover:afterHide:detailPageRefurbishedProductJourneyVideoBottomSheet"}});k.when("A","detailPageRefurbishedProductJourneyVideo-constants","postMetric").register("detailPageRefurbishedProductJourneyVideo-utils",function(b,a,f){function e(c){return typeof c!==a.UNDEFINED&&null!==c}function h(a,b){f.postCountMetric(a,b)}var d=b.$;return{pauseVideoPlayer:function(a){e(a)&&a.isPlaying()&&!a.isFullscreen()&&a.pause()},videoAjaxCall:function(c,f,g,k){!e(k)&&e(d(a.VIDEO_HIDDEN_LOCALE_FIELD).val())&&
e(d(a.VIDEO_HIDDEN_MARKETPLACE_ID_FIELD).val())&&e(d(a.VIDEO_HIDDEN_URL_FIELD).val())&&e(d(a.VIDEO_HIDDEN_THUMBNAIL_IMAGE_FIELD).val())&&(c={requester:c,clientPrefix:f,locale:String(d(a.VIDEO_HIDDEN_LOCALE_FIELD).val()),page:a.VIDEO_AJAX_REQUEST_PAGE,placement:a.VIDEO_AJAX_REQUEST_PLACEMENT,marketplaceID:String(d(a.VIDEO_HIDDEN_MARKETPLACE_ID_FIELD).val()),video:{videoURL:String(d(a.VIDEO_HIDDEN_URL_FIELD).val()),imageURL:String(d(a.VIDEO_HIDDEN_THUMBNAIL_IMAGE_FIELD).val())}},b.ajax(a.VIDEO_AJAX_REQUEST_ENDPOINT,
{params:c,paramsFormat:a.VIDEO_AJAX_REQUEST_PARAMS_FORMAT,method:a.VIDEO_AJAX_REQUEST_METHOD,contentType:a.VIDEO_AJAX_REQUEST_CONTENT_TYPE,success:function(b){d(g).html(b);h(a.VIDEO_LOADED_SUCCESS_METRIC,1)},error:function(b){b=d(g);e(b)&&b.hide();h(a.VIDEO_LOADED_FAILURE_METRIC,1)}}))},isDefined:e,isNotDefined:function(a){return!e(a)},logCountMetric:h}})});
/* ******** */
