(function () {
'use strict';
const _0x5db4bc = document.querySelectorAll('[data-outside]');
const _0x4e548b = {};
const _0x2c2baf = document.querySelector(".player-button-play");
const _0x35fbf4 = document.querySelector(".visualizer");
const _0x52ef0a = document.querySelector('.song-now');
const _0x88f18a = document.getElementById("stations");
const _0x2af40c = document.querySelector(".station-name");
const _0x230a71 = document.querySelector('.station-description');
const _0x9a177c = document.querySelector(".header-logo-img");
const _0x32ca52 = document.querySelector(".player-artwork img:first-child");
const _0x4f1ff0 = document.querySelector(".player-cover-image");
const _0x4d0e83 = document.querySelector('.player-social');
const _0x4eb6ae = document.querySelector(".footer-app");
const _0xc0984c = document.querySelector(".footer-tv");
const _0xcc9105 = document.getElementById("modal-tv");
const _0x18bbd4 = document.querySelector(".player-program");
const _0x171620 = document.getElementById("lyrics");
const _0x4f5987 = document.getElementById("history");
let _0x2a51f3;
let _0x58c67a;
let _0x1f9cb3;
let _0x5abd67;
const _0xdb6d9f = new Audio();
_0xdb6d9f.crossOrigin = "anonymous";
let _0x1ffa1f = false;
const _0x35a29b = {
'play': "",
'pause': "",
'facebook': "",
'twitter': "",
'instagram': "",
'youtube': "",
'tiktok': "",
'whatsapp': "",
'telegram': "",
'tv': ""
};
function _0x6875f2(_0x29dd8c) {
const _0x169cff = document.createElement("div");
_0x169cff.innerHTML = _0x29dd8c.trim();
return _0x169cff.firstChild;
}
function _0x43b9f5(_0x2f3710) {
return new Promise((_0x25886, _0x4118c7) => {
const _0x5506a3 = document.createElement("img");
_0x5506a3.crossOrigin = 'Anonymous';
_0x5506a3.src = "https://images.weserv.nl/?url=" + _0x2f3710;
_0x5506a3.onload = () => _0x25886(_0x5506a3);
_0x5506a3.onerror = _0x4118c7;
});
}
function _0x5b0c81() {
if (_0xdb6d9f.paused) {
_0x4693d2(_0xdb6d9f);
} else {
_0xbacef4(_0xdb6d9f);
}
}
function _0x4693d2(_0x2be6fe, _0x50ad2d = null) {
if (_0x50ad2d) {
_0x2be6fe.src = _0x50ad2d;
}
_0x2be6fe.addEventListener('canplay', () => {
_0x2be6fe.play();
_0x2c2baf.innerHTML = "";
_0x2c2baf.classList.add("is-active");
document.body.classList.add("is-playing");
});
if (!_0x1ffa1f) {
_0x5ac54e(_0x2be6fe, _0x35fbf4);
_0x1ffa1f = true;
}
_0x2be6fe.load();
}
function _0xbacef4(_0x2076c6) {
_0x2076c6.pause();
_0x2c2baf.innerHTML = "";
_0x2c2baf.classList.remove('is-active');
document.body.classList.remove("is-playing");
}
function _0x4cdedf(_0x140720) {
if (!_0x140720) {
return;
}
const _0x5b8e26 = document.getElementById(_0x140720.dataset.outside);
if (!_0x5b8e26) {
return;
}
_0x140720.addEventListener('click', () => {
_0x140720.classList.toggle('is-active');
_0x5b8e26.classList.toggle('is-active');
});
const _0x4593f6 = _0x43ed91 => {
if (!_0x5b8e26.contains(_0x43ed91.target) && !_0x140720.contains(_0x43ed91.target)) {
_0x140720.classList.remove('is-active');
_0x5b8e26.classList.remove('is-active');
}
};
document.addEventListener("click", _0x4593f6);
const _0x12e724 = _0x5b8e26.querySelector("[data-close]");
if (_0x12e724) {
_0x12e724.onclick = function () {
_0x140720.classList.remove('is-active');
_0x5b8e26.classList.remove('is-active');
};
}
}
_0x5db4bc.forEach(_0x1ee827 => {
_0x4cdedf(_0x1ee827);
});
function _0xdde489(_0x6f316a) {
const _0x55788d = document.createElement("canvas");
_0x55788d.setAttribute('id', "visualizerCanvas");
_0x55788d.setAttribute("class", "visualizer-item");
_0x6f316a.appendChild(_0x55788d);
_0x55788d.width = _0x6f316a.clientWidth;
_0x55788d.height = _0x6f316a.clientHeight;
return _0x55788d;
}
function _0x4bf99e(_0x577eae, _0x21f012) {
_0x577eae.width = _0x21f012.clientWidth;
_0x577eae.height = _0x21f012.clientHeight;
}
const _0x5ac54e = (_0x55d4f2, _0x4d062f) => {
if (!_0x55d4f2 || !_0x4d062f) {
return;
}
const _0xc2a0ec = {
'fftSize': _0x4d062f.dataset.fftSize || 0x800,
'numBars': _0x4d062f.dataset.bars || 0x28,
'maxHeight': _0x4d062f.dataset.maxHeight || 0xff
};
const _0x3c5a5a = new AudioContext();
const _0x4f5af2 = _0x3c5a5a.createMediaElementSource(_0x55d4f2);
const _0x2f50db = _0x3c5a5a.createAnalyser();
_0x4f5af2.connect(_0x2f50db);
_0x4f5af2.connect(_0x3c5a5a.destination);
const _0x4bae49 = new Uint8Array(_0x2f50db.frequencyBinCount);
const _0x121666 = _0xdde489(_0x4d062f);
const _0x266128 = _0x121666.getContext('2d');
const _0x3536e0 = () => {
_0x4bf99e(_0x121666, _0x4d062f);
_0x2f50db.getByteFrequencyData(_0x4bae49);
if (_0xc2a0ec.fftSize) {
_0x2f50db.fftSize = _0xc2a0ec.fftSize;
}
_0x266128.clearRect(0x0, 0x0, _0x121666.width, _0x121666.height);
for (let _0x2d6eea = 0x0; _0x2d6eea < _0xc2a0ec.numBars; _0x2d6eea++) {
const _0x17359a = Math.floor((_0x2d6eea + 0xa) * (_0x2d6eea < _0xc2a0ec.numBars / 0x2 ? 0x2 : 0x1));
const _0x7d713a = _0x4bae49[_0x17359a];
const _0x15df11 = Math.max(0x4, _0x7d713a || 0x0) + _0xc2a0ec.maxHeight / 0xff;
const _0x1814dd = _0x121666.width / _0xc2a0ec.numBars;
const _0x43c645 = _0x2d6eea * _0x1814dd;
const _0x5caaed = _0x121666.height - _0x15df11;
_0x266128.fillStyle = "white";
_0x266128.fillRect(_0x43c645, _0x5caaed, _0x1814dd + 0x1, _0x15df11);
}
requestAnimationFrame(_0x3536e0);
};
_0x3536e0();
window.addEventListener('resize', () => {
_0x4bf99e(_0x121666, _0x4d062f);
});
};
async function _0x50b095({
artist: _0x53f9fc,
title: _0x15edb7,
art: _0x22c7d5,
cover: _0x1b818e,
server: _0x489d1c
}) {
let _0x3b034c = {};
let _0x37c545 = _0x53f9fc ? _0x53f9fc + " - " + _0x15edb7 : _0x15edb7;
const _0x3161f7 = _0x37c545.toLowerCase();
if (_0x4e548b[_0x3161f7]) {
return _0x4e548b[_0x3161f7];
}
try {
const _0x251f1a = await fetch("https://demo.jbcast.icu/getMusicInfo.php?artist=" + encodeURIComponent(_0x53f9fc) + "&title=" + encodeURIComponent(_0x15edb7) + "&service=" + _0x489d1c);
if (_0x251f1a.ok) {
_0x3b034c = await _0x251f1a.json();
} else {
console.warn("Erro na API PHP, buscando no iTunes...", _0x251f1a.status);
_0x3b034c = await _0x21809a(_0x53f9fc, _0x15edb7, _0x22c7d5, _0x1b818e);
}
} catch (_0x3e6c03) {
console.error("Erro ao buscar dados:", _0x3e6c03);
_0x3b034c = await _0x21809a(_0x53f9fc, _0x15edb7, _0x22c7d5, _0x1b818e);
}
_0x4e548b[_0x3161f7] = _0x3b034c;
return _0x3b034c;
}
async function _0x21809a(_0x239e7f, _0x41f492, _0x4aed21, _0x5ea418) {
let _0x533d00 = _0x239e7f ? _0x239e7f + " - " + _0x41f492 : _0x41f492;
const _0x4556fb = _0x533d00.toLowerCase();
if (_0x4e548b[_0x4556fb]) {
return _0x4e548b[_0x4556fb];
}
try {
const _0x43dda5 = await fetch("https://itunes.apple.com/search?term=" + encodeURIComponent(_0x533d00) + '&media=music&limit=1');
if (!_0x43dda5.ok) {
throw new Error("Erro na requisição para o iTunes. Status: " + _0x43dda5.status);
}
const _0x505218 = await _0x43dda5.json();
if (_0x505218.resultCount > 0x0) {
const _0x5e1010 = _0x505218.results[0x0];
const _0x3ad36b = {
'title': _0x5e1010.trackName || _0x41f492,
'artist': _0x5e1010.artistName || _0x239e7f,
'thumbnail': _0x5e1010.artworkUrl100 || _0x4aed21,
'art': _0x5e1010.artworkUrl100 ? _0x5e1010.artworkUrl100.replace(/100x100/, "600x600") : _0x4aed21,
'cover': _0x5e1010.artworkUrl100 ? _0x5e1010.artworkUrl100.replace(/100x100/, "1500x1500") : _0x5ea418,
'stream_url': _0x5e1010.trackViewUrl || "#not-found"
};
_0x4e548b[_0x4556fb] = _0x3ad36b;
return _0x3ad36b;
} else {
console.log("Nenhum resultado encontrado no iTunes.");
return {
'title': _0x41f492,
'artist': _0x239e7f,
'art': _0x4aed21,
'cover': _0x5ea418,
'stream_url': '#not-found'
};
}
} catch (_0xd05fce) {
console.error("Erro ao buscar dados do iTunes:", _0xd05fce);
return {
'title': _0x41f492,
'artist': _0x239e7f,
'art': _0x4aed21,
'cover': _0x5ea418,
'stream_url': "#not-found"
};
}
}
const _0x4666e2 = async (_0x53f407, _0x38e6ec) => {
try {
const _0x3a25c3 = await fetch("https://api.vagalume.com.br/search.php?apikey=1637b78dc3b129e6843ed674489a92d0&art=" + encodeURIComponent(_0x53f407) + '&mus=' + encodeURIComponent(_0x38e6ec));
const _0x379afe = await _0x3a25c3.json();
if (_0x379afe.type === "exact" || _0x379afe.type === "aprox") {
const _0xffc010 = _0x379afe.mus[0x0].text;
return _0xffc010;
} else {
return "Letra indisponÃvel";
}
} catch (_0x30d171) {
console.error("Error fetching lyrics:", _0x30d171);
return "Letra no disponible";
}
};
function _0x35fc92(_0x4fb04e) {
let _0x59a769;
let _0x4bdfcd;
if (_0x4fb04e.last_played) {
_0x59a769 = _0x4fb04e.last_played.song;
_0x4bdfcd = _0x4fb04e.last_played.artist;
} else {
if (_0x4fb04e.song && _0x4fb04e.artist) {
_0x59a769 = _0x4fb04e.song;
_0x4bdfcd = _0x4fb04e.artist;
} else {
if (_0x4fb04e.songtitle && _0x4fb04e.songtitle.includes(" - ")) {
_0x59a769 = _0x4fb04e.songtitle.split(" - ")[0x0];
_0x4bdfcd = _0x4fb04e.songtitle.split(" - ")[0x1];
} else {
if (_0x4fb04e.now_playing) {
_0x59a769 = _0x4fb04e.now_playing.song.title;
_0x4bdfcd = _0x4fb04e.now_playing.song.artist;
} else {
if (_0x4fb04e.artist && _0x4fb04e.title) {
_0x59a769 = _0x4fb04e.title;
_0x4bdfcd = _0x4fb04e.artist;
} else {
if (_0x4fb04e.currenttrack_title) {
_0x59a769 = _0x4fb04e.currenttrack_title;
_0x4bdfcd = _0x4fb04e.currenttrack_artist;
} else if (_0x4fb04e.title && _0x4fb04e.djprofile && _0x4fb04e.djusername) {
_0x59a769 = _0x4fb04e.title.split(" - ")[0x1];
_0x4bdfcd = _0x4fb04e.title.split(" - ")[0x0];
} else {
_0x59a769 = _0x4fb04e.currentSong;
_0x4bdfcd = _0x4fb04e.currentArtist;
}
}
}
}
}
}
return {
'title': _0x59a769,
'artist': _0x4bdfcd
};
}
function _0x3547cb(_0x38cc38) {
let _0x2bee84;
let _0x4d0988;
let _0x165311 = _0x38cc38.song_history || _0x38cc38.history || _0x38cc38.songHistory || [];
_0x165311 = _0x165311.slice(0, 0);
const _0x5f1648 = _0x165311.map(_0x5c6f68 => {
if (_0x38cc38.song_history) {
_0x2bee84 = _0x5c6f68.song.artist;
_0x4d0988 = _0x5c6f68.song.title;
} else {
if (_0x38cc38.history) {
_0x2bee84 = (_0x5c6f68.artist || '').replace(/^\d+\.\)\s/, '').replace(/
$/, '');
_0x4d0988 = (_0x5c6f68.song || '').replace(/^\d+\.\)\s/, '').replace(/
$/, '');
} else if (_0x38cc38.songHistory) {
_0x2bee84 = _0x5c6f68.song.artist;
_0x4d0988 = _0x5c6f68.song.title;
}
}
return {
'artist': _0x2bee84,
'song': _0x4d0988
};
});
return _0x5f1648;
}
function _0x1c8bad(_0xd64ed6, _0x5888e7) {
const _0x585208 = document.documentElement;
const _0x1e571e = document.querySelector("meta[name=theme-color]");
if (_0xd64ed6.complete) {
_0x585208.setAttribute("style", "--accent: rgb(" + _0x5888e7.getColor(_0xd64ed6) + ')');
_0x1e571e.setAttribute("content", 'rgb(' + _0x5888e7.getColor(_0xd64ed6) + ')');
} else {
console.log("imagen no completa");
_0xd64ed6.addEventListener("load", function () {
_0x585208.setAttribute("style", "--accent: rgb(" + _0x5888e7.getColor(_0xd64ed6) + ')');
_0x1e571e.setAttribute('content', "rgb(" + _0x5888e7.getColor(_0xd64ed6) + ')');
});
}
}
function _0x442470(_0x50a4ac) {
const _0x20c6f0 = document.createElement("button");
_0x20c6f0.classList.add("player-button-tv", 'btn');
_0x20c6f0.innerHTML = "Tv ao vivo";
_0x20c6f0.addEventListener("click", () => {
_0xcc9105.classList.add("is-active");
_0xbacef4(_0xdb6d9f);
const _0x4553d0 = _0xcc9105.querySelector(".modal-body-video");
const _0x43b8f8 = _0xcc9105.querySelector("[data-close]");
const _0x411acc = document.createElement("iframe");
_0x411acc.src = _0x50a4ac;
_0x411acc.allowFullscreen = true;
_0x4553d0.appendChild(_0x411acc);
_0x43b8f8.addEventListener("click", () => {
_0xcc9105.classList.remove('is-active');
_0x411acc.remove();
});
});
_0xc0984c.appendChild(_0x20c6f0);
}
function _0x135c51(_0x309dc1) {
if (!_0x309dc1) {
return;
}
if (_0x309dc1.time) {
const _0x406487 = document.createElement('div');
const _0x1196ff = document.createElement("span");
_0x406487.classList.add("player-program-time-container");
_0x1196ff.classList.add("player-program-badge");
_0x1196ff.textContent = "Agora";
_0x406487.appendChild(_0x1196ff);
const _0x461c2d = document.createElement("span");
_0x461c2d.classList.add("player-program-time");
_0x461c2d.textContent = _0x309dc1.time;
_0x406487.appendChild(_0x461c2d);
_0x18bbd4.appendChild(_0x406487);
}
if (_0x309dc1.name) {
const _0x4bf083 = document.createElement('span');
_0x4bf083.classList.add("player-program-name");
_0x4bf083.textContent = _0x309dc1.name;
_0x18bbd4.appendChild(_0x4bf083);
}
if (_0x309dc1.description) {
const _0x5d4712 = document.createElement("span");
_0x5d4712.classList.add("player-program-description");
_0x5d4712.textContent = _0x309dc1.description;
_0x18bbd4.appendChild(_0x5d4712);
}
}
function _0xf7aa6(_0x291713, _0xf1ad30) {
const _0x2991df = document.createElement('a');
_0x2991df.classList.add('player-social-item');
_0x2991df.href = _0x291713;
_0x2991df.target = "_blank";
_0x2991df.innerHTML = _0x35a29b[_0xf1ad30];
return _0x2991df;
}
function _0x1cda36(_0x198802, _0xc247da) {
const _0x2cdb75 = document.createElement('a');
_0x2cdb75.classList.add("player-apps-item");
_0x2cdb75.href = _0x198802;
_0x2cdb75.target = '_blank';
_0x2cdb75.innerHTML = "";
return _0x2cdb75;
}
function _0x40eb6c(_0x186619, _0x50ba48, _0x9fd446, _0x5de443) {
const _0x222549 = document.createElement("button");
_0x222549.classList.add("station");
_0x222549.innerHTML = "
";
_0x222549.dataset.index = _0x50ba48;
_0x222549.dataset.hash = _0x186619.hash;
if (_0x9fd446.stream_url === _0x186619.stream_url) {
_0x222549.classList.add("is-active");
_0x58c67a = _0x222549;
}
_0x222549.addEventListener('click', () => {
if (_0x222549.classList.contains("is-active")) {
return;
}
if (_0x58c67a) {
_0x58c67a.classList.remove("is-active");
}
_0x222549.classList.add('is-active');
_0x58c67a = _0x222549;
_0xfd3166(_0x186619);
_0x4693d2(_0xdb6d9f, _0x186619.stream_url);
if (_0x4f5987) {
_0x4f5987.innerHTML = '';
}
if (typeof _0x5de443 === "function") {
_0x5de443(_0x186619);
}
});
return _0x222549;
}
function _0x3fe58c(_0x19c480, _0x1a2be5, _0x3685cd) {
if (!_0x88f18a) {
return;
}
_0x88f18a.innerHTML = '';
_0x19c480.forEach(async (_0x544374, _0x49f62a) => {
const _0x1aef54 = document.createDocumentFragment();
const _0x1b5d9d = _0x40eb6c(_0x544374, _0x49f62a, _0x1a2be5, _0x3685cd);
_0x1aef54.appendChild(_0x1b5d9d);
_0x88f18a.appendChild(_0x1aef54);
});
}
function _0xfd3166(_0x910678) {
_0x4d0e83.innerHTML = '';
_0x4eb6ae.innerHTML = '';
_0x18bbd4.innerHTML = '';
_0xc0984c.innerHTML = '';
_0x9a177c.src = _0x910678.logo;
_0x32ca52.src = _0x910678.album;
_0x4f1ff0.src = _0x910678.cover || _0x910678.album;
_0x2af40c.textContent = _0x910678.name;
_0x230a71.textContent = _0x910678.description;
if (_0x910678.social && _0x4d0e83) {
Object.keys(_0x910678.social).forEach(_0x1cadc3 => {
_0x4d0e83.appendChild(_0xf7aa6(_0x910678.social[_0x1cadc3], _0x1cadc3));
});
}
if (_0x910678.apps && _0x4eb6ae) {
Object.keys(_0x910678.apps).forEach(_0x26d04c => {
_0x4eb6ae.appendChild(_0x1cda36(_0x910678.apps[_0x26d04c], _0x26d04c));
});
}
if (_0x910678.program && _0x18bbd4) {
_0x135c51(_0x910678.program);
}
if (_0x910678.tv_url && _0xc0984c) {
_0x442470(_0x910678.tv_url);
}
}
function _0x163b31(_0x3d94b7) {
const {
title: _0x56f4be,
artist: _0x1b5cce,
album: _0x921e26,
art: _0x168d10
} = _0x3d94b7;
if ('mediaSession' in navigator) {
navigator.mediaSession.metadata = new MediaMetadata({
'title': _0x56f4be,
'artist': _0x1b5cce,
'album': _0x921e26,
'artwork': [{
'src': _0x168d10,
'sizes': "512x512",
'type': "image/png"
}]
});
navigator.mediaSession.setActionHandler("play", () => {
_0x4693d2();
});
navigator.mediaSession.setActionHandler('pause', () => {
_0xbacef4();
});
}
}
function _0x3fc8b4(_0x344f3e) {
_0x52ef0a.querySelector('.song-name').textContent = _0x344f3e.title;
_0x52ef0a.querySelector(".song-artist").textContent = _0x344f3e.artist;
const _0x43a4c0 = _0x52ef0a.querySelector('.player-artwork');
if (_0x43a4c0) {
const _0x28f4d2 = document.createElement("img");
_0x28f4d2.src = _0x344f3e.art;
_0x28f4d2.width = 0x258;
_0x28f4d2.height = 0x258;
_0x28f4d2.addEventListener("load", () => {
_0x43a4c0.appendChild(_0x28f4d2);
const _0x16bc15 = new ColorThief();
_0x43b9f5(_0x28f4d2.src).then(_0x552666 => {
_0x1c8bad(_0x552666, _0x16bc15);
});
setTimeout(() => {
_0x43a4c0.querySelectorAll("img").forEach(_0x466810 => {
_0x466810.style.transform = 'translateX(' + -_0x466810.width + 'px)';
_0x466810.addEventListener('transitionend', () => {
_0x43a4c0.querySelectorAll("img:not(:last-child)").forEach(_0x21d643 => {
_0x21d643.remove();
});
_0x466810.style.transition = "none";
_0x466810.style.transform = 'none';
setTimeout(() => {
_0x466810.removeAttribute('style');
}, 0x3e8);
});
});
}, 0x64);
});
}
if (_0x4f1ff0) {
const _0xd01136 = new Image();
_0xd01136.src = _0x344f3e.cover || _0x344f3e.art;
_0xd01136.addEventListener("load", () => {
_0x4f1ff0.style.opacity = 0x0;
_0x4f1ff0.addEventListener("transitionend", () => {
_0x4f1ff0.src = _0x344f3e.cover || _0x344f3e.art;
_0x4f1ff0.style.opacity = 0x1;
});
});
}
}
function _0x53f842(_0x51f71c, _0x255b28, _0x35b7c6) {
if (!_0x4f5987) {
return;
}
_0x4f5987.innerHTML = "