/*! * (c) Copyright Adnami ApS, all rights reserved. * * Version: 1.1.1 - 2025-06-17T13:36:31.739Z * * Rest of the license is available at: https://macro.adnami.io/macro/gen/adsm.macro.rmb.js.LICENSE.txt */ (()=>{var e={9:function(e,t,n){var i;e.exports=(i=n(21),function(e){var t=i,n=t.lib,r=n.WordArray,o=n.Hasher,a=t.algo,s=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),i=2;i<=n;i++)if(!(t%i))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var i=2,r=0;r<64;)t(i)&&(r<8&&(s[r]=n(e.pow(i,.5))),c[r]=n(e.pow(i,1/3)),r++),i++}();var d=[],l=a.SHA256=o.extend({_doReset:function(){this._hash=new r.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],l=n[5],u=n[6],h=n[7],f=0;f<64;f++){if(f<16)d[f]=0|e[t+f];else{var v=d[f-15],m=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,p=d[f-2],w=(p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10;d[f]=m+d[f-7]+w+d[f-16]}var g=i&r^i&o^r&o,b=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),y=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&u)+c[f]+d[f];h=u,u=l,l=s,s=a+y|0,a=o,o=r,r=i,i=y+(b+g)|0}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+u|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=e.floor(i/4294967296),n[15+(r+64>>>9<<4)]=i,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(l),t.HmacSHA256=o._createHmacHelper(l)}(Math),i.SHA256)},21:function(e,t,n){var i;e.exports=(i=i||function(e,t){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==n.g&&n.g.crypto&&(i=n.g.crypto),!i)try{i=n(477)}catch(e){}var r=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},s=a.lib={},c=s.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},d=s.WordArray=c.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,r=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[i+o>>>2]|=a<<24-(i+o)%4*8}else for(var s=0;s>>2]=n[s>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new d.init(n,t/2)}},h=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new d.init(n,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},v=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,i=this._data,r=i.words,o=i.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*c,o);if(c){for(var u=0;u{},956:function(e,t,n){var i;e.exports=(i=n(21),i.enc.Hex)}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e={},t={},i="ADSM_RMB_ADS_INIT";window.addEventListener("message",(function(n){var r,o,a;const s=!function(e){var t,n,i,r,o;const a=null==e?void 0:e.type,s=null==e?void 0:e.payload,c=null==e||null===(t=e.payload)||void 0===t?void 0:t.ad,d=a&&s&&c,l=null==e||null===(n=e.payload)||void 0===n?void 0:n.uuid,u=null==e||null===(i=e.payload)||void 0===i?void 0:i.id,h=/^[a-zA-Z0-9]+$/.test(null==e||null===(r=e.payload)||void 0===r?void 0:r.id),f=/^[a-zA-Z0-9-]+$/.test(null==e||null===(o=e.payload)||void 0===o?void 0:o.uuid),v=l&&u&&h&&f;return d&&v}(n.data),c=(null===(r=n.data)||void 0===r?void 0:r.type)===i&&(null===(o=n.data)||void 0===o||null===(o=o.payload)||void 0===o?void 0:o.id)&&t[n.data.payload.id]===(null===(a=n.data)||void 0===a||null===(a=a.payload)||void 0===a?void 0:a.uuid);if(s||c)return;const d=n.data.type,l=e[d];var u,h;if((null==(u=n.data)?void 0:u.type)===i&&(null==u||null===(h=u.payload)||void 0===h?void 0:h.ad)&&(t[u.payload.id]=u.payload.uuid),l)for(const e of l)e(n.data.payload,n.source)}),!1);const r=function(t,n){(e[t]=e[t]||[]).push(n)};const o={extend:function(e,t){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}};const a=class{constructor(e){this._changedCallback=e}set(e,t,n){return-1!==["renderMode","appName"].indexOf(t)&&(e[t]=n,this._changedCallback(t,n)),!0}get(e,t){return e[t]}};function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c=class{constructor(){s(this,"_onChangedCallbacks",{renderMode:[],appName:[]}),s(this,"_adnmProxyConfig",new a(this.changed.bind(this))),window.adnm=window.adnm||{},Proxy&&(window.adnm=new Proxy(window.adnm,this._adnmProxyConfig))}changed(e,t){const n=this._onChangedCallbacks[e];for(const e of n)e(t)}onChanged(e,t){const n=this._onChangedCallbacks[t];n&&n.push(e)}set(e,t){window.adnm[t]=e}get(e){return window.adnm[e]}},d={DEFAULT:"DEFAULT",IS_AUDIT:"IS_AUDIT",BANNER:"BANNER"};Object.freeze&&Object.freeze(d);const l=d;const u=class{constructor(){this._adnmObserver=new c}onChange(e){this._adnmObserver.onChanged((()=>{this._onAnyChange(e)}),"renderMode"),this._adnmObserver.onChanged((()=>{this._onAnyChange(e)}),"appName")}get(){const e=this._adnmObserver.get("renderMode"),t=this._adnmObserver.get("appName");if(this.dataIsValid(e,t))return t;throw Error("AppName cannot be retrieved. Verify appName or renderMode is defined and that they are strings.")}_onAnyChange(e){try{e(this.get())}catch(e){return}}dataIsValid(e,t){return!(!e||!t)&&("string"==typeof e&&"string"==typeof t)&&e===l.BANNER}};const h=function(e){const t=e||window;try{return t.top.document,!0}catch(e){return!1}},f=["acdn.adnxs-simple.com","ib.adnxs.com","ib.adnxs-simple.com","mediation.adnxs.com"],v=["googlesyndication.com","safeframe.googlesyndication.com","doubleclick.net",...f,"amazon-adsystem.com","connect.themediatrust.com","about:srcdoc","about:blank"];function m(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:v).some((t=>e.includes(t)))}const p=/^(https?:\/\/)?([\w-]+\.)+\w{2,}(\/.*)?$/i;function w(e){const t=p.test(e),n=function(e){try{return decodeURIComponent(e)}catch(e){return null}}(e);if(n){const e=p.test(n);return!t&&e}return!1}const g=/^(https?:\/\/)?(?:((?:xn--)?[a-z0-9-]{0,61}[a-z0-9]\.)*(?:xn--)?[a-z0-9-]{1,61}\.[a-z]{2,})$/;function b(e){return g.test(e)}const y=function(e){var t,n;let i=window.location.href.replace(window.location.search,"");const r=function(){try{return(new u).get()}catch(e){return""}}();if(r&&r.length>0)i=r;else if(h(window)&&null!==(t=window.top)&&void 0!==t&&null!==(t=t.location)&&void 0!==t&&t.href)i=window.top.location.href.replace(window.top.location.search,"");else if((null===(n=window.location.ancestorOrigins)||void 0===n?void 0:n.length)>0&&b(window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])){const e=window.location.ancestorOrigins;i=e[e.length-1]}else document.referrer&&b(document.referrer)&&(i=document.referrer);return e&&function(e){const t=p.test(e);return t||w(e)}(e)&&m(i)&&(i=function(e,t){t.includes("doubleclick.net")||t.includes("googlesyndication.com")?t=e.replace(/^[\d.]+/,""):w(e)?t=decodeURIComponent(e):m(t)&&(t=e);return t}(e,i)),-1!==i.indexOf("://")||(i="https://".concat(i)),encodeURIComponent(i)};const E=function(){try{var e;const t=null===(e=window.top)||void 0===e?void 0:e.document;return null!=t}catch(e){return!1}}();let _;E||function(){let e,t=window;const n={};for(;t;){try{if(t.frames.__tcfapiLocator){e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}_=function(t,i,r,o){if(e){const a=Math.random()+"",s={__tcfapiCall:{command:t,parameter:o,version:i,callId:a}};n[a]=r,e.postMessage(s,"*")}else r({msg:"CMP not found"},!1)},window.addEventListener("message",(function(e){let t={};try{t="string"==typeof e.data?JSON.parse(e.data):e.data}catch(e){}const i=t.__tcfapiReturn;i&&"function"==typeof n[i.callId]&&(n[i.callId](i.returnValue,i.success),n[i.callId]=null)}),!1)}();const I=function(e,t,n,i){var r,o;E&&null!==(r=window.top)&&void 0!==r&&r.__tcfapi?null===(o=window.top)||void 0===o||o.__tcfapi(e,t,n,i):_?_(e,t,n,i):n("Failed to retrieve consent",!1)};function C(e){const t=atob(e),n=t.length,i=new Uint8Array(new ArrayBuffer(n));for(let e=0;et.errorCode===e.errorCode&&t.errorMessage===e.errorMessage));var n,i;t?t.occurrence=(null!==(n=t.occurrence)&&void 0!==n?n:1)+1:(e.occurrence=null!==(i=e.occurrence)&&void 0!==i?i:1,o.errors.push(e))},logErrors:function(){if(o.errors&&o.errors.length>0){const e=JSON.stringify(o);navigator.sendBeacon("https://functions.adnami.io/api/debug",e),o.errors.length=0}}}},k=O;const T=["${GDPR}","${GDPR_CONSENT_612}","${ADDTL_CONSENT}","<%%GDPR_APPLIES%%>","<%%GDPR_CONSENT%%>","[sas_gdpr_applies]","[sas_gdpr_consent]","[sas_addtl_consent]"];function R(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(window.adsmtag=window.adsmtag||{}).rmb=window.adsmtag.rmb=window.adsmtag.rmb||{};const x=class{constructor(e,t,n){R(this,"placeholderName","default"),R(this,"adParameters",{click:"",uid:"",aid:"",gdpr:"",gdpr_c:"",addtl_c:"",cb:"",sid:"",sit:"",cs:""}),R(this,"tcfData",{tcfAccessible:!1,gdprApplies:"",tcString:"",addtlConsent:""}),R(this,"adLoaded",{}),this.frame=n,window.__adnamiAdsAPI&&window.__adnamiAdsAPIFactory?(this.adnamiAdsAPIFactory=window.__adnamiAdsAPIFactory,this.adnamiAdsApi=window.__adnamiAdsAPI):window.__adnamiAdsAPI?(this.adnamiAdsAPIFactory=void 0,this.adnamiAdsApi=window.__adnamiAdsAPI):this.adnamiAdsAPIFactory=e,this.adunit=t.frame,this.formatType=t.formatType,this.creativeCode=t.uuid,this.readAndStorePayload(t),this.frame.setAttribute("data-adnm-forward","")}loadAd(){this.createCallback(),this.validDataReceived(this.adParameters.gdpr,this.adParameters.gdpr_c)?this.executeCallback():I&&void 0!==I&&I("addEventListener",2,this.getGdprValuesAndExecuteCallback.bind(this),void 0)}readAndStorePayload(e){var t;const n=this.getCreativeSiteOrigin(null==e?void 0:e.sourceUrl);if(this.adParameters={click:encodeURIComponent(e.ad.click),uid:e.ad.uid||"",aid:e.ad.aid||"",gdpr:this.removePrefix(e.ad.gdpr)||"",gdpr_c:this.removePrefix(e.ad.gdpr_c)||"",addtl_c:this.removePrefix(e.ad.addtl_c)||"",cb:"adsmtag.rmb.callback_"+e.id,sid:e.id,sit:e.sit,cs:n},null!==(t=e.ad)&&void 0!==t&&t.custom)for(const t in e.ad.custom)this.adParameters[t]=e.ad.custom[t]}validatePlacement(e){var t;const n=null===(t=window.adsm)||void 0===t||null===(t=t.certifications)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.cert,i=null==n?void 0:n.allowedPlacements;if(void 0!==i){var r;const e=null!==(r=this.adunit)&&void 0!==r?r:this.frame;var o;if(!function(e,t){let n=0;for(const i of t){const t=document.querySelector(i);if(!t){n++;continue}let r=e.parentElement;for(;r&&"BODY"!==r.tagName;){if(r===t)return!0;r=r.parentElement}}return n===t.length}(e,i))return null===(o=this.adnamiAdsApi)||void 0===o||o.v1.tracker.trackEvent("incorrect_placement"),e.style.display="none",!1}return!0}validateFormatIsAllowed(e){var t,n;const i=window.adsm,r="boolean"==typeof(null==i?void 0:i.certificationUnknownFormatTypeAllowed),o="boolean"==typeof(null==i||null===(t=i.certifications)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.allowed),a="object"==typeof(null==i||null===(n=i.certifications)||void 0===n?void 0:n[e]);let s=!0;var c;(r&&!a&&(s=i.certificationUnknownFormatTypeAllowed),o&&(s=i.certifications[e].allowed),s)||(this.adunit&&(this.adunit.style.display="none"),null===(c=this.adnamiAdsApi)||void 0===c||c.v1.tracker.trackEvent("destroyed_format"));return s}validateSize(e){var t;const n=null===(t=window.adsm)||void 0===t||null===(t=t.certifications)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.cert,i=null==n?void 0:n.allowedSizes;var r;if(void 0!==i&&this.adunit){if(!function(e,t){var n,i;const r=parseInt(null!==(n=e.getAttribute("width"))&&void 0!==n?n:"0"),o=parseInt(null!==(i=e.getAttribute("height"))&&void 0!==i?i:"0"),a=e.getBoundingClientRect(),s=0!==r?r:a.width,c=0!==o?o:a.height;return t.some((e=>e.width===s&&e.height===c))}(this.adunit,i))return null===(r=this.adnamiAdsApi)||void 0===r||r.v1.tracker.trackEvent("incorrect_size"),this.adunit.style.display="none",!1}else if(void 0!==i){var o;null===(o=this.adnamiAdsApi)||void 0===o||o.v1.tracker.trackEvent("size_adunit_missing")}return!0}createAdnamiAdsAPI(e){null!=e&&e.creativeCode&&this.adnamiAdsAPIFactory&&this.adnamiAdsAPIFactory.setCreativeCode(e.creativeCode),!this.adnamiAdsApi&&this.adnamiAdsAPIFactory&&(this.adnamiAdsApi=this.adnamiAdsAPIFactory.create(this.placeholderName))}createCallback(){let e=!1;window.adsmtag.rmb["callback_"+this.adParameters.sid]=t=>{var n,i,r;if(e)return;e=!0,this.createAdnamiAdsAPI(t),"canvas"!==this.formatType&&"canvasmobile"!==this.formatType||!this.adnamiAdsApi||(this.adunit?this.adnamiAdsApi.v1.tracker.trackAdunitViewabilityElement(this.adunit):this.adnamiAdsApi.v1.tracker.trackError("adunit_iframe_not_found"));const o=null===(n=t.html.match(/getCert\("([^"]+)"\)/))||void 0===n?void 0:n[1];if(!this.validatePlacement(o))return;if(!this.validateSize(o))return;if(!this.validateFormatIsAllowed(o))return;this.enableAdsApi(this.frame);const a=!window.__adnamiAdsAPI;var s;"banner"===this.formatType&&a&&(null===(s=this.adnamiAdsApi)||void 0===s||null===(s=s.v1)||void 0===s||null===(s=s.tracker)||void 0===s||s.trackViewabilityElement(this.frame));const c=null!==(i=null===(r=this.frame.contentWindow)||void 0===r?void 0:r.document)&&void 0!==i?i:this.frame.contentDocument;null==c||c.open("text/html","replace"),null==c||c.write(t.html),null==c||c.close()}}validDataReceived(e,t){return 0===e||"0"===e||(1===e||"1"===e)&&this.isNotEmptyOrDefaultString(t)}isNotEmptyOrDefaultString(e){return"string"==typeof e&&e.length>0&&(t=e,!T.some((e=>t.includes(e))));var t}executeCallback(){const e=this.adParameters;if(void 0!==this.adLoaded[e.cb]&&!0===this.adLoaded[e.cb])return;this.adLoaded[e.cb]=!0,e.click=this.replaceConsentStringWithMacro(e.click);const t="".concat("https://directive.adnami.io","/adsm.rmb.").concat(this.creativeCode,"?"),n=[];for(const t in e)e.hasOwnProperty(t)&&n.push(t+"="+e[t]);this.appendScriptWithDirectiveSource(t,n)}appendScriptWithDirectiveSource(e,t){let n=this.createQueryString(t);const i=n.length>0;let r=!1;const o=()=>{r||(r=!0,n.length>7500&&(n=n.replace(this.adParameters.addtl_c,"")),this.loadScript(e+n))};if(window.Promise&&i){S.compress(n).catch((()=>{o()})).then((t=>{const i=t!==window.btoa("[object ReadableStream]");if(!i){const e=k();e.addError({errorCode:"Compressesion Failed",errorMessage:'CompressedQueryString is [object ReadableStream] with following query:"'+n+'"',_:Date.now()}),e.logErrors()}i&&"string"==typeof t&&t.length>0?this.loadScript(e+"cmp=1&req="+t,o):o()}))}else o()}loadScript(e,t){const n=document.createElement("script");n.type="text/javascript",t&&(n.onerror=()=>{t()}),n.src=e,window.document.body.appendChild(n)}createQueryString(e){return e.join(";")}replaceConsentStringWithMacro(e){return this.adParameters.gdpr_c&&0!==this.adParameters.gdpr_c.length?this.adParameters.click.split(this.adParameters.gdpr_c).join(encodeURIComponent("${GDPR_CONSENT_612}")):e}getGdprValuesAndExecuteCallback(e,t){t?(this.tcfData.tcfAccessible=!0,this.tcfData.gdprApplies=e.gdprApplies?1:0,this.tcfData.tcString=e.tcString,this.tcfData.addtlConsent=e.addtlConsent,this.prepareData(this.tcfData),this.executeCallback()):(this.prepareData(this.tcfData),this.executeCallback())}prepareData(e){this.adParameters.gdpr=e.gdprApplies||"",this.adParameters.gdpr_c=e.tcString||"",this.adParameters.addtl_c=e.addtlConsent||""}getCreativeSiteOrigin(e){try{const t=y(e);return encodeURIComponent(new URL(decodeURIComponent(t)).origin)}catch(t){return y(e)}}removePrefix(e){const t=["gdpr=","gdpr_consent=","addtl_consent="];for(const n of t)"string"==typeof e&&(e=e.replace(n,""));return e}enableAdsApi(e){null!=e&&e.contentWindow&&(e.contentWindow.__adnamiAdsAPI=this.adnamiAdsApi,e.contentWindow.__adnamiAdsAPIFactory=this.adnamiAdsAPIFactory)}};const D=function(e){if(!e)return;return function(e){const t=e.bottom-e.height/20?-1*e:e}}(e.getBoundingClientRect())};var L=n(9),P=n.n(L),M=n(956),N=n.n(M);const j=function(e){return P()(e).toString(N())};function V(e,t){const n=j(e),i=n.slice(0,n.length/2);return-1!==t.indexOf(i)}const B=["11e5a9827f44bf3f4a2e1b3b458e99de","63f4ec1994ff446fe0ea0d07c6655c93","74a44220fabc78390bdc1bfaeb370f93","cec323288ea92c0d2fae3d85ecd87b37","950df697b1dffbf89e6b164916f3ed1d","f1caba9d2aaa4e067f21793df6ac5991","275bdeaf1abd58cc15cd264c66bd4cb7","769d11e0922bfe80870f0c120ce70eeb"];let W=function(e){return e.AUTO="AUTO",e.IMAGE="IMAGE",e.BEACON="BEACON",e}({});function U(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W.AUTO;if(t===W.AUTO)return void 0!==navigator.sendBeacon?U(e,W.BEACON):U(e,W.IMAGE);if(t===W.BEACON)navigator.sendBeacon(e);else{(new Image).src=e}}const F={videoimpression:"impression",videostart:"start",videofirstquartile:"firstQuartile",videomidpoint:"midpoint",videothirdquartile:"thirdQuartile",videocomplete:"complete"};function H(e){return["videoimpression","videostart","videofirstquartile","videomidpoint","videothirdquartile","videocomplete"].includes(e.toLowerCase())}const z=function(e,t){var n;const i=t,r=function(e){if(!e||0===e.length)return;let t={};return t=e.reduce(((e,t)=>{const n=F[t.type.toLowerCase()];return n&&(e[n]=t.src),e}),t),t}(null===(n=i.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.__adnamiAdsAPI)||void 0===n||null===(n=n.v1)||void 0===n?void 0:n.ThirdPartyTrackers);c(null==r?void 0:r.impression),function(e){try{e.hasAttribute("loop")&&e.removeAttribute("loop"),e.hasAttribute("autoplay")&&e.removeAttribute("autoplay")}catch(e){}}(i),function(){const e=function(){o.started&&o.timesLooped<1?(a(Ie.VIDEO_COMPLETE,.25*i.duration*1e3),o.timesLooped++,o.started=!1,c(null==r?void 0:r.complete)):o.started&&(a(Ie.VIDEO_COMPLETE,1e3*i.duration),o.timesLooped++,o.started=!1,c(null==r?void 0:r.complete))};i.addEventListener("ended",e),i.addEventListener("adnm_ended",e)}(),function(){const e=[!1,!1,!1];let t=!1;i.addEventListener("timeupdate",(function(){const n=.25*i.duration*1e3;i.duration>0&&!t&&(a(Ie.VIDEO_START),t=!0,c(null==r?void 0:r.start)),s(.25*i.duration)<=s(i.currentTime)&&!e[0]&&(a(Ie.VIDEO_FIRST_QUARTILE,n),e[0]=!0,c(null==r?void 0:r.firstQuartile)),s(.5*i.duration)<=s(i.currentTime)&&!e[1]&&(a(Ie.VIDEO_MIDPOINT,n),e[1]=!0,c(null==r?void 0:r.midpoint)),s(.75*i.duration)<=s(i.currentTime)&&!e[2]&&(a(Ie.VIDEO_THIRD_QUARTILE,n),e[2]=!0,c(null==r?void 0:r.thirdQuartile))}))}(),i.addEventListener("timeupdate",(function(){i.currentTime>0&&!o.started&&!i.paused&&(o.started=!0)}));const o={timesLooped:0,started:!1},a=e;function s(e){return Math.round(100*e)/100}function c(e){e&&U(e,W.IMAGE)}};function G(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class q{constructor(e,t){G(this,"isFinished",!1),G(this,"timeElapsed",0),G(this,"timeOffset",0),G(this,"nativeTimeout",null),this.callback=e,this.duration=t}resume(){this.isFinished||this.nativeTimeout||(this.timeOffset=window.performance.now(),this.nativeTimeout=setTimeout((()=>{this.isFinished=!0,this.callback()}),this.duration-this.timeElapsed))}pause(){!this.isFinished&&this.nativeTimeout&&(clearTimeout(this.nativeTimeout),this.nativeTimeout=null,this.timeElapsed=window.performance.now()-this.timeOffset)}}function X(e,t){const n=function(e){const t=e.getBoundingClientRect(),n={top:Math.max(t.top,0),left:Math.max(t.left,0),bottom:Math.min(t.bottom,window.innerHeight),right:Math.min(t.right,window.innerWidth)};return n.width=n.right-n.left,n.height=n.bottom-n.top,n}(e),i=Number(n.right-n.left),r=Number(n.bottom-n.top);if(isNaN(i)||isNaN(r)||i<=0||r<=0)return 0;const o=Number(i/t);let a=0;for(let t=0;t0?Math.min(t+10,100):0}(a/(i*r))}function Q(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Y{constructor(e,t){var n;Q(this,"isTargetInView",!1),Q(this,"isDocumentVisible",!1),this.visibilityChangeCallbackBound=this.visibilityChangeCallback.bind(this),this.callback=e,this.intersectionObserver=new IntersectionObserver(this.intersectionObserverCallback.bind(this),{threshold:null!==(n=null==t?void 0:t.threshold)&&void 0!==n?n:0}),this.viewedOneSecondTimeout=new q((()=>{let e=0;null!=t&&t.visibleRatioDetection&&(e=X(this.observedElement,10)),this.callback($.VIEWED_SECOND,{visibleRatio:e})}),1e3)}observe(e){if(this.observedElement)throw new Error("ViewabilityObserver instance is already observing");this.observedElement=e,this.intersectionObserver.observe(e),this.isDocumentVisible="visible"===document.visibilityState,window.document.addEventListener("visibilitychange",this.visibilityChangeCallbackBound)}disconnect(){this.observedElement&&(this.intersectionObserver.disconnect(),this.viewedOneSecondTimeout.pause(),window.document.removeEventListener("visibilitychange",this.visibilityChangeCallbackBound),this.observedElement=void 0)}intersectionObserverCallback(e){if(0===e.length||!this.observedElement)return;const t=e[0];t.isIntersecting&&!this.isTargetInView?(this.isTargetInView=!0,this.isDocumentVisible&&(this.viewedOneSecondTimeout.resume(),this.callback($.ENTER_SCROLL,{}))):!t.isIntersecting&&this.isTargetInView&&(this.isTargetInView=!1,this.isDocumentVisible&&(this.viewedOneSecondTimeout.pause(),this.callback($.EXIT_SCROLL,{})))}visibilityChangeCallback(){"visible"===document.visibilityState?(this.isDocumentVisible=!0,this.isTargetInView&&(this.viewedOneSecondTimeout.resume(),this.callback($.ENTER_FOCUS,{}))):"hidden"===document.visibilityState&&(this.isDocumentVisible=!1,this.isTargetInView&&(this.viewedOneSecondTimeout.pause(),this.callback($.EXIT_FOCUS,{})))}}let $=function(e){return e[e.VIEWED_SECOND=0]="VIEWED_SECOND",e[e.ENTER_SCROLL=1]="ENTER_SCROLL",e[e.EXIT_SCROLL=2]="EXIT_SCROLL",e[e.EXIT_FOCUS=3]="EXIT_FOCUS",e[e.ENTER_FOCUS=4]="ENTER_FOCUS",e}({});function J(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class K{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;J(this,"hasLeftView",!0),this.exposureChangeCallbackBound=this.exposureChangeCallback.bind(this),this.mraid=t,this.callback=e,this.threshold=100*n,this.viewedOneSecondTimeout=new q((()=>{this.callback($.VIEWED_SECOND,{})}),1e3)}observe(e){if(this.observedElement)throw new Error("ViewabilityObserver instance is already observing");this.observedElement=e,this.mraid.addEventListener("exposureChange",this.exposureChangeCallbackBound)}disconnect(){this.observedElement&&(this.mraid.removeEventListener("exposureChange",this.exposureChangeCallbackBound),this.viewedOneSecondTimeout.pause(),this.observedElement=void 0)}exposureChangeCallback(e){if(!this.observedElement||void 0===(null==e?void 0:e.exposedPercentage))return;const t=this.observedElement.isConnected&&e.exposedPercentage>=this.threshold;t&&this.hasLeftView?(this.viewedOneSecondTimeout.resume(),this.hasLeftView=!1,this.callback($.ENTER_SCROLL,{})):t||this.hasLeftView||(this.viewedOneSecondTimeout.pause(),this.hasLeftView=!0,this.callback($.EXIT_SCROLL,{}))}}let Z=function(e){return e.Banner="b",e.Canvas="c",e.CanvasMobile="cm",e}({}),ee=function(e){return e.Unknown="u",e.Small="s",e.Large="l",e}({}),te=function(e){return e.CLICK="click",e.SWIPE="swipe_legacy",e}({});function ne(){var e,t;const n=navigator.userAgent;return n&&/android|blackberry|iphone|ipad|ipod|opera mini|palm|windows (phone|ce)|iemobile|mobile|tablet/i.test(n.toLowerCase())?"Mobile":n&&""!==n?"Desktop":(null===(e=window.screen)||void 0===e?void 0:e.width)<1024?"Mobile":(null===(t=window.screen)||void 0===t?void 0:t.width)>=1024?"Desktop":"Unknown"}function ie(){return navigator.maxTouchPoints>0}function re(e,t,n){var i;const r=t===ee.Small||n?.5:.3;return!n&&null!==(i=window.screen)&&void 0!==i&&i.height&&e>window.screen.height?r*window.screen.height/e:r}function oe(e,t){const n=ne(),i=e*t;return 0===i?ee.Large:"Desktop"===n?i>=242500?ee.Large:ee.Small:"Mobile"===n?i>=153600?ee.Large:ee.Small:ee.Unknown}function ae(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const se=class{constructor(){ae(this,"executeOnSet",{}),ae(this,"stateCallbacks",{}),ae(this,"stateInfo",{})}executeCallbacks(e){for(const t of this.stateCallbacks[String(e)])t(this.stateInfo[String(e)])}updateStateInfo(e,t){!!this.stateInfo[t]&&this.executeOnSet[t]||(this.stateInfo[t]=e)}removeCallback(e,t){-1!==this.stateCallbacks[String(e)].indexOf(t)&&this.stateCallbacks[String(e)].splice(this.stateCallbacks[String(e)].indexOf(t),1)}onSet(e,t){this.stateCallbacks[String(e)]=this.stateCallbacks[String(e)]||[],this.stateCallbacks[String(e)].push(t),!0===this.executeOnSet[String(e)]&&t(this.stateInfo[String(e)])}set(e,t,n){void 0!==n&&this.updateStateInfo(n,String(e)),this.stateCallbacks[String(e)]=this.stateCallbacks[String(e)]||[],this.executeOnSet[String(e)]=!t,this.executeCallbacks(e)}};const ce=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;return new Promise(((r,o)=>{let a=0;const s=e();null!=s?r(s):t=setInterval((()=>{const s=e();null!=s?(clearInterval(t),r(s)):a>=n&&(clearInterval(t),o(new Error("[WaitFor.ts] That did not return a defined value within '".concat(n*i,"' ms")))),a++}),i)}))};function de(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const le=class{constructor(e){de(this,"mraidEventHandler",new se),de(this,"mraid",window.mraid||window.frameElement&&window.parent.mraid),this.enableMRAID(),e&&(this.mraidUnavailableFallback=e)}enableMRAID(){const e=document.createElement("script");e.src="mraid.js",document.head.appendChild(e),ce((()=>window.mraid||window.frameElement&&window.parent.mraid)).then((e=>{this.mraid=e;"loading"===e.getState()?this.addMraidEventListeners("ready",this.onMRAIDReady.bind(this)):this.onMRAIDReady()})).catch((()=>{this.mraidUnavailableFallback&&this.mraidUnavailableFallback()}))}onMRAIDReady(){this.mraidEventHandler.set("ready",!1),this.addMraidEventListeners("viewableChange",(e=>{this.mraidEventHandler.set("viewableChange",!0,e)})),this.mraidEventHandler.set("viewableChange",!0,this.mraid.isViewable()),this.addMraidEventListeners("exposureChange",((e,t,n)=>{this.mraidEventHandler.set("exposureChange",!0,{exposedPercentage:e,visibleRectangle:t,occlusionRectangle:n})}))}addMraidEventListeners(e,t){this.mraid.addEventListener(e,t)}addEventListener(e,t){this.mraidEventHandler.onSet(e,t)}removeEventListener(e,t){this.mraidEventHandler.removeCallback(e,t)}static isMraidAvailable(e){var t;const n=window.location.href,i=!0===(null===(t=window.MRAID_ENV)||void 0===t?void 0:t.adnmTest),r=-1!==n.indexOf("adx.g.doubleclick.net"),o=-1!==n.indexOf("mraid")&&-1!==n.indexOf("doubleclick.net"),a=-1!==e.indexOf("adsenseformobileapps.com"),s=m(n,f)&&(-1!==e.indexOf("play.google.com")||-1!==e.indexOf("apps.apple.com")),c="object"==typeof window.MRAID_ENV;return s||a||o||r||c||i}},ue="utif_";const he=function(e){var t;if(e.id.includes("google_ads_iframe")){const t=function(e){const t=e.id,n=t.split("/");return n[n.length-1]}(e);return t}if(null===(t=e.parentElement)||void 0===t||null===(t=t.id)||void 0===t?void 0:t.includes(ue)){const t=function(e){const t=e.parentElement,n=t.id,i=n.indexOf(ue);return n.substring(i+5,n.length)}(e);return t}return"unknown"};function fe(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ve{constructor(e,t){fe(this,"counter",0),fe(this,"mraidNeverInitialized",!1),fe(this,"parseFormatType",(e=>"string"!=typeof e?null:{canvasmobile:"cm",canvas:"c",banner:"b"}[e]||null)),this.track=e,this.apiConfig=t}formatViewability(e){var t,n;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!e)return;e.classList.add("adnm-generic-"+this.counter),this.counter++;const o=e.getBoundingClientRect(),a=oe(o.width,o.height),s=re(o.height,a,i);if(le.isMraidAvailable(null!==(t=null===(n=this.apiConfig)||void 0===n?void 0:n.sourceUrl)&&void 0!==t?t:"")&&!this.mraidNeverInitialized){const t=()=>{this.track(Ie.ERROR_MRAID_MISSING),this.mraidNeverInitialized=!0,this.formatViewability(e,i,r)};new K(this.getFormatViewabilityObserverCallback(e,r,a,!0),new le(t),s).observe(e)}else if(i){this.trackAdunitId(e);new Y(this.getAdunitViewabilityObserverCallback(e),{threshold:s}).observe(e)}else{new Y(this.getFormatViewabilityObserverCallback(e,r,a),{threshold:s,visibleRatioDetection:!0}).observe(e)}}getAdunitViewabilityObserverCallback(e){return t=>{if(t===$.VIEWED_SECOND){const t=e.getBoundingClientRect();t.width*t.height>900?this.track(Ie.ADUNIT_IMP_VIEWED):this.track(Ie.ERROR_ADUNIT_SIZE)}}}getFormatViewabilityObserverCallback(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(r,o)=>{if(r===$.ENTER_SCROLL)this.track("wrapper_inview");else if(r===$.EXIT_SCROLL)this.track("wrapper_leave_view");else if(r===$.ENTER_FOCUS)this.track("wrapper_page_inview");else if(r===$.EXIT_FOCUS)this.track("wrapper_page_leave_view");else if(r===$.VIEWED_SECOND){var a,s,c,d,l,u;const r=e.getBoundingClientRect(),f=i?window.innerWidth:r.width,v=i?window.innerHeight:r.height;this.track("wrapper_imp_viewed",{size:n,device:this.parseFormatType(t),adWidth:Math.round(Number(f)),adHeight:Math.round(Number(v)),windowWidth:Number(null!==(a=null===(s=window.screen)||void 0===s?void 0:s.width)&&void 0!==a?a:0),windowHeight:Number(null!==(c=null===(d=window.screen)||void 0===d?void 0:d.height)&&void 0!==c?c:0),visibleRatio:null!==(l=o.visibleRatio)&&void 0!==l?l:0,format:null===(u=this.apiConfig)||void 0===u?void 0:u.format});if(100*Math.random()>=99){var h;const e=k(this.apiConfig);e.addError({errorCode:"format_visibility_ratio",errorMessage:"F: ".concat(null===(h=this.apiConfig)||void 0===h?void 0:h.format,", V: ").concat(o.visibleRatio),_:Date.now()}),e.logErrors()}}}}trackAdunitId(e){const t=he(e);this.track(Ie.ADUNIT_ID,{adunitId:t})}}const me=function(e,t){const n=new ve(e,t);return{formatViewability:n.formatViewability.bind(n)}};const pe=function(e,t){const n=window===window.top;let i,r={isEmpty:!0},o=!1;function a(e,n){const o=function(e,t){if(window.adsmtag&&window.adsmtag.rmb){const n="function"==typeof window.adsmtag.rmb["callback_"+e],i=null!==document.body.querySelector('iframe[id$="'+e+'"]'),o=!r[t]||-1===r[t].sessionId.indexOf(e);return n&&i&&o}return!1}(n,void 0),a=function(e){return!(-1!==e.indexOf("midscroll")||-1!==e.indexOf("interscroll"))}(e);o&&a&&(r[e]=r[e]||{},r[e].sessions=r[e].sessions||[],r[e].sessions.push(n),r.isEmpty=!1,n===t&&(i=e))}n&&function(){const e=document.querySelector("html");for(let t=0;t1),o&&e(Ie.ERROR_DOUBLE_LOAD_API)};function we(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ge{constructor(e){we(this,"observedElements",[]),we(this,"observedIframes",[]),we(this,"SWIPE_PIXEL_THRESHOLD",25),we(this,"SWIPE_ANGLE_THRESHOLD",.577),we(this,"touchStartX",0),we(this,"touchStartY",0),we(this,"handleTouchStartBound",this.handleTouchStart.bind(this)),we(this,"handleTouchEndBound",this.handleTouchEnd.bind(this)),this.callback=e,this.clickListenerCallback=()=>this.callback(be.CLICK)}observe(e){var t;if(this.observedElements.some((t=>t.element===e)))return;const n={element:e,rescanCount:0};this.observedElements.push(n),e.addEventListener("click",this.clickListenerCallback,!0),this.addSwipeListener(e),this.observeElementIframes(n),null!==(t=this.iframeRescanInterval)&&void 0!==t||(this.iframeRescanInterval=setInterval((()=>this.rescanIntervalHandler()),500))}unobserve(e){const t=this.observedElements.findIndex((t=>t.element===e));if(-1===t)return;const[n]=this.observedElements.splice(t,1);e.removeEventListener("click",this.clickListenerCallback,!0),this.removeSwipeListener(e);const i=this.observedIframes.filter((e=>e.origin===n));for(const e of i){1===this.observedIframes.filter((t=>t.iframe==e.iframe)).length&&e.iframe.contentWindow&&(e.iframe.contentWindow.removeEventListener("click",this.clickListenerCallback,!0),this.removeSwipeListener(e.iframe.contentWindow));const t=this.observedIframes.indexOf(e);-1!==t&&this.observedIframes.splice(t,1)}}observeElementIframes(e){if(e.element instanceof HTMLIFrameElement)this.attachListenersToIframe(e.element,e);else{const t=e.element.querySelectorAll("iframe");for(const n of t)this.attachListenersToIframe(n,e)}}attachListenersToIframe(e,t){const n=()=>{if(this.observedElements.some((e=>e===t))&&e.contentWindow&&e.contentDocument){e.contentWindow.removeEventListener("click",this.clickListenerCallback,!0),e.contentWindow.addEventListener("click",this.clickListenerCallback,!0),this.removeSwipeListener(e.contentWindow),this.addSwipeListener(e.contentWindow);this.observedIframes.some((n=>n.iframe===e&&n.origin===t))||this.observedIframes.push({iframe:e,origin:t});const n=e.contentWindow.document.querySelectorAll("iframe");for(const e of n)this.attachListenersToIframe(e,t)}};try{e.contentWindow?n():e.addEventListener("load",(()=>{n()}),!0)}catch(e){}}addSwipeListener(e){ie()&&(e.addEventListener("touchstart",this.handleTouchStartBound),e.addEventListener("touchend",this.handleTouchEndBound))}removeSwipeListener(e){ie()&&(e.removeEventListener("touchstart",this.handleTouchStartBound),e.removeEventListener("touchend",this.handleTouchEndBound))}handleTouchStart(e){this.touchStartX=e.touches[0].screenX,this.touchStartY=e.touches[0].screenY}handleTouchEnd(e){const t=e.changedTouches[0].screenX,n=e.changedTouches[0].screenY,i=t-this.touchStartX,r=n-this.touchStartY;this.detectHorizontalSwipe(i,r)}detectHorizontalSwipe(e,t){Math.abs(e)>this.SWIPE_PIXEL_THRESHOLD&&Math.abs(e)*this.SWIPE_ANGLE_THRESHOLD>Math.abs(t)&&this.callback(be.SWIPE)}clearRescanInterval(){this.iframeRescanInterval&&(clearInterval(this.iframeRescanInterval),this.iframeRescanInterval=void 0)}rescanIntervalHandler(){let e=0;for(const t of this.observedElements)t.rescanCount<4&&(t.rescanCount++,this.observeElementIframes(t),e++);0===e&&this.clearRescanInterval()}disconnect(){this.clearRescanInterval();for(const e of this.observedElements)this.unobserve(e.element);this.observedElements=[],this.observedIframes=[]}}let be=function(e){return e[e.CLICK=0]="CLICK",e[e.SWIPE=1]="SWIPE",e}({});function ye(e){switch(e){case be.CLICK:return te.CLICK;case be.SWIPE:return te.SWIPE;default:throw new Error("EngagementObserverEvent not mapped.")}}const Ee=class{constructor(e,t){this.sessionId=e,this.observer=new ge((e=>{t(ye(e))}))}enableOnElement(e){const t=null==e?void 0:e.ownerDocument.querySelectorAll('iframe[id$="'+this.sessionId+'"]');for(const e of t)this.observer.observe(e)}},_e=function(e,t,n,i,r){var o;const a=e.creativeCode,s=e.sessionId||A.id(),c=e.sessionTimeId||Date.now(),d=null!==(o=e.formatType)&&void 0!==o?o:"",l=me(I,e),f=new Ee(s,b);let v=y(e.sourceUrl);(new u).onChange((()=>{v=y(e.sourceUrl),b(Ie.RERENDERED)}));const m={pageLoadedTime:0,distanceToAd:void 0,tracked:!1},p=k(e);if(-1!==v.indexOf("example.com")){var w,g;const t=null!==(w=null===(g=window.document.head.querySelector("title"))||void 0===g?void 0:g.innerHTML)&&void 0!==w?w:"Title could not be retrieved";let n=document.body.innerHTML;n.length>1e3&&(n=n.slice(0,1e3));let i=document.head.innerHTML;i.length>1e3&&(i=i.slice(0,1e3));const r=window===window.top,o=window.location.ancestorOrigins.length;C("unexpected_site","Title: '".concat(t,"' | isWindowTop: '").concat(r,"' | Number of ancestor origins: '").concat(o,"'| Body: '").concat(n,"' | Head: '").concat(i,"' | URL: '").concat(window.location.href,"' | Source URL: '").concat(e.sourceUrl,"'"))}function b(e){I(e)}function E(e){b("error_"+e)}function _(e,t){I(e,{time:t})}function I(e,t){const n=function(e){return"https://functions.adnami.io/api/tracker"+"?ev=".concat(e)+"&cc=".concat(a)+"&cs=".concat(v)+"&_=".concat(Date.now())+"&sid=".concat(s)+"&sit=".concat(c)}(e)+"".concat(t?function(e){let{time:t,windowWidth:n,windowHeight:i,adWidth:r,adHeight:o,visibleRatio:a,distance:s,adunitId:c,device:d,size:l}=e;const u=t?"&t=".concat(t):"",h=n?"&ww=".concat(n):"",f=i?"&wh=".concat(i):"",v=r?"&aw=".concat(r):"",m=o?"&ah=".concat(o):"",p=a?"&vr=".concat(a):"",w=s?"&dist=".concat(s):"",g=c?"&aid=".concat(c):"",b=d?"&dev=".concat(d):"",y=l?"&sz=".concat(l):"";return u+h+f+v+m+p+w+g+b+y}(t):"");var i;i=n,navigator.sendBeacon?navigator.sendBeacon(i):(new window.Image).src=i,r&&function(e,t,n){const i=Date.now();"click"===t||t.startsWith("interaction")||"wrapper_inview"===t||"wrapper_page_inview"===t?e.trackEvent(t,i):"wrapper_leave_view"===t||"wrapper_page_leave_view"===t?e.trackEvent(t,i,n):"wrapper_imp_viewed"===t&&e.trackEvent(t,i,{size:null==n?void 0:n.size,device:null==n?void 0:n.device,width:Number(null==n?void 0:n.adWidth),height:Number(null==n?void 0:n.adHeight),windowWidth:Number(null==n?void 0:n.windowWidth),windowHeight:Number(null==n?void 0:n.windowHeight),visibleRatio:null==n?void 0:n.visibleRatio,format:null==n?void 0:n.format})}(r,e,t)}function C(e,t){p.addError({errorCode:e,errorMessage:t,_:Date.now()}),p.logErrors()}function S(){pe(E,s)}return e.sourceUrl&&(v.includes("doubleclick")||v.includes("r.inmobi.com")||v.includes("amazon-adsystem.com")||v.includes("googlesyndication")||v.includes("adnxs")||v.includes("themediatrust")||v.includes("googleusercontent")||v.includes("googleadservices")||v.includes("acdn.adnxs-simple.com"))&&C("source_macro","source:".concat(e.sourceUrl,", click:").concat(e.clickUrl)),i.isSubscribed("trackWithDetails")||i.subscribe("trackWithDetails",(e=>I(e))),i.isSubscribed("trackTime")||i.subscribe("trackTime",(e=>_(e.event,e.time))),{trackEvent:b,trackTimeEvent:_,trackViewabilityElement:function(t,i){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((null==i?void 0:i.length)>0&&!r)try{!function(e,t){for(const n of t)if(n.type&&n.src&&"iframe"===n.type){const t=document.createElement("iframe");t.src=n.src,t.style.zIndex="-1",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.visibility="hidden",t.style.opacity="0",t.style.display="block",t.style.position="absolute",e.appendChild(t)}else if(n.type&&n.src&&"script"===n.type){const t=document.createElement("script");t.type="text/javascript",t.src=n.src,e.appendChild(t)}else H(n.type)}(t,i)}catch(e){}r||l.formatViewability(t,!1,d),f.enableOnElement(t),m.distanceToAd=D(t),t&&(t.setAttribute("data-adnm-vt",""),t.setAttribute("data-adnm-cc",a),t.setAttribute("data-adnm-sid",s),e.format&&t.setAttribute("data-adnm-fid",e.format)),n.set("canvasMeasurable",{viewablityElement:t})},trackAdunitViewabilityElement:function(e){l.formatViewability(e,!0)},trackVideoElement:function(e){n.set("bannerVideoMeasurable",{videoElement:e}),z(_,e)},trackExit:function(){b(Ie.EXIT)},trackInit:function(){b(Ie.INIT)},trackError:E,trackLoaded:function(){b(Ie.LOADED),S(),h(window)&&function(e,t){0===e.indexOf("www")&&(e=e.slice(4));let n=V(e,t);if(n||(n=V("*.".concat(e),t)),!n){const i=e.split(".");i[0]="*",n=V(i.join("."),t)}return n}(function(e){const t=y(e);let n="";try{const e=decodeURIComponent(t);n=new URL(e).hostname}catch(e){}return n}(),B)&&function(){var e,t;const n=null===(e=window.top)||void 0===e||null===(e=e.performance)||void 0===e?void 0:e.now(),i=null===(t=window.top)||void 0===t||null===(t=t.performance)||void 0===t?void 0:t.getEntriesByType("navigation");if(!n||!i||0==(null==i?void 0:i.length))return;const r=i[0].domInteractive;if(!r)return;const o=Math.ceil(n-r);m.pageLoadedTime=o,document.addEventListener("visibilitychange",(()=>{var e,t,n;m.tracked||(m.tracked=!0,e=Ie.PAGE_LOAD_TIME,t=m.pageLoadedTime,n=m.distanceToAd,I(e,{time:t,distance:n}))}))}()},trackIfDoubleLoad:S,trackDebugMessage:C,sessionId:s}};let Ie=function(e){return e.PRE_IMP="pre_imp",e.INIT="init",e.EXIT="exit",e.CLICK="click",e.ENGAGEMENT_SWIPE="interaction_swipe",e.RERENDERED="rerendered",e.UPGRADED="upgraded",e.LOADED="loaded",e.PAGE_LOAD_TIME="page_load_time",e.DESTROYED_FORMAT="destroyed_format",e.BANNER_INJECTED="banner_injected",e.BANNER_LOADED="banner_loaded",e.WRAPPER_IMP_VIEWED="wrapper_imp_viewed",e.WRAPPER_INVIEW="wrapper_inview",e.WRAPPER_LEAVE_VIEW="wrapper_leave_view",e.WRAPPER_PAGE_INVIEW="wrapper_page_inview",e.WRAPPER_PAGE_LEAVE_VIEW="wrapper_page_leave_view",e.ADUNIT_ID="adunit_id",e.ADUNIT_IMP_VIEWED="adunit_imp_viewed",e.VIDEO_START="video_start",e.VIDEO_FIRST_QUARTILE="video_firstQuartile",e.VIDEO_MIDPOINT="video_midpoint",e.VIDEO_THIRD_QUARTILE="video_thirdQuartile",e.VIDEO_COMPLETE="video_complete",e.ERROR_PREFIX="error_",e.ERROR_ADUNIT_SIZE="error_adunit_size",e.ERROR_INVALID_API_CONFIG="invalidApiConfig",e.ERROR_DOUBLE_LOAD_API="double_load_api",e.ERROR_GET_CERT="getCert",e.ERROR_NO_SID_OR_SIT="error_no_sid_or_sit",e.ERROR_MRAID_MISSING="error_mraid_missing",e}({});const Ce=function(e,t,n){let i,r;(!n||"string"!=typeof n||parseInt(n)>100)&&(n="10%");let o=1,a=!1;const s=n,c=t;let d=e;function l(e){e?r=e:d.frameElement?r=function(){const e=d;let t,n=d;for(;n.parent!==window.top;)try{n.parent.document&&(n=n.parent)}catch(e){break}for(t=n.frameElement?n.frameElement:e.frameElement;n.frameElement&&t.parentNode!==window.top.document.body&&-1!==JSON.stringify(t.parentNode.classList).indexOf("adnm-");)t=t.parentNode;return t}():i.play()}function u(e){const t=1-parseInt(s)/100;let n,i,r;if(!e)return!1;n=e.offsetHeight,i=e.offsetWidth,r=e.getBoundingClientRect();const o=function(){try{return window.top.document,!0}catch(e){return!1}}();return Math.floor(r.top)>=-n*t&&Math.floor(r.bottom)<=((o?window.top.innerHeight:window.innerHeight)||window.top.document.documentElement.clientHeight)+n*t&&Math.floor(r.left)>=-i*t&&Math.floor(r.right)<=((o?window.top.innerWidth:window.innerWidth)||window.top.document.documentElement.clientWidth)+i*t}function h(){var e,t;null!==(e=i)&&void 0!==e&&e.play&&r&&o<5&&(u(r)?window.Promise&&(null===(t=i)||void 0===t||null===(t=t.play())||void 0===t||t.then().catch((function(e){a||(a=!0,c("video_unavailable"))}))):i.pause())}return{setup:function(e,t){let n=!1;if(function(e){i=e}(e),i){const e=i.ownerDocument||d.document,a=e.defaultView||e.parentWindow||d;a!==d&&(d=a),l(t),i.addEventListener("ended",(function(){o<5?(o++,i.play()):window.removeEventListener("scroll",h,!0)}));try{h()}catch(e){}!function(e,t,n,i){try{return e.addEventListener?e.addEventListener(t,n,i):!!e.attachEvent&&e.attachEvent("on"+t,n)}catch(e){}}(r.ownerDocument.defaultView,"scroll",h,!0),i.addEventListener("canplay",(function(){n||(h(),n=!0)}))}}}};const Se=function(e,t,n,i){let r,o;function a(t){i&&(!0===t[0].isIntersecting?e.call("playVideo",{videoElementId:r},i):e.call("pauseVideo",{videoElementId:r},i))}return o=!n||"string"!=typeof n||parseInt(n)>100?0:parseInt(n)/100,{setup:function(e,t){r=e;const n=t;if(n){new IntersectionObserver(a,{threshold:o}).observe(n)}}}};const Ae=function(e,t,n,i,r,o,a){const s=[],c=Ce;function d(e,t,i){(new le).addEventListener("viewableChange",(r=>{r?e?e.play():n.call("playVideo",{videoElementId:t},i):e?e.pause():n.call("pauseVideo",{videoElementId:t},i)})),e&&function(e,t){e.addEventListener("ended",(function(){t.currentLoops++,t.currentLoops<5&&e.play()}))}(e,{currentLoops:0})}return n.subscribe("videoController",((t,i)=>{t.banner===o&&function(t,i,o){if(a&&le.isMraidAvailable(a))d(null,t,o);else{const a=Se(n,e,i,o);r.onSet("canvasMeasurable",(e=>{if(e){const n=e.viewablityElement;a.setup(t,n),s.push(a)}}))}}(t.elementId,t.percentage,i)})),{playIfInview:function(n,i,r){if(a&&le.isMraidAvailable(a))d(n,"",null);else{const o=c(e,t,r);o.setup(n,i),s.push(o)}}}};const Oe=function(){let e=!1;const t={CUSTOM:1,BANNER_SCROLLED:2},n=new Map([[t.CUSTOM,"Custom event"],[t.BANNER_SCROLLED,"Banner scrolled event"]]);Object.freeze(t),Object.freeze(n);const i=new Map,r=new Map;function o(e){return!!Object.keys(t)&&Object.keys(t).filter((function(n){return t[n]===e})).length>0}function a(t,n){if(void 0===n&&(n=!1),e&&!n)throw"Could not remove listener, EventRelay is currently disconnecting all listeners.";if(!i.has(t))return;const o=i.get(t),a=r.get(o.eventType);a.has(t)&&a.delete(t),i.delete(t)}return{EventType:t,getEventTypeDescription:function(e){let i=null,r=Object.keys(t).filter((function(e){return isNaN(Number(e))})).sort((function(e,t){return e>t?1:e=0,a.isInView?i=a.scrollDistanceY/(a.bottom-a.top+o)*100:a.top>0?i=0:a.top<0&&(i=100),i},getScrolledPixed:function(t){return window.top.scrollY-(window.scrollY+t.getBoundingClientRect().top)+e()},isInView:function(e){let t,n,i;return!!e&&(t=e.offsetHeight,n=e.offsetWidth,i=e.getBoundingClientRect(),Math.floor(i.top)>=.9*-t&&Math.floor(i.bottom)<=(window.top.innerHeight||window.top.document.documentElement.clientHeight)+.9*t&&Math.floor(i.left)>=.9*-n&&Math.floor(i.right)<=(window.top.innerWidth||window.top.document.documentElement.clientWidth)+.9*n)}}},Te=function(e,t,n,i,r){const o=Oe(),a=ke();let s=new Map,c=!1,d=!1;const l=e;let u=window.top;const h=[];function f(e,t){if(t){const n=t;if(r&&-1===r.findIndex((e=>e.contentWindow===n)))return;-1!==h.findIndex((e=>e.context===n))||h.push({context:n,name:e.banner})}}function v(e,t){const r="object"==typeof e&&e.length>0&&void 0!==e[0].intersectionRect&&"number"==typeof e[0].intersectionRect.y;let s=0,c=a.isInView(t),d=0;if(r){e[0].boundingClientRect.y<0?(s=100,d=t.clientHeight):(s=0,d=0)}else(s=a.getScrollPercentage(t))>0&&s<100?(c=!0,d=a.getScrolledPixed(t)):(s=a.getScrollPercentage(t),d=a.getScrolledPixed(t));for(const e of h){const t={elementScrolledPercentage:s,elementScrolledPixels:d,isInView:c,pageScrolledPixels:window.top.scrollY,eventType:o.EventType.BANNER_SCROLLED,banner:n};e.context&&i.call("observeData",t,e.context)}o.raiseEvent(o.EventType.BANNER_SCROLLED,{elementScrolledPercentage:s,elementScrolledPixels:d,isInView:c,pageScrolledPixels:window.top.scrollY})}return function(e){false;i.subscribe("observeSubscribe",f);const t=function(t){!function(e,t){if(c)return;c=!0,v(e,t),setTimeout((function(){c=!1}),1)}(t,e)},n=document.querySelector("#adnm-iphone-screen");n&&"auto"===window.getComputedStyle(n).overflowY&&(u=n);u.addEventListener("scroll",t);let r=new IntersectionObserver((function(t){v(t,e)}));r.observe(e);const o=(new Date).getTime().toString();s.set(o,{observer:r,callback:t})}(l),{addListener:function(e){if(d)throw new Error("Could not add listener, scrollObserver is currently removing all listeners.");return o.addListener(o.EventType.BANNER_SCROLLED,e)},destroy:function(){d=!0,o.disconnectAll(),d=!1,i.unsubscribe("observeSubscribe",f),h.length=0}}},Re=["xbid-prod.googleusercontent.com/ddm/dbm/clicktracking/preview","googleusercontent.com/dv3c/clicktracking/preview","livepreview.adform.com","adspreview.google","preview.adnxs","creative-preview-an","creative-preview.mathads","gateway.app.nexta.io","adform.com/BannerTags/Views/Test","adform.com/line-items","advalidation.net","audit.adnxs.","easy-tag.appspot.com","preview-desk.thetradedesk.com","cr.adnxs.com","cq-reports.adnxs.net","ib.adnxs.com/cr?id","cmp.deltaprojects.com","sting.de17a.com","adsnap-prod.deltaprojects.net","adsnap-accept.deltaprojects.net","production.creative-serving.org","partner.googleadservices.com/gampad/ads","creative-preview.quantserve.com","adnun.net/adnami","creative.dpgdsp-adv-prod.dpgmedia.cloud/","creative.dev.dpgdsp-adv-nonprod.dpgmedia.cloud","creative.acceptance.dpgdsp-adv-nonprod.dpgmedia.cloud"];function xe(e,t){return e.indexOf(t)>-1}const De=function(){for(var e=Re,t=document.referrer,n=window.location.host,i=window.location.href,r=0;r{void 0!==l[e]&&l[e]!==l.DEFAULT&&t(e)}),"renderMode")},set:function(t){l[t]&&e.set(l[t],"renderMode")},get:function(){return e.get("renderMode")}}};const Pe=function(e,t){const n=e,i=t;const r=function(){const e=parseInt(n),t=parseInt(i);return 1===e&&1===t||1===e&&2===t||1800===e&&1e3===t}();return{width:n,height:i,isExpandableSize:r}},Me=function(e){const t=e,n=window===window.top,i=De(),r=h(void 0),o=Le();return function(){var e;const t=(null===(e=window.adnm)||void 0===e?void 0:e.renderMode)===l.BANNER;i?o.set(l.IS_AUDIT):t&&o.set(l.BANNER)}(),{isWindowTop:n,isAudit:i,windowTopAccessible:r,getWindowTop:function(){if(r)return window.top;if(o.get()===l.IS_AUDIT)return window;throw new Error("Window.top can only be accessed by a canvas format")},getTagDimensions:function(){return Pe(t.width,t.height)},getRenderMode:o.get,onRenderModeChanged:o.onChanged,renderModes:l}};const Ne=function(e,t){let n=0;return()=>{Date.now()>=n+t&&(e(),n=Date.now())}},je=function(e,t,n,i){const r=[],o={};window.addEventListener("scroll",Ne((()=>{for(const e in o)o[e]()}),200));let a=null;function s(n,i,o,a){const s=n.contentWindow;if(o)s.postMessage({event:"adnm-sandbox-init",data:{sessionId:e.sessionId,placeholderName:t,content:i.documentElement.outerHTML,feedData:d(),customData:a}},"https://macro.adnami.io");else{if(s.document.open("text/html","replace"),s.__adnamiAdsAPI=window.__adnamiAdsAPI,a&&"object"==typeof a)for(const e in a)s[e]=a[e];s.document.write(i.documentElement.outerHTML),s.document.close()}r.push(n)}function c(){let t,n=null;try{n=function(t){const n=e.iframeWindow.document.querySelector(t);if(!n)throw Error("Expected script tag with id '".concat(t,"' not found."));const i=n.textContent;if(!i)throw Error("Script tag with feed data is empty. Expected JSON.");let r,o;try{r=JSON.parse(i)}catch(e){throw o=e instanceof Error?"Error parsing feed json: '".concat(e,"'"):"".concat(e),Error(o)}if(!r.items)throw Error("Feed data does not contain expected property 'items'.");return r}("#adnm_proprietary_feed_data_json")}catch(e){t=e instanceof Error?e.message:"".concat(e)}return{feedData:n,errorMessage:t}}function d(){const t="#adnm_proprietary_feed_data_json";return e.iframeWindow.document.querySelector(t)?c():{feedData:null,errorMessage:"Expected script tag with id '".concat(t,"' not found.")}}return n.onSet("canvasMeasurable",(e=>{a=null==e?void 0:e.viewablityElement})),{createDocument:function(e){return(new DOMParser).parseFromString(e,"text/html")},createIframe:function(n,c,d,l){const u=n.createElement("iframe");return u.setAttribute("data-adnm-channel",e.sessionId),u.setAttribute("id","adsm-iframe-"+t.toLowerCase()+"-"+e.sessionId),u.setAttribute("src",d?"https://macro.adnami.io/macro/gen/adnm.sandbox.html":"about:blank"),d&&u.setAttribute("data-adnm-sandbox",""),u.onload=()=>{var e;if(-1!==r.indexOf(u))return;let n=2;"Mobile"===ne()&&(n=4),null===a||(null!==(e=D(a))&&void 0!==e?e:0)<=n*window.innerHeight?(s(u,c,d,l),i(Ie.BANNER_INJECTED)):o[t]=()=>{var e;(null!==(e=D(a))&&void 0!==e?e:0)<=n*window.innerHeight&&(s(u,c,d,l),delete o[t],i(Ie.BANNER_INJECTED))}},u},getFeedDataResult:c}};const Ve=function(e){const t="https://functions.adnami.io/api/tracker?ev=error_"+e+"&cc=00000000-0000-0000-0000-000000000000&cs="+encodeURIComponent(window.location.href.replace(window.location.search,""))+"&_="+Date.now()+"&sid="+Date.now()+"&sit="+Date.now();if(navigator.sendBeacon)navigator.sendBeacon(t);else{(new window.Image).src=t}};function Be(e){const t=e.data.channelId,n=e.data.event;if(t&&n){var i,r;const o=null!==(i=null===(r=window.adnmEventCallbacks[t])||void 0===r?void 0:r[n])&&void 0!==i?i:[];for(const t of o)t(e.data.data,e.source);!0===e.data.forward&&"https://macro.adnami.io"===e.origin&&We(e.data,window)}}function We(e,t){const n=t.document.querySelectorAll('iframe[data-adnm-sandbox][data-adnm-channel="'.concat(e.channelId,'"]'));for(const t of n){var i;null===(i=t.contentWindow)||void 0===i||i.postMessage(e,"https://macro.adnami.io")}const r=t.document.querySelectorAll("iframe[data-adnm-forward]");for(const t of r)t.contentWindow&&We(e,t.contentWindow)}const Ue=function(e){return void 0===window.adnmEventCallbacks&&(window.adnmEventCallbacks={}),{call:function(t,n){var i;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.top,o=arguments.length>3?arguments[3]:void 0;r.postMessage({channelId:e,forward:null!==(i=null==o?void 0:o.forward)&&void 0!==i&&i,event:t,data:n},"*")},subscribe:function(t,n){0===Object.keys(window.adnmEventCallbacks).length&&window.addEventListener("message",Be),void 0===window.adnmEventCallbacks[e]&&(window.adnmEventCallbacks[e]={}),void 0===window.adnmEventCallbacks[e][String(t)]&&(window.adnmEventCallbacks[e][String(t)]=[]),window.adnmEventCallbacks[e][String(t)].push(n)},unsubscribe:function(t,n){var i;const r=null===(i=window.adnmEventCallbacks[e])||void 0===i?void 0:i[String(t)];if(!r)return;const o=r.indexOf(n);-1!==o&&(r.splice(o,1),0===r.length&&(delete window.adnmEventCallbacks[e][String(t)],0===Object.keys(window.adnmEventCallbacks[e]).length&&(delete window.adnmEventCallbacks[e],0===Object.keys(window.adnmEventCallbacks).length&&window.removeEventListener("message",Be))))},unsubscribeAll:function(){window.adnmEventCallbacks[e]&&(delete window.adnmEventCallbacks[e],0===Object.keys(window.adnmEventCallbacks).length&&window.removeEventListener("message",Be))},isSubscribed:function(t){var n;return(null===(n=window.adnmEventCallbacks[e])||void 0===n||null===(n=n[String(t)])||void 0===n?void 0:n.length)>0}}};function Fe(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const He=class{constructor(){Fe(this,"adStateMachine",new se)}onSet(e,t){const n=i=>{t(i),this.adStateMachine.removeCallback(e,n)};this.adStateMachine.onSet(e,n)}set(e,t){this.adStateMachine.set(e,!1,t)}};function ze(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ge=class{constructor(e,t){ze(this,"adEvents",{destroy:"onDestroy",init:"onInit",loaded:"onLoaded"}),ze(this,"canvasType","undefined"),this.iframeContext=e,this.tracker=t}loaded(){this.exeCertEventFunc(this.adEvents.loaded),this.tracker.trackLoaded()}onDestroy(e){var t,n;let i=!1;i="boolean"==typeof(null===(t=window.adsm)||void 0===t?void 0:t.allowDeprecatedFeatures)&&!(null!==(n=window.adsm)&&void 0!==n&&n.allowDeprecatedFeatures);let r=!1;const o=this.iframeContext;i||o.addEventListener("unload",(t=>{r||(r=!0,this.exeCertEventFunc(this.adEvents.destroy),e(t))})),o.addEventListener("visibilitychange",(t=>{setTimeout((()=>{r||null!==o.frameElement||o===window.top||(r=!0,this.exeCertEventFunc(this.adEvents.destroy),e(t))}),0)}))}getCert(e){var t;this.canvasType=e;const n=null===(t=window.top)||void 0===t?void 0:t.adsm,i=null!=n&&n.certifications?null==n?void 0:n.certifications[this.canvasType]:void 0;if(!(!e||!n&&"object"!=typeof n||!i&&"object"!=typeof i))return null===i.cert&&this.tracker.trackError(Ie.ERROR_GET_CERT),this.exeCertEventFunc(this.adEvents.init),i.cert}exeCertEventFunc(e){try{var t;(null===(t=window.top)||void 0===t||null===(t=t.adsm)||void 0===t||null===(t=t.certifications)||void 0===t||null===(t=t[this.canvasType])||void 0===t?void 0:t[e])(this.iframeContext)}catch(e){}}};const qe=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))};function Xe(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Qe{constructor(){Xe(this,"callbacks",[])}subscribe(e){this.callbacks.push(e)}unsubscribe(e){const t=this.callbacks.indexOf(e);-1!==t&&this.callbacks.splice(t,1)}invoke(){for(const e of this.callbacks)e(...arguments)}dispose(){this.callbacks.length=0}}function Ye(e){const t=e.getAttribute("data-adnm-bridge-groups");return(t&&""!==t?t.split("|"):[]).map((e=>{const[t,n]=e.split("+");return{group:t,type:n}}))}function $e(e,t,n){const i=Ye(n);if(!i.some((t=>t.group===e))){i.push({group:e,type:t});const r=i.map((e=>"".concat(e.group,"+").concat(e.type))).join("|");n.setAttribute("data-adnm-bridge-groups",r)}}function Je(e,t){const n=Ye(t).filter((t=>t.group!==e));if(n.length>0){const e=n.map((e=>"".concat(e.group,"+").concat(e.type))).join("|");t.setAttribute("data-adnm-bridge-groups",e)}else t.removeAttribute("data-adnm-bridge-groups")}function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ze(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class et{constructor(e){if(Ze(this,"id",qe()),Ze(this,"isDisposed",!1),Ze(this,"onTrackerEventIntercepted",new Qe),Ze(this,"isConnected",!1),Ze(this,"messageQueue",[]),this.onMessageReceivedBound=this.onMessageReceived.bind(this),!window.top)throw new Error("Client instance does not have access to top window");if(this.server=window.top,this.options=function(e){for(var t=1;t{this.options.element&&document.contains(this.options.element)||(clearInterval(e),this.isDisposed||this.dispose())}),1e4)}}connectToServer(){ce((()=>{if(this.isConnected)return!0;this.server.postMessage({type:"adnm-bridge-connect",clientId:this.id,clientType:this.options.type,clientGroup:this.options.group},"*")}),10,300).then((()=>{})).catch((()=>{}))}dispose(){this.isDisposed||(window.removeEventListener("message",this.onMessageReceivedBound),this.onTrackerEventIntercepted.dispose(),this.options.element&&Je(this.options.group,this.options.element),this.isDisposed=!0)}trackEvent(e,t,n){this.sendMessageToServer({type:"adnm-bridge-track",clientId:this.id,event:e,time:t,details:n})}createViewabilityObserver(e){let t=e.getBoundingClientRect();const n=oe(t.width,t.height),i=re(t.height,n,!1);new Y(((n,i)=>{const r=Date.now();if(n===$.ENTER_SCROLL)this.trackEvent("wrapper_inview",r);else if(n===$.EXIT_SCROLL)this.trackEvent("wrapper_leave_view",r);else if(n===$.ENTER_FOCUS)this.trackEvent("wrapper_page_inview",r);else if(n===$.EXIT_FOCUS)this.trackEvent("wrapper_page_leave_view",r);else if(n===$.VIEWED_SECOND){var o,a,s,c,d;t=e.getBoundingClientRect(),this.trackEvent("wrapper_imp_viewed",r,{size:oe(t.width,t.height),device:Z.Banner,width:Math.round(Number(t.width)),height:Math.round(Number(t.height)),windowWidth:Number(null!==(o=null===(a=window.screen)||void 0===a?void 0:a.width)&&void 0!==o?o:0),windowHeight:Number(null!==(s=null===(c=window.screen)||void 0===c?void 0:c.height)&&void 0!==s?s:0),visibleRatio:null!==(d=i.visibleRatio)&&void 0!==d?d:0})}}),{threshold:i,visibleRatioDetection:!0}).observe(e)}createEngagementObserver(e){new ge((e=>{const t=Date.now();this.trackEvent(ye(e),t)})).observe(e)}interceptTrackerEvents(e){this.sendMessageToServer({type:"adnm-bridge-intercept",clientId:this.id,group:e})}sendMessageToServer(e){this.isConnected?this.server.postMessage(e,"*"):this.messageQueue.push(e)}onMessageReceived(e){if(e.source!==this.server||!e.data)return;const t=e.data;if(t.clientId===this.id)if("adnm-bridge-event"===t.type&&t.event)this.onTrackerEventIntercepted.invoke(t.event.name,t.event.time,t.event.details);else if("adnm-bridge-connected"===t.type){this.isConnected=!0;for(const e of this.messageQueue)this.sendMessageToServer(e);this.messageQueue=[]}}}const tt=function(e,t){if(!0!==(null==e?void 0:e.valid))throw Ve(Ie.ERROR_INVALID_API_CONFIG),new Error("AdnamiAdsAPI constructed with invalid apiConfig.");const n=new et({group:e.sessionId,type:"native"}),i=new He,r=e.iframeWindow,o=Ue(e.sessionId),a=_e(e,t,i,o,n),s=new Ge(r,a),c={tracker:a,videoController:Ae(r,a.trackError,o,e.sessionId,i,t,e.sourceUrl),eventManager:o,environment:Me(e.tag),creativeConfigurator:je(e,t,i,a.trackEvent),onDestroy:function(e){s.onDestroy((t=>{var i,r;e(t),null==c||null===(i=c.scrollObserver)||void 0===i||i.destroy(),null==c||null===(r=c.eventManager)||void 0===r||r.unsubscribeAll(),n.dispose()}))},getCert:function(t){if(!c.environment.windowTopAccessible)return;void 0===e.format&&(e.format=t);return s.getCert(t)},createScrollObserver:function(n,i){try{c.scrollObserver=Te(n,e.sessionId,t,o,i)}catch(e){}},loaded:function(){s.loaded()}};return{v1:c}};const nt=function(e){if(void 0===e||void 0===e.valid||!1===e.valid)throw Ve(Ie.ERROR_INVALID_API_CONFIG),new Error("AdnamiAdsAPIFactory constructed with invalid apiConfig.");var t=e,n=tt;return{create:function(e){return n(t,e)},setCreativeCode:function(e){(function(e){return e&&"string"==typeof e&&36===e.length&&"00000000-0000-0000-0000-000000000000"!==e})(e)&&(t.creativeCode=e)}}},it=function(e,t,n,i,r){return{format:void 0,creativeCode:e,iframeWindow:t,sessionId:n,sessionTimeId:i,tag:r,formatType:arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",sourceUrl:arguments.length>6&&void 0!==arguments[6]?arguments[6]:void 0,clickUrl:arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,valid:!0}};const rt=function(e,t,n,i,r,o){let a="https://functions.adnami.io/api/tracker?ev="+e+"&v=1.1.1&cc="+t+"&cs="+y(r)+"&_="+Date.now()+"&sid="+n+"&sit="+i;if(o){const e=window.btoa(JSON.stringify(o));a+="&cd=".concat(e)}if(navigator.sendBeacon)navigator.sendBeacon(a);else{(new Image).src=a}};(window.adsmtag=window.adsmtag||{}).rmb=window.adsmtag.rmb=window.adsmtag.rmb||{},window.adsm=window.adsm||{};const ot={uuid:null,id:null,sit:null,adSource:null,ad:{width:1,height:1,click:"",flex:"",impressionSrc:"",custom:{}},scriptVersion:1,source:null,frame:null,placement:null};function at(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function st(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}r("ADSM_RMB_ADS_INIT",(function(e,t){const n=JSON.parse(JSON.stringify(ot));o.extend(n.ad,e.ad),n.uuid=e.uuid||"",n.id=e.id||"",n.sit=e.sit||"",n.scriptVersion=e.scriptVersion||1,n.source=t,n.adSource=e.adSource||"",n.sourceUrl=e.sourceUrl,n.formatType=e.formatType;const i=function(e){const t=document.querySelectorAll("iframe");for(const n of t)if(n.contentWindow===e)return n}(function(e){let t=e;for(;t.parent&&t.parent!==window.top;)t=t.parent;return t}(t));n.frame=i,n.placement=n.frame.parentNode;if(function(e){var t,n;const i=e.classList.contains("adnm-creative"),r=-1!==(null==e||null===(t=e.firstElementChild)||void 0===t||null===(t=t.id)||void 0===t?void 0:t.indexOf("adsm-iframe"))||-1!==(null==e||null===(n=e.firstElementChild)||void 0===n||null===(n=n.id)||void 0===n?void 0:n.indexOf("adnm-iframe"));return i&&r}(n.placement))return void rt("error_endless_loop",n.uuid,n.id,n.sit,n.sourceUrl);const r=function(){const e=document.createElement("div");return e.classList.add("adnm-creative"),e.style.border="0",e.style.margin="auto",e.style.textAlign="center",e}(),a=function(e){const t=document.createElement("iframe");t.id="adsm-iframe-"+e.uuid+"-"+e.id,"number"==typeof e.ad.width?t.style.width=e.ad.width+"px":t.style.width=e.ad.width;"number"==typeof e.ad.height?t.style.height=e.ad.height+"px":t.style.height=e.ad.height;"100%"===e.ad.height&&(t.style.top="0px",t.style.left="0px",t.style.position="absolute");t.setAttribute("scrolling","no"),t.style.border="0",t.style.verticalAlign="bottom",t.src="about:blank",2===e.scriptVersion&&(t.style.display="none");return t.style.colorScheme="auto",t}(n),s=Pe(n.ad.width,n.ad.height);r.appendChild(a),n.frame.parentNode.insertBefore(r,n.frame);const c=it(n.uuid,a.contentWindow,n.id,n.sit,s,e.formatType,e.sourceUrl),d=nt(c);new x(d,n,a).loadAd()}));class ct{constructor(){if(st(this,"connections",{}),st(this,"trackerEvents",{}),st(this,"trackerEventInterceptors",{}),window!==window.top)throw new Error("Server can only be initialized in top window context");window.addEventListener("message",this.onMessageReceived.bind(this)),setInterval(this.cleanupConnections.bind(this),1e5)}onMessageReceived(e){if(!e.source||!e.data)return;const t=Date.now(),n=e.data;"adnm-bridge-connect"===n.type&&n.clientId&&n.clientGroup&&n.clientType&&this.parseConnectMessage(e.source,n.clientId,n.clientGroup,n.clientType);const i=this.connections[n.clientId];i&&(i.lastMessageTime=t,"adnm-bridge-track"===n.type&&n.event&&n.time?this.parseTrackerEventMessage(i,{name:n.event,time:n.time,details:n.details}):"adnm-bridge-intercept"===n.type&&n.group&&this.parseInterceptMessage(i,n.group))}parseConnectMessage(e,t,n,i){if(t in this.connections)return;const r={window:e,clientId:t,clientType:i,clientGroup:n,lastMessageTime:Date.now()};if(e!==window.top){const t=this.findRootIframeFromWindow(e);if(!t)return;$e(n,i,t),r.iframe=t}this.connections[t]=r,this.sendMessageToClient(r,"adnm-bridge-connected")}parseTrackerEventMessage(e,t){let n=this.trackerEvents[e.clientGroup];n||(n=this.trackerEvents[e.clientGroup]=[]),n.push(t),this.forwardEventToGroupInterceptors(e.clientGroup,t)}parseInterceptMessage(e,t){if(!Object.values(this.connections).some((e=>e.clientGroup===t)))return;let n=this.trackerEventInterceptors[t];n||(n=this.trackerEventInterceptors[t]=[]),n.push(e);if(this.trackerEvents[t])for(const n of this.trackerEvents[t])this.forwardEvent(e,n)}forwardEventToGroupInterceptors(e,t){const n=this.trackerEventInterceptors[e];if(n)for(const e of n)this.forwardEvent(e,t)}forwardEvent(e,t){this.sendMessageToClient(e,"adnm-bridge-event",["event",t])}findRootIframeFromWindow(e){let t=e;for(;t.parent&&t.parent!==window.top;)t=t.parent;const n=document.querySelectorAll("iframe");for(const e of n)if(e.contentWindow===t)return e;return null}sendMessageToClient(e,t){for(var n,i=arguments.length,r=new Array(i>2?i-2:0),o=2;oe.clientGroup===n.clientGroup))||(delete this.trackerEvents[n.clientGroup],delete this.trackerEventInterceptors[n.clientGroup])}}}if(!window.adnmBridgeServer)try{window.adnmBridgeServer=new ct}catch(e){}const dt=window.adsmtag||{};dt.cmd=dt.cmd||[];for(const e of dt.cmd)e()})()})();