images-eu.ssl-images-amazon.com
Open in
urlscan Pro
2a04:4e42::272
Public Scan
Submitted URL: http://images-eu.ssl-images-amazon.com/images/S/apesafeframe/ape/sf/desktop/DAsf-1.50.4fabb038.js?csm_attribution=APE-SafeFrame
Effective URL: https://images-eu.ssl-images-amazon.com/images/S/apesafeframe/ape/sf/desktop/DAsf-1.50.4fabb038.js?csm_attribution=APE-SafeFrame
Submission Tags: falconsandbox
Submission: On December 03 via api from US — Scanned from DE
Effective URL: https://images-eu.ssl-images-amazon.com/images/S/apesafeframe/ape/sf/desktop/DAsf-1.50.4fabb038.js?csm_attribution=APE-SafeFrame
Submission Tags: falconsandbox
Submission: On December 03 via api from US — Scanned from DE
Form analysis
0 forms found in the DOMText Content
(()=>{var e=function(e){return e.replace(/_/g,":")},t=/(\/b|\/s|\/l).*(node=)(\d{1,12})/,n=new Map,a=function(){if(!n.has(window.location.href)){var e=t.exec(window.location.href),a=e&&e[3]?e[3]:null;n.set(window.location.href,a)}return n.get(window.location.href)},i=function(e){var t=a();if(!e||!t)return null;var n=e.split(":");return n.splice(n.length-1,0,t),n.join(":")},o=function(e){var t=a();return t?"".concat(e,":").concat(t):null},s={wb:"ues",bb:"uet",af:"uet",cf:"uet",be:"uet",ld:"uex"},r=function(t){var n,a,s=t.latencyEvent,r=t.scope,m=t.placement,p=t.timestamp;d(s)&&(l(s,c(r),m.id,p),l(s,c(r),e(m.name),p),l(s,c(r),null!==(n=i(m.name))&&void 0!==n?n:void 0,p),l(s,c(r),null!==(a=o(m.id))&&void 0!==a?a:void 0,p))},d=function(e){return"function"==typeof window[s[e]]},l=function(e,t,n,a){void 0===a&&(a=new Date);var i=s[e];n&&"function"==typeof window[i]&&window[i](e,t+n,{wb:1},a)},c=function(e){return"adplacements:"+m(e)},m=function(e){return e?"".concat(e,":"):""},p=function(e){console.debug(e)},h=function(e,t){console.error(e,JSON.stringify(t)),u("ERROR",e,w(e,t))},u=function(e,t,n){var a;null===(a=window.ueLogError)||void 0===a||a.call(window,n,{logLevel:e,attribution:"APE-safeframe",message:t+" | "})},w=function(e,t){return t instanceof Error?t:t?new Error(t):new Error(e)},v=function(e,t,n){if(window.csa)try{window.csa("Content",{element:e})("mark",t,null==n?void 0:n.getTime())}catch(a){h("Error with 'mark' CSA",a)}};class f{sendLatencyMetric({latencyMetricType:e,placementId:t,placementName:n,placementDivId:a,timestamp:i}){r({latencyEvent:e.csmKey,scope:e.csmMessage,placement:{id:t,name:n},timestamp:i}),v(document.getElementById(a),e.csaKey,i)}}const g=()=>new f;var y=function(e,t,n){if(""===t)throw new Error("Invalid queryParamKey input to addJSONQueryParamToURL: "+JSON.stringify({queryParamKey:t}));var a=new URL(e),i=a.searchParams.get(t),o=i||"{}",s=JSON.parse(o),r=Object.assign(s,n);return a.searchParams.set(t,JSON.stringify(r)),a.toString()};function b(e,t,n){var a,i=n||{},o=i.noTrailing,s=void 0!==o&&o,r=i.noLeading,d=void 0!==r&&r,l=i.debounceMode,c=void 0===l?void 0:l,m=!1,p=0;function h(){a&&clearTimeout(a)}function u(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var r=this,l=Date.now()-p;function u(){p=Date.now(),t.apply(r,i)}function w(){a=void 0}m||(d||!c||a||u(),h(),void 0===c&&l>e?d?(p=Date.now(),s||(a=setTimeout(c?w:u,e))):u():!0!==s&&(a=setTimeout(c?w:u,void 0===c?e-l:e)))}return u.cancel=function(e){var t=(e||{}).upcomingOnly,n=void 0!==t&&t;h(),m=!n},u}const I="com.amazon.ads.cpp.",S=(e,t)=>`${I}${e}.${t}`;class M{*[Symbol.iterator](){for(let e=0;e<localStorage.length;e++){const t=localStorage.key(e);if(null==t?void 0:t.startsWith(I)){const n=localStorage.getItem(t);if(localStorage.removeItem(t),e=-1,null===n)continue;yield[t,n]}}}}const E=(e,t,n)=>{localStorage.setItem(S(e,t),n)},k=(e,t,n)=>(...a)=>{try{e(...a)}catch(i){null==t||t(n||"Error in handler",i)}},A=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$/,T=e=>A.test(e),x=e=>T(e)?D(e):e,N=e=>T(e)?e:L(e),L=e=>btoa(unescape(encodeURIComponent(e))),D=e=>decodeURIComponent(escape(atob(e))),C=e=>e&&0===Object.keys(e).length&&e.constructor===Object;var _=function(t,n,a){var s,r,d,l,c,m;if(void 0===a&&(a=1),!F())return window.safeframe=null!==(s=window.safeframe)&&void 0!==s?s:{},window.safeframe.csmCache=null!==(r=window.safeframe.csmCache)&&void 0!==r?r:{},window.safeframe.csmCache.incrementCsmPlacementCounter=null!==(d=window.safeframe.csmCache.incrementCsmPlacementCounter)&&void 0!==d?d:[],void window.safeframe.csmCache.incrementCsmPlacementCounter.push({metric:t,placement:n,count:a});null===(m=null===(c=null===(l=window.safeframe)||void 0===l?void 0:l.csmCache)||void 0===c?void 0:c.incrementCsmPlacementCounter)||void 0===m||m.forEach((function(e){return _(e.metric,e.placement,e.count)}));var p=function(e,t,n){t&&R("".concat(B(e),":").concat(t),n)};p(t,n.id,a),p(t,o(n.id),a),p(t,e(n.name),a),p(t,i(e(n.name)),a)},z=function(e,t){var n,a,i,o,s,r;if(void 0===t&&(t=1),!F())return window.safeframe=null!==(n=window.safeframe)&&void 0!==n?n:{},window.safeframe.csmCache=null!==(a=window.safeframe.csmCache)&&void 0!==a?a:{},window.safeframe.csmCache.incrementCsmCounter=null!==(i=window.safeframe.csmCache.incrementCsmCounter)&&void 0!==i?i:[],void window.safeframe.csmCache.incrementCsmCounter.push({metric:e,count:t});null===(r=null===(s=null===(o=window.safeframe)||void 0===o?void 0:o.csmCache)||void 0===s?void 0:s.incrementCsmCounter)||void 0===r||r.forEach((function(e){return z(e.metric,e.count)})),R(B(e),t)},F=function(){var e;return"function"==typeof(null===(e=null===window||void 0===window?void 0:window.ue)||void 0===e?void 0:e.count)},R=function(e,t){var n;return null===(n=null===window||void 0===window?void 0:window.ue)||void 0===n?void 0:n.count(e,t)},H="adplacements",B=function(e){return e.startsWith(H)?e:"".concat(H,":").concat(e)};const $=(e,t)=>{const n=e,a=n[t].options;if(C(n))return z("getiframe:admap:empty"),null;if(C(a))return z("getiframe:addetails:empty"),null;n[t]&&!C(n[t])||z("getiframe:admap:adinfo:undefinedorempty");const i=`ape_${a.scope}_iframe`;var o,s;n[t].iframe?(null===(s=n[t])||void 0===s||null===(o=s.iframe)||void 0===o?void 0:o.innerHTML)?z("getiframe:admap:iframe:innerhtml:exist"):(z("getiframe:admap:iframe:innerhtml:undefined"),n[t].iframe=document.getElementById(i),document.getElementById(i)||z("getiframe:getElementById:undefined")):z("getiframe:admap:iframe:undefined");return n[t].iframe},W=[{p:50,t:2,def:"iab"}],O=[{p:0,t:0,def:"amzn"},{p:50,t:1,def:"iab"},{p:100,t:1,def:"groupm"}],U=[{p:0,t:0,def:"amzn"},{p:30,t:1,def:"iab"},{p:100,t:1,def:"groupm"}],q=()=>window.innerHeight||document.documentElement.clientHeight,V=()=>window.innerWidth||document.documentElement.clientWidth,J=e=>e.getBoundingClientRect().top-q(),Y=(e,t)=>({t:e.top,l:e.left,r:e.right,b:e.bottom,w:e.width,h:e.height,z:t}),j=e=>{const t=e.getBoundingClientRect();return Y(t,Number(window.getComputedStyle(e,null).zIndex))},K=e=>{const t=ee(e);return{t:e.t,l:e.l,r:e.r,b:e.b,w:e.w,h:e.h,z:e.z,xiv:t.xiv,yiv:t.yiv,iv:t.iv}},G=()=>{const e=window.screenY?window.screenY:window.screenTop,t=window.screenX?window.screenX:window.screenLeft,n=V(),a=q();return{t:e,l:t,w:n,h:a,b:e+a,r:t+n}},X=e=>{const t=G(),n=(e=>K(j(e)))(e),a=te(e);return{atf:Z(e),geom:{win:t,self:n,exp:a},payload:{wh:t.h,ww:t.w,sx:window.scrollX,sy:window.scrollY,ah:n.h,aw:n.w,top:n.t,left:n.l}}},Z=e=>{const t=function(e){const t=document.body.getBoundingClientRect();if(Q(t))return null;const n=j(e),a=q(),i=V(),o=Math.max(0,Math.min(t.left+i,n.r)-n.l),s=Math.max(0,Math.min(t.top+a,n.b)-n.t),r=o*s/(n.h*Math.min(n.w,i));return Number(Math.min(1,Math.max(0,r)).toFixed(2))}(e);return null==t?"unknown":t>=.5},Q=e=>0===e.width&&0===e.height;const ee=e=>{const t=V(),n=q(),a=Math.max(0,ie(e.t,e.b,n)),i=Math.max(0,ie(e.l,e.r,t)),o=a*i,s=e.h*Math.min(e.w,t);return 0!==s||0!==o?{xiv:Number(Math.min(1,i/e.w).toFixed(2)),yiv:Number(Math.min(1,a/e.h).toFixed(2)),iv:Number(Math.min(1,Math.max(0,o/s)).toFixed(2))}:{xiv:0,yiv:0,iv:0}},te=e=>{const t=e.getBoundingClientRect();return ne(t)},ne=e=>({t:e.top,l:e.left,r:V()-e.right,b:q()-e.bottom,xs:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth)>V()?1:0,yx:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)>q()?1:0}),ae=e=>ne(e),ie=(e,t,n)=>{let a=0;return"visible"!==document.visibilityState?a:(a=e>0?n-e:t>0?Math.min(t,n):0,Math.min(a,t-e))},oe=(e,t)=>{const n=j(e),a=j(t),i=V(),o=q();return n&&a&&(Math.abs(n.t-a.b)<o||Math.abs(n.b-a.t)<o)&&(Math.abs(n.l-a.r)<i||Math.abs(n.r-a.l)<i)},se=(e,t)=>{const n=parseInt(t.height)*parseInt(t.width)>=242500;return"V"===e?W:n?U:O},re=e=>{const t=de(e),n=G(),a=K(Y(t,NaN));return{atf:"unknown",geom:{win:n,self:a,exp:ae(t)},payload:{wh:n.h,ww:n.w,sx:window.scrollX,sy:window.scrollY,ah:a.h,aw:a.w,top:a.t,left:a.l}}},de=e=>{const t=e.initialBoundingRect,n=t.top-(window.scrollY-e.originalScrollY),a=n+e.adHeight,i=t.left-(window.scrollX-e.originalScrollX);return{top:n,bottom:a,left:i,right:i+e.adWidth,width:e.adWidth,height:e.adHeight}},le="btr_client",ce="cod_client",me="localstorage_impression",pe=(e,t)=>{const n=document.createElement("img");return n.id=e,n.style.display="none",n.setAttribute("pixel-url",t),n},he="localstorage:impression",ue=async(e,t)=>{let n,a;return new Promise((i=>{a=i,n=new IntersectionObserver((t=>{t.forEach((t=>{t.target===e&&t.isIntersecting&&(a(t),n.unobserve(e))}))}),t),n.observe(e)}))};function we(){try{const e=window.localStorage,t="__storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(e){return!1}}const ve="sfImpression",fe="LightAdImpression",ge="viewablelatency",ye=(e,t,n)=>({csaKey:e,csmKey:t,csmMessage:n}),be=ye("bodyBegin","bb",ve),Ie=(ye("bodyBegin","bb",fe),ye("bodyEnd","be"),ye("clickToATF","af"),ye("criticalFeature","cf"),ye("criticalFeature","cf",ve),ye("criticalFeature","cf",fe),ye("loaded","ld"),ye("loaded","ld",ve),ye("loaded","ld",fe),ye("viewablelatency:bodyBegin","bb",ge)),Se=ye("viewablelatency:loaded","ld",ge),Me=e=>null==e?void 0:e.replace("criticalFeature","").replace("windowOnLoad","").replace("spATFEvent","").replace("r2OnLoad","").replace("aboveTheFold","").replace("af",""),Ee=e=>{const t=Me(e);return""===t||"immediate"===t},ke=async(e,t)=>{e=Me(null!=e?e:"");const n="undefined"!=typeof P,a=/^reached(\d{1,5}px)FromTop$/g.exec(e);if(!Ee(e)){if(e.match("[^:]+:.+")){const t=e.split(":"),a=t[1],i=t.length>2?t[2]:a;if(n)return await new Promise((e=>P.when(i,"A").execute(e)));throw new Error("Need AUI or AmazonJQ installed")}return e.match(/^\d{1,4}px$/g)?await Te(parseInt(e,10),t,((e,t)=>{const n=J(e);return e&&n<=t})):a?await Te(parseInt(a[1],10),t,Ae):void h(`Unknown delay pattern ${e}`)}},Ae=(e,t)=>window.scrollY+q()>=t,Te=async(e,t,n)=>new Promise((a=>{const i=()=>{n(t,e)&&(a(),window.removeEventListener("scroll",o),window.removeEventListener("resize",o))},o=k(b(20,(()=>{i()})),h);window.addEventListener("scroll",o),window.addEventListener("resize",o),i()})),xe=(e,t,n,a,i,o)=>{const s=null==e?void 0:e[t];(null==s?void 0:s.valid)&&(s.loaded=!0,s.viewed&&(g().sendLatencyMetric({latencyMetricType:Se,placementId:a,placementName:n,placementDivId:i,timestamp:new Date(o)}),_("htmlviewed:loaded",{id:a,name:n})))},Ne=e=>{window.addEventListener("scroll",e),window.addEventListener("resize",e),document.addEventListener("visibilitychange",e)};var Pe=function(e){if(window.csa)try{window.csa("Events",{producerId:"adplacements"})("setEntity",{adCreativeMetaData:e})}catch(t){h("Error with 'setEntity' CSA",t)}},Le=function(e,t,n){if(void 0===n&&(n=1),window.csa)try{window.csa("Events",{producerId:"adplacements"})("log",{schemaId:"ApeSafeframe.csaEvent.1",metricName:e+":"+t.name+":"+t.id,metricValue:n},{ent:"all"})}catch(a){h("Error with 'logCsaEvent' CSA",a)}},De=function(e,t){if(void 0===t&&(t=1),window.csa)try{window.csa("Events",{producerId:"adplacements"})("log",{schemaId:"ApeSafeframe.csaEvent.1",metricName:e,metricValue:t},{ent:"all"})}catch(n){h("Error with 'incrementCounter' CSA",n)}};const Ce=async(e,t,n,a)=>{n.options.firePixelsAfter&&await ke(n.options.firePixelsAfter,n.placement),await $e(t.adMap,n.options.arid),e.sendMessageToAd(n.options.arid,"fireImpression",a),ze(e,t,n,a.isNoInventory)},_e=async(e,t,n,a)=>{n.options.firePixelsAfter&&await ke(n.options.firePixelsAfter,n.placement),await $e(t.adMap,n.options.arid),a.measurementMethod===le&&e.sendMessageToAd(n.options.arid,"fireImpression",{measurementMethod:le,isNoInventory:a.isNoInventory}),ze(e,t,n,a.isNoInventory)},ze=(e,t,n,a)=>{a?Be(e,t,n):He(e,t,n)},Fe=e=>{try{Ve(e,document.body),z(he,1),De(me)}catch(t){z("localstorage:error",1),De("localstorage_error")}},Re=async(e,t)=>{t.options.firePixelsAfter&&await ke(t.options.firePixelsAfter,t.placement),e.sendMessageToAd(t.options.arid,"fireImpression",{measurementMethod:ce,isNoInventory:!1})},He=(e,t,n)=>{We(e,t.adMap,n.options.arid);const a=t.ADS_HANDLERS[n.options.arid];a.viewabilityTracker=()=>{b(50,We)(e,t.adMap,n.options.arid)},Ne(a.viewabilityTracker);new IntersectionObserver((()=>{We(e,t.adMap,n.options.arid)}),{threshold:[0,.5,1]}).observe(n.placement)},Be=(e,t,n)=>{const a=Ue(t.adMap,n.options.arid);t.adMap[n.options.arid].noInventorySlotSnapshot=a,Oe(e,t.adMap,n.options.arid,a),e.sendMessageToAd(n.options.arid,"handleFallbackBehavior",{});const i=t.ADS_HANDLERS[n.options.arid];i.noInventoryViewabilityTracker=()=>{b(20,Oe)(e,t.adMap,n.options.arid,a)},Ne(i.noInventoryViewabilityTracker)},$e=async(e,t)=>{const n=$(e,t),a={root:document.documentElement};await ue(n,a)},We=(e,t,n)=>{const a=t[n].options,i=$(t,n),o=se(a.mediaType,a.size);if(i){const t=X(i);t.viewabilityStandards=o,e.sendMessageToAd(n,"updateViewability",t)}},Oe=(e,t,n,a)=>{const i=t[n].options,o=se(i.mediaType,i.size),s=re(a);s.viewabilityStandards=o,e.sendMessageToAd(n,"updateViewability",s)},Ue=(e,t)=>{const n=$(e,t);return{initialBoundingRect:(a=n).getBoundingClientRect(),adHeight:a.offsetHeight,adWidth:a.offsetWidth,originalScrollX:window.scrollX,originalScrollY:window.scrollY};var a},qe=()=>{if(we())for(const e of new M){const t=e[1];Fe(t)}},Ve=async(e,t)=>{const n=y(e,"pj",{measurementMethod:ce});try{await fetch(n,{keepalive:!0,mode:"no-cors",priority:"low"}),t.appendChild(pe("ape_impression",n)),z(he+"loaded"),De(me+"loaded")}catch(a){throw z(he+"error"),De(me+"error"),a}z("impressionFired")},Je=({height:e,width:t,targetWidth:n})=>0===t||isNaN(e)||isNaN(t)||isNaN(n)?0:Math.round(n*e/t),Ye=e=>!e||je(e)||Ke(e)?e:e+"px",je=e=>e.length>1&&"%"===e.charAt(e.length-1),Ke=e=>e.length>2&&"px"===e.substring(e.length-2),Ge=e=>je(e)?e:`${parseInt(e)}px`;class Xe{constructor(e,t){this.weblabsWindow=e,this.prefix=t,this.isT1=()=>"t1"===this.weblabTreatment(),this.isT2=()=>"t2"===this.weblabTreatment(),this.isT3=()=>"t3"===this.weblabTreatment(),this.isT4=()=>"t4"===this.weblabTreatment(),this.isT5=()=>"t5"===this.weblabTreatment(),this.weblabTreatment=()=>{var e,t,n;return null===(n=this.weblabsWindow)||void 0===n||null===(t=n.renderingWeblabs)||void 0===t||null===(e=t[this.prefix])||void 0===e?void 0:e.toLowerCase()}}}const Ze=()=>new Xe(window,"ADPT_SF_TRANSPARENCY_INFO_MANDATORY_FOR_EU_712921"),Qe=(e,t)=>{const n=new Set(["bf4ab3db-618a-4853-ae89-3ad3bd17df16","dd4c5e61-fe9a-4d91-9deb-25fa60557719","da326e4a-90bd-4da3-a526-53301eb2c6a0","ca609359-3cb9-4984-8830-231c22e978d3","15554fd8-4c3e-45c6-ae61-84c65966f5d1","1396c5b8-45a1-4618-9a09-0b84209807f9","d9fb239d-fcde-414f-98a8-409c81052388","b60ea84b-3e24-44dc-9fdb-35bb2fb1fe5c","75b4c7aa-4c22-49d3-8371-15ca116eaf1f","ef368293-2611-4cef-8050-4fcd9b97f12e","db5cbac6-5194-4b52-9929-9ec0bbfed990","6479c6f3-a9c2-4d7c-9d1a-45008113fe0c"]);new Xe(window,"A2I_HOMEPAGE_CARD_THEMING_360311").isT1()&&n.has(e)&&(t&&(t.style.background="linear-gradient(to right, #FFD07E, #EA7867)"),t&&(t.style.margin="0px"))},et="nav-ewc-persistent-hover",tt=()=>null!==document.querySelector(`.${et}`),nt=e=>"attributes"===e.type&&"class"===e.attributeName&&e.target.classList.contains(et),at=e=>{if(tt())return void it(e);new MutationObserver(((t,n)=>{if(t.some(nt))try{it(e),n.disconnect()}catch(a){h("Failed to resize ILM for EWC.",a)}})).observe(window.document.documentElement,{attributes:!0,attributeFilter:["class"]})},it=e=>{const t=document.querySelector("div#nav-flyout-ewc");if(null===e||null===t)return void h(`could not find placementDiv (value was: ${e}) or ewc (value was: ${t})`);const n=t.offsetWidth;ot(e,n)},ot=(e,t)=>{var n,a;const i=document.createElement("style");i.innerHTML=`@media screen and (min-width: 1500px) { div[id$=${e.id}] {\n width: calc(100vw - ${t+5}px) !important;\n margin-left: calc(-50vw + 50% + ${t/2}px) !important;\n margin-right: calc(-50vw + 50% + ${t/2}px) !important;\n `,null===(a=document)||void 0===a||null===(n=a.body)||void 0===n||n.appendChild(i)};class st{resize(e){var t;if(!this.isAllowedSize(e))return void h(`Size w:'${e.width}', h:'${e.height}' is not allow-listed for '${this.name}'`);const n=this.wrapperDiv,a=this.div,i=this.safeframe;null==n||n.removeAttribute("style"),n&&(n.style.overflow="hidden"),n&&(n.style.backgroundColor="white"),a.removeAttribute("style"),a.style.lineHeight="0",!n&&(a.style.marginBottom="20px"),a.style.marginLeft="auto",a.style.marginRight="auto",a.style.maxHeight="inherit",a.style.maxWidth=n?"min(100vh, 100vw)":"inherit",a.style.position="relative",i.style.height="100%",i.style.width="100%",i.removeAttribute("height"),i.removeAttribute("width"),i.style.removeProperty("min-width"),i.style.removeProperty("max-height"),i.style.removeProperty("padding-bottom"),null===(t=this.card)||void 0===t||t.style.setProperty("padding","0"),je(e.height)||je(e.width)?(a.style.height=Ge(e.height),a.style.width=Ge(e.width)):a.style.aspectRatio=`${parseInt(e.width)} / ${parseInt(e.height)}`,this.resizeHandleSpecialCases(e),Qe(this.id,this.wrapperDiv)}collapse(){this.wrapperDiv&&(this.wrapperDiv.style.display="none"),this.div.style.display="none"}resizeHandleSpecialCases(e){const t=this.div;if(lt(this.slotName,e))t.style.maxWidth=Ge(e.width);else if(dt(this.slotName)){var n;const e=this.wrapperDiv;null==e||e.style.setProperty("width","100vw"),null==e||e.style.setProperty("margin-left","calc(-50vw + 50%)"),t.style.removeProperty("aspect-ratio"),t.style.removeProperty("max-width"),t.style.height="50px",null===(n=t.closest(".a-container"))||void 0===n||n.style.setProperty("padding-top","0")}else if(rt(this.slotName)){t.style.removeProperty("aspect-ratio"),t.style.removeProperty("max-width"),t.style.height="55px",t.style.width="100vw",t.style.marginLeft="calc(-50vw + 50%)",tt()&&(t.style.width="100%",t.style.removeProperty("margin-left"));const e=document.createElement("style");e.innerHTML=`@media screen and (max-width: 1000px) {div[id$=${this.div.id}] { width: 100% !important; margin-left: 0 !important; }}`,this.div.prepend(e);const n=document.createElement("style");n.innerHTML=`#${t.id}_Feedback { margin-right: 10px; }`,t.prepend(n)}else"alm-morrisons-storefront-desktop-ad-1"!==this.slotName&&"alm-morrisons-storefront-desktop-ad-2"!==this.slotName&&"alm-monoprix-storefront-desktop-ad-1"!==this.slotName&&"alm-monoprix-storefront-desktop-ad-2"!==this.slotName&&"alm-dia-storefront-desktop-ad-1"!==this.slotName&&"alm-dia-storefront-desktop-ad-2"!==this.slotName&&"alm-storefront-desktop-ad-1"!==this.slotName&&"alm-storefront-desktop-ad-2"!==this.slotName&&"alm-wfm-storefront-desktop-ad-1"!==this.slotName&&"alm-wfm-storefront-desktop-ad-2"!==this.slotName||(this.div.style.maxWidth="300px",this.div.style.marginTop="47px",this.div.style.removeProperty("margin-left"),this.div.style.removeProperty("margin-right"))}get wrapperDiv(){return this.wrapperDivId?document.getElementById(this.wrapperDivId):null}get div(){return document.getElementById(this.divId)}get safeframe(){return document.getElementById(this.safeframeId)}get card(){return document.getElementById(`ape_${this.name}_aui_card`)}constructor(e,t,n,a,i,o,s){this.id=e,this.name=t,this.wrapperDivId=n,this.divId=a,this.safeframeId=i,this.slotName=o,this.allowedSizes=s,this.isAllowedSize=e=>this.allowedSizes.some((t=>Ge(e.height)===t.height&&Ge(e.width)===t.width))}}const rt=e=>"desktop-detail-ilm"===e||"fresh-desktop-detail-ilm"===e||"wfm-desktop-detail-ilm"===e||"vindp-desktop-atf-ilm"===e,dt=e=>"mobile-detail-ilm"===e||"mobile-app-detail-ilm"===e||"fresh-mobile-detail-ilm"===e||"fresh-mobile-detail-ilm-v1"===e||"wfm-mobile-detail-ilm-v1"===e,lt=(e,t)=>970===parseInt(t.width)||980===parseInt(t.width)||728===parseInt(t.width)||"merchandised-search-top-1"===e||"merchandised-search-7"===e||"gwm-atf-dashboard"===e,ct=e=>mt(e,[]),mt=(e,t)=>{var n;return new st(e.placementId,e.placementName,e.adUnitWrapperId,e.adUnitPlacementId,e.adUnitIframeId,e.slotName,(null!==(n=e.allowedSizes)&&void 0!==n?n:[]).concat({height:Ge(e.size.height),width:Ge(e.size.width)}).concat(t.map((e=>({height:Ge(e.height),width:Ge(e.width)})))))},pt="expanded-feedback-label",ht="expanded-safeframe",ut="expandable-ads-styles",wt=(e,t,n)=>{const a=St(t,ct(e.options).div.offsetWidth),i={height:Ye(a),width:Ye(e.options.size.width)},o=mt(e.options,[i]);o.resize(i),It(e.options),gt(e.options),o.div.style.height=i.height,Mt(e,n,ft)},vt=(e,t,n)=>{const a=ct(e.options).div.offsetHeight;wt(e,t,n);const i=ct(e.options);i.div.style.zIndex="2",i.div.style.position="relative",i.div.parentElement&&i.div.parentElement.style.removeProperty("overflow"),i.div.parentElement&&(i.div.parentElement.style.height=a+"px")},ft=e=>{ct(e.options).resize(e.options.size),bt(e.options)},gt=e=>{const t=document.getElementById(e.adUnitIframeId),n=yt(t);if(null===n||null===t)throw new Error(`feedbackWrapper: ${n?"present":"missing"}, safeFrame: ${t?"present":"missing"}`);n.classList.add(pt),t.classList.add(ht)},yt=e=>{var t;let n=null==e?void 0:e.parentElement;return(null==n||null===(t=n.parentElement)||void 0===t?void 0:t.id.endsWith("_wrapper"))&&(n=n.parentElement),n.querySelector("div[id$=_Feedback]")},bt=e=>{const t=document.getElementById(e.adUnitIframeId),n=yt(t);null!==n&&null!==t&&(n.classList.remove(pt),t.classList.remove(ht))},It=e=>{(e=>{if(null!==document.querySelector(`#${ut}`))return;const t=document.createElement("style");t.id=ut,t.innerHTML=`\n div.${pt} {\n background-color: white;\n z-index: 2;\n margin-top: 0px !important;\n padding-top: 2px !important;\n }`,document.getElementById(e.adUnitPlacementId).appendChild(t)})(e)},St=(e,t)=>(e.staticHeight?parseInt(e.staticHeight,10):0)+(je(e.width)?parseInt(e.height,10):Je({height:parseInt(e.height,10),width:parseInt(e.width,10),targetWidth:t})),Mt=(e,t,n)=>{const a=a=>{Et(a,e,t),n(e)};window.addEventListener("scroll",a,{once:!0}),window.addEventListener("click",a,{once:!0}),window.addEventListener("swipe",a,{once:!0}),window.addEventListener("tap",a,{once:!0})},Et=(e,t,n)=>{n.sendMessageToAd(t.options.arid,"triggerEventInIframe",{eventType:e.type})},kt=e=>e+"_Feedback";class At{async addSponsoredLabelWithFeedbackLink(e,t){e.appendChildTo(this.parentHtmlId,this);const n=await t.getSponsoredLabelAndFeedbackLink(this.urlPathAndParameter);if(!(null==n?void 0:n.isOk()))throw new Error(`Result from the feedback service was not ok ${this.urlPathAndParameter}`);e.updateElement(this.getHtmlId(),n)}getHtmlId(){return kt(this.parentHtmlId)}isHidden(){return this.hidden}exists(e){return e.exists(this.getHtmlId())}constructor(e,t,n,a,i,o,s){this.parentHtmlId=e,this.feedbackStyle=t,this.labelText=n,this.labelStyle=a,this.position=i,this.urlPathAndParameter=o,this.hidden=s}}class Tt{open(e){e.clickChildLink(this)}getHtmlId(){return kt(this.parentHtmlId)}constructor(e){this.parentHtmlId=e}}class xt{async createSponsoredLabelWithFeedbackLink(e,t){if(!e.exists(this.feedbackHtmlPort)){t.request();try{await e.addSponsoredLabelWithFeedbackLink(this.feedbackHtmlPort,this.feedbackApiPort),t.success(),e.isHidden()||t.labelRenderedHost()}catch(n){throw t.error(),n}}}openModal(e){e.open(this.feedbackHtmlPort)}labelRendered(e){e.labelRenderedCreative()}removeSponsoredLabelAndFeedbackLink(e){try{var t;null===(t=document.getElementById(kt(e)))||void 0===t||t.remove()}catch(n){h("Unable to remove AdFeedback Div",n)}}logTransparencyInfoMissing(e){e.transparencyInfoMissing()}constructor(e,t){this.feedbackHtmlPort=e,this.feedbackApiPort=t}}const Nt=e=>new Ot(e),Pt="adfeedback_request",Lt="adfeedback_success",Dt="adfeedback_error",Ct="adfeedback_sponsoredlabelrendered_creative",_t="adfeedback_sponsoredlabelrendered_host",zt="adfeedback:request",Ft="adfeedback:success",Rt="adfeedback:error",Ht="adfeedback:sponsoredlabelrendered:creative",Bt="adfeedback:sponsoredlabelrendered:host",$t="adfeedback:sponsoredlabelrendered",Wt="adfeedback:transparencyinfo:missing";class Ot{request(){_(zt,this.placement),z(zt),Le(Pt,this.placement)}success(){_(Ft,this.placement),z(Ft),Le(Lt,this.placement)}error(){_(Rt,this.placement),Le(Dt,this.placement)}labelRenderedCreative(){_(Ht,this.placement),z($t),Le(Ct,this.placement)}labelRenderedHost(){_(Bt,this.placement),z($t),Le(_t,this.placement)}transparencyInfoMissing(){_(Wt,this.placement),z(Wt)}constructor(e){this.placement=e}}class Ut{isOk(){return"ok"===this.status}constructor(e,t,n){this.status=e,this.html=t,this.script=n}}class qt{async getSponsoredLabelAndFeedbackLink(e){const t=await fetch(this.windowRepo.origin()+e);if(t.ok){const e=await t.json();return new Ut(e.status,e.html,e.script)}throw Error("Could not fetch the feedback html/link/script/label")}constructor(e){this.windowRepo=e}}class Vt{appendChildTo(e,t){var n,a;function i(e,t){const n=document.createElement("div");return n.setAttribute("id",t.getHtmlId()),n.classList.add("ape-feedback"),n.style.position="relative",n.style.height="20px",n.style.textAlign=n.id.includes("hero-quick-promo_Desktop_placement_Feedback")?"left":"right",n.style.padding="0",n.style.marginTop="2px",n.style.display=t.feedbackStyle.display,e.endsWith("_wrapper")&&(!e.includes("-ilm")&&(n.style.maxWidth="min(100vh, 100vw)"),n.style.marginLeft="auto",n.style.marginRight="auto",n.style.padding="0 5px"),n.append(function(e){const t=document.createElement("div");return t.innerHTML=e.labelText,Jt(t,e.labelStyle),t}(t)),n}1===t.position?null===(n=document.getElementById(e))||void 0===n||n.prepend(i(e,t)):0===t.position&&(null===(a=document.getElementById(e))||void 0===a||a.append(i(e,t)))}updateElement(e,t){const n=document.getElementById(e);if(n){n.innerHTML=t.html,Yt(n,t);for(const e of n.children)"DIV"===e.tagName?e.removeAttribute("style"):"A"===e.tagName&&(e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("right"),e.style.removeProperty("display"))}}clickChildLink(e){const t=document.getElementById(e.getHtmlId());for(const a of(null==t?void 0:t.children)||[])if("A"===(n=a).tagName||"DIV"===n.tagName)return void a.click();var n}exists(e){return!!document.getElementById(e)}}const Jt=(e,t)=>{for(const n in t)e.style.setProperty(n,t[n])},Yt=(e,t)=>{jt(e).innerHTML=t.script},jt=e=>{const t=document.createElement("script");return e.prepend(t),t},Kt={code:"BE",hostname:"www.amazon.com.be",name:"Belgium"},Gt={code:"FR",hostname:"www.amazon.fr",name:"France"},Xt={code:"DE",hostname:"www.amazon.de",name:"Germany"},Zt={code:"IT",hostname:"www.amazon.it",name:"Italy"},Qt={code:"NL",hostname:"www.amazon.nl",name:"Netherlands"},en={code:"PL",hostname:"www.amazon.pl",name:"Poland"},tn={code:"ES",hostname:"www.amazon.es",name:"Spain"},nn={code:"SE",hostname:"www.amazon.se",name:"Sweden"},an=e=>location.hostname===e.hostname,on=e=>!(an(Kt)||an(Gt)||an(Xt)||an(Zt)||an(Qt)||an(en)||an(tn)||an(nn))||sn(e),sn=e=>{var t,n,a,i,o,s;const r=[];dn(null==e||null===(a=e.url)||void 0===a||null===(n=a.parameters)||void 0===n||null===(t=n.adPlacementMetaData)||void 0===t?void 0:t.slotName)&&r.push("DSA Error: slotName missing");const d=null==e||null===(s=e.url)||void 0===s||null===(o=s.parameters)||void 0===o||null===(i=o.adCreativeMetaData)||void 0===i?void 0:i.adCreativeDetails;(!d||d.length<=0)&&r.push("DSA Error: transparency info missing"),null==d||d.every((e=>rn(e,r)));for(const l of r)for(let e=0;e<ln();e++)h(l);return r.length<=0},rn=(e,t)=>{var n,a,i,o,s;e.version||t.push("DSA Error: version missing"),dn(e.advertiserIdNS)&&t.push("DSA Error: advertiserIdNS missing"),void 0!==(null===(n=e.selectionSignals)||void 0===n?void 0:n.context)&&null!==(null===(a=e.selectionSignals)||void 0===a?void 0:a.context)||t.push("DSA Error: selectionSignals.context missing"),void 0!==(null===(i=e.selectionSignals)||void 0===i?void 0:i.location)&&null!==(null===(o=e.selectionSignals)||void 0===o?void 0:o.location)||t.push("DSA Error: selectionSignals.location missing"),dn(null===(s=e.selectionSignals)||void 0===s?void 0:s.pastActivity)&&t.push("DSA Error: selectionSignals.pastActivity missing")},dn=e=>!e||e.length<=0,ln=()=>Ze().isT1()?2:Ze().isT2()?4:Ze().isT3()?8:Ze().isT4()?16:Ze().isT5()?32:1,cn=()=>new mn(new xt(new Vt,new qt({origin:()=>window.location.origin})));class mn{async addSponsoredLabel({parentHtmlId:e,placement:t,feedback:n}){return on(n)?(n.hidden&&(Object.assign(n.style,{display:"none"}),Object.assign(n.label.style,{display:"none"})),await this.feedbackService.createSponsoredLabelWithFeedbackLink(pn(e,n),Nt(t)),!0):(this.feedbackService.logTransparencyInfoMissing(Nt(t)),h("Transparency Information missing"),!1)}openModal(e){this.feedbackService.openModal(new Tt(e))}labelRendered({placement:e}){this.feedbackService.labelRendered(Nt(e))}removeSponsoredLabelAndFeedbackLink(e){this.feedbackService.removeSponsoredLabelAndFeedbackLink(e)}constructor(e){this.feedbackService=e}}const pn=(e,t)=>{const n=JSON.parse(JSON.stringify(t.url.parameters));return n.adPlacementMetaData.pageUrl=N(n.adPlacementMetaData.pageUrl),new At(e,t.style,t.label.text,t.label.style,"TOP"===t.position?1:0,(a=t.url.path,i=encodeURIComponent(JSON.stringify(n)),a+"?pl="+i),t.hidden);var a,i},hn=e=>{cn().labelRendered({placement:{id:e.options.placementId,name:e.options.placementName}})},un=e=>{cn().openModal(e.options.adPlacementMetaData.adElementId)},wn=e=>{cn().removeSponsoredLabelAndFeedbackLink(e.options.adPlacementMetaData.adElementId)},vn=async e=>cn().addSponsoredLabel(fn(e)),fn=e=>{const t=e.adPlacementMetaData,n=e.adFeedbackInfo;var a;return{parentHtmlId:null!==(a=e.adUnitWrapperId)&&void 0!==a?a:e.adUnitPlacementId,placement:{id:e.placementId,name:e.placementName},feedback:{position:n.adFeedbackOnTop?"TOP":"BOTTOM",hidden:!n.boolFeedback,style:e.feedbackDivStyle,url:{path:n.endPoint,parameters:{adPlacementMetaData:{adElementId:t.adElementId,pageType:t.pageType,pageUrl:N(t.pageUrl),slotName:t.slotName},adCreativeMetaData:e.adCreativeMetaData}},label:{text:x(n.sponsoredText),style:e.advertisementStyle}}}},gn="gw-video-orchestrator",yn=(e,t,n)=>{var a;null===(a=window.P)||void 0===a||a.when(gn).execute((a=>{try{a.subscribe(e,t,n)}catch(i){i instanceof Error?p(`gw-video-orchestrator error: ${i.message}`):p(`gw-video-orchestrator error: ${i}`)}}))},bn=e=>{var t;null===(t=window.P)||void 0===t||t.when(gn).execute((t=>{t.elect(e)}))};let In=null;function Sn(e,t,n){const a=t=>{n.sendCustomMessageToAd(e.options.arid,"videoAutoplayResponse",t)};var i;e.options.expParams&&e.options.expParams.noVideoAutoplay?a(!1):(i=e.options.pageType)&&"gateway"===i.toLowerCase()?yn(e.iframe,a,t):In===e.options.arid?a(!0):null===In&&function(e){const t=document.getElementsByTagName("video");for(let n=0;n<t.length;++n)if(!t[n].paused&&oe(e,t[n]))return!1;return!0}(e.iframe)?(In=e.options.arid,a(!0)):a(!1)}function Mn(){bn(),In=null}function En(e){var t;t=e.iframe,bn(t),In=e.options.arid}var kn=function(t,n,a){An()&&(Tn(xn(t,n.id,a)),Tn(xn(t,e(n.name),a)))},An=function(){var e;return"function"==typeof(null===(e=null===window||void 0===window?void 0:window.ue)||void 0===e?void 0:e.tag)},Tn=function(e){var t;return null===(t=null===window||void 0===window?void 0:window.ue)||void 0===t?void 0:t.tag(e)},xn=function(e,t,n){return"".concat(e,":").concat(t).concat(Nn(n))},Nn=function(e){return e?":".concat(e):""};const Pn="aUAZqFtiIp6VxqpW3coqZ2JdZnV3RN9S8yKMRIdJ",Ln=(e,t,n)=>{Dn(Cn(e,n,_n(t)))},Dn=e=>{new Xe(window,"ADPT_SF_METRICS_LOGGING_1100263").isT1()&&navigator.sendBeacon&&navigator.sendBeacon(`https://e5qq6zj76g.execute-api.us-east-1.amazonaws.com/metric?x-api-key=${Pn}`,JSON.stringify(e))},Cn=(e,t,n)=>({metricName:e,count:t,dimensions:n,xApiKey:Pn}),_n=e=>{var t,n;return{app:"SF",siteName:e.siteName,slotName:e.slotName,pageType:e.pageType,subPageType:e.subPageType,placementId:e.placementId,mediaType:e.mediaType,programId:null===(t=e.adCreativeMetaData)||void 0===t?void 0:t.adProgramId,creativeTemplateName:null===(n=e.adCreativeMetaData)||void 0===n?void 0:n.adCreativeTemplateName,deviceType:e.deviceType,userAgent:navigator.userAgent}};class zn{constructor(e,t){this.hms=e,this.hc=t,this.changeSize=(e,t)=>{Ln("resize:size:changeSize",e.options);ct(e.options).resize(t)},this.startPixelTracking=async(e,t)=>{await Ce(this.hms,this.hc,e,t)},this.startBTRPixelTracking=async(e,t)=>{await _e(this.hms,this.hc,e,t)},this.fireImpressionWithDelay=async e=>{await Re(this.hms,e)},this.logAPIInvocation=(e,t)=>{const n=`messenger:${t.apiName}`;z(n),_(n,{id:e.options.placementId,name:e.options.placementName})},this.logError=(e,t)=>{h(t.message+": "+e.options.placementName,t.error)},this.logFatal=(e,t)=>{var n,a;n=t.message+": "+e.options.placementName,a=t.error,console.error(n,JSON.stringify(a)),u("FATAL",n,w(n,a))},this.logCsaEvent=(e,t)=>{Le(t.metricName,{name:e.options.placementName,id:e.options.placementId})},this.addCsaEntity=(e,t)=>{Pe(t)},this.sendLatencyMetric=(e,t)=>Fn(e,t),this.customMessage=(e,t)=>{this.hms.customMessage(t.key,t.body,["openPsAdPopover","openATCModal","setPartner","sendMetrics","wrap"],e.options.placementName,e.options.placementId)},this.fireViewableLatencyMetrics=async(e,t)=>{xe(this.hc.viewableLatencyTrackers,e.options.arid,e.options.placementName,e.options.placementId,e.options.adUnitPlacementId,t.adLoadedTimestamp)},this.countMetric=(e,t)=>{t.isGlobal?z(t.metricMsg,t.value):_(t.metricMsg,{id:e.options.placementId,name:e.options.placementName},t.value)},this.addCsmTag=(e,t)=>{var n,a;t.isGlobal?(n=t.tag,a=t.msg,An()&&Tn(n+Nn(a))):kn(t.tag,{id:e.options.placementId,name:e.options.placementName},t.msg)},this.requestVideoAutoplay=async(e,t)=>{Sn(e,t,this.hms)},this.releaseVideoAutoplay=async()=>{Mn()},this.haveVideoAutoplayPermission=async e=>{En(e)},this.feedbackLabelRendered=e=>{hn(e)},this.feedbackOpenModal=e=>{un(e)},this.handleFallbackExperience=async e=>{wn(e)},this.expandAdSlot=(e,t)=>{wt(e,t,this.hms)},this.expandAdSlotWithOverlap=(e,t)=>{vt(e,t,this.hms)},this.resetSlotSize=e=>{ft(e)},this.triggerEventInIframe=(e,t)=>{this.hms.sendMessageToAd(e.options.arid,"triggerEventInIframe",{eventType:t.event.type})},this.registerCODFallback=(e,t)=>{we()&&E("SF",e.options.arid,t)},this.clearCODFallback=e=>{var t,n;we()&&(t="SF",n=e.options.arid,localStorage.removeItem(S(t,n)))},this.safeFrameReady=e=>{var t,n;null===(n=performance)||void 0===n||null===(t=n.mark)||void 0===t||t.call(n,`SafeFrame: safeFrameReady ${e.options.slotName}`),this.hms.sendMessageToAd(e.options.arid,"setupComputedAdDetails",{computed:{aPageStart:window.aPageStart,adStartTime:(new Date).getTime()}})}}}const Fn=(e,{latencyMetricType:t,timestamp:n})=>{g().sendLatencyMetric({latencyMetricType:t,placementName:e.options.placementName,placementId:e.options.placementId,placementDivId:e.options.adUnitPlacementId,timestamp:n})},Rn=e=>{const t=document.getElementById(e);void 0!==t&&t&&(t.style.display="none")};class Hn extends zn{constructor(e,t){super(e,t),this.collapseSlot=async e=>{var t,n;(Rn(this.hc.AD_IDS[e.options.arid].placementDivId),Rn(this.hc.AD_IDS[e.options.arid].auiCardDeckId),"nav-sitewide-msg"===e.options.slotName)&&(await ke("amznJQ.available:navbarJSLoaded",e.placement),"function"==typeof(null===(n=parent)||void 0===n||null===(t=n.navbar)||void 0===t?void 0:t.unHideSWM)&&parent.navbar.unHideSWM())}}}const Bn="adload:start",$n=(e,t,n)=>e>0?n>e:t>0,Wn=(e,t,n,a,i,o)=>{var s,r,d;const l=null===(d=document)||void 0===d||null===(r=d.getElementById)||void 0===r||null===(s=r.call(d,n))||void 0===s?void 0:s.getBoundingClientRect();if(l&&$n(l.top,l.bottom,q())&&$n(l.left,l.right,V())){if(g().sendLatencyMetric({latencyMetricType:Ie,placementId:i,placementName:a,placementDivId:n,timestamp:new Date}),e[o].loaded){g().sendLatencyMetric({latencyMetricType:Se,placementId:i,placementName:a,placementDivId:n,timestamp:new Date});const e={id:i,name:a};_("adplacements:htmlviewed:loaded:",e),_("adplacements:htmlviewed",e)}t.viewed=!0,c=t.tracker,window.removeEventListener("scroll",c),window.removeEventListener("resize",c),document.removeEventListener("visibilitychange",c)}var c},On=(e,t,n,a,i)=>{if(!e[i]){e[i]={valid:!1};try{const o=e[i];Wn(e,o,t,n,a,i);const s=k(b(20,(()=>{Wn(e,o,t,n,a,i)})),h);Ne(s),o.tracker=s,o.valid=!0}catch(o){throw h("Error initializing viewable latency instrumentation",o),o}}},Un=e=>{z("resize:size:request"),e.creative.size?e.creative.size.height===parseInt(e.size.height)&&e.creative.size.width===parseInt(e.size.width)||(z("resize:size:differ"),Ln("resize:size:differ",e)):(z("resize:size:missing"),Ln("resize:size:missing",e))};class qn{constructor(e,t,n,a){this.hc=e,this.hms=t,this.hmr=n,this.supportedCommands=a,this.initializeAdIds=e=>{var t,n;this.hc.AD_IDS[e.arid]=(t=e.placementName,n=e.scope,{slotId:t,wrapperDivId:`ape_${n}_wrapper`,placementDivId:`ape_${n}_placement`,iframeId:`ape_${n}_iframe`,textDivWrapperId:`ape_${n}_text-wrapper`,textDivId:`ape_${n}_text`,auiCardDeckId:`ape_${n}_aui_cardDeck`})},this.initializeAdMap=(e,t)=>{try{const n=document.getElementById(this.hc.AD_IDS[e.arid].placementDivId),a=this.hc.AD_IDS[e.arid].iframeId,i=document.getElementById(a);this.hc.adMap[e.arid]={placement:n,iframe:i,options:e,messagePort:t,hasTransferredMessagePort:!1}}catch(n){h(`Error creating safeFrame ${e.slotName}`,n)}},this.initAllSafeFrames=async()=>{var e,t;null===(t=performance)||void 0===t||null===(e=t.mark)||void 0===e||e.call(t,"SafeFrame: Start initAllSafeFrames"),this.getWindowSafeFrame()||(this.initWindowSafeFrame({registerCustomMessageListener:this.hms.registerCustomMessageListener,sendCustomMessage:this.hms.sendCustomMessage,secondPhaseLoadAd:this.secondPhaseLoadAd}),qe(),jn(this.getWindowSafeFrame()))},this.secondPhaseLoadAd=async(e,t,n,a,i)=>{var o,s;null===(s=performance)||void 0===s||null===(o=s.mark)||void 0===o||o.call(s,`SafeFrame: Start secondPhaseLoadAd ${t.adUnitPlacementId}`),this.initializeAdIds(t),this.initializeAdMap(t,n);const r=this.hc,d=this.hms,l=this.hc.adMap[e].options;r.ADS_HANDLERS[l.arid]=r.ADS_HANDLERS[l.arid]||{};const c=ct(l);c.resize(t.size),Un(t),Gn(c,t);const m=this.hc.AD_IDS[e];if(On(r.viewableLatencyTrackers,m.placementDivId,m.slotId,c.id,e),l.forcePunt)return kn("forcePunt",c),Pe({forcePunt:"true"}),void c.collapse();Jn(l),Kn(c,m.placementDivId,a,i),_("adload:delayloadcallback",c),Le("adload_delayload",c);try{var p;new Xe(window,"ADPT_SF_SERVER_SIDE_SPONSORED_LABEL_998980").isT1()&&(null===(p=window.feedbackLabelFunctions)||void 0===p||p[l.adUnitWrapperId||l.adUnitPlacementId]()),await vn(l)?(Vn(r,l,this.hmr),Yn(r,l,d)):c.collapse()}catch(h){throw c.collapse(),h}}}}const Vn=(e,t,n)=>{e.adMap[t.arid].messagePort.onmessage=n.receiveMessage},Jn=e=>{g().sendLatencyMetric({latencyMetricType:be,placementId:e.placementId,placementName:e.placementName,placementDivId:e.adUnitPlacementId}),_(Bn,{id:e.placementId,name:e.placementName}),z(Bn),Le("adload_start",{id:e.placementId,name:e.placementName})},Yn=(e,t,n)=>{var a;rt((a=t).slotName)&&at(document.getElementById(a.adUnitPlacementId))},jn=e=>{window.addEventListener("resize",(()=>{null==e||e.sendCustomMessage("resize",{height:window.innerHeight,width:window.innerWidth})}))},Kn=(e,t,n,a)=>{var i,o;n&&(r({latencyEvent:"wb",placement:e,timestamp:n}),r({latencyEvent:"bb",placement:e,timestamp:n}));const s=null===(o=document)||void 0===o||null===(i=o.getElementById)||void 0===i?void 0:i.call(o,t);a&&null!==s&&v(s,"bodyBegin",a)},Gn=(e,t)=>{try{_("coordinate:x",e,e.div.getBoundingClientRect().x),_("coordinate:y",e,e.div.getBoundingClientRect().y),Ln("coordinate:x",t,e.div.getBoundingClientRect().x),Ln("coordinate:y",t,e.div.getBoundingClientRect().y)}catch(n){return}},Xn="custommessage:notallowlisted";class Zn{constructor(e,t={}){this.adMap=e,this.msgListeners=t,this.sendMessageToAd=(e,t,n)=>{const a={command:t,data:n};this.adMap[e].messagePort.postMessage(a)},this.customMessage=(e,t,n,a,i)=>{const o=this.msgListeners;try{"undefined"!==n&&Array.isArray(n)&&(n.indexOf(e)>-1&&o[e]?(z(`custommessage:allowlisted:${e}`),o[e](t)):-1===n.indexOf(e)?(z(Xn),_(Xn,{id:i,name:a})):h("Unrecognized custom message key: "+e))}catch(s){h("Custom Message Error",s)}},this.registerCustomMessageListener=(e,t,n)=>{let a=!1;const i=this.msgListeners;try{if(!i[e]||"function"!=typeof i[e]||n)i[e]=t,a=!0;else{const t=new Error("Custom message listener already exists for key: "+e);h("Duplicate Key",t)}}catch(o){h("Error registering custom message listener",o)}return a},this.sendCustomMessage=(e,t)=>{const n=this.adMap,a={key:e,data:t};for(const i in n)this.sendMessageToAd(i,"customMessage",a)},this.sendCustomMessageToAd=(e,t,n)=>{const a={key:t,data:n};this.sendMessageToAd(e,"customMessage",a)}}}class Qn{constructor(e={},t={},n={},a={}){this.adMap=e,this.ADS_HANDLERS=t,this.AD_IDS=n,this.viewableLatencyTrackers=a}}class ea{constructor(e={},t){this.adMap=e,this.supportedCommands=t,this.receiveMessage=async e=>{const t=this.adMap,n=e.data,a=t[n.arid];try{const e=this.supportedCommands[n.command];e&&await e(a,n.data)}catch(i){const t="Problem with message: "+JSON.stringify(e.data);h(t,i)}}}}var ta,na;null===(na=performance)||void 0===na||null===(ta=na.mark)||void 0===ta||ta.call(na,"SafeFrame: SafeFrame: Starting DAsf");const aa=new Qn,ia=new Zn(null==aa?void 0:aa.adMap),oa=new class extends qn{constructor(e=new Qn,t=new Zn(e.adMap)){const n=new Hn(t,e);super(e,t,new ea(e.adMap,n),n),this.initWindowSafeFrame=e=>{window.DAsf=e},this.getWindowSafeFrame=()=>window.DAsf}}(aa,ia);k((()=>oa.initAllSafeFrames()),h,"Error initializing safeFrame")()})(); //# sourceMappingURL=DAsf-1.50.4fabb038.js.map