GitHub Action
commited on
Commit
Β·
6a1d8ac
1
Parent(s):
6238ff9
Sync from GitHub: 6e5a10f61469fc6c08b276cfd8f9fe1819d4dfc4
Browse files- .gitattributes +6 -0
- frontend/src/routes/voice-cloning/+page.svelte +0 -41
- hfstudio/server.py +0 -43
- hfstudio/static/_app/immutable/assets/0.DA_IjvHn.css +1 -0
- hfstudio/static/_app/immutable/chunks/B0bP6sS8.js +3 -0
- hfstudio/static/_app/immutable/chunks/BdxGXOVO.js +1 -0
- hfstudio/static/_app/immutable/chunks/IhvhdSp7.js +1 -0
- hfstudio/static/_app/immutable/entry/app.obbrCMnr.js +2 -0
- hfstudio/static/_app/immutable/entry/start.CyPXq5tx.js +1 -0
- hfstudio/static/_app/immutable/nodes/0.CT4YO4R4.js +4 -0
- hfstudio/static/_app/immutable/nodes/1.BthlwIjN.js +1 -0
- hfstudio/static/_app/immutable/nodes/2.DxBLT2JT.js +87 -0
- hfstudio/static/_app/immutable/nodes/3.Dq8C9uWF.js +23 -0
- hfstudio/static/_app/immutable/nodes/4.CtN7iwkG.js +14 -0
- hfstudio/static/_app/version.json +1 -1
- hfstudio/static/index.html +7 -7
.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
|
frontend/src/routes/voice-cloning/+page.svelte
CHANGED
|
@@ -15,7 +15,6 @@
|
|
| 15 |
Mic,
|
| 16 |
Square,
|
| 17 |
Shuffle,
|
| 18 |
-
Trash2,
|
| 19 |
} from 'lucide-svelte';
|
| 20 |
import { onMount } from 'svelte';
|
| 21 |
|
|
@@ -44,7 +43,6 @@
|
|
| 44 |
let uploadResults = {}; // Store upload results for each recording
|
| 45 |
let successMessage = '';
|
| 46 |
let userVoices = []; // Store user's existing voices
|
| 47 |
-
let isDeletingVoice = false;
|
| 48 |
|
| 49 |
// Sample text rotation state
|
| 50 |
const sampleTexts = [
|
|
@@ -428,33 +426,6 @@
|
|
| 428 |
}
|
| 429 |
}
|
| 430 |
|
| 431 |
-
async function deleteVoice(voiceId) {
|
| 432 |
-
isDeletingVoice = true;
|
| 433 |
-
|
| 434 |
-
try {
|
| 435 |
-
const response = await fetch(`/api/voice/${voiceId}`, {
|
| 436 |
-
method: 'DELETE',
|
| 437 |
-
credentials: 'include',
|
| 438 |
-
});
|
| 439 |
-
|
| 440 |
-
if (response.ok) {
|
| 441 |
-
// Remove the voice from the list
|
| 442 |
-
userVoices = userVoices.filter((voice) => voice.id !== voiceId);
|
| 443 |
-
successMessage = 'Voice deleted successfully';
|
| 444 |
-
setTimeout(() => {
|
| 445 |
-
successMessage = '';
|
| 446 |
-
}, 3000);
|
| 447 |
-
} else {
|
| 448 |
-
const errorData = await response.json();
|
| 449 |
-
showError('Delete Error', errorData.detail || 'Failed to delete voice');
|
| 450 |
-
}
|
| 451 |
-
} catch (error) {
|
| 452 |
-
showError('Delete Error', `Failed to delete voice: ${error.message}`);
|
| 453 |
-
} finally {
|
| 454 |
-
isDeletingVoice = false;
|
| 455 |
-
}
|
| 456 |
-
}
|
| 457 |
-
|
| 458 |
onMount(async () => {
|
| 459 |
await checkAuthStatus();
|
| 460 |
await loadHistoryCount();
|
|
@@ -749,18 +720,6 @@
|
|
| 749 |
<Play size={14} class="text-blue-600" />
|
| 750 |
{/if}
|
| 751 |
</button>
|
| 752 |
-
<button
|
| 753 |
-
on:click={() => deleteVoice(voice.id)}
|
| 754 |
-
disabled={isDeletingVoice}
|
| 755 |
-
class="p-1 text-red-600 hover:text-red-800 hover:bg-red-100 rounded transition-colors disabled:opacity-50"
|
| 756 |
-
title="Delete voice"
|
| 757 |
-
>
|
| 758 |
-
{#if isDeletingVoice}
|
| 759 |
-
<Loader2 size={14} class="animate-spin" />
|
| 760 |
-
{:else}
|
| 761 |
-
<Trash2 size={14} />
|
| 762 |
-
{/if}
|
| 763 |
-
</button>
|
| 764 |
</div>
|
| 765 |
</div>
|
| 766 |
<div class="text-xs text-blue-600">
|
|
|
|
| 15 |
Mic,
|
| 16 |
Square,
|
| 17 |
Shuffle,
|
|
|
|
| 18 |
} from 'lucide-svelte';
|
| 19 |
import { onMount } from 'svelte';
|
| 20 |
|
|
|
|
| 43 |
let uploadResults = {}; // Store upload results for each recording
|
| 44 |
let successMessage = '';
|
| 45 |
let userVoices = []; // Store user's existing voices
|
|
|
|
| 46 |
|
| 47 |
// Sample text rotation state
|
| 48 |
const sampleTexts = [
|
|
|
|
| 426 |
}
|
| 427 |
}
|
| 428 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 429 |
onMount(async () => {
|
| 430 |
await checkAuthStatus();
|
| 431 |
await loadHistoryCount();
|
|
|
|
| 720 |
<Play size={14} class="text-blue-600" />
|
| 721 |
{/if}
|
| 722 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 723 |
</div>
|
| 724 |
</div>
|
| 725 |
<div class="text-xs text-blue-600">
|
hfstudio/server.py
CHANGED
|
@@ -1176,49 +1176,6 @@ async def get_user_voices(
|
|
| 1176 |
raise HTTPException(status_code=500, detail=f"Error fetching voices: {str(e)}")
|
| 1177 |
|
| 1178 |
|
| 1179 |
-
@app.delete("/api/voice/{voice_id}")
|
| 1180 |
-
async def delete_voice(
|
| 1181 |
-
voice_id: int,
|
| 1182 |
-
session: Dict[str, Any] = Depends(require_auth),
|
| 1183 |
-
db: Session = Depends(get_db),
|
| 1184 |
-
):
|
| 1185 |
-
"""Delete a voice recording."""
|
| 1186 |
-
try:
|
| 1187 |
-
username = session["user_info"].get("name") or session["user_info"].get("login")
|
| 1188 |
-
if not username:
|
| 1189 |
-
raise HTTPException(status_code=400, detail="Username not found in session")
|
| 1190 |
-
|
| 1191 |
-
# Find the voice record
|
| 1192 |
-
voice = (
|
| 1193 |
-
db.query(Voice)
|
| 1194 |
-
.filter(Voice.id == voice_id, Voice.username == username)
|
| 1195 |
-
.first()
|
| 1196 |
-
)
|
| 1197 |
-
|
| 1198 |
-
if not voice:
|
| 1199 |
-
raise HTTPException(status_code=404, detail="Voice not found")
|
| 1200 |
-
|
| 1201 |
-
# Delete the file if it exists
|
| 1202 |
-
file_path = Path(voice.file_path)
|
| 1203 |
-
if file_path.exists():
|
| 1204 |
-
try:
|
| 1205 |
-
file_path.unlink()
|
| 1206 |
-
except Exception as e:
|
| 1207 |
-
print(f"Error deleting voice file {file_path}: {e}")
|
| 1208 |
-
|
| 1209 |
-
# Delete the database record
|
| 1210 |
-
db.delete(voice)
|
| 1211 |
-
db.commit()
|
| 1212 |
-
|
| 1213 |
-
return {"success": True, "message": "Voice deleted successfully"}
|
| 1214 |
-
|
| 1215 |
-
except HTTPException:
|
| 1216 |
-
raise
|
| 1217 |
-
except Exception as e:
|
| 1218 |
-
db.rollback()
|
| 1219 |
-
raise HTTPException(status_code=500, detail=f"Error deleting voice: {str(e)}")
|
| 1220 |
-
|
| 1221 |
-
|
| 1222 |
@app.get("/{path:path}")
|
| 1223 |
async def serve_spa(
|
| 1224 |
path: str, request: Request, session: Dict[str, Any] = Depends(get_current_session)
|
|
|
|
| 1176 |
raise HTTPException(status_code=500, detail=f"Error fetching voices: {str(e)}")
|
| 1177 |
|
| 1178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1179 |
@app.get("/{path:path}")
|
| 1180 |
async def serve_spa(
|
| 1181 |
path: str, request: Request, session: Dict[str, Any] = Depends(get_current_session)
|
hfstudio/static/_app/immutable/assets/0.DA_IjvHn.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}.sticky{position:sticky}.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-3{left:.75rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-2{top:.5rem}.top-3{top:.75rem}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.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-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-80{height:20rem}.h-96{height:24rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.min-h-\[73px\]{min-height:73px}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-80{width:20rem}.w-96{width:24rem}.w-full{width:100%}.min-w-0{min-width:0px}.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}.rotate-180{--tw-rotate: 180deg;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}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.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-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * 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-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * 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}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-amber-400{--tw-border-opacity: 1;border-color:rgb(251 191 36 / var(--tw-border-opacity, 1))}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / 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-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-orange-100{--tw-border-opacity: 1;border-color:rgb(255 237 213 / var(--tw-border-opacity, 1))}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-orange-300{--tw-border-opacity: 1;border-color:rgb(253 186 116 / var(--tw-border-opacity, 1))}.border-orange-500{--tw-border-opacity: 1;border-color:rgb(249 115 22 / var(--tw-border-opacity, 1))}.border-purple-200{--tw-border-opacity: 1;border-color:rgb(233 213 255 / var(--tw-border-opacity, 1))}.border-purple-400{--tw-border-opacity: 1;border-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-200{--tw-bg-opacity: 1;background-color:rgb(253 230 138 / 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-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / 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-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / 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-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / 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-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / 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-400{--tw-gradient-from: #c084fc var(--tw-gradient-from-position);--tw-gradient-to: rgb(192 132 252 / 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-pink-500{--tw-gradient-to: #ec4899 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}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.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-5{padding-left:1.25rem;padding-right:1.25rem}.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-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-16{padding-bottom:4rem}.pb-24{padding-bottom:6rem}.pb-6{padding-bottom:1.5rem}.pr-4{padding-right:1rem}.pt-10{padding-top:2.5rem}.pt-12{padding-top:3rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.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}.italic{font-style:italic}.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-800{--tw-text-opacity: 1;color:rgb(146 64 14 / 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-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-900{--tw-text-opacity: 1;color:rgb(88 28 135 / 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-30{opacity:.3}.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}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-75{transition-duration:75ms}.ease-linear{transition-timing-function:linear}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\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-200:hover{--tw-bg-opacity: 1;background-color:rgb(253 230 138 / 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-green-100:hover{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / 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-purple-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / 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))}.hover\:text-green-900:hover{--tw-text-opacity: 1;color:rgb(20 83 45 / 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}@media (min-width: 1024px){.lg\:grid-cols-\[1fr_1\.4fr_1fr\]{grid-template-columns:1fr 1.4fr 1fr}}@keyframes svelte-1s3xy1i-sweep{0%{transform:translate(-100%)}to{transform:translate(300%)}}
|
hfstudio/static/_app/immutable/chunks/B0bP6sS8.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,U as At,$ as Rt,a0 as Tt,a1 as It,a2 as Ut,a3 as Lt,a4 as $t,K as ve,a5 as xt,V as be,n as ge,s as Ct}from"./BaOlNwUz.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 Bt(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 Ft(...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 Vt=new TextDecoder;function Mt(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"&&K.delete(Ie(e)),qt(e,t));const K=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&&K.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=Mt(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Kt(e,t,n){if(K.size>0){const r=Ie(e,n),a=K.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);K.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="${Ft(...a)}"]`}return r}const Yt=/^(\[)?(\.\.\.)?(\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=Yt.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 zt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Wt(e){return e.slice(1).split("/").filter(zt)}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 Fe(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_15f9ehl)==null?void 0:Je.base)??"";var Xe;const Zt=((Xe=globalThis.__sveltekit_15f9ehl)==null?void 0:Xe.assets)??$??"",Qt="1761298999117",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",en="sveltekit:pageurl",F="sveltekit:history",z="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 B(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ve={...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=B(o,"preload-code")),a===null&&(a=B(o,"preload-data")),t===null&&(t=B(o,"keepfocus")),n===null&&(n=B(o,"noscroll")),s===null&&(s=B(o,"reload")),i===null&&(i=B(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:Ve[r??"off"],preload_data:Ve[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Me(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:Me({}),page:Me({}),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,Y=new Set;let b={branch:[],error:null,url:null},xe=!1,re=!1,Ke=!0,X=!1,G=!1,ft=!1,Ce=!1,ut,A,L,N;const H=new Set,Ye=new Map;async function Hn(e,t,n){var s,i,o,c,l;(s=globalThis.__sveltekit_15f9ehl)!=null&&s.data&&globalThis.__sveltekit_15f9ehl.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[F],L=(l=history.state)==null?void 0:l[z],A||(A=L=Date.now(),history.replaceState({...history.state,[F]:A,[z]:L},""));const r=j[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Dn(Ee,n)):(await V({type:"enter",url:at(k.hash?Fn(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),Fe(tt,j),dt(L),Fe(et,J)}async function Un(e,t,n,r){let a;t.invalidateAll&&(U=null),await V({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=[...Ye.keys()]),t.invalidate&&t.invalidate.forEach(Nn)}}),t.invalidateAll&&be().then(be).then(()=>{Ye.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()};Y.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:Bt(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?Kt(r,a.href,t):Gt(r,t);return{resolved:a,promise:s}}function ze(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]||ze(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 M(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)&&!ze(_,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 Be;const De={};for(let pe=0;pe<m;pe+=1)Object.assign(De,(Be=await I[pe])==null?void 0:Be.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 M(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 M(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 V({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 M(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 V({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 M(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={[F]:A+=m,[z]: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=>{Y.delete(S)})};m.push(v),m.forEach(S=>{Y.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(Ke){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&&Bn(t,E),Ke=!0,_.props.page&&Object.assign(T,_.props.page),X=!1,e==="popstate"&&ht(L),p.fulfil(void 0),Y.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))}}Y.add(i),i()}function M(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 V({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(),V({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[F]){const a=n.state[F];if(N={},a===A)return;const s=j[a],i=n.state[nt]??{},o=new URL(n.state[en]??location.href),c=n.state[z],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 V({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,[F]:++A,[z]: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 M(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 |
+
`:Vt.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 Bn(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 Fn(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/chunks/BdxGXOVO.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as C,i as j,s as q,n as A,d as c,a as z,b as p,c as g,m as D,o as P,p as h,e as _,f as v,g as I,h as w,j as b,t as x,k as L,q as V,r as F}from"./BaOlNwUz.js";import"./IHki7fMi.js";function B(l){let e;return{c(){e=b("div"),this.h()},l(t){e=_(t,"DIV",{class:!0}),v(e).forEach(c),this.h()},h(){h(e,"class","absolute inset-0 -left-full animate-sweep bg-gradient-to-r from-transparent via-orange-400/40 to-transparent")},m(t,i){p(t,e,i)},d(t){t&&c(e)}}}function H(l){let e,t,i,a,n="Sign In";return{c(){e=b("img"),i=L(),a=b("span"),a.textContent=n,this.h()},l(s){e=_(s,"IMG",{src:!0,alt:!0,class:!0}),i=w(s),a=_(s,"SPAN",{class:!0,"data-svelte-h":!0}),F(a)!=="svelte-b2ltkx"&&(a.textContent=n),this.h()},h(){V(e.src,t="/assets/hf-logo.png")||h(e,"src",t),h(e,"alt","HF Logo"),h(e,"class","w-4 h-4 relative z-10"),h(a,"class","relative z-10")},m(s,f){p(s,e,f),p(s,i,f),p(s,a,f)},p:A,d(s){s&&(c(e),c(i),c(a))}}}function G(l){let e,t,i;return{c(){e=b("span"),t=x("π Logout, "),i=x(l[1]),this.h()},l(a){e=_(a,"SPAN",{class:!0});var n=v(e);t=I(n,"π Logout, "),i=I(n,l[1]),n.forEach(c),this.h()},h(){h(e,"class","relative z-10")},m(a,n){p(a,e,n),g(e,t),g(e,i)},p(a,n){n&2&&z(i,a[1])},d(a){a&&c(e)}}}function M(l){let e,t,i,a,n,s,f,o,S,r=l[3]&&B();function E(m,d){return m[0]?G:H}let y=E(l),u=y(l);return{c(){e=b("div"),t=b("div"),i=b("span"),a=x(l[4]),n=L(),s=b("button"),r&&r.c(),f=L(),u.c(),this.h()},l(m){e=_(m,"DIV",{class:!0});var d=v(e);t=_(d,"DIV",{class:!0});var N=v(t);i=_(N,"SPAN",{class:!0});var T=v(i);a=I(T,l[4]),T.forEach(c),N.forEach(c),n=w(d),s=_(d,"BUTTON",{class:!0});var k=v(s);r&&r.l(k),f=w(k),u.l(k),k.forEach(c),d.forEach(c),this.h()},h(){h(i,"class","font-semibold text-gray-900 text-xl"),h(t,"class","flex items-center gap-2"),s.disabled=!1,h(s,"class","px-4 py-2 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"),h(e,"class","sticky top-0 z-30 bg-white flex items-center justify-between px-4 py-4 border-b border-gray-200 min-h-[73px]")},m(m,d){p(m,e,d),g(e,t),g(t,i),g(i,a),g(e,n),g(e,s),r&&r.m(s,null),g(s,f),u.m(s,null),o||(S=D(s,"click",function(){P(l[2])&&l[2].apply(this,arguments)}),o=!0)},p(m,[d]){l=m,d&16&&z(a,l[4]),l[3]?r||(r=B(),r.c(),r.m(s,f)):r&&(r.d(1),r=null),y===(y=E(l))&&u?u.p(l,d):(u.d(1),u=y(l),u&&(u.c(),u.m(s,null)))},i:A,o:A,d(m){m&&c(e),r&&r.d(),u.d(),o=!1,S()}}}function O(l,e,t){let{isLoggedIn:i=!1}=e,{username:a=""}=e,{handleAuthAction:n=()=>{}}=e,{flashButton:s=!1}=e,{pageTitle:f="HFStudio"}=e;return l.$$set=o=>{"isLoggedIn"in o&&t(0,i=o.isLoggedIn),"username"in o&&t(1,a=o.username),"handleAuthAction"in o&&t(2,n=o.handleAuthAction),"flashButton"in o&&t(3,s=o.flashButton),"pageTitle"in o&&t(4,f=o.pageTitle)},[i,a,n,s,f]}class K extends C{constructor(e){super(),j(this,e,O,M,q,{isLoggedIn:0,username:1,handleAuthAction:2,flashButton:3,pageTitle:4})}}export{K as N};
|
hfstudio/static/_app/immutable/chunks/IhvhdSp7.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{s as e}from"./B0bP6sS8.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
|
hfstudio/static/_app/immutable/entry/app.obbrCMnr.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.CT4YO4R4.js","../chunks/BaOlNwUz.js","../chunks/IHki7fMi.js","../chunks/IhvhdSp7.js","../chunks/B0bP6sS8.js","../chunks/BdxGXOVO.js","../chunks/4G_mFUFB.js","../chunks/C7BncMoR.js","../assets/0.DA_IjvHn.css","../nodes/1.BthlwIjN.js","../nodes/2.DxBLT2JT.js","../chunks/Dj_MM6zE.js","../chunks/BV8rDFhh.js","../chunks/Bm0csYZC.js","../assets/2.CdRym-eY.css","../nodes/3.Dq8C9uWF.js","../assets/3.BNkL3CE9.css","../nodes/4.CtN7iwkG.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{S as C,i as U,s as q,d,w as h,x as g,N as O,H as S,b as v,h as B,J as w,k as W,U as z,K as H,V as J,W as y,v as P,A as R,y as L,z as D,p as T,L as p,e as K,f as F,j as G,T as V,a as Q,g as X,t as Y}from"../chunks/BaOlNwUz.js";import"../chunks/IHki7fMi.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},I={},A=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 I)return;I[f]=!0;const l=f.endsWith(".css"),_=l?'[rel="stylesheet"]':"";if(!!i)for(let k=t.length-1;k>=0;k--){const E=t[k];if(E.href===f&&(!l||E.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,E)=>{m.addEventListener("load",k),m.addEventListener("error",()=>E(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&&D(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){O();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),S()}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&&D(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][0])){if(e){O();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),S()}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&&D(e.$$.fragment,t),n=w()},m(t,s){e&&L(e,t,s),v(t,n,s),i=!0},p(t,s){if(s&4&&r!==(r=t[2][1])){if(e){O();const a=e;h(a.$$.fragment,1,0,()=>{P(a,1)}),S()}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 N(o){let e,n=o[7]&&j(o);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=K(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=F(e);n&&n.l(r),r.forEach(d),this.h()},h(){T(e,"id","svelte-announcer"),T(e,"aria-live","assertive"),T(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){v(i,e,r),n&&n.m(e,null)},p(i,r){i[7]?n?n.p(i,r):(n=j(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&d(e),n&&n.d()}}}function j(o){let e;return{c(){e=Y(o[8])},l(n){e=X(n,o[8])},m(n,i){v(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]&&N(o);return{c(){n.c(),i=W(),f&&f.c(),r=w()},l(l){n.l(l),i=B(l),f&&f.l(l),r=w()},m(l,_){s[e].m(l,_),v(l,i,_),f&&f.m(l,_),v(l,r,_),u=!0},p(l,[_]){let b=e;e=a(l),e===b?s[e].p(l,_):(O(),h(s[b],1,1,()=>{s[b]=null}),S(),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=N(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;z(i.page.notify);let l=!1,_=!1,b=null;H(()=>{const c=i.page.subscribe(()=>{l&&(n(7,_=!0),J().then(()=>{n(8,b=document.title||"untitled page")}))});return n(6,l=!0),c});function m(c){V[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function k(c){V[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function E(c){V[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,E]}class le extends C{constructor(e){super(),U(this,e,ne,te,q,{stores:9,page:1,constructors:2,components:0,form:3,data_0:4,data_1:5})}}const fe=[()=>A(()=>import("../nodes/0.CT4YO4R4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),()=>A(()=>import("../nodes/1.BthlwIjN.js"),__vite__mapDeps([9,1,2,3,4]),import.meta.url),()=>A(()=>import("../nodes/2.DxBLT2JT.js"),__vite__mapDeps([10,1,11,7,2,12,13,14]),import.meta.url),()=>A(()=>import("../nodes/3.Dq8C9uWF.js"),__vite__mapDeps([15,1,11,7,2,5,13,16]),import.meta.url),()=>A(()=>import("../nodes/4.CtN7iwkG.js"),__vite__mapDeps([17,1,7,2,12,6,13]),import.meta.url)],ce=[],ue={"/":[2],"/code-recorder":[3],"/voice-cloning":[4]},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.CyPXq5tx.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{l as o,a as r}from"../chunks/B0bP6sS8.js";export{o as load_css,r as start};
|
hfstudio/static/_app/immutable/nodes/0.CT4YO4R4.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as at,i as ot,s as rt,C as it,d as E,v as Qe,w as Be,x as Oe,p as s,D as ut,E as ct,F as dt,b as _e,c as e,y as Xe,e as a,f as R,r as p,h as u,z as Ze,j as o,k as c,A as $e,l as ft,K as pt,G as ht,O as et,m as xe,a as mt,g as gt,t as xt}from"../chunks/BaOlNwUz.js";import"../chunks/IHki7fMi.js";import{p as _t}from"../chunks/IhvhdSp7.js";import{N as bt}from"../chunks/BdxGXOVO.js";import{M as vt}from"../chunks/4G_mFUFB.js";function tt(f){let r,n,d,H="Sign In with HuggingFace Token",z,t,g,A="<strong>Manual Token Entry:</strong> Please enter your HuggingFace token.",q,_,C=`1. Go to <a href="https://huggingface.co/settings/tokens" target="_blank" class="underline text-blue-600">HuggingFace Settings</a><br/>
|
| 2 |
+
2. Create a new token with "Inference API" permissions<br/>
|
| 3 |
+
3. Copy and paste it below`,M,W,b,B,Y="HuggingFace Token",G,x,O,D,I,P,l="Cancel",w,h,S="Sign In",V,L,T=f[5]&&nt(),y=f[4]&&st(f);return{c(){r=o("div"),n=o("div"),d=o("h2"),d.textContent=H,z=c(),t=o("div"),g=o("p"),g.innerHTML=A,q=c(),_=o("p"),_.innerHTML=C,M=c(),T&&T.c(),W=c(),b=o("div"),B=o("label"),B.textContent=Y,G=c(),x=o("input"),O=c(),y&&y.c(),D=c(),I=o("div"),P=o("button"),P.textContent=l,w=c(),h=o("button"),h.textContent=S,this.h()},l(v){r=a(v,"DIV",{class:!0});var J=R(r);n=a(J,"DIV",{class:!0});var F=R(n);d=a(F,"H2",{class:!0,"data-svelte-h":!0}),p(d)!=="svelte-1t0ehet"&&(d.textContent=H),z=u(F),t=a(F,"DIV",{class:!0});var U=R(t);g=a(U,"P",{class:!0,"data-svelte-h":!0}),p(g)!=="svelte-344vn4"&&(g.innerHTML=A),q=u(U),_=a(U,"P",{class:!0,"data-svelte-h":!0}),p(_)!=="svelte-orsfwv"&&(_.innerHTML=C),M=u(U),T&&T.l(U),U.forEach(E),W=u(F),b=a(F,"DIV",{class:!0});var Q=R(b);B=a(Q,"LABEL",{for:!0,class:!0,"data-svelte-h":!0}),p(B)!=="svelte-vtbmxo"&&(B.textContent=Y),G=u(Q),x=a(Q,"INPUT",{id:!0,type:!0,placeholder:!0,class:!0}),O=u(Q),y&&y.l(Q),Q.forEach(E),D=u(F),I=a(F,"DIV",{class:!0});var X=R(I);P=a(X,"BUTTON",{class:!0,"data-svelte-h":!0}),p(P)!=="svelte-csk0rj"&&(P.textContent=l),w=u(X),h=a(X,"BUTTON",{class:!0,"data-svelte-h":!0}),p(h)!=="svelte-1nxas5u"&&(h.textContent=S),X.forEach(E),F.forEach(E),J.forEach(E),this.h()},h(){s(d,"class","text-xl font-semibold mb-4"),s(g,"class","text-blue-800 mb-2"),s(_,"class","text-blue-700"),s(t,"class","mb-4 p-3 bg-blue-50 rounded-md text-sm"),s(B,"for","token"),s(B,"class","block text-sm font-medium text-gray-700 mb-2"),s(x,"id","token"),s(x,"type","password"),s(x,"placeholder","hf_..."),s(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"),s(b,"class","mb-4"),s(P,"class","px-4 py-2 text-gray-600 hover:text-gray-800 transition-colors"),s(h,"class","px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors"),s(I,"class","flex justify-end gap-3"),s(n,"class","bg-white rounded-lg p-6 max-w-md w-full mx-4 shadow-xl"),s(r,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50")},m(v,J){_e(v,r,J),e(r,n),e(n,d),e(n,z),e(n,t),e(t,g),e(t,q),e(t,_),e(t,M),T&&T.m(t,null),e(n,W),e(n,b),e(b,B),e(b,G),e(b,x),et(x,f[3]),e(b,O),y&&y.m(b,null),e(n,D),e(n,I),e(I,P),e(I,w),e(I,h),V||(L=[xe(x,"input",f[13]),xe(x,"keydown",f[14]),xe(P,"click",f[9]),xe(h,"click",f[10])],V=!0)},p(v,J){v[5]?T||(T=nt(),T.c(),T.m(t,null)):T&&(T.d(1),T=null),J&8&&x.value!==v[3]&&et(x,v[3]),v[4]?y?y.p(v,J):(y=st(v),y.c(),y.m(b,null)):y&&(y.d(1),y=null)},d(v){v&&E(r),T&&T.d(),y&&y.d(),V=!1,ht(L)}}}function nt(f){let r,n=`<strong>Tip:</strong> You can also run <code>huggingface-cli login</code> in your terminal
|
| 4 |
+
to automatically use your local token.`;return{c(){r=o("p"),r.innerHTML=n,this.h()},l(d){r=a(d,"P",{class:!0,"data-svelte-h":!0}),p(r)!=="svelte-xrut8w"&&(r.innerHTML=n),this.h()},h(){s(r,"class","text-blue-600 mt-2")},m(d,H){_e(d,r,H)},d(d){d&&E(r)}}}function st(f){let r,n;return{c(){r=o("p"),n=xt(f[4]),this.h()},l(d){r=a(d,"P",{class:!0});var H=R(r);n=gt(H,f[4]),H.forEach(E),this.h()},h(){s(r,"class","text-red-600 text-sm mt-1")},m(d,H){_e(d,r,H),e(r,n)},p(d,H){H&16&&mt(n,d[4])},d(d){d&&E(r)}}}function wt(f){let r,n,d,H='<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>',z,t,g,A="Audio",q,_,C,M="ποΈ",W,b,B="Text to Speech",Y,G,x,O,D,I,P="Voice Cloning",l,w,h,S="<span>π§</span> <span>Speech to Text</span>",V,L,T="<span>πΌ</span> <span>Sound Effects</span>",y,v,J="<span>πΈ</span> <span>Music Generation</span>",F,U,Q="<span>π</span> <span>Audio Enhancement</span>",X,fe,Pe="Image",be,Z,Ve="<span>π¨</span> <span>Text to Image</span>",ve,$,je="<span>πΌοΈ</span> <span>Image to Image</span>",we,ee,Fe="<span>βοΈ</span> <span>Remove Background</span>",Te,te,Re="<span>π</span> <span>Upscale Image</span>",ye,ne,ze="<span>π</span> <span>Face Swap</span>",Ce,se,qe="<span>π</span> <span>Image to Text</span>",Le,pe,Ge="Video",ke,le,De="<span>π¬</span> <span>Text to Video</span>",Ie,ae,Je="<span>ποΈ</span> <span>Image to Video</span>",He,oe,Ke="<span>β¨</span> <span>Video Enhancement</span>",Me,re,We="<span>π€</span> <span>Lip Sync</span>",Ne,ie,Ye="<span>π£οΈ</span> <span>Video Dubbing</span>",Ee,ue,ce,Se,Ue,de;O=new vt({props:{size:16}}),ce=new bt({props:{isLoggedIn:f[0],username:f[1],handleAuthAction:f[8],flashButton:f[6],pageTitle:lt(f[7].url.pathname)}});const Ae=f[12].default,j=it(Ae,f,f[11],null);let N=f[2]&&tt(f);return{c(){r=o("div"),n=o("aside"),d=o("div"),d.innerHTML=H,z=c(),t=o("nav"),g=o("div"),g.textContent=A,q=c(),_=o("a"),C=o("span"),C.textContent=M,W=c(),b=o("span"),b.textContent=B,G=c(),x=o("a"),$e(O.$$.fragment),D=c(),I=o("span"),I.textContent=P,w=c(),h=o("button"),h.innerHTML=S,V=c(),L=o("button"),L.innerHTML=T,y=c(),v=o("button"),v.innerHTML=J,F=c(),U=o("button"),U.innerHTML=Q,X=c(),fe=o("div"),fe.textContent=Pe,be=c(),Z=o("button"),Z.innerHTML=Ve,ve=c(),$=o("button"),$.innerHTML=je,we=c(),ee=o("button"),ee.innerHTML=Fe,Te=c(),te=o("button"),te.innerHTML=Re,ye=c(),ne=o("button"),ne.innerHTML=ze,Ce=c(),se=o("button"),se.innerHTML=qe,Le=c(),pe=o("div"),pe.textContent=Ge,ke=c(),le=o("button"),le.innerHTML=De,Ie=c(),ae=o("button"),ae.innerHTML=Je,He=c(),oe=o("button"),oe.innerHTML=Ke,Me=c(),re=o("button"),re.innerHTML=We,Ne=c(),ie=o("button"),ie.innerHTML=Ye,Ee=c(),ue=o("main"),$e(ce.$$.fragment),Se=c(),j&&j.c(),Ue=c(),N&&N.c(),this.h()},l(m){r=a(m,"DIV",{class:!0});var k=R(r);n=a(k,"ASIDE",{class:!0});var K=R(n);d=a(K,"DIV",{class:!0,"data-svelte-h":!0}),p(d)!=="svelte-xzbt87"&&(d.innerHTML=H),z=u(K),t=a(K,"NAV",{class:!0});var i=R(t);g=a(i,"DIV",{class:!0,"data-svelte-h":!0}),p(g)!=="svelte-52jqai"&&(g.textContent=A),q=u(i),_=a(i,"A",{href:!0,class:!0});var he=R(_);C=a(he,"SPAN",{"data-svelte-h":!0}),p(C)!=="svelte-1yx42xi"&&(C.textContent=M),W=u(he),b=a(he,"SPAN",{"data-svelte-h":!0}),p(b)!=="svelte-2j89jk"&&(b.textContent=B),he.forEach(E),G=u(i),x=a(i,"A",{href:!0,class:!0});var me=R(x);Ze(O.$$.fragment,me),D=u(me),I=a(me,"SPAN",{"data-svelte-h":!0}),p(I)!=="svelte-10pmll2"&&(I.textContent=P),me.forEach(E),w=u(i),h=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(h)!=="svelte-wf0x5d"&&(h.innerHTML=S),V=u(i),L=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(L)!=="svelte-x7bha3"&&(L.innerHTML=T),y=u(i),v=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(v)!=="svelte-1tyblmt"&&(v.innerHTML=J),F=u(i),U=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(U)!=="svelte-1emrjb3"&&(U.innerHTML=Q),X=u(i),fe=a(i,"DIV",{class:!0,"data-svelte-h":!0}),p(fe)!=="svelte-1pmjg3x"&&(fe.textContent=Pe),be=u(i),Z=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(Z)!=="svelte-11wbuiv"&&(Z.innerHTML=Ve),ve=u(i),$=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p($)!=="svelte-ol2yvl"&&($.innerHTML=je),we=u(i),ee=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ee)!=="svelte-ttigif"&&(ee.innerHTML=Fe),Te=u(i),te=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(te)!=="svelte-ixgtu4"&&(te.innerHTML=Re),ye=u(i),ne=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ne)!=="svelte-r2ax5z"&&(ne.innerHTML=ze),Ce=u(i),se=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(se)!=="svelte-n9rt3x"&&(se.innerHTML=qe),Le=u(i),pe=a(i,"DIV",{class:!0,"data-svelte-h":!0}),p(pe)!=="svelte-1gfxetb"&&(pe.textContent=Ge),ke=u(i),le=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(le)!=="svelte-gox1rd"&&(le.innerHTML=De),Ie=u(i),ae=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ae)!=="svelte-13pimzy"&&(ae.innerHTML=Je),He=u(i),oe=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(oe)!=="svelte-c86wph"&&(oe.innerHTML=Ke),Me=u(i),re=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(re)!=="svelte-wkify0"&&(re.innerHTML=We),Ne=u(i),ie=a(i,"BUTTON",{class:!0,"data-svelte-h":!0}),p(ie)!=="svelte-10ou061"&&(ie.innerHTML=Ye),i.forEach(E),K.forEach(E),Ee=u(k),ue=a(k,"MAIN",{class:!0});var ge=R(ue);Ze(ce.$$.fragment,ge),Se=u(ge),j&&j.l(ge),ge.forEach(E),Ue=u(k),N&&N.l(k),k.forEach(E),this.h()},h(){s(d,"class","px-4 py-4 border-b border-gray-200 min-h-[73px] flex items-center"),s(g,"class","mt-2 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),s(_,"href","/"),s(_,"class",Y="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(f[7].url.pathname==="/"?"bg-gray-100":"")),s(x,"href","/voice-cloning"),s(x,"class",l="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(f[7].url.pathname==="/voice-cloning"?"bg-gray-100":"")),s(h,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),h.disabled=!0,s(L,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),L.disabled=!0,s(v,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),v.disabled=!0,s(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,s(fe,"class","mt-4 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),s(Z,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),Z.disabled=!0,s($,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),$.disabled=!0,s(ee,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ee.disabled=!0,s(te,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),te.disabled=!0,s(ne,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ne.disabled=!0,s(se,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),se.disabled=!0,s(pe,"class","mt-4 mb-1 px-2 text-xs font-medium text-gray-500 uppercase"),s(le,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),le.disabled=!0,s(ae,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ae.disabled=!0,s(oe,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),oe.disabled=!0,s(re,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),re.disabled=!0,s(ie,"class","w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left opacity-40 cursor-not-allowed"),ie.disabled=!0,s(t,"class","p-2 text-sm flex-1"),s(n,"class","w-56 border-r border-gray-200 bg-white flex-shrink-0 flex flex-col h-full relative "),s(ue,"class","flex-1 overflow-auto"),s(r,"class","flex h-screen bg-white")},m(m,k){_e(m,r,k),e(r,n),e(n,d),e(n,z),e(n,t),e(t,g),e(t,q),e(t,_),e(_,C),e(_,W),e(_,b),e(t,G),e(t,x),Xe(O,x,null),e(x,D),e(x,I),e(t,w),e(t,h),e(t,V),e(t,L),e(t,y),e(t,v),e(t,F),e(t,U),e(t,X),e(t,fe),e(t,be),e(t,Z),e(t,ve),e(t,$),e(t,we),e(t,ee),e(t,Te),e(t,te),e(t,ye),e(t,ne),e(t,Ce),e(t,se),e(t,Le),e(t,pe),e(t,ke),e(t,le),e(t,Ie),e(t,ae),e(t,He),e(t,oe),e(t,Me),e(t,re),e(t,Ne),e(t,ie),e(r,Ee),e(r,ue),Xe(ce,ue,null),e(ue,Se),j&&j.m(ue,null),e(r,Ue),N&&N.m(r,null),de=!0},p(m,[k]){(!de||k&128&&Y!==(Y="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(m[7].url.pathname==="/"?"bg-gray-100":"")))&&s(_,"class",Y),(!de||k&128&&l!==(l="w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-gray-100 transition-colors text-left "+(m[7].url.pathname==="/voice-cloning"?"bg-gray-100":"")))&&s(x,"class",l);const K={};k&1&&(K.isLoggedIn=m[0]),k&2&&(K.username=m[1]),k&64&&(K.flashButton=m[6]),k&128&&(K.pageTitle=lt(m[7].url.pathname)),ce.$set(K),j&&j.p&&(!de||k&2048)&&ut(j,Ae,m,m[11],de?dt(Ae,m[11],k,null):ct(m[11]),null),m[2]?N?N.p(m,k):(N=tt(m),N.c(),N.m(r,null)):N&&(N.d(1),N=null)},i(m){de||(Oe(O.$$.fragment,m),Oe(ce.$$.fragment,m),Oe(j,m),de=!0)},o(m){Be(O.$$.fragment,m),Be(ce.$$.fragment,m),Be(j,m),de=!1},d(m){m&&E(r),Qe(O),Qe(ce),j&&j.d(m),N&&N.d()}}}function lt(f){switch(f){case"/":return"Text to Speech Playground";case"/voice-cloning":return"Voice Cloning Playground";default:return"HFStudio"}}function Tt(f,r,n){let d;ft(f,_t,l=>n(7,d=l));let{$$slots:H={},$$scope:z}=r,t={authenticated:!1},g=!1,A="";function q(l){if(t=l,n(0,g=(l==null?void 0:l.authenticated)||!1),l!=null&&l.authenticated&&(l!=null&&l.user_info)){const w=l.user_info,h=w.name||w.fullname||w.login||w.username||"User";n(1,A=h.split(" ")[0])}}typeof window<"u"&&(window.__INITIAL_USER__?(console.log("Found initial user data:",window.__INITIAL_USER__),q(window.__INITIAL_USER__)):(console.log("No initial user data found, listening for event"),window.addEventListener("initial-user-loaded",l=>{console.log("Received initial user event:",l.detail),q(l.detail)})));let _=!1,C="",M="",W=!1,b=!1,B=!1;pt(()=>(window.addEventListener("show-login-prompt",()=>{g||(n(6,b=!0),setTimeout(()=>{n(6,b=!1)},1600))}),Y().then(()=>{!window.__INITIAL_USER__&&!(t!=null&&t.authenticated)&&(console.log("No server data available, checking auth status via API"),G())}),document.addEventListener("visibilitychange",()=>{document.hidden||G()}),()=>{}));async function Y(){try{B=(await(await fetch("/api/status")).json()).is_spaces||!1}catch(l){console.error("Error checking Spaces status:",l),B=!1}}async function G(){if(!(t!=null&&t.authenticated&&g))try{const l=await fetch("/api/auth/user",{credentials:"include"});if(l.ok){const w=await l.json();if(w.authenticated){n(0,g=!0);const h=w.user_info,S=h.name||h.fullname||h.login||h.username||"User";n(1,A=S.split(" ")[0])}else n(0,g=!1),n(1,A="")}else n(0,g=!1),n(1,A="")}catch{n(0,g=!1),n(1,A="")}}async function x(){if(g){try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch(l){console.error("Logout error:",l)}sessionStorage.removeItem("oauth_state"),n(0,g=!1),n(1,A=""),window.location.reload()}else try{const w=await(await fetch("/api/auth/oauth-config")).json(),h=w.scopes||"inference-api";let S=window.location.origin+"/auth/callback";window.location.hostname==="localhost"&&window.location.port==="11111"&&(S="http://localhost:7860/auth/callback");const V=window.location.pathname,L=`https://huggingface.co/oauth/authorize?client_id=${w.client_id}&redirect_uri=${encodeURIComponent(S)}&scope=${encodeURIComponent(h)}&response_type=code&state=${encodeURIComponent(V)}`;window.location.href=L}catch{n(2,_=!0),n(3,C=""),n(4,M="")}}function O(){n(2,_=!1),n(3,C=""),n(4,M="")}async function D(){if(!C.trim()){n(4,M="Please enter a token");return}if(!C.startsWith("hf_")){n(4,M='Token should start with "hf_"');return}try{const l=await fetch("https://huggingface.co/api/whoami-v2",{headers:{Authorization:`Bearer ${C.trim()}`}});if(l.ok){const w=await l.json(),h=C.trim();try{const S=await fetch("/api/auth/manual-token",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:h})});if(S.ok){const V=await S.json();n(0,g=!0);const L=V.user_info,T=L.name||L.fullname||L.login||L.username||"User";n(1,A=T.split(" ")[0]),O()}else{const V=await S.json();n(4,M=V.detail||"Token validation failed")}}catch{n(4,M="Failed to validate token. Please try again.")}}else n(4,M=`Invalid token (${l.status}). Please check your token and try again.`)}catch{n(4,M="Error validating token. Please try again.")}}function I(){C=this.value,n(3,C)}const P=l=>l.key==="Enter"&&D();return f.$$set=l=>{"$$scope"in l&&n(11,z=l.$$scope)},[g,A,_,C,M,W,b,d,x,O,D,z,H,I,P]}class Ht extends at{constructor(r){super(),ot(this,r,Tt,wt,rt,{})}}export{Ht as component};
|
hfstudio/static/_app/immutable/nodes/1.BthlwIjN.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{S as x,i as S,s as j,n as u,d as c,a as h,b as _,c as d,e as v,f as g,g as b,h as k,j as E,t as $,k as q,l as y}from"../chunks/BaOlNwUz.js";import"../chunks/IHki7fMi.js";import{p as C}from"../chunks/IhvhdSp7.js";function H(p){var f;let a,s=p[0].status+"",r,n,o,i=((f=p[0].error)==null?void 0:f.message)+"",m;return{c(){a=E("h1"),r=$(s),n=q(),o=E("p"),m=$(i)},l(e){a=v(e,"H1",{});var t=g(a);r=b(t,s),t.forEach(c),n=k(e),o=v(e,"P",{});var l=g(o);m=b(l,i),l.forEach(c)},m(e,t){_(e,a,t),d(a,r),_(e,n,t),_(e,o,t),d(o,m)},p(e,[t]){var l;t&1&&s!==(s=e[0].status+"")&&h(r,s),t&1&&i!==(i=((l=e[0].error)==null?void 0:l.message)+"")&&h(m,i)},i:u,o:u,d(e){e&&(c(a),c(n),c(o))}}}function P(p,a,s){let r;return y(p,C,n=>s(0,r=n)),[r]}class B extends x{constructor(a){super(),S(this,a,P,H,j,{})}}export{B as component};
|
hfstudio/static/_app/immutable/nodes/2.DxBLT2JT.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as gs,i as _s,s as Ol,u as cr,v as fe,w as T,x as k,y as pe,z as he,A as me,B as Qr,C as vs,D as ys,E as ws,F as xs,d as c,M as bs,G as ml,a as et,O as dl,H as dt,p as o,b as A,c as n,m as L,I as ks,h as _,e as u,f as p,r as W,g as Y,J as Ht,k as b,j as d,t as q,K as Es,N as ft,n as Nt,P as dr,Q as fr,L as ur,R as Wr,T as Ts,q as Zr}from"../chunks/BaOlNwUz.js";import{C as ir,g as Cs,P as Mt,D as $s}from"../chunks/Dj_MM6zE.js";import{I as Is,g as Ds,a as Vs,e as Sl}from"../chunks/C7BncMoR.js";import"../chunks/IHki7fMi.js";import{S as Ls,L as Ps,A as Ms,X as Ns}from"../chunks/BV8rDFhh.js";import{a as pl,P as Al}from"../chunks/Bm0csYZC.js";function Hs(s){let e;const t=s[2].default,l=vs(t,s,s[3],null);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,a){l&&l.m(r,a),e=!0},p(r,a){l&&l.p&&(!e||a&8)&&ys(l,t,r,r[3],e?xs(t,r[3],a,null):ws(r[3]),null)},i(r){e||(k(l,r),e=!0)},o(r){T(l,r),e=!1},d(r){l&&l.d(r)}}}function js(s){let e,t;const l=[{name:"chevron-down"},s[1],{iconNode:s[0]}];let r={$$slots:{default:[Hs]},$$scope:{ctx:s}};for(let a=0;a<l.length;a+=1)r=cr(r,l[a]);return e=new Is({props:r}),{c(){me(e.$$.fragment)},l(a){he(e.$$.fragment,a)},m(a,i){pe(e,a,i),t=!0},p(a,[i]){const h=i&3?Ds(l,[l[0],i&2&&Vs(a[1]),i&1&&{iconNode:a[0]}]):{};i&8&&(h.$$scope={dirty:i,ctx:a}),e.$set(h)},i(a){t||(k(e.$$.fragment,a),t=!0)},o(a){T(e.$$.fragment,a),t=!1},d(a){fe(e,a)}}}function Os(s,e,t){let{$$slots:l={},$$scope:r}=e;const a=[["path",{d:"m6 9 6 6 6-6"}]];return s.$$set=i=>{t(1,e=cr(cr({},e),Qr(i))),"$$scope"in i&&t(3,r=i.$$scope)},e=Qr(e),[a,e,l,r]}class Ss extends gs{constructor(e){super(),_s(this,e,Os,js,Ol,{})}}const{document:es}=Cs;function ts(s,e,t){const l=s.slice();return l[75]=e[t],l}function ls(s,e,t){const l=s.slice();return l[75]=e[t],l}function As(s){let e,t,l;return e=new pl({props:{size:16}}),{c(){me(e.$$.fragment),t=q(`
|
| 2 |
+
Generate speech`)},l(r){he(e.$$.fragment,r),t=Y(r,`
|
| 3 |
+
Generate speech`)},m(r,a){pe(e,r,a),A(r,t,a),l=!0},i(r){l||(k(e.$$.fragment,r),l=!0)},o(r){T(e.$$.fragment,r),l=!1},d(r){r&&c(t),fe(e,r)}}}function Us(s){let e,t,l;return e=new Ps({props:{size:16,class:"animate-spin"}}),{c(){me(e.$$.fragment),t=q(`
|
| 4 |
+
Generating...`)},l(r){he(e.$$.fragment,r),t=Y(r,`
|
| 5 |
+
Generating...`)},m(r,a){pe(e,r,a),A(r,t,a),l=!0},i(r){l||(k(e.$$.fragment,r),l=!0)},o(r){T(e.$$.fragment,r),l=!1},d(r){r&&c(t),fe(e,r)}}}function rs(s){let e=s[75].name+"",t,l,r=s[75].badge&&zs(s);return{c(){t=q(e),r&&r.c(),l=Ht()},l(a){t=Y(a,e),r&&r.l(a),l=Ht()},m(a,i){A(a,t,i),r&&r.m(a,i),A(a,l,i)},p(a,i){a[75].badge&&r.p(a,i)},d(a){a&&(c(t),c(l)),r&&r.d(a)}}}function zs(s){let e,t,l,r=s[75].badge+"",a,i;return{c(){e=q("Β "),t=d("span"),l=q("("),a=q(r),i=q(")"),this.h()},l(h){e=Y(h,"Β "),t=u(h,"SPAN",{class:!0});var g=p(t);l=Y(g,"("),a=Y(g,r),i=Y(g,")"),g.forEach(c),this.h()},h(){o(t,"class","text-sm text-gray-500")},m(h,g){A(h,e,g),A(h,t,g),n(t,l),n(t,a),n(t,i)},p:Nt,d(h){h&&(c(e),c(t))}}}function ss(s){let e,t=s[75].name===s[2]&&rs(s);return{c(){t&&t.c(),e=Ht()},l(l){t&&t.l(l),e=Ht()},m(l,r){t&&t.m(l,r),A(l,e,r)},p(l,r){l[75].name===l[2]?t?t.p(l,r):(t=rs(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(l){l&&c(e),t&&t.d(l)}}}function ns(s){let e,t=Sl(s[25]),l=[];for(let r=0;r<t.length;r+=1)l[r]=os(ts(s,t,r));return{c(){e=d("div");for(let r=0;r<l.length;r+=1)l[r].c();this.h()},l(r){e=u(r,"DIV",{class:!0});var a=p(e);for(let i=0;i<l.length;i+=1)l[i].l(a);a.forEach(c),this.h()},h(){o(e,"class","absolute top-full left-0 right-0 border border-gray-200 border-t-0 bg-white shadow-lg rounded-b-lg overflow-hidden z-20")},m(r,a){A(r,e,a);for(let i=0;i<l.length;i+=1)l[i]&&l[i].m(e,null)},p(r,a){if(a[0]&33554692){t=Sl(r[25]);let i;for(i=0;i<t.length;i+=1){const h=ts(r,t,i);l[i]?l[i].p(h,a):(l[i]=os(h),l[i].c(),l[i].m(e,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=t.length}},d(r){r&&c(e),bs(l,r)}}}function Bs(s){let e,t,l,r=s[75].badge+"",a,i;return{c(){e=q("Β "),t=d("span"),l=q("("),a=q(r),i=q(")"),this.h()},l(h){e=Y(h,"Β "),t=u(h,"SPAN",{class:!0});var g=p(t);l=Y(g,"("),a=Y(g,r),i=Y(g,")"),g.forEach(c),this.h()},h(){o(t,"class","text-sm text-gray-500")},m(h,g){A(h,e,g),A(h,t,g),n(t,l),n(t,a),n(t,i)},p:Nt,d(h){h&&(c(e),c(t))}}}function os(s){let e,t=s[75].name+"",l,r,a,i,h,g=s[75].badge&&Bs(s);function E(){return s[43](s[75])}return{c(){e=d("button"),l=q(t),g&&g.c(),r=b(),this.h()},l(y){e=u(y,"BUTTON",{class:!0});var v=p(e);l=Y(v,t),g&&g.l(v),r=_(v),v.forEach(c),this.h()},h(){o(e,"class",a="w-full px-3 py-2.5 text-left transition-colors text-sm "+(s[75].disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50")+" "+(s[75].name===s[2]?"bg-gray-100":"")),e.disabled=s[75].disabled},m(y,v){A(y,e,v),n(e,l),g&&g.m(e,null),n(e,r),i||(h=L(e,"click",E),i=!0)},p(y,v){s=y,s[75].badge&&g.p(s,v),v[0]&4&&a!==(a="w-full px-3 py-2.5 text-left transition-colors text-sm "+(s[75].disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50")+" "+(s[75].name===s[2]?"bg-gray-100":""))&&o(e,"class",a)},d(y){y&&c(e),g&&g.d(),i=!1,h()}}}function Rs(s){let e,t;return e=new pl({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Gs(s){let e,t;return e=new Al({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Fs(s){let e,t;return e=new pl({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Ys(s){let e,t;return e=new Al({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function qs(s){let e,t;return e=new pl({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Ks(s){let e,t;return e=new Al({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Js(s){let e,t='<div class="flex items-center justify-between mb-1"><div class="flex items-center gap-2"><div class="w-6 h-6 bg-gradient-to-br from-purple-400 to-pink-500 rounded-full flex items-center justify-center text-white text-xs font-semibold">π€</div> <span class="text-xs font-medium text-purple-900">Clone your voice</span></div> <div class="w-5 h-5 flex items-center justify-center"><svg class="w-3 h-3 text-purple-600" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></div></div>';return{c(){e=d("a"),e.innerHTML=t,this.h()},l(l){e=u(l,"A",{href:!0,class:!0,"data-svelte-h":!0}),W(e)!=="svelte-aczm6q"&&(e.innerHTML=t),this.h()},h(){o(e,"href","/voice-cloning"),o(e,"class","p-3 border border-purple-200 rounded-lg transition-colors text-left hover:bg-purple-50 bg-purple-25")},m(l,r){A(l,e,r)},p:Nt,i:Nt,o:Nt,d(l){l&&c(e)}}}function Xs(s){let e,t,l,r='<div class="w-6 h-6 bg-gradient-to-br from-purple-400 to-pink-500 rounded-full flex items-center justify-center text-white text-xs">π€</div> <span class="text-xs font-medium">Your cloned voice</span>',a,i,h,g,E,y,v,$;const G=[Ws,Qs],J=[];function U(w,C){return w[17]==="Yours"?0:1}return h=U(s),g=J[h]=G[h](s),{c(){e=d("button"),t=d("div"),l=d("div"),l.innerHTML=r,a=b(),i=d("button"),g.c(),this.h()},l(w){e=u(w,"BUTTON",{class:!0});var C=p(e);t=u(C,"DIV",{class:!0});var I=p(t);l=u(I,"DIV",{class:!0,"data-svelte-h":!0}),W(l)!=="svelte-1ixcco1"&&(l.innerHTML=r),a=_(I),i=u(I,"BUTTON",{class:!0,title:!0});var X=p(i);g.l(X),X.forEach(c),I.forEach(c),C.forEach(c),this.h()},h(){o(l,"class","flex items-center gap-2"),o(i,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(i,"title","Play sample"),o(t,"class","flex items-center justify-between mb-1"),o(e,"class",E="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Yours"?"border-purple-400 bg-purple-50":"border-gray-200"))},m(w,C){A(w,e,C),n(e,t),n(t,l),n(t,a),n(t,i),J[h].m(i,null),y=!0,v||($=[L(i,"click",s[50]),L(e,"click",s[51])],v=!0)},p(w,C){let I=h;h=U(w),h!==I&&(ft(),T(J[I],1,1,()=>{J[I]=null}),dt(),g=J[h],g||(g=J[h]=G[h](w),g.c()),k(g,1),g.m(i,null)),(!y||C[0]&2&&E!==(E="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(w[1]==="Yours"?"border-purple-400 bg-purple-50":"border-gray-200")))&&o(e,"class",E)},i(w){y||(k(g),y=!0)},o(w){T(g),y=!1},d(w){w&&c(e),J[h].d(),v=!1,ml($)}}}function Qs(s){let e,t;return e=new pl({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function Ws(s){let e,t;return e=new Al({props:{size:10,class:"text-gray-600"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function as(s){let e,t,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>',r,a,i='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>',h,g,E=`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
|
| 6 |
+
additional pay-as-you-go usage ‴`,y,v;return{c(){e=d("div"),t=d("button"),t.innerHTML=l,r=b(),a=d("p"),a.innerHTML=i,h=b(),g=d("p"),g.innerHTML=E,this.h()},l($){e=u($,"DIV",{class:!0});var G=p(e);t=u(G,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),W(t)!=="svelte-9gdgq5"&&(t.innerHTML=l),r=_(G),a=u(G,"P",{class:!0,"data-svelte-h":!0}),W(a)!=="svelte-1q58z3k"&&(a.innerHTML=i),h=_(G),g=u(G,"P",{class:!0,"data-svelte-h":!0}),W(g)!=="svelte-dysk74"&&(g.innerHTML=E),G.forEach(c),this.h()},h(){o(t,"class","absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"),o(t,"aria-label","Dismiss"),o(a,"class","text-sm font-medium text-gray-700 mb-1 pr-4"),o(g,"class","text-sm text-gray-600 pr-4"),o(e,"class","mb-4 px-3 py-2 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg border border-amber-200 relative")},m($,G){A($,e,G),n(e,t),n(e,r),n(e,a),n(e,h),n(e,g),y||(v=L(t,"click",s[54]),y=!0)},p:Nt,d($){$&&c(e),y=!1,v()}}}function is(s){let e,t,l,r=Mt.highlight(s[23],Mt.languages.bash,"bash")+"";return{c(){e=d("pre"),t=d("code"),l=new fr(!1),this.h()},l(a){e=u(a,"PRE",{class:!0});var i=p(e);t=u(i,"CODE",{class:!0});var h=p(t);l=dr(h,!1),h.forEach(c),i.forEach(c),this.h()},h(){l.a=null,o(t,"class","language-bash"),o(e,"class","p-3 overflow-x-auto bg-gray-50 text-xs")},m(a,i){A(a,e,i),n(e,t),l.m(r,t)},p(a,i){i[0]&8388608&&r!==(r=Mt.highlight(a[23],Mt.languages.bash,"bash")+"")&&l.p(r)},d(a){a&&c(e)}}}function cs(s){let e,t,l,r=Mt.highlight(s[24],Mt.languages.python,"python")+"";return{c(){e=d("pre"),t=d("code"),l=new fr(!1),this.h()},l(a){e=u(a,"PRE",{class:!0});var i=p(e);t=u(i,"CODE",{class:!0});var h=p(t);l=dr(h,!1),h.forEach(c),i.forEach(c),this.h()},h(){l.a=null,o(t,"class","language-python"),o(e,"class","p-3 overflow-x-auto bg-gray-50 text-xs")},m(a,i){A(a,e,i),n(e,t),l.m(r,t)},p(a,i){i[0]&16777216&&r!==(r=Mt.highlight(a[24],Mt.languages.python,"python")+"")&&l.p(r)},d(a){a&&c(e)}}}function us(s){let e,t,l,r,a,i,h="Generated Audio",g,E,y,v,$,G="Download",J,U,w,C,I,X,z,ae,Z,D,te,be=fl(s[14])+"",B,M,V,N,F,le,De,K,ee,ge=fl(s[13])+"",Ne,ve,He,je,tt,xe,Ve=fl(s[14])+"",Ke,Oe,se,pt,ht,H=s[11]>0&&s[6]!=="local"&&ds(s);U=new $s({props:{size:12,class:"text-green-600"}});const Le=[en,Zs],_e=[];function Be(P,j){return P[12]?0:1}F=Be(s),le=_e[F]=Le[F](s);let ne=s[10]&&fs(s);return{c(){e=d("div"),t=d("div"),l=d("div"),r=d("div"),a=b(),i=d("span"),i.textContent=h,g=b(),H&&H.c(),E=b(),y=d("div"),v=d("button"),$=d("span"),$.textContent=G,J=b(),me(U.$$.fragment),w=b(),C=d("div"),I=d("div"),X=d("h4"),z=q(s[15]),ae=b(),Z=d("p"),D=q(s[1]),te=q(" β’ "),B=q(be),M=b(),V=d("div"),N=d("button"),le.c(),De=b(),K=d("div"),ee=d("span"),Ne=q(ge),ve=b(),He=d("div"),je=d("div"),tt=b(),xe=d("span"),Ke=q(Ve),Oe=b(),ne&&ne.c(),this.h()},l(P){e=u(P,"DIV",{class:!0});var j=p(e);t=u(j,"DIV",{class:!0});var re=p(t);l=u(re,"DIV",{class:!0});var ie=p(l);r=u(ie,"DIV",{class:!0}),p(r).forEach(c),a=_(ie),i=u(ie,"SPAN",{class:!0,"data-svelte-h":!0}),W(i)!=="svelte-1hz7jl7"&&(i.textContent=h),g=_(ie),H&&H.l(ie),ie.forEach(c),E=_(re),y=u(re,"DIV",{class:!0});var lt=p(y);v=u(lt,"BUTTON",{class:!0,title:!0});var Je=p(v);$=u(Je,"SPAN",{class:!0,"data-svelte-h":!0}),W($)!=="svelte-kkuif9"&&($.textContent=G),J=_(Je),he(U.$$.fragment,Je),Je.forEach(c),lt.forEach(c),re.forEach(c),w=_(j),C=u(j,"DIV",{class:!0});var ye=p(C);I=u(ye,"DIV",{class:!0});var $e=p(I);X=u($e,"H4",{class:!0});var Re=p(X);z=Y(Re,s[15]),Re.forEach(c),ae=_($e),Z=u($e,"P",{class:!0});var rt=p(Z);D=Y(rt,s[1]),te=Y(rt," β’ "),B=Y(rt,be),rt.forEach(c),$e.forEach(c),M=_(ye),V=u(ye,"DIV",{class:!0});var Xe=p(V);N=u(Xe,"BUTTON",{class:!0});var Pe=p(N);le.l(Pe),Pe.forEach(c),De=_(Xe),K=u(Xe,"DIV",{class:!0});var ce=p(K);ee=u(ce,"SPAN",{class:!0});var ke=p(ee);Ne=Y(ke,ge),ke.forEach(c),ve=_(ce),He=u(ce,"DIV",{class:!0});var st=p(He);je=u(st,"DIV",{class:!0,style:!0}),p(je).forEach(c),st.forEach(c),tt=_(ce),xe=u(ce,"SPAN",{class:!0});var mt=p(xe);Ke=Y(mt,Ve),mt.forEach(c),ce.forEach(c),Xe.forEach(c),Oe=_(ye),ne&&ne.l(ye),ye.forEach(c),j.forEach(c),this.h()},h(){o(r,"class","w-1.5 h-1.5 bg-green-500 rounded-full"),o(i,"class","text-xs font-medium text-green-900"),o(l,"class","flex items-center gap-2"),o($,"class","text-xs text-green-700"),o(v,"class","flex items-center gap-1 px-2 py-1 hover:bg-green-100 rounded transition-colors"),o(v,"title","Download audio"),o(y,"class","flex items-center gap-1"),o(t,"class","flex items-center justify-between px-3 py-2 bg-green-50 border-b border-green-200"),o(X,"class","font-medium text-gray-900 text-xs"),o(Z,"class","text-xs text-gray-500"),o(I,"class","mb-3"),o(N,"class","w-6 h-6 bg-black rounded-full flex items-center justify-center hover:bg-gray-800 transition-colors flex-shrink-0"),o(ee,"class","text-xs text-gray-500 font-mono"),o(je,"class","h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all"),ur(je,"width",s[13]/s[14]*100+"%"),o(He,"class","flex-1 h-1 bg-gray-200 rounded-full cursor-pointer"),o(xe,"class","text-xs text-gray-500 font-mono"),o(K,"class","flex-1 flex items-center gap-1"),o(V,"class","flex items-center gap-2"),o(C,"class","p-3"),o(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden mt-4")},m(P,j){A(P,e,j),n(e,t),n(t,l),n(l,r),n(l,a),n(l,i),n(l,g),H&&H.m(l,null),n(t,E),n(t,y),n(y,v),n(v,$),n(v,J),pe(U,v,null),n(e,w),n(e,C),n(C,I),n(I,X),n(X,z),n(I,ae),n(I,Z),n(Z,D),n(Z,te),n(Z,B),n(C,M),n(C,V),n(V,N),_e[F].m(N,null),n(V,De),n(V,K),n(K,ee),n(ee,Ne),n(K,ve),n(K,He),n(He,je),n(K,tt),n(K,xe),n(xe,Ke),n(C,Oe),ne&&ne.m(C,null),se=!0,pt||(ht=[L(v,"click",s[32]),L(N,"click",s[27])],pt=!0)},p(P,j){P[11]>0&&P[6]!=="local"?H?H.p(P,j):(H=ds(P),H.c(),H.m(l,null)):H&&(H.d(1),H=null),(!se||j[0]&32768)&&et(z,P[15]),(!se||j[0]&2)&&et(D,P[1]),(!se||j[0]&16384)&&be!==(be=fl(P[14])+"")&&et(B,be);let re=F;F=Be(P),F!==re&&(ft(),T(_e[re],1,1,()=>{_e[re]=null}),dt(),le=_e[F],le||(le=_e[F]=Le[F](P),le.c()),k(le,1),le.m(N,null)),(!se||j[0]&8192)&&ge!==(ge=fl(P[13])+"")&&et(Ne,ge),(!se||j[0]&24576)&&ur(je,"width",P[13]/P[14]*100+"%"),(!se||j[0]&16384)&&Ve!==(Ve=fl(P[14])+"")&&et(Ke,Ve),P[10]?ne?ne.p(P,j):(ne=fs(P),ne.c(),ne.m(C,null)):ne&&(ne.d(1),ne=null)},i(P){se||(k(U.$$.fragment,P),k(le),se=!0)},o(P){T(U.$$.fragment,P),T(le),se=!1},d(P){P&&c(e),H&&H.d(),fe(U),_e[F].d(),ne&&ne.d(),pt=!1,ml(ht)}}}function ds(s){let e,t,l=s[11].toFixed(1)+"",r,a;return{c(){e=d("span"),t=q("(took "),r=q(l),a=q("s)"),this.h()},l(i){e=u(i,"SPAN",{class:!0});var h=p(e);t=Y(h,"(took "),r=Y(h,l),a=Y(h,"s)"),h.forEach(c),this.h()},h(){o(e,"class","text-xs text-green-700")},m(i,h){A(i,e,h),n(e,t),n(e,r),n(e,a)},p(i,h){h[0]&2048&&l!==(l=i[11].toFixed(1)+"")&&et(r,l)},d(i){i&&c(e)}}}function Zs(s){let e,t;return e=new pl({props:{size:10,class:"text-white ml-0.5"}}),{c(){me(e.$$.fragment)},l(l){he(e.$$.fragment,l)},m(l,r){pe(e,l,r),t=!0},i(l){t||(k(e.$$.fragment,l),t=!0)},o(l){T(e.$$.fragment,l),t=!1},d(l){fe(e,l)}}}function en(s){let e;return{c(){e=d("div"),this.h()},l(t){e=u(t,"DIV",{class:!0}),p(e).forEach(c),this.h()},h(){o(e,"class","pause-filled text-white text-xs svelte-13ak1iw")},m(t,l){A(t,e,l)},i:Nt,o:Nt,d(t){t&&c(e)}}}function fs(s){let e,t,l,r;return{c(){e=d("audio"),this.h()},l(a){e=u(a,"AUDIO",{src:!0,style:!0}),p(e).forEach(c),this.h()},h(){Zr(e.src,t=s[10])||o(e,"src",t),ur(e,"display","none")},m(a,i){A(a,e,i),s[59](e),l||(r=[L(e,"loadedmetadata",s[28]),L(e,"timeupdate",s[29]),L(e,"play",s[30]),L(e,"pause",s[31])],l=!0)},p(a,i){i[0]&1024&&!Zr(e.src,t=a[10])&&o(e,"src",t)},d(a){a&&c(e),s[59](null),l=!1,ml(r)}}}function ps(s){let e,t,l,r,a,i,h,g,E,y,v,$,G="An error occurred while processing your request",J,U,w,C,I,X,z,ae,Z="Close",D,te,be;i=new Ms({props:{size:20,class:"text-red-600"}}),w=new Ns({props:{size:20,class:"text-gray-500"}});let B=s[20]&&hs(s);return{c(){e=d("div"),t=d("div"),l=d("div"),r=d("div"),a=d("div"),me(i.$$.fragment),h=b(),g=d("div"),E=d("h3"),y=q(s[19]),v=b(),$=d("p"),$.textContent=G,J=b(),U=d("button"),me(w.$$.fragment),C=b(),I=d("div"),B&&B.c(),X=b(),z=d("div"),ae=d("button"),ae.textContent=Z,this.h()},l(M){e=u(M,"DIV",{class:!0});var V=p(e);t=u(V,"DIV",{class:!0});var N=p(t);l=u(N,"DIV",{class:!0});var F=p(l);r=u(F,"DIV",{class:!0});var le=p(r);a=u(le,"DIV",{class:!0});var De=p(a);he(i.$$.fragment,De),De.forEach(c),h=_(le),g=u(le,"DIV",{class:!0});var K=p(g);E=u(K,"H3",{class:!0});var ee=p(E);y=Y(ee,s[19]),ee.forEach(c),v=_(K),$=u(K,"P",{class:!0,"data-svelte-h":!0}),W($)!=="svelte-1l3zl3"&&($.textContent=G),K.forEach(c),le.forEach(c),J=_(F),U=u(F,"BUTTON",{class:!0,title:!0});var ge=p(U);he(w.$$.fragment,ge),ge.forEach(c),F.forEach(c),C=_(N),I=u(N,"DIV",{class:!0});var Ne=p(I);B&&B.l(Ne),Ne.forEach(c),X=_(N),z=u(N,"DIV",{class:!0});var ve=p(z);ae=u(ve,"BUTTON",{class:!0,"data-svelte-h":!0}),W(ae)!=="svelte-4sxk6g"&&(ae.textContent=Z),ve.forEach(c),N.forEach(c),V.forEach(c),this.h()},h(){o(a,"class","w-10 h-10 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0"),o(E,"class","text-lg font-semibold text-gray-900 truncate"),o($,"class","text-sm text-gray-600"),o(g,"class","min-w-0"),o(r,"class","flex items-center gap-3 min-w-0"),o(U,"class","p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"),o(U,"title","Close"),o(l,"class","flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0"),o(I,"class","p-6 overflow-y-auto flex-1 min-h-0"),o(ae,"class","px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"),o(z,"class","flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0"),o(t,"class","bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] flex flex-col"),o(e,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4")},m(M,V){A(M,e,V),n(e,t),n(t,l),n(l,r),n(r,a),pe(i,a,null),n(r,h),n(r,g),n(g,E),n(E,y),n(g,v),n(g,$),n(l,J),n(l,U),pe(w,U,null),n(t,C),n(t,I),B&&B.m(I,null),n(t,X),n(t,z),n(z,ae),D=!0,te||(be=[L(U,"click",s[36]),L(ae,"click",s[36])],te=!0)},p(M,V){(!D||V[0]&524288)&&et(y,M[19]),M[20]?B?B.p(M,V):(B=hs(M),B.c(),B.m(I,null)):B&&(B.d(1),B=null)},i(M){D||(k(i.$$.fragment,M),k(w.$$.fragment,M),D=!0)},o(M){T(i.$$.fragment,M),T(w.$$.fragment,M),D=!1},d(M){M&&c(e),fe(i),fe(w),B&&B.d(),te=!1,ml(be)}}}function hs(s){let e,t,l="Error Details:",r,a,i;function h(y,v){return v[0]&1048576&&(i=null),i==null&&(i=!!y[20].includes("exceeded your monthly included credits")),i?ln:tn}let g=h(s,[-1,-1,-1]),E=g(s);return{c(){e=d("div"),t=d("h4"),t.textContent=l,r=b(),a=d("pre"),E.c(),this.h()},l(y){e=u(y,"DIV",{class:!0});var v=p(e);t=u(v,"H4",{class:!0,"data-svelte-h":!0}),W(t)!=="svelte-3lmggt"&&(t.textContent=l),r=_(v),a=u(v,"PRE",{class:!0});var $=p(a);E.l($),$.forEach(c),v.forEach(c),this.h()},h(){o(t,"class","text-sm font-medium text-gray-900 mb-2"),o(a,"class","text-xs text-gray-700 whitespace-pre-wrap font-mono leading-relaxed break-words"),o(e,"class","bg-gray-50 rounded-lg p-4 border")},m(y,v){A(y,e,v),n(e,t),n(e,r),n(e,a),E.m(a,null)},p(y,v){g===(g=h(y,v))&&E?E.p(y,v):(E.d(1),E=g(y),E&&(E.c(),E.m(a,null)))},d(y){y&&c(e),E.d()}}}function tn(s){let e;return{c(){e=q(s[20])},l(t){e=Y(t,s[20])},m(t,l){A(t,e,l)},p(t,l){l[0]&1048576&&et(e,t[20])},d(t){t&&c(e)}}}function ln(s){let e,t=s[20].replace("Subscribe to PRO",'<a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">Subscribe to PRO</a>')+"",l;return{c(){e=new fr(!1),l=Ht(),this.h()},l(r){e=dr(r,!1),l=Ht(),this.h()},h(){e.a=l},m(r,a){e.m(t,r,a),A(r,l,a)},p(r,a){a[0]&1048576&&t!==(t=r[20].replace("Subscribe to PRO",'<a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline font-medium">Subscribe to PRO</a>')+"")&&e.p(t)},d(r){r&&(c(l),e.d())}}}function ms(s){let e,t;return{c(){e=d("div"),t=q(s[22]),this.h()},l(l){e=u(l,"DIV",{class:!0});var r=p(e);t=Y(r,s[22]),r.forEach(c),this.h()},h(){o(e,"class","fixed bottom-4 right-4 px-4 py-2 bg-gray-900 text-white rounded-lg shadow-lg z-50 animate-fade-in svelte-13ak1iw")},m(l,r){A(l,e,r),n(e,t)},p(l,r){r[0]&4194304&&et(t,l[22])},d(l){l&&c(e)}}}function rn(s){let e,t,l,r,a,i,h,g="Text to speak",E,y,v,$,G,J,U=s[0].length.toLocaleString()+"",w,C,I,X,z,ae,Z,D,te,be,B,M,V,N,F,le="Model",De,K,ee,ge,Ne,ve,He,je,tt,xe,Ve='~$0.025 per generation β’ <a href="https://huggingface.co/settings/billing" target="_blank" class="text-amber-600 hover:text-amber-700 underline">Billing ‴</a>',Ke,Oe,se,pt="Voice",ht,H,Le,_e,Be,ne='<div class="w-6 h-6 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-xs font-semibold">A</div> <span class="text-sm font-medium">Andrew</span>',P,j,re,ie,lt,Je,ye,$e,Re,rt='<div class="w-6 h-6 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-xs font-semibold">L</div> <span class="text-sm font-medium">Lily</span>',Xe,Pe,ce,ke,st,mt,Qe,We,nt,gl='<div class="w-6 h-6 bg-gradient-to-br from-amber-400 to-orange-500 rounded-full flex items-center justify-center text-white text-xs font-semibold">P</div> <span class="text-sm font-medium">Pirate</span>',hl,Fe,Se,m,Q,oe,R,O,S,Me,ot,jt,pr='<label for="exaggeration-slider" class="text-sm font-medium text-gray-900">Exaggeration</label>',Ul,Ae,zl,Ot,hr="<span>None</span> <span>More</span>",Bl,at,St,mr='<label for="temperature-slider" class="text-sm font-medium text-gray-900">Stability</label>',Rl,Ue,Gl,At,gr="<span>More stable</span> <span>More variable</span>",Fl,el,ze,_l,Ut,_r='<h3 class="text-lg font-semibold text-gray-900 mb-1">Results & Live Documentation</h3> <p class="text-sm text-gray-600">The code below will update as you adjust the UI β¨</p>',Yl,gt,_t,bt,ql,bl,Kl,vt,Jl,vl,Xl,yt,it,zt,Ql,Bt,br="Copy all",Wl,wt,vr='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="text-amber-700"><path d="M12 2L2 7l10 5 10-5-10-5z"></path><path d="M2 17l10 5 10-5"></path><path d="M2 12l10 5 10-5"></path></svg> <span class="ml-1 text-xs font-medium text-amber-700">Deploy as Space</span>',Zl,Ye,xt,kt,Rt,yr='<span class="text-xs font-medium text-blue-900">Install in Terminal</span>',er,Et,Gt,tr,Ft,wr=s[7],lr,Tt,Ct,Yt,xr='<span class="text-xs font-medium text-amber-900">Python Code</span> <span class="text-xs bg-amber-100 text-amber-700 px-1.5 py-0.5 rounded">Live</span>',rr,$t,qt,sr,Kt,kr=s[7],nr,yl,tl,ll,Ge,or,Er;v=new Ls({props:{size:16}});const Tr=[Us,As],Jt=[];function Cr(f,x){return f[9]?0:1}D=Cr(s),te=Jt[D]=Tr[D](s);let rl=Sl(s[25]),we=[];for(let f=0;f<rl.length;f+=1)we[f]=ss(ls(s,rl,f));ve=new Ss({props:{size:14,class:"text-gray-500 transition-transform "+(s[8]?"rotate-180":"")}});let Ee=s[8]&&ns(s);const $r=[Gs,Rs],Xt=[];function Ir(f,x){return f[17]==="Andrew"?0:1}re=Ir(s),ie=Xt[re]=$r[re](s);const Dr=[Ys,Fs],Qt=[];function Vr(f,x){return f[17]==="Lily"?0:1}ce=Vr(s),ke=Qt[ce]=Dr[ce](s);const Lr=[Ks,qs],Wt=[];function Pr(f,x){return f[17]==="Pirate"?0:1}Se=Pr(s),m=Wt[Se]=Lr[Se](s);const Mr=[Xs,Js],It=[];function Nr(f,x){return f[5].length>0?0:1}R=Nr(s),O=It[R]=Mr[R](s);let Te=s[21]&&as(s);zt=new ir({props:{size:12,class:"text-gray-600"}}),Gt=new ir({props:{size:12,class:"text-blue-600"}});let ct=is(s);qt=new ir({props:{size:12,class:"text-amber-600"}});let ut=cs(s),ue=s[10]&&us(s),de=s[18]&&ps(s),Ce=s[22]&&ms(s);return{c(){e=b(),t=d("div"),l=d("div"),r=d("div"),a=d("div"),i=d("div"),h=d("span"),h.textContent=g,E=b(),y=d("button"),me(v.$$.fragment),$=b(),G=d("div"),J=d("span"),w=q(U),C=q(" / 1,000 characters"),I=b(),X=d("div"),z=d("textarea"),ae=b(),Z=d("button"),te.c(),B=b(),M=d("div"),V=d("div"),N=d("div"),F=d("h3"),F.textContent=le,De=b(),K=d("div"),ee=d("button"),ge=d("span");for(let f=0;f<we.length;f+=1)we[f].c();Ne=b(),me(ve.$$.fragment),je=b(),Ee&&Ee.c(),tt=b(),xe=d("div"),xe.innerHTML=Ve,Ke=b(),Oe=d("div"),se=d("h3"),se.textContent=pt,ht=b(),H=d("div"),Le=d("button"),_e=d("div"),Be=d("div"),Be.innerHTML=ne,P=b(),j=d("button"),ie.c(),Je=b(),ye=d("button"),$e=d("div"),Re=d("div"),Re.innerHTML=rt,Xe=b(),Pe=d("button"),ke.c(),mt=b(),Qe=d("button"),We=d("div"),nt=d("div"),nt.innerHTML=gl,hl=b(),Fe=d("button"),m.c(),oe=b(),O.c(),S=b(),Me=d("div"),ot=d("div"),jt=d("div"),jt.innerHTML=pr,Ul=b(),Ae=d("input"),zl=b(),Ot=d("div"),Ot.innerHTML=hr,Bl=b(),at=d("div"),St=d("div"),St.innerHTML=mr,Rl=b(),Ue=d("input"),Gl=b(),At=d("div"),At.innerHTML=gr,Fl=b(),el=d("div"),ze=d("div"),Te&&Te.c(),_l=b(),Ut=d("div"),Ut.innerHTML=_r,Yl=b(),gt=d("div"),_t=d("div"),bt=d("button"),ql=q("API"),Kl=b(),vt=d("button"),Jl=q("Local"),Xl=b(),yt=d("div"),it=d("button"),me(zt.$$.fragment),Ql=b(),Bt=d("span"),Bt.textContent=br,Wl=b(),wt=d("button"),wt.innerHTML=vr,Zl=b(),Ye=d("div"),xt=d("div"),kt=d("div"),Rt=d("div"),Rt.innerHTML=yr,er=b(),Et=d("button"),me(Gt.$$.fragment),tr=b(),Ft=d("div"),ct.c(),lr=b(),Tt=d("div"),Ct=d("div"),Yt=d("div"),Yt.innerHTML=xr,rr=b(),$t=d("button"),me(qt.$$.fragment),sr=b(),Kt=d("div"),ut.c(),nr=b(),ue&&ue.c(),yl=b(),de&&de.c(),tl=b(),Ce&&Ce.c(),ll=Ht(),this.h()},l(f){ks("svelte-y100ki",es.head).forEach(c),e=_(f),t=u(f,"DIV",{class:!0,role:!0,tabindex:!0});var qe=p(t);l=u(qe,"DIV",{class:!0});var Zt=p(l);r=u(Zt,"DIV",{class:!0});var Dt=p(r);a=u(Dt,"DIV",{class:!0});var Ze=p(a);i=u(Ze,"DIV",{class:!0});var Vt=p(i);h=u(Vt,"SPAN",{class:!0,"data-svelte-h":!0}),W(h)!=="svelte-1da1nvl"&&(h.textContent=g),E=_(Vt),y=u(Vt,"BUTTON",{class:!0,title:!0});var sl=p(y);he(v.$$.fragment,sl),sl.forEach(c),Vt.forEach(c),$=_(Ze),G=u(Ze,"DIV",{class:!0});var Ie=p(G);J=u(Ie,"SPAN",{class:!0});var nl=p(J);w=Y(nl,U),C=Y(nl," / 1,000 characters"),nl.forEach(c),Ie.forEach(c),I=_(Ze),X=u(Ze,"DIV",{class:!0});var wl=p(X);z=u(wl,"TEXTAREA",{maxlength:!0,class:!0,placeholder:!0}),p(z).forEach(c),ae=_(wl),Z=u(wl,"BUTTON",{class:!0});var Hr=p(Z);te.l(Hr),Hr.forEach(c),wl.forEach(c),Ze.forEach(c),B=_(Dt),M=u(Dt,"DIV",{class:!0});var jr=p(M);V=u(jr,"DIV",{class:!0});var ol=p(V);N=u(ol,"DIV",{class:!0});var al=p(N);F=u(al,"H3",{class:!0,"data-svelte-h":!0}),W(F)!=="svelte-x9l5tw"&&(F.textContent=le),De=_(al),K=u(al,"DIV",{class:!0});var xl=p(K);ee=u(xl,"BUTTON",{class:!0});var kl=p(ee);ge=u(kl,"SPAN",{});var Or=p(ge);for(let ar=0;ar<we.length;ar+=1)we[ar].l(Or);Or.forEach(c),Ne=_(kl),he(ve.$$.fragment,kl),kl.forEach(c),je=_(xl),Ee&&Ee.l(xl),xl.forEach(c),tt=_(al),xe=u(al,"DIV",{class:!0,"data-svelte-h":!0}),W(xe)!=="svelte-m7murz"&&(xe.innerHTML=Ve),al.forEach(c),Ke=_(ol),Oe=u(ol,"DIV",{});var El=p(Oe);se=u(El,"H3",{class:!0,"data-svelte-h":!0}),W(se)!=="svelte-1pzzi7j"&&(se.textContent=pt),ht=_(El),H=u(El,"DIV",{class:!0});var Lt=p(H);Le=u(Lt,"BUTTON",{class:!0});var Sr=p(Le);_e=u(Sr,"DIV",{class:!0});var Tl=p(_e);Be=u(Tl,"DIV",{class:!0,"data-svelte-h":!0}),W(Be)!=="svelte-qsi6ww"&&(Be.innerHTML=ne),P=_(Tl),j=u(Tl,"BUTTON",{class:!0,title:!0});var Ar=p(j);ie.l(Ar),Ar.forEach(c),Tl.forEach(c),Sr.forEach(c),Je=_(Lt),ye=u(Lt,"BUTTON",{class:!0});var Ur=p(ye);$e=u(Ur,"DIV",{class:!0});var Cl=p($e);Re=u(Cl,"DIV",{class:!0,"data-svelte-h":!0}),W(Re)!=="svelte-1c7qu8y"&&(Re.innerHTML=rt),Xe=_(Cl),Pe=u(Cl,"BUTTON",{class:!0,title:!0});var zr=p(Pe);ke.l(zr),zr.forEach(c),Cl.forEach(c),Ur.forEach(c),mt=_(Lt),Qe=u(Lt,"BUTTON",{class:!0});var Br=p(Qe);We=u(Br,"DIV",{class:!0});var $l=p(We);nt=u($l,"DIV",{class:!0,"data-svelte-h":!0}),W(nt)!=="svelte-1o6w87n"&&(nt.innerHTML=gl),hl=_($l),Fe=u($l,"BUTTON",{class:!0,title:!0});var Rr=p(Fe);m.l(Rr),Rr.forEach(c),$l.forEach(c),Br.forEach(c),oe=_(Lt),O.l(Lt),Lt.forEach(c),El.forEach(c),S=_(ol),Me=u(ol,"DIV",{class:!0});var Il=p(Me);ot=u(Il,"DIV",{});var il=p(ot);jt=u(il,"DIV",{class:!0,"data-svelte-h":!0}),W(jt)!=="svelte-1n9m3ma"&&(jt.innerHTML=pr),Ul=_(il),Ae=u(il,"INPUT",{id:!0,type:!0,min:!0,max:!0,step:!0,class:!0}),zl=_(il),Ot=u(il,"DIV",{class:!0,"data-svelte-h":!0}),W(Ot)!=="svelte-y6blve"&&(Ot.innerHTML=hr),il.forEach(c),Bl=_(Il),at=u(Il,"DIV",{});var cl=p(at);St=u(cl,"DIV",{class:!0,"data-svelte-h":!0}),W(St)!=="svelte-pmq2mj"&&(St.innerHTML=mr),Rl=_(cl),Ue=u(cl,"INPUT",{id:!0,type:!0,min:!0,max:!0,step:!0,class:!0}),Gl=_(cl),At=u(cl,"DIV",{class:!0,"data-svelte-h":!0}),W(At)!=="svelte-17pelb8"&&(At.innerHTML=gr),cl.forEach(c),Il.forEach(c),ol.forEach(c),jr.forEach(c),Dt.forEach(c),Fl=_(Zt),el=u(Zt,"DIV",{class:!0});var Gr=p(el);ze=u(Gr,"DIV",{class:!0});var Pt=p(ze);Te&&Te.l(Pt),_l=_(Pt),Ut=u(Pt,"DIV",{class:!0,"data-svelte-h":!0}),W(Ut)!=="svelte-jb3ali"&&(Ut.innerHTML=_r),Yl=_(Pt),gt=u(Pt,"DIV",{class:!0});var Dl=p(gt);_t=u(Dl,"DIV",{class:!0});var Vl=p(_t);bt=u(Vl,"BUTTON",{class:!0});var Fr=p(bt);ql=Y(Fr,"API"),Fr.forEach(c),Kl=_(Vl),vt=u(Vl,"BUTTON",{class:!0});var Yr=p(vt);Jl=Y(Yr,"Local"),Yr.forEach(c),Vl.forEach(c),Xl=_(Dl),yt=u(Dl,"DIV",{class:!0});var Ll=p(yt);it=u(Ll,"BUTTON",{class:!0});var Pl=p(it);he(zt.$$.fragment,Pl),Ql=_(Pl),Bt=u(Pl,"SPAN",{class:!0,"data-svelte-h":!0}),W(Bt)!=="svelte-1horous"&&(Bt.textContent=br),Pl.forEach(c),Wl=_(Ll),wt=u(Ll,"BUTTON",{class:!0,"data-svelte-h":!0}),W(wt)!=="svelte-1u9xuv8"&&(wt.innerHTML=vr),Ll.forEach(c),Dl.forEach(c),Zl=_(Pt),Ye=u(Pt,"DIV",{class:!0});var ul=p(Ye);xt=u(ul,"DIV",{class:!0});var Ml=p(xt);kt=u(Ml,"DIV",{class:!0});var Nl=p(kt);Rt=u(Nl,"DIV",{class:!0,"data-svelte-h":!0}),W(Rt)!=="svelte-1eboucz"&&(Rt.innerHTML=yr),er=_(Nl),Et=u(Nl,"BUTTON",{class:!0,title:!0});var qr=p(Et);he(Gt.$$.fragment,qr),qr.forEach(c),Nl.forEach(c),tr=_(Ml),Ft=u(Ml,"DIV",{class:!0});var Kr=p(Ft);ct.l(Kr),Kr.forEach(c),Ml.forEach(c),lr=_(ul),Tt=u(ul,"DIV",{class:!0});var Hl=p(Tt);Ct=u(Hl,"DIV",{class:!0});var jl=p(Ct);Yt=u(jl,"DIV",{class:!0,"data-svelte-h":!0}),W(Yt)!=="svelte-w4xfzx"&&(Yt.innerHTML=xr),rr=_(jl),$t=u(jl,"BUTTON",{class:!0,title:!0});var Jr=p($t);he(qt.$$.fragment,Jr),Jr.forEach(c),jl.forEach(c),sr=_(Hl),Kt=u(Hl,"DIV",{class:!0});var Xr=p(Kt);ut.l(Xr),Xr.forEach(c),Hl.forEach(c),nr=_(ul),ue&&ue.l(ul),ul.forEach(c),Pt.forEach(c),Gr.forEach(c),Zt.forEach(c),qe.forEach(c),yl=_(f),de&&de.l(f),tl=_(f),Ce&&Ce.l(f),ll=Ht(),this.h()},h(){es.title="Text to Speech - HFStudio",o(h,"class","text-sm text-gray-400"),o(y,"class","text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"),o(y,"title","Refresh with famous book opening"),o(i,"class","absolute top-3 left-3 flex items-center gap-2 z-10"),o(J,"class","text-sm text-gray-400"),o(G,"class","absolute top-3 right-3 flex items-center gap-2 z-10"),o(z,"maxlength","1000"),o(z,"class","w-full h-96 pt-10 px-6 pb-16 bg-white resize-none border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent text-gray-900 text-lg leading-relaxed"),o(z,"placeholder","Type the text you'd like to convert to spoken audio here..."),z.autofocus=!0,Z.disabled=be=s[9]||!s[0].trim(),o(Z,"class","absolute bottom-4 right-4 px-5 py-2.5 bg-gradient-to-r from-amber-400 to-orange-500 text-white rounded-lg font-medium hover:from-amber-500 hover:to-orange-600 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-1.5 shadow-sm text-base"),o(X,"class","relative"),o(a,"class","relative mb-4"),o(F,"class","text-sm font-medium text-gray-900 mb-2"),o(ee,"class",He="w-full p-3 border bg-white text-sm focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent shadow-sm text-left flex items-center justify-between "+(s[8]?"rounded-t-lg border-b-0 border-black":"rounded-lg border-black")),o(K,"class","relative"),o(xe,"class","mt-1.5 text-xs text-gray-500 text-right"),o(N,"class","model-dropdown"),o(se,"class","text-sm font-medium text-gray-900 mb-2"),o(Be,"class","flex items-center gap-2"),o(j,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(j,"title","Play sample"),o(_e,"class","flex items-center justify-between mb-1"),o(Le,"class",lt="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Andrew"?"border-black":"border-gray-200")),o(Re,"class","flex items-center gap-2"),o(Pe,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(Pe,"title","Play sample"),o($e,"class","flex items-center justify-between mb-1"),o(ye,"class",st="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Lily"?"border-black":"border-gray-200")),o(nt,"class","flex items-center gap-2"),o(Fe,"class","p-1 rounded-full hover:bg-gray-200 transition-colors w-5 h-5 flex items-center justify-center"),o(Fe,"title","Play sample"),o(We,"class","flex items-center justify-between mb-1"),o(Qe,"class",Q="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(s[1]==="Pirate"?"border-black":"border-gray-200")),o(H,"class","grid grid-cols-2 gap-2"),o(jt,"class","mb-1"),o(Ae,"id","exaggeration-slider"),o(Ae,"type","range"),o(Ae,"min","0"),o(Ae,"max","1"),o(Ae,"step","0.01"),o(Ae,"class","w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),o(Ot,"class","flex justify-between text-xs text-gray-400 mt-1"),o(St,"class","mb-1"),o(Ue,"id","temperature-slider"),o(Ue,"type","range"),o(Ue,"min","0"),o(Ue,"max","1"),o(Ue,"step","0.01"),o(Ue,"class","w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-hf"),o(At,"class","flex justify-between text-xs text-gray-400 mt-1"),o(Me,"class","space-y-3"),o(V,"class","grid grid-cols-1 lg:grid-cols-[1fr_1.4fr_1fr] gap-6"),o(M,"class","p-4 border border-gray-200 rounded-lg bg-white mb-6"),o(r,"class","flex-1 flex flex-col p-6"),o(Ut,"class","mb-4"),o(bt,"class",bl="px-2 py-1 text-xs font-medium rounded transition-colors "+(s[6]==="api"?"bg-white shadow-sm":"text-gray-600")),o(vt,"class",vl="px-2 py-1 text-xs font-medium rounded transition-colors "+(s[6]==="local"?"bg-white shadow-sm":"text-gray-600")),o(_t,"class","flex items-center bg-gray-100 rounded-md p-0.5"),o(Bt,"class","ml-1 text-xs font-medium text-gray-600"),o(it,"class","flex items-center bg-gray-100 hover:bg-gray-200 rounded-md px-2 py-1 transition-colors"),o(wt,"class","flex items-center bg-amber-100 hover:bg-amber-200 rounded-md px-2 py-1 transition-colors"),o(yt,"class","flex items-center gap-2"),o(gt,"class","flex items-center justify-between mb-4"),o(Rt,"class","flex items-center gap-2"),o(Et,"class","p-1 hover:bg-blue-100 rounded transition-colors"),o(Et,"title","Copy setup code"),o(kt,"class","flex items-center justify-between px-3 py-2 bg-blue-50 border-b border-blue-200"),o(Ft,"class","relative"),o(xt,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),o(Yt,"class","flex items-center gap-2"),o($t,"class","p-1 hover:bg-amber-100 rounded transition-colors"),o($t,"title","Copy Python code"),o(Ct,"class","flex items-center justify-between px-3 py-2 bg-amber-50 border-b border-amber-200"),o(Kt,"class","relative"),o(Tt,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),o(Ye,"class","space-y-4"),o(ze,"class","p-4 h-full overflow-y-auto"),o(el,"class","w-96 border-l border-gray-200 bg-white h-full overflow-hidden"),o(l,"class","flex-1 flex"),o(t,"class","flex flex-col h-full"),o(t,"role","main"),o(t,"tabindex","-1")},m(f,x){A(f,e,x),A(f,t,x),n(t,l),n(l,r),n(r,a),n(a,i),n(i,h),n(i,E),n(i,y),pe(v,y,null),n(a,$),n(a,G),n(G,J),n(J,w),n(J,C),n(a,I),n(a,X),n(X,z),dl(z,s[0]),n(X,ae),n(X,Z),Jt[D].m(Z,null),n(r,B),n(r,M),n(M,V),n(V,N),n(N,F),n(N,De),n(N,K),n(K,ee),n(ee,ge);for(let qe=0;qe<we.length;qe+=1)we[qe]&&we[qe].m(ge,null);n(ee,Ne),pe(ve,ee,null),n(K,je),Ee&&Ee.m(K,null),n(N,tt),n(N,xe),n(V,Ke),n(V,Oe),n(Oe,se),n(Oe,ht),n(Oe,H),n(H,Le),n(Le,_e),n(_e,Be),n(_e,P),n(_e,j),Xt[re].m(j,null),n(H,Je),n(H,ye),n(ye,$e),n($e,Re),n($e,Xe),n($e,Pe),Qt[ce].m(Pe,null),n(H,mt),n(H,Qe),n(Qe,We),n(We,nt),n(We,hl),n(We,Fe),Wt[Se].m(Fe,null),n(H,oe),It[R].m(H,null),n(V,S),n(V,Me),n(Me,ot),n(ot,jt),n(ot,Ul),n(ot,Ae),dl(Ae,s[3]),n(ot,zl),n(ot,Ot),n(Me,Bl),n(Me,at),n(at,St),n(at,Rl),n(at,Ue),dl(Ue,s[4]),n(at,Gl),n(at,At),n(l,Fl),n(l,el),n(el,ze),Te&&Te.m(ze,null),n(ze,_l),n(ze,Ut),n(ze,Yl),n(ze,gt),n(gt,_t),n(_t,bt),n(bt,ql),n(_t,Kl),n(_t,vt),n(vt,Jl),n(gt,Xl),n(gt,yt),n(yt,it),pe(zt,it,null),n(it,Ql),n(it,Bt),n(yt,Wl),n(yt,wt),n(ze,Zl),n(ze,Ye),n(Ye,xt),n(xt,kt),n(kt,Rt),n(kt,er),n(kt,Et),pe(Gt,Et,null),n(xt,tr),n(xt,Ft),ct.m(Ft,null),n(Ye,lr),n(Ye,Tt),n(Tt,Ct),n(Ct,Yt),n(Ct,rr),n(Ct,$t),pe(qt,$t,null),n(Tt,sr),n(Tt,Kt),ut.m(Kt,null),n(Ye,nr),ue&&ue.m(Ye,null),A(f,yl,x),de&&de.m(f,x),A(f,tl,x),Ce&&Ce.m(f,x),A(f,ll,x),Ge=!0,z.focus(),or||(Er=[L(y,"click",s[37]),L(z,"input",s[41]),L(z,"keydown",s[34]),L(Z,"click",s[26]),L(ee,"click",s[42]),L(j,"click",s[44]),L(Le,"click",s[45]),L(Pe,"click",s[46]),L(ye,"click",s[47]),L(Fe,"click",s[48]),L(Qe,"click",s[49]),L(Ae,"change",s[52]),L(Ae,"input",s[52]),L(Ue,"change",s[53]),L(Ue,"input",s[53]),L(bt,"click",s[55]),L(vt,"click",s[56]),L(it,"click",s[40]),L(wt,"click",s[39]),L(Et,"click",s[57]),L($t,"click",s[58]),L(t,"click",s[35]),L(t,"keydown",s[34])],or=!0)},p(f,x){(!Ge||x[0]&1)&&U!==(U=f[0].length.toLocaleString()+"")&&et(w,U),x[0]&1&&dl(z,f[0]);let qe=D;if(D=Cr(f),D!==qe&&(ft(),T(Jt[qe],1,1,()=>{Jt[qe]=null}),dt(),te=Jt[D],te||(te=Jt[D]=Tr[D](f),te.c()),k(te,1),te.m(Z,null)),(!Ge||x[0]&513&&be!==(be=f[9]||!f[0].trim()))&&(Z.disabled=be),x[0]&33554436){rl=Sl(f[25]);let Ie;for(Ie=0;Ie<rl.length;Ie+=1){const nl=ls(f,rl,Ie);we[Ie]?we[Ie].p(nl,x):(we[Ie]=ss(nl),we[Ie].c(),we[Ie].m(ge,null))}for(;Ie<we.length;Ie+=1)we[Ie].d(1);we.length=rl.length}const Zt={};x[0]&256&&(Zt.class="text-gray-500 transition-transform "+(f[8]?"rotate-180":"")),ve.$set(Zt),(!Ge||x[0]&256&&He!==(He="w-full p-3 border bg-white text-sm focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent shadow-sm text-left flex items-center justify-between "+(f[8]?"rounded-t-lg border-b-0 border-black":"rounded-lg border-black")))&&o(ee,"class",He),f[8]?Ee?Ee.p(f,x):(Ee=ns(f),Ee.c(),Ee.m(K,null)):Ee&&(Ee.d(1),Ee=null);let Dt=re;re=Ir(f),re!==Dt&&(ft(),T(Xt[Dt],1,1,()=>{Xt[Dt]=null}),dt(),ie=Xt[re],ie||(ie=Xt[re]=$r[re](f),ie.c()),k(ie,1),ie.m(j,null)),(!Ge||x[0]&2&<!==(lt="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(f[1]==="Andrew"?"border-black":"border-gray-200")))&&o(Le,"class",lt);let Ze=ce;ce=Vr(f),ce!==Ze&&(ft(),T(Qt[Ze],1,1,()=>{Qt[Ze]=null}),dt(),ke=Qt[ce],ke||(ke=Qt[ce]=Dr[ce](f),ke.c()),k(ke,1),ke.m(Pe,null)),(!Ge||x[0]&2&&st!==(st="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(f[1]==="Lily"?"border-black":"border-gray-200")))&&o(ye,"class",st);let Vt=Se;Se=Pr(f),Se!==Vt&&(ft(),T(Wt[Vt],1,1,()=>{Wt[Vt]=null}),dt(),m=Wt[Se],m||(m=Wt[Se]=Lr[Se](f),m.c()),k(m,1),m.m(Fe,null)),(!Ge||x[0]&2&&Q!==(Q="p-3 border rounded-lg transition-colors text-left hover:bg-gray-50 "+(f[1]==="Pirate"?"border-black":"border-gray-200")))&&o(Qe,"class",Q);let sl=R;R=Nr(f),R===sl?It[R].p(f,x):(ft(),T(It[sl],1,1,()=>{It[sl]=null}),dt(),O=It[R],O?O.p(f,x):(O=It[R]=Mr[R](f),O.c()),k(O,1),O.m(H,null)),x[0]&8&&dl(Ae,f[3]),x[0]&16&&dl(Ue,f[4]),f[21]?Te?Te.p(f,x):(Te=as(f),Te.c(),Te.m(ze,_l)):Te&&(Te.d(1),Te=null),(!Ge||x[0]&64&&bl!==(bl="px-2 py-1 text-xs font-medium rounded transition-colors "+(f[6]==="api"?"bg-white shadow-sm":"text-gray-600")))&&o(bt,"class",bl),(!Ge||x[0]&64&&vl!==(vl="px-2 py-1 text-xs font-medium rounded transition-colors "+(f[6]==="local"?"bg-white shadow-sm":"text-gray-600")))&&o(vt,"class",vl),x[0]&128&&Ol(wr,wr=f[7])?(ct.d(1),ct=is(f),ct.c(),ct.m(Ft,null)):ct.p(f,x),x[0]&128&&Ol(kr,kr=f[7])?(ut.d(1),ut=cs(f),ut.c(),ut.m(Kt,null)):ut.p(f,x),f[10]?ue?(ue.p(f,x),x[0]&1024&&k(ue,1)):(ue=us(f),ue.c(),k(ue,1),ue.m(Ye,null)):ue&&(ft(),T(ue,1,1,()=>{ue=null}),dt()),f[18]?de?(de.p(f,x),x[0]&262144&&k(de,1)):(de=ps(f),de.c(),k(de,1),de.m(tl.parentNode,tl)):de&&(ft(),T(de,1,1,()=>{de=null}),dt()),f[22]?Ce?Ce.p(f,x):(Ce=ms(f),Ce.c(),Ce.m(ll.parentNode,ll)):Ce&&(Ce.d(1),Ce=null)},i(f){Ge||(k(v.$$.fragment,f),k(te),k(ve.$$.fragment,f),k(ie),k(ke),k(m),k(O),k(zt.$$.fragment,f),k(Gt.$$.fragment,f),k(qt.$$.fragment,f),k(ue),k(de),Ge=!0)},o(f){T(v.$$.fragment,f),T(te),T(ve.$$.fragment,f),T(ie),T(ke),T(m),T(O),T(zt.$$.fragment,f),T(Gt.$$.fragment,f),T(qt.$$.fragment,f),T(ue),T(de),Ge=!1},d(f){f&&(c(e),c(t),c(yl),c(tl),c(ll)),fe(v),Jt[D].d(),bs(we,f),fe(ve),Ee&&Ee.d(),Xt[re].d(),Qt[ce].d(),Wt[Se].d(),It[R].d(),Te&&Te.d(),fe(zt),fe(Gt),ct.d(f),fe(qt),ut.d(f),ue&&ue.d(),de&&de.d(f),Ce&&Ce.d(f),or=!1,ml(Er)}}}function fl(s){const e=Math.floor(s/60),t=Math.floor(s%60);return`${e}:${t.toString().padStart(2,"0")}`}function sn(s,e,t){let l="In a hole in the ground, there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.",r="Andrew",a="Chatterbox",i=!1,h=!1,g=null,E=0,y=.25,v=.7,$=!1,G=0,J=0,U="",w=null,C=null,I=null,X=!1,z="",ae="",Z=0,D=[],te=!1,be=!1,B=null,M="api",V="",N="",F=0;const le=["It was the best of times, it was the worst of times. It was the age of wisdom, it was the age of foolishness.","It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife.","All happy families are alike; each unhappy family is unhappy in its own way.","In a hole in the ground, there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort."];let De=0;const K=[{id:"chatterbox",name:"Chatterbox",badge:"recommended"},{id:"kokoro",name:"Kokoro",badge:"coming soon",disabled:!0}],ee=[{id:"andrew",name:"Andrew",description:"Older British man who speaks clearly and warmly.",sample:"/voices/andrew.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/andrew.mp3"},{id:"lily",name:"Lily",description:"Friendly, conversational tone of a woman in her 30s",sample:"/voices/lily.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3"},{id:"pirate",name:"Pirate",description:"Young male pirate-y voice that speaks gruffly and with excitement",sample:"/voices/pirate.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/pirate.mp3"},{id:"fairy",name:"Fairy",description:"High and airy female voice that bursts with excitement",sample:"/voices/fairy.mp3",preview_url:"https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/fairy.mp3"}];async function ge(){if(!l.trim())return;if(!(await fetch("/api/auth/user",{credentials:"include"})).ok){t(21,be=!0);return}t(9,h=!0),t(10,g=null),t(13,G=0),t(12,$=!1),t(15,U=l.length>30?l.substring(0,30)+"...":l);try{let Q=null;if(r==="Yours"&&D.length>0){const S=D[0];S&&S.voice_url&&(Q=S.voice_url)}else{const S=ee.find(Me=>Me.name===r);S&&S.preview_url&&(Q=S.preview_url)}const oe={text:l,voice_id:r.toLowerCase(),model_id:a.toLowerCase(),mode:"api",parameters:{exaggeration:y,temperature:v},voice_url:Q},R=await fetch("/api/tts/generate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(oe)});if(!R.ok){const S=await R.text();throw new Error(`HTTP error! status: ${R.status}, body: ${S}`)}const O=await R.json();if(O.success&&O.audio_url)t(10,g=O.audio_url),t(11,E=O.generation_time||0),await H(oe,O),setTimeout(()=>{w&&w.play().catch(()=>{})},100);else{const S=O.error||"Unknown error occurred";se("Generation Failed",S),t(10,g=null)}}catch{se("Network Error","Failed to connect to the server. Please check your connection and try again."),t(10,g=null)}finally{t(9,h=!1)}}function Ne(){w&&($?w.pause():w.play())}function ve(){w&&t(14,J=w.duration)}function He(){w&&t(13,G=w.currentTime)}function je(){t(12,$=!0)}function tt(){t(12,$=!1)}function xe(){if(g){const m=document.createElement("a");m.href=g,m.download="speech.wav",m.click()}}function Ve(m,Q){if(Q.stopPropagation(),I===m.name)C&&(C.pause(),C.currentTime=0),t(17,I=null);else{C&&C.pause(),t(17,I=m.name);const oe=m.sample||"/samples/harvard.wav";C?C.src=oe:(C=new Audio(oe),C.addEventListener("ended",()=>{t(17,I=null)})),C.play().catch(R=>{t(17,I=null)})}}function Ke(m){m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),ge()),m.key==="Escape"&&t(8,i=!1)}function Oe(m){m.target.closest(".model-dropdown")||t(8,i=!1),m.target.closest(".voice-dropdown")}function se(m,Q=""){t(19,z=m),t(20,ae=Q),t(18,X=!0)}function pt(){t(18,X=!1),t(19,z=""),t(20,ae="")}function ht(){De=(De+1)%le.length,t(0,l=le[De])}async function H(m,Q){try{let oe=null;const R=D.find(S=>S.voice_name===r);if(R&&R.voice_url)oe=R.voice_url;else{const S=ee.find(Me=>Me.name===r);S&&S.preview_url&&(oe=S.preview_url)}const O=`audio_bytes = client.text_to_speech(
|
| 7 |
+
"${m.text.replace(/"/g,'\\"')}",
|
| 8 |
+
extra_body={
|
| 9 |
+
"exaggeration": ${m.parameters.exaggeration},
|
| 10 |
+
"temperature": ${m.parameters.temperature}${oe?`,
|
| 11 |
+
"audio_url": "${oe}"`:""}
|
| 12 |
+
}
|
| 13 |
+
)`;await fetch("/api/history/save",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({code:O,result_type:"audio",result_data:{url:Q.audio_url,title:U,type:"audio"},entry_type:"generation"})}),await Le()}catch(oe){console.error("Error saving to history:",oe)}}async function Le(){try{const m=await fetch("/api/history/load",{method:"GET",credentials:"include"});m.ok&&(Z=(await m.json()).entries.filter(R=>R.entry_type==="generation").length)}catch(m){console.error("Error loading history count:",m),Z=0}}async function _e(){try{te=!0;const m=await fetch("/api/voice/user-voices",{method:"GET",credentials:"include"});if(m.ok){const Q=await m.json();t(5,D=Q.voices||[])}else t(5,D=[])}catch(m){console.error("Error loading user voices:",m),t(5,D=[])}finally{te=!1}}function Be(){return M==="local"?`pip install huggingface-hub hfstudio uv
|
| 14 |
+
hfstudio start ${a.toLowerCase()} --port 7861`:"pip install huggingface-hub"}function ne(){return M==="local"?'client = InferenceClient(base_url="http://localhost:7861/api/v1")':`client = InferenceClient(
|
| 15 |
+
api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
|
| 16 |
+
model="${a.toLowerCase()==="chatterbox"?"ResembleAI/chatterbox":a.toLowerCase()}",
|
| 17 |
+
)`}function P(){let m=null;if(r==="Yours"&&D.length>0){const O=D[0];O&&O.voice_url&&(m=O.voice_url)}else{const O=ee.find(S=>S.name===r);O&&O.preview_url&&(m=O.preview_url)}const Q=l||"Hello, this is a sample text.";return`${`from huggingface_hub import InferenceClient
|
| 18 |
+
|
| 19 |
+
${ne()}`}
|
| 20 |
+
|
| 21 |
+
audio_bytes = client.text_to_speech(
|
| 22 |
+
"${Q.replace(/"/g,'\\"')}",
|
| 23 |
+
extra_body={
|
| 24 |
+
"exaggeration": ${y},
|
| 25 |
+
"temperature": ${v}${m?`,
|
| 26 |
+
"audio_url": "${m}"`:""}
|
| 27 |
+
}
|
| 28 |
+
)`}function j(m,Q="Copied to clipboard!"){navigator.clipboard.writeText(m).then(()=>{t(22,B=Q),setTimeout(()=>{t(22,B=null)},2e3)})}function re(){let m=null;if(r==="Yours"&&D.length>0){const S=D[0];S&&S.voice_url&&(m=S.voice_url)}else{const S=ee.find(Me=>Me.name===r);S&&S.preview_url&&(m=S.preview_url)}const Q=`from huggingface_hub import InferenceClient
|
| 29 |
+
import gradio as gr
|
| 30 |
+
import os
|
| 31 |
+
|
| 32 |
+
client = InferenceClient(api_key=os.getenv("HF_TOKEN"))
|
| 33 |
+
|
| 34 |
+
def generate_speech(text):
|
| 35 |
+
if not text.strip():
|
| 36 |
+
return None
|
| 37 |
+
|
| 38 |
+
try:
|
| 39 |
+
audio_bytes = client.text_to_speech(
|
| 40 |
+
text,
|
| 41 |
+
extra_body={
|
| 42 |
+
"exaggeration": ${y},
|
| 43 |
+
"temperature": ${v},
|
| 44 |
+
${m?`"audio_url": "${m}",`:""}
|
| 45 |
+
}
|
| 46 |
+
)
|
| 47 |
+
return audio_bytes
|
| 48 |
+
except Exception as e:
|
| 49 |
+
raise gr.Error(f"Error generating speech: {str(e)}")
|
| 50 |
+
|
| 51 |
+
# Create the Gradio interface
|
| 52 |
+
with gr.Blocks(title="Text to Speech") as demo:
|
| 53 |
+
gr.Markdown("# Text to Speech")
|
| 54 |
+
gr.Markdown("Convert text to speech using the Chatterbox model.")
|
| 55 |
+
|
| 56 |
+
with gr.Row():
|
| 57 |
+
with gr.Column():
|
| 58 |
+
text_input = gr.Textbox(
|
| 59 |
+
label="Text to convert to speech",
|
| 60 |
+
placeholder="${l.replace(/"/g,'\\"').substring(0,100)}...",
|
| 61 |
+
lines=5,
|
| 62 |
+
value="${l.replace(/"/g,'\\"')}"
|
| 63 |
+
)
|
| 64 |
+
generate_btn = gr.Button("Generate Speech", variant="primary")
|
| 65 |
+
|
| 66 |
+
with gr.Column():
|
| 67 |
+
audio_output = gr.Audio(label="Generated Speech")
|
| 68 |
+
|
| 69 |
+
generate_btn.click(
|
| 70 |
+
fn=generate_speech,
|
| 71 |
+
inputs=[text_input],
|
| 72 |
+
outputs=[audio_output]
|
| 73 |
+
)
|
| 74 |
+
|
| 75 |
+
if __name__ == "__main__":
|
| 76 |
+
demo.launch()`,oe=`huggingface_hub
|
| 77 |
+
gradio`,R="https://huggingface.co/new-space",O=new URLSearchParams({name:`text-to-speech-${r.toLowerCase()}-${Date.now()}`,sdk:"gradio","files[0][path]":"app.py","files[0][content]":Q,"files[1][path]":"requirements.txt","files[1][content]":oe});window.open(`${R}?${O.toString()}`,"_blank")}function ie(){const m=[];if(V){const R=V.includes("pip install")||V.includes("hfstudio start")?"bash":"";m.push(`## Setup (Run in Terminal)
|
| 78 |
+
|
| 79 |
+
\`\`\`${R}
|
| 80 |
+
${V}
|
| 81 |
+
\`\`\``)}N&&m.push(`## Python Code
|
| 82 |
+
|
| 83 |
+
\`\`\`python
|
| 84 |
+
${N}
|
| 85 |
+
\`\`\``);const Q=m.join(`
|
| 86 |
+
|
| 87 |
+
`);j(Q,"All code copied as Markdown!")}Es(async()=>{await Le(),await _e()});function lt(){l=this.value,t(0,l)}const Je=()=>t(8,i=!i),ye=m=>{m.disabled||(t(2,a=m.name),t(8,i=!1))},$e=m=>Ve({name:"Andrew",sample:"/voices/andrew.mp3"},m),Re=()=>t(1,r="Andrew"),rt=m=>Ve({name:"Lily",sample:"/voices/lily.mp3"},m),Xe=()=>t(1,r="Lily"),Pe=m=>Ve({name:"Pirate",sample:"/voices/pirate.mp3"},m),ce=()=>t(1,r="Pirate"),ke=m=>Ve({name:"Yours",sample:D[0].voice_url},m),st=()=>t(1,r="Yours");function mt(){y=Wr(this.value),t(3,y)}function Qe(){v=Wr(this.value),t(4,v)}const We=()=>t(21,be=!1),nt=()=>t(6,M="api"),gl=()=>t(6,M="local"),hl=()=>j(V),Fe=()=>j(N);function Se(m){Ts[m?"unshift":"push"](()=>{w=m,t(16,w)})}return s.$$.update=()=>{s.$$.dirty[0]&255&&(t(23,V=Be()),t(24,N=P()),t(7,F++,F))},[l,r,a,y,v,D,M,F,i,h,g,E,$,G,J,U,w,I,X,z,ae,be,B,V,N,K,ge,Ne,ve,He,je,tt,xe,Ve,Ke,Oe,pt,ht,j,re,ie,lt,Je,ye,$e,Re,rt,Xe,Pe,ce,ke,st,mt,Qe,We,nt,gl,hl,Fe,Se]}class fn extends gs{constructor(e){super(),_s(this,e,sn,rn,Ol,{},null,[-1,-1,-1])}}export{fn as component};
|
hfstudio/static/_app/immutable/nodes/3.Dq8C9uWF.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as Pe,i as Ve,s as Ne,u as ve,v as ee,w as S,x,y as te,z as le,A as se,B as Ce,C as Ye,D as We,E as Xe,F as Ze,d as c,G as xe,p as u,H as _e,b as W,c as a,m as ce,I as st,h as M,e as h,f as g,r as ye,g as ne,J as Se,k as A,j as m,t as ae,K as rt,n as ot,P as He,Q as Me,a as we,N as be,T as nt,q as Le}from"../chunks/BaOlNwUz.js";import{g as at,C as Ie,P as Z,D as it}from"../chunks/Dj_MM6zE.js";import{I as et,g as tt,a as lt,e as Re,u as ct,o as ut}from"../chunks/C7BncMoR.js";import"../chunks/IHki7fMi.js";import{N as dt}from"../chunks/BdxGXOVO.js";import{P as ft,a as ht}from"../chunks/Bm0csYZC.js";function mt(o){let e;const t=o[2].default,l=Ye(t,o,o[3],null);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,s){l&&l.m(r,s),e=!0},p(r,s){l&&l.p&&(!e||s&8)&&We(l,t,r,r[3],e?Ze(t,r[3],s,null):Xe(r[3]),null)},i(r){e||(x(l,r),e=!0)},o(r){S(l,r),e=!1},d(r){l&&l.d(r)}}}function pt(o){let e,t;const l=[{name:"rotate-ccw"},o[1],{iconNode:o[0]}];let r={$$slots:{default:[mt]},$$scope:{ctx:o}};for(let s=0;s<l.length;s+=1)r=ve(r,l[s]);return e=new et({props:r}),{c(){se(e.$$.fragment)},l(s){le(e.$$.fragment,s)},m(s,n){te(e,s,n),t=!0},p(s,[n]){const f=n&3?tt(l,[l[0],n&2&<(s[1]),n&1&&{iconNode:s[0]}]):{};n&8&&(f.$$scope={dirty:n,ctx:s}),e.$set(f)},i(s){t||(x(e.$$.fragment,s),t=!0)},o(s){S(e.$$.fragment,s),t=!1},d(s){ee(e,s)}}}function gt(o,e,t){let{$$slots:l={},$$scope:r}=e;const s=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];return o.$$set=n=>{t(1,e=ve(ve({},e),Ce(n))),"$$scope"in n&&t(3,r=n.$$scope)},e=Ce(e),[s,e,l,r]}class _t extends Pe{constructor(e){super(),Ve(this,e,gt,pt,Ne,{})}}function bt(o){let e;const t=o[2].default,l=Ye(t,o,o[3],null);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,s){l&&l.m(r,s),e=!0},p(r,s){l&&l.p&&(!e||s&8)&&We(l,t,r,r[3],e?Ze(t,r[3],s,null):Xe(r[3]),null)},i(r){e||(x(l,r),e=!0)},o(r){S(l,r),e=!1},d(r){l&&l.d(r)}}}function vt(o){let e,t;const l=[{name:"share"},o[1],{iconNode:o[0]}];let r={$$slots:{default:[bt]},$$scope:{ctx:o}};for(let s=0;s<l.length;s+=1)r=ve(r,l[s]);return e=new et({props:r}),{c(){se(e.$$.fragment)},l(s){le(e.$$.fragment,s)},m(s,n){te(e,s,n),t=!0},p(s,[n]){const f=n&3?tt(l,[l[0],n&2&<(s[1]),n&1&&{iconNode:s[0]}]):{};n&8&&(f.$$scope={dirty:n,ctx:s}),e.$set(f)},i(s){t||(x(e.$$.fragment,s),t=!0)},o(s){S(e.$$.fragment,s),t=!1},d(s){ee(e,s)}}}function yt(o,e,t){let{$$slots:l={},$$scope:r}=e;const s=[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}],["polyline",{points:"16 6 12 2 8 6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15"}]];return o.$$set=n=>{t(1,e=ve(ve({},e),Ce(n))),"$$scope"in n&&t(3,r=n.$$scope)},e=Ce(e),[s,e,l,r]}class Et extends Pe{constructor(e){super(),Ve(this,e,yt,vt,Ne,{})}}const{document:ze}=at;function Ue(o,e,t){const l=o.slice();return l[25]=e[t],l[26]=e,l[27]=t,l}function kt(o){let e;return{c(){e=ae("Python code to reproduce your actions via the API")},l(t){e=ne(t,"Python code to reproduce your actions via the API")},m(t,l){W(t,e,l)},d(t){t&&c(e)}}}function wt(o){let e;return{c(){e=ae("Python code to reproduce your actions using a local HFStudio server")},l(t){e=ne(t,"Python code to reproduce your actions using a local HFStudio server")},m(t,l){W(t,e,l)},d(t){t&&c(e)}}}function je(o){let e,t,l,r,s,n="Reset history",f,$,E,I,_,O="Copy all as Markdown",k,y,w;return l=new _t({props:{size:16,class:"text-red-600"}}),E=new Ie({props:{size:16,class:"text-gray-600"}}),{c(){e=m("div"),t=m("button"),se(l.$$.fragment),r=A(),s=m("span"),s.textContent=n,f=A(),$=m("button"),se(E.$$.fragment),I=A(),_=m("span"),_.textContent=O,this.h()},l(p){e=h(p,"DIV",{class:!0});var v=g(e);t=h(v,"BUTTON",{class:!0,title:!0});var P=g(t);le(l.$$.fragment,P),r=M(P),s=h(P,"SPAN",{class:!0,"data-svelte-h":!0}),ye(s)!=="svelte-1x639i7"&&(s.textContent=n),P.forEach(c),f=M(v),$=h(v,"BUTTON",{class:!0});var D=g($);le(E.$$.fragment,D),I=M(D),_=h(D,"SPAN",{class:!0,"data-svelte-h":!0}),ye(_)!=="svelte-kfbkuj"&&(_.textContent=O),D.forEach(c),v.forEach(c),this.h()},h(){u(s,"class","ml-2 text-sm font-medium text-red-600"),u(t,"class","flex items-center bg-red-50 hover:bg-red-100 rounded-md px-3 py-1.5 transition-colors"),u(t,"title","Clear history"),u(_,"class","ml-2 text-sm font-medium text-gray-600"),u($,"class","flex items-center bg-gray-100 hover:bg-gray-200 rounded-md px-3 py-1.5 transition-colors"),u(e,"class","flex items-center gap-2")},m(p,v){W(p,e,v),a(e,t),te(l,t,null),a(t,r),a(t,s),a(e,f),a(e,$),te(E,$,null),a($,I),a($,_),k=!0,y||(w=[ce(t,"click",o[6]),ce($,"click",o[8])],y=!0)},p:ot,i(p){k||(x(l.$$.fragment,p),x(E.$$.fragment,p),k=!0)},o(p){S(l.$$.fragment,p),S(E.$$.fragment,p),k=!1},d(p){p&&c(e),ee(l),ee(E),y=!1,xe(w)}}}function Be(o){let e,t,l,r='<span class="text-sm font-medium text-amber-900">Setup (Run in Terminal)</span> <span class="text-xs bg-amber-100 text-amber-700 px-2 py-0.5 rounded">Run once</span>',s,n,f,$,E,I,_,O;f=new Ie({props:{size:14,class:"text-amber-600"}});function k(p,v){return p[2]==="pip install huggingface-hub"?Ct:$t}let y=k(o),w=y(o);return{c(){e=m("div"),t=m("div"),l=m("div"),l.innerHTML=r,s=A(),n=m("button"),se(f.$$.fragment),$=A(),E=m("div"),w.c(),this.h()},l(p){e=h(p,"DIV",{class:!0});var v=g(e);t=h(v,"DIV",{class:!0});var P=g(t);l=h(P,"DIV",{class:!0,"data-svelte-h":!0}),ye(l)!=="svelte-akzwnd"&&(l.innerHTML=r),s=M(P),n=h(P,"BUTTON",{class:!0,title:!0});var D=g(n);le(f.$$.fragment,D),D.forEach(c),P.forEach(c),$=M(v),E=h(v,"DIV",{class:!0});var H=g(E);w.l(H),H.forEach(c),v.forEach(c),this.h()},h(){u(l,"class","flex items-center gap-2"),u(n,"class","p-1.5 hover:bg-amber-100 rounded transition-colors"),u(n,"title","Copy setup code"),u(t,"class","flex items-center justify-between px-4 py-2 bg-amber-50 border-b border-amber-200"),u(E,"class","relative"),u(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(p,v){W(p,e,v),a(e,t),a(t,l),a(t,s),a(t,n),te(f,n,null),a(e,$),a(e,E),w.m(E,null),I=!0,_||(O=ce(n,"click",o[12]),_=!0)},p(p,v){y===(y=k(p))&&w?w.p(p,v):(w.d(1),w=y(p),w&&(w.c(),w.m(E,null)))},i(p){I||(x(f.$$.fragment,p),I=!0)},o(p){S(f.$$.fragment,p),I=!1},d(p){p&&c(e),ee(f),w.d(),_=!1,O()}}}function $t(o){let e,t,l,r=Z.highlight(o[2],Z.languages.bash,"bash")+"";return{c(){e=m("pre"),t=m("code"),l=new Me(!1),this.h()},l(s){e=h(s,"PRE",{class:!0});var n=g(e);t=h(n,"CODE",{class:!0});var f=g(t);l=He(f,!1),f.forEach(c),n.forEach(c),this.h()},h(){l.a=null,u(t,"class","language-bash text-sm"),u(e,"class","p-4 overflow-x-auto bg-gray-50")},m(s,n){W(s,e,n),a(e,t),l.m(r,t)},p(s,n){n&4&&r!==(r=Z.highlight(s[2],Z.languages.bash,"bash")+"")&&l.p(r)},d(s){s&&c(e)}}}function Ct(o){let e,t,l;return{c(){e=m("pre"),t=m("code"),l=ae(o[2]),this.h()},l(r){e=h(r,"PRE",{class:!0});var s=g(e);t=h(s,"CODE",{class:!0});var n=g(t);l=ne(n,o[2]),n.forEach(c),s.forEach(c),this.h()},h(){u(t,"class","language-bash text-sm text-black"),u(e,"class","p-4 overflow-x-auto bg-gray-50")},m(r,s){W(r,e,s),a(e,t),a(t,l)},p(r,s){s&4&&we(l,r[2])},d(r){r&&c(e)}}}function Fe(o){let e,t,l,r='<span class="text-sm font-medium text-blue-900">Imports (Python)</span> <span class="text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded">Run once</span>',s,n,f,$,E,I,_,O,k=Z.highlight(o[3],Z.languages.python,"python")+"",y,w,p;return f=new Ie({props:{size:14,class:"text-blue-600"}}),{c(){e=m("div"),t=m("div"),l=m("div"),l.innerHTML=r,s=A(),n=m("button"),se(f.$$.fragment),$=A(),E=m("div"),I=m("pre"),_=m("code"),O=new Me(!1),this.h()},l(v){e=h(v,"DIV",{class:!0});var P=g(e);t=h(P,"DIV",{class:!0});var D=g(t);l=h(D,"DIV",{class:!0,"data-svelte-h":!0}),ye(l)!=="svelte-sun3yz"&&(l.innerHTML=r),s=M(D),n=h(D,"BUTTON",{class:!0,title:!0});var H=g(n);le(f.$$.fragment,H),H.forEach(c),D.forEach(c),$=M(P),E=h(P,"DIV",{class:!0});var B=g(E);I=h(B,"PRE",{class:!0});var Q=g(I);_=h(Q,"CODE",{class:!0});var K=g(_);O=He(K,!1),K.forEach(c),Q.forEach(c),B.forEach(c),P.forEach(c),this.h()},h(){u(l,"class","flex items-center gap-2"),u(n,"class","p-1.5 hover:bg-blue-100 rounded transition-colors"),u(n,"title","Copy import code"),u(t,"class","flex items-center justify-between px-4 py-2 bg-blue-50 border-b border-blue-200"),O.a=null,u(_,"class","language-python text-sm"),u(I,"class","p-4 overflow-x-auto bg-gray-50"),u(E,"class","relative"),u(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(v,P){W(v,e,P),a(e,t),a(t,l),a(t,s),a(t,n),te(f,n,null),a(e,$),a(e,E),a(E,I),a(I,_),O.m(k,_),y=!0,w||(p=ce(n,"click",o[13]),w=!0)},p(v,P){(!y||P&8)&&k!==(k=Z.highlight(v[3],Z.languages.python,"python")+"")&&O.p(k)},i(v){y||(x(f.$$.fragment,v),y=!0)},o(v){S(f.$$.fragment,v),y=!1},d(v){v&&c(e),ee(f),w=!1,p()}}}function Ge(o){let e,t='<p class="text-gray-500">Start using the UI to see generated code here</p>';return{c(){e=m("div"),e.innerHTML=t,this.h()},l(l){e=h(l,"DIV",{class:!0,"data-svelte-h":!0}),ye(e)!=="svelte-1v3062w"&&(e.innerHTML=t),this.h()},h(){u(e,"class","bg-white rounded-lg border border-gray-200 p-8 text-center")},m(l,r){W(l,e,r)},d(l){l&&c(e)}}}function qe(o){let e,t,l,r,s,n,f,$,E,I,_=(o[25].result.title||"Generated Audio")+"",O,k,y,w,p=Qe(o[25].result.duration||0)+"",v,P,D,H,B,Q,K,b,U,i,V,T=o[26],q=o[27],J,L,X;const ue=[Dt,It],ie=[];function Ee(N,Y){return N[25].isPlaying?0:1}n=Ee(o),f=ie[n]=ue[n](o);function ge(){return o[15](o[25])}B=new it({props:{size:16,class:"text-gray-600"}});function re(){return o[16](o[25])}b=new Et({props:{size:16,class:"text-gray-600"}});const R=()=>o[17](i,T,q),z=()=>o[17](null,T,q);function j(){return o[18](o[25],o[26],o[27])}return{c(){e=m("div"),t=m("div"),l=m("div"),r=m("div"),s=m("button"),f.c(),$=A(),E=m("div"),I=m("div"),O=ae(_),k=A(),y=m("div"),w=ae("Duration: "),v=ae(p),P=A(),D=m("div"),H=m("button"),se(B.$$.fragment),Q=A(),K=m("button"),se(b.$$.fragment),U=A(),i=m("audio"),this.h()},l(N){e=h(N,"DIV",{class:!0});var Y=g(e);t=h(Y,"DIV",{class:!0});var oe=g(t);l=h(oe,"DIV",{class:!0});var F=g(l);r=h(F,"DIV",{class:!0});var d=g(r);s=h(d,"BUTTON",{class:!0});var C=g(s);f.l(C),C.forEach(c),$=M(d),E=h(d,"DIV",{class:!0});var G=g(E);I=h(G,"DIV",{class:!0});var me=g(I);O=ne(me,_),me.forEach(c),k=M(G),y=h(G,"DIV",{class:!0});var fe=g(y);w=ne(fe,"Duration: "),v=ne(fe,p),fe.forEach(c),G.forEach(c),d.forEach(c),P=M(F),D=h(F,"DIV",{class:!0});var de=g(D);H=h(de,"BUTTON",{class:!0,title:!0});var ke=g(H);le(B.$$.fragment,ke),ke.forEach(c),Q=M(de),K=h(de,"BUTTON",{class:!0,title:!0});var pe=g(K);le(b.$$.fragment,pe),pe.forEach(c),de.forEach(c),F.forEach(c),U=M(oe),i=h(oe,"AUDIO",{src:!0,class:!0}),g(i).forEach(c),oe.forEach(c),Y.forEach(c),this.h()},h(){u(s,"class","w-10 h-10 bg-gradient-to-r from-amber-500 to-orange-500 rounded-full flex items-center justify-center text-white hover:from-amber-600 hover:to-orange-600 transition-colors shadow-md"),u(I,"class","text-sm font-medium text-gray-900 truncate"),u(y,"class","text-xs text-gray-500"),u(E,"class","flex-1"),u(r,"class","flex items-center gap-3 flex-1"),u(H,"class","p-2 hover:bg-gray-100 rounded-lg transition-colors"),u(H,"title","Download"),u(K,"class","p-2 hover:bg-gray-100 rounded-lg transition-colors"),u(K,"title","Share"),u(D,"class","flex items-center gap-1"),u(l,"class","flex items-center justify-between"),Le(i.src,V=o[25].result.url)||u(i,"src",V),u(i,"class","hidden"),u(t,"class","bg-white rounded-lg border border-gray-200 p-4 shadow-sm"),u(e,"class","bg-gradient-to-b from-gray-50 to-white p-4")},m(N,Y){W(N,e,Y),a(e,t),a(t,l),a(l,r),a(r,s),ie[n].m(s,null),a(r,$),a(r,E),a(E,I),a(I,O),a(E,k),a(E,y),a(y,w),a(y,v),a(l,P),a(l,D),a(D,H),te(B,H,null),a(D,Q),a(D,K),te(b,K,null),a(t,U),a(t,i),R(),J=!0,L||(X=[ce(s,"click",ge),ce(H,"click",re),ce(i,"ended",j)],L=!0)},p(N,Y){o=N;let oe=n;n=Ee(o),n!==oe&&(be(),S(ie[oe],1,1,()=>{ie[oe]=null}),_e(),f=ie[n],f||(f=ie[n]=ue[n](o),f.c()),x(f,1),f.m(s,null)),(!J||Y&2)&&_!==(_=(o[25].result.title||"Generated Audio")+"")&&we(O,_),(!J||Y&2)&&p!==(p=Qe(o[25].result.duration||0)+"")&&we(v,p),(!J||Y&2&&!Le(i.src,V=o[25].result.url))&&u(i,"src",V),(T!==o[26]||q!==o[27])&&(z(),T=o[26],q=o[27],R())},i(N){J||(x(f),x(B.$$.fragment,N),x(b.$$.fragment,N),J=!0)},o(N){S(f),S(B.$$.fragment,N),S(b.$$.fragment,N),J=!1},d(N){N&&c(e),ie[n].d(),ee(B),ee(b),z(),L=!1,xe(X)}}}function It(o){let e,t;return e=new ht({props:{size:18,class:"ml-0.5"}}),{c(){se(e.$$.fragment)},l(l){le(e.$$.fragment,l)},m(l,r){te(e,l,r),t=!0},i(l){t||(x(e.$$.fragment,l),t=!0)},o(l){S(e.$$.fragment,l),t=!1},d(l){ee(e,l)}}}function Dt(o){let e,t;return e=new ft({props:{size:18}}),{c(){se(e.$$.fragment)},l(l){le(e.$$.fragment,l)},m(l,r){te(e,l,r),t=!0},i(l){t||(x(e.$$.fragment,l),t=!0)},o(l){S(e.$$.fragment,l),t=!1},d(l){ee(e,l)}}}function Ke(o,e){let t,l,r,s,n,f=e[27]+1+"",$,E,I,_,O,k,y,w,p,v=Z.highlight(e[25].code,Z.languages.python,"python")+"",P,D,H,B,Q;_=new Ie({props:{size:14,class:"text-gray-600"}});function K(){return e[14](e[25])}let b=e[25].result&&e[25].result.type==="audio"&&qe(e);return{key:o,first:null,c(){t=m("div"),l=m("div"),r=m("div"),s=m("span"),n=ae("Cell "),$=ae(f),E=A(),I=m("button"),se(_.$$.fragment),O=A(),k=m("div"),y=m("pre"),w=m("code"),p=new Me(!1),P=A(),b&&b.c(),D=A(),this.h()},l(U){t=h(U,"DIV",{class:!0});var i=g(t);l=h(i,"DIV",{class:!0});var V=g(l);r=h(V,"DIV",{class:!0});var T=g(r);s=h(T,"SPAN",{class:!0});var q=g(s);n=ne(q,"Cell "),$=ne(q,f),q.forEach(c),E=M(T),I=h(T,"BUTTON",{class:!0,title:!0});var J=g(I);le(_.$$.fragment,J),J.forEach(c),T.forEach(c),O=M(V),k=h(V,"DIV",{class:!0});var L=g(k);y=h(L,"PRE",{class:!0});var X=g(y);w=h(X,"CODE",{class:!0});var ue=g(w);p=He(ue,!1),ue.forEach(c),X.forEach(c),L.forEach(c),V.forEach(c),P=M(i),b&&b.l(i),D=M(i),i.forEach(c),this.h()},h(){u(s,"class","text-sm font-medium text-gray-700"),u(I,"class","p-1.5 hover:bg-gray-200 rounded transition-colors"),u(I,"title","Copy code"),u(r,"class","flex items-center justify-between px-4 py-2 bg-gray-50 border-b border-gray-100"),p.a=null,u(w,"class","language-python text-sm"),u(y,"class","p-4 overflow-x-auto bg-gray-50"),u(k,"class","relative"),u(l,"class","border-b border-gray-200"),u(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden shadow-sm"),this.first=t},m(U,i){W(U,t,i),a(t,l),a(l,r),a(r,s),a(s,n),a(s,$),a(r,E),a(r,I),te(_,I,null),a(l,O),a(l,k),a(k,y),a(y,w),p.m(v,w),a(t,P),b&&b.m(t,null),a(t,D),H=!0,B||(Q=ce(I,"click",K),B=!0)},p(U,i){e=U,(!H||i&2)&&f!==(f=e[27]+1+"")&&we($,f),(!H||i&2)&&v!==(v=Z.highlight(e[25].code,Z.languages.python,"python")+"")&&p.p(v),e[25].result&&e[25].result.type==="audio"?b?(b.p(e,i),i&2&&x(b,1)):(b=qe(e),b.c(),x(b,1),b.m(t,D)):b&&(be(),S(b,1,1,()=>{b=null}),_e())},i(U){H||(x(_.$$.fragment,U),x(b),H=!0)},o(U){S(_.$$.fragment,U),S(b),H=!1},d(U){U&&c(t),ee(_),b&&b.d(),B=!1,Q()}}}function Je(o){let e,t;return{c(){e=m("div"),t=ae(o[4]),this.h()},l(l){e=h(l,"DIV",{class:!0});var r=g(e);t=ne(r,o[4]),r.forEach(c),this.h()},h(){u(e,"class","fixed bottom-4 right-4 px-4 py-2 bg-gray-900 text-white rounded-lg shadow-lg z-50 animate-fade-in svelte-1vrx3m3")},m(l,r){W(l,e,r),a(e,t)},p(l,r){r&16&&we(t,l[4])},d(l){l&&c(e)}}}function Tt(o){let e,t,l,r,s,n,f,$,E="Code Recorder",I,_,O,k,y,w,p,v,P,D,H,B,Q,K,b,U,i,V,T=[],q=new Map,J,L,X,ue,ie;l=new dt({props:{historyCount:o[5]}});function Ee(d,C){return d[0]==="local"?wt:kt}let ge=Ee(o),re=ge(o),R=(o[1].length>0||o[2]||o[3])&&je(o),z=o[2]&&Be(o),j=o[3]&&Fe(o),N=!o[3]&&o[1].length===0&&Ge(),Y=Re(o[1]);const oe=d=>d[25].id;for(let d=0;d<Y.length;d+=1){let C=Ue(o,Y,d),G=oe(C);q.set(G,T[d]=Ke(G,C))}let F=o[4]&&Je(o);return{c(){e=A(),t=m("div"),se(l.$$.fragment),r=A(),s=m("div"),n=m("div"),f=m("div"),$=m("h2"),$.textContent=E,I=A(),_=m("p"),re.c(),O=A(),k=m("div"),y=m("div"),w=m("button"),p=ae("API"),P=A(),D=m("button"),H=ae("Local"),Q=A(),R&&R.c(),K=A(),b=m("div"),z&&z.c(),U=A(),j&&j.c(),i=A(),N&&N.c(),V=A();for(let d=0;d<T.length;d+=1)T[d].c();J=A(),F&&F.c(),L=Se(),this.h()},l(d){st("svelte-1s75m5n",ze.head).forEach(c),e=M(d),t=h(d,"DIV",{class:!0});var G=g(t);le(l.$$.fragment,G),r=M(G),s=h(G,"DIV",{class:!0});var me=g(s);n=h(me,"DIV",{class:!0});var fe=g(n);f=h(fe,"DIV",{});var de=g(f);$=h(de,"H2",{class:!0,"data-svelte-h":!0}),ye($)!=="svelte-8fx49i"&&($.textContent=E),I=M(de),_=h(de,"P",{class:!0});var ke=g(_);re.l(ke),ke.forEach(c),de.forEach(c),O=M(fe),k=h(fe,"DIV",{class:!0});var pe=g(k);y=h(pe,"DIV",{class:!0});var $e=g(y);w=h($e,"BUTTON",{class:!0});var Ae=g(w);p=ne(Ae,"API"),Ae.forEach(c),P=M($e),D=h($e,"BUTTON",{class:!0});var Oe=g(D);H=ne(Oe,"Local"),Oe.forEach(c),$e.forEach(c),Q=M(pe),R&&R.l(pe),pe.forEach(c),fe.forEach(c),K=M(me),b=h(me,"DIV",{class:!0});var he=g(b);z&&z.l(he),U=M(he),j&&j.l(he),i=M(he),N&&N.l(he),V=M(he);for(let De=0;De<T.length;De+=1)T[De].l(he);he.forEach(c),me.forEach(c),G.forEach(c),J=M(d),F&&F.l(d),L=Se(),this.h()},h(){ze.title="Code Recorder - HFStudio",u($,"class","text-2xl font-semibold text-gray-900"),u(_,"class","text-sm text-gray-600 mt-1"),u(w,"class",v="px-3 py-1 text-sm font-medium rounded transition-colors "+(o[0]==="api"?"bg-white shadow-sm":"text-gray-600")),u(D,"class",B="px-3 py-1 text-sm font-medium rounded transition-colors "+(o[0]==="local"?"bg-white shadow-sm":"text-gray-600")),u(y,"class","flex items-center bg-gray-100 rounded-md p-0.5"),u(k,"class","flex items-center justify-between mt-4"),u(n,"class","mb-6"),u(b,"class","space-y-6"),u(s,"class","max-w-4xl mx-auto p-8"),u(t,"class","flex-1 bg-gray-50 overflow-y-auto")},m(d,C){W(d,e,C),W(d,t,C),te(l,t,null),a(t,r),a(t,s),a(s,n),a(n,f),a(f,$),a(f,I),a(f,_),re.m(_,null),a(n,O),a(n,k),a(k,y),a(y,w),a(w,p),a(y,P),a(y,D),a(D,H),a(k,Q),R&&R.m(k,null),a(s,K),a(s,b),z&&z.m(b,null),a(b,U),j&&j.m(b,null),a(b,i),N&&N.m(b,null),a(b,V);for(let G=0;G<T.length;G+=1)T[G]&&T[G].m(b,null);W(d,J,C),F&&F.m(d,C),W(d,L,C),X=!0,ue||(ie=[ce(w,"click",o[10]),ce(D,"click",o[11])],ue=!0)},p(d,[C]){const G={};C&32&&(G.historyCount=d[5]),l.$set(G),ge!==(ge=Ee(d))&&(re.d(1),re=ge(d),re&&(re.c(),re.m(_,null))),(!X||C&1&&v!==(v="px-3 py-1 text-sm font-medium rounded transition-colors "+(d[0]==="api"?"bg-white shadow-sm":"text-gray-600")))&&u(w,"class",v),(!X||C&1&&B!==(B="px-3 py-1 text-sm font-medium rounded transition-colors "+(d[0]==="local"?"bg-white shadow-sm":"text-gray-600")))&&u(D,"class",B),d[1].length>0||d[2]||d[3]?R?(R.p(d,C),C&14&&x(R,1)):(R=je(d),R.c(),x(R,1),R.m(k,null)):R&&(be(),S(R,1,1,()=>{R=null}),_e()),d[2]?z?(z.p(d,C),C&4&&x(z,1)):(z=Be(d),z.c(),x(z,1),z.m(b,U)):z&&(be(),S(z,1,1,()=>{z=null}),_e()),d[3]?j?(j.p(d,C),C&8&&x(j,1)):(j=Fe(d),j.c(),x(j,1),j.m(b,i)):j&&(be(),S(j,1,1,()=>{j=null}),_e()),!d[3]&&d[1].length===0?N||(N=Ge(),N.c(),N.m(b,V)):N&&(N.d(1),N=null),C&642&&(Y=Re(d[1]),be(),T=ct(T,C,oe,1,d,Y,q,b,ut,Ke,null,Ue),_e()),d[4]?F?F.p(d,C):(F=Je(d),F.c(),F.m(L.parentNode,L)):F&&(F.d(1),F=null)},i(d){if(!X){x(l.$$.fragment,d),x(R),x(z),x(j);for(let C=0;C<Y.length;C+=1)x(T[C]);X=!0}},o(d){S(l.$$.fragment,d),S(R),S(z),S(j);for(let C=0;C<T.length;C+=1)S(T[C]);X=!1},d(d){d&&(c(e),c(t),c(J),c(L)),ee(l),re.d(),R&&R.d(),z&&z.d(),j&&j.d(),N&&N.d();for(let C=0;C<T.length;C+=1)T[C].d();F&&F.d(d),ue=!1,xe(ie)}}}let Te="Chatterbox";function Pt(o,e){const t=document.createElement("a");t.href=o,t.download=`${e||"audio"}.wav`,document.body.appendChild(t),t.click(),document.body.removeChild(t)}function Qe(o){if(!o)return"0:00";const e=Math.floor(o/60),t=Math.floor(o%60);return`${e}:${t.toString().padStart(2,"0")}`}function Vt(o,e,t){let l="api",r=[],s=_(),n=k(),f=null,$=0;async function E(){try{const i=await fetch("/api/history/load",{method:"GET",credentials:"include"});if(i.ok){const V=await i.json(),T=V.entries.filter(L=>L.entry_type==="setup"),q=V.entries.filter(L=>L.entry_type==="import"),J=V.entries.filter(L=>L.entry_type==="generation");t(2,s=_()),t(3,n=q.length>0?q[q.length-1].code:k()),t(1,r=J.map(L=>({id:L.id,code:L.code,result:L.result_data}))),t(5,$=J.length)}}catch(i){console.error("Error loading history from database:",i),t(1,r=[]),t(2,s=_()),t(3,n=k())}}async function I(){try{await fetch("/api/history/clear",{method:"DELETE",credentials:"include"}),t(1,r=[]),t(2,s=_()),t(3,n=k()),t(5,$=0)}catch(i){console.error("Error clearing history:",i),t(1,r=[]),t(2,s=_()),t(3,n=k()),t(5,$=0)}}function _(){return l==="local"?`pip install huggingface-hub hfstudio uv
|
| 2 |
+
hfstudio start ${Te.toLowerCase()} --port 7861`:"pip install huggingface-hub"}function O(){return l==="local"?'client = InferenceClient(base_url="http://localhost:7861/api/v1")':`client = InferenceClient(
|
| 3 |
+
api_key="YOUR_HF_TOKEN", # Get your token from https://huggingface.co/settings/tokens
|
| 4 |
+
model="${Te.toLowerCase()==="chatterbox"?"ResembleAI/chatterbox":Te.toLowerCase()}",
|
| 5 |
+
)`}function k(){const i=O();return l==="local"?`from huggingface_hub import InferenceClient
|
| 6 |
+
|
| 7 |
+
${i}`:`from huggingface_hub import InferenceClient
|
| 8 |
+
|
| 9 |
+
${i}`}function y(i,V="Copied to clipboard!"){navigator.clipboard.writeText(i).then(()=>{t(4,f=V),setTimeout(()=>{t(4,f=null)},2e3)})}function w(){const i=[];if(s){const q=s.includes("pip install")||s.includes("hfstudio start")?"bash":"";i.push(`## Setup (Run in Terminal)
|
| 10 |
+
|
| 11 |
+
\`\`\`${q}
|
| 12 |
+
${s}
|
| 13 |
+
\`\`\``)}n&&i.push(`## Imports (Python)
|
| 14 |
+
|
| 15 |
+
\`\`\`python
|
| 16 |
+
${n}
|
| 17 |
+
\`\`\``),r.forEach((T,q)=>{i.push(`## Cell ${q+1}
|
| 18 |
+
|
| 19 |
+
\`\`\`python
|
| 20 |
+
${T.code}
|
| 21 |
+
\`\`\``)});const V=i.join(`
|
| 22 |
+
|
| 23 |
+
`);y(V,"All code copied as Markdown!")}function p(i){i.audioElement||(i.audioElement=new Audio(i.result.url),i.audioElement.addEventListener("ended",()=>{i.isPlaying=!1,t(1,r=[...r])})),i.isPlaying?(i.audioElement.pause(),i.isPlaying=!1):(r.forEach(V=>{V!==i&&V.isPlaying&&V.audioElement&&(V.audioElement.pause(),V.isPlaying=!1)}),i.audioElement.play(),i.isPlaying=!0),t(1,r=[...r])}rt(async()=>{await E()});const v=()=>t(0,l="api"),P=()=>t(0,l="local"),D=()=>y(s),H=()=>y(n),B=i=>y(i.code),Q=i=>p(i),K=i=>Pt(i.result.url,i.result.title);function b(i,V,T){nt[i?"unshift":"push"](()=>{V[T].audioElement=i,t(1,r)})}const U=(i,V,T)=>t(1,V[T].isPlaying=!1,r);return o.$$.update=()=>{o.$$.dirty&1&&l&&(t(2,s=_()),t(3,n=k()))},[l,r,s,n,f,$,I,y,w,p,v,P,D,H,B,Q,K,b,U]}class St extends Pe{constructor(e){super(),Ve(this,e,Vt,Tt,Ne,{})}}export{St as component};
|
hfstudio/static/_app/immutable/nodes/4.CtN7iwkG.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{S as Nt,i as Ut,s as At,u as it,v as he,w as M,x as V,y as pe,z as me,A as ge,B as xt,C as Ft,D as Yt,E as Gt,F as Jt,d as u,G as ct,a as Ce,H as Pe,p as d,b as H,c,m as $e,I as Kt,h as T,e as h,f as b,r as ke,g as A,J as Ge,k as x,j as p,t as j,K as Wt,L as ee,n as Be,M as jt,N as Le}from"../chunks/BaOlNwUz.js";import{I as Xt,g as Qt,a as Zt,e as lt}from"../chunks/C7BncMoR.js";import"../chunks/IHki7fMi.js";import{S as er,L as Bt,A as tr,X as rr}from"../chunks/BV8rDFhh.js";import{M as Ht}from"../chunks/4G_mFUFB.js";import{P as qt,a as Ot}from"../chunks/Bm0csYZC.js";function lr(s){let t;const e=s[2].default,r=Ft(e,s,s[3],null);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,o){r&&r.m(l,o),t=!0},p(l,o){r&&r.p&&(!t||o&8)&&Yt(r,e,l,l[3],t?Jt(e,l[3],o,null):Gt(l[3]),null)},i(l){t||(V(r,l),t=!0)},o(l){M(r,l),t=!1},d(l){r&&r.d(l)}}}function sr(s){let t,e;const r=[{name:"square"},s[1],{iconNode:s[0]}];let l={$$slots:{default:[lr]},$$scope:{ctx:s}};for(let o=0;o<r.length;o+=1)l=it(l,r[o]);return t=new Xt({props:l}),{c(){ge(t.$$.fragment)},l(o){me(t.$$.fragment,o)},m(o,a){pe(t,o,a),e=!0},p(o,[a]){const i=a&3?Qt(r,[r[0],a&2&&Zt(o[1]),a&1&&{iconNode:o[0]}]):{};a&8&&(i.$$scope={dirty:a,ctx:o}),t.$set(i)},i(o){e||(V(t.$$.fragment,o),e=!0)},o(o){M(t.$$.fragment,o),e=!1},d(o){he(t,o)}}}function or(s,t,e){let{$$slots:r={},$$scope:l}=t;const o=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];return s.$$set=a=>{e(1,t=it(it({},t),xt(a))),"$$scope"in a&&e(3,l=a.$$scope)},t=xt(t),[o,t,r,l]}class nr extends Nt{constructor(t){super(),Ut(this,t,or,sr,At,{})}}function It(s,t,e){const r=s.slice();return r[44]=t[e],r}function Ct(s,t,e){const r=s.slice();return r[47]=t[e],r[49]=e,r}function Vt(s){let t,e,r,l,o,a;return{c(){t=p("div"),e=p("div"),r=x(),l=p("div"),o=x(),a=p("div"),this.h()},l(i){t=h(i,"DIV",{class:!0});var n=b(t);e=h(n,"DIV",{class:!0,style:!0}),b(e).forEach(u),r=T(n),l=h(n,"DIV",{class:!0,style:!0}),b(l).forEach(u),o=T(n),a=h(n,"DIV",{class:!0,style:!0}),b(a).forEach(u),n.forEach(u),this.h()},h(){d(e,"class","absolute rounded-full border-2 border-orange-300 transition-all duration-75"),ee(e,"width",120+s[7]*120+"px"),ee(e,"height",120+s[7]*120+"px"),ee(e,"opacity",.4+s[7]*.6),d(l,"class","absolute rounded-full border-2 border-orange-200 transition-all duration-100"),ee(l,"width",150+s[7]*150+"px"),ee(l,"height",150+s[7]*150+"px"),ee(l,"opacity",.3+s[7]*.5),d(a,"class","absolute rounded-full border-1 border-orange-100 transition-all duration-125"),ee(a,"width",180+s[7]*180+"px"),ee(a,"height",180+s[7]*180+"px"),ee(a,"opacity",.2+s[7]*.4),d(t,"class","absolute inset-0 flex items-center justify-center")},m(i,n){H(i,t,n),c(t,e),c(t,r),c(t,l),c(t,o),c(t,a)},p(i,n){n[0]&128&&ee(e,"width",120+i[7]*120+"px"),n[0]&128&&ee(e,"height",120+i[7]*120+"px"),n[0]&128&&ee(e,"opacity",.4+i[7]*.6),n[0]&128&&ee(l,"width",150+i[7]*150+"px"),n[0]&128&&ee(l,"height",150+i[7]*150+"px"),n[0]&128&&ee(l,"opacity",.3+i[7]*.5),n[0]&128&&ee(a,"width",180+i[7]*180+"px"),n[0]&128&&ee(a,"height",180+i[7]*180+"px"),n[0]&128&&ee(a,"opacity",.2+i[7]*.4)},d(i){i&&u(t)}}}function ar(s){let t,e;return t=new Ht({props:{size:36,class:"text-white"}}),{c(){ge(t.$$.fragment)},l(r){me(t.$$.fragment,r)},m(r,l){pe(t,r,l),e=!0},p:Be,i(r){e||(V(t.$$.fragment,r),e=!0)},o(r){M(t.$$.fragment,r),e=!1},d(r){he(t,r)}}}function ir(s){let t,e,r,l;return r=new nr({props:{size:36,class:(s[6]>=100?"text-white":"text-orange-700")+" relative z-10"}}),{c(){t=p("div"),e=x(),ge(r.$$.fragment),this.h()},l(o){t=h(o,"DIV",{class:!0,style:!0}),b(t).forEach(u),e=T(o),me(r.$$.fragment,o),this.h()},h(){d(t,"class","absolute bottom-0 left-0 right-0 bg-orange-500 transition-all duration-100 ease-linear rounded-full"),ee(t,"height",s[6]+"%")},m(o,a){H(o,t,a),H(o,e,a),pe(r,o,a),l=!0},p(o,a){(!l||a[0]&64)&&ee(t,"height",o[6]+"%");const i={};a[0]&64&&(i.class=(o[6]>=100?"text-white":"text-orange-700")+" relative z-10"),r.$set(i)},i(o){l||(V(r.$$.fragment,o),l=!0)},o(o){M(r.$$.fragment,o),l=!1},d(o){o&&(u(t),u(e)),he(r,o)}}}function St(s){let t,e,r='<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>',l,o,a='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>',i,n,m=`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 ‴`,_,v;return{c(){t=p("div"),e=p("button"),e.innerHTML=r,l=x(),o=p("p"),o.innerHTML=a,i=x(),n=p("p"),n.innerHTML=m,this.h()},l(g){t=h(g,"DIV",{class:!0});var E=b(t);e=h(E,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),ke(e)!=="svelte-9gdgq5"&&(e.innerHTML=r),l=T(E),o=h(E,"P",{class:!0,"data-svelte-h":!0}),ke(o)!=="svelte-1q58z3k"&&(o.innerHTML=a),i=T(E),n=h(E,"P",{class:!0,"data-svelte-h":!0}),ke(n)!=="svelte-dysk74"&&(n.innerHTML=m),E.forEach(u),this.h()},h(){d(e,"class","absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition-colors"),d(e,"aria-label","Dismiss"),d(o,"class","text-sm font-medium text-gray-700 mb-1 pr-4"),d(n,"class","text-sm text-gray-600 pr-4"),d(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(g,E){H(g,t,E),c(t,e),c(t,l),c(t,o),c(t,i),c(t,n),_||(v=$e(e,"click",s[27]),_=!0)},p:Be,d(g){g&&u(t),_=!1,v()}}}function cr(s){let t,e,r=lt(s[1]),l=[];for(let a=0;a<r.length;a+=1)l[a]=Pt(Ct(s,r,a));const o=a=>M(l[a],1,1,()=>{l[a]=null});return{c(){t=p("div");for(let a=0;a<l.length;a+=1)l[a].c();this.h()},l(a){t=h(a,"DIV",{class:!0});var i=b(t);for(let n=0;n<l.length;n+=1)l[n].l(i);i.forEach(u),this.h()},h(){d(t,"class","space-y-2")},m(a,i){H(a,t,i);for(let n=0;n<l.length;n+=1)l[n]&&l[n].m(t,null);e=!0},p(a,i){if(i[0]&50332422){r=lt(a[1]);let n;for(n=0;n<r.length;n+=1){const m=Ct(a,r,n);l[n]?(l[n].p(m,i),V(l[n],1)):(l[n]=Pt(m),l[n].c(),V(l[n],1),l[n].m(t,null))}for(Le(),n=r.length;n<l.length;n+=1)o(n);Pe()}},i(a){if(!e){for(let i=0;i<r.length;i+=1)V(l[i]);e=!0}},o(a){l=l.filter(Boolean);for(let i=0;i<l.length;i+=1)M(l[i]);e=!1},d(a){a&&u(t),jt(l,a)}}}function ur(s){let t,e,r,l,o="Pick a recording to clone",a,i,n="No recordings yet",m;return e=new Ht({props:{size:32,class:"mx-auto mb-2 opacity-30"}}),{c(){t=p("div"),ge(e.$$.fragment),r=x(),l=p("p"),l.textContent=o,a=x(),i=p("p"),i.textContent=n,this.h()},l(_){t=h(_,"DIV",{class:!0});var v=b(t);me(e.$$.fragment,v),r=T(v),l=h(v,"P",{class:!0,"data-svelte-h":!0}),ke(l)!=="svelte-faot34"&&(l.textContent=o),a=T(v),i=h(v,"P",{class:!0,"data-svelte-h":!0}),ke(i)!=="svelte-kwlxsz"&&(i.textContent=n),v.forEach(u),this.h()},h(){d(l,"class","text-sm"),d(i,"class","text-xs text-gray-400"),d(t,"class","text-center py-8 text-gray-500")},m(_,v){H(_,t,v),pe(e,t,null),c(t,r),c(t,l),c(t,a),c(t,i),m=!0},p:Be,i(_){m||(V(e.$$.fragment,_),m=!0)},o(_){M(e.$$.fragment,_),m=!1},d(_){_&&u(t),he(e)}}}function fr(s){let t,e;return t=new Ot({props:{size:14,class:"text-gray-600"}}),{c(){ge(t.$$.fragment)},l(r){me(t.$$.fragment,r)},m(r,l){pe(t,r,l),e=!0},i(r){e||(V(t.$$.fragment,r),e=!0)},o(r){M(t.$$.fragment,r),e=!1},d(r){he(t,r)}}}function dr(s){let t,e;return t=new qt({props:{size:14,class:"text-gray-600"}}),{c(){ge(t.$$.fragment)},l(r){me(t.$$.fragment,r)},m(r,l){pe(t,r,l),e=!0},i(r){e||(V(t.$$.fragment,r),e=!0)},o(r){M(t.$$.fragment,r),e=!1},d(r){he(t,r)}}}function Pt(s){var ue;let t,e,r,l,o=s[49]+1+"",a,i,n,m,_,v,g,E=s[47].timestamp.toLocaleTimeString()+"",F,z,S,J=((ue=s[2])==null?void 0:ue.id)===s[47].id?"Selected":"Select for cloning",N,P,U,Y,B,K,q;const O=[dr,fr],w=[];function k(C,L){var D;return((D=C[8])==null?void 0:D.id)===C[47].id&&C[9]&&!C[9].paused?0:1}m=k(s),_=w[m]=O[m](s);function I(){return s[28](s[47])}function $(){return s[29](s[47])}return{c(){t=p("div"),e=p("div"),r=p("span"),l=j("Recording "),a=j(o),i=x(),n=p("button"),_.c(),v=x(),g=p("div"),F=j(E),z=x(),S=p("button"),N=j(J),U=x(),this.h()},l(C){t=h(C,"DIV",{class:!0});var L=b(t);e=h(L,"DIV",{class:!0});var D=b(e);r=h(D,"SPAN",{class:!0});var se=b(r);l=A(se,"Recording "),a=A(se,o),se.forEach(u),i=T(D),n=h(D,"BUTTON",{class:!0});var re=b(n);_.l(re),re.forEach(u),D.forEach(u),v=T(L),g=h(L,"DIV",{class:!0});var W=b(g);F=A(W,E),W.forEach(u),z=T(L),S=h(L,"BUTTON",{class:!0});var X=b(S);N=A(X,J),X.forEach(u),U=T(L),L.forEach(u),this.h()},h(){var C,L;d(r,"class","text-sm font-medium text-gray-900"),d(n,"class","p-1 hover:bg-gray-100 rounded transition-colors"),d(e,"class","flex items-center justify-between mb-2"),d(g,"class","text-xs text-gray-500 mb-2"),d(S,"class",P="w-full text-xs px-2 py-1 rounded "+(((C=s[2])==null?void 0:C.id)===s[47].id?"bg-amber-200 text-amber-800":"bg-gray-100 text-gray-700 hover:bg-gray-200")+" transition-colors"),d(t,"class",Y="border rounded-lg p-3 "+(((L=s[2])==null?void 0:L.id)===s[47].id?"border-amber-300 bg-amber-50":"border-gray-200 hover:border-gray-300")+" transition-colors")},m(C,L){H(C,t,L),c(t,e),c(e,r),c(r,l),c(r,a),c(e,i),c(e,n),w[m].m(n,null),c(t,v),c(t,g),c(g,F),c(t,z),c(t,S),c(S,N),c(t,U),B=!0,K||(q=[$e(n,"click",I),$e(S,"click",$)],K=!0)},p(C,L){var se,re,W;s=C;let D=m;m=k(s),m!==D&&(Le(),M(w[D],1,1,()=>{w[D]=null}),Pe(),_=w[m],_||(_=w[m]=O[m](s),_.c()),V(_,1),_.m(n,null)),(!B||L[0]&2)&&E!==(E=s[47].timestamp.toLocaleTimeString()+"")&&Ce(F,E),(!B||L[0]&6)&&J!==(J=((se=s[2])==null?void 0:se.id)===s[47].id?"Selected":"Select for cloning")&&Ce(N,J),(!B||L[0]&6&&P!==(P="w-full text-xs px-2 py-1 rounded "+(((re=s[2])==null?void 0:re.id)===s[47].id?"bg-amber-200 text-amber-800":"bg-gray-100 text-gray-700 hover:bg-gray-200")+" transition-colors"))&&d(S,"class",P),(!B||L[0]&6&&Y!==(Y="border rounded-lg p-3 "+(((W=s[2])==null?void 0:W.id)===s[47].id?"border-amber-300 bg-amber-50":"border-gray-200 hover:border-gray-300")+" transition-colors"))&&d(t,"class",Y)},i(C){B||(V(_),B=!0)},o(C){M(_),B=!1},d(C){C&&u(t),w[m].d(),K=!1,ct(q)}}}function _r(s){let t;return{c(){t=j("Clone")},l(e){t=A(e,"Clone")},m(e,r){H(e,t,r)},i:Be,o:Be,d(e){e&&u(t)}}}function hr(s){let t,e,r;return t=new Bt({props:{size:16,class:"animate-spin"}}),{c(){ge(t.$$.fragment),e=j(`
|
| 3 |
+
Uploading...`)},l(l){me(t.$$.fragment,l),e=A(l,`
|
| 4 |
+
Uploading...`)},m(l,o){pe(t,l,o),H(l,e,o),r=!0},i(l){r||(V(t.$$.fragment,l),r=!0)},o(l){M(t.$$.fragment,l),r=!1},d(l){l&&u(e),he(t,l)}}}function pr(s){let t,e,r;return t=new Bt({props:{size:16,class:"animate-spin"}}),{c(){ge(t.$$.fragment),e=j(`
|
| 5 |
+
Transcribing...`)},l(l){me(t.$$.fragment,l),e=A(l,`
|
| 6 |
+
Transcribing...`)},m(l,o){pe(t,l,o),H(l,e,o),r=!0},i(l){r||(V(t.$$.fragment,l),r=!0)},o(l){M(t.$$.fragment,l),r=!1},d(l){l&&u(e),he(t,l)}}}function mr(s){let t;return{c(){t=j("β")},l(e){t=A(e,"β")},m(e,r){H(e,t,r)},p:Be,d(e){e&&u(t)}}}function gr(s){let t,e;function r(a,i){return i[0]&4&&(t=null),t==null&&(t=!!st(a[2])),t?vr:br}let l=r(s,[-1,-1]),o=l(s);return{c(){o.c(),e=Ge()},l(a){o.l(a),e=Ge()},m(a,i){o.m(a,i),H(a,e,i)},p(a,i){l!==(l=r(a,i))&&(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)))},d(a){a&&u(e),o.d(a)}}}function br(s){let t;return{c(){t=j("β")},l(e){t=A(e,"β")},m(e,r){H(e,t,r)},d(e){e&&u(t)}}}function vr(s){let t;return{c(){t=j("β")},l(e){t=A(e,"β")},m(e,r){H(e,t,r)},d(e){e&&u(t)}}}function yr(s){let t;return{c(){t=j("β")},l(e){t=A(e,"β")},m(e,r){H(e,t,r)},p:Be,d(e){e&&u(t)}}}function kr(s){let t,e;function r(a,i){return i[0]&4&&(t=null),t==null&&(t=!!a[20](a[2])),t?Er:wr}let l=r(s,[-1,-1]),o=l(s);return{c(){o.c(),e=Ge()},l(a){o.l(a),e=Ge()},m(a,i){o.m(a,i),H(a,e,i)},p(a,i){l!==(l=r(a,i))&&(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)))},d(a){a&&u(e),o.d(a)}}}function wr(s){let t;return{c(){t=j("β")},l(e){t=A(e,"β")},m(e,r){H(e,t,r)},d(e){e&&u(t)}}}function Er(s){let t;return{c(){t=j("β")},l(e){t=A(e,"β")},m(e,r){H(e,t,r)},d(e){e&&u(t)}}}function Lt(s){let t,e,r,l=s[10][s[2].id].first_words+"",o,a;return{c(){t=p("div"),e=p("p"),r=j('"'),o=j(l),a=j('..."'),this.h()},l(i){t=h(i,"DIV",{class:!0});var n=b(t);e=h(n,"P",{class:!0});var m=b(e);r=A(m,'"'),o=A(m,l),a=A(m,'..."'),m.forEach(u),n.forEach(u),this.h()},h(){d(e,"class","text-sm text-gray-600 italic"),d(t,"class","mt-3 p-3 bg-gray-50 rounded-lg border")},m(i,n){H(i,t,n),c(t,e),c(e,r),c(e,o),c(e,a)},p(i,n){n[0]&1028&&l!==(l=i[10][i[2].id].first_words+"")&&Ce(o,l)},d(i){i&&u(t)}}}function Dr(s){let t,e,r;return{c(){t=p("div"),e=p("p"),r=j(s[14]),this.h()},l(l){t=h(l,"DIV",{class:!0});var o=b(t);e=h(o,"P",{class:!0});var a=b(e);r=A(a,s[14]),a.forEach(u),o.forEach(u),this.h()},h(){d(e,"class","text-sm text-green-700"),d(t,"class","mt-3 p-3 bg-green-50 rounded-lg border border-green-200")},m(l,o){H(l,t,o),c(t,e),c(e,r)},p(l,o){o[0]&16384&&Ce(r,l[14])},d(l){l&&u(t)}}}function Tr(s){let t,e,r,l,o,a,i;return{c(){t=p("div"),e=p("p"),r=j("Your voice has been saved to a "),l=p("a"),o=j("temporary URL"),i=j(` for 24 hours and will be automatically deleted. You can now use it for text-to-speech
|
| 7 |
+
generation.`),this.h()},l(n){t=h(n,"DIV",{class:!0});var m=b(t);e=h(m,"P",{class:!0});var _=b(e);r=A(_,"Your voice has been saved to a "),l=h(_,"A",{href:!0,target:!0,class:!0});var v=b(l);o=A(v,"temporary URL"),v.forEach(u),i=A(_,` for 24 hours and will be automatically deleted. You can now use it for text-to-speech
|
| 8 |
+
generation.`),_.forEach(u),m.forEach(u),this.h()},h(){d(l,"href",a=s[13][s[2].id].voice_url),d(l,"target","_blank"),d(l,"class","text-green-800 underline hover:text-green-900"),d(e,"class","text-sm text-green-700"),d(t,"class","mt-3 p-3 bg-green-50 rounded-lg border border-green-200")},m(n,m){H(n,t,m),c(t,e),c(e,r),c(e,l),c(l,o),c(e,i)},p(n,m){m[0]&8196&&a!==(a=n[13][n[2].id].voice_url)&&d(l,"href",a)},d(n){n&&u(t)}}}function $t(s){let t,e,r="Your existing voice clone",l,o,a,i=lt(s[15]),n=[];for(let _=0;_<i.length;_+=1)n[_]=Rt(It(s,i,_));const m=_=>M(n[_],1,1,()=>{n[_]=null});return{c(){t=p("div"),e=p("h3"),e.textContent=r,l=x(),o=p("div");for(let _=0;_<n.length;_+=1)n[_].c();this.h()},l(_){t=h(_,"DIV",{class:!0});var v=b(t);e=h(v,"H3",{class:!0,"data-svelte-h":!0}),ke(e)!=="svelte-5uh5wl"&&(e.textContent=r),l=T(v),o=h(v,"DIV",{class:!0});var g=b(o);for(let E=0;E<n.length;E+=1)n[E].l(g);g.forEach(u),v.forEach(u),this.h()},h(){d(e,"class","text-sm font-medium text-gray-700 mb-3"),d(o,"class","space-y-2"),d(t,"class","mt-6 pt-4 border-t border-gray-200")},m(_,v){H(_,t,v),c(t,e),c(t,l),c(t,o);for(let g=0;g<n.length;g+=1)n[g]&&n[g].m(o,null);a=!0},p(_,v){if(v[0]&33587968){i=lt(_[15]);let g;for(g=0;g<i.length;g+=1){const E=It(_,i,g);n[g]?(n[g].p(E,v),V(n[g],1)):(n[g]=Rt(E),n[g].c(),V(n[g],1),n[g].m(o,null))}for(Le(),g=i.length;g<n.length;g+=1)m(g);Pe()}},i(_){if(!a){for(let v=0;v<i.length;v+=1)V(n[v]);a=!0}},o(_){n=n.filter(Boolean);for(let v=0;v<n.length;v+=1)M(n[v]);a=!1},d(_){_&&u(t),jt(n,_)}}}function xr(s){let t,e;return t=new Ot({props:{size:14,class:"text-blue-600"}}),{c(){ge(t.$$.fragment)},l(r){me(t.$$.fragment,r)},m(r,l){pe(t,r,l),e=!0},i(r){e||(V(t.$$.fragment,r),e=!0)},o(r){M(t.$$.fragment,r),e=!1},d(r){he(t,r)}}}function Ir(s){let t,e;return t=new qt({props:{size:14,class:"text-blue-600"}}),{c(){ge(t.$$.fragment)},l(r){me(t.$$.fragment,r)},m(r,l){pe(t,r,l),e=!0},i(r){e||(V(t.$$.fragment,r),e=!0)},o(r){M(t.$$.fragment,r),e=!1},d(r){he(t,r)}}}function Rt(s){let t,e,r,l=s[44].voice_name+"",o,a,i,n,m,_,v,g,E,F=new Date(s[44].expires_at).toLocaleDateString()+"",z,S,J=new Date(s[44].expires_at).toLocaleTimeString()+"",N,P,U,Y,B;const K=[Ir,xr],q=[];function O(k,I){var $;return(($=k[8])==null?void 0:$.id)===k[44].id&&k[9]&&!k[9].paused?0:1}m=O(s),_=q[m]=K[m](s);function w(){return s[30](s[44])}return{c(){t=p("div"),e=p("div"),r=p("span"),o=j(l),a=x(),i=p("div"),n=p("button"),_.c(),v=x(),g=p("div"),E=j("Expires: "),z=j(F),S=j(" at "),N=j(J),P=x(),this.h()},l(k){t=h(k,"DIV",{class:!0});var I=b(t);e=h(I,"DIV",{class:!0});var $=b(e);r=h($,"SPAN",{class:!0});var ue=b(r);o=A(ue,l),ue.forEach(u),a=T($),i=h($,"DIV",{class:!0});var C=b(i);n=h(C,"BUTTON",{class:!0,title:!0});var L=b(n);_.l(L),L.forEach(u),C.forEach(u),$.forEach(u),v=T(I),g=h(I,"DIV",{class:!0});var D=b(g);E=A(D,"Expires: "),z=A(D,F),S=A(D," at "),N=A(D,J),D.forEach(u),P=T(I),I.forEach(u),this.h()},h(){d(r,"class","text-sm font-medium text-blue-900"),d(n,"class","p-1 hover:bg-blue-100 rounded transition-colors"),d(n,"title","Play voice sample"),d(i,"class","flex items-center gap-2"),d(e,"class","flex items-center justify-between mb-2"),d(g,"class","text-xs text-blue-600"),d(t,"class","border rounded-lg p-3 bg-blue-50 border-blue-200")},m(k,I){H(k,t,I),c(t,e),c(e,r),c(r,o),c(e,a),c(e,i),c(i,n),q[m].m(n,null),c(t,v),c(t,g),c(g,E),c(g,z),c(g,S),c(g,N),c(t,P),U=!0,Y||(B=$e(n,"click",w),Y=!0)},p(k,I){s=k,(!U||I[0]&32768)&&l!==(l=s[44].voice_name+"")&&Ce(o,l);let $=m;m=O(s),m!==$&&(Le(),M(q[$],1,1,()=>{q[$]=null}),Pe(),_=q[m],_||(_=q[m]=K[m](s),_.c()),V(_,1),_.m(n,null)),(!U||I[0]&32768)&&F!==(F=new Date(s[44].expires_at).toLocaleDateString()+"")&&Ce(z,F),(!U||I[0]&32768)&&J!==(J=new Date(s[44].expires_at).toLocaleTimeString()+"")&&Ce(N,J)},i(k){U||(V(_),U=!0)},o(k){M(_),U=!1},d(k){k&&u(t),q[m].d(),Y=!1,B()}}}function Mt(s){let t,e,r,l,o,a,i,n,m,_,v,g,E="An error occurred while processing your request",F,z,S,J,N,P,U,Y,B="Close",K,q,O;a=new tr({props:{size:20,class:"text-red-600"}}),S=new rr({props:{size:20,class:"text-gray-500"}});let w=s[5]&&zt(s);return{c(){t=p("div"),e=p("div"),r=p("div"),l=p("div"),o=p("div"),ge(a.$$.fragment),i=x(),n=p("div"),m=p("h3"),_=j(s[4]),v=x(),g=p("p"),g.textContent=E,F=x(),z=p("button"),ge(S.$$.fragment),J=x(),N=p("div"),w&&w.c(),P=x(),U=p("div"),Y=p("button"),Y.textContent=B,this.h()},l(k){t=h(k,"DIV",{class:!0});var I=b(t);e=h(I,"DIV",{class:!0});var $=b(e);r=h($,"DIV",{class:!0});var ue=b(r);l=h(ue,"DIV",{class:!0});var C=b(l);o=h(C,"DIV",{class:!0});var L=b(o);me(a.$$.fragment,L),L.forEach(u),i=T(C),n=h(C,"DIV",{class:!0});var D=b(n);m=h(D,"H3",{class:!0});var se=b(m);_=A(se,s[4]),se.forEach(u),v=T(D),g=h(D,"P",{class:!0,"data-svelte-h":!0}),ke(g)!=="svelte-1l3zl3"&&(g.textContent=E),D.forEach(u),C.forEach(u),F=T(ue),z=h(ue,"BUTTON",{class:!0,title:!0});var re=b(z);me(S.$$.fragment,re),re.forEach(u),ue.forEach(u),J=T($),N=h($,"DIV",{class:!0});var W=b(N);w&&w.l(W),W.forEach(u),P=T($),U=h($,"DIV",{class:!0});var X=b(U);Y=h(X,"BUTTON",{class:!0,"data-svelte-h":!0}),ke(Y)!=="svelte-4sxk6g"&&(Y.textContent=B),X.forEach(u),$.forEach(u),I.forEach(u),this.h()},h(){d(o,"class","w-10 h-10 bg-red-100 rounded-full flex items-center justify-center flex-shrink-0"),d(m,"class","text-lg font-semibold text-gray-900 truncate"),d(g,"class","text-sm text-gray-600"),d(n,"class","min-w-0"),d(l,"class","flex items-center gap-3 min-w-0"),d(z,"class","p-2 hover:bg-red-100 rounded-full transition-colors flex-shrink-0"),d(z,"title","Close"),d(r,"class","flex items-center justify-between p-6 border-b border-gray-200 bg-red-50 flex-shrink-0"),d(N,"class","p-6 overflow-y-auto flex-1 min-h-0"),d(Y,"class","px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"),d(U,"class","flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 flex-shrink-0"),d(e,"class","bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] flex flex-col"),d(t,"class","fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4")},m(k,I){H(k,t,I),c(t,e),c(e,r),c(r,l),c(l,o),pe(a,o,null),c(l,i),c(l,n),c(n,m),c(m,_),c(n,v),c(n,g),c(r,F),c(r,z),pe(S,z,null),c(e,J),c(e,N),w&&w.m(N,null),c(e,P),c(e,U),c(U,Y),K=!0,q||(O=[$e(z,"click",s[21]),$e(Y,"click",s[21])],q=!0)},p(k,I){(!K||I[0]&16)&&Ce(_,k[4]),k[5]?w?w.p(k,I):(w=zt(k),w.c(),w.m(N,null)):w&&(w.d(1),w=null)},i(k){K||(V(a.$$.fragment,k),V(S.$$.fragment,k),K=!0)},o(k){M(a.$$.fragment,k),M(S.$$.fragment,k),K=!1},d(k){k&&u(t),he(a),he(S),w&&w.d(),q=!1,ct(O)}}}function zt(s){let t,e,r="Error Details:",l,o,a;return{c(){t=p("div"),e=p("h4"),e.textContent=r,l=x(),o=p("pre"),a=j(s[5]),this.h()},l(i){t=h(i,"DIV",{class:!0});var n=b(t);e=h(n,"H4",{class:!0,"data-svelte-h":!0}),ke(e)!=="svelte-3lmggt"&&(e.textContent=r),l=T(n),o=h(n,"PRE",{class:!0});var m=b(o);a=A(m,s[5]),m.forEach(u),n.forEach(u),this.h()},h(){d(e,"class","text-sm font-medium text-gray-900 mb-2"),d(o,"class","text-xs text-gray-700 whitespace-pre-wrap font-mono leading-relaxed break-words"),d(t,"class","bg-gray-50 rounded-lg p-4 border")},m(i,n){H(i,t,n),c(t,e),c(t,l),c(t,o),c(o,a)},p(i,n){n[0]&32&&Ce(a,i[5])},d(i){i&&u(t)}}}function Cr(s){let t,e,r,l,o,a,i,n,m="Sample script to read",_,v,g,E,F,z,S,J="I consent to cloning my voice.",N,P=s[19][s[16]]+"",U,Y,B,K,q,O,w,k,I,$,ue=`<p class="text-center"><em>Record your voice for at least 15 seconds to create a voice clone. To prevent
|
| 9 |
+
unauthorized voice cloning, you must start by clearly saying "I consent to cloning my
|
| 10 |
+
voice" β the rest of the text is arbitrary. Try reading the sample above.</em></p>`,C,L,D,se,re,W,X,He,le,be,de,fe,Je,Ke,Ve,Te,y,G,oe,te,Se,ve,_e,ye,Ae,xe,Ie,we,ot,ut;g=new er({props:{size:16}});let ne=s[0]&&Vt(s);const ft=[ir,ar],Re=[];function dt(f,R){return f[0]?0:1}O=dt(s),w=Re[O]=ft[O](s);let ae=!s[17]&&s[18]&&St(s);const _t=[ur,cr],Me=[];function ht(f,R){return f[1].length===0?0:1}W=ht(s),X=Me[W]=_t[W](s);const pt=[pr,hr,_r],je=[];function mt(f,R){return f[11]?0:f[12]?1:2}de=mt(s),fe=je[de]=pt[de](s);function gt(f,R){return f[2]?gr:mr}let We=gt(s),Ee=We(s);function bt(f,R){return f[2]&&f[10][f[2].id]?kr:yr}let Xe=bt(s),De=Xe(s),ie=s[2]&&s[10][s[2].id]&&Lt(s);function vt(f,R){if(f[14]&&f[2]&&f[13][f[2].id])return Tr;if(f[14])return Dr}let qe=vt(s),ce=qe&&qe(s),Q=s[17]&&s[15].length>0&&$t(s),Z=s[3]&&Mt(s);return{c(){t=x(),e=p("div"),r=p("div"),l=p("div"),o=p("div"),a=p("div"),i=p("div"),n=p("span"),n.textContent=m,_=x(),v=p("button"),ge(g.$$.fragment),E=x(),F=p("div"),z=p("p"),S=p("span"),S.textContent=J,N=x(),U=j(P),Y=x(),B=p("div"),ne&&ne.c(),K=x(),q=p("button"),w.c(),I=x(),$=p("div"),$.innerHTML=ue,C=x(),L=p("div"),D=p("div"),ae&&ae.c(),se=x(),re=p("div"),X.c(),He=x(),le=p("div"),be=p("button"),fe.c(),Ke=x(),Ve=p("div"),Te=p("span"),Ee.c(),y=j(`
|
| 11 |
+
at least 15 seconds`),oe=x(),te=p("span"),De.c(),Se=j(`
|
| 12 |
+
includes consent`),_e=x(),ie&&ie.c(),ye=x(),ce&&ce.c(),Ae=x(),Q&&Q.c(),xe=x(),Z&&Z.c(),Ie=Ge(),this.h()},l(f){Kt("svelte-ymar42",document.head).forEach(u),t=T(f),e=h(f,"DIV",{class:!0});var Oe=b(e);r=h(Oe,"DIV",{class:!0});var ze=b(r);l=h(ze,"DIV",{class:!0});var Fe=b(l);o=h(Fe,"DIV",{class:!0});var Ye=b(o);a=h(Ye,"DIV",{class:!0});var Qe=b(a);i=h(Qe,"DIV",{class:!0});var Ze=b(i);n=h(Ze,"SPAN",{class:!0,"data-svelte-h":!0}),ke(n)!=="svelte-i2qskl"&&(n.textContent=m),_=T(Ze),v=h(Ze,"BUTTON",{class:!0,title:!0});var yt=b(v);me(g.$$.fragment,yt),yt.forEach(u),Ze.forEach(u),E=T(Qe),F=h(Qe,"DIV",{class:!0});var kt=b(F);z=h(kt,"P",{});var et=b(z);S=h(et,"SPAN",{class:!0,"data-svelte-h":!0}),ke(S)!=="svelte-teyhel"&&(S.textContent=J),N=T(et),U=A(et,P),et.forEach(u),kt.forEach(u),Qe.forEach(u),Y=T(Ye),B=h(Ye,"DIV",{class:!0});var tt=b(B);ne&&ne.l(tt),K=T(tt),q=h(tt,"BUTTON",{class:!0});var wt=b(q);w.l(wt),wt.forEach(u),tt.forEach(u),I=T(Ye),$=h(Ye,"DIV",{class:!0,"data-svelte-h":!0}),ke($)!=="svelte-ohxuow"&&($.innerHTML=ue),Ye.forEach(u),Fe.forEach(u),C=T(ze),L=h(ze,"DIV",{class:!0});var Et=b(L);D=h(Et,"DIV",{class:!0});var Ne=b(D);ae&&ae.l(Ne),se=T(Ne),re=h(Ne,"DIV",{class:!0});var Dt=b(re);X.l(Dt),Dt.forEach(u),He=T(Ne),le=h(Ne,"DIV",{class:!0});var Ue=b(le);be=h(Ue,"BUTTON",{class:!0});var Tt=b(be);fe.l(Tt),Tt.forEach(u),Ke=T(Ue),Ve=h(Ue,"DIV",{class:!0});var rt=b(Ve);Te=h(rt,"SPAN",{class:!0});var nt=b(Te);Ee.l(nt),y=A(nt,`
|
| 13 |
+
at least 15 seconds`),nt.forEach(u),oe=T(rt),te=h(rt,"SPAN",{class:!0});var at=b(te);De.l(at),Se=A(at,`
|
| 14 |
+
includes consent`),at.forEach(u),rt.forEach(u),_e=T(Ue),ie&&ie.l(Ue),ye=T(Ue),ce&&ce.l(Ue),Ue.forEach(u),Ae=T(Ne),Q&&Q.l(Ne),Ne.forEach(u),Et.forEach(u),ze.forEach(u),Oe.forEach(u),xe=T(f),Z&&Z.l(f),Ie=Ge(),this.h()},h(){document.title="Voice Cloning - HFStudio",d(n,"class","text-sm text-gray-400"),d(v,"class","p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors"),d(v,"title","Try a different sample text"),d(i,"class","absolute top-3 left-3 flex items-center gap-2 z-10"),d(S,"class","bg-yellow-50 px-2 py-1 rounded border border-amber-200"),d(F,"class","w-full h-80 pt-12 px-6 pb-6 bg-white border-2 border-amber-400 rounded-lg text-gray-900 text-lg leading-relaxed overflow-y-auto"),d(a,"class","relative mb-4"),d(q,"class",k="w-24 h-24 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg relative overflow-hidden z-20 cursor-pointer "+(s[0]?"border-4 border-orange-500 bg-transparent":"bg-orange-500 hover:bg-orange-600")),d(B,"class","flex justify-center items-center flex-1 relative"),d($,"class","mb-6"),d(o,"class","flex-1 pb-24 relative flex flex-col"),d(l,"class","flex-1 flex flex-col p-6"),d(re,"class","mb-4"),be.disabled=Je=!s[2]||s[11]||s[12],d(be,"class","w-full px-4 py-2 bg-gradient-to-r from-amber-400 to-orange-500 text-white rounded-lg font-medium hover:from-amber-500 hover:to-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2"),d(Te,"class",G="flex items-center gap-1 "+(s[2]?st(s[2])?"text-green-600":"text-red-600":"text-gray-400")),d(te,"class",ve="flex items-center gap-1 "+(s[2]?s[20](s[2])?"text-green-600":s[10][s[2].id]?"text-red-600":"text-gray-400":"text-gray-400")),d(Ve,"class","mt-3 text-sm flex items-center gap-4"),d(le,"class","mt-6 pt-4 border-t border-gray-200"),d(D,"class","p-3 h-full overflow-y-auto"),d(L,"class","w-80 border-l border-gray-200 bg-white h-full overflow-hidden"),d(r,"class","flex-1 flex"),d(e,"class","flex flex-col h-full")},m(f,R){H(f,t,R),H(f,e,R),c(e,r),c(r,l),c(l,o),c(o,a),c(a,i),c(i,n),c(i,_),c(i,v),pe(g,v,null),c(a,E),c(a,F),c(F,z),c(z,S),c(z,N),c(z,U),c(o,Y),c(o,B),ne&&ne.m(B,null),c(B,K),c(B,q),Re[O].m(q,null),c(o,I),c(o,$),c(r,C),c(r,L),c(L,D),ae&&ae.m(D,null),c(D,se),c(D,re),Me[W].m(re,null),c(D,He),c(D,le),c(le,be),je[de].m(be,null),c(le,Ke),c(le,Ve),c(Ve,Te),Ee.m(Te,null),c(Te,y),c(Ve,oe),c(Ve,te),De.m(te,null),c(te,Se),c(le,_e),ie&&ie.m(le,null),c(le,ye),ce&&ce.m(le,null),c(D,Ae),Q&&Q.m(D,null),H(f,xe,R),Z&&Z.m(f,R),H(f,Ie,R),we=!0,ot||(ut=[$e(v,"click",s[22]),$e(q,"click",s[23]),$e(be,"click",s[26])],ot=!0)},p(f,R){(!we||R[0]&65536)&&P!==(P=f[19][f[16]]+"")&&Ce(U,P),f[0]?ne?ne.p(f,R):(ne=Vt(f),ne.c(),ne.m(B,K)):ne&&(ne.d(1),ne=null);let Oe=O;O=dt(f),O===Oe?Re[O].p(f,R):(Le(),M(Re[Oe],1,1,()=>{Re[Oe]=null}),Pe(),w=Re[O],w?w.p(f,R):(w=Re[O]=ft[O](f),w.c()),V(w,1),w.m(q,null)),(!we||R[0]&1&&k!==(k="w-24 h-24 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg relative overflow-hidden z-20 cursor-pointer "+(f[0]?"border-4 border-orange-500 bg-transparent":"bg-orange-500 hover:bg-orange-600")))&&d(q,"class",k),!f[17]&&f[18]?ae?ae.p(f,R):(ae=St(f),ae.c(),ae.m(D,se)):ae&&(ae.d(1),ae=null);let ze=W;W=ht(f),W===ze?Me[W].p(f,R):(Le(),M(Me[ze],1,1,()=>{Me[ze]=null}),Pe(),X=Me[W],X?X.p(f,R):(X=Me[W]=_t[W](f),X.c()),V(X,1),X.m(re,null));let Fe=de;de=mt(f),de!==Fe&&(Le(),M(je[Fe],1,1,()=>{je[Fe]=null}),Pe(),fe=je[de],fe||(fe=je[de]=pt[de](f),fe.c()),V(fe,1),fe.m(be,null)),(!we||R[0]&6148&&Je!==(Je=!f[2]||f[11]||f[12]))&&(be.disabled=Je),We===(We=gt(f))&&Ee?Ee.p(f,R):(Ee.d(1),Ee=We(f),Ee&&(Ee.c(),Ee.m(Te,y))),(!we||R[0]&4&&G!==(G="flex items-center gap-1 "+(f[2]?st(f[2])?"text-green-600":"text-red-600":"text-gray-400")))&&d(Te,"class",G),Xe===(Xe=bt(f))&&De?De.p(f,R):(De.d(1),De=Xe(f),De&&(De.c(),De.m(te,Se))),(!we||R[0]&1028&&ve!==(ve="flex items-center gap-1 "+(f[2]?f[20](f[2])?"text-green-600":f[10][f[2].id]?"text-red-600":"text-gray-400":"text-gray-400")))&&d(te,"class",ve),f[2]&&f[10][f[2].id]?ie?ie.p(f,R):(ie=Lt(f),ie.c(),ie.m(le,ye)):ie&&(ie.d(1),ie=null),qe===(qe=vt(f))&&ce?ce.p(f,R):(ce&&ce.d(1),ce=qe&&qe(f),ce&&(ce.c(),ce.m(le,null))),f[17]&&f[15].length>0?Q?(Q.p(f,R),R[0]&163840&&V(Q,1)):(Q=$t(f),Q.c(),V(Q,1),Q.m(D,null)):Q&&(Le(),M(Q,1,1,()=>{Q=null}),Pe()),f[3]?Z?(Z.p(f,R),R[0]&8&&V(Z,1)):(Z=Mt(f),Z.c(),V(Z,1),Z.m(Ie.parentNode,Ie)):Z&&(Le(),M(Z,1,1,()=>{Z=null}),Pe())},i(f){we||(V(g.$$.fragment,f),V(w),V(X),V(fe),V(Q),V(Z),we=!0)},o(f){M(g.$$.fragment,f),M(w),M(X),M(fe),M(Q),M(Z),we=!1},d(f){f&&(u(t),u(e),u(xe),u(Ie)),he(g),ne&&ne.d(),Re[O].d(),ae&&ae.d(),Me[W].d(),je[de].d(),Ee.d(),De.d(),ie&&ie.d(),ce&&ce.d(),Q&&Q.d(),Z&&Z.d(f),ot=!1,ct(ut)}}}function st(s){return s&&s.duration>=15}function Vr(s,t,e){let r=!1,l=[],o=null,a=[],i=null,n=[],m=!1,_="",v="",g=0,E=0,F=null,z=0,S=null,J=null,N=null,P=null,U={},Y=!1,B=!1,K={},q="",O=[];const w=["There's a quiet kind of magic in the early hours of the morning, when the world is still half-asleep and the air feels crisp with possibility. The hum of the refrigerator becomes a rhythm, the ticking of the clock a heartbeat, and for a brief moment, everything feels perfectly in sync.","The aroma of fresh coffee dances through the kitchen as sunlight streams through translucent curtains, casting golden patterns on weathered wooden floors. Steam rises from the ceramic mug like incense, creating a small sanctuary of warmth and comfort in the midst of a busy day.","Ocean waves crash against weathered cliffs with relentless determination, their white foam reaching toward the endless sky. Seabirds call out across the salt-scented breeze, their cries echoing off ancient stone formations that have stood witness to countless storms and seasons."];let k=0,I=!1,$=!1;function ue(y){if(!y)return!1;const G=U[y.id];return G&&G.consent_detected}function C(y,G=""){e(4,_=y),e(5,v=G),e(3,m=!0)}function L(){e(3,m=!1),e(4,_=""),e(5,v="")}function D(){e(16,k=(k+1)%w.length)}async function se(){try{const y=await fetch("/api/auth/user",{credentials:"include"});if(y.ok){const G=await y.json(),oe=I;e(17,I=G.authenticated),I&&!oe?await fe():!I&&oe&&e(15,O=[])}else e(17,I=!1),e(15,O=[])}catch{e(17,I=!1),e(15,O=[])}}async function re(){if(!I){e(18,$=!0);return}try{let ve=function(){if(!r||!J)return;J.getByteFrequencyData(Se);let _e=0;for(let ye=0;ye<te;ye++)_e+=Se[ye];e(7,z=_e/te/255),requestAnimationFrame(ve)};const y=await navigator.mediaDevices.getUserMedia({audio:!0});let G={};MediaRecorder.isTypeSupported("audio/mp3")?G.mimeType="audio/mp3":MediaRecorder.isTypeSupported("audio/mpeg")?G.mimeType="audio/mpeg":MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?G.mimeType="audio/webm;codecs=opus":MediaRecorder.isTypeSupported("audio/webm")&&(G.mimeType="audio/webm"),i=new MediaRecorder(y,G),n=[],a=[],e(6,E=0),e(7,z=0),S=new(window.AudioContext||window.webkitAudioContext),J=S.createAnalyser(),S.createMediaStreamSource(y).connect(J),J.fftSize=256;const te=J.frequencyBinCount,Se=new Uint8Array(te);i.ondataavailable=_e=>{n.push(_e.data)},i.onstop=()=>{const _e=new Blob(n,{type:G.mimeType||"audio/webm"}),ye=URL.createObjectURL(_e),Ae={id:Date.now(),url:ye,blob:_e,timestamp:new Date,duration:E/100*15};e(1,l=[...l,Ae]),y.getTracks().forEach(xe=>xe.stop()),S&&(S.close(),S=null),e(6,E=0),e(7,z=0)},i.start(),e(0,r=!0),ve(),F=setInterval(()=>{if(!r){clearInterval(F);return}e(6,E+=100/15/10),E>=100&&e(6,E=100)},100)}catch(y){console.error("Error accessing microphone:",y),C("Microphone Error","Could not access microphone. Please check permissions.")}}function W(){i&&i.state==="recording"&&(i.stop(),e(0,r=!1),a=[],F&&(clearInterval(F),F=null))}function X(){r?W():re()}function He(y){e(2,o=y)}function le(y){if((N==null?void 0:N.id)===y.id&&P&&!P.paused){P.pause(),e(8,N=null);return}P&&(P.pause(),e(9,P=null)),e(9,P=new Audio(y.url)),e(8,N=y),P.addEventListener("ended",()=>{e(8,N=null),e(9,P=null)}),P.addEventListener("pause",()=>{P&&P.ended&&(e(8,N=null),e(9,P=null))}),P.play()}async function be(){if(!o){C("Clone Error","Please select a recording.");return}e(11,Y=!0),e(14,q="");try{const y=new FormData;y.append("audio_file",o.blob,"recording.mp3");const G=await fetch("/api/voice/transcribe",{method:"POST",credentials:"include",body:y});if(!G.ok){const te=await G.text();throw new Error(`HTTP error! status: ${G.status}, response: ${te}`)}const oe=await G.json();if(oe.success){e(10,U[o.id]={transcript:oe.transcript,first_words:oe.first_words,consent_detected:oe.consent_detected},U),e(10,U={...U});const te=st(o),Se=oe.consent_detected;if(te&&Se){e(11,Y=!1),e(12,B=!0);try{const ve=new FormData;ve.append("audio_file",o.blob,"recording.mp3");const _e=`Voice_${Date.now()}`,ye=encodeURIComponent(oe.transcript),Ae=Math.floor(o.duration),xe=await fetch(`/api/voice/upload?voice_name=${_e}&transcript=${ye}&duration=${Ae}`,{method:"POST",credentials:"include",body:ve});if(!xe.ok){const we=await xe.text();throw new Error(`Upload failed: ${we}`)}const Ie=await xe.json();Ie.success?(e(13,K[o.id]=Ie,K),e(13,K={...K}),e(14,q="Your voice has been saved to a temporary URL for 24 hours and will be automatically deleted. You can now use it for text-to-speech generation."),await fe()):C("Upload Error",Ie.error||"Failed to upload voice")}catch(ve){C("Upload Error",`Failed to upload voice: ${ve.message}`)}finally{e(12,B=!1)}}}else C("Transcription Error",oe.error||"Failed to transcribe audio")}catch(y){C("Network Error",`Failed to process recording: ${y.message}`)}finally{B||e(11,Y=!1)}}async function de(){try{const y=await fetch("/api/history/load",{method:"GET",credentials:"include"});y.ok&&(g=(await y.json()).entries.filter(te=>te.entry_type==="generation").length)}catch(y){console.error("Error loading history count:",y),g=0}}async function fe(){if(I)try{const y=await fetch("/api/voice/user-voices",{method:"GET",credentials:"include"});if(y.ok){const G=await y.json();e(15,O=G.voices)}}catch(y){console.error("Error loading user voices:",y),e(15,O=[])}}return Wt(async()=>{await se(),await de(),await fe()}),[r,l,o,m,_,v,E,z,N,P,U,Y,B,K,q,O,k,I,$,w,ue,L,D,X,He,le,be,()=>e(18,$=!1),y=>le(y),y=>He(y),y=>le({url:y.voice_url,id:y.id})]}class zr extends Nt{constructor(t){super(),Ut(this,t,Vr,Cr,At,{},null,[-1,-1])}}export{zr as component};
|
hfstudio/static/_app/version.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":"
|
|
|
|
| 1 |
+
{"version":"1761298999117"}
|
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/
|
| 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.CyPXq5tx.js">
|
| 10 |
+
<link rel="modulepreload" href="/_app/immutable/chunks/B0bP6sS8.js">
|
| 11 |
+
<link rel="modulepreload" href="/_app/immutable/chunks/BaOlNwUz.js">
|
| 12 |
+
<link rel="modulepreload" href="/_app/immutable/entry/app.obbrCMnr.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_15f9ehl = {
|
| 20 |
base: ""
|
| 21 |
};
|
| 22 |
|
| 23 |
const element = document.currentScript.parentElement;
|
| 24 |
|
| 25 |
Promise.all([
|
| 26 |
+
import("/_app/immutable/entry/start.CyPXq5tx.js"),
|
| 27 |
+
import("/_app/immutable/entry/app.obbrCMnr.js")
|
| 28 |
]).then(([kit, app]) => {
|
| 29 |
kit.start(app, element);
|
| 30 |
});
|