@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.
@@ -7376,7 +7376,7 @@ function getTimeout(delays, durations) {
7376
7376
  while (delays.length < durations.length) {
7377
7377
  delays = delays.concat(delays);
7378
7378
  }
7379
- return Math.max(...durations.map((d2, i2) => toMs(d2) + toMs(delays[i2])));
7379
+ return Math.max(...durations.map((d3, i2) => toMs(d3) + toMs(delays[i2])));
7380
7380
  }
7381
7381
  function toMs(s2) {
7382
7382
  if (s2 === "auto") return 0;
@@ -9054,17 +9054,17 @@ function toDate(value) {
9054
9054
  const d22 = new Date(ms);
9055
9055
  return Number.isNaN(d22.getTime()) ? null : d22;
9056
9056
  }
9057
- const d2 = new Date(value);
9058
- return Number.isNaN(d2.getTime()) ? null : d2;
9057
+ const d3 = new Date(value);
9058
+ return Number.isNaN(d3.getTime()) ? null : d3;
9059
9059
  }
9060
9060
  function formatLongDate(value, locale) {
9061
- const d2 = toDate(value);
9062
- if (!d2) return "";
9061
+ const d3 = toDate(value);
9062
+ if (!d3) return "";
9063
9063
  return new Intl.DateTimeFormat(locale, {
9064
9064
  day: "numeric",
9065
9065
  month: "long",
9066
9066
  year: "numeric"
9067
- }).format(d2);
9067
+ }).format(d3);
9068
9068
  }
9069
9069
  function formatDurationMinutes(seconds, locale) {
9070
9070
  const minutes = Math.max(0, Math.round(seconds / 60));
@@ -9102,18 +9102,18 @@ function validateEditorDocument(doc2) {
9102
9102
  if (doc2 == null || typeof doc2 !== "object") {
9103
9103
  throw new DocumentValidationError("document", "must be a non-null object");
9104
9104
  }
9105
- const d2 = doc2;
9106
- if (typeof d2.title !== "string") {
9105
+ const d3 = doc2;
9106
+ if (typeof d3.title !== "string") {
9107
9107
  throw new DocumentValidationError("document.title", "must be a string");
9108
9108
  }
9109
- if (!(d2.speakers instanceof Map)) {
9109
+ if (!(d3.speakers instanceof Map)) {
9110
9110
  throw new DocumentValidationError("document.speakers", "must be a Map");
9111
9111
  }
9112
- if (!Array.isArray(d2.channels)) {
9112
+ if (!Array.isArray(d3.channels)) {
9113
9113
  throw new DocumentValidationError("document.channels", "must be an array");
9114
9114
  }
9115
- for (let ci = 0; ci < d2.channels.length; ci++) {
9116
- const ch = d2.channels[ci];
9115
+ for (let ci = 0; ci < d3.channels.length; ci++) {
9116
+ const ch = d3.channels[ci];
9117
9117
  const cp = `channels[${ci}]`;
9118
9118
  if (ch == null || typeof ch !== "object") {
9119
9119
  throw new DocumentValidationError(cp, "must be a non-null object");
@@ -10518,7 +10518,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
10518
10518
  highlighted.value = null;
10519
10519
  return;
10520
10520
  }
10521
- const { highlightCode } = await import("./highlight-B6rbGA8f.js");
10521
+ const { highlightCode } = await import("./highlight-BOTcN5V7.js");
10522
10522
  if (run === seq) highlighted.value = highlightCode(code, lang ?? "");
10523
10523
  },
10524
10524
  { immediate: true }
@@ -14098,7 +14098,7 @@ const flip$1 = function(options) {
14098
14098
  const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
14099
14099
  if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
14100
14100
  // overflows the main axis.
14101
- overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : true)) {
14101
+ overflowsData.every((d3) => getSideAxis(d3.placement) === initialSideAxis ? d3.overflows[0] > 0 : true)) {
14102
14102
  return {
14103
14103
  data: {
14104
14104
  index: nextIndex,
@@ -14110,20 +14110,20 @@ const flip$1 = function(options) {
14110
14110
  };
14111
14111
  }
14112
14112
  }
14113
- let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
14113
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter((d3) => d3.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
14114
14114
  if (!resetPlacement) {
14115
14115
  switch (fallbackStrategy) {
14116
14116
  case "bestFit": {
14117
14117
  var _overflowsData$filter2;
14118
- const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => {
14118
+ const placement2 = (_overflowsData$filter2 = overflowsData.filter((d3) => {
14119
14119
  if (hasFallbackAxisSideDirection) {
14120
- const currentSideAxis = getSideAxis(d2.placement);
14120
+ const currentSideAxis = getSideAxis(d3.placement);
14121
14121
  return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
14122
14122
  // reading directions favoring greater width.
14123
14123
  currentSideAxis === "y";
14124
14124
  }
14125
14125
  return true;
14126
- }).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
14126
+ }).map((d3) => [d3.placement, d3.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
14127
14127
  if (placement2) {
14128
14128
  resetPlacement = placement2;
14129
14129
  }
@@ -18491,20 +18491,20 @@ ${p2}` : p2, r2 = r2 ? `${r2}
18491
18491
  ${c2}` : c2;
18492
18492
  let h2 = this.lexer.state.top;
18493
18493
  if (this.lexer.state.top = true, this.lexer.blockTokens(c2, o2, true), this.lexer.state.top = h2, n2.length === 0) break;
18494
- let d2 = o2.at(-1);
18495
- if (d2?.type === "code") break;
18496
- if (d2?.type === "blockquote") {
18497
- let O = d2, g2 = n2.join(`
18494
+ let d3 = o2.at(-1);
18495
+ if (d3?.type === "code") break;
18496
+ if (d3?.type === "blockquote") {
18497
+ let O = d3, g2 = n2.join(`
18498
18498
  `), w2 = O.raw + `
18499
18499
  ` + g2.replace(this.rules.other.blockquoteSetextReplace2, ""), z = this.blockquote(w2);
18500
18500
  o2[o2.length - 1] = z, s2 = `${s2}
18501
18501
  ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + z.text;
18502
18502
  break;
18503
- } else if (d2?.type === "list") {
18504
- let O = d2, g2 = O.raw + `
18503
+ } else if (d3?.type === "list") {
18504
+ let O = d3, g2 = O.raw + `
18505
18505
  ` + n2.join(`
18506
18506
  `), w2 = this.list(g2);
18507
- o2[o2.length - 1] = w2, s2 = s2.substring(0, s2.length - d2.raw.length) + w2.raw, r2 = r2.substring(0, r2.length - O.raw.length) + w2.raw, n2 = g2.substring(o2.at(-1).raw.length).split(`
18507
+ o2[o2.length - 1] = w2, s2 = s2.substring(0, s2.length - d3.raw.length) + w2.raw, r2 = r2.substring(0, r2.length - O.raw.length) + w2.raw, n2 = g2.substring(o2.at(-1).raw.length).split(`
18508
18508
  `);
18509
18509
  continue;
18510
18510
  }
@@ -18523,23 +18523,23 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + z.text;
18523
18523
  if (!(t2 = o2.exec(e3)) || this.rules.block.hr.test(e3)) break;
18524
18524
  p2 = t2[0], e3 = e3.substring(p2.length);
18525
18525
  let h2 = me(t2[2].split(`
18526
- `, 1)[0], t2[1].length), d2 = e3.split(`
18526
+ `, 1)[0], t2[1].length), d3 = e3.split(`
18527
18527
  `, 1)[0], O = !h2.trim(), g2 = 0;
18528
- if (this.options.pedantic ? (g2 = 2, c2 = h2.trimStart()) : O ? g2 = t2[1].length + 1 : (g2 = h2.search(this.rules.other.nonSpaceChar), g2 = g2 > 4 ? 1 : g2, c2 = h2.slice(g2), g2 += t2[1].length), O && this.rules.other.blankLine.test(d2) && (p2 += d2 + `
18529
- `, e3 = e3.substring(d2.length + 1), a2 = true), !a2) {
18528
+ if (this.options.pedantic ? (g2 = 2, c2 = h2.trimStart()) : O ? g2 = t2[1].length + 1 : (g2 = h2.search(this.rules.other.nonSpaceChar), g2 = g2 > 4 ? 1 : g2, c2 = h2.slice(g2), g2 += t2[1].length), O && this.rules.other.blankLine.test(d3) && (p2 += d3 + `
18529
+ `, e3 = e3.substring(d3.length + 1), a2 = true), !a2) {
18530
18530
  let w2 = this.rules.other.nextBulletRegex(g2), z = this.rules.other.hrRegex(g2), ne = this.rules.other.fencesBeginRegex(g2), re = this.rules.other.headingBeginRegex(g2), be = this.rules.other.htmlBeginRegex(g2), Re = this.rules.other.blockquoteBeginRegex(g2);
18531
18531
  for (; e3; ) {
18532
18532
  let N = e3.split(`
18533
18533
  `, 1)[0], D;
18534
- if (d2 = N, this.options.pedantic ? (d2 = d2.replace(this.rules.other.listReplaceNesting, " "), D = d2) : D = d2.replace(this.rules.other.tabCharGlobal, " "), ne.test(d2) || re.test(d2) || be.test(d2) || Re.test(d2) || w2.test(d2) || z.test(d2)) break;
18535
- if (D.search(this.rules.other.nonSpaceChar) >= g2 || !d2.trim()) c2 += `
18534
+ if (d3 = N, this.options.pedantic ? (d3 = d3.replace(this.rules.other.listReplaceNesting, " "), D = d3) : D = d3.replace(this.rules.other.tabCharGlobal, " "), ne.test(d3) || re.test(d3) || be.test(d3) || Re.test(d3) || w2.test(d3) || z.test(d3)) break;
18535
+ if (D.search(this.rules.other.nonSpaceChar) >= g2 || !d3.trim()) c2 += `
18536
18536
  ` + D.slice(g2);
18537
18537
  else {
18538
18538
  if (O || h2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(h2) || re.test(h2) || z.test(h2)) break;
18539
18539
  c2 += `
18540
- ` + d2;
18540
+ ` + d3;
18541
18541
  }
18542
- O = !d2.trim(), p2 += N + `
18542
+ O = !d3.trim(), p2 += N + `
18543
18543
  `, e3 = e3.substring(N.length + 1), h2 = D.slice(g2);
18544
18544
  }
18545
18545
  }
@@ -18670,8 +18670,8 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + z.text;
18670
18670
  let s2 = this.rules.inline.emStrongLDelim.exec(e3);
18671
18671
  if (!s2 || !s2[1] && !s2[2] && !s2[3] && !s2[4] || s2[4] && n2.match(this.rules.other.unicodeAlphaNumeric)) return;
18672
18672
  if (!(s2[1] || s2[3] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
18673
- let o2 = [...s2[0]].length - 1, i2, l2, a2 = o2, p2 = 0, c2 = s2[0][0], h2 = n2 === c2, d2 = c2 === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
18674
- for (d2.lastIndex = 0, t2 = t2.slice(-1 * e3.length + o2); (s2 = d2.exec(t2)) !== null; ) {
18673
+ let o2 = [...s2[0]].length - 1, i2, l2, a2 = o2, p2 = 0, c2 = s2[0][0], h2 = n2 === c2, d3 = c2 === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
18674
+ for (d3.lastIndex = 0, t2 = t2.slice(-1 * e3.length + o2); (s2 = d3.exec(t2)) !== null; ) {
18675
18675
  if (i2 = s2[1] || s2[2] || s2[3] || s2[4] || s2[5] || s2[6], !i2) continue;
18676
18676
  if (l2 = [...i2].length, s2[3] || s2[4]) {
18677
18677
  a2 += l2;
@@ -18719,8 +18719,8 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + z.text;
18719
18719
  }
18720
18720
  if (a2 -= l2, a2 > 0) continue;
18721
18721
  l2 = Math.min(l2, l2 + a2);
18722
- let c2 = [...s2[0]][0].length, h2 = e3.slice(0, o2 + s2.index + c2 + l2), d2 = h2.slice(o2, -o2);
18723
- return { type: "del", raw: h2, text: d2, tokens: this.lexer.inlineTokens(d2) };
18722
+ let c2 = [...s2[0]][0].length, h2 = e3.slice(0, o2 + s2.index + c2 + l2), d3 = h2.slice(o2, -o2);
18723
+ return { type: "del", raw: h2, text: d3, tokens: this.lexer.inlineTokens(d3) };
18724
18724
  }
18725
18725
  }
18726
18726
  }
@@ -19456,8 +19456,8 @@ var Z = class {
19456
19456
  if (o2.hooks && (o2.hooks.options = o2, o2.hooks.block = e3), o2.async) return (async () => {
19457
19457
  let l2 = o2.hooks ? await o2.hooks.preprocess(n2) : n2, p2 = await (o2.hooks ? await o2.hooks.provideLexer(e3) : e3 ? x.lex : x.lexInline)(l2, o2), c2 = o2.hooks ? await o2.hooks.processAllTokens(p2) : p2;
19458
19458
  o2.walkTokens && await Promise.all(this.walkTokens(c2, o2.walkTokens));
19459
- let d2 = await (o2.hooks ? await o2.hooks.provideParser(e3) : e3 ? b$1.parse : b$1.parseInline)(c2, o2);
19460
- return o2.hooks ? await o2.hooks.postprocess(d2) : d2;
19459
+ let d3 = await (o2.hooks ? await o2.hooks.provideParser(e3) : e3 ? b$1.parse : b$1.parseInline)(c2, o2);
19460
+ return o2.hooks ? await o2.hooks.postprocess(d3) : d3;
19461
19461
  })().catch(i2);
19462
19462
  try {
19463
19463
  o2.hooks && (n2 = o2.hooks.preprocess(n2));
@@ -22201,34 +22201,36 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
22201
22201
  ]),
22202
22202
  _: 1
22203
22203
  }, 8, ["aria-label"])) : createCommentVNode("", true),
22204
- createVNode(unref(Button), {
22205
- variant: "secondary",
22206
- "aria-label": unref(t2)("header.undo"),
22207
- disabled: !props.canUndo,
22208
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("undo"))
22209
- }, {
22210
- icon: withCtx(() => [
22211
- createVNode(unref(EditorIcon), {
22212
- name: "undo",
22213
- size: 16
22214
- })
22215
- ]),
22216
- _: 1
22217
- }, 8, ["aria-label", "disabled"]),
22218
- createVNode(unref(Button), {
22219
- variant: "secondary",
22220
- "aria-label": unref(t2)("header.redo"),
22221
- disabled: !props.canRedo,
22222
- onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("redo"))
22223
- }, {
22224
- icon: withCtx(() => [
22225
- createVNode(unref(EditorIcon), {
22226
- name: "redo",
22227
- size: 16
22228
- })
22229
- ]),
22230
- _: 1
22231
- }, 8, ["aria-label", "disabled"]),
22204
+ props.canUndo || props.canRedo ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
22205
+ createVNode(unref(Button), {
22206
+ variant: "secondary",
22207
+ "aria-label": unref(t2)("header.undo"),
22208
+ disabled: !props.canUndo,
22209
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("undo"))
22210
+ }, {
22211
+ icon: withCtx(() => [
22212
+ createVNode(unref(EditorIcon), {
22213
+ name: "undo",
22214
+ size: 16
22215
+ })
22216
+ ]),
22217
+ _: 1
22218
+ }, 8, ["aria-label", "disabled"]),
22219
+ createVNode(unref(Button), {
22220
+ variant: "secondary",
22221
+ "aria-label": unref(t2)("header.redo"),
22222
+ disabled: !props.canRedo,
22223
+ onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("redo"))
22224
+ }, {
22225
+ icon: withCtx(() => [
22226
+ createVNode(unref(EditorIcon), {
22227
+ name: "redo",
22228
+ size: 16
22229
+ })
22230
+ ]),
22231
+ _: 1
22232
+ }, 8, ["aria-label", "disabled"])
22233
+ ], 64)) : createCommentVNode("", true),
22232
22234
  createVNode(unref(Button), {
22233
22235
  variant: "primary",
22234
22236
  "aria-label": unref(t2)("header.ask"),
@@ -22251,8 +22253,8 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
22251
22253
  };
22252
22254
  }
22253
22255
  });
22254
- 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';
22255
- const Header = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["styles", [_style_0$p]], ["__scopeId", "data-v-6464a453"]]);
22256
+ 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';
22257
+ const Header = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["styles", [_style_0$p]], ["__scopeId", "data-v-491cf8ab"]]);
22256
22258
  const TRANSCRIPTION_TAB = "__transcription__";
22257
22259
  const VERBATIM_TAB = "__verbatim__";
22258
22260
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
@@ -25822,7 +25824,7 @@ function c(t2, e3) {
25822
25824
  i2 && (i2(), i2 = void 0), s2.forEach(((t3) => t3()));
25823
25825
  };
25824
25826
  }
25825
- class u3 extends e$1 {
25827
+ let d$1 = class d extends e$1 {
25826
25828
  get isPlayingSignal() {
25827
25829
  return this._isPlaying;
25828
25830
  }
@@ -25953,8 +25955,8 @@ class u3 extends e$1 {
25953
25955
  setSinkId(t2) {
25954
25956
  return this.media.setSinkId(t2);
25955
25957
  }
25956
- }
25957
- function d$1({ maxTop: t2, maxBottom: e3, halfHeight: i2, vScale: n2, barMinHeight: s2 = 0, barAlign: r2 }) {
25958
+ };
25959
+ function u3({ maxTop: t2, maxBottom: e3, halfHeight: i2, vScale: n2, barMinHeight: s2 = 0, barAlign: r2 }) {
25958
25960
  let o2 = Math.round(t2 * i2 * n2);
25959
25961
  let a2 = o2 + Math.round(e3 * i2 * n2) || 1;
25960
25962
  return a2 < s2 && (a2 = s2, r2 || (o2 = a2 / 2)), { topHeight: o2, totalHeight: a2 };
@@ -26047,16 +26049,16 @@ class C extends e$1 {
26047
26049
  if (o2.has(e4.pointerId)) return;
26048
26050
  if (o2.set(e4.pointerId, e4), o2.size > 1) return;
26049
26051
  const l2 = e4.pointerId;
26050
- let c3 = e4.clientX, u4 = e4.clientY, d2 = false;
26052
+ let c3 = e4.clientX, d3 = e4.clientY, u4 = false;
26051
26053
  const p2 = Date.now(), m2 = t3.getBoundingClientRect(), { left: g2, top: f2 } = m2, v2 = (t4) => {
26052
26054
  if (t4.pointerId !== l2) return;
26053
26055
  if (t4.defaultPrevented || o2.size > 1) return;
26054
26056
  if (a2 && Date.now() - p2 < s2) return;
26055
- const e5 = t4.clientX, n3 = t4.clientY, h3 = e5 - c3, m3 = n3 - u4;
26056
- (d2 || Math.abs(h3) > i2 || Math.abs(m3) > i2) && (t4.preventDefault(), t4.stopPropagation(), d2 || (r2.set({ type: "start", x: c3 - g2, y: u4 - f2 }), d2 = true), r2.set({ type: "move", x: e5 - g2, y: n3 - f2, deltaX: h3, deltaY: m3 }), c3 = e5, u4 = n3);
26057
+ const e5 = t4.clientX, n3 = t4.clientY, h3 = e5 - c3, m3 = n3 - d3;
26058
+ (u4 || Math.abs(h3) > i2 || Math.abs(m3) > i2) && (t4.preventDefault(), t4.stopPropagation(), u4 || (r2.set({ type: "start", x: c3 - g2, y: d3 - f2 }), u4 = true), r2.set({ type: "move", x: e5 - g2, y: n3 - f2, deltaX: h3, deltaY: m3 }), c3 = e5, d3 = n3);
26057
26059
  }, b2 = (t4) => {
26058
26060
  if (o2.delete(t4.pointerId)) {
26059
- if (t4.pointerId === l2 && d2) {
26061
+ if (t4.pointerId === l2 && u4) {
26060
26062
  const e5 = t4.clientX, i3 = t4.clientY;
26061
26063
  r2.set({ type: "end", x: e5 - g2, y: i3 - f2 });
26062
26064
  }
@@ -26065,9 +26067,9 @@ class C extends e$1 {
26065
26067
  }, y3 = (t4) => {
26066
26068
  t4.relatedTarget && t4.relatedTarget !== document.documentElement || b2(t4);
26067
26069
  }, C2 = (t4) => {
26068
- d2 && (t4.stopPropagation(), t4.preventDefault());
26070
+ u4 && (t4.stopPropagation(), t4.preventDefault());
26069
26071
  }, S3 = (t4) => {
26070
- t4.defaultPrevented || o2.size > 1 || d2 && t4.preventDefault();
26072
+ t4.defaultPrevented || o2.size > 1 || u4 && t4.preventDefault();
26071
26073
  };
26072
26074
  document.addEventListener("pointermove", v2), document.addEventListener("pointerup", b2), document.addEventListener("pointerout", y3), document.addEventListener("pointercancel", y3), document.addEventListener("touchmove", S3, { passive: false }), document.addEventListener("click", C2, { capture: true }), h2 = () => {
26073
26075
  document.removeEventListener("pointermove", v2), document.removeEventListener("pointerup", b2), document.removeEventListener("pointerout", y3), document.removeEventListener("pointercancel", y3), document.removeEventListener("touchmove", S3), setTimeout((() => {
@@ -26240,23 +26242,23 @@ class C extends e$1 {
26240
26242
  var t2;
26241
26243
  }
26242
26244
  renderBarWaveform(t2, e3, i2, n2) {
26243
- const { width: s2, height: r2 } = i2.canvas, { halfHeight: o2, barWidth: a2, barRadius: l2, barIndexScale: h2, barSpacing: c2, barMinHeight: u4 } = (function({ width: t3, height: e4, length: i3, options: n3, pixelRatio: s3 }) {
26245
+ const { width: s2, height: r2 } = i2.canvas, { halfHeight: o2, barWidth: a2, barRadius: l2, barIndexScale: h2, barSpacing: c2, barMinHeight: d3 } = (function({ width: t3, height: e4, length: i3, options: n3, pixelRatio: s3 }) {
26244
26246
  const r3 = e4 / 2, o3 = n3.barWidth ? n3.barWidth * s3 : 1, a3 = n3.barGap ? n3.barGap * s3 : n3.barWidth ? o3 / 2 : 0, l3 = o3 + a3 || 1;
26245
26247
  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 };
26246
26248
  })({ width: s2, height: r2, length: (t2[0] || []).length, options: e3, pixelRatio: this.getPixelRatio() }), m2 = (function({ channelData: t3, barIndexScale: e4, barSpacing: i3, barWidth: n3, halfHeight: s3, vScale: r3, canvasHeight: o3, barAlign: a3, barMinHeight: l3 }) {
26247
- const h3 = t3[0] || [], c3 = t3[1] || h3, u5 = h3.length, m3 = [];
26249
+ const h3 = t3[0] || [], c3 = t3[1] || h3, d4 = h3.length, m3 = [];
26248
26250
  let g2 = 0, f2 = 0, v2 = 0;
26249
- for (let t4 = 0; t4 <= u5; t4++) {
26250
- const u6 = Math.round(t4 * e4);
26251
- if (u6 > g2) {
26252
- const { topHeight: t5, totalHeight: e5 } = d$1({ maxTop: f2, maxBottom: v2, halfHeight: s3, vScale: r3, barMinHeight: l3, barAlign: a3 }), h4 = p({ barAlign: a3, halfHeight: s3, topHeight: t5, totalHeight: e5, canvasHeight: o3 });
26253
- m3.push({ x: g2 * i3, y: h4, width: n3, height: e5 }), g2 = u6, f2 = 0, v2 = 0;
26251
+ for (let t4 = 0; t4 <= d4; t4++) {
26252
+ const d5 = Math.round(t4 * e4);
26253
+ if (d5 > g2) {
26254
+ const { topHeight: t5, totalHeight: e5 } = u3({ maxTop: f2, maxBottom: v2, halfHeight: s3, vScale: r3, barMinHeight: l3, barAlign: a3 }), h4 = p({ barAlign: a3, halfHeight: s3, topHeight: t5, totalHeight: e5, canvasHeight: o3 });
26255
+ m3.push({ x: g2 * i3, y: h4, width: n3, height: e5 }), g2 = d5, f2 = 0, v2 = 0;
26254
26256
  }
26255
26257
  const b2 = Math.abs(h3[t4] || 0), y3 = Math.abs(c3[t4] || 0);
26256
26258
  b2 > f2 && (f2 = b2), y3 > v2 && (v2 = y3);
26257
26259
  }
26258
26260
  return m3;
26259
- })({ channelData: t2, barIndexScale: h2, barSpacing: c2, barWidth: a2, halfHeight: o2, vScale: n2, canvasHeight: r2, barAlign: e3.barAlign, barMinHeight: u4 });
26261
+ })({ channelData: t2, barIndexScale: h2, barSpacing: c2, barWidth: a2, halfHeight: o2, vScale: n2, canvasHeight: r2, barAlign: e3.barAlign, barMinHeight: d3 });
26260
26262
  i2.beginPath();
26261
26263
  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);
26262
26264
  i2.fill(), i2.closePath();
@@ -26266,15 +26268,15 @@ class C extends e$1 {
26266
26268
  const s3 = i3 / 2, r3 = t3[0] || [];
26267
26269
  return [r3, t3[1] || r3].map(((t4, i4) => {
26268
26270
  const r4 = t4.length, o3 = r4 ? e4 / r4 : 0, a2 = s3, l2 = 0 === i4 ? -1 : 1, h2 = [{ x: 0, y: a2 }];
26269
- let c2 = 0, u4 = 0;
26271
+ let c2 = 0, d3 = 0;
26270
26272
  for (let e5 = 0; e5 <= r4; e5++) {
26271
26273
  const i5 = Math.round(e5 * o3);
26272
26274
  if (i5 > c2) {
26273
- const t5 = a2 + (Math.round(u4 * s3 * n3) || 1) * l2;
26274
- h2.push({ x: c2, y: t5 }), c2 = i5, u4 = 0;
26275
+ const t5 = a2 + (Math.round(d3 * s3 * n3) || 1) * l2;
26276
+ h2.push({ x: c2, y: t5 }), c2 = i5, d3 = 0;
26275
26277
  }
26276
26278
  const r5 = Math.abs(t4[e5] || 0);
26277
- r5 > u4 && (u4 = r5);
26279
+ r5 > d3 && (d3 = r5);
26278
26280
  }
26279
26281
  return h2.push({ x: c2, y: a2 }), h2;
26280
26282
  }));
@@ -26321,29 +26323,29 @@ class C extends e$1 {
26321
26323
  })({ clientWidth: a2, totalWidth: l2, options: e3 });
26322
26324
  let c2 = {};
26323
26325
  if (0 === h2) return;
26324
- const u4 = (i3) => {
26325
- if (i3 < 0 || i3 >= d2) return;
26326
+ const d3 = (i3) => {
26327
+ if (i3 < 0 || i3 >= u4) return;
26326
26328
  if (c2[i3]) return;
26327
26329
  c2[i3] = true;
26328
26330
  const o3 = i3 * h2;
26329
26331
  let a3 = Math.min(l2 - o3, h2);
26330
26332
  if (a3 = f(a3, e3), a3 <= 0) return;
26331
- const u5 = (function({ channelData: t3, offset: e4, clampedWidth: i4, totalWidth: n3 }) {
26333
+ const d4 = (function({ channelData: t3, offset: e4, clampedWidth: i4, totalWidth: n3 }) {
26332
26334
  return t3.map(((t4) => {
26333
26335
  const s3 = Math.floor(e4 / n3 * t4.length), r3 = Math.floor((e4 + i4) / n3 * t4.length);
26334
26336
  return t4.slice(s3, r3);
26335
26337
  }));
26336
26338
  })({ channelData: t2, offset: o3, clampedWidth: a3, totalWidth: l2 });
26337
- this.renderSingleCanvas(u5, e3, a3, n2, o3, s2, r2);
26338
- }, d2 = Math.ceil(l2 / h2);
26339
+ this.renderSingleCanvas(d4, e3, a3, n2, o3, s2, r2);
26340
+ }, u4 = Math.ceil(l2 / h2);
26339
26341
  if (!this.isScrollable) {
26340
- for (let t3 = 0; t3 < d2; t3++) u4(t3);
26342
+ for (let t3 = 0; t3 < u4; t3++) d3(t3);
26341
26343
  return;
26342
26344
  }
26343
- if (v({ scrollLeft: this.scrollContainer.scrollLeft, totalWidth: l2, numCanvases: d2 }).forEach(((t3) => u4(t3))), d2 > 1) {
26345
+ if (v({ scrollLeft: this.scrollContainer.scrollLeft, totalWidth: l2, numCanvases: u4 }).forEach(((t3) => d3(t3))), u4 > 1) {
26344
26346
  const t3 = this.on("scroll", (() => {
26345
26347
  const { scrollLeft: t4 } = this.scrollContainer;
26346
- Object.keys(c2).length > 10 && (s2.innerHTML = "", r2.innerHTML = "", c2 = {}), v({ scrollLeft: t4, totalWidth: l2, numCanvases: d2 }).forEach(((t5) => u4(t5)));
26348
+ Object.keys(c2).length > 10 && (s2.innerHTML = "", r2.innerHTML = "", c2 = {}), v({ scrollLeft: t4, totalWidth: l2, numCanvases: u4 }).forEach(((t5) => d3(t5)));
26347
26349
  }));
26348
26350
  this.unsubscribeOnScroll.push(t3);
26349
26351
  }
@@ -26606,7 +26608,7 @@ class E extends e$1 {
26606
26608
  }
26607
26609
  }
26608
26610
  const P2 = { waveColor: "#999", progressColor: "#555", cursorWidth: 1, minPxPerSec: 0, fillParent: true, interact: true, dragToSeek: false, autoScroll: true, autoCenter: true, sampleRate: 8e3 };
26609
- class w extends u3 {
26611
+ class w extends d$1 {
26610
26612
  static create(t2) {
26611
26613
  return new w(t2);
26612
26614
  }
@@ -26618,19 +26620,19 @@ class w extends u3 {
26618
26620
  }
26619
26621
  constructor(t2) {
26620
26622
  const e3 = t2.media || ("WebAudio" === t2.backend ? new E() : void 0);
26621
- super({ media: e3, 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({}, P2, t2);
26623
+ super({ media: e3, 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({}, P2, t2);
26622
26624
  const { state: i2, actions: n2 } = (function(t3) {
26623
26625
  var e4, i3, n3, s3, r3, o2;
26624
- const a2 = null !== (e4 = null == t3 ? void 0 : t3.currentTime) && void 0 !== e4 ? e4 : l$1(0), c2 = null !== (i3 = null == t3 ? void 0 : t3.duration) && void 0 !== i3 ? i3 : l$1(0), u4 = 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), y3 = l$1(0), C2 = h$1((() => !u4.value), [u4]), S3 = h$1((() => null !== g2.value), [g2]), E2 = h$1((() => S3.value && c2.value > 0), [S3, c2]), P3 = h$1((() => a2.value), [a2]), w2 = h$1((() => c2.value > 0 ? a2.value / c2.value : 0), [a2, c2]);
26625
- return { state: { currentTime: a2, duration: c2, isPlaying: u4, isPaused: C2, isSeeking: d2, volume: p2, playbackRate: m2, audioBuffer: g2, peaks: f2, url: v2, zoom: b2, scrollPosition: y3, canPlay: S3, isReady: E2, progress: P3, progressPercent: w2 }, actions: { setCurrentTime: (t4) => {
26626
+ const a2 = null !== (e4 = null == t3 ? void 0 : t3.currentTime) && void 0 !== e4 ? e4 : l$1(0), c2 = null !== (i3 = null == t3 ? void 0 : t3.duration) && void 0 !== i3 ? i3 : l$1(0), d3 = null !== (n3 = null == t3 ? void 0 : t3.isPlaying) && void 0 !== n3 ? n3 : l$1(false), u4 = 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), y3 = l$1(0), C2 = h$1((() => !d3.value), [d3]), S3 = h$1((() => null !== g2.value), [g2]), E2 = h$1((() => S3.value && c2.value > 0), [S3, c2]), P3 = 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: d3, isPaused: C2, isSeeking: u4, volume: p2, playbackRate: m2, audioBuffer: g2, peaks: f2, url: v2, zoom: b2, scrollPosition: y3, canPlay: S3, isReady: E2, progress: P3, progressPercent: w2 }, actions: { setCurrentTime: (t4) => {
26626
26628
  const e5 = Math.max(0, Math.min(c2.value || 1 / 0, t4));
26627
26629
  a2.set(e5);
26628
26630
  }, setDuration: (t4) => {
26629
26631
  c2.set(Math.max(0, t4));
26630
26632
  }, setPlaying: (t4) => {
26631
- u4.set(t4);
26633
+ d3.set(t4);
26632
26634
  }, setSeeking: (t4) => {
26633
- d2.set(t4);
26635
+ u4.set(t4);
26634
26636
  }, setVolume: (t4) => {
26635
26637
  const e5 = Math.max(0, Math.min(1, t4));
26636
26638
  p2.set(e5);
@@ -26651,7 +26653,7 @@ class w extends u3 {
26651
26653
  })({ isPlaying: this.isPlayingSignal, currentTime: this.currentTimeSignal, duration: this.durationSignal, volume: this.volumeSignal, playbackRate: this.playbackRateSignal, isSeeking: this.seekingSignal });
26652
26654
  this.wavesurferState = i2, this.wavesurferActions = n2, this.timer = new S2();
26653
26655
  const s2 = e3 ? void 0 : this.getMediaElement();
26654
- this.renderer = new C(this.options, s2), this.initPlayerEvents(), this.initRendererEvents(), this.initTimerEvents(), this.initReactiveState(), this.initPlugins();
26656
+ this.renderer = new C(this.options, s2), this.initPlayerEvents(), this.initRendererEvents(), this.initTimerEvents(), this.initPlugins();
26655
26657
  const r2 = this.options.url || this.getSrc() || "";
26656
26658
  Promise.resolve().then((() => {
26657
26659
  this.emit("init");
@@ -26674,36 +26676,6 @@ class w extends u3 {
26674
26676
  }
26675
26677
  })));
26676
26678
  }
26677
- initReactiveState() {
26678
- this.reactiveCleanups.push((function(t2, e3) {
26679
- const i2 = [];
26680
- i2.push(c((() => {
26681
- const i3 = t2.isPlaying.value;
26682
- e3.emit(i3 ? "play" : "pause");
26683
- }), [t2.isPlaying])), i2.push(c((() => {
26684
- const i3 = t2.currentTime.value;
26685
- e3.emit("timeupdate", i3), t2.isPlaying.value && e3.emit("audioprocess", i3);
26686
- }), [t2.currentTime, t2.isPlaying])), i2.push(c((() => {
26687
- t2.isSeeking.value && e3.emit("seeking", t2.currentTime.value);
26688
- }), [t2.isSeeking, t2.currentTime]));
26689
- let n2 = false;
26690
- i2.push(c((() => {
26691
- t2.isReady.value && !n2 && (n2 = true, e3.emit("ready", t2.duration.value));
26692
- }), [t2.isReady, t2.duration])), i2.push(c((() => {
26693
- null === t2.audioBuffer.value && (n2 = false);
26694
- }), [t2.audioBuffer]));
26695
- let s2 = false;
26696
- return i2.push(c((() => {
26697
- const i3 = t2.isPlaying.value, n3 = t2.currentTime.value, r2 = t2.duration.value, o2 = r2 > 0 && n3 >= r2;
26698
- s2 && !i3 && o2 && e3.emit("finish"), s2 = i3 && o2;
26699
- }), [t2.isPlaying, t2.currentTime, t2.duration])), i2.push(c((() => {
26700
- const i3 = t2.zoom.value;
26701
- i3 > 0 && e3.emit("zoom", i3);
26702
- }), [t2.zoom])), () => {
26703
- i2.forEach(((t3) => t3()));
26704
- };
26705
- })(this.wavesurferState, { emit: this.emit.bind(this) }));
26706
- }
26707
26679
  initPlayerEvents() {
26708
26680
  this.isPlaying() && (this.emit("play"), this.timer.start()), this.mediaSubscriptions.push(this.onMediaEvent("timeupdate", (() => {
26709
26681
  const t2 = this.updateProgress();
@@ -26923,7 +26895,7 @@ class w extends u3 {
26923
26895
  }
26924
26896
  destroy() {
26925
26897
  var t2;
26926
- 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();
26898
+ 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();
26927
26899
  }
26928
26900
  }
26929
26901
  w.BasePlugin = class extends e$1 {
@@ -27023,7 +26995,7 @@ function l(t2) {
27023
26995
  }
27024
26996
  function h(t2, e3 = {}) {
27025
26997
  const { threshold: i2 = 3, mouseButton: n2 = 0, touchDelay: r2 = 100 } = e3, o2 = s(null), h2 = /* @__PURE__ */ new Map(), a2 = matchMedia("(pointer: coarse)").matches;
27026
- let d2 = () => {
26998
+ let d3 = () => {
27027
26999
  };
27028
27000
  const c2 = (e4) => {
27029
27001
  if (e4.button !== n2) return;
@@ -27035,15 +27007,15 @@ function h(t2, e3 = {}) {
27035
27007
  if (t3.pointerId !== s2) return;
27036
27008
  if (t3.defaultPrevented || h2.size > 1) return;
27037
27009
  if (a2 && Date.now() - p2 < r2) return;
27038
- const e5 = t3.clientX, n3 = t3.clientY, d3 = e5 - l2, v3 = n3 - c3;
27039
- (u4 || Math.abs(d3) > i2 || Math.abs(v3) > i2) && (t3.preventDefault(), t3.stopPropagation(), u4 || (o2.set({ type: "start", x: l2 - g2, y: c3 - m2 }), u4 = true), o2.set({ type: "move", x: e5 - g2, y: n3 - m2, deltaX: d3, deltaY: v3 }), l2 = e5, c3 = n3);
27010
+ const e5 = t3.clientX, n3 = t3.clientY, d4 = e5 - l2, v3 = n3 - c3;
27011
+ (u4 || Math.abs(d4) > i2 || Math.abs(v3) > i2) && (t3.preventDefault(), t3.stopPropagation(), u4 || (o2.set({ type: "start", x: l2 - g2, y: c3 - m2 }), u4 = true), o2.set({ type: "move", x: e5 - g2, y: n3 - m2, deltaX: d4, deltaY: v3 }), l2 = e5, c3 = n3);
27040
27012
  }, b2 = (t3) => {
27041
27013
  if (h2.delete(t3.pointerId)) {
27042
27014
  if (t3.pointerId === s2 && u4) {
27043
27015
  const e5 = t3.clientX, i3 = t3.clientY;
27044
27016
  o2.set({ type: "end", x: e5 - g2, y: i3 - m2 });
27045
27017
  }
27046
- 0 === h2.size && d2();
27018
+ 0 === h2.size && d3();
27047
27019
  }
27048
27020
  }, E2 = (t3) => {
27049
27021
  t3.relatedTarget && t3.relatedTarget !== document.documentElement || b2(t3);
@@ -27052,7 +27024,7 @@ function h(t2, e3 = {}) {
27052
27024
  }, L2 = (t3) => {
27053
27025
  t3.defaultPrevented || h2.size > 1 || u4 && t3.preventDefault();
27054
27026
  };
27055
- document.addEventListener("pointermove", f2), document.addEventListener("pointerup", b2), document.addEventListener("pointerout", E2), document.addEventListener("pointercancel", E2), document.addEventListener("touchmove", L2, { passive: false }), document.addEventListener("click", C2, { capture: true }), d2 = () => {
27027
+ document.addEventListener("pointermove", f2), document.addEventListener("pointerup", b2), document.addEventListener("pointerout", E2), document.addEventListener("pointercancel", E2), document.addEventListener("touchmove", L2, { passive: false }), document.addEventListener("click", C2, { capture: true }), d3 = () => {
27056
27028
  document.removeEventListener("pointermove", f2), document.removeEventListener("pointerup", b2), document.removeEventListener("pointerout", E2), document.removeEventListener("pointercancel", E2), document.removeEventListener("touchmove", L2), setTimeout((() => {
27057
27029
  document.removeEventListener("click", C2, { capture: true });
27058
27030
  }), 10);
@@ -27060,13 +27032,13 @@ function h(t2, e3 = {}) {
27060
27032
  };
27061
27033
  t2.addEventListener("pointerdown", c2);
27062
27034
  return { signal: o2, cleanup: () => {
27063
- d2(), t2.removeEventListener("pointerdown", c2), h2.clear(), l(o2);
27035
+ d3(), t2.removeEventListener("pointerdown", c2), h2.clear(), l(o2);
27064
27036
  } };
27065
27037
  }
27066
27038
  class a extends t {
27067
27039
  constructor(t2, e3, i2 = 0) {
27068
- var n2, s2, r2, o2, l2, h2, a2, d2, c2, u4;
27069
- super(), this.totalDuration = e3, this.numberOfChannels = i2, this.element = null, this.minLength = 0, this.maxLength = 1 / 0, this.contentEditable = false, this.subscriptions = [], this.updatingSide = void 0, this.isRemoved = false, this.subscriptions = [], this.id = t2.id || `region-${Math.random().toString(32).slice(2)}`, this.start = this.clampPosition(t2.start), this.end = this.clampPosition(null !== (n2 = t2.end) && void 0 !== n2 ? n2 : t2.start), this.drag = null === (s2 = t2.drag) || void 0 === s2 || s2, this.resize = null === (r2 = t2.resize) || void 0 === r2 || r2, this.resizeStart = null === (o2 = t2.resizeStart) || void 0 === o2 || o2, this.resizeEnd = null === (l2 = t2.resizeEnd) || void 0 === l2 || l2, this.color = null !== (h2 = t2.color) && void 0 !== h2 ? h2 : "rgba(0, 0, 0, 0.1)", this.minLength = null !== (a2 = t2.minLength) && void 0 !== a2 ? a2 : this.minLength, this.maxLength = null !== (d2 = t2.maxLength) && void 0 !== d2 ? d2 : this.maxLength, this.channelIdx = null !== (c2 = t2.channelIdx) && void 0 !== c2 ? c2 : -1, this.contentEditable = null !== (u4 = t2.contentEditable) && void 0 !== u4 ? u4 : this.contentEditable, this.element = this.initElement(), this.setContent(t2.content), this.setPart(), this.renderPosition(), this.initMouseEvents();
27040
+ var n2, s2, r2, o2, l2, h2, a2, d3, c2, u4;
27041
+ super(), this.totalDuration = e3, this.numberOfChannels = i2, this.element = null, this.minLength = 0, this.maxLength = 1 / 0, this.contentEditable = false, this.subscriptions = [], this.updatingSide = void 0, this.isRemoved = false, this.subscriptions = [], this.id = t2.id || `region-${Math.random().toString(32).slice(2)}`, this.start = this.clampPosition(t2.start), this.end = this.clampPosition(null !== (n2 = t2.end) && void 0 !== n2 ? n2 : t2.start), this.drag = null === (s2 = t2.drag) || void 0 === s2 || s2, this.resize = null === (r2 = t2.resize) || void 0 === r2 || r2, this.resizeStart = null === (o2 = t2.resizeStart) || void 0 === o2 || o2, this.resizeEnd = null === (l2 = t2.resizeEnd) || void 0 === l2 || l2, this.color = null !== (h2 = t2.color) && void 0 !== h2 ? h2 : "rgba(0, 0, 0, 0.1)", this.minLength = null !== (a2 = t2.minLength) && void 0 !== a2 ? a2 : this.minLength, this.maxLength = null !== (d3 = t2.maxLength) && void 0 !== d3 ? d3 : this.maxLength, this.channelIdx = null !== (c2 = t2.channelIdx) && void 0 !== c2 ? c2 : -1, this.contentEditable = null !== (u4 = t2.contentEditable) && void 0 !== u4 ? u4 : this.contentEditable, this.element = this.initElement(), this.setContent(t2.content), this.setPart(), this.renderPosition(), this.initMouseEvents();
27070
27042
  }
27071
27043
  clampPosition(t2) {
27072
27044
  return Math.max(0, Math.min(this.totalDuration, t2));
@@ -27080,12 +27052,12 @@ class a extends t {
27080
27052
  const e3 = { position: "absolute", zIndex: "2", width: "6px", height: "100%", top: "0", cursor: "ew-resize", wordBreak: "keep-all" }, i2 = n("div", { part: "region-handle region-handle-left", style: Object.assign(Object.assign({}, e3), { left: "0", borderLeft: "2px solid rgba(0, 0, 0, 0.5)", borderRadius: "2px 0 0 2px" }) }, t2), s2 = n("div", { part: "region-handle region-handle-right", style: Object.assign(Object.assign({}, e3), { right: "0", borderRight: "2px solid rgba(0, 0, 0, 0.5)", borderRadius: "0 2px 2px 0" }) }, t2), o2 = h(i2, { threshold: 1 }), l2 = h(s2, { threshold: 1 }), a2 = r((() => {
27081
27053
  const t3 = o2.signal.value;
27082
27054
  t3 && ("move" === t3.type && void 0 !== t3.deltaX ? this.onResize(t3.deltaX, "start") : "end" === t3.type && this.onEndResizing("start"));
27083
- }), [o2.signal]), d2 = r((() => {
27055
+ }), [o2.signal]), d3 = r((() => {
27084
27056
  const t3 = l2.signal.value;
27085
27057
  t3 && ("move" === t3.type && void 0 !== t3.deltaX ? this.onResize(t3.deltaX, "end") : "end" === t3.type && this.onEndResizing("end"));
27086
27058
  }), [l2.signal]);
27087
27059
  this.subscriptions.push((() => {
27088
- a2(), d2(), o2.cleanup(), l2.cleanup();
27060
+ a2(), d3(), o2.cleanup(), l2.cleanup();
27089
27061
  }));
27090
27062
  }
27091
27063
  removeResizeHandles(t2) {
@@ -27112,9 +27084,9 @@ class a extends t {
27112
27084
  initMouseEvents() {
27113
27085
  const { element: t2 } = this;
27114
27086
  if (!t2) return;
27115
- const e3 = o(t2, "click"), i2 = o(t2, "mouseenter"), n2 = o(t2, "mouseleave"), s2 = o(t2, "dblclick"), a2 = o(t2, "pointerdown"), d2 = o(t2, "pointerup"), c2 = e3.subscribe(((t3) => t3 && this.emit("click", t3))), u4 = i2.subscribe(((t3) => t3 && this.emit("over", t3))), p2 = n2.subscribe(((t3) => t3 && this.emit("leave", t3))), v2 = s2.subscribe(((t3) => t3 && this.emit("dblclick", t3))), g2 = a2.subscribe(((t3) => t3 && this.toggleCursor(true))), m2 = d2.subscribe(((t3) => t3 && this.toggleCursor(false)));
27087
+ const e3 = o(t2, "click"), i2 = o(t2, "mouseenter"), n2 = o(t2, "mouseleave"), s2 = o(t2, "dblclick"), a2 = o(t2, "pointerdown"), d3 = o(t2, "pointerup"), c2 = e3.subscribe(((t3) => t3 && this.emit("click", t3))), u4 = i2.subscribe(((t3) => t3 && this.emit("over", t3))), p2 = n2.subscribe(((t3) => t3 && this.emit("leave", t3))), v2 = s2.subscribe(((t3) => t3 && this.emit("dblclick", t3))), g2 = a2.subscribe(((t3) => t3 && this.toggleCursor(true))), m2 = d3.subscribe(((t3) => t3 && this.toggleCursor(false)));
27116
27088
  this.subscriptions.push((() => {
27117
- c2(), u4(), p2(), v2(), g2(), m2(), l(e3), l(i2), l(n2), l(s2), l(a2), l(d2);
27089
+ c2(), u4(), p2(), v2(), g2(), m2(), l(e3), l(i2), l(n2), l(s2), l(a2), l(d3);
27118
27090
  }));
27119
27091
  const f2 = h(t2), b2 = r((() => {
27120
27092
  const t3 = f2.signal.value;
@@ -27133,8 +27105,8 @@ class a extends t {
27133
27105
  h2 && this.updatingSide && this.updatingSide !== e3 && ("start" === this.updatingSide ? o2 = i2 : l2 = i2), o2 = Math.max(0, o2), l2 = Math.min(this.totalDuration, l2);
27134
27106
  const a2 = l2 - o2;
27135
27107
  this.updatingSide = e3;
27136
- const d2 = a2 >= this.minLength && a2 <= this.maxLength;
27137
- o2 <= l2 && (d2 || h2) && (this.start = o2, this.end = l2, this.renderPosition(), this.emit("update", e3));
27108
+ const d3 = a2 >= this.minLength && a2 <= this.maxLength;
27109
+ o2 <= l2 && (d3 || h2) && (this.start = o2, this.end = l2, this.renderPosition(), this.emit("update", e3));
27138
27110
  }
27139
27111
  onMove(t2) {
27140
27112
  this.drag && this._onUpdate(t2);
@@ -27190,12 +27162,12 @@ class a extends t {
27190
27162
  this.isRemoved = true, this.emit("remove"), this.subscriptions.forEach(((t2) => t2())), this.subscriptions = [], this.content && this.contentEditable && (this.contentClickListener && (this.content.removeEventListener("click", this.contentClickListener), this.contentClickListener = void 0), this.contentBlurListener && (this.content.removeEventListener("blur", this.contentBlurListener), this.contentBlurListener = void 0)), this.element && (this.element.remove(), this.element = null), this.unAll();
27191
27163
  }
27192
27164
  }
27193
- class d extends e2 {
27165
+ class d2 extends e2 {
27194
27166
  constructor(t2) {
27195
27167
  super(t2), this.regions = [], this.regionsContainer = this.initRegionsContainer();
27196
27168
  }
27197
27169
  static create(t2) {
27198
- return new d(t2);
27170
+ return new d2(t2);
27199
27171
  }
27200
27172
  onInit() {
27201
27173
  if (!this.wavesurfer) throw Error("WaveSurfer is not initialized");
@@ -27304,19 +27276,19 @@ class d extends e2 {
27304
27276
  if (!(n2 && n2 instanceof HTMLElement)) return () => {
27305
27277
  };
27306
27278
  let s2 = null, o2 = 0, l2 = 0;
27307
- const d2 = h(n2, { threshold: e3 }), c2 = r((() => {
27279
+ const d3 = h(n2, { threshold: e3 }), c2 = r((() => {
27308
27280
  var e4, i3;
27309
- const n3 = d2.signal.value;
27281
+ const n3 = d3.signal.value;
27310
27282
  if (n3) if ("start" === n3.type) {
27311
27283
  if (o2 = n3.x, !this.wavesurfer) return;
27312
- const r2 = this.wavesurfer.getDuration(), h2 = null === (i3 = null === (e4 = this.wavesurfer) || void 0 === e4 ? void 0 : e4.getDecodedData()) || void 0 === i3 ? void 0 : i3.numberOfChannels, { width: d3 } = this.wavesurfer.getWrapper().getBoundingClientRect();
27313
- l2 = o2 / d3 * r2;
27314
- const c3 = n3.x / d3 * r2, u4 = (n3.x + 5) / d3 * r2;
27284
+ const r2 = this.wavesurfer.getDuration(), h2 = null === (i3 = null === (e4 = this.wavesurfer) || void 0 === e4 ? void 0 : e4.getDecodedData()) || void 0 === i3 ? void 0 : i3.numberOfChannels, { width: d4 } = this.wavesurfer.getWrapper().getBoundingClientRect();
27285
+ l2 = o2 / d4 * r2;
27286
+ const c3 = n3.x / d4 * r2, u4 = (n3.x + 5) / d4 * r2;
27315
27287
  s2 = new a(Object.assign(Object.assign({}, t2), { start: c3, end: u4 }), r2, h2), this.emit("region-initialized", s2), s2.element && this.regionsContainer.appendChild(s2.element);
27316
27288
  } else "move" === n3.type && void 0 !== n3.deltaX ? s2 && s2._onUpdate(n3.deltaX, n3.x > o2 ? "end" : "start", l2) : "end" === n3.type && s2 && (this.saveRegion(s2), s2.updatingSide = void 0, s2 = null);
27317
- }), [d2.signal]);
27289
+ }), [d3.signal]);
27318
27290
  return () => {
27319
- c2(), d2.cleanup();
27291
+ c2(), d3.cleanup();
27320
27292
  };
27321
27293
  }
27322
27294
  clearRegions() {
@@ -27488,7 +27460,7 @@ function useAudioPlayer(options) {
27488
27460
  isLoading.value = true;
27489
27461
  isReady.value = false;
27490
27462
  loadError.value = null;
27491
- const regionsPlugin = d.create();
27463
+ const regionsPlugin = d2.create();
27492
27464
  regions.value = regionsPlugin;
27493
27465
  const precomputed = audio.waveform.value;
27494
27466
  const peaks = precomputed?.length ? [normalizePeaks(precomputed)] : void 0;
@@ -28024,23 +27996,23 @@ function splitPartialSubtitles({ previousText, previousIndexes: oldCutPositions
28024
27996
  );
28025
27997
  wordIndex += diff.countRemoved;
28026
27998
  } else if ("removed" in diff && diff.removed) {
28027
- const d2 = diff;
28028
- wordIndex += d2.count;
27999
+ const d3 = diff;
28000
+ wordIndex += d3.count;
28029
28001
  newCutPositions = incrementIndexes(
28030
28002
  newCutPositions,
28031
28003
  copyCutPositions[0],
28032
- -d2.count
28004
+ -d3.count
28033
28005
  );
28034
28006
  } else if ("added" in diff && diff.added) {
28035
- const d2 = diff;
28007
+ const d3 = diff;
28036
28008
  newCutPositions = incrementIndexes(
28037
28009
  newCutPositions,
28038
28010
  copyCutPositions[0],
28039
- d2.count
28011
+ d3.count
28040
28012
  );
28041
28013
  } else {
28042
- const d2 = diff;
28043
- wordIndex += d2.count;
28014
+ const d3 = diff;
28015
+ wordIndex += d3.count;
28044
28016
  }
28045
28017
  }
28046
28018
  const lineText = (from, to) => newTextSplitBySpace.slice(from, to).join(" ");
@@ -30318,4 +30290,4 @@ export {
30318
30290
  purify as p,
30319
30291
  register as r
30320
30292
  };
30321
- //# sourceMappingURL=index-CopL8cVA.js.map
30293
+ //# sourceMappingURL=index-DhBFBHeE.js.map