"use strict";let flag_=!1,ventana_=$(window),flagSkin=!1,flagItt=!1,flagNot=!1,flagVideo=!1,flagNotSafe=!1,flagExpandeOcierra=!0,flagScroll=!1,globalMensaje;const initListen=()=>{window.addEventListener?window.addEventListener("message",procesarMensaje,!1):window.attachEvent("onmessage",procesarMensaje)},procesarMensaje=e=>{let{data:a,origin:n}=e,{cerrar:i,mensaje:s}=a;if(-1!==n.indexOf("safeframe.googlesyndication.com")){if(globalMensaje=s,"safe-frame"!==e.data.cmd){setTimeout(function(){flagVideo||instanciaFormatVideoAds(i)},1e3);return}switch(1===i&&hideWindow(plataforma),s){case"skin":procesaSkin(a),flagVideo=!0,instanciaFormatVideoAds(i);break;case"expandible":procesaExpandible(a),flagVideo=!0,instanciaFormatVideoAds(i);break;case"video-skin":procesaVideo(a,"skin"),flagVideo=!0;break;case"sticky-skin":procesaSticky(a,"simple",1,"skin"),flagVideo=!0,instanciaFormatVideoAds(i);break;case"sticky-banner":case"sticky-big-banner":procesaSticky(a,"simple",1,"banner"),flagVideo=!0,instanciaFormatVideoAds(i);break;case"video-skin-params":procesaModalVideoSkin(a);break;case"video-banner":procesaVideo(a,"banner"),flagVideo=!0;break;default:if(!i&&"itt"!==s&&"newItt"!==s&&"footer"!==s){console.log("Mensaje no reconocido: ",s);break}switch(s){case"itt":case"newItt":flagVideo=!0,instanciaFormatVideoAds(i),procesaFrame(a);break;case"footer":ventana_.on("scroll",function(){ventana_.scrollTop()>=screen.height&&!flagScroll&&(procesaFrame(a),flagVideo=!1,flagScroll=!0)}),flagScroll&&(procesaFrame(a),flagVideo=!1)}}}
console.log("globalMensaje: ",globalMensaje)
};
document.addEventListener("DOMContentLoaded",initListen);

