1"use strict";(self.webpackChunktiempo=self.webpackChunktiempo||[]).push([[227],{2412:function(e,t,n){n.r(t),n.d(t,{AdTaboola:function(){return a}});var i=n(4678),o=function(e,t,n,i){return new(n||(n=Promise))(function(o,a){function l(e){try{s(i.next(e))}catch(e){a(e)}}function d(e){try{s(i.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(l,d)}s((i=i.apply(e,t||[])).next())})};class a{constructor(e={}){this.flushInserted=!1;const t=!!i.A.ad_taboola_inv_widget;this.options=Object.assign({adId:t?"taboola-invisiblewidget":"taboola-below-article-thumbnails",invisibleWidget:t},e),this.adElements=Array.from(document.querySelectorAll(`#${this.options.adId}`))}static init(e={}){return new a(e).loadScripts()}loadScripts(){return o(this,void 0,void 0,function*(){if(!this.options.invisibleWidget&&!this.adElements.length)return!1;if(yield this.injectScript("head"),this.options.invisibleWidget)yield this.injectInvisibleWidget();else for(const e of this.adElements)yield this.injectScript("body",e);return yield this.injectScript("flush"),!0})}injectInvisibleWidget(){return o(this,void 0,void 0,function*(){if(!document.getElementById("taboola-invisiblewidget")){const e=document.createElement("div");e.id="taboola-invisiblewidget",document.body.appendChild(e)}const e=document.getElementById("taboola-invisiblewidget");yield this.injectScript("body",e)})}injectScript(e,t){return o(this,void 0,void 0,function*(){if("head"===e&&document.getElementById(a.LOADER_SCRIPT_ID))console.log("[Taboola] âï¸ [head] loader ya presente, omitido");else if("flush"===e&&this.flushInserted)console.log("[Taboola] âï¸ [flush] ya insertado, omitido");else if("body"!==e||(null==t?void 0:t.id))try{const n=yield this.createScriptFromTemplate(e,t);this.appendScript(n,e,t),"flush"===e&&(this.flushInserted=!0)}catch(n){console.error(`[Taboola] â Error al cargar template [${e}]:`,n),console.warn(`[Taboola] ð Usando fallback inline para [${e}]`),this.injectScriptFallback(e,t)}else console.warn("[Taboola] â ï¸ [body] El elemento no tiene ID, bloque omitido.")})}createScriptFromTemplate(e,t){return o(this,void 0,void 0,function*(){let o;switch(e){case"head":o=yield n.e(4396).then(n.t.bind(n,7564,23));break;case"body":o=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":o=yield n.e(6916).then(n.t.bind(n,7552,23))}const a={head:{contentType:this.getContentType(),contentPublisher:i.A.ad_taboola_publisher},body:{containerId:null==t?void 0:t.id,invisibleWidget:this.options.invisibleWidget},flush:{}}[e],l=o.default(a);return this.parseScriptFromHtml(l)})}parseScriptFromHtml(e){const t=document.createElement("template");t.innerHTML=e;const n=t.content.querySelector("script");if(!n)throw new Error("No se encontró script en template");const i=document.createElement("script");return i.type="text/javascript",i.text=n.textContent||"",n.id&&(i.id=n.id),i}appendScript(e,t,n){"body"===t&&n?n.insertAdjacentElement("afterend",e):("head"===t?document.head:document.body).appendChild(e)}logSuccess(e,t){const n={head:`â
[head] loader.js inyectado â publisher: ${i.A.ad_taboola_publisher}, contentType: ${this.getContentType()}`,body:`â
[body] script insertado después de #${null==t?void 0:t.id}${this.options.invisibleWidget?" (InvisibleWidget)":""}`,flush:"â
[flush] _taboola.push({flush:true}) insertado al final del <body>"};console.log(`[WEB-1986: Taboola Invisible Widget] ${n[e]}`)}injectScriptFallback(e,t){const n=document.createElement("script");switch(n.type="text/javascript",e){case"head":n.id=a.LOADER_SCRIPT_ID,n.text=this.getHeadScriptContent(),document.head.appendChild(n);break;case"body":if(!(null==t?void 0:t.id))return;n.text=this.getBodyScriptContent(t.id),t.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/${i.A.ad_taboola_publisher}/loader.js',\n '${a.LOADER_SCRIPT_ID}'\n );\n if (window.performance?.mark) window.performance.mark('tbl_ic');\n `}getBodyScriptContent(e){return this.options.invisibleWidget?`\n window._taboola = window._taboola || [];\n _taboola.push({\n mode: 'rbox-tracking',\n container: '${e}',\n placement: 'InvisibleWidget'\n });\n `:`\n window._taboola = window._taboola || [];\n _taboola.push({\n mode: 'alternating-thumbnails-a',\n container: '${e}',\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!!i.A.home}isArticle(){return!!i.A.articulo}static clearScripts(){var e;null===(e=document.getElementById(this.LOADER_SCRIPT_ID))||void 0===e||e.remove();const t=e=>
1{e.querySelectorAll("script").forEach(e=>{var t;(null===(t=e.textContent)||void 0===t?void 0:t.includes("_taboola"))&&e.remove()})};t(document.head),t(document.body),document.querySelectorAll("aside.ad-taboola, #taboola-invisiblewidget").forEach(e=>e.remove()),window._taboola&&(window._taboola=[])}}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.