@sudobility/music_types 0.11.29 → 0.11.31

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 (229) hide show
  1. package/dist/domain/commands/edit-commands.d.ts +3 -3
  2. package/dist/domain/commands/edit-commands.d.ts.map +1 -1
  3. package/dist/domain/commands/edit-commands.js +25 -25
  4. package/dist/domain/commands/edit-commands.js.map +1 -1
  5. package/dist/domain/commands/history.d.ts +32 -0
  6. package/dist/domain/commands/history.d.ts.map +1 -0
  7. package/dist/domain/commands/history.js +63 -0
  8. package/dist/domain/commands/history.js.map +1 -0
  9. package/dist/domain/commands/note-commands.d.ts +147 -3
  10. package/dist/domain/commands/note-commands.d.ts.map +1 -1
  11. package/dist/domain/commands/note-commands.js +438 -46
  12. package/dist/domain/commands/note-commands.js.map +1 -1
  13. package/dist/domain/commands/reflow.d.ts +1 -1
  14. package/dist/domain/commands/reflow.js +17 -17
  15. package/dist/domain/commands/reflow.js.map +1 -1
  16. package/dist/domain/commands/region-commands.d.ts +4 -4
  17. package/dist/domain/commands/region-commands.d.ts.map +1 -1
  18. package/dist/domain/commands/region-commands.js +7 -7
  19. package/dist/domain/commands/region-commands.js.map +1 -1
  20. package/dist/domain/commands/relocate-commands.d.ts +3 -3
  21. package/dist/domain/commands/relocate-commands.js +15 -15
  22. package/dist/domain/commands/relocate-commands.js.map +1 -1
  23. package/dist/domain/commands/ripple-commands.d.ts +2 -2
  24. package/dist/domain/commands/ripple-commands.js +13 -13
  25. package/dist/domain/commands/ripple-commands.js.map +1 -1
  26. package/dist/domain/commands/snapshot.d.ts +3 -3
  27. package/dist/domain/commands/snapshot.js +5 -5
  28. package/dist/domain/commands/snapshot.js.map +1 -1
  29. package/dist/domain/commands/structure-commands.d.ts +86 -5
  30. package/dist/domain/commands/structure-commands.d.ts.map +1 -1
  31. package/dist/domain/commands/structure-commands.js +272 -36
  32. package/dist/domain/commands/structure-commands.js.map +1 -1
  33. package/dist/domain/commands/track-commands.d.ts +2 -2
  34. package/dist/domain/commands/track-commands.js +7 -7
  35. package/dist/domain/commands/track-commands.js.map +1 -1
  36. package/dist/domain/commands/types.d.ts +2 -2
  37. package/dist/domain/generation/replacement-region.d.ts +32 -0
  38. package/dist/domain/generation/replacement-region.d.ts.map +1 -0
  39. package/dist/domain/generation/replacement-region.js +79 -0
  40. package/dist/domain/generation/replacement-region.js.map +1 -0
  41. package/dist/domain/instruments/gm-icon.d.ts +12 -0
  42. package/dist/domain/instruments/gm-icon.d.ts.map +1 -0
  43. package/dist/domain/instruments/gm-icon.js +327 -0
  44. package/dist/domain/instruments/gm-icon.js.map +1 -0
  45. package/dist/domain/instruments/gm-kit.js +9 -9
  46. package/dist/domain/instruments/gm-kit.js.map +1 -1
  47. package/dist/domain/instruments/gm-percussion.js +48 -48
  48. package/dist/domain/instruments/gm-percussion.js.map +1 -1
  49. package/dist/domain/instruments/gm-polyphony.js +6 -6
  50. package/dist/domain/instruments/gm-range.js +6 -6
  51. package/dist/domain/instruments/gm-transposition.js +1 -1
  52. package/dist/domain/instruments/gm.d.ts +1 -1
  53. package/dist/domain/instruments/gm.js +161 -161
  54. package/dist/domain/instruments/gm.js.map +1 -1
  55. package/dist/domain/instruments/icon-art.d.ts +75 -0
  56. package/dist/domain/instruments/icon-art.d.ts.map +1 -0
  57. package/dist/domain/instruments/icon-art.js +93 -0
  58. package/dist/domain/instruments/icon-art.js.map +1 -0
  59. package/dist/domain/instruments/instrument-fit.d.ts +31 -0
  60. package/dist/domain/instruments/instrument-fit.d.ts.map +1 -0
  61. package/dist/domain/instruments/instrument-fit.js +117 -0
  62. package/dist/domain/instruments/instrument-fit.js.map +1 -0
  63. package/dist/domain/instruments/instrument-options.d.ts +62 -0
  64. package/dist/domain/instruments/instrument-options.d.ts.map +1 -0
  65. package/dist/domain/instruments/instrument-options.js +69 -0
  66. package/dist/domain/instruments/instrument-options.js.map +1 -0
  67. package/dist/domain/instruments/track-instrument.d.ts +80 -0
  68. package/dist/domain/instruments/track-instrument.d.ts.map +1 -0
  69. package/dist/domain/instruments/track-instrument.js +102 -0
  70. package/dist/domain/instruments/track-instrument.js.map +1 -0
  71. package/dist/domain/notation/chord-symbol.d.ts +26 -0
  72. package/dist/domain/notation/chord-symbol.d.ts.map +1 -0
  73. package/dist/domain/notation/chord-symbol.js +32 -0
  74. package/dist/domain/notation/chord-symbol.js.map +1 -0
  75. package/dist/domain/notation/lyric-syllables.d.ts +15 -0
  76. package/dist/domain/notation/lyric-syllables.d.ts.map +1 -0
  77. package/dist/domain/notation/lyric-syllables.js +15 -0
  78. package/dist/domain/notation/lyric-syllables.js.map +1 -0
  79. package/dist/domain/notation/music-vocabulary.d.ts +59 -0
  80. package/dist/domain/notation/music-vocabulary.d.ts.map +1 -0
  81. package/dist/domain/notation/music-vocabulary.js +164 -0
  82. package/dist/domain/notation/music-vocabulary.js.map +1 -0
  83. package/dist/domain/pitch/pitch.d.ts +1 -1
  84. package/dist/domain/pitch/pitch.js +29 -29
  85. package/dist/domain/pitch/transpose.d.ts +1 -1
  86. package/dist/domain/pitch/transpose.js +2 -2
  87. package/dist/domain/quantization/quantize.d.ts +2 -2
  88. package/dist/domain/quantization/quantize.js +9 -9
  89. package/dist/domain/quantization/quantize.js.map +1 -1
  90. package/dist/domain/score/articulation.d.ts +56 -0
  91. package/dist/domain/score/articulation.d.ts.map +1 -0
  92. package/dist/domain/score/articulation.js +56 -0
  93. package/dist/domain/score/articulation.js.map +1 -0
  94. package/dist/domain/score/bar-numbers.d.ts +38 -0
  95. package/dist/domain/score/bar-numbers.d.ts.map +1 -0
  96. package/dist/domain/score/bar-numbers.js +49 -0
  97. package/dist/domain/score/bar-numbers.js.map +1 -0
  98. package/dist/domain/score/collapse-rests.d.ts +23 -0
  99. package/dist/domain/score/collapse-rests.d.ts.map +1 -0
  100. package/dist/domain/score/collapse-rests.js +78 -0
  101. package/dist/domain/score/collapse-rests.js.map +1 -0
  102. package/dist/domain/score/cue-notes.d.ts +24 -0
  103. package/dist/domain/score/cue-notes.d.ts.map +1 -0
  104. package/dist/domain/score/cue-notes.js +105 -0
  105. package/dist/domain/score/cue-notes.js.map +1 -0
  106. package/dist/domain/score/dynamics.d.ts +62 -0
  107. package/dist/domain/score/dynamics.d.ts.map +1 -0
  108. package/dist/domain/score/dynamics.js +142 -0
  109. package/dist/domain/score/dynamics.js.map +1 -0
  110. package/dist/domain/score/effective-clef.d.ts +42 -0
  111. package/dist/domain/score/effective-clef.d.ts.map +1 -0
  112. package/dist/domain/score/effective-clef.js +39 -0
  113. package/dist/domain/score/effective-clef.js.map +1 -0
  114. package/dist/domain/score/extract-part.d.ts +10 -0
  115. package/dist/domain/score/extract-part.d.ts.map +1 -0
  116. package/dist/domain/score/extract-part.js +44 -0
  117. package/dist/domain/score/extract-part.js.map +1 -0
  118. package/dist/domain/score/factory.d.ts +1 -1
  119. package/dist/domain/score/factory.js +12 -12
  120. package/dist/domain/score/factory.js.map +1 -1
  121. package/dist/domain/score/fermata-tempo.d.ts +40 -0
  122. package/dist/domain/score/fermata-tempo.d.ts.map +1 -0
  123. package/dist/domain/score/fermata-tempo.js +95 -0
  124. package/dist/domain/score/fermata-tempo.js.map +1 -0
  125. package/dist/domain/score/flatten.d.ts +32 -0
  126. package/dist/domain/score/flatten.d.ts.map +1 -0
  127. package/dist/domain/score/flatten.js +132 -0
  128. package/dist/domain/score/flatten.js.map +1 -0
  129. package/dist/domain/score/fragment.d.ts +3 -3
  130. package/dist/domain/score/fragment.js +8 -8
  131. package/dist/domain/score/fragment.js.map +1 -1
  132. package/dist/domain/score/ids.d.ts +1 -1
  133. package/dist/domain/score/ids.js +6 -6
  134. package/dist/domain/score/ottava.d.ts +41 -0
  135. package/dist/domain/score/ottava.d.ts.map +1 -0
  136. package/dist/domain/score/ottava.js +98 -0
  137. package/dist/domain/score/ottava.js.map +1 -0
  138. package/dist/domain/score/performance-timeline.d.ts +42 -0
  139. package/dist/domain/score/performance-timeline.d.ts.map +1 -0
  140. package/dist/domain/score/performance-timeline.js +78 -0
  141. package/dist/domain/score/performance-timeline.js.map +1 -0
  142. package/dist/domain/score/queries.d.ts +2 -2
  143. package/dist/domain/score/queries.js +7 -7
  144. package/dist/domain/score/queries.js.map +1 -1
  145. package/dist/domain/score/rehearsal-marks.d.ts +30 -0
  146. package/dist/domain/score/rehearsal-marks.d.ts.map +1 -0
  147. package/dist/domain/score/rehearsal-marks.js +126 -0
  148. package/dist/domain/score/rehearsal-marks.js.map +1 -0
  149. package/dist/domain/score/repeat-order.d.ts +21 -0
  150. package/dist/domain/score/repeat-order.d.ts.map +1 -0
  151. package/dist/domain/score/repeat-order.js +123 -0
  152. package/dist/domain/score/repeat-order.js.map +1 -0
  153. package/dist/domain/score/snapshot-tree.d.ts +23 -0
  154. package/dist/domain/score/snapshot-tree.d.ts.map +1 -0
  155. package/dist/domain/score/snapshot-tree.js +45 -0
  156. package/dist/domain/score/snapshot-tree.js.map +1 -0
  157. package/dist/domain/score/ties.d.ts +1 -1
  158. package/dist/domain/score/ties.js +7 -7
  159. package/dist/domain/score/ties.js.map +1 -1
  160. package/dist/domain/score/written-pitch.d.ts +33 -0
  161. package/dist/domain/score/written-pitch.d.ts.map +1 -0
  162. package/dist/domain/score/written-pitch.js +110 -0
  163. package/dist/domain/score/written-pitch.js.map +1 -0
  164. package/dist/domain/selection/range-select.d.ts +13 -0
  165. package/dist/domain/selection/range-select.d.ts.map +1 -0
  166. package/dist/domain/selection/range-select.js +40 -0
  167. package/dist/domain/selection/range-select.js.map +1 -0
  168. package/dist/domain/selection/selection-editing.d.ts +30 -0
  169. package/dist/domain/selection/selection-editing.d.ts.map +1 -0
  170. package/dist/domain/selection/selection-editing.js +31 -0
  171. package/dist/domain/selection/selection-editing.js.map +1 -0
  172. package/dist/domain/selection/selection.d.ts +2 -2
  173. package/dist/domain/selection/selection.js +7 -7
  174. package/dist/domain/selection/selection.js.map +1 -1
  175. package/dist/domain/selection/types.d.ts +2 -2
  176. package/dist/domain/time/duration-modifiers.d.ts +40 -0
  177. package/dist/domain/time/duration-modifiers.d.ts.map +1 -0
  178. package/dist/domain/time/duration-modifiers.js +50 -0
  179. package/dist/domain/time/duration-modifiers.js.map +1 -0
  180. package/dist/domain/time/duration-selection.d.ts +23 -0
  181. package/dist/domain/time/duration-selection.d.ts.map +1 -0
  182. package/dist/domain/time/duration-selection.js +50 -0
  183. package/dist/domain/time/duration-selection.js.map +1 -0
  184. package/dist/domain/time/durations.js +6 -6
  185. package/dist/domain/time/durations.js.map +1 -1
  186. package/dist/domain/time/fraction.d.ts +1 -1
  187. package/dist/domain/time/fraction.js +1 -1
  188. package/dist/domain/time/tap-to-note.d.ts +21 -0
  189. package/dist/domain/time/tap-to-note.d.ts.map +1 -0
  190. package/dist/domain/time/tap-to-note.js +43 -0
  191. package/dist/domain/time/tap-to-note.js.map +1 -0
  192. package/dist/domain/time/tempo-map.d.ts +1 -1
  193. package/dist/domain/time/ticks.d.ts +1 -1
  194. package/dist/domain/time/ticks.d.ts.map +1 -1
  195. package/dist/domain/time/ticks.js +14 -14
  196. package/dist/domain/time/ticks.js.map +1 -1
  197. package/dist/domain/time/tuplets.d.ts +42 -0
  198. package/dist/domain/time/tuplets.d.ts.map +1 -0
  199. package/dist/domain/time/tuplets.js +53 -0
  200. package/dist/domain/time/tuplets.js.map +1 -0
  201. package/dist/domain/validation/issues.d.ts +1 -1
  202. package/dist/domain/validation/issues.js +20 -20
  203. package/dist/domain/validation/validator.d.ts +2 -2
  204. package/dist/domain/validation/validator.d.ts.map +1 -1
  205. package/dist/domain/validation/validator.js +31 -31
  206. package/dist/domain/validation/validator.js.map +1 -1
  207. package/dist/domain/voicing/allocate.d.ts +2 -2
  208. package/dist/domain/voicing/allocate.js +6 -6
  209. package/dist/domain/voicing/allocate.js.map +1 -1
  210. package/dist/index.d.ts +756 -56
  211. package/dist/index.d.ts.map +1 -1
  212. package/dist/index.js +164 -75
  213. package/dist/index.js.map +1 -1
  214. package/dist/platform/audio.d.ts.map +1 -1
  215. package/dist/platform/file.d.ts.map +1 -1
  216. package/dist/platform/index.d.ts +7 -7
  217. package/dist/platform/index.js +7 -7
  218. package/dist/platform/midi-input.d.ts +2 -2
  219. package/dist/platform/midi.d.ts.map +1 -1
  220. package/dist/platform/mod.d.ts +2 -2
  221. package/dist/platform/playback.d.ts +7 -7
  222. package/dist/platform/xml.js +1 -1
  223. package/dist/services/regeneration/controller.d.ts +6 -6
  224. package/dist/services/regeneration/controller.js +12 -12
  225. package/dist/services/regeneration/controller.js.map +1 -1
  226. package/dist/test/fixtures.d.ts +1 -1
  227. package/dist/test/fixtures.js +103 -103
  228. package/dist/test/fixtures.js.map +1 -1
  229. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import type { MusicalEvent, NoteEvent, Score, UUID } from '../../index.js';
2
- import type { QuantizeOptions } from '../quantization/options.js';
3
- import type { ScoreCommand } from './types.js';
1
+ import type { MusicalEvent, NoteEvent, Score, UUID } from "../../index.js";
2
+ import type { QuantizeOptions } from "../quantization/options.js";
3
+ import type { ScoreCommand } from "./types.js";
4
4
  export type PasteDestination = {
5
5
  trackId: UUID;
6
6
  voiceIndex: number;
@@ -1 +1 @@
1
- {"version":3,"file":"edit-commands.d.ts","sourceRoot":"","sources":["../../../src/domain/commands/edit-commands.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,KAAK,EACL,IAAI,EACL,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM/C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAkCF;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,EAAE,EAClB,WAAW,EAAE,gBAAg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M,CAAC;CACpB,CAAC;AAkCF;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,EAAE,EAClB,WAAW,EAAE,gBAAgB,EAC7B,KAAK,EAAE,MAAM,GACZ,YAAY,CAId;AAgBD;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,SAAS,IAAI,EAAE,GACxB,cAAc,EAAE,CAiBlB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,kBAAkB,EAAE,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,GACpD,KAAK,CAqCP;AAuBD,8GAA8G;AAC9G,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,IAAI,EAAE,EAChB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,MAAM,GACZ,YAAY,CAEd;AAuCD,uGAAuG;AACvG,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,IAAI,EAAE,EAChB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACZ,YAAY,CAId"}
@@ -3,19 +3,19 @@
3
3
  * §24). Each factory wraps a pure `(Score) => Score` transform via
4
4
  * `transformCommand`.
5
5
  */
6
- import { createId } from '../score/ids.js';
7
- import { splitNoteAcrossMeasures } from '../score/ties.js';
8
- import { isNoteEvent } from '../../index.js';
9
- import { transposePitch } from '../pitch/transpose.js';
10
- import { quantizeEvents } from '../quantization/quantize.js';
11
- import { transformCommand } from './snapshot.js';
12
- import { insertNoteIntoTrack, reflowVoice, withTracks } from './reflow.js';
6
+ import { createId } from "../score/ids.js";
7
+ import { splitNoteAcrossMeasures } from "../score/ties.js";
8
+ import { isNoteEvent } from "../../index.js";
9
+ import { transposePitch } from "../pitch/transpose.js";
10
+ import { quantizeEvents } from "../quantization/quantize.js";
11
+ import { transformCommand } from "./snapshot.js";
12
+ import { insertNoteIntoTrack, reflowVoice, withTracks } from "./reflow.js";
13
13
  function pasteEvents(score, notes, destination) {
14
- const track = score.tracks.find(t => t.id === destination.trackId);
14
+ const track = score.tracks.find((t) => t.id === destination.trackId);
15
15
  if (!track || notes.length === 0)
16
16
  return score;
17
- const originStart = Math.min(...notes.map(n => n.startTick));
18
- const boundaries = track.measures.map(m => m.startTick);
17
+ const originStart = Math.min(...notes.map((n) => n.startTick));
18
+ const boundaries = track.measures.map((m) => m.startTick);
19
19
  let working = track;
20
20
  for (const note of notes) {
21
21
  const startTick = destination.anchorTick + (note.startTick - originStart);
@@ -32,7 +32,7 @@ function pasteEvents(score, notes, destination) {
32
32
  working = insertNoteIntoTrack(working, segment, destination.voiceIndex);
33
33
  }
34
34
  }
35
- const tracks = score.tracks.map(t => (t.id === track.id ? working : t));
35
+ const tracks = score.tracks.map((t) => (t.id === track.id ? working : t));
36
36
  return withTracks(score, tracks);
37
37
  }
38
38
  /**
@@ -45,7 +45,7 @@ function pasteEvents(score, notes, destination) {
45
45
  * with their source.
46
46
  */
47
47
  export function pasteEventsCommand(notes, destination, label) {
48
- return transformCommand(label, score => pasteEvents(score, notes, destination));
48
+ return transformCommand(label, (score) => pasteEvents(score, notes, destination));
49
49
  }
50
50
  // ---- quantizeCommand -----------------------------------------------------------
51
51
  /** Clips `event` to fit within `measure`'s span, or returns `null` if that leaves no positive duration. */
@@ -75,7 +75,7 @@ export function collectQuantizeTargets(score, eventIds) {
75
75
  for (const track of score.tracks) {
76
76
  for (const measure of track.measures) {
77
77
  for (const voice of measure.voices) {
78
- if (!voice.events.some(e => idSet.has(e.id)))
78
+ if (!voice.events.some((e) => idSet.has(e.id)))
79
79
  continue;
80
80
  targets.push({
81
81
  trackId: track.id,
@@ -110,8 +110,8 @@ export function applyQuantizedGroups(score, targets, quantizedByVoiceId) {
110
110
  else
111
111
  targetsByTrackMeasure.set(key, [target]);
112
112
  }
113
- const tracks = score.tracks.map(track => {
114
- const measures = track.measures.map(measure => {
113
+ const tracks = score.tracks.map((track) => {
114
+ const measures = track.measures.map((measure) => {
115
115
  const measureTargets = targetsByTrackMeasure.get(`${track.id}::${measure.id}`);
116
116
  if (!measureTargets)
117
117
  return measure;
@@ -119,11 +119,11 @@ export function applyQuantizedGroups(score, targets, quantizedByVoiceId) {
119
119
  const measureEnd = measure.startTick + measure.durationTicks;
120
120
  for (const target of measureTargets) {
121
121
  const quantizedNotes = (quantizedByVoiceId.get(target.voiceId) ?? [])
122
- .map(e => clipToMeasure(e, measure.startTick, measureEnd))
122
+ .map((e) => clipToMeasure(e, measure.startTick, measureEnd))
123
123
  .filter((e) => e !== null);
124
124
  const withQuantized = {
125
125
  ...nextMeasure,
126
- voices: nextMeasure.voices.map(v => v.id === target.voiceId ? { ...v, events: quantizedNotes } : v),
126
+ voices: nextMeasure.voices.map((v) => v.id === target.voiceId ? { ...v, events: quantizedNotes } : v),
127
127
  };
128
128
  nextMeasure = reflowVoice(withQuantized, target.voiceId, track.id);
129
129
  }
@@ -145,24 +145,24 @@ export function applyQuantizedGroups(score, targets, quantizedByVoiceId) {
145
145
  */
146
146
  function quantize(score, eventIds, options) {
147
147
  const targets = collectQuantizeTargets(score, eventIds);
148
- const quantizedByVoiceId = new Map(targets.map(t => [t.voiceId, quantizeEvents(t.notes, options)]));
148
+ const quantizedByVoiceId = new Map(targets.map((t) => [t.voiceId, quantizeEvents(t.notes, options)]));
149
149
  return applyQuantizedGroups(score, targets, quantizedByVoiceId);
150
150
  }
151
151
  /** Quantizes every voice containing at least one of `eventIds`, per Task 4's reusable quantization engine. */
152
152
  export function quantizeCommand(eventIds, options, label) {
153
- return transformCommand(label, score => quantize(score, eventIds, options));
153
+ return transformCommand(label, (score) => quantize(score, eventIds, options));
154
154
  }
155
155
  // ---- transposeCommand -----------------------------------------------------------
156
156
  function transpose(score, eventIds, semitones) {
157
157
  const idSet = new Set(eventIds);
158
- const tracks = score.tracks.map(track => {
159
- const measures = track.measures.map(measure => {
160
- const voices = measure.voices.map(voice => {
161
- if (!voice.events.some(e => idSet.has(e.id)))
158
+ const tracks = score.tracks.map((track) => {
159
+ const measures = track.measures.map((measure) => {
160
+ const voices = measure.voices.map((voice) => {
161
+ if (!voice.events.some((e) => idSet.has(e.id)))
162
162
  return voice;
163
163
  return {
164
164
  ...voice,
165
- events: voice.events.map(event => isNoteEvent(event) && idSet.has(event.id)
165
+ events: voice.events.map((event) => isNoteEvent(event) && idSet.has(event.id)
166
166
  ? {
167
167
  ...event,
168
168
  pitch: transposePitch(event.pitch, semitones, measure.keySignature),
@@ -180,6 +180,6 @@ function transpose(score, eventIds, semitones) {
180
180
  }
181
181
  /** Transposes the given notes by `semitones`, re-spelling each per its own measure's key signature. */
182
182
  export function transposeCommand(eventIds, semitones, label) {
183
- return transformCommand(label, score => transpose(score, eventIds, semitones));
183
+ return transformCommand(label, (score) => transpose(score, eventIds, semitones));
184
184
  }
185
185
  //# sourceMappingURL=edit-commands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"edit-commands.js","sourceRoot":"","sources":["../../../src/domain/commands/edit-commands.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAO3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,mBA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AC,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACtE,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACvD,CAAC,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACnC,CAAC;AAED,uGAAuG;AACvG,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,SAAiB,EACjB,KAAa;IAEb,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CACvC,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,CACtC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Command-based undo/redo history (spec §14). `HistoryManager` holds only
3
+ * command-history bookkeeping (the undo/redo stacks and a size limit) —
4
+ * never a `Score` itself or any store reference: the current score always
5
+ * lives with the caller, passed in and received back on every call.
6
+ */
7
+ import type { Score } from "../../index.js";
8
+ import type { ScoreCommand } from "./types.js";
9
+ export declare class HistoryManager {
10
+ private readonly limit;
11
+ private undoStack;
12
+ private redoStack;
13
+ constructor(limit?: number);
14
+ /**
15
+ * Runs `cmd.execute(score)`, pushes `cmd` onto the undo stack (evicting
16
+ * the oldest entry if that exceeds `limit`), and clears the redo stack
17
+ * (a fresh command invalidates any previously-undone branch), per spec
18
+ * §14.
19
+ */
20
+ execute(cmd: ScoreCommand, score: Score): Score;
21
+ /** Undoes the most recently executed (or redone) command, or returns `null` if there is nothing to undo. */
22
+ undo(score: Score): Score | null;
23
+ /** Re-executes the most recently undone command, or returns `null` if there is nothing to redo. */
24
+ redo(score: Score): Score | null;
25
+ get canUndo(): boolean;
26
+ get canRedo(): boolean;
27
+ get undoLabel(): string | null;
28
+ get redoLabel(): string | null;
29
+ /** Clears both the undo and redo stacks. */
30
+ clear(): void;
31
+ }
32
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/domain/commands/history.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,SAAS,CAAsB;gBAE3B,KAAK,GAAE,MAAsB;IAIzC;;;;;OAKG;IACH,OAAO,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK;IAU/C,4GAA4G;IAC5G,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI;IAQhC,mGAAmG;IACnG,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI;IAQhC,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,SAAS,IAAI,MAAM,GAAG,IAAI,CAI7B;IAED,IAAI,SAAS,IAAI,MAAM,GAAG,IAAI,CAI7B;IAED,4CAA4C;IAC5C,KAAK,IAAI,IAAI;CAId"}
@@ -0,0 +1,63 @@
1
+ const DEFAULT_LIMIT = 200;
2
+ export class HistoryManager {
3
+ constructor(limit = DEFAULT_LIMIT) {
4
+ this.undoStack = [];
5
+ this.redoStack = [];
6
+ this.limit = limit;
7
+ }
8
+ /**
9
+ * Runs `cmd.execute(score)`, pushes `cmd` onto the undo stack (evicting
10
+ * the oldest entry if that exceeds `limit`), and clears the redo stack
11
+ * (a fresh command invalidates any previously-undone branch), per spec
12
+ * §14.
13
+ */
14
+ execute(cmd, score) {
15
+ const next = cmd.execute(score);
16
+ this.undoStack.push(cmd);
17
+ if (this.undoStack.length > this.limit) {
18
+ this.undoStack.shift();
19
+ }
20
+ this.redoStack = [];
21
+ return next;
22
+ }
23
+ /** Undoes the most recently executed (or redone) command, or returns `null` if there is nothing to undo. */
24
+ undo(score) {
25
+ const cmd = this.undoStack.pop();
26
+ if (!cmd)
27
+ return null;
28
+ const previous = cmd.undo(score);
29
+ this.redoStack.push(cmd);
30
+ return previous;
31
+ }
32
+ /** Re-executes the most recently undone command, or returns `null` if there is nothing to redo. */
33
+ redo(score) {
34
+ const cmd = this.redoStack.pop();
35
+ if (!cmd)
36
+ return null;
37
+ const next = cmd.execute(score);
38
+ this.undoStack.push(cmd);
39
+ return next;
40
+ }
41
+ get canUndo() {
42
+ return this.undoStack.length > 0;
43
+ }
44
+ get canRedo() {
45
+ return this.redoStack.length > 0;
46
+ }
47
+ get undoLabel() {
48
+ return this.undoStack.length > 0
49
+ ? this.undoStack[this.undoStack.length - 1].label
50
+ : null;
51
+ }
52
+ get redoLabel() {
53
+ return this.redoStack.length > 0
54
+ ? this.redoStack[this.redoStack.length - 1].label
55
+ : null;
56
+ }
57
+ /** Clears both the undo and redo stacks. */
58
+ clear() {
59
+ this.undoStack = [];
60
+ this.redoStack = [];
61
+ }
62
+ }
63
+ //# sourceMappingURL=history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/domain/commands/history.ts"],"names":[],"mappings":"AASA,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,OAAO,cAAc;IAKzB,YAAY,QAAgB,aAAa;QAHjC,cAAS,GAAmB,EAAE,CAAC;QAC/B,cAAS,GAAmB,EAAE,CAAC;QAGrC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,GAAiB,EAAE,KAAY;QACrC,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,SAAS,CAAC,IAAI,C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IAAI,CAAC;IACX,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;YAC9B,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK;YACjD,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IAED,4CAA4C;IAC5C,KAAK;QACH,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACtB,CAAC;CACF"}
@@ -1,5 +1,6 @@
1
- import type { Accidental, Articulation, DurationName, Pitch, UUID } from '../../index.js';
2
- import type { ScoreCommand } from './types.js';
1
+ import type { Accidental, Articulation, DurationName, Hairpin, Ornament, Ottava, Pitch, UUID } from "../../index.js";
2
+ import type { Dynamic, Lyric } from "../../index.js";
3
+ import type { ScoreCommand } from "./types.js";
3
4
  export type AddNoteParams = {
4
5
  trackId: UUID;
5
6
  measureId: UUID;
@@ -64,10 +65,153 @@ export declare function changePitchCommand(eventIds: UUID[], pitch: Pitch, label
64
65
  export declare function changeVelocityCommand(eventIds: UUID[], velocity: number, label: string): ScoreCommand;
65
66
  /** Sets (or clears, when `articulation` is `undefined`) the given notes' articulation. */
66
67
  export declare function changeArticulationCommand(eventIds: UUID[], articulation: Articulation | undefined, label: string): ScoreCommand;
68
+ /**
69
+ * Sets (or clears, when `ornament` is `undefined`) the given notes' ornament.
70
+ *
71
+ * Shaped like `changeArticulationCommand` rather than like the fermata toggle,
72
+ * because an ornament is a choice among several rather than an on/off: a menu
73
+ * sets the one it names, and "None" clears. A note carries at most one sign —
74
+ * a trill that is also a turn is not a marking anybody writes.
75
+ */
76
+ export declare function changeOrnamentCommand(eventIds: UUID[], ornament: Ornament | undefined, label: string): ScoreCommand;
77
+ /**
78
+ * Puts a fermata on the given notes, or takes it off the ones that have one.
79
+ *
80
+ * Toggles on the *whole selection together* rather than per note: the state is
81
+ * read from whether every selected note already carries one, so a mixed
82
+ * selection gains fermatas rather than flipping each note independently. A
83
+ * control that did the latter would leave a selection half-marked and look
84
+ * broken.
85
+ *
86
+ * Unlike `toggleSlurCommand` this needs no endpoints and refuses nothing — a
87
+ * fermata is a property of a single note, so one note is a perfectly good
88
+ * selection and each marked note stands alone. Chords are marked note by note
89
+ * because that is what the selection contains; the renderer draws one fermata
90
+ * per notehead position, which is what a chord with a pause looks like.
91
+ */
92
+ export declare function toggleFermataCommand(eventIds: UUID[], label: string): ScoreCommand;
93
+ /**
94
+ * Sets or clears the dynamic marking the given notes start.
95
+ *
96
+ * A dynamic is stored on the note it applies *from* and governs until the next
97
+ * one on that track, so marking one note `f` is how a passage becomes loud —
98
+ * there is nothing to apply to the notes in between, and applying it to each
99
+ * would print a marking under every notehead.
100
+ */
101
+ export declare function changeDynamicCommand(eventIds: UUID[], dynamic: Dynamic | undefined, label: string): ScoreCommand;
67
102
  /** Sets the given notes' pitch accidental, keeping their step/octave. */
68
103
  export declare function changeAccidentalCommand(eventIds: UUID[], accidental: Accidental, label: string): ScoreCommand;
69
104
  /** Toggles `tieStart` or `tieStop` on the given notes. */
70
- export declare function toggleTieCommand(eventIds: UUID[], which: 'tieStart' | 'tieStop', label: string): ScoreCommand;
105
+ export declare function toggleTieCommand(eventIds: UUID[], which: "tieStart" | "tieStop", label: string): ScoreCommand;
106
+ /**
107
+ * Slurs a selection, or removes the slur it already carries.
108
+ *
109
+ * Takes the whole selection rather than a flag per note, because that is what
110
+ * a slur is: one mark over a run of notes. The caller says "slur these" and
111
+ * this decides which of them is the start and which the stop — marking them
112
+ * individually would let a user create a start with no stop, which draws
113
+ * nothing and is invisible to fix.
114
+ *
115
+ * Endpoints are the earliest and latest note by tick, not the order the ids
116
+ * arrived in: a selection built by shift-clicking around a phrase is still
117
+ * that phrase.
118
+ *
119
+ * Fewer than two notes cannot be slurred — a phrase mark over one note means
120
+ * nothing — and toggling off is offered when the span is already slurred, so
121
+ * the same control removes what it made.
122
+ */
123
+ export declare function toggleSlurCommand(eventIds: UUID[], label: string): ScoreCommand;
124
+ /**
125
+ * Writes a hairpin across the selection, or removes the one it already has.
126
+ *
127
+ * Shaped like `toggleSlurCommand`, because a hairpin is the same kind of thing
128
+ * — one mark over a run of notes. The caller says "crescendo these" and this
129
+ * decides which of them opens it and which closes it; marking them one at a
130
+ * time would let a user create an opening with no close, which draws nothing
131
+ * and is invisible to fix.
132
+ *
133
+ * Endpoints are the earliest and latest note **by tick**, not the order the
134
+ * ids arrived in, so a selection built by shift-clicking around a phrase is
135
+ * still that phrase.
136
+ *
137
+ * Fewer than two notes is refused: a wedge over one note has nowhere to open
138
+ * to. Re-applying the **same** direction to a span that already carries it
139
+ * removes it, so one control undoes what it made; applying the **other**
140
+ * direction flips it, which is what reaching for the other button means.
141
+ */
142
+ export declare function toggleHairpinCommand(eventIds: UUID[], hairpin: Hairpin, label: string): ScoreCommand;
143
+ /**
144
+ * Rolls the selected chords, or stops rolling them.
145
+ *
146
+ * Toggles the whole selection together, like the fermata: the state is read
147
+ * from whether *every* selected note already carries the flag, so a partly
148
+ * marked selection becomes fully marked rather than inverting note by note.
149
+ *
150
+ * The mark belongs to a chord, but the selection is notes — so this simply
151
+ * sets the flag on what was selected and lets the renderer decide. A lone note
152
+ * keeps the flag harmlessly and draws nothing, which is better than refusing:
153
+ * selecting a bar and rolling its chords should not fail because one beat
154
+ * happens to be a single note.
155
+ */
156
+ export declare function toggleArpeggiateCommand(eventIds: UUID[], label: string): ScoreCommand;
157
+ /**
158
+ * Brackets the selection at an octave, or removes the bracket it has.
159
+ *
160
+ * A span like the hairpin: endpoints by tick, two notes minimum, the same
161
+ * displacement twice removes it and a different one replaces it.
162
+ */
163
+ export declare function toggleOttavaCommand(eventIds: UUID[], ottava: Ottava, label: string): ScoreCommand;
164
+ /**
165
+ * Slides between the selected notes, or removes the slide.
166
+ *
167
+ * Two notes exactly is the usual case and two is the minimum: a glissando is
168
+ * a line *between* noteheads, so one note has nothing to slide to. A wider
169
+ * selection slides from its first note to its last, which is what dragging
170
+ * across a run and asking for a slide means.
171
+ */
172
+ export declare function toggleGlissandoCommand(eventIds: UUID[], label: string): ScoreCommand;
173
+ /**
174
+ * Sets or clears the finger written on the given notes.
175
+ *
176
+ * Blank clears it rather than storing an empty string, which would reserve
177
+ * space beside the notehead and print nothing.
178
+ */
179
+ export declare function setFingeringCommand(eventIds: UUID[], fingering: string | undefined, label: string): ScoreCommand;
180
+ /**
181
+ * Sets or clears the syllable sung on one note.
182
+ *
183
+ * One note at a time, unlike the other note commands: every syllable in a line
184
+ * is different, so applying one across a selection could only ever write the
185
+ * same word repeatedly.
186
+ *
187
+ * Blank text clears the lyric rather than storing an empty one — an empty
188
+ * syllable would reserve space under the note and print nothing.
189
+ */
190
+ export declare function setLyricCommand(eventId: UUID, lyric: Lyric | undefined, label: string): ScoreCommand;
191
+ /**
192
+ * Sets or clears the chord symbol printed from a note.
193
+ *
194
+ * One note at a time, like a lyric: every chord in a progression is different,
195
+ * so applying one across a selection could only write the same symbol
196
+ * repeatedly. Blank text clears it rather than storing an empty symbol, which
197
+ * would reserve space above the stave and print nothing.
198
+ */
199
+ export declare function setChordSymbolCommand(eventId: UUID, symbol: string | undefined, label: string): ScoreCommand;
200
+ /**
201
+ * Turns a written note into a grace note on the note that follows it.
202
+ *
203
+ * The note leaves the voice and reappears hanging off its neighbour, and the
204
+ * gap it leaves is filled with a rest — so the bar still adds up, which is the
205
+ * whole reason grace notes are stored on their principal rather than as events
206
+ * of their own.
207
+ *
208
+ * The principal is the next note *in the same voice*, since that is what the
209
+ * ornament leads into. A note with nothing after it cannot become one: an
210
+ * ornament with nothing to ornament would simply vanish from the page.
211
+ */
212
+ export declare function toGraceNoteCommand(eventId: UUID, label: string): ScoreCommand;
213
+ /** Removes every ornament from the given notes. */
214
+ export declare function clearGraceNotesCommand(eventIds: UUID[], label: string): ScoreCommand;
71
215
  /** Moves the given notes to the voice at ordinal position `targetVoiceIndex` within their current measure (created if absent). */
72
216
  export declare function changeVoiceCommand(eventIds: UUID[], targetVoiceIndex: number, label: string): ScoreCommand;
73
217
  //# sourceMappingURL=note-commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"note-commands.d.ts","sourceRoot":"","sources":["../../../src/domain/commands/note-commands.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EAEZ,KAAK,EAGL,IAAI,EACL,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA+C/C,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAwBF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,GACZ,YAAY,CAEd;AAcD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,IAAI,EAAE,EAChB,KAAK,EAAE,MAAM,GACZ,YAAY,CAEd;AAID,MAAM,MAAM,eAAe,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC;AAiF7E;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,IAAI,EAAE,EAChB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,GACZ,YAAY,CAEd;AA0CD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,IAAI,EAAE,EAChB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,GACZ,YAAY,CAId;AAED,yHAAyH;AACzH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,IAAI,EAAE,EAChB,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,MAAM,GACZ,YAAY,CAId;AAID,0DAA0D;AAC1D,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,IAAI,EAAE,EAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,GACZ,YAAY,CAId;AAED,8CAA8C;AAC9C,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,IAAI,EAAE,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,YAAY,CAId;AAED,0FAA0F;AAC1F,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,IAAI,EAAE,EAChB,YAAY,EAAE,YAAY,GAAG,SAAS,EACtC,KAAK,EAAE,MAAM,GACZ,YAAY,CASd;AAED,yEAAyE;AACzE,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,IAAI,EAAE,EAChB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,MAAM,GACZ,YAAY,CAOd;AAED,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,IAAI,EAAE,EAChB,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,KAAK,EAAE,MAAM,GACZ,YAAY,CAId;AA0DD,kIAAkI;AAClI,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,IAAI,EAAE,EAChB,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,MAAM,GACZ,YAAY,CAId"}
1
+ {"version":3,"file":"note-commands.d.ts","sourceRoot":"","sources":["../../../src/domain/commands/note-commands.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,OAAO,EAEP,QAAQ,EACR,MAAM,EACN,KAAK,EAGL,IAAI,EACL,MAAM,gBAAgB,CAAC;AAExB,OAAO,K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