PageSourceSearch

https://m360.cl/noticias/stat/publicidad/codes/utiles/funcionListen.js?ts=20261002034651

js m360.cl collected 2026-10-02 06:47:27 UTC 17,622 bytes, 392 lines download raw bytes

1const hideWindow = e => {
2    let t = 1 === e ? "div-gpt-ad-1749364337870-0" : "div-gpt-ad-1748447098224-0";
3    "itt" === globalMensaje && (document.getElementById(t).style.display = "none",
4    flagSkin = !0),
5    flagItt = !0
6}
7;
8function instanciaFormatVideoAds() {
9    if (flagNot) return;
10    let dfp_sec, arrayTem = null;
11    let e = "https://pubads.g.doubleclick.net/gampad/ads",
12        t = { description_url: "https://www.cooperativa.cl", tfcd: 0, npa: 0, sz: "640x360", gdfp_req: 1, output: "vast", unviewed_position_start: 1, env: "vp", impl: "s", correlator: "",vpmute:1, plcmt:2 },
13        l,
14        s = {};
15    switch (!0) {
16        case -1 !== coop_tipo.indexOf("m360_portada"):
17        case -1 !== coop_tipo.indexOf("m360_portadilla"):
18            (l = `${e}?iu=/1020719/m360_${1 === plataforma ? "m" : "d"}_preroll_home_stiky`), (s = { ...t });
19            break;
20        case -1 !== coop_tipo.indexOf("m360_mam"):
21            l = `${e}?iu=/1020719/m360_${1 === plataforma ? "m" : "d"}_preroll_home_stiky`;
22            break;
23        case -1 !== coop_tipo.indexOf("m360_articulo"):
24            "fid_audio" === fid_dfp || "fid_foto" === fid_dfp || "fid_video" === fid_dfp
25                ? ((l = `${e}?iu=/1020719/m360_${1 === plataforma ? "m" : "d"}_preroll_home_stiky`), (s = { ...t }))
26                : ((l = `${e}?iu=/1020719/m360_${1 === plataforma ? "m" : "d"}_preroll_home_stiky`), ((s = { ...t }).description_url = "https://www.cooperativa.cl/"));
27    }
28    if (l) {
29        s = { ...s, ...dfp_sec, ...arrayTem };
30        let n = new URLSearchParams(s).toString(),
31            a = `${l}&${n}`;
32        (flagNot = !0), go(a, dfp_sec, arrayTem, null, null);
33    }
34}
35function procesaVideo(e, t) {
36    if (1 === plataforma) procesaSticky(e, "video", 1, "skin");
37    else if (0 === plataforma) {
38        if ("skin" === t) {
39            go(
40                "https://pubads.g.doubleclick.net/gampad/ads?iu=/1020719/coop_d_preroll_video_skin&description_url=https%3A%2F%2Fwww.cooperativa.cl&tfcd=0&npa=0&sz=640x360&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",
41                dfp_sec,
42                arrayTem,
43                null
44            ),
45                flag_
46                    ? ventana_.on("scroll", function () {
47                          dibujaSkin(e, flagSkin, flag_);
48                      })
49                    : (flagSkin = !0),
50                dibujaSkin(e, flagSkin, flag_),
51                $(".contenedor.columna-full:first-of-type").css({ marginTop: "180px" });
52            let l = document.getElementsByClassName("gam-bloque-skin")[0].getElementsByTagName("iframe")[0];
53            $(".video-video-skin").hover(
54                function e() {
55                    l.contentWindow.postMessage({ entra: !0 }, "*");
56                },
57                function e() {
58                    l.contentWindow.postMessage({ sale: !0 }, "*");
59                }
60            );
61        } else "banner" === t && procesaSticky(e, "video", 1, "banner");
62    }
63}
64
65function procesaNewItt(e) {
66    flag_ = !0;
67    let { params: t, tipo: l } = e,
68        { height: s, width: n, margin: a } = t,
69        i = document.getElementsByClassName(l),
70        o = i[0].getElementsByTagName("iframe");
71    i && ((i[0].style.height = s || null), (i[0].style.width = n || null), (i[0].style.margin = a || null)),
72        o && ((o[0].style.height = s || null), (o[0].style.width = n || null)),
73        googletag.pubads().addEventListener("slotOnload", function (e) {
74            window.addEventListener("scroll", function (e) {
75                (scroll_position = window.scrollY) >= 600 && (plataforma, hideWindow(plataforma));
76            }),
77                "coop_d_1x1_1" === e.slot.getSlotElementId() || ("coop_m_1x1_1" === e.slot.getSlotElementId() && (document.getElementById("div-gpt-ad-1530907736655-2").style.display = "none"));
78        });
79}
80function procesaModalVideoSkin(e) {
81    let t = document.getElementsByClassName("video-video-skin"),
82        l = document.getElementsByClassName("content-reproductor-video-skin"),
83        s = document.getElementsByClassName("closeWrapper-video-skin");
84    if (e.params) {
85        let {
86                params: { params_video_skin: n = null, params_content_reproductor: a = null, params_content_closeWrapper: i = null },
87            } = e,
88            { zIndex: o, background: d, position: r, transition: p, width: y, height: u, left: c, cursor: m, right: g, top: f } = n;
89        t &&
90            ((t[0].style.zIndex = o || null),
91            (t[0].style.background = d || null),
92            (t[0].style.position = r || null),
93            (t[0].style.transition = p || null),
94            (t[0].style.width = y || null),
95            (t[0].style.height = u || null),
96            (t[0].style.left = c || null),
97            (t[0].style.cursor = m || null),
98            (t[0].style.right = g || null),
99            (t[0].style.top = f || null));
100        let { zIndexR: h, backgroundR: _, transitionR: x, widthR: b, heightR: E, leftR: k, cursorR: w, rightR: v, topR: B, bottomR: N, borderRadiusR: C, boxShadowR: T } = a;
101        l &&
102            ((l[0].style.zIndex = h || null),
103            (l[0].style.background = _ || null),
104            (l[0].style.transition = x || null),
105            (l[0].style.width = b || null),
106            (l[0].style.height = E || null),
107            (l[0].style.left = k || null),
108            (l[0].style.cursor = w || null),
109            (l[0].style.right = v || null),
110            (l[0].style.top = B || null),
111            (l[0].style.bottom = N || null),
112            (l[0].style.borderRadius = C || null),
113            (l[0].style.boxShadow = T || null));
114        let { displayCC: I } = i;
115        s && (s[0].style.display = I || null), resizeBanner(640, 360);
116    } else if (e.paramsRH) {
117        let {
118                paramsRH: { params_caption_text: S = null, params_progressBar_props: O = null, params_progressBar_style: j = null, params_caption_style: z = null },
119            } = e,
120            { valueCT: L } = S,
121            { valuePB: W, maxPB: F, disabledPB: M, destroyPB: V } = O,
122            { displayPB: A } = j,
123            { displayC: R } = z;
124        $(".caption").text(L), $("#progressbar").progressbar({ value: W, max: F }), $("#progressbar").css("display", A), $(".caption").css("display", R), $("#progressbar").progressbar({ disabled: M }), $("#progressbar").progressbar(V);
125    } else if (e.paramsPB_C) {
126        let {
127            paramsPB_C: { params_progressBarr: { displayPB: q } = null, params_caption: { displayC: H } = null },
128        } = e;
129        $("#progressbar").css("display", q), $(".caption").css("display", H);
130    } else if (e.paramsRenH) {
131        let {
132                paramsRenH: { params_progressBar_props: P },
133            } = e,
134            { valuePB: D, maxPB: Y } = P;
135        $("#progressbar").progressbar({ value: D, max: Y }), 1 === D && $(".caption").text("3"), 2 === D && $(".caption").text("2"), 3 === D && $(".caption").text("1");
136    }
137}
138async function procesaFrame(e) {
139    let { timeOut: t, cerrar: l, mensaje: s } = e;
140    if ("footer" === s && t) {
141        setTimeout(() => dibujaFooter(e), 1e3 * t);
142        return;
143    }
144    if (!flagItt) {
145        if (1 === l) {
146            hideWindow(plataforma)
147            //  instanciaFormatVideoAds(l);
148            return;
149        }
150        if ("itt" === s && t) {
151            setTimeout(() => dibujaItt(e), 1e3 * t);
152            return;
153        }
154        if ("newItt" === s) {
155            procesaNewItt(e);
156            return;
157        }
158    }
159}
160function dibujaItt(e) {
161    let { params: t, tipo: l } = e,
162
163        { position: s, height: n, width: a, zIndex: i, display: o, marginTop: d, top: r, left: p, bottom: y } = t,
164        u = document.getElementsByClassName(l)[0];
165    u && ((u.style.position = s && s), (u.style.height = n && n), (u.style.width = a && a), (u.style.zIndex = i && i), (u.style.marginTop = d && d), (u.style.top = r && r), (u.style.bottom = y && y), (u.style.left = p && p));
166    let c = u && u.getElementsByTagName("iframe")[0];
167    c && ((c.style.position = s && s), (c.style.height = n && n), (c.style.width = a && a), (c.style.display = o && o), (c.style.top = r && r), (c.style.left = p && p));
168}
169
170function procesaSkin(e) {
171    flag_
172        ? ventana_.on("scroll", function () {
173              dibujaSkin(e, flagSkin, flag_);
174          })
175        : (flagSkin = !0),
176        dibujaSkin(e, flagSkin, flag_);
177}
178function dibujaSkin(e, t, l) {
179    if (t || !l) {
180        let { tipo: s, params: n, trackUrl: a } = e,
181            { position: i, height: o, width: d, display: r, top: p, left: y, tag: u } = n,
182            c = u,
183            m = document.createElement("style"),
184            g = document.createElement("script"),
185            f = document.getElementsByClassName(s)[0].getElementsByTagName("iframe");
186        a
187            ? f &&
188              ((f[0].style.position = i || null),
189              (f[0].style.height = o || null),
190              (f[0].style.width = d || null),
191              (f[0].style.display = r || null),
192              (f[0].style.top = p || null),
193              (f[0].style.left = y || null),
194              (g.src = a || null),
195              m.appendChild(document.createTextNode(c)),
196              document.getElementsByTagName("body")[0].appendChild(m),
197              document.getElementsByClassName(s)[0].appendChild(g),
198              document.addEventListener("DOMContentLoaded", function (e) {
199                  document.getElementsByTagName("NAV")[0].classList.add("sticky");
200              }),
201              $(function () {
202                  $(window).scroll(function () {
203                      $(this).scrollTop(), $("header nav").addClass("sticky");
204                  });
205              }))
206            : f &&
207              ((f[0].style.position = i || null),
208              (f[0].style.height = o || null),
209              (f[0].style.width = d || null),
210              (f[0].style.display = r || null),
211              (f[0].style.top = p || null),
212              (f[0].style.left = y || null),
213              m.appendChild(document.createTextNode(c)),
214              document.getElementsByTagName("body")[0].appendChild(m),
215              document.addEventListener("DOMContentLoaded", function (e) {
216                  document.getElementsByTagName("NAV")[0].classList.add("sticky");
217              }),
218              $(function () {
219                  $(window).scroll(function () {
220                      $(this).scrollTop(), $("header nav").addClass("sticky");
221                  });
222              }));
223    }
224}
225function procesaExpandible(e) {
226    let { tipo: t, params: l } = e,
227        { height: s, width: n, tag: a } = l,
228        i = document.createElement("style"),
229        o = document.getElementsByClassName(t)[0].getElementsByTagName("iframe");
230    o && ((o[0].style.height = s || null), (o[0].style.width = n || null)), i.appendChild(document.createTextNode(a)), document.getElementsByTagName("body")[0].appendChild(i);
231}
232function dibujaFooter(e) {
233    let { params: t, tipo: l } = e,
234        { position: s, height: n, width: a, zIndex: i, marginTop: o, bottom: d, right: r, background: p } = t,
235        y = document.getElementsByClassName(l),
236        u = y[0].getElementsByTagName("iframe");
237    y &&
238        ((y[0].style.position = s || null),
239        (y[0].style.height = n || null),
240        (y[0].style.width = a || null),
241        (y[0].style.zIndex = i || null),
242        (y[0].style.marginTop = o || null),
243        (y[0].style.bottom = d || null),
244        (y[0].style.right = r || null),
245        (y[0].style.background = p || null)),
246        u &&
247            ((u[0].style.position = s || null),
248            (u[0].style.height = n || null),
249            (u[0].style.width = a || null),
250            (u[0].style.zIndex = i || null),
251            (u[0].style.marginTop = o || null),
252            (u[0].style.right = r || null),
253            (u[0].style.background = p || null));
254}
255
256
257function procesaSticky(e, formato, cierra,tipo){
258  
259    // expandeOcontrae('contrae');
260    let flagVideoSkin = true;
261    let padreVideoSkin = "";
262    let bannertop = "";
263
264    plataforma === 1 ?bannertop =$(".cont_menu").offset():bannertop =$(".contenedor-items-header").offset();
265    bannertop = bannertop.top + 20;
266
267    let proximoBannerPortadilla = 'm360_m_300x250_01_'+seccionPortadilla;
268
269    switch (coop_tipo) {
270        case('m360_portada'):
271plataforma === 0 ? proximoBanner = $("#cultura-home").offset(): proximoBanner = $("#m360_m_300x250_02").offset();
272        break;
273        case('m360_portadilla'):
274plataforma === 0 ? proximoBanner = $(".contenedor-publicidad-arrobapagina").offset(): proximoBanner = $('#'+proximoBannerPortadilla).offset();
275        break;
276        case('m360_portadilla_videos'):
277plataforma === 0 ? proximoBanner = $(".contenedor-publicidad-arrobapagina").offset(): proximoBanner = $("#m360_m_300x250_01_1").offset();
278        break;
279        case('m360_articulo'):
280plataforma === 0 ? proximoBanner = $("#infinitescroll").offset(): proximoBanner = $("#m360_m_300x250_02_1").offset();
281        break;
282    }
283    proximoBanner = proximoBanner.top;
284    let windowHeight=0, bandera = 0;
285
286
287    if (cierra === 0){
288        expandeOcontrae('contrae');
289    }else if(cierra === 1){
290        $(window).scroll(function(){
291            windowHeight = $(window).scrollTop();
292            if(windowHeight === 0){bandera = 0;}
293            if(windowHeight >= bannertop){
294                    if(bandera === 0){                            
295                        if(formato === 'video' ){
296                            flagVideoSkin === true ? (
297                                (plataforma === 1 ?null:null,
298                                tipo === 'skin'? padreVideoSkin = document.getElementsByClassName('video-video-skin'): padreVideoSkin = document.getElementsByClassName('video-sticky-banner'),
299                                expandeOcontrae('expande'),
300                                flagVideoSkin = false)):null; bandera = 1;
301                            }else {
302                                formato === 'simple'? (expandeOcontrae('expande'),bandera = 1):null;
303                            }
304                        }else{windowHeight >= proximoBanner ?  (expandeOcontrae('contrae'), formato === 'video'?adsManagerBanner.destroy():null): null; bandera = 1;}                           
305                }else{
306                    expandeOcontrae('contrae');
307                    formato === 'video' && padreVideoSkin.length > 0 ?( padreVideoSkin[0].style.display = 'none',
308                    adsManagerBanner.destroy()):null;
309                }
310            });
311
312        }
313        
314}
315
316function expandeOcontrae(e){
317
318    let l = document.getElementsByClassName("gam-bloque-skin")[0].getElementsByTagName("iframe")
319      , s = ""
320      , o = ""
321      , n = "";
322
323    let secPortadillaEsc = 'm360_d_990x90_'+seccionPortadilla;
324    let secPortadillaMov = 'm360_m_320x80_01_'+dfp_sec;
325
326
327    if(plataforma === 0 )
328    {
329        if(coop_tipo === 'm360_portadilla'){
330           // console.log("secPortadillaEsc: ",secPortadillaEsc)
331            padreIframe = window.parent.document.getElementById(secPortadillaEsc);
332
333        }else{
334            padreIframe = window.parent.document.getElementById('m360_d_990x90_01_1');
335        }
336    }else{
337        if(coop_tipo === 'm360_portadilla'){
338           // console.log("secPortadillaMov: ",secPortadillaMov);
339            padreIframe = window.parent.document.getElementById(secPortadillaMov);
340
341        }else{
342            padreIframe = window.parent.document.getElementById('m360_m_320x80_01_1');
343        }
344    }
345
346    0 === plataforma ? (padreIframe = window.parent.document.getElementById("coop_d_990x90_01_1"),
347    o = window.parent.document.getElementById("coop_d_990x90_01"),
348    n = window.parent.document.getElementById("deco_98711_dfp")) : (padreIframe = window.parent.document.getElementById("m360_m_320x80_01_1"),
349    o = window.parent.document.getElementById("m360_m_320x80_01"),
350    n = window.parent.document.getElementById("deco_99711_dfp")),
351    padreIframe.style.display = "table",
352    padreIframe.style.margin = "0 auto",
353    o.style.display = "contents",
354    n.style.display = "contents"
355
356    "expande" === e ? (muestraExpandido(l,padreIframe)): "contrae" === e && (l[0].style.height = "200px",
357    muestraContraido(l,padreIframe))
358}
359
360function muestraExpandido(e, t) {
361
362    flagExpandeOcierra && 0 !== $(window).scrollTop && (plataforma,
363    e[0].style.height = "200px",
364    t.style.height = "225px",
365    t.style.top = "60px",
366    t.style.display="flex",
367    // t.style.setProperty("display", "flex", "important"),
368    e[0].style.opacity = "1",
369    t.style.position = "sticky",
370    t.style.zIndex = "10",
371    t.style.width = "100%",
372    t.style.background = "#fff",
373    
374    setTimeout(function() {
375        muestraContraido(e, t)
376    }, 5e3)
377    )
378}
379function muestraContraido(e, t) {
380
381    0 === plataforma ? (e[0].style.height = "200px",
382    t.style.height = "225px",
383    t.style.top = "-6px",
384    t.style.display="flex") : (t.style.height = "225px",
385    t.style.top = "0px",
386    t.style.display = "table"),
387    t.style.position = "relative",
388    t.style.zIndex = "10",
389    t.style.margin = "0 auto",
390    t.style.width = "100%"
391}
392

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.