@waveform-playlist/browser 9.0.2 → 9.0.4

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
@@ -1,5 +1,5 @@
1
1
  import * as Sf from "tone";
2
- import { now as Co, Context as kf, setContext as If, Volume as Ul, getDestination as Kl, getTransport as Ot, start as Af, getContext as Gt, Panner as Ef, Gain as Mf, Analyser as jl, StereoWidener as $f, Gate as Tf, Limiter as Df, Compressor as Pf, Chebyshev as Rf, BitCrusher as Wf, Distortion as Ff, EQ3 as Of, AutoWah as Bf, AutoFilter as Vf, AutoPanner as Lf, Vibrato as zf, Tremolo as Zf, Phaser as Hf, Chorus as Nf, PingPongDelay as Xf, FeedbackDelay as Gf, JCReverb as Yf, Freeverb as Uf, Reverb as Kf } from "tone";
2
+ import { now as Co, Context as kf, setContext as If, Volume as Ul, getDestination as Kl, getTransport as Ot, start as Ef, getContext as Gt, Panner as Af, Gain as Mf, Analyser as jl, StereoWidener as $f, Gate as Tf, Limiter as Df, Compressor as Pf, Chebyshev as Rf, BitCrusher as Wf, Distortion as Ff, EQ3 as Of, AutoWah as Bf, AutoFilter as Vf, AutoPanner as Lf, Vibrato as zf, Tremolo as Zf, Phaser as Hf, Chorus as Nf, PingPongDelay as Xf, FeedbackDelay as Gf, JCReverb as Yf, Freeverb as Uf, Reverb as Kf } from "tone";
3
3
  import { jsx as x, jsxs as me, Fragment as Lt } from "react/jsx-runtime";
4
4
  import * as P from "react";
5
5
  import bt, { useEffect as j, useLayoutEffect as qn, useRef as T, useMemo as Te, useState as V, useCallback as M, useContext as We, createContext as Ze, memo as ql, forwardRef as Jl, startTransition as fs, useImperativeHandle as Ql, Fragment as jf, useSyncExternalStore as qf, useInsertionEffect as Jf } from "react";
@@ -210,7 +210,7 @@ function el(e, t, n, r = "linear", a = 1, o = 0) {
210
210
  }
211
211
  var lh = class {
212
212
  constructor(e) {
213
- this.activeSources = /* @__PURE__ */ new Set(), this._scheduleGuardOffset = 0, this.track = e.track, this.volumeNode = new Ul(this.gainToDb(e.track.gain)), this.panNode = new Ef(e.track.stereoPan), this.muteGain = new Mf(e.track.muted ? 0 : 1), this.volumeNode.chain(this.panNode, this.muteGain);
213
+ this.activeSources = /* @__PURE__ */ new Set(), this._scheduleGuardOffset = 0, this.track = e.track, this.volumeNode = new Ul(this.gainToDb(e.track.gain)), this.panNode = new Af(e.track.stereoPan), this.muteGain = new Mf(e.track.muted ? 0 : 1), this.volumeNode.chain(this.panNode, this.muteGain);
214
214
  const t = e.destination || Kl();
215
215
  if (e.effects) {
216
216
  const s = e.effects(this.muteGain, t, !1);
@@ -488,7 +488,7 @@ var lh = class {
488
488
  }
489
489
  }
490
490
  async init() {
491
- this.isInitialized || (await Af(), this.isInitialized = !0);
491
+ this.isInitialized || (await Ef(), this.isInitialized = !0);
492
492
  }
493
493
  addTrack(e) {
494
494
  const t = {
@@ -554,6 +554,14 @@ var lh = class {
554
554
  } catch (t) {
555
555
  console.warn("[waveform-playlist] Transport.stop() failed:", t);
556
556
  }
557
+ if (this._loopHandler) {
558
+ try {
559
+ e.off("loop", this._loopHandler);
560
+ } catch (t) {
561
+ console.warn("[waveform-playlist] Error removing loop handler:", t);
562
+ }
563
+ this._loopHandler = null;
564
+ }
557
565
  this.tracks.forEach((t) => t.stopAllSources()), this.tracks.forEach((t) => t.cancelFades()), this.clearCompletionEvent();
558
566
  }
559
567
  setMasterGain(e) {
@@ -1002,7 +1010,7 @@ var mh = 44100, gh = 1e3, vh = [256, 512, 1024, 2048, 4096, 8192], rl = 0.1, yh
1002
1010
  if (t !== void 0)
1003
1011
  this._adapter.setLoop(!1, this._loopStart, this._loopEnd);
1004
1012
  else if (this._isLoopEnabled) {
1005
- const a = this._currentTime >= this._loopStart && this._currentTime < this._loopEnd;
1013
+ const a = this._currentTime < this._loopEnd;
1006
1014
  this._adapter.setLoop(a, this._loopStart, this._loopEnd);
1007
1015
  }
1008
1016
  try {
@@ -1039,17 +1047,13 @@ var mh = 44100, gh = 1e3, vh = [256, 512, 1024, 2048, 4096, 8192], rl = 0.1, yh
1039
1047
  setLoopRegion(e, t) {
1040
1048
  const n = Math.min(e, t), r = Math.max(e, t);
1041
1049
  n === this._loopStart && r === this._loopEnd || (this._loopStart = n, this._loopEnd = r, this._adapter?.setLoop(
1042
- this._isLoopEnabled && this._shouldActivateTransportLoop(),
1050
+ this._isLoopEnabled && this._isBeforeLoopEnd(),
1043
1051
  this._loopStart,
1044
1052
  this._loopEnd
1045
1053
  ), this._emitStateChange());
1046
1054
  }
1047
1055
  setLoopEnabled(e) {
1048
- e !== this._isLoopEnabled && (this._isLoopEnabled = e, this._adapter?.setLoop(
1049
- e && this._shouldActivateTransportLoop(),
1050
- this._loopStart,
1051
- this._loopEnd
1052
- ), this._emitStateChange());
1056
+ e !== this._isLoopEnabled && (this._isLoopEnabled = e, this._adapter?.setLoop(e && this._isBeforeLoopEnd(), this._loopStart, this._loopEnd), this._emitStateChange());
1053
1057
  }
1054
1058
  // ---------------------------------------------------------------------------
1055
1059
  // Per-Track Audio (delegates to adapter)
@@ -1119,20 +1123,19 @@ var mh = 44100, gh = 1e3, vh = [256, 512, 1024, 2048, 4096, 8192], rl = 0.1, yh
1119
1123
  console.warn("[waveform-playlist/engine] Error in event listener:", a);
1120
1124
  }
1121
1125
  }
1122
- _emitStateChange() {
1123
- this._emit("statechange", this.getState());
1124
- }
1125
1126
  /**
1126
- * Returns whether Transport loop should be active right now.
1127
- * When not playing, returns true unconditionally the intent to loop
1128
- * should be honored when playback starts (play() has its own position
1129
- * check). During playback, checks if the live position is within the
1130
- * loop region [loopStart, loopEnd).
1127
+ * Returns whether the current playback position is before loopEnd.
1128
+ * Used by setLoopEnabled/setLoopRegion during playbackif past loopEnd,
1129
+ * Transport loop stays off so playback continues to the end.
1130
+ * Note: play() uses an inline check instead _isPlaying is still false
1131
+ * when play() runs, and this method returns true unconditionally when
1132
+ * not playing.
1131
1133
  */
1132
- _shouldActivateTransportLoop() {
1133
- if (!this._isPlaying) return !0;
1134
- const e = this._adapter?.getCurrentTime() ?? this._currentTime;
1135
- return e >= this._loopStart && e < this._loopEnd;
1134
+ _isBeforeLoopEnd() {
1135
+ return this._isPlaying ? (this._adapter?.getCurrentTime() ?? this._currentTime) < this._loopEnd : !0;
1136
+ }
1137
+ _emitStateChange() {
1138
+ this._emit("statechange", this.getState());
1136
1139
  }
1137
1140
  _startTimeUpdateLoop() {
1138
1141
  if (typeof requestAnimationFrame > "u") return;
@@ -1152,7 +1155,7 @@ function Za() {
1152
1155
  else {
1153
1156
  for (var e, t = !1; Sr !== void 0; ) {
1154
1157
  var n = Sr;
1155
- for (Sr = void 0, Ao++; n !== void 0; ) {
1158
+ for (Sr = void 0, Eo++; n !== void 0; ) {
1156
1159
  var r = n.o;
1157
1160
  if (n.o = void 0, n.f &= -3, !(8 & n.f) && uc(n)) try {
1158
1161
  n.c();
@@ -1162,7 +1165,7 @@ function Za() {
1162
1165
  n = r;
1163
1166
  }
1164
1167
  }
1165
- if (Ao = 0, on--, t) throw e;
1168
+ if (Eo = 0, on--, t) throw e;
1166
1169
  }
1167
1170
  }
1168
1171
  function sn(e) {
@@ -1184,7 +1187,7 @@ function Se(e) {
1184
1187
  ve = t;
1185
1188
  }
1186
1189
  }
1187
- var Sr = void 0, on = 0, Ao = 0, Sa = 0;
1190
+ var Sr = void 0, on = 0, Eo = 0, Sa = 0;
1188
1191
  function cc(e) {
1189
1192
  if (ve !== void 0) {
1190
1193
  var t = e.n;
@@ -1253,7 +1256,7 @@ Object.defineProperty(ut.prototype, "value", { get: function() {
1253
1256
  return e !== void 0 && (e.i = this.i), this.v;
1254
1257
  }, set: function(e) {
1255
1258
  if (e !== this.v) {
1256
- if (Ao > 100) throw new Error("Cycle detected");
1259
+ if (Eo > 100) throw new Error("Cycle detected");
1257
1260
  this.v = e, this.i++, Sa++, on++;
1258
1261
  try {
1259
1262
  for (var t = this.t; t !== void 0; t = t.x) t.t.N();
@@ -1393,19 +1396,19 @@ function Mt(e, t) {
1393
1396
  var r = n.d.bind(n);
1394
1397
  return r[Symbol.dispose] = r, r;
1395
1398
  }
1396
- var _h = Object.create, ps = Object.defineProperty, xh = Object.defineProperties, Ch = Object.getOwnPropertyDescriptor, Sh = Object.getOwnPropertyDescriptors, ol = Object.getOwnPropertySymbols, kh = Object.prototype.hasOwnProperty, Ih = Object.prototype.propertyIsEnumerable, Ah = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), Qn = (e) => {
1399
+ var _h = Object.create, ps = Object.defineProperty, xh = Object.defineProperties, Ch = Object.getOwnPropertyDescriptor, Sh = Object.getOwnPropertyDescriptors, ol = Object.getOwnPropertySymbols, kh = Object.prototype.hasOwnProperty, Ih = Object.prototype.propertyIsEnumerable, Eh = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), Qn = (e) => {
1397
1400
  throw TypeError(e);
1398
- }, Eo = (e, t, n) => t in e ? ps(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Eh = (e, t) => {
1401
+ }, Ao = (e, t, n) => t in e ? ps(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ah = (e, t) => {
1399
1402
  for (var n in t || (t = {}))
1400
- kh.call(t, n) && Eo(e, n, t[n]);
1403
+ kh.call(t, n) && Ao(e, n, t[n]);
1401
1404
  if (ol)
1402
1405
  for (var n of ol(t))
1403
- Ih.call(t, n) && Eo(e, n, t[n]);
1406
+ Ih.call(t, n) && Ao(e, n, t[n]);
1404
1407
  return e;
1405
1408
  }, Mh = (e, t) => xh(e, Sh(t)), sl = (e, t) => ps(e, "name", { value: t, configurable: !0 }), $h = (e) => {
1406
1409
  var t;
1407
1410
  return [, , , _h((t = void 0) != null ? t : null)];
1408
- }, pc = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], hr = (e) => e !== void 0 && typeof e != "function" ? Qn("Function expected") : e, Th = (e, t, n, r, a) => ({ kind: pc[e], name: t, metadata: r, addInitializer: (o) => n._ ? Qn("Already initialized") : a.push(hr(o || null)) }), mc = (e, t) => Eo(t, Ah("metadata"), e[3]), mn = (e, t, n, r) => {
1411
+ }, pc = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], hr = (e) => e !== void 0 && typeof e != "function" ? Qn("Function expected") : e, Th = (e, t, n, r, a) => ({ kind: pc[e], name: t, metadata: r, addInitializer: (o) => n._ ? Qn("Already initialized") : a.push(hr(o || null)) }), mc = (e, t) => Ao(t, Eh("metadata"), e[3]), mn = (e, t, n, r) => {
1409
1412
  for (var a = 0, o = e[t >> 1], s = o && o.length; a < s; a++) t & 1 ? o[a].call(n) : r = o[a].call(n, r);
1410
1413
  return r;
1411
1414
  }, er = (e, t, n, r, a, o) => {
@@ -1480,7 +1483,7 @@ function io(e = !0) {
1480
1483
  return function(t, n) {
1481
1484
  n.addInitializer(function() {
1482
1485
  const r = n.kind === "field" ? this : n.static ? this : Object.getPrototypeOf(this), a = Object.getOwnPropertyDescriptor(r, n.name);
1483
- a && Object.defineProperty(r, n.name, Mh(Eh({}, a), { enumerable: e }));
1486
+ a && Object.defineProperty(r, n.name, Mh(Ah({}, a), { enumerable: e }));
1484
1487
  });
1485
1488
  };
1486
1489
  }
@@ -1552,11 +1555,11 @@ var Rh = Object.create, Cc = Object.defineProperty, Wh = Object.getOwnPropertyDe
1552
1555
  }, kc = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ic = (e) => e !== void 0 && typeof e != "function" ? Ha("Function expected") : e, Lh = (e, t, n, r, a) => ({ kind: kc[e], name: t, metadata: r, addInitializer: (o) => n._ ? Ha("Already initialized") : a.push(Ic(o || null)) }), zh = (e, t) => Ro(t, Sc("metadata"), e[3]), Zh = (e, t, n, r) => {
1553
1556
  for (var a = 0, o = e[t >> 1], s = o && o.length; a < s; a++) o[a].call(n);
1554
1557
  return r;
1555
- }, Ac = (e, t, n, r, a, o) => {
1558
+ }, Ec = (e, t, n, r, a, o) => {
1556
1559
  for (var s, i, l, c, u = t & 7, d = !1, h = !1, f = 2, m = kc[u + 5], y = e[f] || (e[f] = []), v = (a = a.prototype, Wh(a, n)), p = r.length - 1; p >= 0; p--)
1557
1560
  l = Lh(u, n, i = {}, e[3], y), l.static = d, l.private = h, c = l.access = { has: (b) => n in b }, c.get = (b) => b[n], s = (0, r[p])(v[m], l), i._ = 1, Ic(s) && (v[m] = s);
1558
1561
  return v && Cc(a, n, v), a;
1559
- }, Ec = (e, t, n) => t.has(e) || Ha("Cannot " + n), Hh = (e, t, n) => (Ec(e, t, "read from private field"), t.get(e)), Nh = (e, t, n) => t.has(e) ? Ha("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Xh = (e, t, n, r) => (Ec(e, t, "write to private field"), t.set(e, n), n), Vt = class Wo {
1562
+ }, Ac = (e, t, n) => t.has(e) || Ha("Cannot " + n), Hh = (e, t, n) => (Ac(e, t, "read from private field"), t.get(e)), Nh = (e, t, n) => t.has(e) ? Ha("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Xh = (e, t, n, r) => (Ac(e, t, "write to private field"), t.set(e, n), n), Vt = class Wo {
1560
1563
  /**
1561
1564
  * @param {number} Coordinate of the point on the horizontal axis
1562
1565
  * @param {number} Coordinate of the point on the vertical axis
@@ -1719,8 +1722,8 @@ var Mc, $c, Fo, fa, Zr, Na = class extends (Fo = cn, $c = [De], Mc = [De], Fo) {
1719
1722
  };
1720
1723
  Zr = Vh(Fo);
1721
1724
  fa = /* @__PURE__ */ new WeakMap();
1722
- Ac(Zr, 2, "delta", $c, Na);
1723
- Ac(Zr, 2, "direction", Mc, Na);
1725
+ Ec(Zr, 2, "delta", $c, Na);
1726
+ Ec(Zr, 2, "direction", Mc, Na);
1724
1727
  zh(Zr, Na);
1725
1728
  function Oo({ x: e, y: t }, n) {
1726
1729
  const r = Math.abs(e), a = Math.abs(t);
@@ -1746,7 +1749,7 @@ var Tc = /* @__PURE__ */ ((e) => (e.Horizontal = "x", e.Vertical = "y", e))(Tc |
1746
1749
  }, nr = (e) => {
1747
1750
  var t;
1748
1751
  return [, , , Yh((t = e?.[Wc("metadata")]) != null ? t : null)];
1749
- }, Vc = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], pr = (e) => e !== void 0 && typeof e != "function" ? tr("Function expected") : e, qh = (e, t, n, r, a) => ({ kind: Vc[e], name: t, metadata: r, addInitializer: (o) => n._ ? tr("Already initialized") : a.push(pr(o || null)) }), An = (e, t) => Bo(t, Wc("metadata"), e[3]), ee = (e, t, n, r) => {
1752
+ }, Vc = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], pr = (e) => e !== void 0 && typeof e != "function" ? tr("Function expected") : e, qh = (e, t, n, r, a) => ({ kind: Vc[e], name: t, metadata: r, addInitializer: (o) => n._ ? tr("Already initialized") : a.push(pr(o || null)) }), En = (e, t) => Bo(t, Wc("metadata"), e[3]), ee = (e, t, n, r) => {
1750
1753
  for (var a = 0, o = e[t >> 1], s = o && o.length; a < s; a++) t & 1 ? o[a].call(n) : r = o[a].call(n, r);
1751
1754
  return r;
1752
1755
  }, de = (e, t, n, r, a, o) => {
@@ -1758,7 +1761,7 @@ var Tc = /* @__PURE__ */ ((e) => (e.Horizontal = "x", e.Vertical = "y", e))(Tc |
1758
1761
  d ? f && d < 4 && cl(o, (d > 2 ? "set " : d > 1 ? "get " : "") + n) : cl(a, n);
1759
1762
  for (var w = r.length - 1; w >= 0; w--)
1760
1763
  c = qh(d, n, l = {}, e[3], p), d && (c.static = h, c.private = f, u = c.access = { has: f ? (g) => Jh(a, g) : (g) => n in g }, d ^ 3 && (u.get = f ? (g) => (d ^ 1 ? je : Qh)(g, a, d ^ 4 ? o : b.get) : (g) => g[n]), d > 2 && (u.set = f ? (g, _) => It(g, a, _, d ^ 4 ? o : b.set) : (g, _) => g[n] = _)), i = (0, r[w])(d ? d < 4 ? f ? o : b[y] : d > 4 ? void 0 : { get: b.get, set: b.set } : a, c), l._ = 1, d ^ 4 || i === void 0 ? pr(i) && (d > 4 ? v.unshift(i) : d ? f ? o = i : b[y] = i : a = i) : typeof i != "object" || i === null ? tr("Object expected") : (pr(s = i.get) && (b.get = s), pr(s = i.set) && (b.set = s), pr(s = i.init) && v.unshift(s));
1761
- return d || An(e, a), b && bs(a, n, b), f ? d ^ 4 ? o : b : a;
1764
+ return d || En(e, a), b && bs(a, n, b), f ? d ^ 4 ? o : b : a;
1762
1765
  }, ws = (e, t, n) => t.has(e) || tr("Cannot " + n), Jh = (e, t) => Object(t) !== t ? tr('Cannot use the "in" operator on this value') : e.has(t), je = (e, t, n) => (ws(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Ce = (e, t, n) => t.has(e) ? tr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), It = (e, t, n, r) => (ws(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), Qh = (e, t, n) => (ws(e, t, "access private method"), n);
1763
1766
  function Lc(e, t) {
1764
1767
  return {
@@ -1862,7 +1865,7 @@ Tr = nr(null);
1862
1865
  xs = /* @__PURE__ */ new WeakMap();
1863
1866
  ha = /* @__PURE__ */ new WeakMap();
1864
1867
  de(Tr, 4, "disabled", zc, pt, xs);
1865
- An(Tr, pt);
1868
+ En(Tr, pt);
1866
1869
  var Hr = class extends pt {
1867
1870
  }, pa, ho = class {
1868
1871
  /**
@@ -2133,17 +2136,17 @@ var ap = class extends Hr {
2133
2136
  }
2134
2137
  );
2135
2138
  }
2136
- }, Cs = /* @__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))(Cs || {}), Ss = /* @__PURE__ */ ((e) => (e[e.Collision = 0] = "Collision", e[e.ShapeIntersection = 1] = "ShapeIntersection", e[e.PointerIntersection = 2] = "PointerIntersection", e))(Ss || {}), Zc, Hc, Nc, Xc, Gc, Yc, Uc, Et, ks;
2139
+ }, Cs = /* @__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))(Cs || {}), Ss = /* @__PURE__ */ ((e) => (e[e.Collision = 0] = "Collision", e[e.ShapeIntersection = 1] = "ShapeIntersection", e[e.PointerIntersection = 2] = "PointerIntersection", e))(Ss || {}), Zc, Hc, Nc, Xc, Gc, Yc, Uc, At, ks;
2137
2140
  Uc = [fe], Yc = [De], Gc = [De], Xc = [De], Nc = [De], Hc = [De], Zc = [De];
2138
2141
  var qt = class {
2139
2142
  constructor() {
2140
- ee(Et, 5, this), Ce(this, ks, ee(
2141
- Et,
2143
+ ee(At, 5, this), Ce(this, ks, ee(
2144
+ At,
2142
2145
  8,
2143
2146
  this,
2144
2147
  "idle"
2145
2148
  /* Idle */
2146
- )), ee(Et, 11, this);
2149
+ )), ee(At, 11, this);
2147
2150
  }
2148
2151
  get current() {
2149
2152
  return this.value;
@@ -2173,16 +2176,16 @@ var qt = class {
2173
2176
  this.value = e;
2174
2177
  }
2175
2178
  };
2176
- Et = nr(null);
2179
+ At = nr(null);
2177
2180
  ks = /* @__PURE__ */ new WeakMap();
2178
- de(Et, 4, "value", Uc, qt, ks);
2179
- de(Et, 2, "current", Yc, qt);
2180
- de(Et, 2, "idle", Gc, qt);
2181
- de(Et, 2, "initializing", Xc, qt);
2182
- de(Et, 2, "initialized", Nc, qt);
2183
- de(Et, 2, "dragging", Hc, qt);
2184
- de(Et, 2, "dropped", Zc, qt);
2185
- An(Et, qt);
2181
+ de(At, 4, "value", Uc, qt, ks);
2182
+ de(At, 2, "current", Yc, qt);
2183
+ de(At, 2, "idle", Gc, qt);
2184
+ de(At, 2, "initializing", Xc, qt);
2185
+ de(At, 2, "initialized", Nc, qt);
2186
+ de(At, 2, "dragging", Hc, qt);
2187
+ de(At, 2, "dropped", Zc, qt);
2188
+ En(At, qt);
2186
2189
  var op = class {
2187
2190
  /**
2188
2191
  * Creates a new instance of drag actions.
@@ -2362,7 +2365,7 @@ var op = class {
2362
2365
  }), o ? o.then(i).catch(() => r.reset()) : i();
2363
2366
  });
2364
2367
  }
2365
- }, Kc, jc, qc, Jc, ht, Is, As, Es, Ms;
2368
+ }, Kc, jc, qc, Jc, ht, Is, Es, As, Ms;
2366
2369
  Jc = [fe], qc = [fe], jc = [fe], Kc = [fe];
2367
2370
  var un = class {
2368
2371
  /**
@@ -2372,7 +2375,7 @@ var un = class {
2372
2375
  * @param manager - The manager that controls the drag and drop operations.
2373
2376
  */
2374
2377
  constructor(e, t) {
2375
- Ce(this, Is, ee(ht, 8, this)), ee(ht, 11, this), Ce(this, As, ee(ht, 12, this)), ee(ht, 15, this), Ce(this, Es, ee(ht, 16, this)), ee(ht, 19, this), Ce(this, Ms, ee(ht, 20, this)), ee(ht, 23, this);
2378
+ Ce(this, Is, ee(ht, 8, this)), ee(ht, 11, this), Ce(this, Es, ee(ht, 12, this)), ee(ht, 15, this), Ce(this, As, ee(ht, 16, this)), ee(ht, 19, this), Ce(this, Ms, ee(ht, 20, this)), ee(ht, 23, this);
2376
2379
  const { effects: n, id: r, data: a = {}, disabled: o = !1, register: s = !0 } = e;
2377
2380
  let i = r;
2378
2381
  this.manager = t, this.id = r, this.data = a, this.disabled = o, this.effects = () => {
@@ -2414,14 +2417,14 @@ var un = class {
2414
2417
  };
2415
2418
  ht = nr(null);
2416
2419
  Is = /* @__PURE__ */ new WeakMap();
2417
- As = /* @__PURE__ */ new WeakMap();
2418
2420
  Es = /* @__PURE__ */ new WeakMap();
2421
+ As = /* @__PURE__ */ new WeakMap();
2419
2422
  Ms = /* @__PURE__ */ new WeakMap();
2420
2423
  de(ht, 4, "manager", Jc, un, Is);
2421
- de(ht, 4, "id", qc, un, As);
2422
- de(ht, 4, "data", jc, un, Es);
2424
+ de(ht, 4, "id", qc, un, Es);
2425
+ de(ht, 4, "data", jc, un, As);
2423
2426
  de(ht, 4, "disabled", Kc, un, Ms);
2424
- An(ht, un);
2427
+ En(ht, un);
2425
2428
  var ul = class {
2426
2429
  constructor() {
2427
2430
  this.map = Vr(/* @__PURE__ */ new Map()), this.cleanupFunctions = /* @__PURE__ */ new WeakMap(), this.register = (e, t) => {
@@ -2507,7 +2510,7 @@ de(lt, 4, "status", nu, zt, Ds);
2507
2510
  de(lt, 2, "isDropping", tu, zt);
2508
2511
  de(lt, 2, "isDragging", eu, zt);
2509
2512
  de(lt, 2, "isDragSource", Qc, zt);
2510
- An(lt, zt);
2513
+ En(lt, zt);
2511
2514
  var ou, su, iu, lu, cu, uu, Lo, Xe, Ps, Rs, Ws, Fs, Os, Zt = class extends (Lo = un, uu = [fe], cu = [fe], lu = [fe], iu = [fe], su = [fe], ou = [De], Lo) {
2512
2515
  constructor(t, n) {
2513
2516
  var r = t, { accept: a, collisionDetector: o, collisionPriority: s, type: i } = r, l = Bc(r, ["accept", "collisionDetector", "collisionPriority", "type"]);
@@ -2540,7 +2543,7 @@ de(Xe, 4, "collisionDetector", lu, Zt, Ws);
2540
2543
  de(Xe, 4, "collisionPriority", iu, Zt, Fs);
2541
2544
  de(Xe, 4, "shape", su, Zt, Os);
2542
2545
  de(Xe, 2, "isDropTarget", ou, Zt);
2543
- An(Xe, Zt);
2546
+ En(Xe, Zt);
2544
2547
  var Gn = class extends pt {
2545
2548
  /**
2546
2549
  * Creates a new sensor instance.
@@ -2760,7 +2763,7 @@ de(Pe, 4, "modifiers", mu, Rt, Zs);
2760
2763
  de(Pe, 2, "source", pu, Rt);
2761
2764
  de(Pe, 2, "target", hu, Rt);
2762
2765
  de(Pe, 2, "transform", fu, Rt);
2763
- An(Pe, Rt);
2766
+ En(Pe, Rt);
2764
2767
  var lp = {
2765
2768
  get rendering() {
2766
2769
  return Promise.resolve();
@@ -2887,12 +2890,12 @@ function Cn(e) {
2887
2890
  function Cu(e) {
2888
2891
  return e instanceof $t(e).SVGElement || "namespaceURI" in e && typeof e.namespaceURI == "string" && e.namespaceURI.endsWith("svg");
2889
2892
  }
2890
- function En(e) {
2893
+ function An(e) {
2891
2894
  return e ? Ns(e) ? e.document : Nr(e) ? Xs(e) ? e : Cn(e) || Cu(e) ? e.ownerDocument : document : document : document;
2892
2895
  }
2893
2896
  function dp(e) {
2894
2897
  var t, n, r, a;
2895
- const { documentElement: o } = En(e), s = $t(e).visualViewport, i = (t = s?.width) != null ? t : o.clientWidth, l = (n = s?.height) != null ? n : o.clientHeight, c = (r = s?.offsetTop) != null ? r : 0, u = (a = s?.offsetLeft) != null ? a : 0;
2898
+ const { documentElement: o } = An(e), s = $t(e).visualViewport, i = (t = s?.width) != null ? t : o.clientWidth, l = (n = s?.height) != null ? n : o.clientHeight, c = (r = s?.offsetTop) != null ? r : 0, u = (a = s?.offsetLeft) != null ? a : 0;
2896
2899
  return {
2897
2900
  top: c,
2898
2901
  left: u,
@@ -2911,19 +2914,19 @@ function fp(e, t) {
2911
2914
  function hp(e) {
2912
2915
  return e.tagName === "DETAILS";
2913
2916
  }
2914
- function Aa(e, t = e.getBoundingClientRect(), n = 0) {
2917
+ function Ea(e, t = e.getBoundingClientRect(), n = 0) {
2915
2918
  var r, a, o, s, i;
2916
2919
  let l = t;
2917
2920
  const { ownerDocument: c } = e, u = (r = c.defaultView) != null ? r : window;
2918
2921
  let d = e.parentElement;
2919
2922
  for (; d && d !== c.documentElement; ) {
2920
2923
  if (!fp(d)) {
2921
- const w = d.getBoundingClientRect(), g = n * (w.bottom - w.top), _ = n * (w.right - w.left), C = n * (w.bottom - w.top), S = n * (w.right - w.left);
2924
+ const w = d.getBoundingClientRect(), g = n * (w.bottom - w.top), _ = n * (w.right - w.left), S = n * (w.bottom - w.top), C = n * (w.right - w.left);
2922
2925
  l = {
2923
2926
  top: Math.max(l.top, w.top - g),
2924
2927
  right: Math.min(l.right, w.right + _),
2925
- bottom: Math.min(l.bottom, w.bottom + C),
2926
- left: Math.max(l.left, w.left - S),
2928
+ bottom: Math.min(l.bottom, w.bottom + S),
2929
+ left: Math.max(l.left, w.left - C),
2927
2930
  width: 0,
2928
2931
  // Will be calculated next
2929
2932
  height: 0
@@ -2993,7 +2996,7 @@ function ku() {
2993
2996
  function Ys(e) {
2994
2997
  return !e || !Nr(e) ? !1 : e instanceof $t(e).ShadowRoot;
2995
2998
  }
2996
- function Ea(e) {
2999
+ function Aa(e) {
2997
3000
  if (e && Nr(e)) {
2998
3001
  let t = e.getRootNode();
2999
3002
  if (Ys(t))
@@ -3001,7 +3004,7 @@ function Ea(e) {
3001
3004
  if (t instanceof Document)
3002
3005
  return t;
3003
3006
  }
3004
- return En(e);
3007
+ return An(e);
3005
3008
  }
3006
3009
  function Iu(e) {
3007
3010
  return e.matchMedia("(prefers-reduced-motion: reduce)").matches;
@@ -3022,13 +3025,13 @@ function dl(e) {
3022
3025
  function fl(e) {
3023
3026
  return e.tagName === "CANVAS";
3024
3027
  }
3025
- function Au(e, { x: t, y: n }) {
3028
+ function Eu(e, { x: t, y: n }) {
3026
3029
  const r = e.elementFromPoint(t, n);
3027
3030
  if (mp(r)) {
3028
3031
  const { contentDocument: a } = r;
3029
3032
  if (a) {
3030
3033
  const { left: o, top: s } = r.getBoundingClientRect();
3031
- return Au(a, {
3034
+ return Eu(a, {
3032
3035
  x: t - o,
3033
3036
  y: n - s
3034
3037
  });
@@ -3050,7 +3053,7 @@ function gp(e) {
3050
3053
  [contenteditable]:not([contenteditable="false"])
3051
3054
  `);
3052
3055
  }
3053
- var Eu = class {
3056
+ var Au = class {
3054
3057
  constructor() {
3055
3058
  this.entries = /* @__PURE__ */ new Set(), this.clear = () => {
3056
3059
  for (const e of this.entries) {
@@ -3106,7 +3109,7 @@ function bp(e, t) {
3106
3109
  return e === t ? !0 : !e || !t ? !1 : e.top == t.top && e.left == t.left && e.right == t.right && e.bottom == t.bottom;
3107
3110
  }
3108
3111
  function wp(e, t = e.getBoundingClientRect()) {
3109
- const { width: n, height: r } = Aa(
3112
+ const { width: n, height: r } = Ea(
3110
3113
  e,
3111
3114
  t
3112
3115
  );
@@ -3144,18 +3147,18 @@ var pl = Array.from({ length: 100 }, (e, t) => t / 100), $u = 75, yn, Ma, en, bn
3144
3147
  const { element: l } = this;
3145
3148
  if ((o = re(this, bn)) == null || o.disconnect(), re(this, kr) || !re(this, yn) || !l.isConnected)
3146
3149
  return;
3147
- const c = (s = l.ownerDocument) != null ? s : document, { innerHeight: u, innerWidth: d } = (i = c.defaultView) != null ? i : window, h = l.getBoundingClientRect(), f = Aa(l, h), { top: m, left: y, bottom: v, right: p } = f, b = -Math.floor(m), w = -Math.floor(y), g = -Math.floor(d - p), _ = -Math.floor(u - v), C = `${b}px ${g}px ${_}px ${w}px`;
3150
+ const c = (s = l.ownerDocument) != null ? s : document, { innerHeight: u, innerWidth: d } = (i = c.defaultView) != null ? i : window, h = l.getBoundingClientRect(), f = Ea(l, h), { top: m, left: y, bottom: v, right: p } = f, b = -Math.floor(m), w = -Math.floor(y), g = -Math.floor(d - p), _ = -Math.floor(u - v), S = `${b}px ${g}px ${_}px ${w}px`;
3148
3151
  this.boundingClientRect = h, yt(this, bn, new IntersectionObserver(
3149
- (S) => {
3150
- const [k] = S, { intersectionRect: I } = k;
3152
+ (C) => {
3153
+ const [k] = C, { intersectionRect: I } = k;
3151
3154
  (k.intersectionRatio !== 1 ? k.intersectionRatio : zr.intersectionRatio(
3152
3155
  I,
3153
- Aa(l)
3156
+ Ea(l)
3154
3157
  )) !== 1 && re(this, yr).call(this);
3155
3158
  },
3156
3159
  {
3157
3160
  threshold: pl,
3158
- rootMargin: C,
3161
+ rootMargin: S,
3159
3162
  root: c
3160
3163
  }
3161
3164
  )), re(this, bn).observe(l), xu(this, $a, Tu).call(this);
@@ -3192,7 +3195,7 @@ Tu = function() {
3192
3195
  };
3193
3196
  Du = function() {
3194
3197
  if (re(this, Qe)) {
3195
- const { top: e, left: t, width: n, height: r } = Aa(
3198
+ const { top: e, left: t, width: n, height: r } = Ea(
3196
3199
  this.element
3197
3200
  );
3198
3201
  re(this, Qe).style.overflow = "hidden", re(this, Qe).style.visibility = "visible", re(this, Qe).style.top = `${Math.floor(e)}px`, re(this, Qe).style.left = `${Math.floor(t)}px`, re(this, Qe).style.width = `${Math.floor(n)}px`, re(this, Qe).style.height = `${Math.floor(r)}px`;
@@ -3273,7 +3276,7 @@ function Pr(e) {
3273
3276
  }
3274
3277
  }
3275
3278
  function ml(e) {
3276
- return !Su || !e ? !1 : e === En(e).scrollingElement;
3279
+ return !Su || !e ? !1 : e === An(e).scrollingElement;
3277
3280
  }
3278
3281
  function Ru(e) {
3279
3282
  var t, n;
@@ -3302,7 +3305,7 @@ function Ru(e) {
3302
3305
  isRight: d
3303
3306
  };
3304
3307
  }
3305
- function Ap(e, t) {
3308
+ function Ep(e, t) {
3306
3309
  const { isTop: n, isBottom: r, isLeft: a, isRight: o, position: s } = Ru(e), { x: i, y: l } = t ?? { x: 0, y: 0 }, c = !n && s.current.y + l > 0, u = !r && s.current.y + l < s.max.y, d = !a && s.current.x + i > 0, h = !o && s.current.x + i < s.max.x;
3307
3310
  return {
3308
3311
  top: c,
@@ -3329,11 +3332,11 @@ var Us = class {
3329
3332
  }
3330
3333
  }, Ta = new Us((e) => {
3331
3334
  typeof requestAnimationFrame == "function" ? requestAnimationFrame(e) : e();
3332
- }), Ep = new Us((e) => setTimeout(e, 50)), Da = /* @__PURE__ */ new Map(), Mp = Da.clear.bind(Da);
3335
+ }), Ap = new Us((e) => setTimeout(e, 50)), Da = /* @__PURE__ */ new Map(), Mp = Da.clear.bind(Da);
3333
3336
  function Jt(e, t = !1) {
3334
3337
  if (!t) return gl(e);
3335
3338
  let n = Da.get(e);
3336
- return n || (n = gl(e), Da.set(e, n), Ep.schedule(Mp), n);
3339
+ return n || (n = gl(e), Da.set(e, n), Ap.schedule(Mp), n);
3337
3340
  }
3338
3341
  function gl(e) {
3339
3342
  return $t(e).getComputedStyle(e);
@@ -3472,7 +3475,7 @@ function Fp(e) {
3472
3475
  }
3473
3476
  return null;
3474
3477
  }
3475
- var At = /* @__PURE__ */ ((e) => (e[e.Idle = 0] = "Idle", e[e.Forward = 1] = "Forward", e[e.Reverse = -1] = "Reverse", e))(At || {}), Op = {
3478
+ var Et = /* @__PURE__ */ ((e) => (e[e.Idle = 0] = "Idle", e[e.Forward = 1] = "Forward", e[e.Reverse = -1] = "Reverse", e))(Et || {}), Op = {
3476
3479
  x: 0.2,
3477
3480
  y: 0.2
3478
3481
  }, Bp = {
@@ -3649,7 +3652,7 @@ function Kp(e, t) {
3649
3652
  }
3650
3653
  return a;
3651
3654
  }
3652
- function Ar(e) {
3655
+ function Er(e) {
3653
3656
  return "style" in e && typeof e.style == "object" && e.style !== null && "setProperty" in e.style && "removeProperty" in e.style && typeof e.style.setProperty == "function" && typeof e.style.removeProperty == "function";
3654
3657
  }
3655
3658
  var jp = class {
@@ -3658,7 +3661,7 @@ var jp = class {
3658
3661
  }
3659
3662
  set(e, t = "") {
3660
3663
  const { element: n } = this;
3661
- if (Ar(n))
3664
+ if (Er(n))
3662
3665
  for (const [r, a] of Object.entries(e)) {
3663
3666
  const o = `${t}${r}`;
3664
3667
  this.initial.has(o) || this.initial.set(o, n.style.getPropertyValue(o)), n.style.setProperty(
@@ -3669,7 +3672,7 @@ var jp = class {
3669
3672
  }
3670
3673
  remove(e, t = "") {
3671
3674
  const { element: n } = this;
3672
- if (Ar(n))
3675
+ if (Er(n))
3673
3676
  for (const r of e) {
3674
3677
  const a = `${t}${r}`;
3675
3678
  n.style.removeProperty(a);
@@ -3677,7 +3680,7 @@ var jp = class {
3677
3680
  }
3678
3681
  reset() {
3679
3682
  const { element: e } = this;
3680
- if (Ar(e)) {
3683
+ if (Er(e)) {
3681
3684
  for (const [t, n] of this.initial)
3682
3685
  e.style.setProperty(t, n);
3683
3686
  e.getAttribute("style") === "" && e.removeAttribute("style");
@@ -3776,15 +3779,15 @@ var em = ({
3776
3779
  return r;
3777
3780
  }, _t = (e, t, n, r, a, o) => {
3778
3781
  var s, i, l, c, u, d = t & 7, h = !!(t & 8), f = !!(t & 16), m = d > 3 ? e.length + 1 : d ? h ? 1 : 2 : 0, y = Vu[d + 5], v = d > 3 && (e[m - 1] = []), p = e[m] || (e[m] = []), b = d && (!f && !h && (a = a.prototype), d < 5 && (d > 3 || !f) && om(d < 4 ? a : { get [n]() {
3779
- return Ee(this, o);
3782
+ return Ae(this, o);
3780
3783
  }, set [n](g) {
3781
3784
  return ct(this, o, g);
3782
3785
  } }, n));
3783
3786
  d ? f && d < 4 && vl(o, (d > 2 ? "set " : d > 1 ? "get " : "") + n) : vl(a, n);
3784
3787
  for (var w = r.length - 1; w >= 0; w--)
3785
- c = im(d, n, l = {}, e[3], p), d && (c.static = h, c.private = f, u = c.access = { has: f ? (g) => lm(a, g) : (g) => n in g }, d ^ 3 && (u.get = f ? (g) => (d ^ 1 ? Ee : kn)(g, a, d ^ 4 ? o : b.get) : (g) => g[n]), d > 2 && (u.set = f ? (g, _) => ct(g, a, _, d ^ 4 ? o : b.set) : (g, _) => g[n] = _)), i = (0, r[w])(d ? d < 4 ? f ? o : b[y] : d > 4 ? void 0 : { get: b.get, set: b.set } : a, c), l._ = 1, d ^ 4 || i === void 0 ? _r(i) && (d > 4 ? v.unshift(i) : d ? f ? o = i : b[y] = i : a = i) : typeof i != "object" || i === null ? ar("Object expected") : (_r(s = i.get) && (b.get = s), _r(s = i.set) && (b.set = s), _r(s = i.init) && v.unshift(s));
3788
+ c = im(d, n, l = {}, e[3], p), d && (c.static = h, c.private = f, u = c.access = { has: f ? (g) => lm(a, g) : (g) => n in g }, d ^ 3 && (u.get = f ? (g) => (d ^ 1 ? Ae : kn)(g, a, d ^ 4 ? o : b.get) : (g) => g[n]), d > 2 && (u.set = f ? (g, _) => ct(g, a, _, d ^ 4 ? o : b.set) : (g, _) => g[n] = _)), i = (0, r[w])(d ? d < 4 ? f ? o : b[y] : d > 4 ? void 0 : { get: b.get, set: b.set } : a, c), l._ = 1, d ^ 4 || i === void 0 ? _r(i) && (d > 4 ? v.unshift(i) : d ? f ? o = i : b[y] = i : a = i) : typeof i != "object" || i === null ? ar("Object expected") : (_r(s = i.get) && (b.get = s), _r(s = i.set) && (b.set = s), _r(s = i.init) && v.unshift(s));
3786
3789
  return d || Mn(e, a), b && Js(a, n, b), f ? d ^ 4 ? o : b : a;
3787
- }, ei = (e, t, n) => t.has(e) || ar("Cannot " + n), lm = (e, t) => Object(t) !== t ? ar('Cannot use the "in" operator on this value') : e.has(t), Ee = (e, t, n) => (ei(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Re = (e, t, n) => t.has(e) ? ar("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ct = (e, t, n, r) => (ei(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), kn = (e, t, n) => (ei(e, t, "access private method"), n), yl = {
3790
+ }, ei = (e, t, n) => t.has(e) || ar("Cannot " + n), lm = (e, t) => Object(t) !== t ? ar('Cannot use the "in" operator on this value') : e.has(t), Ae = (e, t, n) => (ei(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Re = (e, t, n) => t.has(e) ? ar("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ct = (e, t, n, r) => (ei(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), kn = (e, t, n) => (ei(e, t, "access private method"), n), yl = {
3788
3791
  role: "button",
3789
3792
  roleDescription: "draggable"
3790
3793
  }, cm = "dnd-kit-description", um = "dnd-kit-announcement", dm = {
@@ -3835,13 +3838,13 @@ var gm = ["dragover", "dragmove"], vm = class extends pt {
3835
3838
  y,
3836
3839
  i
3837
3840
  ), p = Object.entries(o).map(
3838
- ([_, C]) => this.manager.monitor.addEventListener(
3841
+ ([_, S]) => this.manager.monitor.addEventListener(
3839
3842
  _,
3840
- (S, k) => {
3843
+ (C, k) => {
3841
3844
  const I = h;
3842
3845
  if (!I) return;
3843
- const A = C?.(S, k);
3844
- A && I.nodeValue !== A && (f = A, gm.includes(_) ? v() : (y(), v.cancel()));
3846
+ const E = S?.(C, k);
3847
+ E && I.nodeValue !== E && (f = E, gm.includes(_) ? v() : (y(), v.cancel()));
3845
3848
  }
3846
3849
  )
3847
3850
  ), b = () => {
@@ -3858,26 +3861,26 @@ var gm = ["dragover", "dragmove"], vm = class extends pt {
3858
3861
  this.registerEffect(() => {
3859
3862
  var _;
3860
3863
  w.clear();
3861
- for (const C of this.manager.registry.draggables.value) {
3862
- const S = (_ = C.handle) != null ? _ : C.element;
3863
- if (S) {
3864
- (!u || !d) && w.add(b), (!hm(S) || Gs()) && !S.hasAttribute("tabindex") && w.add(() => S.setAttribute("tabindex", "0")), !S.hasAttribute("role") && S.tagName.toLowerCase() !== "button" && w.add(
3865
- () => S.setAttribute("role", yl.role)
3866
- ), S.hasAttribute("aria-roledescription") || w.add(
3867
- () => S.setAttribute(
3864
+ for (const S of this.manager.registry.draggables.value) {
3865
+ const C = (_ = S.handle) != null ? _ : S.element;
3866
+ if (C) {
3867
+ (!u || !d) && w.add(b), (!hm(C) || Gs()) && !C.hasAttribute("tabindex") && w.add(() => C.setAttribute("tabindex", "0")), !C.hasAttribute("role") && C.tagName.toLowerCase() !== "button" && w.add(
3868
+ () => C.setAttribute("role", yl.role)
3869
+ ), C.hasAttribute("aria-roledescription") || w.add(
3870
+ () => C.setAttribute(
3868
3871
  "aria-roledescription",
3869
3872
  yl.roleDescription
3870
3873
  )
3871
- ), S.hasAttribute("aria-describedby") || w.add(
3872
- () => S.setAttribute("aria-describedby", l)
3874
+ ), C.hasAttribute("aria-describedby") || w.add(
3875
+ () => C.setAttribute("aria-describedby", l)
3873
3876
  );
3874
3877
  for (const I of ["aria-pressed", "aria-grabbed"]) {
3875
- const A = String(C.isDragging);
3876
- S.getAttribute(I) !== A && w.add(() => S.setAttribute(I, A));
3878
+ const E = String(S.isDragging);
3879
+ C.getAttribute(I) !== E && w.add(() => C.setAttribute(I, E));
3877
3880
  }
3878
- const k = String(C.disabled);
3879
- S.getAttribute("aria-disabled") !== k && w.add(
3880
- () => S.setAttribute("aria-disabled", k)
3881
+ const k = String(S.disabled);
3882
+ C.getAttribute("aria-disabled") !== k && w.add(
3883
+ () => C.setAttribute("aria-disabled", k)
3881
3884
  );
3882
3885
  }
3883
3886
  }
@@ -3900,7 +3903,7 @@ var bm = class extends pt {
3900
3903
  const n = ka(
3901
3904
  () => {
3902
3905
  var r;
3903
- return En((r = this.manager.dragOperation.source) == null ? void 0 : r.element);
3906
+ return An((r = this.manager.dragOperation.source) == null ? void 0 : r.element);
3904
3907
  }
3905
3908
  );
3906
3909
  this.destroy = Mt(() => {
@@ -3912,9 +3915,9 @@ var bm = class extends pt {
3912
3915
  }
3913
3916
  });
3914
3917
  }
3915
- }, Ra = /* @__PURE__ */ new Map(), Lu, zu, Zu, Hu, Yo, Er, jt, ti, jn, Nu, Xu, Gu, Yu, $n = class extends (Yo = Hr, Hu = [fe], Zu = [De], zu = [De], Lu = [De], Yo) {
3918
+ }, Ra = /* @__PURE__ */ new Map(), Lu, zu, Zu, Hu, Yo, Ar, jt, ti, jn, Nu, Xu, Gu, Yu, $n = class extends (Yo = Hr, Hu = [fe], Zu = [De], zu = [De], Lu = [De], Yo) {
3916
3919
  constructor(e) {
3917
- super(e), Be(jt, 5, this), Re(this, jn), Re(this, Er, /* @__PURE__ */ new Set()), Re(this, ti, Be(jt, 8, this, /* @__PURE__ */ new Set())), Be(jt, 11, this), this.registerEffect(kn(this, jn, Nu));
3920
+ super(e), Be(jt, 5, this), Re(this, jn), Re(this, Ar, /* @__PURE__ */ new Set()), Re(this, ti, Be(jt, 8, this, /* @__PURE__ */ new Set())), Be(jt, 11, this), this.registerEffect(kn(this, jn, Nu));
3918
3921
  }
3919
3922
  /**
3920
3923
  * Registers CSS rules to be injected into the active drag operation's
@@ -3924,8 +3927,8 @@ var bm = class extends pt {
3924
3927
  * Returns a cleanup function that unregisters the rules.
3925
3928
  */
3926
3929
  register(e) {
3927
- return Ee(this, Er).add(e), () => {
3928
- Ee(this, Er).delete(e);
3930
+ return Ae(this, Ar).add(e), () => {
3931
+ Ae(this, Ar).delete(e);
3929
3932
  };
3930
3933
  }
3931
3934
  /**
@@ -3946,12 +3949,12 @@ var bm = class extends pt {
3946
3949
  get sourceRoot() {
3947
3950
  var e;
3948
3951
  const { source: t } = this.manager.dragOperation;
3949
- return Ea((e = t?.element) != null ? e : null);
3952
+ return Aa((e = t?.element) != null ? e : null);
3950
3953
  }
3951
3954
  get targetRoot() {
3952
3955
  var e;
3953
3956
  const { target: t } = this.manager.dragOperation;
3954
- return Ea((e = t?.element) != null ? e : null);
3957
+ return Aa((e = t?.element) != null ? e : null);
3955
3958
  }
3956
3959
  get roots() {
3957
3960
  const { status: e } = this.manager.dragOperation;
@@ -3965,13 +3968,13 @@ var bm = class extends pt {
3965
3968
  }
3966
3969
  };
3967
3970
  jt = or(Yo);
3968
- Er = /* @__PURE__ */ new WeakMap();
3971
+ Ar = /* @__PURE__ */ new WeakMap();
3969
3972
  ti = /* @__PURE__ */ new WeakMap();
3970
3973
  jn = /* @__PURE__ */ new WeakSet();
3971
3974
  Nu = function() {
3972
3975
  const { roots: e } = this, t = [];
3973
3976
  for (const n of e)
3974
- for (const r of Ee(this, Er))
3977
+ for (const r of Ae(this, Ar))
3975
3978
  t.push(kn(this, jn, Xu).call(this, n, r));
3976
3979
  return () => {
3977
3980
  for (const n of t)
@@ -4151,7 +4154,7 @@ function bl(e) {
4151
4154
  function Ko(e) {
4152
4155
  return e.tagName === "TR";
4153
4156
  }
4154
- function Am(e, t, n) {
4157
+ function Em(e, t, n) {
4155
4158
  const r = new MutationObserver((a) => {
4156
4159
  let o = !1;
4157
4160
  for (const s of a) {
@@ -4166,7 +4169,7 @@ function Am(e, t, n) {
4166
4169
  continue;
4167
4170
  const l = e.getAttribute(i);
4168
4171
  if (i === "style") {
4169
- if (Ar(e) && Ar(t)) {
4172
+ if (Er(e) && Er(t)) {
4170
4173
  const c = e.style;
4171
4174
  for (const u of Array.from(t.style))
4172
4175
  c.getPropertyValue(u) === "" && t.style.removeProperty(u);
@@ -4187,7 +4190,7 @@ function Am(e, t, n) {
4187
4190
  childList: !0
4188
4191
  }), r;
4189
4192
  }
4190
- function Em(e, t, n) {
4193
+ function Am(e, t, n) {
4191
4194
  const r = new MutationObserver((a) => {
4192
4195
  for (const o of a)
4193
4196
  if (o.addedNodes.length !== 0)
@@ -4324,7 +4327,7 @@ wa = /* @__PURE__ */ new WeakSet();
4324
4327
  ju = function(e) {
4325
4328
  const { overlay: t } = this;
4326
4329
  if (!t || !e) return;
4327
- const n = Ea(t);
4330
+ const n = Aa(t);
4328
4331
  if (n)
4329
4332
  return e.addRoot(n);
4330
4333
  };
@@ -4346,21 +4349,21 @@ qu = function() {
4346
4349
  x: y.scaleX / m.scaleX,
4347
4350
  y: y.scaleY / m.scaleY
4348
4351
  };
4349
- let { width: w, height: g, top: _, left: C } = p;
4352
+ let { width: w, height: g, top: _, left: S } = p;
4350
4353
  v && (w = w / b.x, g = g / b.y);
4351
- const S = new jp(f), {
4354
+ const C = new jp(f), {
4352
4355
  transition: k,
4353
4356
  translate: I,
4354
- boxSizing: A,
4357
+ boxSizing: E,
4355
4358
  paddingBlockStart: D,
4356
4359
  paddingBlockEnd: R,
4357
- paddingInlineStart: E,
4360
+ paddingInlineStart: A,
4358
4361
  paddingInlineEnd: O,
4359
4362
  borderInlineStartWidth: B,
4360
4363
  borderInlineEndWidth: X,
4361
4364
  borderBlockStartWidth: J,
4362
4365
  borderBlockEndWidth: oe
4363
- } = Jt(u), L = d === "clone", ae = A === "content-box", se = ae ? parseInt(E) + parseInt(O) + parseInt(B) + parseInt(X) : 0, ie = ae ? parseInt(D) + parseInt(R) + parseInt(J) + parseInt(oe) : 0, ce = d !== "move" && !this.overlay ? Cm(l, L ? "clone" : "hidden") : null, ye = Se(
4366
+ } = Jt(u), L = d === "clone", ae = E === "content-box", se = ae ? parseInt(A) + parseInt(O) + parseInt(B) + parseInt(X) : 0, ie = ae ? parseInt(D) + parseInt(R) + parseInt(J) + parseInt(oe) : 0, ce = d !== "move" && !this.overlay ? Cm(l, L ? "clone" : "hidden") : null, ye = Se(
4364
4367
  () => qs(a.dragOperation.activatorEvent)
4365
4368
  );
4366
4369
  if (I !== "none") {
@@ -4370,11 +4373,11 @@ qu = function() {
4370
4373
  if (!h.transformOrigin) {
4371
4374
  const ne = Se(() => i.current);
4372
4375
  h.transformOrigin = {
4373
- x: (ne.x - C * m.scaleX - m.x) / (w * m.scaleX),
4376
+ x: (ne.x - S * m.scaleX - m.x) / (w * m.scaleX),
4374
4377
  y: (ne.y - _ * m.scaleY - m.y) / (g * m.scaleY)
4375
4378
  };
4376
4379
  }
4377
- const { transformOrigin: _e } = h, Fe = _ * m.scaleY + m.y, Y = C * m.scaleX + m.x;
4380
+ const { transformOrigin: _e } = h, Fe = _ * m.scaleY + m.y, Y = S * m.scaleX + m.x;
4378
4381
  if (!h.coordinates && (h.coordinates = {
4379
4382
  x: Y,
4380
4383
  y: Fe
@@ -4393,12 +4396,12 @@ qu = function() {
4393
4396
  x: N.x / m.scaleX + he.width,
4394
4397
  y: N.y / m.scaleY + he.height
4395
4398
  }, $ = {
4396
- left: C + U.x,
4399
+ left: S + U.x,
4397
4400
  top: _ + U.y
4398
4401
  };
4399
4402
  f.setAttribute(Bt, "true");
4400
4403
  const ge = Se(() => s.transform), Le = (t = h.translate) != null ? t : { x: 0, y: 0 }, Q = ge.x * m.scaleX + Le.x, be = ge.y * m.scaleY + Le.y, Ge = ku();
4401
- S.set(
4404
+ C.set(
4402
4405
  {
4403
4406
  width: w - se,
4404
4407
  height: g - ie,
@@ -4421,11 +4424,11 @@ qu = function() {
4421
4424
  width: w,
4422
4425
  height: g,
4423
4426
  top: _,
4424
- left: C,
4427
+ left: S,
4425
4428
  widthOffset: se,
4426
4429
  heightOffset: ie,
4427
4430
  delta: U,
4428
- styles: S,
4431
+ styles: C,
4429
4432
  dragOperation: s,
4430
4433
  getElementMutationObserver: () => qe,
4431
4434
  getSavedCellWidths: () => Oe,
@@ -4437,11 +4440,11 @@ qu = function() {
4437
4440
  const Je = $t(f), tt = (ne) => {
4438
4441
  this.manager.actions.stop({ event: ne });
4439
4442
  }, dt = Iu(Je);
4440
- ye && Je.addEventListener("resize", tt), Se(() => l.status) === "idle" && requestAnimationFrame(() => l.status = "dragging"), ce && (Ye.observe(ce), qe = Am(
4443
+ ye && Je.addEventListener("resize", tt), Se(() => l.status) === "idle" && requestAnimationFrame(() => l.status = "dragging"), ce && (Ye.observe(ce), qe = Em(
4441
4444
  u,
4442
4445
  ce,
4443
4446
  L
4444
- ), q = Em(
4447
+ ), q = Am(
4445
4448
  u,
4446
4449
  ce,
4447
4450
  f
@@ -4456,7 +4459,7 @@ qu = function() {
4456
4459
  if (qe?.disconnect(), q?.disconnect(), Ye.disconnect(), Je.removeEventListener("resize", tt), Ho(f) && (f.removeEventListener(
4457
4460
  "beforetoggle",
4458
4461
  bl
4459
- ), f.removeAttribute("popover")), f.removeAttribute(Bt), S.reset(), Oe && Ko(u)) {
4462
+ ), f.removeAttribute("popover")), f.removeAttribute(Bt), C.reset(), Oe && Ko(u)) {
4460
4463
  const Me = Array.from(u.cells);
4461
4464
  for (const [Ue, kt] of Me.entries())
4462
4465
  kt.style.width = (ne = Oe[Ue]) != null ? ne : "";
@@ -4477,7 +4480,7 @@ qu = function() {
4477
4480
  var we;
4478
4481
  return (we = s.shape) == null ? void 0 : we.current;
4479
4482
  }), Ie = ye && !dt ? "250ms cubic-bezier(0.25, 1, 0.5, 1)" : "0ms linear";
4480
- if (S.set(
4483
+ if (C.set(
4481
4484
  {
4482
4485
  transition: `${k}, translate ${Ie}`,
4483
4486
  translate: `${kt.x}px ${kt.y}px 0`
@@ -4516,7 +4519,7 @@ qu = function() {
4516
4519
  moved: Me,
4517
4520
  transition: k,
4518
4521
  alignment: l.alignment,
4519
- styles: S,
4522
+ styles: C,
4520
4523
  animation: ne ?? void 0,
4521
4524
  getElementMutationObserver: () => qe,
4522
4525
  cleanup: G,
@@ -4534,16 +4537,16 @@ _t(Wr, 4, "overlay", Ku, Fr, ni);
4534
4537
  Mn(Wr, Fr);
4535
4538
  Fr.configure = rr(Fr);
4536
4539
  var qo = Fr, lr = !0, Pm = !1, Ju, Qu, ed, td, rn, ri, ai;
4537
- td = (ed = [fe], At.Forward), Qu = (Ju = [fe], At.Reverse);
4540
+ td = (ed = [fe], Et.Forward), Qu = (Ju = [fe], Et.Reverse);
4538
4541
  var Or = class {
4539
4542
  constructor() {
4540
4543
  Re(this, ri, Be(rn, 8, this, lr)), Be(rn, 11, this), Re(this, ai, Be(rn, 12, this, lr)), Be(rn, 15, this);
4541
4544
  }
4542
4545
  isLocked(e) {
4543
- return e === At.Idle ? !1 : e == null ? this[At.Forward] === lr && this[At.Reverse] === lr : this[e] === lr;
4546
+ return e === Et.Idle ? !1 : e == null ? this[Et.Forward] === lr && this[Et.Reverse] === lr : this[e] === lr;
4544
4547
  }
4545
4548
  unlock(e) {
4546
- e !== At.Idle && (this[e] = Pm);
4549
+ e !== Et.Idle && (this[e] = Pm);
4547
4550
  }
4548
4551
  };
4549
4552
  rn = or(null);
@@ -4552,7 +4555,7 @@ ai = /* @__PURE__ */ new WeakMap();
4552
4555
  _t(rn, 4, td, ed, Or, ri);
4553
4556
  _t(rn, 4, Qu, Ju, Or, ai);
4554
4557
  Mn(rn, Or);
4555
- var Rm = [At.Forward, At.Reverse], wl = class {
4558
+ var Rm = [Et.Forward, Et.Reverse], wl = class {
4556
4559
  constructor() {
4557
4560
  this.x = new Or(), this.y = new Or();
4558
4561
  }
@@ -4596,9 +4599,9 @@ function _l(e, t) {
4596
4599
  var nd, Jo, Br, oi, tn, Qo, Ya = class extends (Jo = Hr, nd = [fe], Jo) {
4597
4600
  constructor(e) {
4598
4601
  super(e), Re(this, oi, Be(Br, 8, this, !1)), Be(Br, 11, this), Re(this, tn), Re(this, Qo, () => {
4599
- if (!Ee(this, tn))
4602
+ if (!Ae(this, tn))
4600
4603
  return;
4601
- const { element: o, by: s } = Ee(this, tn);
4604
+ const { element: o, by: s } = Ae(this, tn);
4602
4605
  s.y && (o.scrollTop += s.y), s.x && (o.scrollLeft += s.x);
4603
4606
  }), this.scroll = (o) => {
4604
4607
  var s;
@@ -4616,7 +4619,7 @@ var nd, Jo, Br, oi, tn, Qo, Ya = class extends (Jo = Hr, nd = [fe], Jo) {
4616
4619
  if (h?.isLocked())
4617
4620
  return !1;
4618
4621
  for (const f of i) {
4619
- const m = Ap(f, u);
4622
+ const m = Ep(f, u);
4620
4623
  if (m.x || m.y) {
4621
4624
  const { speed: y, direction: v } = Vp(
4622
4625
  f,
@@ -4629,7 +4632,7 @@ var nd, Jo, Br, oi, tn, Qo, Ya = class extends (Jo = Hr, nd = [fe], Jo) {
4629
4632
  if (v.x || v.y) {
4630
4633
  const { x: p, y: b } = u ?? v, w = p * y.x, g = b * y.y;
4631
4634
  if (w || g) {
4632
- const _ = (s = Ee(this, tn)) == null ? void 0 : s.by;
4635
+ const _ = (s = Ae(this, tn)) == null ? void 0 : s.by;
4633
4636
  if (this.autoScrolling && _ && (_.x && !w || _.y && !g))
4634
4637
  continue;
4635
4638
  return ct(this, tn, {
@@ -4638,7 +4641,7 @@ var nd, Jo, Br, oi, tn, Qo, Ya = class extends (Jo = Hr, nd = [fe], Jo) {
4638
4641
  x: w,
4639
4642
  y: g
4640
4643
  }
4641
- }), Ta.schedule(Ee(this, Qo)), !0;
4644
+ }), Ta.schedule(Ae(this, Qo)), !0;
4642
4645
  }
4643
4646
  }
4644
4647
  }
@@ -4651,13 +4654,13 @@ var nd, Jo, Br, oi, tn, Qo, Ya = class extends (Jo = Hr, nd = [fe], Jo) {
4651
4654
  const { position: o, source: s } = e.dragOperation;
4652
4655
  if (!o)
4653
4656
  return null;
4654
- const i = Au(
4655
- Ea(s?.element),
4657
+ const i = Eu(
4658
+ Aa(s?.element),
4656
4659
  o.current
4657
4660
  );
4658
4661
  return i && (t = i), i ?? t;
4659
4662
  }), a = ka(() => {
4660
- const o = r.value, { documentElement: s } = En(o);
4663
+ const o = r.value, { documentElement: s } = An(o);
4661
4664
  if (!o || o === s) {
4662
4665
  const { target: i } = e.dragOperation, l = i?.element;
4663
4666
  if (l) {
@@ -4687,7 +4690,7 @@ Qo = /* @__PURE__ */ new WeakMap();
4687
4690
  _t(Br, 4, "autoScrolling", nd, Ya, oi);
4688
4691
  Mn(Br, Ya);
4689
4692
  function xl(e) {
4690
- return e > 0 ? At.Forward : e < 0 ? At.Reverse : At.Idle;
4693
+ return e > 0 ? Et.Forward : e < 0 ? Et.Reverse : Et.Idle;
4691
4694
  }
4692
4695
  var Fm = class {
4693
4696
  constructor(e) {
@@ -4735,7 +4738,7 @@ var Fm = class {
4735
4738
  }, xr, Vm = class extends Hr {
4736
4739
  constructor(e) {
4737
4740
  super(e), Re(this, xr), this.handleScroll = () => {
4738
- Ee(this, xr) == null && ct(this, xr, setTimeout(() => {
4741
+ Ae(this, xr) == null && ct(this, xr, setTimeout(() => {
4739
4742
  this.manager.collisionObserver.forceUpdate(!1), ct(this, xr, void 0);
4740
4743
  }, 50));
4741
4744
  };
@@ -4796,7 +4799,7 @@ var Cr = Object.freeze({
4796
4799
  }
4797
4800
  }), zn, Fa = class extends Gn {
4798
4801
  constructor(t, n) {
4799
- super(t), this.manager = t, this.options = n, Re(this, zn, []), this.listeners = new Eu(), this.handleSourceKeyDown = (r, a, o) => {
4802
+ super(t), this.manager = t, this.options = n, Re(this, zn, []), this.listeners = new Au(), this.handleSourceKeyDown = (r, a, o) => {
4800
4803
  if (this.disabled || r.defaultPrevented || !Sn(r.target) || a.disabled)
4801
4804
  return;
4802
4805
  const {
@@ -4833,7 +4836,7 @@ var Cr = Object.freeze({
4833
4836
  source: n
4834
4837
  }).signal.aborted) return this.cleanup();
4835
4838
  this.sideEffects();
4836
- const i = En(a), l = [
4839
+ const i = An(a), l = [
4837
4840
  this.listeners.bind(i, [
4838
4841
  {
4839
4842
  type: "keydown",
@@ -4842,7 +4845,7 @@ var Cr = Object.freeze({
4842
4845
  }
4843
4846
  ])
4844
4847
  ];
4845
- Ee(this, zn).push(...l);
4848
+ Ae(this, zn).push(...l);
4846
4849
  }
4847
4850
  handleKeyDown(t, n, r) {
4848
4851
  const { keyboardCodes: a = Cr.keyboardCodes } = r ?? {};
@@ -4890,12 +4893,12 @@ var Cr = Object.freeze({
4890
4893
  }
4891
4894
  sideEffects() {
4892
4895
  const t = this.manager.registry.plugins.get(rd);
4893
- t?.disabled === !1 && (t.disable(), Ee(this, zn).push(() => {
4896
+ t?.disabled === !1 && (t.disable(), Ae(this, zn).push(() => {
4894
4897
  t.enable();
4895
4898
  }));
4896
4899
  }
4897
4900
  cleanup() {
4898
- Ee(this, zn).forEach((t) => t()), ct(this, zn, []);
4901
+ Ae(this, zn).forEach((t) => t()), ct(this, zn, []);
4899
4902
  }
4900
4903
  destroy() {
4901
4904
  this.cleanup(), this.listeners.clear();
@@ -4918,10 +4921,10 @@ var wn, Zm = class extends du {
4918
4921
  ct(this, wn, Yn(e));
4919
4922
  break;
4920
4923
  case "pointermove":
4921
- if (!Ee(this, wn)) return;
4924
+ if (!Ae(this, wn)) return;
4922
4925
  const { x: t, y: n } = Yn(e), r = {
4923
- x: t - Ee(this, wn).x,
4924
- y: n - Ee(this, wn).y
4926
+ x: t - Ae(this, wn).x,
4927
+ y: n - Ae(this, wn).y
4925
4928
  }, { tolerance: a } = this.options;
4926
4929
  if (a && Oo(r, a)) {
4927
4930
  this.abort();
@@ -4952,10 +4955,10 @@ var Zn, _n, Hm = class extends du {
4952
4955
  ));
4953
4956
  break;
4954
4957
  case "pointermove":
4955
- if (!Ee(this, _n)) return;
4958
+ if (!Ae(this, _n)) return;
4956
4959
  const { x: t, y: n } = Yn(e), r = {
4957
- x: t - Ee(this, _n).x,
4958
- y: n - Ee(this, _n).y
4960
+ x: t - Ae(this, _n).x,
4961
+ y: n - Ae(this, _n).y
4959
4962
  };
4960
4963
  Oo(r, this.options.tolerance) && this.abort();
4961
4964
  break;
@@ -4965,7 +4968,7 @@ var Zn, _n, Hm = class extends du {
4965
4968
  }
4966
4969
  }
4967
4970
  abort() {
4968
- Ee(this, Zn) && (clearTimeout(Ee(this, Zn)), ct(this, _n, void 0), ct(this, Zn, void 0));
4971
+ Ae(this, Zn) && (clearTimeout(Ae(this, Zn)), ct(this, _n, void 0), ct(this, Zn, void 0));
4969
4972
  }
4970
4973
  };
4971
4974
  Zn = /* @__PURE__ */ new WeakMap();
@@ -4995,7 +4998,7 @@ var es = Object.freeze({
4995
4998
  }
4996
4999
  }), Hn, Oa = class extends Gn {
4997
5000
  constructor(t, n) {
4998
- super(t), this.manager = t, this.options = n, Re(this, Hn, /* @__PURE__ */ new Set()), this.listeners = new Eu(), this.latest = {
5001
+ super(t), this.manager = t, this.options = n, Re(this, Hn, /* @__PURE__ */ new Set()), this.listeners = new Au(), this.latest = {
4999
5002
  event: void 0,
5000
5003
  coordinates: void 0
5001
5004
  }, this.handleMove = () => {
@@ -5065,7 +5068,7 @@ var es = Object.freeze({
5065
5068
  ]), m = () => {
5066
5069
  f(), this.initialCoordinates = void 0;
5067
5070
  };
5068
- Ee(this, Hn).add(m);
5071
+ Ae(this, Hn).add(m);
5069
5072
  }
5070
5073
  handlePointerMove(t, n) {
5071
5074
  var r, a;
@@ -5100,7 +5103,7 @@ var es = Object.freeze({
5100
5103
  source: t
5101
5104
  }).signal.aborted) return this.cleanup();
5102
5105
  n.preventDefault();
5103
- const i = En(n.target).body;
5106
+ const i = An(n.target).body;
5104
5107
  i.setPointerCapture(n.pointerId);
5105
5108
  const l = Sn(n.target) ? [n.target, i] : i, c = this.listeners.bind(l, [
5106
5109
  {
@@ -5125,7 +5128,7 @@ var es = Object.freeze({
5125
5128
  listener: this.handleKeyDown
5126
5129
  }
5127
5130
  ]);
5128
- Ee(this, Hn).add(c);
5131
+ Ae(this, Hn).add(c);
5129
5132
  }
5130
5133
  handleCancel(t) {
5131
5134
  const { dragOperation: n } = this.manager;
@@ -5135,7 +5138,7 @@ var es = Object.freeze({
5135
5138
  this.latest = {
5136
5139
  event: void 0,
5137
5140
  coordinates: void 0
5138
- }, Ee(this, Hn).forEach((t) => t()), Ee(this, Hn).clear();
5141
+ }, Ae(this, Hn).forEach((t) => t()), Ae(this, Hn).clear();
5139
5142
  }
5140
5143
  destroy() {
5141
5144
  this.cleanup(), this.listeners.clear();
@@ -5271,7 +5274,7 @@ var id, ld, rs, an, ui, go, cd, ud, Mr, di, dd = class extends (rs = Zt, ld = [f
5271
5274
  }
5272
5275
  get element() {
5273
5276
  var e;
5274
- return (e = this.proxy) != null ? e : Ee(this, Mr, cd);
5277
+ return (e = this.proxy) != null ? e : Ae(this, Mr, cd);
5275
5278
  }
5276
5279
  };
5277
5280
  an = or(rs);
@@ -5336,12 +5339,12 @@ function kl(e, t) {
5336
5339
  r !== n.current && (n.current = r, t(r));
5337
5340
  });
5338
5341
  }
5339
- var qm = Object.defineProperty, Jm = Object.defineProperties, Qm = Object.getOwnPropertyDescriptors, Il = Object.getOwnPropertySymbols, eg = Object.prototype.hasOwnProperty, tg = Object.prototype.propertyIsEnumerable, Al = (e, t, n) => t in e ? qm(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, ng = (e, t) => {
5342
+ var qm = Object.defineProperty, Jm = Object.defineProperties, Qm = Object.getOwnPropertyDescriptors, Il = Object.getOwnPropertySymbols, eg = Object.prototype.hasOwnProperty, tg = Object.prototype.propertyIsEnumerable, El = (e, t, n) => t in e ? qm(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, ng = (e, t) => {
5340
5343
  for (var n in t || (t = {}))
5341
- eg.call(t, n) && Al(e, n, t[n]);
5344
+ eg.call(t, n) && El(e, n, t[n]);
5342
5345
  if (Il)
5343
5346
  for (var n of Il(t))
5344
- tg.call(t, n) && Al(e, n, t[n]);
5347
+ tg.call(t, n) && El(e, n, t[n]);
5345
5348
  return e;
5346
5349
  }, rg = (e, t) => Jm(e, Qm(t)), ag = new si(), og = Ze(
5347
5350
  ag
@@ -5756,7 +5759,7 @@ var kg = W.div`
5756
5759
  &:disabled {
5757
5760
  cursor: not-allowed;
5758
5761
  }
5759
- `, Ag = W.label`
5762
+ `, Eg = W.label`
5760
5763
  margin: 0;
5761
5764
  cursor: pointer;
5762
5765
  user-select: none;
@@ -5820,7 +5823,7 @@ W(kd)`
5820
5823
  padding: 0.25rem 0.5rem;
5821
5824
  font-size: ${(e) => e.theme.fontSizeSmall};
5822
5825
  `;
5823
- var Eg = W.label`
5826
+ var Ag = W.label`
5824
5827
  font-family: ${(e) => e.theme.fontFamily};
5825
5828
  font-size: ${(e) => e.theme.fontSizeSmall};
5826
5829
  font-weight: 500;
@@ -5885,7 +5888,7 @@ W(Id)`
5885
5888
  padding: 0.25rem 1.75rem 0.25rem 0.5rem;
5886
5889
  font-size: ${(e) => e.theme.fontSizeSmall};
5887
5890
  `;
5888
- var Ad = W.input.attrs({ type: "range" })`
5891
+ var Ed = W.input.attrs({ type: "range" })`
5889
5892
  -webkit-appearance: none;
5890
5893
  appearance: none;
5891
5894
  width: 100%;
@@ -5984,13 +5987,13 @@ var Ad = W.input.attrs({ type: "range" })`
5984
5987
  disabled: n
5985
5988
  }
5986
5989
  ),
5987
- /* @__PURE__ */ x(Ag, { htmlFor: "automatic-scroll", children: "Automatic Scroll" })
5990
+ /* @__PURE__ */ x(Eg, { htmlFor: "automatic-scroll", children: "Automatic Scroll" })
5988
5991
  ] });
5989
- function Ed(e) {
5992
+ function Ad(e) {
5990
5993
  return typeof e == "object" && e !== null && "type" in e;
5991
5994
  }
5992
5995
  function ln(e) {
5993
- if (!Ed(e))
5996
+ if (!Ad(e))
5994
5997
  return e;
5995
5998
  const t = e.direction === "vertical" ? "to bottom" : "to right", n = e.stops.map((r) => `${r.color} ${r.offset * 100}%`).join(", ");
5996
5999
  return `linear-gradient(${t}, ${n})`;
@@ -6094,11 +6097,20 @@ var Md = {
6094
6097
  const i = e.current;
6095
6098
  if (!i) return;
6096
6099
  o(), i.addEventListener("scroll", s, { passive: !0 });
6097
- const l = new ResizeObserver(() => {
6100
+ let l = !1;
6101
+ const c = () => {
6102
+ l = !0;
6103
+ };
6104
+ i.addEventListener("pointerdown", c, { once: !0 }), i.addEventListener("keydown", c, { once: !0 }), i.addEventListener("wheel", c, { once: !0, passive: !0 });
6105
+ const u = () => {
6106
+ !l && i.scrollLeft !== 0 && (i.scrollLeft = 0, o()), i.removeEventListener("scroll", u);
6107
+ };
6108
+ i.addEventListener("scroll", u);
6109
+ const d = new ResizeObserver(() => {
6098
6110
  s();
6099
6111
  });
6100
- return l.observe(i), () => {
6101
- i.removeEventListener("scroll", s), l.disconnect(), a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
6112
+ return d.observe(i), () => {
6113
+ i.removeEventListener("scroll", s), i.removeEventListener("scroll", u), i.removeEventListener("pointerdown", c), i.removeEventListener("keydown", c), i.removeEventListener("wheel", c), d.disconnect(), a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
6102
6114
  };
6103
6115
  }, [e, o, s]), /* @__PURE__ */ x($d.Provider, { value: r, children: t });
6104
6116
  };
@@ -6168,7 +6180,7 @@ function Bg(e, t, n) {
6168
6180
  return Math.floor((e - t + n) / n) * n;
6169
6181
  }
6170
6182
  function Vg(e, t, n, r) {
6171
- if (!Ed(t))
6183
+ if (!Ad(t))
6172
6184
  return t;
6173
6185
  let a;
6174
6186
  t.direction === "vertical" ? a = e.createLinearGradient(0, 0, 0, r) : a = e.createLinearGradient(0, 0, n, 0);
@@ -6202,7 +6214,7 @@ var Lg = W.canvas.attrs((e) => ({
6202
6214
  /* Force GPU compositing layer to reduce scroll flickering */
6203
6215
  transform: translateZ(0);
6204
6216
  backface-visibility: hidden;
6205
- `, El = (e) => {
6217
+ `, Al = (e) => {
6206
6218
  const {
6207
6219
  data: t,
6208
6220
  bits: n,
@@ -6220,20 +6232,20 @@ var Lg = W.canvas.attrs((e) => ({
6220
6232
  } = e, { canvasRef: m, canvasMapRef: y } = mi(), v = Dd(), p = pi(r, et, v);
6221
6233
  qn(() => {
6222
6234
  const _ = u + d;
6223
- for (const [C, S] of y.current.entries()) {
6224
- const k = C * et, I = S.getContext("2d"), A = Math.floor(i / 2);
6235
+ for (const [S, C] of y.current.entries()) {
6236
+ const k = S * et, I = C.getContext("2d"), E = Math.floor(i / 2);
6225
6237
  if (I) {
6226
- I.resetTransform(), I.clearRect(0, 0, S.width, S.height), I.imageSmoothingEnabled = !1, I.scale(s, s);
6227
- const D = S.width / s;
6238
+ I.resetTransform(), I.clearRect(0, 0, C.width, C.height), I.imageSmoothingEnabled = !1, I.scale(s, s);
6239
+ const D = C.width / s;
6228
6240
  let R;
6229
6241
  f === "normal" ? R = c : R = l, I.fillStyle = Vg(I, R, D, i);
6230
- const E = k, O = k + D, B = Bg(E, u, _);
6242
+ const A = k, O = k + D, B = Bg(A, u, _);
6231
6243
  for (let X = Math.max(0, B); X < O; X += _) {
6232
- const J = X - E;
6244
+ const J = X - A;
6233
6245
  if (J + u <= 0) continue;
6234
6246
  const oe = Math.min(X + _, r), L = Fg(t, n, X, oe);
6235
6247
  if (L) {
6236
- const ae = Og(J, u, A, L.min, L.max, f);
6248
+ const ae = Og(J, u, E, L.min, L.max, f);
6237
6249
  for (const se of ae)
6238
6250
  I.fillRect(se.x, se.y, se.width, se.height);
6239
6251
  }
@@ -6255,13 +6267,13 @@ var Lg = W.canvas.attrs((e) => ({
6255
6267
  p
6256
6268
  ]);
6257
6269
  const b = p.map((_) => {
6258
- const C = _ * et, S = Math.min(r - C, et);
6270
+ const S = _ * et, C = Math.min(r - S, et);
6259
6271
  return /* @__PURE__ */ x(
6260
6272
  Lg,
6261
6273
  {
6262
- $cssWidth: S,
6263
- $left: C,
6264
- width: S * s,
6274
+ $cssWidth: C,
6275
+ $left: S,
6276
+ width: C * s,
6265
6277
  height: i * s,
6266
6278
  $waveHeight: i,
6267
6279
  "data-index": _,
@@ -6518,23 +6530,23 @@ var $l = ({
6518
6530
  showFades: b = !1,
6519
6531
  touchOptimized: w = !1
6520
6532
  }) => {
6521
- const g = Math.floor(s / l), C = Math.floor((s + i) / l) - g, S = c && !u && !d, k = `clip-${r}-${a}`, {
6533
+ const g = Math.floor(s / l), S = Math.floor((s + i) / l) - g, C = c && !u && !d, k = `clip-${r}-${a}`, {
6522
6534
  ref: I,
6523
- handleRef: A,
6535
+ handleRef: E,
6524
6536
  isDragSource: D
6525
6537
  } = vo({
6526
6538
  id: k,
6527
6539
  data: { clipId: n, trackIndex: r, clipIndex: a },
6528
- disabled: !S
6529
- }), R = `clip-boundary-left-${r}-${a}`, { ref: E, isDragSource: O } = vo({
6540
+ disabled: !C
6541
+ }), R = `clip-boundary-left-${r}-${a}`, { ref: A, isDragSource: O } = vo({
6530
6542
  id: R,
6531
6543
  data: { clipId: n, trackIndex: r, clipIndex: a, boundary: "left" },
6532
- disabled: !S,
6544
+ disabled: !C,
6533
6545
  feedback: "none"
6534
6546
  }), B = `clip-boundary-right-${r}-${a}`, { ref: X, isDragSource: J } = vo({
6535
6547
  id: B,
6536
6548
  data: { clipId: n, trackIndex: r, clipIndex: a, boundary: "right" },
6537
- disabled: !S,
6549
+ disabled: !C,
6538
6550
  feedback: "none"
6539
6551
  });
6540
6552
  return /* @__PURE__ */ me(
@@ -6544,11 +6556,12 @@ var $l = ({
6544
6556
  style: D ? { zIndex: 100 } : void 0,
6545
6557
  className: t,
6546
6558
  $left: g,
6547
- $width: C,
6559
+ $width: S,
6548
6560
  $isOverlay: d,
6549
6561
  "data-clip-container": "true",
6550
6562
  "data-track-id": m,
6551
6563
  onMouseDown: f,
6564
+ ...C ? {} : { tabIndex: -1 },
6552
6565
  children: [
6553
6566
  c && /* @__PURE__ */ x(
6554
6567
  Ng,
@@ -6559,7 +6572,7 @@ var $l = ({
6559
6572
  trackName: o,
6560
6573
  isSelected: h,
6561
6574
  disableDrag: u,
6562
- dragHandleProps: S ? { handleRef: A } : void 0
6575
+ dragHandleProps: C ? { handleRef: E } : void 0
6563
6576
  }
6564
6577
  ),
6565
6578
  /* @__PURE__ */ x(Wg, { originX: g, children: /* @__PURE__ */ me(Jg, { $isOverlay: d, children: [
@@ -6576,7 +6589,7 @@ var $l = ({
6576
6589
  b && v && v.duration > 0 && /* @__PURE__ */ x(
6577
6590
  $l,
6578
6591
  {
6579
- left: C - Math.floor(v.duration * p / l),
6592
+ left: S - Math.floor(v.duration * p / l),
6580
6593
  width: Math.floor(v.duration * p / l),
6581
6594
  type: "fadeOut",
6582
6595
  curveType: v.type
@@ -6593,7 +6606,7 @@ var $l = ({
6593
6606
  edge: "left",
6594
6607
  touchOptimized: w,
6595
6608
  dragHandleProps: {
6596
- ref: E,
6609
+ ref: A,
6597
6610
  isDragging: O
6598
6611
  }
6599
6612
  }
@@ -6620,10 +6633,10 @@ var $l = ({
6620
6633
  display: inline-flex;
6621
6634
  align-items: center;
6622
6635
  gap: 0.5rem;
6623
- `, e0 = W(Eg)`
6636
+ `, e0 = W(Ag)`
6624
6637
  margin: 0;
6625
6638
  white-space: nowrap;
6626
- `, t0 = W(Ad)`
6639
+ `, t0 = W(Ed)`
6627
6640
  width: 120px;
6628
6641
  `, n0 = ({
6629
6642
  volume: e,
@@ -6895,12 +6908,12 @@ var Tl = W.div.attrs((e) => ({
6895
6908
  (p, b) => {
6896
6909
  p.preventDefault(), p.stopPropagation(), u(b), d.current = p.clientX, h.current = b === "start" ? e : t;
6897
6910
  const w = (_) => {
6898
- const C = _.clientX - d.current, S = h.current + C;
6911
+ const S = _.clientX - d.current, C = h.current + S;
6899
6912
  if (b === "start") {
6900
- const k = Math.max(i, Math.min(t - 10, S));
6913
+ const k = Math.max(i, Math.min(t - 10, C));
6901
6914
  a?.(k);
6902
6915
  } else {
6903
- const k = Math.max(e + 10, Math.min(l, S));
6916
+ const k = Math.max(e + 10, Math.min(l, C));
6904
6917
  o?.(k);
6905
6918
  }
6906
6919
  }, g = () => {
@@ -6913,9 +6926,9 @@ var Tl = W.div.attrs((e) => ({
6913
6926
  (p) => {
6914
6927
  p.preventDefault(), p.stopPropagation(), u("region"), d.current = p.clientX, h.current = e, f.current = t;
6915
6928
  const b = t - e, w = (_) => {
6916
- const C = _.clientX - d.current;
6917
- let S = h.current + C, k = f.current + C;
6918
- S < i && (S = i, k = i + b), k > l && (k = l, S = l - b), s?.(S, k);
6929
+ const S = _.clientX - d.current;
6930
+ let C = h.current + S, k = f.current + S;
6931
+ C < i && (C = i, k = i + b), k > l && (k = l, C = l - b), s?.(C, k);
6919
6932
  }, g = () => {
6920
6933
  u(null), document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", g);
6921
6934
  };
@@ -6990,8 +7003,8 @@ var Tl = W.div.attrs((e) => ({
6990
7003
  const v = f.clientX - y.left, p = Math.max(o, Math.min(s, v));
6991
7004
  c.current = p, a?.(p, p);
6992
7005
  const b = (g) => {
6993
- const _ = g.clientX - y.left, C = Math.max(o, Math.min(s, _)), S = Math.min(c.current, C), k = Math.max(c.current, C);
6994
- a?.(S, k);
7006
+ const _ = g.clientX - y.left, S = Math.max(o, Math.min(s, _)), C = Math.min(c.current, S), k = Math.max(c.current, S);
7007
+ a?.(C, k);
6995
7008
  }, w = () => {
6996
7009
  l(!1), document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", w);
6997
7010
  };
@@ -7234,15 +7247,15 @@ var S0 = C0(), Pl = ({
7234
7247
  clipId: h,
7235
7248
  onCanvasesReady: f
7236
7249
  }) => {
7237
- const m = t ?? e, { canvasRef: y, canvasMapRef: v } = mi(), p = T([]), b = T(/* @__PURE__ */ new WeakSet()), w = T(d), g = T(f), _ = !!(d && h), C = Dd(), S = pi(r, et, C), k = i ?? S0, I = u ?? (n ? n.sampleRate / 2 : 22050), A = l ?? w0, D = !!l;
7250
+ const m = t ?? e, { canvasRef: y, canvasMapRef: v } = mi(), p = T([]), b = T(/* @__PURE__ */ new WeakSet()), w = T(d), g = T(f), _ = !!(d && h), S = Dd(), C = pi(r, et, S), k = i ?? S0, I = u ?? (n ? n.sampleRate / 2 : 22050), E = l ?? w0, D = !!l;
7238
7251
  j(() => {
7239
7252
  w.current = d;
7240
7253
  }, [d]), j(() => {
7241
7254
  g.current = f;
7242
7255
  }, [f]), j(() => {
7243
7256
  if (!_) return;
7244
- const E = w.current;
7245
- if (!E || !h) return;
7257
+ const A = w.current;
7258
+ if (!A || !h) return;
7246
7259
  const O = p.current.length, B = [];
7247
7260
  for (const oe of p.current) {
7248
7261
  const L = oe.match(/chunk(\d+)$/);
@@ -7255,7 +7268,7 @@ var S0 = C0(), Pl = ({
7255
7268
  B.push(oe);
7256
7269
  else
7257
7270
  try {
7258
- E.unregisterCanvas(oe);
7271
+ A.unregisterCanvas(oe);
7259
7272
  } catch (ie) {
7260
7273
  console.warn(`[spectrogram] unregisterCanvas failed for ${oe}:`, ie);
7261
7274
  }
@@ -7274,7 +7287,7 @@ var S0 = C0(), Pl = ({
7274
7287
  }
7275
7288
  b.current.add(L);
7276
7289
  try {
7277
- E.registerCanvas(ae, se), X.push(ae);
7290
+ A.registerCanvas(ae, se), X.push(ae);
7278
7291
  } catch (ie) {
7279
7292
  console.warn(`[spectrogram] registerCanvas failed for ${ae}:`, ie);
7280
7293
  continue;
@@ -7290,12 +7303,12 @@ var S0 = C0(), Pl = ({
7290
7303
  });
7291
7304
  g.current?.(oe, L);
7292
7305
  }
7293
- }, [v, _, h, m, r, S]), j(() => () => {
7294
- const E = w.current;
7295
- if (E) {
7306
+ }, [v, _, h, m, r, C]), j(() => () => {
7307
+ const A = w.current;
7308
+ if (A) {
7296
7309
  for (const O of p.current)
7297
7310
  try {
7298
- E.unregisterCanvas(O);
7311
+ A.unregisterCanvas(O);
7299
7312
  } catch (B) {
7300
7313
  console.warn(`[spectrogram] unregisterCanvas failed for ${O}:`, B);
7301
7314
  }
@@ -7304,13 +7317,13 @@ var S0 = C0(), Pl = ({
7304
7317
  }, []), qn(() => {
7305
7318
  if (_ || !n) return;
7306
7319
  const {
7307
- frequencyBinCount: E,
7320
+ frequencyBinCount: A,
7308
7321
  frameCount: O,
7309
7322
  hopSize: B,
7310
7323
  sampleRate: X,
7311
7324
  gainDb: J,
7312
7325
  rangeDb: oe
7313
- } = n, L = oe === 0 ? 1 : oe, ae = (se) => se / E * (X / 2);
7326
+ } = n, L = oe === 0 ? 1 : oe, ae = (se) => se / A * (X / 2);
7314
7327
  for (const [se, ie] of v.current.entries()) {
7315
7328
  const ce = se * et, ye = ie.getContext("2d");
7316
7329
  if (!ye) continue;
@@ -7320,19 +7333,19 @@ var S0 = C0(), Pl = ({
7320
7333
  for (let he = 0; he < _e; he++) {
7321
7334
  const $ = (ce + he) * s, ge = Math.floor($ / B);
7322
7335
  if (ge < 0 || ge >= O) continue;
7323
- const Le = ge * E;
7336
+ const Le = ge * A;
7324
7337
  for (let Q = 0; Q < Fe; Q++) {
7325
7338
  const be = 1 - Q / Fe;
7326
- let Ge = Math.floor(be * E);
7339
+ let Ge = Math.floor(be * A);
7327
7340
  if (D) {
7328
- let ke = 0, Je = E - 1;
7341
+ let ke = 0, Je = A - 1;
7329
7342
  for (; ke < Je; ) {
7330
7343
  const tt = ke + Je >> 1, dt = ae(tt);
7331
- A(dt, c, I) < be ? ke = tt + 1 : Je = tt;
7344
+ E(dt, c, I) < be ? ke = tt + 1 : Je = tt;
7332
7345
  }
7333
7346
  Ge = ke;
7334
7347
  }
7335
- if (Ge < 0 || Ge >= E) continue;
7348
+ if (Ge < 0 || Ge >= A) continue;
7336
7349
  const qe = n.data[Le + Ge], q = Math.max(0, Math.min(1, (qe + L + J) / L)), Oe = Math.floor(q * 255), Ye = (Q * _e + he) * 4;
7337
7350
  N[Ye] = k[Oe * 3], N[Ye + 1] = k[Oe * 3 + 1], N[Ye + 2] = k[Oe * 3 + 2], N[Ye + 3] = 255;
7338
7351
  }
@@ -7356,12 +7369,12 @@ var S0 = C0(), Pl = ({
7356
7369
  k,
7357
7370
  c,
7358
7371
  I,
7359
- A,
7372
+ E,
7360
7373
  D,
7361
- S
7374
+ C
7362
7375
  ]);
7363
- const R = S.map((E) => {
7364
- const O = E * et, B = Math.min(r - O, et);
7376
+ const R = C.map((A) => {
7377
+ const O = A * et, B = Math.min(r - O, et);
7365
7378
  return /* @__PURE__ */ x(
7366
7379
  x0,
7367
7380
  {
@@ -7370,10 +7383,10 @@ var S0 = C0(), Pl = ({
7370
7383
  width: B * o,
7371
7384
  height: a * o,
7372
7385
  $waveHeight: a,
7373
- "data-index": E,
7386
+ "data-index": A,
7374
7387
  ref: y
7375
7388
  },
7376
- `${r}-${E}`
7389
+ `${r}-${A}`
7377
7390
  );
7378
7391
  });
7379
7392
  return /* @__PURE__ */ x(_0, { $index: e, $cssWidth: r, $waveHeight: a, children: R });
@@ -7392,8 +7405,8 @@ var S0 = C0(), Pl = ({
7392
7405
  spectrogramOnCanvasesReady: d,
7393
7406
  ...h
7394
7407
  }) => {
7395
- const f = jr(), { waveHeight: m, barWidth: y, barGap: v, samplesPerPixel: p } = ja(), b = vi(), w = o ?? p, g = e && f ? f.selectedWaveOutlineColor : f?.waveOutlineColor, _ = e && f ? f.selectedWaveFillColor : f?.waveFillColor, C = f?.waveformDrawMode || "inverted", S = r || c;
7396
- if (n === "spectrogram" && S)
7408
+ const f = jr(), { waveHeight: m, barWidth: y, barGap: v, samplesPerPixel: p } = ja(), b = vi(), w = o ?? p, g = e && f ? f.selectedWaveOutlineColor : f?.waveOutlineColor, _ = e && f ? f.selectedWaveFillColor : f?.waveFillColor, S = f?.waveformDrawMode || "inverted", C = r || c;
7409
+ if (n === "spectrogram" && C)
7397
7410
  return /* @__PURE__ */ x(
7398
7411
  Pl,
7399
7412
  {
@@ -7412,7 +7425,7 @@ var S0 = C0(), Pl = ({
7412
7425
  onCanvasesReady: d
7413
7426
  }
7414
7427
  );
7415
- if (n === "both" && S) {
7428
+ if (n === "both" && C) {
7416
7429
  const k = Math.floor(m / 2);
7417
7430
  return /* @__PURE__ */ me(Lt, { children: [
7418
7431
  /* @__PURE__ */ x(
@@ -7444,7 +7457,7 @@ var S0 = C0(), Pl = ({
7444
7457
  height: k
7445
7458
  },
7446
7459
  children: /* @__PURE__ */ x(
7447
- El,
7460
+ Al,
7448
7461
  {
7449
7462
  ...h,
7450
7463
  index: 0,
@@ -7455,7 +7468,7 @@ var S0 = C0(), Pl = ({
7455
7468
  barWidth: y,
7456
7469
  barGap: v,
7457
7470
  transparentBackground: t,
7458
- drawMode: C
7471
+ drawMode: S
7459
7472
  }
7460
7473
  )
7461
7474
  }
@@ -7463,7 +7476,7 @@ var S0 = C0(), Pl = ({
7463
7476
  ] });
7464
7477
  }
7465
7478
  return /* @__PURE__ */ x(
7466
- El,
7479
+ Al,
7467
7480
  {
7468
7481
  ...h,
7469
7482
  waveOutlineColor: g,
@@ -7473,7 +7486,7 @@ var S0 = C0(), Pl = ({
7473
7486
  barWidth: y,
7474
7487
  barGap: v,
7475
7488
  transparentBackground: t,
7476
- drawMode: C
7489
+ drawMode: S
7477
7490
  }
7478
7491
  );
7479
7492
  }, Rl = 72, k0 = W.div`
@@ -7509,7 +7522,7 @@ function I0(e, t, n) {
7509
7522
  i.push(a[Math.round(l * s)]);
7510
7523
  return i;
7511
7524
  }
7512
- var A0 = ({
7525
+ var E0 = ({
7513
7526
  waveHeight: e,
7514
7527
  numChannels: t,
7515
7528
  frequencyScaleFn: n,
@@ -7534,8 +7547,8 @@ var A0 = ({
7534
7547
  for (const w of v) {
7535
7548
  const g = n(w, r, a);
7536
7549
  if (g < 0 || g > 1) continue;
7537
- const _ = b + d * (1 - g), C = w >= 1e3 ? `${(w / 1e3).toFixed(1)}k` : `${w} Hz`, S = y.measureText(C), k = 3;
7538
- y.fillStyle = s, y.fillRect(0, _ - 7, S.width + k * 2, 14), y.fillStyle = o, y.fillText(C, k, _);
7550
+ const _ = b + d * (1 - g), S = w >= 1e3 ? `${(w / 1e3).toFixed(1)}k` : `${w} Hz`, C = y.measureText(S), k = 3;
7551
+ y.fillStyle = s, y.fillRect(0, _ - 7, C.width + k * 2, 14), y.fillStyle = o, y.fillText(S, k, _);
7539
7552
  }
7540
7553
  }
7541
7554
  }, [
@@ -7563,7 +7576,7 @@ var A0 = ({
7563
7576
  }
7564
7577
  ) });
7565
7578
  };
7566
- function E0(e, t, n) {
7579
+ function A0(e, t, n) {
7567
7580
  return Math.ceil(e * n / t);
7568
7581
  }
7569
7582
  function M0(e) {
@@ -7616,19 +7629,19 @@ var $0 = W.div.attrs((e) => ({
7616
7629
  timeScaleHeight: d,
7617
7630
  controls: { show: h, width: f }
7618
7631
  } = We(Kr), m = vi(), { widthX: y, canvasInfo: v, timeMarkersWithPositions: p } = Te(() => {
7619
- const S = /* @__PURE__ */ new Map(), k = [], I = E0(n / 1e3, u, c), A = c / u;
7632
+ const C = /* @__PURE__ */ new Map(), k = [], I = A0(n / 1e3, u, c), E = c / u;
7620
7633
  let D = 0;
7621
- for (let R = 0; R < I; R += A * o / 1e3) {
7622
- const E = Math.floor(R);
7634
+ for (let R = 0; R < I; R += E * o / 1e3) {
7635
+ const A = Math.floor(R);
7623
7636
  if (D % r === 0) {
7624
- const O = D, B = M0(O), X = s ? /* @__PURE__ */ x(bt.Fragment, { children: s(O, E) }, `timestamp-${D}`) : /* @__PURE__ */ x(D0, { $left: E, children: B }, B);
7625
- k.push({ pix: E, element: X }), S.set(E, d);
7626
- } else D % a === 0 ? S.set(E, Math.floor(d / 2)) : D % o === 0 && S.set(E, Math.floor(d / 5));
7637
+ const O = D, B = M0(O), X = s ? /* @__PURE__ */ x(bt.Fragment, { children: s(O, A) }, `timestamp-${D}`) : /* @__PURE__ */ x(D0, { $left: A, children: B }, B);
7638
+ k.push({ pix: A, element: X }), C.set(A, d);
7639
+ } else D % a === 0 ? C.set(A, Math.floor(d / 2)) : D % o === 0 && C.set(A, Math.floor(d / 5));
7627
7640
  D += o;
7628
7641
  }
7629
7642
  return {
7630
7643
  widthX: I,
7631
- canvasInfo: S,
7644
+ canvasInfo: C,
7632
7645
  timeMarkersWithPositions: k
7633
7646
  };
7634
7647
  }, [
@@ -7640,8 +7653,8 @@ var $0 = W.div.attrs((e) => ({
7640
7653
  o,
7641
7654
  s,
7642
7655
  d
7643
- ]), b = pi(y, et), w = b.map((S) => {
7644
- const k = S * et, I = Math.min(y - k, et);
7656
+ ]), b = pi(y, et), w = b.map((C) => {
7657
+ const k = C * et, I = Math.min(y - k, et);
7645
7658
  return /* @__PURE__ */ x(
7646
7659
  T0,
7647
7660
  {
@@ -7650,22 +7663,22 @@ var $0 = W.div.attrs((e) => ({
7650
7663
  $timeScaleHeight: d,
7651
7664
  width: I * m,
7652
7665
  height: d * m,
7653
- "data-index": S,
7666
+ "data-index": C,
7654
7667
  ref: i
7655
7668
  },
7656
- `timescale-${S}`
7669
+ `timescale-${C}`
7657
7670
  );
7658
- }), g = b.length > 0 ? b[0] * et : 0, _ = b.length > 0 ? (b[b.length - 1] + 1) * et : 1 / 0, C = b.length > 0 ? p.filter(({ pix: S }) => S >= g && S < _).map(({ element: S }) => S) : p.map(({ element: S }) => S);
7671
+ }), g = b.length > 0 ? b[0] * et : 0, _ = b.length > 0 ? (b[b.length - 1] + 1) * et : 1 / 0, S = b.length > 0 ? p.filter(({ pix: C }) => C >= g && C < _).map(({ element: C }) => C) : p.map(({ element: C }) => C);
7659
7672
  return qn(() => {
7660
- for (const [S, k] of l.current.entries()) {
7673
+ for (const [C, k] of l.current.entries()) {
7661
7674
  const I = k.getContext("2d");
7662
7675
  if (!I) continue;
7663
- const A = S * et, D = k.width / m;
7676
+ const E = C * et, D = k.width / m;
7664
7677
  I.resetTransform(), I.clearRect(0, 0, k.width, k.height), I.imageSmoothingEnabled = !1, I.fillStyle = t, I.scale(m, m);
7665
- for (const [R, E] of v.entries()) {
7666
- if (R < A || R >= A + D) continue;
7667
- const O = R - A, B = d - E;
7668
- I.fillRect(O, B, 1, E);
7678
+ for (const [R, A] of v.entries()) {
7679
+ if (R < E || R >= E + D) continue;
7680
+ const O = R - E, B = d - A;
7681
+ I.fillRect(O, B, 1, A);
7669
7682
  }
7670
7683
  }
7671
7684
  }, [
@@ -7683,7 +7696,7 @@ var $0 = W.div.attrs((e) => ({
7683
7696
  $controlWidth: h ? f : 0,
7684
7697
  $timeScaleHeight: d,
7685
7698
  children: [
7686
- C,
7699
+ S,
7687
7700
  w
7688
7701
  ]
7689
7702
  }
@@ -7995,7 +8008,7 @@ var zd = ({ renderTimestamp: e }) => {
7995
8008
  font-size: ${(e) => e.theme.fontSizeSmall};
7996
8009
  color: ${(e) => e.theme.textColor};
7997
8010
  background-color: transparent;
7998
- `, Y0 = (e) => /* @__PURE__ */ x(Cd, { weight: "light", ...e }), U0 = (e) => /* @__PURE__ */ x(xd, { weight: "light", ...e }), K0 = (e) => /* @__PURE__ */ x(_d, { weight: "bold", ...e }), Ol = W(Ad)`
8011
+ `, Y0 = (e) => /* @__PURE__ */ x(Cd, { weight: "light", ...e }), U0 = (e) => /* @__PURE__ */ x(xd, { weight: "light", ...e }), K0 = (e) => /* @__PURE__ */ x(_d, { weight: "bold", ...e }), Ol = W(Ed)`
7999
8012
  width: 75%;
8000
8013
  height: 5px;
8001
8014
  background: ${(e) => e.theme.sliderTrackColor};
@@ -8176,14 +8189,14 @@ function sv(e) {
8176
8189
  var w = e.bits === 8 ? nv : av, g = e.bits === 8 ? tv : rv;
8177
8190
  f.setInt32(0, 2, !0), f.setUint32(4, e.bits === 8, !0), f.setInt32(8, o, !0), f.setInt32(12, t, !0), f.setInt32(16, c, !0), f.setInt32(20, i, !0);
8178
8191
  for (var _ = 0; _ < a; _++) {
8179
- var C = 0;
8192
+ var S = 0;
8180
8193
  if (i === 1) {
8181
- for (var S = 0; S < s.length; ++S)
8182
- C += s[S][_];
8183
- C = Math.floor(g * C * n / s.length), C < v[0] && (v[0] = C, v[0] < w && (v[0] = w)), C > p[0] && (p[0] = C, p[0] > g && (p[0] = g));
8194
+ for (var C = 0; C < s.length; ++C)
8195
+ S += s[C][_];
8196
+ S = Math.floor(g * S * n / s.length), S < v[0] && (v[0] = S, v[0] < w && (v[0] = w)), S > p[0] && (p[0] = S, p[0] > g && (p[0] = g));
8184
8197
  } else
8185
8198
  for (var k = 0; k < i; ++k)
8186
- C = Math.floor(g * s[k][_] * n), C < v[k] && (v[k] = C, v[k] < w && (v[k] = w)), C > p[k] && (p[k] = C, p[k] > g && (p[k] = g));
8199
+ S = Math.floor(g * s[k][_] * n), S < v[k] && (v[k] = S, v[k] < w && (v[k] = w)), S > p[k] && (p[k] = S, p[k] > g && (p[k] = g));
8187
8200
  if (++m === t) {
8188
8201
  for (var I = 0; I < i; I++)
8189
8202
  e.bits === 8 ? (f.setInt8(y++, v[I]), f.setInt8(y++, p[I])) : (f.setInt16(y, v[I], !0), f.setInt16(y + 2, p[I], !0), y += 4), v[I] = 1 / 0, p[I] = -1 / 0;
@@ -8191,8 +8204,8 @@ function sv(e) {
8191
8204
  }
8192
8205
  }
8193
8206
  if (m > 0)
8194
- for (var A = 0; A < i; A++)
8195
- e.bits === 8 ? (f.setInt8(y++, v[A]), f.setInt8(y++, p[A])) : (f.setInt16(y, v[A], !0), f.setInt16(y + 2, p[A], !0));
8207
+ for (var E = 0; E < i; E++)
8208
+ e.bits === 8 ? (f.setInt8(y++, v[E]), f.setInt8(y++, p[E])) : (f.setInt16(y, v[E], !0), f.setInt16(y + 2, p[E], !0));
8196
8209
  return h;
8197
8210
  }
8198
8211
  function Va(e) {
@@ -8798,7 +8811,7 @@ function Jy(e, t = {}) {
8798
8811
  const g = w ?? p.audioBuffer;
8799
8812
  if (!g && !p.waveformData)
8800
8813
  throw new Error(`Track ${b + 1}: Must provide src, audioBuffer, or waveformData`);
8801
- const _ = g?.duration ?? p.waveformData?.duration, C = rc({
8814
+ const _ = g?.duration ?? p.waveformData?.duration, S = rc({
8802
8815
  audioBuffer: g,
8803
8816
  startTime: p.startTime ?? 0,
8804
8817
  duration: p.duration ?? _,
@@ -8808,12 +8821,12 @@ function Jy(e, t = {}) {
8808
8821
  fadeOut: p.fadeOut,
8809
8822
  waveformData: p.waveformData
8810
8823
  });
8811
- if (isNaN(C.startSample) || isNaN(C.durationSamples) || isNaN(C.offsetSamples))
8812
- throw console.error("Invalid clip values:", C), new Error(`Invalid clip values for track ${b + 1}`);
8824
+ if (isNaN(S.startSample) || isNaN(S.durationSamples) || isNaN(S.offsetSamples))
8825
+ throw console.error("Invalid clip values:", S), new Error(`Invalid clip values for track ${b + 1}`);
8813
8826
  return {
8814
8827
  ...ac({
8815
8828
  name: p.name || `Track ${b + 1}`,
8816
- clips: [C],
8829
+ clips: [S],
8817
8830
  muted: p.muted ?? !1,
8818
8831
  soloed: p.soloed ?? !1,
8819
8832
  volume: p.volume ?? 1,
@@ -8831,33 +8844,33 @@ function Jy(e, t = {}) {
8831
8844
  s(!0), l(null), u(0);
8832
8845
  const p = Sf.getContext().rawContext, b = e.map(async (g, _) => {
8833
8846
  if (g.audioBuffer) {
8834
- const A = y(g, _, g.audioBuffer);
8835
- return n && !h && (m.set(_, A), u((D) => D + 1), a(
8847
+ const E = y(g, _, g.audioBuffer);
8848
+ return n && !h && (m.set(_, E), u((D) => D + 1), a(
8836
8849
  Array.from({ length: e.length }, (D, R) => m.get(R)).filter(
8837
8850
  (D) => D !== void 0
8838
8851
  )
8839
- )), A;
8852
+ )), E;
8840
8853
  }
8841
8854
  if (!g.src && g.waveformData) {
8842
- const A = y(g, _);
8843
- return n && !h && (m.set(_, A), u((D) => D + 1), a(
8855
+ const E = y(g, _);
8856
+ return n && !h && (m.set(_, E), u((D) => D + 1), a(
8844
8857
  Array.from({ length: e.length }, (D, R) => m.get(R)).filter(
8845
8858
  (D) => D !== void 0
8846
8859
  )
8847
- )), A;
8860
+ )), E;
8848
8861
  }
8849
8862
  if (!g.src)
8850
8863
  throw new Error(`Track ${_ + 1}: Must provide src, audioBuffer, or waveformData`);
8851
- const C = await fetch(g.src, { signal: f.signal });
8852
- if (!C.ok)
8853
- throw new Error(`Failed to fetch ${g.src}: ${C.statusText}`);
8854
- const S = await C.arrayBuffer(), k = await p.decodeAudioData(S);
8864
+ const S = await fetch(g.src, { signal: f.signal });
8865
+ if (!S.ok)
8866
+ throw new Error(`Failed to fetch ${g.src}: ${S.statusText}`);
8867
+ const C = await S.arrayBuffer(), k = await p.decodeAudioData(C);
8855
8868
  if (!k || !k.sampleRate || !k.duration)
8856
8869
  throw new Error(`Invalid audio buffer for ${g.src}`);
8857
8870
  const I = y(g, _, k);
8858
- return n && !h && (m.set(_, I), u((A) => A + 1), a(
8859
- Array.from({ length: e.length }, (A, D) => m.get(D)).filter(
8860
- (A) => A !== void 0
8871
+ return n && !h && (m.set(_, I), u((E) => E + 1), a(
8872
+ Array.from({ length: e.length }, (E, D) => m.get(D)).filter(
8873
+ (E) => E !== void 0
8861
8874
  )
8862
8875
  )), I;
8863
8876
  }), w = await Promise.all(b);
@@ -8901,18 +8914,18 @@ function Qy({
8901
8914
  (d) => {
8902
8915
  const h = d.operation.source?.data;
8903
8916
  if (!h || !h.boundary || !s.current) return;
8904
- const { boundary: f, trackIndex: m, clipIndex: y } = h, b = ((d.to?.x ?? d.operation.position.current.x) - d.operation.position.initial.x) * n, w = Math.floor(0.1 * r), g = s.current, _ = e.map((C, S) => {
8905
- if (S !== m) return C;
8906
- const k = [...C.clips].sort((D, R) => D.startSample - R.startSample), I = k.findIndex((D) => D === C.clips[y]), A = C.clips.map((D, R) => {
8917
+ const { boundary: f, trackIndex: m, clipIndex: y } = h, b = ((d.to?.x ?? d.operation.position.current.x) - d.operation.position.initial.x) * n, w = Math.floor(0.1 * r), g = s.current, _ = e.map((S, C) => {
8918
+ if (C !== m) return S;
8919
+ const k = [...S.clips].sort((D, R) => D.startSample - R.startSample), I = k.findIndex((D) => D === S.clips[y]), E = S.clips.map((D, R) => {
8907
8920
  if (R !== y) return D;
8908
8921
  if (f === "left") {
8909
- const E = {
8922
+ const A = {
8910
8923
  ...D,
8911
8924
  startSample: g.startSample,
8912
8925
  offsetSamples: g.offsetSamples,
8913
8926
  durationSamples: g.durationSamples
8914
8927
  }, O = Io(
8915
- E,
8928
+ A,
8916
8929
  Math.floor(b),
8917
8930
  "left",
8918
8931
  k,
@@ -8926,13 +8939,13 @@ function Qy({
8926
8939
  startSample: J
8927
8940
  };
8928
8941
  } else {
8929
- const E = {
8942
+ const A = {
8930
8943
  ...D,
8931
8944
  startSample: g.startSample,
8932
8945
  offsetSamples: g.offsetSamples,
8933
8946
  durationSamples: g.durationSamples
8934
8947
  }, O = Io(
8935
- E,
8948
+ A,
8936
8949
  Math.floor(b),
8937
8950
  "right",
8938
8951
  k,
@@ -8942,7 +8955,7 @@ function Qy({
8942
8955
  return { ...D, durationSamples: B };
8943
8956
  }
8944
8957
  });
8945
- return { ...C, clips: A };
8958
+ return { ...S, clips: E };
8946
8959
  });
8947
8960
  i.current = b, t(_);
8948
8961
  },
@@ -8953,17 +8966,17 @@ function Qy({
8953
8966
  if (s.current) {
8954
8967
  const b = d.operation.source?.data;
8955
8968
  if (b) {
8956
- const { trackIndex: w, clipIndex: g } = b, _ = s.current, C = e.map((S, k) => {
8957
- if (k !== w) return S;
8958
- const I = S.clips.map((A, D) => D !== g ? A : {
8959
- ...A,
8969
+ const { trackIndex: w, clipIndex: g } = b, _ = s.current, S = e.map((C, k) => {
8970
+ if (k !== w) return C;
8971
+ const I = C.clips.map((E, D) => D !== g ? E : {
8972
+ ...E,
8960
8973
  offsetSamples: _.offsetSamples,
8961
8974
  durationSamples: _.durationSamples,
8962
8975
  startSample: _.startSample
8963
8976
  });
8964
- return { ...S, clips: I };
8977
+ return { ...C, clips: I };
8965
8978
  });
8966
- t(C);
8979
+ t(S);
8967
8980
  }
8968
8981
  }
8969
8982
  o.current = !1, s.current = null, i.current = 0;
@@ -9261,10 +9274,10 @@ function a1({
9261
9274
  const f = Te(() => t ? e.findIndex((I) => I.id === t) : -1, [e, t]), m = M(
9262
9275
  (I) => {
9263
9276
  if (!l?.current || !c || !u) return;
9264
- const A = e.find((L) => L.id === I);
9265
- if (!A) return;
9266
- const D = l.current, R = D.clientWidth, E = A.start * u / c + d, O = A.end * u / c + d, B = (E + O) / 2, X = D.scrollLeft, J = X, oe = X + R;
9267
- if (E < J || O > oe) {
9277
+ const E = e.find((L) => L.id === I);
9278
+ if (!E) return;
9279
+ const D = l.current, R = D.clientWidth, A = E.start * u / c + d, O = E.end * u / c + d, B = (A + O) / 2, X = D.scrollLeft, J = X, oe = X + R;
9280
+ if (A < J || O > oe) {
9268
9281
  const L = Math.max(0, B - R / 2);
9269
9282
  D.scrollTo({
9270
9283
  left: L,
@@ -9280,50 +9293,50 @@ function a1({
9280
9293
  const y = M(
9281
9294
  (I) => {
9282
9295
  if (f < 0) return;
9283
- const A = e[f], D = Math.max(0, Math.min(A.end - 0.1, A.start + I)), R = D - A.start, E = [...e];
9284
- if (E[f] = {
9285
- ...A,
9296
+ const E = e[f], D = Math.max(0, Math.min(E.end - 0.1, E.start + I)), R = D - E.start, A = [...e];
9297
+ if (A[f] = {
9298
+ ...E,
9286
9299
  start: D
9287
9300
  }, o && f > 0) {
9288
- const O = E[f - 1];
9289
- Math.abs(O.end - A.start) < bo && (E[f - 1] = {
9301
+ const O = A[f - 1];
9302
+ Math.abs(O.end - E.start) < bo && (A[f - 1] = {
9290
9303
  ...O,
9291
9304
  end: Math.max(O.start + 0.1, O.end + R)
9292
9305
  });
9293
9306
  } else if (!o && f > 0) {
9294
- const O = E[f - 1];
9295
- D < O.end && (E[f - 1] = {
9307
+ const O = A[f - 1];
9308
+ D < O.end && (A[f - 1] = {
9296
9309
  ...O,
9297
9310
  end: D
9298
9311
  });
9299
9312
  }
9300
- n(E);
9313
+ n(A);
9301
9314
  },
9302
9315
  [e, f, o, n]
9303
9316
  ), v = M(
9304
9317
  (I) => {
9305
9318
  if (f < 0) return;
9306
- const A = e[f], D = Math.max(A.start + 0.1, Math.min(a, A.end + I)), R = D - A.end, E = [...e];
9307
- if (E[f] = {
9308
- ...A,
9319
+ const E = e[f], D = Math.max(E.start + 0.1, Math.min(a, E.end + I)), R = D - E.end, A = [...e];
9320
+ if (A[f] = {
9321
+ ...E,
9309
9322
  end: D
9310
9323
  }, o && f < e.length - 1) {
9311
- const O = E[f + 1];
9312
- if (Math.abs(O.start - A.end) < bo) {
9324
+ const O = A[f + 1];
9325
+ if (Math.abs(O.start - E.end) < bo) {
9313
9326
  const B = Math.min(
9314
9327
  O.end - 0.1,
9315
9328
  O.start + R
9316
9329
  );
9317
- E[f + 1] = {
9330
+ A[f + 1] = {
9318
9331
  ...O,
9319
9332
  start: B
9320
9333
  };
9321
9334
  let X = f + 1;
9322
- for (; X < E.length - 1; ) {
9323
- const J = E[X], oe = E[X + 1];
9335
+ for (; X < A.length - 1; ) {
9336
+ const J = A[X], oe = A[X + 1];
9324
9337
  if (Math.abs(oe.start - e[X].end) < bo) {
9325
9338
  const L = J.end - e[X].end;
9326
- E[X + 1] = {
9339
+ A[X + 1] = {
9327
9340
  ...oe,
9328
9341
  start: Math.min(oe.end - 0.1, oe.start + L)
9329
9342
  }, X++;
@@ -9332,17 +9345,17 @@ function a1({
9332
9345
  }
9333
9346
  }
9334
9347
  } else if (!o && f < e.length - 1) {
9335
- const O = E[f + 1];
9348
+ const O = A[f + 1];
9336
9349
  if (D > O.start) {
9337
- E[f + 1] = {
9350
+ A[f + 1] = {
9338
9351
  ...O,
9339
9352
  start: D
9340
9353
  };
9341
9354
  let B = f + 1;
9342
- for (; B < E.length - 1; ) {
9343
- const X = E[B], J = E[B + 1];
9355
+ for (; B < A.length - 1; ) {
9356
+ const X = A[B], J = A[B + 1];
9344
9357
  if (X.end > J.start)
9345
- E[B + 1] = {
9358
+ A[B + 1] = {
9346
9359
  ...J,
9347
9360
  start: X.end
9348
9361
  }, B++;
@@ -9351,7 +9364,7 @@ function a1({
9351
9364
  }
9352
9365
  }
9353
9366
  }
9354
- n(E);
9367
+ n(A);
9355
9368
  },
9356
9369
  [e, f, a, o, n]
9357
9370
  ), p = M(() => {
@@ -9364,11 +9377,11 @@ function a1({
9364
9377
  !r || e.length === 0 || r(e[e.length - 1].id);
9365
9378
  }, [e, r]), _ = M(() => {
9366
9379
  r && r(null);
9367
- }, [r]), C = M(() => {
9380
+ }, [r]), S = M(() => {
9368
9381
  if (f < 0 || !h) return;
9369
- const I = e[f], A = s ? void 0 : I.end - I.start;
9370
- h(I.start, A);
9371
- }, [e, f, s, h]), S = Te(
9382
+ const I = e[f], E = s ? void 0 : I.end - I.start;
9383
+ h(I.start, E);
9384
+ }, [e, f, s, h]), C = Te(
9372
9385
  () => [
9373
9386
  {
9374
9387
  key: "[",
@@ -9398,12 +9411,12 @@ function a1({
9398
9411
  },
9399
9412
  {
9400
9413
  key: "Enter",
9401
- action: C,
9414
+ action: S,
9402
9415
  description: "Play selected annotation",
9403
9416
  preventDefault: !0
9404
9417
  }
9405
9418
  ],
9406
- [y, v, C]
9419
+ [y, v, S]
9407
9420
  ), k = Te(
9408
9421
  () => [
9409
9422
  {
@@ -9452,7 +9465,7 @@ function a1({
9452
9465
  [p, b, w, g, _]
9453
9466
  );
9454
9467
  return is({
9455
- shortcuts: S,
9468
+ shortcuts: C,
9456
9469
  enabled: i && f >= 0
9457
9470
  }), is({
9458
9471
  shortcuts: k,
@@ -9466,7 +9479,7 @@ function a1({
9466
9479
  selectLast: g,
9467
9480
  clearSelection: _,
9468
9481
  scrollToAnnotation: m,
9469
- playActiveAnnotation: C
9482
+ playActiveAnnotation: S
9470
9483
  };
9471
9484
  }
9472
9485
  const Ja = [
@@ -10006,7 +10019,7 @@ const Ja = [
10006
10019
  { id: "dynamics", name: "Dynamics" },
10007
10020
  { id: "spatial", name: "Spatial" }
10008
10021
  ];
10009
- const Av = {
10022
+ const Ev = {
10010
10023
  reverb: Kf,
10011
10024
  freeverb: Uf,
10012
10025
  jcReverb: Yf,
@@ -10028,10 +10041,10 @@ const Av = {
10028
10041
  gate: Tf,
10029
10042
  stereoWidener: $f
10030
10043
  };
10031
- let Ev = 0;
10032
- const Mv = () => `effect_${Date.now()}_${++Ev}`;
10044
+ let Av = 0;
10045
+ const Mv = () => `effect_${Date.now()}_${++Av}`;
10033
10046
  function La(e, t) {
10034
- const n = Av[e.id];
10047
+ const n = Ev[e.id];
10035
10048
  if (!n)
10036
10049
  throw new Error(`Unknown effect type: ${e.id}`);
10037
10050
  const r = {};
@@ -10112,22 +10125,22 @@ function l1(e = 256) {
10112
10125
  const { masterGainNode: b, destination: w, analyserNode: g } = p;
10113
10126
  try {
10114
10127
  b.disconnect();
10115
- } catch (C) {
10116
- console.warn("[waveform-playlist] Error disconnecting master effects chain:", C);
10128
+ } catch (S) {
10129
+ console.warn("[waveform-playlist] Error disconnecting master effects chain:", S);
10117
10130
  }
10118
- const _ = v.map((C) => a.current.get(C.instanceId)).filter((C) => C !== void 0);
10131
+ const _ = v.map((S) => a.current.get(S.instanceId)).filter((S) => S !== void 0);
10119
10132
  if (_.length === 0)
10120
10133
  b.connect(g), g.connect(w);
10121
10134
  else {
10122
- let C = b;
10123
- _.forEach((S) => {
10135
+ let S = b;
10136
+ _.forEach((C) => {
10124
10137
  try {
10125
- S.disconnect();
10138
+ C.disconnect();
10126
10139
  } catch (k) {
10127
- console.warn(`[waveform-playlist] Error disconnecting effect "${S.id}":`, k);
10140
+ console.warn(`[waveform-playlist] Error disconnecting effect "${C.id}":`, k);
10128
10141
  }
10129
- C.connect(S.effect), C = S.effect;
10130
- }), C.connect(g), g.connect(w);
10142
+ S.connect(C.effect), S = C.effect;
10143
+ }), S.connect(g), g.connect(w);
10131
10144
  }
10132
10145
  }, []), l = M((v) => {
10133
10146
  const p = Gd(v);
@@ -10192,14 +10205,14 @@ function l1(e = 256) {
10192
10205
  destination: p,
10193
10206
  analyserNode: w
10194
10207
  };
10195
- const _ = r.current.map((C) => a.current.get(C.instanceId)).filter((C) => C !== void 0);
10208
+ const _ = r.current.map((S) => a.current.get(S.instanceId)).filter((S) => S !== void 0);
10196
10209
  if (_.length === 0)
10197
10210
  v.connect(w), w.connect(p);
10198
10211
  else {
10199
- let C = v;
10200
- _.forEach((S) => {
10201
- C.connect(S.effect), C = S.effect;
10202
- }), C.connect(w), w.connect(p);
10212
+ let S = v;
10213
+ _.forEach((C) => {
10214
+ S.connect(C.effect), S = C.effect;
10215
+ }), S.connect(w), w.connect(p);
10203
10216
  }
10204
10217
  return function() {
10205
10218
  w.dispose(), o.current = null, s.current = null;
@@ -10220,19 +10233,19 @@ function l1(e = 256) {
10220
10233
  return (p, b, w) => {
10221
10234
  const g = [];
10222
10235
  for (const _ of v) {
10223
- const C = La(_.definition, _.params);
10224
- g.push(C);
10236
+ const S = La(_.definition, _.params);
10237
+ g.push(S);
10225
10238
  }
10226
10239
  if (g.length === 0)
10227
10240
  p.connect(b);
10228
10241
  else {
10229
10242
  let _ = p;
10230
- g.forEach((C) => {
10231
- _.connect(C.effect), _ = C.effect;
10243
+ g.forEach((S) => {
10244
+ _.connect(S.effect), _ = S.effect;
10232
10245
  }), _.connect(b);
10233
10246
  }
10234
10247
  return function() {
10235
- g.forEach((C) => C.dispose());
10248
+ g.forEach((S) => S.dispose());
10236
10249
  };
10237
10250
  };
10238
10251
  }, [t]);
@@ -10270,10 +10283,10 @@ function c1() {
10270
10283
  w.forEach((_) => {
10271
10284
  try {
10272
10285
  _.disconnect();
10273
- } catch (C) {
10286
+ } catch (S) {
10274
10287
  console.warn(
10275
10288
  `[waveform-playlist] Error disconnecting effect "${_.id}" on track "${f}":`,
10276
- C
10289
+ S
10277
10290
  );
10278
10291
  }
10279
10292
  g.connect(_.effect), g = _.effect;
@@ -10319,7 +10332,7 @@ function c1() {
10319
10332
  return g.set(
10320
10333
  f,
10321
10334
  _.map(
10322
- (C) => C.instanceId === m ? { ...C, params: { ...C.params, [y]: v } } : C
10335
+ (S) => S.instanceId === m ? { ...S, params: { ...S.params, [y]: v } } : S
10323
10336
  )
10324
10337
  ), g;
10325
10338
  });
@@ -10334,10 +10347,10 @@ function c1() {
10334
10347
  w.setParameter("wet", p ? 0 : g);
10335
10348
  }
10336
10349
  t((g) => {
10337
- const _ = new Map(g), C = _.get(f) || [];
10350
+ const _ = new Map(g), S = _.get(f) || [];
10338
10351
  return _.set(
10339
10352
  f,
10340
- C.map((S) => S.instanceId === m ? { ...S, bypassed: p } : S)
10353
+ S.map((C) => C.instanceId === m ? { ...C, bypassed: p } : C)
10341
10354
  ), _;
10342
10355
  });
10343
10356
  }, []), c = M((f) => {
@@ -10472,17 +10485,17 @@ function Dv() {
10472
10485
  let g = 0;
10473
10486
  for (const D of i)
10474
10487
  for (const R of D.clips) {
10475
- const E = R.startSample + R.durationSamples;
10476
- g = Math.max(g, E);
10488
+ const A = R.startSample + R.durationSamples;
10489
+ g = Math.max(g, A);
10477
10490
  }
10478
10491
  g += Math.round(w * 0.1);
10479
- const _ = g / w, C = d === "individual" ? [{ track: i[h], state: l[h], index: h }] : i.map((D, R) => ({ track: D, state: l[R], index: R })), S = l.some((D) => D.soloed), k = !!v;
10492
+ const _ = g / w, S = d === "individual" ? [{ track: i[h], state: l[h], index: h }] : i.map((D, R) => ({ track: D, state: l[R], index: R })), C = l.some((D) => D.soloed), k = !!v;
10480
10493
  let I;
10481
10494
  if ((y || k) && m)
10482
10495
  I = await Pv(
10483
- C,
10484
- l,
10485
10496
  S,
10497
+ l,
10498
+ C,
10486
10499
  _,
10487
10500
  w,
10488
10501
  y,
@@ -10494,25 +10507,25 @@ function Dv() {
10494
10507
  else {
10495
10508
  const D = new OfflineAudioContext(2, g, w);
10496
10509
  let R = 0;
10497
- const E = C.reduce((O, { track: B }) => O + B.clips.length, 0);
10498
- for (const { track: O, state: B } of C)
10499
- if (!(B.muted && !B.soloed) && !(S && !B.soloed))
10510
+ const A = S.reduce((O, { track: B }) => O + B.clips.length, 0);
10511
+ for (const { track: O, state: B } of S)
10512
+ if (!(B.muted && !B.soloed) && !(C && !B.soloed))
10500
10513
  for (const X of O.clips) {
10501
10514
  await Wv(D, X, B, w, m), R++;
10502
- const J = R / E * 0.5;
10515
+ const J = R / A * 0.5;
10503
10516
  r(J), b?.(J);
10504
10517
  }
10505
10518
  r(0.5), b?.(0.5), I = await D.startRendering();
10506
10519
  }
10507
10520
  r(0.9), b?.(0.9);
10508
- const A = $v(I, { bitDepth: p });
10521
+ const E = $v(I, { bitDepth: p });
10509
10522
  if (r(1), b?.(1), f) {
10510
10523
  const D = d === "individual" ? `${u}_${i[h].name}` : u;
10511
- Tv(A, `${D}.wav`);
10524
+ Tv(E, `${D}.wav`);
10512
10525
  }
10513
10526
  return {
10514
10527
  audioBuffer: I,
10515
- blob: A,
10528
+ blob: E,
10516
10529
  duration: _
10517
10530
  };
10518
10531
  } catch (w) {
@@ -10541,18 +10554,18 @@ async function Pv(e, t, n, r, a, o, s, i) {
10541
10554
  o ? b = o(p, v, !0) : p.connect(v);
10542
10555
  for (const { track: w, state: g } of e) {
10543
10556
  if (g.muted && !g.soloed || n && !g.soloed) continue;
10544
- const _ = new c(Rv(g.volume)), C = new d(g.pan), S = new u(g.muted ? 0 : 1), k = s?.(w.id);
10545
- k ? k(S, p, !0) : S.connect(p), C.connect(S), _.connect(C);
10557
+ const _ = new c(Rv(g.volume)), S = new d(g.pan), C = new u(g.muted ? 0 : 1), k = s?.(w.id);
10558
+ k ? k(C, p, !0) : C.connect(p), S.connect(C), _.connect(S);
10546
10559
  for (const I of w.clips) {
10547
10560
  const {
10548
- audioBuffer: A,
10561
+ audioBuffer: E,
10549
10562
  startSample: D,
10550
10563
  durationSamples: R,
10551
- offsetSamples: E,
10564
+ offsetSamples: A,
10552
10565
  gain: O,
10553
10566
  fadeIn: B,
10554
10567
  fadeOut: X
10555
- } = I, J = D / a, oe = R / a, L = E / a, ae = new f(A), se = new h(ae), ie = new u(O);
10568
+ } = I, J = D / a, oe = R / a, L = A / a, ae = new f(E), se = new h(ae), ie = new u(O);
10556
10569
  if (se.connect(ie), ie.connect(_), B) {
10557
10570
  const ce = J, ye = J + B.duration, _e = ko(ie.gain);
10558
10571
  _e && (_e.setValueAtTime(0, ce), _e.linearRampToValueAtTime(O, ye));
@@ -10903,12 +10916,12 @@ function Vv(e, t) {
10903
10916
  continue;
10904
10917
  }
10905
10918
  if (m.get(g.audioBuffer)) {
10906
- const S = y.get(g.audioBuffer);
10907
- S ? S.add(g.id) : y.set(g.audioBuffer, /* @__PURE__ */ new Set([g.id]));
10919
+ const C = y.get(g.audioBuffer);
10920
+ C ? C.add(g.id) : y.set(g.audioBuffer, /* @__PURE__ */ new Set([g.id]));
10908
10921
  continue;
10909
10922
  }
10910
- const C = p.get(g.audioBuffer);
10911
- C ? C.add(g.id) : p.set(g.audioBuffer, /* @__PURE__ */ new Set([g.id]));
10923
+ const S = p.get(g.audioBuffer);
10924
+ S ? S.add(g.id) : p.set(g.audioBuffer, /* @__PURE__ */ new Set([g.id]));
10912
10925
  }
10913
10926
  if (v.length > 0 && r((w) => {
10914
10927
  const g = new Map(w);
@@ -10923,8 +10936,8 @@ function Vv(e, t) {
10923
10936
  const _ = [];
10924
10937
  for (let k = 0; k < w.numberOfChannels; k++)
10925
10938
  _.push(w.getChannelData(k).slice().buffer);
10926
- const C = `buffer-${Math.random().toString(36).slice(2, 11)}`, S = b.generate({
10927
- id: C,
10939
+ const S = `buffer-${Math.random().toString(36).slice(2, 11)}`, C = b.generate({
10940
+ id: S,
10928
10941
  channels: _,
10929
10942
  length: w.length,
10930
10943
  sampleRate: w.sampleRate,
@@ -10934,8 +10947,8 @@ function Vv(e, t) {
10934
10947
  }).then((k) => {
10935
10948
  f.set(w, k);
10936
10949
  const I = y.get(w) ?? /* @__PURE__ */ new Set();
10937
- y.delete(w), m.delete(w), !h && (r((A) => {
10938
- const D = new Map(A);
10950
+ y.delete(w), m.delete(w), !h && (r((E) => {
10951
+ const D = new Map(E);
10939
10952
  for (const R of I)
10940
10953
  D.set(R, k);
10941
10954
  return D;
@@ -10943,7 +10956,7 @@ function Vv(e, t) {
10943
10956
  }).catch((k) => {
10944
10957
  y.delete(w), m.delete(w), !h && (console.warn("[waveform-playlist] Worker peak generation failed:", k), u.current--, u.current <= 0 && (u.current = 0, o(!1)));
10945
10958
  });
10946
- m.set(w, S);
10959
+ m.set(w, C);
10947
10960
  }
10948
10961
  return () => {
10949
10962
  h = !0, l.current = /* @__PURE__ */ new WeakMap(), c.current = /* @__PURE__ */ new WeakMap(), u.current = 0, o(!1);
@@ -11062,9 +11075,9 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11062
11075
  ), [];
11063
11076
  }
11064
11077
  return c.annotations;
11065
- }, [c?.annotations]), C = T(_);
11066
- C.current = _;
11067
- const [S, k] = V(null), [I, A] = V(!1), [D, R] = V(0), [E, O] = V(0), [B, X] = V([]), [J, oe] = V([]), [L, ae] = V([]), [se, ie] = V(s), [ce, ye] = V(
11078
+ }, [c?.annotations]), S = T(_);
11079
+ S.current = _;
11080
+ const [C, k] = V(null), [I, E] = V(!1), [D, R] = V(0), [A, O] = V(0), [B, X] = V([]), [J, oe] = V([]), [L, ae] = V([]), [se, ie] = V(s), [ce, ye] = V(
11068
11081
  c?.isContinuousPlay ?? !1
11069
11082
  ), [_e, Fe] = V(c?.linkEndpoints ?? !1), [Y, N] = V(c?.editable ?? !1), [he, U] = V(!1), $ = T(null), ge = T(!1), Le = T(!1);
11070
11083
  Le.current = I;
@@ -11093,8 +11106,8 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11093
11106
  onEngineState: ki
11094
11107
  } = Cv({ engineRef: $ }), {
11095
11108
  selectedTrackId: Ii,
11096
- setSelectedTrackId: Ai,
11097
- onEngineState: Ei,
11109
+ setSelectedTrackId: Ei,
11110
+ onEngineState: Ai,
11098
11111
  selectedTrackIdRef: Mi
11099
11112
  } = Sv({ engineRef: $ }), { animationFrameRef: $i, startAnimationFrameLoop: to, stopAnimationFrameLoop: ea } = Yd(), vf = Te(
11100
11113
  () => Math.min(...g ?? [256, 512, 1024, 2048, 4096, 8192]),
@@ -11117,7 +11130,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11117
11130
  if (!ke.current || !B.length) return;
11118
11131
  const F = ke.current, H = ze.current, pe = Ue;
11119
11132
  if (H === pe) return;
11120
- const z = l.show ? l.width : 0, Ae = F.clientWidth, Ne = F.scrollLeft + Ae / 2 - z, Pn = B[0].sampleRate, Rn = Ne * H / Pn * Pn / pe, oo = Math.max(0, Rn + z - Ae / 2);
11133
+ const z = l.show ? l.width : 0, Ee = F.clientWidth, Ne = F.scrollLeft + Ee / 2 - z, Pn = B[0].sampleRate, Rn = Ne * H / Pn * Pn / pe, oo = Math.max(0, Rn + z - Ee / 2);
11121
11134
  F.scrollLeft = oo, ze.current = pe;
11122
11135
  }, [Ue, B, l]);
11123
11136
  const ta = T(null);
@@ -11125,8 +11138,8 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11125
11138
  if (no || ue.current) {
11126
11139
  no && (St.current = null);
11127
11140
  let z = 0;
11128
- e.forEach((Ae) => {
11129
- Ae.clips.forEach((He) => {
11141
+ e.forEach((Ee) => {
11142
+ Ee.clips.forEach((He) => {
11130
11143
  const Ne = (He.startSample + He.durationSamples) / He.sampleRate;
11131
11144
  z = Math.max(z, Ne);
11132
11145
  });
@@ -11144,13 +11157,13 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11144
11157
  e.forEach(($e) => {
11145
11158
  $e.clips.length > 0 && $e.clips[0].audioBuffer && z.push($e.clips[0].audioBuffer);
11146
11159
  });
11147
- let Ae = 0;
11160
+ let Ee = 0;
11148
11161
  e.forEach(($e) => {
11149
11162
  $e.clips.forEach((vt) => {
11150
11163
  const Qt = vt.sampleRate, Cf = (vt.startSample + vt.durationSamples) / Qt;
11151
- Ae = Math.max(Ae, Cf);
11164
+ Ee = Math.max(Ee, Cf);
11152
11165
  });
11153
- }), X(z), O(Ae), ae(($e) => $e.length === e.length ? $e.map((vt, Qt) => ({
11166
+ }), X(z), O(Ee), ae(($e) => $e.length === e.length ? $e.map((vt, Qt) => ({
11154
11167
  ...vt,
11155
11168
  name: e[Qt].name
11156
11169
  })) : e.map((vt) => ({
@@ -11178,14 +11191,14 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11178
11191
  });
11179
11192
  let Rn = !0;
11180
11193
  Ne.on("statechange", ($e) => {
11181
- dn($e), ki($e), Ei($e), kt($e), we($e), !Rn && $e.tracksVersion !== Wt.current && (Wt.current = $e.tracksVersion, St.current = $e.tracks, p ? p($e.tracks) : console.warn(
11194
+ dn($e), ki($e), Ai($e), kt($e), we($e), !Rn && $e.tracksVersion !== Wt.current && (Wt.current = $e.tracksVersion, St.current = $e.tracks, p ? p($e.tracks) : console.warn(
11182
11195
  "[waveform-playlist] Engine tracks changed but onTracksChange prop is not set — UI will revert on next render. Pass onTracksChange to WaveformPlaylistProvider."
11183
11196
  ));
11184
11197
  }), Ne.setTracks(ra), Rn = !1, Wt.current = Ne.getState().tracksVersion, $.current = Ne, U(!0);
11185
11198
  const oo = new CustomEvent("waveform-playlist:ready", {
11186
11199
  detail: {
11187
11200
  trackCount: e.length,
11188
- duration: Ae
11201
+ duration: Ee
11189
11202
  }
11190
11203
  });
11191
11204
  window.dispatchEvent(oo), d?.();
@@ -11212,7 +11225,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11212
11225
  ea,
11213
11226
  dn,
11214
11227
  ki,
11215
- Ei,
11228
+ Ai,
11216
11229
  kt,
11217
11230
  we,
11218
11231
  p,
@@ -11226,10 +11239,10 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11226
11239
  ]), j(() => {
11227
11240
  if (e.length === 0) return;
11228
11241
  const F = e.map((H) => H.clips.map((z) => {
11229
- let Ae;
11242
+ let Ee;
11230
11243
  if (z.waveformData)
11231
11244
  try {
11232
- Ae = Vl(
11245
+ Ee = Vl(
11233
11246
  z.waveformData,
11234
11247
  Ue,
11235
11248
  n,
@@ -11239,11 +11252,11 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11239
11252
  } catch (He) {
11240
11253
  console.warn("[waveform-playlist] Failed to extract peaks from waveformData:", He);
11241
11254
  }
11242
- if (!Ae) {
11255
+ if (!Ee) {
11243
11256
  const He = Ti.get(z.id);
11244
11257
  if (He)
11245
11258
  try {
11246
- Ae = Vl(
11259
+ Ee = Vl(
11247
11260
  He,
11248
11261
  Ue,
11249
11262
  n,
@@ -11254,12 +11267,12 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11254
11267
  console.warn("[waveform-playlist] Failed to extract peaks from cache:", Ne);
11255
11268
  }
11256
11269
  }
11257
- if (!Ae) {
11270
+ if (!Ee) {
11258
11271
  !z.audioBuffer && !z.waveformData && console.warn(
11259
11272
  `[waveform-playlist] Clip "${z.id}" has no audio data or waveform data`
11260
11273
  );
11261
11274
  const He = n ? 1 : z.audioBuffer?.numberOfChannels ?? 1;
11262
- Ae = {
11275
+ Ee = {
11263
11276
  length: 0,
11264
11277
  data: Array.from({ length: He }, () => new Int16Array(0)),
11265
11278
  bits: 16
@@ -11268,7 +11281,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11268
11281
  return {
11269
11282
  clipId: z.id,
11270
11283
  trackName: H.name,
11271
- peaks: Ae,
11284
+ peaks: Ee,
11272
11285
  startSample: z.startSample,
11273
11286
  durationSamples: z.durationSamples,
11274
11287
  fadeIn: z.fadeIn,
@@ -11289,41 +11302,41 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11289
11302
  const F = () => {
11290
11303
  const H = Dn();
11291
11304
  be.current = H;
11292
- const pe = C.current;
11305
+ const pe = S.current;
11293
11306
  if (pe.length > 0) {
11294
11307
  const z = pe.find(
11295
- (Ae) => H >= Ae.start && H < Ae.end
11308
+ (Ee) => H >= Ee.start && H < Ee.end
11296
11309
  );
11297
11310
  if (tt.current)
11298
11311
  z && z.id !== dt.current ? Xt(z.id) : !z && dt.current !== null && Xt(null);
11299
11312
  else if (dt.current) {
11300
- const Ae = pe.find(
11313
+ const Ee = pe.find(
11301
11314
  (He) => He.id === dt.current
11302
11315
  );
11303
- if (Ae && H >= Ae.end) {
11304
- $.current && $.current.stop(), A(!1), be.current = Q.current, R(Q.current);
11316
+ if (Ee && H >= Ee.end) {
11317
+ $.current && $.current.stop(), E(!1), be.current = Q.current, R(Q.current);
11305
11318
  return;
11306
11319
  }
11307
11320
  } else
11308
11321
  z && Xt(z.id);
11309
11322
  }
11310
11323
  if (Je.current && ke.current && B.length > 0) {
11311
- const z = ke.current, Ae = B[0].sampleRate, He = H * Ae / ze.current, Ne = z.clientWidth, Pn = l.show ? l.width : 0, ra = He + Pn, Rn = Math.max(0, ra - Ne / 2);
11324
+ const z = ke.current, Ee = B[0].sampleRate, He = H * Ee / ze.current, Ne = z.clientWidth, Pn = l.show ? l.width : 0, ra = He + Pn, Rn = Math.max(0, ra - Ne / 2);
11312
11325
  z.scrollLeft = Rn;
11313
11326
  }
11314
11327
  if (Ye.current !== null && H >= Ye.current) {
11315
- $.current && $.current.stop(), A(!1), be.current = Ye.current, R(Ye.current), Ye.current = null;
11328
+ $.current && $.current.stop(), E(!1), be.current = Ye.current, R(Ye.current), Ye.current = null;
11316
11329
  return;
11317
11330
  }
11318
- if (H >= E) {
11319
- $.current && $.current.stop(), A(!1), be.current = Q.current, R(Q.current), Xt(null);
11331
+ if (H >= A) {
11332
+ $.current && $.current.stop(), E(!1), be.current = Q.current, R(Q.current), Xt(null);
11320
11333
  return;
11321
11334
  }
11322
11335
  to(F);
11323
11336
  };
11324
11337
  to(F);
11325
11338
  }, [
11326
- E,
11339
+ A,
11327
11340
  B,
11328
11341
  l.show,
11329
11342
  l.width,
@@ -11342,7 +11355,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11342
11355
  } else
11343
11356
  gt(), pn();
11344
11357
  })().catch((H) => {
11345
- console.warn("[waveform-playlist] Failed to reschedule playback:", H), A(!1), gt();
11358
+ console.warn("[waveform-playlist] Failed to reschedule playback:", H), E(!1), gt();
11346
11359
  });
11347
11360
  }, [ce, I, pn, gt, $i]), j(() => {
11348
11361
  (async () => {
@@ -11350,10 +11363,10 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11350
11363
  const { position: H } = ta.current;
11351
11364
  ta.current = null;
11352
11365
  const z = Gt().currentTime;
11353
- q.current = z, Oe.current = H, ge.current || (await $.current.init(), ge.current = !0), $.current.play(H), A(!0), pn();
11366
+ q.current = z, Oe.current = H, ge.current || (await $.current.init(), ge.current = !0), $.current.play(H), E(!0), pn();
11354
11367
  }
11355
11368
  })().catch((H) => {
11356
- console.warn("[waveform-playlist] Failed to resume playback after track change:", H), A(!1), gt();
11369
+ console.warn("[waveform-playlist] Failed to resume playback after track change:", H), E(!1), gt();
11357
11370
  });
11358
11371
  }, [e, pn, gt]);
11359
11372
  const na = M(
@@ -11361,8 +11374,8 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11361
11374
  if (!$.current || B.length === 0) return;
11362
11375
  const pe = F ?? be.current;
11363
11376
  Q.current = pe, be.current = pe, $.current.stop(), $.current.seek(pe), gt();
11364
- const Ae = Gt().currentTime;
11365
- q.current = Ae, Oe.current = pe, Ye.current = H !== void 0 ? pe + H : null, ge.current || (await $.current.init(), ge.current = !0);
11377
+ const Ee = Gt().currentTime;
11378
+ q.current = Ee, Oe.current = pe, Ye.current = H !== void 0 ? pe + H : null, ge.current || (await $.current.init(), ge.current = !0);
11366
11379
  const He = H !== void 0 ? pe + H : void 0;
11367
11380
  try {
11368
11381
  $.current.play(pe, He);
@@ -11370,21 +11383,21 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11370
11383
  console.warn("[waveform-playlist] Playback failed to start:", Ne), gt();
11371
11384
  return;
11372
11385
  }
11373
- A(!0), pn();
11386
+ E(!0), pn();
11374
11387
  },
11375
11388
  [B.length, pn, gt]
11376
11389
  ), Wi = M(() => {
11377
11390
  if (!$.current) return;
11378
11391
  const F = Dn();
11379
- $.current.pause(), A(!1), gt(), be.current = F, R(F);
11392
+ $.current.pause(), E(!1), gt(), be.current = F, R(F);
11380
11393
  }, [gt, Dn]), Fi = M(() => {
11381
- $.current && ($.current.stop(), A(!1), gt(), be.current = Q.current, R(Q.current), Xt(null));
11394
+ $.current && ($.current.stop(), E(!1), gt(), be.current = Q.current, R(Q.current), Xt(null));
11382
11395
  }, [gt, Xt]), Oi = M(
11383
11396
  (F) => {
11384
- const H = Math.max(0, Math.min(F, E));
11397
+ const H = Math.max(0, Math.min(F, A));
11385
11398
  be.current = H, R(H), I && $.current && na(H);
11386
11399
  },
11387
- [E, I, na]
11400
+ [A, I, na]
11388
11401
  ), Bi = M(
11389
11402
  (F, H) => {
11390
11403
  const pe = Ge.current[F]?.id;
@@ -11428,7 +11441,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11428
11441
  ro.current = f;
11429
11442
  const Ni = M(
11430
11443
  (F) => {
11431
- const H = typeof F == "function" ? F(C.current) : F;
11444
+ const H = typeof F == "function" ? F(S.current) : F;
11432
11445
  if (!ro.current) {
11433
11446
  process.env.NODE_ENV !== "production" && console.warn(
11434
11447
  "waveform-playlist: setAnnotations was called but no onAnnotationsChange callback is provided. Annotation edits will not persist. Pass onAnnotationsChange to WaveformPlaylistProvider to handle annotation updates."
@@ -11463,7 +11476,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11463
11476
  isAutomaticScroll: se,
11464
11477
  isLoopEnabled: Ht,
11465
11478
  annotations: _,
11466
- activeAnnotationId: S,
11479
+ activeAnnotationId: C,
11467
11480
  selectionStart: ot,
11468
11481
  selectionEnd: mt,
11469
11482
  selectedTrackId: Ii,
@@ -11477,7 +11490,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11477
11490
  se,
11478
11491
  Ht,
11479
11492
  _,
11480
- S,
11493
+ C,
11481
11494
  ot,
11482
11495
  mt,
11483
11496
  Ii,
@@ -11506,7 +11519,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11506
11519
  setTrackPan: zi,
11507
11520
  // Selection
11508
11521
  setSelection: Zi,
11509
- setSelectedTrackId: Ai,
11522
+ setSelectedTrackId: Ei,
11510
11523
  // Time format
11511
11524
  setTimeFormat: ne,
11512
11525
  formatTime: xe,
@@ -11542,7 +11555,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11542
11555
  Li,
11543
11556
  zi,
11544
11557
  Zi,
11545
- Ai,
11558
+ Ei,
11546
11559
  ne,
11547
11560
  xe,
11548
11561
  Me.zoomIn,
@@ -11563,7 +11576,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11563
11576
  ]
11564
11577
  ), _f = Te(
11565
11578
  () => ({
11566
- duration: E,
11579
+ duration: A,
11567
11580
  audioBuffers: B,
11568
11581
  peaksDataArray: J,
11569
11582
  trackStates: L,
@@ -11587,7 +11600,7 @@ const Ud = Ze(null), Kd = Ze(null), jd = Ze(null), qd = Ze(null), d1 = ({
11587
11600
  isDraggingRef: ue
11588
11601
  }),
11589
11602
  [
11590
- E,
11603
+ A,
11591
11604
  B,
11592
11605
  J,
11593
11606
  L,
@@ -11893,7 +11906,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
11893
11906
  onReady: f,
11894
11907
  children: m
11895
11908
  }) => {
11896
- const y = d ?? c + u, [v, p] = V(!1), [b, w] = V(0), [g, _] = V(0), [C, S] = V([]), [k, I] = V(a), A = Te(() => {
11909
+ const y = d ?? c + u, [v, p] = V(!1), [b, w] = V(0), [g, _] = V(0), [S, C] = V([]), [k, I] = V(a), E = Te(() => {
11897
11910
  if (!l?.annotations) return [];
11898
11911
  if (process.env.NODE_ENV !== "production" && l.annotations.length > 0) {
11899
11912
  const G = l.annotations[0];
@@ -11903,9 +11916,9 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
11903
11916
  ), [];
11904
11917
  }
11905
11918
  return l.annotations;
11906
- }, [l?.annotations]), D = T(A);
11907
- D.current = A;
11908
- const [R, E] = V(null), [O, B] = V(
11919
+ }, [l?.annotations]), D = T(E);
11920
+ D.current = E;
11921
+ const [R, A] = V(null), [O, B] = V(
11909
11922
  l?.isContinuousPlay ?? !1
11910
11923
  ), [X] = V(t), [J, oe] = V(o), L = T(null), ae = T(0), se = T(O), ie = T(null), ce = T(null), ye = T(o), _e = T(t), { startAnimationFrameLoop: Fe, stopAnimationFrameLoop: Y } = Yd();
11911
11924
  j(() => {
@@ -11914,7 +11927,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
11914
11927
  ye.current = J;
11915
11928
  }, [J]);
11916
11929
  const N = M((G) => {
11917
- ie.current = G, E(G);
11930
+ ie.current = G, A(G);
11918
11931
  }, []), he = M((G) => {
11919
11932
  se.current = G, B(G);
11920
11933
  }, []), U = M((G) => {
@@ -11967,7 +11980,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
11967
11980
  startSample: 0,
11968
11981
  durationSamples: Math.ceil(e.waveformData.duration * $)
11969
11982
  };
11970
- S([[ue]]);
11983
+ C([[ue]]);
11971
11984
  } catch (G) {
11972
11985
  console.warn("[waveform-playlist] Failed to extract peaks from waveform data:", G);
11973
11986
  }
@@ -12030,12 +12043,12 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
12030
12043
  ), ke = Te(
12031
12044
  () => ({
12032
12045
  continuousPlay: O,
12033
- annotations: A,
12046
+ annotations: E,
12034
12047
  activeAnnotationId: R,
12035
12048
  playbackRate: k,
12036
12049
  isAutomaticScroll: J
12037
12050
  }),
12038
- [O, A, R, k, J]
12051
+ [O, E, R, k, J]
12039
12052
  ), Je = T(h);
12040
12053
  Je.current = h;
12041
12054
  const tt = M(
@@ -12080,7 +12093,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
12080
12093
  ), St = Te(
12081
12094
  () => ({
12082
12095
  duration: g,
12083
- peaksDataArray: C,
12096
+ peaksDataArray: S,
12084
12097
  sampleRate: $,
12085
12098
  waveHeight: n,
12086
12099
  timeScaleHeight: Oe,
@@ -12093,7 +12106,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
12093
12106
  }),
12094
12107
  [
12095
12108
  g,
12096
- C,
12109
+ S,
12097
12110
  $,
12098
12111
  n,
12099
12112
  Oe,
@@ -12246,7 +12259,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
12246
12259
  }, [r, s, a, o]), j(() => {
12247
12260
  !r && t.current && (t.current.textContent = Xn(a.current ?? 0, s));
12248
12261
  }), /* @__PURE__ */ x(Hv, { ref: t, className: e, "aria-label": "Audio position", children: Xn(a.current ?? 0, s) });
12249
- }, A1 = ({ className: e }) => {
12262
+ }, E1 = ({ className: e }) => {
12250
12263
  const { selectionStart: t, selectionEnd: n } = Ct(), { setSelection: r } = Ve();
12251
12264
  return /* @__PURE__ */ x(
12252
12265
  h0,
@@ -12257,7 +12270,7 @@ const Jd = Ze(null), Qd = Ze(null), ef = Ze(null), tf = Ze(null), f1 = ({
12257
12270
  className: e
12258
12271
  }
12259
12272
  );
12260
- }, E1 = ({ className: e }) => {
12273
+ }, A1 = ({ className: e }) => {
12261
12274
  const { isAutomaticScroll: t } = Ct(), { setAutomaticScroll: n } = Ve();
12262
12275
  return /* @__PURE__ */ x(
12263
12276
  $g,
@@ -12408,15 +12421,15 @@ const $1 = ({ className: e }) => {
12408
12421
  }) => {
12409
12422
  const r = T(null), a = T(null), o = jr(), { waveHeight: s } = ja(), { isPlaying: i, currentTimeRef: l, getPlaybackTime: c } = xt(), { samplesPerPixel: u, sampleRate: d } = Dt(), h = o?.waveProgressColor || "rgba(0, 0, 0, 0.1)";
12410
12423
  j(() => {
12411
- const C = () => {
12424
+ const S = () => {
12412
12425
  if (r.current) {
12413
12426
  const k = (i ? c() : l.current ?? 0) * d, I = e + t;
12414
- let A = 0;
12415
- k <= e ? A = 0 : k >= I ? A = 1 : A = (k - e) / t, r.current.style.transform = `scaleX(${A})`;
12427
+ let E = 0;
12428
+ k <= e ? E = 0 : k >= I ? E = 1 : E = (k - e) / t, r.current.style.transform = `scaleX(${E})`;
12416
12429
  }
12417
- i && (a.current = requestAnimationFrame(C));
12430
+ i && (a.current = requestAnimationFrame(S));
12418
12431
  };
12419
- return i ? a.current = requestAnimationFrame(C) : C(), () => {
12432
+ return i ? a.current = requestAnimationFrame(S) : S(), () => {
12420
12433
  a.current && (cancelAnimationFrame(a.current), a.current = null);
12421
12434
  };
12422
12435
  }, [
@@ -12430,9 +12443,9 @@ const $1 = ({ className: e }) => {
12430
12443
  c
12431
12444
  ]), j(() => {
12432
12445
  if (!i && r.current) {
12433
- const S = (l.current ?? 0) * d, k = e + t;
12446
+ const C = (l.current ?? 0) * d, k = e + t;
12434
12447
  let I = 0;
12435
- S <= e ? I = 0 : S >= k ? I = 1 : I = (S - e) / t, r.current.style.transform = `scaleX(${I})`;
12448
+ C <= e ? I = 0 : C >= k ? I = 1 : I = (C - e) / t, r.current.style.transform = `scaleX(${I})`;
12436
12449
  }
12437
12450
  });
12438
12451
  const f = o?.waveformDrawMode || "inverted";
@@ -12514,14 +12527,14 @@ const Kv = 60, jv = ({
12514
12527
  selectionEnd: w,
12515
12528
  annotations: g,
12516
12529
  activeAnnotationId: _,
12517
- annotationsEditable: C,
12518
- linkEndpoints: S,
12530
+ annotationsEditable: S,
12531
+ linkEndpoints: C,
12519
12532
  continuousPlay: k,
12520
12533
  selectedTrackId: I,
12521
- loopStart: A,
12534
+ loopStart: E,
12522
12535
  loopEnd: D,
12523
12536
  isLoopEnabled: R
12524
- } = Ct(), E = We(Qa), {
12537
+ } = Ct(), A = We(Qa), {
12525
12538
  setAnnotations: O,
12526
12539
  setActiveAnnotationId: B,
12527
12540
  setTrackMute: X,
@@ -12662,8 +12675,8 @@ const Kv = 60, jv = ({
12662
12675
  R && /* @__PURE__ */ x(
12663
12676
  f0,
12664
12677
  {
12665
- startPosition: Math.min(A, D) * $ / U,
12666
- endPosition: Math.max(A, D) * $ / U,
12678
+ startPosition: Math.min(E, D) * $ / U,
12679
+ endPosition: Math.max(E, D) * $ / U,
12667
12680
  markerColor: h.loopMarkerColor,
12668
12681
  regionColor: h.loopRegionColor,
12669
12682
  minPosition: 0,
@@ -12782,7 +12795,7 @@ const Kv = 60, jv = ({
12782
12795
  we !== "waveform" && (() => {
12783
12796
  const le = Oe.get(te.id), Ke = le?.config;
12784
12797
  return !Ke?.labels || !le ? null : /* @__PURE__ */ x(
12785
- A0,
12798
+ E0,
12786
12799
  {
12787
12800
  waveHeight: ge,
12788
12801
  numChannels: mt,
@@ -12895,10 +12908,10 @@ const Kv = 60, jv = ({
12895
12908
  }
12896
12909
  ) }, te.id);
12897
12910
  }),
12898
- g.length > 0 && E && /* @__PURE__ */ x(E.AnnotationBoxesWrapper, { height: 30, width: ze, children: g.map((Z, K) => {
12911
+ g.length > 0 && A && /* @__PURE__ */ x(A.AnnotationBoxesWrapper, { height: 30, width: ze, children: g.map((Z, K) => {
12899
12912
  const te = Z.start * $ / U, Ie = Z.end * $ / U, we = a ? a(Z, K) : Z.id;
12900
12913
  return /* @__PURE__ */ x(
12901
- E.AnnotationBox,
12914
+ A.AnnotationBox,
12902
12915
  {
12903
12916
  annotationId: Z.id,
12904
12917
  annotationIndex: K,
@@ -12908,7 +12921,7 @@ const Kv = 60, jv = ({
12908
12921
  color: "#ff9800",
12909
12922
  isActive: Z.id === _,
12910
12923
  onClick: () => nt(Z),
12911
- editable: C
12924
+ editable: S
12912
12925
  },
12913
12926
  Z.id
12914
12927
  );
@@ -13111,60 +13124,60 @@ function oy(e) {
13111
13124
  "onDragOver",
13112
13125
  "onDragEnd"
13113
13126
  ]);
13114
- const u = T(null), { plugins: d, modifiers: h, sensors: f } = c, m = Ut(d, Nn.plugins), y = Ut(f, Nn.sensors), v = Ut(h, Nn.modifiers), p = On(a), b = On(o), w = On(i), g = On(s), _ = On(l), C = On(r), S = sy(() => {
13127
+ const u = T(null), { plugins: d, modifiers: h, sensors: f } = c, m = Ut(d, Nn.plugins), y = Ut(f, Nn.sensors), v = Ut(h, Nn.modifiers), p = On(a), b = On(o), w = On(i), g = On(s), _ = On(l), S = On(r), C = sy(() => {
13115
13128
  var k;
13116
13129
  return (k = c.manager) != null ? k : new si(c);
13117
13130
  });
13118
13131
  return j(() => {
13119
13132
  if (!u.current) throw new Error("Renderer not found");
13120
- const { renderer: k, trackRendering: I } = u.current, { monitor: A } = S;
13121
- S.renderer = k;
13133
+ const { renderer: k, trackRendering: I } = u.current, { monitor: E } = C;
13134
+ C.renderer = k;
13122
13135
  const D = [
13123
- A.addEventListener("beforedragstart", (R) => {
13124
- const E = p.current;
13125
- E && I(() => E(R, S));
13136
+ E.addEventListener("beforedragstart", (R) => {
13137
+ const A = p.current;
13138
+ A && I(() => A(R, C));
13126
13139
  }),
13127
- A.addEventListener(
13140
+ E.addEventListener(
13128
13141
  "dragstart",
13129
13142
  (R) => {
13130
- var E;
13131
- return (E = b.current) == null ? void 0 : E.call(b, R, S);
13143
+ var A;
13144
+ return (A = b.current) == null ? void 0 : A.call(b, R, C);
13132
13145
  }
13133
13146
  ),
13134
- A.addEventListener("dragover", (R) => {
13135
- const E = w.current;
13136
- E && I(() => E(R, S));
13147
+ E.addEventListener("dragover", (R) => {
13148
+ const A = w.current;
13149
+ A && I(() => A(R, C));
13137
13150
  }),
13138
- A.addEventListener("dragmove", (R) => {
13139
- const E = g.current;
13140
- E && I(() => E(R, S));
13151
+ E.addEventListener("dragmove", (R) => {
13152
+ const A = g.current;
13153
+ A && I(() => A(R, C));
13141
13154
  }),
13142
- A.addEventListener("dragend", (R) => {
13143
- const E = _.current;
13144
- E && I(() => E(R, S));
13155
+ E.addEventListener("dragend", (R) => {
13156
+ const A = _.current;
13157
+ A && I(() => A(R, C));
13145
13158
  }),
13146
- A.addEventListener(
13159
+ E.addEventListener(
13147
13160
  "collision",
13148
13161
  (R) => {
13149
- var E;
13150
- return (E = C.current) == null ? void 0 : E.call(C, R, S);
13162
+ var A;
13163
+ return (A = S.current) == null ? void 0 : A.call(S, R, C);
13151
13164
  }
13152
13165
  )
13153
13166
  ];
13154
13167
  return () => D.forEach((R) => R());
13155
- }, [S]), _o(
13168
+ }, [C]), _o(
13156
13169
  m,
13157
- () => S && (S.plugins = m),
13170
+ () => C && (C.plugins = m),
13158
13171
  ...xo
13159
13172
  ), _o(
13160
13173
  y,
13161
- () => S && (S.sensors = y),
13174
+ () => C && (C.sensors = y),
13162
13175
  ...xo
13163
13176
  ), _o(
13164
13177
  v,
13165
- () => S && (S.modifiers = v),
13178
+ () => C && (C.modifiers = v),
13166
13179
  ...xo
13167
- ), /* @__PURE__ */ me(ry.Provider, { value: S, children: [
13180
+ ), /* @__PURE__ */ me(ry.Provider, { value: C, children: [
13168
13181
  /* @__PURE__ */ x(ay, { ref: u, children: n }),
13169
13182
  n
13170
13183
  ] });
@@ -13358,7 +13371,7 @@ const Cy = (e) => {
13358
13371
  }), /* @__PURE__ */ x(Sy, { ref: n, $color: e, $width: l, "data-playhead": !0 });
13359
13372
  }, Iy = W.div`
13360
13373
  position: relative;
13361
- `, Ay = W.div`
13374
+ `, Ey = W.div`
13362
13375
  position: absolute;
13363
13376
  top: ${(e) => e.$top}px;
13364
13377
  left: 0;
@@ -13369,7 +13382,7 @@ const Cy = (e) => {
13369
13382
  transform: translateZ(0);
13370
13383
  backface-visibility: hidden;
13371
13384
  will-change: transform;
13372
- `, Ey = W.div`
13385
+ `, Ay = W.div`
13373
13386
  position: absolute;
13374
13387
  top: ${(e) => e.$top}px;
13375
13388
  left: 0;
@@ -13436,7 +13449,7 @@ const Cy = (e) => {
13436
13449
  const m = ln(f);
13437
13450
  return /* @__PURE__ */ me(Iy, { children: [
13438
13451
  /* @__PURE__ */ x(
13439
- Ay,
13452
+ Ey,
13440
13453
  {
13441
13454
  $color: m,
13442
13455
  $height: s,
@@ -13445,7 +13458,7 @@ const Cy = (e) => {
13445
13458
  }
13446
13459
  ),
13447
13460
  /* @__PURE__ */ x(
13448
- Ey,
13461
+ Ay,
13449
13462
  {
13450
13463
  ref: r,
13451
13464
  $color: d,
@@ -13470,10 +13483,10 @@ const Cy = (e) => {
13470
13483
  timeScaleHeight: w,
13471
13484
  samplesPerPixel: g,
13472
13485
  controls: _,
13473
- playoutRef: C,
13474
- barWidth: S,
13486
+ playoutRef: S,
13487
+ barWidth: C,
13475
13488
  barGap: k
13476
- } = _i(), [I, A] = V(0), [D, R] = V(0), [E, O] = V(!1), B = T(null), X = M(
13489
+ } = _i(), [I, E] = V(0), [D, R] = V(0), [A, O] = V(!1), B = T(null), X = M(
13477
13490
  (Y) => {
13478
13491
  B.current = Y, m(Y);
13479
13492
  },
@@ -13507,32 +13520,32 @@ const Cy = (e) => {
13507
13520
  }), ce = M(
13508
13521
  (Y) => {
13509
13522
  const N = Y.currentTarget.getBoundingClientRect(), he = _.show ? _.width : 0, $ = (Y.clientX - N.left - he) * g / p;
13510
- O(!0), A($), R($);
13523
+ O(!0), E($), R($);
13511
13524
  },
13512
13525
  [_, g, p]
13513
13526
  ), ye = M(
13514
13527
  (Y) => {
13515
- if (!E) return;
13528
+ if (!A) return;
13516
13529
  const N = Y.currentTarget.getBoundingClientRect(), he = _.show ? _.width : 0, $ = (Y.clientX - N.left - he) * g / p;
13517
13530
  R($);
13518
13531
  },
13519
- [E, _, g, p]
13532
+ [A, _, g, p]
13520
13533
  ), _e = M(
13521
13534
  (Y) => {
13522
- if (!E) return;
13535
+ if (!A) return;
13523
13536
  O(!1);
13524
13537
  const N = Y.currentTarget.getBoundingClientRect(), he = _.show ? _.width : 0, $ = (Y.clientX - N.left - he) * g / p, ge = Math.min(I, $), Le = Math.max(I, $);
13525
- Math.abs(Le - ge) < 0.1 ? (d(ge), A(ge), R(ge), s && C.current && (C.current.stop(), u(ge))) : (A(ge), R(Le));
13538
+ Math.abs(Le - ge) < 0.1 ? (d(ge), E(ge), R(ge), s && S.current && (S.current.stop(), u(ge))) : (E(ge), R(Le));
13526
13539
  },
13527
13540
  [
13528
- E,
13541
+ A,
13529
13542
  I,
13530
13543
  g,
13531
13544
  p,
13532
13545
  _,
13533
13546
  d,
13534
13547
  s,
13535
- C,
13548
+ S,
13536
13549
  u
13537
13550
  ]
13538
13551
  );
@@ -13550,7 +13563,7 @@ const Cy = (e) => {
13550
13563
  timeScaleHeight: w,
13551
13564
  duration: y * 1e3,
13552
13565
  controls: _,
13553
- barWidth: S,
13566
+ barWidth: C,
13554
13567
  barGap: k
13555
13568
  },
13556
13569
  children: /* @__PURE__ */ x(
@@ -13567,7 +13580,7 @@ const Cy = (e) => {
13567
13580
  onTracksMouseMove: ye,
13568
13581
  onTracksMouseUp: _e,
13569
13582
  scrollContainerRef: X,
13570
- isSelecting: E,
13583
+ isSelecting: A,
13571
13584
  timescale: w > 0 ? /* @__PURE__ */ x(zd, {}) : void 0,
13572
13585
  children: /* @__PURE__ */ me(Lt, { children: [
13573
13586
  v.map((Y, N) => {
@@ -13752,7 +13765,7 @@ let Yl = za;
13752
13765
  export {
13753
13766
  M1 as AnnotationIntegrationProvider,
13754
13767
  I1 as AudioPosition,
13755
- E1 as AutomaticScrollCheckbox,
13768
+ A1 as AutomaticScrollCheckbox,
13756
13769
  Yl as ClipCollisionModifier,
13757
13770
  $1 as ContinuousPlayCheckbox,
13758
13771
  P1 as DownloadAnnotationsButton,
@@ -13771,7 +13784,7 @@ export {
13771
13784
  qv as PlaylistAnnotationList,
13772
13785
  jv as PlaylistVisualization,
13773
13786
  g1 as RewindButton,
13774
- A1 as SelectionTimeInputs,
13787
+ E1 as SelectionTimeInputs,
13775
13788
  _1 as SetLoopRegionButton,
13776
13789
  y1 as SkipBackwardButton,
13777
13790
  b1 as SkipForwardButton,