`;
fragment.appendChild(notificationCard);
});
// Append all notification cards at once
notiOBJ.innerHTML = »;
notiOBJ.appendChild(fragment);
} catch (error) {
console.error(«Error fetching notifications:», error);
notiOBJ.innerHTML = ‘
Hubo un error al cargar las notificaciones. Inténtalo más tarde.
‘;
}
}
const userSessionFullName = localStorage.getItem(‘userSessionFullName’);
if (userSessionFullName) {
const nameUserSessionElements = document.querySelectorAll(‘.nameUserSession’);
// Verificar si hay elementos con la clase nameUserSession
if (0 < nameUserSessionElements.length) {
nameUserSessionElements.forEach((element) => {
element.textContent=»Hola, » + userSessionFullName.split(‘ ‘)[0]; // eslint-disable-line no-param-reassign
});
}
}
tp.push([«init», function() {
window.domBatch.add(() => {
const elements = document.querySelectorAll(‘.showPianoLoginPl’);
elements.forEach((element) => {
element.addEventListener(‘click’, () => {
// eslint-disable-next-line no-shadow
const tp = window.tp || [];
const isAuthenticated = tp.user.isUserValid();
const domainName = window.location.hostname;
const loginPath=»/login»;
const profilePath=»/mi-perfil»;
const url = `https://${domainName}${isAuthenticated ? profilePath : loginPath}`;
window.open(url, ‘_self’);
});
});
});
if (tp.pianoId.isUserValid()) {
const tokenUser = JSON.stringify({
tokenUser: tp.pianoId.getToken()
});
const myHeaders = new Headers();
myHeaders.append(‘Content-Type’, ‘application/json’);
const request = {
method: ‘POST’,
headers: myHeaders,
body: tokenUser,
mode: ‘cors’,
redirect: ‘follow’,
};
fetch(‘https://foservices.prensalibre.com/pianoid/data/access/user’, request)
.then(response => response.json())
.then((data) => {
let isSuscriptionActive=»no-suscriptor»;
if (data.status === ‘active’) {
isSuscriptionActive=»suscriptor»;
window.domBatch.add(() => {
jQuery(‘#ux-btn-impreso’).show();
});
}
if (data.status !== ‘active’) {
window.domBatch.add(() => {
jQuery(‘#btn-suscribase-header’).attr(‘style’, ‘display:inline-block !important’);
});
}
// SETEA EL BADGE DE NOTIFICACIONES
jQuery.ajax({
url: `https://foservices.prensalibre.com/usuario/notificaciones_piano/${tp.pianoId.getUser().uid}/${isSuscriptionActive}`,
type: ‘GET’,
success: (dataresp) => {
window.domBatch.add(() => {
const notifications = jQuery(‘.ux-notifications’);
const notificationsHeader = jQuery(‘.ux-notifications-header’);
const notiNumber = jQuery(‘.ux-noti-number’);
const unreadCount = dataresp?.unread || 0;
if (unreadCount > 0) {
// Show notification badges
notifications.css(‘display’, ‘inline-block’).text(unreadCount);
notificationsHeader.css(‘display’, ‘inline-block’).text(unreadCount);
notiNumber.css(‘display’, ‘block’)
.css(‘text-align’, ‘center’)
.html(`Hay ${unreadCount} notificación${unreadCount > 1 ? ‘es’ : »} nueva${unreadCount > 1 ? ‘s’ : »}
Leer`);
} else {
// Hide all notification elements
notifications.hide();
notificationsHeader.hide();
notiNumber.hide();
}
});
},
error: (xhr, status, error) => {
console.error(`Error fetching notifications: ${status} – ${error}`);
}
});
const cUrl = window.location.pathname;
if (‘/mis-notificaciones/’ === cUrl) {
//FETCH NOTIFICATIONS HERE
// Call the function to fetch notifications
fetchNotifications(isSuscriptionActive);
}
})
.catch((error) => {
console.error(‘Error:’, error)
});
} else {
window.domBatch.add(() => {
jQuery(‘#btn-suscribase-header’).removeClass(‘d-none’);
});
}
}]);
Guatemala
Fuentes legislativas confirman que la sugerencia está siendo promovida por algunos diputados que integran la Junta Directiva.

Diputados en el pleno del Congreso durante la sesión de la semana pasada.(Foto Prensa Libre: Esbin García)
El Congreso programó para la sesión de este martes aprobar una ley contra las pandillas, pero la sesión podría ser a puerta cerrada bajo el argumento que se estrían abordando temas de seguridad nacional.
La sugerencia estaría siendo promovida por algunos diputados que integran la actual Junta Directiva, misma que preside el diputado Nery Ramos, del bloque Azul, exdirector de la Policía Nacional Civil (PCN).
La iniciativa prevista para ser aprobada en tercera lectura y redacción final es aquella propuesta por el expresidente Alejandro Giammattei, que buscaba tipificar como “terroristas” a los pandilleros.
Pero el dictamen que comenzó a ser aprobado eliminó este terminó y los reclasificó como delincuentes de “alta peligrosidad”, normativa que motivó una serie de reuniones legislativas a puerta cerrada la última semana.
Información en desarrollo