1"use strict";(self.webpackChunktiempo=self.webpackChunktiempo||[]).push([[227],{2412:function(t,e,n){n.r(e),n.d(e,{AdTaboola:function(){return a}});var o=n(4678),i=function(t,e,n,o){return new(n||(n=Promise))(function(i,a){function r(t){try{d(o.next(t))}catch(t){a(t)}}function s(t){try{d(o.throw(t))}catch(t){a(t)}}function d(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(r,s)}d((o=o.apply(t,e||[])).next())})};class a{constructor(t={}){this.flushInserted=!1;const e=!!o.A.ad_taboola_inv_widget;this.options=Object.assign({adId:e?"taboola-invisiblewidget":"taboola-below-article-thumbnails",invisibleWidget:e,root:document,newPageLoad:!1},t),this.adElements=Array.from(this.options.root.querySelectorAll(`#${this.options.adId}`))}static init(t={}){return new a(t).loadScripts()}static initLocalidad(){return document.querySelector(".box2")?a.initCarrusel():a.init()}static initCarrusel(){const t=document.querySelector(".box2");if(!t)return Promise.resolve(!1);const e=!!document.getElementById(a.LOADER_SCRIPT_ID);return new a({root:t,newPageLoad:e}).loadScripts()}loadScripts(){return i(this,void 0,void 0,function*(){if(!this.options.invisibleWidget&&!this.adElements.length)return!1;if(this.options.newPageLoad?this.notifyNewPageLoad():yield this.injectScript("head"),this.options.invisibleWidget)yield this.injectInvisibleWidget();else for(const t of this.adElements)yield this.injectScript("body",t);return yield this.injectScript("flush"),!0})}injectInvisibleWidget(){return i(this,void 0,void 0,function*(){if(!document.getElementById("taboola-invisiblewidget")){const t=document.createElement("div");t.id="taboola-invisiblewidget",document.body.appendChild(t)}const t=document.getElementById("taboola-invisiblewidget");yield this.injectScript("body",t)})}notifyNewPageLoad(){const t=this.getContentType();window._taboola=window._taboola||[],window._taboola.push({notify:"newPageLoad"}),window._taboola.push({[t]:"auto",url:location.href})}trazarCargaLoader(){const t=document.getElementById(a.LOADER_SCRIPT_ID);t?(t.addEventListener("load",()=>console.log(`[Taboola] ð¦ loader.js cargado â ${this.getEstadoLibreria()}`),{once:!0}),t.addEventListener("error",()=>console.error("[Taboola] â Error al descargar loader.js"),{once:!0})):console.warn(`[Taboola] â ï¸ [head] No se encontró #${a.LOADER_SCRIPT_ID} tras inyectar el head`)}getEstadoLibreria(){const t=window._taboola;return t?`librerÃa: ${t.push!==Array.prototype.push?"conectada":"no cargada (array nativo)"}, cola: ${t.length}`:"librerÃa: _taboola no definido"}injectScript(t,e){return i(this,void 0,void 0,function*(){if(("head"!==t||!document.getElementById(a.LOADER_SCRIPT_ID))&&("flush"!==t||!this.flushInserted)&&("body"!==t||(null==e?void 0:e.id)))try{const n=yield this.createScriptFromTemplate(t,e);this.appendScript(n,t,e),"flush"===t&&(this.flushInserted=!0)}catch(n){console.error(`[Taboola] â Error al cargar template [${t}]:`,n),console.warn(`[Taboola] ð Usando fallback inline para [${t}]`),this.injectScriptFallback(t,e)}})}createScriptFromTemplate(t,e){return i(this,void 0,void 0,function*(){let i;switch(t){case"head":i=yield n.e(4396).then(n.t.bind(n,7564,23));break;case"body":i=this.options.invisibleWidget?yield n.e(6540).then(n.t.bind(n,5948,23)):yield n.e(5242).then(n.t.bind(n,4466,23));break;case"flush":i=yield n.e(6916).then(n.t.bind(n,7552,23))}const a={head:{contentType:this.getContentType(),contentPublisher:o.A.ad_taboola_publisher},body:{containerId:null==e?void 0:e.id,invisibleWidget:this.options.invisibleWidget},flush:{}}[t],r=i.default(a);return this.parseScriptFromHtml(r)})}parseScriptFromHtml(t){const e=document.createElement("template");e.innerHTML=t;const n=e.content.querySelector("script");if(!n)throw new Error("No se encontró script en template");const o=document.createElement("script");return o.type="text/javascript",o.text=n.textContent||"",n.id&&(o.id=n.id),o}appendScript(t,e,n){"body"===e&&n?n.insertAdjacentElement("afterend",t):("head"===e?document.head:document.body).appendChild(t)}logSuccess(t,e){const n={head:`â
[head] loader.js inyectado â publisher: ${o.A.ad_taboola_publisher}, contentType: ${this.getContentType()}`,body:`â
[body] script insertado después de #${null==e?void 0:e.id}${this.options.invisibleWidget?" (InvisibleWidget)":""}`,flush:"â
[flush] _taboola.push({flush:true}) insertado al final del <body>"};console.log(`[Taboola] ${n[t]}`)}injectScriptFallback(t,e){const n=document.createElement("script");switch(n.type="text/javascript",t){case"head":n.id=a.LOADER_SCRIPT_ID,n.text=this.getHeadScriptContent(),document.head.appendChild(n);break;case"body":if(!(null==e?void 0:e.id))return;n.text=this.getBodyScriptContent(e.id),e.insertAdjacentElement("afterend",n);break;case"flush":n.text=this.getFlushScriptContent(),document.body.appendChild(n),this.flushInserted=!0}}getHeadScriptContent(){return`\n window._taboola = window._taboola || [];\n _taboola.push({ ${this.getContentType()}: 'auto' });\n (function(e, f, u, i) {\n if (!document.getElementById(i)) {\n e.async = true;\n e.src = u;\n e.id = i;\n f.parentNode.insertBefore(e, f);\n }\n })(\n document.createElement('script'),\n document.getElementsByTagName('script')[0],\n '//cdn.taboola.com/libtrc/${o.A.ad_taboola_publisher}/loader.js',\n '${a.LOADER_SCRIPT_ID}'\n );\n if (window.performance?.mark) window.performance.mark('tbl_ic');\n `}getBodyScriptContent(t){return this.options.invisibleWidget?`\n window._taboola = window._taboola || [];\n _taboola.push({\n mode: 'rbox-tracking',\n container: '${t}',\n placement: 'InvisibleWidget'\n });\n `:`\n window._taboola = window._taboola || [];\n _taboola.push({\n mode: 'alternating-thumbnails-a',\n container: '${t}',\n placement: 'Below Article Thumbnails',\n target_type: 'mix'\n });\n `}getFlushScriptContent(){return"\n window._taboola = window._taboola || [];\n _taboola.push({ flush: true });\n "}getContentType(){return this.isHomepage()?"homepage":this.isArticle()?"article":"category"}isHomepage(){return!!o.A.home}isArticle(){return!!o.A.articulo}}a.LOADER_SCRIPT_ID="tb_loader_script"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.