@ghchinoy/lit-audio-ui 0.5.1 → 0.6.0

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.
Files changed (40) hide show
  1. package/custom-elements.json +134 -60
  2. package/dist/components/atoms/ui-audio-next-button.js +9 -13
  3. package/dist/components/atoms/ui-audio-play-button.js +10 -14
  4. package/dist/components/atoms/ui-audio-player-error.js +10 -14
  5. package/dist/components/atoms/ui-audio-prev-button.js +9 -13
  6. package/dist/components/atoms/ui-audio-progress-slider.js +16 -20
  7. package/dist/components/atoms/ui-audio-time-display.js +15 -19
  8. package/dist/components/atoms/ui-audio-volume-slider.js +17 -21
  9. package/dist/components/atoms/ui-speech-cancel-button.js +5 -5
  10. package/dist/components/atoms/ui-speech-record-button.js +5 -5
  11. package/dist/components/atoms/ui-timed-text.js +14 -18
  12. package/dist/components/atoms/ui-voice-waveform.js +15 -19
  13. package/dist/components/molecules/ui-live-waveform.js +33 -32
  14. package/dist/components/molecules/ui-mic-selector.js +14 -18
  15. package/dist/components/molecules/ui-playlist.js +15 -19
  16. package/dist/components/molecules/ui-scrolling-waveform.js +30 -29
  17. package/dist/components/molecules/ui-spectrum-visualizer.js +23 -25
  18. package/dist/components/molecules/ui-speech-preview.js +16 -20
  19. package/dist/components/molecules/ui-voice-button.js +25 -29
  20. package/dist/components/molecules/ui-voice-picker.js +21 -25
  21. package/dist/components/molecules/ui-voice-pill.js +5 -5
  22. package/dist/components/molecules/ui-waveform.js +46 -36
  23. package/dist/components/organisms/ui-audio-player.js +7 -11
  24. package/dist/components/providers/ui-audio-provider.js +17 -22
  25. package/dist/components/providers/ui-speech-provider.js +13 -17
  26. package/dist/index.js +36 -36
  27. package/dist/node_modules/@chenglou/pretext/dist/analysis.js +456 -0
  28. package/dist/node_modules/@chenglou/pretext/dist/bidi.js +62 -0
  29. package/dist/node_modules/@chenglou/pretext/dist/layout.js +190 -0
  30. package/dist/node_modules/@chenglou/pretext/dist/line-break.js +234 -0
  31. package/dist/node_modules/@chenglou/pretext/dist/measurement.js +106 -0
  32. package/dist/scream-audio-ui.umd.js +45 -42
  33. package/dist/src/components/molecules/ui-waveform.d.ts +7 -1
  34. package/dist/src/components/providers/ui-audio-provider.d.ts +2 -1
  35. package/dist/src/utils/audio-context.d.ts +0 -1
  36. package/dist/src/utils/audio-utils.d.ts +8 -0
  37. package/dist/standalone/scream-audio-ui.standalone.js +2626 -1655
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/dist/utils/audio-utils.js +27 -16
  40. package/package.json +7 -4
@@ -667,6 +667,33 @@
667
667
  }
668
668
  ],
669
669
  "description": "Formats a duration in seconds into a standard MM:SS or HH:MM:SS string."
670
+ },
671
+ {
672
+ "kind": "function",
673
+ "name": "computeAudioPeaks",
674
+ "return": {
675
+ "type": {
676
+ "text": ""
677
+ }
678
+ },
679
+ "parameters": [
680
+ {
681
+ "name": "audioUrl",
682
+ "type": {
683
+ "text": "string"
684
+ },
685
+ "description": "The URL of the audio file."
686
+ },
687
+ {
688
+ "name": "numPeaks",
689
+ "default": "100",
690
+ "type": {
691
+ "text": "number"
692
+ },
693
+ "description": "The number of peaks to generate."
694
+ }
695
+ ],
696
+ "description": "Computes an array of normalized RMS peaks from an audio URL using the Web Audio API."
670
697
  }
671
698
  ],
672
699
  "exports": [
@@ -717,6 +744,14 @@
717
744
  "name": "formatAudioTime",
718
745
  "module": "src/utils/audio-utils.ts"
719
746
  }
747
+ },
748
+ {
749
+ "kind": "js",
750
+ "name": "computeAudioPeaks",
751
+ "declaration": {
752
+ "name": "computeAudioPeaks",
753
+ "module": "src/utils/audio-utils.ts"
754
+ }
720
755
  }
721
756
  ]
722
757
  },
@@ -1749,6 +1784,51 @@
1749
1784
  }
1750
1785
  ]
1751
1786
  },
1787
+ {
1788
+ "kind": "javascript-module",
1789
+ "path": "src/components/organisms/ui-audio-player.ts",
1790
+ "declarations": [
1791
+ {
1792
+ "kind": "class",
1793
+ "description": "A monolithic backward-compatibility wrapper that renders the classic ElevenLabs\npill-shaped audio player. Internally, it relies completely on the new\ncompound <ui-audio-provider> architecture.",
1794
+ "name": "UiAudioPlayer",
1795
+ "members": [
1796
+ {
1797
+ "kind": "field",
1798
+ "name": "item",
1799
+ "type": {
1800
+ "text": "AudioPlayerItem | undefined"
1801
+ }
1802
+ },
1803
+ {
1804
+ "kind": "field",
1805
+ "name": "styles",
1806
+ "static": true,
1807
+ "default": "css` :host { display: inline-block; width: 100%; max-width: 400px; } .player-pill { display: flex; align-items: center; gap: var(--ui-audio-player-gap, 16px); padding: var(--ui-audio-player-padding, 12px 24px); background: var(--md-sys-color-surface-container-high, #e2e2e2); border-radius: 999px; /* Pill shape */ width: fit-content; font-family: inherit; } .time-container { min-width: 85px; /* prevent jitter when times change */ } .slider-container { width: 200px; display: flex; align-items: center; } `"
1808
+ },
1809
+ {
1810
+ "kind": "method",
1811
+ "name": "render"
1812
+ }
1813
+ ],
1814
+ "superclass": {
1815
+ "name": "LitElement",
1816
+ "package": "lit"
1817
+ },
1818
+ "customElement": true
1819
+ }
1820
+ ],
1821
+ "exports": [
1822
+ {
1823
+ "kind": "js",
1824
+ "name": "UiAudioPlayer",
1825
+ "declaration": {
1826
+ "name": "UiAudioPlayer",
1827
+ "module": "src/components/organisms/ui-audio-player.ts"
1828
+ }
1829
+ }
1830
+ ]
1831
+ },
1752
1832
  {
1753
1833
  "kind": "javascript-module",
1754
1834
  "path": "src/components/molecules/scream-voice-button.ts",
@@ -4288,6 +4368,13 @@
4288
4368
  "description": "",
4289
4369
  "name": "UiWaveform",
4290
4370
  "members": [
4371
+ {
4372
+ "kind": "field",
4373
+ "name": "src",
4374
+ "type": {
4375
+ "text": "string | undefined"
4376
+ }
4377
+ },
4291
4378
  {
4292
4379
  "kind": "field",
4293
4380
  "name": "data",
@@ -4373,6 +4460,47 @@
4373
4460
  "text": "number | string | undefined"
4374
4461
  }
4375
4462
  },
4463
+ {
4464
+ "kind": "field",
4465
+ "name": "overlayText",
4466
+ "type": {
4467
+ "text": "string | undefined"
4468
+ }
4469
+ },
4470
+ {
4471
+ "kind": "field",
4472
+ "name": "overlayFont",
4473
+ "type": {
4474
+ "text": "string"
4475
+ },
4476
+ "default": "'14px Inter, sans-serif'"
4477
+ },
4478
+ {
4479
+ "kind": "field",
4480
+ "name": "overlayColor",
4481
+ "type": {
4482
+ "text": "string"
4483
+ },
4484
+ "default": "'#ffffff'"
4485
+ },
4486
+ {
4487
+ "kind": "field",
4488
+ "name": "_computedPeaks",
4489
+ "type": {
4490
+ "text": "number[] | null"
4491
+ },
4492
+ "privacy": "private",
4493
+ "default": "null"
4494
+ },
4495
+ {
4496
+ "kind": "field",
4497
+ "name": "_preparedOverlayText",
4498
+ "type": {
4499
+ "text": "PreparedTextWithSegments | null"
4500
+ },
4501
+ "privacy": "private",
4502
+ "default": "null"
4503
+ },
4376
4504
  {
4377
4505
  "kind": "field",
4378
4506
  "name": "_canvas",
@@ -4452,51 +4580,6 @@
4452
4580
  }
4453
4581
  ]
4454
4582
  },
4455
- {
4456
- "kind": "javascript-module",
4457
- "path": "src/components/organisms/ui-audio-player.ts",
4458
- "declarations": [
4459
- {
4460
- "kind": "class",
4461
- "description": "A monolithic backward-compatibility wrapper that renders the classic ElevenLabs\npill-shaped audio player. Internally, it relies completely on the new\ncompound <ui-audio-provider> architecture.",
4462
- "name": "UiAudioPlayer",
4463
- "members": [
4464
- {
4465
- "kind": "field",
4466
- "name": "item",
4467
- "type": {
4468
- "text": "AudioPlayerItem | undefined"
4469
- }
4470
- },
4471
- {
4472
- "kind": "field",
4473
- "name": "styles",
4474
- "static": true,
4475
- "default": "css` :host { display: inline-block; width: 100%; max-width: 400px; } .player-pill { display: flex; align-items: center; gap: var(--ui-audio-player-gap, 16px); padding: var(--ui-audio-player-padding, 12px 24px); background: var(--md-sys-color-surface-container-high, #e2e2e2); border-radius: 999px; /* Pill shape */ width: fit-content; font-family: inherit; } .time-container { min-width: 85px; /* prevent jitter when times change */ } .slider-container { width: 200px; display: flex; align-items: center; } `"
4476
- },
4477
- {
4478
- "kind": "method",
4479
- "name": "render"
4480
- }
4481
- ],
4482
- "superclass": {
4483
- "name": "LitElement",
4484
- "package": "lit"
4485
- },
4486
- "customElement": true
4487
- }
4488
- ],
4489
- "exports": [
4490
- {
4491
- "kind": "js",
4492
- "name": "UiAudioPlayer",
4493
- "declaration": {
4494
- "name": "UiAudioPlayer",
4495
- "module": "src/components/organisms/ui-audio-player.ts"
4496
- }
4497
- }
4498
- ]
4499
- },
4500
4583
  {
4501
4584
  "kind": "javascript-module",
4502
4585
  "path": "src/components/providers/ui-audio-provider.ts",
@@ -4530,14 +4613,6 @@
4530
4613
  },
4531
4614
  "default": "true"
4532
4615
  },
4533
- {
4534
- "kind": "field",
4535
- "name": "loop",
4536
- "type": {
4537
- "text": "boolean"
4538
- },
4539
- "default": "false"
4540
- },
4541
4616
  {
4542
4617
  "kind": "field",
4543
4618
  "name": "_audioEl",
@@ -4586,7 +4661,7 @@
4586
4661
  "text": "AudioPlayerState"
4587
4662
  },
4588
4663
  "privacy": "public",
4589
- "default": "{ src: '', isPlaying: false, isBuffering: false, currentTime: 0, duration: 0, volume: 1, muted: false, loop: false, items: [], currentIndex: -1, autoAdvance: true, analyserNode: undefined, play: () => this.play(), pause: () => this.pause(), togglePlay: () => this._togglePlay(), seek: (time: number) => this.seek(time), reset: () => this.reset(), setVolume: (volume: number) => this._setVolume(volume), toggleMute: () => this._toggleMute(), next: () => this.next(), previous: () => this.previous(), select: (index: number) => this.select(index), }"
4664
+ "default": "{ src: '', isPlaying: false, isBuffering: false, currentTime: 0, duration: 0, volume: 1, muted: false, items: [], currentIndex: -1, autoAdvance: true, analyserNode: undefined, play: () => this.play(), pause: () => this.pause(), togglePlay: () => this._togglePlay(), seek: (time: number) => this.seek(time), reset: () => this.reset(), setVolume: (volume: number) => this._setVolume(volume), toggleMute: () => this._toggleMute(), next: () => this.next(), previous: () => this.previous(), select: (index: number) => this.select(index), }"
4590
4665
  },
4591
4666
  {
4592
4667
  "kind": "field",
@@ -4594,6 +4669,11 @@
4594
4669
  "static": true,
4595
4670
  "default": "css` :host { display: contents; /* We are completely invisible, just wrapping children */ } audio { display: none; } `"
4596
4671
  },
4672
+ {
4673
+ "kind": "method",
4674
+ "name": "clearTextCache",
4675
+ "privacy": "public"
4676
+ },
4597
4677
  {
4598
4678
  "kind": "method",
4599
4679
  "name": "render"
@@ -4760,12 +4840,6 @@
4760
4840
  "type": {
4761
4841
  "text": "CustomEvent"
4762
4842
  }
4763
- },
4764
- {
4765
- "name": "ended",
4766
- "type": {
4767
- "text": "CustomEvent"
4768
- }
4769
4843
  }
4770
4844
  ],
4771
4845
  "superclass": {
@@ -1,8 +1,9 @@
1
1
  import { audioPlayerContext as e } from "../../utils/audio-context.js";
2
+ import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
3
  import "@material/web/icon/icon.js";
3
- import { LitElement as t, css as n, html as r } from "lit";
4
- import { customElement as i } from "lit/decorators.js";
5
- import { consume as a } from "@lit/context";
4
+ import { LitElement as n, css as r, html as i } from "lit";
5
+ import { customElement as a } from "lit/decorators.js";
6
+ import { consume as o } from "@lit/context";
6
7
  import "@material/web/iconbutton/icon-button.js";
7
8
  /**
8
9
  * Copyright 2026 Google LLC
@@ -19,21 +20,16 @@ import "@material/web/iconbutton/icon-button.js";
19
20
  * See the License for the specific language governing permissions and
20
21
  * limitations under the License.
21
22
  */
22
- var o = function(e, t, n, r) {
23
- var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
24
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
25
- else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
26
- return i > 3 && a && Object.defineProperty(t, n, a), a;
27
- }, s = class extends t {
23
+ var s = class extends n {
28
24
  static {
29
- this.styles = n`
25
+ this.styles = r`
30
26
  :host {
31
27
  display: inline-block;
32
28
  }
33
29
  `;
34
30
  }
35
31
  render() {
36
- return r`
32
+ return i`
37
33
  <md-icon-button
38
34
  aria-label="Next track"
39
35
  ?disabled=${!(this.playerState && this.playerState.items.length > 0 && (this.playerState.currentIndex < this.playerState.items.length - 1 || this.playerState.autoAdvance))}
@@ -44,8 +40,8 @@ var o = function(e, t, n, r) {
44
40
  `;
45
41
  }
46
42
  };
47
- o([a({
43
+ t([o({
48
44
  context: e,
49
45
  subscribe: !0
50
- })], s.prototype, "playerState", void 0), s = o([i("ui-audio-next-button")], s);
46
+ })], s.prototype, "playerState", void 0), s = t([a("ui-audio-next-button")], s);
51
47
  export { s as UiAudioNextButton };
@@ -1,18 +1,14 @@
1
1
  import { audioPlayerContext as e } from "../../utils/audio-context.js";
2
+ import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
3
  import "@material/web/icon/icon.js";
3
- import { LitElement as t, css as n, html as r } from "lit";
4
- import { customElement as i, property as a } from "lit/decorators.js";
5
- import { consume as o } from "@lit/context";
4
+ import { LitElement as n, css as r, html as i } from "lit";
5
+ import { customElement as a, property as o } from "lit/decorators.js";
6
+ import { consume as s } from "@lit/context";
6
7
  import "@material/web/iconbutton/filled-icon-button.js";
7
8
  import "@material/web/progress/circular-progress.js";
8
- var s = function(e, t, n, r) {
9
- var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
10
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
11
- else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
12
- return i > 3 && a && Object.defineProperty(t, n, a), a;
13
- }, c = class extends t {
9
+ var c = class extends n {
14
10
  static {
15
- this.styles = n`
11
+ this.styles = r`
16
12
  :host {
17
13
  display: inline-flex;
18
14
  position: relative;
@@ -73,7 +69,7 @@ var s = function(e, t, n, r) {
73
69
  }
74
70
  render() {
75
71
  let e = this.playerState?.isPlaying ?? !1, t = this.playerState?.isBuffering ?? !1, n = !!this.playerState?.error;
76
- return r`
72
+ return i`
77
73
  <md-filled-icon-button
78
74
  part="button"
79
75
  class="${n ? "error" : ""}"
@@ -81,7 +77,7 @@ var s = function(e, t, n, r) {
81
77
  @click="${this._handleClick}"
82
78
  ?disabled="${!this.playerState?.src}"
83
79
  >
84
- ${t && e && !n ? r`<md-circular-progress indeterminate></md-circular-progress>` : r`<md-icon>${n ? "error" : e ? "pause" : "play_arrow"}</md-icon>`}
80
+ ${t && e && !n ? i`<md-circular-progress indeterminate></md-circular-progress>` : i`<md-icon>${n ? "error" : e ? "pause" : "play_arrow"}</md-icon>`}
85
81
  </md-filled-icon-button>
86
82
  `;
87
83
  }
@@ -89,8 +85,8 @@ var s = function(e, t, n, r) {
89
85
  this.playerState && this.playerState.togglePlay();
90
86
  }
91
87
  };
92
- s([o({
88
+ t([s({
93
89
  context: e,
94
90
  subscribe: !0
95
- }), a({ attribute: !1 })], c.prototype, "playerState", void 0), c = s([i("ui-audio-play-button")], c);
91
+ }), o({ attribute: !1 })], c.prototype, "playerState", void 0), c = t([a("ui-audio-play-button")], c);
96
92
  export { c as UiAudioPlayButton };
@@ -1,19 +1,15 @@
1
1
  import { audioPlayerContext as e } from "../../utils/audio-context.js";
2
+ import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
3
  import "@material/web/icon/icon.js";
3
- import { LitElement as t, css as n, html as r } from "lit";
4
- import { customElement as i, property as a } from "lit/decorators.js";
5
- import { consume as o } from "@lit/context";
4
+ import { LitElement as n, css as r, html as i } from "lit";
5
+ import { customElement as a, property as o } from "lit/decorators.js";
6
+ import { consume as s } from "@lit/context";
6
7
  /**
7
8
  * Copyright 2026 Google LLC
8
9
  */
9
- var s = function(e, t, n, r) {
10
- var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
11
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
12
- else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
13
- return i > 3 && a && Object.defineProperty(t, n, a), a;
14
- }, c = class extends t {
10
+ var c = class extends n {
15
11
  static {
16
- this.styles = n`
12
+ this.styles = r`
17
13
  :host {
18
14
  display: inline-flex;
19
15
  align-items: center;
@@ -49,14 +45,14 @@ var s = function(e, t, n, r) {
49
45
  }
50
46
  render() {
51
47
  let e = this.playerState?.error;
52
- return e ? r`
48
+ return e ? i`
53
49
  <md-icon class="error-icon">error</md-icon>
54
50
  <span class="error-text" title="${e}">${e}</span>
55
- ` : r``;
51
+ ` : i``;
56
52
  }
57
53
  };
58
- s([o({
54
+ t([s({
59
55
  context: e,
60
56
  subscribe: !0
61
- }), a({ attribute: !1 })], c.prototype, "playerState", void 0), c = s([i("ui-audio-player-error")], c);
57
+ }), o({ attribute: !1 })], c.prototype, "playerState", void 0), c = t([a("ui-audio-player-error")], c);
62
58
  export { c as UiAudioPlayerError };
@@ -1,8 +1,9 @@
1
1
  import { audioPlayerContext as e } from "../../utils/audio-context.js";
2
+ import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
2
3
  import "@material/web/icon/icon.js";
3
- import { LitElement as t, css as n, html as r } from "lit";
4
- import { customElement as i } from "lit/decorators.js";
5
- import { consume as a } from "@lit/context";
4
+ import { LitElement as n, css as r, html as i } from "lit";
5
+ import { customElement as a } from "lit/decorators.js";
6
+ import { consume as o } from "@lit/context";
6
7
  import "@material/web/iconbutton/icon-button.js";
7
8
  /**
8
9
  * Copyright 2026 Google LLC
@@ -19,21 +20,16 @@ import "@material/web/iconbutton/icon-button.js";
19
20
  * See the License for the specific language governing permissions and
20
21
  * limitations under the License.
21
22
  */
22
- var o = function(e, t, n, r) {
23
- var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
24
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
25
- else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
26
- return i > 3 && a && Object.defineProperty(t, n, a), a;
27
- }, s = class extends t {
23
+ var s = class extends n {
28
24
  static {
29
- this.styles = n`
25
+ this.styles = r`
30
26
  :host {
31
27
  display: inline-block;
32
28
  }
33
29
  `;
34
30
  }
35
31
  render() {
36
- return r`
32
+ return i`
37
33
  <md-icon-button
38
34
  aria-label="Previous track"
39
35
  ?disabled=${!(this.playerState && this.playerState.items.length > 0 && (this.playerState.currentIndex > 0 || this.playerState.autoAdvance))}
@@ -44,8 +40,8 @@ var o = function(e, t, n, r) {
44
40
  `;
45
41
  }
46
42
  };
47
- o([a({
43
+ t([o({
48
44
  context: e,
49
45
  subscribe: !0
50
- })], s.prototype, "playerState", void 0), s = o([i("ui-audio-prev-button")], s);
46
+ })], s.prototype, "playerState", void 0), s = t([a("ui-audio-prev-button")], s);
51
47
  export { s as UiAudioPrevButton };
@@ -1,20 +1,16 @@
1
1
  import { audioPlayerContext as e } from "../../utils/audio-context.js";
2
- import { formatAudioTime as t } from "../../utils/audio-utils.js";
3
- import { LitElement as n, css as r, html as i } from "lit";
4
- import { customElement as a, property as o, query as s, state as c } from "lit/decorators.js";
5
- import { consume as l } from "@lit/context";
2
+ import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
3
+ import { formatAudioTime as n } from "../../utils/audio-utils.js";
4
+ import { LitElement as r, css as i, html as a } from "lit";
5
+ import { customElement as o, property as s, query as c, state as l } from "lit/decorators.js";
6
+ import { consume as u } from "@lit/context";
6
7
  import "@material/web/slider/slider.js";
7
- var u = function(e, t, n, r) {
8
- var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
9
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
10
- else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
11
- return i > 3 && a && Object.defineProperty(t, n, a), a;
12
- }, d = class extends n {
13
- constructor() {
14
- super(...arguments), this._isDragging = !1, this._dragValue = 0, this.hoverTimestamp = !1, this._hoverX = 0, this._showHover = !1, this._hoverTime = 0;
8
+ var d = class extends r {
9
+ constructor(...e) {
10
+ super(...e), this._isDragging = !1, this._dragValue = 0, this.hoverTimestamp = !1, this._hoverX = 0, this._showHover = !1, this._hoverTime = 0;
15
11
  }
16
12
  static {
17
- this.styles = r`
13
+ this.styles = i`
18
14
 
19
15
 
20
16
  :host {
@@ -69,20 +65,20 @@ var u = function(e, t, n, r) {
69
65
  `;
70
66
  }
71
67
  render() {
72
- let e = this.playerState?.duration || 0, n = e === 0 || !this.playerState?.src, r = this._isDragging ? this._dragValue : this.playerState?.currentTime || 0;
73
- return i`
68
+ let e = this.playerState?.duration || 0, t = e === 0 || !this.playerState?.src, r = this._isDragging ? this._dragValue : this.playerState?.currentTime || 0;
69
+ return a`
74
70
  <div
75
71
  style="position: relative; width: 100%; display: flex; align-items: center;"
76
72
  @mousemove="${this._handleMouseMove}"
77
73
  @mouseenter="${() => this._showHover = !0}"
78
74
  @mouseleave="${() => this._showHover = !1}"
79
75
  >
80
- ${this.hoverTimestamp && this.playerState?.src ? i`
76
+ ${this.hoverTimestamp && this.playerState?.src ? a`
81
77
  <div
82
78
  class="hover-tooltip ${this._showHover ? "show" : ""}"
83
79
  style="left: ${this._hoverX}px;"
84
80
  >
85
- ${t(this._hoverTime)}
81
+ ${n(this._hoverTime)}
86
82
  </div>
87
83
  ` : ""}
88
84
  <md-slider
@@ -92,7 +88,7 @@ var u = function(e, t, n, r) {
92
88
  max="${e || 100}"
93
89
  value="${r}"
94
90
  step="0.1"
95
- ?disabled="${n}"
91
+ ?disabled="${t}"
96
92
  @input="${this._handleInput}"
97
93
  @change="${this._handleChange}"
98
94
  ></md-slider>
@@ -111,8 +107,8 @@ var u = function(e, t, n, r) {
111
107
  this._dragValue = e.target.value, this.playerState && this.playerState.seek(this._dragValue), this._isDragging = !1;
112
108
  }
113
109
  };
114
- u([l({
110
+ t([u({
115
111
  context: e,
116
112
  subscribe: !0
117
- }), o({ attribute: !1 })], d.prototype, "playerState", void 0), u([o({ type: Boolean })], d.prototype, "hoverTimestamp", void 0), u([c()], d.prototype, "_hoverX", void 0), u([c()], d.prototype, "_showHover", void 0), u([c()], d.prototype, "_hoverTime", void 0), u([s("md-slider")], d.prototype, "_sliderEl", void 0), d = u([a("ui-audio-progress-slider")], d);
113
+ }), s({ attribute: !1 })], d.prototype, "playerState", void 0), t([s({ type: Boolean })], d.prototype, "hoverTimestamp", void 0), t([l()], d.prototype, "_hoverX", void 0), t([l()], d.prototype, "_showHover", void 0), t([l()], d.prototype, "_hoverTime", void 0), t([c("md-slider")], d.prototype, "_sliderEl", void 0), d = t([o("ui-audio-progress-slider")], d);
118
114
  export { d as UiAudioProgressSlider };
@@ -1,19 +1,15 @@
1
1
  import { audioPlayerContext as e } from "../../utils/audio-context.js";
2
- import { formatAudioTime as t } from "../../utils/audio-utils.js";
3
- import { LitElement as n, css as r, html as i } from "lit";
4
- import { customElement as a, property as o } from "lit/decorators.js";
5
- import { consume as s } from "@lit/context";
6
- var c = function(e, t, n, r) {
7
- var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
8
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
9
- else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
10
- return i > 3 && a && Object.defineProperty(t, n, a), a;
11
- }, l = class extends n {
12
- constructor() {
13
- super(...arguments), this.format = "combined", this.separator = " / ", this.compact = !1;
2
+ import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/decorate.js";
3
+ import { formatAudioTime as n } from "../../utils/audio-utils.js";
4
+ import { LitElement as r, css as i, html as a } from "lit";
5
+ import { customElement as o, property as s } from "lit/decorators.js";
6
+ import { consume as c } from "@lit/context";
7
+ var l = class extends r {
8
+ constructor(...e) {
9
+ super(...e), this.format = "combined", this.separator = " / ", this.compact = !1;
14
10
  }
15
11
  static {
16
- this.styles = r`
12
+ this.styles = i`
17
13
  :host {
18
14
  display: inline-block;
19
15
  font-variant-numeric: tabular-nums;
@@ -25,18 +21,18 @@ var c = function(e, t, n, r) {
25
21
  }
26
22
  render() {
27
23
  let e = this.playerState?.currentTime || 0, t = this.playerState?.duration || 0;
28
- if (this.format === "elapsed") return i`${this._formatTime(e)}`;
24
+ if (this.format === "elapsed") return a`${this._formatTime(e)}`;
29
25
  if (this.format === "remaining") {
30
26
  let n = Math.max(0, t - e);
31
- return i`-${this._formatTime(n)}`;
32
- } else return i`${this._formatTime(e)}${this.separator}${t ? this._formatTime(t) : "--:--"}`;
27
+ return a`-${this._formatTime(n)}`;
28
+ } else return a`${this._formatTime(e)}${this.separator}${t ? this._formatTime(t) : "--:--"}`;
33
29
  }
34
30
  _formatTime(e) {
35
- return t(e);
31
+ return n(e);
36
32
  }
37
33
  };
38
- c([s({
34
+ t([c({
39
35
  context: e,
40
36
  subscribe: !0
41
- }), o({ attribute: !1 })], l.prototype, "playerState", void 0), c([o({ type: String })], l.prototype, "format", void 0), c([o({ type: String })], l.prototype, "separator", void 0), c([o({ type: Boolean })], l.prototype, "compact", void 0), l = c([a("ui-audio-time-display")], l);
37
+ }), s({ attribute: !1 })], l.prototype, "playerState", void 0), t([s({ type: String })], l.prototype, "format", void 0), t([s({ type: String })], l.prototype, "separator", void 0), t([s({ type: Boolean })], l.prototype, "compact", void 0), l = t([o("ui-audio-time-display")], l);
42
38
  export { l as UiAudioTimeDisplay };