@linto-ai/transcript-ui-webcomponent 0.9.21 → 0.9.22

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.
@@ -22203,34 +22203,36 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
22203
22203
  ]),
22204
22204
  _: 1
22205
22205
  }, 8, ["aria-label"])) : createCommentVNode("", true),
22206
- createVNode(unref(Button), {
22207
- variant: "secondary",
22208
- "aria-label": unref(t2)("header.undo"),
22209
- disabled: !props.canUndo,
22210
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("undo"))
22211
- }, {
22212
- icon: withCtx(() => [
22213
- createVNode(unref(EditorIcon), {
22214
- name: "undo",
22215
- size: 16
22216
- })
22217
- ]),
22218
- _: 1
22219
- }, 8, ["aria-label", "disabled"]),
22220
- createVNode(unref(Button), {
22221
- variant: "secondary",
22222
- "aria-label": unref(t2)("header.redo"),
22223
- disabled: !props.canRedo,
22224
- onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("redo"))
22225
- }, {
22226
- icon: withCtx(() => [
22227
- createVNode(unref(EditorIcon), {
22228
- name: "redo",
22229
- size: 16
22230
- })
22231
- ]),
22232
- _: 1
22233
- }, 8, ["aria-label", "disabled"]),
22206
+ props.canUndo || props.canRedo ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
22207
+ createVNode(unref(Button), {
22208
+ variant: "secondary",
22209
+ "aria-label": unref(t2)("header.undo"),
22210
+ disabled: !props.canUndo,
22211
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("undo"))
22212
+ }, {
22213
+ icon: withCtx(() => [
22214
+ createVNode(unref(EditorIcon), {
22215
+ name: "undo",
22216
+ size: 16
22217
+ })
22218
+ ]),
22219
+ _: 1
22220
+ }, 8, ["aria-label", "disabled"]),
22221
+ createVNode(unref(Button), {
22222
+ variant: "secondary",
22223
+ "aria-label": unref(t2)("header.redo"),
22224
+ disabled: !props.canRedo,
22225
+ onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("redo"))
22226
+ }, {
22227
+ icon: withCtx(() => [
22228
+ createVNode(unref(EditorIcon), {
22229
+ name: "redo",
22230
+ size: 16
22231
+ })
22232
+ ]),
22233
+ _: 1
22234
+ }, 8, ["aria-label", "disabled"])
22235
+ ], 64)) : createCommentVNode("", true),
22234
22236
  createVNode(unref(Button), {
22235
22237
  variant: "primary",
22236
22238
  "aria-label": unref(t2)("header.ask"),
@@ -22253,8 +22255,8 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
22253
22255
  };
22254
22256
  }
22255
22257
  });
22256
- const _style_0$p = '\n.editor-header[data-v-6464a453] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--spacing-md);\n padding: var(--spacing-sm) var(--spacing-lg);\n min-height: var(--header-height);\n border-bottom: 1px solid var(--color-border);\n background-color: var(--color-surface);\n flex-shrink: 0;\n}\n.header-main[data-v-6464a453] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n flex: 1;\n}\n.document-title[data-v-6464a453] {\n font-size: var(--font-size-lg);\n font-weight: 600;\n color: var(--color-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n}\n.document-meta[data-v-6464a453] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--spacing-xs);\n font-size: var(--font-size-xs);\n color: var(--color-text-muted);\n}\n.document-meta__part[data-v-6464a453] {\n text-box: cap alphabetic;\n}\n.document-meta__part + .document-meta__part[data-v-6464a453]::before {\n content: "·";\n margin-right: var(--spacing-xs);\n}\n.header-right[data-v-6464a453] {\n display: flex;\n align-items: center;\n gap: var(--spacing-sm);\n flex-shrink: 0;\n}\n@media (max-width: 767px) {\n.editor-header[data-v-6464a453] {\n padding: var(--spacing-xs) var(--spacing-md);\n}\n.document-title[data-v-6464a453] {\n font-size: var(--font-size-base);\n}\n}\n';
22257
- const Header = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["styles", [_style_0$p]], ["__scopeId", "data-v-6464a453"]]);
22258
+ const _style_0$p = '\n.editor-header[data-v-491cf8ab] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--spacing-md);\n padding: var(--spacing-sm) var(--spacing-lg);\n min-height: var(--header-height);\n border-bottom: 1px solid var(--color-border);\n background-color: var(--color-surface);\n flex-shrink: 0;\n}\n.header-main[data-v-491cf8ab] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n flex: 1;\n}\n.document-title[data-v-491cf8ab] {\n font-size: var(--font-size-lg);\n font-weight: 600;\n color: var(--color-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n}\n.document-meta[data-v-491cf8ab] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--spacing-xs);\n font-size: var(--font-size-xs);\n color: var(--color-text-muted);\n}\n.document-meta__part[data-v-491cf8ab] {\n text-box: cap alphabetic;\n}\n.document-meta__part + .document-meta__part[data-v-491cf8ab]::before {\n content: "·";\n margin-right: var(--spacing-xs);\n}\n.header-right[data-v-491cf8ab] {\n display: flex;\n align-items: center;\n gap: var(--spacing-sm);\n flex-shrink: 0;\n}\n@media (max-width: 767px) {\n.editor-header[data-v-491cf8ab] {\n padding: var(--spacing-xs) var(--spacing-md);\n}\n.document-title[data-v-491cf8ab] {\n font-size: var(--font-size-base);\n}\n}\n';
22259
+ const Header = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["styles", [_style_0$p]], ["__scopeId", "data-v-491cf8ab"]]);
22258
22260
  const TRANSCRIPTION_TAB = "__transcription__";
22259
22261
  const VERBATIM_TAB = "__verbatim__";
22260
22262
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
@@ -25824,7 +25826,7 @@ section.turn:has([data-state="open"]) {
25824
25826
  i2 && (i2(), i2 = void 0), s2.forEach(((t3) => t3()));
25825
25827
  };
25826
25828
  }
25827
- class u extends e$1 {
25829
+ let d$1 = class d extends e$1 {
25828
25830
  get isPlayingSignal() {
25829
25831
  return this._isPlaying;
25830
25832
  }
@@ -25955,8 +25957,8 @@ section.turn:has([data-state="open"]) {
25955
25957
  setSinkId(t2) {
25956
25958
  return this.media.setSinkId(t2);
25957
25959
  }
25958
- }
25959
- function d$1({ maxTop: t2, maxBottom: e2, halfHeight: i2, vScale: n2, barMinHeight: s2 = 0, barAlign: r2 }) {
25960
+ };
25961
+ function u({ maxTop: t2, maxBottom: e2, halfHeight: i2, vScale: n2, barMinHeight: s2 = 0, barAlign: r2 }) {
25960
25962
  let o2 = Math.round(t2 * i2 * n2);
25961
25963
  let a2 = o2 + Math.round(e2 * i2 * n2) || 1;
25962
25964
  return a2 < s2 && (a2 = s2, r2 || (o2 = a2 / 2)), { topHeight: o2, totalHeight: a2 };
@@ -26049,16 +26051,16 @@ section.turn:has([data-state="open"]) {
26049
26051
  if (o2.has(e3.pointerId)) return;
26050
26052
  if (o2.set(e3.pointerId, e3), o2.size > 1) return;
26051
26053
  const l2 = e3.pointerId;
26052
- let c3 = e3.clientX, u2 = e3.clientY, d2 = false;
26054
+ let c3 = e3.clientX, d2 = e3.clientY, u2 = false;
26053
26055
  const p2 = Date.now(), m2 = t3.getBoundingClientRect(), { left: g2, top: f2 } = m2, v2 = (t4) => {
26054
26056
  if (t4.pointerId !== l2) return;
26055
26057
  if (t4.defaultPrevented || o2.size > 1) return;
26056
26058
  if (a2 && Date.now() - p2 < s2) return;
26057
- const e4 = t4.clientX, n3 = t4.clientY, h3 = e4 - c3, m3 = n3 - u2;
26058
- (d2 || Math.abs(h3) > i2 || Math.abs(m3) > i2) && (t4.preventDefault(), t4.stopPropagation(), d2 || (r2.set({ type: "start", x: c3 - g2, y: u2 - f2 }), d2 = true), r2.set({ type: "move", x: e4 - g2, y: n3 - f2, deltaX: h3, deltaY: m3 }), c3 = e4, u2 = n3);
26059
+ const e4 = t4.clientX, n3 = t4.clientY, h3 = e4 - c3, m3 = n3 - d2;
26060
+ (u2 || Math.abs(h3) > i2 || Math.abs(m3) > i2) && (t4.preventDefault(), t4.stopPropagation(), u2 || (r2.set({ type: "start", x: c3 - g2, y: d2 - f2 }), u2 = true), r2.set({ type: "move", x: e4 - g2, y: n3 - f2, deltaX: h3, deltaY: m3 }), c3 = e4, d2 = n3);
26059
26061
  }, b2 = (t4) => {
26060
26062
  if (o2.delete(t4.pointerId)) {
26061
- if (t4.pointerId === l2 && d2) {
26063
+ if (t4.pointerId === l2 && u2) {
26062
26064
  const e4 = t4.clientX, i3 = t4.clientY;
26063
26065
  r2.set({ type: "end", x: e4 - g2, y: i3 - f2 });
26064
26066
  }
@@ -26067,9 +26069,9 @@ section.turn:has([data-state="open"]) {
26067
26069
  }, y2 = (t4) => {
26068
26070
  t4.relatedTarget && t4.relatedTarget !== document.documentElement || b2(t4);
26069
26071
  }, C2 = (t4) => {
26070
- d2 && (t4.stopPropagation(), t4.preventDefault());
26072
+ u2 && (t4.stopPropagation(), t4.preventDefault());
26071
26073
  }, S2 = (t4) => {
26072
- t4.defaultPrevented || o2.size > 1 || d2 && t4.preventDefault();
26074
+ t4.defaultPrevented || o2.size > 1 || u2 && t4.preventDefault();
26073
26075
  };
26074
26076
  document.addEventListener("pointermove", v2), document.addEventListener("pointerup", b2), document.addEventListener("pointerout", y2), document.addEventListener("pointercancel", y2), document.addEventListener("touchmove", S2, { passive: false }), document.addEventListener("click", C2, { capture: true }), h2 = () => {
26075
26077
  document.removeEventListener("pointermove", v2), document.removeEventListener("pointerup", b2), document.removeEventListener("pointerout", y2), document.removeEventListener("pointercancel", y2), document.removeEventListener("touchmove", S2), setTimeout((() => {
@@ -26242,23 +26244,23 @@ section.turn:has([data-state="open"]) {
26242
26244
  var t2;
26243
26245
  }
26244
26246
  renderBarWaveform(t2, e2, i2, n2) {
26245
- const { width: s2, height: r2 } = i2.canvas, { halfHeight: o2, barWidth: a2, barRadius: l2, barIndexScale: h2, barSpacing: c2, barMinHeight: u2 } = (function({ width: t3, height: e3, length: i3, options: n3, pixelRatio: s3 }) {
26247
+ const { width: s2, height: r2 } = i2.canvas, { halfHeight: o2, barWidth: a2, barRadius: l2, barIndexScale: h2, barSpacing: c2, barMinHeight: d2 } = (function({ width: t3, height: e3, length: i3, options: n3, pixelRatio: s3 }) {
26246
26248
  const r3 = e3 / 2, o3 = n3.barWidth ? n3.barWidth * s3 : 1, a3 = n3.barGap ? n3.barGap * s3 : n3.barWidth ? o3 / 2 : 0, l3 = o3 + a3 || 1;
26247
26249
  return { halfHeight: r3, barWidth: o3, barGap: a3, barRadius: n3.barRadius || 0, barMinHeight: n3.barMinHeight ? n3.barMinHeight * s3 : 0, barIndexScale: i3 > 0 ? t3 / l3 / i3 : 0, barSpacing: l3 };
26248
26250
  })({ width: s2, height: r2, length: (t2[0] || []).length, options: e2, pixelRatio: this.getPixelRatio() }), m2 = (function({ channelData: t3, barIndexScale: e3, barSpacing: i3, barWidth: n3, halfHeight: s3, vScale: r3, canvasHeight: o3, barAlign: a3, barMinHeight: l3 }) {
26249
- const h3 = t3[0] || [], c3 = t3[1] || h3, u3 = h3.length, m3 = [];
26251
+ const h3 = t3[0] || [], c3 = t3[1] || h3, d3 = h3.length, m3 = [];
26250
26252
  let g2 = 0, f2 = 0, v2 = 0;
26251
- for (let t4 = 0; t4 <= u3; t4++) {
26252
- const u4 = Math.round(t4 * e3);
26253
- if (u4 > g2) {
26254
- const { topHeight: t5, totalHeight: e4 } = d$1({ maxTop: f2, maxBottom: v2, halfHeight: s3, vScale: r3, barMinHeight: l3, barAlign: a3 }), h4 = p({ barAlign: a3, halfHeight: s3, topHeight: t5, totalHeight: e4, canvasHeight: o3 });
26255
- m3.push({ x: g2 * i3, y: h4, width: n3, height: e4 }), g2 = u4, f2 = 0, v2 = 0;
26253
+ for (let t4 = 0; t4 <= d3; t4++) {
26254
+ const d4 = Math.round(t4 * e3);
26255
+ if (d4 > g2) {
26256
+ const { topHeight: t5, totalHeight: e4 } = u({ maxTop: f2, maxBottom: v2, halfHeight: s3, vScale: r3, barMinHeight: l3, barAlign: a3 }), h4 = p({ barAlign: a3, halfHeight: s3, topHeight: t5, totalHeight: e4, canvasHeight: o3 });
26257
+ m3.push({ x: g2 * i3, y: h4, width: n3, height: e4 }), g2 = d4, f2 = 0, v2 = 0;
26256
26258
  }
26257
26259
  const b2 = Math.abs(h3[t4] || 0), y2 = Math.abs(c3[t4] || 0);
26258
26260
  b2 > f2 && (f2 = b2), y2 > v2 && (v2 = y2);
26259
26261
  }
26260
26262
  return m3;
26261
- })({ channelData: t2, barIndexScale: h2, barSpacing: c2, barWidth: a2, halfHeight: o2, vScale: n2, canvasHeight: r2, barAlign: e2.barAlign, barMinHeight: u2 });
26263
+ })({ channelData: t2, barIndexScale: h2, barSpacing: c2, barWidth: a2, halfHeight: o2, vScale: n2, canvasHeight: r2, barAlign: e2.barAlign, barMinHeight: d2 });
26262
26264
  i2.beginPath();
26263
26265
  for (const t3 of m2) l2 && "roundRect" in i2 ? i2.roundRect(t3.x, t3.y, t3.width, t3.height, l2) : i2.rect(t3.x, t3.y, t3.width, t3.height);
26264
26266
  i2.fill(), i2.closePath();
@@ -26268,15 +26270,15 @@ section.turn:has([data-state="open"]) {
26268
26270
  const s3 = i3 / 2, r3 = t3[0] || [];
26269
26271
  return [r3, t3[1] || r3].map(((t4, i4) => {
26270
26272
  const r4 = t4.length, o3 = r4 ? e3 / r4 : 0, a2 = s3, l2 = 0 === i4 ? -1 : 1, h2 = [{ x: 0, y: a2 }];
26271
- let c2 = 0, u2 = 0;
26273
+ let c2 = 0, d2 = 0;
26272
26274
  for (let e4 = 0; e4 <= r4; e4++) {
26273
26275
  const i5 = Math.round(e4 * o3);
26274
26276
  if (i5 > c2) {
26275
- const t5 = a2 + (Math.round(u2 * s3 * n3) || 1) * l2;
26276
- h2.push({ x: c2, y: t5 }), c2 = i5, u2 = 0;
26277
+ const t5 = a2 + (Math.round(d2 * s3 * n3) || 1) * l2;
26278
+ h2.push({ x: c2, y: t5 }), c2 = i5, d2 = 0;
26277
26279
  }
26278
26280
  const r5 = Math.abs(t4[e4] || 0);
26279
- r5 > u2 && (u2 = r5);
26281
+ r5 > d2 && (d2 = r5);
26280
26282
  }
26281
26283
  return h2.push({ x: c2, y: a2 }), h2;
26282
26284
  }));
@@ -26323,29 +26325,29 @@ section.turn:has([data-state="open"]) {
26323
26325
  })({ clientWidth: a2, totalWidth: l2, options: e2 });
26324
26326
  let c2 = {};
26325
26327
  if (0 === h2) return;
26326
- const u2 = (i3) => {
26327
- if (i3 < 0 || i3 >= d2) return;
26328
+ const d2 = (i3) => {
26329
+ if (i3 < 0 || i3 >= u2) return;
26328
26330
  if (c2[i3]) return;
26329
26331
  c2[i3] = true;
26330
26332
  const o3 = i3 * h2;
26331
26333
  let a3 = Math.min(l2 - o3, h2);
26332
26334
  if (a3 = f(a3, e2), a3 <= 0) return;
26333
- const u3 = (function({ channelData: t3, offset: e3, clampedWidth: i4, totalWidth: n3 }) {
26335
+ const d3 = (function({ channelData: t3, offset: e3, clampedWidth: i4, totalWidth: n3 }) {
26334
26336
  return t3.map(((t4) => {
26335
26337
  const s3 = Math.floor(e3 / n3 * t4.length), r3 = Math.floor((e3 + i4) / n3 * t4.length);
26336
26338
  return t4.slice(s3, r3);
26337
26339
  }));
26338
26340
  })({ channelData: t2, offset: o3, clampedWidth: a3, totalWidth: l2 });
26339
- this.renderSingleCanvas(u3, e2, a3, n2, o3, s2, r2);
26340
- }, d2 = Math.ceil(l2 / h2);
26341
+ this.renderSingleCanvas(d3, e2, a3, n2, o3, s2, r2);
26342
+ }, u2 = Math.ceil(l2 / h2);
26341
26343
  if (!this.isScrollable) {
26342
- for (let t3 = 0; t3 < d2; t3++) u2(t3);
26344
+ for (let t3 = 0; t3 < u2; t3++) d2(t3);
26343
26345
  return;
26344
26346
  }
26345
- if (v({ scrollLeft: this.scrollContainer.scrollLeft, totalWidth: l2, numCanvases: d2 }).forEach(((t3) => u2(t3))), d2 > 1) {
26347
+ if (v({ scrollLeft: this.scrollContainer.scrollLeft, totalWidth: l2, numCanvases: u2 }).forEach(((t3) => d2(t3))), u2 > 1) {
26346
26348
  const t3 = this.on("scroll", (() => {
26347
26349
  const { scrollLeft: t4 } = this.scrollContainer;
26348
- Object.keys(c2).length > 10 && (s2.innerHTML = "", r2.innerHTML = "", c2 = {}), v({ scrollLeft: t4, totalWidth: l2, numCanvases: d2 }).forEach(((t5) => u2(t5)));
26350
+ Object.keys(c2).length > 10 && (s2.innerHTML = "", r2.innerHTML = "", c2 = {}), v({ scrollLeft: t4, totalWidth: l2, numCanvases: u2 }).forEach(((t5) => d2(t5)));
26349
26351
  }));
26350
26352
  this.unsubscribeOnScroll.push(t3);
26351
26353
  }
@@ -26608,7 +26610,7 @@ section.turn:has([data-state="open"]) {
26608
26610
  }
26609
26611
  }
26610
26612
  const P = { waveColor: "#999", progressColor: "#555", cursorWidth: 1, minPxPerSec: 0, fillParent: true, interact: true, dragToSeek: false, autoScroll: true, autoCenter: true, sampleRate: 8e3 };
26611
- class w extends u {
26613
+ class w extends d$1 {
26612
26614
  static create(t2) {
26613
26615
  return new w(t2);
26614
26616
  }
@@ -26620,19 +26622,19 @@ section.turn:has([data-state="open"]) {
26620
26622
  }
26621
26623
  constructor(t2) {
26622
26624
  const e2 = t2.media || ("WebAudio" === t2.backend ? new E() : void 0);
26623
- super({ media: e2, mediaControls: t2.mediaControls, autoplay: t2.autoplay, playbackRate: t2.audioRate }), this.plugins = [], this.decodedData = null, this.stopAtPosition = null, this.subscriptions = [], this.mediaSubscriptions = [], this.abortController = null, this._isDestroyed = false, this._loadVersion = 0, this.reactiveCleanups = [], this.options = Object.assign({}, P, t2);
26625
+ super({ media: e2, mediaControls: t2.mediaControls, autoplay: t2.autoplay, playbackRate: t2.audioRate }), this.plugins = [], this.decodedData = null, this.stopAtPosition = null, this.subscriptions = [], this.mediaSubscriptions = [], this.abortController = null, this._isDestroyed = false, this._loadVersion = 0, this.options = Object.assign({}, P, t2);
26624
26626
  const { state: i2, actions: n2 } = (function(t3) {
26625
26627
  var e3, i3, n3, s3, r3, o2;
26626
- const a2 = null !== (e3 = null == t3 ? void 0 : t3.currentTime) && void 0 !== e3 ? e3 : l$1(0), c2 = null !== (i3 = null == t3 ? void 0 : t3.duration) && void 0 !== i3 ? i3 : l$1(0), u2 = null !== (n3 = null == t3 ? void 0 : t3.isPlaying) && void 0 !== n3 ? n3 : l$1(false), d2 = null !== (s3 = null == t3 ? void 0 : t3.isSeeking) && void 0 !== s3 ? s3 : l$1(false), p2 = null !== (r3 = null == t3 ? void 0 : t3.volume) && void 0 !== r3 ? r3 : l$1(1), m2 = null !== (o2 = null == t3 ? void 0 : t3.playbackRate) && void 0 !== o2 ? o2 : l$1(1), g2 = l$1(null), f2 = l$1(null), v2 = l$1(""), b2 = l$1(0), y2 = l$1(0), C2 = h$1((() => !u2.value), [u2]), S2 = h$1((() => null !== g2.value), [g2]), E2 = h$1((() => S2.value && c2.value > 0), [S2, c2]), P2 = h$1((() => a2.value), [a2]), w2 = h$1((() => c2.value > 0 ? a2.value / c2.value : 0), [a2, c2]);
26627
- return { state: { currentTime: a2, duration: c2, isPlaying: u2, isPaused: C2, isSeeking: d2, volume: p2, playbackRate: m2, audioBuffer: g2, peaks: f2, url: v2, zoom: b2, scrollPosition: y2, canPlay: S2, isReady: E2, progress: P2, progressPercent: w2 }, actions: { setCurrentTime: (t4) => {
26628
+ const a2 = null !== (e3 = null == t3 ? void 0 : t3.currentTime) && void 0 !== e3 ? e3 : l$1(0), c2 = null !== (i3 = null == t3 ? void 0 : t3.duration) && void 0 !== i3 ? i3 : l$1(0), d2 = null !== (n3 = null == t3 ? void 0 : t3.isPlaying) && void 0 !== n3 ? n3 : l$1(false), u2 = null !== (s3 = null == t3 ? void 0 : t3.isSeeking) && void 0 !== s3 ? s3 : l$1(false), p2 = null !== (r3 = null == t3 ? void 0 : t3.volume) && void 0 !== r3 ? r3 : l$1(1), m2 = null !== (o2 = null == t3 ? void 0 : t3.playbackRate) && void 0 !== o2 ? o2 : l$1(1), g2 = l$1(null), f2 = l$1(null), v2 = l$1(""), b2 = l$1(0), y2 = l$1(0), C2 = h$1((() => !d2.value), [d2]), S2 = h$1((() => null !== g2.value), [g2]), E2 = h$1((() => S2.value && c2.value > 0), [S2, c2]), P2 = h$1((() => a2.value), [a2]), w2 = h$1((() => c2.value > 0 ? a2.value / c2.value : 0), [a2, c2]);
26629
+ return { state: { currentTime: a2, duration: c2, isPlaying: d2, isPaused: C2, isSeeking: u2, volume: p2, playbackRate: m2, audioBuffer: g2, peaks: f2, url: v2, zoom: b2, scrollPosition: y2, canPlay: S2, isReady: E2, progress: P2, progressPercent: w2 }, actions: { setCurrentTime: (t4) => {
26628
26630
  const e4 = Math.max(0, Math.min(c2.value || 1 / 0, t4));
26629
26631
  a2.set(e4);
26630
26632
  }, setDuration: (t4) => {
26631
26633
  c2.set(Math.max(0, t4));
26632
26634
  }, setPlaying: (t4) => {
26633
- u2.set(t4);
26634
- }, setSeeking: (t4) => {
26635
26635
  d2.set(t4);
26636
+ }, setSeeking: (t4) => {
26637
+ u2.set(t4);
26636
26638
  }, setVolume: (t4) => {
26637
26639
  const e4 = Math.max(0, Math.min(1, t4));
26638
26640
  p2.set(e4);
@@ -26653,7 +26655,7 @@ section.turn:has([data-state="open"]) {
26653
26655
  })({ isPlaying: this.isPlayingSignal, currentTime: this.currentTimeSignal, duration: this.durationSignal, volume: this.volumeSignal, playbackRate: this.playbackRateSignal, isSeeking: this.seekingSignal });
26654
26656
  this.wavesurferState = i2, this.wavesurferActions = n2, this.timer = new S();
26655
26657
  const s2 = e2 ? void 0 : this.getMediaElement();
26656
- this.renderer = new C(this.options, s2), this.initPlayerEvents(), this.initRendererEvents(), this.initTimerEvents(), this.initReactiveState(), this.initPlugins();
26658
+ this.renderer = new C(this.options, s2), this.initPlayerEvents(), this.initRendererEvents(), this.initTimerEvents(), this.initPlugins();
26657
26659
  const r2 = this.options.url || this.getSrc() || "";
26658
26660
  Promise.resolve().then((() => {
26659
26661
  this.emit("init");
@@ -26676,36 +26678,6 @@ section.turn:has([data-state="open"]) {
26676
26678
  }
26677
26679
  })));
26678
26680
  }
26679
- initReactiveState() {
26680
- this.reactiveCleanups.push((function(t2, e2) {
26681
- const i2 = [];
26682
- i2.push(c((() => {
26683
- const i3 = t2.isPlaying.value;
26684
- e2.emit(i3 ? "play" : "pause");
26685
- }), [t2.isPlaying])), i2.push(c((() => {
26686
- const i3 = t2.currentTime.value;
26687
- e2.emit("timeupdate", i3), t2.isPlaying.value && e2.emit("audioprocess", i3);
26688
- }), [t2.currentTime, t2.isPlaying])), i2.push(c((() => {
26689
- t2.isSeeking.value && e2.emit("seeking", t2.currentTime.value);
26690
- }), [t2.isSeeking, t2.currentTime]));
26691
- let n2 = false;
26692
- i2.push(c((() => {
26693
- t2.isReady.value && !n2 && (n2 = true, e2.emit("ready", t2.duration.value));
26694
- }), [t2.isReady, t2.duration])), i2.push(c((() => {
26695
- null === t2.audioBuffer.value && (n2 = false);
26696
- }), [t2.audioBuffer]));
26697
- let s2 = false;
26698
- return i2.push(c((() => {
26699
- const i3 = t2.isPlaying.value, n3 = t2.currentTime.value, r2 = t2.duration.value, o2 = r2 > 0 && n3 >= r2;
26700
- s2 && !i3 && o2 && e2.emit("finish"), s2 = i3 && o2;
26701
- }), [t2.isPlaying, t2.currentTime, t2.duration])), i2.push(c((() => {
26702
- const i3 = t2.zoom.value;
26703
- i3 > 0 && e2.emit("zoom", i3);
26704
- }), [t2.zoom])), () => {
26705
- i2.forEach(((t3) => t3()));
26706
- };
26707
- })(this.wavesurferState, { emit: this.emit.bind(this) }));
26708
- }
26709
26681
  initPlayerEvents() {
26710
26682
  this.isPlaying() && (this.emit("play"), this.timer.start()), this.mediaSubscriptions.push(this.onMediaEvent("timeupdate", (() => {
26711
26683
  const t2 = this.updateProgress();
@@ -26925,7 +26897,7 @@ section.turn:has([data-state="open"]) {
26925
26897
  }
26926
26898
  destroy() {
26927
26899
  var t2;
26928
- this._isDestroyed = true, this.emit("destroy"), null === (t2 = this.abortController) || void 0 === t2 || t2.abort(), this.plugins.forEach(((t3) => t3.destroy())), this.subscriptions.forEach(((t3) => t3())), this.unsubscribePlayerEvents(), this.reactiveCleanups.forEach(((t3) => t3())), this.reactiveCleanups = [], this.timer.destroy(), this.renderer.destroy(), super.destroy();
26900
+ this._isDestroyed = true, this.emit("destroy"), null === (t2 = this.abortController) || void 0 === t2 || t2.abort(), this.plugins.forEach(((t3) => t3.destroy())), this.subscriptions.forEach(((t3) => t3())), this.unsubscribePlayerEvents(), this.timer.destroy(), this.renderer.destroy(), super.destroy();
26929
26901
  }
26930
26902
  }
26931
26903
  w.BasePlugin = class extends e$1 {