@44-audio/components 0.1.0-dev.18 → 0.1.0-dev.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/player.es.js +500 -500
- package/package.json +1 -1
package/dist/player.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { b as rt, E as mt, a as at, n as Qe, d as Wt, h as Ue, c as ot, e as Bt, f as bt, g as $e, s as wt, U as At, i as qt, j as Nt, p as xt, k as _t, l as ue, m as pe, o as be, q as u, r as F, t as H, u as te, v as Le, w as e, x as W, y as x, z as ge, A as c, B as
|
|
2
|
-
function Ge(y, t, ...
|
|
1
|
+
import { b as rt, E as mt, a as at, n as Qe, d as Wt, h as Ue, c as ot, e as Bt, f as bt, g as $e, s as wt, U as At, i as qt, j as Nt, p as xt, k as _t, l as ue, m as pe, o as be, q as u, r as F, t as H, u as te, v as Le, w as e, x as W, y as x, z as ge, A as c, B as fe, C as me, D as q, F as m, G as ee, H as J, I as K, J as G, K as N, L as ye, M as Ce, N as ze, O as Pe, P as je, Q as Ve, R as pt, S as Dt, T as Fe, V as Ee, W as Z, X as Be, Y as Me, Z as nt, _ as Ae, $ as Ne, a0 as Ot, a1 as gt, a2 as Ie, a3 as yt, a4 as Xe, a5 as Ut, a6 as Ft } from "./time-BmemrSJ4.mjs";
|
|
2
|
+
function Ge(y, t, ...g) {
|
|
3
3
|
var i = y, o = Qe, r;
|
|
4
4
|
rt(() => {
|
|
5
5
|
o !== (o = t()) && (r && (Wt(r), r = null), r = at(() => (
|
|
6
6
|
/** @type {SnippetFn} */
|
|
7
|
-
o(i, ...
|
|
7
|
+
o(i, ...g)
|
|
8
8
|
)));
|
|
9
9
|
}, mt), Ue && (i = ot);
|
|
10
10
|
}
|
|
11
|
-
function Gt(y, t,
|
|
11
|
+
function Gt(y, t, g) {
|
|
12
12
|
Ue && _t();
|
|
13
13
|
var i = y, o = At, r, a, n = null, s = Nt() ? Bt : qt;
|
|
14
14
|
function _() {
|
|
@@ -16,12 +16,12 @@ function Gt(y, t, p) {
|
|
|
16
16
|
}
|
|
17
17
|
rt(() => {
|
|
18
18
|
if (s(o, o = t())) {
|
|
19
|
-
var
|
|
20
|
-
I && (n = document.createDocumentFragment(), n.append(
|
|
19
|
+
var f = i, I = wt();
|
|
20
|
+
I && (n = document.createDocumentFragment(), n.append(f = bt())), a = at(() => g(f)), I ? $e.add_callback(_) : _();
|
|
21
21
|
}
|
|
22
22
|
}), Ue && (i = ot);
|
|
23
23
|
}
|
|
24
|
-
function Kt(y, t,
|
|
24
|
+
function Kt(y, t, g) {
|
|
25
25
|
Ue && _t();
|
|
26
26
|
var i = y, o, r, a = null, n = null;
|
|
27
27
|
function s() {
|
|
@@ -31,8 +31,8 @@ function Kt(y, t, p) {
|
|
|
31
31
|
if (o !== (o = t())) {
|
|
32
32
|
var _ = wt();
|
|
33
33
|
if (o) {
|
|
34
|
-
var
|
|
35
|
-
_ && (a = document.createDocumentFragment(), a.append(
|
|
34
|
+
var f = i;
|
|
35
|
+
_ && (a = document.createDocumentFragment(), a.append(f = bt()), r && $e.skipped_effects.add(r)), n = at(() => g(f, o));
|
|
36
36
|
}
|
|
37
37
|
_ ? $e.add_callback(s) : s();
|
|
38
38
|
}
|
|
@@ -42,19 +42,19 @@ var Vt = F("<fortyfour-player></fortyfour-player>", 2);
|
|
|
42
42
|
const Xt = { hash: "svelte-1uea9wj", code: ":host {display:block;}" };
|
|
43
43
|
function Yt(y, t) {
|
|
44
44
|
pe(t, !0), be(y, Xt);
|
|
45
|
-
let
|
|
45
|
+
let g = u(t, "recordingId", 7), i = u(t, "theme", 7, ""), o = u(t, "apiHost", 7, "api.44.audio");
|
|
46
46
|
const r = W(() => {
|
|
47
47
|
if (!i())
|
|
48
48
|
return "";
|
|
49
|
-
const s = i().split(",").map((
|
|
49
|
+
const s = i().split(",").map((f) => f.trim()), _ = [];
|
|
50
50
|
return s[0] && _.push(`--fortyfour-player-background: ${s[0]}`), s[1] && _.push(`--fortyfour-player-text: ${s[1]}`), s[2] && _.push(`--fortyfour-player-accent: ${s[2]}`), s[4] && _.push(`--fortyfour-player-muted: ${s[4]}`), s[5] && _.push(`--fortyfour-player-border: ${s[5]}`), s[0] && _.push(`--fortyfour-player-surface: ${s[0]}`), _.join("; ");
|
|
51
51
|
});
|
|
52
52
|
var a = {
|
|
53
53
|
get recordingId() {
|
|
54
|
-
return
|
|
54
|
+
return g();
|
|
55
55
|
},
|
|
56
56
|
set recordingId(s) {
|
|
57
|
-
|
|
57
|
+
g(s), c();
|
|
58
58
|
},
|
|
59
59
|
get theme() {
|
|
60
60
|
return i();
|
|
@@ -69,7 +69,7 @@ function Yt(y, t) {
|
|
|
69
69
|
o(s), c();
|
|
70
70
|
}
|
|
71
71
|
}, n = Vt();
|
|
72
|
-
return H(() => te(n, "api-host", o())), H(() => te(n, "recording-id",
|
|
72
|
+
return H(() => te(n, "api-host", o())), H(() => te(n, "recording-id", g())), te(n, "preload", "metadata"), H(() => Le(n, e(r))), x(y, n), ge(a);
|
|
73
73
|
}
|
|
74
74
|
customElements.define("fortyfour-audio-player", ue(
|
|
75
75
|
Yt,
|
|
@@ -89,13 +89,13 @@ const Jt = {
|
|
|
89
89
|
};
|
|
90
90
|
function Qt(y, t) {
|
|
91
91
|
pe(t, !0), be(y, Jt);
|
|
92
|
-
let
|
|
92
|
+
let g = u(t, "apiHost", 7, "api.44.audio"), i = u(t, "recordingId", 7), o = u(t, "visualization", 7, "none"), r = u(t, "rippleIntensity", 7, 1), a = u(t, "hover", 7, "none"), n = u(t, "preload", 7, "none"), s = u(t, "shape", 7, "circle"), _ = u(t, "blobAnimate", 7, !1), f = u(t, "blobSpeed", 7, 20);
|
|
93
93
|
var I = {
|
|
94
94
|
get apiHost() {
|
|
95
|
-
return
|
|
95
|
+
return g();
|
|
96
96
|
},
|
|
97
97
|
set apiHost(l = "api.44.audio") {
|
|
98
|
-
|
|
98
|
+
g(l), c();
|
|
99
99
|
},
|
|
100
100
|
get recordingId() {
|
|
101
101
|
return i();
|
|
@@ -140,13 +140,13 @@ function Qt(y, t) {
|
|
|
140
140
|
_(l), c();
|
|
141
141
|
},
|
|
142
142
|
get blobSpeed() {
|
|
143
|
-
return
|
|
143
|
+
return f();
|
|
144
144
|
},
|
|
145
145
|
set blobSpeed(l = 20) {
|
|
146
|
-
|
|
146
|
+
f(l), c();
|
|
147
147
|
}
|
|
148
|
-
},
|
|
149
|
-
return H(() => te(
|
|
148
|
+
}, d = Zt();
|
|
149
|
+
return H(() => te(d, "api-host", g())), H(() => te(d, "recording-id", i())), H(() => te(d, "preload", n())), fe(d, 1, "svelte-1pz3muj"), x(y, d), ge(I);
|
|
150
150
|
}
|
|
151
151
|
customElements.define("fortyfour-player-mini", ue(
|
|
152
152
|
Qt,
|
|
@@ -166,18 +166,18 @@ customElements.define("fortyfour-player-mini", ue(
|
|
|
166
166
|
!0
|
|
167
167
|
));
|
|
168
168
|
function it(y, t = 200) {
|
|
169
|
-
let
|
|
169
|
+
let g = q(!1);
|
|
170
170
|
return me(() => {
|
|
171
171
|
if (y()) {
|
|
172
|
-
const i = setTimeout(() => m(
|
|
172
|
+
const i = setTimeout(() => m(g, !0), t);
|
|
173
173
|
return () => clearTimeout(i);
|
|
174
174
|
} else
|
|
175
|
-
m(
|
|
176
|
-
}), () => e(
|
|
175
|
+
m(g, !1);
|
|
176
|
+
}), () => e(g);
|
|
177
177
|
}
|
|
178
|
-
function lt(y, t,
|
|
178
|
+
function lt(y, t, g) {
|
|
179
179
|
me(() => {
|
|
180
|
-
|
|
180
|
+
g() ? y.setAttribute(t, "") : y.removeAttribute(t);
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
var $t = F('<div part="separator" class="separator svelte-38lkst">/</div>'), er = F('<div part="elapsed" class="elapsed svelte-38lkst"> </div> <!> <div part="total" class="total svelte-38lkst"> </div>', 1), tr = F('<div part="elapsed" class="elapsed svelte-38lkst">-:--</div> <div part="separator" class="separator svelte-38lkst">/</div> <div part="total" class="total svelte-38lkst">-:--</div>', 1), rr = F('<div part="duration" class="duration svelte-38lkst"><!></div>'), ar = F("<span> </span>"), or = F("<span>--</span>"), nr = F('<div part="duration" class="duration svelte-38lkst"><!></div>');
|
|
@@ -187,9 +187,9 @@ const ir = {
|
|
|
187
187
|
};
|
|
188
188
|
function lr(y, t) {
|
|
189
189
|
pe(t, !0), be(y, ir);
|
|
190
|
-
const
|
|
190
|
+
const g = t.$$host;
|
|
191
191
|
let i = u(t, "format", 7, "-remaining"), o = u(t, "for", 7, ""), r = q(0), a = q(0), n = q("none");
|
|
192
|
-
const s = it(() => e(a) === 0, 200), _ = W(() => e(a) !== 0 ? !1 : e(n) === "none" ? !0 : s()),
|
|
192
|
+
const s = it(() => e(a) === 0, 200), _ = W(() => e(a) !== 0 ? !1 : e(n) === "none" ? !0 : s()), f = W(() => Ve(e(r))), I = W(() => Ve(e(a))), d = W(() => {
|
|
193
193
|
if (e(a) === 0)
|
|
194
194
|
return "";
|
|
195
195
|
switch (i()) {
|
|
@@ -198,7 +198,7 @@ function lr(y, t) {
|
|
|
198
198
|
case "remaining":
|
|
199
199
|
return Ve(Math.max(0, e(a) - e(r)));
|
|
200
200
|
case "elapsed":
|
|
201
|
-
return e(
|
|
201
|
+
return e(f);
|
|
202
202
|
case "elapsed-text":
|
|
203
203
|
return pt(e(r));
|
|
204
204
|
case "total":
|
|
@@ -231,7 +231,7 @@ function lr(y, t) {
|
|
|
231
231
|
return B.addEventListener("loadedmetadata", A), B.addEventListener("timeupdate", X), () => {
|
|
232
232
|
B.removeEventListener("loadedmetadata", A), B.removeEventListener("timeupdate", X);
|
|
233
233
|
};
|
|
234
|
-
}), lt(
|
|
234
|
+
}), lt(g, "data-placeholder", () => e(_));
|
|
235
235
|
var l = {
|
|
236
236
|
get format() {
|
|
237
237
|
return i();
|
|
@@ -258,16 +258,16 @@ function lr(y, t) {
|
|
|
258
258
|
var Q = $t();
|
|
259
259
|
ze(1, Q, () => Pe, () => ({ duration: 400 })), x(E, Q);
|
|
260
260
|
});
|
|
261
|
-
var z = ye(M, 2),
|
|
261
|
+
var z = ye(M, 2), v = G(z, !0);
|
|
262
262
|
N(z), H(() => {
|
|
263
|
-
je(L, e(
|
|
263
|
+
je(L, e(f)), je(v, e(I));
|
|
264
264
|
}), ze(1, T, () => Pe, () => ({ duration: 400 })), ze(1, z, () => Pe, () => ({ duration: 400 })), x(k, D);
|
|
265
265
|
}, V = (k) => {
|
|
266
266
|
var D = ee(), T = J(D);
|
|
267
267
|
{
|
|
268
268
|
var L = (M) => {
|
|
269
|
-
var z = ee(),
|
|
270
|
-
Ce(
|
|
269
|
+
var z = ee(), v = J(z);
|
|
270
|
+
Ce(v, t, "placeholder", {}, (E) => {
|
|
271
271
|
var Q = tr();
|
|
272
272
|
Dt(4), x(E, Q);
|
|
273
273
|
}), x(M, z);
|
|
@@ -292,13 +292,13 @@ function lr(y, t) {
|
|
|
292
292
|
{
|
|
293
293
|
var R = (k) => {
|
|
294
294
|
var D = ar(), T = G(D, !0);
|
|
295
|
-
N(D), H(() => je(T, e(
|
|
295
|
+
N(D), H(() => je(T, e(d))), ze(1, D, () => Pe, () => ({ duration: 400 })), x(k, D);
|
|
296
296
|
}, V = (k) => {
|
|
297
297
|
var D = ee(), T = J(D);
|
|
298
298
|
{
|
|
299
299
|
var L = (M) => {
|
|
300
|
-
var z = ee(),
|
|
301
|
-
Ce(
|
|
300
|
+
var z = ee(), v = J(z);
|
|
301
|
+
Ce(v, t, "placeholder", {}, (E) => {
|
|
302
302
|
var Q = or();
|
|
303
303
|
x(E, Q);
|
|
304
304
|
}), x(M, z);
|
|
@@ -333,25 +333,25 @@ const cr = {
|
|
|
333
333
|
};
|
|
334
334
|
function kt(y, t) {
|
|
335
335
|
pe(t, !0), be(y, cr);
|
|
336
|
-
function
|
|
336
|
+
function g(k, D) {
|
|
337
337
|
const T = k.length / D, L = [];
|
|
338
338
|
for (let M = 0; M < D; M++) {
|
|
339
|
-
const z = Math.floor(M * T),
|
|
339
|
+
const z = Math.floor(M * T), v = Math.floor((M + 1) * T), E = k.slice(z, Math.max(z + 1, v)), Q = E.reduce((w, h) => w + h * h, 0), oe = Math.sqrt(Q / E.length);
|
|
340
340
|
L.push(oe);
|
|
341
341
|
}
|
|
342
342
|
return L;
|
|
343
343
|
}
|
|
344
|
-
let i = u(t, "data", 7), o = u(t, "timeMs", 7, null), r = u(t, "barWidth", 7, 3), a = u(t, "spacing", 7, 1), n = u(t, "minHeight", 7, 3), s = q(0), _ = q(56),
|
|
344
|
+
let i = u(t, "data", 7), o = u(t, "timeMs", 7, null), r = u(t, "barWidth", 7, 3), a = u(t, "spacing", 7, 1), n = u(t, "minHeight", 7, 3), s = q(0), _ = q(56), f = q(!1), I = null;
|
|
345
345
|
Fe(() => {
|
|
346
346
|
const k = new ResizeObserver((D) => {
|
|
347
347
|
for (let T of D)
|
|
348
|
-
T.contentBoxSize ? (m(s, T.contentBoxSize[0]?.inlineSize || T.contentBoxSize.inlineSize, !0), m(_, T.contentBoxSize[0]?.blockSize || T.contentBoxSize.blockSize || 56, !0)) : (m(s, T.contentRect.width, !0), m(_, T.contentRect.height || 56, !0)), m(
|
|
348
|
+
T.contentBoxSize ? (m(s, T.contentBoxSize[0]?.inlineSize || T.contentBoxSize.inlineSize, !0), m(_, T.contentBoxSize[0]?.blockSize || T.contentBoxSize.blockSize || 56, !0)) : (m(s, T.contentRect.width, !0), m(_, T.contentRect.height || 56, !0)), m(f, !0);
|
|
349
349
|
});
|
|
350
350
|
return I && k.observe(I), () => {
|
|
351
351
|
k.disconnect();
|
|
352
352
|
};
|
|
353
353
|
});
|
|
354
|
-
const
|
|
354
|
+
const d = 100, l = W(() => Math.floor(e(s) / (r() + a()))), P = W(() => g(i(), e(l))), b = W(() => e(P).length ? i().length / e(P).length : 1), j = W(() => d * e(b)), C = W(() => e(P).map((k) => {
|
|
355
355
|
const D = Math.max(n(), Math.round(k / 100 * (e(_) - n()) + n()));
|
|
356
356
|
return D % 2 === 0 ? D + 1 : D;
|
|
357
357
|
}));
|
|
@@ -391,15 +391,15 @@ function kt(y, t) {
|
|
|
391
391
|
var V = (k) => {
|
|
392
392
|
var D = ee(), T = J(D);
|
|
393
393
|
Be(T, 17, () => e(C), Ae, (L, M, z) => {
|
|
394
|
-
const
|
|
394
|
+
const v = W(() => z * e(j) < o());
|
|
395
395
|
var E = sr();
|
|
396
396
|
H(() => {
|
|
397
|
-
|
|
397
|
+
fe(E, 0, nt(["bar", e(v) ? "progress" : "track"]), "svelte-7i2lww"), Z(E, "x", z * (r() + a())), Z(E, "y", e(_) / 4 - e(M) / 2), Z(E, "width", r() - 1), Z(E, "height", e(M));
|
|
398
398
|
}), x(L, E);
|
|
399
399
|
}), x(k, D);
|
|
400
400
|
};
|
|
401
401
|
K(R, (k) => {
|
|
402
|
-
e(
|
|
402
|
+
e(f) && k(V);
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
return N(X), N(A), Ee(A, (k) => I = k, () => I), H(() => {
|
|
@@ -419,14 +419,14 @@ ue(
|
|
|
419
419
|
[],
|
|
420
420
|
!0
|
|
421
421
|
);
|
|
422
|
-
var
|
|
422
|
+
var dr = F('<div class="track svelte-11a7nsg"><div class="progress svelte-11a7nsg"></div></div>'), fr = F('<div class="container svelte-11a7nsg"><!></div>');
|
|
423
423
|
const vr = {
|
|
424
424
|
hash: "svelte-11a7nsg",
|
|
425
425
|
code: ".container.svelte-11a7nsg {flex:1;display:flex;align-items:center;height:100%;}.track.svelte-11a7nsg {width:100%;background:var(--fortyfour-player-waveform-track-color);overflow:hidden;}.progress.svelte-11a7nsg {height:100%;background:var(--fortyfour-player-waveform-progress-color);transition:width 0.1s linear;}"
|
|
426
426
|
};
|
|
427
427
|
function zt(y, t) {
|
|
428
428
|
pe(t, !0), be(y, vr);
|
|
429
|
-
let
|
|
429
|
+
let g = u(t, "data", 7), i = u(t, "timeMs", 7, null), o = u(t, "lineWidth", 7, 4), r = q(0), a = q(!1), n = null;
|
|
430
430
|
Fe(() => {
|
|
431
431
|
const P = new ResizeObserver((b) => {
|
|
432
432
|
for (let j of b)
|
|
@@ -437,16 +437,16 @@ function zt(y, t) {
|
|
|
437
437
|
};
|
|
438
438
|
});
|
|
439
439
|
const s = 100, _ = W(() => {
|
|
440
|
-
if (i() === null || i() === 0 || !
|
|
441
|
-
const P =
|
|
440
|
+
if (i() === null || i() === 0 || !g().length) return 0;
|
|
441
|
+
const P = g().length * s;
|
|
442
442
|
return Math.min(100, i() / P * 100);
|
|
443
443
|
});
|
|
444
|
-
var
|
|
444
|
+
var f = {
|
|
445
445
|
get data() {
|
|
446
|
-
return
|
|
446
|
+
return g();
|
|
447
447
|
},
|
|
448
448
|
set data(P) {
|
|
449
|
-
|
|
449
|
+
g(P), c();
|
|
450
450
|
},
|
|
451
451
|
get timeMs() {
|
|
452
452
|
return i();
|
|
@@ -460,19 +460,19 @@ function zt(y, t) {
|
|
|
460
460
|
set lineWidth(P = 4) {
|
|
461
461
|
o(P), c();
|
|
462
462
|
}
|
|
463
|
-
}, I =
|
|
463
|
+
}, I = fr(), d = G(I);
|
|
464
464
|
{
|
|
465
465
|
var l = (P) => {
|
|
466
|
-
var b =
|
|
466
|
+
var b = dr(), j = G(b);
|
|
467
467
|
N(b), H(() => {
|
|
468
468
|
Le(b, `height: ${o() ?? ""}px; border-radius: ${o() / 2}px`), Le(j, `width: ${e(_) ?? ""}%; border-radius: ${o() / 2}px`);
|
|
469
469
|
}), x(P, b);
|
|
470
470
|
};
|
|
471
|
-
K(
|
|
471
|
+
K(d, (P) => {
|
|
472
472
|
e(a) && P(l);
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
|
-
return N(I), Ee(I, (P) => n = P, () => n), x(y, I), ge(
|
|
475
|
+
return N(I), Ee(I, (P) => n = P, () => n), x(y, I), ge(f);
|
|
476
476
|
}
|
|
477
477
|
ue(zt, { data: {}, timeMs: {}, lineWidth: {} }, [], [], !0);
|
|
478
478
|
var pr = Me('<path class="waveform-line progress svelte-189wzd8"></path>'), gr = Me('<path class="waveform-line track svelte-189wzd8"></path><!>', 1), yr = F('<div class="container svelte-189wzd8"><svg width="100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" preserveAspectRatio="none" class="svelte-189wzd8"><!></svg></div>');
|
|
@@ -482,13 +482,13 @@ const hr = {
|
|
|
482
482
|
};
|
|
483
483
|
function Pt(y, t) {
|
|
484
484
|
pe(t, !0), be(y, hr);
|
|
485
|
-
function
|
|
486
|
-
const z = L.length / M,
|
|
485
|
+
function g(L, M) {
|
|
486
|
+
const z = L.length / M, v = [];
|
|
487
487
|
for (let E = 0; E < M; E++) {
|
|
488
|
-
const Q = Math.floor(E * z), oe = Math.floor((E + 1) * z), w = L.slice(Q, Math.max(Q + 1, oe)), h = w.reduce((S, O) => S + O * O, 0),
|
|
489
|
-
|
|
488
|
+
const Q = Math.floor(E * z), oe = Math.floor((E + 1) * z), w = L.slice(Q, Math.max(Q + 1, oe)), h = w.reduce((S, O) => S + O * O, 0), p = Math.sqrt(h / w.length);
|
|
489
|
+
v.push(p);
|
|
490
490
|
}
|
|
491
|
-
return
|
|
491
|
+
return v;
|
|
492
492
|
}
|
|
493
493
|
let i = u(t, "data", 7), o = u(t, "timeMs", 7, null), r = u(t, "lineWidth", 7, 2), a = q(0), n = q(56), s = q(!1), _ = null;
|
|
494
494
|
Fe(() => {
|
|
@@ -500,15 +500,15 @@ function Pt(y, t) {
|
|
|
500
500
|
L.disconnect();
|
|
501
501
|
};
|
|
502
502
|
});
|
|
503
|
-
const
|
|
503
|
+
const f = W(() => e(n) / 2), I = W(() => e(n) / 2 * 0.8), d = 100, l = 0.15, P = W(() => Math.max(2, Math.floor(e(a) * l))), b = W(() => g(i(), e(P))), j = W(() => {
|
|
504
504
|
if (o() === null || o() === 0) return 0;
|
|
505
|
-
const L = i().length *
|
|
506
|
-
return z + M *
|
|
505
|
+
const L = i().length * d, M = Math.min(1, o() / L), z = r() / 2, v = e(a) - z * 2;
|
|
506
|
+
return z + M * v;
|
|
507
507
|
}), C = W(() => {
|
|
508
508
|
if (!e(b).length || e(a) === 0) return [];
|
|
509
509
|
const L = r() / 2, M = e(a) - L * 2;
|
|
510
|
-
return e(b).map((z,
|
|
511
|
-
const E = L +
|
|
510
|
+
return e(b).map((z, v) => {
|
|
511
|
+
const E = L + v / (e(b).length - 1) * M, Q = Math.max(0.05, z / 100), oe = v % 2 === 0 ? -1 : 1, w = e(f) + oe * Q * e(I);
|
|
512
512
|
return { x: E, y: w };
|
|
513
513
|
});
|
|
514
514
|
});
|
|
@@ -516,7 +516,7 @@ function Pt(y, t) {
|
|
|
516
516
|
if (L.length === 0) return "";
|
|
517
517
|
let M = `M ${L[0].x} ${L[0].y}`;
|
|
518
518
|
for (let z = 1; z < L.length; z++) {
|
|
519
|
-
const
|
|
519
|
+
const v = L[z - 1], E = L[z], Q = v.x + (E.x - v.x) / 3, oe = v.y, w = v.x + (E.x - v.x) * 2 / 3, h = E.y;
|
|
520
520
|
M += ` C ${Q} ${oe}, ${w} ${h}, ${E.x} ${E.y}`;
|
|
521
521
|
}
|
|
522
522
|
return M;
|
|
@@ -525,17 +525,17 @@ function Pt(y, t) {
|
|
|
525
525
|
if (e(C).length === 0 || e(j) <= 0) return "";
|
|
526
526
|
const L = [];
|
|
527
527
|
let M = null;
|
|
528
|
-
for (let
|
|
529
|
-
if (e(C)[
|
|
530
|
-
L.push(e(C)[
|
|
528
|
+
for (let v = 0; v < e(C).length; v++)
|
|
529
|
+
if (e(C)[v].x <= e(j))
|
|
530
|
+
L.push(e(C)[v]);
|
|
531
531
|
else {
|
|
532
|
-
M = e(C)[
|
|
532
|
+
M = e(C)[v];
|
|
533
533
|
break;
|
|
534
534
|
}
|
|
535
535
|
if (L.length === 0) return "";
|
|
536
536
|
const z = L[L.length - 1];
|
|
537
537
|
if (M && z.x < e(j)) {
|
|
538
|
-
const
|
|
538
|
+
const v = (e(j) - z.x) / (M.x - z.x), E = z.y + v * (M.y - z.y);
|
|
539
539
|
L.push({ x: e(j), y: E });
|
|
540
540
|
}
|
|
541
541
|
return B(L);
|
|
@@ -562,7 +562,7 @@ function Pt(y, t) {
|
|
|
562
562
|
}, V = yr(), k = G(V), D = G(k);
|
|
563
563
|
{
|
|
564
564
|
var T = (L) => {
|
|
565
|
-
var M = gr(), z = J(M),
|
|
565
|
+
var M = gr(), z = J(M), v = ye(z);
|
|
566
566
|
{
|
|
567
567
|
var E = (Q) => {
|
|
568
568
|
var oe = pr();
|
|
@@ -570,7 +570,7 @@ function Pt(y, t) {
|
|
|
570
570
|
Z(oe, "d", e(X)), Z(oe, "stroke-width", r());
|
|
571
571
|
}), x(Q, oe);
|
|
572
572
|
};
|
|
573
|
-
K(
|
|
573
|
+
K(v, (Q) => {
|
|
574
574
|
e(X) && Q(E);
|
|
575
575
|
});
|
|
576
576
|
}
|
|
@@ -594,7 +594,7 @@ const xr = {
|
|
|
594
594
|
};
|
|
595
595
|
function _r(y, t) {
|
|
596
596
|
pe(t, !0), be(y, xr);
|
|
597
|
-
const
|
|
597
|
+
const g = (R, V = Qe, k = Qe) => {
|
|
598
598
|
var D = ee(), T = J(D);
|
|
599
599
|
{
|
|
600
600
|
var L = (z) => {
|
|
@@ -610,7 +610,7 @@ function _r(y, t) {
|
|
|
610
610
|
}
|
|
611
611
|
});
|
|
612
612
|
}, M = (z) => {
|
|
613
|
-
var
|
|
613
|
+
var v = ee(), E = J(v);
|
|
614
614
|
{
|
|
615
615
|
var Q = (w) => {
|
|
616
616
|
Pt(w, {
|
|
@@ -651,7 +651,7 @@ function _r(y, t) {
|
|
|
651
651
|
!0
|
|
652
652
|
);
|
|
653
653
|
}
|
|
654
|
-
x(z,
|
|
654
|
+
x(z, v);
|
|
655
655
|
};
|
|
656
656
|
K(T, (z) => {
|
|
657
657
|
r() === "progress" ? z(L) : z(M, !1);
|
|
@@ -659,8 +659,8 @@ function _r(y, t) {
|
|
|
659
659
|
}
|
|
660
660
|
x(R, D);
|
|
661
661
|
}, i = t.$$host;
|
|
662
|
-
let o = u(t, "for", 7, ""), r = u(t, "type", 7, "bars"), a = u(t, "barWidth", 7, 3), n = u(t, "barSpacing", 7, 1), s = u(t, "lineWidth", 7, 4), _ = u(t, "barMinHeight", 7, 3),
|
|
663
|
-
const l = it(() => e(
|
|
662
|
+
let o = u(t, "for", 7, ""), r = u(t, "type", 7, "bars"), a = u(t, "barWidth", 7, 3), n = u(t, "barSpacing", 7, 1), s = u(t, "lineWidth", 7, 4), _ = u(t, "barMinHeight", 7, 3), f = q(null), I = q(0), d = q("none");
|
|
663
|
+
const l = it(() => e(f) === null, 200), P = W(() => e(f) !== null && e(f).length > 0 ? !1 : e(d) === "none" ? !0 : l());
|
|
664
664
|
me(() => {
|
|
665
665
|
if (!o()) {
|
|
666
666
|
console.warn("fortyfour-player-waveform: 'for' attribute is required to link to a player");
|
|
@@ -671,9 +671,9 @@ function _r(y, t) {
|
|
|
671
671
|
console.warn(`fortyfour-player-waveform: No player found with id '${o()}'`);
|
|
672
672
|
return;
|
|
673
673
|
}
|
|
674
|
-
m(
|
|
674
|
+
m(d, R.getAttribute("preload") || "none", !0), R.waveform && R.waveform.length > 0 && m(f, R.waveform, !0), R.currentTime && m(I, R.currentTime, !0);
|
|
675
675
|
function V(D) {
|
|
676
|
-
m(
|
|
676
|
+
m(f, D.detail?.waveform, !0);
|
|
677
677
|
}
|
|
678
678
|
function k(D) {
|
|
679
679
|
m(I, D.detail.currentTime, !0);
|
|
@@ -724,15 +724,15 @@ function _r(y, t) {
|
|
|
724
724
|
{
|
|
725
725
|
var A = (R) => {
|
|
726
726
|
var V = mr(), k = G(V);
|
|
727
|
-
|
|
727
|
+
g(k, () => e(f), () => e(I)), N(V), ze(1, V, () => Pe, () => ({ duration: 400 })), x(R, V);
|
|
728
728
|
}, X = (R) => {
|
|
729
729
|
var V = ee(), k = J(V);
|
|
730
730
|
{
|
|
731
731
|
var D = (T) => {
|
|
732
732
|
var L = ee(), M = J(L);
|
|
733
733
|
Ce(M, t, "placeholder", {}, (z) => {
|
|
734
|
-
var
|
|
735
|
-
|
|
734
|
+
var v = br(), E = G(v);
|
|
735
|
+
g(E, () => b, () => 0), N(v), x(z, v);
|
|
736
736
|
}), x(T, L);
|
|
737
737
|
};
|
|
738
738
|
K(
|
|
@@ -746,7 +746,7 @@ function _r(y, t) {
|
|
|
746
746
|
x(R, V);
|
|
747
747
|
};
|
|
748
748
|
K(B, (R) => {
|
|
749
|
-
e(
|
|
749
|
+
e(f) && e(f).length > 0 ? R(A) : R(X, !1);
|
|
750
750
|
});
|
|
751
751
|
}
|
|
752
752
|
return N(C), x(y, C), ge(j);
|
|
@@ -773,25 +773,25 @@ const Nr = {
|
|
|
773
773
|
};
|
|
774
774
|
function Dr(y, t) {
|
|
775
775
|
pe(t, !0), be(y, Nr);
|
|
776
|
-
const
|
|
777
|
-
let i = u(t, "for", 7, ""), o = u(t, "truncate", 7, 200), r = u(t, "mode", 7, "static"), a = q(null), n = q(null), s = q(null), _ = q(!1),
|
|
778
|
-
const l = it(() => e(a) === null, 200), P = W(() => e(a) !== null ? !1 : e(I) === "none" ? !0 : l()), b = W(() => e(_) && e(n) ? e(n) : e(a)), j = W(() => r() === "static" && o() > 0 && e(b) && e(b).length > o()), C = W(() => e(b) ? e(j) && !e(
|
|
776
|
+
const g = t.$$host;
|
|
777
|
+
let i = u(t, "for", 7, ""), o = u(t, "truncate", 7, 200), r = u(t, "mode", 7, "static"), a = q(null), n = q(null), s = q(null), _ = q(!1), f = q(!1), I = q("none"), d = q(0);
|
|
778
|
+
const l = it(() => e(a) === null, 200), P = W(() => e(a) !== null ? !1 : e(I) === "none" ? !0 : l()), b = W(() => e(_) && e(n) ? e(n) : e(a)), j = W(() => r() === "static" && o() > 0 && e(b) && e(b).length > o()), C = W(() => e(b) ? e(j) && !e(f) ? e(b).slice(0, o()) : e(b) : ""), B = W(() => e(n) !== null && e(n) !== ""), A = W(() => e(s) !== null && e(s).length > 0), X = W(() => !e(A) || r() === "static" ? -1 : e(s).findIndex((w) => e(d) >= w.start && e(d) <= w.end));
|
|
779
779
|
function R(w) {
|
|
780
780
|
const h = [];
|
|
781
|
-
let
|
|
781
|
+
let p = { words: [], start: 0, end: 0 };
|
|
782
782
|
for (const S of w) {
|
|
783
|
-
|
|
783
|
+
p.words.length === 0 && (p.start = S.start), p.words.push(S), p.end = S.end;
|
|
784
784
|
const O = S.text.trim();
|
|
785
|
-
(O.endsWith(".") || O.endsWith("?") || O.endsWith("!")) && (h.push(
|
|
785
|
+
(O.endsWith(".") || O.endsWith("?") || O.endsWith("!")) && (h.push(p), p = { words: [], start: 0, end: 0 });
|
|
786
786
|
}
|
|
787
|
-
return
|
|
787
|
+
return p.words.length > 0 && h.push(p), h;
|
|
788
788
|
}
|
|
789
|
-
const V = W(() => e(A) ? R(e(s)) : []), k = W(() => r() !== "subtitle" || e(V).length === 0 ? null : e(V).find((w) => e(
|
|
789
|
+
const V = W(() => e(A) ? R(e(s)) : []), k = W(() => r() !== "subtitle" || e(V).length === 0 ? null : e(V).find((w) => e(d) >= w.start && e(d) <= w.end) ?? null);
|
|
790
790
|
function D(w) {
|
|
791
|
-
return e(
|
|
791
|
+
return e(d) >= w.start && e(d) <= w.end;
|
|
792
792
|
}
|
|
793
793
|
function T(w) {
|
|
794
|
-
return e(
|
|
794
|
+
return e(d) > w.end;
|
|
795
795
|
}
|
|
796
796
|
me(() => {
|
|
797
797
|
if (!i()) {
|
|
@@ -803,17 +803,17 @@ function Dr(y, t) {
|
|
|
803
803
|
console.warn(`fortyfour-player-transcription: No player found with id '${i()}'`);
|
|
804
804
|
return;
|
|
805
805
|
}
|
|
806
|
-
m(I, w.getAttribute("preload") || "none", !0), w.transcription && m(a, w.transcription, !0), w.translation && m(n, w.translation, !0), w.words && m(s, w.words, !0), w.currentTime && m(
|
|
806
|
+
m(I, w.getAttribute("preload") || "none", !0), w.transcription && m(a, w.transcription, !0), w.translation && m(n, w.translation, !0), w.words && m(s, w.words, !0), w.currentTime && m(d, w.currentTime, !0);
|
|
807
807
|
function h(S) {
|
|
808
808
|
m(a, S.detail?.transcription ?? null, !0), m(n, S.detail?.translation ?? null, !0), m(s, S.detail?.words ?? null, !0);
|
|
809
809
|
}
|
|
810
|
-
function
|
|
811
|
-
m(
|
|
810
|
+
function p(S) {
|
|
811
|
+
m(d, S.detail.currentTime, !0);
|
|
812
812
|
}
|
|
813
|
-
return w.addEventListener("loadedmetadata", h), w.addEventListener("timeupdate",
|
|
814
|
-
w.removeEventListener("loadedmetadata", h), w.removeEventListener("timeupdate",
|
|
813
|
+
return w.addEventListener("loadedmetadata", h), w.addEventListener("timeupdate", p), () => {
|
|
814
|
+
w.removeEventListener("loadedmetadata", h), w.removeEventListener("timeupdate", p);
|
|
815
815
|
};
|
|
816
|
-
}), lt(
|
|
816
|
+
}), lt(g, "data-placeholder", () => e(P));
|
|
817
817
|
var L = {
|
|
818
818
|
get for() {
|
|
819
819
|
return i();
|
|
@@ -835,35 +835,35 @@ function Dr(y, t) {
|
|
|
835
835
|
}
|
|
836
836
|
}, M = qr(), z = G(M);
|
|
837
837
|
{
|
|
838
|
-
var
|
|
839
|
-
var h = zr(),
|
|
840
|
-
|
|
841
|
-
var S = G(
|
|
838
|
+
var v = (w) => {
|
|
839
|
+
var h = zr(), p = G(h);
|
|
840
|
+
p.__change = [kr, _];
|
|
841
|
+
var S = G(p);
|
|
842
842
|
S.value = S.__value = "original";
|
|
843
843
|
var O = ye(S);
|
|
844
|
-
O.value = O.__value = "en", N(
|
|
844
|
+
O.value = O.__value = "en", N(p), N(h), x(w, h);
|
|
845
845
|
};
|
|
846
846
|
K(z, (w) => {
|
|
847
|
-
e(B) && w(
|
|
847
|
+
e(B) && w(v);
|
|
848
848
|
});
|
|
849
849
|
}
|
|
850
850
|
var E = ye(z, 2);
|
|
851
851
|
{
|
|
852
852
|
var Q = (w) => {
|
|
853
|
-
var h = Pr(),
|
|
854
|
-
N(
|
|
853
|
+
var h = Pr(), p = G(h), S = G(p, !0);
|
|
854
|
+
N(p), N(h), H(() => je(S, e(n))), ze(1, h, () => Pe, () => ({ duration: 400 })), x(w, h);
|
|
855
855
|
}, oe = (w) => {
|
|
856
|
-
var h = ee(),
|
|
856
|
+
var h = ee(), p = J(h);
|
|
857
857
|
{
|
|
858
858
|
var S = ($) => {
|
|
859
859
|
var Y = jr(), ce = G(Y);
|
|
860
860
|
Be(ce, 21, () => e(s), Ae, (U, re, ne) => {
|
|
861
861
|
var ie = Lr();
|
|
862
862
|
let ve;
|
|
863
|
-
var
|
|
863
|
+
var de = G(ie, !0);
|
|
864
864
|
N(ie), H(
|
|
865
865
|
(ae) => {
|
|
866
|
-
ve =
|
|
866
|
+
ve = fe(ie, 1, "word svelte-1cjx9l7", null, ve, ae), Z(ie, "data-type", e(re).type), je(de, e(re).text);
|
|
867
867
|
},
|
|
868
868
|
[
|
|
869
869
|
() => ({
|
|
@@ -879,7 +879,7 @@ function Dr(y, t) {
|
|
|
879
879
|
var U = (ne) => {
|
|
880
880
|
var ie = Mr(), ve = G(ie);
|
|
881
881
|
{
|
|
882
|
-
var
|
|
882
|
+
var de = (ae) => {
|
|
883
883
|
var he = Er();
|
|
884
884
|
Be(he, 21, () => e(k).words, Ae, (le, se) => {
|
|
885
885
|
var xe = Ir();
|
|
@@ -887,7 +887,7 @@ function Dr(y, t) {
|
|
|
887
887
|
var we = G(xe, !0);
|
|
888
888
|
N(xe), H(
|
|
889
889
|
(ke) => {
|
|
890
|
-
_e =
|
|
890
|
+
_e = fe(xe, 1, "word svelte-1cjx9l7", null, _e, ke), Z(xe, "data-type", e(se).type), je(we, e(se).text);
|
|
891
891
|
},
|
|
892
892
|
[
|
|
893
893
|
() => ({
|
|
@@ -899,14 +899,14 @@ function Dr(y, t) {
|
|
|
899
899
|
}), N(he), ze(1, he, () => Pe, () => ({ duration: 200 })), x(ae, he);
|
|
900
900
|
};
|
|
901
901
|
K(ve, (ae) => {
|
|
902
|
-
e(k) && ae(
|
|
902
|
+
e(k) && ae(de);
|
|
903
903
|
});
|
|
904
904
|
}
|
|
905
905
|
N(ie), x(ne, ie);
|
|
906
906
|
}, re = (ne) => {
|
|
907
907
|
var ie = ee(), ve = J(ie);
|
|
908
908
|
{
|
|
909
|
-
var
|
|
909
|
+
var de = (he) => {
|
|
910
910
|
var le = Tr(), se = G(le);
|
|
911
911
|
Be(se, 21, () => e(s), Ae, (xe, _e, we) => {
|
|
912
912
|
var ke = ee(), Se = J(ke);
|
|
@@ -917,13 +917,13 @@ function Dr(y, t) {
|
|
|
917
917
|
var We = G(Te, !0);
|
|
918
918
|
N(Te), H(
|
|
919
919
|
(qe) => {
|
|
920
|
-
Ke =
|
|
920
|
+
Ke = fe(Te, 1, "word svelte-1cjx9l7", null, Ke, qe), Z(Te, "data-type", e(_e).type), je(We, e(_e).text);
|
|
921
921
|
},
|
|
922
922
|
[() => ({ active: we === e(X) })]
|
|
923
923
|
), ze(1, Te, () => Pe, () => ({ duration: 150 })), x(Re, Te);
|
|
924
924
|
};
|
|
925
925
|
K(Se, (Re) => {
|
|
926
|
-
e(
|
|
926
|
+
e(d) >= e(_e).start && Re(He);
|
|
927
927
|
});
|
|
928
928
|
}
|
|
929
929
|
x(xe, ke);
|
|
@@ -936,18 +936,18 @@ function Dr(y, t) {
|
|
|
936
936
|
{
|
|
937
937
|
var Te = (We) => {
|
|
938
938
|
var qe = Cr(), Ze = ye(J(qe));
|
|
939
|
-
Ze.__click = [Rr,
|
|
939
|
+
Ze.__click = [Rr, f], x(We, qe);
|
|
940
940
|
}, Ke = (We) => {
|
|
941
941
|
var qe = ee(), Ze = J(qe);
|
|
942
942
|
{
|
|
943
943
|
var Ht = (Je) => {
|
|
944
944
|
var vt = Wr();
|
|
945
|
-
vt.__click = [Hr,
|
|
945
|
+
vt.__click = [Hr, f], x(Je, vt);
|
|
946
946
|
};
|
|
947
947
|
K(
|
|
948
948
|
Ze,
|
|
949
949
|
(Je) => {
|
|
950
|
-
e(j) && e(
|
|
950
|
+
e(j) && e(f) && Je(Ht);
|
|
951
951
|
},
|
|
952
952
|
!0
|
|
953
953
|
);
|
|
@@ -955,7 +955,7 @@ function Dr(y, t) {
|
|
|
955
955
|
x(We, qe);
|
|
956
956
|
};
|
|
957
957
|
K(Re, (We) => {
|
|
958
|
-
e(j) && !e(
|
|
958
|
+
e(j) && !e(f) ? We(Te) : We(Ke, !1);
|
|
959
959
|
});
|
|
960
960
|
}
|
|
961
961
|
N(Se), N(ke), H(() => je(He, e(C))), ze(1, ke, () => Pe, () => ({ duration: 400 })), x(we, ke);
|
|
@@ -989,7 +989,7 @@ function Dr(y, t) {
|
|
|
989
989
|
K(
|
|
990
990
|
ve,
|
|
991
991
|
(he) => {
|
|
992
|
-
r() === "progressive" && e(A) ? he(
|
|
992
|
+
r() === "progressive" && e(A) ? he(de) : he(ae, !1);
|
|
993
993
|
},
|
|
994
994
|
!0
|
|
995
995
|
);
|
|
@@ -1007,7 +1007,7 @@ function Dr(y, t) {
|
|
|
1007
1007
|
x($, Y);
|
|
1008
1008
|
};
|
|
1009
1009
|
K(
|
|
1010
|
-
|
|
1010
|
+
p,
|
|
1011
1011
|
($) => {
|
|
1012
1012
|
r() === "karaoke" && e(A) ? $(S) : $(O, !1);
|
|
1013
1013
|
},
|
|
@@ -1041,22 +1041,22 @@ typeof window < "u" && (window.__44_dev = et);
|
|
|
1041
1041
|
function Or(y) {
|
|
1042
1042
|
return new Promise((t) => setTimeout(t, y));
|
|
1043
1043
|
}
|
|
1044
|
-
async function Ur(y, t,
|
|
1045
|
-
const i = `https://${t}/v1/recordings/${
|
|
1044
|
+
async function Ur(y, t, g) {
|
|
1045
|
+
const i = `https://${t}/v1/recordings/${g}/player`;
|
|
1046
1046
|
et.delay > 0 && await Or(et.delay);
|
|
1047
1047
|
const o = await fetch(i, { signal: y });
|
|
1048
1048
|
if (!o.ok)
|
|
1049
|
-
throw o.status === 404 ? new Error(`Recording not found: ${
|
|
1049
|
+
throw o.status === 404 ? new Error(`Recording not found: ${g}`) : new Error(`Failed to fetch recording (${o.status})`);
|
|
1050
1050
|
const r = await o.json();
|
|
1051
1051
|
if (r.status !== "ready")
|
|
1052
|
-
throw new Error(`Recording not ready: ${
|
|
1052
|
+
throw new Error(`Recording not ready: ${g}`);
|
|
1053
1053
|
return r;
|
|
1054
1054
|
}
|
|
1055
1055
|
var Fr = F("<audio hidden></audio>");
|
|
1056
1056
|
function Gr(y, t) {
|
|
1057
1057
|
pe(t, !0);
|
|
1058
|
-
const
|
|
1059
|
-
let i = u(t, "recordingId", 7), o = u(t, "apiHost", 7, "api.44.audio"), r = u(t, "preload", 7, "none"), a = q(null), n = q(null), s = q(0), _ = q(0),
|
|
1058
|
+
const g = t.$$host;
|
|
1059
|
+
let i = u(t, "recordingId", 7), o = u(t, "apiHost", 7, "api.44.audio"), r = u(t, "preload", 7, "none"), a = q(null), n = q(null), s = q(0), _ = q(0), f = q("idle"), I = null, d = null;
|
|
1060
1060
|
const l = W(() => ({
|
|
1061
1061
|
waveform: e(a)?.waveform ?? [],
|
|
1062
1062
|
transcription: e(a)?.transcription ?? null,
|
|
@@ -1064,32 +1064,32 @@ function Gr(y, t) {
|
|
|
1064
1064
|
words: e(a)?.words ?? null
|
|
1065
1065
|
}));
|
|
1066
1066
|
function P() {
|
|
1067
|
-
|
|
1067
|
+
g.duration = e(_), g.currentTime = e(s), g.state = e(f), g.metadata = e(l), g.setAttribute("data-state", e(f));
|
|
1068
1068
|
}
|
|
1069
|
-
function b(
|
|
1070
|
-
P(),
|
|
1069
|
+
function b(v) {
|
|
1070
|
+
P(), g.dispatchEvent(new CustomEvent(v, { bubbles: !0, composed: !0 }));
|
|
1071
1071
|
}
|
|
1072
1072
|
function j() {
|
|
1073
1073
|
if (!e(n)) {
|
|
1074
|
-
|
|
1074
|
+
d = null;
|
|
1075
1075
|
return;
|
|
1076
1076
|
}
|
|
1077
|
-
m(s, Math.floor(e(n).currentTime * 1e3), !0), b("timeupdate"),
|
|
1077
|
+
m(s, Math.floor(e(n).currentTime * 1e3), !0), b("timeupdate"), d = requestAnimationFrame(j);
|
|
1078
1078
|
}
|
|
1079
1079
|
async function C() {
|
|
1080
|
-
if (e(
|
|
1080
|
+
if (e(f) === "idle") {
|
|
1081
1081
|
if (!i()) {
|
|
1082
1082
|
console.warn("fortyfour-recording: recording-id attribute is required");
|
|
1083
1083
|
return;
|
|
1084
1084
|
}
|
|
1085
|
-
I = new AbortController(), m(
|
|
1085
|
+
I = new AbortController(), m(f, "loading"), b("loading");
|
|
1086
1086
|
try {
|
|
1087
|
-
const
|
|
1088
|
-
m(a,
|
|
1089
|
-
} catch (
|
|
1090
|
-
if (
|
|
1087
|
+
const v = await Ur(I.signal, o(), i());
|
|
1088
|
+
m(a, v, !0), m(_, v.duration, !0), m(f, "ready"), b("loadedmetadata");
|
|
1089
|
+
} catch (v) {
|
|
1090
|
+
if (v.name === "AbortError")
|
|
1091
1091
|
return;
|
|
1092
|
-
console.warn(`fortyfour-recording: ${
|
|
1092
|
+
console.warn(`fortyfour-recording: ${v.message}`), m(f, "error"), b("error");
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
@@ -1099,9 +1099,9 @@ function Gr(y, t) {
|
|
|
1099
1099
|
return;
|
|
1100
1100
|
}
|
|
1101
1101
|
try {
|
|
1102
|
-
await e(n).play(), m(
|
|
1103
|
-
} catch {
|
|
1104
|
-
m(
|
|
1102
|
+
await e(n).play(), m(f, "playing"), b("play"), d || j();
|
|
1103
|
+
} catch (v) {
|
|
1104
|
+
console.warn(`fortyfour-recording: ${v.message}`), m(f, "error"), b("error");
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
1107
|
function A() {
|
|
@@ -1109,71 +1109,71 @@ function Gr(y, t) {
|
|
|
1109
1109
|
console.warn("fortyfour-recording: pause() called but audio element not ready");
|
|
1110
1110
|
return;
|
|
1111
1111
|
}
|
|
1112
|
-
e(n).pause(), m(
|
|
1112
|
+
e(n).pause(), m(f, "paused"), cancelAnimationFrame(d), d = null, b("pause");
|
|
1113
1113
|
}
|
|
1114
1114
|
async function X() {
|
|
1115
|
-
if (e(
|
|
1115
|
+
if (e(f) === "error") {
|
|
1116
1116
|
console.warn("fortyfour-recording: togglePlay() called while in error state");
|
|
1117
1117
|
return;
|
|
1118
1118
|
}
|
|
1119
|
-
e(
|
|
1119
|
+
e(f) !== "loading" && (e(f) === "playing" ? A() : e(f) === "idle" ? (await C(), await gt(), e(f) === "ready" && await B()) : await B());
|
|
1120
1120
|
}
|
|
1121
|
-
function R(
|
|
1121
|
+
function R(v) {
|
|
1122
1122
|
if (!e(n)) {
|
|
1123
1123
|
console.warn("fortyfour-recording: seek() called but audio element not ready");
|
|
1124
1124
|
return;
|
|
1125
1125
|
}
|
|
1126
|
-
if (typeof
|
|
1127
|
-
console.warn("fortyfour-recording: seek() called with invalid time:",
|
|
1126
|
+
if (typeof v != "number" || Number.isNaN(v)) {
|
|
1127
|
+
console.warn("fortyfour-recording: seek() called with invalid time:", v);
|
|
1128
1128
|
return;
|
|
1129
1129
|
}
|
|
1130
|
-
if (
|
|
1131
|
-
console.warn("fortyfour-recording: seek() time out of range:",
|
|
1130
|
+
if (v < 0 || v > e(_)) {
|
|
1131
|
+
console.warn("fortyfour-recording: seek() time out of range:", v, "duration:", e(_));
|
|
1132
1132
|
return;
|
|
1133
1133
|
}
|
|
1134
|
-
e(n).currentTime =
|
|
1134
|
+
e(n).currentTime = v / 1e3, m(s, Math.floor(v), !0), b("timeupdate");
|
|
1135
1135
|
}
|
|
1136
1136
|
async function V() {
|
|
1137
|
-
cancelAnimationFrame(
|
|
1137
|
+
cancelAnimationFrame(d), d = null, m(s, e(_), !0), b("timeupdate"), await gt(), m(s, 0), e(n).currentTime = 0, b("timeupdate"), m(f, "ready"), b("ended");
|
|
1138
1138
|
}
|
|
1139
|
-
function k() {
|
|
1140
|
-
m(
|
|
1139
|
+
function k(v) {
|
|
1140
|
+
console.warn("fortyfour-recording: audio error", v.target.error), m(f, "error"), b("error");
|
|
1141
1141
|
}
|
|
1142
1142
|
function D() {
|
|
1143
|
-
I?.abort(), cancelAnimationFrame(
|
|
1143
|
+
I?.abort(), cancelAnimationFrame(d), d = null, e(n)?.pause(), m(a, null), m(s, 0), m(_, 0), m(f, "idle"), T = i(), b("timeupdate");
|
|
1144
1144
|
}
|
|
1145
1145
|
let T = i();
|
|
1146
1146
|
me(() => {
|
|
1147
|
-
i() !== T && D(), e(
|
|
1148
|
-
}),
|
|
1149
|
-
I?.abort(), e(n)?.pause(), cancelAnimationFrame(
|
|
1147
|
+
i() !== T && D(), e(f) === "idle" && (r() === "auto" || r() === "metadata") && C();
|
|
1148
|
+
}), g.togglePlay = X, g.seek = R, P(), Ot(() => {
|
|
1149
|
+
I?.abort(), e(n)?.pause(), cancelAnimationFrame(d);
|
|
1150
1150
|
});
|
|
1151
1151
|
var L = {
|
|
1152
1152
|
get recordingId() {
|
|
1153
1153
|
return i();
|
|
1154
1154
|
},
|
|
1155
|
-
set recordingId(
|
|
1156
|
-
i(
|
|
1155
|
+
set recordingId(v) {
|
|
1156
|
+
i(v), c();
|
|
1157
1157
|
},
|
|
1158
1158
|
get apiHost() {
|
|
1159
1159
|
return o();
|
|
1160
1160
|
},
|
|
1161
|
-
set apiHost(
|
|
1162
|
-
o(
|
|
1161
|
+
set apiHost(v = "api.44.audio") {
|
|
1162
|
+
o(v), c();
|
|
1163
1163
|
},
|
|
1164
1164
|
get preload() {
|
|
1165
1165
|
return r();
|
|
1166
1166
|
},
|
|
1167
|
-
set preload(
|
|
1168
|
-
r(
|
|
1167
|
+
set preload(v = "none") {
|
|
1168
|
+
r(v), c();
|
|
1169
1169
|
}
|
|
1170
1170
|
}, M = ee(), z = J(M);
|
|
1171
|
-
return Gt(z, i, (
|
|
1171
|
+
return Gt(z, i, (v) => {
|
|
1172
1172
|
var E = ee(), Q = J(E);
|
|
1173
1173
|
{
|
|
1174
1174
|
var oe = (w) => {
|
|
1175
1175
|
var h = Fr();
|
|
1176
|
-
Ee(h, (
|
|
1176
|
+
Ee(h, (p) => m(n, p), () => e(n)), H(() => {
|
|
1177
1177
|
Z(h, "src", e(a).audioUrl), Z(h, "preload", r() === "auto" ? "auto" : "none");
|
|
1178
1178
|
}), Ie("ended", h, V), Ie("error", h, k), x(w, h);
|
|
1179
1179
|
};
|
|
@@ -1181,7 +1181,7 @@ function Gr(y, t) {
|
|
|
1181
1181
|
e(a)?.audioUrl && w(oe);
|
|
1182
1182
|
});
|
|
1183
1183
|
}
|
|
1184
|
-
x(
|
|
1184
|
+
x(v, E);
|
|
1185
1185
|
}), x(y, M), ge(L);
|
|
1186
1186
|
}
|
|
1187
1187
|
customElements.define("fortyfour-recording", ue(
|
|
@@ -1198,28 +1198,28 @@ customElements.define("fortyfour-recording", ue(
|
|
|
1198
1198
|
function De(y) {
|
|
1199
1199
|
if (isNaN(y) || y < 0)
|
|
1200
1200
|
return "-:--";
|
|
1201
|
-
const t = Math.floor(y / 3600),
|
|
1202
|
-
return t > 0 ? `${t}:${
|
|
1201
|
+
const t = Math.floor(y / 3600), g = Math.floor(y % 3600 / 60), i = y % 60;
|
|
1202
|
+
return t > 0 ? `${t}:${g.toString().padStart(2, "0")}:${i.toString().padStart(2, "0")}` : `${g}:${i.toString().padStart(2, "0")}`;
|
|
1203
1203
|
}
|
|
1204
1204
|
function ht(y) {
|
|
1205
1205
|
if (isNaN(y) || y < 0)
|
|
1206
1206
|
return "--";
|
|
1207
|
-
const t = Math.floor(y / 1e3),
|
|
1208
|
-
return
|
|
1207
|
+
const t = Math.floor(y / 1e3), g = Math.floor(t / 60), i = t % 60;
|
|
1208
|
+
return g > 0 ? `${g}m ${i}s` : `${i}s`;
|
|
1209
1209
|
}
|
|
1210
1210
|
function st(y, t = 200) {
|
|
1211
|
-
let
|
|
1211
|
+
let g = q(!1);
|
|
1212
1212
|
return me(() => {
|
|
1213
1213
|
if (y()) {
|
|
1214
|
-
const i = setTimeout(() => m(
|
|
1214
|
+
const i = setTimeout(() => m(g, !0), t);
|
|
1215
1215
|
return () => clearTimeout(i);
|
|
1216
1216
|
} else
|
|
1217
|
-
m(
|
|
1218
|
-
}), () => e(
|
|
1217
|
+
m(g, !1);
|
|
1218
|
+
}), () => e(g);
|
|
1219
1219
|
}
|
|
1220
|
-
function Oe(y, t,
|
|
1220
|
+
function Oe(y, t, g) {
|
|
1221
1221
|
me(() => {
|
|
1222
|
-
|
|
1222
|
+
g() ? y.setAttribute(t, "") : y.removeAttribute(t);
|
|
1223
1223
|
});
|
|
1224
1224
|
}
|
|
1225
1225
|
const Kr = {
|
|
@@ -1231,7 +1231,7 @@ const Kr = {
|
|
|
1231
1231
|
};
|
|
1232
1232
|
function Vr(y, t) {
|
|
1233
1233
|
pe(t, !0), be(y, Kr);
|
|
1234
|
-
const
|
|
1234
|
+
const g = t.$$host;
|
|
1235
1235
|
let i = u(t, "for", 7, ""), o = u(t, "format", 7, "elapsed/total"), r = q(0), a = q(0);
|
|
1236
1236
|
function n(P, b, j) {
|
|
1237
1237
|
const C = Math.floor(P / 1e3), B = Math.floor(b / 1e3), A = Math.max(0, B - C);
|
|
@@ -1272,12 +1272,12 @@ function Vr(y, t) {
|
|
|
1272
1272
|
return "0";
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
|
-
Oe(
|
|
1275
|
+
Oe(g, "data-placeholder", () => e(a) === 0), me(() => {
|
|
1276
1276
|
if (!i()) {
|
|
1277
1277
|
console.warn("fortyfour-duration: for attribute is required");
|
|
1278
1278
|
return;
|
|
1279
1279
|
}
|
|
1280
|
-
const b =
|
|
1280
|
+
const b = g.getRootNode().getElementById(i());
|
|
1281
1281
|
if (!b) {
|
|
1282
1282
|
console.warn(`fortyfour-duration: element with id "${i()}" not found`);
|
|
1283
1283
|
return;
|
|
@@ -1303,9 +1303,9 @@ function Vr(y, t) {
|
|
|
1303
1303
|
set format(P = "elapsed/total") {
|
|
1304
1304
|
o(P), c();
|
|
1305
1305
|
}
|
|
1306
|
-
},
|
|
1306
|
+
}, f = ee(), I = J(f);
|
|
1307
1307
|
{
|
|
1308
|
-
var
|
|
1308
|
+
var d = (P) => {
|
|
1309
1309
|
var b = yt();
|
|
1310
1310
|
H((j) => je(b, j), [
|
|
1311
1311
|
() => n(e(r), e(a), o())
|
|
@@ -1318,10 +1318,10 @@ function Vr(y, t) {
|
|
|
1318
1318
|
}), x(P, b);
|
|
1319
1319
|
};
|
|
1320
1320
|
K(I, (P) => {
|
|
1321
|
-
e(a) !== 0 ? P(
|
|
1321
|
+
e(a) !== 0 ? P(d) : P(l, !1);
|
|
1322
1322
|
});
|
|
1323
1323
|
}
|
|
1324
|
-
return x(y,
|
|
1324
|
+
return x(y, f), ge(_);
|
|
1325
1325
|
}
|
|
1326
1326
|
customElements.define("fortyfour-duration", ue(
|
|
1327
1327
|
Vr,
|
|
@@ -1344,14 +1344,14 @@ const Yr = {
|
|
|
1344
1344
|
};
|
|
1345
1345
|
function ut(y, t) {
|
|
1346
1346
|
pe(t, !0), be(y, Yr);
|
|
1347
|
-
let
|
|
1348
|
-
const i = W(() =>
|
|
1347
|
+
let g = u(t, "progress", 7, 0);
|
|
1348
|
+
const i = W(() => g() * 360);
|
|
1349
1349
|
var o = {
|
|
1350
1350
|
get progress() {
|
|
1351
|
-
return
|
|
1351
|
+
return g();
|
|
1352
1352
|
},
|
|
1353
1353
|
set progress(a = 0) {
|
|
1354
|
-
|
|
1354
|
+
g(a), c();
|
|
1355
1355
|
}
|
|
1356
1356
|
}, r = Xr();
|
|
1357
1357
|
return H(() => Le(r, `--progress-deg: ${e(i) ?? ""}deg`)), x(y, r), ge(o);
|
|
@@ -1405,12 +1405,12 @@ const ea = {
|
|
|
1405
1405
|
};
|
|
1406
1406
|
function ct(y, t) {
|
|
1407
1407
|
pe(t, !0), be(y, ea);
|
|
1408
|
-
let
|
|
1408
|
+
let g = u(t, "isPlaying", 7, !1), i = u(t, "amplitude", 7, 0), o = u(t, "intensity", 7, 1), r = q(Xe({ small: !1, medium: !1, large: !1 }));
|
|
1409
1409
|
function a(j) {
|
|
1410
1410
|
return j < 33 ? "small" : j < 66 ? "medium" : "large";
|
|
1411
1411
|
}
|
|
1412
1412
|
me(() => {
|
|
1413
|
-
if (!
|
|
1413
|
+
if (!g()) {
|
|
1414
1414
|
m(r, { small: !1, medium: !1, large: !1 }, !0);
|
|
1415
1415
|
return;
|
|
1416
1416
|
}
|
|
@@ -1422,10 +1422,10 @@ function ct(y, t) {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
var s = {
|
|
1424
1424
|
get isPlaying() {
|
|
1425
|
-
return
|
|
1425
|
+
return g();
|
|
1426
1426
|
},
|
|
1427
1427
|
set isPlaying(j = !1) {
|
|
1428
|
-
|
|
1428
|
+
g(j), c();
|
|
1429
1429
|
},
|
|
1430
1430
|
get amplitude() {
|
|
1431
1431
|
return i();
|
|
@@ -1439,27 +1439,27 @@ function ct(y, t) {
|
|
|
1439
1439
|
set intensity(j = 1) {
|
|
1440
1440
|
o(j), c();
|
|
1441
1441
|
}
|
|
1442
|
-
}, _ = $r(),
|
|
1442
|
+
}, _ = $r(), f = J(_);
|
|
1443
1443
|
{
|
|
1444
1444
|
var I = (j) => {
|
|
1445
1445
|
var C = Zr();
|
|
1446
1446
|
H(() => Le(C, `--intensity: ${o() ?? ""};`)), Ie("animationend", C, () => n("small")), x(j, C);
|
|
1447
1447
|
};
|
|
1448
|
-
K(
|
|
1448
|
+
K(f, (j) => {
|
|
1449
1449
|
e(r).small && j(I);
|
|
1450
1450
|
});
|
|
1451
1451
|
}
|
|
1452
|
-
var
|
|
1452
|
+
var d = ye(f, 2);
|
|
1453
1453
|
{
|
|
1454
1454
|
var l = (j) => {
|
|
1455
1455
|
var C = Jr();
|
|
1456
1456
|
H(() => Le(C, `--intensity: ${o() ?? ""};`)), Ie("animationend", C, () => n("medium")), x(j, C);
|
|
1457
1457
|
};
|
|
1458
|
-
K(
|
|
1458
|
+
K(d, (j) => {
|
|
1459
1459
|
e(r).medium && j(l);
|
|
1460
1460
|
});
|
|
1461
1461
|
}
|
|
1462
|
-
var P = ye(
|
|
1462
|
+
var P = ye(d, 2);
|
|
1463
1463
|
{
|
|
1464
1464
|
var b = (j) => {
|
|
1465
1465
|
var C = Qr();
|
|
@@ -1481,13 +1481,13 @@ const aa = {
|
|
|
1481
1481
|
};
|
|
1482
1482
|
function Ye(y, t) {
|
|
1483
1483
|
pe(t, !0), be(y, aa);
|
|
1484
|
-
let
|
|
1484
|
+
let g = u(t, "onclick", 7), i = u(t, "disabled", 7, !1), o = u(t, "loading", 7, !1), r = u(t, "visualization", 7, "none"), a = u(t, "progressPercent", 7, 0), n = u(t, "isPlaying", 7, !1), s = u(t, "amplitude", 7, 0), _ = u(t, "rippleIntensity", 7, 1), f = u(t, "ariaLabel", 7, "Play"), I = u(t, "borderRadius", 7, "50%"), d = u(t, "children", 7);
|
|
1485
1485
|
var l = {
|
|
1486
1486
|
get onclick() {
|
|
1487
|
-
return
|
|
1487
|
+
return g();
|
|
1488
1488
|
},
|
|
1489
1489
|
set onclick(k) {
|
|
1490
|
-
|
|
1490
|
+
g(k), c();
|
|
1491
1491
|
},
|
|
1492
1492
|
get disabled() {
|
|
1493
1493
|
return i();
|
|
@@ -1532,10 +1532,10 @@ function Ye(y, t) {
|
|
|
1532
1532
|
_(k), c();
|
|
1533
1533
|
},
|
|
1534
1534
|
get ariaLabel() {
|
|
1535
|
-
return
|
|
1535
|
+
return f();
|
|
1536
1536
|
},
|
|
1537
1537
|
set ariaLabel(k = "Play") {
|
|
1538
|
-
|
|
1538
|
+
f(k), c();
|
|
1539
1539
|
},
|
|
1540
1540
|
get borderRadius() {
|
|
1541
1541
|
return I();
|
|
@@ -1544,10 +1544,10 @@ function Ye(y, t) {
|
|
|
1544
1544
|
I(k), c();
|
|
1545
1545
|
},
|
|
1546
1546
|
get children() {
|
|
1547
|
-
return
|
|
1547
|
+
return d();
|
|
1548
1548
|
},
|
|
1549
1549
|
set children(k) {
|
|
1550
|
-
|
|
1550
|
+
d(k), c();
|
|
1551
1551
|
}
|
|
1552
1552
|
}, P = ra(), b = G(P);
|
|
1553
1553
|
{
|
|
@@ -1570,7 +1570,7 @@ function Ye(y, t) {
|
|
|
1570
1570
|
}
|
|
1571
1571
|
var C = ye(b, 2);
|
|
1572
1572
|
let B;
|
|
1573
|
-
C.__click = [ta,
|
|
1573
|
+
C.__click = [ta, g];
|
|
1574
1574
|
var A = G(C);
|
|
1575
1575
|
{
|
|
1576
1576
|
var X = (k) => {
|
|
@@ -1585,9 +1585,9 @@ function Ye(y, t) {
|
|
|
1585
1585
|
});
|
|
1586
1586
|
}
|
|
1587
1587
|
var R = ye(A, 2), V = G(R);
|
|
1588
|
-
return Ge(V,
|
|
1588
|
+
return Ge(V, d), N(R), N(C), N(P), H(
|
|
1589
1589
|
(k) => {
|
|
1590
|
-
Le(P, `border-radius: ${I() ?? ""}`), B =
|
|
1590
|
+
Le(P, `border-radius: ${I() ?? ""}`), B = fe(C, 1, "play-button svelte-nzw87g", null, B, k), C.disabled = i(), Z(C, "aria-label", f()), Z(C, "aria-busy", o()), Le(C, `border-radius: ${I() ?? ""}`);
|
|
1591
1591
|
},
|
|
1592
1592
|
[() => ({ "has-ring-progress": r() === "ring" })]
|
|
1593
1593
|
), x(y, P), ge(l);
|
|
@@ -1614,13 +1614,13 @@ ue(
|
|
|
1614
1614
|
);
|
|
1615
1615
|
function tt(y, t) {
|
|
1616
1616
|
pe(t, !0);
|
|
1617
|
-
let
|
|
1618
|
-
var
|
|
1617
|
+
let g = u(t, "onclick", 7), i = u(t, "disabled", 7, !1), o = u(t, "loading", 7, !1), r = u(t, "visualization", 7, "none"), a = u(t, "progressPercent", 7, 0), n = u(t, "isPlaying", 7, !1), s = u(t, "amplitude", 7, 0), _ = u(t, "rippleIntensity", 7, 1), f = u(t, "ariaLabel", 7, "Play"), I = u(t, "children", 7);
|
|
1618
|
+
var d = {
|
|
1619
1619
|
get onclick() {
|
|
1620
|
-
return
|
|
1620
|
+
return g();
|
|
1621
1621
|
},
|
|
1622
1622
|
set onclick(l) {
|
|
1623
|
-
|
|
1623
|
+
g(l), c();
|
|
1624
1624
|
},
|
|
1625
1625
|
get disabled() {
|
|
1626
1626
|
return i();
|
|
@@ -1665,10 +1665,10 @@ function tt(y, t) {
|
|
|
1665
1665
|
_(l), c();
|
|
1666
1666
|
},
|
|
1667
1667
|
get ariaLabel() {
|
|
1668
|
-
return
|
|
1668
|
+
return f();
|
|
1669
1669
|
},
|
|
1670
1670
|
set ariaLabel(l = "Play") {
|
|
1671
|
-
|
|
1671
|
+
f(l), c();
|
|
1672
1672
|
},
|
|
1673
1673
|
get children() {
|
|
1674
1674
|
return I();
|
|
@@ -1679,7 +1679,7 @@ function tt(y, t) {
|
|
|
1679
1679
|
};
|
|
1680
1680
|
return Ye(y, {
|
|
1681
1681
|
get onclick() {
|
|
1682
|
-
return
|
|
1682
|
+
return g();
|
|
1683
1683
|
},
|
|
1684
1684
|
get disabled() {
|
|
1685
1685
|
return i();
|
|
@@ -1703,7 +1703,7 @@ function tt(y, t) {
|
|
|
1703
1703
|
return _();
|
|
1704
1704
|
},
|
|
1705
1705
|
get ariaLabel() {
|
|
1706
|
-
return
|
|
1706
|
+
return f();
|
|
1707
1707
|
},
|
|
1708
1708
|
borderRadius: "50%",
|
|
1709
1709
|
children: (l, P) => {
|
|
@@ -1711,7 +1711,7 @@ function tt(y, t) {
|
|
|
1711
1711
|
Ge(j, I), x(l, b);
|
|
1712
1712
|
},
|
|
1713
1713
|
$$slots: { default: !0 }
|
|
1714
|
-
}), ge(
|
|
1714
|
+
}), ge(d);
|
|
1715
1715
|
}
|
|
1716
1716
|
ue(
|
|
1717
1717
|
tt,
|
|
@@ -1733,13 +1733,13 @@ ue(
|
|
|
1733
1733
|
);
|
|
1734
1734
|
function Lt(y, t) {
|
|
1735
1735
|
pe(t, !0);
|
|
1736
|
-
let
|
|
1737
|
-
var
|
|
1736
|
+
let g = u(t, "onclick", 7), i = u(t, "disabled", 7, !1), o = u(t, "loading", 7, !1), r = u(t, "visualization", 7, "none"), a = u(t, "progressPercent", 7, 0), n = u(t, "isPlaying", 7, !1), s = u(t, "amplitude", 7, 0), _ = u(t, "rippleIntensity", 7, 1), f = u(t, "ariaLabel", 7, "Play"), I = u(t, "children", 7);
|
|
1737
|
+
var d = {
|
|
1738
1738
|
get onclick() {
|
|
1739
|
-
return
|
|
1739
|
+
return g();
|
|
1740
1740
|
},
|
|
1741
1741
|
set onclick(l) {
|
|
1742
|
-
|
|
1742
|
+
g(l), c();
|
|
1743
1743
|
},
|
|
1744
1744
|
get disabled() {
|
|
1745
1745
|
return i();
|
|
@@ -1784,10 +1784,10 @@ function Lt(y, t) {
|
|
|
1784
1784
|
_(l), c();
|
|
1785
1785
|
},
|
|
1786
1786
|
get ariaLabel() {
|
|
1787
|
-
return
|
|
1787
|
+
return f();
|
|
1788
1788
|
},
|
|
1789
1789
|
set ariaLabel(l = "Play") {
|
|
1790
|
-
|
|
1790
|
+
f(l), c();
|
|
1791
1791
|
},
|
|
1792
1792
|
get children() {
|
|
1793
1793
|
return I();
|
|
@@ -1798,7 +1798,7 @@ function Lt(y, t) {
|
|
|
1798
1798
|
};
|
|
1799
1799
|
return Ye(y, {
|
|
1800
1800
|
get onclick() {
|
|
1801
|
-
return
|
|
1801
|
+
return g();
|
|
1802
1802
|
},
|
|
1803
1803
|
get disabled() {
|
|
1804
1804
|
return i();
|
|
@@ -1822,7 +1822,7 @@ function Lt(y, t) {
|
|
|
1822
1822
|
return _();
|
|
1823
1823
|
},
|
|
1824
1824
|
get ariaLabel() {
|
|
1825
|
-
return
|
|
1825
|
+
return f();
|
|
1826
1826
|
},
|
|
1827
1827
|
borderRadius: "0",
|
|
1828
1828
|
children: (l, P) => {
|
|
@@ -1830,7 +1830,7 @@ function Lt(y, t) {
|
|
|
1830
1830
|
Ge(j, I), x(l, b);
|
|
1831
1831
|
},
|
|
1832
1832
|
$$slots: { default: !0 }
|
|
1833
|
-
}), ge(
|
|
1833
|
+
}), ge(d);
|
|
1834
1834
|
}
|
|
1835
1835
|
ue(
|
|
1836
1836
|
Lt,
|
|
@@ -1852,13 +1852,13 @@ ue(
|
|
|
1852
1852
|
);
|
|
1853
1853
|
function jt(y, t) {
|
|
1854
1854
|
pe(t, !0);
|
|
1855
|
-
let
|
|
1856
|
-
var
|
|
1855
|
+
let g = u(t, "onclick", 7), i = u(t, "disabled", 7, !1), o = u(t, "loading", 7, !1), r = u(t, "visualization", 7, "none"), a = u(t, "progressPercent", 7, 0), n = u(t, "isPlaying", 7, !1), s = u(t, "amplitude", 7, 0), _ = u(t, "rippleIntensity", 7, 1), f = u(t, "ariaLabel", 7, "Play"), I = u(t, "children", 7);
|
|
1856
|
+
var d = {
|
|
1857
1857
|
get onclick() {
|
|
1858
|
-
return
|
|
1858
|
+
return g();
|
|
1859
1859
|
},
|
|
1860
1860
|
set onclick(l) {
|
|
1861
|
-
|
|
1861
|
+
g(l), c();
|
|
1862
1862
|
},
|
|
1863
1863
|
get disabled() {
|
|
1864
1864
|
return i();
|
|
@@ -1903,10 +1903,10 @@ function jt(y, t) {
|
|
|
1903
1903
|
_(l), c();
|
|
1904
1904
|
},
|
|
1905
1905
|
get ariaLabel() {
|
|
1906
|
-
return
|
|
1906
|
+
return f();
|
|
1907
1907
|
},
|
|
1908
1908
|
set ariaLabel(l = "Play") {
|
|
1909
|
-
|
|
1909
|
+
f(l), c();
|
|
1910
1910
|
},
|
|
1911
1911
|
get children() {
|
|
1912
1912
|
return I();
|
|
@@ -1917,7 +1917,7 @@ function jt(y, t) {
|
|
|
1917
1917
|
};
|
|
1918
1918
|
return Ye(y, {
|
|
1919
1919
|
get onclick() {
|
|
1920
|
-
return
|
|
1920
|
+
return g();
|
|
1921
1921
|
},
|
|
1922
1922
|
get disabled() {
|
|
1923
1923
|
return i();
|
|
@@ -1941,7 +1941,7 @@ function jt(y, t) {
|
|
|
1941
1941
|
return _();
|
|
1942
1942
|
},
|
|
1943
1943
|
get ariaLabel() {
|
|
1944
|
-
return
|
|
1944
|
+
return f();
|
|
1945
1945
|
},
|
|
1946
1946
|
borderRadius: "var(--fortyfour-play-button-border-radius)",
|
|
1947
1947
|
children: (l, P) => {
|
|
@@ -1949,7 +1949,7 @@ function jt(y, t) {
|
|
|
1949
1949
|
Ge(j, I), x(l, b);
|
|
1950
1950
|
},
|
|
1951
1951
|
$$slots: { default: !0 }
|
|
1952
|
-
}), ge(
|
|
1952
|
+
}), ge(d);
|
|
1953
1953
|
}
|
|
1954
1954
|
ue(
|
|
1955
1955
|
jt,
|
|
@@ -1976,9 +1976,9 @@ const na = {
|
|
|
1976
1976
|
};
|
|
1977
1977
|
function It(y, t) {
|
|
1978
1978
|
pe(t, !0), be(y, na);
|
|
1979
|
-
let
|
|
1980
|
-
function P(
|
|
1981
|
-
return Math.floor(
|
|
1979
|
+
let g = u(t, "onclick", 7), i = u(t, "disabled", 7, !1), o = u(t, "loading", 7, !1), r = u(t, "visualization", 7, "none"), a = u(t, "progressPercent", 7, 0), n = u(t, "isPlaying", 7, !1), s = u(t, "amplitude", 7, 0), _ = u(t, "rippleIntensity", 7, 1), f = u(t, "ariaLabel", 7, "Play"), I = u(t, "animate", 7, !1), d = u(t, "speed", 7, 20), l = u(t, "children", 7);
|
|
1980
|
+
function P(p, S) {
|
|
1981
|
+
return Math.floor(p + Math.random() * (S - p));
|
|
1982
1982
|
}
|
|
1983
1983
|
function b() {
|
|
1984
1984
|
const S = ($) => 100 - $;
|
|
@@ -2002,7 +2002,7 @@ function It(y, t) {
|
|
|
2002
2002
|
let A = q(null), X = null;
|
|
2003
2003
|
const R = typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2004
2004
|
me(() => (e(A) && I() && !R && (X = e(A).animate(C, {
|
|
2005
|
-
duration:
|
|
2005
|
+
duration: d() * 1e3,
|
|
2006
2006
|
iterations: 1 / 0,
|
|
2007
2007
|
easing: "ease"
|
|
2008
2008
|
})), () => {
|
|
@@ -2010,83 +2010,83 @@ function It(y, t) {
|
|
|
2010
2010
|
}));
|
|
2011
2011
|
var V = {
|
|
2012
2012
|
get onclick() {
|
|
2013
|
-
return
|
|
2013
|
+
return g();
|
|
2014
2014
|
},
|
|
2015
|
-
set onclick(
|
|
2016
|
-
p
|
|
2015
|
+
set onclick(p) {
|
|
2016
|
+
g(p), c();
|
|
2017
2017
|
},
|
|
2018
2018
|
get disabled() {
|
|
2019
2019
|
return i();
|
|
2020
2020
|
},
|
|
2021
|
-
set disabled(
|
|
2022
|
-
i(
|
|
2021
|
+
set disabled(p = !1) {
|
|
2022
|
+
i(p), c();
|
|
2023
2023
|
},
|
|
2024
2024
|
get loading() {
|
|
2025
2025
|
return o();
|
|
2026
2026
|
},
|
|
2027
|
-
set loading(
|
|
2028
|
-
o(
|
|
2027
|
+
set loading(p = !1) {
|
|
2028
|
+
o(p), c();
|
|
2029
2029
|
},
|
|
2030
2030
|
get visualization() {
|
|
2031
2031
|
return r();
|
|
2032
2032
|
},
|
|
2033
|
-
set visualization(
|
|
2034
|
-
r(
|
|
2033
|
+
set visualization(p = "none") {
|
|
2034
|
+
r(p), c();
|
|
2035
2035
|
},
|
|
2036
2036
|
get progressPercent() {
|
|
2037
2037
|
return a();
|
|
2038
2038
|
},
|
|
2039
|
-
set progressPercent(
|
|
2040
|
-
a(
|
|
2039
|
+
set progressPercent(p = 0) {
|
|
2040
|
+
a(p), c();
|
|
2041
2041
|
},
|
|
2042
2042
|
get isPlaying() {
|
|
2043
2043
|
return n();
|
|
2044
2044
|
},
|
|
2045
|
-
set isPlaying(
|
|
2046
|
-
n(
|
|
2045
|
+
set isPlaying(p = !1) {
|
|
2046
|
+
n(p), c();
|
|
2047
2047
|
},
|
|
2048
2048
|
get amplitude() {
|
|
2049
2049
|
return s();
|
|
2050
2050
|
},
|
|
2051
|
-
set amplitude(
|
|
2052
|
-
s(
|
|
2051
|
+
set amplitude(p = 0) {
|
|
2052
|
+
s(p), c();
|
|
2053
2053
|
},
|
|
2054
2054
|
get rippleIntensity() {
|
|
2055
2055
|
return _();
|
|
2056
2056
|
},
|
|
2057
|
-
set rippleIntensity(
|
|
2058
|
-
_(
|
|
2057
|
+
set rippleIntensity(p = 1) {
|
|
2058
|
+
_(p), c();
|
|
2059
2059
|
},
|
|
2060
2060
|
get ariaLabel() {
|
|
2061
|
-
return
|
|
2061
|
+
return f();
|
|
2062
2062
|
},
|
|
2063
|
-
set ariaLabel(
|
|
2064
|
-
|
|
2063
|
+
set ariaLabel(p = "Play") {
|
|
2064
|
+
f(p), c();
|
|
2065
2065
|
},
|
|
2066
2066
|
get animate() {
|
|
2067
2067
|
return I();
|
|
2068
2068
|
},
|
|
2069
|
-
set animate(
|
|
2070
|
-
I(
|
|
2069
|
+
set animate(p = !1) {
|
|
2070
|
+
I(p), c();
|
|
2071
2071
|
},
|
|
2072
2072
|
get speed() {
|
|
2073
|
-
return
|
|
2073
|
+
return d();
|
|
2074
2074
|
},
|
|
2075
|
-
set speed(
|
|
2076
|
-
|
|
2075
|
+
set speed(p = 20) {
|
|
2076
|
+
d(p), c();
|
|
2077
2077
|
},
|
|
2078
2078
|
get children() {
|
|
2079
2079
|
return l();
|
|
2080
2080
|
},
|
|
2081
|
-
set children(
|
|
2082
|
-
l(
|
|
2081
|
+
set children(p) {
|
|
2082
|
+
l(p), c();
|
|
2083
2083
|
}
|
|
2084
2084
|
}, k = oa();
|
|
2085
2085
|
let D;
|
|
2086
2086
|
var T = G(k);
|
|
2087
2087
|
{
|
|
2088
|
-
var L = (
|
|
2089
|
-
ct(
|
|
2088
|
+
var L = (p) => {
|
|
2089
|
+
ct(p, {
|
|
2090
2090
|
get isPlaying() {
|
|
2091
2091
|
return n();
|
|
2092
2092
|
},
|
|
@@ -2098,34 +2098,34 @@ function It(y, t) {
|
|
|
2098
2098
|
}
|
|
2099
2099
|
});
|
|
2100
2100
|
};
|
|
2101
|
-
K(T, (
|
|
2102
|
-
r() === "ripple" &&
|
|
2101
|
+
K(T, (p) => {
|
|
2102
|
+
r() === "ripple" && p(L);
|
|
2103
2103
|
});
|
|
2104
2104
|
}
|
|
2105
2105
|
var M = ye(T, 2);
|
|
2106
|
-
M.__click = function(...
|
|
2107
|
-
|
|
2106
|
+
M.__click = function(...p) {
|
|
2107
|
+
g()?.apply(this, p);
|
|
2108
2108
|
};
|
|
2109
2109
|
var z = G(M);
|
|
2110
|
-
let
|
|
2110
|
+
let v, E;
|
|
2111
2111
|
var Q = G(z);
|
|
2112
2112
|
{
|
|
2113
|
-
var oe = (
|
|
2114
|
-
ut(
|
|
2113
|
+
var oe = (p) => {
|
|
2114
|
+
ut(p, {
|
|
2115
2115
|
get progress() {
|
|
2116
2116
|
return a();
|
|
2117
2117
|
}
|
|
2118
2118
|
});
|
|
2119
2119
|
};
|
|
2120
|
-
K(Q, (
|
|
2121
|
-
r() === "ring" &&
|
|
2120
|
+
K(Q, (p) => {
|
|
2121
|
+
r() === "ring" && p(oe);
|
|
2122
2122
|
});
|
|
2123
2123
|
}
|
|
2124
|
-
N(z), Ee(z, (
|
|
2124
|
+
N(z), Ee(z, (p) => m(A, p), () => e(A));
|
|
2125
2125
|
var w = ye(z, 2), h = G(w);
|
|
2126
2126
|
return Ge(h, l), N(w), N(M), N(k), H(
|
|
2127
|
-
(
|
|
2128
|
-
D = Le(k, "", D,
|
|
2127
|
+
(p, S, O) => {
|
|
2128
|
+
D = Le(k, "", D, p), M.disabled = i(), Z(M, "aria-label", f()), Z(M, "aria-busy", o()), v = fe(z, 1, "blob-background svelte-jokk6x", null, v, S), E = Le(z, "", E, O);
|
|
2129
2129
|
},
|
|
2130
2130
|
[
|
|
2131
2131
|
() => ({ "border-radius": B }),
|
|
@@ -2213,18 +2213,18 @@ const ca = {
|
|
|
2213
2213
|
:host([hover="lift"]) {transition:none;}
|
|
2214
2214
|
}`
|
|
2215
2215
|
};
|
|
2216
|
-
function
|
|
2216
|
+
function da(y, t) {
|
|
2217
2217
|
pe(t, !0), be(y, ca);
|
|
2218
|
-
const
|
|
2218
|
+
const g = (v) => {
|
|
2219
2219
|
var E = ee(), Q = J(E);
|
|
2220
2220
|
{
|
|
2221
2221
|
var oe = (h) => {
|
|
2222
|
-
var
|
|
2222
|
+
var p = ee(), S = J(p);
|
|
2223
2223
|
Ce(S, t, "icon-error", {}, (O) => {
|
|
2224
2224
|
Tt(O);
|
|
2225
|
-
}), x(h,
|
|
2225
|
+
}), x(h, p);
|
|
2226
2226
|
}, w = (h) => {
|
|
2227
|
-
var
|
|
2227
|
+
var p = ee(), S = J(p);
|
|
2228
2228
|
{
|
|
2229
2229
|
var O = (Y) => {
|
|
2230
2230
|
var ce = ee(), U = J(ce);
|
|
@@ -2235,13 +2235,13 @@ function fa(y, t) {
|
|
|
2235
2235
|
var ce = ee(), U = J(ce);
|
|
2236
2236
|
{
|
|
2237
2237
|
var re = (ie) => {
|
|
2238
|
-
var ve = ee(),
|
|
2239
|
-
Ce(
|
|
2238
|
+
var ve = ee(), de = J(ve);
|
|
2239
|
+
Ce(de, t, "icon-playing", {}, (ae) => {
|
|
2240
2240
|
Mt(ae);
|
|
2241
2241
|
}), x(ie, ve);
|
|
2242
2242
|
}, ne = (ie) => {
|
|
2243
|
-
var ve = ee(),
|
|
2244
|
-
Ce(
|
|
2243
|
+
var ve = ee(), de = J(ve);
|
|
2244
|
+
Ce(de, t, "icon-paused", {}, (ae) => {
|
|
2245
2245
|
Et(ae);
|
|
2246
2246
|
}), x(ie, ve);
|
|
2247
2247
|
};
|
|
@@ -2263,26 +2263,26 @@ function fa(y, t) {
|
|
|
2263
2263
|
!0
|
|
2264
2264
|
);
|
|
2265
2265
|
}
|
|
2266
|
-
x(h,
|
|
2266
|
+
x(h, p);
|
|
2267
2267
|
};
|
|
2268
2268
|
K(Q, (h) => {
|
|
2269
2269
|
e(X) ? h(oe) : h(w, !1);
|
|
2270
2270
|
});
|
|
2271
2271
|
}
|
|
2272
|
-
x(
|
|
2272
|
+
x(v, E);
|
|
2273
2273
|
}, i = t.$$host;
|
|
2274
|
-
let o = u(t, "for", 7, ""), r = u(t, "shape", 7, "circle"), a = u(t, "visualization", 7, "none"), n = u(t, "hover", 7, "none"), s = u(t, "rippleIntensity", 7, 1), _ = u(t, "blobAnimate", 7, !1),
|
|
2274
|
+
let o = u(t, "for", 7, ""), r = u(t, "shape", 7, "circle"), a = u(t, "visualization", 7, "none"), n = u(t, "hover", 7, "none"), s = u(t, "rippleIntensity", 7, 1), _ = u(t, "blobAnimate", 7, !1), f = u(t, "blobSpeed", 7, 20);
|
|
2275
2275
|
const I = {
|
|
2276
2276
|
circle: tt,
|
|
2277
2277
|
square: Lt,
|
|
2278
2278
|
"rounded-square": jt,
|
|
2279
2279
|
blob: It
|
|
2280
2280
|
};
|
|
2281
|
-
let
|
|
2281
|
+
let d = q(null), l = q("idle"), P = q(0), b = q(0), j = q(Xe([]));
|
|
2282
2282
|
const C = W(() => I[r()] ?? tt), B = W(() => e(l) === "playing"), A = W(() => e(l) === "loading"), X = W(() => e(l) === "error"), R = W(() => e(b) > 0 ? e(P) / e(b) : 0), V = st(() => e(A), 200), k = W(() => {
|
|
2283
2283
|
if (!e(j).length || e(b) === 0)
|
|
2284
2284
|
return 0;
|
|
2285
|
-
const
|
|
2285
|
+
const v = Math.floor(e(P) / e(b) * e(j).length), E = 3, Q = Math.max(0, v - Math.floor(E / 2)), oe = Math.min(e(j).length, Q + E), w = e(j).slice(Q, oe), h = w.reduce((p, S) => p + S * S, 0);
|
|
2286
2286
|
return Math.sqrt(h / w.length);
|
|
2287
2287
|
}), D = W(() => ({
|
|
2288
2288
|
onclick: T,
|
|
@@ -2294,84 +2294,84 @@ function fa(y, t) {
|
|
|
2294
2294
|
amplitude: e(k),
|
|
2295
2295
|
rippleIntensity: s(),
|
|
2296
2296
|
ariaLabel: e(B) ? "Pause" : "Play",
|
|
2297
|
-
...r() === "blob" ? { animate: _(), speed:
|
|
2297
|
+
...r() === "blob" ? { animate: _(), speed: f() } : {}
|
|
2298
2298
|
}));
|
|
2299
2299
|
me(() => {
|
|
2300
2300
|
if (!o()) {
|
|
2301
2301
|
console.warn("fortyfour-play-button: 'for' attribute is required");
|
|
2302
2302
|
return;
|
|
2303
2303
|
}
|
|
2304
|
-
const
|
|
2305
|
-
if (m(
|
|
2304
|
+
const v = i.getRootNode();
|
|
2305
|
+
if (m(d, v.getElementById(o()), !0), !e(d)) {
|
|
2306
2306
|
console.warn(`fortyfour-play-button: element with id "${o()}" not found`);
|
|
2307
2307
|
return;
|
|
2308
2308
|
}
|
|
2309
2309
|
function E() {
|
|
2310
|
-
m(l, e(
|
|
2310
|
+
m(l, e(d).state, !0), m(P, e(d).currentTime, !0), m(b, e(d).duration, !0), m(j, e(d).metadata?.waveform ?? [], !0);
|
|
2311
2311
|
}
|
|
2312
|
-
return E(), e(
|
|
2313
|
-
e(
|
|
2312
|
+
return E(), e(d).addEventListener("loading", E), e(d).addEventListener("loadedmetadata", E), e(d).addEventListener("play", E), e(d).addEventListener("pause", E), e(d).addEventListener("ended", E), e(d).addEventListener("error", E), e(d).addEventListener("timeupdate", E), () => {
|
|
2313
|
+
e(d).removeEventListener("loading", E), e(d).removeEventListener("loadedmetadata", E), e(d).removeEventListener("play", E), e(d).removeEventListener("pause", E), e(d).removeEventListener("ended", E), e(d).removeEventListener("error", E), e(d).removeEventListener("timeupdate", E);
|
|
2314
2314
|
};
|
|
2315
2315
|
});
|
|
2316
2316
|
function T() {
|
|
2317
|
-
e(
|
|
2317
|
+
e(d)?.togglePlay();
|
|
2318
2318
|
}
|
|
2319
2319
|
Oe(i, "data-playing", () => e(B)), Oe(i, "data-loading", V), Oe(i, "data-error", () => e(X));
|
|
2320
2320
|
var L = {
|
|
2321
2321
|
get for() {
|
|
2322
2322
|
return o();
|
|
2323
2323
|
},
|
|
2324
|
-
set for(
|
|
2325
|
-
o(
|
|
2324
|
+
set for(v = "") {
|
|
2325
|
+
o(v), c();
|
|
2326
2326
|
},
|
|
2327
2327
|
get shape() {
|
|
2328
2328
|
return r();
|
|
2329
2329
|
},
|
|
2330
|
-
set shape(
|
|
2331
|
-
r(
|
|
2330
|
+
set shape(v = "circle") {
|
|
2331
|
+
r(v), c();
|
|
2332
2332
|
},
|
|
2333
2333
|
get visualization() {
|
|
2334
2334
|
return a();
|
|
2335
2335
|
},
|
|
2336
|
-
set visualization(
|
|
2337
|
-
a(
|
|
2336
|
+
set visualization(v = "none") {
|
|
2337
|
+
a(v), c();
|
|
2338
2338
|
},
|
|
2339
2339
|
get hover() {
|
|
2340
2340
|
return n();
|
|
2341
2341
|
},
|
|
2342
|
-
set hover(
|
|
2343
|
-
n(
|
|
2342
|
+
set hover(v = "none") {
|
|
2343
|
+
n(v), c();
|
|
2344
2344
|
},
|
|
2345
2345
|
get rippleIntensity() {
|
|
2346
2346
|
return s();
|
|
2347
2347
|
},
|
|
2348
|
-
set rippleIntensity(
|
|
2349
|
-
s(
|
|
2348
|
+
set rippleIntensity(v = 1) {
|
|
2349
|
+
s(v), c();
|
|
2350
2350
|
},
|
|
2351
2351
|
get blobAnimate() {
|
|
2352
2352
|
return _();
|
|
2353
2353
|
},
|
|
2354
|
-
set blobAnimate(
|
|
2355
|
-
_(
|
|
2354
|
+
set blobAnimate(v = !1) {
|
|
2355
|
+
_(v), c();
|
|
2356
2356
|
},
|
|
2357
2357
|
get blobSpeed() {
|
|
2358
|
-
return
|
|
2358
|
+
return f();
|
|
2359
2359
|
},
|
|
2360
|
-
set blobSpeed(
|
|
2361
|
-
|
|
2360
|
+
set blobSpeed(v = 20) {
|
|
2361
|
+
f(v), c();
|
|
2362
2362
|
}
|
|
2363
2363
|
}, M = ee(), z = J(M);
|
|
2364
|
-
return Kt(z, () => e(C), (
|
|
2365
|
-
E(
|
|
2364
|
+
return Kt(z, () => e(C), (v, E) => {
|
|
2365
|
+
E(v, Ft(() => e(D), {
|
|
2366
2366
|
children: (Q, oe) => {
|
|
2367
|
-
|
|
2367
|
+
g(Q);
|
|
2368
2368
|
},
|
|
2369
2369
|
$$slots: { default: !0 }
|
|
2370
2370
|
}));
|
|
2371
2371
|
}), x(y, M), ge(L);
|
|
2372
2372
|
}
|
|
2373
2373
|
customElements.define("fortyfour-play-button", ue(
|
|
2374
|
-
|
|
2374
|
+
da,
|
|
2375
2375
|
{
|
|
2376
2376
|
for: { attribute: "for", reflect: !0 },
|
|
2377
2377
|
shape: { attribute: "shape", reflect: !0 },
|
|
@@ -2388,43 +2388,43 @@ customElements.define("fortyfour-play-button", ue(
|
|
|
2388
2388
|
function Rt(y, t) {
|
|
2389
2389
|
if (!y.length || t <= 0)
|
|
2390
2390
|
return [];
|
|
2391
|
-
const
|
|
2391
|
+
const g = y.length / t, i = [];
|
|
2392
2392
|
for (let o = 0; o < t; o++) {
|
|
2393
|
-
const r = Math.floor(o *
|
|
2393
|
+
const r = Math.floor(o * g), a = Math.floor((o + 1) * g), n = y.slice(r, Math.max(r + 1, a)), s = n.reduce((f, I) => f + I * I, 0), _ = Math.sqrt(s / n.length);
|
|
2394
2394
|
i.push(_);
|
|
2395
2395
|
}
|
|
2396
2396
|
return i;
|
|
2397
2397
|
}
|
|
2398
|
-
function
|
|
2398
|
+
function dt(y, t, g) {
|
|
2399
2399
|
return function(o) {
|
|
2400
|
-
const r = y(), a = t(), n =
|
|
2400
|
+
const r = y(), a = t(), n = g();
|
|
2401
2401
|
if (!r || !n || a <= 0)
|
|
2402
2402
|
return;
|
|
2403
|
-
const s = o.clientX - n.left,
|
|
2404
|
-
r.seek(
|
|
2403
|
+
const s = o.clientX - n.left, f = Math.max(0, Math.min(1, s / n.width)) * a;
|
|
2404
|
+
r.seek(f);
|
|
2405
2405
|
};
|
|
2406
2406
|
}
|
|
2407
|
-
function
|
|
2407
|
+
function ft(y, t, g) {
|
|
2408
2408
|
return function(o) {
|
|
2409
|
-
const r = y(), a = t(), n =
|
|
2409
|
+
const r = y(), a = t(), n = g();
|
|
2410
2410
|
if (!r || a <= 0)
|
|
2411
2411
|
return;
|
|
2412
2412
|
const s = a * 0.05;
|
|
2413
2413
|
o.key === "ArrowRight" ? r.seek(Math.min(a, n + s)) : o.key === "ArrowLeft" && r.seek(Math.max(0, n - s));
|
|
2414
2414
|
};
|
|
2415
2415
|
}
|
|
2416
|
-
var
|
|
2416
|
+
var fa = Me("<rect></rect>"), va = F('<div class="waveform svelte-kt0w9q" role="slider" tabindex="0" aria-valuemin="0" aria-label="Audio playback position"><svg width="100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" class="svelte-kt0w9q"><!></svg></div>');
|
|
2417
2417
|
const pa = {
|
|
2418
2418
|
hash: "svelte-kt0w9q",
|
|
2419
2419
|
code: ":host {display:flex;flex:1;--waveform-progress-color: #3b82f6;--waveform-track-color: #e5e7eb;--waveform-focus-color: #3b82f6;--waveform-focus-width: 2px;--waveform-focus-offset: 2px;--waveform-focus-radius: 4px;}.waveform.svelte-kt0w9q {flex:1;height:100%;display:flex;align-items:center;cursor:pointer;border-radius:var(--waveform-focus-radius);}.waveform.svelte-kt0w9q:focus-visible {outline:var(--waveform-focus-width) solid var(--waveform-focus-color);outline-offset:var(--waveform-focus-offset);}svg.svelte-kt0w9q {display:block;}.bar.svelte-kt0w9q {transition:fill 0.15s;}.progress.svelte-kt0w9q {fill:var(--waveform-progress-color);}.track.svelte-kt0w9q {fill:var(--waveform-track-color);}"
|
|
2420
2420
|
};
|
|
2421
2421
|
function ga(y, t) {
|
|
2422
2422
|
pe(t, !0), be(y, pa);
|
|
2423
|
-
const
|
|
2424
|
-
let i = u(t, "for", 7, ""), o = u(t, "barWidth", 7, 3), r = u(t, "barGap", 7, 1), a = u(t, "barRadius", 7, 1), n = u(t, "minBarHeight", 7, 3), s = u(t, "height", 7, 56), _ = q(Xe([])),
|
|
2425
|
-
|
|
2426
|
-
const z = new ResizeObserver((
|
|
2427
|
-
for (let E of
|
|
2423
|
+
const g = t.$$host;
|
|
2424
|
+
let i = u(t, "for", 7, ""), o = u(t, "barWidth", 7, 3), r = u(t, "barGap", 7, 1), a = u(t, "barRadius", 7, 1), n = u(t, "minBarHeight", 7, 3), s = u(t, "height", 7, 56), _ = q(Xe([])), f = q(0), I = q(0), d = q(null), l = q(0), P = q(!1), b = q(null);
|
|
2425
|
+
g.style.height = `${s()}px`, Fe(() => {
|
|
2426
|
+
const z = new ResizeObserver((v) => {
|
|
2427
|
+
for (let E of v)
|
|
2428
2428
|
m(l, E.contentRect.width || 0, !0), m(P, !0);
|
|
2429
2429
|
});
|
|
2430
2430
|
return e(b) && z.observe(e(b)), () => {
|
|
@@ -2435,30 +2435,30 @@ function ga(y, t) {
|
|
|
2435
2435
|
console.warn("fortyfour-bar-waveform: 'for' attribute is required");
|
|
2436
2436
|
return;
|
|
2437
2437
|
}
|
|
2438
|
-
const z =
|
|
2439
|
-
if (m(
|
|
2438
|
+
const z = g.getRootNode();
|
|
2439
|
+
if (m(d, z.getElementById(i()), !0), !e(d)) {
|
|
2440
2440
|
console.warn(`fortyfour-bar-waveform: element with id "${i()}" not found`);
|
|
2441
2441
|
return;
|
|
2442
2442
|
}
|
|
2443
|
-
e(
|
|
2444
|
-
function
|
|
2445
|
-
m(_, e(
|
|
2443
|
+
e(d).metadata?.waveform && m(_, e(d).metadata.waveform, !0), e(d).duration && m(I, e(d).duration, !0), e(d).currentTime && m(f, e(d).currentTime, !0);
|
|
2444
|
+
function v() {
|
|
2445
|
+
m(_, e(d).metadata?.waveform || [], !0), m(I, e(d).duration, !0);
|
|
2446
2446
|
}
|
|
2447
2447
|
function E() {
|
|
2448
|
-
m(
|
|
2448
|
+
m(f, e(d).currentTime, !0);
|
|
2449
2449
|
}
|
|
2450
|
-
return e(
|
|
2451
|
-
e(
|
|
2450
|
+
return e(d).addEventListener("loadedmetadata", v), e(d).addEventListener("timeupdate", E), () => {
|
|
2451
|
+
e(d).removeEventListener("loadedmetadata", v), e(d).removeEventListener("timeupdate", E);
|
|
2452
2452
|
};
|
|
2453
2453
|
});
|
|
2454
|
-
const j = W(() => Math.max(1, Math.floor(e(l) / (o() + r())))), C = W(() => e(_).length > 0), B = W(() => e(C) ? Rt(e(_), e(j)) : Array(e(j)).fill(0)), A = W(() => e(I) > 0 ? e(
|
|
2455
|
-
const
|
|
2456
|
-
return
|
|
2454
|
+
const j = W(() => Math.max(1, Math.floor(e(l) / (o() + r())))), C = W(() => e(_).length > 0), B = W(() => e(C) ? Rt(e(_), e(j)) : Array(e(j)).fill(0)), A = W(() => e(I) > 0 ? e(f) / e(I) : 0), X = W(() => e(B).map((z) => {
|
|
2455
|
+
const v = Math.max(n(), Math.round(z / 100 * (s() - n()) + n()));
|
|
2456
|
+
return v % 2 === 0 ? v + 1 : v;
|
|
2457
2457
|
}));
|
|
2458
2458
|
me(() => {
|
|
2459
|
-
e(C) ?
|
|
2459
|
+
e(C) ? g.removeAttribute("data-placeholder") : g.setAttribute("data-placeholder", "");
|
|
2460
2460
|
});
|
|
2461
|
-
const R =
|
|
2461
|
+
const R = dt(() => e(d), () => e(I), () => g.getBoundingClientRect()), V = ft(() => e(d), () => e(I), () => e(f));
|
|
2462
2462
|
var k = {
|
|
2463
2463
|
get for() {
|
|
2464
2464
|
return i();
|
|
@@ -2501,24 +2501,24 @@ function ga(y, t) {
|
|
|
2501
2501
|
var T = G(D), L = G(T);
|
|
2502
2502
|
{
|
|
2503
2503
|
var M = (z) => {
|
|
2504
|
-
var
|
|
2504
|
+
var v = ee(), E = J(v);
|
|
2505
2505
|
Be(E, 17, () => e(X), Ae, (Q, oe, w) => {
|
|
2506
|
-
const h = W(() => (w + 1) / e(X).length),
|
|
2507
|
-
var S =
|
|
2506
|
+
const h = W(() => (w + 1) / e(X).length), p = W(() => e(h) <= e(A));
|
|
2507
|
+
var S = fa();
|
|
2508
2508
|
H(
|
|
2509
2509
|
(O) => {
|
|
2510
|
-
|
|
2510
|
+
fe(S, 0, nt(["bar", e(p) ? "progress" : "track"]), "svelte-kt0w9q"), Z(S, "x", w * (o() + r())), Z(S, "y", s() / 4 - e(oe) / 2), Z(S, "width", O), Z(S, "height", e(oe)), Z(S, "rx", a());
|
|
2511
2511
|
},
|
|
2512
2512
|
[() => Math.max(1, o() - 1)]
|
|
2513
2513
|
), x(Q, S);
|
|
2514
|
-
}), x(z,
|
|
2514
|
+
}), x(z, v);
|
|
2515
2515
|
};
|
|
2516
2516
|
K(L, (z) => {
|
|
2517
2517
|
e(P) && z(M);
|
|
2518
2518
|
});
|
|
2519
2519
|
}
|
|
2520
2520
|
return N(T), N(D), Ee(D, (z) => m(b, z), () => e(b)), H(() => {
|
|
2521
|
-
Z(D, "aria-valuemax", e(I)), Z(D, "aria-valuenow", e(
|
|
2521
|
+
Z(D, "aria-valuemax", e(I)), Z(D, "aria-valuenow", e(f)), Z(T, "height", s()), Z(T, "viewBox", `0 0 ${e(l)} ${s() / 2}`);
|
|
2522
2522
|
}), x(y, D), ge(k);
|
|
2523
2523
|
}
|
|
2524
2524
|
Ne(["click", "keydown"]);
|
|
@@ -2546,12 +2546,12 @@ const wa = {
|
|
|
2546
2546
|
};
|
|
2547
2547
|
function xa(y, t) {
|
|
2548
2548
|
pe(t, !0), be(y, wa);
|
|
2549
|
-
const
|
|
2550
|
-
let i = u(t, "for", 7, ""), o = u(t, "lineWidth", 7, 2), r = u(t, "height", 7, 56), a = u(t, "sharp", 7, !1), n = q(Xe([])), s = q(0), _ = q(0),
|
|
2551
|
-
|
|
2552
|
-
const h = new ResizeObserver((
|
|
2553
|
-
for (let S of
|
|
2554
|
-
m(I, S.contentRect.width || 0, !0), m(
|
|
2549
|
+
const g = t.$$host;
|
|
2550
|
+
let i = u(t, "for", 7, ""), o = u(t, "lineWidth", 7, 2), r = u(t, "height", 7, 56), a = u(t, "sharp", 7, !1), n = q(Xe([])), s = q(0), _ = q(0), f = q(null), I = q(0), d = q(!1), l = q(null);
|
|
2551
|
+
g.style.height = `${r()}px`, Fe(() => {
|
|
2552
|
+
const h = new ResizeObserver((p) => {
|
|
2553
|
+
for (let S of p)
|
|
2554
|
+
m(I, S.contentRect.width || 0, !0), m(d, !0);
|
|
2555
2555
|
});
|
|
2556
2556
|
return e(l) && h.observe(e(l)), () => {
|
|
2557
2557
|
h.disconnect();
|
|
@@ -2561,38 +2561,38 @@ function xa(y, t) {
|
|
|
2561
2561
|
console.warn("fortyfour-line-waveform: 'for' attribute is required");
|
|
2562
2562
|
return;
|
|
2563
2563
|
}
|
|
2564
|
-
const h =
|
|
2565
|
-
if (m(
|
|
2564
|
+
const h = g.getRootNode();
|
|
2565
|
+
if (m(f, h.getElementById(i()), !0), !e(f)) {
|
|
2566
2566
|
console.warn(`fortyfour-line-waveform: element with id "${i()}" not found`);
|
|
2567
2567
|
return;
|
|
2568
2568
|
}
|
|
2569
|
-
e(
|
|
2570
|
-
function
|
|
2571
|
-
m(n, e(
|
|
2569
|
+
e(f).metadata?.waveform && m(n, e(f).metadata.waveform, !0), e(f).duration && m(_, e(f).duration, !0), e(f).currentTime && m(s, e(f).currentTime, !0);
|
|
2570
|
+
function p() {
|
|
2571
|
+
m(n, e(f).metadata?.waveform || [], !0), m(_, e(f).duration, !0);
|
|
2572
2572
|
}
|
|
2573
2573
|
function S() {
|
|
2574
|
-
m(s, e(
|
|
2574
|
+
m(s, e(f).currentTime, !0);
|
|
2575
2575
|
}
|
|
2576
|
-
return e(
|
|
2577
|
-
e(
|
|
2576
|
+
return e(f).addEventListener("loadedmetadata", p), e(f).addEventListener("timeupdate", S), () => {
|
|
2577
|
+
e(f).removeEventListener("loadedmetadata", p), e(f).removeEventListener("timeupdate", S);
|
|
2578
2578
|
};
|
|
2579
2579
|
});
|
|
2580
2580
|
const P = 0.15, b = W(() => Math.max(2, Math.floor(e(I) * P))), j = W(() => e(n).length > 0), C = W(() => e(j) ? Rt(e(n), e(b)) : []), B = W(() => e(_) > 0 ? e(s) / e(_) : 0), A = W(() => r() / 2), X = W(() => r() / 2 * 0.8), R = W(() => {
|
|
2581
2581
|
if (!e(C).length || e(I) === 0)
|
|
2582
2582
|
return [];
|
|
2583
|
-
const h = o() / 2,
|
|
2583
|
+
const h = o() / 2, p = e(I) - h * 2;
|
|
2584
2584
|
return e(C).map((S, O) => {
|
|
2585
|
-
const $ = h + O / (e(C).length - 1) *
|
|
2585
|
+
const $ = h + O / (e(C).length - 1) * p, Y = Math.max(0.05, S / 100), ce = O % 2 === 0 ? -1 : 1, U = e(A) + ce * Y * e(X);
|
|
2586
2586
|
return { x: $, y: U };
|
|
2587
2587
|
});
|
|
2588
2588
|
});
|
|
2589
|
-
function V(h,
|
|
2589
|
+
function V(h, p) {
|
|
2590
2590
|
if (h.length === 0)
|
|
2591
2591
|
return "";
|
|
2592
2592
|
let S = `M ${h[0].x} ${h[0].y}`;
|
|
2593
2593
|
for (let O = 1; O < h.length; O++) {
|
|
2594
2594
|
const $ = h[O - 1], Y = h[O];
|
|
2595
|
-
if (
|
|
2595
|
+
if (p) {
|
|
2596
2596
|
const ce = $.x + (Y.x - $.x) / 3, U = $.y, re = $.x + (Y.x - $.x) * 2 / 3, ne = Y.y;
|
|
2597
2597
|
S += ` C ${ce} ${U}, ${re} ${ne}, ${Y.x} ${Y.y}`;
|
|
2598
2598
|
} else
|
|
@@ -2603,33 +2603,33 @@ function xa(y, t) {
|
|
|
2603
2603
|
const k = W(() => V(e(R), !a())), D = W(() => {
|
|
2604
2604
|
if (e(B) <= 0 || e(I) === 0)
|
|
2605
2605
|
return 0;
|
|
2606
|
-
const h = o() / 2,
|
|
2607
|
-
return h + e(B) *
|
|
2606
|
+
const h = o() / 2, p = e(I) - h * 2;
|
|
2607
|
+
return h + e(B) * p;
|
|
2608
2608
|
}), T = W(() => {
|
|
2609
2609
|
if (e(R).length === 0 || e(D) <= 0)
|
|
2610
2610
|
return "";
|
|
2611
2611
|
const h = [];
|
|
2612
|
-
let
|
|
2612
|
+
let p = null;
|
|
2613
2613
|
for (let O = 0; O < e(R).length; O++)
|
|
2614
2614
|
if (e(R)[O].x <= e(D))
|
|
2615
2615
|
h.push(e(R)[O]);
|
|
2616
2616
|
else {
|
|
2617
|
-
|
|
2617
|
+
p = e(R)[O];
|
|
2618
2618
|
break;
|
|
2619
2619
|
}
|
|
2620
2620
|
if (h.length === 0)
|
|
2621
2621
|
return "";
|
|
2622
2622
|
const S = h[h.length - 1];
|
|
2623
|
-
if (
|
|
2624
|
-
const O = (e(D) - S.x) / (
|
|
2623
|
+
if (p && S.x < e(D)) {
|
|
2624
|
+
const O = (e(D) - S.x) / (p.x - S.x), $ = S.y + O * (p.y - S.y);
|
|
2625
2625
|
h.push({ x: e(D), y: $ });
|
|
2626
2626
|
}
|
|
2627
2627
|
return V(h, !a());
|
|
2628
2628
|
});
|
|
2629
2629
|
me(() => {
|
|
2630
|
-
e(j) ?
|
|
2630
|
+
e(j) ? g.removeAttribute("data-placeholder") : g.setAttribute("data-placeholder", "");
|
|
2631
2631
|
});
|
|
2632
|
-
const L =
|
|
2632
|
+
const L = dt(() => e(f), () => e(_), () => e(l).getBoundingClientRect()), M = ft(() => e(f), () => e(_), () => e(s));
|
|
2633
2633
|
var z = {
|
|
2634
2634
|
get for() {
|
|
2635
2635
|
return i();
|
|
@@ -2655,12 +2655,12 @@ function xa(y, t) {
|
|
|
2655
2655
|
set sharp(h = !1) {
|
|
2656
2656
|
a(h), c();
|
|
2657
2657
|
}
|
|
2658
|
-
},
|
|
2659
|
-
|
|
2660
|
-
var E = G(
|
|
2658
|
+
}, v = ba();
|
|
2659
|
+
v.__click = L, v.__keydown = M;
|
|
2660
|
+
var E = G(v), Q = G(E);
|
|
2661
2661
|
{
|
|
2662
2662
|
var oe = (h) => {
|
|
2663
|
-
var
|
|
2663
|
+
var p = ha(), S = J(p);
|
|
2664
2664
|
let O;
|
|
2665
2665
|
var $ = ye(S);
|
|
2666
2666
|
{
|
|
@@ -2669,7 +2669,7 @@ function xa(y, t) {
|
|
|
2669
2669
|
let re;
|
|
2670
2670
|
H(
|
|
2671
2671
|
(ne) => {
|
|
2672
|
-
re =
|
|
2672
|
+
re = fe(U, 0, "line progress svelte-1j1dyl9", null, re, ne), Z(U, "d", e(T)), Z(U, "stroke-width", o());
|
|
2673
2673
|
},
|
|
2674
2674
|
[() => ({ sharp: a() })]
|
|
2675
2675
|
), x(ce, U);
|
|
@@ -2680,12 +2680,12 @@ function xa(y, t) {
|
|
|
2680
2680
|
}
|
|
2681
2681
|
H(
|
|
2682
2682
|
(ce) => {
|
|
2683
|
-
O =
|
|
2683
|
+
O = fe(S, 0, "line track svelte-1j1dyl9", null, O, ce), Z(S, "d", e(k)), Z(S, "stroke-width", o());
|
|
2684
2684
|
},
|
|
2685
2685
|
[() => ({ sharp: a() })]
|
|
2686
|
-
), x(h,
|
|
2686
|
+
), x(h, p);
|
|
2687
2687
|
}, w = (h) => {
|
|
2688
|
-
var
|
|
2688
|
+
var p = ee(), S = J(p);
|
|
2689
2689
|
{
|
|
2690
2690
|
var O = ($) => {
|
|
2691
2691
|
var Y = ma();
|
|
@@ -2696,20 +2696,20 @@ function xa(y, t) {
|
|
|
2696
2696
|
K(
|
|
2697
2697
|
S,
|
|
2698
2698
|
($) => {
|
|
2699
|
-
e(
|
|
2699
|
+
e(d) && $(O);
|
|
2700
2700
|
},
|
|
2701
2701
|
!0
|
|
2702
2702
|
);
|
|
2703
2703
|
}
|
|
2704
|
-
x(h,
|
|
2704
|
+
x(h, p);
|
|
2705
2705
|
};
|
|
2706
2706
|
K(Q, (h) => {
|
|
2707
|
-
e(
|
|
2707
|
+
e(d) && e(k) ? h(oe) : h(w, !1);
|
|
2708
2708
|
});
|
|
2709
2709
|
}
|
|
2710
|
-
return N(E), N(
|
|
2711
|
-
Z(
|
|
2712
|
-
}), x(y,
|
|
2710
|
+
return N(E), N(v), Ee(v, (h) => m(l, h), () => e(l)), H(() => {
|
|
2711
|
+
Z(v, "aria-valuemax", e(_)), Z(v, "aria-valuenow", e(s)), Z(E, "height", r()), Z(E, "viewBox", `0 0 ${e(I)} ${r()}`);
|
|
2712
|
+
}), x(y, v), ge(z);
|
|
2713
2713
|
}
|
|
2714
2714
|
Ne(["click", "keydown"]);
|
|
2715
2715
|
customElements.define("fortyfour-line-waveform", ue(
|
|
@@ -2734,14 +2734,14 @@ const ka = {
|
|
|
2734
2734
|
};
|
|
2735
2735
|
function za(y, t) {
|
|
2736
2736
|
pe(t, !0), be(y, ka);
|
|
2737
|
-
const
|
|
2737
|
+
const g = t.$$host;
|
|
2738
2738
|
let i = u(t, "for", 7, ""), o = u(t, "barHeight", 7, 4), r = u(t, "barRadius", 7, 2), a = q(0), n = q(0), s = q(null), _ = q(null);
|
|
2739
2739
|
me(() => {
|
|
2740
2740
|
if (!i()) {
|
|
2741
2741
|
console.warn("fortyfour-progress-bar: 'for' attribute is required");
|
|
2742
2742
|
return;
|
|
2743
2743
|
}
|
|
2744
|
-
const A =
|
|
2744
|
+
const A = g.getRootNode();
|
|
2745
2745
|
if (m(s, A.getElementById(i()), !0), !e(s)) {
|
|
2746
2746
|
console.warn(`fortyfour-progress-bar: element with id "${i()}" not found`);
|
|
2747
2747
|
return;
|
|
@@ -2757,7 +2757,7 @@ function za(y, t) {
|
|
|
2757
2757
|
e(s).removeEventListener("loadedmetadata", X), e(s).removeEventListener("timeupdate", R);
|
|
2758
2758
|
};
|
|
2759
2759
|
});
|
|
2760
|
-
const
|
|
2760
|
+
const f = W(() => e(n) > 0 ? e(a) / e(n) * 100 : 0), I = dt(() => e(s), () => e(n), () => e(_)?.getBoundingClientRect()), d = ft(() => e(s), () => e(n), () => e(a));
|
|
2761
2761
|
var l = {
|
|
2762
2762
|
get for() {
|
|
2763
2763
|
return i();
|
|
@@ -2778,7 +2778,7 @@ function za(y, t) {
|
|
|
2778
2778
|
r(A), c();
|
|
2779
2779
|
}
|
|
2780
2780
|
}, P = _a();
|
|
2781
|
-
P.__click = I, P.__keydown =
|
|
2781
|
+
P.__click = I, P.__keydown = d;
|
|
2782
2782
|
var b = G(P);
|
|
2783
2783
|
let j;
|
|
2784
2784
|
var C = G(b);
|
|
@@ -2793,7 +2793,7 @@ function za(y, t) {
|
|
|
2793
2793
|
"border-radius": `${r() ?? ""}px`
|
|
2794
2794
|
}),
|
|
2795
2795
|
() => ({
|
|
2796
|
-
width: `${e(
|
|
2796
|
+
width: `${e(f) ?? ""}%`,
|
|
2797
2797
|
"border-radius": `${r() ?? ""}px`
|
|
2798
2798
|
})
|
|
2799
2799
|
]
|
|
@@ -2823,31 +2823,31 @@ const Ha = {
|
|
|
2823
2823
|
};
|
|
2824
2824
|
function Wa(y, t) {
|
|
2825
2825
|
pe(t, !0), be(y, Ha);
|
|
2826
|
-
const
|
|
2826
|
+
const g = t.$$host;
|
|
2827
2827
|
let i = u(t, "for", 7, ""), o = u(t, "mode", 7, "static"), r = u(t, "maxHeight", 7, 0), a = q(null);
|
|
2828
2828
|
const n = W(() => r() > 0);
|
|
2829
2829
|
let s = q(!1), _ = q(!1);
|
|
2830
|
-
function
|
|
2830
|
+
function f() {
|
|
2831
2831
|
if (!e(a) || !e(n)) {
|
|
2832
2832
|
m(s, !1), m(_, !1);
|
|
2833
2833
|
return;
|
|
2834
2834
|
}
|
|
2835
|
-
const { scrollTop: w, scrollHeight: h, clientHeight:
|
|
2836
|
-
m(s, w > 1), m(_, w +
|
|
2835
|
+
const { scrollTop: w, scrollHeight: h, clientHeight: p } = e(a);
|
|
2836
|
+
m(s, w > 1), m(_, w + p < h - 1);
|
|
2837
2837
|
}
|
|
2838
|
-
let I = q(null),
|
|
2839
|
-
const b = st(() => e(I) === null, 200), j = W(() => e(I) !== null ? !1 : e(l) === "none" ? !0 : b()), C = W(() => e(
|
|
2838
|
+
let I = q(null), d = q(null), l = q("none"), P = q(0);
|
|
2839
|
+
const b = st(() => e(I) === null, 200), j = W(() => e(I) !== null ? !1 : e(l) === "none" ? !0 : b()), C = W(() => e(d) !== null && e(d).length > 0), B = W(() => !e(C) || o() === "static" ? -1 : e(d).findIndex((w) => e(P) >= w.start && e(P) <= w.end));
|
|
2840
2840
|
function A(w) {
|
|
2841
2841
|
const h = [];
|
|
2842
|
-
let
|
|
2842
|
+
let p = { words: [], start: 0, end: 0 };
|
|
2843
2843
|
for (const S of w) {
|
|
2844
|
-
|
|
2844
|
+
p.words.length === 0 && (p.start = S.start), p.words.push(S), p.end = S.end;
|
|
2845
2845
|
const O = S.text.trim();
|
|
2846
|
-
(O.endsWith(".") || O.endsWith("?") || O.endsWith("!")) && (h.push(
|
|
2846
|
+
(O.endsWith(".") || O.endsWith("?") || O.endsWith("!")) && (h.push(p), p = { words: [], start: 0, end: 0 });
|
|
2847
2847
|
}
|
|
2848
|
-
return
|
|
2848
|
+
return p.words.length > 0 && h.push(p), h;
|
|
2849
2849
|
}
|
|
2850
|
-
const X = W(() => e(C) ? A(e(
|
|
2850
|
+
const X = W(() => e(C) ? A(e(d)) : []), R = W(() => o() !== "subtitle" || e(X).length === 0 ? null : e(X).find((w) => e(P) >= w.start && e(P) <= w.end) ?? null);
|
|
2851
2851
|
function V(w) {
|
|
2852
2852
|
return e(P) >= w.start && e(P) <= w.end;
|
|
2853
2853
|
}
|
|
@@ -2859,17 +2859,17 @@ function Wa(y, t) {
|
|
|
2859
2859
|
console.warn("fortyfour-transcription: 'for' attribute is required");
|
|
2860
2860
|
return;
|
|
2861
2861
|
}
|
|
2862
|
-
const h =
|
|
2862
|
+
const h = g.getRootNode().getElementById(i());
|
|
2863
2863
|
if (!h) {
|
|
2864
2864
|
console.warn(`fortyfour-transcription: element with id "${i()}" not found`);
|
|
2865
2865
|
return;
|
|
2866
2866
|
}
|
|
2867
2867
|
m(l, h.getAttribute("preload") || "none", !0);
|
|
2868
|
-
const
|
|
2869
|
-
|
|
2868
|
+
const p = h.metadata;
|
|
2869
|
+
p && (m(I, p.transcription ?? null, !0), m(d, p.words ?? null, !0)), h.currentTime && m(P, h.currentTime, !0);
|
|
2870
2870
|
function S() {
|
|
2871
2871
|
const $ = h.metadata;
|
|
2872
|
-
m(I, $?.transcription ?? null, !0), m(
|
|
2872
|
+
m(I, $?.transcription ?? null, !0), m(d, $?.words ?? null, !0);
|
|
2873
2873
|
}
|
|
2874
2874
|
function O() {
|
|
2875
2875
|
m(P, h.currentTime, !0);
|
|
@@ -2877,13 +2877,13 @@ function Wa(y, t) {
|
|
|
2877
2877
|
return h.addEventListener("loadedmetadata", S), h.addEventListener("timeupdate", O), () => {
|
|
2878
2878
|
h.removeEventListener("loadedmetadata", S), h.removeEventListener("timeupdate", O);
|
|
2879
2879
|
};
|
|
2880
|
-
}), Oe(
|
|
2880
|
+
}), Oe(g, "data-placeholder", () => e(j)), me(() => {
|
|
2881
2881
|
if (!e(a) || !e(n))
|
|
2882
2882
|
return;
|
|
2883
|
-
|
|
2884
|
-
const w = new ResizeObserver(
|
|
2883
|
+
f(), e(a).addEventListener("scroll", f);
|
|
2884
|
+
const w = new ResizeObserver(f);
|
|
2885
2885
|
return w.observe(e(a)), () => {
|
|
2886
|
-
e(a).removeEventListener("scroll",
|
|
2886
|
+
e(a).removeEventListener("scroll", f), w.disconnect();
|
|
2887
2887
|
};
|
|
2888
2888
|
}), me(() => {
|
|
2889
2889
|
if (!e(n) || o() !== "karaoke")
|
|
@@ -2896,7 +2896,7 @@ function Wa(y, t) {
|
|
|
2896
2896
|
return;
|
|
2897
2897
|
const w = e(a)?.querySelector(".word.active");
|
|
2898
2898
|
if (w) {
|
|
2899
|
-
const h = e(a).getBoundingClientRect(),
|
|
2899
|
+
const h = e(a).getBoundingClientRect(), p = w.getBoundingClientRect(), S = e(a).scrollTop + (p.top - h.top) - h.height / 2 + p.height / 2;
|
|
2900
2900
|
e(a).scrollTo({ top: S, behavior: "smooth" });
|
|
2901
2901
|
}
|
|
2902
2902
|
});
|
|
@@ -2922,18 +2922,18 @@ function Wa(y, t) {
|
|
|
2922
2922
|
}, T = Ca();
|
|
2923
2923
|
let L;
|
|
2924
2924
|
var M = G(T);
|
|
2925
|
-
let z,
|
|
2925
|
+
let z, v;
|
|
2926
2926
|
var E = G(M);
|
|
2927
2927
|
{
|
|
2928
2928
|
var Q = (w) => {
|
|
2929
|
-
var h = La(),
|
|
2930
|
-
Be(
|
|
2929
|
+
var h = La(), p = G(h);
|
|
2930
|
+
Be(p, 21, () => e(d), Ae, (S, O, $) => {
|
|
2931
2931
|
var Y = Pa();
|
|
2932
2932
|
let ce;
|
|
2933
2933
|
var U = G(Y, !0);
|
|
2934
2934
|
N(Y), H(
|
|
2935
2935
|
(re) => {
|
|
2936
|
-
ce =
|
|
2936
|
+
ce = fe(Y, 1, "word svelte-1lixazt", null, ce, re), Z(Y, "data-type", e(O).type), je(U, e(O).text);
|
|
2937
2937
|
},
|
|
2938
2938
|
[
|
|
2939
2939
|
() => ({
|
|
@@ -2942,9 +2942,9 @@ function Wa(y, t) {
|
|
|
2942
2942
|
})
|
|
2943
2943
|
]
|
|
2944
2944
|
), x(S, Y);
|
|
2945
|
-
}), N(
|
|
2945
|
+
}), N(p), N(h), ze(1, h, () => Pe, () => ({ duration: 400 })), x(w, h);
|
|
2946
2946
|
}, oe = (w) => {
|
|
2947
|
-
var h = ee(),
|
|
2947
|
+
var h = ee(), p = J(h);
|
|
2948
2948
|
{
|
|
2949
2949
|
var S = ($) => {
|
|
2950
2950
|
var Y = Ea(), ce = G(Y);
|
|
@@ -2952,12 +2952,12 @@ function Wa(y, t) {
|
|
|
2952
2952
|
var U = (re) => {
|
|
2953
2953
|
var ne = Ia();
|
|
2954
2954
|
Be(ne, 21, () => e(R).words, Ae, (ie, ve) => {
|
|
2955
|
-
var
|
|
2955
|
+
var de = ja();
|
|
2956
2956
|
let ae;
|
|
2957
|
-
var he = G(
|
|
2958
|
-
N(
|
|
2957
|
+
var he = G(de, !0);
|
|
2958
|
+
N(de), H(
|
|
2959
2959
|
(le) => {
|
|
2960
|
-
ae = de
|
|
2960
|
+
ae = fe(de, 1, "word svelte-1lixazt", null, ae, le), Z(de, "data-type", e(ve).type), je(he, e(ve).text);
|
|
2961
2961
|
},
|
|
2962
2962
|
[
|
|
2963
2963
|
() => ({
|
|
@@ -2965,7 +2965,7 @@ function Wa(y, t) {
|
|
|
2965
2965
|
past: k(e(ve))
|
|
2966
2966
|
})
|
|
2967
2967
|
]
|
|
2968
|
-
), x(ie,
|
|
2968
|
+
), x(ie, de);
|
|
2969
2969
|
}), N(ne), ze(1, ne, () => Pe, () => ({ duration: 200 })), x(re, ne);
|
|
2970
2970
|
};
|
|
2971
2971
|
K(ce, (re) => {
|
|
@@ -2978,7 +2978,7 @@ function Wa(y, t) {
|
|
|
2978
2978
|
{
|
|
2979
2979
|
var U = (ne) => {
|
|
2980
2980
|
var ie = Sa(), ve = G(ie);
|
|
2981
|
-
Be(ve, 21, () => e(
|
|
2981
|
+
Be(ve, 21, () => e(d), Ae, (de, ae, he) => {
|
|
2982
2982
|
var le = ee(), se = J(le);
|
|
2983
2983
|
{
|
|
2984
2984
|
var xe = (_e) => {
|
|
@@ -2987,7 +2987,7 @@ function Wa(y, t) {
|
|
|
2987
2987
|
var Se = G(we, !0);
|
|
2988
2988
|
N(we), H(
|
|
2989
2989
|
(He) => {
|
|
2990
|
-
ke =
|
|
2990
|
+
ke = fe(we, 1, "word svelte-1lixazt", null, ke, He), Z(we, "data-type", e(ae).type), je(Se, e(ae).text);
|
|
2991
2991
|
},
|
|
2992
2992
|
[() => ({ active: he === e(B) })]
|
|
2993
2993
|
), ze(1, we, () => Pe, () => ({ duration: 150 })), x(_e, we);
|
|
@@ -2996,12 +2996,12 @@ function Wa(y, t) {
|
|
|
2996
2996
|
e(P) >= e(ae).start && _e(xe);
|
|
2997
2997
|
});
|
|
2998
2998
|
}
|
|
2999
|
-
x(
|
|
2999
|
+
x(de, le);
|
|
3000
3000
|
}), N(ve), N(ie), ze(1, ie, () => Pe, () => ({ duration: 400 })), x(ne, ie);
|
|
3001
3001
|
}, re = (ne) => {
|
|
3002
3002
|
var ie = ee(), ve = J(ie);
|
|
3003
3003
|
{
|
|
3004
|
-
var
|
|
3004
|
+
var de = (he) => {
|
|
3005
3005
|
var le = Ta(), se = G(le), xe = G(se, !0);
|
|
3006
3006
|
N(se), N(le), H(() => je(xe, e(I))), ze(1, le, () => Pe, () => ({ duration: 400 })), x(he, le);
|
|
3007
3007
|
}, ae = (he) => {
|
|
@@ -3027,7 +3027,7 @@ function Wa(y, t) {
|
|
|
3027
3027
|
K(
|
|
3028
3028
|
ve,
|
|
3029
3029
|
(he) => {
|
|
3030
|
-
e(I) ? he(
|
|
3030
|
+
e(I) ? he(de) : he(ae, !1);
|
|
3031
3031
|
},
|
|
3032
3032
|
!0
|
|
3033
3033
|
);
|
|
@@ -3045,7 +3045,7 @@ function Wa(y, t) {
|
|
|
3045
3045
|
x($, Y);
|
|
3046
3046
|
};
|
|
3047
3047
|
K(
|
|
3048
|
-
|
|
3048
|
+
p,
|
|
3049
3049
|
($) => {
|
|
3050
3050
|
o() === "subtitle" && e(C) ? $(S) : $(O, !1);
|
|
3051
3051
|
},
|
|
@@ -3059,8 +3059,8 @@ function Wa(y, t) {
|
|
|
3059
3059
|
});
|
|
3060
3060
|
}
|
|
3061
3061
|
return N(M), Ee(M, (w) => m(a, w), () => e(a)), N(T), H(
|
|
3062
|
-
(w, h,
|
|
3063
|
-
L =
|
|
3062
|
+
(w, h, p) => {
|
|
3063
|
+
L = fe(T, 1, "wrapper svelte-1lixazt", null, L, w), z = fe(M, 1, "container svelte-1lixazt", null, z, h), v = Le(M, "", v, p);
|
|
3064
3064
|
},
|
|
3065
3065
|
[
|
|
3066
3066
|
() => ({
|
|
@@ -3097,7 +3097,7 @@ const Na = {
|
|
|
3097
3097
|
};
|
|
3098
3098
|
function Da(y, t) {
|
|
3099
3099
|
pe(t, !0), be(y, Na);
|
|
3100
|
-
const
|
|
3100
|
+
const g = t.$$host;
|
|
3101
3101
|
let i = u(t, "for", 7, ""), o = u(t, "maxHeight", 7, 0), r = q(null);
|
|
3102
3102
|
const a = W(() => o() > 0);
|
|
3103
3103
|
let n = q(!1), s = q(!1);
|
|
@@ -3109,35 +3109,35 @@ function Da(y, t) {
|
|
|
3109
3109
|
const { scrollTop: T, scrollHeight: L, clientHeight: M } = e(r);
|
|
3110
3110
|
m(n, T > 1), m(s, T + M < L - 1);
|
|
3111
3111
|
}
|
|
3112
|
-
let
|
|
3113
|
-
function
|
|
3112
|
+
let f = q(null), I = q("none");
|
|
3113
|
+
function d(T) {
|
|
3114
3114
|
if (!T)
|
|
3115
3115
|
return T;
|
|
3116
3116
|
const L = document.createElement("textarea");
|
|
3117
3117
|
return L.innerHTML = T, L.value;
|
|
3118
3118
|
}
|
|
3119
|
-
const l = W(() =>
|
|
3119
|
+
const l = W(() => d(e(f))), P = st(() => e(f) === null, 200), b = W(() => e(f) !== null ? !1 : e(I) === "none" ? !0 : P());
|
|
3120
3120
|
me(() => {
|
|
3121
3121
|
if (!i()) {
|
|
3122
3122
|
console.warn("fortyfour-translation: 'for' attribute is required");
|
|
3123
3123
|
return;
|
|
3124
3124
|
}
|
|
3125
|
-
const L =
|
|
3125
|
+
const L = g.getRootNode().getElementById(i());
|
|
3126
3126
|
if (!L) {
|
|
3127
3127
|
console.warn(`fortyfour-translation: element with id "${i()}" not found`);
|
|
3128
3128
|
return;
|
|
3129
3129
|
}
|
|
3130
3130
|
m(I, L.getAttribute("preload") || "none", !0);
|
|
3131
3131
|
const M = L.metadata;
|
|
3132
|
-
M && m(
|
|
3132
|
+
M && m(f, M.translation ?? null, !0);
|
|
3133
3133
|
function z() {
|
|
3134
|
-
const
|
|
3135
|
-
m(
|
|
3134
|
+
const v = L.metadata;
|
|
3135
|
+
m(f, v?.translation ?? null, !0);
|
|
3136
3136
|
}
|
|
3137
3137
|
return L.addEventListener("loadedmetadata", z), () => {
|
|
3138
3138
|
L.removeEventListener("loadedmetadata", z);
|
|
3139
3139
|
};
|
|
3140
|
-
}), Oe(
|
|
3140
|
+
}), Oe(g, "data-placeholder", () => e(b)), me(() => {
|
|
3141
3141
|
if (!e(r) || !e(a))
|
|
3142
3142
|
return;
|
|
3143
3143
|
_(), e(r).addEventListener("scroll", _);
|
|
@@ -3171,17 +3171,17 @@ function Da(y, t) {
|
|
|
3171
3171
|
}, D = (T) => {
|
|
3172
3172
|
var L = ee(), M = J(L);
|
|
3173
3173
|
{
|
|
3174
|
-
var z = (
|
|
3174
|
+
var z = (v) => {
|
|
3175
3175
|
var E = Aa();
|
|
3176
3176
|
let Q;
|
|
3177
3177
|
H((oe) => Q = Le(E, "", Q, oe), [
|
|
3178
3178
|
() => ({ height: e(a) ? `${o()}px` : void 0 })
|
|
3179
|
-
]), x(
|
|
3179
|
+
]), x(v, E);
|
|
3180
3180
|
};
|
|
3181
3181
|
K(
|
|
3182
3182
|
M,
|
|
3183
|
-
(
|
|
3184
|
-
e(b) &&
|
|
3183
|
+
(v) => {
|
|
3184
|
+
e(b) && v(z);
|
|
3185
3185
|
},
|
|
3186
3186
|
!0
|
|
3187
3187
|
);
|
|
@@ -3194,7 +3194,7 @@ function Da(y, t) {
|
|
|
3194
3194
|
}
|
|
3195
3195
|
return N(A), Ee(A, (T) => m(r, T), () => e(r)), N(C), H(
|
|
3196
3196
|
(T, L, M) => {
|
|
3197
|
-
B =
|
|
3197
|
+
B = fe(C, 1, "wrapper svelte-z1j7sg", null, B, T), X = fe(A, 1, "container svelte-z1j7sg", null, X, L), R = Le(A, "", R, M);
|
|
3198
3198
|
},
|
|
3199
3199
|
[
|
|
3200
3200
|
() => ({
|
|
@@ -3222,13 +3222,13 @@ customElements.define("fortyfour-translation", ue(
|
|
|
3222
3222
|
var Oa = Me('<svg viewBox="0 0 359 254" aria-label="44" fill="currentColor"><path d="M92,300 C92.2666667,290.933333 92.8,280.533333 93.6,268.8 C93.8666667,262.666667 94,258.4 94,256 L6,256 L6,161.2 C7.33333333,159.333333 9.2,156.533333 11.6,152.8 C27.0666667,129.866667 39.3333333,110.733333 48.4,95.4 C57.4666667,80.0666667 65.2,63.8666667 71.6,46.8 L186,46.8 C128.4,122.533333 85.8666667,187.066667 58.4,240.4 L94,240.4 C94,240.133333 94,239.6 94,238.8 C93.4666667,228.666667 92.8,219.6 92,211.6 L185.2,72.4 C181.733333,91.0666667 180,127.333333 180,181.2 C180,235.066667 181.733333,274.666667 185.2,300 L92,300 Z" transform="translate(-6, -46)"></path><path d="M271,300 C271.266667,290.933333 271.8,280.533333 272.6,268.8 C272.866667,262.666667 273,258.4 273,256 L185,256 L185,161.2 C186.333333,159.333333 188.2,156.533333 190.6,152.8 C206.066667,129.866667 218.333333,110.733333 227.4,95.4 C236.466667,80.0666667 244.2,63.8666667 250.6,46.8 L365,46.8 C307.4,122.533333 264.866667,187.066667 237.4,240.4 L273,240.4 C273,240.133333 273,239.6 273,238.8 C272.466667,228.666667 271.8,219.6 271,211.6 L364.2,72.4 C360.733333,91.0666667 359,127.333333 359,181.2 C359,235.066667 360.733333,274.666667 364.2,300 L271,300 Z" transform="translate(-6, -46)"></path></svg>');
|
|
3223
3223
|
function Ct(y, t) {
|
|
3224
3224
|
pe(t, !0);
|
|
3225
|
-
let
|
|
3225
|
+
let g = u(t, "class", 7, ""), i = u(t, "height", 7, "1em"), o = u(t, "width", 7, "auto");
|
|
3226
3226
|
var r = {
|
|
3227
3227
|
get class() {
|
|
3228
|
-
return
|
|
3228
|
+
return g();
|
|
3229
3229
|
},
|
|
3230
3230
|
set class(n = "") {
|
|
3231
|
-
|
|
3231
|
+
g(n), c();
|
|
3232
3232
|
},
|
|
3233
3233
|
get height() {
|
|
3234
3234
|
return i();
|
|
@@ -3244,31 +3244,31 @@ function Ct(y, t) {
|
|
|
3244
3244
|
}
|
|
3245
3245
|
}, a = Oa();
|
|
3246
3246
|
return H(() => {
|
|
3247
|
-
|
|
3247
|
+
fe(a, 0, nt(g())), Z(a, "height", i()), Z(a, "width", o());
|
|
3248
3248
|
}), x(y, a), ge(r);
|
|
3249
3249
|
}
|
|
3250
3250
|
ue(Ct, { class: {}, height: {}, width: {} }, [], [], !0);
|
|
3251
|
-
var Ua = F("<fortyfour-progress-bar></fortyfour-progress-bar>", 2), Fa = F("<fortyfour-line-waveform></fortyfour-line-waveform>", 2), Ga = F("<fortyfour-bar-waveform></fortyfour-bar-waveform>", 2), Ka = (y, t) => m(t, !e(t)), Va = F('<span class="label-separator svelte-
|
|
3251
|
+
var Ua = F("<fortyfour-progress-bar></fortyfour-progress-bar>", 2), Fa = F("<fortyfour-line-waveform></fortyfour-line-waveform>", 2), Ga = F("<fortyfour-bar-waveform></fortyfour-bar-waveform>", 2), Ka = (y, t) => m(t, !e(t)), Va = F('<span class="label-separator svelte-1duyr35">•</span> <button class="translation-toggle svelte-1duyr35"> </button>', 1), Xa = F("<fortyfour-translation></fortyfour-translation>", 2), Ya = F("<fortyfour-transcription></fortyfour-transcription>", 2), Za = F('<div class="transcription-box svelte-1duyr35"><div class="transcription-header svelte-1duyr35"><span class="transcription-label svelte-1duyr35">TRANSCRIPT</span> <!></div> <!></div>'), Ja = F('<a class="branding svelte-1duyr35" href="https://44.audio" target="_blank" rel="noopener noreferrer"><span class="branding-text svelte-1duyr35">powered by</span> <!></a>'), Qa = F('<fortyfour-recording></fortyfour-recording> <div><div class="player svelte-1duyr35"><fortyfour-play-button></fortyfour-play-button> <!> <div class="duration svelte-1duyr35"><fortyfour-duration><span slot="placeholder">0:00</span></fortyfour-duration> <span class="separator svelte-1duyr35">/</span> <fortyfour-duration><span slot="placeholder">0:00</span></fortyfour-duration></div></div> <!></div> <!>', 3);
|
|
3252
3252
|
const $a = {
|
|
3253
|
-
hash: "svelte-
|
|
3253
|
+
hash: "svelte-1duyr35",
|
|
3254
3254
|
code: `:host {--fortyfour-player-font-family: system-ui, sans-serif;--fortyfour-player-font-size: 14px;--fortyfour-player-accent: #c4956a;--fortyfour-player-background: #faf8f5;--fortyfour-player-surface: #f0ede8;--fortyfour-player-text: #2c2620;--fortyfour-player-muted: #8c8279;--fortyfour-player-border: #d9d4cc;display:block;font-family:var(--fortyfour-player-font-family);font-size:var(--fortyfour-player-font-size);}
|
|
3255
3255
|
|
|
3256
3256
|
@media (prefers-color-scheme: dark) {:host {--fortyfour-player-accent: #d4a574;--fortyfour-player-background: #1c1917;--fortyfour-player-surface: #262220;--fortyfour-player-text: #e7e0d5;--fortyfour-player-muted: #9c938a;--fortyfour-player-border: #3d3632;}
|
|
3257
|
-
}.container.svelte-
|
|
3258
|
-
fortyfour-line-waveform.svelte-
|
|
3259
|
-
fortyfour-progress-bar.svelte-
|
|
3260
|
-
fortyfour-translation.svelte-
|
|
3257
|
+
}.container.svelte-1duyr35 {border:1px solid var(--fortyfour-player-border);border-radius:12px;background:var(--fortyfour-player-background);overflow:hidden;}.container.square.svelte-1duyr35 {border-radius:0;}.container.compact.svelte-1duyr35 .player:where(.svelte-1duyr35) {height:44px;padding:0.5rem 0.75rem;gap:0.75rem;}.container.compact.svelte-1duyr35 .transcription-box:where(.svelte-1duyr35) {padding:0.5rem 0.75rem;}.container.compact.svelte-1duyr35 fortyfour-play-button:where(.svelte-1duyr35) {--fortyfour-play-button-size: 40px;}.container.comfortable.svelte-1duyr35 .player:where(.svelte-1duyr35) {height:68px;padding:1rem 1.25rem;gap:1.25rem;}.container.comfortable.svelte-1duyr35 .transcription-box:where(.svelte-1duyr35) {padding:1rem 1.25rem;}.container.comfortable.svelte-1duyr35 fortyfour-play-button:where(.svelte-1duyr35) {--fortyfour-play-button-size: 56px;}.player.svelte-1duyr35 {display:flex;align-items:center;gap:1rem;height:56px;padding:0.75rem 1rem;}fortyfour-play-button.svelte-1duyr35 {--fortyfour-play-button-size: 48px;--fortyfour-play-button-background-color: var(--fortyfour-player-accent);--fortyfour-play-button-icon-color: var(--fortyfour-player-background);--fortyfour-play-button-border-width: 0;--fortyfour-play-button-focus-color: var(--fortyfour-player-accent);flex-shrink:0;}fortyfour-bar-waveform.svelte-1duyr35,
|
|
3258
|
+
fortyfour-line-waveform.svelte-1duyr35,
|
|
3259
|
+
fortyfour-progress-bar.svelte-1duyr35 {height:100%;flex:1;}fortyfour-bar-waveform.svelte-1duyr35 {--waveform-progress-color: var(--fortyfour-player-accent);--waveform-track-color: var(--fortyfour-player-border);--waveform-focus-color: var(--fortyfour-player-accent);}fortyfour-line-waveform.svelte-1duyr35 {--fortyfour-line-waveform-progress-color: var(--fortyfour-player-accent);--fortyfour-line-waveform-track-color: var(--fortyfour-player-border);--fortyfour-line-waveform-focus-color: var(--fortyfour-player-accent);}fortyfour-progress-bar.svelte-1duyr35 {--fortyfour-progress-bar-progress-color: var(--fortyfour-player-accent);--fortyfour-progress-bar-track-color: var(--fortyfour-player-border);--fortyfour-progress-bar-focus-color: var(--fortyfour-player-accent);}.duration.svelte-1duyr35 {display:flex;align-items:center;gap:0.25rem;flex-shrink:0;}.elapsed.svelte-1duyr35 {--fortyfour-duration-font-family: var(--fortyfour-player-font-family);--fortyfour-duration-font-size: 1em;--fortyfour-duration-color: var(--fortyfour-player-text);font-weight:500;}.separator.svelte-1duyr35 {font-size:1em;color:var(--fortyfour-player-muted);}.total.svelte-1duyr35 {--fortyfour-duration-font-family: var(--fortyfour-player-font-family);--fortyfour-duration-font-size: 1em;--fortyfour-duration-color: var(--fortyfour-player-muted);}.transcription-box.svelte-1duyr35 {background:var(--fortyfour-player-surface);padding:0.75rem 1rem;border-top:1px solid var(--fortyfour-player-border);}.transcription-header.svelte-1duyr35 {display:flex;align-items:center;gap:0.5em;margin-bottom:0.5rem;}.transcription-label.svelte-1duyr35 {font-size:0.7em;font-weight:600;letter-spacing:0.05em;color:var(--fortyfour-player-muted);}.label-separator.svelte-1duyr35 {font-size:0.7em;color:var(--fortyfour-player-muted);}.translation-toggle.svelte-1duyr35 {font-size:0.7em;font-weight:600;letter-spacing:0.05em;color:var(--fortyfour-player-accent);background:none;border:none;padding:0;cursor:pointer;}.translation-toggle.svelte-1duyr35:hover {text-decoration:underline;}.translation-toggle.svelte-1duyr35:focus-visible {outline:2px solid var(--fortyfour-player-accent);outline-offset:2px;border-radius:2px;}fortyfour-transcription.svelte-1duyr35,
|
|
3260
|
+
fortyfour-translation.svelte-1duyr35 {display:block;line-height:1.5;color:var(--fortyfour-player-text);--fortyfour-transcription-font-family: var(--fortyfour-player-font-family);--fortyfour-transcription-font-size: 1em;--fortyfour-translation-font-family: var(--fortyfour-player-font-family);--fortyfour-translation-font-size: 1em;--fortyfour-transcription-color: var(--fortyfour-player-muted);--fortyfour-transcription-active-color: var(--fortyfour-player-background);--fortyfour-transcription-active-bg: var(--fortyfour-player-accent);--fortyfour-transcription-past-color: var(--fortyfour-player-text);--fortyfour-transcription-fade-color: var(--fortyfour-player-surface);--fortyfour-transcription-placeholder-color: var(--fortyfour-player-border);--fortyfour-transcription-scrollbar-thumb: var(--fortyfour-player-border);--fortyfour-transcription-scrollbar-thumb-hover: var(--fortyfour-player-muted);--fortyfour-transcription-focus-color: var(--fortyfour-player-accent);--fortyfour-translation-fade-color: var(--fortyfour-player-surface);--fortyfour-translation-placeholder-color: var(--fortyfour-player-border);--fortyfour-translation-scrollbar-thumb: var(--fortyfour-player-border);--fortyfour-translation-scrollbar-thumb-hover: var(--fortyfour-player-muted);--fortyfour-translation-focus-color: var(--fortyfour-player-accent);}.branding.svelte-1duyr35 {display:flex;align-items:center;gap:0.3em;width:fit-content;margin-left:auto;margin-top:0.5rem;margin-right:1rem;text-decoration:none;color:var(--fortyfour-player-muted);border-radius:4px;white-space:nowrap;}.branding.svelte-1duyr35:focus-visible {outline:2px solid var(--fortyfour-player-accent);outline-offset:2px;}.branding-text.svelte-1duyr35 {font-size:0.7em;font-weight:400;letter-spacing:0.01em;}`
|
|
3261
3261
|
};
|
|
3262
3262
|
function eo(y, t) {
|
|
3263
3263
|
pe(t, !0), be(y, $a);
|
|
3264
|
-
const
|
|
3265
|
-
let i = u(t, "recordingId", 7), o = u(t, "apiHost", 7, "api.44.audio"), r = u(t, "shape", 7, "rounded"), a = u(t, "preload", 7, "none"), n = u(t, "spacing", 7, "default"), s = u(t, "progress", 7, "bar-waveform"), _ = u(t, "hideTranscript", 7, !1),
|
|
3266
|
-
const
|
|
3264
|
+
const g = t.$$host;
|
|
3265
|
+
let i = u(t, "recordingId", 7), o = u(t, "apiHost", 7, "api.44.audio"), r = u(t, "shape", 7, "rounded"), a = u(t, "preload", 7, "none"), n = u(t, "spacing", 7, "default"), s = u(t, "progress", 7, "bar-waveform"), _ = u(t, "hideTranscript", 7, !1), f = u(t, "hideTranslation", 7, !1), I = u(t, "hideBranding", 7, !1);
|
|
3266
|
+
const d = `fortyfour-player-${crypto.randomUUID().slice(0, 8)}`;
|
|
3267
3267
|
let l = q(null), P = q(!1), b = q(!1);
|
|
3268
3268
|
const j = W(() => r() === "square"), C = W(() => e(j) ? "square" : "circle"), B = W(() => e(j) ? "0" : "2"), A = W(() => s() || "bar-waveform"), X = W(() => n() === "compact" ? 28 : n() === "comfortable" ? 48 : 40), R = W(() => n() === "compact" ? 4 : n() === "comfortable" ? 8 : 6);
|
|
3269
3269
|
function V() {
|
|
3270
3270
|
const U = e(l)?.state ?? "idle";
|
|
3271
|
-
|
|
3271
|
+
g.setAttribute("data-state", U);
|
|
3272
3272
|
}
|
|
3273
3273
|
function k() {
|
|
3274
3274
|
const U = e(l)?.metadata?.translation;
|
|
@@ -3321,10 +3321,10 @@ function eo(y, t) {
|
|
|
3321
3321
|
_(U), c();
|
|
3322
3322
|
},
|
|
3323
3323
|
get hideTranslation() {
|
|
3324
|
-
return
|
|
3324
|
+
return f();
|
|
3325
3325
|
},
|
|
3326
3326
|
set hideTranslation(U = !1) {
|
|
3327
|
-
|
|
3327
|
+
f(U), c();
|
|
3328
3328
|
},
|
|
3329
3329
|
get hideBranding() {
|
|
3330
3330
|
return I();
|
|
@@ -3333,30 +3333,30 @@ function eo(y, t) {
|
|
|
3333
3333
|
I(U), c();
|
|
3334
3334
|
}
|
|
3335
3335
|
}, T = Qa(), L = J(T);
|
|
3336
|
-
H(() => te(L, "id",
|
|
3336
|
+
H(() => te(L, "id", d)), H(() => te(L, "api-host", o())), H(() => te(L, "recording-id", i())), H(() => te(L, "preload", a())), Ee(L, (U) => m(l, U), () => e(l));
|
|
3337
3337
|
var M = ye(L, 2);
|
|
3338
3338
|
let z;
|
|
3339
|
-
var
|
|
3340
|
-
H(() => te(E, "for",
|
|
3339
|
+
var v = G(M), E = G(v);
|
|
3340
|
+
H(() => te(E, "for", d)), H(() => te(E, "shape", e(C))), fe(E, 1, "svelte-1duyr35");
|
|
3341
3341
|
var Q = ye(E, 2);
|
|
3342
3342
|
{
|
|
3343
3343
|
var oe = (U) => {
|
|
3344
3344
|
var re = Ua();
|
|
3345
|
-
H(() => te(re, "for",
|
|
3345
|
+
H(() => te(re, "for", d)), H(() => te(re, "bar-height", e(R))), H(() => te(re, "bar-radius", e(B))), fe(re, 1, "svelte-1duyr35"), x(U, re);
|
|
3346
3346
|
}, w = (U) => {
|
|
3347
3347
|
var re = ee(), ne = J(re);
|
|
3348
3348
|
{
|
|
3349
|
-
var ie = (
|
|
3349
|
+
var ie = (de) => {
|
|
3350
3350
|
var ae = Fa();
|
|
3351
|
-
H(() => te(ae, "for",
|
|
3352
|
-
}, ve = (
|
|
3351
|
+
H(() => te(ae, "for", d)), te(ae, "line-width", "2"), H(() => te(ae, "height", e(X))), H(() => te(ae, "sharp", e(j))), fe(ae, 1, "svelte-1duyr35"), x(de, ae);
|
|
3352
|
+
}, ve = (de) => {
|
|
3353
3353
|
var ae = Ga();
|
|
3354
|
-
H(() => te(ae, "for",
|
|
3354
|
+
H(() => te(ae, "for", d)), te(ae, "bar-width", "4"), te(ae, "bar-gap", "2"), H(() => te(ae, "bar-radius", e(B))), H(() => te(ae, "height", e(X))), fe(ae, 1, "svelte-1duyr35"), x(de, ae);
|
|
3355
3355
|
};
|
|
3356
3356
|
K(
|
|
3357
3357
|
ne,
|
|
3358
|
-
(
|
|
3359
|
-
e(A) === "line-waveform" ?
|
|
3358
|
+
(de) => {
|
|
3359
|
+
e(A) === "line-waveform" ? de(ie) : de(ve, !1);
|
|
3360
3360
|
},
|
|
3361
3361
|
!0
|
|
3362
3362
|
);
|
|
@@ -3367,11 +3367,11 @@ function eo(y, t) {
|
|
|
3367
3367
|
e(A) === "progress-bar" ? U(oe) : U(w, !1);
|
|
3368
3368
|
});
|
|
3369
3369
|
}
|
|
3370
|
-
var h = ye(Q, 2),
|
|
3371
|
-
|
|
3372
|
-
var S = ye(
|
|
3373
|
-
|
|
3374
|
-
var O = ye(
|
|
3370
|
+
var h = ye(Q, 2), p = G(h);
|
|
3371
|
+
fe(p, 1, "elapsed svelte-1duyr35"), H(() => te(p, "for", d)), te(p, "format", "elapsed");
|
|
3372
|
+
var S = ye(p, 4);
|
|
3373
|
+
fe(S, 1, "total svelte-1duyr35"), H(() => te(S, "for", d)), te(S, "format", "total"), N(h), N(v);
|
|
3374
|
+
var O = ye(v, 2);
|
|
3375
3375
|
{
|
|
3376
3376
|
var $ = (U) => {
|
|
3377
3377
|
var re = Za(), ne = G(re), ie = ye(G(ne), 2);
|
|
@@ -3383,21 +3383,21 @@ function eo(y, t) {
|
|
|
3383
3383
|
N(xe), H(() => je(_e, e(b) ? "ORIGINAL" : "TRANSLATION")), x(le, se);
|
|
3384
3384
|
};
|
|
3385
3385
|
K(ie, (le) => {
|
|
3386
|
-
e(P) && !
|
|
3386
|
+
e(P) && !f() && le(ve);
|
|
3387
3387
|
});
|
|
3388
3388
|
}
|
|
3389
3389
|
N(ne);
|
|
3390
|
-
var
|
|
3390
|
+
var de = ye(ne, 2);
|
|
3391
3391
|
{
|
|
3392
3392
|
var ae = (le) => {
|
|
3393
3393
|
var se = Xa();
|
|
3394
|
-
H(() => te(se, "for",
|
|
3394
|
+
H(() => te(se, "for", d)), te(se, "max-height", "96"), fe(se, 1, "svelte-1duyr35"), x(le, se);
|
|
3395
3395
|
}, he = (le) => {
|
|
3396
3396
|
var se = Ya();
|
|
3397
|
-
H(() => te(se, "for",
|
|
3397
|
+
H(() => te(se, "for", d)), te(se, "mode", "karaoke"), te(se, "max-height", "96"), fe(se, 1, "svelte-1duyr35"), x(le, se);
|
|
3398
3398
|
};
|
|
3399
|
-
K(
|
|
3400
|
-
e(b) && !
|
|
3399
|
+
K(de, (le) => {
|
|
3400
|
+
e(b) && !f() ? le(ae) : le(he, !1);
|
|
3401
3401
|
});
|
|
3402
3402
|
}
|
|
3403
3403
|
N(re), x(U, re);
|
|
@@ -3417,7 +3417,7 @@ function eo(y, t) {
|
|
|
3417
3417
|
I() || U(ce);
|
|
3418
3418
|
});
|
|
3419
3419
|
}
|
|
3420
|
-
return H((U) => z =
|
|
3420
|
+
return H((U) => z = fe(M, 1, "container svelte-1duyr35", null, z, U), [
|
|
3421
3421
|
() => ({
|
|
3422
3422
|
square: e(j),
|
|
3423
3423
|
compact: n() === "compact",
|
|
@@ -3459,18 +3459,18 @@ const ro = {
|
|
|
3459
3459
|
};
|
|
3460
3460
|
function ao(y, t) {
|
|
3461
3461
|
pe(t, !0), be(y, ro);
|
|
3462
|
-
const
|
|
3462
|
+
const g = t.$$host;
|
|
3463
3463
|
let i = u(t, "recordingId", 7), o = u(t, "apiHost", 7, "api.44.audio"), r = u(t, "size", 7, "medium"), a = u(t, "preload", 7, "none");
|
|
3464
3464
|
const n = `fortyfour-mini-player-${crypto.randomUUID().slice(0, 8)}`;
|
|
3465
3465
|
let s = q(null);
|
|
3466
3466
|
function _() {
|
|
3467
3467
|
const b = e(s)?.state ?? "idle";
|
|
3468
|
-
|
|
3468
|
+
g.setAttribute("data-state", b);
|
|
3469
3469
|
}
|
|
3470
3470
|
me(() => {
|
|
3471
3471
|
e(s) && _();
|
|
3472
3472
|
});
|
|
3473
|
-
var
|
|
3473
|
+
var f = {
|
|
3474
3474
|
get recordingId() {
|
|
3475
3475
|
return i();
|
|
3476
3476
|
},
|
|
@@ -3495,13 +3495,13 @@ function ao(y, t) {
|
|
|
3495
3495
|
set preload(b = "none") {
|
|
3496
3496
|
a(b), c();
|
|
3497
3497
|
}
|
|
3498
|
-
}, I = to(),
|
|
3499
|
-
H(() => te(
|
|
3500
|
-
var l = ye(
|
|
3498
|
+
}, I = to(), d = J(I);
|
|
3499
|
+
H(() => te(d, "id", n)), H(() => te(d, "api-host", o())), H(() => te(d, "recording-id", i())), H(() => te(d, "preload", a())), Ee(d, (b) => m(s, b), () => e(s));
|
|
3500
|
+
var l = ye(d, 2);
|
|
3501
3501
|
let P;
|
|
3502
|
-
return H(() => te(l, "for", n)), te(l, "shape", "circle"), te(l, "visualization", "ring"), H((b) => P =
|
|
3502
|
+
return H(() => te(l, "for", n)), te(l, "shape", "circle"), te(l, "visualization", "ring"), H((b) => P = fe(l, 1, "button svelte-1i43bu9", null, P, b), [
|
|
3503
3503
|
() => ({ small: r() === "small", large: r() === "large" })
|
|
3504
|
-
]), Ie("loadedmetadata",
|
|
3504
|
+
]), Ie("loadedmetadata", d, _), Ie("play", d, _), Ie("pause", d, _), Ie("error", d, _), Ie("ended", d, _), x(y, I), ge(f);
|
|
3505
3505
|
}
|
|
3506
3506
|
customElements.define("fortyfour-mini-player", ue(
|
|
3507
3507
|
ao,
|