@waveform-playlist/browser 9.3.1 → 9.3.2

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/index.mjs CHANGED
@@ -2,7 +2,7 @@ import * as nh from "tone";
2
2
  import { now as Va, Context as rh, setContext as oh, Volume as Qo, getDestination as ea, getTransport as Wt, start as ah, getContext as Lt, Panner as Ds, Gain as Rs, PolySynth as io, Synth as sh, MembraneSynth as lo, NoiseSynth as ih, MetalSynth as bl, Part as wc, Analyser as _c, StereoWidener as lh, Gate as ch, Limiter as uh, Compressor as dh, Chebyshev as fh, BitCrusher as hh, Distortion as ph, EQ3 as mh, AutoWah as gh, AutoFilter as vh, AutoPanner as yh, Vibrato as bh, Tremolo as wh, Phaser as _h, Chorus as Sh, PingPongDelay as kh, FeedbackDelay as Ch, JCReverb as xh, Freeverb as Eh, Reverb as Ih } from "tone";
3
3
  import { jsx as k, jsxs as me, Fragment as zt } from "react/jsx-runtime";
4
4
  import * as P from "react";
5
- import at, { useEffect as K, useLayoutEffect as Nr, useRef as T, useMemo as Ce, useState as z, useCallback as $, useContext as Pe, createContext as Ve, memo as Sc, forwardRef as kc, startTransition as Ps, useImperativeHandle as Cc, useSyncExternalStore as Ah, Fragment as Mh, useInsertionEffect as Th } from "react";
5
+ import at, { useEffect as K, useLayoutEffect as Nr, useRef as T, useMemo as Ce, useState as z, useCallback as $, useContext as Fe, createContext as Ve, memo as Sc, forwardRef as kc, startTransition as Ps, useImperativeHandle as Cc, useSyncExternalStore as Ah, Fragment as Mh, useInsertionEffect as Th } from "react";
6
6
  import O, { ThemeContext as $h, withTheme as xc, useTheme as Dh, ThemeProvider as Ec } from "styled-components";
7
7
  import { flushSync as Rh, createPortal as Ic } from "react-dom";
8
8
  var ka = { exports: {} }, wl;
@@ -87,25 +87,25 @@ function Ph() {
87
87
  }
88
88
  var d = (function(h) {
89
89
  function g(y) {
90
- var w, b, _, S, C, E;
90
+ var b, w, _, S, C, E;
91
91
  return (function(x, M) {
92
92
  if (!(x instanceof M)) throw new TypeError("Cannot call a class as a function");
93
- })(this, g), b = this, w = !(_ = u(g).call(this, y.id, y.length, y.buffer, y.subChunks)) || l(_) !== "object" && typeof _ != "function" ? p(b) : _, S = p(p(w)), E = void 0, (C = "subChunks") in S ? Object.defineProperty(S, C, { value: E, enumerable: !0, configurable: !0, writable: !0 }) : S[C] = E, w.subChunks = y.subChunks.map((function(x) {
93
+ })(this, g), w = this, b = !(_ = u(g).call(this, y.id, y.length, y.buffer, y.subChunks)) || l(_) !== "object" && typeof _ != "function" ? p(w) : _, S = p(p(b)), E = void 0, (C = "subChunks") in S ? Object.defineProperty(S, C, { value: E, enumerable: !0, configurable: !0, writable: !0 }) : S[C] = E, b.subChunks = y.subChunks.map((function(x) {
94
94
  return new g(x);
95
- })), w;
95
+ })), b;
96
96
  }
97
97
  var v, m;
98
- return (function(y, w) {
99
- if (typeof w != "function" && w !== null) throw new TypeError("Super expression must either be null or a function");
100
- y.prototype = Object.create(w && w.prototype, { constructor: { value: y, writable: !0, configurable: !0 } }), w && f(y, w);
98
+ return (function(y, b) {
99
+ if (typeof b != "function" && b !== null) throw new TypeError("Super expression must either be null or a function");
100
+ y.prototype = Object.create(b && b.prototype, { constructor: { value: y, writable: !0, configurable: !0 } }), b && f(y, b);
101
101
  })(g, h), v = g, (m = [{ key: "getMetaData", value: function() {
102
102
  if (this.id !== "LIST") throw new a.ParseError("Unexpected chunk ID", "'LIST'", "'".concat(this.id, "'"));
103
- var y = this.subChunks.reduce((function(w, b) {
104
- if (b.id === "ifil" || b.id === "iver") {
105
- if (b.length !== s.SF_VERSION_LENGTH) throw new a.ParseError("Invalid size for the '".concat(b.id, "' sub-chunk"));
106
- w[b.id] = "".concat(b.getInt16(), ".").concat(b.getInt16(2));
107
- } else w[b.id] = b.getString();
108
- return w;
103
+ var y = this.subChunks.reduce((function(b, w) {
104
+ if (w.id === "ifil" || w.id === "iver") {
105
+ if (w.length !== s.SF_VERSION_LENGTH) throw new a.ParseError("Invalid size for the '".concat(w.id, "' sub-chunk"));
106
+ b[w.id] = "".concat(w.getInt16(), ".").concat(w.getInt16(2));
107
+ } else b[w.id] = w.getString();
108
+ return b;
109
109
  }), {});
110
110
  if (!y.ifil) throw new a.ParseError("Missing required 'ifil' sub-chunk");
111
111
  if (!y.INAM) throw new a.ParseError("Missing required 'INAM' sub-chunk");
@@ -366,23 +366,23 @@ function Ph() {
366
366
  return { generatorIndex: g.getInt16(), modulatorIndex: g.getInt16() };
367
367
  }));
368
368
  }, c = function(d, h, g, v, m, y) {
369
- for (var w = [], b = 0; b < d.length; b++) {
370
- for (var _ = d[b], S = d[b + 1], C = _.bagIndex, E = S ? S.bagIndex : h.length, x = [], M = void 0, R = C; R < E; R++) {
369
+ for (var b = [], w = 0; w < d.length; w++) {
370
+ for (var _ = d[w], S = d[w + 1], C = _.bagIndex, E = S ? S.bagIndex : h.length, x = [], M = void 0, R = C; R < E; R++) {
371
371
  var A = u(R, h, g), I = f(R, h, v), D = I[i.GeneratorType.KeyRange] && I[i.GeneratorType.KeyRange].range, F = I[y];
372
372
  if (F) {
373
373
  var L = m[F.value];
374
374
  L && x.push({ keyRange: D, modulators: A, generators: I, reference: L });
375
375
  } else R - C == 0 && (M = { keyRange: D, modulators: A, generators: I });
376
376
  }
377
- w.push({ header: _, globalZone: M, zones: x });
377
+ b.push({ header: _, globalZone: M, zones: x });
378
378
  }
379
- return w;
379
+ return b;
380
380
  }, u = function(d, h, g) {
381
- var v = h[d], m = h[d + 1], y = v.modulatorIndex, w = m ? m.modulatorIndex : h.length;
382
- return p(y, w, g);
381
+ var v = h[d], m = h[d + 1], y = v.modulatorIndex, b = m ? m.modulatorIndex : h.length;
382
+ return p(y, b, g);
383
383
  }, f = function(d, h, g) {
384
- var v = h[d], m = h[d + 1], y = v.generatorIndex, w = m ? m.generatorIndex : h.length;
385
- return p(y, w, g);
384
+ var v = h[d], m = h[d + 1], y = v.generatorIndex, b = m ? m.generatorIndex : h.length;
385
+ return p(y, b, g);
386
386
  }, p = function(d, h, g) {
387
387
  for (var v = {}, m = d; m < h; m++) {
388
388
  var y = g[m];
@@ -617,10 +617,10 @@ function Ph() {
617
617
  }
618
618
  function c(d, h, g) {
619
619
  return (c = l() ? Reflect.construct : function(v, m, y) {
620
- var w = [null];
621
- w.push.apply(w, m);
622
- var b = new (Function.bind.apply(v, w))();
623
- return y && u(b, y.prototype), b;
620
+ var b = [null];
621
+ b.push.apply(b, m);
622
+ var w = new (Function.bind.apply(v, b))();
623
+ return y && u(w, y.prototype), w;
624
624
  }).apply(null, arguments);
625
625
  }
626
626
  function u(d, h) {
@@ -638,8 +638,8 @@ function Ph() {
638
638
  }));
639
639
  var p = (function(d) {
640
640
  function h(g, v, m) {
641
- return (function(y, w) {
642
- if (!(y instanceof w)) throw new TypeError("Cannot call a class as a function");
641
+ return (function(y, b) {
642
+ if (!(y instanceof b)) throw new TypeError("Cannot call a class as a function");
643
643
  })(this, h), s(this, f(h).call(this, "".concat(g).concat(v && m ? ", expected ".concat(v, ", received ").concat(m) : "")));
644
644
  }
645
645
  return (function(g, v) {
@@ -783,10 +783,10 @@ function Ph() {
783
783
  function u(g) {
784
784
  for (var v = 1; v < arguments.length; v++) {
785
785
  var m = arguments[v] != null ? arguments[v] : {}, y = Object.keys(m);
786
- typeof Object.getOwnPropertySymbols == "function" && (y = y.concat(Object.getOwnPropertySymbols(m).filter((function(w) {
787
- return Object.getOwnPropertyDescriptor(m, w).enumerable;
788
- })))), y.forEach((function(w) {
789
- d(g, w, m[w]);
786
+ typeof Object.getOwnPropertySymbols == "function" && (y = y.concat(Object.getOwnPropertySymbols(m).filter((function(b) {
787
+ return Object.getOwnPropertyDescriptor(m, b).enumerable;
788
+ })))), y.forEach((function(b) {
789
+ d(g, b, m[b]);
790
790
  }));
791
791
  }
792
792
  return g;
@@ -805,8 +805,8 @@ function Ph() {
805
805
  }
806
806
  var h = (function() {
807
807
  function g(v) {
808
- if ((function(y, w) {
809
- if (!(y instanceof w)) throw new TypeError("Cannot call a class as a function");
808
+ if ((function(y, b) {
809
+ if (!(y instanceof b)) throw new TypeError("Cannot call a class as a function");
810
810
  })(this, g), d(this, "chunk", void 0), d(this, "metaData", void 0), d(this, "sampleData", void 0), d(this, "samples", void 0), d(this, "presetData", void 0), d(this, "instruments", void 0), d(this, "presets", void 0), d(this, "banks", void 0), !(v instanceof s.SF2Chunk)) {
811
811
  var m = Object(i.parseBuffer)(v);
812
812
  v = new s.SF2Chunk(m);
@@ -817,28 +817,28 @@ function Ph() {
817
817
  return p(g, null, [{ key: "from", value: function(v) {
818
818
  return new g(v);
819
819
  } }]), p(g, [{ key: "getKeyData", value: function(v) {
820
- var m = this, y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, w = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
821
- return Object(c.memoize)((function(b, _, S) {
820
+ var m = this, y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, b = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
821
+ return Object(c.memoize)((function(w, _, S) {
822
822
  var C = m.banks[_];
823
823
  if (C) {
824
824
  var E = C.presets[S];
825
825
  if (E) {
826
826
  var x = E.zones.filter((function(Z) {
827
- return m.isKeyInRange(Z, b);
827
+ return m.isKeyInRange(Z, w);
828
828
  }));
829
829
  if (x.length > 0) {
830
830
  var M = !0, R = !1, A = void 0;
831
831
  try {
832
832
  for (var I, D = x[Symbol.iterator](); !(M = (I = D.next()).done); M = !0) {
833
833
  var F = I.value, L = F.instrument, H = L.zones.filter((function(Z) {
834
- return m.isKeyInRange(Z, b);
834
+ return m.isKeyInRange(Z, w);
835
835
  }));
836
836
  if (H.length > 0) {
837
837
  var Q = !0, q = !1, oe = void 0;
838
838
  try {
839
839
  for (var X, ee = H[Symbol.iterator](); !(Q = (X = ee.next()).done); Q = !0) {
840
- var ie = X.value, fe = ie.sample, he = u({}, F.generators, ie.generators), De = u({}, F.modulators, ie.modulators);
841
- return { keyNumber: b, preset: E, instrument: L, sample: fe, generators: he, modulators: De };
840
+ var ie = X.value, fe = ie.sample, he = u({}, F.generators, ie.generators), Re = u({}, F.modulators, ie.modulators);
841
+ return { keyNumber: w, preset: E, instrument: L, sample: fe, generators: he, modulators: Re };
842
842
  }
843
843
  } catch (Z) {
844
844
  q = !0, oe = Z;
@@ -864,7 +864,7 @@ function Ph() {
864
864
  }
865
865
  }
866
866
  return null;
867
- }))(v, y, w);
867
+ }))(v, y, b);
868
868
  } }, { key: "isKeyInRange", value: function(v, m) {
869
869
  return v.keyRange === void 0 || v.keyRange.lo <= m && v.keyRange.hi >= m;
870
870
  } }, { key: "getBanks", value: function() {
@@ -873,8 +873,8 @@ function Ph() {
873
873
  return v[y] || (v[y] = { presets: [] }), v[y].presets[m.header.preset] = m, v;
874
874
  }), []);
875
875
  } }, { key: "getPresets", value: function() {
876
- var v = this.presetData, m = v.presetHeaders, y = v.presetZones, w = v.presetGenerators, b = v.presetModulators;
877
- return Object(l.getItemsInZone)(m, y, b, w, this.instruments, a.GeneratorType.Instrument).filter((function(_) {
876
+ var v = this.presetData, m = v.presetHeaders, y = v.presetZones, b = v.presetGenerators, w = v.presetModulators;
877
+ return Object(l.getItemsInZone)(m, y, w, b, this.instruments, a.GeneratorType.Instrument).filter((function(_) {
878
878
  return _.header.name !== "EOP";
879
879
  })).map((function(_) {
880
880
  return { header: _.header, globalZone: _.globalZone, zones: _.zones.map((function(S) {
@@ -882,8 +882,8 @@ function Ph() {
882
882
  })) };
883
883
  }));
884
884
  } }, { key: "getInstruments", value: function() {
885
- var v = this.presetData, m = v.instrumentHeaders, y = v.instrumentZones, w = v.instrumentModulators, b = v.instrumentGenerators;
886
- return Object(l.getItemsInZone)(m, y, w, b, this.samples, a.GeneratorType.SampleId).filter((function(_) {
885
+ var v = this.presetData, m = v.instrumentHeaders, y = v.instrumentZones, b = v.instrumentModulators, w = v.instrumentGenerators;
886
+ return Object(l.getItemsInZone)(m, y, b, w, this.samples, a.GeneratorType.SampleId).filter((function(_) {
887
887
  return _.header.name !== "EOI";
888
888
  })).map((function(_) {
889
889
  return { header: _.header, globalZone: _.globalZone, zones: _.zones.map((function(S) {
@@ -1991,17 +1991,17 @@ var Zh = class {
1991
1991
  }
1992
1992
  const c = Lt().rawContext, u = c.createBufferSource();
1993
1993
  u.buffer = l.buffer, u.playbackRate.value = l.playbackRate, (l.loopMode === 1 || l.loopMode === 3) && (u.loop = !0, u.loopStart = l.loopStart, u.loopEnd = l.loopEnd);
1994
- const f = l.buffer.duration / l.playbackRate, p = l.loopMode === 0 ? Math.max(n, f) : n, d = o * o, h = c.createGain(), { attackVolEnv: g, holdVolEnv: v, decayVolEnv: m, sustainVolEnv: y, releaseVolEnv: w } = l, b = d * y;
1994
+ const f = l.buffer.duration / l.playbackRate, p = l.loopMode === 0 ? Math.max(n, f) : n, d = o * o, h = c.createGain(), { attackVolEnv: g, holdVolEnv: v, decayVolEnv: m, sustainVolEnv: y, releaseVolEnv: b } = l, w = d * y;
1995
1995
  h.gain.setValueAtTime(0, r), h.gain.linearRampToValueAtTime(d, r + g), v > 1e-3 && h.gain.setValueAtTime(d, r + g + v);
1996
1996
  const _ = r + g + v;
1997
- h.gain.linearRampToValueAtTime(b, _ + m), h.gain.setValueAtTime(b, r + p), h.gain.linearRampToValueAtTime(0, r + p + w), u.connect(h), h.connect(this.volumeNode.input.input), this.activeSources.add(u), u.onended = () => {
1997
+ h.gain.linearRampToValueAtTime(w, _ + m), h.gain.setValueAtTime(w, r + p), h.gain.linearRampToValueAtTime(0, r + p + b), u.connect(h), h.connect(this.volumeNode.input.input), this.activeSources.add(u), u.onended = () => {
1998
1998
  this.activeSources.delete(u);
1999
1999
  try {
2000
2000
  h.disconnect();
2001
2001
  } catch (S) {
2002
2002
  console.warn("[waveform-playlist] GainNode already disconnected:", S);
2003
2003
  }
2004
- }, u.start(r), u.stop(r + p + w);
2004
+ }, u.start(r), u.stop(r + p + b);
2005
2005
  }
2006
2006
  gainToDb(t) {
2007
2007
  return 20 * Math.log10(t);
@@ -2405,14 +2405,14 @@ function Yh(e) {
2405
2405
  stereoPan: f.pan,
2406
2406
  startTime: h,
2407
2407
  endTime: g
2408
- }, y = d.map((w) => ({
2409
- notes: w.midiNotes,
2410
- startTime: co(w) - h,
2411
- duration: Cl(w),
2412
- offset: kl(w)
2408
+ }, y = d.map((b) => ({
2409
+ notes: b.midiNotes,
2410
+ startTime: co(b) - h,
2411
+ duration: Cl(b),
2412
+ offset: kl(b)
2413
2413
  }));
2414
2414
  if (e?.soundFontCache?.isLoaded) {
2415
- const w = d[0], _ = w.midiChannel === 9, S = w.midiProgram ?? 0;
2415
+ const b = d[0], _ = b.midiChannel === 9, S = b.midiProgram ?? 0;
2416
2416
  t.addSoundFontTrack({
2417
2417
  clips: y,
2418
2418
  track: m,
@@ -3138,12 +3138,12 @@ var op = Object.create, Ls = Object.defineProperty, ap = Object.defineProperties
3138
3138
  }, rr = (e, t, n, r, o, a) => {
3139
3139
  var s, i, l, c, u, f = t & 7, p = !!(t & 8), d = !!(t & 16), h = f > 3 ? e.length + 1 : f ? p ? 1 : 2 : 0, g = zc[f + 5], v = f > 3 && (e[h - 1] = []), m = e[h] || (e[h] = []), y = f && (!d && !p && (o = o.prototype), f < 5 && (f > 3 || !d) && sp(f < 4 ? o : { get [n]() {
3140
3140
  return Sn(this, a);
3141
- }, set [n](b) {
3142
- return rn(this, a, b);
3141
+ }, set [n](w) {
3142
+ return rn(this, a, w);
3143
3143
  } }, n));
3144
3144
  f ? d && f < 4 && Rl(a, (f > 2 ? "set " : f > 1 ? "get " : "") + n) : Rl(o, n);
3145
- for (var w = r.length - 1; w >= 0; w--)
3146
- c = pp(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (b) => mp(o, b) : (b) => n in b }, f ^ 3 && (u.get = d ? (b) => (f ^ 1 ? Sn : gp)(b, o, f ^ 4 ? a : y.get) : (b) => b[n]), f > 2 && (u.set = d ? (b, _) => rn(b, o, _, f ^ 4 ? a : y.set) : (b, _) => b[n] = _)), i = (0, r[w])(f ? f < 4 ? d ? a : y[g] : f > 4 ? void 0 : { get: y.get, set: y.set } : o, c), l._ = 1, f ^ 4 || i === void 0 ? mr(i) && (f > 4 ? v.unshift(i) : f ? d ? a = i : y[g] = i : o = i) : typeof i != "object" || i === null ? nr("Object expected") : (mr(s = i.get) && (y.get = s), mr(s = i.set) && (y.set = s), mr(s = i.init) && v.unshift(s));
3145
+ for (var b = r.length - 1; b >= 0; b--)
3146
+ c = pp(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (w) => mp(o, w) : (w) => n in w }, f ^ 3 && (u.get = d ? (w) => (f ^ 1 ? Sn : gp)(w, o, f ^ 4 ? a : y.get) : (w) => w[n]), f > 2 && (u.set = d ? (w, _) => rn(w, o, _, f ^ 4 ? a : y.set) : (w, _) => w[n] = _)), i = (0, r[b])(f ? f < 4 ? d ? a : y[g] : f > 4 ? void 0 : { get: y.get, set: y.set } : o, c), l._ = 1, f ^ 4 || i === void 0 ? mr(i) && (f > 4 ? v.unshift(i) : f ? d ? a = i : y[g] = i : o = i) : typeof i != "object" || i === null ? nr("Object expected") : (mr(s = i.get) && (y.get = s), mr(s = i.set) && (y.set = s), mr(s = i.init) && v.unshift(s));
3147
3147
  return f || Zc(e, o), y && Ls(o, n, y), d ? f ^ 4 ? a : y : o;
3148
3148
  }, Bs = (e, t, n) => t.has(e) || nr("Cannot " + n), mp = (e, t) => Object(t) !== t ? nr('Cannot use the "in" operator on this value') : e.has(t), Sn = (e, t, n) => (Bs(e, t, "read from private field"), n ? n.call(e) : t.get(e)), fo = (e, t, n) => t.has(e) ? nr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), rn = (e, t, n, r) => (Bs(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), gp = (e, t, n) => (Bs(e, t, "access private method"), n);
3149
3149
  function Po(e, t) {
@@ -3196,7 +3196,7 @@ function ge({ get: e }, t) {
3196
3196
  }
3197
3197
  };
3198
3198
  }
3199
- function Re(e, t) {
3199
+ function Pe(e, t) {
3200
3200
  const n = /* @__PURE__ */ new WeakMap();
3201
3201
  return function() {
3202
3202
  let r = n.get(this);
@@ -3408,7 +3408,7 @@ function Mp(e, t) {
3408
3408
  const n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), o = Math.min(t.left + t.width, e.left + e.width), a = Math.min(t.top + t.height, e.top + e.height), s = o - r, i = a - n;
3409
3409
  return r < o && n < a ? s * i : 0;
3410
3410
  }
3411
- var ru, ou, es, wo, Gr, oa = class extends (es = un, ou = [Re], ru = [Re], es) {
3411
+ var ru, ou, es, wo, Gr, oa = class extends (es = un, ou = [Pe], ru = [Pe], es) {
3412
3412
  constructor(t) {
3413
3413
  const n = Nt.from(t);
3414
3414
  super(n, (r, o) => Nt.equals(r, o)), xp(Gr, 5, this), Ip(this, wo, 0), this.velocity = { x: 0, y: 0 };
@@ -3479,12 +3479,12 @@ var au = /* @__PURE__ */ ((e) => (e.Horizontal = "x", e.Vertical = "y", e))(au |
3479
3479
  }, de = (e, t, n, r, o, a) => {
3480
3480
  var s, i, l, c, u, f = t & 7, p = !!(t & 8), d = !!(t & 16), h = f > 3 ? e.length + 1 : f ? p ? 1 : 2 : 0, g = hu[f + 5], v = f > 3 && (e[h - 1] = []), m = e[h] || (e[h] = []), y = f && (!d && !p && (o = o.prototype), f < 5 && (f > 3 || !d) && Dp(f < 4 ? o : { get [n]() {
3481
3481
  return Je(this, a);
3482
- }, set [n](b) {
3483
- return It(this, a, b);
3482
+ }, set [n](w) {
3483
+ return It(this, a, w);
3484
3484
  } }, n));
3485
3485
  f ? d && f < 4 && Ol(a, (f > 2 ? "set " : f > 1 ? "get " : "") + n) : Ol(o, n);
3486
- for (var w = r.length - 1; w >= 0; w--)
3487
- c = Pp(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (b) => Fp(o, b) : (b) => n in b }, f ^ 3 && (u.get = d ? (b) => (f ^ 1 ? Je : Op)(b, o, f ^ 4 ? a : y.get) : (b) => b[n]), f > 2 && (u.set = d ? (b, _) => It(b, o, _, f ^ 4 ? a : y.set) : (b, _) => b[n] = _)), i = (0, r[w])(f ? f < 4 ? d ? a : y[g] : f > 4 ? void 0 : { get: y.get, set: y.set } : o, c), l._ = 1, f ^ 4 || i === void 0 ? gr(i) && (f > 4 ? v.unshift(i) : f ? d ? a = i : y[g] = i : o = i) : typeof i != "object" || i === null ? or("Object expected") : (gr(s = i.get) && (y.get = s), gr(s = i.set) && (y.set = s), gr(s = i.init) && v.unshift(s));
3486
+ for (var b = r.length - 1; b >= 0; b--)
3487
+ c = Pp(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (w) => Fp(o, w) : (w) => n in w }, f ^ 3 && (u.get = d ? (w) => (f ^ 1 ? Je : Op)(w, o, f ^ 4 ? a : y.get) : (w) => w[n]), f > 2 && (u.set = d ? (w, _) => It(w, o, _, f ^ 4 ? a : y.set) : (w, _) => w[n] = _)), i = (0, r[b])(f ? f < 4 ? d ? a : y[g] : f > 4 ? void 0 : { get: y.get, set: y.set } : o, c), l._ = 1, f ^ 4 || i === void 0 ? gr(i) && (f > 4 ? v.unshift(i) : f ? d ? a = i : y[g] = i : o = i) : typeof i != "object" || i === null ? or("Object expected") : (gr(s = i.get) && (y.get = s), gr(s = i.set) && (y.set = s), gr(s = i.init) && v.unshift(s));
3488
3488
  return f || In(e, o), y && zs(o, n, y), d ? f ^ 4 ? a : y : o;
3489
3489
  }, Zs = (e, t, n) => t.has(e) || or("Cannot " + n), Fp = (e, t) => Object(t) !== t ? or('Cannot use the "in" operator on this value') : e.has(t), Je = (e, t, n) => (Zs(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Se = (e, t, n) => t.has(e) ? or("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), It = (e, t, n, r) => (Zs(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), Op = (e, t, n) => (Zs(e, t, "access private method"), n);
3490
3490
  function pu(e, t) {
@@ -3861,7 +3861,7 @@ var Np = class extends Ur {
3861
3861
  );
3862
3862
  }
3863
3863
  }, Us = /* @__PURE__ */ ((e) => (e[e.Lowest = 0] = "Lowest", e[e.Low = 1] = "Low", e[e.Normal = 2] = "Normal", e[e.High = 3] = "High", e[e.Highest = 4] = "Highest", e))(Us || {}), Xs = /* @__PURE__ */ ((e) => (e[e.Collision = 0] = "Collision", e[e.ShapeIntersection = 1] = "ShapeIntersection", e[e.PointerIntersection = 2] = "PointerIntersection", e))(Xs || {}), gu, vu, yu, bu, wu, _u, Su, Mt, Ys;
3864
- Su = [ge], _u = [Re], wu = [Re], bu = [Re], yu = [Re], vu = [Re], gu = [Re];
3864
+ Su = [ge], _u = [Pe], wu = [Pe], bu = [Pe], yu = [Pe], vu = [Pe], gu = [Pe];
3865
3865
  var Kt = class {
3866
3866
  constructor() {
3867
3867
  se(Mt, 5, this), Se(this, Ys, se(
@@ -4208,7 +4208,7 @@ var Ll = class {
4208
4208
  }
4209
4209
  this.map.value = /* @__PURE__ */ new Map();
4210
4210
  }
4211
- }, Iu, Au, Mu, Tu, $u, Du, rs, ct, Qs, ei, ti, Zt = class extends (rs = dn, Du = [ge], $u = [ge], Tu = [ge], Mu = [Re], Au = [Re], Iu = [Re], rs) {
4211
+ }, Iu, Au, Mu, Tu, $u, Du, rs, ct, Qs, ei, ti, Zt = class extends (rs = dn, Du = [ge], $u = [ge], Tu = [ge], Mu = [Pe], Au = [Pe], Iu = [Pe], rs) {
4212
4212
  constructor(t, n) {
4213
4213
  var r = t, { modifiers: o, type: a, sensors: s } = r, i = fu(r, ["modifiers", "type", "sensors"]);
4214
4214
  super(i, n), se(ct, 5, this), Se(this, Qs, se(ct, 8, this)), se(ct, 11, this), Se(this, ei, se(ct, 12, this)), se(ct, 15, this), Se(this, ti, se(ct, 16, this, this.isDragSource ? "dragging" : "idle")), se(ct, 19, this), this.type = a, this.sensors = s, this.modifiers = o, this.alignment = i.alignment;
@@ -4235,7 +4235,7 @@ de(ct, 2, "isDropping", Mu, Zt);
4235
4235
  de(ct, 2, "isDragging", Au, Zt);
4236
4236
  de(ct, 2, "isDragSource", Iu, Zt);
4237
4237
  In(ct, Zt);
4238
- var Ru, Pu, Fu, Ou, Lu, Bu, os, Ye, ni, ri, oi, ai, si, Ht = class extends (os = dn, Bu = [ge], Lu = [ge], Ou = [ge], Fu = [ge], Pu = [ge], Ru = [Re], os) {
4238
+ var Ru, Pu, Fu, Ou, Lu, Bu, os, Ye, ni, ri, oi, ai, si, Ht = class extends (os = dn, Bu = [ge], Lu = [ge], Ou = [ge], Fu = [ge], Pu = [ge], Ru = [Pe], os) {
4239
4239
  constructor(t, n) {
4240
4240
  var r = t, { accept: o, collisionDetector: a, collisionPriority: s, type: i } = r, l = fu(r, ["accept", "collisionDetector", "collisionPriority", "type"]);
4241
4241
  super(l, n), se(Ye, 5, this), Se(this, ni, se(Ye, 8, this)), se(Ye, 11, this), Se(this, ri, se(Ye, 12, this)), se(Ye, 15, this), Se(this, oi, se(Ye, 16, this)), se(Ye, 19, this), Se(this, ai, se(Ye, 20, this)), se(Ye, 23, this), Se(this, si, se(Ye, 24, this)), se(Ye, 27, this), this.accept = o, this.collisionDetector = a, this.collisionPriority = s, this.type = i;
@@ -4385,7 +4385,7 @@ var jn = class extends mt {
4385
4385
  this.draggables.destroy(), this.droppables.destroy(), this.plugins.destroy(), this.sensors.destroy(), this.modifiers.destroy();
4386
4386
  }
4387
4387
  }, Vu, Nu, zu, Zu, Hu, Gu, Uu, Xu, Yu, vr, xo, Nn, Be, ii, li, ci, ui, di, yr;
4388
- Yu = [Re], Xu = [ge], Uu = [ge], Gu = [ge], Hu = [ge], Zu = [ge], zu = [Re], Nu = [Re], Vu = [Re];
4388
+ Yu = [Pe], Xu = [ge], Uu = [ge], Gu = [ge], Hu = [ge], Zu = [ge], zu = [Pe], Nu = [Pe], Vu = [Pe];
4389
4389
  var Bt = class {
4390
4390
  /**
4391
4391
  * Creates a new drag operation instance.
@@ -4515,8 +4515,8 @@ var Up = class {
4515
4515
  for (const m of g)
4516
4516
  v.includes(m) || m.destroy();
4517
4517
  this.dragOperation.modifiers = (h = (d = (p = this.dragOperation.source) == null ? void 0 : p.modifiers) == null ? void 0 : d.map((m) => {
4518
- const { plugin: y, options: w } = Hs(m);
4519
- return new y(this, w);
4518
+ const { plugin: y, options: b } = Hs(m);
4519
+ return new y(this, b);
4520
4520
  })) != null ? h : v;
4521
4521
  });
4522
4522
  this.destroy = () => {
@@ -4573,7 +4573,7 @@ var Up = class {
4573
4573
  }
4574
4574
  }, ju = (e) => {
4575
4575
  throw TypeError(e);
4576
- }, fi = (e, t, n) => t.has(e) || ju("Cannot " + n), ce = (e, t, n) => (fi(e, t, "read from private field"), t.get(e)), ht = (e, t, n) => t.has(e) ? ju("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), wt = (e, t, n, r) => (fi(e, t, "write to private field"), t.set(e, n), n), Ku = (e, t, n) => (fi(e, t, "access private method"), n);
4576
+ }, fi = (e, t, n) => t.has(e) || ju("Cannot " + n), ce = (e, t, n) => (fi(e, t, "read from private field"), t.get(e)), ht = (e, t, n) => t.has(e) ? ju("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), St = (e, t, n, r) => (fi(e, t, "write to private field"), t.set(e, n), n), Ku = (e, t, n) => (fi(e, t, "access private method"), n);
4577
4577
  function aa(e) {
4578
4578
  return e ? e instanceof KeyframeEffect ? !0 : "getKeyframes" in e && typeof e.getKeyframes == "function" : !1;
4579
4579
  }
@@ -4645,12 +4645,12 @@ function Oo(e, t = e.getBoundingClientRect(), n = 0) {
4645
4645
  let f = e.parentElement;
4646
4646
  for (; f && f !== c.documentElement; ) {
4647
4647
  if (!jp(f)) {
4648
- const w = f.getBoundingClientRect(), b = n * (w.bottom - w.top), _ = n * (w.right - w.left), S = n * (w.bottom - w.top), C = n * (w.right - w.left);
4648
+ const b = f.getBoundingClientRect(), w = n * (b.bottom - b.top), _ = n * (b.right - b.left), S = n * (b.bottom - b.top), C = n * (b.right - b.left);
4649
4649
  l = {
4650
- top: Math.max(l.top, w.top - b),
4651
- right: Math.min(l.right, w.right + _),
4652
- bottom: Math.min(l.bottom, w.bottom + S),
4653
- left: Math.max(l.left, w.left - C),
4650
+ top: Math.max(l.top, b.top - w),
4651
+ right: Math.min(l.right, b.right + _),
4652
+ bottom: Math.min(l.bottom, b.bottom + S),
4653
+ left: Math.max(l.left, b.left - C),
4654
4654
  width: 0,
4655
4655
  // Will be calculated next
4656
4656
  height: 0
@@ -4850,7 +4850,7 @@ var om = Ju ? ResizeObserver : class {
4850
4850
  constructor(e) {
4851
4851
  super((t) => {
4852
4852
  if (!ce(this, Eo)) {
4853
- wt(this, Eo, !0);
4853
+ St(this, Eo, !0);
4854
4854
  return;
4855
4855
  }
4856
4856
  e(t, this);
@@ -4865,14 +4865,14 @@ var Nl = Array.from({ length: 100 }, (e, t) => t / 100), od = 75, yn, Bo, tn, bn
4865
4865
  }) {
4866
4866
  this.element = e, this.callback = t, ht(this, Wo), this.disconnect = () => {
4867
4867
  var a, s, i;
4868
- wt(this, Ir, !0), (a = ce(this, tn)) == null || a.disconnect(), (s = ce(this, bn)) == null || s.disconnect(), ce(this, br).disconnect(), (i = ce(this, et)) == null || i.remove();
4868
+ St(this, Ir, !0), (a = ce(this, tn)) == null || a.disconnect(), (s = ce(this, bn)) == null || s.disconnect(), ce(this, br).disconnect(), (i = ce(this, et)) == null || i.remove();
4869
4869
  }, ht(this, yn, !0), ht(this, Bo), ht(this, tn), ht(this, bn), ht(this, br), ht(this, et), ht(this, Ir, !1), ht(this, wr, rd(() => {
4870
4870
  var a, s, i;
4871
4871
  const { element: l } = this;
4872
4872
  if ((a = ce(this, bn)) == null || a.disconnect(), ce(this, Ir) || !ce(this, yn) || !l.isConnected)
4873
4873
  return;
4874
- const c = (s = l.ownerDocument) != null ? s : document, { innerHeight: u, innerWidth: f } = (i = c.defaultView) != null ? i : window, p = l.getBoundingClientRect(), d = Oo(l, p), { top: h, left: g, bottom: v, right: m } = d, y = -Math.floor(h), w = -Math.floor(g), b = -Math.floor(f - m), _ = -Math.floor(u - v), S = `${y}px ${b}px ${_}px ${w}px`;
4875
- this.boundingClientRect = p, wt(this, bn, new IntersectionObserver(
4874
+ const c = (s = l.ownerDocument) != null ? s : document, { innerHeight: u, innerWidth: f } = (i = c.defaultView) != null ? i : window, p = l.getBoundingClientRect(), d = Oo(l, p), { top: h, left: g, bottom: v, right: m } = d, y = -Math.floor(h), b = -Math.floor(g), w = -Math.floor(f - m), _ = -Math.floor(u - v), S = `${y}px ${w}px ${_}px ${b}px`;
4875
+ this.boundingClientRect = p, St(this, bn, new IntersectionObserver(
4876
4876
  (C) => {
4877
4877
  const [E] = C, { intersectionRect: x } = E;
4878
4878
  (E.intersectionRatio !== 1 ? E.intersectionRatio : Hr.intersectionRatio(
@@ -4886,17 +4886,17 @@ var Nl = Array.from({ length: 100 }, (e, t) => t / 100), od = 75, yn, Bo, tn, bn
4886
4886
  root: c
4887
4887
  }
4888
4888
  )), ce(this, bn).observe(l), Ku(this, Wo, ad).call(this);
4889
- }, od)), this.boundingClientRect = e.getBoundingClientRect(), wt(this, yn, rm(e, this.boundingClientRect));
4889
+ }, od)), this.boundingClientRect = e.getBoundingClientRect(), St(this, yn, rm(e, this.boundingClientRect));
4890
4890
  let r = !0;
4891
4891
  this.callback = (a) => {
4892
4892
  r && (r = !1, n.skipInitial) || t(a);
4893
4893
  };
4894
4894
  const o = e.ownerDocument;
4895
- n?.debug && (wt(this, et, document.createElement("div")), ce(this, et).style.background = "rgba(0,0,0,0.15)", ce(this, et).style.position = "fixed", ce(this, et).style.pointerEvents = "none", o.body.appendChild(ce(this, et))), wt(this, br, new IntersectionObserver(
4895
+ n?.debug && (St(this, et, document.createElement("div")), ce(this, et).style.background = "rgba(0,0,0,0.15)", ce(this, et).style.position = "fixed", ce(this, et).style.pointerEvents = "none", o.body.appendChild(ce(this, et))), St(this, br, new IntersectionObserver(
4896
4896
  (a) => {
4897
4897
  var s, i;
4898
4898
  const l = a[a.length - 1], { boundingClientRect: c, isIntersecting: u } = l, { width: f, height: p } = c, d = ce(this, yn);
4899
- wt(this, yn, u), !(!f && !p) && (d && !u ? ((s = ce(this, bn)) == null || s.disconnect(), this.callback(null), (i = ce(this, tn)) == null || i.disconnect(), wt(this, tn, void 0), ce(this, et) && (ce(this, et).style.visibility = "hidden")) : ce(this, wr).call(this), u && !ce(this, tn) && (wt(this, tn, new am(ce(this, wr))), ce(this, tn).observe(e)));
4899
+ St(this, yn, u), !(!f && !p) && (d && !u ? ((s = ce(this, bn)) == null || s.disconnect(), this.callback(null), (i = ce(this, tn)) == null || i.disconnect(), St(this, tn, void 0), ce(this, et) && (ce(this, et).style.visibility = "hidden")) : ce(this, wr).call(this), u && !ce(this, tn) && (St(this, tn, new am(ce(this, wr))), ce(this, tn).observe(e)));
4900
4900
  },
4901
4901
  {
4902
4902
  threshold: Nl,
@@ -4915,7 +4915,7 @@ Ir = /* @__PURE__ */ new WeakMap();
4915
4915
  wr = /* @__PURE__ */ new WeakMap();
4916
4916
  Wo = /* @__PURE__ */ new WeakSet();
4917
4917
  ad = function() {
4918
- ce(this, Ir) || (Ku(this, Wo, sd).call(this), !nm(this.boundingClientRect, ce(this, Bo)) && (this.callback(this.boundingClientRect), wt(this, Bo, this.boundingClientRect)));
4918
+ ce(this, Ir) || (Ku(this, Wo, sd).call(this), !nm(this.boundingClientRect, ce(this, Bo)) && (this.callback(this.boundingClientRect), St(this, Bo, this.boundingClientRect)));
4919
4919
  };
4920
4920
  sd = function() {
4921
4921
  if (ce(this, et)) {
@@ -4980,8 +4980,8 @@ var _r, Sr, Io, ss, cm = class {
4980
4980
  }
4981
4981
  }, od));
4982
4982
  const r = em(e), o = im(r, t), a = lm(e, ce(this, ss));
4983
- wt(this, Io, r), wt(this, _r, new id(e, t, n)), this.disconnect = () => {
4984
- ce(this, Sr) || (wt(this, Sr, !0), o(), a(), ce(this, _r).disconnect());
4983
+ St(this, Io, r), St(this, _r, new id(e, t, n)), this.disconnect = () => {
4984
+ ce(this, Sr) || (St(this, Sr, !0), o(), a(), ce(this, _r).disconnect());
4985
4985
  };
4986
4986
  }
4987
4987
  };
@@ -5212,28 +5212,28 @@ function Sm(e, t, n, r = 25, o = wm, a = _m) {
5212
5212
  l.top * d.scaleY + d.y,
5213
5213
  l.width * d.scaleX,
5214
5214
  l.height * d.scaleY
5215
- ), w = {
5215
+ ), b = {
5216
5216
  x: 0,
5217
5217
  y: 0
5218
5218
  /* Idle */
5219
- }, b = {
5219
+ }, w = {
5220
5220
  x: 0,
5221
5221
  y: 0
5222
5222
  }, _ = {
5223
5223
  height: y.height * o.y,
5224
5224
  width: y.width * o.x
5225
5225
  };
5226
- return (!c || m && !u) && i <= y.top + _.height && n?.y !== 1 && s >= y.left - a.x && s <= y.right + a.x ? (w.y = m ? 1 : -1, b.y = r * Math.abs(
5226
+ return (!c || m && !u) && i <= y.top + _.height && n?.y !== 1 && s >= y.left - a.x && s <= y.right + a.x ? (b.y = m ? 1 : -1, w.y = r * Math.abs(
5227
5227
  (y.top + _.height - i) / _.height
5228
- )) : (!u || m && !c) && i >= y.bottom - _.height && n?.y !== -1 && s >= y.left - a.x && s <= y.right + a.x && (w.y = m ? -1 : 1, b.y = r * Math.abs(
5228
+ )) : (!u || m && !c) && i >= y.bottom - _.height && n?.y !== -1 && s >= y.left - a.x && s <= y.right + a.x && (b.y = m ? -1 : 1, w.y = r * Math.abs(
5229
5229
  (y.bottom - _.height - i) / _.height
5230
- )), (!p || v && !f) && s >= y.right - _.width && n?.x !== -1 && i >= y.top - a.y && i <= y.bottom + a.y ? (w.x = v ? -1 : 1, b.x = r * Math.abs(
5230
+ )), (!p || v && !f) && s >= y.right - _.width && n?.x !== -1 && i >= y.top - a.y && i <= y.bottom + a.y ? (b.x = v ? -1 : 1, w.x = r * Math.abs(
5231
5231
  (y.right - _.width - s) / _.width
5232
- )) : (!f || v && !p) && s <= y.left + _.width && n?.x !== 1 && i >= y.top - a.y && i <= y.bottom + a.y && (w.x = v ? 1 : -1, b.x = r * Math.abs(
5232
+ )) : (!f || v && !p) && s <= y.left + _.width && n?.x !== 1 && i >= y.top - a.y && i <= y.bottom + a.y && (b.x = v ? 1 : -1, w.x = r * Math.abs(
5233
5233
  (y.left + _.width - s) / _.width
5234
5234
  )), {
5235
- direction: w,
5236
- speed: b
5235
+ direction: b,
5236
+ speed: w
5237
5237
  };
5238
5238
  }
5239
5239
  function km(e) {
@@ -5328,25 +5328,25 @@ var Yt = class extends Hr {
5328
5328
  const v = qt(e), m = bi(v), y = {
5329
5329
  x: (n = m?.scaleX) != null ? n : 1,
5330
5330
  y: (r = m?.scaleY) != null ? r : 1
5331
- }, w = Dm(e, v);
5331
+ }, b = Dm(e, v);
5332
5332
  c?.(), m && (g = Em(
5333
5333
  u,
5334
5334
  m,
5335
5335
  v.transformOrigin
5336
- ), (i || w) && (f = g.top, p = g.left, d = g.width, h = g.height));
5337
- const b = {
5336
+ ), (i || b) && (f = g.top, p = g.left, d = g.width, h = g.height));
5337
+ const w = {
5338
5338
  width: (o = g?.width) != null ? o : d,
5339
5339
  height: (a = g?.height) != null ? a : h
5340
5340
  };
5341
- if (w && !i && g) {
5341
+ if (b && !i && g) {
5342
5342
  const _ = xm(
5343
5343
  g,
5344
- w,
5344
+ b,
5345
5345
  v.transformOrigin
5346
5346
  );
5347
- f = _.top, p = _.left, d = _.width, h = _.height, y.x = w.scaleX, y.y = w.scaleY;
5347
+ f = _.top, p = _.left, d = _.width, h = _.height, y.x = b.scaleX, y.y = b.scaleY;
5348
5348
  }
5349
- s && (i || (p *= s.scaleX, d *= s.scaleX, f *= s.scaleY, h *= s.scaleY), p += s.x, f += s.y), super(p, f, d, h), this.scale = y, this.intrinsicWidth = b.width, this.intrinsicHeight = b.height;
5349
+ s && (i || (p *= s.scaleX, d *= s.scaleX, f *= s.scaleY, h *= s.scaleY), p += s.x, f += s.y), super(p, f, d, h), this.scale = y, this.intrinsicWidth = w.width, this.intrinsicHeight = w.height;
5350
5350
  }
5351
5351
  };
5352
5352
  function Dm(e, t) {
@@ -5501,15 +5501,15 @@ var Lm = ({
5501
5501
  }, hd = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], kr = (e) => e !== void 0 && typeof e != "function" ? sr("Function expected") : e, Hm = (e, t, n, r, o) => ({ kind: hd[e], name: t, metadata: r, addInitializer: (a) => n._ ? sr("Already initialized") : o.push(kr(a || null)) }), Tn = (e, t) => us(t, dd("metadata"), e[3]), He = (e, t, n, r) => {
5502
5502
  for (var o = 0, a = e[t >> 1], s = a && a.length; o < s; o++) t & 1 ? a[o].call(n) : r = a[o].call(n, r);
5503
5503
  return r;
5504
- }, St = (e, t, n, r, o, a) => {
5504
+ }, Ct = (e, t, n, r, o, a) => {
5505
5505
  var s, i, l, c, u, f = t & 7, p = !!(t & 8), d = !!(t & 16), h = f > 3 ? e.length + 1 : f ? p ? 1 : 2 : 0, g = hd[f + 5], v = f > 3 && (e[h - 1] = []), m = e[h] || (e[h] = []), y = f && (!d && !p && (o = o.prototype), f < 5 && (f > 3 || !d) && zm(f < 4 ? o : { get [n]() {
5506
5506
  return Ie(this, a);
5507
- }, set [n](b) {
5508
- return ut(this, a, b);
5507
+ }, set [n](w) {
5508
+ return ut(this, a, w);
5509
5509
  } }, n));
5510
5510
  f ? d && f < 4 && Hl(a, (f > 2 ? "set " : f > 1 ? "get " : "") + n) : Hl(o, n);
5511
- for (var w = r.length - 1; w >= 0; w--)
5512
- c = Hm(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (b) => Gm(o, b) : (b) => n in b }, f ^ 3 && (u.get = d ? (b) => (f ^ 1 ? Ie : xn)(b, o, f ^ 4 ? a : y.get) : (b) => b[n]), f > 2 && (u.set = d ? (b, _) => ut(b, o, _, f ^ 4 ? a : y.set) : (b, _) => b[n] = _)), i = (0, r[w])(f ? f < 4 ? d ? a : y[g] : f > 4 ? void 0 : { get: y.get, set: y.set } : o, c), l._ = 1, f ^ 4 || i === void 0 ? kr(i) && (f > 4 ? v.unshift(i) : f ? d ? a = i : y[g] = i : o = i) : typeof i != "object" || i === null ? sr("Object expected") : (kr(s = i.get) && (y.get = s), kr(s = i.set) && (y.set = s), kr(s = i.init) && v.unshift(s));
5511
+ for (var b = r.length - 1; b >= 0; b--)
5512
+ c = Hm(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (w) => Gm(o, w) : (w) => n in w }, f ^ 3 && (u.get = d ? (w) => (f ^ 1 ? Ie : xn)(w, o, f ^ 4 ? a : y.get) : (w) => w[n]), f > 2 && (u.set = d ? (w, _) => ut(w, o, _, f ^ 4 ? a : y.set) : (w, _) => w[n] = _)), i = (0, r[b])(f ? f < 4 ? d ? a : y[g] : f > 4 ? void 0 : { get: y.get, set: y.set } : o, c), l._ = 1, f ^ 4 || i === void 0 ? kr(i) && (f > 4 ? v.unshift(i) : f ? d ? a = i : y[g] = i : o = i) : typeof i != "object" || i === null ? sr("Object expected") : (kr(s = i.get) && (y.get = s), kr(s = i.set) && (y.set = s), kr(s = i.init) && v.unshift(s));
5513
5513
  return f || Tn(e, o), y && _i(o, n, y), d ? f ^ 4 ? a : y : o;
5514
5514
  }, ki = (e, t, n) => t.has(e) || sr("Cannot " + n), Gm = (e, t) => Object(t) !== t ? sr('Cannot use the "in" operator on this value') : e.has(t), Ie = (e, t, n) => (ki(e, t, "read from private field"), n ? n.call(e) : t.get(e)), We = (e, t, n) => t.has(e) ? sr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ut = (e, t, n, r) => (ki(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), xn = (e, t, n) => (ki(e, t, "access private method"), n), Gl = {
5515
5515
  role: "button",
@@ -5577,38 +5577,38 @@ var Qm = ["dragover", "dragmove"], eg = class extends mt {
5577
5577
  l,
5578
5578
  s.draggable
5579
5579
  ), _.push(u)), f?.isConnected || (f = Jm(c), p = document.createTextNode(""), f.appendChild(p), _.push(f)), _.length > 0 && document.body.append(..._);
5580
- }, w = /* @__PURE__ */ new Set();
5581
- function b() {
5582
- for (const _ of w)
5580
+ }, b = /* @__PURE__ */ new Set();
5581
+ function w() {
5582
+ for (const _ of b)
5583
5583
  _();
5584
5584
  }
5585
5585
  this.registerEffect(() => {
5586
5586
  var _;
5587
- w.clear();
5587
+ b.clear();
5588
5588
  for (const S of this.manager.registry.draggables.value) {
5589
5589
  const C = (_ = S.handle) != null ? _ : S.element;
5590
5590
  if (C) {
5591
- (!u || !f) && w.add(y), (!Km(C) || mi()) && !C.hasAttribute("tabindex") && w.add(() => C.setAttribute("tabindex", "0")), !C.hasAttribute("role") && C.tagName.toLowerCase() !== "button" && w.add(
5591
+ (!u || !f) && b.add(y), (!Km(C) || mi()) && !C.hasAttribute("tabindex") && b.add(() => C.setAttribute("tabindex", "0")), !C.hasAttribute("role") && C.tagName.toLowerCase() !== "button" && b.add(
5592
5592
  () => C.setAttribute("role", Gl.role)
5593
- ), C.hasAttribute("aria-roledescription") || w.add(
5593
+ ), C.hasAttribute("aria-roledescription") || b.add(
5594
5594
  () => C.setAttribute(
5595
5595
  "aria-roledescription",
5596
5596
  Gl.roleDescription
5597
5597
  )
5598
- ), C.hasAttribute("aria-describedby") || w.add(
5598
+ ), C.hasAttribute("aria-describedby") || b.add(
5599
5599
  () => C.setAttribute("aria-describedby", l)
5600
5600
  );
5601
5601
  for (const x of ["aria-pressed", "aria-grabbed"]) {
5602
5602
  const M = String(S.isDragging);
5603
- C.getAttribute(x) !== M && w.add(() => C.setAttribute(x, M));
5603
+ C.getAttribute(x) !== M && b.add(() => C.setAttribute(x, M));
5604
5604
  }
5605
5605
  const E = String(S.disabled);
5606
- C.getAttribute("aria-disabled") !== E && w.add(
5606
+ C.getAttribute("aria-disabled") !== E && b.add(
5607
5607
  () => C.setAttribute("aria-disabled", E)
5608
5608
  );
5609
5609
  }
5610
5610
  }
5611
- w.size > 0 && Vo.schedule(b);
5611
+ b.size > 0 && Vo.schedule(w);
5612
5612
  }), this.destroy = () => {
5613
5613
  super.destroy(), u?.remove(), f?.remove(), m.forEach((_) => _());
5614
5614
  };
@@ -5639,7 +5639,7 @@ var ng = class extends mt {
5639
5639
  }
5640
5640
  });
5641
5641
  }
5642
- }, Zo = /* @__PURE__ */ new Map(), pd, md, gd, vd, ds, Tr, jt, Ci, Qn, yd, bd, wd, _d, $n = class extends (ds = Ur, vd = [ge], gd = [Re], md = [Re], pd = [Re], ds) {
5642
+ }, Zo = /* @__PURE__ */ new Map(), pd, md, gd, vd, ds, Tr, jt, Ci, Qn, yd, bd, wd, _d, $n = class extends (ds = Ur, vd = [ge], gd = [Pe], md = [Pe], pd = [Pe], ds) {
5643
5643
  constructor(e) {
5644
5644
  super(e), He(jt, 5, this), We(this, Qn), We(this, Tr, /* @__PURE__ */ new Set()), We(this, Ci, He(jt, 8, this, /* @__PURE__ */ new Set())), He(jt, 11, this), this.registerEffect(xn(this, Qn, yd));
5645
5645
  }
@@ -5762,10 +5762,10 @@ _d = function(e, t, n) {
5762
5762
  }
5763
5763
  };
5764
5764
  };
5765
- St(jt, 4, "additionalRoots", vd, $n, Ci);
5766
- St(jt, 2, "sourceRoot", gd, $n);
5767
- St(jt, 2, "targetRoot", md, $n);
5768
- St(jt, 2, "roots", pd, $n);
5765
+ Ct(jt, 4, "additionalRoots", vd, $n, Ci);
5766
+ Ct(jt, 2, "sourceRoot", gd, $n);
5767
+ Ct(jt, 2, "targetRoot", md, $n);
5768
+ Ct(jt, 2, "roots", pd, $n);
5769
5769
  Tn(jt, $n);
5770
5770
  var Yr = "data-dnd-", fs = `${Yr}dropping`, ot = "--dnd-", Vt = `${Yr}dragging`, Ho = `${Yr}placeholder`, rg = [
5771
5771
  Vt,
@@ -6073,8 +6073,8 @@ xd = function() {
6073
6073
  x: g.scaleX / h.scaleX,
6074
6074
  y: g.scaleY / h.scaleY
6075
6075
  };
6076
- let { width: w, height: b, top: _, left: S } = m;
6077
- v && (w = w / y.x, b = b / y.y);
6076
+ let { width: b, height: w, top: _, left: S } = m;
6077
+ v && (b = b / y.x, w = w / y.y);
6078
6078
  const C = new Rm(d), {
6079
6079
  transition: E,
6080
6080
  translate: x,
@@ -6097,25 +6097,25 @@ xd = function() {
6097
6097
  if (!p.transformOrigin) {
6098
6098
  const le = ke(() => i.current);
6099
6099
  p.transformOrigin = {
6100
- x: (le.x - S * h.scaleX - h.x) / (w * h.scaleX),
6101
- y: (le.y - _ * h.scaleY - h.y) / (b * h.scaleY)
6100
+ x: (le.x - S * h.scaleX - h.x) / (b * h.scaleX),
6101
+ y: (le.y - _ * h.scaleY - h.y) / (w * h.scaleY)
6102
6102
  };
6103
6103
  }
6104
- const { transformOrigin: he } = p, De = _ * h.scaleY + h.y, Z = S * h.scaleX + h.x;
6104
+ const { transformOrigin: he } = p, Re = _ * h.scaleY + h.y, Z = S * h.scaleX + h.x;
6105
6105
  if (!p.coordinates && (p.coordinates = {
6106
6106
  x: Z,
6107
- y: De
6107
+ y: Re
6108
6108
  }, y.x !== 1 || y.y !== 1)) {
6109
6109
  const { scaleX: le, scaleY: pe } = g, { x: Ke, y: Rt } = he;
6110
- p.coordinates.x += (w * le - w) * Ke, p.coordinates.y += (b * pe - b) * Rt;
6110
+ p.coordinates.x += (b * le - b) * Ke, p.coordinates.y += (w * pe - w) * Rt;
6111
6111
  }
6112
- p.dimensions || (p.dimensions = { width: w, height: b }), p.frameTransform || (p.frameTransform = h);
6112
+ p.dimensions || (p.dimensions = { width: b, height: w }), p.frameTransform || (p.frameTransform = h);
6113
6113
  const Y = {
6114
6114
  x: p.coordinates.x - Z,
6115
- y: p.coordinates.y - De
6115
+ y: p.coordinates.y - Re
6116
6116
  }, _e = {
6117
- width: (p.dimensions.width * p.frameTransform.scaleX - w * h.scaleX) * he.x,
6118
- height: (p.dimensions.height * p.frameTransform.scaleY - b * h.scaleY) * he.y
6117
+ width: (p.dimensions.width * p.frameTransform.scaleX - b * h.scaleX) * he.x,
6118
+ height: (p.dimensions.height * p.frameTransform.scaleY - w * h.scaleY) * he.y
6119
6119
  }, G = {
6120
6120
  x: Y.x / h.scaleX + _e.width,
6121
6121
  y: Y.y / h.scaleY + _e.height
@@ -6127,8 +6127,8 @@ xd = function() {
6127
6127
  const Me = ke(() => s.transform), B = (t = p.translate) != null ? t : { x: 0, y: 0 }, Oe = Me.x * h.scaleX + B.x, st = Me.y * h.scaleY + B.y, Ge = Qu();
6128
6128
  C.set(
6129
6129
  {
6130
- width: w - X,
6131
- height: b - ee,
6130
+ width: b - X,
6131
+ height: w - ee,
6132
6132
  top: te.top + Ge.y,
6133
6133
  left: te.left + Ge.x,
6134
6134
  translate: `${Oe}px ${st}px 0`,
@@ -6145,8 +6145,8 @@ xd = function() {
6145
6145
  feedbackElement: d,
6146
6146
  frameTransform: h,
6147
6147
  transformOrigin: he,
6148
- width: w,
6149
- height: b,
6148
+ width: b,
6149
+ height: w,
6150
6150
  top: _,
6151
6151
  left: S,
6152
6152
  widthOffset: X,
@@ -6200,7 +6200,7 @@ xd = function() {
6200
6200
  const Rt = (le = p.translate) != null ? le : { x: 0, y: 0 }, Pt = {
6201
6201
  x: pe.x / h.scaleX + Rt.x,
6202
6202
  y: pe.y / h.scaleY + Rt.y
6203
- }, Rn = r.current.translate, gt = ke(() => s.modifiers), V = ke(() => {
6203
+ }, Rn = r.current.translate, yt = ke(() => s.modifiers), V = ke(() => {
6204
6204
  var ne;
6205
6205
  return (ne = s.shape) == null ? void 0 : ne.current;
6206
6206
  }), J = fe && !tt ? "250ms cubic-bezier(0.25, 1, 0.5, 1)" : "0ms linear";
@@ -6210,7 +6210,7 @@ xd = function() {
6210
6210
  translate: `${Pt.x}px ${Pt.y}px 0`
6211
6211
  },
6212
6212
  ot
6213
- ), ve?.takeRecords(), V && V !== xe && Rn && !gt.length) {
6213
+ ), ve?.takeRecords(), V && V !== xe && Rn && !yt.length) {
6214
6214
  const ne = Nt.delta(Pt, Rn);
6215
6215
  s.shape = Hr.from(
6216
6216
  V.boundingRectangle
@@ -6257,7 +6257,7 @@ xd = function() {
6257
6257
  j(), ze();
6258
6258
  };
6259
6259
  };
6260
- St(Lr, 4, "overlay", kd, Br, xi);
6260
+ Ct(Lr, 4, "overlay", kd, Br, xi);
6261
6261
  Tn(Lr, Br);
6262
6262
  Br.configure = An(Br);
6263
6263
  var ms = Br, ur = !0, gg = !1, Ed, Id, Ad, Md, on, Ei, Ii;
@@ -6276,8 +6276,8 @@ var Wr = class {
6276
6276
  on = ir(null);
6277
6277
  Ei = /* @__PURE__ */ new WeakMap();
6278
6278
  Ii = /* @__PURE__ */ new WeakMap();
6279
- St(on, 4, Md, Ad, Wr, Ei);
6280
- St(on, 4, Id, Ed, Wr, Ii);
6279
+ Ct(on, 4, Md, Ad, Wr, Ei);
6280
+ Ct(on, 4, Id, Ed, Wr, Ii);
6281
6281
  Tn(on, Wr);
6282
6282
  var vg = [At.Forward, At.Reverse], Xl = class {
6283
6283
  constructor() {
@@ -6354,16 +6354,16 @@ var Td, gs, Vr, Ai, nn, vs, ia = class extends (gs = Ur, Td = [ge], gs) {
6354
6354
  for (const m of su)
6355
6355
  p[m].isLocked(v[m]) && (g[m] = 0, v[m] = 0);
6356
6356
  if (v.x || v.y) {
6357
- const { x: m, y } = u ?? v, w = m * g.x, b = y * g.y;
6358
- if (w || b) {
6357
+ const { x: m, y } = u ?? v, b = m * g.x, w = y * g.y;
6358
+ if (b || w) {
6359
6359
  const _ = (s = Ie(this, nn)) == null ? void 0 : s.by;
6360
- if (this.autoScrolling && _ && (_.x && !w || _.y && !b))
6360
+ if (this.autoScrolling && _ && (_.x && !b || _.y && !w))
6361
6361
  continue;
6362
6362
  return ut(this, nn, {
6363
6363
  element: d,
6364
6364
  by: {
6365
- x: w,
6366
- y: b
6365
+ x: b,
6366
+ y: w
6367
6367
  }
6368
6368
  }), Vo.schedule(Ie(this, vs)), !0;
6369
6369
  }
@@ -6411,7 +6411,7 @@ Vr = ir(gs);
6411
6411
  Ai = /* @__PURE__ */ new WeakMap();
6412
6412
  nn = /* @__PURE__ */ new WeakMap();
6413
6413
  vs = /* @__PURE__ */ new WeakMap();
6414
- St(Vr, 4, "autoScrolling", Td, ia, Ai);
6414
+ Ct(Vr, 4, "autoScrolling", Td, ia, Ai);
6415
6415
  Tn(Vr, ia);
6416
6416
  function jl(e) {
6417
6417
  return e > 0 ? At.Forward : e < 0 ? At.Reverse : At.Idle;
@@ -6941,9 +6941,9 @@ Ot = ir(ws);
6941
6941
  Ti = /* @__PURE__ */ new WeakMap();
6942
6942
  $i = /* @__PURE__ */ new WeakMap();
6943
6943
  Di = /* @__PURE__ */ new WeakMap();
6944
- St(Ot, 4, "handle", Pd, jr, Ti);
6945
- St(Ot, 4, "element", Rd, jr, $i);
6946
- St(Ot, 4, "feedback", Dd, jr, Di);
6944
+ Ct(Ot, 4, "handle", Pd, jr, Ti);
6945
+ Ct(Ot, 4, "element", Rd, jr, $i);
6946
+ Ct(Ot, 4, "feedback", Dd, jr, Di);
6947
6947
  Tn(Ot, jr);
6948
6948
  var Fd, Od, _s, an, Ri, Ra, Ld, Bd, $r, Pi, Wd = class extends (_s = Ht, Od = [ge], Fd = [ge], _s) {
6949
6949
  constructor(e, t) {
@@ -7005,8 +7005,8 @@ an = ir(_s);
7005
7005
  Ri = /* @__PURE__ */ new WeakMap();
7006
7006
  $r = /* @__PURE__ */ new WeakSet();
7007
7007
  Pi = /* @__PURE__ */ new WeakMap();
7008
- Ra = St(an, 20, "#element", Od, $r, Ri), Ld = Ra.get, Bd = Ra.set;
7009
- St(an, 4, "proxy", Fd, Wd, Pi);
7008
+ Ra = Ct(an, 20, "#element", Od, $r, Ri), Ld = Ra.get, Bd = Ra.set;
7009
+ Ct(an, 4, "proxy", Fd, Wd, Pi);
7010
7010
  Tn(an, Wd);
7011
7011
  function Tg(e) {
7012
7012
  return e != null && typeof e == "object" && "current" in e;
@@ -7100,7 +7100,7 @@ Sc(
7100
7100
  })
7101
7101
  );
7102
7102
  function Zg() {
7103
- return Pe(zg);
7103
+ return Fe(zg);
7104
7104
  }
7105
7105
  function Hg(e) {
7106
7106
  var t;
@@ -7173,7 +7173,7 @@ var Ug = Object.create, Vd = Object.defineProperty, Xg = Object.getOwnPropertyDe
7173
7173
  for (var s, i, l, c, u = t & 7, f = !1, p = !1, d = 2, h = zd[u + 5], g = e[d] || (e[d] = []), v = (o = o.prototype, Xg(o, n)), m = r.length - 1; m >= 0; m--)
7174
7174
  l = Kg(u, n, i = {}, e[3], g), l.static = f, l.private = p, c = l.access = { has: (y) => n in y }, c.get = (y) => y[n], s = (0, r[m])(v[h], l), i._ = 1, Zd(s) && (v[h] = s);
7175
7175
  return v && Vd(o, n, v), o;
7176
- }, Gd = (e, t, n) => t.has(e) || ca("Cannot " + n), Qg = (e, t, n) => (Gd(e, t, "read from private field"), t.get(e)), e0 = (e, t, n) => t.has(e) ? ca("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), t0 = (e, t, n, r) => (Gd(e, t, "write to private field"), t.set(e, n), n), dr = class Ss {
7176
+ }, Gd = (e, t, n) => t.has(e) || ca("Cannot " + n), Qg = (e, t, n) => (Gd(e, t, "read from private field"), t.get(e)), ev = (e, t, n) => t.has(e) ? ca("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), tv = (e, t, n, r) => (Gd(e, t, "write to private field"), t.set(e, n), n), dr = class Ss {
7177
7177
  /**
7178
7178
  * @param {number} Coordinate of the point on the horizontal axis
7179
7179
  * @param {number} Coordinate of the point on the vertical axis
@@ -7211,10 +7211,10 @@ var Ug = Object.create, Vd = Object.defineProperty, Xg = Object.getOwnPropertyDe
7211
7211
  static from({ x: t, y: n }) {
7212
7212
  return new Ss(t, n);
7213
7213
  }
7214
- }, Ud, Xd, ks, Mo, Kr, Fi = class extends (ks = un, Xd = [Re], Ud = [Re], ks) {
7214
+ }, Ud, Xd, ks, Mo, Kr, Fi = class extends (ks = un, Xd = [Pe], Ud = [Pe], ks) {
7215
7215
  constructor(t) {
7216
7216
  const n = dr.from(t);
7217
- super(n, (r, o) => dr.equals(r, o)), Jg(Kr, 5, this), e0(this, Mo, 0), this.velocity = { x: 0, y: 0 };
7217
+ super(n, (r, o) => dr.equals(r, o)), Jg(Kr, 5, this), ev(this, Mo, 0), this.velocity = { x: 0, y: 0 };
7218
7218
  }
7219
7219
  get delta() {
7220
7220
  return dr.delta(this.current, this.initial);
@@ -7237,7 +7237,7 @@ var Ug = Object.create, Vd = Object.defineProperty, Xg = Object.getOwnPropertyDe
7237
7237
  y: r.y - n.y
7238
7238
  }, a = Date.now(), s = a - Qg(this, Mo), i = (l) => Math.round(l / s * 100);
7239
7239
  ln(() => {
7240
- t0(this, Mo, a), this.velocity = {
7240
+ tv(this, Mo, a), this.velocity = {
7241
7241
  x: i(o.x),
7242
7242
  y: i(o.y)
7243
7243
  }, super.current = r;
@@ -7254,7 +7254,7 @@ Hd(Kr, 2, "direction", Ud, Fi);
7254
7254
  qg(Kr, Fi);
7255
7255
  var Yd = /* @__PURE__ */ ((e) => (e.Horizontal = "x", e.Vertical = "y", e))(Yd || {});
7256
7256
  Object.values(Yd);
7257
- const n0 = /* @__PURE__ */ new Map([
7257
+ const nv = /* @__PURE__ */ new Map([
7258
7258
  [
7259
7259
  "bold",
7260
7260
  /* @__PURE__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement("path", { d: "M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z" }))
@@ -7285,7 +7285,7 @@ const n0 = /* @__PURE__ */ new Map([
7285
7285
  "thin",
7286
7286
  /* @__PURE__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement("path", { d: "M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z" }))
7287
7287
  ]
7288
- ]), r0 = /* @__PURE__ */ new Map([
7288
+ ]), rv = /* @__PURE__ */ new Map([
7289
7289
  [
7290
7290
  "bold",
7291
7291
  /* @__PURE__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement("path", { d: "M157.27,21.22a12,12,0,0,0-12.64,1.31L75.88,76H32A20,20,0,0,0,12,96v64a20,20,0,0,0,20,20H75.88l68.75,53.47A12,12,0,0,0,164,224V32A12,12,0,0,0,157.27,21.22ZM36,100H68v56H36Zm104,99.46L92,162.13V93.87l48-37.33ZM212,128a44,44,0,0,1-11,29.11,12,12,0,1,1-18-15.88,20,20,0,0,0,0-26.43,12,12,0,0,1,18-15.86A43.94,43.94,0,0,1,212,128Zm40,0a83.87,83.87,0,0,1-21.39,56,12,12,0,0,1-17.89-16,60,60,0,0,0,0-80,12,12,0,1,1,17.88-16A83.87,83.87,0,0,1,252,128Z" }))
@@ -7310,7 +7310,7 @@ const n0 = /* @__PURE__ */ new Map([
7310
7310
  "thin",
7311
7311
  /* @__PURE__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement("path", { d: "M153.76,28.41a4,4,0,0,0-4.22.43L78.63,84H32A12,12,0,0,0,20,96v64a12,12,0,0,0,12,12H78.63l70.91,55.16A4.07,4.07,0,0,0,152,228a3.92,3.92,0,0,0,1.76-.41A4,4,0,0,0,156,224V32A4,4,0,0,0,153.76,28.41ZM28,160V96a4,4,0,0,1,4-4H76v72H32A4,4,0,0,1,28,160Zm120,55.82L84,166V90l64-49.78Zm47-111.61a36,36,0,0,1,0,47.59,4,4,0,1,1-6-5.3,28,28,0,0,0,0-37,4,4,0,0,1,6-5.28ZM244,128a75.88,75.88,0,0,1-19.35,50.67,4,4,0,0,1-6-5.34,68,68,0,0,0,0-90.66,4,4,0,0,1,6-5.34A75.88,75.88,0,0,1,244,128Z" }))
7312
7312
  ]
7313
- ]), o0 = /* @__PURE__ */ new Map([
7313
+ ]), ov = /* @__PURE__ */ new Map([
7314
7314
  [
7315
7315
  "bold",
7316
7316
  /* @__PURE__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement("path", { d: "M157.27,21.22a12,12,0,0,0-12.64,1.31L75.88,76H32A20,20,0,0,0,12,96v64a20,20,0,0,0,20,20H75.88l68.75,53.47A12,12,0,0,0,164,224V32A12,12,0,0,0,157.27,21.22ZM36,100H68v56H36Zm104,99.46L92,162.13V93.87l48-37.33ZM212,128a44,44,0,0,1-11,29.11,12,12,0,0,1-18-15.88,20,20,0,0,0,0-26.44,12,12,0,0,1,18-15.85A43.94,43.94,0,0,1,212,128Z" }))
@@ -7335,7 +7335,7 @@ const n0 = /* @__PURE__ */ new Map([
7335
7335
  "thin",
7336
7336
  /* @__PURE__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement("path", { d: "M153.76,28.41a4,4,0,0,0-4.22.43L78.63,84H32A12,12,0,0,0,20,96v64a12,12,0,0,0,12,12H78.63l70.91,55.16A4.07,4.07,0,0,0,152,228a3.92,3.92,0,0,0,1.76-.41A4,4,0,0,0,156,224V32A4,4,0,0,0,153.76,28.41ZM28,160V96a4,4,0,0,1,4-4H76v72H32A4,4,0,0,1,28,160Zm120,55.82L84,166V90l64-49.78ZM204,128a36,36,0,0,1-9,23.82,4,4,0,1,1-6-5.3,28,28,0,0,0,0-37,4,4,0,0,1,6-5.28A36,36,0,0,1,204,128Z" }))
7337
7337
  ]
7338
- ]), a0 = /* @__PURE__ */ new Map([
7338
+ ]), av = /* @__PURE__ */ new Map([
7339
7339
  [
7340
7340
  "bold",
7341
7341
  /* @__PURE__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement("path", { d: "M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z" }))
@@ -7366,7 +7366,7 @@ const n0 = /* @__PURE__ */ new Map([
7366
7366
  "thin",
7367
7367
  /* @__PURE__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement("path", { d: "M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z" }))
7368
7368
  ]
7369
- ]), s0 = Ve({
7369
+ ]), sv = Ve({
7370
7370
  color: "currentColor",
7371
7371
  size: "1em",
7372
7372
  weight: "regular",
@@ -7388,7 +7388,7 @@ const n0 = /* @__PURE__ */ new Map([
7388
7388
  weight: p = "regular",
7389
7389
  mirrored: d = !1,
7390
7390
  ...h
7391
- } = P.useContext(s0);
7391
+ } = P.useContext(sv);
7392
7392
  return /* @__PURE__ */ P.createElement(
7393
7393
  "svg",
7394
7394
  {
@@ -7409,15 +7409,15 @@ const n0 = /* @__PURE__ */ new Map([
7409
7409
  }
7410
7410
  );
7411
7411
  qr.displayName = "IconBase";
7412
- const jd = P.forwardRef((e, t) => /* @__PURE__ */ P.createElement(qr, { ref: t, ...e, weights: n0 }));
7412
+ const jd = P.forwardRef((e, t) => /* @__PURE__ */ P.createElement(qr, { ref: t, ...e, weights: nv }));
7413
7413
  jd.displayName = "DotsThreeIcon";
7414
- const Kd = P.forwardRef((e, t) => /* @__PURE__ */ P.createElement(qr, { ref: t, ...e, weights: r0 }));
7414
+ const Kd = P.forwardRef((e, t) => /* @__PURE__ */ P.createElement(qr, { ref: t, ...e, weights: rv }));
7415
7415
  Kd.displayName = "SpeakerHighIcon";
7416
- const qd = P.forwardRef((e, t) => /* @__PURE__ */ P.createElement(qr, { ref: t, ...e, weights: o0 }));
7416
+ const qd = P.forwardRef((e, t) => /* @__PURE__ */ P.createElement(qr, { ref: t, ...e, weights: ov }));
7417
7417
  qd.displayName = "SpeakerLowIcon";
7418
- const Jd = P.forwardRef((e, t) => /* @__PURE__ */ P.createElement(qr, { ref: t, ...e, weights: a0 }));
7418
+ const Jd = P.forwardRef((e, t) => /* @__PURE__ */ P.createElement(qr, { ref: t, ...e, weights: av }));
7419
7419
  Jd.displayName = "XIcon";
7420
- const i0 = Jd;
7420
+ const iv = Jd;
7421
7421
  O.span`
7422
7422
  font-family: 'Courier New', Monaco, monospace;
7423
7423
  font-size: 1rem;
@@ -7472,25 +7472,25 @@ O(Oi)`
7472
7472
  min-height: 1.75rem;
7473
7473
  font-size: ${(e) => e.theme.fontSizeSmall};
7474
7474
  `;
7475
- var l0 = O.div`
7475
+ var lv = O.div`
7476
7476
  display: inline-flex;
7477
7477
  align-items: center;
7478
7478
  gap: 0.5rem;
7479
- `, c0 = O.input`
7479
+ `, cv = O.input`
7480
7480
  cursor: pointer;
7481
7481
  accent-color: ${(e) => e.theme.inputFocusBorder};
7482
7482
 
7483
7483
  &:disabled {
7484
7484
  cursor: not-allowed;
7485
7485
  }
7486
- `, u0 = O.label`
7486
+ `, uv = O.label`
7487
7487
  margin: 0;
7488
7488
  cursor: pointer;
7489
7489
  user-select: none;
7490
7490
  font-family: ${(e) => e.theme.fontFamily};
7491
7491
  font-size: ${(e) => e.theme.fontSize};
7492
7492
  color: ${(e) => e.theme.textColor};
7493
- `, kt = O.button`
7493
+ `, xt = O.button`
7494
7494
  padding: 0.5rem 1rem;
7495
7495
  background: ${(e) => e.theme.buttonBackground || "#007bff"};
7496
7496
  color: ${(e) => e.theme.buttonText || "white"};
@@ -7547,7 +7547,7 @@ O(Qd)`
7547
7547
  padding: 0.25rem 0.5rem;
7548
7548
  font-size: ${(e) => e.theme.fontSizeSmall};
7549
7549
  `;
7550
- var d0 = O.label`
7550
+ var dv = O.label`
7551
7551
  font-family: ${(e) => e.theme.fontFamily};
7552
7552
  font-size: ${(e) => e.theme.fontSizeSmall};
7553
7553
  font-weight: 500;
@@ -7564,7 +7564,7 @@ O.label`
7564
7564
  gap: 0.5rem;
7565
7565
  cursor: pointer;
7566
7566
  `;
7567
- var f0 = O.span`
7567
+ var fv = O.span`
7568
7568
  position: absolute;
7569
7569
  width: 1px;
7570
7570
  height: 1px;
@@ -7692,14 +7692,14 @@ var tf = O.input.attrs({ type: "range" })`
7692
7692
  &:disabled::-moz-range-thumb {
7693
7693
  cursor: not-allowed;
7694
7694
  }
7695
- `, h0 = ({
7695
+ `, hv = ({
7696
7696
  checked: e,
7697
7697
  onChange: t,
7698
7698
  disabled: n = !1,
7699
7699
  className: r
7700
- }) => /* @__PURE__ */ me(l0, { className: r, children: [
7700
+ }) => /* @__PURE__ */ me(lv, { className: r, children: [
7701
7701
  /* @__PURE__ */ k(
7702
- c0,
7702
+ cv,
7703
7703
  {
7704
7704
  type: "checkbox",
7705
7705
  id: "automatic-scroll",
@@ -7711,7 +7711,7 @@ var tf = O.input.attrs({ type: "range" })`
7711
7711
  disabled: n
7712
7712
  }
7713
7713
  ),
7714
- /* @__PURE__ */ k(u0, { htmlFor: "automatic-scroll", children: "Automatic Scroll" })
7714
+ /* @__PURE__ */ k(uv, { htmlFor: "automatic-scroll", children: "Automatic Scroll" })
7715
7715
  ] });
7716
7716
  function nf(e) {
7717
7717
  return typeof e == "object" && e !== null && "type" in e;
@@ -7792,7 +7792,7 @@ var rf = {
7792
7792
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif',
7793
7793
  fontSize: "14px",
7794
7794
  fontSizeSmall: "12px"
7795
- }, p0 = class {
7795
+ }, pv = class {
7796
7796
  constructor(e) {
7797
7797
  this._listeners = /* @__PURE__ */ new Set(), this._notifyRafId = null, this.subscribe = (r) => (this._listeners.add(r), () => this._listeners.delete(r)), this.getSnapshot = () => this._state;
7798
7798
  const t = e?.clientWidth ?? (typeof window < "u" ? window.innerWidth : 1024), n = t * 1.5;
@@ -7824,10 +7824,10 @@ var rf = {
7824
7824
  cancelPendingNotification() {
7825
7825
  this._notifyRafId !== null && (cancelAnimationFrame(this._notifyRafId), this._notifyRafId = null);
7826
7826
  }
7827
- }, of = Ve(null), m0 = () => () => {
7828
- }, g0 = ({ containerRef: e, children: t }) => {
7827
+ }, of = Ve(null), mv = () => () => {
7828
+ }, gv = ({ containerRef: e, children: t }) => {
7829
7829
  const n = T(null);
7830
- n.current === null && (n.current = new p0(e.current));
7830
+ n.current === null && (n.current = new pv(e.current));
7831
7831
  const r = n.current, o = T(null), a = $(() => {
7832
7832
  const i = e.current;
7833
7833
  i && r.update(i.scrollLeft, i.clientWidth);
@@ -7850,16 +7850,16 @@ var rf = {
7850
7850
  };
7851
7851
  }, [e, s, r]), /* @__PURE__ */ k(of.Provider, { value: r, children: t });
7852
7852
  };
7853
- function v0(e) {
7854
- const t = Pe(of);
7853
+ function vv(e) {
7854
+ const t = Fe(of);
7855
7855
  return Ah(
7856
- t ? t.subscribe : m0,
7856
+ t ? t.subscribe : mv,
7857
7857
  () => e(t ? t.getSnapshot() : null),
7858
7858
  () => e(null)
7859
7859
  );
7860
7860
  }
7861
7861
  function ua(e, t, n = 0) {
7862
- const r = v0((o) => {
7862
+ const r = vv((o) => {
7863
7863
  const a = Math.ceil(e / t), s = [];
7864
7864
  for (let i = 0; i < a; i++) {
7865
7865
  const l = i * t, c = Math.min(e - l, t);
@@ -7877,10 +7877,10 @@ function ua(e, t, n = 0) {
7877
7877
  [r]
7878
7878
  );
7879
7879
  }
7880
- var af = Ve(0), y0 = ({
7880
+ var af = Ve(0), yv = ({
7881
7881
  originX: e,
7882
7882
  children: t
7883
- }) => /* @__PURE__ */ k(af.Provider, { value: e, children: t }), Li = () => Pe(af);
7883
+ }) => /* @__PURE__ */ k(af.Provider, { value: e, children: t }), Li = () => Fe(af);
7884
7884
  function da() {
7885
7885
  const e = T(/* @__PURE__ */ new Map()), t = $((n) => {
7886
7886
  if (n !== null) {
@@ -7894,7 +7894,7 @@ function da() {
7894
7894
  o.isConnected || n.delete(r);
7895
7895
  }), { canvasRef: t, canvasMapRef: e };
7896
7896
  }
7897
- function b0(e, t, n, r) {
7897
+ function bv(e, t, n, r) {
7898
7898
  if (n * 2 + 1 >= e.length)
7899
7899
  return null;
7900
7900
  const o = 2 ** (t - 1);
@@ -7905,17 +7905,17 @@ function b0(e, t, n, r) {
7905
7905
  }
7906
7906
  return { min: a, max: s };
7907
7907
  }
7908
- function w0(e, t, n, r, o, a) {
7908
+ function wv(e, t, n, r, o, a) {
7909
7909
  const s = Math.abs(r * n), i = Math.abs(o * n);
7910
7910
  return a === "normal" ? [{ x: e, y: n - i, width: t, height: i + s }] : [
7911
7911
  { x: e, y: 0, width: t, height: n - i },
7912
7912
  { x: e, y: n + s, width: t, height: n - s }
7913
7913
  ];
7914
7914
  }
7915
- function _0(e, t, n) {
7915
+ function _v(e, t, n) {
7916
7916
  return Math.floor((e - t + n) / n) * n;
7917
7917
  }
7918
- function S0(e, t, n, r) {
7918
+ function Sv(e, t, n, r) {
7919
7919
  if (!nf(t))
7920
7920
  return t;
7921
7921
  let o;
@@ -7924,7 +7924,7 @@ function S0(e, t, n, r) {
7924
7924
  o.addColorStop(a.offset, a.color);
7925
7925
  return o;
7926
7926
  }
7927
- var k0 = O.canvas.attrs((e) => ({
7927
+ var kv = O.canvas.attrs((e) => ({
7928
7928
  style: {
7929
7929
  width: `${e.$cssWidth}px`,
7930
7930
  height: `${e.$waveHeight}px`,
@@ -7936,7 +7936,7 @@ var k0 = O.canvas.attrs((e) => ({
7936
7936
  /* Disable image rendering interpolation */
7937
7937
  image-rendering: pixelated;
7938
7938
  image-rendering: crisp-edges;
7939
- `, C0 = O.div.attrs((e) => ({
7939
+ `, Cv = O.div.attrs((e) => ({
7940
7940
  style: {
7941
7941
  top: `${e.$waveHeight * e.$index}px`,
7942
7942
  width: `${e.$cssWidth}px`,
@@ -7972,14 +7972,14 @@ var k0 = O.canvas.attrs((e) => ({
7972
7972
  x.resetTransform(), x.clearRect(0, 0, C.width, C.height), x.imageSmoothingEnabled = !1, x.scale(s, s);
7973
7973
  const R = C.width / s;
7974
7974
  let A;
7975
- d === "normal" ? A = c : A = l, x.fillStyle = S0(x, A, R, i);
7976
- const I = E, D = E + R, F = _0(I, u, _);
7975
+ d === "normal" ? A = c : A = l, x.fillStyle = Sv(x, A, R, i);
7976
+ const I = E, D = E + R, F = _v(I, u, _);
7977
7977
  for (let L = Math.max(0, F); L < D; L += _) {
7978
7978
  const H = L - I;
7979
7979
  if (H + u <= 0) continue;
7980
- const Q = Math.min(L + _, r), q = b0(t, n, L, Q);
7980
+ const Q = Math.min(L + _, r), q = bv(t, n, L, Q);
7981
7981
  if (q) {
7982
- const oe = w0(H, u, M, q.min, q.max, d);
7982
+ const oe = wv(H, u, M, q.min, q.max, d);
7983
7983
  for (const X of oe)
7984
7984
  x.fillRect(X.x, X.y, X.width, X.height);
7985
7985
  }
@@ -8004,7 +8004,7 @@ var k0 = O.canvas.attrs((e) => ({
8004
8004
  const y = m.map((_) => {
8005
8005
  const S = _ * Ze, C = Math.min(r - S, Ze);
8006
8006
  return /* @__PURE__ */ k(
8007
- k0,
8007
+ kv,
8008
8008
  {
8009
8009
  $cssWidth: C,
8010
8010
  $left: S,
@@ -8016,19 +8016,19 @@ var k0 = O.canvas.attrs((e) => ({
8016
8016
  },
8017
8017
  `${r}-${_}`
8018
8018
  );
8019
- }), b = p ? "transparent" : cn(c);
8019
+ }), w = p ? "transparent" : cn(c);
8020
8020
  return /* @__PURE__ */ k(
8021
- C0,
8021
+ Cv,
8022
8022
  {
8023
8023
  $index: o,
8024
8024
  $cssWidth: r,
8025
8025
  className: a,
8026
8026
  $waveHeight: i,
8027
- $waveFillColor: b,
8027
+ $waveFillColor: w,
8028
8028
  children: y
8029
8029
  }
8030
8030
  );
8031
- }, x0 = {
8031
+ }, xv = {
8032
8032
  padding: "16px",
8033
8033
  background: "#1a1a2e",
8034
8034
  color: "#e0e0e0",
@@ -8052,7 +8052,7 @@ var k0 = O.canvas.attrs((e) => ({
8052
8052
  console.error("[waveform-playlist] Render error:", e, t.componentStack);
8053
8053
  }
8054
8054
  render() {
8055
- return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ k("div", { style: x0, children: "Waveform playlist encountered an error. Check console for details." }) : this.props.children;
8055
+ return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ k("div", { style: xv, children: "Waveform playlist encountered an error. Check console for details." }) : this.props.children;
8056
8056
  }
8057
8057
  });
8058
8058
  var Bi = 22, sf = O.div`
@@ -8087,10 +8087,10 @@ var Bi = 22, sf = O.div`
8087
8087
  white-space: nowrap;
8088
8088
  overflow: hidden;
8089
8089
  text-overflow: ellipsis;
8090
- `, E0 = ({
8090
+ `, Ev = ({
8091
8091
  trackName: e,
8092
8092
  isSelected: t = !1
8093
- }) => /* @__PURE__ */ k(sf, { $interactive: !1, $isSelected: t, children: /* @__PURE__ */ k(lf, { title: e, children: e }) }), I0 = ({
8093
+ }) => /* @__PURE__ */ k(sf, { $interactive: !1, $isSelected: t, children: /* @__PURE__ */ k(lf, { title: e, children: e }) }), Iv = ({
8094
8094
  clipId: e,
8095
8095
  trackIndex: t,
8096
8096
  clipIndex: n,
@@ -8100,7 +8100,7 @@ var Bi = 22, sf = O.div`
8100
8100
  dragHandleProps: s
8101
8101
  }) => {
8102
8102
  if (a || !s)
8103
- return /* @__PURE__ */ k(E0, { trackName: r, isSelected: o });
8103
+ return /* @__PURE__ */ k(Ev, { trackName: r, isSelected: o });
8104
8104
  const { handleRef: i } = s;
8105
8105
  return /* @__PURE__ */ k(
8106
8106
  sf,
@@ -8112,12 +8112,12 @@ var Bi = 22, sf = O.div`
8112
8112
  children: /* @__PURE__ */ k(lf, { title: r, children: r })
8113
8113
  }
8114
8114
  );
8115
- }, A0 = 8, M0 = 24, T0 = O.div`
8115
+ }, Av = 8, Mv = 24, Tv = O.div`
8116
8116
  position: absolute;
8117
8117
  ${(e) => e.$edge === "left" ? "left: 0;" : "right: 0;"}
8118
8118
  top: 0;
8119
8119
  bottom: 0;
8120
- width: ${(e) => e.$touchOptimized ? M0 : A0}px;
8120
+ width: ${(e) => e.$touchOptimized ? Mv : Av}px;
8121
8121
  cursor: col-resize;
8122
8122
  user-select: none;
8123
8123
  z-index: 105; /* Above waveform, below header */
@@ -8153,7 +8153,7 @@ var Bi = 22, sf = O.div`
8153
8153
  return null;
8154
8154
  const { ref: l, isDragging: c } = o;
8155
8155
  return /* @__PURE__ */ k(
8156
- T0,
8156
+ Tv,
8157
8157
  {
8158
8158
  ref: l,
8159
8159
  "data-clip-id": e,
@@ -8166,7 +8166,7 @@ var Bi = 22, sf = O.div`
8166
8166
  onMouseLeave: () => i(!1)
8167
8167
  }
8168
8168
  );
8169
- }, $0 = O.div.attrs((e) => ({
8169
+ }, $v = O.div.attrs((e) => ({
8170
8170
  style: {
8171
8171
  left: `${e.$left}px`,
8172
8172
  width: `${e.$width}px`
@@ -8177,14 +8177,14 @@ var Bi = 22, sf = O.div`
8177
8177
  bottom: 0;
8178
8178
  pointer-events: none;
8179
8179
  z-index: 50;
8180
- `, D0 = O.svg`
8180
+ `, Dv = O.svg`
8181
8181
  width: 100%;
8182
8182
  height: 100%;
8183
8183
  display: block;
8184
8184
  /* Flip horizontally for fadeOut - makes it mirror of fadeIn */
8185
8185
  transform: ${(e) => e.$type === "fadeOut" ? "scaleX(-1)" : "none"};
8186
8186
  `;
8187
- function R0(e, t, n = "logarithmic") {
8187
+ function Rv(e, t, n = "logarithmic") {
8188
8188
  const r = [], o = Math.max(20, Math.min(e, 100));
8189
8189
  for (let a = 0; a <= o; a++) {
8190
8190
  const s = a / o * e, i = a / o;
@@ -8219,8 +8219,8 @@ var rc = ({
8219
8219
  const a = Dh();
8220
8220
  if (t < 1) return null;
8221
8221
  const s = o || a?.fadeOverlayColor || "rgba(0, 0, 0, 0.4)";
8222
- return /* @__PURE__ */ k($0, { $left: e, $width: t, $type: n, children: /* @__PURE__ */ k(D0, { $type: n, viewBox: `0 0 ${t} 100`, preserveAspectRatio: "none", children: /* @__PURE__ */ k("path", { d: R0(t, 100, r), fill: s }) }) });
8223
- }, P0 = O.div.attrs((e) => ({
8222
+ return /* @__PURE__ */ k($v, { $left: e, $width: t, $type: n, children: /* @__PURE__ */ k(Dv, { $type: n, viewBox: `0 0 ${t} 100`, preserveAspectRatio: "none", children: /* @__PURE__ */ k("path", { d: Rv(t, 100, r), fill: s }) }) });
8223
+ }, Pv = O.div.attrs((e) => ({
8224
8224
  style: e.$isOverlay ? {} : {
8225
8225
  left: `${e.$left}px`,
8226
8226
  width: `${e.$width}px`
@@ -8234,7 +8234,7 @@ var rc = ({
8234
8234
  flex-direction: column;
8235
8235
  z-index: 10; /* Above progress overlay (z-index: 2) but below controls/playhead */
8236
8236
  pointer-events: none; /* Let clicks pass through to ClickOverlay for playhead positioning */
8237
- `, F0 = O.div`
8237
+ `, Fv = O.div`
8238
8238
  flex: 1;
8239
8239
  position: relative;
8240
8240
  overflow: ${(e) => e.$isOverlay ? "visible" : "hidden"};
@@ -8258,9 +8258,9 @@ var rc = ({
8258
8258
  fadeOut: v,
8259
8259
  sampleRate: m = 44100,
8260
8260
  showFades: y = !1,
8261
- touchOptimized: w = !1
8261
+ touchOptimized: b = !1
8262
8262
  }) => {
8263
- const b = Math.floor(s / l), _ = $c(s, i, l), S = c && !u && !f, C = `clip-${r}-${o}`, {
8263
+ const w = Math.floor(s / l), _ = $c(s, i, l), S = c && !u && !f, C = `clip-${r}-${o}`, {
8264
8264
  ref: E,
8265
8265
  handleRef: x,
8266
8266
  isDragSource: M
@@ -8280,12 +8280,12 @@ var rc = ({
8280
8280
  feedback: "none"
8281
8281
  });
8282
8282
  return /* @__PURE__ */ me(
8283
- P0,
8283
+ Pv,
8284
8284
  {
8285
8285
  ref: E,
8286
8286
  style: M ? { zIndex: 100 } : void 0,
8287
8287
  className: t,
8288
- $left: b,
8288
+ $left: w,
8289
8289
  $width: _,
8290
8290
  $isOverlay: f,
8291
8291
  "data-clip-container": "true",
@@ -8294,7 +8294,7 @@ var rc = ({
8294
8294
  tabIndex: -1,
8295
8295
  children: [
8296
8296
  c && /* @__PURE__ */ k(
8297
- I0,
8297
+ Iv,
8298
8298
  {
8299
8299
  clipId: n,
8300
8300
  trackIndex: r,
@@ -8305,7 +8305,7 @@ var rc = ({
8305
8305
  dragHandleProps: S ? { handleRef: x } : void 0
8306
8306
  }
8307
8307
  ),
8308
- /* @__PURE__ */ k(y0, { originX: b, children: /* @__PURE__ */ me(F0, { $isOverlay: f, children: [
8308
+ /* @__PURE__ */ k(yv, { originX: w, children: /* @__PURE__ */ me(Fv, { $isOverlay: f, children: [
8309
8309
  e,
8310
8310
  y && g && g.duration > 0 && /* @__PURE__ */ k(
8311
8311
  rc,
@@ -8334,7 +8334,7 @@ var rc = ({
8334
8334
  trackIndex: r,
8335
8335
  clipIndex: o,
8336
8336
  edge: "left",
8337
- touchOptimized: w,
8337
+ touchOptimized: b,
8338
8338
  dragHandleProps: {
8339
8339
  ref: A,
8340
8340
  isDragging: I
@@ -8348,7 +8348,7 @@ var rc = ({
8348
8348
  trackIndex: r,
8349
8349
  clipIndex: o,
8350
8350
  edge: "right",
8351
- touchOptimized: w,
8351
+ touchOptimized: b,
8352
8352
  dragHandleProps: {
8353
8353
  ref: F,
8354
8354
  isDragging: L
@@ -8359,16 +8359,16 @@ var rc = ({
8359
8359
  ]
8360
8360
  }
8361
8361
  );
8362
- }, O0 = O.div`
8362
+ }, Ov = O.div`
8363
8363
  display: inline-flex;
8364
8364
  align-items: center;
8365
8365
  gap: 0.5rem;
8366
- `, L0 = O(d0)`
8366
+ `, Lv = O(dv)`
8367
8367
  margin: 0;
8368
8368
  white-space: nowrap;
8369
- `, B0 = O(tf)`
8369
+ `, Bv = O(tf)`
8370
8370
  width: 120px;
8371
- `, W0 = ({
8371
+ `, Wv = ({
8372
8372
  volume: e,
8373
8373
  onChange: t,
8374
8374
  disabled: n = !1,
@@ -8377,10 +8377,10 @@ var rc = ({
8377
8377
  const o = (a) => {
8378
8378
  t(parseFloat(a.target.value) / 100);
8379
8379
  };
8380
- return /* @__PURE__ */ me(O0, { className: r, children: [
8381
- /* @__PURE__ */ k(L0, { htmlFor: "master-gain", children: "Master Volume" }),
8380
+ return /* @__PURE__ */ me(Ov, { className: r, children: [
8381
+ /* @__PURE__ */ k(Lv, { htmlFor: "master-gain", children: "Master Volume" }),
8382
8382
  /* @__PURE__ */ k(
8383
- B0,
8383
+ Bv,
8384
8384
  {
8385
8385
  min: "0",
8386
8386
  max: "100",
@@ -8391,7 +8391,7 @@ var rc = ({
8391
8391
  }
8392
8392
  )
8393
8393
  ] });
8394
- }, V0 = O.canvas.attrs((e) => ({
8394
+ }, Vv = O.canvas.attrs((e) => ({
8395
8395
  style: {
8396
8396
  width: `${e.$cssWidth}px`,
8397
8397
  height: `${e.$waveHeight}px`,
@@ -8402,7 +8402,7 @@ var rc = ({
8402
8402
  top: 0;
8403
8403
  image-rendering: pixelated;
8404
8404
  image-rendering: crisp-edges;
8405
- `, N0 = O.div.attrs((e) => ({
8405
+ `, Nv = O.div.attrs((e) => ({
8406
8406
  style: {
8407
8407
  top: `${e.$waveHeight * e.$index}px`,
8408
8408
  width: `${e.$cssWidth}px`,
@@ -8413,7 +8413,7 @@ var rc = ({
8413
8413
  background: ${(e) => e.$backgroundColor};
8414
8414
  transform: translateZ(0);
8415
8415
  backface-visibility: hidden;
8416
- `, z0 = ({
8416
+ `, zv = ({
8417
8417
  index: e,
8418
8418
  midiNotes: t,
8419
8419
  length: n,
@@ -8434,7 +8434,7 @@ var rc = ({
8434
8434
  for (const E of t)
8435
8435
  E.midi < S && (S = E.midi), E.midi > C && (C = E.midi);
8436
8436
  return { minMidi: Math.max(0, S - 1), maxMidi: Math.min(127, C + 1) };
8437
- }, [t]), w = u ? c : l;
8437
+ }, [t]), b = u ? c : l;
8438
8438
  K(() => {
8439
8439
  const S = y - m + 1, C = Math.max(2, r / S), E = s / a;
8440
8440
  for (const [x, M] of h.current.entries()) {
@@ -8446,7 +8446,7 @@ var rc = ({
8446
8446
  const H = L.time - i;
8447
8447
  if (H + L.duration <= D || H >= F) continue;
8448
8448
  const q = H * E - R, oe = Math.max(2, L.duration * E), X = (y - L.midi) / S * r, ee = 0.3 + L.velocity * 0.7;
8449
- I.fillStyle = w, I.globalAlpha = ee;
8449
+ I.fillStyle = b, I.globalAlpha = ee;
8450
8450
  const ie = 1;
8451
8451
  I.beginPath(), I.roundRect(q, X, oe, C, ie), I.fill();
8452
8452
  }
@@ -8460,17 +8460,17 @@ var rc = ({
8460
8460
  a,
8461
8461
  s,
8462
8462
  i,
8463
- w,
8463
+ b,
8464
8464
  m,
8465
8465
  y,
8466
8466
  n,
8467
8467
  v,
8468
8468
  e
8469
8469
  ]);
8470
- const b = v.map((S) => {
8470
+ const w = v.map((S) => {
8471
8471
  const C = S * Ze, E = Math.min(n - C, Ze);
8472
8472
  return /* @__PURE__ */ k(
8473
- V0,
8473
+ Vv,
8474
8474
  {
8475
8475
  $cssWidth: E,
8476
8476
  $left: C,
@@ -8483,7 +8483,7 @@ var rc = ({
8483
8483
  `${n}-${S}`
8484
8484
  );
8485
8485
  });
8486
- return /* @__PURE__ */ k(N0, { $index: e, $cssWidth: n, $waveHeight: r, $backgroundColor: f ? "transparent" : p, children: b });
8486
+ return /* @__PURE__ */ k(Nv, { $index: e, $cssWidth: n, $waveHeight: r, $backgroundColor: f ? "transparent" : p, children: w });
8487
8487
  };
8488
8488
  O.div.attrs((e) => ({
8489
8489
  style: {
@@ -8527,42 +8527,42 @@ O.div`
8527
8527
  height: 100%;
8528
8528
  background: ${(e) => e.$color};
8529
8529
  `;
8530
- var Z0 = O.div`
8530
+ var Zv = O.div`
8531
8531
  display: flex;
8532
8532
  overflow-y: hidden;
8533
8533
  position: relative;
8534
- `, H0 = O.div.attrs((e) => ({
8534
+ `, Hv = O.div.attrs((e) => ({
8535
8535
  style: { width: `${e.$width}px` }
8536
8536
  }))`
8537
8537
  flex-shrink: 0;
8538
8538
  overflow: hidden;
8539
- `, G0 = O.div.attrs((e) => ({
8539
+ `, Gv = O.div.attrs((e) => ({
8540
8540
  style: { height: `${e.$height}px` }
8541
- }))``, U0 = O.div`
8541
+ }))``, Uv = O.div`
8542
8542
  overflow-x: auto;
8543
8543
  overflow-y: hidden;
8544
8544
  overflow-anchor: none;
8545
8545
  flex: 1;
8546
8546
  position: relative;
8547
- `, X0 = O.div.attrs((e) => ({
8547
+ `, Xv = O.div.attrs((e) => ({
8548
8548
  style: e.$width !== void 0 ? { width: `${e.$width}px` } : {}
8549
8549
  }))`
8550
8550
  position: relative;
8551
8551
  background: ${(e) => e.$backgroundColor || "transparent"};
8552
- `, Y0 = O.div.attrs((e) => ({
8552
+ `, Yv = O.div.attrs((e) => ({
8553
8553
  style: e.$width ? { minWidth: `${e.$width}px` } : {}
8554
8554
  }))`
8555
8555
  background: ${(e) => e.$backgroundColor || "white"};
8556
8556
  width: 100%;
8557
8557
  position: relative;
8558
8558
  overflow: hidden; /* Constrain loop region to timescale area */
8559
- `, j0 = O.div.attrs((e) => ({
8559
+ `, jv = O.div.attrs((e) => ({
8560
8560
  style: e.$width !== void 0 ? { minWidth: `${e.$width}px` } : {}
8561
8561
  }))`
8562
8562
  position: relative;
8563
8563
  background: ${(e) => e.$backgroundColor || "transparent"};
8564
8564
  width: 100%;
8565
- `, K0 = O.div`
8565
+ `, Kv = O.div`
8566
8566
  position: absolute;
8567
8567
  top: 0;
8568
8568
  left: 0;
@@ -8590,22 +8590,22 @@ var Z0 = O.div`
8590
8590
  timescaleGapHeight: g = 0
8591
8591
  }) => {
8592
8592
  const v = T(null), m = $(
8593
- (w) => {
8594
- v.current = w, f?.(w);
8593
+ (b) => {
8594
+ v.current = b, f?.(b);
8595
8595
  },
8596
8596
  [f]
8597
8597
  ), y = s !== void 0 && s > 0;
8598
- return /* @__PURE__ */ me(Z0, { "data-playlist-state": d, children: [
8599
- y && /* @__PURE__ */ me(H0, { $width: s, children: [
8600
- g > 0 && /* @__PURE__ */ k(G0, { $height: g }),
8598
+ return /* @__PURE__ */ me(Zv, { "data-playlist-state": d, children: [
8599
+ y && /* @__PURE__ */ me(Hv, { $width: s, children: [
8600
+ g > 0 && /* @__PURE__ */ k(Gv, { $height: g }),
8601
8601
  h
8602
8602
  ] }),
8603
- /* @__PURE__ */ k(U0, { "data-scroll-container": "true", ref: m, children: /* @__PURE__ */ k(g0, { containerRef: v, children: /* @__PURE__ */ me(X0, { $backgroundColor: t, $width: a, children: [
8604
- r && /* @__PURE__ */ k(Y0, { $width: o, $backgroundColor: n, children: r }),
8605
- /* @__PURE__ */ me(j0, { $width: a, $backgroundColor: t, children: [
8603
+ /* @__PURE__ */ k(Uv, { "data-scroll-container": "true", ref: m, children: /* @__PURE__ */ k(gv, { containerRef: v, children: /* @__PURE__ */ me(Xv, { $backgroundColor: t, $width: a, children: [
8604
+ r && /* @__PURE__ */ k(Yv, { $width: o, $backgroundColor: n, children: r }),
8605
+ /* @__PURE__ */ me(jv, { $width: a, $backgroundColor: t, children: [
8606
8606
  e,
8607
8607
  (i || l) && /* @__PURE__ */ k(
8608
- K0,
8608
+ Kv,
8609
8609
  {
8610
8610
  $isSelecting: p,
8611
8611
  onClick: i,
@@ -8619,7 +8619,7 @@ var Z0 = O.div`
8619
8619
  ] });
8620
8620
  };
8621
8621
  xc(Wi);
8622
- var q0 = O.div.attrs((e) => ({
8622
+ var qv = O.div.attrs((e) => ({
8623
8623
  style: {
8624
8624
  left: `${e.$left}px`,
8625
8625
  width: `${e.$width}px`
@@ -8638,7 +8638,7 @@ var q0 = O.div.attrs((e) => ({
8638
8638
  color: n = "#00ff00"
8639
8639
  }) => {
8640
8640
  const r = Math.max(0, t - e);
8641
- return r <= 0 ? null : /* @__PURE__ */ k(q0, { $left: e, $width: r, $color: n, "data-selection": !0 });
8641
+ return r <= 0 ? null : /* @__PURE__ */ k(qv, { $left: e, $width: r, $color: n, "data-selection": !0 });
8642
8642
  };
8643
8643
  O.div.attrs((e) => ({
8644
8644
  style: {
@@ -8719,7 +8719,7 @@ var oc = O.div.attrs((e) => ({
8719
8719
  &:hover::before {
8720
8720
  opacity: 1;
8721
8721
  }
8722
- `, J0 = O.div.attrs((e) => ({
8722
+ `, Jv = O.div.attrs((e) => ({
8723
8723
  style: {
8724
8724
  left: `${e.$left}px`,
8725
8725
  width: `${e.$width}px`
@@ -8735,7 +8735,7 @@ var oc = O.div.attrs((e) => ({
8735
8735
  &:active {
8736
8736
  cursor: grabbing;
8737
8737
  }
8738
- `, Q0 = ({
8738
+ `, Qv = ({
8739
8739
  startPosition: e,
8740
8740
  endPosition: t,
8741
8741
  markerColor: n = "#3b82f6",
@@ -8749,7 +8749,7 @@ var oc = O.div.attrs((e) => ({
8749
8749
  const [c, u] = z(null), f = T(0), p = T(0), d = T(0), h = Math.max(0, t - e), g = $(
8750
8750
  (m, y) => {
8751
8751
  m.preventDefault(), m.stopPropagation(), u(y), f.current = m.clientX, p.current = y === "start" ? e : t;
8752
- const w = (_) => {
8752
+ const b = (_) => {
8753
8753
  const S = _.clientX - f.current, C = p.current + S;
8754
8754
  if (y === "start") {
8755
8755
  const E = Math.max(i, Math.min(t - 10, C));
@@ -8758,29 +8758,29 @@ var oc = O.div.attrs((e) => ({
8758
8758
  const E = Math.max(e + 10, Math.min(l, C));
8759
8759
  a?.(E);
8760
8760
  }
8761
- }, b = () => {
8762
- u(null), document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", b);
8761
+ }, w = () => {
8762
+ u(null), document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", w);
8763
8763
  };
8764
- document.addEventListener("mousemove", w), document.addEventListener("mouseup", b);
8764
+ document.addEventListener("mousemove", b), document.addEventListener("mouseup", w);
8765
8765
  },
8766
8766
  [e, t, i, l, o, a]
8767
8767
  ), v = $(
8768
8768
  (m) => {
8769
8769
  m.preventDefault(), m.stopPropagation(), u("region"), f.current = m.clientX, p.current = e, d.current = t;
8770
- const y = t - e, w = (_) => {
8770
+ const y = t - e, b = (_) => {
8771
8771
  const S = _.clientX - f.current;
8772
8772
  let C = p.current + S, E = d.current + S;
8773
8773
  C < i && (C = i, E = i + y), E > l && (E = l, C = l - y), s?.(C, E);
8774
- }, b = () => {
8775
- u(null), document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", b);
8774
+ }, w = () => {
8775
+ u(null), document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", w);
8776
8776
  };
8777
- document.addEventListener("mousemove", w), document.addEventListener("mouseup", b);
8777
+ document.addEventListener("mousemove", b), document.addEventListener("mouseup", w);
8778
8778
  },
8779
8779
  [e, t, i, l, s]
8780
8780
  );
8781
8781
  return h <= 0 ? null : /* @__PURE__ */ me(zt, { children: [
8782
8782
  /* @__PURE__ */ k(
8783
- J0,
8783
+ Jv,
8784
8784
  {
8785
8785
  $left: e,
8786
8786
  $width: h,
@@ -8813,7 +8813,7 @@ var oc = O.div.attrs((e) => ({
8813
8813
  }
8814
8814
  )
8815
8815
  ] });
8816
- }, ev = O.div`
8816
+ }, e0 = O.div`
8817
8817
  position: absolute;
8818
8818
  top: 0;
8819
8819
  left: 0;
@@ -8821,7 +8821,7 @@ var oc = O.div.attrs((e) => ({
8821
8821
  height: 100%; /* Stay within timescale bounds, don't extend into tracks */
8822
8822
  cursor: crosshair;
8823
8823
  z-index: 40; /* Below markers and shading */
8824
- `, tv = ({
8824
+ `, t0 = ({
8825
8825
  startPosition: e,
8826
8826
  endPosition: t,
8827
8827
  markerColor: n = "#3b82f6",
@@ -8840,8 +8840,8 @@ var oc = O.div.attrs((e) => ({
8840
8840
  if (!h) return;
8841
8841
  const g = p.clientX - h.left, v = Math.max(a, Math.min(s, g));
8842
8842
  l.current = v, o?.(v, v);
8843
- const m = (w) => {
8844
- const b = w.clientX - h.left, _ = Math.max(a, Math.min(s, b)), S = Math.min(l.current, _), C = Math.max(l.current, _);
8843
+ const m = (b) => {
8844
+ const w = b.clientX - h.left, _ = Math.max(a, Math.min(s, w)), S = Math.min(l.current, _), C = Math.max(l.current, _);
8845
8845
  o?.(S, C);
8846
8846
  }, y = () => {
8847
8847
  i(!1), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", y);
@@ -8851,13 +8851,13 @@ var oc = O.div.attrs((e) => ({
8851
8851
  [a, s, o]
8852
8852
  );
8853
8853
  return /* @__PURE__ */ k(
8854
- ev,
8854
+ e0,
8855
8855
  {
8856
8856
  ref: c,
8857
8857
  onMouseDown: f,
8858
8858
  "data-timescale-loop-creator": !0,
8859
8859
  children: u && /* @__PURE__ */ k(
8860
- Q0,
8860
+ Qv,
8861
8861
  {
8862
8862
  startPosition: e,
8863
8863
  endPosition: t,
@@ -8928,7 +8928,7 @@ var ac = ({
8928
8928
  const p = Xn(n, r);
8929
8929
  l(p);
8930
8930
  }, [n, r, e]), /* @__PURE__ */ me(zt, { children: [
8931
- /* @__PURE__ */ k(f0, { as: "label", htmlFor: e, children: t }),
8931
+ /* @__PURE__ */ k(fv, { as: "label", htmlFor: e, children: t }),
8932
8932
  /* @__PURE__ */ k(
8933
8933
  Qd,
8934
8934
  {
@@ -8954,7 +8954,7 @@ var ac = ({
8954
8954
  }
8955
8955
  )
8956
8956
  ] });
8957
- }, nv = ({
8957
+ }, n0 = ({
8958
8958
  selectionStart: e,
8959
8959
  selectionEnd: t,
8960
8960
  onSelectionChange: n,
@@ -8996,9 +8996,9 @@ var ac = ({
8996
8996
  }
8997
8997
  )
8998
8998
  ] });
8999
- }, rv = Ve(null);
8999
+ }, r0 = Ve(null);
9000
9000
  function df() {
9001
- return Pe(rv);
9001
+ return Fe(r0);
9002
9002
  }
9003
9003
  function To() {
9004
9004
  return window.devicePixelRatio;
@@ -9012,7 +9012,7 @@ var ff = Ve(To()), hf = ({ children: e }) => {
9012
9012
  },
9013
9013
  { once: !0 }
9014
9014
  ), /* @__PURE__ */ k(ff.Provider, { value: Math.ceil(t), children: e });
9015
- }, Vi = () => Pe(ff), Jr = Ve({
9015
+ }, Vi = () => Fe(ff), Jr = Ve({
9016
9016
  sampleRate: 48e3,
9017
9017
  samplesPerPixel: 1e3,
9018
9018
  zoomLevels: [1e3, 1500, 2e3, 2500],
@@ -9025,15 +9025,15 @@ var ff = Ve(To()), hf = ({ children: e }) => {
9025
9025
  duration: 3e4,
9026
9026
  barWidth: 1,
9027
9027
  barGap: 0
9028
- }), fa = () => Pe(Jr), Qr = () => Pe($h);
9028
+ }), fa = () => Fe(Jr), Qr = () => Fe($h);
9029
9029
  Ve(/* @__PURE__ */ k(Mh, {}));
9030
- var ov = 0, av = !1, sv = 0, iv = 0, lv = {
9031
- progress: ov,
9032
- isPlaying: av,
9033
- selectionStart: sv,
9034
- selectionEnd: iv
9030
+ var o0 = 0, a0 = !1, s0 = 0, i0 = 0, l0 = {
9031
+ progress: o0,
9032
+ isPlaying: a0,
9033
+ selectionStart: s0,
9034
+ selectionEnd: i0
9035
9035
  };
9036
- Ve(lv);
9036
+ Ve(l0);
9037
9037
  Ve({
9038
9038
  setIsPlaying: () => {
9039
9039
  },
@@ -9042,7 +9042,7 @@ Ve({
9042
9042
  setSelection: () => {
9043
9043
  }
9044
9044
  });
9045
- var cv = (e, t, n) => (e - t) / (n - t), uv = O.div.attrs((e) => ({
9045
+ var c0 = (e, t, n) => (e - t) / (n - t), u0 = O.div.attrs((e) => ({
9046
9046
  style: {
9047
9047
  top: `${e.$waveHeight * e.$index}px`,
9048
9048
  width: `${e.$cssWidth}px`,
@@ -9053,7 +9053,7 @@ var cv = (e, t, n) => (e - t) / (n - t), uv = O.div.attrs((e) => ({
9053
9053
  background: #000;
9054
9054
  transform: translateZ(0);
9055
9055
  backface-visibility: hidden;
9056
- `, dv = O.canvas.attrs((e) => ({
9056
+ `, d0 = O.canvas.attrs((e) => ({
9057
9057
  style: {
9058
9058
  width: `${e.$cssWidth}px`,
9059
9059
  height: `${e.$waveHeight}px`,
@@ -9065,13 +9065,13 @@ var cv = (e, t, n) => (e - t) / (n - t), uv = O.div.attrs((e) => ({
9065
9065
  image-rendering: pixelated;
9066
9066
  image-rendering: crisp-edges;
9067
9067
  `;
9068
- function fv() {
9068
+ function f0() {
9069
9069
  const e = new Uint8Array(768);
9070
9070
  for (let t = 0; t < 256; t++)
9071
9071
  e[t * 3] = e[t * 3 + 1] = e[t * 3 + 2] = t;
9072
9072
  return e;
9073
9073
  }
9074
- var hv = fv(), sc = ({
9074
+ var h0 = f0(), sc = ({
9075
9075
  index: e,
9076
9076
  channelIndex: t,
9077
9077
  data: n,
@@ -9087,14 +9087,14 @@ var hv = fv(), sc = ({
9087
9087
  clipId: p,
9088
9088
  onCanvasesReady: d
9089
9089
  }) => {
9090
- const h = t ?? e, { canvasRef: g, canvasMapRef: v } = da(), m = T([]), y = T(/* @__PURE__ */ new WeakSet()), w = T(f), b = T(d), _ = !!(f && p), S = Li(), C = ua(r, Ze, S), E = i ?? hv, x = u ?? (n ? n.sampleRate / 2 : 22050), M = l ?? cv, R = !!l;
9090
+ const h = t ?? e, { canvasRef: g, canvasMapRef: v } = da(), m = T([]), y = T(/* @__PURE__ */ new WeakSet()), b = T(f), w = T(d), _ = !!(f && p), S = Li(), C = ua(r, Ze, S), E = i ?? h0, x = u ?? (n ? n.sampleRate / 2 : 22050), M = l ?? c0, R = !!l;
9091
9091
  K(() => {
9092
- w.current = f;
9092
+ b.current = f;
9093
9093
  }, [f]), K(() => {
9094
- b.current = d;
9094
+ w.current = d;
9095
9095
  }, [d]), K(() => {
9096
9096
  if (!_) return;
9097
- const I = w.current;
9097
+ const I = b.current;
9098
9098
  if (!I || !p) return;
9099
9099
  const D = m.current.length, F = [];
9100
9100
  for (const Q of m.current) {
@@ -9141,10 +9141,10 @@ var hv = fv(), sc = ({
9141
9141
  const ee = parseInt(X[1], 10);
9142
9142
  return Math.min(r - ee * Ze, Ze);
9143
9143
  });
9144
- b.current?.(Q, q);
9144
+ w.current?.(Q, q);
9145
9145
  }
9146
9146
  }, [v, _, p, h, r, C]), K(() => () => {
9147
- const I = w.current;
9147
+ const I = b.current;
9148
9148
  if (I) {
9149
9149
  for (const D of m.current)
9150
9150
  try {
@@ -9167,15 +9167,15 @@ var hv = fv(), sc = ({
9167
9167
  for (const [X, ee] of v.current.entries()) {
9168
9168
  const ie = X * Ze, fe = ee.getContext("2d");
9169
9169
  if (!fe) continue;
9170
- const he = ee.width / a, De = o;
9170
+ const he = ee.width / a, Re = o;
9171
9171
  fe.resetTransform(), fe.clearRect(0, 0, ee.width, ee.height), fe.imageSmoothingEnabled = !1, fe.scale(a, a);
9172
- const Z = fe.createImageData(he, De), Y = Z.data;
9172
+ const Z = fe.createImageData(he, Re), Y = Z.data;
9173
9173
  for (let _e = 0; _e < he; _e++) {
9174
9174
  const te = (ie + _e) * s, Me = Math.floor(te / F);
9175
9175
  if (Me < 0 || Me >= D) continue;
9176
9176
  const B = Me * I;
9177
- for (let Oe = 0; Oe < De; Oe++) {
9178
- const st = 1 - Oe / De;
9177
+ for (let Oe = 0; Oe < Re; Oe++) {
9178
+ const st = 1 - Oe / Re;
9179
9179
  let Ge = Math.floor(st * I);
9180
9180
  if (R) {
9181
9181
  let xe = 0, Ne = I - 1;
@@ -9192,7 +9192,7 @@ var hv = fv(), sc = ({
9192
9192
  }
9193
9193
  if (fe.resetTransform(), fe.putImageData(Z, 0, 0), a !== 1) {
9194
9194
  const _e = document.createElement("canvas");
9195
- _e.width = he, _e.height = De;
9195
+ _e.width = he, _e.height = Re;
9196
9196
  const G = _e.getContext("2d");
9197
9197
  if (!G) continue;
9198
9198
  G.putImageData(Z, 0, 0), fe.clearRect(0, 0, ee.width, ee.height), fe.imageSmoothingEnabled = !1, fe.drawImage(_e, 0, 0, ee.width, ee.height);
@@ -9216,7 +9216,7 @@ var hv = fv(), sc = ({
9216
9216
  const A = C.map((I) => {
9217
9217
  const D = I * Ze, F = Math.min(r - D, Ze);
9218
9218
  return /* @__PURE__ */ k(
9219
- dv,
9219
+ d0,
9220
9220
  {
9221
9221
  $cssWidth: F,
9222
9222
  $left: D,
@@ -9229,7 +9229,7 @@ var hv = fv(), sc = ({
9229
9229
  `${r}-${I}`
9230
9230
  );
9231
9231
  });
9232
- return /* @__PURE__ */ k(uv, { $index: e, $cssWidth: r, $waveHeight: o, children: A });
9232
+ return /* @__PURE__ */ k(u0, { $index: e, $cssWidth: r, $waveHeight: o, children: A });
9233
9233
  }, pf = ({
9234
9234
  isSelected: e,
9235
9235
  transparentBackground: t,
@@ -9251,10 +9251,10 @@ var hv = fv(), sc = ({
9251
9251
  const v = Qr(), {
9252
9252
  waveHeight: m,
9253
9253
  barWidth: y,
9254
- barGap: w,
9255
- samplesPerPixel: b,
9254
+ barGap: b,
9255
+ samplesPerPixel: w,
9256
9256
  sampleRate: _
9257
- } = fa(), S = Vi(), C = a ?? b, E = e && v ? v.selectedWaveOutlineColor : v?.waveOutlineColor, x = e && v ? v.selectedWaveFillColor : v?.waveFillColor, M = v?.waveformDrawMode || "inverted", R = r || c;
9257
+ } = fa(), S = Vi(), C = a ?? w, E = e && v ? v.selectedWaveOutlineColor : v?.waveOutlineColor, x = e && v ? v.selectedWaveFillColor : v?.waveFillColor, M = v?.waveformDrawMode || "inverted", R = r || c;
9258
9258
  if (n === "spectrogram" && R)
9259
9259
  return /* @__PURE__ */ k(
9260
9260
  sc,
@@ -9315,7 +9315,7 @@ var hv = fv(), sc = ({
9315
9315
  waveHeight: A,
9316
9316
  devicePixelRatio: S,
9317
9317
  barWidth: y,
9318
- barGap: w,
9318
+ barGap: b,
9319
9319
  transparentBackground: t,
9320
9320
  drawMode: M
9321
9321
  }
@@ -9325,7 +9325,7 @@ var hv = fv(), sc = ({
9325
9325
  ] });
9326
9326
  }
9327
9327
  return n === "piano-roll" ? /* @__PURE__ */ k(
9328
- z0,
9328
+ zv,
9329
9329
  {
9330
9330
  index: g.index,
9331
9331
  midiNotes: p ?? [],
@@ -9350,12 +9350,12 @@ var hv = fv(), sc = ({
9350
9350
  waveHeight: m,
9351
9351
  devicePixelRatio: S,
9352
9352
  barWidth: y,
9353
- barGap: w,
9353
+ barGap: b,
9354
9354
  transparentBackground: t,
9355
9355
  drawMode: M
9356
9356
  }
9357
9357
  );
9358
- }, ic = 72, pv = O.div`
9358
+ }, ic = 72, p0 = O.div`
9359
9359
  position: sticky;
9360
9360
  left: 0;
9361
9361
  z-index: 101;
@@ -9364,7 +9364,7 @@ var hv = fv(), sc = ({
9364
9364
  width: 0;
9365
9365
  overflow: visible;
9366
9366
  `;
9367
- function mv(e, t, n) {
9367
+ function m0(e, t, n) {
9368
9368
  const o = [
9369
9369
  20,
9370
9370
  50,
@@ -9388,7 +9388,7 @@ function mv(e, t, n) {
9388
9388
  i.push(o[Math.round(l * s)]);
9389
9389
  return i;
9390
9390
  }
9391
- var gv = ({
9391
+ var g0 = ({
9392
9392
  waveHeight: e,
9393
9393
  numChannels: t,
9394
9394
  frequencyScaleFn: n,
@@ -9406,14 +9406,14 @@ var gv = ({
9406
9406
  const g = h.getContext("2d");
9407
9407
  if (!g) return;
9408
9408
  g.resetTransform(), g.clearRect(0, 0, h.width, h.height), g.scale(u, u);
9409
- const v = mv(r, o, f);
9409
+ const v = m0(r, o, f);
9410
9410
  for (let m = 0; m < t; m++) {
9411
9411
  const y = m * e + d;
9412
9412
  g.font = "11px monospace", g.textBaseline = "middle";
9413
- for (const w of v) {
9414
- const b = n(w, r, o);
9415
- if (b < 0 || b > 1) continue;
9416
- const _ = y + f * (1 - b), S = w >= 1e3 ? `${(w / 1e3).toFixed(1)}k` : `${w} Hz`, C = g.measureText(S), E = 3;
9413
+ for (const b of v) {
9414
+ const w = n(b, r, o);
9415
+ if (w < 0 || w > 1) continue;
9416
+ const _ = y + f * (1 - w), S = b >= 1e3 ? `${(b / 1e3).toFixed(1)}k` : `${b} Hz`, C = g.measureText(S), E = 3;
9417
9417
  g.fillStyle = s, g.fillRect(0, _ - 7, C.width + E * 2, 14), g.fillStyle = a, g.fillText(S, E, _);
9418
9418
  }
9419
9419
  }
@@ -9428,7 +9428,7 @@ var gv = ({
9428
9428
  u,
9429
9429
  f,
9430
9430
  d
9431
- ]), /* @__PURE__ */ k(pv, { $height: p + d, children: /* @__PURE__ */ k(
9431
+ ]), /* @__PURE__ */ k(p0, { $height: p + d, children: /* @__PURE__ */ k(
9432
9432
  "canvas",
9433
9433
  {
9434
9434
  ref: c,
@@ -9441,7 +9441,7 @@ var gv = ({
9441
9441
  }
9442
9442
  }
9443
9443
  ) });
9444
- }, vv = O.div.attrs((e) => ({
9444
+ }, v0 = O.div.attrs((e) => ({
9445
9445
  style: {
9446
9446
  width: `${e.$cssWidth}px`,
9447
9447
  height: `${e.$timeScaleHeight}px`
@@ -9451,7 +9451,7 @@ var gv = ({
9451
9451
  overflow: visible; /* Allow time labels to render above the container */
9452
9452
  border-bottom: 1px solid ${(e) => e.theme.timeColor};
9453
9453
  box-sizing: border-box;
9454
- `, yv = O.canvas.attrs((e) => ({
9454
+ `, y0 = O.canvas.attrs((e) => ({
9455
9455
  style: {
9456
9456
  width: `${e.$cssWidth}px`,
9457
9457
  height: `${e.$timeScaleHeight}px`,
@@ -9460,14 +9460,14 @@ var gv = ({
9460
9460
  }))`
9461
9461
  position: absolute;
9462
9462
  bottom: 0;
9463
- `, bv = (e) => {
9463
+ `, b0 = (e) => {
9464
9464
  const {
9465
9465
  theme: { timeColor: t },
9466
9466
  tickData: n
9467
- } = e, { canvasRef: r, canvasMapRef: o } = da(), { timeScaleHeight: a } = Pe(Jr), s = Vi(), { widthX: i, canvasInfo: l, timeMarkersWithPositions: c } = n, u = ua(i, Ze), f = u.map((g) => {
9467
+ } = e, { canvasRef: r, canvasMapRef: o } = da(), { timeScaleHeight: a } = Fe(Jr), s = Vi(), { widthX: i, canvasInfo: l, timeMarkersWithPositions: c } = n, u = ua(i, Ze), f = u.map((g) => {
9468
9468
  const v = g * Ze, m = Math.min(i - v, Ze);
9469
9469
  return /* @__PURE__ */ k(
9470
- yv,
9470
+ y0,
9471
9471
  {
9472
9472
  $cssWidth: m,
9473
9473
  $left: v,
@@ -9484,19 +9484,19 @@ var gv = ({
9484
9484
  for (const [g, v] of o.current.entries()) {
9485
9485
  const m = v.getContext("2d");
9486
9486
  if (!m) continue;
9487
- const y = g * Ze, w = v.width / s;
9487
+ const y = g * Ze, b = v.width / s;
9488
9488
  m.resetTransform(), m.clearRect(0, 0, v.width, v.height), m.imageSmoothingEnabled = !1, m.fillStyle = t, m.scale(s, s);
9489
- for (const [b, _] of l.entries()) {
9490
- if (b < y || b >= y + w) continue;
9491
- const S = b - y, C = a - _;
9489
+ for (const [w, _] of l.entries()) {
9490
+ if (w < y || w >= y + b) continue;
9491
+ const S = w - y, C = a - _;
9492
9492
  m.fillRect(S, C, 1, _);
9493
9493
  }
9494
9494
  }
9495
- }, [o, s, t, a, l, u]), /* @__PURE__ */ me(vv, { $cssWidth: i, $timeScaleHeight: a, children: [
9495
+ }, [o, s, t, a, l, u]), /* @__PURE__ */ me(v0, { $cssWidth: i, $timeScaleHeight: a, children: [
9496
9496
  h,
9497
9497
  f
9498
9498
  ] });
9499
- }, wv = xc(bv), lc = /* @__PURE__ */ new Map([
9499
+ }, w0 = xc(b0), lc = /* @__PURE__ */ new Map([
9500
9500
  [700, { marker: 1e3, bigStep: 500, smallStep: 100 }],
9501
9501
  [1500, { marker: 2e3, bigStep: 1e3, smallStep: 200 }],
9502
9502
  [2500, { marker: 2e3, bigStep: 1e3, smallStep: 500 }],
@@ -9515,11 +9515,11 @@ function xs(e) {
9515
9515
  }
9516
9516
  return n === void 0 && (n = { marker: 3e4, bigStep: 1e4, smallStep: 5e3 }), n;
9517
9517
  }
9518
- function _v(e) {
9518
+ function _0(e) {
9519
9519
  const t = Math.floor(e / 1e3), n = t % 60;
9520
9520
  return `${(t - n) / 60}:${String(n).padStart(2, "0")}`;
9521
9521
  }
9522
- var Sv = O.div.attrs((e) => ({
9522
+ var S0 = O.div.attrs((e) => ({
9523
9523
  style: {
9524
9524
  left: `${e.$left + 4}px`
9525
9525
  // Offset 4px to the right of the tick
@@ -9530,13 +9530,13 @@ var Sv = O.div.attrs((e) => ({
9530
9530
  white-space: nowrap; /* Prevent text wrapping */
9531
9531
  color: ${(e) => e.theme.timeColor}; /* Use theme color instead of inheriting */
9532
9532
  `, mf = ({ renderTick: e }) => {
9533
- const { samplesPerPixel: t, sampleRate: n, duration: r, timeScaleHeight: o } = Pe(Jr), a = df(), s = Ce(() => {
9533
+ const { samplesPerPixel: t, sampleRate: n, duration: r, timeScaleHeight: o } = Fe(Jr), a = df(), s = Ce(() => {
9534
9534
  const i = Oh(r / 1e3, t, n);
9535
9535
  if (a && a.scaleMode === "beats") {
9536
- const { bpm: v, timeSignature: m, ticksPerBar: y, ticksPerBeat: w } = a, b = /* @__PURE__ */ new Map(), _ = [], S = r / 1e3, C = Math.ceil(S * v * er / 60), E = Gn(w, v, n) / t, x = Gn(y, v, n) / t, M = 10, R = 30;
9536
+ const { bpm: v, timeSignature: m, ticksPerBar: y, ticksPerBeat: b } = a, w = /* @__PURE__ */ new Map(), _ = [], S = r / 1e3, C = Math.ceil(S * v * er / 60), E = Gn(b, v, n) / t, x = Gn(y, v, n) / t, M = 10, R = 30;
9537
9537
  let A;
9538
9538
  if (E >= M)
9539
- A = w;
9539
+ A = b;
9540
9540
  else if (x >= M)
9541
9541
  A = y;
9542
9542
  else {
@@ -9545,7 +9545,7 @@ var Sv = O.div.attrs((e) => ({
9545
9545
  }
9546
9546
  let I;
9547
9547
  if (E >= R)
9548
- I = w;
9548
+ I = b;
9549
9549
  else if (x >= R)
9550
9550
  I = y;
9551
9551
  else {
@@ -9556,7 +9556,7 @@ var Sv = O.div.attrs((e) => ({
9556
9556
  const F = Gn(D, v, n), L = Fh(F, t);
9557
9557
  if (L >= i) break;
9558
9558
  const H = D % y === 0, Q = D % I === 0, q = H ? o : Math.floor(Q ? o / 2 : o / 5);
9559
- if (b.set(L, q), Q) {
9559
+ if (w.set(L, q), Q) {
9560
9560
  const oe = Lh(D, m), X = e ? /* @__PURE__ */ k(at.Fragment, { children: e(oe, L) }, `bb-${D}`) : /* @__PURE__ */ k(
9561
9561
  "div",
9562
9562
  {
@@ -9573,38 +9573,38 @@ var Sv = O.div.attrs((e) => ({
9573
9573
  _.push({ pix: L, element: X });
9574
9574
  }
9575
9575
  }
9576
- return { widthX: i, canvasInfo: b, timeMarkersWithPositions: _ };
9576
+ return { widthX: i, canvasInfo: w, timeMarkersWithPositions: _ };
9577
9577
  }
9578
9578
  const l = xs(t), { marker: c, bigStep: u, smallStep: f } = l, p = /* @__PURE__ */ new Map(), d = [], h = n / t;
9579
9579
  let g = 0;
9580
9580
  for (let v = 0; v < i; v += h * f / 1e3) {
9581
9581
  const m = Math.floor(v);
9582
9582
  if (g % c === 0) {
9583
- const y = _v(g), w = e ? /* @__PURE__ */ k(at.Fragment, { children: e(y, m) }, `timestamp-${g}`) : /* @__PURE__ */ k(Sv, { $left: m, children: y }, y);
9584
- d.push({ pix: m, element: w }), p.set(m, o);
9583
+ const y = _0(g), b = e ? /* @__PURE__ */ k(at.Fragment, { children: e(y, m) }, `timestamp-${g}`) : /* @__PURE__ */ k(S0, { $left: m, children: y }, y);
9584
+ d.push({ pix: m, element: b }), p.set(m, o);
9585
9585
  } else g % u === 0 ? p.set(m, Math.floor(o / 2)) : g % f === 0 && p.set(m, Math.floor(o / 5));
9586
9586
  g += f;
9587
9587
  }
9588
9588
  return { widthX: i, canvasInfo: p, timeMarkersWithPositions: d };
9589
9589
  }, [a, r, t, n, o, e]);
9590
- return /* @__PURE__ */ k(wv, { tickData: s });
9591
- }, kv = O.div`
9590
+ return /* @__PURE__ */ k(w0, { tickData: s });
9591
+ }, k0 = O.div`
9592
9592
  display: inline-flex;
9593
9593
  align-items: center;
9594
9594
  gap: 0.5rem;
9595
- `, Cv = [
9595
+ `, C0 = [
9596
9596
  { value: "seconds", label: "seconds" },
9597
9597
  { value: "thousandths", label: "thousandths" },
9598
9598
  { value: "hh:mm:ss", label: "hh:mm:ss" },
9599
9599
  { value: "hh:mm:ss.u", label: "hh:mm:ss + tenths" },
9600
9600
  { value: "hh:mm:ss.uu", label: "hh:mm:ss + hundredths" },
9601
9601
  { value: "hh:mm:ss.uuu", label: "hh:mm:ss + milliseconds" }
9602
- ], xv = ({
9602
+ ], x0 = ({
9603
9603
  value: e,
9604
9604
  onChange: t,
9605
9605
  disabled: n = !1,
9606
9606
  className: r
9607
- }) => /* @__PURE__ */ k(kv, { className: r, children: /* @__PURE__ */ k(
9607
+ }) => /* @__PURE__ */ k(k0, { className: r, children: /* @__PURE__ */ k(
9608
9608
  ef,
9609
9609
  {
9610
9610
  className: "time-format",
@@ -9614,16 +9614,16 @@ var Sv = O.div.attrs((e) => ({
9614
9614
  },
9615
9615
  disabled: n,
9616
9616
  "aria-label": "Time format selection",
9617
- children: Cv.map((a) => /* @__PURE__ */ k("option", { value: a.value, children: a.label }, a.value))
9617
+ children: C0.map((a) => /* @__PURE__ */ k("option", { value: a.value, children: a.label }, a.value))
9618
9618
  }
9619
- ) }), Ev = O.div.attrs((e) => ({
9619
+ ) }), E0 = O.div.attrs((e) => ({
9620
9620
  style: {
9621
9621
  height: `${e.$waveHeight * e.$numChannels + (e.$hasClipHeaders ? Bi : 0)}px`
9622
9622
  }
9623
9623
  }))`
9624
9624
  position: relative;
9625
9625
  ${(e) => e.$width !== void 0 && `width: ${e.$width}px;`}
9626
- `, Iv = O.div.attrs((e) => ({
9626
+ `, I0 = O.div.attrs((e) => ({
9627
9627
  style: {
9628
9628
  paddingLeft: `${e.$offset || 0}px`
9629
9629
  }
@@ -9645,7 +9645,7 @@ var Sv = O.div.attrs((e) => ({
9645
9645
  }) => {
9646
9646
  const { waveHeight: u } = fa();
9647
9647
  return /* @__PURE__ */ k(
9648
- Ev,
9648
+ E0,
9649
9649
  {
9650
9650
  $numChannels: e,
9651
9651
  className: n,
@@ -9653,7 +9653,7 @@ var Sv = O.div.attrs((e) => ({
9653
9653
  $width: a,
9654
9654
  $hasClipHeaders: s,
9655
9655
  children: /* @__PURE__ */ k(
9656
- Iv,
9656
+ I0,
9657
9657
  {
9658
9658
  $backgroundColor: r,
9659
9659
  $offset: o,
@@ -9728,7 +9728,7 @@ var Sv = O.div.attrs((e) => ({
9728
9728
  box-shadow: 0 0 0 0.2rem ${e.theme.inputFocusBorder}33;
9729
9729
  }
9730
9730
  `}
9731
- `, Av = O.div`
9731
+ `, A0 = O.div`
9732
9732
  margin-bottom: 0.3rem;
9733
9733
 
9734
9734
  button:not(:first-child) {
@@ -9740,7 +9740,7 @@ var Sv = O.div.attrs((e) => ({
9740
9740
  border-top-right-radius: 0;
9741
9741
  border-bottom-right-radius: 0;
9742
9742
  }
9743
- `, Mv = O.button`
9743
+ `, M0 = O.button`
9744
9744
  position: absolute;
9745
9745
  left: 0;
9746
9746
  top: 0;
@@ -9762,7 +9762,7 @@ var Sv = O.div.attrs((e) => ({
9762
9762
  opacity: 1;
9763
9763
  color: #dc3545;
9764
9764
  }
9765
- `, Tv = ({ onClick: e, title: t = "Remove track" }) => /* @__PURE__ */ k(Mv, { onClick: e, title: t, children: /* @__PURE__ */ k(i0, { size: 12, weight: "bold" }) }), $v = O.div`
9765
+ `, T0 = ({ onClick: e, title: t = "Remove track" }) => /* @__PURE__ */ k(M0, { onClick: e, title: t, children: /* @__PURE__ */ k(iv, { size: 12, weight: "bold" }) }), $0 = O.div`
9766
9766
  background: transparent;
9767
9767
  width: 100%;
9768
9768
  height: 100%;
@@ -9775,7 +9775,7 @@ var Sv = O.div.attrs((e) => ({
9775
9775
  text-align: center;
9776
9776
  border: 1px solid ${(e) => e.theme.borderColor};
9777
9777
  border-radius: ${(e) => e.theme.borderRadius};
9778
- `, Dv = O.header`
9778
+ `, D0 = O.header`
9779
9779
  overflow: hidden;
9780
9780
  height: 26px;
9781
9781
  width: 100%;
@@ -9786,7 +9786,7 @@ var Sv = O.div.attrs((e) => ({
9786
9786
  font-size: ${(e) => e.theme.fontSizeSmall};
9787
9787
  color: ${(e) => e.theme.textColor};
9788
9788
  background-color: transparent;
9789
- `, Rv = (e) => /* @__PURE__ */ k(qd, { weight: "light", ...e }), Pv = (e) => /* @__PURE__ */ k(Kd, { weight: "light", ...e }), Fv = (e) => /* @__PURE__ */ k(jd, { weight: "bold", ...e }), uc = O(tf)`
9789
+ `, R0 = (e) => /* @__PURE__ */ k(qd, { weight: "light", ...e }), P0 = (e) => /* @__PURE__ */ k(Kd, { weight: "light", ...e }), F0 = (e) => /* @__PURE__ */ k(jd, { weight: "bold", ...e }), uc = O(tf)`
9790
9790
  width: 75%;
9791
9791
  height: 5px;
9792
9792
  background: ${(e) => e.theme.sliderTrackColor};
@@ -9843,10 +9843,10 @@ var Sv = O.div.attrs((e) => ({
9843
9843
  padding: 0 1rem;
9844
9844
  margin-bottom: 0.2rem;
9845
9845
  font-size: 14px;
9846
- `, Ov = O.div`
9846
+ `, O0 = O.div`
9847
9847
  position: relative;
9848
9848
  display: inline-block;
9849
- `, Lv = O.button`
9849
+ `, L0 = O.button`
9850
9850
  background: none;
9851
9851
  border: none;
9852
9852
  cursor: pointer;
@@ -9860,7 +9860,7 @@ var Sv = O.div.attrs((e) => ({
9860
9860
  &:hover {
9861
9861
  opacity: 1;
9862
9862
  }
9863
- `, $o = 180, Bv = O.div`
9863
+ `, $o = 180, B0 = O.div`
9864
9864
  position: fixed;
9865
9865
  top: ${(e) => e.$top}px;
9866
9866
  left: ${(e) => e.$left}px;
@@ -9872,11 +9872,11 @@ var Sv = O.div.attrs((e) => ({
9872
9872
  padding: 0.5rem 0;
9873
9873
  min-width: ${$o}px;
9874
9874
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
9875
- `, Wv = O.hr`
9875
+ `, W0 = O.hr`
9876
9876
  border: none;
9877
9877
  border-top: 1px solid rgba(128, 128, 128, 0.3);
9878
9878
  margin: 0.35rem 0;
9879
- `, Vv = ({ items: e }) => {
9879
+ `, V0 = ({ items: e }) => {
9880
9880
  const [t, n] = z(!1), r = $(() => n(!1), []), o = typeof e == "function" ? e(r) : e, [a, s] = z({ top: 0, left: 0 }), i = T(null), l = T(null), c = $(() => {
9881
9881
  if (!i.current) return;
9882
9882
  const u = i.current.getBoundingClientRect(), f = window.innerWidth, p = window.innerHeight, d = l.current?.offsetHeight ?? 160;
@@ -9903,9 +9903,9 @@ var Sv = O.div.attrs((e) => ({
9903
9903
  return document.addEventListener("mousedown", u), document.addEventListener("keydown", f), () => {
9904
9904
  document.removeEventListener("mousedown", u), document.removeEventListener("keydown", f);
9905
9905
  };
9906
- }, [t]), /* @__PURE__ */ me(Ov, { children: [
9906
+ }, [t]), /* @__PURE__ */ me(O0, { children: [
9907
9907
  /* @__PURE__ */ k(
9908
- Lv,
9908
+ L0,
9909
9909
  {
9910
9910
  ref: i,
9911
9911
  onClick: (u) => {
@@ -9914,19 +9914,19 @@ var Sv = O.div.attrs((e) => ({
9914
9914
  onMouseDown: (u) => u.stopPropagation(),
9915
9915
  title: "Track menu",
9916
9916
  "aria-label": "Track menu",
9917
- children: /* @__PURE__ */ k(Fv, { size: 16 })
9917
+ children: /* @__PURE__ */ k(F0, { size: 16 })
9918
9918
  }
9919
9919
  ),
9920
9920
  t && typeof document < "u" && Ic(
9921
9921
  /* @__PURE__ */ k(
9922
- Bv,
9922
+ B0,
9923
9923
  {
9924
9924
  ref: l,
9925
9925
  $top: a.top,
9926
9926
  $left: a.left,
9927
9927
  onMouseDown: (u) => u.stopPropagation(),
9928
9928
  children: o.map((u, f) => /* @__PURE__ */ me(at.Fragment, { children: [
9929
- f > 0 && /* @__PURE__ */ k(Wv, {}),
9929
+ f > 0 && /* @__PURE__ */ k(W0, {}),
9930
9930
  u.content
9931
9931
  ] }, u.id))
9932
9932
  }
@@ -9964,27 +9964,27 @@ Dn.prototype.max_array = function() {
9964
9964
  t.push(this.max_sample(n));
9965
9965
  return t;
9966
9966
  };
9967
- var Nv = 127, zv = -128, Zv = 32767, Hv = -32768;
9968
- function Gv(e, t) {
9967
+ var N0 = 127, z0 = -128, Z0 = 32767, H0 = -32768;
9968
+ function G0(e, t) {
9969
9969
  var n = Math.floor(e / t), r = e - n * t;
9970
9970
  return r > 0 && n++, n;
9971
9971
  }
9972
- function Uv(e) {
9972
+ function U0(e) {
9973
9973
  for (var t = e.scale, n = e.amplitude_scale, r = e.split_channels, o = e.length, a = e.sample_rate, s = e.channels.map(function(R) {
9974
9974
  return new Float32Array(R);
9975
- }), i = r ? s.length : 1, l = 24, c = Gv(o, t), u = e.bits === 8 ? 1 : 2, f = l + c * 2 * u * i, p = new ArrayBuffer(f), d = new DataView(p), h = 0, g = l, v = new Array(i), m = new Array(i), y = 0; y < i; y++)
9975
+ }), i = r ? s.length : 1, l = 24, c = G0(o, t), u = e.bits === 8 ? 1 : 2, f = l + c * 2 * u * i, p = new ArrayBuffer(f), d = new DataView(p), h = 0, g = l, v = new Array(i), m = new Array(i), y = 0; y < i; y++)
9976
9976
  v[y] = 1 / 0, m[y] = -1 / 0;
9977
- var w = e.bits === 8 ? zv : Hv, b = e.bits === 8 ? Nv : Zv;
9977
+ var b = e.bits === 8 ? z0 : H0, w = e.bits === 8 ? N0 : Z0;
9978
9978
  d.setInt32(0, 2, !0), d.setUint32(4, e.bits === 8, !0), d.setInt32(8, a, !0), d.setInt32(12, t, !0), d.setInt32(16, c, !0), d.setInt32(20, i, !0);
9979
9979
  for (var _ = 0; _ < o; _++) {
9980
9980
  var S = 0;
9981
9981
  if (i === 1) {
9982
9982
  for (var C = 0; C < s.length; ++C)
9983
9983
  S += s[C][_];
9984
- S = Math.floor(b * S * n / s.length), S < v[0] && (v[0] = S, v[0] < w && (v[0] = w)), S > m[0] && (m[0] = S, m[0] > b && (m[0] = b));
9984
+ S = Math.floor(w * S * n / s.length), S < v[0] && (v[0] = S, v[0] < b && (v[0] = b)), S > m[0] && (m[0] = S, m[0] > w && (m[0] = w));
9985
9985
  } else
9986
9986
  for (var E = 0; E < i; ++E)
9987
- S = Math.floor(b * s[E][_] * n), S < v[E] && (v[E] = S, v[E] < w && (v[E] = w)), S > m[E] && (m[E] = S, m[E] > b && (m[E] = b));
9987
+ S = Math.floor(w * s[E][_] * n), S < v[E] && (v[E] = S, v[E] < b && (v[E] = b)), S > m[E] && (m[E] = S, m[E] > w && (m[E] = w));
9988
9988
  if (++h === t) {
9989
9989
  for (var x = 0; x < i; x++)
9990
9990
  e.bits === 8 ? (d.setInt8(g++, v[x]), d.setInt8(g++, m[x])) : (d.setInt16(g, v[x], !0), d.setInt16(g + 2, m[x], !0), g += 4), v[x] = 1 / 0, m[x] = -1 / 0;
@@ -10004,10 +10004,10 @@ function Yo(e) {
10004
10004
  return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
10005
10005
  }, Yo(e);
10006
10006
  }
10007
- function Xv(e) {
10007
+ function X0(e) {
10008
10008
  return e && Yo(e) === "object" && "sample_rate" in e && "samples_per_pixel" in e && "bits" in e && "length" in e && "data" in e;
10009
10009
  }
10010
- function Yv(e) {
10010
+ function Y0(e) {
10011
10011
  var t = e && Yo(e) === "object" && "byteLength" in e;
10012
10012
  if (t) {
10013
10013
  var n = new DataView(e), r = n.getInt32(0, !0);
@@ -10016,7 +10016,7 @@ function Yv(e) {
10016
10016
  }
10017
10017
  return t;
10018
10018
  }
10019
- function jv(e) {
10019
+ function j0(e) {
10020
10020
  var t = e.data, n = e.channels || 1, r = 24, o = e.bits === 8 ? 1 : 2, a = e.length * 2 * n;
10021
10021
  if (t.length !== a)
10022
10022
  throw new Error("WaveformData.create(): Length mismatch in JSON waveform data");
@@ -10034,24 +10034,24 @@ function jv(e) {
10034
10034
  function Ln(e) {
10035
10035
  return e == null;
10036
10036
  }
10037
- function Kv(e, t) {
10037
+ function K0(e, t) {
10038
10038
  var n = atob(e);
10039
10039
  return n;
10040
10040
  }
10041
- function qv(e, t, n) {
10042
- var r = Kv(e), o = r.indexOf(`
10041
+ function q0(e, t, n) {
10042
+ var r = K0(e), o = r.indexOf(`
10043
10043
  `, 10) + 1, a = r.substring(o) + "", s = new Blob([a], { type: "application/javascript" });
10044
10044
  return URL.createObjectURL(s);
10045
10045
  }
10046
- function Jv(e, t, n) {
10046
+ function J0(e, t, n) {
10047
10047
  var r;
10048
10048
  return function(a) {
10049
- return r = r || qv(e), new Worker(r, a);
10049
+ return r = r || q0(e), new Worker(r, a);
10050
10050
  };
10051
10051
  }
10052
- var Qv = /* @__PURE__ */ Jv("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgLyoqCiAgICogQXVkaW9CdWZmZXItYmFzZWQgV2F2ZWZvcm1EYXRhIGdlbmVyYXRvcgogICAqCiAgICogQWRhcHRlZCBmcm9tIEJsb2NrRmlsZTo6Q2FsY1N1bW1hcnkgaW4gQXVkYWNpdHksIHdpdGggcGVybWlzc2lvbi4KICAgKiBTZWUgaHR0cHM6Ly9naXRodWIuY29tL2F1ZGFjaXR5L2F1ZGFjaXR5L2Jsb2IvCiAgICogICAxMTA4YzEzNzZjMDkxNjYxNjIzMzVmYWI0NzQzMDA4Y2JhNTdjNGVlL3NyYy9CbG9ja0ZpbGUuY3BwI0wxOTgKICAgKi8KCiAgdmFyIElOVDhfTUFYID0gMTI3OwogIHZhciBJTlQ4X01JTiA9IC0xMjg7CiAgdmFyIElOVDE2X01BWCA9IDMyNzY3OwogIHZhciBJTlQxNl9NSU4gPSAtMzI3Njg7CiAgZnVuY3Rpb24gY2FsY3VsYXRlV2F2ZWZvcm1EYXRhTGVuZ3RoKGF1ZGlvX3NhbXBsZV9jb3VudCwgc2NhbGUpIHsKICAgIHZhciBkYXRhX2xlbmd0aCA9IE1hdGguZmxvb3IoYXVkaW9fc2FtcGxlX2NvdW50IC8gc2NhbGUpOwogICAgdmFyIHNhbXBsZXNfcmVtYWluaW5nID0gYXVkaW9fc2FtcGxlX2NvdW50IC0gZGF0YV9sZW5ndGggKiBzY2FsZTsKICAgIGlmIChzYW1wbGVzX3JlbWFpbmluZyA+IDApIHsKICAgICAgZGF0YV9sZW5ndGgrKzsKICAgIH0KICAgIHJldHVybiBkYXRhX2xlbmd0aDsKICB9CiAgZnVuY3Rpb24gZ2VuZXJhdGVXYXZlZm9ybURhdGEob3B0aW9ucykgewogICAgdmFyIHNjYWxlID0gb3B0aW9ucy5zY2FsZTsKICAgIHZhciBhbXBsaXR1ZGVfc2NhbGUgPSBvcHRpb25zLmFtcGxpdHVkZV9zY2FsZTsKICAgIHZhciBzcGxpdF9jaGFubmVscyA9IG9wdGlvbnMuc3BsaXRfY2hhbm5lbHM7CiAgICB2YXIgbGVuZ3RoID0gb3B0aW9ucy5sZW5ndGg7CiAgICB2YXIgc2FtcGxlX3JhdGUgPSBvcHRpb25zLnNhbXBsZV9yYXRlOwogICAgdmFyIGNoYW5uZWxzID0gb3B0aW9ucy5jaGFubmVscy5tYXAoZnVuY3Rpb24gKGNoYW5uZWwpIHsKICAgICAgcmV0dXJuIG5ldyBGbG9hdDMyQXJyYXkoY2hhbm5lbCk7CiAgICB9KTsKICAgIHZhciBvdXRwdXRfY2hhbm5lbHMgPSBzcGxpdF9jaGFubmVscyA/IGNoYW5uZWxzLmxlbmd0aCA6IDE7CiAgICB2YXIgaGVhZGVyX3NpemUgPSAyNDsKICAgIHZhciBkYXRhX2xlbmd0aCA9IGNhbGN1bGF0ZVdhdmVmb3JtRGF0YUxlbmd0aChsZW5ndGgsIHNjYWxlKTsKICAgIHZhciBieXRlc19wZXJfc2FtcGxlID0gb3B0aW9ucy5iaXRzID09PSA4ID8gMSA6IDI7CiAgICB2YXIgdG90YWxfc2l6ZSA9IGhlYWRlcl9zaXplICsgZGF0YV9sZW5ndGggKiAyICogYnl0ZXNfcGVyX3NhbXBsZSAqIG91dHB1dF9jaGFubmVsczsKICAgIHZhciBidWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIodG90YWxfc2l6ZSk7CiAgICB2YXIgZGF0YV92aWV3ID0gbmV3IERhdGFWaWV3KGJ1ZmZlcik7CiAgICB2YXIgc2NhbGVfY291bnRlciA9IDA7CiAgICB2YXIgb2Zmc2V0ID0gaGVhZGVyX3NpemU7CiAgICB2YXIgbWluX3ZhbHVlID0gbmV3IEFycmF5KG91dHB1dF9jaGFubmVscyk7CiAgICB2YXIgbWF4X3ZhbHVlID0gbmV3IEFycmF5KG91dHB1dF9jaGFubmVscyk7CiAgICBmb3IgKHZhciBjaGFubmVsID0gMDsgY2hhbm5lbCA8IG91dHB1dF9jaGFubmVsczsgY2hhbm5lbCsrKSB7CiAgICAgIG1pbl92YWx1ZVtjaGFubmVsXSA9IEluZmluaXR5OwogICAgICBtYXhfdmFsdWVbY2hhbm5lbF0gPSAtSW5maW5pdHk7CiAgICB9CiAgICB2YXIgcmFuZ2VfbWluID0gb3B0aW9ucy5iaXRzID09PSA4ID8gSU5UOF9NSU4gOiBJTlQxNl9NSU47CiAgICB2YXIgcmFuZ2VfbWF4ID0gb3B0aW9ucy5iaXRzID09PSA4ID8gSU5UOF9NQVggOiBJTlQxNl9NQVg7CiAgICBkYXRhX3ZpZXcuc2V0SW50MzIoMCwgMiwgdHJ1ZSk7IC8vIFZlcnNpb24KICAgIGRhdGFfdmlldy5zZXRVaW50MzIoNCwgb3B0aW9ucy5iaXRzID09PSA4LCB0cnVlKTsgLy8gSXMgOCBiaXQ/CiAgICBkYXRhX3ZpZXcuc2V0SW50MzIoOCwgc2FtcGxlX3JhdGUsIHRydWUpOyAvLyBTYW1wbGUgcmF0ZQogICAgZGF0YV92aWV3LnNldEludDMyKDEyLCBzY2FsZSwgdHJ1ZSk7IC8vIFNjYWxlCiAgICBkYXRhX3ZpZXcuc2V0SW50MzIoMTYsIGRhdGFfbGVuZ3RoLCB0cnVlKTsgLy8gTGVuZ3RoCiAgICBkYXRhX3ZpZXcuc2V0SW50MzIoMjAsIG91dHB1dF9jaGFubmVscywgdHJ1ZSk7CiAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CiAgICAgIHZhciBzYW1wbGUgPSAwOwogICAgICBpZiAob3V0cHV0X2NoYW5uZWxzID09PSAxKSB7CiAgICAgICAgZm9yICh2YXIgX2NoYW5uZWwgPSAwOyBfY2hhbm5lbCA8IGNoYW5uZWxzLmxlbmd0aDsgKytfY2hhbm5lbCkgewogICAgICAgICAgc2FtcGxlICs9IGNoYW5uZWxzW19jaGFubmVsXVtpXTsKICAgICAgICB9CiAgICAgICAgc2FtcGxlID0gTWF0aC5mbG9vcihyYW5nZV9tYXggKiBzYW1wbGUgKiBhbXBsaXR1ZGVfc2NhbGUgLyBjaGFubmVscy5sZW5ndGgpOwogICAgICAgIGlmIChzYW1wbGUgPCBtaW5fdmFsdWVbMF0pIHsKICAgICAgICAgIG1pbl92YWx1ZVswXSA9IHNhbXBsZTsKICAgICAgICAgIGlmIChtaW5fdmFsdWVbMF0gPCByYW5nZV9taW4pIHsKICAgICAgICAgICAgbWluX3ZhbHVlWzBdID0gcmFuZ2VfbWluOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZiAoc2FtcGxlID4gbWF4X3ZhbHVlWzBdKSB7CiAgICAgICAgICBtYXhfdmFsdWVbMF0gPSBzYW1wbGU7CiAgICAgICAgICBpZiAobWF4X3ZhbHVlWzBdID4gcmFuZ2VfbWF4KSB7CiAgICAgICAgICAgIG1heF92YWx1ZVswXSA9IHJhbmdlX21heDsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZm9yICh2YXIgX2NoYW5uZWwyID0gMDsgX2NoYW5uZWwyIDwgb3V0cHV0X2NoYW5uZWxzOyArK19jaGFubmVsMikgewogICAgICAgICAgc2FtcGxlID0gTWF0aC5mbG9vcihyYW5nZV9tYXggKiBjaGFubmVsc1tfY2hhbm5lbDJdW2ldICogYW1wbGl0dWRlX3NjYWxlKTsKICAgICAgICAgIGlmIChzYW1wbGUgPCBtaW5fdmFsdWVbX2NoYW5uZWwyXSkgewogICAgICAgICAgICBtaW5fdmFsdWVbX2NoYW5uZWwyXSA9IHNhbXBsZTsKICAgICAgICAgICAgaWYgKG1pbl92YWx1ZVtfY2hhbm5lbDJdIDwgcmFuZ2VfbWluKSB7CiAgICAgICAgICAgICAgbWluX3ZhbHVlW19jaGFubmVsMl0gPSByYW5nZV9taW47CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIGlmIChzYW1wbGUgPiBtYXhfdmFsdWVbX2NoYW5uZWwyXSkgewogICAgICAgICAgICBtYXhfdmFsdWVbX2NoYW5uZWwyXSA9IHNhbXBsZTsKICAgICAgICAgICAgaWYgKG1heF92YWx1ZVtfY2hhbm5lbDJdID4gcmFuZ2VfbWF4KSB7CiAgICAgICAgICAgICAgbWF4X3ZhbHVlW19jaGFubmVsMl0gPSByYW5nZV9tYXg7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0KICAgICAgaWYgKCsrc2NhbGVfY291bnRlciA9PT0gc2NhbGUpIHsKICAgICAgICBmb3IgKHZhciBfY2hhbm5lbDMgPSAwOyBfY2hhbm5lbDMgPCBvdXRwdXRfY2hhbm5lbHM7IF9jaGFubmVsMysrKSB7CiAgICAgICAgICBpZiAob3B0aW9ucy5iaXRzID09PSA4KSB7CiAgICAgICAgICAgIGRhdGFfdmlldy5zZXRJbnQ4KG9mZnNldCsrLCBtaW5fdmFsdWVbX2NoYW5uZWwzXSk7CiAgICAgICAgICAgIGRhdGFfdmlldy5zZXRJbnQ4KG9mZnNldCsrLCBtYXhfdmFsdWVbX2NoYW5uZWwzXSk7CiAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBkYXRhX3ZpZXcuc2V0SW50MTYob2Zmc2V0LCBtaW5fdmFsdWVbX2NoYW5uZWwzXSwgdHJ1ZSk7CiAgICAgICAgICAgIGRhdGFfdmlldy5zZXRJbnQxNihvZmZzZXQgKyAyLCBtYXhfdmFsdWVbX2NoYW5uZWwzXSwgdHJ1ZSk7CiAgICAgICAgICAgIG9mZnNldCArPSA0OwogICAgICAgICAgfQogICAgICAgICAgbWluX3ZhbHVlW19jaGFubmVsM10gPSBJbmZpbml0eTsKICAgICAgICAgIG1heF92YWx1ZVtfY2hhbm5lbDNdID0gLUluZmluaXR5OwogICAgICAgIH0KICAgICAgICBzY2FsZV9jb3VudGVyID0gMDsKICAgICAgfQogICAgfQogICAgaWYgKHNjYWxlX2NvdW50ZXIgPiAwKSB7CiAgICAgIGZvciAodmFyIF9jaGFubmVsNCA9IDA7IF9jaGFubmVsNCA8IG91dHB1dF9jaGFubmVsczsgX2NoYW5uZWw0KyspIHsKICAgICAgICBpZiAob3B0aW9ucy5iaXRzID09PSA4KSB7CiAgICAgICAgICBkYXRhX3ZpZXcuc2V0SW50OChvZmZzZXQrKywgbWluX3ZhbHVlW19jaGFubmVsNF0pOwogICAgICAgICAgZGF0YV92aWV3LnNldEludDgob2Zmc2V0KyssIG1heF92YWx1ZVtfY2hhbm5lbDRdKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgZGF0YV92aWV3LnNldEludDE2KG9mZnNldCwgbWluX3ZhbHVlW19jaGFubmVsNF0sIHRydWUpOwogICAgICAgICAgZGF0YV92aWV3LnNldEludDE2KG9mZnNldCArIDIsIG1heF92YWx1ZVtfY2hhbm5lbDRdLCB0cnVlKTsKICAgICAgICB9CiAgICAgIH0KICAgIH0KICAgIHJldHVybiBidWZmZXI7CiAgfQoKICBvbm1lc3NhZ2UgPSBmdW5jdGlvbiBvbm1lc3NhZ2UoZXZ0KSB7CiAgICB2YXIgYnVmZmVyID0gZ2VuZXJhdGVXYXZlZm9ybURhdGEoZXZ0LmRhdGEpOwoKICAgIC8vIFRyYW5zZmVyIGJ1ZmZlciB0byB0aGUgY2FsbGluZyB0aHJlYWQKICAgIHRoaXMucG9zdE1lc3NhZ2UoYnVmZmVyLCBbYnVmZmVyXSk7CiAgICB0aGlzLmNsb3NlKCk7CiAgfTsKCn0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPXdhdmVmb3JtLWRhdGEtd29ya2VyLmpzLm1hcAoK");
10053
- function _t(e) {
10054
- if (Xv(e) && (e = jv(e)), Yv(e)) {
10052
+ var Q0 = /* @__PURE__ */ J0("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgLyoqCiAgICogQXVkaW9CdWZmZXItYmFzZWQgV2F2ZWZvcm1EYXRhIGdlbmVyYXRvcgogICAqCiAgICogQWRhcHRlZCBmcm9tIEJsb2NrRmlsZTo6Q2FsY1N1bW1hcnkgaW4gQXVkYWNpdHksIHdpdGggcGVybWlzc2lvbi4KICAgKiBTZWUgaHR0cHM6Ly9naXRodWIuY29tL2F1ZGFjaXR5L2F1ZGFjaXR5L2Jsb2IvCiAgICogICAxMTA4YzEzNzZjMDkxNjYxNjIzMzVmYWI0NzQzMDA4Y2JhNTdjNGVlL3NyYy9CbG9ja0ZpbGUuY3BwI0wxOTgKICAgKi8KCiAgdmFyIElOVDhfTUFYID0gMTI3OwogIHZhciBJTlQ4X01JTiA9IC0xMjg7CiAgdmFyIElOVDE2X01BWCA9IDMyNzY3OwogIHZhciBJTlQxNl9NSU4gPSAtMzI3Njg7CiAgZnVuY3Rpb24gY2FsY3VsYXRlV2F2ZWZvcm1EYXRhTGVuZ3RoKGF1ZGlvX3NhbXBsZV9jb3VudCwgc2NhbGUpIHsKICAgIHZhciBkYXRhX2xlbmd0aCA9IE1hdGguZmxvb3IoYXVkaW9fc2FtcGxlX2NvdW50IC8gc2NhbGUpOwogICAgdmFyIHNhbXBsZXNfcmVtYWluaW5nID0gYXVkaW9fc2FtcGxlX2NvdW50IC0gZGF0YV9sZW5ndGggKiBzY2FsZTsKICAgIGlmIChzYW1wbGVzX3JlbWFpbmluZyA+IDApIHsKICAgICAgZGF0YV9sZW5ndGgrKzsKICAgIH0KICAgIHJldHVybiBkYXRhX2xlbmd0aDsKICB9CiAgZnVuY3Rpb24gZ2VuZXJhdGVXYXZlZm9ybURhdGEob3B0aW9ucykgewogICAgdmFyIHNjYWxlID0gb3B0aW9ucy5zY2FsZTsKICAgIHZhciBhbXBsaXR1ZGVfc2NhbGUgPSBvcHRpb25zLmFtcGxpdHVkZV9zY2FsZTsKICAgIHZhciBzcGxpdF9jaGFubmVscyA9IG9wdGlvbnMuc3BsaXRfY2hhbm5lbHM7CiAgICB2YXIgbGVuZ3RoID0gb3B0aW9ucy5sZW5ndGg7CiAgICB2YXIgc2FtcGxlX3JhdGUgPSBvcHRpb25zLnNhbXBsZV9yYXRlOwogICAgdmFyIGNoYW5uZWxzID0gb3B0aW9ucy5jaGFubmVscy5tYXAoZnVuY3Rpb24gKGNoYW5uZWwpIHsKICAgICAgcmV0dXJuIG5ldyBGbG9hdDMyQXJyYXkoY2hhbm5lbCk7CiAgICB9KTsKICAgIHZhciBvdXRwdXRfY2hhbm5lbHMgPSBzcGxpdF9jaGFubmVscyA/IGNoYW5uZWxzLmxlbmd0aCA6IDE7CiAgICB2YXIgaGVhZGVyX3NpemUgPSAyNDsKICAgIHZhciBkYXRhX2xlbmd0aCA9IGNhbGN1bGF0ZVdhdmVmb3JtRGF0YUxlbmd0aChsZW5ndGgsIHNjYWxlKTsKICAgIHZhciBieXRlc19wZXJfc2FtcGxlID0gb3B0aW9ucy5iaXRzID09PSA4ID8gMSA6IDI7CiAgICB2YXIgdG90YWxfc2l6ZSA9IGhlYWRlcl9zaXplICsgZGF0YV9sZW5ndGggKiAyICogYnl0ZXNfcGVyX3NhbXBsZSAqIG91dHB1dF9jaGFubmVsczsKICAgIHZhciBidWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIodG90YWxfc2l6ZSk7CiAgICB2YXIgZGF0YV92aWV3ID0gbmV3IERhdGFWaWV3KGJ1ZmZlcik7CiAgICB2YXIgc2NhbGVfY291bnRlciA9IDA7CiAgICB2YXIgb2Zmc2V0ID0gaGVhZGVyX3NpemU7CiAgICB2YXIgbWluX3ZhbHVlID0gbmV3IEFycmF5KG91dHB1dF9jaGFubmVscyk7CiAgICB2YXIgbWF4X3ZhbHVlID0gbmV3IEFycmF5KG91dHB1dF9jaGFubmVscyk7CiAgICBmb3IgKHZhciBjaGFubmVsID0gMDsgY2hhbm5lbCA8IG91dHB1dF9jaGFubmVsczsgY2hhbm5lbCsrKSB7CiAgICAgIG1pbl92YWx1ZVtjaGFubmVsXSA9IEluZmluaXR5OwogICAgICBtYXhfdmFsdWVbY2hhbm5lbF0gPSAtSW5maW5pdHk7CiAgICB9CiAgICB2YXIgcmFuZ2VfbWluID0gb3B0aW9ucy5iaXRzID09PSA4ID8gSU5UOF9NSU4gOiBJTlQxNl9NSU47CiAgICB2YXIgcmFuZ2VfbWF4ID0gb3B0aW9ucy5iaXRzID09PSA4ID8gSU5UOF9NQVggOiBJTlQxNl9NQVg7CiAgICBkYXRhX3ZpZXcuc2V0SW50MzIoMCwgMiwgdHJ1ZSk7IC8vIFZlcnNpb24KICAgIGRhdGFfdmlldy5zZXRVaW50MzIoNCwgb3B0aW9ucy5iaXRzID09PSA4LCB0cnVlKTsgLy8gSXMgOCBiaXQ/CiAgICBkYXRhX3ZpZXcuc2V0SW50MzIoOCwgc2FtcGxlX3JhdGUsIHRydWUpOyAvLyBTYW1wbGUgcmF0ZQogICAgZGF0YV92aWV3LnNldEludDMyKDEyLCBzY2FsZSwgdHJ1ZSk7IC8vIFNjYWxlCiAgICBkYXRhX3ZpZXcuc2V0SW50MzIoMTYsIGRhdGFfbGVuZ3RoLCB0cnVlKTsgLy8gTGVuZ3RoCiAgICBkYXRhX3ZpZXcuc2V0SW50MzIoMjAsIG91dHB1dF9jaGFubmVscywgdHJ1ZSk7CiAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CiAgICAgIHZhciBzYW1wbGUgPSAwOwogICAgICBpZiAob3V0cHV0X2NoYW5uZWxzID09PSAxKSB7CiAgICAgICAgZm9yICh2YXIgX2NoYW5uZWwgPSAwOyBfY2hhbm5lbCA8IGNoYW5uZWxzLmxlbmd0aDsgKytfY2hhbm5lbCkgewogICAgICAgICAgc2FtcGxlICs9IGNoYW5uZWxzW19jaGFubmVsXVtpXTsKICAgICAgICB9CiAgICAgICAgc2FtcGxlID0gTWF0aC5mbG9vcihyYW5nZV9tYXggKiBzYW1wbGUgKiBhbXBsaXR1ZGVfc2NhbGUgLyBjaGFubmVscy5sZW5ndGgpOwogICAgICAgIGlmIChzYW1wbGUgPCBtaW5fdmFsdWVbMF0pIHsKICAgICAgICAgIG1pbl92YWx1ZVswXSA9IHNhbXBsZTsKICAgICAgICAgIGlmIChtaW5fdmFsdWVbMF0gPCByYW5nZV9taW4pIHsKICAgICAgICAgICAgbWluX3ZhbHVlWzBdID0gcmFuZ2VfbWluOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZiAoc2FtcGxlID4gbWF4X3ZhbHVlWzBdKSB7CiAgICAgICAgICBtYXhfdmFsdWVbMF0gPSBzYW1wbGU7CiAgICAgICAgICBpZiAobWF4X3ZhbHVlWzBdID4gcmFuZ2VfbWF4KSB7CiAgICAgICAgICAgIG1heF92YWx1ZVswXSA9IHJhbmdlX21heDsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZm9yICh2YXIgX2NoYW5uZWwyID0gMDsgX2NoYW5uZWwyIDwgb3V0cHV0X2NoYW5uZWxzOyArK19jaGFubmVsMikgewogICAgICAgICAgc2FtcGxlID0gTWF0aC5mbG9vcihyYW5nZV9tYXggKiBjaGFubmVsc1tfY2hhbm5lbDJdW2ldICogYW1wbGl0dWRlX3NjYWxlKTsKICAgICAgICAgIGlmIChzYW1wbGUgPCBtaW5fdmFsdWVbX2NoYW5uZWwyXSkgewogICAgICAgICAgICBtaW5fdmFsdWVbX2NoYW5uZWwyXSA9IHNhbXBsZTsKICAgICAgICAgICAgaWYgKG1pbl92YWx1ZVtfY2hhbm5lbDJdIDwgcmFuZ2VfbWluKSB7CiAgICAgICAgICAgICAgbWluX3ZhbHVlW19jaGFubmVsMl0gPSByYW5nZV9taW47CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIGlmIChzYW1wbGUgPiBtYXhfdmFsdWVbX2NoYW5uZWwyXSkgewogICAgICAgICAgICBtYXhfdmFsdWVbX2NoYW5uZWwyXSA9IHNhbXBsZTsKICAgICAgICAgICAgaWYgKG1heF92YWx1ZVtfY2hhbm5lbDJdID4gcmFuZ2VfbWF4KSB7CiAgICAgICAgICAgICAgbWF4X3ZhbHVlW19jaGFubmVsMl0gPSByYW5nZV9tYXg7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0KICAgICAgaWYgKCsrc2NhbGVfY291bnRlciA9PT0gc2NhbGUpIHsKICAgICAgICBmb3IgKHZhciBfY2hhbm5lbDMgPSAwOyBfY2hhbm5lbDMgPCBvdXRwdXRfY2hhbm5lbHM7IF9jaGFubmVsMysrKSB7CiAgICAgICAgICBpZiAob3B0aW9ucy5iaXRzID09PSA4KSB7CiAgICAgICAgICAgIGRhdGFfdmlldy5zZXRJbnQ4KG9mZnNldCsrLCBtaW5fdmFsdWVbX2NoYW5uZWwzXSk7CiAgICAgICAgICAgIGRhdGFfdmlldy5zZXRJbnQ4KG9mZnNldCsrLCBtYXhfdmFsdWVbX2NoYW5uZWwzXSk7CiAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBkYXRhX3ZpZXcuc2V0SW50MTYob2Zmc2V0LCBtaW5fdmFsdWVbX2NoYW5uZWwzXSwgdHJ1ZSk7CiAgICAgICAgICAgIGRhdGFfdmlldy5zZXRJbnQxNihvZmZzZXQgKyAyLCBtYXhfdmFsdWVbX2NoYW5uZWwzXSwgdHJ1ZSk7CiAgICAgICAgICAgIG9mZnNldCArPSA0OwogICAgICAgICAgfQogICAgICAgICAgbWluX3ZhbHVlW19jaGFubmVsM10gPSBJbmZpbml0eTsKICAgICAgICAgIG1heF92YWx1ZVtfY2hhbm5lbDNdID0gLUluZmluaXR5OwogICAgICAgIH0KICAgICAgICBzY2FsZV9jb3VudGVyID0gMDsKICAgICAgfQogICAgfQogICAgaWYgKHNjYWxlX2NvdW50ZXIgPiAwKSB7CiAgICAgIGZvciAodmFyIF9jaGFubmVsNCA9IDA7IF9jaGFubmVsNCA8IG91dHB1dF9jaGFubmVsczsgX2NoYW5uZWw0KyspIHsKICAgICAgICBpZiAob3B0aW9ucy5iaXRzID09PSA4KSB7CiAgICAgICAgICBkYXRhX3ZpZXcuc2V0SW50OChvZmZzZXQrKywgbWluX3ZhbHVlW19jaGFubmVsNF0pOwogICAgICAgICAgZGF0YV92aWV3LnNldEludDgob2Zmc2V0KyssIG1heF92YWx1ZVtfY2hhbm5lbDRdKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgZGF0YV92aWV3LnNldEludDE2KG9mZnNldCwgbWluX3ZhbHVlW19jaGFubmVsNF0sIHRydWUpOwogICAgICAgICAgZGF0YV92aWV3LnNldEludDE2KG9mZnNldCArIDIsIG1heF92YWx1ZVtfY2hhbm5lbDRdLCB0cnVlKTsKICAgICAgICB9CiAgICAgIH0KICAgIH0KICAgIHJldHVybiBidWZmZXI7CiAgfQoKICBvbm1lc3NhZ2UgPSBmdW5jdGlvbiBvbm1lc3NhZ2UoZXZ0KSB7CiAgICB2YXIgYnVmZmVyID0gZ2VuZXJhdGVXYXZlZm9ybURhdGEoZXZ0LmRhdGEpOwoKICAgIC8vIFRyYW5zZmVyIGJ1ZmZlciB0byB0aGUgY2FsbGluZyB0aHJlYWQKICAgIHRoaXMucG9zdE1lc3NhZ2UoYnVmZmVyLCBbYnVmZmVyXSk7CiAgICB0aGlzLmNsb3NlKCk7CiAgfTsKCn0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPXdhdmVmb3JtLWRhdGEtd29ya2VyLmpzLm1hcAoK");
10053
+ function kt(e) {
10054
+ if (X0(e) && (e = j0(e)), Y0(e)) {
10055
10055
  this._data = new DataView(e), this._offset = this._version() === 2 ? 24 : 20, this._channels = [];
10056
10056
  for (var t = 0; t < this.channels; t++)
10057
10057
  this._channels[t] = new Dn(this, t);
@@ -10083,7 +10083,7 @@ function ty(e) {
10083
10083
  function vf(e, t, n) {
10084
10084
  var r = ty(e);
10085
10085
  if (t.disable_worker) {
10086
- var o = Uv({
10086
+ var o = U0({
10087
10087
  scale: t.scale,
10088
10088
  bits: t.bits,
10089
10089
  amplitude_scale: t.amplitude_scale,
@@ -10092,11 +10092,11 @@ function vf(e, t, n) {
10092
10092
  sample_rate: e.sampleRate,
10093
10093
  channels: r
10094
10094
  });
10095
- n(void 0, new _t(o), e);
10095
+ n(void 0, new kt(o), e);
10096
10096
  } else {
10097
- var a = new Qv();
10097
+ var a = new Q0();
10098
10098
  a.onmessage = function(s) {
10099
- n(void 0, new _t(s.data), e);
10099
+ n(void 0, new kt(s.data), e);
10100
10100
  }, a.postMessage({
10101
10101
  scale: t.scale,
10102
10102
  bits: t.bits,
@@ -10118,10 +10118,10 @@ function ny(e, t, n, r) {
10118
10118
  }, o);
10119
10119
  a && a.catch(o);
10120
10120
  }
10121
- _t.create = function(t) {
10122
- return new _t(t);
10121
+ kt.create = function(t) {
10122
+ return new kt(t);
10123
10123
  };
10124
- _t.createFromAudio = function(e, t) {
10124
+ kt.createFromAudio = function(e, t) {
10125
10125
  var n = ey(e);
10126
10126
  if (e.audio_context && e.array_buffer)
10127
10127
  return ny(e.audio_context, e.array_buffer, n, t);
@@ -10135,7 +10135,7 @@ _t.createFromAudio = function(e, t) {
10135
10135
  function ha(e) {
10136
10136
  this._inputData = e.waveformData, this._output_samples_per_pixel = e.scale, this._scale = this._inputData.scale, this._input_buffer_size = this._inputData.length;
10137
10137
  var t = this._input_buffer_size * this._inputData.scale, n = Math.ceil(t / this._output_samples_per_pixel), r = 24, o = this._inputData.bits === 8 ? 1 : 2, a = r + n * 2 * this._inputData.channels * o;
10138
- this._output_data = new ArrayBuffer(a), this.output_dataview = new DataView(this._output_data), this.output_dataview.setInt32(0, 2, !0), this.output_dataview.setUint32(4, this._inputData.bits === 8, !0), this.output_dataview.setInt32(8, this._inputData.sample_rate, !0), this.output_dataview.setInt32(12, this._output_samples_per_pixel, !0), this.output_dataview.setInt32(16, n, !0), this.output_dataview.setInt32(20, this._inputData.channels, !0), this._outputWaveformData = new _t(this._output_data), this._input_index = 0, this._output_index = 0;
10138
+ this._output_data = new ArrayBuffer(a), this.output_dataview = new DataView(this._output_data), this.output_dataview.setInt32(0, 2, !0), this.output_dataview.setUint32(4, this._inputData.bits === 8, !0), this.output_dataview.setInt32(8, this._inputData.sample_rate, !0), this.output_dataview.setInt32(12, this._output_samples_per_pixel, !0), this.output_dataview.setInt32(16, n, !0), this.output_dataview.setInt32(20, this._inputData.channels, !0), this._outputWaveformData = new kt(this._output_data), this._input_index = 0, this._output_index = 0;
10139
10139
  var s = this._inputData.channels;
10140
10140
  this._min = new Array(s), this._max = new Array(s);
10141
10141
  for (var i = 0; i < s; ++i)
@@ -10175,7 +10175,7 @@ ha.prototype.next = function() {
10175
10175
  ha.prototype.getOutputData = function() {
10176
10176
  return this._output_data;
10177
10177
  };
10178
- _t.prototype = {
10178
+ kt.prototype = {
10179
10179
  _getResampleOptions: function(t) {
10180
10180
  var n = {};
10181
10181
  if (n.scale = t.scale, n.width = t.width, !Ln(n.width) && (typeof n.width != "number" || n.width <= 0))
@@ -10192,7 +10192,7 @@ _t.prototype = {
10192
10192
  t = this._getResampleOptions(t), t.waveformData = this;
10193
10193
  for (var n = new ha(t); !n.next(); )
10194
10194
  ;
10195
- return new _t(n.getOutputData());
10195
+ return new kt(n.getOutputData());
10196
10196
  },
10197
10197
  /**
10198
10198
  * Concatenates with one or more other waveforms, returning a new WaveformData object.
@@ -10204,7 +10204,7 @@ _t.prototype = {
10204
10204
  throw new Error("WaveformData.concat(): Waveforms are incompatible");
10205
10205
  });
10206
10206
  var r = this._concatBuffers.apply(this, n);
10207
- return _t.create(r);
10207
+ return kt.create(r);
10208
10208
  },
10209
10209
  /**
10210
10210
  * Returns a new ArrayBuffer with the concatenated waveform.
@@ -10239,7 +10239,7 @@ _t.prototype = {
10239
10239
  var f = this._at(n * this.channels * 2 + u);
10240
10240
  this.bits === 8 ? c.setInt8(a + u, f) : c.setInt16(a + u * 2, f, !0);
10241
10241
  }
10242
- return new _t(l);
10242
+ return new kt(l);
10243
10243
  },
10244
10244
  /**
10245
10245
  * Returns the data format version number.
@@ -10358,10 +10358,10 @@ async function yf(e) {
10358
10358
  throw new Error(`Failed to fetch waveform data: ${t.statusText}`);
10359
10359
  if (e.endsWith(".dat")) {
10360
10360
  const r = await t.arrayBuffer();
10361
- return _t.create(r);
10361
+ return kt.create(r);
10362
10362
  } else {
10363
10363
  const r = await t.json();
10364
- return _t.create(r);
10364
+ return kt.create(r);
10365
10365
  }
10366
10366
  }
10367
10367
  function ry(e, t = 0) {
@@ -10375,11 +10375,11 @@ function ry(e, t = 0) {
10375
10375
  sampleRate: e.sample_rate
10376
10376
  };
10377
10377
  }
10378
- async function Vb(e, t = 0) {
10378
+ async function Zb(e, t = 0) {
10379
10379
  const n = await yf(e);
10380
10380
  return ry(n, t);
10381
10381
  }
10382
- async function Nb(e) {
10382
+ async function Hb(e) {
10383
10383
  const t = await yf(e);
10384
10384
  return {
10385
10385
  sampleRate: t.sample_rate,
@@ -10575,7 +10575,7 @@ function uy({ engineRef: e }) {
10575
10575
  selectedTrackIdRef: r
10576
10576
  };
10577
10577
  }
10578
- const zb = (e = 256) => {
10578
+ const Gb = (e = 256) => {
10579
10579
  const t = T(null), n = $(
10580
10580
  (r, o, a) => {
10581
10581
  const s = new _c("fft", e);
@@ -10626,29 +10626,29 @@ function vo(e, t, n, r) {
10626
10626
  }, c = r.get(t);
10627
10627
  return c ? (l.id = c.trackId, l.clips[0] = { ...l.clips[0], id: c.clipId }) : r.set(t, { trackId: l.id, clipId: l.clips[0].id }), l;
10628
10628
  }
10629
- function Zb(e, t = {}) {
10629
+ function Ub(e, t = {}) {
10630
10630
  const { immediate: n = !1, progressive: r = !1 } = t, o = n || r, [a, s] = z(!0), [i, l] = z(null), [c, u] = z(0), f = e.length, [p, d] = z(/* @__PURE__ */ new Map()), h = T(/* @__PURE__ */ new Map()), g = Ce(() => {
10631
10631
  if (!o) return null;
10632
- const w = [];
10633
- for (let b = 0; b < e.length; b++) {
10634
- const _ = vo(e[b], b, p.get(b), h.current);
10635
- _ && w.push(_);
10632
+ const b = [];
10633
+ for (let w = 0; w < e.length; w++) {
10634
+ const _ = vo(e[w], w, p.get(w), h.current);
10635
+ _ && b.push(_);
10636
10636
  }
10637
- return w;
10637
+ return b;
10638
10638
  }, [o, e, p]), [v, m] = z(g ?? []), y = T(g);
10639
10639
  return g !== y.current && (y.current = g, g && m(g)), K(() => {
10640
10640
  if (e.length === 0) {
10641
10641
  m([]), s(!1), u(0);
10642
10642
  return;
10643
10643
  }
10644
- let w = !1;
10645
- const b = new AbortController();
10644
+ let b = !1;
10645
+ const w = new AbortController();
10646
10646
  return (async () => {
10647
10647
  try {
10648
10648
  s(!0), l(null), u(0), o && d(/* @__PURE__ */ new Map());
10649
10649
  const S = nh.getContext().rawContext, C = e.map(async (x, M) => {
10650
10650
  if (x.audioBuffer) {
10651
- if (o && !w) {
10651
+ if (o && !b) {
10652
10652
  d((D) => {
10653
10653
  const F = new Map(D);
10654
10654
  return F.set(M, x.audioBuffer), F;
@@ -10658,7 +10658,7 @@ function Zb(e, t = {}) {
10658
10658
  return vo(x, M, x.audioBuffer, h.current);
10659
10659
  }
10660
10660
  if (!x.src && x.waveformData) {
10661
- if (o && !w) {
10661
+ if (o && !b) {
10662
10662
  u((D) => D + 1);
10663
10663
  return;
10664
10664
  }
@@ -10666,13 +10666,13 @@ function Zb(e, t = {}) {
10666
10666
  }
10667
10667
  if (!x.src)
10668
10668
  throw new Error(`Track ${M + 1}: Must provide src, audioBuffer, or waveformData`);
10669
- const R = await fetch(x.src, { signal: b.signal });
10669
+ const R = await fetch(x.src, { signal: w.signal });
10670
10670
  if (!R.ok)
10671
10671
  throw new Error(`Failed to fetch ${x.src}: ${R.statusText}`);
10672
10672
  const A = await R.arrayBuffer(), I = await S.decodeAudioData(A);
10673
10673
  if (!I || !I.sampleRate || !I.duration)
10674
10674
  throw new Error(`Invalid audio buffer for ${x.src}`);
10675
- if (o && !w) {
10675
+ if (o && !b) {
10676
10676
  d((D) => {
10677
10677
  const F = new Map(D);
10678
10678
  return F.set(M, I), F;
@@ -10681,7 +10681,7 @@ function Zb(e, t = {}) {
10681
10681
  }
10682
10682
  return vo(x, M, I, h.current);
10683
10683
  }), E = await Promise.all(C);
10684
- if (!w) {
10684
+ if (!b) {
10685
10685
  if (!o) {
10686
10686
  const x = E.filter((M) => M != null);
10687
10687
  m(x), u(x.length);
@@ -10689,13 +10689,13 @@ function Zb(e, t = {}) {
10689
10689
  s(!1);
10690
10690
  }
10691
10691
  } catch (S) {
10692
- if (!w) {
10692
+ if (!b) {
10693
10693
  const C = S instanceof Error ? S.message : "Unknown error loading audio";
10694
10694
  l(C), s(!1), console.error(`[waveform-playlist] Error loading audio tracks: ${C}`);
10695
10695
  }
10696
10696
  }
10697
10697
  })(), () => {
10698
- w = !0, b.abort();
10698
+ b = !0, w.abort();
10699
10699
  };
10700
10700
  }, [e, o]), { tracks: v, loading: a, error: i, loadedCount: c, totalCount: f };
10701
10701
  }
@@ -10763,8 +10763,8 @@ function hy({
10763
10763
  (d) => {
10764
10764
  const h = d.operation.source?.data;
10765
10765
  if (!h || !h.boundary || !l.current) return;
10766
- const { boundary: g, trackIndex: v, clipIndex: m } = h, w = (d.to?.x ?? d.operation.position.current.x) - d.operation.position.initial.x, b = w * n, _ = l.current, S = i.current;
10767
- let C = b;
10766
+ const { boundary: g, trackIndex: v, clipIndex: m } = h, b = (d.to?.x ?? d.operation.position.current.x) - d.operation.position.initial.x, w = b * n, _ = l.current, S = i.current;
10767
+ let C = w;
10768
10768
  const E = e.map((x, M) => {
10769
10769
  if (M !== v) return x;
10770
10770
  const R = [...x.clips].sort((D, F) => D.startSample - F.startSample), A = R.findIndex((D) => D === x.clips[m]), I = x.clips.map((D, F) => {
@@ -10772,7 +10772,7 @@ function hy({
10772
10772
  let L = fy({
10773
10773
  originalClip: _,
10774
10774
  clip: D,
10775
- pixelDelta: w,
10775
+ pixelDelta: b,
10776
10776
  samplesPerPixel: n,
10777
10777
  sampleRate: r,
10778
10778
  boundary: g,
@@ -10810,9 +10810,9 @@ function hy({
10810
10810
  (d) => {
10811
10811
  if (d.canceled) {
10812
10812
  if (l.current) {
10813
- const b = d.operation.source?.data;
10814
- if (b) {
10815
- const { trackIndex: _, clipIndex: S } = b, C = l.current, E = e.map((x, M) => {
10813
+ const w = d.operation.source?.data;
10814
+ if (w) {
10815
+ const { trackIndex: _, clipIndex: S } = w, C = l.current, E = e.map((x, M) => {
10816
10816
  if (M !== _) return x;
10817
10817
  const R = x.clips.map((A, I) => I !== S ? A : {
10818
10818
  ...A,
@@ -10830,14 +10830,14 @@ function hy({
10830
10830
  }
10831
10831
  const h = d.operation.source?.data;
10832
10832
  if (!h) return;
10833
- const { trackIndex: g, clipId: v, boundary: m } = h, y = m ? c.current : d.operation.transform.x * n, w = e[g]?.id;
10833
+ const { trackIndex: g, clipId: v, boundary: m } = h, y = m ? c.current : d.operation.transform.x * n, b = e[g]?.id;
10834
10834
  if (m) {
10835
- a.current = !1, w ? o.current ? o.current.trimClip(w, v, m, Math.floor(y)) : console.warn("[waveform-playlist] engineRef is null — trim not synced to adapter") : console.warn(
10835
+ a.current = !1, b ? o.current ? o.current.trimClip(b, v, m, Math.floor(y)) : console.warn("[waveform-playlist] engineRef is null — trim not synced to adapter") : console.warn(
10836
10836
  `[waveform-playlist] onDragEnd: track at index ${g} not found — trim not synced to adapter`
10837
10837
  ), l.current = null, c.current = 0;
10838
10838
  return;
10839
10839
  }
10840
- w ? o.current ? o.current.moveClip(w, v, Math.floor(y)) : console.warn("[waveform-playlist] engineRef is null — move not synced to adapter") : console.warn(
10840
+ b ? o.current ? o.current.moveClip(b, v, Math.floor(y)) : console.warn("[waveform-playlist] engineRef is null — move not synced to adapter") : console.warn(
10841
10841
  `[waveform-playlist] onDragEnd: track at index ${g} not found — move not synced to adapter`
10842
10842
  );
10843
10843
  },
@@ -10879,7 +10879,7 @@ function py({
10879
10879
  return;
10880
10880
  const f = u.operation.source?.data;
10881
10881
  if (!f) return;
10882
- const { edge: p, annotationIndex: d } = f, h = s.current, m = ((u.to?.x ?? u.operation.position.current.x) - u.operation.position.initial.x) * n / r, y = p === "start" ? h.start + m : h.end + m, w = my({
10882
+ const { edge: p, annotationIndex: d } = f, h = s.current, m = ((u.to?.x ?? u.operation.position.current.x) - u.operation.position.initial.x) * n / r, y = p === "start" ? h.start + m : h.end + m, b = my({
10883
10883
  annotationIndex: d,
10884
10884
  newTime: y,
10885
10885
  isDraggingStart: p === "start",
@@ -10887,7 +10887,7 @@ function py({
10887
10887
  duration: o,
10888
10888
  linkEndpoints: a
10889
10889
  });
10890
- t(w);
10890
+ t(b);
10891
10891
  },
10892
10892
  [e, t, n, r, o, a]
10893
10893
  ), c = at.useCallback(
@@ -11009,8 +11009,8 @@ function gy(e = {}) {
11009
11009
  })
11010
11010
  ], [t, n, r, o]);
11011
11011
  }
11012
- const Hb = (e) => {
11013
- const { tracks: t, sampleRate: n, engineRef: r } = e, { currentTimeRef: o } = Ct(), { selectedTrackId: a } = xt(), s = $(
11012
+ const vy = (e) => {
11013
+ const { tracks: t, sampleRate: n, engineRef: r } = e, { currentTimeRef: o } = Et(), { selectedTrackId: a } = gt(), s = $(
11014
11014
  (l, c, u) => {
11015
11015
  const { samplesPerPixel: f } = e, p = t[l];
11016
11016
  if (!p) return !1;
@@ -11062,11 +11062,11 @@ const Hb = (e) => {
11062
11062
  window.removeEventListener("keydown", r);
11063
11063
  };
11064
11064
  }, [r, n]);
11065
- }, Gb = (e) => {
11065
+ }, Xb = (e) => {
11066
11066
  const t = [], n = typeof navigator < "u" && navigator.platform.includes("Mac");
11067
11067
  return e.metaKey && t.push(n ? "Cmd" : "Ctrl"), e.ctrlKey && !e.metaKey && t.push("Ctrl"), e.altKey && t.push(n ? "Option" : "Alt"), e.shiftKey && t.push("Shift"), t.push(e.key.toUpperCase()), t.join("+");
11068
- }, Ub = (e = {}) => {
11069
- const { enabled: t = !0, additionalShortcuts: n = [], shortcuts: r } = e, { isPlaying: o } = Ct(), { setCurrentTime: a, play: s, pause: i, stop: l } = Fe(), c = $(() => {
11068
+ }, yy = (e = {}) => {
11069
+ const { enabled: t = !0, additionalShortcuts: n = [], shortcuts: r } = e, { isPlaying: o } = Et(), { setCurrentTime: a, play: s, pause: i, stop: l } = De(), c = $(() => {
11070
11070
  o ? i() : s();
11071
11071
  }, [o, s, i]), u = $(() => {
11072
11072
  l();
@@ -11102,7 +11102,7 @@ const Hb = (e) => {
11102
11102
  shortcuts: d
11103
11103
  };
11104
11104
  }, Oa = 0.01, yo = 0.01;
11105
- function Xb({
11105
+ function by({
11106
11106
  annotations: e,
11107
11107
  activeAnnotationId: t,
11108
11108
  onAnnotationsChange: n,
@@ -11218,9 +11218,9 @@ function Xb({
11218
11218
  !r || e.length === 0 || (p < 0 || p >= e.length - 1 ? r(e[0].id) : r(e[p + 1].id));
11219
11219
  }, [e, p, r]), y = $(() => {
11220
11220
  !r || e.length === 0 || r(e[0].id);
11221
- }, [e, r]), w = $(() => {
11222
- !r || e.length === 0 || r(e[e.length - 1].id);
11223
11221
  }, [e, r]), b = $(() => {
11222
+ !r || e.length === 0 || r(e[e.length - 1].id);
11223
+ }, [e, r]), w = $(() => {
11224
11224
  r && r(null);
11225
11225
  }, [r]), _ = $(() => {
11226
11226
  if (p < 0 || !f) return;
@@ -11296,18 +11296,18 @@ function Xb({
11296
11296
  },
11297
11297
  {
11298
11298
  key: "End",
11299
- action: w,
11299
+ action: b,
11300
11300
  description: "Select last annotation",
11301
11301
  preventDefault: !0
11302
11302
  },
11303
11303
  {
11304
11304
  key: "Escape",
11305
- action: b,
11305
+ action: w,
11306
11306
  description: "Deselect annotation",
11307
11307
  preventDefault: !0
11308
11308
  }
11309
11309
  ],
11310
- [v, m, y, w, b]
11310
+ [v, m, y, b, w]
11311
11311
  );
11312
11312
  return Es({
11313
11313
  shortcuts: S,
@@ -11321,8 +11321,8 @@ function Xb({
11321
11321
  selectPrevious: v,
11322
11322
  selectNext: m,
11323
11323
  selectFirst: y,
11324
- selectLast: w,
11325
- clearSelection: b,
11324
+ selectLast: b,
11325
+ clearSelection: w,
11326
11326
  scrollToAnnotation: d,
11327
11327
  playActiveAnnotation: _
11328
11328
  };
@@ -11864,7 +11864,7 @@ const pa = [
11864
11864
  { id: "dynamics", name: "Dynamics" },
11865
11865
  { id: "spatial", name: "Spatial" }
11866
11866
  ];
11867
- const vy = {
11867
+ const wy = {
11868
11868
  reverb: Ih,
11869
11869
  freeverb: Eh,
11870
11870
  jcReverb: xh,
@@ -11886,10 +11886,10 @@ const vy = {
11886
11886
  gate: ch,
11887
11887
  stereoWidener: lh
11888
11888
  };
11889
- let yy = 0;
11890
- const by = () => `effect_${Date.now()}_${++yy}`;
11889
+ let _y = 0;
11890
+ const Sy = () => `effect_${Date.now()}_${++_y}`;
11891
11891
  function jo(e, t) {
11892
- const n = vy[e.id];
11892
+ const n = wy[e.id];
11893
11893
  if (!n)
11894
11894
  throw new Error(`Unknown effect type: ${e.id}`);
11895
11895
  const r = {};
@@ -11897,7 +11897,7 @@ function jo(e, t) {
11897
11897
  const l = t?.[i.name] ?? i.default;
11898
11898
  r[i.name] = l;
11899
11899
  });
11900
- const o = new n(r), a = by(), s = o;
11900
+ const o = new n(r), a = Sy(), s = o;
11901
11901
  return {
11902
11902
  effect: o,
11903
11903
  id: e.id,
@@ -11967,7 +11967,7 @@ function qb(e = 256) {
11967
11967
  const o = T(/* @__PURE__ */ new Map()), a = T(null), s = T(null), i = $((v) => {
11968
11968
  const m = s.current;
11969
11969
  if (!m) return;
11970
- const { masterGainNode: y, destination: w, analyserNode: b } = m;
11970
+ const { masterGainNode: y, destination: b, analyserNode: w } = m;
11971
11971
  try {
11972
11972
  y.disconnect();
11973
11973
  } catch (S) {
@@ -11975,7 +11975,7 @@ function qb(e = 256) {
11975
11975
  }
11976
11976
  const _ = v.map((S) => o.current.get(S.instanceId)).filter((S) => S !== void 0);
11977
11977
  if (_.length === 0)
11978
- y.connect(b), b.connect(w);
11978
+ y.connect(w), w.connect(b);
11979
11979
  else {
11980
11980
  let S = y;
11981
11981
  _.forEach((C) => {
@@ -11985,7 +11985,7 @@ function qb(e = 256) {
11985
11985
  console.warn(`[waveform-playlist] Error disconnecting effect "${C.id}":`, E);
11986
11986
  }
11987
11987
  S.connect(C.effect), S = C.effect;
11988
- }), S.connect(b), b.connect(w);
11988
+ }), S.connect(w), w.connect(b);
11989
11989
  }
11990
11990
  }, []), l = $((v) => {
11991
11991
  const m = wf(v);
@@ -11997,44 +11997,44 @@ function qb(e = 256) {
11997
11997
  m.parameters.forEach((_) => {
11998
11998
  y[_.name] = _.default;
11999
11999
  });
12000
- const w = jo(m, y);
12001
- o.current.set(w.instanceId, w);
12002
- const b = {
12003
- instanceId: w.instanceId,
12000
+ const b = jo(m, y);
12001
+ o.current.set(b.instanceId, b);
12002
+ const w = {
12003
+ instanceId: b.instanceId,
12004
12004
  effectId: m.id,
12005
12005
  definition: m,
12006
12006
  params: y,
12007
12007
  bypassed: !1
12008
12008
  };
12009
- n((_) => [..._, b]);
12009
+ n((_) => [..._, w]);
12010
12010
  }, []), c = $((v) => {
12011
12011
  const m = o.current.get(v);
12012
- m && (m.dispose(), o.current.delete(v)), n((y) => y.filter((w) => w.instanceId !== v));
12012
+ m && (m.dispose(), o.current.delete(v)), n((y) => y.filter((b) => b.instanceId !== v));
12013
12013
  }, []), u = $(
12014
12014
  (v, m, y) => {
12015
- const w = o.current.get(v);
12016
- w && w.setParameter(m, y), n(
12017
- (b) => b.map(
12015
+ const b = o.current.get(v);
12016
+ b && b.setParameter(m, y), n(
12017
+ (w) => w.map(
12018
12018
  (_) => _.instanceId === v ? { ..._, params: { ..._.params, [m]: y } } : _
12019
12019
  )
12020
12020
  );
12021
12021
  },
12022
12022
  []
12023
12023
  ), f = $((v) => {
12024
- const m = r.current.find((b) => b.instanceId === v);
12024
+ const m = r.current.find((w) => w.instanceId === v);
12025
12025
  if (!m) return;
12026
- const y = !m.bypassed, w = o.current.get(v);
12027
- if (w) {
12028
- const b = m.params.wet ?? 1;
12029
- w.setParameter("wet", y ? 0 : b);
12026
+ const y = !m.bypassed, b = o.current.get(v);
12027
+ if (b) {
12028
+ const w = m.params.wet ?? 1;
12029
+ b.setParameter("wet", y ? 0 : w);
12030
12030
  }
12031
12031
  n(
12032
- (b) => b.map((_) => _.instanceId === v ? { ..._, bypassed: y } : _)
12032
+ (w) => w.map((_) => _.instanceId === v ? { ..._, bypassed: y } : _)
12033
12033
  );
12034
12034
  }, []), p = $((v, m) => {
12035
12035
  n((y) => {
12036
- const w = [...y], [b] = w.splice(v, 1);
12037
- return w.splice(m, 0, b), w;
12036
+ const b = [...y], [w] = b.splice(v, 1);
12037
+ return b.splice(m, 0, w), b;
12038
12038
  });
12039
12039
  }, []), d = $(() => {
12040
12040
  o.current.forEach((v) => v.dispose()), o.current.clear(), n([]);
@@ -12044,23 +12044,23 @@ function qb(e = 256) {
12044
12044
  }, [t, i]);
12045
12045
  const h = $(
12046
12046
  (v, m, y) => {
12047
- const w = new _c("fft", e);
12048
- a.current = w, s.current = {
12047
+ const b = new _c("fft", e);
12048
+ a.current = b, s.current = {
12049
12049
  masterGainNode: v,
12050
12050
  destination: m,
12051
- analyserNode: w
12051
+ analyserNode: b
12052
12052
  };
12053
12053
  const _ = r.current.map((S) => o.current.get(S.instanceId)).filter((S) => S !== void 0);
12054
12054
  if (_.length === 0)
12055
- v.connect(w), w.connect(m);
12055
+ v.connect(b), b.connect(m);
12056
12056
  else {
12057
12057
  let S = v;
12058
12058
  _.forEach((C) => {
12059
12059
  S.connect(C.effect), S = C.effect;
12060
- }), S.connect(w), w.connect(m);
12060
+ }), S.connect(b), b.connect(m);
12061
12061
  }
12062
12062
  return function() {
12063
- w.dispose(), a.current = null, s.current = null;
12063
+ b.dispose(), a.current = null, s.current = null;
12064
12064
  };
12065
12065
  },
12066
12066
  [e]
@@ -12075,22 +12075,22 @@ function qb(e = 256) {
12075
12075
  const g = $(() => {
12076
12076
  const v = t.filter((m) => !m.bypassed);
12077
12077
  if (v.length !== 0)
12078
- return (m, y, w) => {
12079
- const b = [];
12078
+ return (m, y, b) => {
12079
+ const w = [];
12080
12080
  for (const _ of v) {
12081
12081
  const S = jo(_.definition, _.params);
12082
- b.push(S);
12082
+ w.push(S);
12083
12083
  }
12084
- if (b.length === 0)
12084
+ if (w.length === 0)
12085
12085
  m.connect(y);
12086
12086
  else {
12087
12087
  let _ = m;
12088
- b.forEach((S) => {
12088
+ w.forEach((S) => {
12089
12089
  _.connect(S.effect), _ = S.effect;
12090
12090
  }), _.connect(y);
12091
12091
  }
12092
12092
  return function() {
12093
- b.forEach((S) => S.dispose());
12093
+ w.forEach((S) => S.dispose());
12094
12094
  };
12095
12095
  };
12096
12096
  }, [t]);
@@ -12117,15 +12117,15 @@ function Jb() {
12117
12117
  const { graphEnd: v, masterGainNode: m } = g, y = n.current.get(d);
12118
12118
  try {
12119
12119
  v.disconnect();
12120
- } catch (b) {
12121
- console.warn(`[waveform-playlist] Error disconnecting track "${d}" effect chain:`, b);
12120
+ } catch (w) {
12121
+ console.warn(`[waveform-playlist] Error disconnecting track "${d}" effect chain:`, w);
12122
12122
  }
12123
- const w = h.map((b) => y?.get(b.instanceId)).filter((b) => b !== void 0);
12124
- if (w.length === 0)
12123
+ const b = h.map((w) => y?.get(w.instanceId)).filter((w) => w !== void 0);
12124
+ if (b.length === 0)
12125
12125
  v.connect(m);
12126
12126
  else {
12127
- let b = v;
12128
- w.forEach((_) => {
12127
+ let w = v;
12128
+ b.forEach((_) => {
12129
12129
  try {
12130
12130
  _.disconnect();
12131
12131
  } catch (S) {
@@ -12134,8 +12134,8 @@ function Jb() {
12134
12134
  S
12135
12135
  );
12136
12136
  }
12137
- b.connect(_.effect), b = _.effect;
12138
- }), b.connect(m);
12137
+ w.connect(_.effect), w = _.effect;
12138
+ }), w.connect(m);
12139
12139
  }
12140
12140
  }, []), a = $((d, h) => {
12141
12141
  const g = wf(h);
@@ -12144,8 +12144,8 @@ function Jb() {
12144
12144
  return;
12145
12145
  }
12146
12146
  const v = {};
12147
- g.parameters.forEach((w) => {
12148
- v[w.name] = w.default;
12147
+ g.parameters.forEach((b) => {
12148
+ v[b.name] = b.default;
12149
12149
  });
12150
12150
  const m = jo(g, v);
12151
12151
  n.current.has(d) || n.current.set(d, /* @__PURE__ */ new Map()), n.current.get(d).set(m.instanceId, m);
@@ -12156,43 +12156,43 @@ function Jb() {
12156
12156
  params: v,
12157
12157
  bypassed: !1
12158
12158
  };
12159
- t((w) => {
12160
- const b = new Map(w), _ = b.get(d) || [];
12161
- return b.set(d, [..._, y]), b;
12159
+ t((b) => {
12160
+ const w = new Map(b), _ = w.get(d) || [];
12161
+ return w.set(d, [..._, y]), w;
12162
12162
  });
12163
12163
  }, []), s = $((d, h) => {
12164
12164
  const g = n.current.get(d), v = g?.get(h);
12165
12165
  v && (v.dispose(), g?.delete(h)), t((m) => {
12166
- const y = new Map(m), w = y.get(d) || [];
12166
+ const y = new Map(m), b = y.get(d) || [];
12167
12167
  return y.set(
12168
12168
  d,
12169
- w.filter((b) => b.instanceId !== h)
12169
+ b.filter((w) => w.instanceId !== h)
12170
12170
  ), y;
12171
12171
  });
12172
12172
  }, []), i = $(
12173
12173
  (d, h, g, v) => {
12174
12174
  const y = n.current.get(d)?.get(h);
12175
- y && y.setParameter(g, v), t((w) => {
12176
- const b = new Map(w), _ = b.get(d) || [];
12177
- return b.set(
12175
+ y && y.setParameter(g, v), t((b) => {
12176
+ const w = new Map(b), _ = w.get(d) || [];
12177
+ return w.set(
12178
12178
  d,
12179
12179
  _.map(
12180
12180
  (S) => S.instanceId === h ? { ...S, params: { ...S.params, [g]: v } } : S
12181
12181
  )
12182
- ), b;
12182
+ ), w;
12183
12183
  });
12184
12184
  },
12185
12185
  []
12186
12186
  ), l = $((d, h) => {
12187
- const v = (u.current.get(d) || []).find((b) => b.instanceId === h);
12187
+ const v = (u.current.get(d) || []).find((w) => w.instanceId === h);
12188
12188
  if (!v) return;
12189
- const m = !v.bypassed, w = n.current.get(d)?.get(h);
12190
- if (w) {
12191
- const b = v.params.wet ?? 1;
12192
- w.setParameter("wet", m ? 0 : b);
12189
+ const m = !v.bypassed, b = n.current.get(d)?.get(h);
12190
+ if (b) {
12191
+ const w = v.params.wet ?? 1;
12192
+ b.setParameter("wet", m ? 0 : w);
12193
12193
  }
12194
- t((b) => {
12195
- const _ = new Map(b), S = _.get(d) || [];
12194
+ t((w) => {
12195
+ const _ = new Map(w), S = _.get(d) || [];
12196
12196
  return _.set(
12197
12197
  d,
12198
12198
  S.map((C) => C.instanceId === h ? { ...C, bypassed: m } : C)
@@ -12212,14 +12212,14 @@ function Jb() {
12212
12212
  graphEnd: h,
12213
12213
  masterGainNode: g
12214
12214
  });
12215
- const m = u.current.get(d) || [], y = n.current.get(d), w = m.map((b) => y?.get(b.instanceId)).filter((b) => b !== void 0);
12216
- if (w.length === 0)
12215
+ const m = u.current.get(d) || [], y = n.current.get(d), b = m.map((w) => y?.get(w.instanceId)).filter((w) => w !== void 0);
12216
+ if (b.length === 0)
12217
12217
  h.connect(g);
12218
12218
  else {
12219
- let b = h;
12220
- w.forEach((_) => {
12221
- b.connect(_.effect), b = _.effect;
12222
- }), b.connect(g);
12219
+ let w = h;
12220
+ b.forEach((_) => {
12221
+ w.connect(_.effect), w = _.effect;
12222
+ }), w.connect(g);
12223
12223
  }
12224
12224
  return function() {
12225
12225
  r.current.delete(d);
@@ -12245,21 +12245,21 @@ function Jb() {
12245
12245
  const g = (e.get(d) || []).filter((v) => !v.bypassed);
12246
12246
  if (g.length !== 0)
12247
12247
  return (v, m, y) => {
12248
- const w = [];
12249
- for (const b of g) {
12250
- const _ = jo(b.definition, b.params);
12251
- w.push(_);
12248
+ const b = [];
12249
+ for (const w of g) {
12250
+ const _ = jo(w.definition, w.params);
12251
+ b.push(_);
12252
12252
  }
12253
- if (w.length === 0)
12253
+ if (b.length === 0)
12254
12254
  v.connect(m);
12255
12255
  else {
12256
- let b = v;
12257
- w.forEach((_) => {
12258
- b.connect(_.effect), b = _.effect;
12259
- }), b.connect(m);
12256
+ let w = v;
12257
+ b.forEach((_) => {
12258
+ w.connect(_.effect), w = _.effect;
12259
+ }), w.connect(m);
12260
12260
  }
12261
12261
  return function() {
12262
- w.forEach((_) => _.dispose());
12262
+ b.forEach((_) => _.dispose());
12263
12263
  };
12264
12264
  };
12265
12265
  },
@@ -12277,7 +12277,7 @@ function Jb() {
12277
12277
  availableEffects: pa
12278
12278
  };
12279
12279
  }
12280
- function wy(e, t = {}) {
12280
+ function ky(e, t = {}) {
12281
12281
  const { bitDepth: n = 16 } = t, r = e.numberOfChannels, o = e.sampleRate, a = e.length, s = n / 8, i = r * s, l = o * i, c = a * i, u = 44, f = u + c, p = new ArrayBuffer(f), d = new DataView(p);
12282
12282
  bo(d, 0, "RIFF"), d.setUint32(4, f - 8, !0), bo(d, 8, "WAVE"), bo(d, 12, "fmt "), d.setUint32(16, 16, !0), d.setUint16(20, n === 32 ? 3 : 1, !0), d.setUint16(22, r, !0), d.setUint32(24, o, !0), d.setUint32(28, l, !0), d.setUint16(32, i, !0), d.setUint16(34, n, !0), bo(d, 36, "data"), d.setUint32(40, c, !0);
12283
12283
  const h = [];
@@ -12287,8 +12287,8 @@ function wy(e, t = {}) {
12287
12287
  if (n === 16)
12288
12288
  for (let v = 0; v < a; v++)
12289
12289
  for (let m = 0; m < r; m++) {
12290
- const y = h[m][v], w = Math.max(-1, Math.min(1, y)), b = w < 0 ? w * 32768 : w * 32767;
12291
- d.setInt16(g, b, !0), g += 2;
12290
+ const y = h[m][v], b = Math.max(-1, Math.min(1, y)), w = b < 0 ? b * 32768 : b * 32767;
12291
+ d.setInt16(g, w, !0), g += 2;
12292
12292
  }
12293
12293
  else
12294
12294
  for (let v = 0; v < a; v++)
@@ -12300,11 +12300,11 @@ function bo(e, t, n) {
12300
12300
  for (let r = 0; r < n.length; r++)
12301
12301
  e.setUint8(t + r, n.charCodeAt(r));
12302
12302
  }
12303
- function _y(e, t) {
12303
+ function Cy(e, t) {
12304
12304
  const n = URL.createObjectURL(e), r = document.createElement("a");
12305
12305
  r.href = n, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
12306
12306
  }
12307
- function Sy() {
12307
+ function xy() {
12308
12308
  const [e, t] = z(!1), [n, r] = z(0), [o, a] = z(null);
12309
12309
  return {
12310
12310
  exportWav: $(
@@ -12326,23 +12326,23 @@ function Sy() {
12326
12326
  throw new Error("No tracks to export");
12327
12327
  if (f === "individual" && (p === void 0 || p < 0 || p >= i.length))
12328
12328
  throw new Error("Invalid track index for individual export");
12329
- const w = i[0].clips[0]?.sampleRate || 44100;
12330
- let b = 0;
12329
+ const b = i[0].clips[0]?.sampleRate || 44100;
12330
+ let w = 0;
12331
12331
  for (const R of i)
12332
12332
  for (const A of R.clips) {
12333
12333
  const I = A.startSample + A.durationSamples;
12334
- b = Math.max(b, I);
12334
+ w = Math.max(w, I);
12335
12335
  }
12336
- b += Math.round(w * 0.1);
12337
- const _ = b / w, S = f === "individual" ? [{ track: i[p], state: l[p], index: p }] : i.map((R, A) => ({ track: R, state: l[A], index: A })), C = l.some((R) => R.soloed), E = !!v;
12336
+ w += Math.round(b * 0.1);
12337
+ const _ = w / b, S = f === "individual" ? [{ track: i[p], state: l[p], index: p }] : i.map((R, A) => ({ track: R, state: l[A], index: A })), C = l.some((R) => R.soloed), E = !!v;
12338
12338
  let x;
12339
12339
  if ((g || E) && h)
12340
- x = await ky(
12340
+ x = await Ey(
12341
12341
  S,
12342
12342
  l,
12343
12343
  C,
12344
12344
  _,
12345
- w,
12345
+ b,
12346
12346
  g,
12347
12347
  v,
12348
12348
  (R) => {
@@ -12350,32 +12350,32 @@ function Sy() {
12350
12350
  }
12351
12351
  );
12352
12352
  else {
12353
- const R = new OfflineAudioContext(2, b, w);
12353
+ const R = new OfflineAudioContext(2, w, b);
12354
12354
  let A = 0;
12355
12355
  const I = S.reduce((D, { track: F }) => D + F.clips.length, 0);
12356
12356
  for (const { track: D, state: F } of S)
12357
12357
  if (!(F.muted && !F.soloed) && !(C && !F.soloed))
12358
12358
  for (const L of D.clips) {
12359
- await xy(R, L, F, w, h), A++;
12359
+ await Ay(R, L, F, b, h), A++;
12360
12360
  const H = A / I * 0.5;
12361
12361
  r(H), y?.(H);
12362
12362
  }
12363
12363
  r(0.5), y?.(0.5), x = await R.startRendering();
12364
12364
  }
12365
12365
  r(0.9), y?.(0.9);
12366
- const M = wy(x, { bitDepth: m });
12366
+ const M = ky(x, { bitDepth: m });
12367
12367
  if (r(1), y?.(1), d) {
12368
12368
  const R = f === "individual" ? `${u}_${i[p].name}` : u;
12369
- _y(M, `${R}.wav`);
12369
+ Cy(M, `${R}.wav`);
12370
12370
  }
12371
12371
  return {
12372
12372
  audioBuffer: x,
12373
12373
  blob: M,
12374
12374
  duration: _
12375
12375
  };
12376
- } catch (w) {
12377
- const b = w instanceof Error ? w.message : "Export failed";
12378
- throw a(b), w;
12376
+ } catch (b) {
12377
+ const w = b instanceof Error ? b.message : "Export failed";
12378
+ throw a(w), b;
12379
12379
  } finally {
12380
12380
  t(!1);
12381
12381
  }
@@ -12387,7 +12387,7 @@ function Sy() {
12387
12387
  error: o
12388
12388
  };
12389
12389
  }
12390
- async function ky(e, t, n, r, o, a, s, i) {
12390
+ async function Ey(e, t, n, r, o, a, s, i) {
12391
12391
  const { Offline: l, Volume: c, Gain: u, Panner: f, Player: p, ToneAudioBuffer: d } = await import("tone");
12392
12392
  i(0.1);
12393
12393
  let h;
@@ -12397,11 +12397,11 @@ async function ky(e, t, n, r, o, a, s, i) {
12397
12397
  const m = new c(0);
12398
12398
  let y;
12399
12399
  a ? y = a(m, v, !0) : m.connect(v);
12400
- for (const { track: w, state: b } of e) {
12401
- if (b.muted && !b.soloed || n && !b.soloed) continue;
12402
- const _ = new c(Cy(b.volume)), S = new f(b.pan), C = new u(b.muted ? 0 : 1), E = s?.(w.id);
12400
+ for (const { track: b, state: w } of e) {
12401
+ if (w.muted && !w.soloed || n && !w.soloed) continue;
12402
+ const _ = new c(Iy(w.volume)), S = new f(w.pan), C = new u(w.muted ? 0 : 1), E = s?.(b.id);
12403
12403
  E ? E(C, m, !0) : C.connect(m), S.connect(C), _.connect(S);
12404
- for (const x of w.clips) {
12404
+ for (const x of b.clips) {
12405
12405
  const {
12406
12406
  audioBuffer: M,
12407
12407
  startSample: R,
@@ -12434,10 +12434,10 @@ async function ky(e, t, n, r, o, a, s, i) {
12434
12434
  }
12435
12435
  return i(0.9), h.get();
12436
12436
  }
12437
- function Cy(e) {
12437
+ function Iy(e) {
12438
12438
  return 20 * Math.log10(Math.max(e, 1e-4));
12439
12439
  }
12440
- async function xy(e, t, n, r, o) {
12440
+ async function Ay(e, t, n, r, o) {
12441
12441
  const {
12442
12442
  audioBuffer: a,
12443
12443
  startSample: s,
@@ -12456,22 +12456,22 @@ async function xy(e, t, n, r, o) {
12456
12456
  const v = e.createGain(), m = c * n.volume, y = e.createStereoPanner();
12457
12457
  if (y.pan.value = n.pan, g.connect(v), v.connect(y), y.connect(e.destination), o) {
12458
12458
  if (u ? v.gain.setValueAtTime(0, p) : v.gain.setValueAtTime(m, p), u) {
12459
- const w = p, b = p + u.duration;
12459
+ const b = p, w = p + u.duration;
12460
12460
  hc(
12461
12461
  v.gain,
12462
- w,
12463
12462
  b,
12463
+ w,
12464
12464
  0,
12465
12465
  m,
12466
12466
  u.type || "linear"
12467
12467
  );
12468
12468
  }
12469
12469
  if (f) {
12470
- const w = p + d - f.duration, b = p + d;
12471
- (!u || u.duration < d - f.duration) && v.gain.setValueAtTime(m, w), hc(
12470
+ const b = p + d - f.duration, w = p + d;
12471
+ (!u || u.duration < d - f.duration) && v.gain.setValueAtTime(m, b), hc(
12472
12472
  v.gain,
12473
- w,
12474
12473
  b,
12474
+ w,
12475
12475
  m,
12476
12476
  0,
12477
12477
  f.type || "linear"
@@ -12532,7 +12532,7 @@ const _f = () => {
12532
12532
  startAnimationFrameLoop: n,
12533
12533
  stopAnimationFrameLoop: t
12534
12534
  };
12535
- }, Ey = `
12535
+ }, My = `
12536
12536
  "use strict";
12537
12537
 
12538
12538
  var INT8_MAX = 127;
@@ -12680,11 +12680,11 @@ self.onmessage = function(e) {
12680
12680
  }
12681
12681
  };
12682
12682
  `;
12683
- let Iy = 0;
12684
- function Ay() {
12683
+ let Ty = 0;
12684
+ function $y() {
12685
12685
  let e;
12686
12686
  try {
12687
- const r = new Blob([Ey], { type: "application/javascript" }), o = URL.createObjectURL(r);
12687
+ const r = new Blob([My], { type: "application/javascript" }), o = URL.createObjectURL(r);
12688
12688
  e = new Worker(o), URL.revokeObjectURL(o);
12689
12689
  } catch (r) {
12690
12690
  return console.warn("[waveform-playlist] Failed to create peaks worker (CSP restriction?):", r), {
@@ -12704,7 +12704,7 @@ function Ay() {
12704
12704
  a.reject(new Error(o.error));
12705
12705
  else
12706
12706
  try {
12707
- const s = _t.create(o.buffer);
12707
+ const s = kt.create(o.buffer);
12708
12708
  a.resolve(s);
12709
12709
  } catch (s) {
12710
12710
  a.reject(s);
@@ -12717,7 +12717,7 @@ function Ay() {
12717
12717
  }, {
12718
12718
  generate(r) {
12719
12719
  if (n) return Promise.reject(new Error("Worker terminated"));
12720
- const o = String(++Iy);
12720
+ const o = String(++Ty);
12721
12721
  return new Promise((a, s) => {
12722
12722
  t.set(o, { resolve: a, reject: s }), e.postMessage(
12723
12723
  {
@@ -12743,65 +12743,65 @@ function Ay() {
12743
12743
  }
12744
12744
  };
12745
12745
  }
12746
- function My(e, t) {
12747
- const [n, r] = z(() => /* @__PURE__ */ new Map()), [o, a] = z(!1), s = T(null), i = T(/* @__PURE__ */ new WeakMap()), l = T(/* @__PURE__ */ new WeakMap()), c = T(/* @__PURE__ */ new WeakMap()), u = T(0), f = $(() => (s.current || (s.current = Ay()), s.current), []);
12746
+ function Dy(e, t) {
12747
+ const [n, r] = z(() => /* @__PURE__ */ new Map()), [o, a] = z(!1), s = T(null), i = T(/* @__PURE__ */ new WeakMap()), l = T(/* @__PURE__ */ new WeakMap()), c = T(/* @__PURE__ */ new WeakMap()), u = T(0), f = $(() => (s.current || (s.current = $y()), s.current), []);
12748
12748
  return K(() => {
12749
12749
  let p = !1;
12750
12750
  const d = i.current, h = l.current, g = c.current, v = [], m = /* @__PURE__ */ new Map();
12751
- for (const w of e)
12752
- for (const b of w.clips) {
12753
- if (!b.audioBuffer || b.waveformData)
12751
+ for (const b of e)
12752
+ for (const w of b.clips) {
12753
+ if (!w.audioBuffer || w.waveformData)
12754
12754
  continue;
12755
- const _ = d.get(b.audioBuffer);
12755
+ const _ = d.get(w.audioBuffer);
12756
12756
  if (_) {
12757
12757
  v.push({
12758
- clipId: b.id,
12758
+ clipId: w.id,
12759
12759
  waveformData: _
12760
12760
  });
12761
12761
  continue;
12762
12762
  }
12763
- if (h.get(b.audioBuffer)) {
12764
- const C = g.get(b.audioBuffer);
12765
- C ? C.add(b.id) : g.set(b.audioBuffer, /* @__PURE__ */ new Set([b.id]));
12763
+ if (h.get(w.audioBuffer)) {
12764
+ const C = g.get(w.audioBuffer);
12765
+ C ? C.add(w.id) : g.set(w.audioBuffer, /* @__PURE__ */ new Set([w.id]));
12766
12766
  continue;
12767
12767
  }
12768
- const S = m.get(b.audioBuffer);
12769
- S ? S.add(b.id) : m.set(b.audioBuffer, /* @__PURE__ */ new Set([b.id]));
12768
+ const S = m.get(w.audioBuffer);
12769
+ S ? S.add(w.id) : m.set(w.audioBuffer, /* @__PURE__ */ new Set([w.id]));
12770
12770
  }
12771
- if (v.length > 0 && r((w) => {
12772
- const b = new Map(w);
12771
+ if (v.length > 0 && r((b) => {
12772
+ const w = new Map(b);
12773
12773
  for (const _ of v)
12774
- b.set(_.clipId, _.waveformData);
12775
- return b;
12774
+ w.set(_.clipId, _.waveformData);
12775
+ return w;
12776
12776
  }), m.size === 0) return;
12777
12777
  u.current += m.size, a(!0);
12778
12778
  const y = f();
12779
- for (const [w, b] of m) {
12780
- g.set(w, new Set(b));
12779
+ for (const [b, w] of m) {
12780
+ g.set(b, new Set(w));
12781
12781
  const _ = [];
12782
- for (let E = 0; E < w.numberOfChannels; E++)
12783
- _.push(w.getChannelData(E).slice().buffer);
12782
+ for (let E = 0; E < b.numberOfChannels; E++)
12783
+ _.push(b.getChannelData(E).slice().buffer);
12784
12784
  const S = `buffer-${Math.random().toString(36).slice(2, 11)}`, C = y.generate({
12785
12785
  id: S,
12786
12786
  channels: _,
12787
- length: w.length,
12788
- sampleRate: w.sampleRate,
12787
+ length: b.length,
12788
+ sampleRate: b.sampleRate,
12789
12789
  scale: t,
12790
12790
  bits: 16,
12791
12791
  splitChannels: !0
12792
12792
  }).then((E) => {
12793
- d.set(w, E);
12794
- const x = g.get(w) ?? /* @__PURE__ */ new Set();
12795
- g.delete(w), h.delete(w), !p && (r((M) => {
12793
+ d.set(b, E);
12794
+ const x = g.get(b) ?? /* @__PURE__ */ new Set();
12795
+ g.delete(b), h.delete(b), !p && (r((M) => {
12796
12796
  const R = new Map(M);
12797
12797
  for (const A of x)
12798
12798
  R.set(A, E);
12799
12799
  return R;
12800
12800
  }), u.current--, u.current <= 0 && (u.current = 0, a(!1)));
12801
12801
  }).catch((E) => {
12802
- g.delete(w), h.delete(w), !p && (console.warn("[waveform-playlist] Worker peak generation failed:", E), u.current--, u.current <= 0 && (u.current = 0, a(!1)));
12802
+ g.delete(b), h.delete(b), !p && (console.warn("[waveform-playlist] Worker peak generation failed:", E), u.current--, u.current <= 0 && (u.current = 0, a(!1)));
12803
12803
  });
12804
- h.set(w, C);
12804
+ h.set(b, C);
12805
12805
  }
12806
12806
  return () => {
12807
12807
  p = !0, l.current = /* @__PURE__ */ new WeakMap(), c.current = /* @__PURE__ */ new WeakMap(), u.current = 0, a(!1);
@@ -12813,7 +12813,7 @@ function My(e, t) {
12813
12813
  function Is(e) {
12814
12814
  return e instanceof File ? e.name.replace(/\.[^/.]+$/, "") : e instanceof Blob ? "Untitled" : typeof e == "string" ? e.split("/").pop()?.replace(/\.[^/.]+$/, "") ?? "Untitled" : e.name ?? e.src.split("/").pop()?.replace(/\.[^/.]+$/, "") ?? "Untitled";
12815
12815
  }
12816
- async function Ty(e, t, n) {
12816
+ async function Ry(e, t, n) {
12817
12817
  const r = Is(e);
12818
12818
  if (e instanceof Blob) {
12819
12819
  const l = await e.arrayBuffer();
@@ -12847,7 +12847,7 @@ function Qb() {
12847
12847
  const v = new AbortController();
12848
12848
  l.current.set(h.id, v), (async () => {
12849
12849
  try {
12850
- const { audioBuffer: m, name: y } = await Ty(g, p, v.signal), w = Ac({
12850
+ const { audioBuffer: m, name: y } = await Ry(g, p, v.signal), b = Ac({
12851
12851
  audioBuffer: m,
12852
12852
  startTime: 0,
12853
12853
  duration: m.duration,
@@ -12855,11 +12855,11 @@ function Qb() {
12855
12855
  name: y
12856
12856
  });
12857
12857
  !s.current && i.current.has(h.id) && t(
12858
- (b) => b.map((_) => _.id === h.id ? { ..._, name: y, clips: [w] } : _)
12858
+ (w) => w.map((_) => _.id === h.id ? { ..._, name: y, clips: [b] } : _)
12859
12859
  );
12860
12860
  } catch (m) {
12861
12861
  if (m instanceof DOMException && m.name === "AbortError") return;
12862
- console.warn("[waveform-playlist] Error loading audio:", m), !s.current && i.current.has(h.id) && (t((y) => y.filter((w) => w.id !== h.id)), a((y) => [
12862
+ console.warn("[waveform-playlist] Error loading audio:", m), !s.current && i.current.has(h.id) && (t((y) => y.filter((b) => b.id !== h.id)), a((y) => [
12863
12863
  ...y,
12864
12864
  {
12865
12865
  name: Is(g),
@@ -12905,8 +12905,8 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
12905
12905
  progressBarWidth: v,
12906
12906
  onTracksChange: m,
12907
12907
  soundFontCache: y,
12908
- deferEngineRebuild: w = !1,
12909
- children: b
12908
+ deferEngineRebuild: b = !1,
12909
+ children: w
12910
12910
  }) => {
12911
12911
  const _ = v ?? h + g, S = Ce(
12912
12912
  () => a,
@@ -12924,13 +12924,13 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
12924
12924
  return c.annotations;
12925
12925
  }, [c?.annotations]), E = T(C);
12926
12926
  E.current = C;
12927
- const [x, M] = z(null), [R, A] = z(!1), [I, D] = z(0), [F, L] = z(0), [H, Q] = z([]), [q, oe] = z([]), [X, ee] = z([]), [ie, fe] = z(s), [he, De] = z(
12927
+ const [x, M] = z(null), [R, A] = z(!1), [I, D] = z(0), [F, L] = z(0), [H, Q] = z([]), [q, oe] = z([]), [X, ee] = z([]), [ie, fe] = z(s), [he, Re] = z(
12928
12928
  c?.isContinuousPlay ?? !1
12929
12929
  ), [Z, Y] = z(c?.linkEndpoints ?? !1), [_e, G] = z(c?.editable ?? !1), [te, Me] = z(!1), B = T(null), Oe = T(!1), st = T(!1);
12930
12930
  st.current = R;
12931
12931
  const Ge = T(0), ve = T(0), re = T(e), Qe = T(y);
12932
12932
  Qe.current = y;
12933
- const ft = T(X), xe = T(0), Ne = T(0), Ue = T(null), tt = T(null), Dt = T(!1), Jt = T(c?.isContinuousPlay ?? !1), j = T(null), ye = T(null), je = T(0), ze = T(!1), le = T(!1), pe = T(o), Ke = T(44100), { timeFormat: Rt, setTimeFormat: Pt, formatTime: Rn } = ay(), gt = sy({ engineRef: B, initialSamplesPerPixel: o }), { samplesPerPixel: V, onEngineState: J } = gt, ne = iy({ engineRef: B, initialVolume: 1 }), {
12933
+ const ft = T(X), xe = T(0), Ne = T(0), Ue = T(null), tt = T(null), Dt = T(!1), Jt = T(c?.isContinuousPlay ?? !1), j = T(null), ye = T(null), je = T(0), ze = T(!1), le = T(!1), pe = T(o), Ke = T(44100), { timeFormat: Rt, setTimeFormat: Pt, formatTime: Rn } = ay(), yt = sy({ engineRef: B, initialSamplesPerPixel: o }), { samplesPerPixel: V, onEngineState: J } = yt, ne = iy({ engineRef: B, initialVolume: 1 }), {
12934
12934
  masterVolume: ue,
12935
12935
  setMasterVolume: Le,
12936
12936
  masterVolumeRef: qe,
@@ -12939,7 +12939,7 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
12939
12939
  selectionStart: nt,
12940
12940
  selectionEnd: it,
12941
12941
  setSelection: Xe,
12942
- selectionStartRef: vt,
12942
+ selectionStartRef: bt,
12943
12943
  selectionEndRef: Ft,
12944
12944
  onEngineState: fn
12945
12945
  } = ly({ engineRef: B }), {
@@ -12961,14 +12961,14 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
12961
12961
  } = uy({ engineRef: B }), { animationFrameRef: tl, startAnimationFrameLoop: va, stopAnimationFrameLoop: no } = _f(), Yf = Ce(
12962
12962
  () => Math.min(...S ?? [256, 512, 1024, 2048, 4096, 8192]),
12963
12963
  [S]
12964
- ), { cache: nl } = My(e, Yf), rl = $((N) => {
12965
- Jt.current = N, De(N);
12964
+ ), { cache: nl } = Dy(e, Yf), rl = $((N) => {
12965
+ Jt.current = N, Re(N);
12966
12966
  }, []), Gt = $((N) => {
12967
12967
  j.current = N, M(N);
12968
12968
  }, []), ol = $(() => {
12969
- const N = vt.current ?? 0, U = Ft.current ?? 0;
12969
+ const N = bt.current ?? 0, U = Ft.current ?? 0;
12970
12970
  N !== U && U > N && Pn(N, U);
12971
- }, [Pn, vt, Ft]);
12971
+ }, [Pn, bt, Ft]);
12972
12972
  K(() => {
12973
12973
  Dt.current = ie;
12974
12974
  }, [ie]), K(() => {
@@ -12995,7 +12995,7 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
12995
12995
  }), L(W);
12996
12996
  return;
12997
12997
  }
12998
- if (w) {
12998
+ if (b) {
12999
12999
  let W = 0;
13000
13000
  e.forEach((Ee) => {
13001
13001
  Ee.clips.forEach((Te) => {
@@ -13018,28 +13018,28 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13018
13018
  });
13019
13019
  let Ee = 0;
13020
13020
  e.forEach(($e) => {
13021
- $e.clips.forEach((bt) => {
13022
- const en = bt.sampleRate, th = (bt.startSample + bt.durationSamples) / en;
13021
+ $e.clips.forEach((_t) => {
13022
+ const en = _t.sampleRate, th = (_t.startSample + _t.durationSamples) / en;
13023
13023
  Ee = Math.max(Ee, th);
13024
13024
  });
13025
- }), Q(W), L(Ee), ee(($e) => $e.length === e.length ? $e.map((bt, en) => ({
13026
- ...bt,
13025
+ }), Q(W), L(Ee), ee(($e) => $e.length === e.length ? $e.map((_t, en) => ({
13026
+ ..._t,
13027
13027
  name: e[en].name
13028
- })) : e.map((bt) => ({
13029
- name: bt.name,
13030
- muted: bt.muted,
13031
- soloed: bt.soloed,
13032
- volume: bt.volume,
13033
- pan: bt.pan
13028
+ })) : e.map((_t) => ({
13029
+ name: _t.name,
13030
+ muted: _t.muted,
13031
+ soloed: _t.soloed,
13032
+ volume: _t.volume,
13033
+ pan: _t.pan
13034
13034
  }))), B.current && B.current.dispose(), je.current = 0, ye.current = null, Oe.current = !1;
13035
13035
  const Te = Yh({ effects: u, soundFontCache: Qe.current }), Ae = new tp({
13036
13036
  adapter: Te,
13037
13037
  samplesPerPixel: pe.current,
13038
13038
  zoomLevels: S
13039
13039
  });
13040
- Ae.setSelection(vt.current ?? 0, Ft.current ?? 0), Ae.setLoopRegion(Yi.current ?? 0, ji.current ?? 0), Xi.current && Ae.setLoopEnabled(!0), Ae.setMasterVolume(qe.current ?? 1), el.current && Ae.selectTrack(el.current);
13041
- const ao = ft.current, Sa = e.map(($e, bt) => {
13042
- const en = ao[bt];
13040
+ Ae.setSelection(bt.current ?? 0, Ft.current ?? 0), Ae.setLoopRegion(Yi.current ?? 0, ji.current ?? 0), Xi.current && Ae.setLoopEnabled(!0), Ae.setMasterVolume(qe.current ?? 1), el.current && Ae.selectTrack(el.current);
13041
+ const ao = ft.current, Sa = e.map(($e, _t) => {
13042
+ const en = ao[_t];
13043
13043
  return {
13044
13044
  ...$e,
13045
13045
  volume: en?.volume ?? $e.volume,
@@ -13089,14 +13089,14 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13089
13089
  ae,
13090
13090
  m,
13091
13091
  qe,
13092
- vt,
13092
+ bt,
13093
13093
  Ft,
13094
13094
  Yi,
13095
13095
  ji,
13096
13096
  Xi,
13097
13097
  S,
13098
13098
  y,
13099
- w
13099
+ b
13100
13100
  ]), K(() => {
13101
13101
  if (e.length === 0) return;
13102
13102
  const N = e.map((U) => U.clips.map((W) => {
@@ -13129,7 +13129,7 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13129
13129
  }
13130
13130
  }
13131
13131
  if (!Ee) {
13132
- !w && !W.audioBuffer && !W.waveformData && !W.midiNotes && console.warn(
13132
+ !b && !W.audioBuffer && !W.waveformData && !W.midiNotes && console.warn(
13133
13133
  `[waveform-playlist] Clip "${W.id}" has no audio data or waveform data`
13134
13134
  );
13135
13135
  const Te = n ? 1 : W.audioBuffer?.numberOfChannels ?? 1, Ae = W.midiNotes ? Math.ceil(W.durationSamples / V) : 0;
@@ -13153,7 +13153,7 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13153
13153
  };
13154
13154
  }));
13155
13155
  oe(N);
13156
- }, [e, V, n, nl, w]);
13156
+ }, [e, V, n, nl, b]);
13157
13157
  const al = T(!1), Fn = $(() => {
13158
13158
  if (B.current)
13159
13159
  return B.current.getCurrentTime();
@@ -13199,21 +13199,21 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13199
13199
  va(N);
13200
13200
  };
13201
13201
  va(N);
13202
- }, [F, Gt, va, Fn]), yt = no;
13202
+ }, [F, Gt, va, Fn]), wt = no;
13203
13203
  K(() => {
13204
13204
  (async () => {
13205
13205
  if (R && tl.current && B.current)
13206
13206
  if (he) {
13207
13207
  const U = ve.current;
13208
- B.current.stop(), yt();
13208
+ B.current.stop(), wt();
13209
13209
  const W = Lt().currentTime;
13210
13210
  xe.current = W, Ne.current = U, B.current.play(U), pn();
13211
13211
  } else
13212
- yt(), pn();
13212
+ wt(), pn();
13213
13213
  })().catch((U) => {
13214
- console.warn("[waveform-playlist] Failed to reschedule playback:", U), A(!1), yt();
13214
+ console.warn("[waveform-playlist] Failed to reschedule playback:", U), A(!1), wt();
13215
13215
  });
13216
- }, [he, R, pn, yt, tl]), K(() => {
13216
+ }, [he, R, pn, wt, tl]), K(() => {
13217
13217
  (async () => {
13218
13218
  if (ro.current && B.current) {
13219
13219
  const { position: U } = ro.current;
@@ -13222,33 +13222,33 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13222
13222
  xe.current = W, Ne.current = U, Oe.current || (await B.current.init(), Oe.current = !0), B.current.play(U), A(!0), pn();
13223
13223
  }
13224
13224
  })().catch((U) => {
13225
- console.warn("[waveform-playlist] Failed to resume playback after track change:", U), A(!1), yt();
13225
+ console.warn("[waveform-playlist] Failed to resume playback after track change:", U), A(!1), wt();
13226
13226
  });
13227
- }, [e, pn, yt]);
13227
+ }, [e, pn, wt]);
13228
13228
  const oo = $(
13229
13229
  async (N, U) => {
13230
13230
  if (!B.current || F === 0) return;
13231
13231
  const be = N ?? ve.current;
13232
- Ge.current = be, ve.current = be, B.current.stop(), B.current.seek(be), yt();
13232
+ Ge.current = be, ve.current = be, B.current.stop(), B.current.seek(be), wt();
13233
13233
  const Ee = Lt().currentTime;
13234
13234
  xe.current = Ee, Ne.current = be, Ue.current = U !== void 0 ? be + U : null, Oe.current || (await B.current.init(), Oe.current = !0);
13235
13235
  const Te = U !== void 0 ? be + U : void 0;
13236
13236
  try {
13237
13237
  B.current.play(be, Te);
13238
13238
  } catch (Ae) {
13239
- console.warn("[waveform-playlist] Playback failed to start:", Ae), yt();
13239
+ console.warn("[waveform-playlist] Playback failed to start:", Ae), wt();
13240
13240
  return;
13241
13241
  }
13242
13242
  A(!0), pn();
13243
13243
  },
13244
- [F, pn, yt]
13244
+ [F, pn, wt]
13245
13245
  ), sl = $(() => {
13246
13246
  if (!B.current) return;
13247
13247
  const N = Fn();
13248
- B.current.pause(), A(!1), yt(), ve.current = N, D(N);
13249
- }, [yt, Fn]), il = $(() => {
13250
- B.current && (B.current.stop(), A(!1), yt(), ve.current = Ge.current, D(Ge.current), Gt(null));
13251
- }, [yt, Gt]), ll = $(
13248
+ B.current.pause(), A(!1), wt(), ve.current = N, D(N);
13249
+ }, [wt, Fn]), il = $(() => {
13250
+ B.current && (B.current.stop(), A(!1), wt(), ve.current = Ge.current, D(Ge.current), Gt(null));
13251
+ }, [wt, Gt]), ll = $(
13252
13252
  (N) => {
13253
13253
  const U = Math.max(0, Math.min(N, F));
13254
13254
  ve.current = U, D(U), R && B.current && oo(U);
@@ -13382,8 +13382,8 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13382
13382
  setTimeFormat: Pt,
13383
13383
  formatTime: Rn,
13384
13384
  // Zoom
13385
- zoomIn: gt.zoomIn,
13386
- zoomOut: gt.zoomOut,
13385
+ zoomIn: yt.zoomIn,
13386
+ zoomOut: yt.zoomOut,
13387
13387
  // Master volume
13388
13388
  setMasterVolume: Le,
13389
13389
  // Automatic scroll
@@ -13416,8 +13416,8 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13416
13416
  Ji,
13417
13417
  Pt,
13418
13418
  Rn,
13419
- gt.zoomIn,
13420
- gt.zoomOut,
13419
+ yt.zoomIn,
13420
+ yt.zoomOut,
13421
13421
  Le,
13422
13422
  yl,
13423
13423
  pl,
@@ -13448,8 +13448,8 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13448
13448
  samplesPerPixel: V,
13449
13449
  timeFormat: Rt,
13450
13450
  masterVolume: ue,
13451
- canZoomIn: gt.canZoomIn,
13452
- canZoomOut: gt.canZoomOut,
13451
+ canZoomIn: yt.canZoomIn,
13452
+ canZoomOut: yt.canZoomOut,
13453
13453
  barWidth: h,
13454
13454
  barGap: g,
13455
13455
  progressBarWidth: _,
@@ -13473,8 +13473,8 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13473
13473
  V,
13474
13474
  Rt,
13475
13475
  ue,
13476
- gt.canZoomIn,
13477
- gt.canZoomOut,
13476
+ yt.canZoomIn,
13477
+ yt.canZoomOut,
13478
13478
  h,
13479
13479
  g,
13480
13480
  _,
@@ -13484,29 +13484,29 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
13484
13484
  m
13485
13485
  ]
13486
13486
  ), Qf = { ...rf, ...i };
13487
- return /* @__PURE__ */ k(Ec, { theme: Qf, children: /* @__PURE__ */ k(Sf.Provider, { value: jf, children: /* @__PURE__ */ k(kf.Provider, { value: Kf, children: /* @__PURE__ */ k(Cf.Provider, { value: qf, children: /* @__PURE__ */ k(xf.Provider, { value: Jf, children: b }) }) }) }) });
13488
- }, Ct = () => {
13489
- const e = Pe(Sf);
13487
+ return /* @__PURE__ */ k(Ec, { theme: Qf, children: /* @__PURE__ */ k(Sf.Provider, { value: jf, children: /* @__PURE__ */ k(kf.Provider, { value: Kf, children: /* @__PURE__ */ k(Cf.Provider, { value: qf, children: /* @__PURE__ */ k(xf.Provider, { value: Jf, children: w }) }) }) }) });
13488
+ }, Et = () => {
13489
+ const e = Fe(Sf);
13490
13490
  if (!e)
13491
13491
  throw new Error("usePlaybackAnimation must be used within WaveformPlaylistProvider");
13492
13492
  return e;
13493
- }, xt = () => {
13494
- const e = Pe(kf);
13493
+ }, gt = () => {
13494
+ const e = Fe(kf);
13495
13495
  if (!e)
13496
13496
  throw new Error("usePlaylistState must be used within WaveformPlaylistProvider");
13497
13497
  return e;
13498
- }, Fe = () => {
13499
- const e = Pe(Cf);
13498
+ }, De = () => {
13499
+ const e = Fe(Cf);
13500
13500
  if (!e)
13501
13501
  throw new Error("usePlaylistControls must be used within WaveformPlaylistProvider");
13502
13502
  return e;
13503
- }, Et = () => {
13504
- const e = Pe(xf);
13503
+ }, vt = () => {
13504
+ const e = Fe(xf);
13505
13505
  if (!e)
13506
13506
  throw new Error("usePlaylistData must be used within WaveformPlaylistProvider");
13507
13507
  return e;
13508
13508
  };
13509
- var $y = class {
13509
+ var Py = class {
13510
13510
  constructor(e) {
13511
13511
  this._playbackRate = 1, this.handleEnded = () => {
13512
13512
  this.onStopCallback && this.onStopCallback();
@@ -13613,7 +13613,7 @@ var $y = class {
13613
13613
  get element() {
13614
13614
  return this.audioElement;
13615
13615
  }
13616
- }, Dy = class {
13616
+ }, Fy = class {
13617
13617
  constructor(e = {}) {
13618
13618
  this.track = null, this._isPlaying = !1, this._masterVolume = e.masterVolume ?? 1, this._playbackRate = e.playbackRate ?? 1;
13619
13619
  }
@@ -13630,7 +13630,7 @@ var $y = class {
13630
13630
  addTrack(e) {
13631
13631
  return this.track && (console.warn(
13632
13632
  "MediaElementPlayout: Only one track is supported. Disposing previous track. For multi-track, use TonePlayout."
13633
- ), this.track.dispose()), this.track = new $y({
13633
+ ), this.track.dispose()), this.track = new Py({
13634
13634
  ...e,
13635
13635
  volume: this._masterVolume * (e.volume ?? 1),
13636
13636
  playbackRate: this._playbackRate
@@ -13766,7 +13766,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
13766
13766
  onReady: d,
13767
13767
  children: h
13768
13768
  }) => {
13769
- const g = f ?? c + u, [v, m] = z(!1), [y, w] = z(0), [b, _] = z(0), [S, C] = z([]), [E, x] = z(o), M = Ce(() => {
13769
+ const g = f ?? c + u, [v, m] = z(!1), [y, b] = z(0), [w, _] = z(0), [S, C] = z([]), [E, x] = z(o), M = Ce(() => {
13770
13770
  if (!l?.annotations) return [];
13771
13771
  if (process.env.NODE_ENV !== "production" && l.annotations.length > 0) {
13772
13772
  const j = l.annotations[0];
@@ -13780,7 +13780,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
13780
13780
  R.current = M;
13781
13781
  const [A, I] = z(null), [D, F] = z(
13782
13782
  l?.isContinuousPlay ?? !1
13783
- ), [L] = z(t), [H, Q] = z(a), q = T(null), oe = T(0), X = T(D), ee = T(null), ie = T(null), fe = T(a), he = T(t), { startAnimationFrameLoop: De, stopAnimationFrameLoop: Z } = _f();
13783
+ ), [L] = z(t), [H, Q] = z(a), q = T(null), oe = T(0), X = T(D), ee = T(null), ie = T(null), fe = T(a), he = T(t), { startAnimationFrameLoop: Re, stopAnimationFrameLoop: Z } = _f();
13784
13784
  K(() => {
13785
13785
  X.current = D;
13786
13786
  }, [D]), K(() => {
@@ -13794,7 +13794,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
13794
13794
  ie.current = j;
13795
13795
  }, []), te = e.waveformData.sample_rate;
13796
13796
  K(() => {
13797
- const j = new Dy({
13797
+ const j = new Fy({
13798
13798
  playbackRate: o
13799
13799
  });
13800
13800
  j.addTrack({
@@ -13806,7 +13806,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
13806
13806
  return ye && ye.setOnTimeUpdateCallback((je) => {
13807
13807
  oe.current = je;
13808
13808
  }), j.setOnPlaybackComplete(() => {
13809
- Z(), m(!1), Y(null), oe.current = 0, w(0);
13809
+ Z(), m(!1), Y(null), oe.current = 0, b(0);
13810
13810
  }), q.current = j, _(e.waveformData.duration), d?.(), () => {
13811
13811
  Z(), j.dispose();
13812
13812
  };
@@ -13870,10 +13870,10 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
13870
13870
  const ze = ie.current, le = ye * te / he.current, pe = ze.clientWidth, Ke = Math.max(0, le - pe / 2);
13871
13871
  ze.scrollLeft = Ke;
13872
13872
  }
13873
- De(j);
13873
+ Re(j);
13874
13874
  };
13875
- De(j);
13876
- }, [Y, te, De]), B = Z, Oe = $(
13875
+ Re(j);
13876
+ }, [Y, te, Re]), B = Z, Oe = $(
13877
13877
  (j) => {
13878
13878
  if (!q.current) return;
13879
13879
  const ye = j ?? oe.current;
@@ -13881,15 +13881,15 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
13881
13881
  },
13882
13882
  [Me]
13883
13883
  ), st = $(() => {
13884
- q.current && (q.current.pause(), m(!1), B(), w(q.current.getCurrentTime()));
13884
+ q.current && (q.current.pause(), m(!1), B(), b(q.current.getCurrentTime()));
13885
13885
  }, [B]), Ge = $(() => {
13886
- q.current && (q.current.stop(), m(!1), B(), oe.current = 0, w(0), Y(null));
13886
+ q.current && (q.current.stop(), m(!1), B(), oe.current = 0, b(0), Y(null));
13887
13887
  }, [B, Y]), ve = $(
13888
13888
  (j) => {
13889
- const ye = Math.max(0, Math.min(j, b));
13890
- oe.current = ye, w(ye), q.current && q.current.seekTo(ye);
13889
+ const ye = Math.max(0, Math.min(j, w));
13890
+ oe.current = ye, b(ye), q.current && q.current.seekTo(ye);
13891
13891
  },
13892
- [b]
13892
+ [w]
13893
13893
  ), re = $((j) => {
13894
13894
  const ye = Math.max(0.5, Math.min(2, j));
13895
13895
  x(ye), q.current && q.current.setPlaybackRate(ye);
@@ -13952,7 +13952,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
13952
13952
  ]
13953
13953
  ), Dt = Ce(
13954
13954
  () => ({
13955
- duration: b,
13955
+ duration: w,
13956
13956
  peaksDataArray: S,
13957
13957
  sampleRate: te,
13958
13958
  waveHeight: n,
@@ -13965,7 +13965,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
13965
13965
  progressBarWidth: g
13966
13966
  }),
13967
13967
  [
13968
- b,
13968
+ w,
13969
13969
  S,
13970
13970
  te,
13971
13971
  n,
@@ -13979,28 +13979,28 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
13979
13979
  ), Jt = { ...rf, ...s };
13980
13980
  return /* @__PURE__ */ k(Ec, { theme: Jt, children: /* @__PURE__ */ k(Ef.Provider, { value: ft, children: /* @__PURE__ */ k(If.Provider, { value: xe, children: /* @__PURE__ */ k(Af.Provider, { value: tt, children: /* @__PURE__ */ k(Mf.Provider, { value: Dt, children: h }) }) }) }) });
13981
13981
  }, Ni = () => {
13982
- const e = Pe(Ef);
13982
+ const e = Fe(Ef);
13983
13983
  if (!e)
13984
13984
  throw new Error("useMediaElementAnimation must be used within MediaElementPlaylistProvider");
13985
13985
  return e;
13986
13986
  }, zi = () => {
13987
- const e = Pe(If);
13987
+ const e = Fe(If);
13988
13988
  if (!e)
13989
13989
  throw new Error("useMediaElementState must be used within MediaElementPlaylistProvider");
13990
13990
  return e;
13991
13991
  }, Tf = () => {
13992
- const e = Pe(Af);
13992
+ const e = Fe(Af);
13993
13993
  if (!e)
13994
13994
  throw new Error("useMediaElementControls must be used within MediaElementPlaylistProvider");
13995
13995
  return e;
13996
13996
  }, Zi = () => {
13997
- const e = Pe(Mf);
13997
+ const e = Fe(Mf);
13998
13998
  if (!e)
13999
13999
  throw new Error("useMediaElementData must be used within MediaElementPlaylistProvider");
14000
14000
  return e;
14001
14001
  }, n1 = ({ className: e }) => {
14002
- const { isPlaying: t, currentTimeRef: n } = Ct(), { selectionStart: r, selectionEnd: o, isLoopEnabled: a } = xt(), { play: s } = Fe();
14003
- return /* @__PURE__ */ k(kt, { onClick: async () => {
14002
+ const { isPlaying: t, currentTimeRef: n } = Et(), { selectionStart: r, selectionEnd: o, isLoopEnabled: a } = gt(), { play: s } = De();
14003
+ return /* @__PURE__ */ k(xt, { onClick: async () => {
14004
14004
  if (r !== o && o > r && !a) {
14005
14005
  const c = o - r;
14006
14006
  await s(r, c);
@@ -14008,27 +14008,27 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
14008
14008
  await s(n.current ?? 0);
14009
14009
  }, disabled: t, className: e, children: "Play" });
14010
14010
  }, r1 = ({ className: e }) => {
14011
- const { isPlaying: t } = Ct(), { pause: n } = Fe();
14012
- return /* @__PURE__ */ k(kt, { onClick: n, disabled: !t, className: e, children: "Pause" });
14011
+ const { isPlaying: t } = Et(), { pause: n } = De();
14012
+ return /* @__PURE__ */ k(xt, { onClick: n, disabled: !t, className: e, children: "Pause" });
14013
14013
  }, o1 = ({ className: e }) => {
14014
- const { isPlaying: t } = Ct(), { stop: n } = Fe();
14015
- return /* @__PURE__ */ k(kt, { onClick: n, disabled: !t, className: e, children: "Stop" });
14014
+ const { isPlaying: t } = Et(), { stop: n } = De();
14015
+ return /* @__PURE__ */ k(xt, { onClick: n, disabled: !t, className: e, children: "Stop" });
14016
14016
  }, a1 = ({ className: e }) => {
14017
- const { isPlaying: t } = Ct(), { play: n, setCurrentTime: r } = Fe();
14018
- return /* @__PURE__ */ k(kt, { onClick: () => {
14017
+ const { isPlaying: t } = Et(), { play: n, setCurrentTime: r } = De();
14018
+ return /* @__PURE__ */ k(xt, { onClick: () => {
14019
14019
  r(0), t && n(0);
14020
14020
  }, className: e, children: "Rewind" });
14021
14021
  }, s1 = ({ className: e }) => {
14022
- const { isPlaying: t } = Ct(), { play: n, setCurrentTime: r } = Fe(), { duration: o } = Et();
14023
- return /* @__PURE__ */ k(kt, { onClick: () => {
14022
+ const { isPlaying: t } = Et(), { play: n, setCurrentTime: r } = De(), { duration: o } = vt();
14023
+ return /* @__PURE__ */ k(xt, { onClick: () => {
14024
14024
  r(o), t && n(o);
14025
14025
  }, className: e, children: "Fast Forward" });
14026
14026
  }, i1 = ({
14027
14027
  skipAmount: e = 5,
14028
14028
  className: t
14029
14029
  }) => {
14030
- const { currentTimeRef: n, isPlaying: r } = Ct(), { play: o, setCurrentTime: a } = Fe();
14031
- return /* @__PURE__ */ k(kt, { onClick: () => {
14030
+ const { currentTimeRef: n, isPlaying: r } = Et(), { play: o, setCurrentTime: a } = De();
14031
+ return /* @__PURE__ */ k(xt, { onClick: () => {
14032
14032
  const i = Math.max(0, (n.current ?? 0) - e);
14033
14033
  a(i), r && o(i);
14034
14034
  }, className: t, children: "Skip Backward" });
@@ -14036,15 +14036,15 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
14036
14036
  skipAmount: e = 5,
14037
14037
  className: t
14038
14038
  }) => {
14039
- const { currentTimeRef: n, isPlaying: r } = Ct(), { play: o, setCurrentTime: a } = Fe(), { duration: s } = Et();
14040
- return /* @__PURE__ */ k(kt, { onClick: () => {
14039
+ const { currentTimeRef: n, isPlaying: r } = Et(), { play: o, setCurrentTime: a } = De(), { duration: s } = vt();
14040
+ return /* @__PURE__ */ k(xt, { onClick: () => {
14041
14041
  const l = Math.min(s, (n.current ?? 0) + e);
14042
14042
  a(l), r && o(l);
14043
14043
  }, className: t, children: "Skip Forward" });
14044
14044
  }, c1 = ({ className: e }) => {
14045
- const { isLoopEnabled: t, loopStart: n, loopEnd: r } = xt(), { setLoopEnabled: o, setLoopRegion: a } = Fe(), { duration: s } = Et(), i = n !== r && r > n;
14045
+ const { isLoopEnabled: t, loopStart: n, loopEnd: r } = gt(), { setLoopEnabled: o, setLoopRegion: a } = De(), { duration: s } = vt(), i = n !== r && r > n;
14046
14046
  return /* @__PURE__ */ k(
14047
- kt,
14047
+ xt,
14048
14048
  {
14049
14049
  onClick: () => {
14050
14050
  if (!t && !i) {
@@ -14059,9 +14059,9 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
14059
14059
  }
14060
14060
  );
14061
14061
  }, u1 = ({ className: e }) => {
14062
- const { selectionStart: t, selectionEnd: n, loopStart: r, loopEnd: o } = xt(), { setLoopRegionFromSelection: a, clearLoopRegion: s } = Fe(), i = t !== n && n > t, l = r !== o && o > r;
14062
+ const { selectionStart: t, selectionEnd: n, loopStart: r, loopEnd: o } = gt(), { setLoopRegionFromSelection: a, clearLoopRegion: s } = De(), i = t !== n && n > t, l = r !== o && o > r;
14063
14063
  return /* @__PURE__ */ k(
14064
- kt,
14064
+ xt,
14065
14065
  {
14066
14066
  onClick: () => {
14067
14067
  l ? s() : a();
@@ -14077,26 +14077,26 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
14077
14077
  label: t = "Clear All",
14078
14078
  className: n
14079
14079
  }) => {
14080
- const { stop: r } = Fe(), o = $(() => {
14080
+ const { stop: r } = De(), o = $(() => {
14081
14081
  r(), e();
14082
14082
  }, [r, e]);
14083
- return /* @__PURE__ */ k(kt, { onClick: o, className: n, title: "Remove all tracks", children: t });
14083
+ return /* @__PURE__ */ k(xt, { onClick: o, className: n, title: "Remove all tracks", children: t });
14084
14084
  }, f1 = ({
14085
14085
  className: e,
14086
14086
  disabled: t
14087
14087
  }) => {
14088
- const { zoomIn: n } = Fe(), { canZoomIn: r } = Et();
14089
- return /* @__PURE__ */ k(kt, { onClick: n, disabled: t || !r, className: e, children: "Zoom In" });
14088
+ const { zoomIn: n } = De(), { canZoomIn: r } = vt();
14089
+ return /* @__PURE__ */ k(xt, { onClick: n, disabled: t || !r, className: e, children: "Zoom In" });
14090
14090
  }, h1 = ({
14091
14091
  className: e,
14092
14092
  disabled: t
14093
14093
  }) => {
14094
- const { zoomOut: n } = Fe(), { canZoomOut: r } = Et();
14095
- return /* @__PURE__ */ k(kt, { onClick: n, disabled: t || !r, className: e, children: "Zoom Out" });
14094
+ const { zoomOut: n } = De(), { canZoomOut: r } = vt();
14095
+ return /* @__PURE__ */ k(xt, { onClick: n, disabled: t || !r, className: e, children: "Zoom Out" });
14096
14096
  }, p1 = ({ className: e }) => {
14097
- const { masterVolume: t } = Et(), { setMasterVolume: n } = Fe();
14097
+ const { masterVolume: t } = vt(), { setMasterVolume: n } = De();
14098
14098
  return /* @__PURE__ */ k(
14099
- W0,
14099
+ Wv,
14100
14100
  {
14101
14101
  volume: t,
14102
14102
  onChange: n,
@@ -14104,16 +14104,16 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
14104
14104
  }
14105
14105
  );
14106
14106
  }, m1 = ({ className: e }) => {
14107
- const { timeFormat: t } = Et(), { setTimeFormat: n } = Fe();
14108
- return /* @__PURE__ */ k(xv, { value: t, onChange: n, className: e });
14109
- }, Ry = O.span`
14107
+ const { timeFormat: t } = vt(), { setTimeFormat: n } = De();
14108
+ return /* @__PURE__ */ k(x0, { value: t, onChange: n, className: e });
14109
+ }, Oy = O.span`
14110
14110
  font-family: 'Courier New', Monaco, monospace;
14111
14111
  font-size: 1rem;
14112
14112
  font-weight: 600;
14113
14113
  color: ${(e) => e.theme?.textColor || "#333"};
14114
14114
  user-select: none;
14115
14115
  `, g1 = ({ className: e }) => {
14116
- const t = T(null), n = T(null), { isPlaying: r, currentTimeRef: o, getPlaybackTime: a } = Ct(), { timeFormat: s } = Et();
14116
+ const t = T(null), n = T(null), { isPlaying: r, currentTimeRef: o, getPlaybackTime: a } = Et(), { timeFormat: s } = vt();
14117
14117
  return K(() => {
14118
14118
  const i = () => {
14119
14119
  if (t.current) {
@@ -14127,11 +14127,11 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
14127
14127
  };
14128
14128
  }, [r, s, o, a]), K(() => {
14129
14129
  !r && t.current && (t.current.textContent = Xn(o.current ?? 0, s));
14130
- }), /* @__PURE__ */ k(Ry, { ref: t, className: e, "aria-label": "Audio position", children: Xn(o.current ?? 0, s) });
14130
+ }), /* @__PURE__ */ k(Oy, { ref: t, className: e, "aria-label": "Audio position", children: Xn(o.current ?? 0, s) });
14131
14131
  }, v1 = ({ className: e }) => {
14132
- const { selectionStart: t, selectionEnd: n } = xt(), { setSelection: r } = Fe();
14132
+ const { selectionStart: t, selectionEnd: n } = gt(), { setSelection: r } = De();
14133
14133
  return /* @__PURE__ */ k(
14134
- nv,
14134
+ n0,
14135
14135
  {
14136
14136
  selectionStart: t,
14137
14137
  selectionEnd: n,
@@ -14140,9 +14140,9 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
14140
14140
  }
14141
14141
  );
14142
14142
  }, y1 = ({ className: e }) => {
14143
- const { isAutomaticScroll: t } = xt(), { setAutomaticScroll: n } = Fe();
14143
+ const { isAutomaticScroll: t } = gt(), { setAutomaticScroll: n } = De();
14144
14144
  return /* @__PURE__ */ k(
14145
- h0,
14145
+ hv,
14146
14146
  {
14147
14147
  checked: t,
14148
14148
  onChange: n,
@@ -14151,7 +14151,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
14151
14151
  );
14152
14152
  }, ma = Ve(null), b1 = ma.Provider;
14153
14153
  function lr() {
14154
- const e = Pe(ma);
14154
+ const e = Fe(ma);
14155
14155
  if (!e)
14156
14156
  throw new Error(
14157
14157
  "useAnnotationIntegration must be used within <AnnotationProvider>. Install @waveform-playlist/annotations and wrap your app with <AnnotationProvider>. See: https://waveform-playlist.naomiaro.com/docs/guides/annotations"
@@ -14159,19 +14159,19 @@ function lr() {
14159
14159
  return e;
14160
14160
  }
14161
14161
  const w1 = ({ className: e }) => {
14162
- const { ContinuousPlayCheckbox: t } = lr(), { continuousPlay: n } = xt(), { setContinuousPlay: r } = Fe();
14162
+ const { ContinuousPlayCheckbox: t } = lr(), { continuousPlay: n } = gt(), { setContinuousPlay: r } = De();
14163
14163
  return /* @__PURE__ */ k(t, { checked: n, onChange: r, className: e });
14164
14164
  }, _1 = ({ className: e }) => {
14165
- const { LinkEndpointsCheckbox: t } = lr(), { linkEndpoints: n } = xt(), { setLinkEndpoints: r } = Fe();
14165
+ const { LinkEndpointsCheckbox: t } = lr(), { linkEndpoints: n } = gt(), { setLinkEndpoints: r } = De();
14166
14166
  return /* @__PURE__ */ k(t, { checked: n, onChange: r, className: e });
14167
14167
  }, S1 = ({ className: e }) => {
14168
- const { EditableCheckbox: t } = lr(), { annotationsEditable: n } = xt(), { setAnnotationsEditable: r } = Fe();
14168
+ const { EditableCheckbox: t } = lr(), { annotationsEditable: n } = gt(), { setAnnotationsEditable: r } = De();
14169
14169
  return /* @__PURE__ */ k(t, { checked: n, onChange: r, className: e });
14170
14170
  }, k1 = ({
14171
14171
  filename: e,
14172
14172
  className: t
14173
14173
  }) => {
14174
- const { DownloadAnnotationsButton: n } = lr(), { annotations: r } = xt();
14174
+ const { DownloadAnnotationsButton: n } = lr(), { annotations: r } = gt();
14175
14175
  return /* @__PURE__ */ k(n, { annotations: r, filename: e, className: t });
14176
14176
  }, C1 = ({
14177
14177
  label: e = "Export WAV",
@@ -14186,7 +14186,7 @@ const w1 = ({ className: e }) => {
14186
14186
  onExportComplete: c,
14187
14187
  onExportError: u
14188
14188
  }) => {
14189
- const { tracks: f, trackStates: p } = Et(), { exportWav: d, isExporting: h, progress: g } = Sy(), v = async () => {
14189
+ const { tracks: f, trackStates: p } = vt(), { exportWav: d, isExporting: h, progress: g } = xy(), v = async () => {
14190
14190
  try {
14191
14191
  const y = await d(f, p, {
14192
14192
  filename: t,
@@ -14204,7 +14204,7 @@ const w1 = ({ className: e }) => {
14204
14204
  }
14205
14205
  }, m = h ? `Exporting ${Math.round(g * 100)}%` : e;
14206
14206
  return /* @__PURE__ */ k(
14207
- kt,
14207
+ xt,
14208
14208
  {
14209
14209
  onClick: v,
14210
14210
  disabled: h || f.length === 0,
@@ -14212,11 +14212,11 @@ const w1 = ({ className: e }) => {
14212
14212
  children: m
14213
14213
  }
14214
14214
  );
14215
- }, $f = Ve(!1), Py = $f.Provider;
14216
- function Fy() {
14217
- return Pe($f);
14215
+ }, $f = Ve(!1), Ly = $f.Provider;
14216
+ function By() {
14217
+ return Fe($f);
14218
14218
  }
14219
- const Oy = O.div.attrs((e) => ({
14219
+ const Wy = O.div.attrs((e) => ({
14220
14220
  style: {
14221
14221
  width: `${e.$width}px`,
14222
14222
  background: e.$color
@@ -14229,8 +14229,8 @@ const Oy = O.div.attrs((e) => ({
14229
14229
  z-index: 100; /* Below sticky controls (z-index: 101) so playhead is hidden when scrolled behind controls */
14230
14230
  pointer-events: none;
14231
14231
  will-change: transform;
14232
- `, Ly = ({ color: e = "#ff0000" }) => {
14233
- const t = T(null), n = T(null), { isPlaying: r, currentTimeRef: o, getPlaybackTime: a } = Ct(), { samplesPerPixel: s, sampleRate: i, progressBarWidth: l } = Et();
14232
+ `, Vy = ({ color: e = "#ff0000" }) => {
14233
+ const t = T(null), n = T(null), { isPlaying: r, currentTimeRef: o, getPlaybackTime: a } = Et(), { samplesPerPixel: s, sampleRate: i, progressBarWidth: l } = vt();
14234
14234
  return K(() => {
14235
14235
  const c = () => {
14236
14236
  if (t.current) {
@@ -14247,8 +14247,8 @@ const Oy = O.div.attrs((e) => ({
14247
14247
  const u = (o.current ?? 0) * i / s;
14248
14248
  t.current.style.transform = `translate3d(${u}px, 0, 0)`;
14249
14249
  }
14250
- }), /* @__PURE__ */ k(Oy, { ref: t, $color: e, $width: l, "data-playhead": !0 });
14251
- }, By = O.div`
14250
+ }), /* @__PURE__ */ k(Wy, { ref: t, $color: e, $width: l, "data-playhead": !0 });
14251
+ }, Ny = O.div`
14252
14252
  position: relative;
14253
14253
  `, La = O.div.attrs((e) => ({
14254
14254
  style: {
@@ -14264,7 +14264,7 @@ const Oy = O.div.attrs((e) => ({
14264
14264
  /* Force GPU compositing layer to prevent gradient flickering during scroll */
14265
14265
  transform: translateZ(0);
14266
14266
  backface-visibility: hidden;
14267
- `, Wy = O.div.attrs((e) => ({
14267
+ `, zy = O.div.attrs((e) => ({
14268
14268
  style: {
14269
14269
  top: `${e.$top}px`,
14270
14270
  height: `${e.$height}px`,
@@ -14280,7 +14280,7 @@ const Oy = O.div.attrs((e) => ({
14280
14280
  transform-origin: left;
14281
14281
  /* scaleX changes are composite-only (GPU) — no layout reflow per frame */
14282
14282
  will-change: transform;
14283
- `, Vy = O.div`
14283
+ `, Zy = O.div`
14284
14284
  position: relative;
14285
14285
  z-index: 2;
14286
14286
  `, mc = ({
@@ -14291,7 +14291,7 @@ const Oy = O.div.attrs((e) => ({
14291
14291
  clipOffsetSeconds: o,
14292
14292
  ...a
14293
14293
  }) => {
14294
- const s = T(null), i = T(null), l = Qr(), { waveHeight: c } = fa(), { isPlaying: u, currentTimeRef: f, getPlaybackTime: p } = Ct(), { samplesPerPixel: d, sampleRate: h } = Et(), g = l?.waveProgressColor || "rgba(0, 0, 0, 0.1)", v = $c(
14294
+ const s = T(null), i = T(null), l = Qr(), { waveHeight: c } = fa(), { isPlaying: u, currentTimeRef: f, getPlaybackTime: p } = Et(), { samplesPerPixel: d, sampleRate: h } = vt(), g = l?.waveProgressColor || "rgba(0, 0, 0, 0.1)", v = $c(
14295
14295
  e,
14296
14296
  t,
14297
14297
  d
@@ -14326,8 +14326,8 @@ const Oy = O.div.attrs((e) => ({
14326
14326
  const m = l?.waveformDrawMode || "inverted";
14327
14327
  let y;
14328
14328
  m === "inverted" ? y = a.isSelected && l ? l.selectedWaveFillColor : l?.waveFillColor || "white" : y = a.isSelected && l ? l.selectedWaveOutlineColor : l?.waveOutlineColor || "grey";
14329
- const w = a.renderMode === "spectrogram" || a.renderMode === "both", b = a.renderMode === "piano-roll", _ = a.renderMode === "both", S = w ? "#000" : b ? l?.pianoRollBackgroundColor || "#1a1a2e" : cn(y), C = Math.floor(c / 2), E = c, x = a.index * c, M = cn(y);
14330
- return /* @__PURE__ */ me(By, { children: [
14329
+ const b = a.renderMode === "spectrogram" || a.renderMode === "both", w = a.renderMode === "piano-roll", _ = a.renderMode === "both", S = b ? "#000" : w ? l?.pianoRollBackgroundColor || "#1a1a2e" : cn(y), C = Math.floor(c / 2), E = c, x = a.index * c, M = cn(y);
14330
+ return /* @__PURE__ */ me(Ny, { children: [
14331
14331
  _ ? /* @__PURE__ */ me(zt, { children: [
14332
14332
  /* @__PURE__ */ k(
14333
14333
  La,
@@ -14356,8 +14356,8 @@ const Oy = O.div.attrs((e) => ({
14356
14356
  $width: a.length
14357
14357
  }
14358
14358
  ),
14359
- !b && /* @__PURE__ */ k(
14360
- Wy,
14359
+ !w && /* @__PURE__ */ k(
14360
+ zy,
14361
14361
  {
14362
14362
  ref: s,
14363
14363
  $color: g,
@@ -14366,7 +14366,7 @@ const Oy = O.div.attrs((e) => ({
14366
14366
  $width: v
14367
14367
  }
14368
14368
  ),
14369
- /* @__PURE__ */ k(Vy, { children: /* @__PURE__ */ k(
14369
+ /* @__PURE__ */ k(Zy, { children: /* @__PURE__ */ k(
14370
14370
  pf,
14371
14371
  {
14372
14372
  ...a,
@@ -14379,14 +14379,14 @@ const Oy = O.div.attrs((e) => ({
14379
14379
  ] });
14380
14380
  }, Hi = Ve(null), x1 = Hi.Provider;
14381
14381
  function E1() {
14382
- const e = Pe(Hi);
14382
+ const e = Fe(Hi);
14383
14383
  if (!e)
14384
14384
  throw new Error(
14385
14385
  "useSpectrogramIntegration must be used within <SpectrogramProvider>. Install @waveform-playlist/spectrogram and wrap your app with <SpectrogramProvider>."
14386
14386
  );
14387
14387
  return e;
14388
14388
  }
14389
- const Ny = 60, zy = O.div.attrs((e) => ({
14389
+ const Hy = 60, Gy = O.div.attrs((e) => ({
14390
14390
  style: { height: `${e.$height}px` }
14391
14391
  }))`
14392
14392
  overflow: hidden;
@@ -14394,7 +14394,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14394
14394
  background: ${(e) => e.theme.surfaceColor};
14395
14395
  transition: background 0.15s ease-in-out;
14396
14396
  ${(e) => e.$isSelected && `background: ${e.theme.selectedTrackControlsBackground};`}
14397
- `, Zy = ({
14397
+ `, Uy = ({
14398
14398
  renderTrackControls: e,
14399
14399
  renderTick: t,
14400
14400
  renderPlayhead: n,
@@ -14414,10 +14414,10 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14414
14414
  playbackStartTimeRef: g,
14415
14415
  audioStartPositionRef: v,
14416
14416
  getPlaybackTime: m
14417
- } = Ct(), {
14417
+ } = Et(), {
14418
14418
  selectionStart: y,
14419
- selectionEnd: w,
14420
- annotations: b,
14419
+ selectionEnd: b,
14420
+ annotations: w,
14421
14421
  activeAnnotationId: _,
14422
14422
  annotationsEditable: S,
14423
14423
  linkEndpoints: C,
@@ -14426,7 +14426,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14426
14426
  loopStart: M,
14427
14427
  loopEnd: R,
14428
14428
  isLoopEnabled: A
14429
- } = xt(), I = Pe(ma), {
14429
+ } = gt(), I = Fe(ma), {
14430
14430
  setAnnotations: D,
14431
14431
  setActiveAnnotationId: F,
14432
14432
  setTrackMute: L,
@@ -14439,8 +14439,8 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14439
14439
  setSelectedTrackId: ie,
14440
14440
  setCurrentTime: fe,
14441
14441
  setLoopRegion: he
14442
- } = Fe(), {
14443
- peaksDataArray: De,
14442
+ } = De(), {
14443
+ peaksDataArray: Re,
14444
14444
  trackStates: Z,
14445
14445
  tracks: Y,
14446
14446
  duration: _e,
@@ -14452,7 +14452,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14452
14452
  barWidth: st,
14453
14453
  barGap: Ge,
14454
14454
  isReady: ve
14455
- } = Et(), re = Pe(Hi), Qe = Ce(() => {
14455
+ } = vt(), re = Fe(Hi), Qe = Ce(() => {
14456
14456
  if (!re)
14457
14457
  return /* @__PURE__ */ new Map();
14458
14458
  const V = /* @__PURE__ */ new Map();
@@ -14484,7 +14484,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14484
14484
  const Le = (ue.startSample + ue.durationSamples) / ue.sampleRate;
14485
14485
  return Math.max(ne, Le);
14486
14486
  }, V), 0);
14487
- let je = ye > 0 ? ye : _e > 0 ? _e : Ny;
14487
+ let je = ye > 0 ? ye : _e > 0 ? _e : Hy;
14488
14488
  if (f?.isRecording) {
14489
14489
  const J = (f.startSample + f.durationSamples) / te;
14490
14490
  je = Math.max(je, J + 10);
@@ -14512,8 +14512,8 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14512
14512
  ), Ke = (V) => {
14513
14513
  const J = V.currentTarget.getBoundingClientRect(), ue = (V.clientX - J.left) * G / te, qe = V.clientY - J.top;
14514
14514
  let ae = 0, nt = -1;
14515
- for (let it = 0; it < De.length; it++) {
14516
- const Xe = De[it], vt = Xe.length > 0 ? Math.max(1, ...Xe.map((Qt) => Qt.peaks.data.length)) : 1, hn = ((re?.trackSpectrogramOverrides.get(Y[it]?.id)?.renderMode ?? Y[it]?.renderMode ?? "waveform") === "both" ? vt * 2 : vt) * Me + (s ? 22 : 0);
14515
+ for (let it = 0; it < Re.length; it++) {
14516
+ const Xe = Re[it], bt = Xe.length > 0 ? Math.max(1, ...Xe.map((Qt) => Qt.peaks.data.length)) : 1, hn = ((re?.trackSpectrogramOverrides.get(Y[it]?.id)?.renderMode ?? Y[it]?.renderMode ?? "waveform") === "both" ? bt * 2 : bt) * Me + (s ? 22 : 0);
14517
14517
  if (qe >= ae && qe < ae + hn) {
14518
14518
  nt = it;
14519
14519
  break;
@@ -14535,9 +14535,9 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14535
14535
  const J = V.currentTarget.getBoundingClientRect(), ue = (V.clientX - J.left) * G / te, Le = Math.min(y, ue), qe = Math.max(y, ue);
14536
14536
  Math.abs(qe - Le) < 0.1 ? fe(Le) : oe(Le, qe);
14537
14537
  };
14538
- if (Y.some((V) => V.clips.length > 0) && De.length === 0)
14538
+ if (Y.some((V) => V.clips.length > 0) && Re.length === 0)
14539
14539
  return /* @__PURE__ */ k("div", { className: a, children: "Loading waveform..." });
14540
- const gt = Oe.show ? De.map((V, J) => {
14540
+ const yt = Oe.show ? Re.map((V, J) => {
14541
14541
  const ne = Y[J];
14542
14542
  if (!ne) return null;
14543
14543
  const ue = Z[J] || {
@@ -14546,10 +14546,10 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14546
14546
  soloed: !1,
14547
14547
  volume: 1,
14548
14548
  pan: 0
14549
- }, Le = ne.clips.some((Xe) => Xe.midiNotes && Xe.midiNotes.length > 0), qe = re?.trackSpectrogramOverrides.get(ne.id)?.renderMode ?? ne.renderMode ?? (Le ? "piano-roll" : "waveform"), ae = V.length > 0 ? Math.max(1, ...V.map((Xe) => Xe.peaks.data.length)) : 1, nt = Me * ae + (s ? Bi : 0), it = e ? e(J) : /* @__PURE__ */ me($v, { onClick: () => pe(J), children: [
14550
- /* @__PURE__ */ me(Dv, { style: { justifyContent: "center", position: "relative" }, children: [
14549
+ }, Le = ne.clips.some((Xe) => Xe.midiNotes && Xe.midiNotes.length > 0), qe = re?.trackSpectrogramOverrides.get(ne.id)?.renderMode ?? ne.renderMode ?? (Le ? "piano-roll" : "waveform"), ae = V.length > 0 ? Math.max(1, ...V.map((Xe) => Xe.peaks.data.length)) : 1, nt = Me * ae + (s ? Bi : 0), it = e ? e(J) : /* @__PURE__ */ me($0, { onClick: () => pe(J), children: [
14550
+ /* @__PURE__ */ me(D0, { style: { justifyContent: "center", position: "relative" }, children: [
14551
14551
  u && /* @__PURE__ */ k(
14552
- Tv,
14552
+ T0,
14553
14553
  {
14554
14554
  onClick: (Xe) => {
14555
14555
  Xe.stopPropagation(), u(J);
@@ -14570,18 +14570,18 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14570
14570
  }
14571
14571
  ),
14572
14572
  re?.renderMenuItems && /* @__PURE__ */ k("span", { style: { position: "absolute", right: 0, top: 0 }, children: /* @__PURE__ */ k(
14573
- Vv,
14573
+ V0,
14574
14574
  {
14575
14575
  items: (Xe) => re.renderMenuItems({
14576
14576
  renderMode: qe,
14577
- onRenderModeChange: (vt) => re.setTrackRenderMode(ne.id, vt),
14577
+ onRenderModeChange: (bt) => re.setTrackRenderMode(ne.id, bt),
14578
14578
  onOpenSettings: () => Ne(ne.id),
14579
14579
  onClose: Xe
14580
14580
  })
14581
14581
  }
14582
14582
  ) })
14583
14583
  ] }),
14584
- /* @__PURE__ */ me(Av, { children: [
14584
+ /* @__PURE__ */ me(A0, { children: [
14585
14585
  /* @__PURE__ */ k(
14586
14586
  cc,
14587
14587
  {
@@ -14600,7 +14600,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14600
14600
  )
14601
14601
  ] }),
14602
14602
  /* @__PURE__ */ me(dc, { children: [
14603
- /* @__PURE__ */ k(Rv, {}),
14603
+ /* @__PURE__ */ k(R0, {}),
14604
14604
  /* @__PURE__ */ k(
14605
14605
  uc,
14606
14606
  {
@@ -14611,7 +14611,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14611
14611
  onChange: (Xe) => Q(J, parseFloat(Xe.target.value))
14612
14612
  }
14613
14613
  ),
14614
- /* @__PURE__ */ k(Pv, {})
14614
+ /* @__PURE__ */ k(P0, {})
14615
14615
  ] }),
14616
14616
  /* @__PURE__ */ me(dc, { children: [
14617
14617
  /* @__PURE__ */ k("span", { children: "L" }),
@@ -14629,7 +14629,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14629
14629
  ] })
14630
14630
  ] });
14631
14631
  return /* @__PURE__ */ k(
14632
- zy,
14632
+ Gy,
14633
14633
  {
14634
14634
  $height: nt,
14635
14635
  $isSelected: ne.id === x,
@@ -14668,12 +14668,12 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14668
14668
  scrollContainerRef: j,
14669
14669
  isSelecting: Ue,
14670
14670
  "data-playlist-state": ve ? "ready" : "loading",
14671
- trackControlsSlots: gt,
14671
+ trackControlsSlots: yt,
14672
14672
  timescaleGapHeight: B > 0 ? B + 1 : 0,
14673
14673
  timescale: B > 0 ? /* @__PURE__ */ me(zt, { children: [
14674
14674
  /* @__PURE__ */ k(mf, { renderTick: t }),
14675
14675
  A && /* @__PURE__ */ k(
14676
- tv,
14676
+ t0,
14677
14677
  {
14678
14678
  startPosition: Math.min(M, R) * te / G,
14679
14679
  endPosition: Math.max(M, R) * te / G,
@@ -14689,7 +14689,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14689
14689
  )
14690
14690
  ] }) : void 0,
14691
14691
  children: /* @__PURE__ */ me(zt, { children: [
14692
- De.map((V, J) => {
14692
+ Re.map((V, J) => {
14693
14693
  const ne = Y[J];
14694
14694
  if (!ne) return null;
14695
14695
  const ue = ne.clips.some((ae) => ae.midiNotes && ae.midiNotes.length > 0), Le = re?.trackSpectrogramOverrides.get(ne.id)?.renderMode ?? ne.renderMode ?? (ue ? "piano-roll" : "waveform"), qe = V.length > 0 ? Math.max(1, ...V.map((ae) => ae.peaks.data.length)) : 1;
@@ -14707,7 +14707,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14707
14707
  Le !== "waveform" && (() => {
14708
14708
  const ae = Qe.get(ne.id), nt = ae?.config;
14709
14709
  return !nt?.labels || !ae ? null : /* @__PURE__ */ k(
14710
- gv,
14710
+ g0,
14711
14711
  {
14712
14712
  waveHeight: Me,
14713
14713
  numChannels: qe,
@@ -14742,18 +14742,18 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14742
14742
  sampleRate: te,
14743
14743
  showFades: l,
14744
14744
  touchOptimized: c,
14745
- onMouseDown: (vt) => {
14746
- vt.target.closest(
14745
+ onMouseDown: (bt) => {
14746
+ bt.target.closest(
14747
14747
  '[role="button"][aria-roledescription="draggable"]'
14748
14748
  ) || pe(J);
14749
14749
  },
14750
- children: it.data.map((vt, Ft) => {
14750
+ children: it.data.map((bt, Ft) => {
14751
14751
  const fn = re?.spectrogramDataMap.get(ae.clipId), hn = fn?.[Ft] ?? fn?.[0], Qt = Qe.get(ne.id), cr = Qt?.config;
14752
14752
  return /* @__PURE__ */ k(
14753
14753
  mc,
14754
14754
  {
14755
14755
  index: Ft,
14756
- data: vt,
14756
+ data: bt,
14757
14757
  bits: it.bits,
14758
14758
  length: Xe,
14759
14759
  isSelected: ne.id === x,
@@ -14822,7 +14822,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14822
14822
  ne.id
14823
14823
  );
14824
14824
  }),
14825
- b.length > 0 && I && /* @__PURE__ */ k(I.AnnotationBoxesWrapper, { height: 30, width: ze, children: b.map((V, J) => {
14825
+ w.length > 0 && I && /* @__PURE__ */ k(I.AnnotationBoxesWrapper, { height: 30, width: ze, children: w.map((V, J) => {
14826
14826
  const ne = V.start * te / G, ue = V.end * te / G, Le = o ? o(V, J) : V.id;
14827
14827
  return /* @__PURE__ */ k(
14828
14828
  I.AnnotationBox,
@@ -14840,15 +14840,15 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14840
14840
  V.id
14841
14841
  );
14842
14842
  }) }),
14843
- y !== w && /* @__PURE__ */ k(
14843
+ y !== b && /* @__PURE__ */ k(
14844
14844
  cf,
14845
14845
  {
14846
- startPosition: Math.min(y, w) * te / G,
14847
- endPosition: Math.max(y, w) * te / G,
14846
+ startPosition: Math.min(y, b) * te / G,
14847
+ endPosition: Math.max(y, b) * te / G,
14848
14848
  color: p.selectionColor
14849
14849
  }
14850
14850
  ),
14851
- (d || y === w) && (n ? n({
14851
+ (d || y === b) && (n ? n({
14852
14852
  position: (h.current ?? 0) * te / G,
14853
14853
  color: p.playheadColor,
14854
14854
  isPlaying: d,
@@ -14860,7 +14860,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14860
14860
  controlsOffset: 0,
14861
14861
  getAudioContextTime: () => Lt().currentTime,
14862
14862
  getPlaybackTime: m
14863
- }) : /* @__PURE__ */ k(Ly, { color: p.playheadColor }))
14863
+ }) : /* @__PURE__ */ k(Vy, { color: p.playheadColor }))
14864
14864
  ] })
14865
14865
  }
14866
14866
  )
@@ -14882,7 +14882,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14882
14882
  document.body
14883
14883
  )
14884
14884
  ] });
14885
- }, Hy = ({
14885
+ }, Xy = ({
14886
14886
  height: e,
14887
14887
  renderAnnotationItem: t,
14888
14888
  onAnnotationUpdate: n,
@@ -14891,7 +14891,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14891
14891
  scrollActivePosition: a = "center",
14892
14892
  scrollActiveContainer: s = "nearest"
14893
14893
  }) => {
14894
- const { annotations: i, activeAnnotationId: l, annotationsEditable: c, linkEndpoints: u, continuousPlay: f } = xt(), p = lr(), { setAnnotations: d } = Fe(), h = o ?? { linkEndpoints: u, continuousPlay: f }, g = $(
14894
+ const { annotations: i, activeAnnotationId: l, annotationsEditable: c, linkEndpoints: u, continuousPlay: f } = gt(), p = lr(), { setAnnotations: d } = De(), h = o ?? { linkEndpoints: u, continuousPlay: f }, g = $(
14895
14895
  (m) => {
14896
14896
  d(m), n?.(m);
14897
14897
  },
@@ -14933,10 +14933,10 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14933
14933
  onRemoveTrack: v,
14934
14934
  recordingState: m
14935
14935
  }) => {
14936
- const { annotations: y } = xt(), w = Fy();
14936
+ const { annotations: y } = gt(), b = By();
14937
14937
  return /* @__PURE__ */ me(zt, { children: [
14938
14938
  /* @__PURE__ */ k(
14939
- Zy,
14939
+ Uy,
14940
14940
  {
14941
14941
  renderTrackControls: e,
14942
14942
  renderTick: t ?? (n ? (_, S) => n(parseFloat(_) || 0, S) : void 0),
@@ -14945,7 +14945,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14945
14945
  getAnnotationBoxLabel: l,
14946
14946
  className: f,
14947
14947
  showClipHeaders: p,
14948
- interactiveClips: d || w,
14948
+ interactiveClips: d || b,
14949
14949
  showFades: h,
14950
14950
  touchOptimized: g,
14951
14951
  onRemoveTrack: v,
@@ -14953,7 +14953,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14953
14953
  }
14954
14954
  ),
14955
14955
  y.length > 0 && /* @__PURE__ */ k(
14956
- Hy,
14956
+ Xy,
14957
14957
  {
14958
14958
  height: s,
14959
14959
  renderAnnotationItem: i,
@@ -14965,7 +14965,7 @@ const Ny = 60, zy = O.div.attrs((e) => ({
14965
14965
  )
14966
14966
  ] });
14967
14967
  };
14968
- var Gy = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", Df = Gy ? Nr : K;
14968
+ var Yy = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", Df = Yy ? Nr : K;
14969
14969
  function Bn(e) {
14970
14970
  const t = T(e);
14971
14971
  return Df(() => {
@@ -14979,17 +14979,17 @@ function Ba(e, t, n = K, r = Object.is) {
14979
14979
  r(e, a) || (o.current = e, t(e, a));
14980
14980
  }, [t, e]);
14981
14981
  }
14982
- var gc = Object.getOwnPropertySymbols, Uy = Object.prototype.hasOwnProperty, Xy = Object.prototype.propertyIsEnumerable, Yy = (e, t) => {
14982
+ var gc = Object.getOwnPropertySymbols, jy = Object.prototype.hasOwnProperty, Ky = Object.prototype.propertyIsEnumerable, qy = (e, t) => {
14983
14983
  var n = {};
14984
14984
  for (var r in e)
14985
- Uy.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
14985
+ jy.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
14986
14986
  if (e != null && gc)
14987
14987
  for (var r of gc(e))
14988
- t.indexOf(r) < 0 && Xy.call(e, r) && (n[r] = e[r]);
14988
+ t.indexOf(r) < 0 && Ky.call(e, r) && (n[r] = e[r]);
14989
14989
  return n;
14990
- }, jy = new Mi(), Ky = Ve(
14991
- jy
14992
- ), qy = Sc(
14990
+ }, Jy = new Mi(), Qy = Ve(
14991
+ Jy
14992
+ ), eb = Sc(
14993
14993
  kc(({ children: e }, t) => {
14994
14994
  const [n, r] = z(0), o = T(null), a = T(null), s = Ce(
14995
14995
  () => ({
@@ -15024,7 +15024,7 @@ function Rf(e) {
15024
15024
  onDragMove: s,
15025
15025
  onDragOver: i,
15026
15026
  onDragEnd: l
15027
- } = t, c = Yy(t, [
15027
+ } = t, c = qy(t, [
15028
15028
  "children",
15029
15029
  "onCollision",
15030
15030
  "onBeforeDragStart",
@@ -15033,7 +15033,7 @@ function Rf(e) {
15033
15033
  "onDragOver",
15034
15034
  "onDragEnd"
15035
15035
  ]);
15036
- const u = T(null), { plugins: f, modifiers: p, sensors: d } = c, h = Xt(f, Un.plugins), g = Xt(d, Un.sensors), v = Xt(p, Un.modifiers), m = Bn(o), y = Bn(a), w = Bn(i), b = Bn(s), _ = Bn(l), S = Bn(r), C = Jy(() => {
15036
+ const u = T(null), { plugins: f, modifiers: p, sensors: d } = c, h = Xt(f, Un.plugins), g = Xt(d, Un.sensors), v = Xt(p, Un.modifiers), m = Bn(o), y = Bn(a), b = Bn(i), w = Bn(s), _ = Bn(l), S = Bn(r), C = tb(() => {
15037
15037
  var E;
15038
15038
  return (E = c.manager) != null ? E : new Mi(c);
15039
15039
  });
@@ -15054,11 +15054,11 @@ function Rf(e) {
15054
15054
  }
15055
15055
  ),
15056
15056
  M.addEventListener("dragover", (A) => {
15057
- const I = w.current;
15057
+ const I = b.current;
15058
15058
  I && x(() => I(A, C));
15059
15059
  }),
15060
15060
  M.addEventListener("dragmove", (A) => {
15061
- const I = b.current;
15061
+ const I = w.current;
15062
15062
  I && x(() => I(A, C));
15063
15063
  }),
15064
15064
  M.addEventListener("dragend", (A) => {
@@ -15086,31 +15086,31 @@ function Rf(e) {
15086
15086
  v,
15087
15087
  () => C && (C.modifiers = v),
15088
15088
  ...Wa
15089
- ), /* @__PURE__ */ me(Ky.Provider, { value: C, children: [
15090
- /* @__PURE__ */ k(qy, { ref: u, children: n }),
15089
+ ), /* @__PURE__ */ me(Qy.Provider, { value: C, children: [
15090
+ /* @__PURE__ */ k(eb, { ref: u, children: n }),
15091
15091
  n
15092
15092
  ] });
15093
15093
  }
15094
- function Jy(e) {
15094
+ function tb(e) {
15095
15095
  const t = T(null);
15096
15096
  return t.current || (t.current = e()), Th(() => () => {
15097
15097
  var n;
15098
15098
  return (n = t.current) == null ? void 0 : n.destroy();
15099
15099
  }, []), t.current;
15100
15100
  }
15101
- var Qy = Object.create, Pf = Object.defineProperty, eb = Object.getOwnPropertyDescriptor, Ff = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), ga = (e) => {
15101
+ var nb = Object.create, Pf = Object.defineProperty, rb = Object.getOwnPropertyDescriptor, Ff = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), ga = (e) => {
15102
15102
  throw TypeError(e);
15103
- }, tb = (e, t, n) => t in e ? Pf(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, nb = (e) => {
15103
+ }, ob = (e, t, n) => t in e ? Pf(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, ab = (e) => {
15104
15104
  var t;
15105
- return [, , , Qy((t = e?.[Ff("metadata")]) != null ? t : null)];
15106
- }, Of = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Lf = (e) => e !== void 0 && typeof e != "function" ? ga("Function expected") : e, rb = (e, t, n, r, o) => ({ kind: Of[e], name: t, metadata: r, addInitializer: (a) => n._ ? ga("Already initialized") : o.push(Lf(a || null)) }), ob = (e, t) => tb(t, Ff("metadata"), e[3]), ab = (e, t, n, r) => {
15105
+ return [, , , nb((t = e?.[Ff("metadata")]) != null ? t : null)];
15106
+ }, Of = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Lf = (e) => e !== void 0 && typeof e != "function" ? ga("Function expected") : e, sb = (e, t, n, r, o) => ({ kind: Of[e], name: t, metadata: r, addInitializer: (a) => n._ ? ga("Already initialized") : o.push(Lf(a || null)) }), ib = (e, t) => ob(t, Ff("metadata"), e[3]), lb = (e, t, n, r) => {
15107
15107
  for (var o = 0, a = e[t >> 1], s = a && a.length; o < s; o++) a[o].call(n);
15108
15108
  return r;
15109
15109
  }, Bf = (e, t, n, r, o, a) => {
15110
- for (var s, i, l, c, u = t & 7, f = !1, p = !1, d = 2, h = Of[u + 5], g = e[d] || (e[d] = []), v = (o = o.prototype, eb(o, n)), m = r.length - 1; m >= 0; m--)
15111
- l = rb(u, n, i = {}, e[3], g), l.static = f, l.private = p, c = l.access = { has: (y) => n in y }, c.get = (y) => y[n], s = (0, r[m])(v[h], l), i._ = 1, Lf(s) && (v[h] = s);
15110
+ for (var s, i, l, c, u = t & 7, f = !1, p = !1, d = 2, h = Of[u + 5], g = e[d] || (e[d] = []), v = (o = o.prototype, rb(o, n)), m = r.length - 1; m >= 0; m--)
15111
+ l = sb(u, n, i = {}, e[3], g), l.static = f, l.private = p, c = l.access = { has: (y) => n in y }, c.get = (y) => y[n], s = (0, r[m])(v[h], l), i._ = 1, Lf(s) && (v[h] = s);
15112
15112
  return v && Pf(o, n, v), o;
15113
- }, Wf = (e, t, n) => t.has(e) || ga("Cannot " + n), sb = (e, t, n) => (Wf(e, t, "read from private field"), t.get(e)), ib = (e, t, n) => t.has(e) ? ga("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), lb = (e, t, n, r) => (Wf(e, t, "write to private field"), t.set(e, n), n), pr = class As {
15113
+ }, Wf = (e, t, n) => t.has(e) || ga("Cannot " + n), cb = (e, t, n) => (Wf(e, t, "read from private field"), t.get(e)), ub = (e, t, n) => t.has(e) ? ga("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), db = (e, t, n, r) => (Wf(e, t, "write to private field"), t.set(e, n), n), pr = class As {
15114
15114
  /**
15115
15115
  * @param {number} Coordinate of the point on the horizontal axis
15116
15116
  * @param {number} Coordinate of the point on the vertical axis
@@ -15148,10 +15148,10 @@ var Qy = Object.create, Pf = Object.defineProperty, eb = Object.getOwnPropertyDe
15148
15148
  static from({ x: t, y: n }) {
15149
15149
  return new As(t, n);
15150
15150
  }
15151
- }, Vf, Nf, Ms, Do, eo, Gi = class extends (Ms = un, Nf = [Re], Vf = [Re], Ms) {
15151
+ }, Vf, Nf, Ms, Do, eo, Gi = class extends (Ms = un, Nf = [Pe], Vf = [Pe], Ms) {
15152
15152
  constructor(e) {
15153
15153
  const t = pr.from(e);
15154
- super(t, (n, r) => pr.equals(n, r)), ab(eo, 5, this), ib(this, Do, 0), this.velocity = { x: 0, y: 0 };
15154
+ super(t, (n, r) => pr.equals(n, r)), lb(eo, 5, this), ub(this, Do, 0), this.velocity = { x: 0, y: 0 };
15155
15155
  }
15156
15156
  get delta() {
15157
15157
  return pr.delta(this.current, this.initial);
@@ -15172,9 +15172,9 @@ var Qy = Object.create, Pf = Object.defineProperty, eb = Object.getOwnPropertyDe
15172
15172
  const { current: t } = this, n = pr.from(e), r = {
15173
15173
  x: n.x - t.x,
15174
15174
  y: n.y - t.y
15175
- }, o = Date.now(), a = o - sb(this, Do), s = (i) => Math.round(i / a * 100);
15175
+ }, o = Date.now(), a = o - cb(this, Do), s = (i) => Math.round(i / a * 100);
15176
15176
  ln(() => {
15177
- lb(this, Do, o), this.velocity = {
15177
+ db(this, Do, o), this.velocity = {
15178
15178
  x: s(r.x),
15179
15179
  y: s(r.y)
15180
15180
  }, super.current = n;
@@ -15184,21 +15184,21 @@ var Qy = Object.create, Pf = Object.defineProperty, eb = Object.getOwnPropertyDe
15184
15184
  super.reset(pr.from(e)), this.velocity = { x: 0, y: 0 };
15185
15185
  }
15186
15186
  };
15187
- eo = nb(Ms);
15187
+ eo = ab(Ms);
15188
15188
  Do = /* @__PURE__ */ new WeakMap();
15189
15189
  Bf(eo, 2, "delta", Nf, Gi);
15190
15190
  Bf(eo, 2, "direction", Vf, Gi);
15191
- ob(eo, Gi);
15191
+ ib(eo, Gi);
15192
15192
  var zf = /* @__PURE__ */ ((e) => (e.Horizontal = "x", e.Vertical = "y", e))(zf || {});
15193
15193
  Object.values(zf);
15194
- var cb = Object.defineProperty, ub = Object.defineProperties, db = Object.getOwnPropertyDescriptors, vc = Object.getOwnPropertySymbols, fb = Object.prototype.hasOwnProperty, hb = Object.prototype.propertyIsEnumerable, yc = (e, t, n) => t in e ? cb(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Zf = (e, t) => {
15194
+ var fb = Object.defineProperty, hb = Object.defineProperties, pb = Object.getOwnPropertyDescriptors, vc = Object.getOwnPropertySymbols, mb = Object.prototype.hasOwnProperty, gb = Object.prototype.propertyIsEnumerable, yc = (e, t, n) => t in e ? fb(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Zf = (e, t) => {
15195
15195
  for (var n in t || (t = {}))
15196
- fb.call(t, n) && yc(e, n, t[n]);
15196
+ mb.call(t, n) && yc(e, n, t[n]);
15197
15197
  if (vc)
15198
15198
  for (var n of vc(t))
15199
- hb.call(t, n) && yc(e, n, t[n]);
15199
+ gb.call(t, n) && yc(e, n, t[n]);
15200
15200
  return e;
15201
- }, Hf = (e, t) => ub(e, db(t)), Ts = class extends jn {
15201
+ }, Hf = (e, t) => hb(e, pb(t)), Ts = class extends jn {
15202
15202
  /**
15203
15203
  * Applies the axis restriction to the drag operation.
15204
15204
  *
@@ -15246,7 +15246,7 @@ const Xf = (e) => {
15246
15246
  return t || console.warn(
15247
15247
  "[waveform-playlist] noDropAnimationPlugins: Feedback plugin not found in defaults — drop animation may not be disabled. Check @dnd-kit/dom version."
15248
15248
  ), n;
15249
- }, pb = O.div`
15249
+ }, vb = O.div`
15250
15250
  position: absolute;
15251
15251
  top: 0;
15252
15252
  left: 0;
@@ -15256,7 +15256,7 @@ const Xf = (e) => {
15256
15256
  z-index: 100;
15257
15257
  pointer-events: none;
15258
15258
  will-change: transform;
15259
- `, mb = ({
15259
+ `, yb = ({
15260
15260
  color: e = "#ff0000"
15261
15261
  }) => {
15262
15262
  const t = T(null), n = T(null), { isPlaying: r, currentTimeRef: o } = Ni(), { samplesPerPixel: a, sampleRate: s, progressBarWidth: i } = Zi();
@@ -15276,10 +15276,10 @@ const Xf = (e) => {
15276
15276
  const c = (o.current ?? 0) * s / a;
15277
15277
  t.current.style.transform = `translate3d(${c}px, 0, 0)`;
15278
15278
  }
15279
- }), /* @__PURE__ */ k(pb, { ref: t, $color: e, $width: i, "data-playhead": !0 });
15280
- }, gb = O.div`
15279
+ }), /* @__PURE__ */ k(vb, { ref: t, $color: e, $width: i, "data-playhead": !0 });
15280
+ }, bb = O.div`
15281
15281
  position: relative;
15282
- `, vb = O.div`
15282
+ `, wb = O.div`
15283
15283
  position: absolute;
15284
15284
  top: ${(e) => e.$top}px;
15285
15285
  left: 0;
@@ -15289,7 +15289,7 @@ const Xf = (e) => {
15289
15289
  z-index: 0;
15290
15290
  transform: translateZ(0);
15291
15291
  backface-visibility: hidden;
15292
- `, yb = O.div`
15292
+ `, _b = O.div`
15293
15293
  position: absolute;
15294
15294
  top: ${(e) => e.$top}px;
15295
15295
  left: 0;
@@ -15298,10 +15298,10 @@ const Xf = (e) => {
15298
15298
  pointer-events: none;
15299
15299
  z-index: 1;
15300
15300
  will-change: width;
15301
- `, bb = O.div`
15301
+ `, Sb = O.div`
15302
15302
  position: relative;
15303
15303
  z-index: 2;
15304
- `, wb = ({
15304
+ `, kb = ({
15305
15305
  clipStartSample: e,
15306
15306
  clipDurationSamples: t,
15307
15307
  ...n
@@ -15311,16 +15311,16 @@ const Xf = (e) => {
15311
15311
  const g = () => {
15312
15312
  if (r.current) {
15313
15313
  const m = (l.current ?? 0) * u, y = e + t;
15314
- let w = 0;
15314
+ let b = 0;
15315
15315
  if (m <= e)
15316
- w = 0;
15316
+ b = 0;
15317
15317
  else if (m >= y)
15318
- w = n.length;
15318
+ b = n.length;
15319
15319
  else {
15320
- const b = m - e;
15321
- w = Math.floor(b / c);
15320
+ const w = m - e;
15321
+ b = Math.floor(w / c);
15322
15322
  }
15323
- r.current.style.width = `${w}px`;
15323
+ r.current.style.width = `${b}px`;
15324
15324
  }
15325
15325
  i && (o.current = requestAnimationFrame(g));
15326
15326
  };
@@ -15344,8 +15344,8 @@ const Xf = (e) => {
15344
15344
  else if (v >= m)
15345
15345
  y = n.length;
15346
15346
  else {
15347
- const w = v - e;
15348
- y = Math.floor(w / c);
15347
+ const b = v - e;
15348
+ y = Math.floor(b / c);
15349
15349
  }
15350
15350
  r.current.style.width = `${y}px`;
15351
15351
  }
@@ -15354,9 +15354,9 @@ const Xf = (e) => {
15354
15354
  let d;
15355
15355
  p === "inverted" ? d = a?.selectedWaveFillColor || a?.waveFillColor || "white" : d = a?.selectedWaveOutlineColor || a?.waveOutlineColor || "grey";
15356
15356
  const h = cn(d);
15357
- return /* @__PURE__ */ me(gb, { children: [
15357
+ return /* @__PURE__ */ me(bb, { children: [
15358
15358
  /* @__PURE__ */ k(
15359
- vb,
15359
+ wb,
15360
15360
  {
15361
15361
  $color: h,
15362
15362
  $height: s,
@@ -15365,7 +15365,7 @@ const Xf = (e) => {
15365
15365
  }
15366
15366
  ),
15367
15367
  /* @__PURE__ */ k(
15368
- yb,
15368
+ _b,
15369
15369
  {
15370
15370
  ref: r,
15371
15371
  $color: f,
@@ -15373,22 +15373,22 @@ const Xf = (e) => {
15373
15373
  $top: n.index * s
15374
15374
  }
15375
15375
  ),
15376
- /* @__PURE__ */ k(bb, { children: /* @__PURE__ */ k(pf, { ...n, isSelected: !0, transparentBackground: !0 }) })
15376
+ /* @__PURE__ */ k(Sb, { children: /* @__PURE__ */ k(pf, { ...n, isSelected: !0, transparentBackground: !0 }) })
15377
15377
  ] });
15378
- }, _b = ({
15378
+ }, Cb = ({
15379
15379
  getAnnotationBoxLabel: e,
15380
15380
  editable: t = !1,
15381
15381
  linkEndpoints: n = !1,
15382
15382
  onAnnotationUpdate: r,
15383
15383
  className: o
15384
15384
  }) => {
15385
- const a = Qr(), { isPlaying: s } = Ni(), { annotations: i, activeAnnotationId: l } = zi(), c = Pe(ma), { play: u, seekTo: f, setActiveAnnotationId: p, setAnnotations: d, setScrollContainer: h } = Tf(), {
15385
+ const a = Qr(), { isPlaying: s } = Ni(), { annotations: i, activeAnnotationId: l } = zi(), c = Fe(ma), { play: u, seekTo: f, setActiveAnnotationId: p, setAnnotations: d, setScrollContainer: h } = Tf(), {
15386
15386
  duration: g,
15387
15387
  peaksDataArray: v,
15388
15388
  sampleRate: m,
15389
15389
  waveHeight: y,
15390
- timeScaleHeight: w,
15391
- samplesPerPixel: b,
15390
+ timeScaleHeight: b,
15391
+ samplesPerPixel: w,
15392
15392
  controls: _,
15393
15393
  playoutRef: S,
15394
15394
  barWidth: C,
@@ -15398,7 +15398,7 @@ const Xf = (e) => {
15398
15398
  F.current = Z, h(Z);
15399
15399
  },
15400
15400
  [h]
15401
- ), H = Math.floor(g * m / b), Q = $(
15401
+ ), H = Math.floor(g * m / w), Q = $(
15402
15402
  async (Z) => {
15403
15403
  p(Z.id);
15404
15404
  try {
@@ -15420,24 +15420,24 @@ const Xf = (e) => {
15420
15420
  ), { onDragStart: oe, onDragMove: X, onDragEnd: ee } = py({
15421
15421
  annotations: i,
15422
15422
  onAnnotationsChange: q,
15423
- samplesPerPixel: b,
15423
+ samplesPerPixel: w,
15424
15424
  sampleRate: m,
15425
15425
  duration: g,
15426
15426
  linkEndpoints: n
15427
15427
  }), ie = T(0), fe = $(
15428
15428
  (Z) => {
15429
- const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) * b / m;
15429
+ const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) * w / m;
15430
15430
  ie.current = G, D(!0), M(G), A(G);
15431
15431
  },
15432
- [b, m]
15432
+ [w, m]
15433
15433
  ), he = $(
15434
15434
  (Z) => {
15435
15435
  if (!I) return;
15436
- const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) * b / m;
15436
+ const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) * w / m;
15437
15437
  A(G);
15438
15438
  },
15439
- [I, b, m]
15440
- ), De = $(
15439
+ [I, w, m]
15440
+ ), Re = $(
15441
15441
  (Z) => {
15442
15442
  if (!I) return;
15443
15443
  if (D(!1), s && S.current) {
@@ -15445,20 +15445,20 @@ const Xf = (e) => {
15445
15445
  f(B), M(B), A(B), S.current.stop(), u(B);
15446
15446
  return;
15447
15447
  }
15448
- const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) * b / m, te = Math.min(x, G), Me = Math.max(x, G);
15448
+ const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) * w / m, te = Math.min(x, G), Me = Math.max(x, G);
15449
15449
  Math.abs(Me - te) < 0.1 ? (f(te), M(te), A(te)) : (M(te), A(Me));
15450
15450
  },
15451
- [I, x, b, m, f, s, S, u]
15451
+ [I, x, w, m, f, s, S, u]
15452
15452
  );
15453
15453
  return v.length === 0 ? /* @__PURE__ */ k("div", { className: o, children: "Loading waveform..." }) : /* @__PURE__ */ k(hf, { children: /* @__PURE__ */ k(
15454
15454
  Jr.Provider,
15455
15455
  {
15456
15456
  value: {
15457
- samplesPerPixel: b,
15457
+ samplesPerPixel: w,
15458
15458
  sampleRate: m,
15459
- zoomLevels: [b],
15459
+ zoomLevels: [w],
15460
15460
  waveHeight: y,
15461
- timeScaleHeight: w,
15461
+ timeScaleHeight: b,
15462
15462
  duration: g * 1e3,
15463
15463
  controls: _,
15464
15464
  barWidth: C,
@@ -15475,10 +15475,10 @@ const Xf = (e) => {
15475
15475
  controlsWidth: _.show ? _.width : 0,
15476
15476
  onTracksMouseDown: fe,
15477
15477
  onTracksMouseMove: he,
15478
- onTracksMouseUp: De,
15478
+ onTracksMouseUp: Re,
15479
15479
  scrollContainerRef: L,
15480
15480
  isSelecting: I,
15481
- timescale: w > 0 ? /* @__PURE__ */ k(mf, {}) : void 0,
15481
+ timescale: b > 0 ? /* @__PURE__ */ k(mf, {}) : void 0,
15482
15482
  children: /* @__PURE__ */ me(zt, { children: [
15483
15483
  v.map((Z, Y) => {
15484
15484
  const _e = Z.length > 0 ? Math.max(...Z.map((G) => G.peaks.data.length)) : 1;
@@ -15503,13 +15503,13 @@ const Xf = (e) => {
15503
15503
  trackName: G.trackName,
15504
15504
  startSample: G.startSample,
15505
15505
  durationSamples: G.durationSamples,
15506
- samplesPerPixel: b,
15506
+ samplesPerPixel: w,
15507
15507
  showHeader: !1,
15508
15508
  disableHeaderDrag: !0,
15509
15509
  isSelected: !0,
15510
15510
  trackId: `media-element-track-${Y}`,
15511
15511
  children: Me.data.map((Oe, st) => /* @__PURE__ */ k(
15512
- wb,
15512
+ kb,
15513
15513
  {
15514
15514
  index: st,
15515
15515
  data: Oe,
@@ -15537,7 +15537,7 @@ const Xf = (e) => {
15537
15537
  modifiers: t ? [Uf] : [],
15538
15538
  plugins: Xf,
15539
15539
  children: /* @__PURE__ */ k(c.AnnotationBoxesWrapper, { height: 30, width: H, children: i.map((Z, Y) => {
15540
- const _e = Z.start * m / b, G = Z.end * m / b, te = e ? e(Z, Y) : Z.id;
15540
+ const _e = Z.start * m / w, G = Z.end * m / w, te = e ? e(Z, Y) : Z.id;
15541
15541
  return /* @__PURE__ */ k(
15542
15542
  c.AnnotationBox,
15543
15543
  {
@@ -15559,18 +15559,18 @@ const Xf = (e) => {
15559
15559
  x !== R && /* @__PURE__ */ k(
15560
15560
  cf,
15561
15561
  {
15562
- startPosition: Math.min(x, R) * m / b,
15563
- endPosition: Math.max(x, R) * m / b,
15562
+ startPosition: Math.min(x, R) * m / w,
15563
+ endPosition: Math.max(x, R) * m / w,
15564
15564
  color: a.selectionColor
15565
15565
  }
15566
15566
  ),
15567
- /* @__PURE__ */ k(mb, { color: a.playheadColor })
15567
+ /* @__PURE__ */ k(yb, { color: a.playheadColor })
15568
15568
  ] })
15569
15569
  }
15570
15570
  )
15571
15571
  }
15572
15572
  ) });
15573
- }, Sb = ({
15573
+ }, xb = ({
15574
15574
  height: e,
15575
15575
  renderAnnotationItem: t,
15576
15576
  onAnnotationUpdate: n,
@@ -15616,7 +15616,7 @@ const Xf = (e) => {
15616
15616
  const { annotations: c } = zi();
15617
15617
  return /* @__PURE__ */ me(zt, { children: [
15618
15618
  /* @__PURE__ */ k(
15619
- _b,
15619
+ Cb,
15620
15620
  {
15621
15621
  getAnnotationBoxLabel: t,
15622
15622
  editable: r,
@@ -15626,7 +15626,7 @@ const Xf = (e) => {
15626
15626
  }
15627
15627
  ),
15628
15628
  c.length > 0 && /* @__PURE__ */ k(
15629
- Sb,
15629
+ xb,
15630
15630
  {
15631
15631
  height: e,
15632
15632
  renderAnnotationItem: n,
@@ -15638,6 +15638,46 @@ const Xf = (e) => {
15638
15638
  }
15639
15639
  )
15640
15640
  ] });
15641
+ }, $1 = ({
15642
+ playback: e = !1,
15643
+ clipSplitting: t = !1,
15644
+ annotations: n = !1,
15645
+ additionalShortcuts: r = [],
15646
+ enabled: o = !0
15647
+ }) => {
15648
+ const { tracks: a, samplesPerPixel: s, sampleRate: i, playoutRef: l, duration: c } = vt(), {
15649
+ annotations: u,
15650
+ linkEndpoints: f,
15651
+ activeAnnotationId: p,
15652
+ continuousPlay: d
15653
+ } = gt(), { setAnnotations: h, setActiveAnnotationId: g, scrollContainerRef: v, play: m } = De(), { splitClipAtPlayhead: y } = vy({
15654
+ tracks: a,
15655
+ sampleRate: i,
15656
+ samplesPerPixel: s,
15657
+ engineRef: l
15658
+ }), b = [];
15659
+ return t && b.push({
15660
+ key: "s",
15661
+ action: y,
15662
+ description: "Split clip at playhead",
15663
+ preventDefault: !0
15664
+ }), r.length > 0 && b.push(...r), yy({
15665
+ enabled: o && (e || b.length > 0),
15666
+ ...e ? { additionalShortcuts: b } : { shortcuts: b }
15667
+ }), by({
15668
+ annotations: u,
15669
+ activeAnnotationId: p,
15670
+ onAnnotationsChange: h,
15671
+ onActiveAnnotationChange: g,
15672
+ duration: c,
15673
+ linkEndpoints: f,
15674
+ continuousPlay: d,
15675
+ scrollContainerRef: v,
15676
+ samplesPerPixel: s,
15677
+ sampleRate: i,
15678
+ onPlay: m,
15679
+ enabled: o && n && u.length > 0
15680
+ }), null;
15641
15681
  }, qo = class qo extends jn {
15642
15682
  apply(t) {
15643
15683
  const { transform: n, source: r } = t;
@@ -15664,8 +15704,8 @@ const Jo = class Jo extends jn {
15664
15704
  if (this.options.mode === "timescale") {
15665
15705
  const { gridSamples: v } = this.options;
15666
15706
  if (a !== void 0) {
15667
- const w = a + n.x * s;
15668
- return { x: (Math.round(w / v) * v - a) / s, y: 0 };
15707
+ const b = a + n.x * s;
15708
+ return { x: (Math.round(b / v) * v - a) / s, y: 0 };
15669
15709
  }
15670
15710
  const m = n.x * s;
15671
15711
  return { x: Math.round(m / v) * v / s, y: 0 };
@@ -15683,13 +15723,13 @@ const Jo = class Jo extends jn {
15683
15723
  };
15684
15724
  Jo.configure = An(Jo);
15685
15725
  let Ko = Jo;
15686
- const kb = () => {
15687
- }, $1 = ({
15726
+ const Eb = () => {
15727
+ }, D1 = ({
15688
15728
  snap: e = !1,
15689
15729
  touchOptimized: t = !1,
15690
15730
  children: n
15691
15731
  }) => {
15692
- const { tracks: r, samplesPerPixel: o, sampleRate: a, playoutRef: s, isDraggingRef: i, onTracksChange: l } = Et(), { setSelectedTrackId: c } = Fe(), u = df(), f = e && u != null && u.scaleMode === "beats" && u.snapTo !== "off", p = e && !f;
15732
+ const { tracks: r, samplesPerPixel: o, sampleRate: a, playoutRef: s, isDraggingRef: i, onTracksChange: l } = vt(), { setSelectedTrackId: c } = De(), u = df(), f = e && u != null && u.scaleMode === "beats" && u.snapTo !== "off", p = e && !f;
15693
15733
  K(() => {
15694
15734
  l == null && console.warn(
15695
15735
  "[waveform-playlist] ClipInteractionProvider: onTracksChange is not set on WaveformPlaylistProvider. Drag and trim edits will not be persisted."
@@ -15697,15 +15737,15 @@ const kb = () => {
15697
15737
  }, [l]);
15698
15738
  const d = Ce(() => {
15699
15739
  if (f && u) {
15700
- const { bpm: b, timeSignature: _, snapTo: S } = u, C = S === "bar" ? Fs(_) : ta(_);
15740
+ const { bpm: w, timeSignature: _, snapTo: S } = u, C = S === "bar" ? Fs(_) : ta(_);
15701
15741
  return (E) => {
15702
- const x = za(E, b, a), M = Za(x, C);
15703
- return Gn(M, b, a);
15742
+ const x = za(E, w, a), M = Za(x, C);
15743
+ return Gn(M, w, a);
15704
15744
  };
15705
15745
  }
15706
15746
  if (p) {
15707
- const b = Math.round(xs(o).smallStep / 1e3 * a);
15708
- return (_) => Math.round(_ / b) * b;
15747
+ const w = Math.round(xs(o).smallStep / 1e3 * a);
15748
+ return (_) => Math.round(_ / w) * w;
15709
15749
  }
15710
15750
  }, [f, p, u, a, o]), h = gy({ touchOptimized: t }), {
15711
15751
  onDragStart: g,
@@ -15713,21 +15753,21 @@ const kb = () => {
15713
15753
  onDragEnd: m
15714
15754
  } = hy({
15715
15755
  tracks: r,
15716
- onTracksChange: l ?? kb,
15756
+ onTracksChange: l ?? Eb,
15717
15757
  samplesPerPixel: o,
15718
15758
  sampleRate: a,
15719
15759
  engineRef: s,
15720
15760
  isDraggingRef: i,
15721
15761
  snapSamplePosition: d
15722
15762
  }), y = at.useCallback(
15723
- (b) => {
15724
- const _ = b.operation?.source?.data?.trackIndex;
15725
- _ !== void 0 && r[_] && c(r[_].id), g(b);
15763
+ (w) => {
15764
+ const _ = w.operation?.source?.data?.trackIndex;
15765
+ _ !== void 0 && r[_] && c(r[_].id), g(w);
15726
15766
  },
15727
15767
  [g, r, c]
15728
- ), w = Ce(() => {
15729
- const b = [Uf];
15730
- return f && u ? b.push(
15768
+ ), b = Ce(() => {
15769
+ const w = [Uf];
15770
+ return f && u ? w.push(
15731
15771
  Ko.configure({
15732
15772
  mode: "beats",
15733
15773
  snapTo: u.snapTo,
@@ -15736,22 +15776,22 @@ const kb = () => {
15736
15776
  samplesPerPixel: o,
15737
15777
  sampleRate: a
15738
15778
  })
15739
- ) : p && b.push(
15779
+ ) : p && w.push(
15740
15780
  Ko.configure({
15741
15781
  mode: "timescale",
15742
15782
  gridSamples: Math.round(xs(o).smallStep / 1e3 * a),
15743
15783
  samplesPerPixel: o
15744
15784
  })
15745
- ), b.push($s.configure({ tracks: r, samplesPerPixel: o })), b;
15785
+ ), w.push($s.configure({ tracks: r, samplesPerPixel: o })), w;
15746
15786
  }, [f, p, u, r, o, a]);
15747
- return /* @__PURE__ */ k(Py, { value: !0, children: /* @__PURE__ */ k(
15787
+ return /* @__PURE__ */ k(Ly, { value: !0, children: /* @__PURE__ */ k(
15748
15788
  Rf,
15749
15789
  {
15750
15790
  sensors: h,
15751
15791
  onDragStart: y,
15752
15792
  onDragMove: v,
15753
15793
  onDragEnd: m,
15754
- modifiers: w,
15794
+ modifiers: b,
15755
15795
  plugins: Xf,
15756
15796
  children: n
15757
15797
  }
@@ -15763,23 +15803,24 @@ export {
15763
15803
  y1 as AutomaticScrollCheckbox,
15764
15804
  d1 as ClearAllButton,
15765
15805
  $s as ClipCollisionModifier,
15766
- $1 as ClipInteractionProvider,
15806
+ D1 as ClipInteractionProvider,
15767
15807
  w1 as ContinuousPlayCheckbox,
15768
15808
  k1 as DownloadAnnotationsButton,
15769
15809
  S1 as EditableCheckbox,
15770
15810
  C1 as ExportWavButton,
15771
15811
  s1 as FastForwardButton,
15812
+ $1 as KeyboardShortcuts,
15772
15813
  _1 as LinkEndpointsCheckbox,
15773
15814
  c1 as LoopButton,
15774
15815
  p1 as MasterVolumeControl,
15775
- Sb as MediaElementAnnotationList,
15776
- _b as MediaElementPlaylist,
15816
+ xb as MediaElementAnnotationList,
15817
+ Cb as MediaElementPlaylist,
15777
15818
  t1 as MediaElementPlaylistProvider,
15778
15819
  T1 as MediaElementWaveform,
15779
15820
  r1 as PauseButton,
15780
15821
  n1 as PlayButton,
15781
- Hy as PlaylistAnnotationList,
15782
- Zy as PlaylistVisualization,
15822
+ Xy as PlaylistAnnotationList,
15823
+ Uy as PlaylistVisualization,
15783
15824
  a1 as RewindButton,
15784
15825
  v1 as SelectionTimeInputs,
15785
15826
  u1 as SetLoopRegionButton,
@@ -15800,34 +15841,34 @@ export {
15800
15841
  pa as effectDefinitions,
15801
15842
  wf as getEffectDefinition,
15802
15843
  Yb as getEffectsByCategory,
15803
- Gb as getShortcutLabel,
15804
- Nb as getWaveformDataMetadata,
15805
- Vb as loadPeaksFromWaveformData,
15844
+ Xb as getShortcutLabel,
15845
+ Hb as getWaveformDataMetadata,
15846
+ Zb as loadPeaksFromWaveformData,
15806
15847
  yf as loadWaveformData,
15807
15848
  Xf as noDropAnimationPlugins,
15808
15849
  py as useAnnotationDragHandlers,
15809
15850
  lr as useAnnotationIntegration,
15810
- Xb as useAnnotationKeyboardControls,
15811
- Zb as useAudioTracks,
15851
+ by as useAnnotationKeyboardControls,
15852
+ Ub as useAudioTracks,
15812
15853
  hy as useClipDragHandlers,
15813
- Fy as useClipInteractionEnabled,
15814
- Hb as useClipSplitting,
15854
+ By as useClipInteractionEnabled,
15855
+ vy as useClipSplitting,
15815
15856
  gy as useDragSensors,
15816
15857
  qb as useDynamicEffects,
15817
15858
  Qb as useDynamicTracks,
15818
- Sy as useExportWav,
15859
+ xy as useExportWav,
15819
15860
  Es as useKeyboardShortcuts,
15820
- zb as useMasterAnalyser,
15861
+ Gb as useMasterAnalyser,
15821
15862
  iy as useMasterVolume,
15822
15863
  Ni as useMediaElementAnimation,
15823
15864
  Tf as useMediaElementControls,
15824
15865
  Zi as useMediaElementData,
15825
15866
  zi as useMediaElementState,
15826
- Ct as usePlaybackAnimation,
15827
- Ub as usePlaybackShortcuts,
15828
- Fe as usePlaylistControls,
15829
- Et as usePlaylistData,
15830
- xt as usePlaylistState,
15867
+ Et as usePlaybackAnimation,
15868
+ yy as usePlaybackShortcuts,
15869
+ De as usePlaylistControls,
15870
+ vt as usePlaylistData,
15871
+ gt as usePlaylistState,
15831
15872
  E1 as useSpectrogramIntegration,
15832
15873
  ay as useTimeFormat,
15833
15874
  Jb as useTrackDynamicEffects,