Spaces:
Runtime error
Runtime error
Ron Au
commited on
Commit
β’
075b025
1
Parent(s):
339a63f
build: merge local branch for Space
Browse files- README.md +4 -6
- app.py +158 -28
- requirements.txt +7 -7
- source/constants.py +23 -4
- source/ui/src/lib/ComposeButton.svelte +81 -19
- source/ui/src/lib/Notes.svelte +81 -46
- source/ui/src/lib/StyleOptions.svelte +1 -1
- source/ui/src/lib/config.json +2 -1
- source/ui/src/lib/util.ts +0 -4
- source/ui/src/routes/index.svelte +1 -1
- source/ui/static/compose.png +0 -0
- source/ui/static/download.wav +0 -0
- source/ui/static/favicon.png +0 -0
- source/ui/static/hugging-face-headphones.png +0 -0
- source/ui/static/reggae.svg +1 -0
- source/ui/static/script.js +0 -67
- source/ui/svelte.config.js +4 -1
- start.py +3 -0
- static/_app/assets/pages/{index.svelte-45cd6b36.css β index.svelte-10d60411.css} +1 -1
- static/_app/chunks/{index-f9918abc.js β index-7a30815e.js} +1 -1
- static/_app/chunks/index-c61749f5.js +0 -4
- static/_app/chunks/index-f8f7cfca.js +4 -0
- static/_app/{error.svelte-83166d57.js β error.svelte-2573bba8.js} +1 -1
- static/_app/{layout.svelte-0c060267.js β layout.svelte-3942c837.js} +1 -1
- static/_app/manifest.json +16 -16
- static/_app/pages/index.svelte-416adc10.js +0 -5
- static/_app/pages/index.svelte-b34d5edf.js +5 -0
- static/_app/start-5e34eb6b.js +1 -0
- static/_app/start-b4f523d8.js +0 -1
- static/_app/version.json +1 -1
- static/compose.png +0 -0
- static/download.wav +0 -0
- static/favicon.png +0 -0
- static/hugging-face-headphones.png +0 -0
- {templates β static}/index.html +25 -25
- static/reggae.svg +1 -0
- static/script.js +0 -67
README.md
CHANGED
@@ -1,12 +1,10 @@
|
|
1 |
---
|
2 |
title: Composer
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 2.9.4
|
8 |
-
app_file:
|
9 |
pinned: false
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
|
|
|
1 |
---
|
2 |
title: Composer
|
3 |
+
emoji: πͺ
|
4 |
+
colorFrom: gray
|
5 |
+
colorTo: red
|
6 |
sdk: gradio
|
7 |
sdk_version: 2.9.4
|
8 |
+
app_file: start.py
|
9 |
pinned: false
|
10 |
---
|
|
|
|
app.py
CHANGED
@@ -14,12 +14,18 @@
|
|
14 |
|
15 |
# Lint as: python3
|
16 |
|
17 |
-
from
|
|
|
|
|
|
|
18 |
from PIL import Image
|
19 |
import os
|
20 |
import io
|
21 |
import random
|
22 |
import base64
|
|
|
|
|
|
|
23 |
import torch
|
24 |
import wave
|
25 |
from source.logging import create_logger
|
@@ -34,35 +40,108 @@ auth_token = os.getenv("authtoken")
|
|
34 |
|
35 |
# Loading the model and its tokenizer.
|
36 |
logger.info("Loading tokenizer and model...")
|
37 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
38 |
-
|
|
|
|
|
|
|
|
|
39 |
logger.info("Done.")
|
40 |
|
41 |
-
|
|
|
42 |
logger.info("Creating app...")
|
43 |
-
app =
|
|
|
44 |
logger.info("Done.")
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
)
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
-
@app.route("/compose", methods=["POST"])
|
58 |
-
def compose():
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
density = params["density"]
|
64 |
-
temperature = params["temperature"]
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
instruments = constants.get_instruments(music_style)
|
67 |
density = constants.get_density(density)
|
68 |
temperature = constants.get_temperature(temperature)
|
@@ -110,23 +189,24 @@ def compose():
|
|
110 |
img_io.close()
|
111 |
|
112 |
# Return.
|
113 |
-
return
|
114 |
"tokens": generated_sequence,
|
115 |
"audio": "data:audio/wav;base64," + audio_data_base64,
|
116 |
"image": "data:image/png;base64," + image_data_base64,
|
117 |
-
"status": "OK"
|
118 |
-
}
|
119 |
|
120 |
|
121 |
def generate_sequence(instruments, density, temperature):
|
122 |
-
|
123 |
instruments = instruments[::]
|
124 |
random.shuffle(instruments)
|
125 |
|
126 |
generated_ids = tokenizer.encode("PIECE_START", return_tensors="pt")[0]
|
127 |
|
128 |
for instrument in instruments:
|
129 |
-
more_ids = tokenizer.encode(
|
|
|
|
|
130 |
generated_ids = torch.cat((generated_ids, more_ids))
|
131 |
generated_ids = generated_ids.unsqueeze(0)
|
132 |
|
@@ -135,12 +215,62 @@ def generate_sequence(instruments, density, temperature):
|
|
135 |
max_length=2048,
|
136 |
do_sample=True,
|
137 |
temperature=temperature,
|
138 |
-
eos_token_id=tokenizer.encode("TRACK_END")[0]
|
139 |
)[0]
|
140 |
|
141 |
generated_sequence = tokenizer.decode(generated_ids)
|
|
|
|
|
142 |
return generated_sequence
|
143 |
|
144 |
|
145 |
-
|
146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
# Lint as: python3
|
16 |
|
17 |
+
from fastapi import BackgroundTasks, FastAPI
|
18 |
+
from fastapi.staticfiles import StaticFiles
|
19 |
+
from fastapi.responses import FileResponse
|
20 |
+
from pydantic import BaseModel
|
21 |
from PIL import Image
|
22 |
import os
|
23 |
import io
|
24 |
import random
|
25 |
import base64
|
26 |
+
from time import time
|
27 |
+
from statistics import mean
|
28 |
+
from collections import OrderedDict
|
29 |
import torch
|
30 |
import wave
|
31 |
from source.logging import create_logger
|
|
|
40 |
|
41 |
# Loading the model and its tokenizer.
|
42 |
logger.info("Loading tokenizer and model...")
|
43 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
44 |
+
"ai-guru/lakhclean_mmmtrack_4bars_d-2048", use_auth_token=auth_token
|
45 |
+
)
|
46 |
+
model = AutoModelForCausalLM.from_pretrained(
|
47 |
+
"ai-guru/lakhclean_mmmtrack_4bars_d-2048", use_auth_token=auth_token
|
48 |
+
)
|
49 |
logger.info("Done.")
|
50 |
|
51 |
+
|
52 |
+
# Create the app
|
53 |
logger.info("Creating app...")
|
54 |
+
app = FastAPI(docs_url=None, redoc_url=None)
|
55 |
+
app.mount("/static", StaticFiles(directory="static"), name="static")
|
56 |
logger.info("Done.")
|
57 |
|
58 |
+
|
59 |
+
class Options(BaseModel):
|
60 |
+
music_style: str
|
61 |
+
density: str
|
62 |
+
temperature: str
|
63 |
+
|
64 |
+
|
65 |
+
class NewTask(BaseModel):
|
66 |
+
music_style = "synth"
|
67 |
+
density = "medium"
|
68 |
+
temperature = "medium"
|
69 |
+
|
70 |
+
|
71 |
+
def get_place_in_queue(task_id):
|
72 |
+
queued_tasks = list(
|
73 |
+
task
|
74 |
+
for task in tasks.values()
|
75 |
+
if task["status"] == "queued" or task["status"] == "processing"
|
76 |
+
)
|
77 |
+
|
78 |
+
queued_tasks.sort(key=lambda task: task["created_at"])
|
79 |
+
|
80 |
+
queued_task_ids = list(task["task_id"] for task in queued_tasks)
|
81 |
+
|
82 |
+
try:
|
83 |
+
return queued_task_ids.index(task_id) + 1
|
84 |
+
except:
|
85 |
+
return 0
|
86 |
+
|
87 |
+
|
88 |
+
def calculate_eta(task_id):
|
89 |
+
total_durations = list(
|
90 |
+
task["completed_at"] - task["started_at"]
|
91 |
+
for task in tasks.values()
|
92 |
+
if "completed_at" in task and task["status"] == "completed"
|
93 |
)
|
94 |
|
95 |
+
initial_place_in_queue = tasks[task_id]["initial_place_in_queue"]
|
96 |
+
|
97 |
+
if len(total_durations):
|
98 |
+
eta = initial_place_in_queue * mean(total_durations)
|
99 |
+
else:
|
100 |
+
eta = initial_place_in_queue * 35
|
101 |
+
|
102 |
+
return round(eta, 1)
|
103 |
+
|
104 |
+
|
105 |
+
def next_task(task_id):
|
106 |
+
tasks[task_id]["completed_at"] = time()
|
107 |
+
|
108 |
+
queued_tasks = list(task for task in tasks.values() if task["status"] == "queued")
|
109 |
+
|
110 |
+
if queued_tasks:
|
111 |
+
print(
|
112 |
+
f"{task_id} {tasks[task_id]['status']}. Task/s remaining: {len(queued_tasks)}"
|
113 |
+
)
|
114 |
+
process_task(queued_tasks[0]["task_id"])
|
115 |
|
|
|
|
|
116 |
|
117 |
+
def process_task(task_id):
|
118 |
+
if "processing" in list(task["status"] for task in tasks.values()):
|
119 |
+
return
|
|
|
|
|
120 |
|
121 |
+
if tasks[task_id]["last_poll"] and time() - tasks[task_id]["last_poll"] > 30:
|
122 |
+
tasks[task_id]["status"] = "abandoned"
|
123 |
+
next_task(task_id)
|
124 |
+
|
125 |
+
tasks[task_id]["status"] = "processing"
|
126 |
+
tasks[task_id]["started_at"] = time()
|
127 |
+
print(f"Processing {task_id}")
|
128 |
+
|
129 |
+
try:
|
130 |
+
tasks[task_id]["output"] = compose(
|
131 |
+
tasks[task_id]["music_style"],
|
132 |
+
tasks[task_id]["density"],
|
133 |
+
tasks[task_id]["temperature"],
|
134 |
+
)
|
135 |
+
except Exception as ex:
|
136 |
+
tasks[task_id]["status"] = "failed"
|
137 |
+
tasks[task_id]["error"] = repr(ex)
|
138 |
+
else:
|
139 |
+
tasks[task_id]["status"] = "completed"
|
140 |
+
finally:
|
141 |
+
next_task(task_id)
|
142 |
+
|
143 |
+
|
144 |
+
def compose(music_style, density, temperature):
|
145 |
instruments = constants.get_instruments(music_style)
|
146 |
density = constants.get_density(density)
|
147 |
temperature = constants.get_temperature(temperature)
|
|
|
189 |
img_io.close()
|
190 |
|
191 |
# Return.
|
192 |
+
return {
|
193 |
"tokens": generated_sequence,
|
194 |
"audio": "data:audio/wav;base64," + audio_data_base64,
|
195 |
"image": "data:image/png;base64," + image_data_base64,
|
196 |
+
"status": "OK",
|
197 |
+
}
|
198 |
|
199 |
|
200 |
def generate_sequence(instruments, density, temperature):
|
|
|
201 |
instruments = instruments[::]
|
202 |
random.shuffle(instruments)
|
203 |
|
204 |
generated_ids = tokenizer.encode("PIECE_START", return_tensors="pt")[0]
|
205 |
|
206 |
for instrument in instruments:
|
207 |
+
more_ids = tokenizer.encode(
|
208 |
+
f"TRACK_START INST={instrument} DENSITY={density}", return_tensors="pt"
|
209 |
+
)[0]
|
210 |
generated_ids = torch.cat((generated_ids, more_ids))
|
211 |
generated_ids = generated_ids.unsqueeze(0)
|
212 |
|
|
|
215 |
max_length=2048,
|
216 |
do_sample=True,
|
217 |
temperature=temperature,
|
218 |
+
eos_token_id=tokenizer.encode("TRACK_END")[0],
|
219 |
)[0]
|
220 |
|
221 |
generated_sequence = tokenizer.decode(generated_ids)
|
222 |
+
print("GENERATING COMPLETE")
|
223 |
+
print(generate_sequence)
|
224 |
return generated_sequence
|
225 |
|
226 |
|
227 |
+
tasks = OrderedDict()
|
228 |
+
|
229 |
+
# Route for the loading page.
|
230 |
+
@app.head("/")
|
231 |
+
@app.route("/")
|
232 |
+
def index(request):
|
233 |
+
return FileResponse(path="static/index.html", media_type="text/html")
|
234 |
+
|
235 |
+
|
236 |
+
@app.post("/task/create")
|
237 |
+
def create_task(background_tasks: BackgroundTasks, new_task: NewTask):
|
238 |
+
created_at = time()
|
239 |
+
|
240 |
+
task_id = f"{str(created_at)}_{new_task.music_style}"
|
241 |
+
|
242 |
+
tasks[task_id] = OrderedDict(
|
243 |
+
{
|
244 |
+
"task_id": task_id,
|
245 |
+
"status": "queued",
|
246 |
+
"eta": None,
|
247 |
+
"created_at": created_at,
|
248 |
+
"started_at": None,
|
249 |
+
"completed_at": None,
|
250 |
+
"last_poll": None,
|
251 |
+
"poll_count": 0,
|
252 |
+
"initial_place_in_queue": None,
|
253 |
+
"place_in_queue": None,
|
254 |
+
"music_style": new_task.music_style,
|
255 |
+
"density": new_task.density,
|
256 |
+
"temperature": new_task.temperature,
|
257 |
+
"output": None,
|
258 |
+
}
|
259 |
+
)
|
260 |
+
|
261 |
+
tasks[task_id]["initial_place_in_queue"] = get_place_in_queue(task_id)
|
262 |
+
tasks[task_id]["eta"] = calculate_eta(task_id)
|
263 |
+
|
264 |
+
background_tasks.add_task(process_task, task_id)
|
265 |
+
|
266 |
+
return tasks[task_id]
|
267 |
+
|
268 |
+
|
269 |
+
@app.get("/task/poll")
|
270 |
+
def poll_task(task_id: str):
|
271 |
+
tasks[task_id]["place_in_queue"] = get_place_in_queue(task_id)
|
272 |
+
tasks[task_id]["eta"] = calculate_eta(task_id)
|
273 |
+
tasks[task_id]["last_poll"] = time()
|
274 |
+
tasks[task_id]["poll_count"] += 1
|
275 |
+
|
276 |
+
return tasks[task_id]
|
requirements.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
transformers
|
2 |
-
tokenizers
|
3 |
-
datasets
|
4 |
-
|
5 |
-
torch
|
6 |
-
pyfluidsynth
|
7 |
-
|
|
|
1 |
+
transformers==4.18.*
|
2 |
+
tokenizers==0.12.*
|
3 |
+
datasets==2.1.*
|
4 |
+
fastapi[all]==0.75.*
|
5 |
+
torch==1.11.*
|
6 |
+
pyfluidsynth==1.3.*
|
7 |
+
note-seq==0.0.*
|
source/constants.py
CHANGED
@@ -27,6 +27,10 @@ compose_styles_config = {
|
|
27 |
"readable": "Country",
|
28 |
"instruments": ["DRUMS", "22", "32", "25"],
|
29 |
},
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
densities_config = {
|
@@ -63,23 +67,38 @@ temperatures_config = {
|
|
63 |
},
|
64 |
}
|
65 |
|
|
|
66 |
def get_compose_styles_for_ui():
|
67 |
-
compose_styles = [
|
|
|
|
|
|
|
68 |
return compose_styles
|
69 |
|
|
|
70 |
def get_densities_for_ui():
|
71 |
-
densities = [
|
|
|
|
|
|
|
72 |
return densities
|
73 |
|
|
|
74 |
def get_temperatures_for_ui():
|
75 |
-
temperatures = [
|
|
|
|
|
|
|
76 |
return temperatures
|
77 |
|
|
|
78 |
def get_instruments(key):
|
79 |
return compose_styles_config[key]["instruments"]
|
80 |
|
|
|
81 |
def get_density(key):
|
82 |
return densities_config[key]["density"]
|
83 |
|
|
|
84 |
def get_temperature(key):
|
85 |
-
return temperatures_config[key]["temperature"]
|
|
|
27 |
"readable": "Country",
|
28 |
"instruments": ["DRUMS", "22", "32", "25"],
|
29 |
},
|
30 |
+
"reggae": {
|
31 |
+
"readable": "Reggae-esque",
|
32 |
+
"instruments": ["114", "28", "1"],
|
33 |
+
},
|
34 |
}
|
35 |
|
36 |
densities_config = {
|
|
|
67 |
},
|
68 |
}
|
69 |
|
70 |
+
|
71 |
def get_compose_styles_for_ui():
|
72 |
+
compose_styles = [
|
73 |
+
[key, compose_styles_config[key]["readable"]]
|
74 |
+
for key, value in compose_styles_config.items()
|
75 |
+
]
|
76 |
return compose_styles
|
77 |
|
78 |
+
|
79 |
def get_densities_for_ui():
|
80 |
+
densities = [
|
81 |
+
[key, densities_config[key]["readable"]]
|
82 |
+
for key, value in densities_config.items()
|
83 |
+
]
|
84 |
return densities
|
85 |
|
86 |
+
|
87 |
def get_temperatures_for_ui():
|
88 |
+
temperatures = [
|
89 |
+
[key, temperatures_config[key]["readable"]]
|
90 |
+
for key, value in temperatures_config.items()
|
91 |
+
]
|
92 |
return temperatures
|
93 |
|
94 |
+
|
95 |
def get_instruments(key):
|
96 |
return compose_styles_config[key]["instruments"]
|
97 |
|
98 |
+
|
99 |
def get_density(key):
|
100 |
return densities_config[key]["density"]
|
101 |
|
102 |
+
|
103 |
def get_temperature(key):
|
104 |
+
return temperatures_config[key]["temperature"]
|
source/ui/src/lib/ComposeButton.svelte
CHANGED
@@ -1,30 +1,92 @@
|
|
1 |
<script lang="ts">
|
2 |
import { density, composing, style, temperature, notesImage, notesTokens, audioBlob } from '$lib/stores';
|
|
|
3 |
|
4 |
-
const
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
|
|
|
|
|
|
25 |
$notesImage = image;
|
26 |
$notesTokens = tokens;
|
27 |
-
|
|
|
28 |
} catch (err) {
|
29 |
console.error(err);
|
30 |
} finally {
|
@@ -37,7 +99,7 @@ const compose = async (): Promise<void> => {
|
|
37 |
{#if $composing}
|
38 |
Composing...
|
39 |
{:else}
|
40 |
-
Compose <img src="wand.svg" alt="Magic wand" />
|
41 |
{/if}
|
42 |
</button>
|
43 |
|
|
|
1 |
<script lang="ts">
|
2 |
import { density, composing, style, temperature, notesImage, notesTokens, audioBlob } from '$lib/stores';
|
3 |
+
import { styles } from './config.json';
|
4 |
|
5 |
+
const updateMetadata = () => {
|
6 |
+
if ('mediaSession' in navigator) {
|
7 |
+
navigator.mediaSession.metadata = new MediaMetadata({
|
8 |
+
title: `${styles[$style]} omposition`,
|
9 |
+
artist: 'AI Guru Composer',
|
10 |
+
album: 'Hugging Face',
|
11 |
+
artwork: [
|
12 |
+
{
|
13 |
+
src: 'static/hugging-face-headphones.png',
|
14 |
+
sizes: '512x512',
|
15 |
+
type: 'image/png',
|
16 |
+
},
|
17 |
+
],
|
18 |
});
|
19 |
+
}
|
20 |
+
};
|
21 |
+
|
22 |
+
const createTask = async ({
|
23 |
+
music_style,
|
24 |
+
density,
|
25 |
+
temperature,
|
26 |
+
}: {
|
27 |
+
music_style: string;
|
28 |
+
density: string;
|
29 |
+
temperature: string;
|
30 |
+
}) => {
|
31 |
+
const taskResponse = await fetch('task/create', {
|
32 |
+
method: 'POST',
|
33 |
+
headers: {
|
34 |
+
'Content-Type': 'application/json',
|
35 |
+
},
|
36 |
+
body: JSON.stringify({
|
37 |
+
music_style,
|
38 |
+
density,
|
39 |
+
temperature,
|
40 |
+
}),
|
41 |
+
});
|
42 |
+
|
43 |
+
if (!taskResponse.ok || !taskResponse.headers.get('content-type')?.includes('application/json')) {
|
44 |
+
throw new Error(`Unable to create composition: [${taskResponse.status}] ${await taskResponse.text()}`);
|
45 |
+
}
|
46 |
+
|
47 |
+
const task = await taskResponse.json();
|
48 |
+
|
49 |
+
return task;
|
50 |
+
};
|
51 |
+
|
52 |
+
const pollTask = async (task: Record<string, any>) => {
|
53 |
+
const taskResponse = await fetch(`task/poll?task_id=${task.task_id}`);
|
54 |
+
|
55 |
+
if (!taskResponse.ok || !taskResponse.headers.get('content-type')?.includes('application/json')) {
|
56 |
+
throw new Error(`Unable to create composition: [${taskResponse.status}] ${await taskResponse.text()}`);
|
57 |
+
}
|
58 |
|
59 |
+
return await taskResponse.json();
|
60 |
+
};
|
61 |
+
|
62 |
+
const longPollTask = async (task: Record<string, any>, interval = 1_000, max = 100): Promise<Record<string, any>> => {
|
63 |
+
task = await pollTask(task);
|
64 |
+
|
65 |
+
if (task.status === 'completed' || task.status === 'failed' || (max && task.poll_count > max)) {
|
66 |
+
return task;
|
67 |
+
}
|
68 |
+
|
69 |
+
await new Promise((resolve) => setTimeout(resolve, interval));
|
70 |
+
|
71 |
+
return await longPollTask(task, interval, max);
|
72 |
+
};
|
73 |
|
74 |
+
const compose = async () => {
|
75 |
+
$composing = true;
|
76 |
+
try {
|
77 |
+
const task = await createTask({
|
78 |
+
music_style: $style,
|
79 |
+
density: $density,
|
80 |
+
temperature: $temperature,
|
81 |
+
});
|
82 |
|
83 |
+
const completedTask = await longPollTask(task);
|
84 |
+
const { audio, image, tokens } = completedTask.output;
|
85 |
+
$audioBlob = audio;
|
86 |
$notesImage = image;
|
87 |
$notesTokens = tokens;
|
88 |
+
|
89 |
+
updateMetadata();
|
90 |
} catch (err) {
|
91 |
console.error(err);
|
92 |
} finally {
|
|
|
99 |
{#if $composing}
|
100 |
Composing...
|
101 |
{:else}
|
102 |
+
Compose <img src="static/wand.svg" alt="Magic wand" />
|
103 |
{/if}
|
104 |
</button>
|
105 |
|
source/ui/src/lib/Notes.svelte
CHANGED
@@ -1,20 +1,39 @@
|
|
1 |
<script lang="ts">
|
|
|
2 |
import { fade } from 'svelte/transition';
|
3 |
-
import { audioBlob, notesImage } from './stores';
|
|
|
4 |
|
5 |
let currentTime: number;
|
6 |
let duration: number;
|
7 |
let paused = true;
|
8 |
|
9 |
-
let
|
10 |
let visualisation: HTMLImageElement;
|
11 |
-
|
|
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
$: if ($audioBlob || currentTime || duration || !paused) {
|
16 |
imageWidth = visualisation && visualisation.clientWidth;
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
const mouseMove = (event: MouseEvent): void => {
|
20 |
if (!duration) {
|
@@ -25,7 +44,7 @@ const mouseMove = (event: MouseEvent): void => {
|
|
25 |
return;
|
26 |
}
|
27 |
|
28 |
-
const { left, right } =
|
29 |
currentTime = (duration * (event.clientX - left)) / (right - left);
|
30 |
};
|
31 |
|
@@ -34,100 +53,116 @@ const touchMove = (event: TouchEvent): void => {
|
|
34 |
return;
|
35 |
}
|
36 |
|
37 |
-
const { left, right } =
|
38 |
currentTime = (duration * (event.touches[0].clientX - left)) / (right - left);
|
39 |
};
|
40 |
|
41 |
-
const
|
|
|
|
|
42 |
if (e.code === 'Space') {
|
43 |
paused = !paused;
|
44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
};
|
46 |
</script>
|
47 |
|
48 |
-
<svelte:window on:keydown={handleKeydown} on:resize={() => (imageWidth = visualisation && visualisation.clientWidth)} />
|
49 |
-
|
50 |
{#if $audioBlob}
|
51 |
-
<section
|
|
|
52 |
<div
|
53 |
-
|
54 |
-
|
|
|
|
|
55 |
on:mousemove={mouseMove}
|
56 |
on:touchmove|preventDefault={touchMove}
|
57 |
-
|
|
|
|
|
58 |
>
|
59 |
-
<img
|
60 |
-
class="visualisation"
|
61 |
-
src={$notesImage}
|
62 |
-
alt="MIDI notes of composition"
|
63 |
-
draggable="false"
|
64 |
-
bind:this={visualisation}
|
65 |
-
on:click={() => (paused = !paused)}
|
66 |
-
/>
|
67 |
<audio bind:currentTime bind:duration bind:paused src={$audioBlob} />
|
68 |
-
<div class="handle" style:transform="
|
69 |
{#if paused}
|
70 |
-
<img
|
71 |
-
class="play"
|
72 |
-
src="play.svg"
|
73 |
-
alt="Play button"
|
74 |
-
draggable="false"
|
75 |
-
transition:fade
|
76 |
-
on:click={() => (paused = !paused)}
|
77 |
-
/>
|
78 |
{/if}
|
79 |
</div>
|
|
|
|
|
|
|
80 |
</section>
|
81 |
{/if}
|
82 |
|
83 |
<style>
|
84 |
section {
|
|
|
|
|
|
|
85 |
border: 2px solid hsl(0 0% 80%);
|
86 |
border-radius: 0.375rem;
|
87 |
padding: 1rem;
|
88 |
}
|
89 |
|
90 |
-
.
|
91 |
-
position:
|
92 |
-
|
93 |
-
|
|
|
94 |
}
|
95 |
.visualisation {
|
96 |
-
|
97 |
margin: auto;
|
98 |
-
cursor: pointer;
|
99 |
}
|
100 |
|
101 |
audio {
|
102 |
width: 100%;
|
103 |
margin: 1rem auto;
|
104 |
}
|
105 |
-
|
106 |
-
.play {
|
107 |
position: absolute;
|
108 |
left: 50%;
|
109 |
top: 50%;
|
110 |
width: 20%;
|
111 |
aspect-ratio: 1 / 1;
|
112 |
-
transform: translate(-50%, -
|
113 |
filter: drop-shadow(0 0 5px black);
|
|
|
114 |
cursor: pointer;
|
115 |
}
|
116 |
.handle {
|
117 |
position: absolute;
|
118 |
left: 0;
|
119 |
top: 0;
|
120 |
-
height:
|
121 |
width: 0.2rem;
|
122 |
-
margin-left: 1rem;
|
123 |
border-radius: 0.1rem;
|
124 |
background-color: white;
|
125 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
}
|
127 |
|
128 |
@media (min-width: 600px) {
|
129 |
-
|
130 |
-
|
131 |
}
|
132 |
}
|
133 |
</style>
|
|
|
1 |
<script lang="ts">
|
2 |
+
import { afterUpdate, onMount } from 'svelte';
|
3 |
import { fade } from 'svelte/transition';
|
4 |
+
import { audioBlob, notesImage, style } from './stores';
|
5 |
+
import { styles } from './config.json';
|
6 |
|
7 |
let currentTime: number;
|
8 |
let duration: number;
|
9 |
let paused = true;
|
10 |
|
11 |
+
let player: HTMLDivElement;
|
12 |
let visualisation: HTMLImageElement;
|
13 |
+
let imageWidth: number;
|
14 |
+
let imageHeight: number;
|
15 |
|
16 |
+
const updateDimensions = (): void => {
|
|
|
|
|
17 |
imageWidth = visualisation && visualisation.clientWidth;
|
18 |
+
imageHeight = visualisation && visualisation.clientHeight;
|
19 |
+
};
|
20 |
+
|
21 |
+
onMount(() => {
|
22 |
+
updateDimensions();
|
23 |
+
|
24 |
+
if ('mediaSession' in navigator) {
|
25 |
+
navigator.mediaSession.setActionHandler('play', () => (paused = false));
|
26 |
+
navigator.mediaSession.setActionHandler('pause', () => (paused = true));
|
27 |
+
navigator.mediaSession.setActionHandler('stop', () => {
|
28 |
+
paused = true;
|
29 |
+
currentTime = 0;
|
30 |
+
});
|
31 |
+
}
|
32 |
+
});
|
33 |
+
|
34 |
+
afterUpdate((): void => {
|
35 |
+
updateDimensions();
|
36 |
+
});
|
37 |
|
38 |
const mouseMove = (event: MouseEvent): void => {
|
39 |
if (!duration) {
|
|
|
44 |
return;
|
45 |
}
|
46 |
|
47 |
+
const { left, right } = player.getBoundingClientRect();
|
48 |
currentTime = (duration * (event.clientX - left)) / (right - left);
|
49 |
};
|
50 |
|
|
|
53 |
return;
|
54 |
}
|
55 |
|
56 |
+
const { left, right } = player.getBoundingClientRect();
|
57 |
currentTime = (duration * (event.touches[0].clientX - left)) / (right - left);
|
58 |
};
|
59 |
|
60 |
+
const keyDown = (e: KeyboardEvent): void => {
|
61 |
+
e.preventDefault();
|
62 |
+
|
63 |
if (e.code === 'Space') {
|
64 |
paused = !paused;
|
65 |
}
|
66 |
+
if (e.code === 'ArrowLeft') {
|
67 |
+
currentTime = currentTime >= 1 ? currentTime - 1 : 0;
|
68 |
+
}
|
69 |
+
if (e.code === 'ArrowRight') {
|
70 |
+
currentTime = currentTime <= duration - 1 ? currentTime + 1 : duration;
|
71 |
+
}
|
72 |
};
|
73 |
</script>
|
74 |
|
|
|
|
|
75 |
{#if $audioBlob}
|
76 |
+
<section transition:fade>
|
77 |
+
<img class="visualisation" src={$notesImage} alt="" bind:this={visualisation} />
|
78 |
<div
|
79 |
+
bind:this={player}
|
80 |
+
class="player"
|
81 |
+
style:width={imageWidth + 'px'}
|
82 |
+
style:height={imageHeight + 'px'}
|
83 |
on:mousemove={mouseMove}
|
84 |
on:touchmove|preventDefault={touchMove}
|
85 |
+
on:keydown={keyDown}
|
86 |
+
on:click={() => (paused = !paused)}
|
87 |
+
tabindex="0"
|
88 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
<audio bind:currentTime bind:duration bind:paused src={$audioBlob} />
|
90 |
+
<div class="handle" style:transform="translate({imageWidth * (currentTime / duration)}px, -2%)" />
|
91 |
{#if paused}
|
92 |
+
<img class="play-button" src="static/play.svg" alt="Play button" draggable="false" transition:fade />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
{/if}
|
94 |
</div>
|
95 |
+
<a href={$audioBlob} download={`${styles[$style]} Composition - AI Guru ft. Hugging Face.wav`} class="download"
|
96 |
+
>Download</a
|
97 |
+
>
|
98 |
</section>
|
99 |
{/if}
|
100 |
|
101 |
<style>
|
102 |
section {
|
103 |
+
display: flex;
|
104 |
+
flex-direction: column;
|
105 |
+
position: relative;
|
106 |
border: 2px solid hsl(0 0% 80%);
|
107 |
border-radius: 0.375rem;
|
108 |
padding: 1rem;
|
109 |
}
|
110 |
|
111 |
+
.player {
|
112 |
+
position: absolute;
|
113 |
+
left: 50%;
|
114 |
+
transform: translateX(-50%);
|
115 |
+
cursor: pointer;
|
116 |
}
|
117 |
.visualisation {
|
118 |
+
width: min(100%, 512px);
|
119 |
margin: auto;
|
|
|
120 |
}
|
121 |
|
122 |
audio {
|
123 |
width: 100%;
|
124 |
margin: 1rem auto;
|
125 |
}
|
126 |
+
.play-button {
|
|
|
127 |
position: absolute;
|
128 |
left: 50%;
|
129 |
top: 50%;
|
130 |
width: 20%;
|
131 |
aspect-ratio: 1 / 1;
|
132 |
+
transform: translate(-50%, -50%);
|
133 |
filter: drop-shadow(0 0 5px black);
|
134 |
+
pointer-events: none;
|
135 |
cursor: pointer;
|
136 |
}
|
137 |
.handle {
|
138 |
position: absolute;
|
139 |
left: 0;
|
140 |
top: 0;
|
141 |
+
height: 104%;
|
142 |
width: 0.2rem;
|
|
|
143 |
border-radius: 0.1rem;
|
144 |
background-color: white;
|
145 |
cursor: pointer;
|
146 |
+
transform: translate(0, -2%);
|
147 |
+
}
|
148 |
+
|
149 |
+
a.download {
|
150 |
+
display: block;
|
151 |
+
font-size: 1.2rem;
|
152 |
+
font-family: 'Lato', sans-serif;
|
153 |
+
font-weight: 700;
|
154 |
+
color: hsl(0 0% 97%);
|
155 |
+
background: transparent;
|
156 |
+
border: 3px solid hsl(0 0% 97%);
|
157 |
+
border-radius: 0.375rem;
|
158 |
+
padding: 0.5rem 1rem;
|
159 |
+
cursor: pointer;
|
160 |
+
margin: 1rem auto auto;
|
161 |
}
|
162 |
|
163 |
@media (min-width: 600px) {
|
164 |
+
section {
|
165 |
+
padding: 2rem;
|
166 |
}
|
167 |
}
|
168 |
</style>
|
source/ui/src/lib/StyleOptions.svelte
CHANGED
@@ -11,7 +11,7 @@ const keys: string[] = Object.keys(styles);
|
|
11 |
{#each keys as key, i}
|
12 |
<label data-selected={$style === key}>
|
13 |
<div>
|
14 |
-
<img src={
|
15 |
</div>
|
16 |
<input type="radio" bind:group={$style} value={key} />
|
17 |
</label>
|
|
|
11 |
{#each keys as key, i}
|
12 |
<label data-selected={$style === key}>
|
13 |
<div>
|
14 |
+
<img src={`static/${key}.svg`} alt={styles[key]} />
|
15 |
</div>
|
16 |
<input type="radio" bind:group={$style} value={key} />
|
17 |
</label>
|
source/ui/src/lib/config.json
CHANGED
@@ -6,7 +6,8 @@
|
|
6 |
"synth": "Synthesizer",
|
7 |
"church": "Church",
|
8 |
"timpani_strings_harp": "Timpani, Contrabass, Harp",
|
9 |
-
"country": "Country"
|
|
|
10 |
},
|
11 |
"densities": {
|
12 |
"low": "Low",
|
|
|
6 |
"synth": "Synthesizer",
|
7 |
"church": "Church",
|
8 |
"timpani_strings_harp": "Timpani, Contrabass, Harp",
|
9 |
+
"country": "Country",
|
10 |
+
"reggae": "Reggae-esque"
|
11 |
},
|
12 |
"densities": {
|
13 |
"low": "Low",
|
source/ui/src/lib/util.ts
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
export const toggle = (value: boolean): void => {
|
2 |
-
console.log('potato');
|
3 |
-
value = !value;
|
4 |
-
};
|
|
|
|
|
|
|
|
|
|
source/ui/src/routes/index.svelte
CHANGED
@@ -9,7 +9,7 @@ import Tokens from '$lib/Tokens.svelte';
|
|
9 |
|
10 |
<main>
|
11 |
<h1>Composer</h1>
|
12 |
-
<p class="heading">
|
13 |
<p>
|
14 |
This space contains a deep neural network model that can compose music. You can use it to generate music in
|
15 |
different styles, 4 bars at a time.
|
|
|
9 |
|
10 |
<main>
|
11 |
<h1>Composer</h1>
|
12 |
+
<p class="heading">Trained on fifteen thousand songs. One AI model. Infinite compositions.</p>
|
13 |
<p>
|
14 |
This space contains a deep neural network model that can compose music. You can use it to generate music in
|
15 |
different styles, 4 bars at a time.
|
source/ui/static/compose.png
DELETED
Binary file (1.45 kB)
|
|
source/ui/static/download.wav
DELETED
Binary file (794 kB)
|
|
source/ui/static/favicon.png
DELETED
Binary file (1.57 kB)
|
|
source/ui/static/hugging-face-headphones.png
ADDED
source/ui/static/reggae.svg
ADDED
source/ui/static/script.js
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
function compose() {
|
2 |
-
|
3 |
-
// Get the value of the select with id selected_midi_program.
|
4 |
-
var selected_music_style = document.getElementById("selected_music_style").value;
|
5 |
-
var selected_density = document.getElementById("selected_density").value;
|
6 |
-
var selected_temperature = document.getElementById("selected_temperature").value;
|
7 |
-
|
8 |
-
var xhr = new XMLHttpRequest();
|
9 |
-
xhr.open("POST", "compose", true);
|
10 |
-
xhr.setRequestHeader("Content-Type", "application/json");
|
11 |
-
xhr.send(JSON.stringify({
|
12 |
-
music_style: selected_music_style,
|
13 |
-
density: selected_density,
|
14 |
-
temperature: selected_temperature
|
15 |
-
}));
|
16 |
-
|
17 |
-
xhr.onreadystatechange = function() {
|
18 |
-
if (xhr.readyState == 4 && xhr.status == 200) {
|
19 |
-
var response = JSON.parse(xhr.responseText);
|
20 |
-
console.log(response);
|
21 |
-
|
22 |
-
if (response.status == "OK") {
|
23 |
-
|
24 |
-
// Replace the inner html of the div with id token_sequence with the token sequence.
|
25 |
-
document.getElementById("token_sequence").innerHTML = response.tokens;
|
26 |
-
|
27 |
-
// Replace the source of the audio element with id audio..
|
28 |
-
var audio = document.getElementById("audio_id");
|
29 |
-
audio.src = response.audio;
|
30 |
-
|
31 |
-
// Replace the source of the image element with id image.
|
32 |
-
var image = document.getElementById("image_id");
|
33 |
-
image.src = response.image;
|
34 |
-
|
35 |
-
}
|
36 |
-
else {
|
37 |
-
alert("Error: " + response.error);
|
38 |
-
}
|
39 |
-
}
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
|
44 |
-
function post_command(command_name, command_parameters, reload) {
|
45 |
-
var xhr = new XMLHttpRequest();
|
46 |
-
xhr.open("POST", "/command", true);
|
47 |
-
xhr.setRequestHeader("Content-Type", "application/json");
|
48 |
-
xhr.send(JSON.stringify({command_name: command_name, command_parameters: command_parameters}));
|
49 |
-
|
50 |
-
xhr.onreadystatechange = function() {
|
51 |
-
if (xhr.readyState == 4 && xhr.status == 200) {
|
52 |
-
var response = JSON.parse(xhr.responseText);
|
53 |
-
if (response.status == "OK") {
|
54 |
-
|
55 |
-
// Reload the page if requested.
|
56 |
-
if (reload) {
|
57 |
-
console.log("Reloading.");
|
58 |
-
load_cells();
|
59 |
-
}
|
60 |
-
|
61 |
-
}
|
62 |
-
else {
|
63 |
-
alert("Error: " + response.error);
|
64 |
-
}
|
65 |
-
}
|
66 |
-
}
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
source/ui/svelte.config.js
CHANGED
@@ -7,9 +7,12 @@ const config = {
|
|
7 |
|
8 |
kit: {
|
9 |
adapter: adapter({
|
10 |
-
pages: '../../
|
11 |
assets: '../../static',
|
12 |
}),
|
|
|
|
|
|
|
13 |
prerender: {
|
14 |
default: true,
|
15 |
},
|
|
|
7 |
|
8 |
kit: {
|
9 |
adapter: adapter({
|
10 |
+
pages: '../../static',
|
11 |
assets: '../../static',
|
12 |
}),
|
13 |
+
paths: {
|
14 |
+
base: '/static',
|
15 |
+
},
|
16 |
prerender: {
|
17 |
default: true,
|
18 |
},
|
start.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
import subprocess
|
2 |
+
|
3 |
+
subprocess.run("uvicorn app:app --host 0.0.0.0 --port 7860", shell=True)
|
static/_app/assets/pages/{index.svelte-45cd6b36.css β index.svelte-10d60411.css}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
fieldset.svelte-1r9pswz.svelte-1r9pswz{position:relative;padding:0;border:none;margin-top:1rem}legend.svelte-1r9pswz.svelte-1r9pswz{text-align:center;font-size:1.25rem;font-weight:700;padding:0}.grid.svelte-1r9pswz.svelte-1r9pswz{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;width:min-content;margin:1rem auto}img.svelte-1r9pswz.svelte-1r9pswz{width:100%;height:100%;filter:invert(1);margin:auto}label.svelte-1r9pswz.svelte-1r9pswz{background-color:transparent;border-radius:.375rem;transition:background-color .25s;cursor:pointer}label.svelte-1r9pswz>div.svelte-1r9pswz{width:3rem;aspect-ratio:1 / 1}input.svelte-1r9pswz.svelte-1r9pswz{position:fixed;opacity:0;pointer-events:none}label[data-selected=true].svelte-1r9pswz.svelte-1r9pswz{background-color:#f7f7f7;border-radius:.375rem}label[data-selected=true].svelte-1r9pswz img.svelte-1r9pswz{filter:none}@media (min-width: 600px) and (max-width: 899px){.grid.svelte-1r9pswz.svelte-1r9pswz{display:flex;flex-direction:row}}@media (min-width: 900px){.grid.svelte-1r9pswz.svelte-1r9pswz{grid-template-columns:repeat(4,1fr)}}.options.svelte-1m848u0{display:flex;flex-direction:row;justify-content:center;width:100%;margin:auto}label.svelte-1m848u0{display:block;margin-bottom:1rem;padding:.5rem;border:2px solid hsl(0 0% 97%);border-right:none;text-align:center;transition:background-color .25s;cursor:pointer}label.svelte-1m848u0:nth-of-type(1){border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-right-width:0}label.svelte-1m848u0:last-of-type{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem;border-right:2px solid hsl(0 0% 97%)}label[data-selected=true].svelte-1m848u0{background-color:#fff;color:#333;font-weight:700}label.svelte-1m848u0:focus{outline:red}input.svelte-1m848u0{position:fixed;opacity:0;pointer-events:none}fieldset.svelte-1ikh8be{padding:0;border:none;margin-top:1rem}legend.svelte-1ikh8be{text-align:center;font-size:1.25rem;font-weight:700;padding:0;margin-bottom:1rem}button.svelte-18w38ow{display:block;font-size:1.2rem;font-family:Lato,sans-serif;font-weight:700;color:#f7f7f7;background:transparent;border:3px solid hsl(0 0% 97%);border-radius:.375rem;padding:.5rem 1rem;cursor:pointer;margin:1rem auto 2rem}button[disabled].svelte-18w38ow{border-color:gray;color:gray;cursor:initial}img.svelte-18w38ow{height:1.2rem;aspect-ratio:1 / 1;vertical-align:bottom}@media (min-width: 900px){button.svelte-18w38ow{margin-top:0}}section.svelte-
|
|
|
1 |
+
fieldset.svelte-1r9pswz.svelte-1r9pswz{position:relative;padding:0;border:none;margin-top:1rem}legend.svelte-1r9pswz.svelte-1r9pswz{text-align:center;font-size:1.25rem;font-weight:700;padding:0}.grid.svelte-1r9pswz.svelte-1r9pswz{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;width:min-content;margin:1rem auto}img.svelte-1r9pswz.svelte-1r9pswz{width:100%;height:100%;filter:invert(1);margin:auto}label.svelte-1r9pswz.svelte-1r9pswz{background-color:transparent;border-radius:.375rem;transition:background-color .25s;cursor:pointer}label.svelte-1r9pswz>div.svelte-1r9pswz{width:3rem;aspect-ratio:1 / 1}input.svelte-1r9pswz.svelte-1r9pswz{position:fixed;opacity:0;pointer-events:none}label[data-selected=true].svelte-1r9pswz.svelte-1r9pswz{background-color:#f7f7f7;border-radius:.375rem}label[data-selected=true].svelte-1r9pswz img.svelte-1r9pswz{filter:none}@media (min-width: 600px) and (max-width: 899px){.grid.svelte-1r9pswz.svelte-1r9pswz{display:flex;flex-direction:row}}@media (min-width: 900px){.grid.svelte-1r9pswz.svelte-1r9pswz{grid-template-columns:repeat(4,1fr)}}.options.svelte-1m848u0{display:flex;flex-direction:row;justify-content:center;width:100%;margin:auto}label.svelte-1m848u0{display:block;margin-bottom:1rem;padding:.5rem;border:2px solid hsl(0 0% 97%);border-right:none;text-align:center;transition:background-color .25s;cursor:pointer}label.svelte-1m848u0:nth-of-type(1){border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-right-width:0}label.svelte-1m848u0:last-of-type{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem;border-right:2px solid hsl(0 0% 97%)}label[data-selected=true].svelte-1m848u0{background-color:#fff;color:#333;font-weight:700}label.svelte-1m848u0:focus{outline:red}input.svelte-1m848u0{position:fixed;opacity:0;pointer-events:none}fieldset.svelte-1ikh8be{padding:0;border:none;margin-top:1rem}legend.svelte-1ikh8be{text-align:center;font-size:1.25rem;font-weight:700;padding:0;margin-bottom:1rem}button.svelte-18w38ow{display:block;font-size:1.2rem;font-family:Lato,sans-serif;font-weight:700;color:#f7f7f7;background:transparent;border:3px solid hsl(0 0% 97%);border-radius:.375rem;padding:.5rem 1rem;cursor:pointer;margin:1rem auto 2rem}button[disabled].svelte-18w38ow{border-color:gray;color:gray;cursor:initial}img.svelte-18w38ow{height:1.2rem;aspect-ratio:1 / 1;vertical-align:bottom}@media (min-width: 900px){button.svelte-18w38ow{margin-top:0}}section.svelte-hbmhov{display:flex;flex-direction:column;position:relative;border:2px solid hsl(0 0% 80%);border-radius:.375rem;padding:1rem}.player.svelte-hbmhov{position:absolute;left:50%;transform:translate(-50%);cursor:pointer}.visualisation.svelte-hbmhov{width:min(100%,512px);margin:auto}audio.svelte-hbmhov{width:100%;margin:1rem auto}.play-button.svelte-hbmhov{position:absolute;left:50%;top:50%;width:20%;aspect-ratio:1 / 1;transform:translate(-50%,-50%);filter:drop-shadow(0 0 5px black);pointer-events:none;cursor:pointer}.handle.svelte-hbmhov{position:absolute;left:0;top:0;height:104%;width:.2rem;border-radius:.1rem;background-color:#fff;cursor:pointer;transform:translateY(-2%)}a.download.svelte-hbmhov{display:block;font-size:1.2rem;font-family:Lato,sans-serif;font-weight:700;color:#f7f7f7;background:transparent;border:3px solid hsl(0 0% 97%);border-radius:.375rem;padding:.5rem 1rem;cursor:pointer;margin:1rem auto auto}@media (min-width: 600px){section.svelte-hbmhov{padding:2rem}}section.svelte-4un5mw{border:2px solid hsl(0 0% 80%);border-radius:.375rem;padding:1rem}p.svelte-4un5mw{font-size:.75rem}main.svelte-1rfjlkw{width:100%;display:flex;flex-direction:column;gap:1rem;margin:0 auto}h1.svelte-1rfjlkw{font-size:1.5rem;border-left:.25ch solid hsl(0 0% 97%);padding-left:.5ch}.heading.svelte-1rfjlkw{font-size:2.25rem}p.svelte-1rfjlkw:not(.heading){max-width:40rem;font-size:1.2rem;line-height:1.5rem;margin:0}#options.svelte-1rfjlkw{display:flex;flex-direction:column;justify-content:space-between;margin-top:1rem}@media (min-width: 600px){main.svelte-1rfjlkw{max-width:60rem}}@media (min-width: 900px){#options.svelte-1rfjlkw{display:flex;flex-direction:row;justify-content:space-between}}
|
static/_app/chunks/{index-f9918abc.js β index-7a30815e.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
import{E as f,s as l}from"./index-
|
|
|
1 |
+
import{E as f,s as l}from"./index-f8f7cfca.js";const e=[];function h(n,u=f){let o;const i=new Set;function r(t){if(l(n,t)&&(n=t,o)){const c=!e.length;for(const s of i)s[1](),e.push(s,n);if(c){for(let s=0;s<e.length;s+=2)e[s][0](e[s+1]);e.length=0}}}function b(t){r(t(n))}function p(t,c=f){const s=[t,c];return i.add(s),i.size===1&&(o=u(r)||f),t(n),()=>{i.delete(s),i.size===0&&(o(),o=null)}}return{set:r,update:b,subscribe:p}}export{h as w};
|
static/_app/chunks/index-c61749f5.js
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
function k(){}const lt=t=>t;function ut(t,e){for(const n in e)t[n]=e[n];return t}function U(t){return t()}function G(){return Object.create(null)}function x(t){t.forEach(U)}function V(t){return typeof t=="function"}function Tt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let C;function Wt(t,e){return C||(C=document.createElement("a")),C.href=e,t===C.href}function at(t){return Object.keys(t).length===0}function ft(t,...e){if(t==null)return k;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Bt(t,e,n){t.$$.on_destroy.push(ft(e,n))}function Lt(t,e,n,i){if(t){const s=X(t,e,n,i);return t[0](s)}}function X(t,e,n,i){return t[1]&&i?ut(n.ctx.slice(),t[1](i(e))):n.ctx}function Ft(t,e,n,i){if(t[2]&&i){const s=t[2](i(n));if(e.dirty===void 0)return s;if(typeof s=="object"){const c=[],r=Math.max(e.dirty.length,s.length);for(let l=0;l<r;l+=1)c[l]=e.dirty[l]|s[l];return c}return e.dirty|s}return e.dirty}function It(t,e,n,i,s,c){if(s){const r=X(e,n,i,c);t.p(r,s)}}function Ht(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let i=0;i<n;i++)e[i]=-1;return e}return-1}function Gt(t,e,n){return t.set(n),e}const Y=typeof window!="undefined";let dt=Y?()=>window.performance.now():()=>Date.now(),L=Y?t=>requestAnimationFrame(t):k;const b=new Set;function Z(t){b.forEach(e=>{e.c(t)||(b.delete(e),e.f())}),b.size!==0&&L(Z)}function _t(t){let e;return b.size===0&&L(Z),{promise:new Promise(n=>{b.add(e={c:t,f:n})}),abort(){b.delete(e)}}}let O=!1;function ht(){O=!0}function mt(){O=!1}function pt(t,e,n,i){for(;t<e;){const s=t+(e-t>>1);n(s)<=i?t=s+1:e=s}return t}function yt(t){if(t.hydrate_init)return;t.hydrate_init=!0;let e=t.childNodes;if(t.nodeName==="HEAD"){const o=[];for(let u=0;u<e.length;u++){const d=e[u];d.claim_order!==void 0&&o.push(d)}e=o}const n=new Int32Array(e.length+1),i=new Int32Array(e.length);n[0]=-1;let s=0;for(let o=0;o<e.length;o++){const u=e[o].claim_order,d=(s>0&&e[n[s]].claim_order<=u?s+1:pt(1,s,a=>e[n[a]].claim_order,u))-1;i[o]=n[d]+1;const f=d+1;n[f]=o,s=Math.max(f,s)}const c=[],r=[];let l=e.length-1;for(let o=n[s]+1;o!=0;o=i[o-1]){for(c.push(e[o-1]);l>=o;l--)r.push(e[l]);l--}for(;l>=0;l--)r.push(e[l]);c.reverse(),r.sort((o,u)=>o.claim_order-u.claim_order);for(let o=0,u=0;o<r.length;o++){for(;u<c.length&&r[o].claim_order>=c[u].claim_order;)u++;const d=u<c.length?c[u]:null;t.insertBefore(r[o],d)}}function tt(t,e){t.appendChild(e)}function et(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function gt(t){const e=F("style");return bt(et(t),e),e.sheet}function bt(t,e){tt(t.head||t,e)}function xt(t,e){if(O){for(yt(t),(t.actual_end_child===void 0||t.actual_end_child!==null&&t.actual_end_child.parentElement!==t)&&(t.actual_end_child=t.firstChild);t.actual_end_child!==null&&t.actual_end_child.claim_order===void 0;)t.actual_end_child=t.actual_end_child.nextSibling;e!==t.actual_end_child?(e.claim_order!==void 0||e.parentNode!==t)&&t.insertBefore(e,t.actual_end_child):t.actual_end_child=e.nextSibling}else(e.parentNode!==t||e.nextSibling!==null)&&t.appendChild(e)}function Jt(t,e,n){O&&!n?xt(t,e):(e.parentNode!==t||e.nextSibling!=n)&&t.insertBefore(e,n||null)}function nt(t){t.parentNode.removeChild(t)}function Kt(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function F(t){return document.createElement(t)}function I(t){return document.createTextNode(t)}function Qt(){return I(" ")}function Ut(){return I("")}function J(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function Vt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function Xt(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function $t(t){return Array.from(t.childNodes)}function wt(t){t.claim_info===void 0&&(t.claim_info={last_index:0,total_claimed:0})}function it(t,e,n,i,s=!1){wt(t);const c=(()=>{for(let r=t.claim_info.last_index;r<t.length;r++){const l=t[r];if(e(l)){const o=n(l);return o===void 0?t.splice(r,1):t[r]=o,s||(t.claim_info.last_index=r),l}}for(let r=t.claim_info.last_index-1;r>=0;r--){const l=t[r];if(e(l)){const o=n(l);return o===void 0?t.splice(r,1):t[r]=o,s?o===void 0&&t.claim_info.last_index--:t.claim_info.last_index=r,l}}return i()})();return c.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,c}function vt(t,e,n,i){return it(t,s=>s.nodeName===e,s=>{const c=[];for(let r=0;r<s.attributes.length;r++){const l=s.attributes[r];n[l.name]||c.push(l.name)}c.forEach(r=>s.removeAttribute(r))},()=>i(e))}function Yt(t,e,n){return vt(t,e,n,F)}function Et(t,e){return it(t,n=>n.nodeType===3,n=>{const i=""+e;if(n.data.startsWith(i)){if(n.data.length!==i.length)return n.splitText(i.length)}else n.data=i},()=>I(e),!0)}function Zt(t){return Et(t," ")}function te(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function ee(t,e,n,i){n===null?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}let N;function kt(){if(N===void 0){N=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch{N=!0}}return N}function ne(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const i=F("iframe");i.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),i.setAttribute("aria-hidden","true"),i.tabIndex=-1;const s=kt();let c;return s?(i.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",c=J(window,"message",r=>{r.source===i.contentWindow&&e()})):(i.src="about:blank",i.onload=()=>{c=J(i.contentWindow,"resize",e)}),tt(t,i),()=>{(s||c&&i.contentWindow)&&c(),nt(i)}}function At(t,e,n=!1){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,n,!1,e),i}const z=new Map;let R=0;function Ct(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function Nt(t,e){const n={stylesheet:gt(e),rules:{}};return z.set(t,n),n}function K(t,e,n,i,s,c,r,l=0){const o=16.666/i;let u=`{
|
2 |
-
`;for(let p=0;p<=1;p+=o){const g=e+(n-e)*c(p);u+=p*100+`%{${r(g,1-g)}}
|
3 |
-
`}const d=u+`100% {${r(n,1-n)}}
|
4 |
-
}`,f=`__svelte_${Ct(d)}_${l}`,a=et(t),{stylesheet:_,rules:h}=z.get(a)||Nt(a,t);h[f]||(h[f]=!0,_.insertRule(`@keyframes ${f} ${d}`,_.cssRules.length));const y=t.style.animation||"";return t.style.animation=`${y?`${y}, `:""}${f} ${i}ms linear ${s}ms 1 both`,R+=1,f}function jt(t,e){const n=(t.style.animation||"").split(", "),i=n.filter(e?c=>c.indexOf(e)<0:c=>c.indexOf("__svelte")===-1),s=n.length-i.length;s&&(t.style.animation=i.join(", "),R-=s,R||St())}function St(){L(()=>{R||(z.forEach(t=>{const{stylesheet:e}=t;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.rules={}}),z.clear())})}let E;function v(t){E=t}function H(){if(!E)throw new Error("Function called outside component initialization");return E}function ie(t){H().$$.on_mount.push(t)}function re(t){H().$$.after_update.push(t)}function se(t,e){H().$$.context.set(t,e)}const w=[],Q=[],S=[],W=[],rt=Promise.resolve();let B=!1;function st(){B||(B=!0,rt.then(ot))}function oe(){return st(),rt}function D(t){S.push(t)}function ce(t){W.push(t)}const q=new Set;let j=0;function ot(){const t=E;do{for(;j<w.length;){const e=w[j];j++,v(e),Mt(e.$$)}for(v(null),w.length=0,j=0;Q.length;)Q.pop()();for(let e=0;e<S.length;e+=1){const n=S[e];q.has(n)||(q.add(n),n())}S.length=0}while(w.length);for(;W.length;)W.pop()();B=!1,q.clear(),v(t)}function Mt(t){if(t.fragment!==null){t.update(),x(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(D)}}let $;function zt(){return $||($=Promise.resolve(),$.then(()=>{$=null})),$}function T(t,e,n){t.dispatchEvent(At(`${e?"intro":"outro"}${n}`))}const M=new Set;let m;function le(){m={r:0,c:[],p:m}}function ue(){m.r||x(m.c),m=m.p}function Rt(t,e){t&&t.i&&(M.delete(t),t.i(e))}function ae(t,e,n,i){if(t&&t.o){if(M.has(t))return;M.add(t),m.c.push(()=>{M.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}}const Dt={duration:0};function fe(t,e,n,i){let s=e(t,n),c=i?0:1,r=null,l=null,o=null;function u(){o&&jt(t,o)}function d(a,_){const h=a.b-c;return _*=Math.abs(h),{a:c,b:a.b,d:h,duration:_,start:a.start,end:a.start+_,group:a.group}}function f(a){const{delay:_=0,duration:h=300,easing:y=lt,tick:p=k,css:g}=s||Dt,P={start:dt()+_,b:a};a||(P.group=m,m.r+=1),r||l?l=P:(g&&(u(),o=K(t,c,a,h,_,y,g)),a&&p(0,1),r=d(P,h),D(()=>T(t,a,"start")),_t(A=>{if(l&&A>l.start&&(r=d(l,h),l=null,T(t,r.b,"start"),g&&(u(),o=K(t,c,r.b,r.duration,0,y,s.css))),r){if(A>=r.end)p(c=r.b,1-c),T(t,r.b,"end"),l||(r.b?u():--r.group.r||x(r.group.c)),r=null;else if(A>=r.start){const ct=A-r.start;c=r.a+r.d*y(ct/r.duration),p(c,1-c)}}return!!(r||l)}))}return{run(a){V(s)?zt().then(()=>{s=s(),f(a)}):f(a)},end(){u(),r=l=null}}}function de(t,e){const n={},i={},s={$$scope:1};let c=t.length;for(;c--;){const r=t[c],l=e[c];if(l){for(const o in r)o in l||(i[o]=1);for(const o in l)s[o]||(n[o]=l[o],s[o]=1);t[c]=l}else for(const o in r)s[o]=1}for(const r in i)r in n||(n[r]=void 0);return n}function _e(t){return typeof t=="object"&&t!==null?t:{}}function he(t,e,n){const i=t.$$.props[e];i!==void 0&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function me(t){t&&t.c()}function pe(t,e){t&&t.l(e)}function Ot(t,e,n,i){const{fragment:s,on_mount:c,on_destroy:r,after_update:l}=t.$$;s&&s.m(e,n),i||D(()=>{const o=c.map(U).filter(V);r?r.push(...o):x(o),t.$$.on_mount=[]}),l.forEach(D)}function Pt(t,e){const n=t.$$;n.fragment!==null&&(x(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function qt(t,e){t.$$.dirty[0]===-1&&(w.push(t),st(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ye(t,e,n,i,s,c,r,l=[-1]){const o=E;v(t);const u=t.$$={fragment:null,ctx:null,props:c,update:k,not_equal:s,bound:G(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(o?o.$$.context:[])),callbacks:G(),dirty:l,skip_bound:!1,root:e.target||o.$$.root};r&&r(u.root);let d=!1;if(u.ctx=n?n(t,e.props||{},(f,a,..._)=>{const h=_.length?_[0]:a;return u.ctx&&s(u.ctx[f],u.ctx[f]=h)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](h),d&&qt(t,f)),a}):[],u.update(),d=!0,x(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){ht();const f=$t(e.target);u.fragment&&u.fragment.l(f),f.forEach(nt)}else u.fragment&&u.fragment.c();e.intro&&Rt(t.$$.fragment),Ot(t,e.target,e.anchor,e.customElement),mt(),ot()}v(o)}class ge{$destroy(){Pt(this,1),this.$destroy=k}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!at(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}export{_e as A,Pt as B,ut as C,oe as D,k as E,Lt as F,It as G,Ht as H,Ft as I,xt as J,Wt as K,J as L,Kt as M,Bt as N,Q as O,he as P,ce as Q,Gt as R,ge as S,lt as T,D as U,ne as V,Vt as W,fe as X,x as Y,L as Z,$t as a,Xt as b,Yt as c,nt as d,F as e,ee as f,Jt as g,Et as h,ye as i,te as j,Qt as k,Ut as l,Zt as m,le as n,ae as o,ue as p,Rt as q,se as r,Tt as s,I as t,re as u,ie as v,me as w,pe as x,Ot as y,de as z};
|
|
|
|
|
|
|
|
|
|
static/_app/chunks/index-f8f7cfca.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function k(){}const rt=t=>t;function st(t,e){for(const n in e)t[n]=e[n];return t}function J(t){return t()}function I(){return Object.create(null)}function x(t){t.forEach(J)}function K(t){return typeof t=="function"}function Pt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let j;function qt(t,e){return j||(j=document.createElement("a")),j.href=e,t===j.href}function ct(t){return Object.keys(t).length===0}function lt(t,...e){if(t==null)return k;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Tt(t,e,n){t.$$.on_destroy.push(lt(e,n))}function zt(t,e,n,r){if(t){const s=Q(t,e,n,r);return t[0](s)}}function Q(t,e,n,r){return t[1]&&r?st(n.ctx.slice(),t[1](r(e))):n.ctx}function Bt(t,e,n,r){if(t[2]&&r){const s=t[2](r(n));if(e.dirty===void 0)return s;if(typeof s=="object"){const o=[],i=Math.max(e.dirty.length,s.length);for(let l=0;l<i;l+=1)o[l]=e.dirty[l]|s[l];return o}return e.dirty|s}return e.dirty}function Lt(t,e,n,r,s,o){if(s){const i=Q(e,n,r,o);t.p(i,s)}}function Ft(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let r=0;r<n;r++)e[r]=-1;return e}return-1}function Ht(t,e,n){return t.set(n),e}const U=typeof window!="undefined";let ot=U?()=>window.performance.now():()=>Date.now(),L=U?t=>requestAnimationFrame(t):k;const b=new Set;function V(t){b.forEach(e=>{e.c(t)||(b.delete(e),e.f())}),b.size!==0&&L(V)}function ut(t){let e;return b.size===0&&L(V),{promise:new Promise(n=>{b.add(e={c:t,f:n})}),abort(){b.delete(e)}}}let O=!1;function at(){O=!0}function ft(){O=!1}function _t(t,e,n,r){for(;t<e;){const s=t+(e-t>>1);n(s)<=r?t=s+1:e=s}return t}function dt(t){if(t.hydrate_init)return;t.hydrate_init=!0;let e=t.childNodes;if(t.nodeName==="HEAD"){const c=[];for(let u=0;u<e.length;u++){const _=e[u];_.claim_order!==void 0&&c.push(_)}e=c}const n=new Int32Array(e.length+1),r=new Int32Array(e.length);n[0]=-1;let s=0;for(let c=0;c<e.length;c++){const u=e[c].claim_order,_=(s>0&&e[n[s]].claim_order<=u?s+1:_t(1,s,a=>e[n[a]].claim_order,u))-1;r[c]=n[_]+1;const f=_+1;n[f]=c,s=Math.max(f,s)}const o=[],i=[];let l=e.length-1;for(let c=n[s]+1;c!=0;c=r[c-1]){for(o.push(e[c-1]);l>=c;l--)i.push(e[l]);l--}for(;l>=0;l--)i.push(e[l]);o.reverse(),i.sort((c,u)=>c.claim_order-u.claim_order);for(let c=0,u=0;c<i.length;c++){for(;u<o.length&&i[c].claim_order>=o[u].claim_order;)u++;const _=u<o.length?o[u]:null;t.insertBefore(i[c],_)}}function ht(t,e){t.appendChild(e)}function X(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function mt(t){const e=Y("style");return pt(X(t),e),e.sheet}function pt(t,e){ht(t.head||t,e)}function yt(t,e){if(O){for(dt(t),(t.actual_end_child===void 0||t.actual_end_child!==null&&t.actual_end_child.parentElement!==t)&&(t.actual_end_child=t.firstChild);t.actual_end_child!==null&&t.actual_end_child.claim_order===void 0;)t.actual_end_child=t.actual_end_child.nextSibling;e!==t.actual_end_child?(e.claim_order!==void 0||e.parentNode!==t)&&t.insertBefore(e,t.actual_end_child):t.actual_end_child=e.nextSibling}else(e.parentNode!==t||e.nextSibling!==null)&&t.appendChild(e)}function It(t,e,n){O&&!n?yt(t,e):(e.parentNode!==t||e.nextSibling!=n)&&t.insertBefore(e,n||null)}function gt(t){t.parentNode.removeChild(t)}function Wt(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function Y(t){return document.createElement(t)}function F(t){return document.createTextNode(t)}function Gt(){return F(" ")}function Jt(){return F("")}function Kt(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function Qt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function Ut(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function bt(t){return Array.from(t.childNodes)}function xt(t){t.claim_info===void 0&&(t.claim_info={last_index:0,total_claimed:0})}function Z(t,e,n,r,s=!1){xt(t);const o=(()=>{for(let i=t.claim_info.last_index;i<t.length;i++){const l=t[i];if(e(l)){const c=n(l);return c===void 0?t.splice(i,1):t[i]=c,s||(t.claim_info.last_index=i),l}}for(let i=t.claim_info.last_index-1;i>=0;i--){const l=t[i];if(e(l)){const c=n(l);return c===void 0?t.splice(i,1):t[i]=c,s?c===void 0&&t.claim_info.last_index--:t.claim_info.last_index=i,l}}return r()})();return o.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,o}function $t(t,e,n,r){return Z(t,s=>s.nodeName===e,s=>{const o=[];for(let i=0;i<s.attributes.length;i++){const l=s.attributes[i];n[l.name]||o.push(l.name)}o.forEach(i=>s.removeAttribute(i))},()=>r(e))}function Vt(t,e,n){return $t(t,e,n,Y)}function wt(t,e){return Z(t,n=>n.nodeType===3,n=>{const r=""+e;if(n.data.startsWith(r)){if(n.data.length!==r.length)return n.splitText(r.length)}else n.data=r},()=>F(e),!0)}function Xt(t){return wt(t," ")}function Yt(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Zt(t,e,n,r){n===null?t.style.removeProperty(e):t.style.setProperty(e,n,r?"important":"")}function vt(t,e,n=!1){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,!1,e),r}const M=new Map;let R=0;function Et(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function kt(t,e){const n={stylesheet:mt(e),rules:{}};return M.set(t,n),n}function W(t,e,n,r,s,o,i,l=0){const c=16.666/r;let u=`{
|
2 |
+
`;for(let p=0;p<=1;p+=c){const g=e+(n-e)*o(p);u+=p*100+`%{${i(g,1-g)}}
|
3 |
+
`}const _=u+`100% {${i(n,1-n)}}
|
4 |
+
}`,f=`__svelte_${Et(_)}_${l}`,a=X(t),{stylesheet:d,rules:h}=M.get(a)||kt(a,t);h[f]||(h[f]=!0,d.insertRule(`@keyframes ${f} ${_}`,d.cssRules.length));const y=t.style.animation||"";return t.style.animation=`${y?`${y}, `:""}${f} ${r}ms linear ${s}ms 1 both`,R+=1,f}function Nt(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?o=>o.indexOf(e)<0:o=>o.indexOf("__svelte")===-1),s=n.length-r.length;s&&(t.style.animation=r.join(", "),R-=s,R||jt())}function jt(){L(()=>{R||(M.forEach(t=>{const{stylesheet:e}=t;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.rules={}}),M.clear())})}let E;function v(t){E=t}function H(){if(!E)throw new Error("Function called outside component initialization");return E}function te(t){H().$$.on_mount.push(t)}function ee(t){H().$$.after_update.push(t)}function ne(t,e){H().$$.context.set(t,e)}const w=[],G=[],C=[],z=[],tt=Promise.resolve();let B=!1;function et(){B||(B=!0,tt.then(nt))}function ie(){return et(),tt}function D(t){C.push(t)}function re(t){z.push(t)}const q=new Set;let A=0;function nt(){const t=E;do{for(;A<w.length;){const e=w[A];A++,v(e),At(e.$$)}for(v(null),w.length=0,A=0;G.length;)G.pop()();for(let e=0;e<C.length;e+=1){const n=C[e];q.has(n)||(q.add(n),n())}C.length=0}while(w.length);for(;z.length;)z.pop()();B=!1,q.clear(),v(t)}function At(t){if(t.fragment!==null){t.update(),x(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(D)}}let $;function Ct(){return $||($=Promise.resolve(),$.then(()=>{$=null})),$}function T(t,e,n){t.dispatchEvent(vt(`${e?"intro":"outro"}${n}`))}const S=new Set;let m;function se(){m={r:0,c:[],p:m}}function ce(){m.r||x(m.c),m=m.p}function St(t,e){t&&t.i&&(S.delete(t),t.i(e))}function le(t,e,n,r){if(t&&t.o){if(S.has(t))return;S.add(t),m.c.push(()=>{S.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}}const Mt={duration:0};function oe(t,e,n,r){let s=e(t,n),o=r?0:1,i=null,l=null,c=null;function u(){c&&Nt(t,c)}function _(a,d){const h=a.b-o;return d*=Math.abs(h),{a:o,b:a.b,d:h,duration:d,start:a.start,end:a.start+d,group:a.group}}function f(a){const{delay:d=0,duration:h=300,easing:y=rt,tick:p=k,css:g}=s||Mt,P={start:ot()+d,b:a};a||(P.group=m,m.r+=1),i||l?l=P:(g&&(u(),c=W(t,o,a,h,d,y,g)),a&&p(0,1),i=_(P,h),D(()=>T(t,a,"start")),ut(N=>{if(l&&N>l.start&&(i=_(l,h),l=null,T(t,i.b,"start"),g&&(u(),c=W(t,o,i.b,i.duration,0,y,s.css))),i){if(N>=i.end)p(o=i.b,1-o),T(t,i.b,"end"),l||(i.b?u():--i.group.r||x(i.group.c)),i=null;else if(N>=i.start){const it=N-i.start;o=i.a+i.d*y(it/i.duration),p(o,1-o)}}return!!(i||l)}))}return{run(a){K(s)?Ct().then(()=>{s=s(),f(a)}):f(a)},end(){u(),i=l=null}}}function ue(t,e){const n={},r={},s={$$scope:1};let o=t.length;for(;o--;){const i=t[o],l=e[o];if(l){for(const c in i)c in l||(r[c]=1);for(const c in l)s[c]||(n[c]=l[c],s[c]=1);t[o]=l}else for(const c in i)s[c]=1}for(const i in r)i in n||(n[i]=void 0);return n}function ae(t){return typeof t=="object"&&t!==null?t:{}}function fe(t,e,n){const r=t.$$.props[e];r!==void 0&&(t.$$.bound[r]=n,n(t.$$.ctx[r]))}function _e(t){t&&t.c()}function de(t,e){t&&t.l(e)}function Rt(t,e,n,r){const{fragment:s,on_mount:o,on_destroy:i,after_update:l}=t.$$;s&&s.m(e,n),r||D(()=>{const c=o.map(J).filter(K);i?i.push(...c):x(c),t.$$.on_mount=[]}),l.forEach(D)}function Dt(t,e){const n=t.$$;n.fragment!==null&&(x(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Ot(t,e){t.$$.dirty[0]===-1&&(w.push(t),et(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function he(t,e,n,r,s,o,i,l=[-1]){const c=E;v(t);const u=t.$$={fragment:null,ctx:null,props:o,update:k,not_equal:s,bound:I(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:I(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};i&&i(u.root);let _=!1;if(u.ctx=n?n(t,e.props||{},(f,a,...d)=>{const h=d.length?d[0]:a;return u.ctx&&s(u.ctx[f],u.ctx[f]=h)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](h),_&&Ot(t,f)),a}):[],u.update(),_=!0,x(u.before_update),u.fragment=r?r(u.ctx):!1,e.target){if(e.hydrate){at();const f=bt(e.target);u.fragment&&u.fragment.l(f),f.forEach(gt)}else u.fragment&&u.fragment.c();e.intro&&St(t.$$.fragment),Rt(t,e.target,e.anchor,e.customElement),ft(),nt()}v(c)}class me{$destroy(){Dt(this,1),this.$destroy=k}$on(e,n){const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}$set(e){this.$$set&&!ct(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}export{ae as A,Dt as B,st as C,ie as D,k as E,zt as F,Lt as G,Ft as H,Bt as I,yt as J,qt as K,Kt as L,Wt as M,Tt as N,G as O,fe as P,re as Q,Ht as R,me as S,rt as T,D as U,Qt as V,oe as W,x as X,L as Y,bt as a,Ut as b,Vt as c,gt as d,Y as e,Zt as f,It as g,wt as h,he as i,Yt as j,Gt as k,Jt as l,Xt as m,se as n,le as o,ce as p,St as q,ne as r,Pt as s,F as t,ee as u,te as v,_e as w,de as x,Rt as y,ue as z};
|
static/_app/{error.svelte-83166d57.js β error.svelte-2573bba8.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
import{S as w,i as y,s as z,e as E,t as v,c as d,a as b,h as P,d as o,g as u,J as R,j as N,k as S,l as C,m as j,E as H}from"./chunks/index-
|
|
|
1 |
+
import{S as w,i as y,s as z,e as E,t as v,c as d,a as b,h as P,d as o,g as u,J as R,j as N,k as S,l as C,m as j,E as H}from"./chunks/index-f8f7cfca.js";function J(r){let l,t=r[1].frame+"",a;return{c(){l=E("pre"),a=v(t)},l(f){l=d(f,"PRE",{});var s=b(l);a=P(s,t),s.forEach(o)},m(f,s){u(f,l,s),R(l,a)},p(f,s){s&2&&t!==(t=f[1].frame+"")&&N(a,t)},d(f){f&&o(l)}}}function h(r){let l,t=r[1].stack+"",a;return{c(){l=E("pre"),a=v(t)},l(f){l=d(f,"PRE",{});var s=b(l);a=P(s,t),s.forEach(o)},m(f,s){u(f,l,s),R(l,a)},p(f,s){s&2&&t!==(t=f[1].stack+"")&&N(a,t)},d(f){f&&o(l)}}}function A(r){let l,t,a,f,s=r[1].message+"",c,k,n,p,i=r[1].frame&&J(r),_=r[1].stack&&h(r);return{c(){l=E("h1"),t=v(r[0]),a=S(),f=E("pre"),c=v(s),k=S(),i&&i.c(),n=S(),_&&_.c(),p=C()},l(e){l=d(e,"H1",{});var m=b(l);t=P(m,r[0]),m.forEach(o),a=j(e),f=d(e,"PRE",{});var q=b(f);c=P(q,s),q.forEach(o),k=j(e),i&&i.l(e),n=j(e),_&&_.l(e),p=C()},m(e,m){u(e,l,m),R(l,t),u(e,a,m),u(e,f,m),R(f,c),u(e,k,m),i&&i.m(e,m),u(e,n,m),_&&_.m(e,m),u(e,p,m)},p(e,[m]){m&1&&N(t,e[0]),m&2&&s!==(s=e[1].message+"")&&N(c,s),e[1].frame?i?i.p(e,m):(i=J(e),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null),e[1].stack?_?_.p(e,m):(_=h(e),_.c(),_.m(p.parentNode,p)):_&&(_.d(1),_=null)},i:H,o:H,d(e){e&&o(l),e&&o(a),e&&o(f),e&&o(k),i&&i.d(e),e&&o(n),_&&_.d(e),e&&o(p)}}}function F({error:r,status:l}){return{props:{error:r,status:l}}}function B(r,l,t){let{status:a}=l,{error:f}=l;return r.$$set=s=>{"status"in s&&t(0,a=s.status),"error"in s&&t(1,f=s.error)},[a,f]}class G extends w{constructor(l){super(),y(this,l,B,A,z,{status:0,error:1})}}export{G as default,F as load};
|
static/_app/{layout.svelte-0c060267.js β layout.svelte-3942c837.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
import{S as l,i,s as r,F as u,G as f,H as _,I as c,q as p,o as d}from"./chunks/index-
|
|
|
1 |
+
import{S as l,i,s as r,F as u,G as f,H as _,I as c,q as p,o as d}from"./chunks/index-f8f7cfca.js";function m(n){let s;const o=n[1].default,e=u(o,n,n[0],null);return{c(){e&&e.c()},l(t){e&&e.l(t)},m(t,a){e&&e.m(t,a),s=!0},p(t,[a]){e&&e.p&&(!s||a&1)&&f(e,o,t,t[0],s?c(o,t[0],a,null):_(t[0]),null)},i(t){s||(p(e,t),s=!0)},o(t){d(e,t),s=!1},d(t){e&&e.d(t)}}}function $(n,s,o){let{$$slots:e={},$$scope:t}=s;return n.$$set=a=>{"$$scope"in a&&o(0,t=a.$$scope)},[t,e]}class h extends l{constructor(s){super(),i(this,s,$,m,r,{})}}export{h as default};
|
static/_app/manifest.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
{
|
2 |
".svelte-kit/runtime/client/start.js": {
|
3 |
-
"file": "start-
|
4 |
"src": ".svelte-kit/runtime/client/start.js",
|
5 |
"isEntry": true,
|
6 |
"imports": [
|
7 |
-
"_index-
|
8 |
-
"_index-
|
9 |
],
|
10 |
"dynamicImports": [
|
11 |
".svelte-kit/runtime/components/layout.svelte",
|
@@ -14,43 +14,43 @@
|
|
14 |
]
|
15 |
},
|
16 |
".svelte-kit/runtime/components/layout.svelte": {
|
17 |
-
"file": "layout.svelte-
|
18 |
"src": ".svelte-kit/runtime/components/layout.svelte",
|
19 |
"isEntry": true,
|
20 |
"isDynamicEntry": true,
|
21 |
"imports": [
|
22 |
-
"_index-
|
23 |
]
|
24 |
},
|
25 |
".svelte-kit/runtime/components/error.svelte": {
|
26 |
-
"file": "error.svelte-
|
27 |
"src": ".svelte-kit/runtime/components/error.svelte",
|
28 |
"isEntry": true,
|
29 |
"isDynamicEntry": true,
|
30 |
"imports": [
|
31 |
-
"_index-
|
32 |
]
|
33 |
},
|
34 |
"src/routes/index.svelte": {
|
35 |
-
"file": "pages/index.svelte-
|
36 |
"src": "src/routes/index.svelte",
|
37 |
"isEntry": true,
|
38 |
"isDynamicEntry": true,
|
39 |
"imports": [
|
40 |
-
"_index-
|
41 |
-
"_index-
|
42 |
],
|
43 |
"css": [
|
44 |
-
"assets/pages/index.svelte-
|
45 |
]
|
46 |
},
|
47 |
-
"_index-
|
48 |
-
"file": "chunks/index-
|
49 |
},
|
50 |
-
"_index-
|
51 |
-
"file": "chunks/index-
|
52 |
"imports": [
|
53 |
-
"_index-
|
54 |
]
|
55 |
}
|
56 |
}
|
|
|
1 |
{
|
2 |
".svelte-kit/runtime/client/start.js": {
|
3 |
+
"file": "start-5e34eb6b.js",
|
4 |
"src": ".svelte-kit/runtime/client/start.js",
|
5 |
"isEntry": true,
|
6 |
"imports": [
|
7 |
+
"_index-f8f7cfca.js",
|
8 |
+
"_index-7a30815e.js"
|
9 |
],
|
10 |
"dynamicImports": [
|
11 |
".svelte-kit/runtime/components/layout.svelte",
|
|
|
14 |
]
|
15 |
},
|
16 |
".svelte-kit/runtime/components/layout.svelte": {
|
17 |
+
"file": "layout.svelte-3942c837.js",
|
18 |
"src": ".svelte-kit/runtime/components/layout.svelte",
|
19 |
"isEntry": true,
|
20 |
"isDynamicEntry": true,
|
21 |
"imports": [
|
22 |
+
"_index-f8f7cfca.js"
|
23 |
]
|
24 |
},
|
25 |
".svelte-kit/runtime/components/error.svelte": {
|
26 |
+
"file": "error.svelte-2573bba8.js",
|
27 |
"src": ".svelte-kit/runtime/components/error.svelte",
|
28 |
"isEntry": true,
|
29 |
"isDynamicEntry": true,
|
30 |
"imports": [
|
31 |
+
"_index-f8f7cfca.js"
|
32 |
]
|
33 |
},
|
34 |
"src/routes/index.svelte": {
|
35 |
+
"file": "pages/index.svelte-b34d5edf.js",
|
36 |
"src": "src/routes/index.svelte",
|
37 |
"isEntry": true,
|
38 |
"isDynamicEntry": true,
|
39 |
"imports": [
|
40 |
+
"_index-f8f7cfca.js",
|
41 |
+
"_index-7a30815e.js"
|
42 |
],
|
43 |
"css": [
|
44 |
+
"assets/pages/index.svelte-10d60411.css"
|
45 |
]
|
46 |
},
|
47 |
+
"_index-f8f7cfca.js": {
|
48 |
+
"file": "chunks/index-f8f7cfca.js"
|
49 |
},
|
50 |
+
"_index-7a30815e.js": {
|
51 |
+
"file": "chunks/index-7a30815e.js",
|
52 |
"imports": [
|
53 |
+
"_index-f8f7cfca.js"
|
54 |
]
|
55 |
}
|
56 |
}
|
static/_app/pages/index.svelte-416adc10.js
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
import{S as J,i as K,s as Q,e as g,k as T,c as v,a as y,d as p,m as I,K as se,b as _,g as M,J as f,L as B,t as O,h as z,j as Ie,E as Y,M as Ge,N as L,O as de,P as Ue,w as W,x as X,y as F,Q as We,q as S,o as A,B as q,R as oe,T as qe,U as ce,f as fe,V as Ye,W as Je,X as ae,n as Ne,p as Ce,Y as Xe,l as _e,Z as Ke}from"../chunks/index-c61749f5.js";import{w as le}from"../chunks/index-f9918abc.js";const ye=le("synth"),ke=le("medium"),we=le("medium"),be=le(!1),Ee=le(""),$e=le(""),Te=le(""),he={piano:"Piano",chamber:"Chamber Music",rock_and_metal:"Rock and Metal",synth:"Synthesizer",church:"Church",timpani_strings_harp:"Timpani, Contrabass, Harp",country:"Country"},Qe={low:"Low",medium:"Medium",high:"High"},Ze={low:"Low",medium:"Medium",high:"High",very_high:"Very High"};function Be(r,e,t){const s=r.slice();return s[4]=e[t],s[6]=t,s}function Le(r){let e,t,s,c,l,n,a,o,d,u,i,m;return{c(){e=g("label"),t=g("div"),s=g("img"),n=T(),a=g("input"),d=T(),this.h()},l(h){e=v(h,"LABEL",{"data-selected":!0,class:!0});var k=y(e);t=v(k,"DIV",{class:!0});var P=y(t);s=v(P,"IMG",{src:!0,alt:!0,class:!0}),P.forEach(p),n=I(k),a=v(k,"INPUT",{type:!0,class:!0}),d=I(k),k.forEach(p),this.h()},h(){se(s.src,c=`${r[4]}.svg`)||_(s,"src",c),_(s,"alt",l=he[r[4]]),_(s,"class","svelte-1r9pswz"),_(t,"class","svelte-1r9pswz"),_(a,"type","radio"),a.__value=o=r[4],a.value=a.__value,_(a,"class","svelte-1r9pswz"),r[3][0].push(a),_(e,"data-selected",u=r[0]===r[4]),_(e,"class","svelte-1r9pswz")},m(h,k){M(h,e,k),f(e,t),f(t,s),f(e,n),f(e,a),a.checked=a.__value===r[0],f(e,d),i||(m=B(a,"change",r[2]),i=!0)},p(h,k){k&1&&(a.checked=a.__value===h[0]),k&1&&u!==(u=h[0]===h[4])&&_(e,"data-selected",u)},d(h){h&&p(e),r[3][0].splice(r[3][0].indexOf(a),1),i=!1,m()}}}function xe(r){let e,t,s=(he[r[0]]||"Synthesizer")+"",c,l,n,a=r[1],o=[];for(let d=0;d<a.length;d+=1)o[d]=Le(Be(r,a,d));return{c(){e=g("fieldset"),t=g("legend"),c=O(s),l=T(),n=g("div");for(let d=0;d<o.length;d+=1)o[d].c();this.h()},l(d){e=v(d,"FIELDSET",{class:!0});var u=y(e);t=v(u,"LEGEND",{class:!0});var i=y(t);c=z(i,s),i.forEach(p),l=I(u),n=v(u,"DIV",{class:!0});var m=y(n);for(let h=0;h<o.length;h+=1)o[h].l(m);m.forEach(p),u.forEach(p),this.h()},h(){_(t,"class","svelte-1r9pswz"),_(n,"class","grid svelte-1r9pswz"),_(e,"class","svelte-1r9pswz")},m(d,u){M(d,e,u),f(e,t),f(t,c),f(e,l),f(e,n);for(let i=0;i<o.length;i+=1)o[i].m(n,null)},p(d,[u]){if(u&1&&s!==(s=(he[d[0]]||"Synthesizer")+"")&&Ie(c,s),u&3){a=d[1];let i;for(i=0;i<a.length;i+=1){const m=Be(d,a,i);o[i]?o[i].p(m,u):(o[i]=Le(m),o[i].c(),o[i].m(n,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=a.length}},i:Y,o:Y,d(d){d&&p(e),Ge(o,d)}}}function et(r,e,t){let s;L(r,ye,a=>t(0,s=a));const c=Object.keys(he),l=[[]];function n(){s=this.__value,ye.set(s)}return[s,c,n,l]}class tt extends J{constructor(e){super(),K(this,e,et,xe,Q,{})}}function je(r,e,t){const s=r.slice();return s[5]=e[t],s}function Pe(r){let e,t=r[1][r[5]]+"",s,c,l,n,a,o,d;return{c(){e=g("label"),s=O(t),c=T(),l=g("input"),this.h()},l(u){e=v(u,"LABEL",{"data-selected":!0,class:!0});var i=y(e);s=z(i,t),c=I(i),l=v(i,"INPUT",{type:!0,class:!0}),i.forEach(p),this.h()},h(){_(l,"type","radio"),l.__value=n=r[5],l.value=l.__value,_(l,"class","svelte-1m848u0"),r[4][0].push(l),_(e,"data-selected",a=r[5]===r[0]),_(e,"class","svelte-1m848u0")},m(u,i){M(u,e,i),f(e,s),f(e,c),f(e,l),l.checked=l.__value===r[0],o||(d=B(l,"change",r[3]),o=!0)},p(u,i){i&2&&t!==(t=u[1][u[5]]+"")&&Ie(s,t),i&1&&(l.checked=l.__value===u[0]),i&1&&a!==(a=u[5]===u[0])&&_(e,"data-selected",a)},d(u){u&&p(e),r[4][0].splice(r[4][0].indexOf(l),1),o=!1,d()}}}function st(r){let e,t,s,c=r[2],l=[];for(let n=0;n<c.length;n+=1)l[n]=Pe(je(r,c,n));return{c(){e=g("div");for(let n=0;n<l.length;n+=1)l[n].c();t=T(),s=g("input"),this.h()},l(n){e=v(n,"DIV",{class:!0});var a=y(e);for(let o=0;o<l.length;o+=1)l[o].l(a);t=I(a),s=v(a,"INPUT",{type:!0,class:!0}),a.forEach(p),this.h()},h(){_(s,"type","radio"),s.checked=!0,_(s,"class","svelte-1m848u0"),_(e,"class","options svelte-1m848u0")},m(n,a){M(n,e,a);for(let o=0;o<l.length;o+=1)l[o].m(e,null);f(e,t),f(e,s)},p(n,[a]){if(a&7){c=n[2];let o;for(o=0;o<c.length;o+=1){const d=je(n,c,o);l[o]?l[o].p(d,a):(l[o]=Pe(d),l[o].c(),l[o].m(e,t))}for(;o<l.length;o+=1)l[o].d(1);l.length=c.length}},i:Y,o:Y,d(n){n&&p(e),Ge(l,n)}}}function lt(r,e,t){let{options:s}=e;const c=Object.keys(s);let{selection:l=c[1]}=e;const n=[[]];function a(){l=this.__value,t(0,l)}return r.$$set=o=>{"options"in o&&t(1,s=o.options),"selection"in o&&t(0,l=o.selection)},[l,s,c,a,n]}class Fe extends J{constructor(e){super(),K(this,e,lt,st,Q,{options:1,selection:0})}}function nt(r){let e,t,s,c,l,n,a,o;function d(i){r[1](i)}let u={options:Qe};return r[0]!==void 0&&(u.selection=r[0]),n=new Fe({props:u}),de.push(()=>Ue(n,"selection",d)),{c(){e=g("div"),t=g("fieldset"),s=g("legend"),c=O("Note density"),l=T(),W(n.$$.fragment),this.h()},l(i){e=v(i,"DIV",{});var m=y(e);t=v(m,"FIELDSET",{class:!0});var h=y(t);s=v(h,"LEGEND",{class:!0});var k=y(s);c=z(k,"Note density"),k.forEach(p),l=I(h),X(n.$$.fragment,h),h.forEach(p),m.forEach(p),this.h()},h(){_(s,"class","svelte-1ikh8be"),_(t,"class","svelte-1ikh8be")},m(i,m){M(i,e,m),f(e,t),f(t,s),f(s,c),f(t,l),F(n,t,null),o=!0},p(i,[m]){const h={};!a&&m&1&&(a=!0,h.selection=i[0],We(()=>a=!1)),n.$set(h)},i(i){o||(S(n.$$.fragment,i),o=!0)},o(i){A(n.$$.fragment,i),o=!1},d(i){i&&p(e),q(n)}}}function rt(r,e,t){let s;L(r,ke,l=>t(0,s=l));function c(l){s=l,ke.set(s)}return[s,c]}class at extends J{constructor(e){super(),K(this,e,rt,nt,Q,{})}}function it(r){let e,t,s,c,l,n,a,o;function d(i){r[1](i)}let u={options:Ze};return r[0]!==void 0&&(u.selection=r[0]),n=new Fe({props:u}),de.push(()=>Ue(n,"selection",d)),{c(){e=g("div"),t=g("fieldset"),s=g("legend"),c=O("Temperature"),l=T(),W(n.$$.fragment),this.h()},l(i){e=v(i,"DIV",{});var m=y(e);t=v(m,"FIELDSET",{class:!0});var h=y(t);s=v(h,"LEGEND",{class:!0});var k=y(s);c=z(k,"Temperature"),k.forEach(p),l=I(h),X(n.$$.fragment,h),h.forEach(p),m.forEach(p),this.h()},h(){_(s,"class","svelte-1ikh8be"),_(t,"class","svelte-1ikh8be")},m(i,m){M(i,e,m),f(e,t),f(t,s),f(s,c),f(t,l),F(n,t,null),o=!0},p(i,[m]){const h={};!a&&m&1&&(a=!0,h.selection=i[0],We(()=>a=!1)),n.$set(h)},i(i){o||(S(n.$$.fragment,i),o=!0)},o(i){A(n.$$.fragment,i),o=!1},d(i){i&&p(e),q(n)}}}function ot(r,e,t){let s;L(r,we,l=>t(0,s=l));function c(l){s=l,we.set(s)}return[s,c]}class ct extends J{constructor(e){super(),K(this,e,ot,it,Q,{})}}function ut(r){let e,t,s;return{c(){e=O("Compose "),t=g("img"),this.h()},l(c){e=z(c,"Compose "),t=v(c,"IMG",{src:!0,alt:!0,class:!0}),this.h()},h(){se(t.src,s="wand.svg")||_(t,"src",s),_(t,"alt","Magic wand"),_(t,"class","svelte-18w38ow")},m(c,l){M(c,e,l),M(c,t,l)},d(c){c&&p(e),c&&p(t)}}}function ft(r){let e;return{c(){e=O("Composing...")},l(t){e=z(t,"Composing...")},m(t,s){M(t,e,s)},d(t){t&&p(e)}}}function dt(r){let e,t,s;function c(a,o){return a[0]?ft:ut}let l=c(r),n=l(r);return{c(){e=g("button"),n.c(),this.h()},l(a){e=v(a,"BUTTON",{class:!0});var o=y(e);n.l(o),o.forEach(p),this.h()},h(){e.disabled=r[0],_(e,"class","svelte-18w38ow")},m(a,o){M(a,e,o),n.m(e,null),t||(s=B(e,"click",r[1]),t=!0)},p(a,[o]){l!==(l=c(a))&&(n.d(1),n=l(a),n&&(n.c(),n.m(e,null))),o&1&&(e.disabled=a[0])},i:Y,o:Y,d(a){a&&p(e),n.d(),t=!1,s()}}}function _t(r,e,t){let s,c,l,n,a,o,d;return L(r,be,i=>t(0,s=i)),L(r,Ee,i=>t(2,c=i)),L(r,Te,i=>t(3,l=i)),L(r,$e,i=>t(4,n=i)),L(r,we,i=>t(5,a=i)),L(r,ke,i=>t(6,o=i)),L(r,ye,i=>t(7,d=i)),[s,async()=>{try{oe(be,s=!0,s);const i=await fetch("compose",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({music_style:d,density:o,temperature:a})});if(!i.ok)throw new Error(`Unable to create composition: [${i.status}] ${i.text()}`);const{audio:m,image:h,tokens:k}=await i.json();oe($e,n=h,n),oe(Te,l=k,l),oe(Ee,c=m,c)}catch(i){console.error(i)}finally{oe(be,s=!1,s)}}]}class ht extends J{constructor(e){super(),K(this,e,_t,dt,Q,{})}}function ie(r,{delay:e=0,duration:t=400,easing:s=qe}={}){const c=+getComputedStyle(r).opacity;return{delay:e,duration:t,easing:s,css:l=>`opacity: ${l*c}`}}function Re(r){let e,t,s,c,l,n,a,o=!1,d,u=!0,i,m,h=`translateX(${r[7]*(r[0]/r[1])}px)`,k,P,C,j,H,U;function R(){cancelAnimationFrame(d),n.paused||(d=Ke(R),o=!0),r[15].call(n)}let $=r[2]&&Ve(r);return{c(){e=g("section"),t=g("div"),s=g("img"),l=T(),n=g("audio"),i=T(),m=g("div"),k=T(),$&&$.c(),this.h()},l(w){e=v(w,"SECTION",{class:!0});var E=y(e);t=v(E,"DIV",{class:!0});var b=y(t);s=v(b,"IMG",{class:!0,src:!0,alt:!0,draggable:!0}),l=I(b),n=v(b,"AUDIO",{src:!0,class:!0}),y(n).forEach(p),i=I(b),m=v(b,"DIV",{class:!0}),y(m).forEach(p),k=I(b),$&&$.l(b),b.forEach(p),E.forEach(p),this.h()},h(){_(s,"class","visualisation svelte-sa1t0p"),se(s.src,c=r[8])||_(s,"src",c),_(s,"alt","MIDI notes of composition"),_(s,"draggable","false"),se(n.src,a=r[4])||_(n,"src",a),_(n,"class","svelte-sa1t0p"),r[1]===void 0&&ce(()=>r[16].call(n)),_(m,"class","handle svelte-sa1t0p"),fe(m,"transform",h,!1),_(t,"class","container svelte-sa1t0p"),fe(t,"width",Math.min(r[7],r[6])+"px",!1),_(e,"class","svelte-sa1t0p"),ce(()=>r[20].call(e))},m(w,E){M(w,e,E),f(e,t),f(t,s),r[13](s),f(t,l),f(t,n),f(t,i),f(t,m),f(t,k),$&&$.m(t,null),r[19](t),P=Ye(e,r[20].bind(e)),j=!0,H||(U=[B(s,"click",r[14]),B(n,"timeupdate",R),B(n,"durationchange",r[16]),B(n,"play",r[17]),B(n,"pause",r[17]),B(t,"mousemove",r[9]),B(t,"touchmove",Je(r[10]))],H=!0)},p(w,E){(!j||E&256&&!se(s.src,c=w[8]))&&_(s,"src",c),(!j||E&16&&!se(n.src,a=w[4]))&&_(n,"src",a),!o&&E&1&&!isNaN(w[0])&&(n.currentTime=w[0]),o=!1,E&4&&u!==(u=w[2])&&n[u?"pause":"play"](),E&131&&h!==(h=`translateX(${w[7]*(w[0]/w[1])}px)`)&&fe(m,"transform",h,!1),w[2]?$?($.p(w,E),E&4&&S($,1)):($=Ve(w),$.c(),S($,1),$.m(t,null)):$&&(Ne(),A($,1,1,()=>{$=null}),Ce()),E&192&&fe(t,"width",Math.min(w[7],w[6])+"px",!1)},i(w){j||(S($),ce(()=>{C||(C=ae(e,ie,{},!0)),C.run(1)}),j=!0)},o(w){A($),C||(C=ae(e,ie,{},!1)),C.run(0),j=!1},d(w){w&&p(e),r[13](null),$&&$.d(),r[19](null),P(),w&&C&&C.end(),H=!1,Xe(U)}}}function Ve(r){let e,t,s,c,l,n;return{c(){e=g("img"),this.h()},l(a){e=v(a,"IMG",{class:!0,src:!0,alt:!0,draggable:!0}),this.h()},h(){_(e,"class","play svelte-sa1t0p"),se(e.src,t="play.svg")||_(e,"src",t),_(e,"alt","Play button"),_(e,"draggable","false")},m(a,o){M(a,e,o),c=!0,l||(n=B(e,"click",r[18]),l=!0)},p:Y,i(a){c||(ce(()=>{s||(s=ae(e,ie,{},!0)),s.run(1)}),c=!0)},o(a){s||(s=ae(e,ie,{},!1)),s.run(0),c=!1},d(a){a&&p(e),a&&s&&s.end(),l=!1,n()}}}function pt(r){let e,t,s,c,l=r[4]&&Re(r);return{c(){l&&l.c(),e=_e()},l(n){l&&l.l(n),e=_e()},m(n,a){l&&l.m(n,a),M(n,e,a),t=!0,s||(c=[B(window,"keydown",r[11]),B(window,"resize",r[12])],s=!0)},p(n,[a]){n[4]?l?(l.p(n,a),a&16&&S(l,1)):(l=Re(n),l.c(),S(l,1),l.m(e.parentNode,e)):l&&(Ne(),A(l,1,1,()=>{l=null}),Ce())},i(n){t||(S(l),t=!0)},o(n){A(l),t=!1},d(n){l&&l.d(n),n&&p(e),s=!1,Xe(c)}}}function mt(r,e,t){let s,c,l;L(r,Ee,b=>t(4,c=b)),L(r,$e,b=>t(8,l=b));let n,a,o=!0,d,u,i;const m=b=>{if(!a||!b.buttons)return;const{left:G,right:V}=d.getBoundingClientRect();t(0,n=a*(b.clientX-G)/(V-G))},h=b=>{if(!a)return;const{left:G,right:V}=d.getBoundingClientRect();t(0,n=a*(b.touches[0].clientX-G)/(V-G))},k=b=>{b.code==="Space"&&t(2,o=!o)},P=()=>t(7,s=u&&u.clientWidth);function C(b){de[b?"unshift":"push"](()=>{u=b,t(3,u)})}const j=()=>t(2,o=!o);function H(){n=this.currentTime,t(0,n)}function U(){a=this.duration,t(1,a)}function R(){o=this.paused,t(2,o)}const $=()=>t(2,o=!o);function w(b){de[b?"unshift":"push"](()=>{d=b,t(5,d)})}function E(){i=this.clientWidth,t(6,i)}return r.$$.update=()=>{r.$$.dirty&8&&t(7,s=u&&u.clientWidth),r.$$.dirty&31&&(c||n||a||!o)&&t(7,s=u&&u.clientWidth)},[n,a,o,u,c,d,i,s,l,m,h,k,P,C,j,H,U,R,$,w,E]}class gt extends J{constructor(e){super(),K(this,e,mt,pt,Q,{})}}function He(r){let e,t,s,c,l,n,a,o;return{c(){e=g("section"),t=g("h2"),s=O("Tokenized notes"),c=T(),l=g("p"),n=O(r[0]),this.h()},l(d){e=v(d,"SECTION",{class:!0});var u=y(e);t=v(u,"H2",{});var i=y(t);s=z(i,"Tokenized notes"),i.forEach(p),c=I(u),l=v(u,"P",{class:!0});var m=y(l);n=z(m,r[0]),m.forEach(p),u.forEach(p),this.h()},h(){_(l,"class","svelte-4un5mw"),_(e,"class","svelte-4un5mw")},m(d,u){M(d,e,u),f(e,t),f(t,s),f(e,c),f(e,l),f(l,n),o=!0},p(d,u){(!o||u&1)&&Ie(n,d[0])},i(d){o||(ce(()=>{a||(a=ae(e,ie,{},!0)),a.run(1)}),o=!0)},o(d){a||(a=ae(e,ie,{},!1)),a.run(0),o=!1},d(d){d&&p(e),d&&a&&a.end()}}}function vt(r){let e,t,s=r[0]&&He(r);return{c(){s&&s.c(),e=_e()},l(c){s&&s.l(c),e=_e()},m(c,l){s&&s.m(c,l),M(c,e,l),t=!0},p(c,[l]){c[0]?s?(s.p(c,l),l&1&&S(s,1)):(s=He(c),s.c(),S(s,1),s.m(e.parentNode,e)):s&&(Ne(),A(s,1,1,()=>{s=null}),Ce())},i(c){t||(S(s),t=!0)},o(c){A(s),t=!1},d(c){s&&s.d(c),c&&p(e)}}}function bt(r,e,t){let s;return L(r,Te,c=>t(0,s=c)),[s]}class yt extends J{constructor(e){super(),K(this,e,bt,vt,Q,{})}}function kt(r){let e,t,s,c,l,n,a,o,d,u,i,m,h,k,P,C,j,H,U,R,$,w,E,b,G,V,pe,Z,me,x,ge,ee,ve,te,ue;return b=new tt({}),V=new at({}),Z=new ct({}),x=new ht({}),ee=new gt({}),te=new yt({}),{c(){e=g("main"),t=g("h1"),s=O("Composer"),c=T(),l=g("p"),n=O("A hundred thousand songs used to train. One AI model. Infinite compositions."),a=T(),o=g("p"),d=O(`This space contains a deep neural network model that can compose music. You can use it to generate music in
|
2 |
-
different styles, 4 bars at a time.`),u=T(),i=g("p"),m=O("Developed by "),h=g("a"),k=O("Ron Au"),P=O(` and
|
3 |
-
`),C=g("a"),j=O("Tristan Behrens"),H=O("."),U=T(),R=g("p"),$=O("Have fun! And always feel free to send us some feedback and share your compositions!"),w=T(),E=g("section"),W(b.$$.fragment),G=T(),W(V.$$.fragment),pe=T(),W(Z.$$.fragment),me=T(),W(x.$$.fragment),ge=T(),W(ee.$$.fragment),ve=T(),W(te.$$.fragment),this.h()},l(D){e=v(D,"MAIN",{class:!0});var N=y(e);t=v(N,"H1",{class:!0});var De=y(t);s=z(De,"Composer"),De.forEach(p),c=I(N),l=v(N,"P",{class:!0});var Oe=y(l);n=z(Oe,"A hundred thousand songs used to train. One AI model. Infinite compositions."),Oe.forEach(p),a=I(N),o=v(N,"P",{class:!0});var ze=y(o);d=z(ze,`This space contains a deep neural network model that can compose music. You can use it to generate music in
|
4 |
-
different styles, 4 bars at a time.`),ze.forEach(p),u=I(N),i=v(N,"P",{class:!0});var ne=y(i);m=z(ne,"Developed by "),h=v(ne,"A",{href:!0,rel:!0,target:!0});var Se=y(h);k=z(Se,"Ron Au"),Se.forEach(p),P=z(ne,` and
|
5 |
-
`),C=v(ne,"A",{href:!0,rel:!0,target:!0});var Me=y(C);j=z(Me,"Tristan Behrens"),Me.forEach(p),H=z(ne,"."),ne.forEach(p),U=I(N),R=v(N,"P",{class:!0});var Ae=y(R);$=z(Ae,"Have fun! And always feel free to send us some feedback and share your compositions!"),Ae.forEach(p),w=I(N),E=v(N,"SECTION",{id:!0,class:!0});var re=y(E);X(b.$$.fragment,re),G=I(re),X(V.$$.fragment,re),pe=I(re),X(Z.$$.fragment,re),re.forEach(p),me=I(N),X(x.$$.fragment,N),ge=I(N),X(ee.$$.fragment,N),ve=I(N),X(te.$$.fragment,N),N.forEach(p),this.h()},h(){_(t,"class","svelte-1rfjlkw"),_(l,"class","heading svelte-1rfjlkw"),_(o,"class","svelte-1rfjlkw"),_(h,"href","https://twitter.com/ronvoluted"),_(h,"rel","noopener"),_(h,"target","_blank"),_(C,"href","https://twitter.com/DrTBehrens"),_(C,"rel","noopener"),_(C,"target","_blank"),_(i,"class","svelte-1rfjlkw"),_(R,"class","svelte-1rfjlkw"),_(E,"id","options"),_(E,"class","svelte-1rfjlkw"),_(e,"class","svelte-1rfjlkw")},m(D,N){M(D,e,N),f(e,t),f(t,s),f(e,c),f(e,l),f(l,n),f(e,a),f(e,o),f(o,d),f(e,u),f(e,i),f(i,m),f(i,h),f(h,k),f(i,P),f(i,C),f(C,j),f(i,H),f(e,U),f(e,R),f(R,$),f(e,w),f(e,E),F(b,E,null),f(E,G),F(V,E,null),f(E,pe),F(Z,E,null),f(e,me),F(x,e,null),f(e,ge),F(ee,e,null),f(e,ve),F(te,e,null),ue=!0},p:Y,i(D){ue||(S(b.$$.fragment,D),S(V.$$.fragment,D),S(Z.$$.fragment,D),S(x.$$.fragment,D),S(ee.$$.fragment,D),S(te.$$.fragment,D),ue=!0)},o(D){A(b.$$.fragment,D),A(V.$$.fragment,D),A(Z.$$.fragment,D),A(x.$$.fragment,D),A(ee.$$.fragment,D),A(te.$$.fragment,D),ue=!1},d(D){D&&p(e),q(b),q(V),q(Z),q(x),q(ee),q(te)}}}class $t extends J{constructor(e){super(),K(this,e,null,kt,Q,{})}}export{$t as default};
|
|
|
|
|
|
|
|
|
|
|
|
static/_app/pages/index.svelte-b34d5edf.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import{S as J,i as K,s as Q,e as v,k as D,c as b,a as E,d as p,m as C,K as se,b as f,g as P,J as u,L as G,t as H,h as j,j as Ie,E as ne,M as Ue,N as z,O as he,P as Ve,w as q,x as W,y as X,Q as Fe,q as L,o as R,B as Y,R as fe,T as We,U as _e,f as ie,V as Xe,W as ce,n as De,p as Ce,X as Ye,l as pe,v as Je,u as Ke,Y as Qe}from"../chunks/index-f8f7cfca.js";import{w as ae}from"../chunks/index-7a30815e.js";const me=ae("synth"),we=ae("medium"),ke=ae("medium"),ye=ae(!1),Ee=ae(""),$e=ae(""),Te=ae(""),le={piano:"Piano",chamber:"Chamber Music",rock_and_metal:"Rock and Metal",synth:"Synthesizer",church:"Church",timpani_strings_harp:"Timpani, Contrabass, Harp",country:"Country",reggae:"Reggae-esque"},Ze={low:"Low",medium:"Medium",high:"High"},xe={low:"Low",medium:"Medium",high:"High",very_high:"Very High"};function je(l,e,s){const t=l.slice();return t[4]=e[s],t[6]=s,t}function Be(l){let e,s,t,r,n,a,i,o,d,h,c,m;return{c(){e=v("label"),s=v("div"),t=v("img"),a=D(),i=v("input"),d=D(),this.h()},l(_){e=b(_,"LABEL",{"data-selected":!0,class:!0});var T=E(e);s=b(T,"DIV",{class:!0});var g=E(s);t=b(g,"IMG",{src:!0,alt:!0,class:!0}),g.forEach(p),a=C(T),i=b(T,"INPUT",{type:!0,class:!0}),d=C(T),T.forEach(p),this.h()},h(){se(t.src,r=`static/${l[4]}.svg`)||f(t,"src",r),f(t,"alt",n=le[l[4]]),f(t,"class","svelte-1r9pswz"),f(s,"class","svelte-1r9pswz"),f(i,"type","radio"),i.__value=o=l[4],i.value=i.__value,f(i,"class","svelte-1r9pswz"),l[3][0].push(i),f(e,"data-selected",h=l[0]===l[4]),f(e,"class","svelte-1r9pswz")},m(_,T){P(_,e,T),u(e,s),u(s,t),u(e,a),u(e,i),i.checked=i.__value===l[0],u(e,d),c||(m=G(i,"change",l[2]),c=!0)},p(_,T){T&1&&(i.checked=i.__value===_[0]),T&1&&h!==(h=_[0]===_[4])&&f(e,"data-selected",h)},d(_){_&&p(e),l[3][0].splice(l[3][0].indexOf(i),1),c=!1,m()}}}function et(l){let e,s,t=(le[l[0]]||"Synthesizer")+"",r,n,a,i=l[1],o=[];for(let d=0;d<i.length;d+=1)o[d]=Be(je(l,i,d));return{c(){e=v("fieldset"),s=v("legend"),r=H(t),n=D(),a=v("div");for(let d=0;d<o.length;d+=1)o[d].c();this.h()},l(d){e=b(d,"FIELDSET",{class:!0});var h=E(e);s=b(h,"LEGEND",{class:!0});var c=E(s);r=j(c,t),c.forEach(p),n=C(h),a=b(h,"DIV",{class:!0});var m=E(a);for(let _=0;_<o.length;_+=1)o[_].l(m);m.forEach(p),h.forEach(p),this.h()},h(){f(s,"class","svelte-1r9pswz"),f(a,"class","grid svelte-1r9pswz"),f(e,"class","svelte-1r9pswz")},m(d,h){P(d,e,h),u(e,s),u(s,r),u(e,n),u(e,a);for(let c=0;c<o.length;c+=1)o[c].m(a,null)},p(d,[h]){if(h&1&&t!==(t=(le[d[0]]||"Synthesizer")+"")&&Ie(r,t),h&3){i=d[1];let c;for(c=0;c<i.length;c+=1){const m=je(d,i,c);o[c]?o[c].p(m,h):(o[c]=Be(m),o[c].c(),o[c].m(a,null))}for(;c<o.length;c+=1)o[c].d(1);o.length=i.length}},i:ne,o:ne,d(d){d&&p(e),Ue(o,d)}}}function tt(l,e,s){let t;z(l,me,i=>s(0,t=i));const r=Object.keys(le),n=[[]];function a(){t=this.__value,me.set(t)}return[t,r,a,n]}class st extends J{constructor(e){super(),K(this,e,tt,et,Q,{})}}function Le(l,e,s){const t=l.slice();return t[5]=e[s],t}function Pe(l){let e,s=l[1][l[5]]+"",t,r,n,a,i,o,d;return{c(){e=v("label"),t=H(s),r=D(),n=v("input"),this.h()},l(h){e=b(h,"LABEL",{"data-selected":!0,class:!0});var c=E(e);t=j(c,s),r=C(c),n=b(c,"INPUT",{type:!0,class:!0}),c.forEach(p),this.h()},h(){f(n,"type","radio"),n.__value=a=l[5],n.value=n.__value,f(n,"class","svelte-1m848u0"),l[4][0].push(n),f(e,"data-selected",i=l[5]===l[0]),f(e,"class","svelte-1m848u0")},m(h,c){P(h,e,c),u(e,t),u(e,r),u(e,n),n.checked=n.__value===l[0],o||(d=G(n,"change",l[3]),o=!0)},p(h,c){c&2&&s!==(s=h[1][h[5]]+"")&&Ie(t,s),c&1&&(n.checked=n.__value===h[0]),c&1&&i!==(i=h[5]===h[0])&&f(e,"data-selected",i)},d(h){h&&p(e),l[4][0].splice(l[4][0].indexOf(n),1),o=!1,d()}}}function nt(l){let e,s,t,r=l[2],n=[];for(let a=0;a<r.length;a+=1)n[a]=Pe(Le(l,r,a));return{c(){e=v("div");for(let a=0;a<n.length;a+=1)n[a].c();s=D(),t=v("input"),this.h()},l(a){e=b(a,"DIV",{class:!0});var i=E(e);for(let o=0;o<n.length;o+=1)n[o].l(i);s=C(i),t=b(i,"INPUT",{type:!0,class:!0}),i.forEach(p),this.h()},h(){f(t,"type","radio"),t.checked=!0,f(t,"class","svelte-1m848u0"),f(e,"class","options svelte-1m848u0")},m(a,i){P(a,e,i);for(let o=0;o<n.length;o+=1)n[o].m(e,null);u(e,s),u(e,t)},p(a,[i]){if(i&7){r=a[2];let o;for(o=0;o<r.length;o+=1){const d=Le(a,r,o);n[o]?n[o].p(d,i):(n[o]=Pe(d),n[o].c(),n[o].m(e,s))}for(;o<n.length;o+=1)n[o].d(1);n.length=r.length}},i:ne,o:ne,d(a){a&&p(e),Ue(n,a)}}}function lt(l,e,s){let{options:t}=e;const r=Object.keys(t);let{selection:n=r[1]}=e;const a=[[]];function i(){n=this.__value,s(0,n)}return l.$$set=o=>{"options"in o&&s(1,t=o.options),"selection"in o&&s(0,n=o.selection)},[n,t,r,i,a]}class qe extends J{constructor(e){super(),K(this,e,lt,nt,Q,{options:1,selection:0})}}function at(l){let e,s,t,r,n,a,i,o;function d(c){l[1](c)}let h={options:Ze};return l[0]!==void 0&&(h.selection=l[0]),a=new qe({props:h}),he.push(()=>Ve(a,"selection",d)),{c(){e=v("div"),s=v("fieldset"),t=v("legend"),r=H("Note density"),n=D(),q(a.$$.fragment),this.h()},l(c){e=b(c,"DIV",{});var m=E(e);s=b(m,"FIELDSET",{class:!0});var _=E(s);t=b(_,"LEGEND",{class:!0});var T=E(t);r=j(T,"Note density"),T.forEach(p),n=C(_),W(a.$$.fragment,_),_.forEach(p),m.forEach(p),this.h()},h(){f(t,"class","svelte-1ikh8be"),f(s,"class","svelte-1ikh8be")},m(c,m){P(c,e,m),u(e,s),u(s,t),u(t,r),u(s,n),X(a,s,null),o=!0},p(c,[m]){const _={};!i&&m&1&&(i=!0,_.selection=c[0],Fe(()=>i=!1)),a.$set(_)},i(c){o||(L(a.$$.fragment,c),o=!0)},o(c){R(a.$$.fragment,c),o=!1},d(c){c&&p(e),Y(a)}}}function rt(l,e,s){let t;z(l,we,n=>s(0,t=n));function r(n){t=n,we.set(t)}return[t,r]}class ot extends J{constructor(e){super(),K(this,e,rt,at,Q,{})}}function it(l){let e,s,t,r,n,a,i,o;function d(c){l[1](c)}let h={options:xe};return l[0]!==void 0&&(h.selection=l[0]),a=new qe({props:h}),he.push(()=>Ve(a,"selection",d)),{c(){e=v("div"),s=v("fieldset"),t=v("legend"),r=H("Temperature"),n=D(),q(a.$$.fragment),this.h()},l(c){e=b(c,"DIV",{});var m=E(e);s=b(m,"FIELDSET",{class:!0});var _=E(s);t=b(_,"LEGEND",{class:!0});var T=E(t);r=j(T,"Temperature"),T.forEach(p),n=C(_),W(a.$$.fragment,_),_.forEach(p),m.forEach(p),this.h()},h(){f(t,"class","svelte-1ikh8be"),f(s,"class","svelte-1ikh8be")},m(c,m){P(c,e,m),u(e,s),u(s,t),u(t,r),u(s,n),X(a,s,null),o=!0},p(c,[m]){const _={};!i&&m&1&&(i=!0,_.selection=c[0],Fe(()=>i=!1)),a.$set(_)},i(c){o||(L(a.$$.fragment,c),o=!0)},o(c){R(a.$$.fragment,c),o=!1},d(c){c&&p(e),Y(a)}}}function ct(l,e,s){let t;z(l,ke,n=>s(0,t=n));function r(n){t=n,ke.set(t)}return[t,r]}class ut extends J{constructor(e){super(),K(this,e,ct,it,Q,{})}}function ft(l){let e,s,t;return{c(){e=H("Compose "),s=v("img"),this.h()},l(r){e=j(r,"Compose "),s=b(r,"IMG",{src:!0,alt:!0,class:!0}),this.h()},h(){se(s.src,t="static/wand.svg")||f(s,"src",t),f(s,"alt","Magic wand"),f(s,"class","svelte-18w38ow")},m(r,n){P(r,e,n),P(r,s,n)},d(r){r&&p(e),r&&p(s)}}}function dt(l){let e;return{c(){e=H("Composing...")},l(s){e=j(s,"Composing...")},m(s,t){P(s,e,t)},d(s){s&&p(e)}}}function ht(l){let e,s,t;function r(i,o){return i[0]?dt:ft}let n=r(l),a=n(l);return{c(){e=v("button"),a.c(),this.h()},l(i){e=b(i,"BUTTON",{class:!0});var o=E(e);a.l(o),o.forEach(p),this.h()},h(){e.disabled=l[0],f(e,"class","svelte-18w38ow")},m(i,o){P(i,e,o),a.m(e,null),s||(t=G(e,"click",l[1]),s=!0)},p(i,[o]){n!==(n=r(i))&&(a.d(1),a=n(i),a&&(a.c(),a.m(e,null))),o&1&&(e.disabled=i[0])},i:ne,o:ne,d(i){i&&p(e),a.d(),s=!1,t()}}}function _t(l,e,s){let t,r,n,a,i,o,d;z(l,ye,g=>s(0,t=g)),z(l,Te,g=>s(2,r=g)),z(l,$e,g=>s(3,n=g)),z(l,Ee,g=>s(4,a=g)),z(l,ke,g=>s(5,i=g)),z(l,we,g=>s(6,o=g)),z(l,me,g=>s(7,d=g));const h=()=>{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new MediaMetadata({title:`${le[d]} omposition`,artist:"AI Guru Composer",album:"Hugging Face",artwork:[{src:"static/hugging-face-headphones.png",sizes:"512x512",type:"image/png"}]}))},c=async({music_style:g,density:w,temperature:S})=>{var N;const A=await fetch("task/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({music_style:g,density:w,temperature:S})});if(!A.ok||!((N=A.headers.get("content-type"))!=null&&N.includes("application/json")))throw new Error(`Unable to create composition: [${A.status}] ${await A.text()}`);return await A.json()},m=async g=>{var S;const w=await fetch(`task/poll?task_id=${g.task_id}`);if(!w.ok||!((S=w.headers.get("content-type"))!=null&&S.includes("application/json")))throw new Error(`Unable to create composition: [${w.status}] ${await w.text()}`);return await w.json()},_=async(g,w=1e3,S=100)=>(g=await m(g),g.status==="completed"||g.status==="failed"||S&&g.poll_count>S?g:(await new Promise(A=>setTimeout(A,w)),await _(g,w,S)));return[t,async()=>{fe(ye,t=!0,t);try{const g=await c({music_style:d,density:o,temperature:i}),w=await _(g),{audio:S,image:A,tokens:B}=w.output;fe(Ee,a=S,a),fe($e,n=A,n),fe(Te,r=B,r),h()}catch(g){console.error(g)}finally{fe(ye,t=!1,t)}}]}class pt extends J{constructor(e){super(),K(this,e,_t,ht,Q,{})}}function ue(l,{delay:e=0,duration:s=400,easing:t=We}={}){const r=+getComputedStyle(l).opacity;return{delay:e,duration:s,easing:t,css:n=>`opacity: ${n*r}`}}function ze(l){let e,s,t,r,n,a,i,o=!1,d,h=!0,c,m,_=`translate(${l[5]*(l[0]/l[1])}px, -2%)`,T,g,w,S,A,B,N,F,Z;function y(){cancelAnimationFrame(d),a.paused||(d=Qe(y),o=!0),l[14].call(a)}let k=l[2]&&Re();return{c(){e=v("section"),s=v("img"),r=D(),n=v("div"),a=v("audio"),c=D(),m=v("div"),T=D(),k&&k.c(),g=D(),w=v("a"),S=H("Download"),this.h()},l($){e=b($,"SECTION",{class:!0});var I=E(e);s=b(I,"IMG",{class:!0,src:!0,alt:!0}),r=C(I),n=b(I,"DIV",{class:!0,tabindex:!0});var U=E(n);a=b(U,"AUDIO",{src:!0,class:!0}),E(a).forEach(p),c=C(U),m=b(U,"DIV",{class:!0}),E(m).forEach(p),T=C(U),k&&k.l(U),U.forEach(p),g=C(I),w=b(I,"A",{href:!0,download:!0,class:!0});var V=E(w);S=j(V,"Download"),V.forEach(p),I.forEach(p),this.h()},h(){f(s,"class","visualisation svelte-hbmhov"),se(s.src,t=l[8])||f(s,"src",t),f(s,"alt",""),se(a.src,i=l[7])||f(a,"src",i),f(a,"class","svelte-hbmhov"),l[1]===void 0&&_e(()=>l[15].call(a)),f(m,"class","handle svelte-hbmhov"),ie(m,"transform",_,!1),f(n,"class","player svelte-hbmhov"),f(n,"tabindex","0"),ie(n,"width",l[5]+"px",!1),ie(n,"height",l[6]+"px",!1),f(w,"href",l[7]),f(w,"download",A=`${le[l[9]]} Composition - AI Guru ft. Hugging Face.wav`),f(w,"class","download svelte-hbmhov"),f(e,"class","svelte-hbmhov")},m($,I){P($,e,I),u(e,s),l[13](s),u(e,r),u(e,n),u(n,a),u(n,c),u(n,m),u(n,T),k&&k.m(n,null),l[17](n),u(e,g),u(e,w),u(w,S),N=!0,F||(Z=[G(a,"timeupdate",y),G(a,"durationchange",l[15]),G(a,"play",l[16]),G(a,"pause",l[16]),G(n,"mousemove",l[10]),G(n,"touchmove",Xe(l[11])),G(n,"keydown",l[12]),G(n,"click",l[18])],F=!0)},p($,I){(!N||I&256&&!se(s.src,t=$[8]))&&f(s,"src",t),(!N||I&128&&!se(a.src,i=$[7]))&&f(a,"src",i),!o&&I&1&&!isNaN($[0])&&(a.currentTime=$[0]),o=!1,I&4&&h!==(h=$[2])&&a[h?"pause":"play"](),I&35&&_!==(_=`translate(${$[5]*($[0]/$[1])}px, -2%)`)&&ie(m,"transform",_,!1),$[2]?k?I&4&&L(k,1):(k=Re(),k.c(),L(k,1),k.m(n,null)):k&&(De(),R(k,1,1,()=>{k=null}),Ce()),I&32&&ie(n,"width",$[5]+"px",!1),I&64&&ie(n,"height",$[6]+"px",!1),(!N||I&128)&&f(w,"href",$[7]),(!N||I&512&&A!==(A=`${le[$[9]]} Composition - AI Guru ft. Hugging Face.wav`))&&f(w,"download",A)},i($){N||(L(k),_e(()=>{B||(B=ce(e,ue,{},!0)),B.run(1)}),N=!0)},o($){R(k),B||(B=ce(e,ue,{},!1)),B.run(0),N=!1},d($){$&&p(e),l[13](null),k&&k.d(),l[17](null),$&&B&&B.end(),F=!1,Ye(Z)}}}function Re(l){let e,s,t,r;return{c(){e=v("img"),this.h()},l(n){e=b(n,"IMG",{class:!0,src:!0,alt:!0,draggable:!0}),this.h()},h(){f(e,"class","play-button svelte-hbmhov"),se(e.src,s="static/play.svg")||f(e,"src",s),f(e,"alt","Play button"),f(e,"draggable","false")},m(n,a){P(n,e,a),r=!0},i(n){r||(_e(()=>{t||(t=ce(e,ue,{},!0)),t.run(1)}),r=!0)},o(n){t||(t=ce(e,ue,{},!1)),t.run(0),r=!1},d(n){n&&p(e),n&&t&&t.end()}}}function mt(l){let e,s,t=l[7]&&ze(l);return{c(){t&&t.c(),e=pe()},l(r){t&&t.l(r),e=pe()},m(r,n){t&&t.m(r,n),P(r,e,n),s=!0},p(r,[n]){r[7]?t?(t.p(r,n),n&128&&L(t,1)):(t=ze(r),t.c(),L(t,1),t.m(e.parentNode,e)):t&&(De(),R(t,1,1,()=>{t=null}),Ce())},i(r){s||(L(t),s=!0)},o(r){R(t),s=!1},d(r){t&&t.d(r),r&&p(e)}}}function gt(l,e,s){let t,r,n;z(l,Ee,y=>s(7,t=y)),z(l,$e,y=>s(8,r=y)),z(l,me,y=>s(9,n=y));let a,i,o=!0,d,h,c,m;const _=()=>{s(5,c=h&&h.clientWidth),s(6,m=h&&h.clientHeight)};Je(()=>{_(),"mediaSession"in navigator&&(navigator.mediaSession.setActionHandler("play",()=>s(2,o=!1)),navigator.mediaSession.setActionHandler("pause",()=>s(2,o=!0)),navigator.mediaSession.setActionHandler("stop",()=>{s(2,o=!0),s(0,a=0)}))}),Ke(()=>{_()});const T=y=>{if(!i||!y.buttons)return;const{left:k,right:$}=d.getBoundingClientRect();s(0,a=i*(y.clientX-k)/($-k))},g=y=>{if(!i)return;const{left:k,right:$}=d.getBoundingClientRect();s(0,a=i*(y.touches[0].clientX-k)/($-k))},w=y=>{y.preventDefault(),y.code==="Space"&&s(2,o=!o),y.code==="ArrowLeft"&&s(0,a=a>=1?a-1:0),y.code==="ArrowRight"&&s(0,a=a<=i-1?a+1:i)};function S(y){he[y?"unshift":"push"](()=>{h=y,s(4,h)})}function A(){a=this.currentTime,s(0,a)}function B(){i=this.duration,s(1,i)}function N(){o=this.paused,s(2,o)}function F(y){he[y?"unshift":"push"](()=>{d=y,s(3,d)})}return[a,i,o,d,h,c,m,t,r,n,T,g,w,S,A,B,N,F,()=>s(2,o=!o)]}class vt extends J{constructor(e){super(),K(this,e,gt,mt,Q,{})}}function Ge(l){let e,s,t,r,n,a,i,o;return{c(){e=v("section"),s=v("h2"),t=H("Tokenized notes"),r=D(),n=v("p"),a=H(l[0]),this.h()},l(d){e=b(d,"SECTION",{class:!0});var h=E(e);s=b(h,"H2",{});var c=E(s);t=j(c,"Tokenized notes"),c.forEach(p),r=C(h),n=b(h,"P",{class:!0});var m=E(n);a=j(m,l[0]),m.forEach(p),h.forEach(p),this.h()},h(){f(n,"class","svelte-4un5mw"),f(e,"class","svelte-4un5mw")},m(d,h){P(d,e,h),u(e,s),u(s,t),u(e,r),u(e,n),u(n,a),o=!0},p(d,h){(!o||h&1)&&Ie(a,d[0])},i(d){o||(_e(()=>{i||(i=ce(e,ue,{},!0)),i.run(1)}),o=!0)},o(d){i||(i=ce(e,ue,{},!1)),i.run(0),o=!1},d(d){d&&p(e),d&&i&&i.end()}}}function bt(l){let e,s,t=l[0]&&Ge(l);return{c(){t&&t.c(),e=pe()},l(r){t&&t.l(r),e=pe()},m(r,n){t&&t.m(r,n),P(r,e,n),s=!0},p(r,[n]){r[0]?t?(t.p(r,n),n&1&&L(t,1)):(t=Ge(r),t.c(),L(t,1),t.m(e.parentNode,e)):t&&(De(),R(t,1,1,()=>{t=null}),Ce())},i(r){s||(L(t),s=!0)},o(r){R(t),s=!1},d(r){t&&t.d(r),r&&p(e)}}}function yt(l,e,s){let t;return z(l,Te,r=>s(0,t=r)),[t]}class wt extends J{constructor(e){super(),K(this,e,yt,bt,Q,{})}}function kt(l){let e,s,t,r,n,a,i,o,d,h,c,m,_,T,g,w,S,A,B,N,F,Z,y,k,$,I,U,V,ge,x,ve,ee,be,te,de;return k=new st({}),I=new ot({}),V=new ut({}),x=new pt({}),ee=new vt({}),te=new wt({}),{c(){e=v("main"),s=v("h1"),t=H("Composer"),r=D(),n=v("p"),a=H("Trained on fifteen thousand songs. One AI model. Infinite compositions."),i=D(),o=v("p"),d=H(`This space contains a deep neural network model that can compose music. You can use it to generate music in
|
2 |
+
different styles, 4 bars at a time.`),h=D(),c=v("p"),m=H("Developed by "),_=v("a"),T=H("Ron Au"),g=H(` and
|
3 |
+
`),w=v("a"),S=H("Tristan Behrens"),A=H("."),B=D(),N=v("p"),F=H("Have fun! And always feel free to send us some feedback and share your compositions!"),Z=D(),y=v("section"),q(k.$$.fragment),$=D(),q(I.$$.fragment),U=D(),q(V.$$.fragment),ge=D(),q(x.$$.fragment),ve=D(),q(ee.$$.fragment),be=D(),q(te.$$.fragment),this.h()},l(M){e=b(M,"MAIN",{class:!0});var O=E(e);s=b(O,"H1",{class:!0});var Se=E(s);t=j(Se,"Composer"),Se.forEach(p),r=C(O),n=b(O,"P",{class:!0});var Ae=E(n);a=j(Ae,"Trained on fifteen thousand songs. One AI model. Infinite compositions."),Ae.forEach(p),i=C(O),o=b(O,"P",{class:!0});var Ne=E(o);d=j(Ne,`This space contains a deep neural network model that can compose music. You can use it to generate music in
|
4 |
+
different styles, 4 bars at a time.`),Ne.forEach(p),h=C(O),c=b(O,"P",{class:!0});var re=E(c);m=j(re,"Developed by "),_=b(re,"A",{href:!0,rel:!0,target:!0});var Oe=E(_);T=j(Oe,"Ron Au"),Oe.forEach(p),g=j(re,` and
|
5 |
+
`),w=b(re,"A",{href:!0,rel:!0,target:!0});var Me=E(w);S=j(Me,"Tristan Behrens"),Me.forEach(p),A=j(re,"."),re.forEach(p),B=C(O),N=b(O,"P",{class:!0});var He=E(N);F=j(He,"Have fun! And always feel free to send us some feedback and share your compositions!"),He.forEach(p),Z=C(O),y=b(O,"SECTION",{id:!0,class:!0});var oe=E(y);W(k.$$.fragment,oe),$=C(oe),W(I.$$.fragment,oe),U=C(oe),W(V.$$.fragment,oe),oe.forEach(p),ge=C(O),W(x.$$.fragment,O),ve=C(O),W(ee.$$.fragment,O),be=C(O),W(te.$$.fragment,O),O.forEach(p),this.h()},h(){f(s,"class","svelte-1rfjlkw"),f(n,"class","heading svelte-1rfjlkw"),f(o,"class","svelte-1rfjlkw"),f(_,"href","https://twitter.com/ronvoluted"),f(_,"rel","noopener"),f(_,"target","_blank"),f(w,"href","https://twitter.com/DrTBehrens"),f(w,"rel","noopener"),f(w,"target","_blank"),f(c,"class","svelte-1rfjlkw"),f(N,"class","svelte-1rfjlkw"),f(y,"id","options"),f(y,"class","svelte-1rfjlkw"),f(e,"class","svelte-1rfjlkw")},m(M,O){P(M,e,O),u(e,s),u(s,t),u(e,r),u(e,n),u(n,a),u(e,i),u(e,o),u(o,d),u(e,h),u(e,c),u(c,m),u(c,_),u(_,T),u(c,g),u(c,w),u(w,S),u(c,A),u(e,B),u(e,N),u(N,F),u(e,Z),u(e,y),X(k,y,null),u(y,$),X(I,y,null),u(y,U),X(V,y,null),u(e,ge),X(x,e,null),u(e,ve),X(ee,e,null),u(e,be),X(te,e,null),de=!0},p:ne,i(M){de||(L(k.$$.fragment,M),L(I.$$.fragment,M),L(V.$$.fragment,M),L(x.$$.fragment,M),L(ee.$$.fragment,M),L(te.$$.fragment,M),de=!0)},o(M){R(k.$$.fragment,M),R(I.$$.fragment,M),R(V.$$.fragment,M),R(x.$$.fragment,M),R(ee.$$.fragment,M),R(te.$$.fragment,M),de=!1},d(M){M&&p(e),Y(k),Y(I),Y(V),Y(x),Y(ee),Y(te)}}}class Tt extends J{constructor(e){super(),K(this,e,null,kt,Q,{})}}export{Tt as default};
|
static/_app/start-5e34eb6b.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
var et=Object.defineProperty,tt=Object.defineProperties;var nt=Object.getOwnPropertyDescriptors;var fe=Object.getOwnPropertySymbols;var Te=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable;var Ie=(n,e,t)=>e in n?et(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,P=(n,e)=>{for(var t in e||(e={}))Te.call(e,t)&&Ie(n,t,e[t]);if(fe)for(var t of fe(e))De.call(e,t)&&Ie(n,t,e[t]);return n},ne=(n,e)=>tt(n,nt(e));var Ve=(n,e)=>{var t={};for(var s in n)Te.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&fe)for(var s of fe(n))e.indexOf(s)<0&&De.call(n,s)&&(t[s]=n[s]);return t};import{S as rt,i as st,s as it,e as at,c as ot,a as ct,d as V,b as we,f as B,g as q,t as lt,h as ft,j as ut,k as dt,l as C,m as pt,n as M,o as j,p as F,q as I,r as ht,u as _t,v as $e,w as z,x as se,y as J,z as ie,A as ae,B as K,C as oe,D as qe}from"./chunks/index-f8f7cfca.js";import{w as ue}from"./chunks/index-7a30815e.js";let ze="",He="";function mt(n){ze=n.base,He=n.assets||ze}function gt(n){let e,t,s;const l=[n[1]||{}];var c=n[0][0];function f(r){let i={};for(let a=0;a<l.length;a+=1)i=oe(i,l[a]);return{props:i}}return c&&(e=new c(f())),{c(){e&&z(e.$$.fragment),t=C()},l(r){e&&se(e.$$.fragment,r),t=C()},m(r,i){e&&J(e,r,i),q(r,t,i),s=!0},p(r,i){const a=i&2?ie(l,[ae(r[1]||{})]):{};if(c!==(c=r[0][0])){if(e){M();const d=e;j(d.$$.fragment,1,0,()=>{K(d,1)}),F()}c?(e=new c(f()),z(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&j(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function wt(n){let e,t,s;const l=[n[1]||{}];var c=n[0][0];function f(r){let i={$$slots:{default:[$t]},$$scope:{ctx:r}};for(let a=0;a<l.length;a+=1)i=oe(i,l[a]);return{props:i}}return c&&(e=new c(f(n))),{c(){e&&z(e.$$.fragment),t=C()},l(r){e&&se(e.$$.fragment,r),t=C()},m(r,i){e&&J(e,r,i),q(r,t,i),s=!0},p(r,i){const a=i&2?ie(l,[ae(r[1]||{})]):{};if(i&525&&(a.$$scope={dirty:i,ctx:r}),c!==(c=r[0][0])){if(e){M();const d=e;j(d.$$.fragment,1,0,()=>{K(d,1)}),F()}c?(e=new c(f(r)),z(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&j(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function bt(n){let e,t,s;const l=[n[2]||{}];var c=n[0][1];function f(r){let i={};for(let a=0;a<l.length;a+=1)i=oe(i,l[a]);return{props:i}}return c&&(e=new c(f())),{c(){e&&z(e.$$.fragment),t=C()},l(r){e&&se(e.$$.fragment,r),t=C()},m(r,i){e&&J(e,r,i),q(r,t,i),s=!0},p(r,i){const a=i&4?ie(l,[ae(r[2]||{})]):{};if(c!==(c=r[0][1])){if(e){M();const d=e;j(d.$$.fragment,1,0,()=>{K(d,1)}),F()}c?(e=new c(f()),z(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&j(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function yt(n){let e,t,s;const l=[n[2]||{}];var c=n[0][1];function f(r){let i={$$slots:{default:[vt]},$$scope:{ctx:r}};for(let a=0;a<l.length;a+=1)i=oe(i,l[a]);return{props:i}}return c&&(e=new c(f(n))),{c(){e&&z(e.$$.fragment),t=C()},l(r){e&&se(e.$$.fragment,r),t=C()},m(r,i){e&&J(e,r,i),q(r,t,i),s=!0},p(r,i){const a=i&4?ie(l,[ae(r[2]||{})]):{};if(i&521&&(a.$$scope={dirty:i,ctx:r}),c!==(c=r[0][1])){if(e){M();const d=e;j(d.$$.fragment,1,0,()=>{K(d,1)}),F()}c?(e=new c(f(r)),z(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&j(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function vt(n){let e,t,s;const l=[n[3]||{}];var c=n[0][2];function f(r){let i={};for(let a=0;a<l.length;a+=1)i=oe(i,l[a]);return{props:i}}return c&&(e=new c(f())),{c(){e&&z(e.$$.fragment),t=C()},l(r){e&&se(e.$$.fragment,r),t=C()},m(r,i){e&&J(e,r,i),q(r,t,i),s=!0},p(r,i){const a=i&8?ie(l,[ae(r[3]||{})]):{};if(c!==(c=r[0][2])){if(e){M();const d=e;j(d.$$.fragment,1,0,()=>{K(d,1)}),F()}c?(e=new c(f()),z(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&j(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function $t(n){let e,t,s,l;const c=[yt,bt],f=[];function r(i,a){return i[0][2]?0:1}return e=r(n),t=f[e]=c[e](n),{c(){t.c(),s=C()},l(i){t.l(i),s=C()},m(i,a){f[e].m(i,a),q(i,s,a),l=!0},p(i,a){let d=e;e=r(i),e===d?f[e].p(i,a):(M(),j(f[d],1,1,()=>{f[d]=null}),F(),t=f[e],t?t.p(i,a):(t=f[e]=c[e](i),t.c()),I(t,1),t.m(s.parentNode,s))},i(i){l||(I(t),l=!0)},o(i){j(t),l=!1},d(i){f[e].d(i),i&&V(s)}}}function Je(n){let e,t=n[5]&&Ke(n);return{c(){e=at("div"),t&&t.c(),this.h()},l(s){e=ot(s,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var l=ct(e);t&&t.l(l),l.forEach(V),this.h()},h(){we(e,"id","svelte-announcer"),we(e,"aria-live","assertive"),we(e,"aria-atomic","true"),B(e,"position","absolute"),B(e,"left","0"),B(e,"top","0"),B(e,"clip","rect(0 0 0 0)"),B(e,"clip-path","inset(50%)"),B(e,"overflow","hidden"),B(e,"white-space","nowrap"),B(e,"width","1px"),B(e,"height","1px")},m(s,l){q(s,e,l),t&&t.m(e,null)},p(s,l){s[5]?t?t.p(s,l):(t=Ke(s),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(s){s&&V(e),t&&t.d()}}}function Ke(n){let e;return{c(){e=lt(n[6])},l(t){e=ft(t,n[6])},m(t,s){q(t,e,s)},p(t,s){s&64&&ut(e,t[6])},d(t){t&&V(e)}}}function kt(n){let e,t,s,l,c;const f=[wt,gt],r=[];function i(d,R){return d[0][1]?0:1}e=i(n),t=r[e]=f[e](n);let a=n[4]&&Je(n);return{c(){t.c(),s=dt(),a&&a.c(),l=C()},l(d){t.l(d),s=pt(d),a&&a.l(d),l=C()},m(d,R){r[e].m(d,R),q(d,s,R),a&&a.m(d,R),q(d,l,R),c=!0},p(d,[R]){let y=e;e=i(d),e===y?r[e].p(d,R):(M(),j(r[y],1,1,()=>{r[y]=null}),F(),t=r[e],t?t.p(d,R):(t=r[e]=f[e](d),t.c()),I(t,1),t.m(s.parentNode,s)),d[4]?a?a.p(d,R):(a=Je(d),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(d){c||(I(t),c=!0)},o(d){j(t),c=!1},d(d){r[e].d(d),d&&V(s),a&&a.d(d),d&&V(l)}}}function Et(n,e,t){let{stores:s}=e,{page:l}=e,{components:c}=e,{props_0:f=null}=e,{props_1:r=null}=e,{props_2:i=null}=e;ht("__svelte__",s),_t(s.page.notify);let a=!1,d=!1,R=null;return $e(()=>{const y=s.page.subscribe(()=>{a&&(t(5,d=!0),t(6,R=document.title||"untitled page"))});return t(4,a=!0),y}),n.$$set=y=>{"stores"in y&&t(7,s=y.stores),"page"in y&&t(8,l=y.page),"components"in y&&t(0,c=y.components),"props_0"in y&&t(1,f=y.props_0),"props_1"in y&&t(2,r=y.props_1),"props_2"in y&&t(3,i=y.props_2)},n.$$.update=()=>{n.$$.dirty&384&&s.page.set(l)},[c,f,r,i,a,d,R,s,l]}class Rt extends rt{constructor(e){super(),st(this,e,Et,kt,it,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const St="modulepreload",Be={},Lt="https://hf.space/embed/ai-guru/composer/static/_app/",be=function(e,t){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=`${Lt}${s}`,s in Be)return;Be[s]=!0;const l=s.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${c}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":St,l||(f.as="script",f.crossOrigin=""),f.href=s,document.head.appendChild(f),l)return new Promise((r,i)=>{f.addEventListener("load",r),f.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e())},Ut={},Ee=[()=>be(()=>import("./layout.svelte-3942c837.js"),["layout.svelte-3942c837.js","chunks/index-f8f7cfca.js"]),()=>be(()=>import("./error.svelte-2573bba8.js"),["error.svelte-2573bba8.js","chunks/index-f8f7cfca.js"]),()=>be(()=>import("./pages/index.svelte-b34d5edf.js"),["pages/index.svelte-b34d5edf.js","assets/pages/index.svelte-10d60411.css","chunks/index-f8f7cfca.js","chunks/index-7a30815e.js"])],At={"":[[0,2],[1]]};function We(n){return n instanceof Error||n&&n.name&&n.message?n:new Error(JSON.stringify(n))}function Ye(n){if(n.fallthrough)throw new Error("fallthrough is no longer supported. Use matchers instead: https://kit.svelte.dev/docs/routing#advanced-routing-matching");if("maxage"in n)throw new Error("maxage should be replaced with cache: { maxage }");const e=n.status&&n.status>=400&&n.status<=599&&!n.redirect;if(n.error||e){const t=n.status;if(!n.error&&e)return{status:t||500,error:new Error};const s=typeof n.error=="string"?new Error(n.error):n.error;return s instanceof Error?!t||t<400||t>599?(console.warn('"error" returned from load() without a valid status code \u2014 defaulting to 500'),{status:500,error:s}):{status:t,error:s}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof s}"`)}}if(n.redirect){if(!n.status||Math.floor(n.status/100)!==3)return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if(typeof n.redirect!="string")return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}if(n.dependencies&&(!Array.isArray(n.dependencies)||n.dependencies.some(t=>typeof t!="string")))return{status:500,error:new Error('"dependencies" property returned from load() must be of type string[]')};if(n.context)throw new Error('You are returning "context" from a load function. "context" was renamed to "stuff", please adjust your code accordingly.');return n}function Nt(n,e){return n==="/"||e==="ignore"?n:e==="never"?n.endsWith("/")?n.slice(0,-1):n:e==="always"&&!n.endsWith("/")?n+"/":n}function Ot(n){let e=5381,t=n.length;if(typeof n=="string")for(;t;)e=e*33^n.charCodeAt(--t);else for(;t;)e=e*33^n[--t];return(e>>>0).toString(36)}function Me(n){let e=n.baseURI;if(!e){const t=n.getElementsByTagName("base");e=t.length?t[0].href:n.URL}return e}function ke(){return{x:pageXOffset,y:pageYOffset}}function Fe(n){return n.composedPath().find(t=>t instanceof Node&&t.nodeName.toUpperCase()==="A")}function Ge(n){return n instanceof SVGAElement?new URL(n.href.baseVal,document.baseURI):new URL(n.href)}function Xe(n){const e=ue(n);let t=!0;function s(){t=!0,e.update(f=>f)}function l(f){t=!1,e.set(f)}function c(f){let r;return e.subscribe(i=>{(r===void 0||t&&i!==r)&&f(r=i)})}return{notify:s,set:l,subscribe:c}}function xt(){const{set:n,subscribe:e}=ue(!1),t="1651474694789";let s;async function l(){clearTimeout(s);const f=await fetch(`https://hf.space/embed/ai-guru/composer/static/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(f.ok){const{version:r}=await f.json(),i=r!==t;return i&&(n(!0),clearTimeout(s)),i}else throw new Error(`Version check failed: ${f.status}`)}return{subscribe:e,check:l}}function Pt(n,e){let s=`script[sveltekit\\:data-type="data"][sveltekit\\:data-url=${JSON.stringify(typeof n=="string"?n:n.url)}]`;e&&typeof e.body=="string"&&(s+=`[sveltekit\\:data-body="${Ot(e.body)}"]`);const l=document.querySelector(s);if(l&&l.textContent){const c=JSON.parse(l.textContent),{body:f}=c,r=Ve(c,["body"]);return Promise.resolve(new Response(f,r))}return fetch(n,e)}const Ct=/^(\.\.\.)?(\w+)(?:=(\w+))?$/;function jt(n){const e=[],t=[];let s=!0;return{pattern:n===""?/^\/$/:new RegExp(`^${decodeURIComponent(n).split(/(?:@[a-zA-Z0-9_-]+)?(?:\/|$)/).map((c,f,r)=>{const i=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(c);if(i)return e.push(i[1]),t.push(i[2]),"(?:/(.*))?";const a=f===r.length-1;return c&&"/"+c.split(/\[(.+?)\]/).map((d,R)=>{if(R%2){const[,y,Z,G]=Ct.exec(d);return e.push(Z),t.push(G),y?"(.*?)":"([^/]+?)"}return a&&d.includes(".")&&(s=!1),d.normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}${s?"/?":""}$`),names:e,types:t}}function It(n,e,t,s){const l={};for(let c=0;c<e.length;c+=1){const f=e[c],r=t[c],i=n[c+1]||"";if(r){const a=s[r];if(!a)throw new Error(`Missing "${r}" param matcher`);if(!a(i))return}l[f]=i}return l}function Tt(n,e,t){return Object.entries(e).map(([l,[c,f,r]])=>{const{pattern:i,names:a,types:d}=jt(l);return{id:l,exec:R=>{const y=i.exec(R);if(y)return It(y,a,d,t)},a:c.map(R=>n[R]),b:f.map(R=>n[R]),has_shadow:!!r}})}const Qe="sveltekit:scroll",W="sveltekit:index",ye=Tt(Ee,At,Ut),Dt=Ee[0](),Vt=Ee[1](),Ze={};let re={};try{re=JSON.parse(sessionStorage[Qe])}catch{}function ve(n){re[n]=ke()}function qt({target:n,session:e,base:t,trailing_slash:s}){var Ce;const l=new Map,c=[],f={url:Xe({}),page:Xe({}),navigating:ue(null),session:ue(e),updated:xt()},r={id:null,promise:null},i={before_navigate:[],after_navigate:[]};let a={branch:[],error:null,session_id:0,stuff:Ze,url:null},d=!1,R=!0,y=!1,Z=1,G=null,Re,Se,Le=!1;f.session.subscribe(async o=>{Se=o,Le&&(Z+=1,_e(new URL(location.href),[],!0))}),Le=!0;let X=!0,T=(Ce=history.state)==null?void 0:Ce[W];T||(T=Date.now(),history.replaceState(ne(P({},history.state),{[W]:T}),"",location.href));const de=re[T];de&&(history.scrollRestoration="manual",scrollTo(de.x,de.y));let pe=!1,he,Ue;async function Ae(o,{noscroll:p=!1,replaceState:w=!1,keepfocus:u=!1,state:h={}},b){const _=new URL(o,Me(document));if(X)return ge({url:_,scroll:p?ke():null,keepfocus:u,redirect_chain:b,details:{state:h,replaceState:w},accepted:()=>{},blocked:()=>{}});await ee(_)}async function Ne(o){const p=Pe(o);if(!p)throw new Error("Attempted to prefetch a URL that does not belong to this app");return r.promise=xe(p,!1),r.id=p.id,r.promise}async function _e(o,p,w,u){var g,$,S;const h=Pe(o),b=Ue={};let _=h&&await xe(h,w);if(!_&&o.origin===location.origin&&o.pathname===location.pathname&&(_=await Q({status:404,error:new Error(`Not found: ${o.pathname}`),url:o,routeId:null})),!_)return await ee(o),!1;if(Ue!==b)return!1;if(c.length=0,_.redirect)if(p.length>10||p.includes(o.pathname))_=await Q({status:500,error:new Error("Redirect loop"),url:o,routeId:null});else return X?Ae(new URL(_.redirect,o).href,{},[...p,o.pathname]):await ee(new URL(_.redirect,location.href)),!1;else(($=(g=_.props)==null?void 0:g.page)==null?void 0:$.status)>=400&&await f.updated.check()&&await ee(o);if(y=!0,u&&u.details){const{details:k}=u,E=k.replaceState?0:1;k.state[W]=T+=E,history[k.replaceState?"replaceState":"pushState"](k.state,"",o)}if(d?(a=_.state,Re.$set(_.props)):Oe(_),u){const{scroll:k,keepfocus:E}=u;if(!E){const m=document.body,A=m.getAttribute("tabindex");(S=getSelection())==null||S.removeAllRanges(),m.tabIndex=-1,m.focus(),A!==null?m.setAttribute("tabindex",A):m.removeAttribute("tabindex")}if(await qe(),R){const m=o.hash&&document.getElementById(o.hash.slice(1));k?scrollTo(k.x,k.y):m?m.scrollIntoView():scrollTo(0,0)}}else await qe();r.promise=null,r.id=null,R=!0,y=!1,_.props.page&&(he=_.props.page);const v=_.state.branch[_.state.branch.length-1];return X=(v==null?void 0:v.module.router)!==!1,!0}function Oe(o){a=o.state;const p=document.querySelector("style[data-sveltekit]");if(p&&p.remove(),he=o.props.page,Re=new Rt({target:n,props:ne(P({},o.props),{stores:f}),hydrate:!0}),d=!0,X){const w={from:null,to:new URL(location.href)};i.after_navigate.forEach(u=>u(w))}}async function me({url:o,params:p,stuff:w,branch:u,status:h,error:b,routeId:_}){var m,A;const v=u.filter(Boolean),g=v.find(U=>{var O;return(O=U.loaded)==null?void 0:O.redirect}),$={redirect:(m=g==null?void 0:g.loaded)==null?void 0:m.redirect,state:{url:o,params:p,branch:u,error:b,stuff:w,session_id:Z},props:{components:v.map(U=>U.module.default)}};for(let U=0;U<v.length;U+=1){const O=v[U].loaded;$.props[`props_${U}`]=O?await O.props:null}if(!a.url||o.href!==a.url.href||a.error!==b||a.stuff!==w){$.props.page={error:b,params:p,routeId:_,status:h,stuff:w,url:o};const U=(O,L)=>{Object.defineProperty($.props.page,O,{get:()=>{throw new Error(`$page.${O} has been replaced by $page.url.${L}`)}})};U("origin","origin"),U("path","pathname"),U("query","searchParams")}const k=v[v.length-1],E=(A=k==null?void 0:k.loaded)==null?void 0:A.cache;if(E){const U=o.pathname+o.search;let O=!1;const L=()=>{l.get(U)===$&&l.delete(U),x(),clearTimeout(N)},N=setTimeout(L,E.maxage*1e3),x=f.session.subscribe(()=>{O&&L()});O=!0,l.set(U,$)}return $}async function H({status:o,error:p,module:w,url:u,params:h,stuff:b,props:_,routeId:v}){const g={module:w,uses:{params:new Set,url:!1,session:!1,stuff:!1,dependencies:new Set},loaded:null,stuff:b};function $(E){const{href:m}=new URL(E,u);g.uses.dependencies.add(m)}_&&g.uses.dependencies.add(u.href);const S={};for(const E in h)Object.defineProperty(S,E,{get(){return g.uses.params.add(E),h[E]},enumerable:!0});const k=Se;if(w.load){const E={routeId:v,params:S,props:_||{},get url(){return g.uses.url=!0,u},get session(){return g.uses.session=!0,k},get stuff(){return g.uses.stuff=!0,P({},b)},fetch(A,U){const O=typeof A=="string"?A:A.url;return $(O),d?fetch(A,U):Pt(A,U)},status:o!=null?o:null,error:p!=null?p:null},m=await w.load.call(null,E);if(!m)throw new Error("load function must return a value");g.loaded=Ye(m),g.loaded.stuff&&(g.stuff=g.loaded.stuff),g.loaded.dependencies&&g.loaded.dependencies.forEach($)}else _&&(g.loaded=Ye({props:_}));return g}async function xe({id:o,url:p,params:w,route:u},h){var A,U,O;if(r.id===o&&r.promise)return r.promise;if(!h){const L=l.get(o);if(L)return L}const{a:b,b:_,has_shadow:v}=u,g=a.url&&{url:o!==a.url.pathname+a.url.search,params:Object.keys(w).filter(L=>a.params[L]!==w[L]),session:Z!==a.session_id};let $=[],S=Ze,k=!1,E=200,m=null;b.forEach(L=>L());e:for(let L=0;L<b.length;L+=1){let N;try{if(!b[L])continue;const x=await b[L](),D=a.branch[L];if(!D||x!==D.module||g.url&&D.uses.url||g.params.some(Y=>D.uses.params.has(Y))||g.session&&D.uses.session||Array.from(D.uses.dependencies).some(Y=>c.some(le=>le(Y)))||k&&D.uses.stuff){let Y={};const le=v&&L===b.length-1;if(le){const te=await fetch(`${p.pathname}${p.pathname.endsWith("/")?"":"/"}__data.json${p.search}`,{headers:{"x-sveltekit-load":"true"}});if(te.ok){const je=te.headers.get("x-sveltekit-location");if(je)return{redirect:je,props:{},state:a};Y=te.status===204?{}:await te.json()}else E=te.status,m=new Error("Failed to load data")}if(m||(N=await H({module:x,url:p,params:w,props:Y,stuff:S,routeId:u.id})),N&&(le&&(N.uses.url=!0),N.loaded)){if(N.loaded.error&&(E=N.loaded.status,m=N.loaded.error),N.loaded.redirect)return{redirect:N.loaded.redirect,props:{},state:a};N.loaded.stuff&&(k=!0)}}else N=D}catch(x){E=500,m=We(x)}if(m){for(;L--;)if(_[L]){let x,D,ce=L;for(;!(D=$[ce]);)ce-=1;try{if(x=await H({status:E,error:m,module:await _[L](),url:p,params:w,stuff:D.stuff,routeId:u.id}),(A=x==null?void 0:x.loaded)!=null&&A.error)continue;(U=x==null?void 0:x.loaded)!=null&&U.stuff&&(S=P(P({},S),x.loaded.stuff)),$=$.slice(0,ce+1).concat(x);break e}catch{continue}}return await Q({status:E,error:m,url:p,routeId:u.id})}else(O=N==null?void 0:N.loaded)!=null&&O.stuff&&(S=P(P({},S),N.loaded.stuff)),$.push(N)}return await me({url:p,params:w,stuff:S,branch:$,status:E,error:m,routeId:u.id})}async function Q({status:o,error:p,url:w,routeId:u}){var v,g;const h={},b=await H({module:await Dt,url:w,params:h,stuff:{},routeId:u}),_=await H({status:o,error:p,module:await Vt,url:w,params:h,stuff:b&&b.loaded&&b.loaded.stuff||{},routeId:u});return await me({url:w,params:h,stuff:P(P({},(v=b==null?void 0:b.loaded)==null?void 0:v.stuff),(g=_==null?void 0:_.loaded)==null?void 0:g.stuff),branch:[b,_],status:o,error:p,routeId:u})}function Pe(o){if(o.origin!==location.origin||!o.pathname.startsWith(t))return;const p=decodeURI(o.pathname.slice(t.length)||"/");for(const w of ye){const u=w.exec(p);if(u)return{id:o.pathname+o.search,route:w,params:u,url:o}}}async function ge({url:o,scroll:p,keepfocus:w,redirect_chain:u,details:h,accepted:b,blocked:_}){const v=a.url;let g=!1;const $={from:v,to:o,cancel:()=>g=!0};if(i.before_navigate.forEach(m=>m($)),g){_();return}const S=Nt(o.pathname,s),k=new URL(o.origin+S+o.search+o.hash);if(ve(T),b(),d&&f.navigating.set({from:a.url,to:k}),await _e(k,u,!1,{scroll:p,keepfocus:w,details:h})){const m={from:v,to:k};i.after_navigate.forEach(A=>A(m)),f.navigating.set(null)}}function ee(o){return location.href=o.href,new Promise(()=>{})}return{after_navigate:o=>{$e(()=>(i.after_navigate.push(o),()=>{const p=i.after_navigate.indexOf(o);i.after_navigate.splice(p,1)}))},before_navigate:o=>{$e(()=>(i.before_navigate.push(o),()=>{const p=i.before_navigate.indexOf(o);i.before_navigate.splice(p,1)}))},disable_scroll_handling:()=>{(y||!d)&&(R=!1)},goto:(o,p={})=>Ae(o,p,[]),invalidate:o=>{if(typeof o=="function")c.push(o);else{const{href:p}=new URL(o,location.href);c.push(w=>w===p)}return G||(G=Promise.resolve().then(async()=>{await _e(new URL(location.href),[],!0),G=null})),G},prefetch:async o=>{const p=new URL(o,Me(document));await Ne(p)},prefetch_routes:async o=>{const w=(o?ye.filter(u=>o.some(h=>u.exec(h))):ye).map(u=>Promise.all(u.a.map(h=>h())));await Promise.all(w)},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",u=>{let h=!1;const b={from:a.url,to:null,cancel:()=>h=!0};i.before_navigate.forEach(_=>_(b)),h?(u.preventDefault(),u.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){ve(T);try{sessionStorage[Qe]=JSON.stringify(re)}catch{}}});const o=u=>{const h=Fe(u);h&&h.href&&h.hasAttribute("sveltekit:prefetch")&&Ne(Ge(h))};let p;const w=u=>{clearTimeout(p),p=setTimeout(()=>{var h;(h=u.target)==null||h.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",o),addEventListener("mousemove",w),addEventListener("sveltekit:trigger_prefetch",o),addEventListener("click",u=>{if(!X||u.button||u.which!==1||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey||u.defaultPrevented)return;const h=Fe(u);if(!h||!h.href)return;const b=h instanceof SVGAElement,_=Ge(h);if(!b&&_.origin==="null")return;const v=(h.getAttribute("rel")||"").split(/\s+/);if(h.hasAttribute("download")||v.includes("external")||h.hasAttribute("sveltekit:reload")||(b?h.target.baseVal:h.target))return;const[g,$]=_.href.split("#");if($!==void 0&&g===location.href.split("#")[0]){pe=!0,ve(T),f.page.set(ne(P({},he),{url:_})),f.page.notify();return}ge({url:_,scroll:h.hasAttribute("sveltekit:noscroll")?ke():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:_.href===location.href},accepted:()=>u.preventDefault(),blocked:()=>u.preventDefault()})}),addEventListener("popstate",u=>{if(u.state&&X){if(u.state[W]===T)return;ge({url:new URL(location.href),scroll:re[u.state[W]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{T=u.state[W]},blocked:()=>{const h=T-u.state[W];history.go(h)}})}}),addEventListener("hashchange",()=>{pe&&(pe=!1,history.replaceState(ne(P({},history.state),{[W]:++T}),"",location.href))})},_hydrate:async({status:o,error:p,nodes:w,params:u,routeId:h})=>{const b=new URL(location.href),_=[];let v={},g,$;try{for(let S=0;S<w.length;S+=1){const k=S===w.length-1;let E;if(k){const A=document.querySelector('script[sveltekit\\:data-type="props"]');A&&(E=JSON.parse(A.textContent))}const m=await H({module:await w[S],url:b,params:u,stuff:v,status:k?o:void 0,error:k?p:void 0,props:E,routeId:h});if(E&&(m.uses.dependencies.add(b.href),m.uses.url=!0),_.push(m),m&&m.loaded)if(m.loaded.error){if(p)throw m.loaded.error;$={status:m.loaded.status,error:m.loaded.error,url:b,routeId:h}}else m.loaded.stuff&&(v=P(P({},v),m.loaded.stuff))}g=$?await Q($):await me({url:b,params:u,stuff:v,branch:_,status:o,error:p,routeId:h})}catch(S){if(p)throw S;g=await Q({status:500,error:We(S),url:b,routeId:h})}g.redirect&&await ee(new URL(g.redirect,location.href)),Oe(g)}}}async function Bt({paths:n,target:e,session:t,route:s,spa:l,trailing_slash:c,hydrate:f}){const r=qt({target:e,session:t,base:n.base,trailing_slash:c});mt(n),f&&await r._hydrate(f),s&&(l&&r.goto(location.href,{replaceState:!0}),r._start_router()),dispatchEvent(new CustomEvent("sveltekit:start"))}export{Bt as start};
|
static/_app/start-b4f523d8.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
var et=Object.defineProperty,tt=Object.defineProperties;var nt=Object.getOwnPropertyDescriptors;var fe=Object.getOwnPropertySymbols;var Te=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable;var Ie=(n,e,t)=>e in n?et(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,P=(n,e)=>{for(var t in e||(e={}))Te.call(e,t)&&Ie(n,t,e[t]);if(fe)for(var t of fe(e))De.call(e,t)&&Ie(n,t,e[t]);return n},ne=(n,e)=>tt(n,nt(e));var Ve=(n,e)=>{var t={};for(var s in n)Te.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&fe)for(var s of fe(n))e.indexOf(s)<0&&De.call(n,s)&&(t[s]=n[s]);return t};import{S as rt,i as st,s as it,e as at,c as ot,a as ct,d as V,b as we,f as B,g as q,t as lt,h as ft,j as ut,k as dt,l as C,m as pt,n as M,o as j,p as F,q as I,r as ht,u as _t,v as $e,w as z,x as se,y as J,z as ie,A as ae,B as K,C as oe,D as qe}from"./chunks/index-c61749f5.js";import{w as ue}from"./chunks/index-f9918abc.js";let ze="",He="";function mt(n){ze=n.base,He=n.assets||ze}function gt(n){let e,t,s;const l=[n[1]||{}];var c=n[0][0];function f(r){let i={};for(let a=0;a<l.length;a+=1)i=oe(i,l[a]);return{props:i}}return c&&(e=new c(f())),{c(){e&&z(e.$$.fragment),t=C()},l(r){e&&se(e.$$.fragment,r),t=C()},m(r,i){e&&J(e,r,i),q(r,t,i),s=!0},p(r,i){const a=i&2?ie(l,[ae(r[1]||{})]):{};if(c!==(c=r[0][0])){if(e){M();const d=e;j(d.$$.fragment,1,0,()=>{K(d,1)}),F()}c?(e=new c(f()),z(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&j(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function wt(n){let e,t,s;const l=[n[1]||{}];var c=n[0][0];function f(r){let i={$$slots:{default:[$t]},$$scope:{ctx:r}};for(let a=0;a<l.length;a+=1)i=oe(i,l[a]);return{props:i}}return c&&(e=new c(f(n))),{c(){e&&z(e.$$.fragment),t=C()},l(r){e&&se(e.$$.fragment,r),t=C()},m(r,i){e&&J(e,r,i),q(r,t,i),s=!0},p(r,i){const a=i&2?ie(l,[ae(r[1]||{})]):{};if(i&525&&(a.$$scope={dirty:i,ctx:r}),c!==(c=r[0][0])){if(e){M();const d=e;j(d.$$.fragment,1,0,()=>{K(d,1)}),F()}c?(e=new c(f(r)),z(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&j(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function bt(n){let e,t,s;const l=[n[2]||{}];var c=n[0][1];function f(r){let i={};for(let a=0;a<l.length;a+=1)i=oe(i,l[a]);return{props:i}}return c&&(e=new c(f())),{c(){e&&z(e.$$.fragment),t=C()},l(r){e&&se(e.$$.fragment,r),t=C()},m(r,i){e&&J(e,r,i),q(r,t,i),s=!0},p(r,i){const a=i&4?ie(l,[ae(r[2]||{})]):{};if(c!==(c=r[0][1])){if(e){M();const d=e;j(d.$$.fragment,1,0,()=>{K(d,1)}),F()}c?(e=new c(f()),z(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&j(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function yt(n){let e,t,s;const l=[n[2]||{}];var c=n[0][1];function f(r){let i={$$slots:{default:[vt]},$$scope:{ctx:r}};for(let a=0;a<l.length;a+=1)i=oe(i,l[a]);return{props:i}}return c&&(e=new c(f(n))),{c(){e&&z(e.$$.fragment),t=C()},l(r){e&&se(e.$$.fragment,r),t=C()},m(r,i){e&&J(e,r,i),q(r,t,i),s=!0},p(r,i){const a=i&4?ie(l,[ae(r[2]||{})]):{};if(i&521&&(a.$$scope={dirty:i,ctx:r}),c!==(c=r[0][1])){if(e){M();const d=e;j(d.$$.fragment,1,0,()=>{K(d,1)}),F()}c?(e=new c(f(r)),z(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&j(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function vt(n){let e,t,s;const l=[n[3]||{}];var c=n[0][2];function f(r){let i={};for(let a=0;a<l.length;a+=1)i=oe(i,l[a]);return{props:i}}return c&&(e=new c(f())),{c(){e&&z(e.$$.fragment),t=C()},l(r){e&&se(e.$$.fragment,r),t=C()},m(r,i){e&&J(e,r,i),q(r,t,i),s=!0},p(r,i){const a=i&8?ie(l,[ae(r[3]||{})]):{};if(c!==(c=r[0][2])){if(e){M();const d=e;j(d.$$.fragment,1,0,()=>{K(d,1)}),F()}c?(e=new c(f()),z(e.$$.fragment),I(e.$$.fragment,1),J(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(r){s||(e&&I(e.$$.fragment,r),s=!0)},o(r){e&&j(e.$$.fragment,r),s=!1},d(r){r&&V(t),e&&K(e,r)}}}function $t(n){let e,t,s,l;const c=[yt,bt],f=[];function r(i,a){return i[0][2]?0:1}return e=r(n),t=f[e]=c[e](n),{c(){t.c(),s=C()},l(i){t.l(i),s=C()},m(i,a){f[e].m(i,a),q(i,s,a),l=!0},p(i,a){let d=e;e=r(i),e===d?f[e].p(i,a):(M(),j(f[d],1,1,()=>{f[d]=null}),F(),t=f[e],t?t.p(i,a):(t=f[e]=c[e](i),t.c()),I(t,1),t.m(s.parentNode,s))},i(i){l||(I(t),l=!0)},o(i){j(t),l=!1},d(i){f[e].d(i),i&&V(s)}}}function Je(n){let e,t=n[5]&&Ke(n);return{c(){e=at("div"),t&&t.c(),this.h()},l(s){e=ot(s,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var l=ct(e);t&&t.l(l),l.forEach(V),this.h()},h(){we(e,"id","svelte-announcer"),we(e,"aria-live","assertive"),we(e,"aria-atomic","true"),B(e,"position","absolute"),B(e,"left","0"),B(e,"top","0"),B(e,"clip","rect(0 0 0 0)"),B(e,"clip-path","inset(50%)"),B(e,"overflow","hidden"),B(e,"white-space","nowrap"),B(e,"width","1px"),B(e,"height","1px")},m(s,l){q(s,e,l),t&&t.m(e,null)},p(s,l){s[5]?t?t.p(s,l):(t=Ke(s),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(s){s&&V(e),t&&t.d()}}}function Ke(n){let e;return{c(){e=lt(n[6])},l(t){e=ft(t,n[6])},m(t,s){q(t,e,s)},p(t,s){s&64&&ut(e,t[6])},d(t){t&&V(e)}}}function kt(n){let e,t,s,l,c;const f=[wt,gt],r=[];function i(d,R){return d[0][1]?0:1}e=i(n),t=r[e]=f[e](n);let a=n[4]&&Je(n);return{c(){t.c(),s=dt(),a&&a.c(),l=C()},l(d){t.l(d),s=pt(d),a&&a.l(d),l=C()},m(d,R){r[e].m(d,R),q(d,s,R),a&&a.m(d,R),q(d,l,R),c=!0},p(d,[R]){let y=e;e=i(d),e===y?r[e].p(d,R):(M(),j(r[y],1,1,()=>{r[y]=null}),F(),t=r[e],t?t.p(d,R):(t=r[e]=f[e](d),t.c()),I(t,1),t.m(s.parentNode,s)),d[4]?a?a.p(d,R):(a=Je(d),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(d){c||(I(t),c=!0)},o(d){j(t),c=!1},d(d){r[e].d(d),d&&V(s),a&&a.d(d),d&&V(l)}}}function Et(n,e,t){let{stores:s}=e,{page:l}=e,{components:c}=e,{props_0:f=null}=e,{props_1:r=null}=e,{props_2:i=null}=e;ht("__svelte__",s),_t(s.page.notify);let a=!1,d=!1,R=null;return $e(()=>{const y=s.page.subscribe(()=>{a&&(t(5,d=!0),t(6,R=document.title||"untitled page"))});return t(4,a=!0),y}),n.$$set=y=>{"stores"in y&&t(7,s=y.stores),"page"in y&&t(8,l=y.page),"components"in y&&t(0,c=y.components),"props_0"in y&&t(1,f=y.props_0),"props_1"in y&&t(2,r=y.props_1),"props_2"in y&&t(3,i=y.props_2)},n.$$.update=()=>{n.$$.dirty&384&&s.page.set(l)},[c,f,r,i,a,d,R,s,l]}class Rt extends rt{constructor(e){super(),st(this,e,Et,kt,it,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const St="modulepreload",Be={},Lt="https://hf.space/embed/ai-guru/composer/_app",be=function(e,t){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=`${Lt}${s}`,s in Be)return;Be[s]=!0;const l=s.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${c}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":St,l||(f.as="script",f.crossOrigin=""),f.href=s,document.head.appendChild(f),l)return new Promise((r,i)=>{f.addEventListener("load",r),f.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e())},Ut={},Ee=[()=>be(()=>import("./layout.svelte-0c060267.js"),["layout.svelte-0c060267.js","chunks/index-c61749f5.js"]),()=>be(()=>import("./error.svelte-83166d57.js"),["error.svelte-83166d57.js","chunks/index-c61749f5.js"]),()=>be(()=>import("./pages/index.svelte-416adc10.js"),["pages/index.svelte-416adc10.js","assets/pages/index.svelte-45cd6b36.css","chunks/index-c61749f5.js","chunks/index-f9918abc.js"])],At={"":[[0,2],[1]]};function We(n){return n instanceof Error||n&&n.name&&n.message?n:new Error(JSON.stringify(n))}function Ye(n){if(n.fallthrough)throw new Error("fallthrough is no longer supported. Use matchers instead: https://kit.svelte.dev/docs/routing#advanced-routing-matching");if("maxage"in n)throw new Error("maxage should be replaced with cache: { maxage }");const e=n.status&&n.status>=400&&n.status<=599&&!n.redirect;if(n.error||e){const t=n.status;if(!n.error&&e)return{status:t||500,error:new Error};const s=typeof n.error=="string"?new Error(n.error):n.error;return s instanceof Error?!t||t<400||t>599?(console.warn('"error" returned from load() without a valid status code \u2014 defaulting to 500'),{status:500,error:s}):{status:t,error:s}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof s}"`)}}if(n.redirect){if(!n.status||Math.floor(n.status/100)!==3)return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if(typeof n.redirect!="string")return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}if(n.dependencies&&(!Array.isArray(n.dependencies)||n.dependencies.some(t=>typeof t!="string")))return{status:500,error:new Error('"dependencies" property returned from load() must be of type string[]')};if(n.context)throw new Error('You are returning "context" from a load function. "context" was renamed to "stuff", please adjust your code accordingly.');return n}function Nt(n,e){return n==="/"||e==="ignore"?n:e==="never"?n.endsWith("/")?n.slice(0,-1):n:e==="always"&&!n.endsWith("/")?n+"/":n}function Ot(n){let e=5381,t=n.length;if(typeof n=="string")for(;t;)e=e*33^n.charCodeAt(--t);else for(;t;)e=e*33^n[--t];return(e>>>0).toString(36)}function Me(n){let e=n.baseURI;if(!e){const t=n.getElementsByTagName("base");e=t.length?t[0].href:n.URL}return e}function ke(){return{x:pageXOffset,y:pageYOffset}}function Fe(n){return n.composedPath().find(t=>t instanceof Node&&t.nodeName.toUpperCase()==="A")}function Ge(n){return n instanceof SVGAElement?new URL(n.href.baseVal,document.baseURI):new URL(n.href)}function Xe(n){const e=ue(n);let t=!0;function s(){t=!0,e.update(f=>f)}function l(f){t=!1,e.set(f)}function c(f){let r;return e.subscribe(i=>{(r===void 0||t&&i!==r)&&f(r=i)})}return{notify:s,set:l,subscribe:c}}function xt(){const{set:n,subscribe:e}=ue(!1),t="1651227702162";let s;async function l(){clearTimeout(s);const f=await fetch(`https://hf.space/embed/ai-guru/composer/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(f.ok){const{version:r}=await f.json(),i=r!==t;return i&&(n(!0),clearTimeout(s)),i}else throw new Error(`Version check failed: ${f.status}`)}return{subscribe:e,check:l}}function Pt(n,e){let s=`script[sveltekit\\:data-type="data"][sveltekit\\:data-url=${JSON.stringify(typeof n=="string"?n:n.url)}]`;e&&typeof e.body=="string"&&(s+=`[sveltekit\\:data-body="${Ot(e.body)}"]`);const l=document.querySelector(s);if(l&&l.textContent){const c=JSON.parse(l.textContent),{body:f}=c,r=Ve(c,["body"]);return Promise.resolve(new Response(f,r))}return fetch(n,e)}const Ct=/^(\.\.\.)?(\w+)(?:=(\w+))?$/;function jt(n){const e=[],t=[];let s=!0;return{pattern:n===""?/^\/$/:new RegExp(`^${decodeURIComponent(n).split(/(?:@[a-zA-Z0-9_-]+)?(?:\/|$)/).map((c,f,r)=>{const i=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(c);if(i)return e.push(i[1]),t.push(i[2]),"(?:/(.*))?";const a=f===r.length-1;return c&&"/"+c.split(/\[(.+?)\]/).map((d,R)=>{if(R%2){const[,y,Z,G]=Ct.exec(d);return e.push(Z),t.push(G),y?"(.*?)":"([^/]+?)"}return a&&d.includes(".")&&(s=!1),d.normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}${s?"/?":""}$`),names:e,types:t}}function It(n,e,t,s){const l={};for(let c=0;c<e.length;c+=1){const f=e[c],r=t[c],i=n[c+1]||"";if(r){const a=s[r];if(!a)throw new Error(`Missing "${r}" param matcher`);if(!a(i))return}l[f]=i}return l}function Tt(n,e,t){return Object.entries(e).map(([l,[c,f,r]])=>{const{pattern:i,names:a,types:d}=jt(l);return{id:l,exec:R=>{const y=i.exec(R);if(y)return It(y,a,d,t)},a:c.map(R=>n[R]),b:f.map(R=>n[R]),has_shadow:!!r}})}const Qe="sveltekit:scroll",W="sveltekit:index",ye=Tt(Ee,At,Ut),Dt=Ee[0](),Vt=Ee[1](),Ze={};let re={};try{re=JSON.parse(sessionStorage[Qe])}catch{}function ve(n){re[n]=ke()}function qt({target:n,session:e,base:t,trailing_slash:s}){var Ce;const l=new Map,c=[],f={url:Xe({}),page:Xe({}),navigating:ue(null),session:ue(e),updated:xt()},r={id:null,promise:null},i={before_navigate:[],after_navigate:[]};let a={branch:[],error:null,session_id:0,stuff:Ze,url:null},d=!1,R=!0,y=!1,Z=1,G=null,Re,Se,Le=!1;f.session.subscribe(async o=>{Se=o,Le&&(Z+=1,_e(new URL(location.href),[],!0))}),Le=!0;let X=!0,T=(Ce=history.state)==null?void 0:Ce[W];T||(T=Date.now(),history.replaceState(ne(P({},history.state),{[W]:T}),"",location.href));const de=re[T];de&&(history.scrollRestoration="manual",scrollTo(de.x,de.y));let pe=!1,he,Ue;async function Ae(o,{noscroll:p=!1,replaceState:w=!1,keepfocus:u=!1,state:h={}},b){const _=new URL(o,Me(document));if(X)return ge({url:_,scroll:p?ke():null,keepfocus:u,redirect_chain:b,details:{state:h,replaceState:w},accepted:()=>{},blocked:()=>{}});await ee(_)}async function Ne(o){const p=Pe(o);if(!p)throw new Error("Attempted to prefetch a URL that does not belong to this app");return r.promise=xe(p,!1),r.id=p.id,r.promise}async function _e(o,p,w,u){var g,$,S;const h=Pe(o),b=Ue={};let _=h&&await xe(h,w);if(!_&&o.origin===location.origin&&o.pathname===location.pathname&&(_=await Q({status:404,error:new Error(`Not found: ${o.pathname}`),url:o,routeId:null})),!_)return await ee(o),!1;if(Ue!==b)return!1;if(c.length=0,_.redirect)if(p.length>10||p.includes(o.pathname))_=await Q({status:500,error:new Error("Redirect loop"),url:o,routeId:null});else return X?Ae(new URL(_.redirect,o).href,{},[...p,o.pathname]):await ee(new URL(_.redirect,location.href)),!1;else(($=(g=_.props)==null?void 0:g.page)==null?void 0:$.status)>=400&&await f.updated.check()&&await ee(o);if(y=!0,u&&u.details){const{details:k}=u,E=k.replaceState?0:1;k.state[W]=T+=E,history[k.replaceState?"replaceState":"pushState"](k.state,"",o)}if(d?(a=_.state,Re.$set(_.props)):Oe(_),u){const{scroll:k,keepfocus:E}=u;if(!E){const m=document.body,A=m.getAttribute("tabindex");(S=getSelection())==null||S.removeAllRanges(),m.tabIndex=-1,m.focus(),A!==null?m.setAttribute("tabindex",A):m.removeAttribute("tabindex")}if(await qe(),R){const m=o.hash&&document.getElementById(o.hash.slice(1));k?scrollTo(k.x,k.y):m?m.scrollIntoView():scrollTo(0,0)}}else await qe();r.promise=null,r.id=null,R=!0,y=!1,_.props.page&&(he=_.props.page);const v=_.state.branch[_.state.branch.length-1];return X=(v==null?void 0:v.module.router)!==!1,!0}function Oe(o){a=o.state;const p=document.querySelector("style[data-sveltekit]");if(p&&p.remove(),he=o.props.page,Re=new Rt({target:n,props:ne(P({},o.props),{stores:f}),hydrate:!0}),d=!0,X){const w={from:null,to:new URL(location.href)};i.after_navigate.forEach(u=>u(w))}}async function me({url:o,params:p,stuff:w,branch:u,status:h,error:b,routeId:_}){var m,A;const v=u.filter(Boolean),g=v.find(U=>{var O;return(O=U.loaded)==null?void 0:O.redirect}),$={redirect:(m=g==null?void 0:g.loaded)==null?void 0:m.redirect,state:{url:o,params:p,branch:u,error:b,stuff:w,session_id:Z},props:{components:v.map(U=>U.module.default)}};for(let U=0;U<v.length;U+=1){const O=v[U].loaded;$.props[`props_${U}`]=O?await O.props:null}if(!a.url||o.href!==a.url.href||a.error!==b||a.stuff!==w){$.props.page={error:b,params:p,routeId:_,status:h,stuff:w,url:o};const U=(O,L)=>{Object.defineProperty($.props.page,O,{get:()=>{throw new Error(`$page.${O} has been replaced by $page.url.${L}`)}})};U("origin","origin"),U("path","pathname"),U("query","searchParams")}const k=v[v.length-1],E=(A=k==null?void 0:k.loaded)==null?void 0:A.cache;if(E){const U=o.pathname+o.search;let O=!1;const L=()=>{l.get(U)===$&&l.delete(U),x(),clearTimeout(N)},N=setTimeout(L,E.maxage*1e3),x=f.session.subscribe(()=>{O&&L()});O=!0,l.set(U,$)}return $}async function H({status:o,error:p,module:w,url:u,params:h,stuff:b,props:_,routeId:v}){const g={module:w,uses:{params:new Set,url:!1,session:!1,stuff:!1,dependencies:new Set},loaded:null,stuff:b};function $(E){const{href:m}=new URL(E,u);g.uses.dependencies.add(m)}_&&g.uses.dependencies.add(u.href);const S={};for(const E in h)Object.defineProperty(S,E,{get(){return g.uses.params.add(E),h[E]},enumerable:!0});const k=Se;if(w.load){const E={routeId:v,params:S,props:_||{},get url(){return g.uses.url=!0,u},get session(){return g.uses.session=!0,k},get stuff(){return g.uses.stuff=!0,P({},b)},fetch(A,U){const O=typeof A=="string"?A:A.url;return $(O),d?fetch(A,U):Pt(A,U)},status:o!=null?o:null,error:p!=null?p:null},m=await w.load.call(null,E);if(!m)throw new Error("load function must return a value");g.loaded=Ye(m),g.loaded.stuff&&(g.stuff=g.loaded.stuff),g.loaded.dependencies&&g.loaded.dependencies.forEach($)}else _&&(g.loaded=Ye({props:_}));return g}async function xe({id:o,url:p,params:w,route:u},h){var A,U,O;if(r.id===o&&r.promise)return r.promise;if(!h){const L=l.get(o);if(L)return L}const{a:b,b:_,has_shadow:v}=u,g=a.url&&{url:o!==a.url.pathname+a.url.search,params:Object.keys(w).filter(L=>a.params[L]!==w[L]),session:Z!==a.session_id};let $=[],S=Ze,k=!1,E=200,m=null;b.forEach(L=>L());e:for(let L=0;L<b.length;L+=1){let N;try{if(!b[L])continue;const x=await b[L](),D=a.branch[L];if(!D||x!==D.module||g.url&&D.uses.url||g.params.some(Y=>D.uses.params.has(Y))||g.session&&D.uses.session||Array.from(D.uses.dependencies).some(Y=>c.some(le=>le(Y)))||k&&D.uses.stuff){let Y={};const le=v&&L===b.length-1;if(le){const te=await fetch(`${p.pathname}${p.pathname.endsWith("/")?"":"/"}__data.json${p.search}`,{headers:{"x-sveltekit-load":"true"}});if(te.ok){const je=te.headers.get("x-sveltekit-location");if(je)return{redirect:je,props:{},state:a};Y=te.status===204?{}:await te.json()}else E=te.status,m=new Error("Failed to load data")}if(m||(N=await H({module:x,url:p,params:w,props:Y,stuff:S,routeId:u.id})),N&&(le&&(N.uses.url=!0),N.loaded)){if(N.loaded.error&&(E=N.loaded.status,m=N.loaded.error),N.loaded.redirect)return{redirect:N.loaded.redirect,props:{},state:a};N.loaded.stuff&&(k=!0)}}else N=D}catch(x){E=500,m=We(x)}if(m){for(;L--;)if(_[L]){let x,D,ce=L;for(;!(D=$[ce]);)ce-=1;try{if(x=await H({status:E,error:m,module:await _[L](),url:p,params:w,stuff:D.stuff,routeId:u.id}),(A=x==null?void 0:x.loaded)!=null&&A.error)continue;(U=x==null?void 0:x.loaded)!=null&&U.stuff&&(S=P(P({},S),x.loaded.stuff)),$=$.slice(0,ce+1).concat(x);break e}catch{continue}}return await Q({status:E,error:m,url:p,routeId:u.id})}else(O=N==null?void 0:N.loaded)!=null&&O.stuff&&(S=P(P({},S),N.loaded.stuff)),$.push(N)}return await me({url:p,params:w,stuff:S,branch:$,status:E,error:m,routeId:u.id})}async function Q({status:o,error:p,url:w,routeId:u}){var v,g;const h={},b=await H({module:await Dt,url:w,params:h,stuff:{},routeId:u}),_=await H({status:o,error:p,module:await Vt,url:w,params:h,stuff:b&&b.loaded&&b.loaded.stuff||{},routeId:u});return await me({url:w,params:h,stuff:P(P({},(v=b==null?void 0:b.loaded)==null?void 0:v.stuff),(g=_==null?void 0:_.loaded)==null?void 0:g.stuff),branch:[b,_],status:o,error:p,routeId:u})}function Pe(o){if(o.origin!==location.origin||!o.pathname.startsWith(t))return;const p=decodeURI(o.pathname.slice(t.length)||"/");for(const w of ye){const u=w.exec(p);if(u)return{id:o.pathname+o.search,route:w,params:u,url:o}}}async function ge({url:o,scroll:p,keepfocus:w,redirect_chain:u,details:h,accepted:b,blocked:_}){const v=a.url;let g=!1;const $={from:v,to:o,cancel:()=>g=!0};if(i.before_navigate.forEach(m=>m($)),g){_();return}const S=Nt(o.pathname,s),k=new URL(o.origin+S+o.search+o.hash);if(ve(T),b(),d&&f.navigating.set({from:a.url,to:k}),await _e(k,u,!1,{scroll:p,keepfocus:w,details:h})){const m={from:v,to:k};i.after_navigate.forEach(A=>A(m)),f.navigating.set(null)}}function ee(o){return location.href=o.href,new Promise(()=>{})}return{after_navigate:o=>{$e(()=>(i.after_navigate.push(o),()=>{const p=i.after_navigate.indexOf(o);i.after_navigate.splice(p,1)}))},before_navigate:o=>{$e(()=>(i.before_navigate.push(o),()=>{const p=i.before_navigate.indexOf(o);i.before_navigate.splice(p,1)}))},disable_scroll_handling:()=>{(y||!d)&&(R=!1)},goto:(o,p={})=>Ae(o,p,[]),invalidate:o=>{if(typeof o=="function")c.push(o);else{const{href:p}=new URL(o,location.href);c.push(w=>w===p)}return G||(G=Promise.resolve().then(async()=>{await _e(new URL(location.href),[],!0),G=null})),G},prefetch:async o=>{const p=new URL(o,Me(document));await Ne(p)},prefetch_routes:async o=>{const w=(o?ye.filter(u=>o.some(h=>u.exec(h))):ye).map(u=>Promise.all(u.a.map(h=>h())));await Promise.all(w)},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",u=>{let h=!1;const b={from:a.url,to:null,cancel:()=>h=!0};i.before_navigate.forEach(_=>_(b)),h?(u.preventDefault(),u.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){ve(T);try{sessionStorage[Qe]=JSON.stringify(re)}catch{}}});const o=u=>{const h=Fe(u);h&&h.href&&h.hasAttribute("sveltekit:prefetch")&&Ne(Ge(h))};let p;const w=u=>{clearTimeout(p),p=setTimeout(()=>{var h;(h=u.target)==null||h.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",o),addEventListener("mousemove",w),addEventListener("sveltekit:trigger_prefetch",o),addEventListener("click",u=>{if(!X||u.button||u.which!==1||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey||u.defaultPrevented)return;const h=Fe(u);if(!h||!h.href)return;const b=h instanceof SVGAElement,_=Ge(h);if(!b&&_.origin==="null")return;const v=(h.getAttribute("rel")||"").split(/\s+/);if(h.hasAttribute("download")||v.includes("external")||h.hasAttribute("sveltekit:reload")||(b?h.target.baseVal:h.target))return;const[g,$]=_.href.split("#");if($!==void 0&&g===location.href.split("#")[0]){pe=!0,ve(T),f.page.set(ne(P({},he),{url:_})),f.page.notify();return}ge({url:_,scroll:h.hasAttribute("sveltekit:noscroll")?ke():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:_.href===location.href},accepted:()=>u.preventDefault(),blocked:()=>u.preventDefault()})}),addEventListener("popstate",u=>{if(u.state&&X){if(u.state[W]===T)return;ge({url:new URL(location.href),scroll:re[u.state[W]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{T=u.state[W]},blocked:()=>{const h=T-u.state[W];history.go(h)}})}}),addEventListener("hashchange",()=>{pe&&(pe=!1,history.replaceState(ne(P({},history.state),{[W]:++T}),"",location.href))})},_hydrate:async({status:o,error:p,nodes:w,params:u,routeId:h})=>{const b=new URL(location.href),_=[];let v={},g,$;try{for(let S=0;S<w.length;S+=1){const k=S===w.length-1;let E;if(k){const A=document.querySelector('script[sveltekit\\:data-type="props"]');A&&(E=JSON.parse(A.textContent))}const m=await H({module:await w[S],url:b,params:u,stuff:v,status:k?o:void 0,error:k?p:void 0,props:E,routeId:h});if(E&&(m.uses.dependencies.add(b.href),m.uses.url=!0),_.push(m),m&&m.loaded)if(m.loaded.error){if(p)throw m.loaded.error;$={status:m.loaded.status,error:m.loaded.error,url:b,routeId:h}}else m.loaded.stuff&&(v=P(P({},v),m.loaded.stuff))}g=$?await Q($):await me({url:b,params:u,stuff:v,branch:_,status:o,error:p,routeId:h})}catch(S){if(p)throw S;g=await Q({status:500,error:We(S),url:b,routeId:h})}g.redirect&&await ee(new URL(g.redirect,location.href)),Oe(g)}}}async function Bt({paths:n,target:e,session:t,route:s,spa:l,trailing_slash:c,hydrate:f}){const r=qt({target:e,session:t,base:n.base,trailing_slash:c});mt(n),f&&await r._hydrate(f),s&&(l&&r.goto(location.href,{replaceState:!0}),r._start_router()),dispatchEvent(new CustomEvent("sveltekit:start"))}export{Bt as start};
|
|
|
|
static/_app/version.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":"
|
|
|
1 |
+
{"version":"1651474694789"}
|
static/compose.png
DELETED
Binary file (1.45 kB)
|
|
static/download.wav
DELETED
Binary file (794 kB)
|
|
static/favicon.png
DELETED
Binary file (1.57 kB)
|
|
static/hugging-face-headphones.png
ADDED
{templates β static}/index.html
RENAMED
@@ -3,28 +3,28 @@
|
|
3 |
<head>
|
4 |
<meta charset="utf-8" />
|
5 |
<meta name="description" content="" />
|
6 |
-
<link rel="icon" href="
|
7 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
9 |
<link href="https://fonts.googleapis.com/css2?family=Italiana&family=Lato&display=swap" rel="stylesheet" />
|
10 |
-
<link rel="stylesheet" href="
|
11 |
<link href="https://fonts.googleapis.com/css2?family=Italiana&family=Lato&display=swap" rel="stylesheet" />
|
12 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
13 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.2/iframeResizer.contentWindow.min.js"></script>
|
14 |
<meta http-equiv="content-security-policy" content="">
|
15 |
-
<link rel="stylesheet" href="https://hf.space/embed/ai-guru/composer/_app/assets/pages/index.svelte-
|
16 |
-
<link rel="modulepreload" href="https://hf.space/embed/ai-guru/composer/_app/start-
|
17 |
-
<link rel="modulepreload" href="https://hf.space/embed/ai-guru/composer/_app/chunks/index-
|
18 |
-
<link rel="modulepreload" href="https://hf.space/embed/ai-guru/composer/_app/chunks/index-
|
19 |
-
<link rel="modulepreload" href="https://hf.space/embed/ai-guru/composer/_app/layout.svelte-
|
20 |
-
<link rel="modulepreload" href="https://hf.space/embed/ai-guru/composer/_app/pages/index.svelte-
|
21 |
</head>
|
22 |
<body>
|
23 |
<div>
|
24 |
|
25 |
|
26 |
<main class="svelte-1rfjlkw"><h1 class="svelte-1rfjlkw">Composer</h1>
|
27 |
-
<p class="heading svelte-1rfjlkw">
|
28 |
<p class="svelte-1rfjlkw">This space contains a deep neural network model that can compose music. You can use it to generate music in
|
29 |
different styles, 4 bars at a time.
|
30 |
</p>
|
@@ -33,20 +33,22 @@
|
|
33 |
</p>
|
34 |
<p class="svelte-1rfjlkw">Have fun! And always feel free to send us some feedback and share your compositions!</p>
|
35 |
<section id="options" class="svelte-1rfjlkw"><fieldset class="svelte-1r9pswz"><legend class="svelte-1r9pswz">Synthesizer</legend>
|
36 |
-
<div class="grid svelte-1r9pswz"><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="piano.svg" alt="Piano" class="svelte-1r9pswz"></div>
|
37 |
<input type="radio" value="piano" class="svelte-1r9pswz">
|
38 |
-
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="chamber.svg" alt="Chamber Music" class="svelte-1r9pswz"></div>
|
39 |
<input type="radio" value="chamber" class="svelte-1r9pswz">
|
40 |
-
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="rock_and_metal.svg" alt="Rock and Metal" class="svelte-1r9pswz"></div>
|
41 |
<input type="radio" value="rock_and_metal" class="svelte-1r9pswz">
|
42 |
-
</label><label data-selected="true" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="synth.svg" alt="Synthesizer" class="svelte-1r9pswz"></div>
|
43 |
<input type="radio" value="synth" class="svelte-1r9pswz" checked>
|
44 |
-
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="church.svg" alt="Church" class="svelte-1r9pswz"></div>
|
45 |
<input type="radio" value="church" class="svelte-1r9pswz">
|
46 |
-
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="timpani_strings_harp.svg" alt="Timpani, Contrabass, Harp" class="svelte-1r9pswz"></div>
|
47 |
<input type="radio" value="timpani_strings_harp" class="svelte-1r9pswz">
|
48 |
-
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="country.svg" alt="Country" class="svelte-1r9pswz"></div>
|
49 |
<input type="radio" value="country" class="svelte-1r9pswz">
|
|
|
|
|
50 |
</label></div>
|
51 |
</fieldset>
|
52 |
<div><fieldset class="svelte-1ikh8be"><legend class="svelte-1ikh8be">Note density</legend>
|
@@ -73,20 +75,18 @@
|
|
73 |
<input type="radio" checked class="svelte-1m848u0">
|
74 |
</div></fieldset>
|
75 |
</div></section>
|
76 |
-
<button class="svelte-18w38ow">Compose <img src="wand.svg" alt="Magic wand" class="svelte-18w38ow">
|
77 |
</button>
|
78 |
|
79 |
-
|
80 |
-
|
81 |
|
82 |
</main>
|
83 |
|
84 |
|
85 |
-
<script type="module" data-hydrate="
|
86 |
-
import { start } from "https://hf.space/embed/ai-guru/composer/_app/start-
|
87 |
start({
|
88 |
-
target: document.querySelector('[data-hydrate="
|
89 |
-
paths: {"base":"","assets":""},
|
90 |
session: {},
|
91 |
route: true,
|
92 |
spa: false,
|
@@ -95,8 +95,8 @@
|
|
95 |
status: 200,
|
96 |
error: null,
|
97 |
nodes: [
|
98 |
-
import("https://hf.space/embed/ai-guru/composer/_app/layout.svelte-
|
99 |
-
import("https://hf.space/embed/ai-guru/composer/_app/pages/index.svelte-
|
100 |
],
|
101 |
params: {},
|
102 |
routeId: ""
|
|
|
3 |
<head>
|
4 |
<meta charset="utf-8" />
|
5 |
<meta name="description" content="" />
|
6 |
+
<link rel="icon" href="/static/wand.svg" />
|
7 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
9 |
<link href="https://fonts.googleapis.com/css2?family=Italiana&family=Lato&display=swap" rel="stylesheet" />
|
10 |
+
<link rel="stylesheet" href="/static/style.css" />
|
11 |
<link href="https://fonts.googleapis.com/css2?family=Italiana&family=Lato&display=swap" rel="stylesheet" />
|
12 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
13 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.2/iframeResizer.contentWindow.min.js"></script>
|
14 |
<meta http-equiv="content-security-policy" content="">
|
15 |
+
<link rel="stylesheet" href="https://hf.space/embed/ai-guru/composer/static/_app/assets/pages/index.svelte-10d60411.css">
|
16 |
+
<link rel="modulepreload" href="https://hf.space/embed/ai-guru/composer/static/_app/start-5e34eb6b.js">
|
17 |
+
<link rel="modulepreload" href="https://hf.space/embed/ai-guru/composer/static/_app/chunks/index-f8f7cfca.js">
|
18 |
+
<link rel="modulepreload" href="https://hf.space/embed/ai-guru/composer/static/_app/chunks/index-7a30815e.js">
|
19 |
+
<link rel="modulepreload" href="https://hf.space/embed/ai-guru/composer/static/_app/layout.svelte-3942c837.js">
|
20 |
+
<link rel="modulepreload" href="https://hf.space/embed/ai-guru/composer/static/_app/pages/index.svelte-b34d5edf.js">
|
21 |
</head>
|
22 |
<body>
|
23 |
<div>
|
24 |
|
25 |
|
26 |
<main class="svelte-1rfjlkw"><h1 class="svelte-1rfjlkw">Composer</h1>
|
27 |
+
<p class="heading svelte-1rfjlkw">Trained on fifteen thousand songs. One AI model. Infinite compositions.</p>
|
28 |
<p class="svelte-1rfjlkw">This space contains a deep neural network model that can compose music. You can use it to generate music in
|
29 |
different styles, 4 bars at a time.
|
30 |
</p>
|
|
|
33 |
</p>
|
34 |
<p class="svelte-1rfjlkw">Have fun! And always feel free to send us some feedback and share your compositions!</p>
|
35 |
<section id="options" class="svelte-1rfjlkw"><fieldset class="svelte-1r9pswz"><legend class="svelte-1r9pswz">Synthesizer</legend>
|
36 |
+
<div class="grid svelte-1r9pswz"><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="static/piano.svg" alt="Piano" class="svelte-1r9pswz"></div>
|
37 |
<input type="radio" value="piano" class="svelte-1r9pswz">
|
38 |
+
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="static/chamber.svg" alt="Chamber Music" class="svelte-1r9pswz"></div>
|
39 |
<input type="radio" value="chamber" class="svelte-1r9pswz">
|
40 |
+
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="static/rock_and_metal.svg" alt="Rock and Metal" class="svelte-1r9pswz"></div>
|
41 |
<input type="radio" value="rock_and_metal" class="svelte-1r9pswz">
|
42 |
+
</label><label data-selected="true" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="static/synth.svg" alt="Synthesizer" class="svelte-1r9pswz"></div>
|
43 |
<input type="radio" value="synth" class="svelte-1r9pswz" checked>
|
44 |
+
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="static/church.svg" alt="Church" class="svelte-1r9pswz"></div>
|
45 |
<input type="radio" value="church" class="svelte-1r9pswz">
|
46 |
+
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="static/timpani_strings_harp.svg" alt="Timpani, Contrabass, Harp" class="svelte-1r9pswz"></div>
|
47 |
<input type="radio" value="timpani_strings_harp" class="svelte-1r9pswz">
|
48 |
+
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="static/country.svg" alt="Country" class="svelte-1r9pswz"></div>
|
49 |
<input type="radio" value="country" class="svelte-1r9pswz">
|
50 |
+
</label><label data-selected="false" class="svelte-1r9pswz"><div class="svelte-1r9pswz"><img src="static/reggae.svg" alt="Reggae-esque" class="svelte-1r9pswz"></div>
|
51 |
+
<input type="radio" value="reggae" class="svelte-1r9pswz">
|
52 |
</label></div>
|
53 |
</fieldset>
|
54 |
<div><fieldset class="svelte-1ikh8be"><legend class="svelte-1ikh8be">Note density</legend>
|
|
|
75 |
<input type="radio" checked class="svelte-1m848u0">
|
76 |
</div></fieldset>
|
77 |
</div></section>
|
78 |
+
<button class="svelte-18w38ow">Compose <img src="static/wand.svg" alt="Magic wand" class="svelte-18w38ow">
|
79 |
</button>
|
80 |
|
|
|
|
|
81 |
|
82 |
</main>
|
83 |
|
84 |
|
85 |
+
<script type="module" data-hydrate="o4uw90">
|
86 |
+
import { start } from "https://hf.space/embed/ai-guru/composer/static/_app/start-5e34eb6b.js";
|
87 |
start({
|
88 |
+
target: document.querySelector('[data-hydrate="o4uw90"]').parentNode,
|
89 |
+
paths: {"base":"/static","assets":"/static"},
|
90 |
session: {},
|
91 |
route: true,
|
92 |
spa: false,
|
|
|
95 |
status: 200,
|
96 |
error: null,
|
97 |
nodes: [
|
98 |
+
import("https://hf.space/embed/ai-guru/composer/static/_app/layout.svelte-3942c837.js"),
|
99 |
+
import("https://hf.space/embed/ai-guru/composer/static/_app/pages/index.svelte-b34d5edf.js")
|
100 |
],
|
101 |
params: {},
|
102 |
routeId: ""
|
static/reggae.svg
ADDED
static/script.js
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
function compose() {
|
2 |
-
|
3 |
-
// Get the value of the select with id selected_midi_program.
|
4 |
-
var selected_music_style = document.getElementById("selected_music_style").value;
|
5 |
-
var selected_density = document.getElementById("selected_density").value;
|
6 |
-
var selected_temperature = document.getElementById("selected_temperature").value;
|
7 |
-
|
8 |
-
var xhr = new XMLHttpRequest();
|
9 |
-
xhr.open("POST", "compose", true);
|
10 |
-
xhr.setRequestHeader("Content-Type", "application/json");
|
11 |
-
xhr.send(JSON.stringify({
|
12 |
-
music_style: selected_music_style,
|
13 |
-
density: selected_density,
|
14 |
-
temperature: selected_temperature
|
15 |
-
}));
|
16 |
-
|
17 |
-
xhr.onreadystatechange = function() {
|
18 |
-
if (xhr.readyState == 4 && xhr.status == 200) {
|
19 |
-
var response = JSON.parse(xhr.responseText);
|
20 |
-
console.log(response);
|
21 |
-
|
22 |
-
if (response.status == "OK") {
|
23 |
-
|
24 |
-
// Replace the inner html of the div with id token_sequence with the token sequence.
|
25 |
-
document.getElementById("token_sequence").innerHTML = response.tokens;
|
26 |
-
|
27 |
-
// Replace the source of the audio element with id audio..
|
28 |
-
var audio = document.getElementById("audio_id");
|
29 |
-
audio.src = response.audio;
|
30 |
-
|
31 |
-
// Replace the source of the image element with id image.
|
32 |
-
var image = document.getElementById("image_id");
|
33 |
-
image.src = response.image;
|
34 |
-
|
35 |
-
}
|
36 |
-
else {
|
37 |
-
alert("Error: " + response.error);
|
38 |
-
}
|
39 |
-
}
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
|
44 |
-
function post_command(command_name, command_parameters, reload) {
|
45 |
-
var xhr = new XMLHttpRequest();
|
46 |
-
xhr.open("POST", "/command", true);
|
47 |
-
xhr.setRequestHeader("Content-Type", "application/json");
|
48 |
-
xhr.send(JSON.stringify({command_name: command_name, command_parameters: command_parameters}));
|
49 |
-
|
50 |
-
xhr.onreadystatechange = function() {
|
51 |
-
if (xhr.readyState == 4 && xhr.status == 200) {
|
52 |
-
var response = JSON.parse(xhr.responseText);
|
53 |
-
if (response.status == "OK") {
|
54 |
-
|
55 |
-
// Reload the page if requested.
|
56 |
-
if (reload) {
|
57 |
-
console.log("Reloading.");
|
58 |
-
load_cells();
|
59 |
-
}
|
60 |
-
|
61 |
-
}
|
62 |
-
else {
|
63 |
-
alert("Error: " + response.error);
|
64 |
-
}
|
65 |
-
}
|
66 |
-
}
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|