1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3 4/***/ 404: 5/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 6 7module.exports = function () { 8 __webpack_require__(964 9 // __dirname + "/../../../../../../../../web/dist/publico/board-espacio-publico.js", 10 ); 11}(); 12 13/***/ }), 14 15/***/ 964: 16/***/ (() => { 17 18function ownKeys(e, r) { 19 var t = Object.keys(e); 20 if (Object.getOwnPropertySymbols) { 21 var o = Object.getOwnPropertySymbols(e); 22 r && (o = o.filter(function (r) { 23 return Object.getOwnPropertyDescriptor(e, r).enumerable; 24 })), t.push.apply(t, o); 25 } 26 return t; 27} 28function _objectSpread(e) { 29 for (var r = 1; r < arguments.length; r++) { 30 var t = null != arguments[r] ? arguments[r] : {}; 31 r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { 32 _defineProperty(e, r, t[r]); 33 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { 34 Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); 35 }); 36 } 37 return e; 38} 39function _slicedToArray(r, e) { 40 return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); 41} 42function _nonIterableRest() { 43 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 44} 45function _unsupportedIterableToArray(r, a) { 46 if (r) { 47 if ("string" == typeof r) return _arrayLikeToArray(r, a); 48 var t = {}.toString.call(r).slice(8, -1); 49 return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; 50 } 51} 52function _arrayLikeToArray(r, a) { 53 (null == a || a > r.length) && (a = r.length); 54 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; 55 return n; 56} 57function _iterableToArrayLimit(r, l) { 58 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; 59 if (null != t) { 60 var e, 61 n, 62 i, 63 u, 64 a = [], 65 f = !0, 66 o = !1; 67 try { 68 if (i = (t = t.call(r)).next, 0 === l) { 69 if (Object(t) !== t) return; 70 f = !1; 71 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); 72 } catch (r) { 73 o = !0, n = r; 74 } finally { 75 try { 76 if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; 77 } finally { 78 if (o) throw n; 79 } 80 } 81 return a; 82 } 83} 84function _arrayWithHoles(r) { 85 if (Array.isArray(r)) return r; 86} 87function _typeof(o) { 88 "@babel/helpers - typeof"; 89 90 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { 91 return typeof o; 92 } : function (o) { 93 return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; 94 }, _typeof(o); 95} 96function _regeneratorRuntime() { 97 "use strict"; 98 99 /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ 100 _regeneratorRuntime = function _regeneratorRuntime() { 101 return r; 102 }; 103 var t, 104 r = {}, 105 e = Object.prototype, 106 n = e.hasOwnProperty, 107 o = "function" == typeof Symbol ? Symbol : {}, 108 i = o.iterator || "@@iterator", 109 a = o.asyncIterator || "@@asyncIterator", 110 u = o.toStringTag || "@@toStringTag"; 111 function c(t, r, e, n) { 112 return Object.defineProperty(t, r, { 113 value: e, 114 enumerable: !n, 115 configurable: !n, 116 writable: !n 117 }); 118 } 119 try { 120 c({}, ""); 121 } catch (t) { 122 c = function c(t, r, e) { 123 return t[r] = e; 124 }; 125 } 126 function h(r, e, n, o) { 127 var i = e && e.prototype instanceof Generator ? e : Generator, 128 a = Object.create(i.prototype); 129 return c(a, "_invoke", function (r, e, n) { 130 var o = 1; 131 return function (i, a) { 132 if (3 === o) throw Error("Generator is already running"); 133 if (4 === o) { 134 if ("throw" === i) throw a; 135 return { 136 value: t, 137 done: !0 138 }; 139 } 140 for (n.method = i, n.arg = a;;) { 141 var u = n.delegate; 142 if (u) { 143 var c = d(u, n); 144 if (c) { 145 if (c === f) continue; 146 return c; 147 } 148 } 149 if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
vendor: 5,245 bytes, lines 150-295
150 if (1 === o) throw o = 4, n.arg; 151 n.dispatchException(n.arg); 152 } else "return" === n.method && n.abrupt("return", n.arg); 153 o = 3; 154 var h = s(r, e, n); 155 if ("normal" === h.type) { 156 if (o = n.done ? 4 : 2, h.arg === f) continue; 157 return { 158 value: h.arg, 159 done: n.done 160 }; 161 } 162 "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); 163 } 164 }; 165 }(r, n, new Context(o || [])), !0), a; 166 } 167 function s(t, r, e) { 168 try { 169 return { 170 type: "normal", 171 arg: t.call(r, e) 172 }; 173 } catch (t) { 174 return { 175 type: "throw", 176 arg: t 177 }; 178 } 179 } 180 r.wrap = h; 181 var f = {}; 182 function Generator() {} 183 function GeneratorFunction() {} 184 function GeneratorFunctionPrototype() {} 185 var l = {}; 186 c(l, i, function () { 187 return this; 188 }); 189 var p = Object.getPrototypeOf, 190 y = p && p(p(x([]))); 191 y && y !== e && n.call(y, i) && (l = y); 192 var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); 193 function g(t) { 194 ["next", "throw", "return"].forEach(function (r) { 195 c(t, r, function (t) { 196 return this._invoke(r, t); 197 }); 198 }); 199 } 200 function AsyncIterator(t, r) { 201 function e(o, i, a, u) { 202 var c = s(t[o], t, i); 203 if ("throw" !== c.type) { 204 var h = c.arg, 205 f = h.value; 206 return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { 207 e("next", t, a, u); 208 }, function (t) { 209 e("throw", t, a, u); 210 }) : r.resolve(f).then(function (t) { 211 h.value = t, a(h); 212 }, function (t) { 213 return e("throw", t, a, u); 214 }); 215 } 216 u(c.arg); 217 } 218 var o; 219 c(this, "_invoke", function (t, n) { 220 function i() { 221 return new r(function (r, o) { 222 e(t, n, r, o); 223 }); 224 } 225 return o = o ? o.then(i, i) : i(); 226 }, !0); 227 } 228 function d(r, e) { 229 var n = e.method, 230 o = r.i[n]; 231 if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; 232 var i = s(o, r.i, e.arg); 233 if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; 234 var a = i.arg; 235 return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); 236 } 237 function w(t) { 238 this.tryEntries.push(t); 239 } 240 function m(r) { 241 var e = r[4] || {}; 242 e.type = "normal", e.arg = t, r[4] = e; 243 } 244 function Context(t) { 245 this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); 246 } 247 function x(r) { 248 if (null != r) { 249 var e = r[i]; 250 if (e) return e.call(r); 251 if ("function" == typeof r.next) return r; 252 if (!isNaN(r.length)) { 253 var o = -1, 254 a = function e() { 255 for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; 256 return e.value = t, e.done = !0, e; 257 }; 258 return a.next = a; 259 } 260 } 261 throw new TypeError(_typeof(r) + " is not iterable"); 262 } 263 return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { 264 var r = "function" == typeof t && t.constructor; 265 return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); 266 }, r.mark = function (t) { 267 return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; 268 }, r.awrap = function (t) { 269 return { 270 __await: t 271 }; 272 }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { 273 return this; 274 }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { 275 void 0 === i && (i = Promise); 276 var a = new AsyncIterator(h(t, e, n, o), i); 277 return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { 278 return t.done ? t.value : a.next(); 279 }); 280 }, g(v), c(v, u, "Generator"), c(v, i, function () { 281 return this; 282 }), c(v, "toString", function () { 283 return "[object Generator]"; 284 }), r.keys = function (t) { 285 var r = Object(t), 286 e = []; 287 for (var n in r) e.unshift(n); 288 return function t() { 289 for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; 290 return t.done = !0, t; 291 }; 292 }, r.values = x, Context.prototype = { 293 constructor: Context, 294 reset: function reset(r) { 295 if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEac
295h(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); 296 }, 297 stop: function stop() { 298 this.done = !0; 299 var t = this.tryEntries[0][4]; 300 if ("throw" === t.type) throw t.arg; 301 return this.rval; 302 }, 303 dispatchException: function dispatchException(r) { 304 if (this.done) throw r; 305 var e = this; 306 function n(t) { 307 a.type = "throw", a.arg = r, e.next = t; 308 } 309 for (var o = e.tryEntries.length - 1; o >= 0; --o) { 310 var i = this.tryEntries[o], 311 a = i[4], 312 u = this.prev, 313 c = i[1], 314 h = i[2]; 315 if (-1 === i[0]) return n("end"), !1; 316 if (!c && !h) throw Error("try statement without catch or finally"); 317 if (null != i[0] && i[0] <= u) { 318 if (u < c) return this.method = "next", this.arg = t, n(c), !0; 319 if (u < h) return n(h), !1; 320 } 321 } 322 }, 323 abrupt: function abrupt(t, r) { 324 for (var e = this.tryEntries.length - 1; e >= 0; --e) { 325 var n = this.tryEntries[e]; 326 if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { 327 var o = n; 328 break; 329 } 330 } 331 o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); 332 var i = o ? o[4] : {}; 333 return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); 334 }, 335 complete: function complete(t, r) { 336 if ("throw" === t.type) throw t.arg; 337 return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; 338 }, 339 finish: function finish(t) { 340 for (var r = this.tryEntries.length - 1; r >= 0; --r) { 341 var e = this.tryEntries[r]; 342 if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; 343 } 344 }, 345 "catch": function _catch(t) { 346 for (var r = this.tryEntries.length - 1; r >= 0; --r) { 347 var e = this.tryEntries[r]; 348 if (e[0] === t) { 349 var n = e[4]; 350 if ("throw" === n.type) { 351 var o = n.arg; 352 m(e); 353 } 354 return o; 355 } 356 } 357 throw Error("illegal catch attempt"); 358 }, 359 delegateYield: function delegateYield(r, e, n) { 360 return this.delegate = { 361 i: x(r), 362 r: e, 363 n: n 364 }, "next" === this.method && (this.arg = t), f; 365 } 366 }, r; 367} 368function asyncGeneratorStep(n, t, e, r, o, a, c) { 369 try { 370 var i = n[a](c), 371 u = i.value; 372 } catch (n) { 373 return void e(n); 374 } 375 i.done ? t(u) : Promise.resolve(u).then(r, o); 376} 377function _asyncToGenerator(n) { 378 return function () { 379 var t = this, 380 e = arguments; 381 return new Promise(function (r, o) { 382 var a = n.apply(t, e); 383 function _next(n) { 384 asyncGeneratorStep(a, r, o, _next, _throw, "next", n); 385 } 386 function _throw(n) { 387 asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); 388 } 389 _next(void 0); 390 }); 391 }; 392} 393function _defineProperty(e, r, t) { 394 return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { 395 value: t, 396 enumerable: !0, 397 configurable: !0, 398 writable: !0 399 }) : e[r] = t, e; 400} 401function _classCallCheck(a, n) { 402 if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); 403} 404function _defineProperties(e, r) { 405 for (var t = 0; t < r.length; t++) { 406 var o = r[t]; 407 o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); 408 } 409} 410function _createClass(e, r, t) { 411 return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { 412 writable: !1 413 }), e; 414} 415function _toPropertyKey(t) { 416 var i = _toPrimitive(t, "string"); 417 return "symbol" == _typeof(i) ? i : i + ""; 418} 419function _toPrimitive(t, r) { 420 if ("object" != _typeof(t) || !t) return t; 421 var e = t[Symbol.toPrimitive]; 422 if (void 0 !== e) { 423 var i = e.call(t, r || "default"); 424 if ("object" != _typeof(i)) return i; 425 throw new TypeError("@@toPrimitive must return a primitive value."); 426 } 427 return ("string" === r ? String : Number)(t); 428} 429(function () { 430 "use strict"; 431 432 var e, t, n; 433 !function (e) {
434 e.SUBSCRIBER = "paid", e.REGISTERED = "lgdin"; 435 }(e || (e = {})), function (e) { 436 e.ANONYMOUS = "a6425154060c8437cb7d5e78b07c53f2c2b052450", e.DARKMODE = "dark", e.DESKTOP = "pb-desktop", e.HIDDEN = "hidden", e.INITIALIZED_ADS = "pb-ads-initialized", e.LIGHTMODE = "light", e.LOGGEDIN = "l26c434f4c22ce5a4c56cc4bcfda0b5ae66292b8b", e.NO_ADS = "na64bf0efc8f03047d171e48a7d6ad0fe98e5a4db", e.MOBILE = "pb-mobile", e.ONLY_MOBILE = "only-mobile", e.OVERFLOW_HIDDEN = "overflow-hidden", e.REGISTER = "rea9bf6dc47dbb2366c1afa36611a73648dbc3e74", e.SUBSCRIBER = "s20c9d4ef36eeca7c0e1f7d38398e98e01d305f60", e.TEMPORARY_NOTES = "temporary-notes", e.LEFT_0 = "left-0", e.REFRESH_AFTER_LOGIN = "refresh-after-login"; 437 }(t || (t = {})), function (e) { 438 e.ADBLOCKER = "__adblocker", e.USER_TYPE = "pb-user-type", e.USER_ID = "pb-user-id", e.TEMPORARY_NOTES = "pb-temporary-notes", e.TEXT_SIZE = "pb-text-size", e.THEME = "pb-theme", e.LOGIN = "__utp"; 439 }(n || (n = {})); 440 var a, s, i, o, r, c, d, l, u, p, m, h; 441 !function (e) { 442 e.DESKTOP = "desktop", e.TABLET = "tablet", e.MOBILE = "mobile"; 443 }(a || (a = {})), function (e) { 444 e.BIG = "big", e.DEFAULT = "default", e.EXTRABIG = "extrabig", e.MEDIUM = "medium"; 445 }(s || (s = {})), function (e) { 446 e.CHANGE_SIZE_MODAL = "change-size-modal", e.CHANGE_THEME_MODAL = "change-theme-modal", e.COMMENTS_MODAL = "comments-modal", e.MODAL_LANG = "data-modal-lang", e.MODAL_TARGET = "data-modal-target", e.MODAL_TARGET_OPTIONAL = "data-modal-target-optional", e.MODAL_TITLE = "data-modal-title", e.ORIGINAL_TEXT_SIZE = "data-original-text-size", e.READ_LATER_MODAL = "read-later-modal", e.TEXT_SIZE = "data-text-size", e.THEME = "data-theme", e.LISTEN_MODAL = "listen-modal", e.SHARE_MODAL = "share-modal", e.LANG_PUBLIC = "public", e.GOOGLE_AFTER_LOGIN_MODAL = "google-login", e.NEWSLETTER = "newsletter", e.NEWSLETTER_EXCLUSIVA = "newsletter-exclusiva"; 447 }(i || (i = {})), function (e) { 448 e.DOMAIN_NAME = "diaripublic.cat", e.SECTION_SLUG = "public"; 449 }(o || (o = {})), function (e) { 450 e.ARTICLE_TITLE = "article-title", e.ACTION_BUTTONS = ".action-buttons > li", e.ADS = ".pb-ads", e.ADS_CONTAINER = ".pb-ads-container", e.ADS_DYNAMIC_COUNT = ".pb-ads-count", e.ADS_DYNAMIC_POSITIONS = ".pb-desktop-dynamic-positions", e.ADS_DYNAMIC_MEGABANNER = ".pb-desktop-dynamic-megabanner", e.ADS_DYNAMIC_MEGABANNER_MOBILE = ".pb-mobile-dynamic-megabanner", e.ADS_DYNAMIC_OUTBRAIN = ".pb-desktop-dynamic-outbrain", e.ADS_DYNAMIC_OUTBRAIN_MOBILE = ".pb-mobile-dynamic-outbrain", e.ADS_DYNAMIC_ROBAPAGINAS = ".pb-desktop-dynamic-robapaginas", e.ADS_DYNAMIC_ROBAPAGINAS_MOBILE = ".pb-mobile-dynamic-robapaginas", e.ARTICLE = "article-page", e.ARTICLE_OUTBRAIN = "article-outbrain-container", e.AUTHOR = "author", e.BODY = "body", e.BTN_PUBLICO_COMMENTS = ".btn-publico-comments", e.BUTTON = "button", e.CHANGE_TEXT_SIZE_BT = ".change-text-size-bt", e.CHANGE_SIZE_MODAL_CLASS = ".change-size-modal", e.CHANGE_THEME = ".change-theme-bt", e.CHANGE_SHARE = ".change-share-bt", e.CHANGE_THEME_MODAL_CLASS = ".change-theme-modal", e.CLOSE = ".close", e.CLOSE_STICKY = ".sticky-botton-close", e.COMMENTS = ".comments", e.COMMENTS_ID = "comments", e.COMMENTS_BOX = ".comments-box", e.COMMENTS_CONTAINER = ".comment-container", e.COMMENTS_CONTAINER_ID = "comments-container", e.COMMENTS_COUNT = ".comments-count", e.COMMENTS_FORM = ".comment-form", e.COMMENTS_HEADER = ".comments-header", e.COMMENTS_LOGIN = ".comments-login", e.COMMENTS_RESPONSE = ".comment-responses", e.COPY_TEXT = ".copy-text", e.DATA_ID = "data-id", e.FOOTER_LEGAL_CONTAINER = "#footer_legal", e.DISCARD_COMMENT = ".discard-comment", e.DISCARD_RESPONSE = ".discard-response", e.EXCO_FOOTER = ".article-footer-exco", e.EXCO_INTEXT = ".article-intext-exco", e.FORM = "form", e.GOOGLE_LOGIN_FORM_MODAL = "#form-modal-google-login", e.HOME = "home", e.HEADER_NAV = "header-nav", e.HIDDEN_RESPONSES = ".hidden-responses", e.ID_COMMENTS = "comments", e.ICON_COPY_LINK = ".icon-copy-link", e.ICON_SPINNER_CONTAINER = ".icon-spinner-container", e.ICON_TWITTER = ".icon-x-twitter", e.ICON_BLUESKY = ".icon-bluesky", e.ICON_TELEGRAM = ".icon-telegram-plane", e.ICON_WHATSAPP = ".icon-whatsapp", e.ICON_WHATSAPP_DESKTOP = ".icon-whatsapp.wa-desktop", e.ICON_WHATSAPP_MOBILE = ".icon-whatsapp.wa-mobile", e.ICON_FACEBOOK = ".icon-facebook-f", e.INPUT_URL = ".input-url", e.INPUT_USER = ".input-user", e.INPUT_URL_RESPONSE = ".input-url-response", e.INPUT_USER_RESPONSE = ".input-user-response", e.INPUT_ID_RESPONSE = ".input-id-response", e.JOIN_US = ".join-us", e.LISTEN = ".listen", e.LISTEN_CONTAINER = ".listen-container", e.LOGIN = ".login", e.LOGIN_TEXT = ".login-text", e.LOGOUT = ".logout", e.MAIN_CONTENT = "main-content", e.MENU_ACTION_BUTTONS = ".menu-action-buttons > li", e.MODAL = ".modal", e.MODAL_CONTAINER = ".modal-container", e.MODAL_CONTAINER_ID = "modal
450-container", e.MODAL_CONTENT = ".modal-content", e.MODAL_CONTENT_ITEM = ".modal-content-item", e.MODAL_TITLE = ".modal-title", e.NAVBAR = ".navbar-menu", e.NAVBAR_POPUP = "navbar-menu-popup", e.NAVBAR_BACKGROUND = ".navbar-bg", e.NAVBAR_BT = ".navbar-menu-bt", e.NAVBAR_CLOSE_BT = ".navbar-close", e.NEW_COMMENT_ID = "new-comment", e.NEW_COMMENT = ".new-comment-btn", e.READ_LATER = ".read-later", e.READ_LATER_CONTAINER = ".read-later-container", e.READ_LATER_TEXT = ".read-later-text", e.RESPONSE_TEXTAREA = ".response-textarea", e.REGISTER = ".register", e.REPLY_COMMENT = ".reply-comment", e.SECTION = "page-category", e.SHARE_BTN = ".share-bt", e.SHARE_MODAL = ".share-modal", e.SEND_COMMENT = ".send-comment", e.SEND_RESPONSE = ".send-response", e.SELECT_NEWSLETTER = ".select-newsletter", e.SIDEBAR_FIXED_ROBAPAGINAS = "sidebar-fixed-robapaginas", e.SHOW_RESPONSES = ".show-responses", e.SUBSCRIPTION_BTN = ".subscribers-btn-container", e.SUBSCRIPTION_CLAIMS = ".subscription-claims", e.TAG = "tag", e.TEXTAREA = "textarea", e.TITLE = "title", e.SPAN = "span", e.SVG_CONTAINER = "svg-container", e.USER_LOGGED = ".user-logged"; 451 }(r || (r = {})), function (e) { 452 e.ARTICLE_TITLE = "article-title", e.ARTICLE_IMAGE = "article-main-image", e.MAM_TIME_ELEMENT_CONTENT = "mam-main-container", e.MAM_TIME_ELEMENT_TITLE = "h2.highlighted", e.MAM_TIME_ELEMENT_IMAGE = ".main-image figure", e.MAM_TIME_PARAM = "mamTime"; 453 }(c || (c = {})), function (e) { 454 e.MY_ACCOUNT = "Mi cuenta", e.NO_READ_LATER = "No leer después", e.READ_LATER = "Leer después", e.READ_LATER_PROCESO = "...", e.READ_LATER_ERROR = "Error al guardar", e.OCULTAR_RESPUESTAS = "Ocultar respuestas", e.MOSTRAR_RESPUESTAS = "Mostrar respuestas", e.MY_ACCOUNT_CAT = "El meu compte", e.NO_READ_LATER_CAT = "No llegir després", e.READ_LATER_CAT = "Llegir després", e.OCULTAR_RESPUESTAS_CAT = "Amagar respostes", e.MOSTRAR_RESPUESTAS_CAT = "Mostrar respostes"; 455 }(d || (d = {})), function (e) { 456 e.DARK = "dark", e.LIGHT = "light"; 457 }(l || (l = {})), function (e) { 458 e.ARTICLE = "article-page", e.CATEGORY = "category-page", e.HOME = "home-page"; 459 }(u || (u = {})), function (e) { 460 e.DUDAS = "#dudas--bloque", e.PREGUNTAS = "#preguntas--bloque", e.VENTAJAS = "#ventajas--bloque"; 461 }(p || (p = {})), function (e) { 462 e.FONT_SIZE = "pb-dbg-fontsize", e.LOGIN = "pb-login", e.THEME = "pb-dbg-theme"; 463 }(m || (m = {})), function (e) { 464 e.ANONYMOUS = "false", e.REGISTERED = "Registrado", e.SUBSCRIBER = "Suscriptor"; 465 }(h || (h = {})); 466 var g = ["text-xs", "text-sm", "text-base", "text-lg", "text-xl", "text-xl2", "text-xl4", "text-xl6", "text-xl8", "text-xxl", "text-xxl2", "text-xxl4", "text-xxl6", "text-xxl8", "text-xxxl", "text-xxxl2", "text-xxxl4", "text-xxxl6", "text-xxxl8", "text-xxxxl", "desktop:text-xs", "desktop:text-sm", "desktop:text-base", "desktop:text-lg", "desktop:text-xl", "desktop:text-xl2", "desktop:text-xl4", "desktop:text-xl6", "desktop:text-xl8", "desktop:text-xxl", "desktop:text-xxl2", "desktop:text-xxl4", "desktop:text-xxl6", "desktop:text-xxl8", "desktop:text-xxxl", "desktop:text-xxxl2", "desktop:text-xxxl4", "desktop:text-xxxl6", "desktop:text-xxxl8", "desktop:text-xxxxl"], 467 E = ["first-letter:text-x5l", "first-letter:text-x5l6", "first-letter:text-x6l2", "first-letter:text-x6l8", "desktop:first-letter:text-x5l4", "desktop:first-letter:text-x6l", "desktop:first-letter:text-x6l8", "desktop:first-letter:text-x7l2"], 468 b = ["manana-en-publico", "las-claves-de-ana"], 469 f = ["/mi-cuenta/cambiar-contrasena", "/mi-cuenta/login", "/mi-cuenta/logout", "/landing/registro"]; 470 function A(e) { 471 var t = "".concat(encodeURIComponent(e), "="), 472 n = document.cookie.split(";").map(function (e) { 473 return e.trim(); 474 }).find(function (e) { 475 return e.startsWith(t); 476 }); 477 return n ? decodeURIComponent(n.substring(t.length)) : null; 478 } 479 function S(e, t, n) { 480 var a = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "/"; 481 var s = ""; 482 if (null != n) if ("number" == typeof n) { 483 var _e = new Date(); 484 _e.setTime(_e.getTime() + 24 * n * 60 * 60 * 1e3), s = "; expires=".concat(_e.toUTCString()); 485 } else s = "; expires=".concat(n); 486 document.cookie = "".concat(encodeURIComponent(e), "=").concat(encodeURIComponent(t)).concat(s, "; path=").concat(a); 487 } 488 function T(e) { 489 var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "/"; 490 document.cookie = "".concat(encodeURIComponent(e), "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=").concat(t); 491 } 492 var _ = function _() { 493 var e = window.location.href;
494 return e.includes("admin-local") || e.includes("admin-pr") || e.includes("admin."); 495 }, 496 C = function C() { 497 return "undefined" != typeof document && (document.documentElement.classList.contains(t.MOBILE) || /iPhone|iPad|iPod|Android/i.test(navigator.userAgent)); 498 }, 499 I = { 500 debug: { 501 color: "#7f8c8d", 502 fontWeight: "normal" 503 }, 504 info: { 505 color: "#2980b9", 506 fontWeight: "normal" 507 }, 508 warn: { 509 color: "#f39c12", 510 fontWeight: "bold" 511 }, 512 error: { 513 color: "#e74c3c", 514 fontWeight: "bold" 515 } 516 }; 517 function L(e, t, n, a, s) { 518 if (!function (e) { 519 return "warn" === e || "error" === e || !1; 520 }(e)) return; 521 var i = I[e]; 522 i.color, i.fontWeight; 523 s.length; 524 } 525 function y(e) { 526 return { 527 debug: function debug(e, t) { 528 for (var _len = arguments.length, n = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 529 n[_key - 2] = arguments[_key]; 530 } 531 return L("debug", 0, 0, 0, n); 532 }, 533 info: function info(e, t) { 534 for (var _len2 = arguments.length, n = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { 535 n[_key2 - 2] = arguments[_key2]; 536 } 537 return L("info", 0, 0, 0, n); 538 }, 539 warn: function warn(e, t) { 540 for (var _len3 = arguments.length, n = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { 541 n[_key3 - 2] = arguments[_key3]; 542 } 543 return L("warn", 0, 0, 0, n); 544 }, 545 error: function error(e, t) { 546 for (var _len4 = arguments.length, n = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) { 547 n[_key4 - 2] = arguments[_key4]; 548 } 549 return L("error", 0, 0, 0, n); 550 } 551 }; 552 } 553 var N = y(); 554 var w = /*#__PURE__*/function () { 555 function w() { 556 _classCallCheck(this, w); 557 } 558 return _createClass(w, null, [{ 559 key: "updateHtmlClasses", 560 value: function updateHtmlClasses(e, n) { 561 var a = document.documentElement; 562 a && (a.classList.remove(t.SUBSCRIBER, t.REGISTER, t.ANONYMOUS), n && e !== h.SUBSCRIBER ? e === h.REGISTERED ? a.classList.add(t.REGISTER) : a.classList.add(t.ANONYMOUS) : a.classList.add(t.SUBSCRIBER), N.info("updateHtmlClasses", "Perfil de usuario aplicado", { 563 userType: e, 564 canShowAds: n 565 })); 566 } 567 }, { 568 key: "changeLoginToMyAccount", 569 value: function changeLoginToMyAccount() { 570 var e = document.getElementById(r.HEADER_NAV); 571 if (!e) return;
572 e.querySelectorAll(r.LOGIN).forEach(function (e) { 573 var _e$parentNode; 574 var t = e.cloneNode(!0); 575 (_e$parentNode = e.parentNode) === null || _e$parentNode === void 0 || _e$parentNode.replaceChild(t, e); 576 var n = t.querySelector(r.LOGIN_TEXT); 577 n ? n.textContent = d.MY_ACCOUNT : t.textContent = d.MY_ACCOUNT, t.addEventListener("click", function (e) { 578 e.preventDefault(), window.location.href = t.getAttribute("href") || "/mi-cuenta"; 579 }); 580 }), N.debug("changeLoginToMyAccount", 'Botón de "Inicia sesión" transformado en "Mi cuenta"'); 581 } 582 }]); 583 }(); 584 var x = y(); 585 var R = /*#__PURE__*/function () { 586 function R() { 587 _classCallCheck(this, R); 588 this.initialized = !1, this.id = "", this.doRedirectWhenDecline = !0; 589 } 590 return _createClass(R, [{ 591 key: "setDoNotRedirectWhenDecline", 592 value: function setDoNotRedirectWhenDecline() { 593 x.debug("setDoNotRedirectWhenDecline", "Anulamos la redirección a DIDOMI_DECLINE_REDIRECT cuando declinen el consentimiento."), this.doRedirectWhenDecline = !1; 594 } 595 }, { 596 key: "onConsentResolved", 597 value: function onConsentResolved(e) { 598 var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 599 var _t$fallbackIfNoTcfApi = t.fallbackIfNoTcfApi, 600 n = _t$fallbackIfNoTcfApi === void 0 ? !1 : _t$fallbackIfNoTcfApi, 601 _t$pollForTcfApi = t.pollForTcfApi, 602 a = _t$pollForTcfApi === void 0 ? !1 : _t$pollForTcfApi, 603 _t$maxRetries = t.maxRetries, 604 s = _t$maxRetries === void 0 ? 20 : _t$maxRetries, 605 _t$retryDelayMs = t.retryDelayMs, 606 i = _t$retryDelayMs === void 0 ? 100 : _t$retryDelayMs, 607 _o = function o(t) { 608 "function" == typeof window.__tcfapi ? window.__tcfapi("addEventListener", 2, function (t, n) { 609 n && t && R.TCF_RESOLVED_STATUSES.includes(t.eventStatus) && t.gdprApplies && (x.debug("onConsentResolved", "Consentimiento GDPR (TCF) resuelto, ejecutando callback"), e()); 610 }) : a && t > 0 ? setTimeout(function () { 611 return _o(t - 1); 612 }, i) : n && (x.warn("onConsentResolved", "No se detectó __tcfapi, se ejecuta el callback sin esperar consentimiento"), e()); 613 }; 614 _o(s); 615 } 616 }, { 617 key: "init", 618 value: function init() { 619 var _this = this; 620 var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 621 if (this.initialized) return void x.debug("init", "Didomi ya estaba inicializado, se omite"); 622 x.info("init", "Inicializando CMP y eventos de consentimiento GDPR"); 623 var t = location.pathname, 624 n = R.silentPages.includes(t); 625 window.didomiConfig = window.didomiConfig || {}, window.didomiConfig.user = { 626 bots: { 627 consentRequired: !1, 628 extraUserAgents: ["cXensebot"] 629 } 630 }, (e.suppressNotice || n) && (x.debug("init", "Modo silencioso activado, aviso de cookies oculto", { 631 isSilentPage: n, 632 suppressNotice: e.suppressNotice 633 }), window.didomiConfig.notice = { 634 enable: !1 635 }), this.loadPrivacyScript(); 636 var a = window.didomiOnReady || []; 637 window.didomiOnReady = a; 638 ["notice.clickdisagree", "preferences.clickdisagreetoall", "preferences.clickvendordisagree", "preferences.clickpurposedisagree", "preferences.clickcategorydisagree", "consent.changed"].forEach(function (e) { 639 a.push(function (t) { 640 t.on(e, function (n) { 641 var a = !1; 642 if (x.debug("init", "Evento de Didomi recibido: ".concat(e), n), "consent.changed" === e) { 643 var _e2 = t.getUserConsentStatusForAll(); 644 x.debug("init", "Estado de consentimientos", _e2), x.debug("init", "Contador de consents", "userConsents.purposes.disabled.length =", _e2.purposes.disabled.length, "userConsents.vendors.disabled.length =", _e2.vendors.disabled.length, "userConsents.purposes.enabled.length =", _e2.purposes.enabled.length, "userConsents.vendors.enabled.length =", _e2.vendors.enabled.length), "click" === n.action && (_e2.purposes.disabled.length > 2 || _e2.vendors.disabled.length > 2) && (a = !0); 645 } else a = !0; 646 if (a && (x.warn("init", "El usuario ha rechazado parte o todo el consentimiento, se resetea Didomi"), t.reset(), _this.doRedirectWhenDecline)) { 647 var _e3 = "//www.publico.es/landing/suscripciones?from=cmp"; 648 _e3 ? location.href = _e3 : x.error("init", "Falta definir DIDOMI_DECLINE_REDIRECT en las variables de entorno"); 649 } 650 }); 651 }); 652 }), a.push(function (e) { 653 var t = new URLSearchParams(location.search); 654 location.pathname.includes("landing/suscripciones") && "cmp" === t.get("from") && _this.hideNotice(e); 655 }), this.initialized = !0; 656 } 657 }, {
658 key: "loadPrivacyScript", 659 value: function loadPrivacyScript() { 660 if (!this.initialized) { 661 window.gdprAppliesGlobally = !0; 662 var _e6 = function _e4(t) { 663 if (!window.frames[t]) if (document.body && document.body.firstChild) { 664 var _e5 = document.createElement("iframe"); 665 _e5.style.display = "none", _e5.name = t, _e5.title = t, document.body.insertBefore(_e5, document.body.firstChild); 666 } else setTimeout(function () { 667 return _e6(t); 668 }, 5); 669 }, 670 _t = function _t(e, t, n, a, s) { 671 var i = function i(e, n, a, _i) { 672 if ("function" != typeof a) return; 673 var o = window[t] || []; 674 window[t] = o; 675 var r = !1; 676 s && (r = s(e, _i, a)), r || o.push({ 677 command: e, 678 version: n, 679 callback: a, 680 parameter: _i 681 }); 682 }; 683 i.stub = !0, i.stubVersion = 2; 684 var o = function o(t) { 685 if (!window[e] || !0 !== window[e].stub || !t.data) return; 686 var s = "string" == typeof t.data; 687 var i; 688 try { 689 i = s ? JSON.parse(t.data) : t.data; 690 } catch (_unused) { 691 return; 692 } 693 if (i[n]) { 694 var _o2 = i[n]; 695 window[e](_o2.command, _o2.version, function (e, n) { 696 var i = _defineProperty({}, a, { 697 returnValue: e, 698 success: n, 699 callId: _o2.callId 700 }); 701 t.source && t.source.postMessage(s ? JSON.stringify(i) : i, "*"); 702 }, _o2.parameter); 703 } 704 }; 705 "function" != typeof window[e] && (window[e] = i, window.addEventListener ? window.addEventListener("message", o, !1) : window.attachEvent("onmessage", o)); 706 }; 707 _t("__uspapi", "__uspapiBuffer", "__uspapiCall", "__uspapiReturn"), _e6("__uspapiLocator"), _t("__tcfapi", "__tcfapiBuffer", "__tcfapiCall", "__tcfapiReturn"), _e6("__tcfapiLocator"), function (e, _window$didomiConfig) { 708 var t = document.createElement("link"); 709 t.rel = "preconnect", t.href = "https://sdk.privacy-center.org/"; 710 var n = document.createElement("link"); 711 n.rel = "dns-prefetch", n.href = "https://sdk.privacy-center.org/"; 712 var a = "https://sdk.privacy-center.org/".concat(e, "/loader.js?target=").concat(document.location.hostname); 713 if ((_window$didomiConfig = window.didomiConfig) !== null && _window$didomiConfig !== void 0 && _window$didomiConfig.user) { 714 var _window$didomiConfig$ = window.didomiConfig.user, 715 _e7 = _window$didomiConfig$.country, 716 _t2 = _window$didomiConfig$.region; 717 _e7 && (a += "&country=".concat(_e7)), _e7 && _t2 && (a += "®ion=".concat(_t2)); 718 } 719 var s = document.createElement("link"); 720 s.rel = "preload", s.as = "script", s.href = a; 721 var i = document.createElement("script"); 722 i.id = "spcloader", i.type = "text/javascript", i.async = !0, i.charset = "utf-8", i.src = a; 723 var o = document.getElementsByTagName("script")[0]; 724 (o === null || o === void 0 ? void 0 : o.parentNode) && (o.parentNode.insertBefore(t, o), o.parentNode.insertBefore(n, o), o.parentNode.insertBefore(s, o), o.parentNode.insertBefore(i, o)); 725 }("d892ed41-2bfc-4977-a05e-07be26865229"); 726 } 727 } 728 }, { 729 key: "handleSuscriber", 730 value: function handleSuscriber() { 731 window.Didomi && (x.info("handleSuscriber", "Usuario suscriptor, se oculta el aviso de consentimiento sin alterar la decisión del usuario"), this.hideNotice(window.Didomi)); 732 } 733 }, { 734 key: "hideNotice", 735 value: function hideNotice(e) { 736 var _e$notice; 737 e === null || e === void 0 || (_e$notice = e.notice) === null || _e$notice === void 0 || _e$notice.hide(); 738 } 739 }, {
740 key: "resetConsentAfterSubscriberLogout", 741 value: function resetConsentAfterSubscriberLogout() { 742 window.Didomi && "function" == typeof window.Didomi.reset && (x.info("resetConsentAfterSubscriberLogout", "Suscriptor cerró sesión, se resetea el consentimiento para volver a mostrar el aviso"), window.Didomi.reset()); 743 } 744 }], [{ 745 key: "getInstance", 746 value: function getInstance() { 747 var e = "__DidomiService_instance__"; 748 return window[e] ? x.debug("getInstance", "Instancia creada previamente") : (x.debug("getInstance", "Creando instancia"), window[e] = new R(), window[e].id = crypto.randomUUID()), x.debug("getInstance", "Devolvemos instancia " + window[e].id), window[e]; 749 } 750 }]); 751 }(); 752 function O(_x, _x2, _x3, _x4) { 753 return _O.apply(this, arguments); 754 } 755 function _O() { 756 _O = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(e, t, n, a) { 757 var s, 758 i, 759 _args7 = arguments; 760 return _regeneratorRuntime().wrap(function _callee7$(_context7) { 761 while (1) switch (_context7.prev = _context7.next) { 762 case 0: 763 s = _args7.length > 4 && _args7[4] !== undefined ? _args7[4] : {}; 764 i = "https://api-eu.piano.io/id/api/v1/identity/userinfo?lang=en_US&aid=".concat(e.aid, "&access_token=").concat(n); 765 _context7.next = 4; 766 return fetch(i, _objectSpread({ 767 method: "PUT", 768 headers: { 769 "Content-Type": "application/json; charset=UTF-8" 770 }, 771 body: JSON.stringify({ 772 uid: t, 773 custom_field_values: a 774 }) 775 }, s.keepalive && { 776 keepalive: !0 777 })); 778 case 4: 779 return _context7.abrupt("return", _context7.sent.json()); 780 case 5: 781 case "end": 782 return _context7.stop(); 783 } 784 }, _callee7); 785 })); 786 return _O.apply(this, arguments); 787 } 788 R.silentPages = f, R.TCF_RESOLVED_STATUSES = ["tcloaded", "useractioncomplete"]; 789 var k = y(); 790 var D = /*#__PURE__*/function () { 791 function D() { 792 _classCallCheck(this, D); 793 this.abandonCFQueue = Promise.resolve(), this.CF_MAX_LEN = 3e3; 794 } 795 return _createClass(D, [{ 796 key: "track", 797 value: function track(e, t, n) { 798 var _this2 = this; 799 this.abandonCFQueue = this.abandonCFQueue.then(function () { 800 return _this2.processAbandonUpdate(e, t, n); 801 })["catch"](function (e) { 802 k.error("track", "Error procesando el seguimiento de abandono, se continúa sin bloquear", e); 803 }); 804 } 805 }, { 806 key: "getExtendedUser", 807 value: function getExtendedUser(e) { 808 return new Promise(function (t) { 809 e.pianoId.loadExtendedUser({ 810 formName: "customFieldsCustomForm", 811 extendedUserLoaded: function extendedUserLoaded(e) { 812 return t(e); 813 } 814 }); 815 }); 816 } 817 }, { 818 key: "processAbandonUpdate", 819 value: function () { 820 var _processAbandonUpdate = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, t, n) { 821 var a, _s, _i3, _o3, _r, _e8, _c, _d, _l, _u, _p, _m, _h; 822 return _regeneratorRuntime().wrap(function _callee$(_context) { 823 while (1) switch (_context.prev = _context.next) { 824 case 0: 825 a = t.pianoId.getUser(); 826 if (!a) { 827 _context.next = 30; 828 break; 829 } 830 _context.prev = 2; 831 _context.next = 5; 832 return this.getExtendedUser(t); 833 case 5: 834 _s = _context.sent; 835 _i3 = ((_s === null || _s === void 0 ? void 0 : _s.custom_field_values) || []).find(function (e) { 836 return "abandonoHistoricoCustomField" === (e === null || e === void 0 ? void 0 : e.field_name); 837 }); 838 _o3 = _i3 === null || _i3 === void 0 ? void 0 : _i3.value; 839 _r = []; 840 if ("string" == typeof _o3 && _o3) try { 841 _e8 = JSON.parse(_o3); 842 _r = Array.isArray(_e8) ? _e8 : []; 843 } catch (_unused2) { 844 k.warn("processAbandonUpdate", "El JSON del custom field era inválido, se resetea"); 845 } 846 _c = new Date().toISOString(), _d = _r.findIndex(function (t) { 847 return (t === null || t === void 0 ? void 0 : t.paso) === e.paso && (t === null || t === void 0 ? void 0 : t.term) === n; 848 }); 849 _d >= 0 ? (_r[_d].hits = (Number(_r[_d].hits) || 0) + 1, _r[_d].etiqueta = e.etiqueta, _r[_d].lastUpdated = _c) : _r.push({ 850 term: n, 851 paso: e.paso, 852 etiqueta: e.etiqueta, 853 hits: 1, 854 lastUpdated: _c 855 }), _r.sort(function (e, t) { 856 return ((t === null || t === void 0 ? void 0 : t.lastUpdated) || "").localeCompare((e === null || e === void 0 ? void 0 : e.lastUpdated) || ""); 857 }); 858 _l = JSON.stringify(_r); 859 for (; _l.length > this.CF_MAX_LEN && _r.length > 0;) _r.pop(), _l = JSON.stringify(_r); 860 _l.length > this.CF_MAX_LEN && (_r = [], _l = "[]"); 861 _u = new Date().toISOString().split("T")[0].replace(/-/g, "/"), _p = n; 862 50 === e.paso && (_p = "", _u = ""); 863 _m = [{ 864 field_name: "abandonoHistoricoCustomField", 865 value: _l 866 }, { 867 field_name: "abandonoPlanCustomField", 868 value: _p 869 }, { 870 field_name: "abandonoFechaCustomField", 871 value: _u 872 }], _h = t.pianoId.getToken(); 873 _context.next = 20; 874 return O(t, a.uid, _h, _m, { 875 keepalive: !0 876 }); 877 case 20: 878 k.debug("processAbandonUpdate", "Histórico de abandono guardado en Piano"); 879 _context.t0 = 50 !== e.paso; 880 if (!_context.t0) { 881 _context.next = 25; 882 break; 883 } 884 _context.next = 25; 885 return this.nullifyAbandonoIfHasAccess(t, a.uid, _h); 886 case 25: 887 _context.next = 30; 888 break; 889 case 27: 890 _context.prev = 27; 891 _context.t1 = _context["catch"](2); 892 k.error("processAbandonUpdate", "Error al procesar el seguimiento de abandono", _context.t1); 893 case 30: 894 case "end": 895 return _context.stop(); 896 } 897 }, _callee, this, [[2, 27]]); 898 })); 899 function processAbandonUpdate(_x5, _x6, _x7) { 900 return _processAbandonUpdate.apply(this, arguments); 901 } 902 return processAbandonUpdate; 903 }() 904 }, {
905 key: "nullifyAbandonoIfHasAccess", 906 value: function nullifyAbandonoIfHasAccess(e, t, n) { 907 return new Promise(function (a) { 908 e.api.callApi("/access/list", {}, /*#__PURE__*/function () { 909 var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) { 910 var _a; 911 return _regeneratorRuntime().wrap(function _callee2$(_context2) { 912 while (1) switch (_context2.prev = _context2.next) { 913 case 0: 914 if (!(s && s.count > 0)) { 915 _context2.next = 11; 916 break; 917 } 918 _context2.prev = 1; 919 _a = [{ 920 field_name: "abandonoPlanCustomField", 921 value: "" 922 }, { 923 field_name: "abandonoFechaCustomField", 924 value: "" 925 }]; 926 _context2.next = 5; 927 return O(e, t, n, _a, { 928 keepalive: !0 929 }); 930 case 5: 931 k.debug("nullifyAbandonoIfHasAccess", "Usuario con acceso, se limpian los campos de abandono de plan y fecha"); 932 _context2.next = 11; 933 break; 934 case 8: 935 _context2.prev = 8; 936 _context2.t0 = _context2["catch"](1); 937 k.warn("nullifyAbandonoIfHasAccess", "Error al limpiar los campos de abandono", _context2.t0); 938 case 11: 939 a(); 940 case 12: 941 case "end": 942 return _context2.stop(); 943 } 944 }, _callee2, null, [[1, 8]]); 945 })); 946 return function (_x8) { 947 return _ref.apply(this, arguments); 948 }; 949 }()); 950 }); 951 } 952 }], [{ 953 key: "getInstance", 954 value: function getInstance() { 955 return D.instance || (k.debug("getInstance", "Creando instancia"), D.instance = new D()), D.instance; 956 } 957 }]); 958 }(); 959 var v = /*#__PURE__*/function () { 960 function v() { 961 _classCallCheck(this, v); 962 } 963 return _createClass(v, null, [{ 964 key: "show", 965 value: function show(e) { 966 var t = document.getElementById("messageBox"); 967 t || (t = document.createElement("div"), t.id = "messageBox", Object.assign(t.style, { 968 position: "fixed", 969 top: "100px", 970 right: "20px", 971 color: "white", 972 padding: "10px 20px", 973 borderRadius: "8px", 974 boxShadow: "0 2px 10px rgba(0, 0, 0, 0.2)", 975 opacity: "0", 976 transition: "opacity 0.5s ease", 977 zIndex: "99999", 978 width: "90%", 979 maxWidth: "400px" 980 }), document.body.appendChild(t)); 981 var n = e.status ? "#38a169" : "#e53e3e"; 982 t.textContent = e.msg, t.style.backgroundColor = n, setTimeout(function () { 983 t && (t.style.opacity = "1"); 984 }, 0), setTimeout(function () { 985 t && (t.style.opacity = "0"); 986 }, 3e3); 987 } 988 }]); 989 }(); 990 var M = y(); 991 var U = /*#__PURE__*/function () { 992 function U() { 993 _classCallCheck(this, U); 994 } 995 return _createClass(U, null, [{ 996 key: "registerHandlers", 997 value: function registerHandlers(e, t, a) { 998 e && "function" == typeof e.push && (M.debug("registerHandlers", "Registrando los eventos globales de Piano"), e.push(["addHandler", "checkoutClose", function (e) { 999 M.debug("registerHandlers", "El usuario ha cerrado el checkout", e), e && "checkoutCompleted" === e.state ? location.reload() : a(); 1000 }]), e.push(["addHandler", "meterExpired", function (e) { 1001 M.info("registerHandlers", "LÃmite de artÃculos gratuitos agotado para este usuario", e); 1002 }]), e.push(["addHandler", "logout", function () { 1003 M.info("registerHandlers", "Cierre de sesión detectado desde Piano"), t.getUserType() === h.SUBSCRIBER && R.getInstance().resetConsentAfterSubscriberLogout(), T(n.USER_ID), T(n.USER_TYPE), location.reload(); 1004 }]), e.push(["addHandler", "checkoutCustomEvent", function (t) { 1005 M.debug("registerHandlers", "Evento personalizado de checkout detectado", t), t && "create-cookie" === t.eventName ? U.handleCreateCookie(t.params) : t && "update-custom-field" === t.eventName && U.handleUpdate
1005CustomField(t.params, e); 1006 }]), e.push(["addHandler", "submitPayment", function (t) { 1007 M.info("registerHandlers", "El usuario ha intentado enviar el pago", t), U.submitCounter++, U.submitCounter > 3 && (v.show({ 1008 status: !1, 1009 msg: "Por favor, comprueba que están todos los datos correctamente cumplimentados, incluido el método de pago." 1010 }), U.submitCounter = 0), U.pushToDataLayer(49, "continuar-pago", e); 1011 }]), e.push(["addHandler", "loginDisplayed", function () { 1012 U.pushToDataLayer(32, "login", e); 1013 }]), e.push(["addHandler", "loginRequired", function () { 1014 U.pushToDataLayer(30, "registro", e); 1015 }]), e.push(["addHandler", "registrationSuccess", function () { 1016 U.pushToDataLayer(31, "conversion-registro", e); 1017 }]), e.push(["addHandler", "loginSuccess", function (t) { 1018 M.info("registerHandlers", "Inicio de sesión correcto", t), U.pushToDataLayer(32, "conversion-login", e); 1019 var n = !0; 1020 var a = document.querySelector("div.tp-modal iframe"); 1021 a && a instanceof HTMLIFrameElement && a.src && (a.src.includes("offer") || a.src.includes("checkout")) && (n = !1, M.debug("registerHandlers", "No se recarga la página: el usuario está en medio de un proceso de compra")), n && location.reload(); 1022 }]), e.push(["addHandler", "startCheckout", function (e) { 1023 M.info("registerHandlers", "El usuario ha iniciado el proceso de checkout", e), U.currentTermName = (e === null || e === void 0 ? void 0 : e.termName) || ""; 1024 }]), e.push(["addHandler", "checkoutSelectTerm", function (e) { 1025 M.debug("registerHandlers", "Nuevo término de suscripción seleccionado", e), U.currentTermName = (e === null || e === void 0 ? void 0 : e.termName) || ""; 1026 }]), e.push(["addHandler", "checkoutStateChange", function (t) { 1027 var n = (t === null || t === void 0 ? void 0 : t.stateName) && U.CHECKOUT_STATE_DATALAYER[t.stateName]; 1028 n && U.pushToDataLayer(n.paso, n.etiqueta, e); 1029 }]), e.push(["addHandler", "checkoutComplete", function (t) { 1030 M.info("registerHandlers", "Suscripción completada con éxito", t), U.pushToDataLayer(50, "conversion-suscripcion", e); 1031 }])); 1032 } 1033 }, { 1034 key: "handleCreateCookie", 1035 value: function handleCreateCookie(e) { 1036 if (e && e.cookie) { 1037 var _t3 = "_pc_cookie_".concat(e.cookie), 1038 _n = e.expirationDays ? parseInt(e.expirationDays, 10) : 7, 1039 _a2 = new Date(); 1040 _a2.setTime(_a2.getTime() + 24 * _n * 60 * 60 * 1e3), document.cookie = "".concat(_t3, "=true;expires=").concat(_a2.toUTCString(), ";path=/"), M.debug("handleCreateCookie", "Cookie creada desde el checkout", _t3); 1041 } 1042 } 1043 }, { 1044 key: "handleUpdateCustomField", 1045 value: function () { 1046 var _handleUpdateCustomField = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e, t) { 1047 var n, a, s, i, _e9; 1048 return _regeneratorRuntime().wrap(function _callee3$(_context3) { 1049 while (1) switch (_context3.prev = _context3.next) { 1050 case 0: 1051 n = e === null || e === void 0 ? void 0 : e.field; 1052 a = e === null || e === void 0 ? void 0 : e.value; 1053 "now" === a && (a = new Date().toISOString().split("T")[0].replace(/-/g, "/")); 1054 s = t.pianoId.getUser(), i = t.pianoId.getToken(); 1055 if (!(n && a && s && i)) { 1056 _context3.next = 15; 1057 break; 1058 } 1059 _context3.prev = 5; 1060 _context3.next = 8; 1061 return O(t, s.uid, i, [{ 1062 field_name: n, 1063 value: a 1064 }]); 1065 case 8: 1066 _e9 = _context3.sent; 1067 M.debug("handleUpdateCustomField", "Campo personalizado actualizado", _e9); 1068 _context3.next = 15; 1069 break; 1070 case 12: 1071 _context3.prev = 12; 1072 _context3.t0 = _context3["catch"](5);
1073 M.error("handleUpdateCustomField", "Error al actualizar el campo personalizado", _context3.t0); 1074 case 15: 1075 case "end": 1076 return _context3.stop(); 1077 } 1078 }, _callee3, null, [[5, 12]]); 1079 })); 1080 function handleUpdateCustomField(_x9, _x0) { 1081 return _handleUpdateCustomField.apply(this, arguments); 1082 } 1083 return handleUpdateCustomField; 1084 }() 1085 }, { 1086 key: "pushToDataLayer", 1087 value: function pushToDataLayer(e, t, n) { 1088 window.dataLayer && (window.dataLayer.push({ 1089 event: "funnel", 1090 paso: e, 1091 etiqueta: t 1092 }), n && n.pianoId && n.pianoId.getUser() && e >= 40 && e <= 50 && D.getInstance().track({ 1093 paso: e, 1094 etiqueta: t 1095 }, n, U.currentTermName)); 1096 } 1097 }]); 1098 }(); 1099 U.currentTermName = "", U.submitCounter = 0, U.CHECKOUT_STATE_DATALAYER = { 1100 state2: { 1101 paso: 40, 1102 etiqueta: "seleccion-metodo-de-pago" 1103 }, 1104 giftParams: { 1105 paso: 33, 1106 etiqueta: "regala-datos" 1107 }, 1108 redemptionCodeApplied: { 1109 paso: 21, 1110 etiqueta: "regala-codigo" 1111 } 1112 }; 1113 var P = y(); 1114 var B = /*#__PURE__*/function () { 1115 function B() { 1116 _classCallCheck(this, B); 1117 } 1118 return _createClass(B, null, [{ 1119 key: "addDidomiConfigFooterLink", 1120 value: function addDidomiConfigFooterLink() { 1121 var _document$querySelect; 1122 var e = location.pathname; 1123 if (R.silentPages && R.silentPages.includes(e)) return; 1124 var t = (_document$querySelect = document.querySelector(r.FOOTER_LEGAL_CONTAINER)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.querySelector("ul"); 1125 if (t) { 1126 var _e0 = document.createElement("li"); 1127 _e0.className = "text-sm mb-1"; 1128 var _n2 = document.createElement("a"); 1129 _n2.className = "hover:underline", _n2.href = "javascript:Didomi.preferences.show()", _n2.textContent = function () { 1130 if ("undefined" == typeof document) return !1; 1131 var _document$location = document.location, 1132 e = _document$location.hostname, 1133 t = _document$location.pathname; 1134 return e.includes(o.DOMAIN_NAME) || t === o.SECTION_SLUG || t.includes("".concat(o.SECTION_SLUG, "/")); 1135 }() ? "Configuració de cookies" : "Configurar cookies", _e0.appendChild(_n2), t.appendChild(_e0); 1136 } 1137 } 1138 }, { 1139 key: "initPianoFaldonListener", 1140 value: function initPianoFaldonListener() { 1141 window.addEventListener("message", function (e) { 1142 if (e.data && "ajustar-footer-colapsable" === e.data.type) { 1143 var _e1 = document.querySelector("footer"); 1144 _e1 && _e1.style.setProperty("padding-bottom", "5.25rem"); 1145 } 1146 }, !1); 1147 } 1148 }, { 1149 key: "initCarousel", 1150 value: function initCarousel() { 1151 var _e$querySelectorAll; 1152 var e = document.querySelector(".carrousel"), 1153 t = (_e$querySelectorAll = e === null || e === void 0 ? void 0 : e.querySelectorAll("li")) !== null && _e$querySelectorAll !== void 0 ? _e$querySelectorAll : [], 1154 n = document.querySelector(".carrousel-prev"), 1155 a = document.querySelector(".carrousel-next"); 1156 if (C() || !e || !n || !a || t.length <= 4) return n && (n.style.display = "none"), void (a && (a.style.display = "none")); 1157 var s = 1; 1158 var i = Math.ceil(t.length / 4), 1159 o = 4 * t[0].clientWidth, 1160 r = function r() { 1161 n.style.display = s <= 1 ? "none" : "block", a.style.display = s >= i ? "none" : "block"; 1162 }; 1163 r(), a.addEventListener("click", function () { 1164 s < i && (e.scrollBy({ 1165 left: o, 1166 behavior: "smooth" 1167 }), s++, r()); 1168 }), n.addEventListener("click", function () { 1169 s > 1 && (e.scrollBy({ 1170 left: -o, 1171 behavior: "smooth" 1172 }), s--, r()); 1173 }); 1174 } 1175 }, { 1176 key: "initHeaderButtons", 1177 value: function initHeaderButtons() { 1178 var e = document.querySelector(r.NAVBAR_BT), 1179 n = document.querySelector(r.NAVBAR), 1180 a = document.getElementById("navbar-menu-popup"),
1181 s = n === null || n === void 0 ? void 0 : n.querySelector(r.NAVBAR_CLOSE_BT), 1182 i = n === null || n === void 0 ? void 0 : n.querySelector(r.NAVBAR_BACKGROUND), 1183 o = document.querySelector("main.container.relative"), 1184 c = document.getElementById("sub-fixed-footer"), 1185 d = document.getElementById("sub-fixed-footer2"), 1186 l = document.getElementById("pb-login-popup"); 1187 e !== null && e !== void 0 && e.addEventListener("click", function (e) { 1188 e.preventDefault(), a !== null && a !== void 0 && a.classList.remove("-left-[600px]"), a !== null && a !== void 0 && a.classList.add(t.LEFT_0), i !== null && i !== void 0 && i.classList.remove(t.HIDDEN), document.body.classList.add(t.OVERFLOW_HIDDEN), o !== null && o !== void 0 && o.classList.remove("z-20"), o !== null && o !== void 0 && o.classList.add("z-[41]"), c !== null && c !== void 0 && c.classList.remove("z-[51]"), c !== null && c !== void 0 && c.classList.add("z-40"), d !== null && d !== void 0 && d.classList.remove("z-[51]"), d !== null && d !== void 0 && d.classList.add("z-40"), l !== null && l !== void 0 && l.classList.remove("z-[51]"), l === null || l === void 0 ? void 0 : l.classList.add("z-40"); 1189 }), s !== null && s !== void 0 && s.addEventListener("click", function (e) { 1190 e.preventDefault(), a !== null && a !== void 0 && a.classList.add("-left-[600px]"), a !== null && a !== void 0 && a.classList.remove(t.LEFT_0), i !== null && i !== void 0 && i.classList.add(t.HIDDEN), document.body.classList.remove(t.OVERFLOW_HIDDEN), o !== null && o !== void 0 && o.classList.remove("z-[41]"), o !== null && o !== void 0 && o.classList.add("z-20"), c !== null && c !== void 0 && c.classList.remove("z-40"), c !== null && c !== void 0 && c.classList.add("z-[51]"), d !== null && d !== void 0 && d.classList.remove("z-40"), d !== null && d !== void 0 && d.classList.add("z-[51]"), l !== null && l !== void 0 && l.classList.remove("z-40"), l === null || l === void 0 ? void 0 : l.classList.add("z-[51]"); 1191 }), i === null || i === void 0 ? void 0 : i.addEventListener("click", function (e) { 1192 e.preventDefault(), s === null || s === void 0 ? void 0 : s.dispatchEvent(new Event("click")); 1193 }); 1194 } 1195 }, { 1196 key: "initTodayInterest", 1197 value: function initTodayInterest() { 1198 if (document.body.classList.contains("pb-desktop")) { 1199 var _e10 = document.getElementById("hoy-interesa"); 1200 if (_e10) { 1201 var _t4 = _e10.querySelector("ul"), 1202 _n3 = _e10.querySelectorAll("li"); 1203 if (!_t4 || !_n3) return; 1204 var _a3 = 0, 1205 _s2 = !1, 1206 _i4 = [], 1207 _o4 = document.createElement("li"); 1208 _o4.innerHTML = '<span class="icon-chevron-down mr-1" style="font-size:0.5rem;"></span> <span class="hover:underline">Más</span><ul class="hidden absolute mt-2 px-1.5 z-[51] right-0 shadow bg-warm-gray-100 dark:bg-cold-gray-700"></ul>', _o4.classList.add("more-item", "tablet:hidden", "relative", "cursor-pointer", "px-1", "py-2", "flex-shrink-0", "dark:text-cold-gray-100"), _n3.forEach(function (e) { 1209 _a3 += e.clientWidth, _a3 > _t4.clientWidth && (_i4.push(e), _s2 = !0); 1210 }); 1211 var _r2 = _o4.querySelector("ul"); 1212 _r2 && (_i4.forEach(function (e) { 1213 e.remove(), e.classList.add("whitespace-nowrap"), _r2.appendChild(e); 1214 }), _s2 && (_t4.appendChild(_o4), _t4.classList.remove("desktop:w-[944px]"), _t4.classList.add("desktop:w-[990px]"), _o4.addEventListener("click", function (t) { 1215 t.preventDefault(), _o4.classList.contains("active") ? (_o4.classList.remove("active", "bg-warm-gray-100", "dark:bg-cold-gray-700"), _r2.classList.add("hidden"), _e10.classList.add("overflow-x-auto", "desktop:overflow-hidden")) : (_o4.classList.add("active", "bg-warm-gray-100", "dark:bg-cold-gray-700"), _r2.classList.remove("hidden"), _e10.classList.remove("overflow-x-auto", "desktop:overflow-hidden")); 1216 }))); 1217 } 1218 } 1219 } 1220 }, {
1221 key: "handlerDesktopAdsDynamicPositions", 1222 value: function handlerDesktopAdsDynamicPositions() { 1223 if (!C()) { 1224 var _e11 = r.ADS_DYNAMIC_POSITIONS; 1225 var _t5 = {}; 1226 document.querySelectorAll(_e11).forEach(function (e) { 1227 var n = e.getAttribute("data-id"); 1228 n && (_t5[n] = _t5[n] ? _t5[n] + 1 : 1, e.id = n + _t5[n]); 1229 }); 1230 } 1231 } 1232 }, { 1233 key: "handlerRobapaginasDesktopHeigth", 1234 value: function handlerRobapaginasDesktopHeigth() { 1235 if (document.documentElement.classList.contains(t.DESKTOP)) { 1236 P.debug("handlerRobapaginasDesktopHeigth", "Ajustando la altura del robapáginas"); 1237 var _e12 = document.getElementById(r.SIDEBAR_FIXED_ROBAPAGINAS), 1238 _t6 = document.getElementById(r.MAIN_CONTENT); 1239 _e12 && _t6 && _t6.clientHeight > 0 && (_e12.style.height = parseInt(_t6.clientHeight.toString()) - 1500 + "px"); 1240 } 1241 } 1242 }, { 1243 key: "removeDesktopMinHeightClass", 1244 value: function removeDesktopMinHeightClass(e) { 1245 if (e.canWriteComments()) { 1246 var _e13 = document.getElementById(r.MAIN_CONTENT); 1247 if (_e13) { 1248 var _t7 = Array.from(_e13.children).find(function (e) { 1249 return e.classList.contains("desktop:min-h-[1400px]"); 1250 }); 1251 _t7 && (_t7.classList.remove("desktop:min-h-[1400px]"), P.debug("removeDesktopMinHeightClass", "Clase de altura mÃnima eliminada (usuario con permiso para comentar)")); 1252 } 1253 } 1254 } 1255 }]); 1256 }(); 1257 var H = y(); 1258 var G = /*#__PURE__*/function () { 1259 function G() { 1260 _classCallCheck(this, G); 1261 } 1262 return _createClass(G, null, [{ 1263 key: "handleActionButtons", 1264 value: function handleActionButtons(e) { 1265 H.debug("handleActionButtons", "Inicializando listeners de botones de acción"); 1266 var t = "".concat(r.MENU_ACTION_BUTTONS, ", ").concat(r.ACTION_BUTTONS, ":not(").concat(r.SHARE_BTN, "), ").concat(r.BTN_PUBLICO_COMMENTS); 1267 document.querySelectorAll(t).forEach(function (t) { 1268 var n = t.getAttribute(i.MODAL_TARGET); 1269 n !== i.CHANGE_SIZE_MODAL && n !== i.CHANGE_THEME_MODAL && n !== i.LISTEN_MODAL && n !== i.READ_LATER_MODAL && n !== i.COMMENTS_MODAL || t.addEventListener("click", function (a) { 1270 a.preventDefault(); 1271 var s = !0; 1272 var o = String(e.getUserType()); 1273 if (!(o === String(h.REGISTERED) || o === String(h.SUBSCRIBER)) || n !== i.COMMENTS_MODAL && n !== i.READ_LATER_MODAL || (H.debug("handleActionButtons", "Usuario autenticado, se ejecuta la acción directamente en vez de mostrar el modal"), G.handleCustomActionButtons(e), s = !1), s) { 1274 var _t$getAttribute, _t$getAttribute2, _t$getAttribute3; 1275 var _n4 = (_t$getAttribute = t.getAttribute(i.MODAL_TARGET)) !== null && _t$getAttribute !== void 0 ? _t$getAttribute : "", 1276 _a4 = e.getFeatures(), 1277 _s3 = (_t$getAttribute2 = t.getAttribute(i.MODAL_TITLE)) !== null && _t$getAttribute2 !== void 0 ? _t$getAttribute2 : "", 1278 _o5 = (_t$getAttribute3 = t.getAttribute(i.MODAL_LANG)) !== null && _t$getAttribute3 !== void 0 ? _t$getAttribute3 : "", 1279 _r3 = K.getInstance(); 1280 _r3.updateModalData({ 1281 id: _n4, 1282 url: "", 1283 text: "", 1284 title: _s3, 1285 lang: _o5, 1286 userFeatures: _a4 1287 }), _r3.show(); 1288 } 1289 }); 1290 }), this.handleShareButtons(e); 1291 } 1292 }, { 1293 key: "handleShareButtons", 1294 value: function handleShareButtons(e) { 1295 var n = document.querySelectorAll(r.SHARE_BTN); 1296 0 !== n.length && n.forEach(function (n) { 1297 n.addEventListener("click", function (a) { 1298 var _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5, _document$querySelect6, _document$querySelect7; 1299 a.preventDefault(); 1300 var s = (_document$querySelect2 = (_document$querySelect3 = document.querySelector('meta[property="og:title"]')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.getAttribute("content")) !== null && _document$querySelect2 !== void 0 ? _document$querySelect2 : "", 1301 o = (_document$querySelect4 = (_document$querySelect5 = document.querySelector('meta[property="og:url"]')) === null || _document$querySelect5 === void 0 ? void 0 : _document$querySelect5.getAttribute("content")) !== null && _document$querySelect4 !== void 0 ? _document$querySelect4 : ""; 1302 o || (o = (_document$querySelect6 = (_document$querySelect7 = document.querySelector('link[rel="canonical"]')) === null || _document$querySelect7 === void 0 ? void 0 : _document$querySelect7.getAttribute("href")) !== null && _document$querySelect6 !== void 0 ? _document$querySelect6 : ""); 1303 var c = n.getAttribute("href"), 1304 d = n.parentElement, 1305 l = d === null || d === void 0 ? void 0 : d.nextElementSibling; 1306 if (c && l) { 1307 s = (l === null || l === void 0 ? void 0 : l.textContent) || s, o = c; 1308 var _e14 = new MutationObserver(function () { 1309 var n = document.querySelector(r.SHARE_MODAL); 1310 if (n) { 1311 var _a5 = n.querySelector('li[title="Copiar enlace"]'), 1312 _s4 = n.querySelector(r.COPY_TEXT); 1313 _a5 && _s4 && (_a5.classList.remove(t.HIDDEN), _a5.addEventListener("click", function () { 1314 navigator.clipboard.writeText(o), _s4.textContent = "Enlace copiado"; 1315 })), _e14.disconnect(); 1316 } 1317 }); 1318 _e14.observe(document.body, { 1319 childList: !0, 1320 subtree: !0 1321 }); 1322 } 1323 var u = new URL(window.location.href).searchParams.get("action"), 1324 p = K.getInstance(), 1325 m = C(); 1326 if (navigator.share && m && !u) H.debug("handleShareButtons", "Compartiendo mediante el menú nativo del dispositivo"), navigator.share({ 1327 title: s, 1328 text: s,
1329 url: p.buildShareUrl(o, "native_share") 1330 });else { 1331 var _n$getAttribute, _n$getAttribute2, _n$getAttribute3; 1332 H.debug("handleShareButtons", "Mostrando modal de compartir"); 1333 var _t8 = (_n$getAttribute = n.getAttribute(i.MODAL_TARGET)) !== null && _n$getAttribute !== void 0 ? _n$getAttribute : "", 1334 _a6 = e.getFeatures(), 1335 _r4 = (_n$getAttribute2 = n.getAttribute(i.MODAL_TITLE)) !== null && _n$getAttribute2 !== void 0 ? _n$getAttribute2 : "", 1336 _c2 = (_n$getAttribute3 = n.getAttribute(i.MODAL_LANG)) !== null && _n$getAttribute3 !== void 0 ? _n$getAttribute3 : ""; 1337 p.updateModalData({ 1338 id: _t8, 1339 url: o, 1340 text: s, 1341 title: _r4, 1342 lang: _c2, 1343 userFeatures: _a6 1344 }), p.show(); 1345 } 1346 }); 1347 }); 1348 } 1349 }, { 1350 key: "handleCustomActionButtons", 1351 value: function handleCustomActionButtons(e) { 1352 var _document$body$getAtt; 1353 var t = e === null || e === void 0 ? void 0 : e.getReadLater(), 1354 n = (_document$body$getAtt = document.body.getAttribute(r.DATA_ID)) !== null && _document$body$getAtt !== void 0 ? _document$body$getAtt : ""; 1355 t && t.includes(n) && (document.querySelectorAll(".read-later span").forEach(function (e) { 1356 e.classList.remove("icon-bookmark"), e.classList.add("icon-bookmark-solid"); 1357 }), document.querySelectorAll(".read-later-text").forEach(function (e) { 1358 e.textContent = d.NO_READ_LATER; 1359 })); 1360 var a = document.querySelectorAll(r.ACTION_BUTTONS); 1361 e.canListenArticle() && G.handlerListenButton(a), e.canReadLater() && G.handlerReadLaterButton(a), e.canReadComments() && G.handlerCommentsButton(a); 1362 } 1363 }, { 1364 key: "handlerListenButton", 1365 value: function handlerListenButton(e) { 1366 var _this3 = this; 1367 e.forEach(function (e) { 1368 e.getAttribute(i.MODAL_TARGET) === i.LISTEN_MODAL && (e = _this3.unbindEvent(e)).addEventListener("click", function (e) { 1369 e.preventDefault(), H.debug("handlerListenButton", "Reproductor de audio activado"); 1370 }); 1371 }); 1372 } 1373 }, { 1374 key: "handlerReadLaterButton", 1375 value: function handlerReadLaterButton(e) { 1376 var _this4 = this; 1377 e.forEach(function (e) { 1378 if (e.getAttribute(i.MODAL_TARGET) === i.READ_LATER_MODAL) { 1379 e = _this4.unbindEvent(e); 1380 var _t9 = document.body.getAttribute(r.DATA_ID); 1381 e.addEventListener("click", /*#__PURE__*/function () { 1382 var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(n) { 1383 var _e15, _e16; 1384 var a, s, i, o, c, l, u, _e17; 1385 return _regeneratorRuntime().wrap(function _callee4$(_context4) { 1386 while (1) switch (_context4.prev = _context4.next) { 1387 case 0: 1388 n.preventDefault(); 1389 a = (_e15 = e) === null || _e15 === void 0 ? void 0 : _e15.querySelector(r.SPAN), s = (_e16 = e) === null || _e16 === void 0 ? void 0 : _e16.querySelector(r.READ_LATER_TEXT), i = n.currentTarget.closest(".page-content"), o = i === null || i === void 0 ? void 0 : i.querySelectorAll(".read-later-container button span"), c = i === null || i === void 0 ? void 0 : i.querySelectorAll(r.READ_LATER_TEXT), l = a === null || a === void 0 ? void 0 : a.classList.contains("icon-bookmark-solid"), u = l ? "remove" : "add"; 1390 _context4.prev = 2; 1391 s && (s.textContent = d.READ_LATER_PROCESO); 1392 _context4.next = 6; 1393 return fetch("/mi-cuenta/forms/readlater", { 1394 method: "POST", 1395 headers: { 1396 "Content-Type": "application/json" 1397 }, 1398 body: JSON.stringify({ 1399 id: _t9, 1400 action: u 1401 }) 1402 }); 1403 case 6: 1404 _e17 = _context4.sent; 1405 if (_e17.ok) { 1406 _context4.next = 9; 1407 break; 1408 } 1409 throw s && (s.textContent = d.READ_LATER_ER
1409ROR), new Error("Error en la respuesta: ".concat(_e17.status)); 1410 case 9: 1411 "add" === u ? (a !== null && a !== void 0 && a.classList.remove("icon-bookmark"), a !== null && a !== void 0 && a.classList.add("icon-bookmark-solid"), s && (s.textContent = d.NO_READ_LATER)) : (o && o.forEach(function (e) { 1412 e.classList.remove("icon-bookmark-solid"), e.classList.add("icon-bookmark"); 1413 }), c && c.forEach(function (e) { 1414 return e.textContent = d.READ_LATER; 1415 }), s && (s.textContent = d.READ_LATER)); 1416 _context4.next = 15; 1417 break; 1418 case 12: 1419 _context4.prev = 12; 1420 _context4.t0 = _context4["catch"](2); 1421 s && (s.textContent = d.READ_LATER_ERROR), H.warn("handlerReadLaterButton", 'No se pudo actualizar el estado de "leer después"', _context4.t0); 1422 case 15: 1423 case "end": 1424 return _context4.stop(); 1425 } 1426 }, _callee4, null, [[2, 12]]); 1427 })); 1428 return function (_x1) { 1429 return _ref2.apply(this, arguments); 1430 }; 1431 }()); 1432 } 1433 }); 1434 } 1435 }, { 1436 key: "handlerCommentsButton", 1437 value: function handlerCommentsButton(e) { 1438 var _this5 = this; 1439 e.forEach(function (e) { 1440 e.getAttribute(i.MODAL_TARGET) === i.COMMENTS_MODAL && (e = _this5.unbindEvent(e)).addEventListener("click", function (e) { 1441 e.preventDefault(); 1442 var t = document.getElementById(r.ID_COMMENTS); 1443 if (t) { 1444 var _e18 = t.getBoundingClientRect(), 1445 _n5 = window.scrollY || document.documentElement.scrollTop; 1446 window.scrollTo({ 1447 top: _e18.top + _n5 - 70, 1448 behavior: "smooth" 1449 }); 1450 } 1451 }); 1452 }); 1453 } 1454 }, { 1455 key: "unbindEvent", 1456 value: function unbindEvent(e) { 1457 var _e$parentNode2; 1458 var t = e.cloneNode(!0); 1459 return (_e$parentNode2 = e.parentNode) !== null && _e$parentNode2 !== void 0 && _e$parentNode2.replaceChild(t, e), t; 1460 } 1461 }]); 1462 }(); 1463 var F = y(); 1464 var z = /*#__PURE__*/function () { 1465 function z() { 1466 _classCallCheck(this, z); 1467 } 1468 return _createClass(z, null, [{ 1469 key: "changeTheme", 1470 value: function changeTheme(e, a) { 1471 F.info("changeTheme", "Tema aplicado", e), e === l.DARK ? (document.documentElement.classList.add(t.DARKMODE), document.documentElement.classList.remove(t.LIGHTMODE)) : e === l.LIGHT && (document.documentElement.classList.add(t.LIGHTMODE), document.documentElement.classList.remove(t.DARKMODE)), a && S(n.THEME, e, 365); 1472 var s = document.querySelectorAll('iframe[src*="template"]'); 1473 if (s && s.length > 0) { 1474 var _t0 = JSON.stringify({ 1475 action: "publicoTheme", 1476 theme: e 1477 }); 1478 s.forEach(function (e) { 1479 try { 1480 e.contentWindow && e.contentWindow.postMessage(_t0, "*"); 1481 } catch (e) { 1482 F.warn("changeTheme", "No se pudo enviar el tema al iframe", e); 1483 } 1484 }); 1485 } 1486 } 1487 }]); 1488 }(); 1489 var q = y(); 1490 var $ = /*#__PURE__*/function () { 1491 function $() { 1492 _classCallCheck(this, $); 1493 } 1494 return _createClass($, null, [{ 1495 key: "changeFontSize", 1496 value: function changeFontSize(e, t) { 1497 var _this6 = this; 1498 if (q.info("changeFontSize", "Tamaño de fuente aplicado", e), !Object.values([s.DEFAULT, s.MEDIUM, s.BIG, s.EXTRABIG]).includes(e)) return; 1499 Array.from(document.querySelectorAll("[".concat(i.ORIGINAL_TEXT_SIZE, "]"))).filter(function (e) { 1500 return "" !== e.getAttribute(i.ORIGINAL_TEXT_SIZE); 1501 }
1501).forEach(function (t) { 1502 var n = t.getAttribute(i.ORIGINAL_TEXT_SIZE); 1503 if (!n) return; 1504 var a = n, 1505 o = n; 1506 if (n.includes(":")) { 1507 var _e19 = n.includes("desktop:") ? n.split("desktop:") : n.split(":"); 1508 o = _e19[0].trim(), a = _e19[1].trim(); 1509 } 1510 Array.from(t.classList).filter(function (e) { 1511 return g.includes(e); 1512 }).forEach(function (e) { 1513 return t.classList.remove(e); 1514 }), e === s.DEFAULT ? t.classList.add(o, "desktop:".concat(a)) : t.classList.add(_this6.getFontSizeToAdd(o, e), "desktop:".concat(_this6.getFontSizeToAdd(a, e))); 1515 }), this.applyFirstLetterOpinionSize(e), t && S(n.TEXT_SIZE, e, 365); 1516 } 1517 }, { 1518 key: "applyFirstLetterOpinionSize", 1519 value: function applyFirstLetterOpinionSize(e) { 1520 var t = document.getElementById("body-modules"); 1521 if (!t || !t.classList.contains("opinion")) return; 1522 var n = 0; 1523 E.forEach(function (e) { 1524 t.classList.remove(e); 1525 }), e === s.MEDIUM ? n = 1 : e === s.BIG ? n = 2 : e === s.EXTRABIG && (n = 3), t.classList.add(E[0 + n], E[4 + n]); 1526 } 1527 }, { 1528 key: "getFontSizeToAdd", 1529 value: function getFontSizeToAdd(e, t) { 1530 var n = g.indexOf(e); 1531 return -1 === n && (n = 2), t === s.MEDIUM ? n += 1 : t === s.BIG ? n += 2 : t === s.EXTRABIG && (n += 3), g[Math.min(n, g.length - 1)]; 1532 } 1533 }]); 1534 }(); 1535 var W = y(); 1536 var Y = /*#__PURE__*/function () { 1537 function Y() { 1538 _classCallCheck(this, Y); 1539 this.device = ""; 1540 } 1541 return _createClass(Y, [{ 1542 key: "init", 1543 value: function init() { 1544 W.info("init", "Inicializando componentes comunes de la página"), B.initHeaderButtons(), B.initTodayInterest(), B.initCarousel(), B.addDidomiConfigFooterLink(), B.initPianoFaldonListener(); 1545 var e = se.getInstance().getCurrentFontSize(); 1546 e && e !== s.DEFAULT && $.changeFontSize(e, !1); 1547 } 1548 }, { 1549 key: "handlerCustomActionButtons", 1550 value: function handlerCustomActionButtons(e) { 1551 G.handleCustomActionButtons(e); 1552 } 1553 }, { 1554 key: "handlerActionButtons", 1555 value: function handlerActionButtons(e) { 1556 G.handleActionButtons(e); 1557 } 1558 }, { 1559 key: "changeFontSize", 1560 value: function changeFontSize(e, t) { 1561 $.changeFontSize(e, t); 1562 } 1563 }, { 1564 key: "changeTheme", 1565 value: function changeTheme(e, t) { 1566 z.changeTheme(e, t); 1567 } 1568 }, { 1569 key: "handlerDesktopAdsDynamicPositions", 1570 value: function handlerDesktopAdsDynamicPositions() { 1571 B.handlerDesktopAdsDynamicPositions(); 1572 } 1573 }, { 1574 key: "removeDesktopMinHeightClass", 1575 value: function removeDesktopMinHeightClass(e) { 1576 B.removeDesktopMinHeightClass(e); 1577 } 1578 }, { 1579 key: "handlerRobapaginasDesktopHeigth", 1580 value: function handlerRobapaginasDesktopHeigth() { 1581 B.handlerRobapaginasDesktopHeigth(); 1582 } 1583 }], [{ 1584 key: "getInstance", 1585 value: function getInstance() { 1586 return Y.instance || (W.debug("getInstance", "Creando instancia"), Y.instance = new Y()), Y.instance; 1587 } 1588 }]); 1589 }(); 1590 var j = y(); 1591 function X(e) { 1592 window.adk_subscribed = e, j.info("setAdkaoraVar", "Seteando adk_subscribed = ".concat(e)); 1593 } 1594 var V = y(); 1595 var K = /*#__PURE__*/function () { 1596 function K() { 1597 _classCallCheck(this, K); 1598 this.initialized = !1, this.data = { 1599 id: "", 1600 url: "", 1601 text: "", 1602 title: "", 1603 lang: "", 1604 userFeatures: {} 1605 }; 1606 } 1607 return _createClass(K, [{ 1608 key: "addSelectedText", 1609 value: function addSelectedText(e) { 1610 var _t$getCurrentTheme, _t$getCurrentFontSize; 1611 var t = se.getInstance(), 1612 n = ((_t$getCurrentTheme = t.getCurrentTheme) === null || _t$getCurrentTheme === void 0 ? void 0 : _t$getCurrentTheme.call(t)) || l.LIGHT, 1613 a = ((_t$getCurrentFontSize = t.getCurrentFontSize) === null || _t$getCurrentFontSize === void 0 ? void 0 : _t$getCurrentFontSize.call(t)) || s.DEFAULT; 1614 e && (this.insertSelectedText(e, "".concat(r.CHANGE_THEME, "[").concat(i.THEME, "=\"").concat(n, "\"]")), this.insertSelectedText(e, "".concat(r.CHANGE_TEXT_SIZE_BT, "[").concat(i.TEXT_SIZE, "=\"").concat(a, "\"]"))); 1615 } 1616 }, {
1617 key: "changeIllustration", 1618 value: function changeIllustration(e) { 1619 if (e.includes(r.SVG_CONTAINER)) { 1620 var _t1 = "".concat(Math.floor(6 * Math.random())).concat(Math.floor(9 * Math.random()) + 1); 1621 e = e.replace('svg-container">', "svg-container\"><img src=\"/dist/publico/svg/".concat(_t1, ".svg\" class=\"pr-4 max-w-32 desktop:max-w-44 h-auto\" alt=\"Ilustraci\xF3n\">")); 1622 } 1623 return e; 1624 } 1625 }, { 1626 key: "getModalContent", 1627 value: function getModalContent() { 1628 var e = se.getInstance(), 1629 t = !e.canReadComments || e.canReadComments(); 1630 var n = ""; 1631 switch (this.data.id) { 1632 case i.CHANGE_SIZE_MODAL: 1633 n = '<ul class="change-size-modal modal-content-item">\n <li class="change-text-size-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode cursor-pointer" data-text-size="default">\n <span class="icon-font text-lg mr-2"></span>\n <span>Por defecto</span>\n </li>\n <li class="change-text-size-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode cursor-pointer" data-text-size="medium">\n <span class="icon-font text-xl mr-2"></span>\n <span>Mediano</span>\n </li>\n <li class="change-text-size-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode cursor-pointer" data-text-size="big">\n <span class="icon-font text-xl2 mr-2"></span>\n <span>Grande</span>\n </li>\n <li class="change-text-size-bt p-3 flex w-full btn-secondary-left dark:bg-darkmode cursor-pointer" data-text-size="extrabig">\n <span class="icon-font text-xl4 mr-2"></span>\n <span>Extragrande</span>\n </li>\n</ul>', this.data.lang == i.LANG_PUBLIC && (n = '<ul class="change-size-modal modal-content-item">\n <li class="change-text-size-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode cursor-pointer" data-text-size="default">\n <span class="icon-font text-lg mr-2"></span>\n <span>Per defecte</span>\n </li>\n <li class="change-text-size-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode cursor-pointer" data-text-size="medium">\n <span class="icon-font text-xl mr-2"></span>\n <span>Mitjà </span>\n </li>\n <li class="change-text-size-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode cursor-pointer" data-text-size="big">\n <span class="icon-font text-xl2 mr-2"></span>\n <span>Gran</span>\n </li>\n <li class="change-text-size-bt p-3 flex w-full btn-secondary-left dark:bg-darkmode cursor-pointer" data-text-size="extrabig">\n <span class="icon-font text-xl4 mr-2"></span>\n <span>Molt gran</span>\n </li>\n</ul>'); 1634 break; 1635 case i.CHANGE_THEME_MODAL: 1636 n = '<ul class="change-theme-modal modal-content-item">\n <li class="change-theme-bt dark:bg-darkmode p-3 mb-3 w-full btn-secondary-left desktop:min-w-48" data-theme="light">\n <span class="icon-sun-solid text-lg mr-2"></span> <span>Claro</span>\n </li>\n <li class="change-theme-bt dark:bg-darkmode p-3 w-full btn-secondary-left desktop:min-w-48" data-theme="dark">\n <span class="icon-moon-solid text-lg mr-2"></span> <span>Oscuro</span>\n </li>\n</ul>', this.data.lang == i.LANG_PUBLIC && (n = '<ul class="change-theme-modal modal-content-item">\n <li class="change-theme-bt dark:bg-darkmode p-3 mb-3 w-full btn-secondary-left desktop:min-w-48" data-theme="light">\n <span class="icon-sun-solid text-lg mr-2"></span> <span>Clar</span>\n </li>\n <li class="change-theme-bt dark:bg-darkmode p-3 w-full btn-secondary-left desktop:min-w-48" data-theme="dark">\n <span class="icon-moon-solid text-lg mr-2"></span> <span>Obscur</span>\n </li>\n</ul>'); 1637 break; 1638 case i.READ_LATER_MODAL: 1639 t || (n = this.changeIllustration('<div class="read-later-modal modal-content-item"> \n <div class="flex gap-4 items-center"> \n <div class="svg-container"></div>\n <div>\n <p class="block font-bold text-lg desktop:text-xl4 mb-1 leading-tight">Esta funcionalidad es solo para usuarios registrados. \n <sp
1639an class="block mt-4 text-base desktop:text-xl font-normal leading-snug">Si no tienes usuario, puedes registrarte.</span> \n <span class="block mt-2 desktop:mt-0 text-base desktop:text-xl font-normal underline leading-snug">Son solo dos minutos.</span>\n </p> \n <a href="/registro" title="RegÃstrate" class="register my-5 btn-secondary dark:bg-darkmode w-full justify-center">RegÃstrate</a>\n <p class="text-center">Si ya tienes una cuenta, <a href="/login" title="inicia sesión" class="login text-link-normal underline dark:text-link-dark">inicia sesión</a></p> \n </div> \n </div> \n</div>')), n = n.replace('href="/registro"', 'href="/registro?next=' + window.location.pathname + '"'), n = n.replace('href="/login"', 'href="/login?next=' + window.location.pathname + '"'); 1640 break; 1641 case i.COMMENTS_MODAL: 1642 if (!t) { 1643 n = this.changeIllustration('<div class="comments-modal modal-content-item"> \n <div class="flex gap-4 items-center"> \n <div class="svg-container"></div>\n <div>\n <p class="block font-bold text-lg desktop:text-xl4 mb-3 leading-tight">Funcionalidad disponible solo con una suscripción activa. <span class="block mt-4 text-base desktop:text-xl font-normal leading-snug">Si quieres participar en la conversación, da un paso más y únete a nuestra comunidad.</span> </p> \n <a href="/landing/suscripciones?tpcc=articulo_modal_comentarios" title="Ãnete a Público" class="p-4 my-5 btn-terciary-sm text-white bg-publico dark:bg-publico w-full justify-center">Ãnete a Público</a> \n <p class="text-center">Si ya tienes una cuenta, <a href="/login" title="inicia sesión" class="login text-link-normal underline dark:text-link-dark">inicia sesión</a></p> \n </div> \n </div> \n</div>'), n = n.replace('href="/login"', 'href="/login?next=' + window.location.pathname + '"'); 1644 break; 1645 } 1646 break; 1647 case i.SHARE_MODAL: 1648 n = '<ul class="share-modal modal-content-item">\n <li title="Whatsapp" class="tablet:hidden change-share-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode min-w-64" data-theme="light"><span class="icon-whatsapp wa-desktop text-lg mr-2"></span> <span>Whatsapp</span></li>\n <li title="Whatsapp" class="desktop:hidden change-share-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode min-w-64" data-theme="light"><span class="icon-whatsapp wa-mobile text-lg mr-2"></span> <span>Whatsapp</span></li>\n\n <li title="Telegram" class="change-share-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode min-w-64" data-theme="dark"><span class="icon-telegram-plane text-lg mr-2"></span> <span>Telegram</span></li>\n <li title="Bluesky" class="change-share-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode min-w-64" data-theme="light"><span class="icon-bluesky text-lg mr-2"></span> <span>Bluesky</span></li>\n <li title="Facebook" class="change-share-bt p-3 mb-3 w-full btn-secondary-left dark:bg-darkmode min-w-64" data-theme="light"><span class="icon-facebook-f text-lg mr-2"></span> <span>Facebook</span></li>\n <li title="X" class="change-share-bt p-3 w-full btn-secondary-left dark:bg-darkmode min-w-64" data-theme="light"><span class="icon-x-twitter text-lg mr-2"></span> <span>X</span></li>\n <li title="Copiar enlace" class="hidden change-share-bt p-3 w-full btn-secondary-left dark:bg-darkmode min-w-64 mt-3" data-theme="light"><span class="icon-link text-lg mr-2"></span> <span class=\'copy-text\'>Copiar enlace</span></li>\n</ul>'; 1649 break; 1650 case i.LISTEN_MODAL: 1651 t || (n = this.changeIllustration('<div class="listen-modal modal-content-item"> \n <div class="flex gap-4 items-center"> \n <div class="svg-container"></div>\n <div>\n <p class="block font-bold text-lg desktop:text-xl4 mb-3 leading-tight">Escuchar los artÃculos es solo para nuestros suscriptores. <span class="block mt-4 text-base desktop:text-xl font-normal leading-snug">Si quieres disfrutar de esta y otras ventajas, da un paso más y únete a nuestra comunidad.</span> </p>\n <a href="/landing/suscripciones?tpcc=articulo_modal_escuchar" title="Ãnete a Público" class="p-4 my-5 btn-terciary-sm text-white bg-publico dark:bg-publico w-full justify-center">Ãnete a Público</a> \n <p class="text-center">Si ya tienes una cuenta, <a href="/login" title="inicia sesión" class="login text-link-normal underline dark:text-link-dark">inicia sesión</a></p> \n </div> \n </div> \n</div>')); 1652 break; 1653 case i.NEWSLETTER: 1654 n = this.changeIllustration('<div class="newsletter modal-content-item">\n <div class="flex items-center gap-4">\n <div class="svg-container"></div>\n <div>\n <p class="block text-pretty font-bold text-lg desktop:text-xl6 mb-3 leading-tight">Para recibir newsletters de Público necesitas tener una cuenta <span class="block mt-4 desktop:mt-6 text-base desktop:text-xl font-normal leading-snug">Si estás interesado en recibir nuestros contenidos editoriales directamente en tu email, no dudes en crear tu cuenta con nosotros.</span>\n </p>\n <a href="/registro?next=/landing/newsletter" title="Registrate, es gratis" class="register refresh-after-login p-4 my-5 btn-terciary-sm bg-form-input-focus text-white w-full justify-center">¡RegÃstrate! Es gratis </a>\n </div>\n </div>\n <p class="text-center mt-3 pt-3 border-t border-warm-gray-100 only-anonymous">Si ya tienes una cuenta, <a href="/login" title="inicia sesión" class="refresh-after-login login text-link-normal underline dark:text-link-dark">inicia sesión</a></p>\n</div>
1654'), "" !== this.data.url && (n = n.replace("/registro?next=/landing/newsletter", "/registro?next=".concat(this.data.url))); 1655 break; 1656 case i.NEWSLETTER_EXCLUSIVA: 1657 n = this.changeIllustration('<div class="newsletter-exclusiva comments-modal modal-content-item">\n <div class="flex items-center gap-4">\n <div class="svg-container"></div>\n <div>\n <p class="block text-pretty font-bold text-lg desktop:text-xl6 mb-3 leading-tight">Esta newsletter es exclusiva para socias y socios <span class="block mt-4 desktop:mt-6 text-base desktop:text-xl font-normal leading-snug">Solo si eres miembro de nuestra comunidad podrás recibir este contenido exclusivo en tu mail. Apoya el proyecto y disfruta de estas y otras ventajas solo para socias y socios.</span>\n </p>\n <a href="/landing/suscripciones?tpcc=landingnl_modal_nlsocios" title="Hazte socia/o" class="p-4 my-5 btn-terciary-sm bg-form-input-focus text-white w-full justify-center">Hazte socia/o</a>\n </div>\n </div>\n <p class="text-center mt-3 pt-3 border-t border-warm-gray-100 only-anonymous">Si ya tienes una cuenta, <a href="/login" title="inicia sesión" class="login refresh-after-login text-link-normal underline dark:text-link-dark">inicia sesión</a></p>\n</div>'); 1658 break; 1659 case i.GOOGLE_AFTER_LOGIN_MODAL: 1660 n = '<div class="google-login-modal modal-content-item">\n<div class="dark:text-neutral-gray-100">\n <p class="mb-4">Acabas de iniciar sesión en Público con los datos de tu cuenta de Google. En unos minutos recibirás un correo de bienvenida y las instrucciones para establecer tu contraseña de acceso. Recuerda que tu acceso a nuestra web tendrá su propia contraseña y que no compartirá las credenciales de tu cuenta de Google.</p>\n \n <h2 class="font-bold text-lg desktop:text-xl mb-2">¿Quieres recibir nuestras newsletters?</h2>\n\n <form id="form-modal-google-login" method="post" action="/mi-cuenta/forms/set_nl_preferences" class="pb-16">\n <div class="mb-5">\n <label for="googleLoginNewslettersComunicaciones" class="relative text-lg pl-9 mb-3 cursor-pointer select-none group/nl-comunicaciones"> Emails informativos sobre la República de <span class="italic">Público</span>\n <input type="checkbox" id="googleLoginNewslettersComunicaciones" name="googleLoginNewsletters[]" value="comunicaciones" class="absolute opacity-0 cursor-pointer h-0 w-0 peer/nl-comunicaciones">\n <span class="absolute top-0 left-0 h-6 w-6 bg-warm-gray-100 group-hover/nl-comunicaciones:bg-warm-gray-200 peer-checked/nl-comunicaciones:bg-darkmode peer-checked/nl-comunicaciones:after:block after:content-[\'\'] after:absolute after:hidden after:left-2 after:top-0.5 after:w-2 after:h-4 after:border-white after:border-r after:border-r-4 after:border-b after:border-b-4 after:rotate-45"></span>\n </label>\n </div>\n\n <div class="mb-5">\n <label for="googleLoginNewslettersEditorial" class="relative text-lg pl-9 mb-3 cursor-pointer select-none group/nl-editorial"> EnvÃos editoriales (descubre nuestras newsletters âPonte al dÃaâ, âHoy en Públicoâ o âTremendingâ)\n <input type="checkbox" id="googleLoginNewslettersEditorial" name="googleLoginNewsletters[]" value="editorial" class="absolute opacity-0 cursor-pointer h-0 w-0 peer/nl-editorial">\n <span class="absolute top-0 left-0 h-6 w-6 bg-warm-gray-100 group-hover/nl-editorial:bg-warm-gray-200 peer-checked/nl-editorial:bg-darkmode peer-checked/nl-editorial:after:block after:content-[\'\'] after:absolute after:hidden after:left-2 after:top-0.5 after:w-2 after:h-4 after:border-white after:border-r after:border-r-4 after:border-b after:border-b-4 after:rotate-45"></span>\n </label>\n </div>\n\n <button class="btn-primary float-right" type="submit">Continuar</button>\n </form>\n</div>\n</div>'; 1661 } 1662 return n; 1663 } 1664 }, { 1665 key: "init", 1666 value: function init() { 1667 var _document$querySelect8, 1668 _this7 = this; 1669 V.debug("init", "Inicializando contenedor de ventana modal"), this.initialized = !0, (_document$querySelect8 = document.querySelector(r.BODY)) === null || _document$querySelect8 === void 0 ? void 0 : _document$querySelect8.insertAdjacentHTML("beforeend", '\n<div id="modal-container" tabindex="-1" aria-hidden="true" class="modal modal-container overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 bottom-0 z-50 w-full desktop:inset-0 hidden">\n <div class="p-4 flex justify-center items-center relative w-full min-h-full bg-black/90">\n <div class="flex justify-center items-center min-h-full">\n <div class="relative bg-white rounded-lg shadow max-w-2xl dark:bg-gray-700 dark:bg-cold-gray-700">\n <div class="p-4 flex items-center justify-between desktop:p-5 border-b border-neutral-gray-200 rounded-t dark:border-neutral-gray-600">\n <p class="modal-title text-xl text-left font-bold text-gray-900 dark:text-white"></p>\n <button title="Cerrar" type="button" class="close text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white">
1669\n <span class="icon-times text-xl4 dark:text-white"></span> <span class="sr-only">Cerrar</span>\n </button>\n </div>\n <div id="modal-content" class="modal-content p-4 desktop:mt-5 desktop:p-5 desktop:pt-0 space-y-4"></div>\n </div>\n </div>\n </div>\n</div>\n'); 1670 var e = document.getElementById(r.MODAL_CONTAINER_ID), 1671 t = e === null || e === void 0 ? void 0 : e.querySelector(r.CLOSE); 1672 e && t && t.addEventListener("click", function () { 1673 _this7.hide(e); 1674 }); 1675 } 1676 }, { 1677 key: "insertSelectedText", 1678 value: function insertSelectedText(e, t) { 1679 var n = e.querySelector(t); 1680 if (n) { 1681 var _e20 = document.createElement(r.SPAN); 1682 _e20.textContent = this.data.lang == i.LANG_PUBLIC ? "Seleccionat" : "Seleccionado", _e20.className = "selected text-sm ml-auto", n === null || n === void 0 ? void 0 : n.appendChild(_e20); 1683 } 1684 } 1685 }, { 1686 key: "show", 1687 value: function show() { 1688 var _document$querySelect9; 1689 V.debug("show", "Mostrando ventana modal", this.data.id), X(!0), this.initialized || this.init(); 1690 var e = document.getElementById(r.MODAL_CONTAINER_ID); 1691 e ? (this.updateModalContent(e), e.classList.remove(t.HIDDEN), (_document$querySelect9 = document.querySelector(r.BODY)) === null || _document$querySelect9 === void 0 ? void 0 : _document$querySelect9.classList.add(t.OVERFLOW_HIDDEN)) : V.error("show", "No se encuentra el contenedor de la ventana modal en el DOM"); 1692 } 1693 }, { 1694 key: "handlerModalButtons", 1695 value: function handlerModalButtons(e) { 1696 var _this8 = this; 1697 var t = Y.getInstance(), 1698 n = e.querySelector(r.GOOGLE_LOGIN_FORM_MODAL); 1699 n && n.addEventListener("submit", /*#__PURE__*/function () { 1700 var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(t) { 1701 var n, a; 1702 return _regeneratorRuntime().wrap(function _callee5$(_context5) { 1703 while (1) switch (_context5.prev = _context5.next) { 1704 case 0: 1705 t.preventDefault(); 1706 n = t.target, a = new FormData(n); 1707 _context5.prev = 2; 1708 _context5.next = 5; 1709 return fetch(n.action, { 1710 method: n.method || "POST", 1711 body: a, 1712 credentials: "include" 1713 }); 1714 case 5: 1715 _context5.next = 10; 1716 break; 1717 case 7: 1718 _context5.prev = 7; 1719 _context5.t0 = _context5["catch"](2); 1720 V.warn("handlerModalButtons", "Error al enviar el formulario de Google Login", _context5.t0); 1721 case 10: 1722 _context5.prev = 10; 1723 _this8.hide(e); 1724 return _context5.finish(10); 1725 case 13: 1726 case "end": 1727 return _context5.stop(); 1728 } 1729 }, _callee5, null, [[2, 7, 10, 13]]); 1730 })); 1731 return function (_x10) { 1732 return _ref3.apply(this, arguments); 1733 }; 1734 }()); 1735 var a = e.querySelector(r.CHANGE_SIZE_MODAL_CLASS); 1736 a && a.querySelectorAll(r.CHANGE_TEXT_SIZE_BT).forEach(function (n) { 1737 n.addEventListener("click", function (a) { 1738 var _n$getAttribute4; 1739 a.preventDefault(); 1740 var s = (_n$getAttribute4 = n.getAttribute(i.TEXT_SIZE)) !== null && _n$getAttribute4 !== void 0 ? _n$getAttribute4 : ""; 1741 t.changeFontSize(s, !0), _this8.hide(e); 1742 }); 1743 }); 1744 var s = e.querySelector(r.CHANGE_THEME_MODAL_CLASS); 1745 s && s.querySelectorAll(r.CHANGE_THEME).forEach(function (n) { 1746 n.addEventListener("click", function (a) { 1747 var _n$getAttribute5; 1748 a.preventDefault(); 1749 var s = (_n$getAttribute5 = n.getAttribute(i.THEME)) !== null && _n$getAttribute5 !== void 0 ? _n$getAttribute5 : ""; 1750 t.changeTheme(s, !0), _this8.hide(e); 1751 }); 1752 }); 1753 var o = e.querySelector(r.SHARE_MODAL), 1754 c = C();
1755 o && o.querySelectorAll(r.CHANGE_SHARE).forEach(function (t) { 1756 t.addEventListener("click", function (n) { 1757 n.preventDefault(); 1758 var a = _this8.data.url, 1759 s = _this8.data.text; 1760 if (navigator.share && c) navigator.share({ 1761 title: s, 1762 text: s, 1763 url: _this8.buildShareUrl(a, "native_share") 1764 })["catch"](function () {});else { 1765 var _n6; 1766 t.querySelector(r.ICON_TWITTER) ? (_n6 = _this8.buildShareUrl(a, "twitter"), window.open("https://twitter.com/intent/tweet?url=".concat(encodeURIComponent(_n6), "&text=").concat(encodeURIComponent(s), "&via=publico_es"), "_blank")) : t.querySelector(r.ICON_WHATSAPP_DESKTOP) ? (_n6 = _this8.buildShareUrl(a, "whatsapp"), window.open("https://web.whatsapp.com/send?text=".concat(encodeURIComponent(s ? "".concat(s, " ").concat(_n6) : _n6)), "_blank")) : t.querySelector(r.ICON_WHATSAPP_MOBILE) ? (_n6 = _this8.buildShareUrl(a, "whatsapp"), window.open("whatsapp://send?text=".concat(encodeURIComponent(s ? "".concat(s, " ").concat(_n6) : _n6)), "_blank")) : t.querySelector(r.ICON_TELEGRAM) ? (_n6 = _this8.buildShareUrl(a, "telegram"), window.open("https://t.me/share/url?url=".concat(encodeURIComponent(_n6), "&text=").concat(encodeURIComponent(s)), "_blank")) : t.querySelector(r.ICON_FACEBOOK) ? (_n6 = _this8.buildShareUrl(a, "facebook"), window.open("https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(_n6), ""e=").concat(encodeURIComponent(s)), "_blank")) : t.querySelector(r.ICON_BLUESKY) && (_n6 = _this8.buildShareUrl(a, "Bluesky"), window.open("https://bsky.app/intent/compose?text=".concat(encodeURIComponent("".concat(s, " \n").concat(_n6))), "_blank")), _this8.hide(e); 1767 } 1768 }); 1769 }); 1770 } 1771 }, { 1772 key: "hide", 1773 value: function hide(e) { 1774 var _document$querySelect0; 1775 X(!1); 1776 var n = e || document.getElementById(r.MODAL_CONTAINER_ID); 1777 n && n.classList.add(t.HIDDEN), (_document$querySelect0 = document.querySelector(r.BODY)) !== null && _document$querySelect0 !== void 0 && _document$querySelect0.classList.remove(t.OVERFLOW_HIDDEN), "function" == typeof this.closeCallback && this.closeCallback(); 1778 } 1779 }, { 1780 key: "render", 1781 value: function render(e) { 1782 this.updateModalData({ 1783 id: e.id || "", 1784 url: e.url || "", 1785 text: e.text || "", 1786 title: e.title || "", 1787 lang: e.lang || "", 1788 userFeatures: e.userFeatures || {} 1789 }), this.show(); 1790 } 1791 }, { 1792 key: "updateModalContent", 1793 value: function updateModalContent(e) { 1794 var t = e.querySelector(r.MODAL_TITLE), 1795 n = e.querySelector(r.MODAL_CONTENT); 1796 t && n && (t.innerText = this.data.title, n.innerHTML = this.getModalContent(), this.handlerModalButtons(e), this.addSelectedText(e)); 1797 } 1798 }, { 1799 key: "updateModalData", 1800 value: function updateModalData(e) { 1801 this.data = e; 1802 } 1803 }, { 1804 key: "setCloseCallback", 1805 value: function setCloseCallback(e) { 1806 this.closeCallback = e; 1807 } 1808 }, { 1809 key: "buildShareUrl", 1810 value: function buildShareUrl(e, t) { 1811 var n = new URL(e); 1812 return n.searchParams.set("utm_source", t), n.searchParams.set("utm_medium", "social"), n.searchParams.set("utm_campaign", "web"), n.searchParams.set("via", "publico_es"), n.toString(); 1813 } 1814 }], [{ 1815 key: "getInstance", 1816 value: function getInstance() { 1817 return K.instance || (V.debug("getInstance", "Creando instancia"), K.instance = new K()), K.instance; 1818 } 1819 }]); 1820 }(); 1821 var Z = y(), 1822 J = function J(e) { 1823 return e.trim().toLowerCase().replace(/\/+$/, ""); 1824 }, 1825 Q = "[https://pay.google.com, https://api-eu.piano.io, https://id-eu.piano.io/, https://buy-eu.piano.io, https://www.publico.es, https://admin.publico.es, https://pre.publico.es, https://admin-pre.publico.es, https://pro.publico.es, https://admin-pro.publico.es]".replace(/[[\]]/g, "").split(",").map(J).filter(function (e) { 1826 return e.length > 0; 1827 }); 1828 var ee = /*#__PURE__*/function () { 1829 function ee() { 1830 _classCallCheck(this, ee); 1831 this.isListening = !1; 1832 } 1833 return _createClass(ee, [{ 1834 key: "initListeners", 1835 value: function initListeners() { 1836 var _this9 = this; 1837 this.isListening || (0 !== Q.length ? (window.addEventListener("message", function (e) { 1838 var _t$params; 1839 if (!e.data) return; 1840 if (!Q.includes(J(e.origin))) return void Z.debug("initListeners", "Mensaje descartado por origen n
1840o autorizado", e.origin); 1841 var t = e.data; 1842 if ("string" == typeof t) { 1843 if ("showLoginCheckout" === t) return void _this9.handleShowLoginCheckout(); 1844 try { 1845 t = JSON.parse(t); 1846 } catch (_unused3) {} 1847 } 1848 t && "object" == _typeof(t) && ("showTemplate" === ((_t$params = t.params) === null || _t$params === void 0 ? void 0 : _t$params.eventCategory) && _this9.syncThemeWithIframe(t.params.templateId), "string" == typeof t.type && t.type.startsWith("piano.") && _this9.handlePianoMessage(t.type, t), t.action && _this9.handleCustomAction(t.action, t)); 1849 }), this.isListening = !0, Z.debug("initListeners", "Escuchando eventos postMessage")) : Z.error("initListeners", "PIANO_MESSAGE_ORIGIN no está definido: se descartan todos los postMessage entrantes")); 1850 } 1851 }, { 1852 key: "syncThemeWithIframe", 1853 value: function syncThemeWithIframe(e) { 1854 var t = document.querySelector("iframe[src*=\"".concat(e, "\"]")), 1855 n = document.documentElement.getAttribute("data-theme") || "light"; 1856 t && t.contentWindow && (Z.debug("syncThemeWithIframe", "Sincronizando tema visual con la plantilla", e), t.contentWindow.postMessage(JSON.stringify({ 1857 action: "publicoTheme", 1858 theme: n 1859 }), "*")); 1860 } 1861 }, { 1862 key: "handlePianoMessage", 1863 value: function handlePianoMessage(e, t) { 1864 "piano.action" === e && Z.debug("handlePianoMessage", "Acción especÃfica de Piano detectada", t); 1865 } 1866 }, { 1867 key: "handleShowLoginCheckout", 1868 value: function handleShowLoginCheckout() { 1869 var e = window.tp || []; 1870 e && e.push && (X(!0), e.push(["init", function () { 1871 return e.pianoId.show({ 1872 stage: "publicoweb" 1873 }); 1874 }])); 1875 } 1876 }, { 1877 key: "handleCustomAction", 1878 value: function handleCustomAction(e, t) { 1879 var n = window.tp || []; 1880 switch (e) { 1881 case "funnel": 1882 { 1883 var _e21 = Number(t.paso); 1884 !Number.isNaN(_e21) && t.etiqueta && U.pushToDataLayer(_e21, t.etiqueta, n); 1885 break; 1886 } 1887 case "showPublicoOfferModal": 1888 U.pushToDataLayer(10, "composer", n), n && n.offer && n.template && (n.template.close(), t.tpcc && this.setCampaignCookie(t.tpcc), X(!0), n.offer.show({ 1889 offerId: t.offerId, 1890 templateId: t.templateId, 1891 templateVariantId: t.templateVariantId || "", 1892 showCloseButton: "true" === String(t.closeBtn), 1893 displayMode: "modal" 1894 })); 1895 break; 1896 case "startPublicoCheckout": 1897 n && n.offer && n.template && (n.template.close(), t.tpcc && this.setCampaignCookie(t.tpcc), X(!0), n.offer.startCheckout({ 1898 offerId: t.offerId, 1899 termId: t.termId, 1900 templateVariantId: t.templateVariantId || "", 1901 experienceId: t.experienceId || "", 1902 templateId: "" 1903 })); 1904 break; 1905 case "templateCaptacion": 1906 this.handleTemplateCaptacion(t.campaign); 1907 break; 1908 case "composerSubscribeNL": 1909 this.handleNewsletterSubscription(t, n); 1910 } 1911 } 1912 }, { 1913 key: "setCampaignCookie", 1914 value: function setCampaignCookie(e) { 1915 var t = new Date().getTime(); 1916 S("tpcc_".concat(e), encodeURIComponent(JSON.stringify({ 1917 date: t 1918 })), 90), Z.debug("setCampaignCookie", "Cookie de campaña registrada", e); 1919 } 1920 }, { 1921 key: "handleTemplateCaptacion", 1922 value: function handleTemplateCaptacion(e) { 1923 if (!e) return; 1924 var t = A("pb-campaigns") || ""; 1925 "" === t ? t = e : t.includes(e) || (t += ",".concat(e)), S("pb-campaigns", t, 90), Z.debug("handleTemplateCaptacion", "Cookie de recogida de firmas actualizada", t); 1926 } 1927 }, { 1928 key: "handleNewsletterSubscription", 1929 value: function () { 1930 var _handleNewsletterSubscription = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(e, t) { 1931 var n, a, s, o, r, c, _e22, _t10; 1932 return _regeneratorRuntime().wrap(function _callee6$(_context6) { 1933 while (1) switch (_context6.prev = _context6.next) { 1934 case 0: 1935 n = e.slug, a = e.op, s = e.templateId, o = document.querySelector(".tp-container-inner iframe[src*=\"".concat(s, "\"]")), r = b.includes(n), c = se.getInstance(); 1936 if (!(t.user && t.user.isUserValid())) { 1937 _context6.next = 24; 1938 break; 1939 } 1940 if (!(c.getUserType() !== h.SUBSCRIBER && r)) { 1941 _context6.next = 6; 1942 break; 1943 } 1944 this.showNewsletterModal(c, i.NEWSLETTER_EXCLUSIVA, o, a, n, "No tienes permisos de suscriptor"); 1945 _context6.next = 22; 1946 break; 1947 case 6: 1948 if (!n) { 1949 _context6.next = 22; 1950 break; 1951 } 1952 if (!(!(c.getFeatures().newsletters || []).includes(n) && "subscribe" === a)) { 1953 _context6.next = 22; 1954 break; 1955 } 1956 _context6.prev = 8; 1957 Z.info("handleNewsletterSubscription", "Suscribiendo a newsletter", n); 1958 _context6.next = 12; 1959 return fetch("/mi-cuenta/async/newsletter/change", { 1960 method: "POST", 1961 headers: { 1962 "Content-Type": "application/json" 1963 }, 1964 body: JSON.stringify({ 1965 action: a, 1966 slug: n 1967 }) 1968 }); 1969 case 12: 1970 _e22 = _context6.sent; 1971 _context6.next = 15; 1972 return _e22.json(); 1973 case 15: 1974 _t10 = _context6.sent; 1975 !_t10.status && o && o.contentWindow && o.contentWindow.postMessage({ 1976 action: "frontendStatus", 1977 status: !1, 1978 msg: _t10.msg, 1979 op: a, 1980 slug: n 1981 }, "*"); 1982 _context6.next = 22; 1983 break; 1984 case 19: 1985 _context6.prev = 19; 1986 _context6.t0 = _context6["catch"](8); 1987 Z.error("handleNewsletterSubscription", "Error al suscribir a la newsletter", _context6.t0); 1988 case 22: 1989 _context6.next = 25; 1990 break; 1991 case 24: 1992 this.showNewsletterModal(c, r ? i.NEWSLETTER_EXCLUSIVA : i.NEWSLETTER, o, a, n, "No hay sesión iniciada"); 1993 case 25: 1994 case "end": 1995 return _context6.stop(); 1996 } 1997 }, _callee6, this, [[8, 19]]); 1998 })); 1999 function handleNewsletterSubscription(_x11, _x12) { 2000 return _handleNewsletterSubscription.apply(this, arguments); 2001 } 2002 return handleNewsletterSubscription; 2003 }() 2004 }, {
2005 key: "showNewsletterModal", 2006 value: function showNewsletterModal(e, t, n, a, s, i) { 2007 var o = K.getInstance(); 2008 o.updateModalData({ 2009 id: t, 2010 url: window.location.pathname, 2011 text: "", 2012 title: "", 2013 lang: "", 2014 userFeatures: e.getFeatures() 2015 }), o.show(), n && n.contentWindow && n.contentWindow.postMessage({ 2016 action: "frontendStatus", 2017 status: !1, 2018 msg: i, 2019 op: a, 2020 slug: s 2021 }, "*"); 2022 } 2023 }], [{ 2024 key: "getInstance", 2025 value: function getInstance() { 2026 return ee.instance || (ee.instance = new ee()), ee.instance; 2027 } 2028 }]); 2029 }(); 2030 var te = y(); 2031 var ne = /*#__PURE__*/function () { 2032 function ne() { 2033 _classCallCheck(this, ne); 2034 this.cookieExpiration = 0, this.initialized = !1, this.pianoScriptLoaded = !1, this.pianoScriptCallbacks = []; 2035 } 2036 return _createClass(ne, [{ 2037 key: "init", 2038 value: function init(e) { 2039 this.initialized || (te.info("init", "Arrancando el servicio de Piano y CRM"), _() ? te.debug("init", "Página de administración, se omite la carga del CRM") : (this.cookieExpiration = parseInt("365"), this.initPianoScriptAndConfig(e), this.initialized = !0)); 2040 } 2041 }, { 2042 key: "initPianoScriptAndConfig", 2043 value: function initPianoScriptAndConfig(e) { 2044 var _this0 = this; 2045 this.insertPianoIdScript(function () { 2046 te.info("initPianoScriptAndConfig", "Configurando Piano ESP con ID 714022E3-11EB-492D-AE4C-87D3C8DF00B1"), window.PianoESPConfig = { 2047 hashId: "714022E3-11EB-492D-AE4C-87D3C8DF00B1" 2048 }, _this0.tp = window.tp || [], _this0.setConfig(); 2049 var t = _this0.tp; 2050 t.push(["init", function () { 2051 t && t.user && te.debug("initPianoScriptAndConfig", "Validez de usuario según Piano", t.user.isUserValid()); 2052 var n = "https://id-eu.piano.io"; 2053 t.pianoId.init({ 2054 iframeUrl: n 2055 }), U.registerHandlers(t, e, function () { 2056 _this0.checkUserData(e, function () { 2057 return location.reload(); 2058 }); 2059 }), ee.getInstance().initListeners(), _this0.checkUserData(e, function (e) { 2060 te.debug("initPianoScriptAndConfig", "Inicializando la experiencia visual de Piano"), t.experience.init(), e && _this0.handlerPostLoginActions(e); 2061 }); 2062 }]), ne.bindPianoAuthButtons(document.body, e, _this0); 2063 }); 2064 } 2065 }, { 2066 key: "setConfig", 2067 value: function setConfig() { 2068 var e = this.tp; 2069 e && (e.push(["setAid", "BrpcnPenpe"]), e.push(["setCxenseSiteId", "1137485112206018008,"]), e.push(["setEndpoint", "https://buy-eu.piano.io/api/v3"]), e.push(["setUseTinypassAccounts", !1]), e.push(["setUsePianoIdUserProvider", !0]), e.push(["setPianoIdUrl", "https://id-eu.piano.io"]), e.push(["setEspEndpoint", "https://api-esp-eu.piano.io"])); 2070 } 2071 }, { 2072 key: "checkUserData", 2073 value: function checkUserData(e, t) { 2074 var _this1 = this; 2075 var a = this.tp; 2076 if (a.user && a.user.isUserValid()) { 2077 var _s5 = a.pianoId.getUser(); 2078 te.debug("checkUserData", "Datos de usuario recibidos de Piano", _s5), a.pianoId && _s5 ? a.pianoId.loadExtendedUser({ 2079 extendedUserLoaded: function extendedUserLoaded(a) { 2080 if (a) { 2081 S(n.USER_ID, a.uid, _this1.cookieExpiration); 2082 var _s6 = {}; 2083 a.custom_field_values && a.custom_field_values.forEach(function (e) { 2084 if (e.field_name) { 2085 var _t11 = e.value; 2086 _t11 && "true" === _t11.toLowerCase() ? _s6[e.field_name] = !0 : _t11 && "false" === _t11.toLowerCase() ? _s6[e.field_name] = !1 : isNaN(_t11) || "" === _t11 ? _s6[e.field_name] = _t11 : _s6[e.field_name] = parseInt(_t11); 2087 } 2088 }), e.determineUserTypeAndFeatures(_s6), t(e); 2089 } else te.warn("checkUserData", "Sesión válida sin perfil extendido, se resuelve como anónimo"), _this1.resolveAsAnonymous(e), t(null); 2090 }, 2091 formName: "customFieldsCustomForm" 2092 }) : (this.resolveAsAnonymous(e), t(null)); 2093 } else this.resolveAsAnonymous(e), t(null); 2094 } 2095 }, {
2096 key: "resolveAsAnonymous", 2097 value: function resolveAsAnonymous(e) { 2098 e.determineUserTypeAndFeatures(null), this.cleanCookies(); 2099 } 2100 }, { 2101 key: "handlerPostLoginActions", 2102 value: function handlerPostLoginActions(e) { 2103 var t = e.getUserType(); 2104 if (w.updateHtmlClasses(t, e.canShowAds()), t !== h.ANONYMOUS && (w.changeLoginToMyAccount(), this.bindLogoutButton()), t === h.SUBSCRIBER) { 2105 var _e23 = R.getInstance(); 2106 _e23.handleSuscriber(), _e23.setDoNotRedirectWhenDecline(); 2107 } 2108 } 2109 }, { 2110 key: "bindLogoutButton", 2111 value: function bindLogoutButton() { 2112 var _this10 = this; 2113 var e = document.getElementById(r.HEADER_NAV); 2114 e && e.querySelectorAll(r.LOGOUT).forEach(function (e) { 2115 e.addEventListener("click", function (e) { 2116 e.preventDefault(), _this10.cleanCookies(), _this10.tp && _this10.tp.pianoId ? _this10.tp.pianoId.logout() : location.reload(); 2117 }); 2118 }); 2119 } 2120 }, { 2121 key: "cleanCookies", 2122 value: function cleanCookies() { 2123 T(n.USER_ID), T(n.USER_TYPE); 2124 } 2125 }, { 2126 key: "insertPianoIdScript", 2127 value: function insertPianoIdScript(e) { 2128 var _A, 2129 _this11 = this; 2130 var t = window.location.pathname, 2131 a = (_A = A(n.LOGIN)) !== null && _A !== void 0 ? _A : null; 2132 ne.PAGES_WITH_PIANO_NO_CONSENT.includes(t) || a ? (te.debug("insertPianoIdScript", "Ruta sin aviso de cookies, se inserta Piano directamente: ".concat(t)), this.realInsertPianoIdScript(e)) : R.getInstance().onConsentResolved(function () { 2133 return _this11.realInsertPianoIdScript(e); 2134 }); 2135 } 2136 }, { 2137 key: "realInsertPianoIdScript", 2138 value: function realInsertPianoIdScript(e) { 2139 var _this12 = this; 2140 var t = "//cdn.tinypass.com/api/tinypass.min.js"; 2141 if (document.querySelector("script[src=\"".concat(t, "\"]"))) this.pianoScriptLoaded ? e() : this.pianoScriptCallbacks.push(e);else { 2142 var _n7 = document.createElement("script"); 2143 _n7.src = t, _n7.async = !0, this.pianoScriptCallbacks.push(e), _n7.onload = function () { 2144 _this12.pianoScriptLoaded = !0, _this12.pianoScriptCallbacks.forEach(function (e) { 2145 return e(); 2146 }), _this12.pianoScriptCallbacks = []; 2147 }, document.body.appendChild(_n7); 2148 } 2149 this.insertPianoAdblockScript(); 2150 } 2151 }, { 2152 key: "insertPianoAdblockScript", 2153 value: function insertPianoAdblockScript() { 2154 var e = "//www.npttech.com/advertising.js"; 2155 T(n.ADBLOCKER); 2156 var t = document.createElement("script"); 2157 t.src = e, t.async = !0, t.onload = function () { 2158 te.debug("insertPianoAdblockScript", "Detector de adblockers cargado correctamente"); 2159 }, t.onerror = function () { 2160 te.info("insertPianoAdblockScript", "Un adblocker ha bloqueado el script de detección"); 2161 var e = new Date(); 2162 e.setTime(e.getTime() + 3e5), S(n.ADBLOCKER, "true", e.toUTCString()); 2163 }, document.body.appendChild(t); 2164 } 2165 }], [{ 2166 key: "getInstance", 2167 value: function getInstance() { 2168 return ne.instance || (te.debug("getInstance", "Creando instancia"), ne.instance = new ne()), ne.instance; 2169 } 2170 }, { 2171 key: "bindPianoAuthButtons", 2172 value: function bindPianoAuthButtons(e, n, a) { 2173 te.debug("bindPianoAuthButtons", "Configurando botones de autenticación en la interfaz"); 2174 var s = window.tp || []; 2175 if (!s || !s.pianoId) return; 2176 var i = function i(_i5, o) { 2177 e.querySelectorAll(_i5).forEach(function (e) { 2178 var i = e.classList.contains(t.REFRESH_AFTER_LOGIN); 2179 e.addEventListener("click", function (e) { 2180 e.preventDefault(), X(!0), s.pianoId.show({ 2181 disableSignUp: !1, 2182 displayMode: "modal", 2183 screen: o, 2184 loggedIn: function loggedIn(e) { 2185 te.info("bindPianoAuthButtons", ("login" === o ? "Login" : "Registro") + " completado con éxito", e), a && n && !i ? a.checkUserData(n, function () { 2186 return location.reload(); 2187 }) : i && location.reload(); 2188 }, 2189 loggedOut: function loggedOut() { 2190 return te.info("bindPianoAuthButtons", "Cierre de sesión detectado desde el widget"); 2191 }, 2192 loginFailed: function loginFailed(e) { 2193 return te.warn("bindPianoAuthButtons", "Fallo durante el " + ("login" === o ? "login" : "registro"), e); 2194 } 2195 }); 2196 }); 2197 }); 2198 };
2199 i(r.LOGIN, "login"), i(r.REGISTER, "register"); 2200 } 2201 }]); 2202 }(); 2203 ne.PAGES_WITH_PIANO_NO_CONSENT = [].concat(f, ["/landing/suscripciones"]); 2204 var ae = y(); 2205 var se = /*#__PURE__*/function () { 2206 function se() { 2207 _classCallCheck(this, se); 2208 this.isLoggedIn = !1, this.userType = h.ANONYMOUS, this.data = { 2209 username: "", 2210 features: { 2211 ads: !0, 2212 listenArticle: !1, 2213 readLater: !1, 2214 readLaterData: [], 2215 readComments: !1, 2216 writeComments: !1, 2217 newsletters: [] 2218 } 2219 }, this.userResolvedListeners = []; 2220 } 2221 return _createClass(se, [{ 2222 key: "getCurrentTheme", 2223 value: function getCurrentTheme() { 2224 return A(n.THEME) || l.LIGHT; 2225 } 2226 }, { 2227 key: "getCurrentFontSize", 2228 value: function getCurrentFontSize() { 2229 return A(n.TEXT_SIZE) || s.DEFAULT; 2230 } 2231 }, { 2232 key: "getUserType", 2233 value: function getUserType() { 2234 return this.userType; 2235 } 2236 }, { 2237 key: "getFeaturesFromCRM", 2238 value: function getFeaturesFromCRM() { 2239 ne.getInstance().init(this); 2240 } 2241 }, { 2242 key: "isLoggedInUser", 2243 value: function isLoggedInUser() { 2244 return this.isLoggedIn; 2245 } 2246 }, { 2247 key: "canShowAds", 2248 value: function canShowAds() { 2249 return this.data.features.ads; 2250 } 2251 }, { 2252 key: "canListenArticle", 2253 value: function canListenArticle() { 2254 return this.data.features.listenArticle; 2255 } 2256 }, { 2257 key: "canReadLater", 2258 value: function canReadLater() { 2259 return this.isLoggedIn; 2260 } 2261 }, { 2262 key: "canReadComments", 2263 value: function canReadComments() { 2264 return this.data.features.readComments; 2265 } 2266 }, { 2267 key: "canWriteComments", 2268 value: function canWriteComments() { 2269 return this.data.features.writeComments; 2270 } 2271 }, { 2272 key: "getNewsletters", 2273 value: function getNewsletters() { 2274 return this.data.features.newsletters; 2275 } 2276 }, { 2277 key: "getReadLater", 2278 value: function getReadLater() { 2279 return this.data.features.readLaterData; 2280 } 2281 }, { 2282 key: "getFeatures", 2283 value: function getFeatures() { 2284 return this.data.features; 2285 } 2286 }, { 2287 key: "setAfterUserLoginCallback", 2288 value: function setAfterUserLoginCallback(e) { 2289 this.userResolvedListeners.push(e); 2290 } 2291 }, { 2292 key: "emitUserResolved", 2293 value: function emitUserResolved() { 2294 if (0 === this.userResolvedListeners.length) return void ae.debug("emitUserResolved", "Sesión ya resuelta anteriormente, no se vuelve a notificar"); 2295 var e = this.userResolvedListeners; 2296 this.userResolvedListeners = [], e.forEach(function (e) { 2297 return e(); 2298 }); 2299 } 2300 }, { 2301 key: "addNewsletter", 2302 value: function addNewsletter(e) { 2303 this.data.features.newsletters.includes(e) || (this.data.features.newsletters.push(e), ae.debug("addNewsletter", "Newsletter añadida", e)); 2304 } 2305 }, { 2306 key: "removeNewsletter", 2307 value: function removeNewsletter(e) { 2308 this.data.features.newsletters = this.data.features.newsletters.filter(function (t) { 2309 return t !== e; 2310 }), ae.debug("removeNewsletter", "Newsletter eliminada", e); 2311 } 2312 }, { 2313 key: "determineUserTypeAndFeatures", 2314 value: function determineUserTypeAndFeatures(e) { 2315 if (!e) return this.setUserType(h.ANONYMOUS), void this.emitUserResolved(); 2316 if ("userCanHideAds" in e && (this.data.features.ads = !e.userCanHideAds), "userCanReadComments" in e && (this.data.features.readComments = e.userCanReadComments), "userCanWriteComments" in e && (this.data.features.writeComments = e.userCanWriteComments), "userCanReadLater" in e && (this.data.features.readLater = e.userCanReadLater), "readLaterData" in e && (this.data.features.readLaterData = e.readLaterData), "editorialMLCustomField" in e) { 2317 var _t12 = e.editorialMLCustomField.toString(); 2318 _t12.startsWith("%") ? this.data.features.newsletters = [] : this.data.features.newsletters = _t12.split(",").map(function (e) { 2319 return e.trim(); 2320 }); 2321 } 2322 !1 === this.data.features.ads ? this.setUserType(h.SUBSCRIBER) : !0 === this.data.features.readComments ? this.setUserType(h.REGISTERED) : this.setUserType(h.ANONYMOUS), this.emitUserResolved(); 2323 } 2324 }, {
2325 key: "setUserType", 2326 value: function setUserType(e) { 2327 this.userType = e, this.isLoggedIn = e === h.REGISTERED || e === h.SUBSCRIBER; 2328 var t = parseInt("365"); 2329 S(n.USER_TYPE, this.userType, t), ae.debug("setUserType", "Tipo de usuario actualizado", this.userType); 2330 } 2331 }, { 2332 key: "logUserSummary", 2333 value: function logUserSummary() { 2334 ae.info("logUserSummary", "Perfil de usuario", { 2335 type: this.userType, 2336 theme: this.getCurrentTheme(), 2337 fontSize: this.getCurrentFontSize(), 2338 features: { 2339 canShowAds: this.canShowAds(), 2340 canReadLater: this.canReadLater(), 2341 canReadComments: this.canReadComments(), 2342 canWriteComments: this.canWriteComments(), 2343 canListenArticle: this.canListenArticle(), 2344 newsletters: this.getNewsletters(), 2345 readLaterData: this.getReadLater() 2346 } 2347 }); 2348 } 2349 }], [{ 2350 key: "getInstance", 2351 value: function getInstance() { 2352 return se.instance || (ae.debug("getInstance", "Creando instancia"), se.instance = new se()), se.instance; 2353 } 2354 }]); 2355 }(); 2356 var ie = y(); 2357 function oe(e) { 2358 var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 2359 return new Promise(function (n, a) { 2360 var _t$async; 2361 ie.debug("loadScript", "Inyectando script: ".concat(e)); 2362 var s = document.createElement("script"); 2363 s.src = e, t.defer ? s.defer = !0 : s.async = (_t$async = t.async) !== null && _t$async !== void 0 ? _t$async : !0, t.attributes && Object.entries(t.attributes).forEach(function (_ref4) { 2364 var _ref5 = _slicedToArray(_ref4, 2), 2365 e = _ref5[0], 2366 t = _ref5[1]; 2367 s.setAttribute(e, t); 2368 }), s.onload = function () { 2369 ie.debug("loadScript", "Script cargado: ".concat(e)), n(); 2370 }, s.onerror = function (t) { 2371 ie.error("loadScript", "Error al cargar el script: ".concat(e), t), a(t); 2372 }, document.head.appendChild(s); 2373 }); 2374 } 2375 var re = /*#__PURE__*/function () { 2376 function re() { 2377 _classCallCheck(this, re); 2378 this.name = "smartclip", this.scripts = ["https://www.googletagservices.com/tag/js/gpt.js", "https://s3.eu-central-1.amazonaws.com/sc-devel/sc-tagmanager/publico.js", "https://s3.eu-central-1.amazonaws.com/sc-devel/Skins/SMCService.js", "https://cdn.smartclip-services.com/v1/Storage-a482323/smartclip-services/HeaderBidding/js/SmartclipConfig.js"]; 2379 } 2380 return _createClass(re, [{ 2381 key: "init", 2382 value: function init() { 2383 if (this.scripts.forEach(function (e) { 2384 return oe(e); 2385 }), document.body.classList.contains(r.ARTICLE)) { 2386 var _window$top; 2387 var _e24 = location.pathname; 2388 oe("https://des.smartclip.net/ads?type=dyn&sz=400x320&plc=112306&sc_sitName=publico&sc_cc=es&elementId=smartIntxt&cat=".concat(_e24.startsWith("/culturas") ? "cultura" : _e24.startsWith("/economia") ? "ec" : "", "&ref=").concat(encodeURIComponent(((_window$top = window.top) === null || _window$top === void 0 ? void 0 : _window$top.document.URL) || ""), "&rnd=").concat(Math.round(1e8 * Math.random()))); 2389 } 2390 } 2391 }]); 2392 }(); 2393 var ce = /*#__PURE__*/function () { 2394 function ce() { 2395 _classCallCheck(this, ce); 2396 this.name = "outbrain", this.scriptUrl = "https://widgets.outbrain.com/outbrain.js"; 2397 } 2398 return _createClass(ce, [{ 2399 key: "init", 2400 value: function init() { 2401 oe(this.scriptUrl); 2402 } 2403 }]); 2404 }(); 2405 var de = /*#__PURE__*/function () { 2406 function de() { 2407 _classCallCheck(this, de); 2408 this.name = "adkaora", this.scriptUrl = "https://cdn.adkaora.space/publicoes/generic/prod/adk-init.js"; 2409 } 2410 return _createClass(de, [{ 2411 key: "init", 2412 value: function init() { 2413 oe(this.scriptUrl, { 2414 defer: !0, 2415 attributes: { 2416 "data-version": "3" 2417 } 2418 }); 2419 } 2420 }]); 2421 }(); 2422 var le = y(); 2423 var ue = /*#__PURE__*/function () { 2424 function ue() { 2425 _classCallCheck(this, ue); 2426 this.providers = new Map(), this.registerProvider(new re()), this.registerProvider(new ce()), this.registerProvider(new de()); 2427 } 2428 return _createClass(ue, [{ 2429 key: "registerProvider", 2430 value: function registerProvider(e) { 2431 le.debug("registerProvider", "Proveedor registrado", e.name), this.providers.set(e.name, e); 2432 } 2433 }, {
2434 key: "loadPageScripts", 2435 value: function loadPageScripts(e) { 2436 var t = Array.isArray(e) && e.length > 0; 2437 this.providers.forEach(function (n, a) { 2438 !t || e.includes(a) ? (le.info("loadPageScripts", "Cargando proveedor de publicidad", a), n.init()) : le.debug("loadPageScripts", "Proveedor omitido por configuración de filtros", a); 2439 }); 2440 } 2441 }], [{ 2442 key: "getInstance", 2443 value: function getInstance() { 2444 return ue.instance || (le.debug("getInstance", "Creando instancia"), ue.instance = new ue()), ue.instance; 2445 } 2446 }]); 2447 }(); 2448 var pe = y(); 2449 var me = /*#__PURE__*/function () { 2450 function me() { 2451 _classCallCheck(this, me); 2452 this.initialized = !1, this.isVisible = !1; 2453 } 2454 return _createClass(me, [{ 2455 key: "init", 2456 value: function init(e) { 2457 var _this13 = this; 2458 pe.info("init", "Inicializando publicidad", { 2459 allowedProviders: e !== null && e !== void 0 ? e : "todos" 2460 }), this.initialized ? pe.debug("init", "La publicidad ya estaba inicializada, se omite") : (this.initialized = !0, this.changeDynamicIds(), this.changeDynamicPositions(), R.getInstance().onConsentResolved(function () { 2461 return _this13.executeProviders(e); 2462 }, { 2463 fallbackIfNoTcfApi: !0 2464 })); 2465 } 2466 }, { 2467 key: "executeProviders", 2468 value: function executeProviders(e) { 2469 ue.getInstance().loadPageScripts(e), this.show(); 2470 } 2471 }, { 2472 key: "changeDynamicIds", 2473 value: function changeDynamicIds() { 2474 var e = document.body.classList; 2475 if ([r.HOME, r.SECTION, r.AUTHOR, r.TAG, r.ARTICLE].some(function (t) { 2476 return e.contains(t); 2477 })) { 2478 pe.debug("changeDynamicIds", "Reasignando IDs de bloques publicitarios dinámicos"); 2479 var _e25 = C(), 2480 _t13 = _e25 ? r.ADS_DYNAMIC_ROBAPAGINAS_MOBILE : r.ADS_DYNAMIC_ROBAPAGINAS; 2481 document.querySelectorAll(_t13).forEach(function (e, t) { 2482 var n = e.querySelector(r.ADS_DYNAMIC_COUNT); 2483 n && (n.id = "sc-mpu".concat(t + 1)); 2484 }); 2485 var _n8 = _e25 ? r.ADS_DYNAMIC_OUTBRAIN_MOBILE : r.ADS_DYNAMIC_OUTBRAIN; 2486 document.querySelectorAll(_n8).forEach(function (e, t) { 2487 var n = e.querySelector(r.ADS_DYNAMIC_COUNT); 2488 n && n.setAttribute("data-widget-id", "SF_".concat(t + 1)); 2489 }); 2490 var _a7 = _e25 ? r.ADS_DYNAMIC_MEGABANNER_MOBILE : r.ADS_DYNAMIC_MEGABANNER; 2491 document.querySelectorAll(_a7).forEach(function (e, t) { 2492 var n = e.querySelector(r.ADS_DYNAMIC_COUNT); 2493 n && (n.id = "sc-superbanner-btf".concat(t + 1)); 2494 }); 2495 } 2496 } 2497 }, { 2498 key: "changeDynamicPositions", 2499 value: function changeDynamicPositions() { 2500 var e = document.body.classList.contains(r.ARTICLE), 2501 t = C(); 2502 if (e && t) { 2503 pe.debug("changeDynamicPositions", "Reubicando contenedores publicitarios para artÃculo móvil"); 2504 var _e26 = document.querySelector(r.EXCO_FOOTER), 2505 _t14 = document.querySelector(r.EXCO_INTEXT); 2506 _e26 && _t14 && _t14.appendChild(_e26); 2507 } 2508 } 2509 }, { 2510 key: "isInitialized", 2511 value: function isInitialized() { 2512 return this.initialized; 2513 } 2514 }, { 2515 key: "show", 2516 value: function show() { 2517 pe.debug("show", "Mostrando espacios publicitarios"), this.isVisible = !0, document.body.classList.remove(t.NO_ADS), document.body.classList.add(t.INITIALIZED_ADS), document.querySelectorAll(r.ADS_DYNAMIC_COUNT).forEach(function (e) { 2518 e.style.display = ""; 2519 }); 2520 } 2521 }, { 2522 key: "hide", 2523 value: function hide() { 2524 pe.debug("hide", "Ocultando espacios publicitarios"), this.isVisible = !1, document.body.classList.add(t.NO_ADS), document.body.classList.remove(t.INITIALIZED_ADS), document.querySelectorAll(r.ADS_DYNAMIC_COUNT).forEach(function (e) { 2525 e.style.display = "none"; 2526 }); 2527 } 2528 }, { 2529 key: "getIsVisible", 2530 value: function getIsVisible() { 2531 return this.isVisible; 2532 } 2533 }], [{ 2534 key: "getInstance", 2535 value: function getInstance() { 2536 return me.instance || (pe.debug("getInstance", "Creando instancia"), me.
2536instance = new me()), me.instance; 2537 } 2538 }]); 2539 }(); 2540 var he = y(); 2541 var ge = /*#__PURE__*/function () { 2542 function ge() { 2543 _classCallCheck(this, ge); 2544 } 2545 return _createClass(ge, null, [{ 2546 key: "run", 2547 value: function run(e) { 2548 var _this14 = this; 2549 var t = e.pageType, 2550 n = e.onInit, 2551 a = e.onReady, 2552 s = e.requiresCRM, 2553 i = e.requiresAds, 2554 o = e.allowedAdsProviders; 2555 if (he.info("run", "Arrancando aplicación", { 2556 pageType: t, 2557 requiresCRM: !1 !== s, 2558 requiresAds: !1 !== i 2559 }), _()) return void he.info("run", "Entorno de administración detectado, no se ejecuta la lógica de la página"); 2560 n && n(); 2561 var r = se.getInstance(), 2562 c = Y.getInstance(); 2563 !1 !== s ? (he.debug("run", "Validando usuario contra el CRM"), r.setAfterUserLoginCallback(function () { 2564 he.info("afterUserLoginCallback", "Usuario validado en el CRM"), r.logUserSummary(), !1 !== i && (r.canShowAds() ? (he.debug("afterUserLoginCallback", "Cargando publicidad"), _this14.initAds(o)) : he.debug("afterUserLoginCallback", "Publicidad omitida (suscriptor o usuario sin anuncios)")), a && a({ 2565 user: r, 2566 page: c 2567 }); 2568 }), r.getFeaturesFromCRM()) : (he.debug("run", "CRM desactivado para esta página"), R.getInstance().setDoNotRedirectWhenDecline(), !1 !== i && this.initAds(o), a && a({ 2569 page: c 2570 })); 2571 } 2572 }, { 2573 key: "initAds", 2574 value: function initAds(e) { 2575 he.debug("initAds", "Inicializando gestor de anuncios"); 2576 me.getInstance().init(e); 2577 } 2578 }]); 2579 }(); 2580 var Ee = y(); 2581 var be = y(); 2582 var fe, Ae, Se; 2583 (fe = "board", Ae = "board.entry.ts", Se = function Se(_ref6) { 2584 var e = _ref6.page, 2585 t = _ref6.entryName; 2586 be.info("onReady", "Inicializando board", { 2587 entryName: t 2588 }); 2589 var n = se.getInstance(); 2590 e !== null && e !== void 0 && e.handlerDesktopAdsDynamicPositions(), e !== null && e !== void 0 && e.init(), e === null || e === void 0 ? void 0 : e.handlerActionButtons(n); 2591 }, function () { 2592 var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 2593 var _e$requiresCRM = e.requiresCRM, 2594 t = _e$requiresCRM === void 0 ? !0 : _e$requiresCRM, 2595 _e$requiresAds = e.requiresAds, 2596 n = _e$requiresAds === void 0 ? !0 : _e$requiresAds, 2597 a = e.allowedAdsProviders, 2598 _e$entryName = e.entryName, 2599 s = _e$entryName === void 0 ? Ae : _e$entryName, 2600 i = e.onInit; 2601 ge.run(_objectSpread(_objectSpread({ 2602 pageType: fe, 2603 requiresCRM: t, 2604 requiresAds: n 2605 }, a && { 2606 allowedAdsProviders: a 2607 }), {}, { 2608 onReady: function onReady(_ref7) { 2609 var e = _ref7.user, 2610 t = _ref7.page; 2611 if (i) return Ee.info("run", "onInit personalizado ejecutado (".concat(s, ")")), void i({ 2612 page: t 2613 }); 2614 Se({ 2615 user: e, 2616 page: t, 2617 entryName: s 2618 }); 2619 } 2620 })); 2621 })({ 2622 entryName: "board.entry.ts" 2623 }); 2624})(); 2625 2626/***/ }) 2627 2628/******/ }); 2629/************************************************************************/ 2630/******/ // The module cache 2631/******/ var __webpack_module_cache__ = {}; 2632/******/ 2633/******/ // The require function 2634/******/ function __webpack_require__(moduleId) { 2635/******/ // Check if module is in cache 2636/******/ var cachedModule = __webpack_module_cache__[moduleId]; 2637/******/ if (cachedModule !== undefined) { 2638/******/ return cachedModule.exports; 2639/******/ } 2640/******/ // Create a new module (and put it into the cache) 2641/******/ var module = __webpack_module_cache__[moduleId] = { 2642/******/ // no module.id needed 2643/******/ // no module.loaded needed 2644/******/ exports: {} 2645/******/ }; 2646/******/ 2647/******/ // Execute the module function 2648/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 2649/******/ 2650/******/ // Return the exports of the module 2651/******/ return module.exports; 2652/******/ } 2653/******/ 2654/************************************************************************/ 2655/******/ 2656/******/ // startup 2657/******/ // Load entry module and return exports 2658/******/ // This entry module is referenced by other modules so it can't be inlined 2659/******/ var __webpack_exports__ = __webpack_require__(404); 2660/******/ 2661/******/ })() 2662;
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.