(function(a){var n=window.AmazonUIPageJS||window.P,h=n._namespace||n.attributeErrors,f=h?h("AXFClientPluginAsset",""):n;f.guardFatal?f.guardFatal(a)(f,window):f.execute(function(){a(f,window)})})(function(a,n,h){a.when("A","ready").register("ContextualActionsAUI",function(f){function h(b){n.ue&&"function"===typeof n.ue.count&&n.ue.count(b,1)}function p(){a.when("mash","A").execute(function(b,c){c.on("a:pageUpdate",function(a){var k=c.$;a=k("#corePriceDisplay_mobile_feature_div").attr("data-csa-c-asin");
var q=!1;(k=k(".a-price-range span"))&&(q=2<k.length);b.dispatchEvent({type:"appx:axf:pageUpdate",detail:{asin:a,hasPriceRangeLabel:q}})})})}function t(){a.when("mash","A").execute(function(b,c){c.on("rcx:huc:template:inserted",function(c){b.dispatchEvent({type:"appx:axf:miniBuyBoxDisplayed"})})});a.when("A","mash").execute("adjustMiniBuyBox",function(b,c){var a=b.$("#mobile_miniatf"),k=a&&a.hasClass("is-hidden");b.$(n).scroll(function(){var b=a&&a.hasClass("is-hidden");b!==k&&(c.dispatchEvent({type:"appx:axf:floatingButtonVisilibityChange",
detail:{visibility:!b}}),k=b)})});a.when("mash","A","btf-sub-nav-configs").execute(function(b,c){document.getElementById("btf-sub-nav-tab")&&b.dispatchEvent({type:"appx:axf:blacklistBTTFromPage"})})}function w(){a.when("mash","A").execute(function(b,c){c.on("ssf:event:caf-share-complete-success",function(){b.dispatchEvent({type:"axf:consultAFriend:shareCompletedSuccessfully"})})});a.when("mash","A").execute(function(b,c){c.declarative("ssf-share-icon","click",function(){b.dispatchEvent({type:"axf:consultAFriend:shareButtonTapped"})})})}
function A(){a.when("mash","A").execute(function(b,c){var a=c.$(n),k=!1,q="",f=c.$("#dp-pr-top-scrollable"),h="",u="",x=".sponsored-products-detail-mobile",d=function(b){b=c.$("#newPitchPriceWrapper_feature_div, #unifiedPrice_feature_div, #buybox, #mobile_buybox_feature_div, #apex_mobile_feature_div, #apex_desktop, #almBuyBox_feature_div");var a=c.$("#btf-sub-nav-tab");0<b.length&&"visible"===document.visibilityState&&(a=0<a.length?a.height():0,c.$([document.documentElement,document.body]).animate({scrollTop:b.eq(0).offset().top-
a},200))},g=function(a){var d=c.$(n),e=c.$("#"+q),l=c.$("#dp-pr-top-scrollable"),m=!1,g=!0,f="";if(!(0>=e.length)){var y=document.getElementById(h),z=document.getElementById("buy-now-button"),v=c.$(u),r=c.$(x),p=0<r.length,t=0<v.length;if((0<d.length||0<l.length)&&0<e.length&&(m=p?r.eq(0):t?v:null,m?(f=m.attr("cel_widget_id")||m.attr("id"),e=m.offset().top,0<l.length?(d=l.scrollTop(),l.height(),e=e+0>d):(l=d.scrollTop(),d.height(),e=e+0>l),m=e):(0<l.length?(g=l.scrollTop(),l.height(),f=e.offset().top,
e=e.height(),g=f+e>g):(g=d.scrollTop(),d.height(),f=e.offset().top,e=e.height(),g=f+e>g),m=g,f=q,g=!1),k===m&&!a))return;k=m;e=a=!1;y&&(a=null!=y.offsetParent);z&&(e=null!=z.offsetParent);b.dispatchEvent({type:"appx:axf:buybox.availability",detail:{isBuyboxOnScreen:m,isCartButtonActive:a,isBuyNowButtonActive:e,isCustomAttribute:g,widgetID:f}})}};b&&(b.addEventListener("afx.mash.onclick.jumpToBuybox",d),b.addEventListener("appPause",function(c){b.removeEventListener("afx.mash.onclick.jumpToBuybox",
d)}),b.addEventListener("appResume",function(c){b.addEventListener("afx.mash.onclick.jumpToBuybox",d)}),q="buybox",h="add-to-cart-button",u='[cel_widget_id\x3d"p13n-mobile-sims-fbt_DPSims_0"]',x=".sponsored-products-detail-mobile",a.scroll(function(){g(!1)}),0<f.length&&f.scroll(function(){g(!1)}));c.on("dpx:add-to-cart:success",function(c){b.dispatchEvent({type:"appfirst:dpx:add-to-cart:success",detail:{}})});c.on("dpx:add-to-cart:error",function(c){b.dispatchEvent({type:"appfirst:dpx:add-to-cart:error",
detail:{}})})})}function B(){a.when("mash","A").execute(function(b,c){var a=c.$(n),f=!1,h=c.$("#dp-pr-top-scrollable"),r=function(b){b=c.$("#newPitchPriceWrapper_feature_div, #unifiedPrice_feature_div, #buybox, #mobile_buybox_feature_div, #apex_mobile_feature_div, #apex_desktop, #almBuyBox_feature_div");var a=c.$("#btf-sub-nav-tab");0<b.length&&"visible"===document.visibilityState&&(a=0<a.length?a.height():0,c.$([document.documentElement,document.body]).animate({scrollTop:b.eq(0).offset().top-a},
200))},p=function(a){var h=c.$(n),d=c.$("#buybox"),g=c.$("#dp-pr-top-scrollable"),l=!1,k=!0,e="";if(!(0>=d.length)){var p=document.getElementById("add-to-cart-button"),m=document.getElementById("buy-now-button"),q=c.$('[cel_widget_id\x3d"p13n-mobile-sims-fbt_DPSims_0"]'),r=c.$(".sponsored-products-detail-mobile"),u=c.$("#aw-udpv3-customer-reviews_feature_div"),t=0<r.length,v=0<q.length;if((0<h.length||0<g.length)&&0<d.length&&(e=0<u.length?u:t?r.eq(0):v?q:null,(l=e)?(e=l.attr("cel_widget_id")||l.attr("id"),
d=l.offset().top,0<g.length?(h=g.scrollTop(),g.height(),d=d+-20>h):(g=h.scrollTop(),h.height(),d=d+-20>g),l=d):(0<g.length?(k=g.scrollTop(),g.height(),e=d.offset().top,d=d.height(),k=e+d>k):(k=h.scrollTop(),h.height(),e=d.offset().top,d=d.height(),k=e+d>k),l=k,e="buybox",k=!1),f===l&&!a))return;f=l;d=a=!1;p&&(a=null!=p.offsetParent);m&&(d=null!=m.offsetParent);b.dispatchEvent({type:"appx:axf:buybox.availability",detail:{isBuyboxOnScreen:l,isCartButtonActive:a,isBuyNowButtonActive:d,isCustomAttribute:k,
widgetID:e}})}};b&&(b.addEventListener("afx.mash.onclick.jumpToBuybox",r),b.addEventListener("appPause",function(a){b.removeEventListener("afx.mash.onclick.jumpToBuybox",r)}),b.addEventListener("appResume",function(a){b.addEventListener("afx.mash.onclick.jumpToBuybox",r)}),a.scroll(function(){p(!1)}),0<h.length&&h.scroll(function(){p(!1)}));c.on("dpx:add-to-cart:success",function(a){b.dispatchEvent({type:"appfirst:dpx:add-to-cart:success",detail:{}})});c.on("dpx:add-to-cart:error",function(a){b.dispatchEvent({type:"appfirst:dpx:add-to-cart:error",
detail:{}})})})}a.when("ContextualActions").execute(function(a){f.on("axf:mashExtHandOffCtxIos",function(a){p();t();w();A();h("axf:mashExtHf:ctx:ios:end")});f.on("axf:mashExtHandOffCtxAndroid",function(a){p();t();w();B();h("axf:mashExtHf:ctx:android:end")})});return{}})});