die('Invalid session token. Are you trying to hack me?!');
}
$dataStore = new \PBPanel\Util\DataStore();
$connection = new \PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botSettings = $functions->getDbTableArray('settings');
$youtubePlayerSettings = $functions->getDbTableArray('youtubePlayer');
$requestQueue = preg_split('/\\n/', trim($functions->getOtherFile($dataStore->getVar('paths', 'youtubePlaylist'))));
$defaultPlaylist = preg_split('/\\n/', trim($functions->getOtherFile($dataStore->getVar('paths', 'defaultYoutubePlaylist'))));
$defaultPlaylistLength = 0;
$requestQueueLength = 0;
$requestQueueDataRows = '';
$defaultPlaylistDataRows = '';
foreach ($defaultPlaylist as $item) {
    preg_match('/[0-9]+\\.\\s(.*)\\s\\(([a-z0-9=?\\/.:_-]+)\\)$/i', $functions->cleanYTVideoTitle($item), $matches);
    $defaultPlaylistDataRows .= '<tr><td>' . ($defaultPlaylistLength + 1) . '.</td><td>' . trim($matches[1]) . '</td><td><div class="btn-toolbar" style="width:125px;">' . $templates->botCommandButton('playsong ' . str_replace('https://youtube.com/watch?v=', '', $matches[2]), '<span class="fa fa-play"></span>', 'success btn-sm') . $templates->botCommandButton('musicplayer deldefault ' . $defaultPlaylistLength, '<span class="fa fa-trash"></span>', 'danger btn-sm') . $templates->botCommandButton('d !chat Youtube link for ' . $matches[1] . ' -> ' . $matches[2], '<span class="fa fa-link"></span>', 'default btn-sm') . '</div></td></tr>';
    ++$defaultPlaylistLength;
}
foreach ($requestQueue as $item) {
    if ($item == '') {
        continue;
    }
    preg_match('/(.*)\\s\\(.+\\s([a-z0-9_]+)\\)$/i', $functions->cleanYTVideoTitle($item), $matches);
    $requestQueueDataRows .= '<tr><td>' . ($requestQueueLength + 1) . '.</td><td>' . $matches[1] . '</td><td>' . $matches[2] . '</td></tr>';
    ++$requestQueueLength;
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">