⏳ Новое устройство на карантине 48ч (вывод, ключи и админка закрыты)
🚨 Зафиксирован вход с нового устройства! Проверь в Профиле, ты ли это!
Новый диалог
✨ Универсальный⚡ Авто-выбор
📢 Объявление —
Открыть
✨ Универсал 🎭 Character.AI RP 💻 Код и Игры 🧠 Анализ
Выбирай модель в «🌐 Каталог API» ⏱ Лимиты
🌐 Каталог публичных моделей
🎭 Режим чата и Секретный // промпт //
🧠 Память чата
🚀 Добавить API (заработок 50% или лично для себя)
📋 Мои ключи
👤 Гость
FREE
🔥 Стрик: 0 дн. 🔗 Реф.код: —
🛡 Безопасность и Устройства
⏱ Лимиты (5ч / Неделя / Месяц)
5-часовое окно0 / 0 ₽
Недельный лимит0 / 0 ₽
Месячный лимит0 / 0 ₽
💰 Кошелёк разработчика (50% с тарифов)
0.00 ₽
Всего заработано: 0.00 ₽
`; html = html.replace(`@@CB_${id}@@`, box); } return `
${html}
`; } let curSandboxHtml = ''; function openSandbox(id) { const item = window.__codeBlocks[id]; if (!item) return; curSandboxHtml = item.lang === 'svg' ? `${item.code}` : item.code; document.getElementById('sandboxIframe').srcdoc = curSandboxHtml; document.getElementById('sandboxModal').classList.add('open'); } function copyCode(id) { const item = window.__codeBlocks[id]; if (item) copyTextSafe(item.code); } async function loadCaptcha() { try { const c = await apiFetch('/api/captcha/challenge'); const qEl = document.getElementById('authCaptchaQuestion'), aEl = document.getElementById('authCaptchaAnswer'), tsBox = document.getElementById('turnstileBox'); if (c.mode === 'turnstile') { qEl.textContent = '🛡 Проверка Cloudflare:'; aEl.style.display = 'none'; tsBox.innerHTML = ''; if (!window.turnstile) { const s = document.createElement('script'); s.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit'; s.onload = () => window.turnstile.render('#turnstileBox', { sitekey: c.siteKey, theme: 'dark', callback: t => appState.turnstileToken = t }); document.head.appendChild(s); } else { window.turnstile.render('#turnstileBox', { sitekey: c.siteKey, theme: 'dark', callback: t => appState.turnstileToken = t }); } } else { qEl.textContent = `🛡 Капча: ${c.question}`; aEl.style.display = 'block'; aEl.value = ''; appState.challengeToken = c.challengeToken; } } catch (_) {} } async function loadStats() { try { const s = await apiFetch('/api/stats'); document.getElementById('authStatsText').textContent = `🌐 Моделей: ${s.models} · Юзеров: ${s.users} · Запросов: ${s.requests}`; renderAdBanner(s.ad); } catch (_) {} } async function sendEmailCodeReq() { const btn = document.getElementById('btnSendCode'); const payload = { mode: authMode === 'login' ? 'login' : 'register', username: document.getElementById('authUsername').value.trim(), email: document.getElementById('authEmail').value.trim(), challengeToken: appState.challengeToken, captchaAnswer: document.getElementById('authCaptchaAnswer').value, turnstileToken: appState.turnstileToken }; btn.disabled = true; try { const r = await apiFetch('/api/auth/send-code', { method: 'POST', body: JSON.stringify(payload) }); showToast(r.message); if (r.mailerMissing) document.getElementById('authEmailCodeGroup').style.display = 'none'; } catch (e) { showToast('❌ ' + e.message); loadCaptcha(); } setTimeout(() => btn.disabled = false, 4000); } async function submitAuth() { const u = document.getElementById('authUsername').value.trim(); const email = document.getElementById('authEmail').value.trim(); const p = document.getElementById('authPassword').value; const ref = document.getElementById('authRefCode').value.trim(); const emailCode = document.getElementById('authEmailCode').value.trim(); const rulesAccepted = document.getElementById('authRulesCheck').checked; if (authMode === 'reg' && !rulesAccepted) return showToast('Прими Правила проекта!'); try { const endpoint = authMode === 'login' ? '/api/auth/login' : '/api/auth/register'; const res = await apiFetch(endpoint, { method: 'POST', body: JSON.stringify({ username: u, email, password: p, refCode: ref, rulesAccepted, emailCode, challengeToken: appState.challengeToken, captchaAnswer: document.getElementById('authCaptchaAnswer').value, turnstileToken: appState.turnstileToken }) }); appState.token = res.token; saveLocal(); document.getElementById('authModal').classList.remove('open'); await loadMe(); await loadCatalog(); showToast(authMode === 'login' ? '✅ С возвращением!' : '🎉 Аккаунт создан!'); } catch (e) { if (e.data?.needEmailCode) document.getElementById('authEmailCodeGroup').style.display = 'flex'; if (e.data?.burned) document.getElementById('authEmailCode').value = ''; showToast('❌ ' + e.message); loadCaptcha(); } }