GitHub Action
commited on
Commit
Β·
869e4d2
1
Parent(s):
f93940a
Sync from GitHub: 8a3e6537640e76da443641bac7847ba548a36fe3
Browse files- .gitattributes +6 -0
- .gitignore.backup +1 -0
- frontend/src/routes/+page.svelte +93 -73
- hfstudio/database.py +55 -0
- hfstudio/server.py +126 -0
- hfstudio/static/_app/immutable/assets/0.CsSbhH5k.css +1 -0
- hfstudio/static/_app/immutable/chunks/CEW4is7A.js +3 -0
- hfstudio/static/_app/immutable/entry/app.BdU0kAy8.js +2 -0
- hfstudio/static/_app/immutable/entry/start.CuKEKhTN.js +1 -0
- hfstudio/static/_app/immutable/nodes/0.BUlMOkAD.js +5 -0
- hfstudio/static/_app/immutable/nodes/1.CNpY1S-Y.js +1 -0
- hfstudio/static/_app/immutable/nodes/2.DpS_xF3t.js +0 -0
- hfstudio/static/_app/version.json +1 -1
- hfstudio/static/index.html +6 -6
- pyproject.toml +1 -0
.gitattributes
CHANGED
|
@@ -7,3 +7,9 @@
|
|
| 7 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 9 |
*.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 9 |
*.pdf filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
hfstudio/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
hfstudio/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
frontend/static/assets/hf-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
frontend/static/assets/hf-studio-logo.png filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
hfstudio/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
frontend/static/samples/harvard.wav filter=lfs diff=lfs merge=lfs -text
|
.gitignore.backup
CHANGED
|
@@ -277,6 +277,7 @@ public
|
|
| 277 |
notebooks/
|
| 278 |
models/*.pyc
|
| 279 |
models/__pycache__/
|
|
|
|
| 280 |
|
| 281 |
# OS
|
| 282 |
.DS_Store
|
|
|
|
| 277 |
notebooks/
|
| 278 |
models/*.pyc
|
| 279 |
models/__pycache__/
|
| 280 |
+
hfstudio/hfstudio.db
|
| 281 |
|
| 282 |
# OS
|
| 283 |
.DS_Store
|
frontend/src/routes/+page.svelte
CHANGED
|
@@ -50,10 +50,9 @@
|
|
| 50 |
let showErrorModal = false;
|
| 51 |
let errorMessage = '';
|
| 52 |
let errorDetails = '';
|
| 53 |
-
let currentUsername = null;
|
| 54 |
|
| 55 |
const famousBookOpeners = [
|
| 56 |
-
'It was the best of times, it was the worst of times
|
| 57 |
'It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife.',
|
| 58 |
'All happy families are alike; each unhappy family is unhappy in its own way.',
|
| 59 |
];
|
|
@@ -84,7 +83,7 @@
|
|
| 84 |
{
|
| 85 |
id: 'pirate',
|
| 86 |
name: 'Pirate',
|
| 87 |
-
description: 'Young pirate that speaks gruffly and with excitement',
|
| 88 |
sample: '/voices/pirate.mp3',
|
| 89 |
preview_url:
|
| 90 |
'https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3',
|
|
@@ -116,6 +115,24 @@
|
|
| 116 |
// Generate import code when user starts interacting
|
| 117 |
if (!importCode) {
|
| 118 |
importCode = generateImportCode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
}
|
| 120 |
|
| 121 |
const ttsCode = generateTTSCode();
|
|
@@ -283,54 +300,90 @@
|
|
| 283 |
}
|
| 284 |
}
|
| 285 |
|
| 286 |
-
function addCodeToHistory(code, result = null) {
|
| 287 |
const entry = {
|
| 288 |
id: Date.now() + Math.random(),
|
| 289 |
code,
|
| 290 |
result,
|
| 291 |
};
|
| 292 |
codeHistory = [...codeHistory, entry];
|
| 293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
return entry;
|
| 295 |
}
|
| 296 |
|
| 297 |
-
function
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
importCode,
|
| 304 |
-
history: codeHistory,
|
| 305 |
-
};
|
| 306 |
-
localStorage.setItem(storageKey, JSON.stringify(historyData));
|
| 307 |
-
}
|
| 308 |
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
const
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
}
|
| 325 |
}
|
| 326 |
|
| 327 |
-
function resetHistory() {
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 334 |
}
|
| 335 |
}
|
| 336 |
|
|
@@ -472,41 +525,11 @@ print(f"β Audio saved to {output_filename}")
|
|
| 472 |
copyToClipboard(markdownContent, 'All code copied as Markdown!');
|
| 473 |
}
|
| 474 |
|
| 475 |
-
onMount(() => {
|
| 476 |
-
//
|
| 477 |
-
|
| 478 |
-
// Auth status managed by parent layout component
|
| 479 |
-
};
|
| 480 |
-
|
| 481 |
-
checkUsername();
|
| 482 |
-
|
| 483 |
-
// Listen for auth changes
|
| 484 |
-
window.addEventListener('storage', (e) => {
|
| 485 |
-
if (e.key === 'hf_access_token') {
|
| 486 |
-
checkUsername();
|
| 487 |
-
}
|
| 488 |
-
});
|
| 489 |
});
|
| 490 |
|
| 491 |
-
async function fetchUserInfo(token) {
|
| 492 |
-
try {
|
| 493 |
-
const response = await fetch('https://huggingface.co/api/whoami-v2', {
|
| 494 |
-
headers: {
|
| 495 |
-
Authorization: `Bearer ${token}`,
|
| 496 |
-
},
|
| 497 |
-
});
|
| 498 |
-
|
| 499 |
-
if (response.ok) {
|
| 500 |
-
const userData = await response.json();
|
| 501 |
-
currentUsername =
|
| 502 |
-
userData.name || userData.fullname || userData.login || userData.username || 'User';
|
| 503 |
-
loadHistoryFromStorage();
|
| 504 |
-
}
|
| 505 |
-
} catch (error) {
|
| 506 |
-
console.error('Error fetching user info:', error);
|
| 507 |
-
}
|
| 508 |
-
}
|
| 509 |
-
|
| 510 |
// Update setup code when mode changes
|
| 511 |
$: if (mode) {
|
| 512 |
setupCode = generateSetupCode();
|
|
@@ -1092,9 +1115,6 @@ print(f"β Audio saved to {output_filename}")
|
|
| 1092 |
{#if !importCode && codeHistory.length === 0}
|
| 1093 |
<div class="bg-white rounded-lg border border-gray-200 p-8 text-center">
|
| 1094 |
<p class="text-gray-500">Start using the UI to see generated code here</p>
|
| 1095 |
-
{#if currentUsername}
|
| 1096 |
-
<p class="text-xs text-gray-400 mt-2">Logged in as: {currentUsername}</p>
|
| 1097 |
-
{/if}
|
| 1098 |
</div>
|
| 1099 |
{/if}
|
| 1100 |
|
|
|
|
| 50 |
let showErrorModal = false;
|
| 51 |
let errorMessage = '';
|
| 52 |
let errorDetails = '';
|
|
|
|
| 53 |
|
| 54 |
const famousBookOpeners = [
|
| 55 |
+
'It was the best of times, it was the worst of times. It was the age of wisdom, it was the age of foolishness.',
|
| 56 |
'It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife.',
|
| 57 |
'All happy families are alike; each unhappy family is unhappy in its own way.',
|
| 58 |
];
|
|
|
|
| 83 |
{
|
| 84 |
id: 'pirate',
|
| 85 |
name: 'Pirate',
|
| 86 |
+
description: 'Young male pirate-y voice that speaks gruffly and with excitement',
|
| 87 |
sample: '/voices/pirate.mp3',
|
| 88 |
preview_url:
|
| 89 |
'https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3',
|
|
|
|
| 115 |
// Generate import code when user starts interacting
|
| 116 |
if (!importCode) {
|
| 117 |
importCode = generateImportCode();
|
| 118 |
+
// Save import code to database
|
| 119 |
+
try {
|
| 120 |
+
await fetch('/api/history/save', {
|
| 121 |
+
method: 'POST',
|
| 122 |
+
headers: {
|
| 123 |
+
'Content-Type': 'application/json',
|
| 124 |
+
},
|
| 125 |
+
credentials: 'include',
|
| 126 |
+
body: JSON.stringify({
|
| 127 |
+
code: importCode,
|
| 128 |
+
result_type: null,
|
| 129 |
+
result_data: null,
|
| 130 |
+
entry_type: 'import',
|
| 131 |
+
}),
|
| 132 |
+
});
|
| 133 |
+
} catch (error) {
|
| 134 |
+
console.error('Error saving import code to database:', error);
|
| 135 |
+
}
|
| 136 |
}
|
| 137 |
|
| 138 |
const ttsCode = generateTTSCode();
|
|
|
|
| 300 |
}
|
| 301 |
}
|
| 302 |
|
| 303 |
+
async function addCodeToHistory(code, result = null) {
|
| 304 |
const entry = {
|
| 305 |
id: Date.now() + Math.random(),
|
| 306 |
code,
|
| 307 |
result,
|
| 308 |
};
|
| 309 |
codeHistory = [...codeHistory, entry];
|
| 310 |
+
|
| 311 |
+
// Save to database
|
| 312 |
+
try {
|
| 313 |
+
await fetch('/api/history/save', {
|
| 314 |
+
method: 'POST',
|
| 315 |
+
headers: {
|
| 316 |
+
'Content-Type': 'application/json',
|
| 317 |
+
},
|
| 318 |
+
credentials: 'include',
|
| 319 |
+
body: JSON.stringify({
|
| 320 |
+
code: code,
|
| 321 |
+
result_type: result?.type || null,
|
| 322 |
+
result_data: result || null,
|
| 323 |
+
entry_type: 'generation',
|
| 324 |
+
}),
|
| 325 |
+
});
|
| 326 |
+
} catch (error) {
|
| 327 |
+
console.error('Error saving history to database:', error);
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
return entry;
|
| 331 |
}
|
| 332 |
|
| 333 |
+
async function loadHistoryFromDatabase() {
|
| 334 |
+
try {
|
| 335 |
+
const response = await fetch('/api/history/load', {
|
| 336 |
+
method: 'GET',
|
| 337 |
+
credentials: 'include',
|
| 338 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 339 |
|
| 340 |
+
if (response.ok) {
|
| 341 |
+
const data = await response.json();
|
| 342 |
+
|
| 343 |
+
// Separate different types of entries
|
| 344 |
+
const setupEntries = data.entries.filter((e) => e.entry_type === 'setup');
|
| 345 |
+
const importEntries = data.entries.filter((e) => e.entry_type === 'import');
|
| 346 |
+
const generationEntries = data.entries.filter((e) => e.entry_type === 'generation');
|
| 347 |
+
|
| 348 |
+
// Load setup code (use latest or regenerate)
|
| 349 |
+
setupCode = generateSetupCode();
|
| 350 |
+
|
| 351 |
+
// Load import code (use latest or null)
|
| 352 |
+
importCode = importEntries.length > 0 ? importEntries[importEntries.length - 1].code : null;
|
| 353 |
+
|
| 354 |
+
// Load generation history
|
| 355 |
+
codeHistory = generationEntries.map((entry) => ({
|
| 356 |
+
id: entry.id,
|
| 357 |
+
code: entry.code,
|
| 358 |
+
result: entry.result_data,
|
| 359 |
+
}));
|
| 360 |
}
|
| 361 |
+
} catch (error) {
|
| 362 |
+
console.error('Error loading history from database:', error);
|
| 363 |
+
// Fallback to empty state
|
| 364 |
+
codeHistory = [];
|
| 365 |
+
setupCode = generateSetupCode();
|
| 366 |
+
importCode = null;
|
| 367 |
}
|
| 368 |
}
|
| 369 |
|
| 370 |
+
async function resetHistory() {
|
| 371 |
+
try {
|
| 372 |
+
await fetch('/api/history/clear', {
|
| 373 |
+
method: 'DELETE',
|
| 374 |
+
credentials: 'include',
|
| 375 |
+
});
|
| 376 |
+
|
| 377 |
+
// Reset local state
|
| 378 |
+
codeHistory = [];
|
| 379 |
+
setupCode = generateSetupCode();
|
| 380 |
+
importCode = null;
|
| 381 |
+
} catch (error) {
|
| 382 |
+
console.error('Error clearing history:', error);
|
| 383 |
+
// Still reset local state even if API call fails
|
| 384 |
+
codeHistory = [];
|
| 385 |
+
setupCode = generateSetupCode();
|
| 386 |
+
importCode = null;
|
| 387 |
}
|
| 388 |
}
|
| 389 |
|
|
|
|
| 525 |
copyToClipboard(markdownContent, 'All code copied as Markdown!');
|
| 526 |
}
|
| 527 |
|
| 528 |
+
onMount(async () => {
|
| 529 |
+
// Load history from database when component mounts
|
| 530 |
+
await loadHistoryFromDatabase();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 531 |
});
|
| 532 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 533 |
// Update setup code when mode changes
|
| 534 |
$: if (mode) {
|
| 535 |
setupCode = generateSetupCode();
|
|
|
|
| 1115 |
{#if !importCode && codeHistory.length === 0}
|
| 1116 |
<div class="bg-white rounded-lg border border-gray-200 p-8 text-center">
|
| 1117 |
<p class="text-gray-500">Start using the UI to see generated code here</p>
|
|
|
|
|
|
|
|
|
|
| 1118 |
</div>
|
| 1119 |
{/if}
|
| 1120 |
|
hfstudio/database.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sqlalchemy import create_engine, Column, Integer, String, Text, DateTime, JSON
|
| 2 |
+
from sqlalchemy.ext.declarative import declarative_base
|
| 3 |
+
from sqlalchemy.orm import sessionmaker
|
| 4 |
+
from datetime import datetime
|
| 5 |
+
import os
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
|
| 8 |
+
Base = declarative_base()
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class CodeHistory(Base):
|
| 12 |
+
__tablename__ = "code_history"
|
| 13 |
+
|
| 14 |
+
id = Column(Integer, primary_key=True, autoincrement=True)
|
| 15 |
+
username = Column(String(255), nullable=False, index=True)
|
| 16 |
+
code = Column(Text, nullable=False)
|
| 17 |
+
result_type = Column(String(50), nullable=True) # "audio", null for setup/import
|
| 18 |
+
result_data = Column(JSON, nullable=True) # audio URL, title, duration, etc.
|
| 19 |
+
entry_type = Column(String(50), nullable=False) # "setup", "import", "generation"
|
| 20 |
+
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
# Database setup
|
| 24 |
+
def get_database_url():
|
| 25 |
+
"""Get database URL, using persistent storage on Spaces or local directory."""
|
| 26 |
+
# Check if running on HuggingFace Spaces
|
| 27 |
+
if os.getenv("SPACE_ID"):
|
| 28 |
+
# Use persistent data directory on Spaces
|
| 29 |
+
data_dir = Path("/data/.huggingface/hfstudio")
|
| 30 |
+
data_dir.mkdir(parents=True, exist_ok=True)
|
| 31 |
+
db_path = data_dir / "hfstudio.db"
|
| 32 |
+
else:
|
| 33 |
+
# Use local directory for development
|
| 34 |
+
db_path = Path(__file__).parent / "hfstudio.db"
|
| 35 |
+
|
| 36 |
+
return f"sqlite:///{db_path}"
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
# Create engine and session
|
| 40 |
+
engine = create_engine(get_database_url(), echo=False)
|
| 41 |
+
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def create_tables():
|
| 45 |
+
"""Create all database tables."""
|
| 46 |
+
Base.metadata.create_all(bind=engine)
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def get_db():
|
| 50 |
+
"""FastAPI dependency to get database session."""
|
| 51 |
+
db = SessionLocal()
|
| 52 |
+
try:
|
| 53 |
+
yield db
|
| 54 |
+
finally:
|
| 55 |
+
db.close()
|
hfstudio/server.py
CHANGED
|
@@ -14,6 +14,8 @@ from pathlib import Path
|
|
| 14 |
from huggingface_hub import InferenceClient, get_token, whoami
|
| 15 |
from huggingface_hub.utils import build_hf_headers
|
| 16 |
from hfstudio import __version__
|
|
|
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
class TTSRequest(BaseModel):
|
|
@@ -36,6 +38,9 @@ class TTSResponse(BaseModel):
|
|
| 36 |
|
| 37 |
app = FastAPI(title="HFStudio API", version="0.1.0")
|
| 38 |
|
|
|
|
|
|
|
|
|
|
| 39 |
# In-memory session store (use Redis/database for production)
|
| 40 |
sessions: Dict[str, Dict[str, Any]] = {}
|
| 41 |
SESSION_TIMEOUT = 7 * 24 * 60 * 60 # 7 days in seconds
|
|
@@ -213,6 +218,26 @@ class ManualTokenRequest(BaseModel):
|
|
| 213 |
token: str
|
| 214 |
|
| 215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
@app.get("/")
|
| 217 |
async def root():
|
| 218 |
index_path = static_dir / "index.html"
|
|
@@ -401,6 +426,107 @@ async def logout(
|
|
| 401 |
return {"success": True}
|
| 402 |
|
| 403 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 404 |
@app.post("/api/tts/generate")
|
| 405 |
async def generate_tts(
|
| 406 |
request: TTSRequest, session: Dict[str, Any] = Depends(require_auth)
|
|
|
|
| 14 |
from huggingface_hub import InferenceClient, get_token, whoami
|
| 15 |
from huggingface_hub.utils import build_hf_headers
|
| 16 |
from hfstudio import __version__
|
| 17 |
+
from hfstudio.database import create_tables, get_db, CodeHistory
|
| 18 |
+
from sqlalchemy.orm import Session
|
| 19 |
|
| 20 |
|
| 21 |
class TTSRequest(BaseModel):
|
|
|
|
| 38 |
|
| 39 |
app = FastAPI(title="HFStudio API", version="0.1.0")
|
| 40 |
|
| 41 |
+
# Initialize database tables
|
| 42 |
+
create_tables()
|
| 43 |
+
|
| 44 |
# In-memory session store (use Redis/database for production)
|
| 45 |
sessions: Dict[str, Dict[str, Any]] = {}
|
| 46 |
SESSION_TIMEOUT = 7 * 24 * 60 * 60 # 7 days in seconds
|
|
|
|
| 218 |
token: str
|
| 219 |
|
| 220 |
|
| 221 |
+
class HistoryEntryRequest(BaseModel):
|
| 222 |
+
code: str
|
| 223 |
+
result_type: Optional[str] = None
|
| 224 |
+
result_data: Optional[Dict[str, Any]] = None
|
| 225 |
+
entry_type: str # "setup", "import", "generation"
|
| 226 |
+
|
| 227 |
+
|
| 228 |
+
class HistoryEntryResponse(BaseModel):
|
| 229 |
+
id: int
|
| 230 |
+
code: str
|
| 231 |
+
result_type: Optional[str]
|
| 232 |
+
result_data: Optional[Dict[str, Any]]
|
| 233 |
+
entry_type: str
|
| 234 |
+
created_at: str
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
class HistoryResponse(BaseModel):
|
| 238 |
+
entries: list[HistoryEntryResponse]
|
| 239 |
+
|
| 240 |
+
|
| 241 |
@app.get("/")
|
| 242 |
async def root():
|
| 243 |
index_path = static_dir / "index.html"
|
|
|
|
| 426 |
return {"success": True}
|
| 427 |
|
| 428 |
|
| 429 |
+
@app.post("/api/history/save")
|
| 430 |
+
async def save_history_entry(
|
| 431 |
+
request: HistoryEntryRequest,
|
| 432 |
+
session: Dict[str, Any] = Depends(require_auth),
|
| 433 |
+
db: Session = Depends(get_db),
|
| 434 |
+
):
|
| 435 |
+
"""Save a history entry to the database."""
|
| 436 |
+
try:
|
| 437 |
+
username = session["user_info"].get("name") or session["user_info"].get("login")
|
| 438 |
+
if not username:
|
| 439 |
+
raise HTTPException(status_code=400, detail="Username not found in session")
|
| 440 |
+
|
| 441 |
+
# Create new history entry
|
| 442 |
+
history_entry = CodeHistory(
|
| 443 |
+
username=username,
|
| 444 |
+
code=request.code,
|
| 445 |
+
result_type=request.result_type,
|
| 446 |
+
result_data=request.result_data,
|
| 447 |
+
entry_type=request.entry_type,
|
| 448 |
+
)
|
| 449 |
+
|
| 450 |
+
db.add(history_entry)
|
| 451 |
+
db.commit()
|
| 452 |
+
db.refresh(history_entry)
|
| 453 |
+
|
| 454 |
+
return {
|
| 455 |
+
"success": True,
|
| 456 |
+
"id": history_entry.id,
|
| 457 |
+
"message": "History entry saved successfully",
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
except Exception as e:
|
| 461 |
+
db.rollback()
|
| 462 |
+
raise HTTPException(status_code=500, detail=f"Error saving history: {str(e)}")
|
| 463 |
+
|
| 464 |
+
|
| 465 |
+
@app.get("/api/history/load")
|
| 466 |
+
async def load_history(
|
| 467 |
+
session: Dict[str, Any] = Depends(require_auth), db: Session = Depends(get_db)
|
| 468 |
+
) -> HistoryResponse:
|
| 469 |
+
"""Load all history entries for the authenticated user."""
|
| 470 |
+
try:
|
| 471 |
+
username = session["user_info"].get("name") or session["user_info"].get("login")
|
| 472 |
+
if not username:
|
| 473 |
+
raise HTTPException(status_code=400, detail="Username not found in session")
|
| 474 |
+
|
| 475 |
+
# Query history entries for user, ordered by creation time
|
| 476 |
+
entries = (
|
| 477 |
+
db.query(CodeHistory)
|
| 478 |
+
.filter(CodeHistory.username == username)
|
| 479 |
+
.order_by(CodeHistory.created_at.asc())
|
| 480 |
+
.all()
|
| 481 |
+
)
|
| 482 |
+
|
| 483 |
+
# Convert to response format
|
| 484 |
+
history_entries = [
|
| 485 |
+
HistoryEntryResponse(
|
| 486 |
+
id=entry.id,
|
| 487 |
+
code=entry.code,
|
| 488 |
+
result_type=entry.result_type,
|
| 489 |
+
result_data=entry.result_data,
|
| 490 |
+
entry_type=entry.entry_type,
|
| 491 |
+
created_at=entry.created_at.isoformat(),
|
| 492 |
+
)
|
| 493 |
+
for entry in entries
|
| 494 |
+
]
|
| 495 |
+
|
| 496 |
+
return HistoryResponse(entries=history_entries)
|
| 497 |
+
|
| 498 |
+
except Exception as e:
|
| 499 |
+
raise HTTPException(status_code=500, detail=f"Error loading history: {str(e)}")
|
| 500 |
+
|
| 501 |
+
|
| 502 |
+
@app.delete("/api/history/clear")
|
| 503 |
+
async def clear_history(
|
| 504 |
+
session: Dict[str, Any] = Depends(require_auth), db: Session = Depends(get_db)
|
| 505 |
+
):
|
| 506 |
+
"""Clear all history entries for the authenticated user."""
|
| 507 |
+
try:
|
| 508 |
+
username = session["user_info"].get("name") or session["user_info"].get("login")
|
| 509 |
+
if not username:
|
| 510 |
+
raise HTTPException(status_code=400, detail="Username not found in session")
|
| 511 |
+
|
| 512 |
+
# Delete all history entries for user
|
| 513 |
+
deleted_count = (
|
| 514 |
+
db.query(CodeHistory).filter(CodeHistory.username == username).delete()
|
| 515 |
+
)
|
| 516 |
+
|
| 517 |
+
db.commit()
|
| 518 |
+
|
| 519 |
+
return {
|
| 520 |
+
"success": True,
|
| 521 |
+
"deleted_count": deleted_count,
|
| 522 |
+
"message": f"Cleared {deleted_count} history entries",
|
| 523 |
+
}
|
| 524 |
+
|
| 525 |
+
except Exception as e:
|
| 526 |
+
db.rollback()
|
| 527 |
+
raise HTTPException(status_code=500, detail=f"Error clearing history: {str(e)}")
|
| 528 |
+
|
| 529 |
+
|
| 530 |
@app.post("/api/tts/generate")
|
| 531 |
async def generate_tts(
|
| 532 |
request: TTSRequest, session: Dict[str, Any] = Depends(require_auth)
|
hfstudio/static/_app/immutable/assets/0.CsSbhH5k.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-left-full{left:-100%}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-56{left:14rem}.right-0{right:0}.right-2{right:.5rem}.right-4{right:1rem}.right-80{right:20rem}.top-0{top:0}.top-2{top:.5rem}.top-full{top:100%}.z-10{z-index:10}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[18px\]{height:18px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[18px\]{min-width:18px}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.scale-150{--tw-scale-x: 1.5;--tw-scale-y: 1.5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-amber-400{--tw-gradient-from: #fbbf24 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 191 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-50{--tw-gradient-from: #fffbeb var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 251 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-500{--tw-gradient-from: #f59e0b var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-50{--tw-gradient-from: #f9fafb var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 250 251 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-green-500{--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #22c55e var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-orange-400\/40{--tw-gradient-to: rgb(251 146 60 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(251 146 60 / .4) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-pink-500{--tw-gradient-to: rgb(236 72 153 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #ec4899 var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position)}.to-orange-50{--tw-gradient-to: #fff7ed var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-right{background-position:right}.bg-no-repeat{background-repeat:no-repeat}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-24{padding-bottom:6rem}.pr-10{padding-right:2.5rem}.pr-4{padding-right:1rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-relaxed{line-height:1.625}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}code[class*=language-],pre[class*=language-]{color:#393a34;font-family:Consolas,Bitstream Vera Sans Mono,Courier New,Courier,monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;font-size:.875rem;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]{padding:1rem;margin:0;overflow:auto;background:#f8f9fa}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:green;font-style:italic}.token.punctuation{color:#393a34}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#e91e63}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#067d17}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#795da3}.token.atrule,.token.attr-value,.token.keyword{color:#00f}.token.function,.token.class-name{color:#795da3}.token.regex,.token.important,.token.variable{color:#e90}.language-bash .token.function{color:#067d17}.slider-hf::-webkit-slider-thumb{height:1rem;width:1rem;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:9999px;background:linear-gradient(45deg,#ffd21e,#ff9d00);box-shadow:0 1px 3px #0000001a}.slider-hf::-moz-range-thumb{height:1rem;width:1rem;cursor:pointer;border-radius:9999px;border-width:0px;background:linear-gradient(45deg,#ffd21e,#ff9d00);box-shadow:0 1px 3px #0000001a}.pause-filled{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px}.pause-filled:before,.pause-filled:after{content:"";width:2px;height:10px;background-color:currentColor;border-radius:1px}.pause-filled:before{margin-right:2px}.pause-filled:after{margin-left:2px}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-orange-600:hover{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:from-amber-500:hover{--tw-gradient-from: #f59e0b var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-amber-600:hover{--tw-gradient-from: #d97706 var(--tw-gradient-from-position);--tw-gradient-to: rgb(217 119 6 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-orange-600:hover{--tw-gradient-to: #ea580c var(--tw-gradient-to-position)}.hover\:text-amber-700:hover{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-amber-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(251 191 36 / var(--tw-ring-opacity, 1))}.focus\:ring-orange-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 115 22 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@keyframes svelte-1s3xy1i-sweep{0%{transform:translate(-100%)}to{transform:translate(300%)}}.animate-sweep.svelte-1s3xy1i{animation:svelte-1s3xy1i-sweep 1.6s linear forwards}
|
hfstudio/static/_app/immutable/chunks/CEW4is7A.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var St=Object.defineProperty;var kt=(e,t,n)=>t in e?St(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>kt(e,typeof t!="symbol"?t+"":t,n);import{S as Et,F as At,Z as Rt,_ as Tt,$ as It,a0 as Ut,a1 as Lt,a2 as $t,z as ve,a3 as xt,G as be,n as ge,s as Ct}from"./MT0Fezl8.js";class Ze extends Et{constructor(n){if(!n||!n.target&&!n.$$inline)throw new Error("'target' is a required option");super();R(this,"$$prop_def");R(this,"$$events_def");R(this,"$$slot_def")}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}class Pt extends Ze{}const Ot=Object.freeze(Object.defineProperty({__proto__:null,SvelteComponent:Ze,SvelteComponentTyped:Pt,afterUpdate:At,beforeUpdate:Rt,createEventDispatcher:Tt,getAllContexts:It,getContext:Ut,hasContext:Lt,onDestroy:$t,onMount:ve,setContext:xt,tick:be},Symbol.toStringTag,{value:"Module"}));class ie{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Re{constructor(t,n){this.status=t,this.location=n}}class Te extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function Nt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function jt(e){return e.split("%25").map(decodeURI).join("%25")}function Dt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function Ft(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return l=>(n(l),i[o](l));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function Bt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const Mt=new TextDecoder;function Vt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const qt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:(t==null?void 0:t.method)||"GET")!=="GET"&&Y.delete(Ie(e)),qt(e,t));const Y=new Map;function Gt(e,t){const n=Ie(e,t),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&Y.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=Vt(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Yt(e,t,n){if(Y.size>0){const r=Ie(e,n),a=Y.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(a.body,a.init);Y.delete(r)}}return window.fetch(t,n)}function Ie(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t!=null&&t.headers||t!=null&&t.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Bt(...a)}"]`}return r}const zt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Ht(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Wt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,l)=>{if(l%2){if(c.startsWith("x+"))return _e(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return _e(String.fromCharCode(...c.slice(2).split("-").map(u=>parseInt(u,16))));const d=zt.exec(c),[,h,y,f,p]=d;return t.push({name:f,matcher:p,optional:!!h,rest:!!y,chained:y?l===1&&i[0]==="":!1}),y?"([^]*?)":h?"([^/]*)?":"([^/]+?)"}return _e(c)}).join("")}).join("")}/?$`),params:t}}function Kt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Wt(e){return e.slice(1).split("/").filter(Kt)}function Jt(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;o<t.length;o+=1){const c=t[o];let l=a[o-i];if(c.chained&&c.rest&&i&&(l=a.slice(o-i,o+1).filter(d=>d).join("/"),i=0),l===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](l)){r[c.name]=l;const d=t[o+1],h=a[o+1];d&&!d.rest&&d.optional&&h&&c.chained&&(i=0),!d&&!h&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Xt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,l,d]])=>{const{pattern:h,params:y}=Ht(o),f={id:o,exec:p=>{const u=h.exec(p);if(u)return Jt(u,y,r)},errors:[1,...d||[]].map(p=>e[p]),layouts:[0,...l||[]].map(i),leaf:s(c)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function Qe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Be(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const D=[];function Ue(e,t=ge){let n;const r=new Set;function a(o){if(Ct(e,o)&&(e=o,n)){const c=!D.length;for(const l of r)l[1](),D.push(l,e);if(c){for(let l=0;l<D.length;l+=2)D[l][0](D[l+1]);D.length=0}}}function s(o){a(o(e))}function i(o,c=ge){const l=[o,c];return r.add(l),r.size===1&&(n=t(a,s)||ge),o(e),()=>{r.delete(l),r.size===0&&n&&(n(),n=null)}}return{set:a,update:s,subscribe:i}}var Je;const $=((Je=globalThis.__sveltekit_1mhd705)==null?void 0:Je.base)??"";var Xe;const Zt=((Xe=globalThis.__sveltekit_1mhd705)==null?void 0:Xe.assets)??$??"",Qt="1761235858189",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",en="sveltekit:pageurl",B="sveltekit:history",K="sveltekit:navigation",O={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ce=location.origin;function at(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function le(){return{x:pageXOffset,y:pageYOffset}}function F(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Me={...O,"":O.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function ot(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(e)}}function Se(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||fe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=(r==null?void 0:r.origin)===ce&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function Q(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=F(o,"preload-code")),a===null&&(a=F(o,"preload-data")),t===null&&(t=F(o,"keepfocus")),n===null&&(n=F(o,"noscroll")),s===null&&(s=F(o,"reload")),i===null&&(i=F(o,"replacestate")),o=rt(o);function c(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Me[r??"off"],preload_data:Me[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Ve(e){const t=Ue(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const st={v:()=>{}};function tn(){const{set:e,subscribe:t}=Ue(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Zt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Qt;return i&&(e(!0),st.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function fe(e,t,n){return e.origin!==ce||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function qn(e){}function nn(e){const t=rn(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a<n.byteLength;a++)r.setUint8(a,t.charCodeAt(a));return n}const an="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rn(e){e.length%4===0&&(e=e.replace(/==?$/,""));let t="",n=0,r=0;for(let a=0;a<e.length;a++)n<<=6,n|=an.indexOf(e[a]),r+=6,r===24&&(t+=String.fromCharCode((n&16711680)>>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const on=-1,sn=-2,cn=-3,ln=-4,fn=-5,un=-6;function dn(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===on)return;if(s===cn)return NaN;if(s===ln)return 1/0;if(s===fn)return-1/0;if(s===un)return-0;if(i||typeof s!="number")throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],l=t==null?void 0:t[c];if(l)return r[s]=l(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let f=1;f<o.length;f+=1)d.add(a(o[f]));break;case"Map":const h=new Map;r[s]=h;for(let f=1;f<o.length;f+=2)h.set(a(o[f]),a(o[f+1]));break;case"RegExp":r[s]=new RegExp(o[1],o[2]);break;case"Object":r[s]=Object(o[1]);break;case"BigInt":r[s]=BigInt(o[1]);break;case"null":const y=Object.create(null);r[s]=y;for(let f=1;f<o.length;f+=2)y[o[f]]=a(o[f+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const f=globalThis[c],p=new f(a(o[1]));r[s]=o[2]!==void 0?p.subarray(o[2],o[3]):p;break}case"ArrayBuffer":{const f=o[1],p=nn(f);r[s]=p;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const f=c.slice(9);r[s]=Temporal[f].from(o[1]);break}case"URL":{const f=new URL(o[1]);r[s]=f;break}case"URLSearchParams":{const f=new URLSearchParams(o[1]);r[s]=f;break}default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(o.length);r[s]=c;for(let l=0;l<o.length;l+=1){const d=o[l];d!==sn&&(c[l]=a(d))}}else{const c={};r[s]=c;for(const l in o){if(l==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=o[l];c[l]=a(d)}}return r[s]}return a(0)}const it=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...it];const hn=new Set([...it]);[...hn];function pn(e){return e.filter(t=>t!=null)}const gn="x-sveltekit-invalidated",mn="x-sveltekit-trailing-slash";function ee(e){return e instanceof ie||e instanceof Te?e.status:500}function _n(e){return e instanceof Te?e.text:"Internal Error"}let T,W,we;const wn=ve.toString().includes("$$")||/function \w+\(\) \{\}/.test(ve.toString());wn?(T={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},we={current:!1}):(T=new class{constructor(){R(this,"data",$state.raw({}));R(this,"form",$state.raw(null));R(this,"error",$state.raw(null));R(this,"params",$state.raw({}));R(this,"route",$state.raw({id:null}));R(this,"state",$state.raw({}));R(this,"status",$state.raw(-1));R(this,"url",$state.raw(new URL("https://example.com")))}},W=new class{constructor(){R(this,"current",$state.raw(null))}},we=new class{constructor(){R(this,"current",$state.raw(!1))}},st.v=()=>we.current=!0);function yn(e){Object.assign(T,e)}const vn="/__data.json",bn=".html__data.json";function Sn(e){return e.endsWith(".html")?e.replace(/\.html$/,bn):e.replace(/\/$/,"")+vn}const qe={spanContext(){return kn},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},kn={traceId:"",spanId:"",traceFlags:0},{tick:En}=Ot,An=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Qe(tt)??{},J=Qe(et)??{},C={url:Ve({}),page:Ve({}),navigating:Ue(null),updated:tn()};function Le(e){j[e]=le()}function Rn(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ct(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration($||"/");e&&await e.update()}}function Ge(){}let $e,ke,te,x,Ee,k;const ne=[],ae=[];let U=null;const Z=new Map,lt=new Set,Tn=new Set,z=new Set;let b={branch:[],error:null,url:null},xe=!1,re=!1,Ye=!0,X=!1,G=!1,ft=!1,Ce=!1,ut,A,L,N;const H=new Set,ze=new Map;async function Hn(e,t,n){var s,i,o,c,l;(s=globalThis.__sveltekit_1mhd705)!=null&&s.data&&globalThis.__sveltekit_1mhd705.data,document.URL!==location.href&&(location.href=location.href),k=e,await((o=(i=e.hooks).init)==null?void 0:o.call(i)),$e=Xt(e),x=document.documentElement,Ee=t,ke=e.nodes[0],te=e.nodes[1],ke(),te(),A=(c=history.state)==null?void 0:c[B],L=(l=history.state)==null?void 0:l[K],A||(A=L=Date.now(),history.replaceState({...history.state,[B]:A,[K]:L},""));const r=j[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Dn(Ee,n)):(await M({type:"enter",url:at(k.hash?Bn(new URL(location.href)):location.href),replace_state:!0}),a()),jn()}function In(){ne.length=0,Ce=!1}function dt(e){ae.some(t=>t==null?void 0:t.snapshot)&&(J[e]=ae.map(t=>{var n;return(n=t==null?void 0:t.snapshot)==null?void 0:n.capture()}))}function ht(e){var t;(t=J[e])==null||t.forEach((n,r)=>{var a,s;(s=(a=ae[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function He(){Le(A),Be(tt,j),dt(L),Be(et,J)}async function Un(e,t,n,r){let a;t.invalidateAll&&(U=null),await M({type:"goto",url:at(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Ce=!0,a=[...ze.keys()]),t.invalidate&&t.invalidate.forEach(Nn)}}),t.invalidateAll&&be().then(be).then(()=>{ze.forEach(({resource:s},i)=>{var o;a!=null&&a.includes(i)&&((o=s.refresh)==null||o.call(s))})})}async function Ln(e){if(e.id!==(U==null?void 0:U.id)){const t={};H.add(t),U={id:e.id,token:t,promise:mt({...e,preload:t}).then(n=>(H.delete(t),n.type==="loaded"&&n.state.error&&(U=null),n))}}return U.promise}async function ye(e){var n;const t=(n=await de(e,!1))==null?void 0:n.route;t&&await Promise.all([...t.layouts,t.leaf].map(r=>r==null?void 0:r[1]()))}function pt(e,t,n){var a;b=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(T,e.props.page),ut=new k.root({target:t,props:{...e.props,stores:C,components:ae},hydrate:n,sync:!1}),ht(L),n){const s={from:null,to:{params:b.params,route:{id:((a=b.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(i=>i(s))}re=!0}function oe({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if($&&(e.pathname===$||e.pathname===$+"/"))o="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(o=f.slash);e.pathname=Nt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:pn(n).map(f=>f.node.component),page:je(T)}};i!==void 0&&(c.props.form=i);let l={},d=!T,h=0;for(let f=0;f<Math.max(n.length,b.branch.length);f+=1){const p=n[f],u=b.branch[f];(p==null?void 0:p.data)!==(u==null?void 0:u.data)&&(d=!0),p&&(l={...l,...p.data},d&&(c.props[`data_${h}`]=l),h+=1)}return(!b.url||e.href!==b.url.href||b.error!==a||i!==void 0&&i!==T.form||d)&&(c.props.page={error:a,params:t,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:i??null,data:d?l:T.data}),c}async function Pe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){var d,h,y;let i=null,o=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if((d=l.universal)!=null&&d.load){let f=function(...u){for(const g of u){const{href:_}=new URL(g,n);c.dependencies.add(_)}};const p={tracing:{enabled:!1,root:qe,current:qe},route:new Proxy(a,{get:(u,g)=>(o&&(c.route=!0),u[g])}),params:new Proxy(r,{get:(u,g)=>(o&&c.params.add(g),u[g])}),data:(s==null?void 0:s.data)??null,url:Ft(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},k.hash),async fetch(u,g){u instanceof Request&&(g={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u==null?void 0:u.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...g});const{resolved:_,promise:I}=gt(u,g,n);return o&&f(_.href),I},setHeaders:()=>{},depends:f,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await l.universal.load.call(null,p)??null}return{node:l,loader:e,server:s,universal:(h=l.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(s==null?void 0:s.data)??null,slash:((y=l.universal)==null?void 0:y.trailingSlash)??(s==null?void 0:s.slash)}}function gt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=re?Yt(r,a.href,t):Gt(r,t);return{resolved:a,promise:s}}function Ke(e,t,n,r,a,s){if(Ce)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==b.params[i])return!0;for(const i of a.dependencies)if(ne.some(o=>o(new URL(i))))return!0;return!1}function Oe(e,t){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?t??null:null}function $n(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function We({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:je(T),constructors:[]}}}async function mt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if((U==null?void 0:U.id)===e)return H.delete(U.token),U.promise;const{errors:i,layouts:o,leaf:c}=a,l=[...o,c];i.forEach(w=>w==null?void 0:w().catch(()=>{})),l.forEach(w=>w==null?void 0:w[1]().catch(()=>{}));let d=null;const h=b.url?e!==se(b.url):!1,y=b.route?a.id!==b.route.id:!1,f=$n(b.url,n);let p=!1;const u=l.map((w,m)=>{var P;const v=b.branch[m],S=!!(w!=null&&w[0])&&((v==null?void 0:v.loader)!==w[1]||Ke(p,y,h,f,(P=v.server)==null?void 0:P.uses,r));return S&&(p=!0),S});if(u.some(Boolean)){try{d=await yt(n,u)}catch(w){const m=await V(w,{url:n,params:r,route:{id:e}});return H.has(s)?We({error:m,url:n,params:r,route:a}):ue({status:ee(w),error:m,url:n,route:a})}if(d.type==="redirect")return d}const g=d==null?void 0:d.nodes;let _=!1;const I=l.map(async(w,m)=>{var he;if(!w)return;const v=b.branch[m],S=g==null?void 0:g[m];if((!S||S.type==="skip")&&w[1]===(v==null?void 0:v.loader)&&!Ke(_,y,h,f,(he=v.universal)==null?void 0:he.uses,r))return v;if(_=!0,(S==null?void 0:S.type)==="error")throw S;return Pe({loader:w[1],url:n,params:r,route:a,parent:async()=>{var Fe;const De={};for(let pe=0;pe<m;pe+=1)Object.assign(De,(Fe=await I[pe])==null?void 0:Fe.data);return De},server_data_node:Oe(S===void 0&&w[0]?{type:"skip"}:S??null,w[0]?v==null?void 0:v.server:void 0)})});for(const w of I)w.catch(()=>{});const E=[];for(let w=0;w<l.length;w+=1)if(l[w])try{E.push(await I[w])}catch(m){if(m instanceof Re)return{type:"redirect",location:m.location};if(H.has(s))return We({error:await V(m,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let v=ee(m),S;if(g!=null&&g.includes(m))v=m.status??v,S=m.error;else if(m instanceof ie)S=m.body;else{if(await C.updated.check())return await ct(),await q(n);S=await V(m,{params:r,url:n,route:{id:a.id}})}const P=await xn(w,E,i);return P?oe({url:n,params:r,branch:E.slice(0,P.idx).concat(P.node),status:v,error:S,route:a}):await wt(n,{id:a.id},S,v)}else E.push(void 0);return oe({url:n,params:r,branch:E,status:200,error:null,route:a,form:t?void 0:null})}async function xn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function ue({status:e,error:t,url:n,route:r}){const a={};let s=null;if(k.server_loads[0]===0)try{const o=await yt(n,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;s=o.nodes[0]??null}catch{(n.origin!==ce||n.pathname!==location.pathname||xe)&&await q(n)}try{const o=await Pe({loader:ke,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Oe(s)}),c={node:await te(),loader:te,universal:null,server:null,data:null};return oe({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Re)return Un(new URL(o.location,location.href),{},0);throw o}}async function Cn(e){const t=e.href;if(Z.has(t))return Z.get(t);let n;try{const r=(async()=>{let a=await k.hooks.reroute({url:new URL(e),fetch:async(s,i)=>gt(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);k.hash?s.hash=a:s.pathname=a,a=s}return a})();Z.set(t,r),n=await r}catch{Z.delete(t);return}return n}async function de(e,t){if(e&&!fe(e,$,k.hash)){const n=await Cn(e);if(!n)return;const r=Pn(n);for(const a of $e){const s=a.exec(r);if(s)return{id:se(e),invalidating:t,route:a,params:Dt(s),url:e}}}}function Pn(e){return jt(k.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice($.length))||"/"}function se(e){return(k.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function _t({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=Ne(b,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||lt.forEach(c=>c(o)),s?null:i}async function M({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:l=Ge,block:d=Ge,event:h}){const y=N;N=c;const f=await de(t,!1),p=e==="enter"?Ne(b,f,t,e):_t({url:t,type:e,delta:n==null?void 0:n.delta,intent:f,event:h});if(!p){d(),N===c&&(N=y);return}const u=A,g=L;l(),X=!0,re&&p.navigation.type!=="enter"&&C.navigating.set(W.current=p.navigation);let _=f&&await mt(f);if(!_){if(fe(t,$,k.hash))return await q(t,s);_=await wt(t,{id:null},await V(new Te(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=(f==null?void 0:f.url)||t,N!==c)return p.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(o<20){await M({type:e,url:new URL(_.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i,redirect_count:o+1,nav_token:c}),p.fulfil(void 0);return}_=await ue({status:500,error:await V(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await C.updated.check()&&(await ct(),await q(t,s));if(In(),Le(u),dt(g),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=n?n.state:i,!n){const m=s?0:1,v={[B]:A+=m,[K]:L+=m,[nt]:i};(s?history.replaceState:history.pushState).call(history,v,"",t),s||Rn(A,L)}if(U=null,_.props.page.state=i,re){const m=(await Promise.all(Array.from(Tn,v=>v(p.navigation)))).filter(v=>typeof v=="function");if(m.length>0){let v=function(){m.forEach(S=>{z.delete(S)})};m.push(v),m.forEach(S=>{z.add(S)})}b=_.state,_.props.page&&(_.props.page.url=t),ut.$set(_.props),yn(_.props.page),ft=!0}else pt(_,Ee,!1);const{activeElement:I}=document;await En();let E=n?n.scroll:a?le():null;if(Ye){const m=t.hash&&document.getElementById(bt(t));if(E)scrollTo(E.x,E.y);else if(m){m.scrollIntoView();const{top:v,left:S}=m.getBoundingClientRect();E={x:pageXOffset+S,y:pageYOffset+v}}else scrollTo(0,0)}const w=document.activeElement!==I&&document.activeElement!==document.body;!r&&!w&&Fn(t,E),Ye=!0,_.props.page&&Object.assign(T,_.props.page),X=!1,e==="popstate"&&ht(L),p.fulfil(void 0),z.forEach(m=>m(p.navigation)),C.navigating.set(W.current=null)}async function wt(e,t,n,r,a){return e.origin===ce&&e.pathname===location.pathname&&!xe?await ue({status:r,error:n,url:e,route:t}):await q(e,a)}function On(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,O.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],O.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(ye(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const l=ot(o,x),d=l===t&&c>=n;if(!l||d)return;const{url:h,external:y,download:f}=Se(l,$,k.hash);if(y||f)return;const p=Q(l),u=h&&se(b.url)===se(h);if(!(p.reload||u))if(c<=p.preload_data){t=l,n=O.tap;const g=await de(h,!1);if(!g)return;Ln(g)}else c<=p.preload_code&&(t=l,n=c,ye(h))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:l,download:d}=Se(o,$,k.hash);if(l||d)continue;const h=Q(o);h.reload||(h.preload_code===O.viewport&&a.observe(o),h.preload_code===O.eager&&ye(c))}}z.add(i),i()}function V(e,t){if(e instanceof ie)return e.body;const n=ee(e),r=_n(e);return k.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Nn(e){if(typeof e=="function")ne.push(e);else{const{href:t}=new URL(e,location.href);ne.push(n=>n.href===t)}}function jn(){var t;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(He(),!X){const a=Ne(b,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};lt.forEach(i=>i(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&He()}),(t=navigator.connection)!=null&&t.saveData||On(),x.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=ot(n.composedPath()[0],x);if(!r)return;const{url:a,external:s,target:i,download:o}=Se(r,$,k.hash);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Q(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||o)return;const[d,h]=(k.hash?a.hash.replace(/^#/,""):a.href).split("#"),y=d===me(location);if(s||c.reload&&(!y||!h)){_t({url:a,type:"link",event:n})?X=!0:n.preventDefault();return}if(h!==void 0&&y){const[,f]=b.url.href.split("#");if(f===h){if(n.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const p=r.ownerDocument.getElementById(decodeURIComponent(h));p&&(p.scrollIntoView(),p.focus())}return}if(G=!0,Le(A),e(a),!c.replace_state)return;G=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await M({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href,event:n})}),x.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const o=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(fe(o,$,!1))return;const c=n.target,l=Q(c);if(l.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(c,a);o.search=new URLSearchParams(d).toString(),M({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Ae){if((r=n.state)!=null&&r[B]){const a=n.state[B];if(N={},a===A)return;const s=j[a],i=n.state[nt]??{},o=new URL(n.state[en]??location.href),c=n.state[K],l=b.url?me(location)===me(b.url):!1;if(c===L&&(ft||l)){i!==T.state&&(T.state=i),e(o),j[A]=le(),s&&scrollTo(s.x,s.y),A=a;return}const h=a-A;await M({type:"popstate",url:o,popped:{state:i,scroll:s,delta:h},accept:()=>{A=a,L=c},block:()=>{history.go(-h)},nav_token:N,event:n})}else if(!G){const a=new URL(location.href);e(a),k.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++A,[K]:L},"",location.href))});for(const n of document.querySelectorAll("link"))An.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&C.navigating.set(W.current=null)});function e(n){b.url=T.url=n,C.page.set(je(T)),C.page.notify()}}async function Dn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){xe=!0;const l=new URL(location.href);let d;({params:a={},route:s={id:null}}=await de(l,!1)||{}),d=$e.find(({id:f})=>f===s.id);let h,y=!0;try{const f=r.map(async(u,g)=>{const _=o[g];return _!=null&&_.uses&&(_.uses=vt(_.uses)),Pe({loader:k.nodes[u],url:l,params:a,route:s,parent:async()=>{const I={};for(let E=0;E<g;E+=1)Object.assign(I,(await f[E]).data);return I},server_data_node:Oe(_)})}),p=await Promise.all(f);if(d){const u=d.layouts;for(let g=0;g<u.length;g++)u[g]||p.splice(g,0,void 0)}h=oe({url:l,params:a,branch:p,status:t,error:n,form:c,route:d??null})}catch(f){if(f instanceof Re){await q(new URL(f.location,location.href));return}h=await ue({status:ee(f),error:await V(f,{url:l,params:a,route:s}),url:l,route:s}),e.textContent="",y=!1}h.props.page&&(h.props.page.state={}),pt(h,e,y)}async function yt(e,t){var s;const n=new URL(e);n.pathname=Sn(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(mn,"1"),n.searchParams.append(gn,t.map(i=>i?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let i;throw(s=a.headers.get("content-type"))!=null&&s.includes("application/json")?i=await a.json():a.status===404?i="Not Found":a.status===500&&(i="Internal Error"),new ie(a.status,i)}return new Promise(async i=>{var h;const o=new Map,c=a.body.getReader();function l(y){return dn(y,{...k.decoders,Promise:f=>new Promise((p,u)=>{o.set(f,{fulfil:p,reject:u})})})}let d="";for(;;){const{done:y,value:f}=await c.read();if(y&&!d)break;for(d+=!f&&d?`
|
| 2 |
+
`:Mt.decode(f,{stream:!0});;){const p=d.indexOf(`
|
| 3 |
+
`);if(p===-1)break;const u=JSON.parse(d.slice(0,p));if(d=d.slice(p+1),u.type==="redirect")return i(u);if(u.type==="data")(h=u.nodes)==null||h.forEach(g=>{(g==null?void 0:g.type)==="data"&&(g.uses=vt(g.uses),g.data=l(g.data))}),i(u);else if(u.type==="chunk"){const{id:g,data:_,error:I}=u,E=o.get(g);o.delete(g),I?E.reject(l(I)):E.fulfil(l(_))}}}})}function vt(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}let Ae=!1;function Fn(e,t=null){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=bt(e);if(r&&document.getElementById(r)){const{x:s,y:i}=t??le();setTimeout(()=>{const o=history.state;Ae=!0,location.replace(`#${r}`),k.hash&&location.replace(e.hash),history.replaceState(o,"",e.hash),scrollTo(s,i),Ae=!1})}else{const s=document.body,i=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),i!==null?s.setAttribute("tabindex",i):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let i=0;i<a.rangeCount;i+=1)s.push(a.getRangeAt(i));setTimeout(()=>{if(a.rangeCount===s.length){for(let i=0;i<a.rangeCount;i+=1){const o=s[i],c=a.getRangeAt(i);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}a.removeAllRanges()}})}}}function Ne(e,t,n,r){var c,l;let a,s;const i=new Promise((d,h)=>{a=d,s=h});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((c=e.route)==null?void 0:c.id)??null},url:e.url},to:n&&{params:(t==null?void 0:t.params)??null,route:{id:((l=t==null?void 0:t.route)==null?void 0:l.id)??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function je(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Bn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function bt(e){let t;if(k.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Hn as a,qn as l,C as s};
|
hfstudio/static/_app/immutable/entry/app.BdU0kAy8.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BUlMOkAD.js","../chunks/MT0Fezl8.js","../chunks/IHki7fMi.js","../assets/0.CsSbhH5k.css","../nodes/1.CNpY1S-Y.js","../chunks/CEW4is7A.js","../nodes/2.DpS_xF3t.js","../assets/2.BoAMr1TJ.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{S as T,i as V,s as B,d,o as h,p as g,C as S,D as O,b as E,h as U,E as w,k as z,F,z as G,G as H,H as y,I as P,J as R,K as L,L as I,q as A,M as p,e as J,f as K,j as W,N as C,a as Q,g as X,t as Y}from"../chunks/MT0Fezl8.js";import"../chunks/IHki7fMi.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},N={},D=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.allSettled(n.map(f=>{if(f=M(f,i),f in N)return;N[f]=!0;const l=f.endsWith(".css"),_=l?'[rel="stylesheet"]':"";if(!!i)for(let k=t.length-1;k>=0;k--){const v=t[k];if(v.href===f&&(!l||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${_}`))return;const m=document.createElement("link");if(m.rel=l?"stylesheet":Z,l||(m.as="script"),m.crossOrigin="",m.href=f,a&&m.setAttribute("nonce",a),document.head.appendChild(m),l)return new Promise((k,v)=>{m.addEventListener("load",k),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${f}`)))})}))}function u(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return r.then(t=>{for(const s of t||[])s.status==="rejected"&&u(s.reason);return e().catch(u)})},ae={};function $(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],form:t[3],params:t[1].params}}}return r&&(e=y(r,u(o)),o[12](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[12](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[12](null),e&&P(e,t)}}}function x(o){let e,n,i;var r=o[2][0];function u(t,s){return{props:{data:t[4],params:t[1].params,$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=y(r,u(o)),o[11](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[11](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&16&&(a.data=t[4]),s&2&&(a.params=t[1].params),s&8239&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[11](null),e&&P(e,t)}}}function ee(o){let e,n,i;var r=o[2][1];function u(t,s){return{props:{data:t[5],form:t[3],params:t[1].params}}}return r&&(e=y(r,u(o)),o[10](e)),{c(){e&&R(e.$$.fragment),n=w()},l(t){e&&I(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),E(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][1])){if(e){S();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),O()}r?(e=y(r,u(t)),t[10](e),R(e.$$.fragment),g(e.$$.fragment,1),L(e,n.parentNode,n)):e=null}else if(r){const a={};s&32&&(a.data=t[5]),s&8&&(a.form=t[3]),s&2&&(a.params=t[1].params),e.$set(a)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){t&&d(n),o[10](null),e&&P(e,t)}}}function j(o){let e,n=o[7]&&q(o);return{c(){e=W("div"),n&&n.c(),this.h()},l(i){e=J(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=K(e);n&&n.l(r),r.forEach(d),this.h()},h(){A(e,"id","svelte-announcer"),A(e,"aria-live","assertive"),A(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(i,r){E(i,e,r),n&&n.m(e,null)},p(i,r){i[7]?n?n.p(i,r):(n=q(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&d(e),n&&n.d()}}}function q(o){let e;return{c(){e=Y(o[8])},l(n){e=X(n,o[8])},m(n,i){E(n,e,i)},p(n,i){i&256&&Q(e,n[8])},d(n){n&&d(e)}}}function te(o){let e,n,i,r,u;const t=[x,$],s=[];function a(l,_){return l[2][1]?0:1}e=a(o),n=s[e]=t[e](o);let f=o[6]&&j(o);return{c(){n.c(),i=z(),f&&f.c(),r=w()},l(l){n.l(l),i=U(l),f&&f.l(l),r=w()},m(l,_){s[e].m(l,_),E(l,i,_),f&&f.m(l,_),E(l,r,_),u=!0},p(l,[_]){let b=e;e=a(l),e===b?s[e].p(l,_):(S(),h(s[b],1,1,()=>{s[b]=null}),O(),n=s[e],n?n.p(l,_):(n=s[e]=t[e](l),n.c()),g(n,1),n.m(i.parentNode,i)),l[6]?f?f.p(l,_):(f=j(l),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},i(l){u||(g(n),u=!0)},o(l){h(n),u=!1},d(l){l&&(d(i),d(r)),s[e].d(l),f&&f.d(l)}}}function ne(o,e,n){let{stores:i}=e,{page:r}=e,{constructors:u}=e,{components:t=[]}=e,{form:s}=e,{data_0:a=null}=e,{data_1:f=null}=e;F(i.page.notify);let l=!1,_=!1,b=null;G(()=>{const c=i.page.subscribe(()=>{l&&(n(7,_=!0),H().then(()=>{n(8,b=document.title||"untitled page")}))});return n(6,l=!0),c});function m(c){C[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function k(c){C[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function v(c){C[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return o.$$set=c=>{"stores"in c&&n(9,i=c.stores),"page"in c&&n(1,r=c.page),"constructors"in c&&n(2,u=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(3,s=c.form),"data_0"in c&&n(4,a=c.data_0),"data_1"in c&&n(5,f=c.data_1)},o.$$.update=()=>{o.$$.dirty&514&&i.page.set(r)},[t,r,u,s,a,f,l,_,b,i,m,k,v]}class le extends T{constructor(e){super(),V(this,e,ne,te,B,{stores:9,page:1,constructors:2,components:0,form:3,data_0:4,data_1:5})}}const fe=[()=>D(()=>import("../nodes/0.BUlMOkAD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>D(()=>import("../nodes/1.CNpY1S-Y.js"),__vite__mapDeps([4,1,2,5]),import.meta.url),()=>D(()=>import("../nodes/2.DpS_xF3t.js"),__vite__mapDeps([6,1,2,7]),import.meta.url)],ce=[],ue={"/":[2]},se={handleError:({error:o})=>{console.error(o)},reroute:()=>{},transport:{}},ie=Object.fromEntries(Object.entries(se.transport).map(([o,e])=>[o,e.decode])),_e=!1,me=(o,e)=>ie[o](e);export{me as decode,ie as decoders,ue as dictionary,_e as hash,se as hooks,ae as matchers,fe as nodes,le as root,ce as server_loads};
|
hfstudio/static/_app/immutable/entry/start.CuKEKhTN.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{l as o,a as r}from"../chunks/CEW4is7A.js";export{o as load_css,r as start};
|
hfstudio/static/_app/immutable/nodes/0.BUlMOkAD.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as Ie,i as He,s as Ee,m as Me,d as m,r as Te,o as Se,p as Pe,q as a,u as Ne,v as Ae,w as De,b as Q,c as n,x as se,e as r,f as A,y as L,h as b,j as i,k as v,z as je,n as Ce,A as be,a as Le,g as pe,t as he,B as Be}from"../chunks/MT0Fezl8.js";import"../chunks/IHki7fMi.js";function ve(u){let t,e,l='<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>',o,h,s='Hugging Face <span class="bg-gradient-to-r from-purple-500 via-pink-500 via-green-500 to-blue-500 bg-clip-text text-transparent font-bold">PRO</span>',c,k,B=`Sign in to with your Hugging Face <a href="https://huggingface.co/pro" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">PRO account</a> to get started with $2 of free API credits per month. You can add a billing method for
|
| 2 |
+
additional pay-as-you-go usage ‡`,f,w;return{c(){t=i("div"),e=i("button"),e.innerHTML=l,o=v(),h=i("p"),h.innerHTML=s,c=v(),k=i("p"),k.innerHTML=B,this.h()},l(O){t=r(O,"DIV",{class:!0});var C=A(t);e=r(C,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),L(e)!=="svelte-1ywh7al"&&(e.innerHTML=l),o=b(C),h=r(C,"P",{class:!0,"data-svelte-h":!0}),L(h)!=="svelte-1k9uu9c"&&(h.innerHTML=s),c=b(C),k=r(C,"P",{class:!0,"data-svelte-h":!0}),L(k)!=="svelte-s4eiw5"&&(k.innerHTML=B),C.forEach(m),this.h()},h(){a(e,"class","absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"),a(e,"aria-label","Dismiss"),a(h,"class","text-sm font-medium text-gray-700 mb-1 pr-4"),a(k,"class","text-sm text-gray-600 pr-4"),a(t,"class","mb-3 px-3 py-2 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg border border-amber-200 relative")},m(O,C){Q(O,t,C),n(t,e),n(t,o),n(t,h),n(t,c),n(t,k),f||(w=se(e,"click",u[15]),f=!0)},p:Ce,d(O){O&&m(t),f=!1,w()}}}function xe(u){let t;return{c(){t=i("div"),this.h()},l(e){t=r(e,"DIV",{class:!0}),A(t).forEach(m),this.h()},h(){a(t,"class","absolute inset-0 -left-full animate-sweep bg-gradient-to-r from-transparent via-orange-400/40 to-transparent svelte-1s3xy1i")},m(e,l){Q(e,t,l)},d(e){e&&m(t)}}}function Oe(u){let t,e,l,o,h="Sign In";return{c(){t=i("img"),l=v(),o=i("span"),o.textContent=h,this.h()},l(s){t=r(s,"IMG",{src:!0,alt:!0,class:!0}),l=b(s),o=r(s,"SPAN",{class:!0,"data-svelte-h":!0}),L(o)!=="svelte-b2ltkx"&&(o.textContent=h),this.h()},h(){Be(t.src,e="/assets/hf-logo.png")||a(t,"src",e),a(t,"alt","HF Logo"),a(t,"class","w-5 h-5 relative z-10"),a(o,"class","relative z-10")},m(s,c){Q(s,t,c),Q(s,l,c),Q(s,o,c)},p:Ce,d(s){s&&(m(t),m(l),m(o))}}}function Ve(u){let t,e,l;return{c(){t=i("span"),e=he("π Logout, "),l=he(u[2]),this.h()},l(o){t=r(o,"SPAN",{class:!0});var h=A(t);e=pe(h,"π Logout, "),l=pe(h,u[2]),h.forEach(m),this.h()},h(){a(t,"class","relative z-10")},m(o,h){Q(o,t,h),n(t,e),n(t,l)},p(o,h){h&4&&Le(l,o[2])},d(o){o&&m(t)}}}function we(u){let t,e,l,o="Sign In with HuggingFace Token",h,s,c,k="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",B,f,w=`1. Go to <a href="https://huggingface.co/settings/tokens" target="_blank" class="underline text-blue-600">HuggingFace Settings</a><br/>
|
| 3 |
+
2. Create a new token with "Inference API" permissions<br/>
|
| 4 |
+
3. Copy and paste it below`,O,C,y,V,X="HuggingFace Token",W,x,Z,K,I,R,ee="Cancel",U,d,F="Sign In",T,D,_=u[6]&&ye(),p=u[5]&&ke(u);return{c(){t=i("div"),e=i("div"),l=i("h2"),l.textContent=o,h=v(),s=i("div"),c=i("p"),c.innerHTML=k,B=v(),f=i("p"),f.innerHTML=w,O=v(),_&&_.c(),C=v(),y=i("div"),V=i("label"),V.textContent=X,W=v(),x=i("input"),Z=v(),p&&p.c(),K=v(),I=i("div"),R=i("button"),R.textContent=ee,U=v(),d=i("button"),d.textContent=F,this.h()},l(M){t=r(M,"DIV",{class:!0});var G=A(t);e=r(G,"DIV",{class:!0});var E=A(e);l=r(E,"H2",{class:!0,"data-svelte-h":!0}),L(l)!=="svelte-1t0ehet"&&(l.textContent=o),h=b(E),s=r(E,"DIV",{class:!0});var Y=A(s);c=r(Y,"P",{class:!0,"data-svelte-h":!0}),L(c)!=="svelte-344vn4"&&(c.innerHTML=k),B=b(Y),f=r(Y,"P",{class:!0,"data-svelte-h":!0}),L(f)!=="svelte-orsfwv"&&(f.innerHTML=w),O=b(Y),_&&_.l(Y),Y.forEach(m),C=b(E),y=r(E,"DIV",{class:!0});var H=A(y);V=r(H,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),L(V)!=="svelte-vtbmxo"&&(V.textContent=X),W=b(H),x=r(H,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),Z=b(H),p&&p.l(H),H.forEach(m),K=b(E),I=r(E,"DIV",{class:!0});var $=A(I);R=r($,"BUTTON",{class:!0,"data-svelte-h":!0}),L(R)!=="svelte-csk0rj"&&(R.textContent=ee),U=b($),d=r($,"BUTTON",{class:!0,"data-svelte-h":!0}),L(d)!=="svelte-1nxas5u"&&(d.textContent=F),$.forEach(m),E.forEach(m),G.forEach(m),this.h()},h(){a(l,"class","text-xl font-semibold mb-4"),a(c,"class","text-blue-800 mb-2"),a(f,"class","text-blue-700"),a(s,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),a(V,"for","token"),a(V,"class","block text-sm font-medium text-gray-700 mb-2"),a(x,"id","token"),a(x,"type","password"),a(x,"placeholder","hf_..."),a(x,"class","w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-transparent"),a(y,"class","mb-4"),a(R,"class","px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors"),a(d,"class","px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors"),a(I,"class","flex justify-end gap-3"),a(e,"class","bg-white rounded-lg p-6 max-w-md w-full mx-4 shadow-xl"),a(t,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50")},m(M,G){Q(M,t,G),n(t,e),n(e,l),n(e,h),n(e,s),n(s,c),n(s,B),n(s,f),n(s,O),_&&_.m(s,null),n(e,C),n(e,y),n(y,V),n(y,W),n(y,x),be(x,u[4]),n(y,Z),p&&p.m(y,null),n(e,K),n(e,I),n(I,R),n(I,U),n(I,d),T||(D=[se(x,"input",u[16]),se(x,"keydown",u[17]),se(R,"click",u[10]),se(d,"click",u[11])],T=!0)},p(M,G){M[6]?_||(_=ye(),_.c(),_.m(s,null)):_&&(_.d(1),_=null),G&16&&x.value!==M[4]&&be(x,M[4]),M[5]?p?p.p(M,G):(p=ke(M),p.c(),p.m(y,null)):p&&(p.d(1),p=null)},d(M){M&&m(t),_&&_.d(),p&&p.d(),T=!1,Te(D)}}}function ye(u){let t,e=`<strong>Tip:</strong> You can also run <code>huggingface-cli login</code> in your terminal
|
| 5 |
+
to automatically use your local token.`;return{c(){t=i("p"),t.innerHTML=e,this.h()},l(l){t=r(l,"P",{class:!0,"data-svelte-h":!0}),L(t)!=="svelte-xrut8w"&&(t.innerHTML=e),this.h()},h(){a(t,"class","text-blue-600 mt-2")},m(l,o){Q(l,t,o)},d(l){l&&m(t)}}}function ke(u){let t,e;return{c(){t=i("p"),e=he(u[5]),this.h()},l(l){t=r(l,"P",{class:!0});var o=A(t);e=pe(o,u[5]),o.forEach(m),this.h()},h(){a(t,"class","text-red-600 text-sm mt-1")},m(l,o){Q(l,t,o),n(t,e)},p(l,o){o&32&&Le(e,l[5])},d(l){l&&m(t)}}}function Ue(u){let t,e,l,o='<div class="flex items-center gap-3"><img src="/assets/hf-studio-logo.png" alt="HF Logo" class="w-8 h-8"/> <h1 class="text-xl font-semibold">HFStudio<sup class="text-xs text-gray-500 ml-1">BETA</sup></h1></div>',h,s,c,k="Tasks",B,f,w,O="ποΈ",C,y,V="Text to Speech",X,W,x,Z="<span>π΅</span> <span>Voice Cloning</span>",K,I,R="<span>π§</span> <span>Speech to Text</span>",ee,U,d="<span>πΌ</span> <span>Sound Effects</span>",F,T,D="<span>πΈ</span> <span>Music Generation</span>",_,p,M="<span>π</span> <span>Audio Enhancement</span>",G,E,Y,H,$,ue,ne,ce,te,fe,ge,S=!u[1]&&u[7]&&ve(u),j=u[8]&&xe();function me(g,N){return g[1]?Ve:Oe}let ae=me(u),J=ae(u);const de=u[13].default,q=Me(de,u,u[12],null);let P=u[3]&&we(u);return{c(){t=i("div"),e=i("aside"),l=i("div"),l.innerHTML=o,h=v(),s=i("nav"),c=i("div"),c.textContent=k,B=v(),f=i("button"),w=i("span"),w.textContent=O,C=v(),y=i("span"),y.textContent=V,W=v(),x=i("button"),x.innerHTML=Z,K=v(),I=i("button"),I.innerHTML=R,ee=v(),U=i("button"),U.innerHTML=d,F=v(),T=i("button"),T.innerHTML=D,_=v(),p=i("button"),p.innerHTML=M,G=v(),E=i("div"),S&&S.c(),Y=v(),H=i("button"),j&&j.c(),$=v(),J.c(),ue=v(),ne=i("main"),q&&q.c(),ce=v(),P&&P.c(),this.h()},l(g){t=r(g,"DIV",{class:!0});var N=A(t);e=r(N,"ASIDE",{class:!0});var le=A(e);l=r(le,"DIV",{class:!0,"data-svelte-h":!0}),L(l)!=="svelte-60or62"&&(l.innerHTML=o),h=b(le),s=r(le,"NAV",{class:!0});var z=A(s);c=r(z,"DIV",{class:!0,"data-svelte-h":!0}),L(c)!=="svelte-pii1fa"&&(c.textContent=k),B=b(z),f=r(z,"BUTTON",{class:!0});var oe=A(f);w=r(oe,"SPAN",{"data-svelte-h":!0}),L(w)!=="svelte-1yx42xi"&&(w.textContent=O),C=b(oe),y=r(oe,"SPAN",{"data-svelte-h":!0}),L(y)!=="svelte-2j89jk"&&(y.textContent=V),oe.forEach(m),W=b(z),x=r(z,"BUTTON",{class:!0,"data-svelte-h":!0}),L(x)!=="svelte-10dl8nf"&&(x.innerHTML=Z),K=b(z),I=r(z,"BUTTON",{class:!0,"data-svelte-h":!0}),L(I)!=="svelte-wf0x5d"&&(I.innerHTML=R),ee=b(z),U=r(z,"BUTTON",{class:!0,"data-svelte-h":!0}),L(U)!=="svelte-x7bha3"&&(U.innerHTML=d),F=b(z),T=r(z,"BUTTON",{class:!0,"data-svelte-h":!0}),L(T)!=="svelte-1tyblmt"&&(T.innerHTML=D),_=b(z),p=r(z,"BUTTON",{class:!0,"data-svelte-h":!0}),L(p)!=="svelte-1emrjb3"&&(p.innerHTML=M),z.forEach(m),G=b(le),E=r(le,"DIV",{class:!0});var re=A(E);S&&S.l(re),Y=b(re),H=r(re,"BUTTON",{class:!0});var ie=A(H);j&&j.l(ie),$=b(ie),J.l(ie),ie.forEach(m),re.forEach(m),le.forEach(m),ue=b(N),ne=r(N,"MAIN",{class:!0});var _e=A(ne);q&&q.l(_e),_e.forEach(m),ce=b(N),P&&P.l(N),N.forEach(m),this.h()},h(){a(l,"class","p-4 border-b border-gray-200"),a(c,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),a(f,"class",X="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(u[0]==="tts"?"bg-gray-100":"")),a(x,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),x.disabled=!0,a(I,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),I.disabled=!0,a(U,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),U.disabled=!0,a(T,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),T.disabled=!0,a(p,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),p.disabled=!0,a(s,"class","p-2 text-sm flex-1"),H.disabled=!1,a(H,"class","w-full px-6 py-3 bg-black text-white rounded-lg font-medium hover:bg-gray-800 transition-colors shadow-sm flex items-center justify-center gap-2 text-sm disabled:opacity-50 disabled:cursor-not-allowed relative overflow-hidden"),a(E,"class","p-2"),a(e,"class","w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full "),a(ne,"class","flex-1 overflow-auto"),a(t,"class","flex h-screen bg-white")},m(g,N){Q(g,t,N),n(t,e),n(e,l),n(e,h),n(e,s),n(s,c),n(s,B),n(s,f),n(f,w),n(f,C),n(f,y),n(s,W),n(s,x),n(s,K),n(s,I),n(s,ee),n(s,U),n(s,F),n(s,T),n(s,_),n(s,p),n(e,G),n(e,E),S&&S.m(E,null),n(E,Y),n(E,H),j&&j.m(H,null),n(H,$),J.m(H,null),n(t,ue),n(t,ne),q&&q.m(ne,null),n(t,ce),P&&P.m(t,null),te=!0,fe||(ge=[se(f,"click",u[14]),se(H,"click",u[9])],fe=!0)},p(g,[N]){(!te||N&1&&X!==(X="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(g[0]==="tts"?"bg-gray-100":"")))&&a(f,"class",X),!g[1]&&g[7]?S?S.p(g,N):(S=ve(g),S.c(),S.m(E,Y)):S&&(S.d(1),S=null),g[8]?j||(j=xe(),j.c(),j.m(H,$)):j&&(j.d(1),j=null),ae===(ae=me(g))&&J?J.p(g,N):(J.d(1),J=ae(g),J&&(J.c(),J.m(H,null))),q&&q.p&&(!te||N&4096)&&Ne(q,de,g,g[12],te?De(de,g[12],N,null):Ae(g[12]),null),g[3]?P?P.p(g,N):(P=we(g),P.c(),P.m(t,null)):P&&(P.d(1),P=null)},i(g){te||(Pe(q,g),te=!0)},o(g){Se(q,g),te=!1},d(g){g&&m(t),S&&S.d(),j&&j.d(),J.d(),q&&q.d(g),P&&P.d(),fe=!1,Te(ge)}}}function Fe(u,t,e){let{$$slots:l={},$$scope:o}=t,h="tts",s=typeof window<"u"&&window.__INITIAL_USER__?window.__INITIAL_USER__:{authenticated:!1},c=(s==null?void 0:s.authenticated)||!1,k=s!=null&&s.authenticated&&(s!=null&&s.user_info)?(s.user_info.name||s.user_info.fullname||s.user_info.login||s.user_info.username||"User").split(" ")[0]:"",B=!1,f="",w="",O=!1,C=!1,y=!1,V=!1;je(()=>(window.addEventListener("show-login-prompt",()=>{c||(e(7,C=!0),e(8,y=!0),setTimeout(()=>{e(8,y=!1)},1600))}),X().then(()=>{s!=null&&s.authenticated||W()}),document.addEventListener("visibilitychange",()=>{document.hidden||W()}),()=>{}));async function X(){try{V=(await(await fetch("/api/status")).json()).is_spaces||!1}catch(d){console.error("Error checking Spaces status:",d),V=!1}}async function W(){if(!(s!=null&&s.authenticated&&c))try{const d=await fetch("/api/auth/user",{credentials:"include"});if(d.ok){const F=await d.json();if(F.authenticated){e(1,c=!0);const T=F.user_info,D=T.name||T.fullname||T.login||T.username||"User";e(2,k=D.split(" ")[0])}else e(1,c=!1),e(2,k="")}else e(1,c=!1),e(2,k="")}catch{e(1,c=!1),e(2,k="")}}async function x(){if(c){try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch(d){console.error("Logout error:",d)}sessionStorage.removeItem("oauth_state"),e(1,c=!1),e(2,k="")}else try{const F=await(await fetch("/api/auth/oauth-config")).json(),T=F.scopes||"inference-api";let D=window.location.origin+"/auth/callback";window.location.hostname==="localhost"&&window.location.port==="11111"&&(D="http://localhost:7860/auth/callback");const _=`https://huggingface.co/oauth/authorize?client_id=${F.client_id}&redirect_uri=${encodeURIComponent(D)}&scope=${encodeURIComponent(T)}&response_type=code&state=${Date.now()}`;window.location.href=_}catch{e(3,B=!0),e(4,f=""),e(5,w="")}}function Z(){e(3,B=!1),e(4,f=""),e(5,w="")}async function K(){if(!f.trim()){e(5,w="Please enter a token");return}if(!f.startsWith("hf_")){e(5,w='Token should start with "hf_"');return}try{const d=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${f.trim()}`}});if(d.ok){const F=await d.json(),T=f.trim();try{const D=await fetch("/api/auth/manual-token",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:T})});if(D.ok){const _=await D.json();e(1,c=!0);const p=_.user_info,M=p.name||p.fullname||p.login||p.username||"User";e(2,k=M.split(" ")[0]),Z()}else{const _=await D.json();e(5,w=_.detail||"Token validation failed")}}catch{e(5,w="Failed to validate token. Please try again.")}}else e(5,w=`Invalid token (${d.status}). Please check your token and try again.`)}catch{e(5,w="Error validating token. Please try again.")}}const I=()=>e(0,h="tts"),R=()=>e(7,C=!1);function ee(){f=this.value,e(4,f)}const U=d=>d.key==="Enter"&&K();return u.$$set=d=>{"$$scope"in d&&e(12,o=d.$$scope)},[h,c,k,B,f,w,O,C,y,x,Z,K,o,l,I,R,ee,U]}class qe extends Ie{constructor(t){super(),He(this,t,Fe,Ue,Ee,{})}}export{qe as component};
|
hfstudio/static/_app/immutable/nodes/1.CNpY1S-Y.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S,i as x,s as j,n as _,d as l,a as d,b as m,c as f,e as g,f as h,g as v,h as k,j as $,t as E,k as q,l as y}from"../chunks/MT0Fezl8.js";import"../chunks/IHki7fMi.js";import{s as C}from"../chunks/CEW4is7A.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",n,o,i,c=((b=s[0].error)==null?void 0:b.message)+"",u;return{c(){t=$("h1"),n=E(r),o=q(),i=$("p"),u=E(c)},l(e){t=g(e,"H1",{});var a=h(t);n=v(a,r),a.forEach(l),o=k(e),i=g(e,"P",{});var p=h(i);u=v(p,c),p.forEach(l)},m(e,a){m(e,t,a),f(t,n),m(e,o,a),m(e,i,a),f(i,u)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&d(n,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&d(u,c)},i:_,o:_,d(e){e&&(l(t),l(o),l(i))}}}function z(s,t,r){let n;return y(s,P,o=>r(0,n=o)),[n]}let F=class extends S{constructor(t){super(),x(this,t,z,w,j,{})}};export{F as component};
|
hfstudio/static/_app/immutable/nodes/2.DpS_xF3t.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
hfstudio/static/_app/version.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":"
|
|
|
|
| 1 |
+
{"version":"1761235858189"}
|
hfstudio/static/index.html
CHANGED
|
@@ -6,25 +6,25 @@
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<title>HFStudio - Text to Speech</title>
|
| 8 |
|
| 9 |
-
<link rel="modulepreload" href="/_app/immutable/entry/start.
|
| 10 |
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
| 11 |
<link rel="modulepreload" href="/_app/immutable/chunks/MT0Fezl8.js">
|
| 12 |
-
<link rel="modulepreload" href="/_app/immutable/entry/app.
|
| 13 |
<link rel="modulepreload" href="/_app/immutable/chunks/IHki7fMi.js">
|
| 14 |
</head>
|
| 15 |
<body data-sveltekit-preload-data="hover">
|
| 16 |
<div style="display: contents">
|
| 17 |
<script>
|
| 18 |
{
|
| 19 |
-
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
-
import("/_app/immutable/entry/start.
|
| 27 |
-
import("/_app/immutable/entry/app.
|
| 28 |
]).then(([kit, app]) => {
|
| 29 |
kit.start(app, element);
|
| 30 |
});
|
|
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<title>HFStudio - Text to Speech</title>
|
| 8 |
|
| 9 |
+
<link rel="modulepreload" href="/_app/immutable/entry/start.CuKEKhTN.js">
|
| 10 |
+
<link rel="modulepreload" href="/_app/immutable/chunks/CEW4is7A.js">
|
| 11 |
<link rel="modulepreload" href="/_app/immutable/chunks/MT0Fezl8.js">
|
| 12 |
+
<link rel="modulepreload" href="/_app/immutable/entry/app.BdU0kAy8.js">
|
| 13 |
<link rel="modulepreload" href="/_app/immutable/chunks/IHki7fMi.js">
|
| 14 |
</head>
|
| 15 |
<body data-sveltekit-preload-data="hover">
|
| 16 |
<div style="display: contents">
|
| 17 |
<script>
|
| 18 |
{
|
| 19 |
+
__sveltekit_1mhd705 = {
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
+
import("/_app/immutable/entry/start.CuKEKhTN.js"),
|
| 27 |
+
import("/_app/immutable/entry/app.BdU0kAy8.js")
|
| 28 |
]).then(([kit, app]) => {
|
| 29 |
kit.start(app, element);
|
| 30 |
});
|
pyproject.toml
CHANGED
|
@@ -32,6 +32,7 @@ dependencies = [
|
|
| 32 |
"httpx>=0.25.0",
|
| 33 |
"numpy>=1.21.0",
|
| 34 |
"soundfile>=0.12.0",
|
|
|
|
| 35 |
]
|
| 36 |
|
| 37 |
[project.optional-dependencies]
|
|
|
|
| 32 |
"httpx>=0.25.0",
|
| 33 |
"numpy>=1.21.0",
|
| 34 |
"soundfile>=0.12.0",
|
| 35 |
+
"sqlalchemy>=2.0.0",
|
| 36 |
]
|
| 37 |
|
| 38 |
[project.optional-dependencies]
|