@tremolo-ui/dom 0.4.0 → 0.5.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.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,111 @@
1
+ import { PianoLayout, ValueRange } from "@tremolo-ui/functions";
2
+
3
+ //#region src/canvas/animation.d.ts
4
+ /** What the canvas looked like when a frame was drawn. */
5
+ interface AnimationFrame {
6
+ /** Width of the canvas in CSS pixels. */
7
+ width: number;
8
+ /** Height of the canvas in CSS pixels. */
9
+ height: number;
10
+ /** Frames drawn so far, starting at 0. */
11
+ count: number;
12
+ /** Milliseconds since the previous frame. */
13
+ deltaTime: number;
14
+ /** Milliseconds since the instance was created. */
15
+ elapsedTime: number;
16
+ /** Frames per second implied by `deltaTime`. */
17
+ fps: number;
18
+ }
19
+ type CanvasDrawFunction = (context: CanvasRenderingContext2D, frame: AnimationFrame) => void;
20
+ type CanvasInitFunction = (context: CanvasRenderingContext2D, size: {
21
+ width: number;
22
+ height: number;
23
+ }) => void;
24
+ interface AnimationCanvasOptions {
25
+ /** Called for every frame. */
26
+ draw: CanvasDrawFunction;
27
+ /** Called once, after the first size is known and before the first frame. */
28
+ init?: CanvasInitFunction;
29
+ /**
30
+ * Keep drawing on every animation frame. When off, a frame is drawn only on
31
+ * a resize or an explicit {@link AnimationCanvasInstance.redraw}.
32
+ *
33
+ * @default true
34
+ */
35
+ animate?: boolean;
36
+ /**
37
+ * Size in CSS pixels. Ignored when `relativeSize` is on.
38
+ *
39
+ * @default { width: 100, height: 100 }
40
+ */
41
+ size?: {
42
+ width: number;
43
+ height: number;
44
+ };
45
+ /**
46
+ * Follow the size of the canvas's parent element instead of `size`.
47
+ *
48
+ * Fixed for the lifetime of the instance: it decides whether a
49
+ * `ResizeObserver` is attached.
50
+ *
51
+ * @default false
52
+ */
53
+ relativeSize?: boolean;
54
+ /**
55
+ * Carry the drawing across a resize, so that the canvas does not blank for a
56
+ * frame while the new size is drawn.
57
+ *
58
+ * @default true
59
+ */
60
+ reduceFlickering?: boolean;
61
+ /**
62
+ * Passed to `getContext('2d', …)`. Read once when the context is created, so
63
+ * it is fixed for the lifetime of the instance.
64
+ *
65
+ * @see https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/getContext#contextattributes
66
+ */
67
+ contextAttributes?: CanvasRenderingContext2DSettings;
68
+ }
69
+ interface AnimationCanvasInstance {
70
+ /**
71
+ * Replace the given options. Lets a wrapper feed a fresh `draw` in on every
72
+ * render without restarting the animation, so the frame count and the
73
+ * elapsed time keep running.
74
+ *
75
+ * `relativeSize` and `contextAttributes` are fixed for the lifetime of the
76
+ * instance and are ignored here.
77
+ *
78
+ * While `animate` is off this also draws a frame, since nothing else would.
79
+ */
80
+ update: (options: Partial<AnimationCanvasOptions>) => void;
81
+ /** Draw one frame now, whether or not `animate` is on. */
82
+ redraw: () => void;
83
+ destroy: () => void;
84
+ }
85
+ /**
86
+ * Drive a canvas from `requestAnimationFrame`, keeping its backing store in
87
+ * step with the device pixel ratio and, optionally, with the size of its
88
+ * parent.
89
+ *
90
+ * Drawing code works in CSS pixels: the context is scaled by the device pixel
91
+ * ratio, and `width` / `height` of each {@link AnimationFrame} are CSS pixels.
92
+ */
93
+ declare function createAnimationCanvas(canvas: HTMLCanvasElement, options: AnimationCanvasOptions): AnimationCanvasInstance;
94
+ //#endregion
95
+ //#region src/canvas/context.d.ts
96
+ /**
97
+ * The properties of a 2D context that survive `save()` / `restore()`, and so
98
+ * are what has to be carried across a resize by hand: setting `canvas.width`
99
+ * resets the context to its defaults.
100
+ *
101
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/save
102
+ */
103
+ declare const drawingState: readonly ["strokeStyle", "fillStyle", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "lineDashOffset", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "globalCompositeOperation", "font", "textAlign", "textBaseline", "direction", "imageSmoothingEnabled"];
104
+ type DrawingState = (typeof drawingState)[number];
105
+ type DrawingStateValue = CanvasRenderingContext2D[DrawingState];
106
+ type DrawingContext = Pick<CanvasRenderingContext2D, DrawingState>;
107
+ declare function isDrawingState(value: unknown): value is DrawingState;
108
+ //#endregion
1
109
  //#region src/midi/access.d.ts
2
110
  /** @private */
3
111
  declare const PERMISSION_DENIED = "PERMISSION_DENIED";
@@ -55,6 +163,75 @@ declare function createMIDIInput(midiAccess: MIDIAccess | null, {
55
163
  onPitchBendEvent
56
164
  }: MIDIInputHandlers): MIDIInputInstance;
57
165
  //#endregion
166
+ //#region src/piano/input.d.ts
167
+ /**
168
+ * What asked for a note to sound.
169
+ *
170
+ * A note stops only once everything that asked for it has let go, so two
171
+ * fingers on one key, or a key held by both the mouse and a MIDI keyboard,
172
+ * behave the way they look.
173
+ *
174
+ * Pointers use `pointer:<pointerId>`; everything else names its own source.
175
+ */
176
+ type NoteSource = string;
177
+ interface PianoInputOptions {
178
+ /** Geometry of the drawn keyboard, used to find the note under a pointer. */
179
+ layout: PianoLayout;
180
+ /**
181
+ * Let a pointer slide from one key to the next while it is down. With it off,
182
+ * the key that was pressed keeps sounding until the pointer is released.
183
+ *
184
+ * @default true
185
+ */
186
+ glissando?: boolean;
187
+ /**
188
+ * Highest note that can sound. Above it a note is refused, whichever source
189
+ * asks for it.
190
+ *
191
+ * @default 127
192
+ */
193
+ midiMax?: number;
194
+ /** Called when a note starts sounding, not for each source that asks. */
195
+ onPlayNote?: (note: number, velocity?: number) => void;
196
+ /** Called once the last source holding a note has let go. */
197
+ onStopNote?: (note: number) => void;
198
+ /** Called whenever {@link PianoInputInstance.activeNotes} would change. */
199
+ onActiveNotesChange?: (notes: number[]) => void;
200
+ }
201
+ interface PianoInputInstance {
202
+ /**
203
+ * Replace the given options. Lets a wrapper feed a fresh layout in without
204
+ * tearing down the listeners, which would abort a drag in progress.
205
+ */
206
+ update: (options: Partial<PianoInputOptions>) => void;
207
+ /**
208
+ * Start a note from something other than a pointer: a keyboard shortcut, a
209
+ * MIDI message, an imperative call.
210
+ */
211
+ noteOn: (note: number, options?: {
212
+ source?: NoteSource;
213
+ velocity?: number;
214
+ }) => void;
215
+ /** Release a note held by `source`. */
216
+ noteOff: (note: number, options?: {
217
+ source?: NoteSource;
218
+ }) => void;
219
+ /** The notes currently sounding, ascending. */
220
+ activeNotes: () => number[];
221
+ destroy: () => void;
222
+ }
223
+ /**
224
+ * Drive a piano keyboard with pointers, and own what is sounding.
225
+ *
226
+ * Every way of playing a note goes through the one instance — pointers here,
227
+ * keyboard shortcuts and MIDI through {@link PianoInputInstance.noteOn} — so
228
+ * there is a single answer to what is currently held, and drawing the keys is
229
+ * left entirely to the wrapper.
230
+ *
231
+ * Tracks every pointer at once, so a chord can be played with several fingers.
232
+ */
233
+ declare function createPianoInput(element: Element, options: PianoInputOptions): PianoInputInstance;
234
+ //#endregion
58
235
  //#region src/pointer/drag.d.ts
59
236
  type DragState = {
60
237
  /** Total movement from the drag start, in screen coordinates. */x: number;
@@ -63,28 +240,57 @@ type DragState = {
63
240
  deltaY: number; /** Pointer position in viewport coordinates. */
64
241
  clientX: number;
65
242
  clientY: number;
243
+ /**
244
+ * Which pointer this is. Always the same value for one drag; with
245
+ * {@link DragOptions.multiPointer} it tells concurrent drags apart.
246
+ */
247
+ pointerId: number;
66
248
  event: PointerEvent;
67
249
  };
68
250
  type DragOptions = {
69
251
  /**
70
- * Minimum movement in pixels before `onDrag` fires.
252
+ * Minimum movement in pixels before `onDrag` fires. Movement below it is
253
+ * carried over to the next event rather than discarded, so a slow drag still
254
+ * reports once it adds up.
255
+ *
71
256
  * Prevents `onDrag` from firing on, for example, a double click.
72
- * Values below 1 are clamped to 1.
73
257
  *
74
- * @default 1
258
+ * @default 0
75
259
  */
76
260
  threshold?: number;
77
261
  /**
78
262
  * CSS cursor to show while dragging. Applied to the element itself: pointer
79
263
  * capture keeps it in effect even once the pointer leaves the element, so
80
264
  * there is no need to touch the document.
265
+ *
266
+ * With {@link DragOptions.multiPointer} it is set for the first pointer and
267
+ * restored once the last one is up.
81
268
  */
82
269
  cursor?: string;
270
+ /**
271
+ * Track every pointer that goes down on the element, rather than only the
272
+ * first. Each one gets its own `onDragStart` / `onDrag` / `onDragEnd` and
273
+ * carries its own totals; {@link DragState.pointerId} says which is which.
274
+ *
275
+ * Fixed for the lifetime of the instance: switching part way through a drag
276
+ * has no meaning, so `update()` ignores it.
277
+ *
278
+ * @default false
279
+ */
280
+ multiPointer?: boolean;
83
281
  onDragStart?: (state: DragState) => void;
84
282
  onDrag?: (state: DragState) => void;
85
283
  onDragEnd?: (state: DragState) => void;
86
284
  };
87
285
  interface DragInstance {
286
+ /**
287
+ * Replace the given options. Lets a wrapper feed fresh handlers in without
288
+ * tearing down the listeners, which would abort a drag in progress.
289
+ *
290
+ * `multiPointer` is fixed for the lifetime of the instance and is ignored
291
+ * here.
292
+ */
293
+ update: (options: DragOptions) => void;
88
294
  destroy: () => void;
89
295
  }
90
296
  /**
@@ -95,17 +301,165 @@ interface DragInstance {
95
301
  * element gets `touch-action: none` so that touch dragging does not scroll the
96
302
  * page, plus `user-select: none` so that a long press does not start a text
97
303
  * selection instead.
304
+ *
305
+ * One pointer at a time by default; see {@link DragOptions.multiPointer}.
306
+ */
307
+ declare function createDrag(element: Element, options?: DragOptions): DragInstance;
308
+ //#endregion
309
+ //#region src/xy.d.ts
310
+ /**
311
+ * A pair of per-axis values. The tuple elements are labelled, so editors show
312
+ * `[x: number, y: number]` rather than a bare pair.
98
313
  */
99
- declare function createDrag(element: Element, {
100
- threshold: _threshold,
101
- cursor,
102
- onDragStart,
103
- onDrag,
104
- onDragEnd
105
- }?: DragOptions): DragInstance;
314
+ type XY<T> = [x: T, y: T];
315
+ /**
316
+ * A setting that may be given once for both axes, or per axis.
317
+ *
318
+ * A single value is told from a pair with `Array.isArray`, so the single form
319
+ * is only offered while `T` cannot itself be an array. Where it can, the pair
320
+ * is the only way to write it, since a lone array would be read as a pair.
321
+ */
322
+ type XYInput<T> = [T] extends [readonly unknown[]] ? readonly [x: T, y: T] : T | readonly [x: T, y: T];
323
+ /**
324
+ * Spread a setting that may have been given as a single value.
325
+ *
326
+ * The parameter is written out rather than taken as `XYInput<T>`: a
327
+ * conditional type cannot be narrowed, so the constraint stays where it is
328
+ * declared and this takes both forms.
329
+ *
330
+ * The pair is copied rather than passed along, so that the result is a tuple
331
+ * the caller owns even when a readonly one was given.
332
+ */
333
+ declare function toXY<T>(value: T | readonly [x: T, y: T]): XY<T>;
334
+ //#endregion
335
+ //#region src/pointer/dragValue.d.ts
336
+ /**
337
+ * How the 0-1 travel of one axis maps onto a value.
338
+ *
339
+ * Extends `ValueRange` so that a drag and an `applyDelta` nudge from a wheel
340
+ * or an arrow key share one description of the scaling.
341
+ */
342
+ interface AxisOptions extends ValueRange {
343
+ /**
344
+ * Flip the axis so that its far end is `min`.
345
+ *
346
+ * Positions follow the screen: x grows to the right, y downwards. A vertical
347
+ * slider whose maximum is at the top therefore reverses its y axis.
348
+ *
349
+ * @default false
350
+ */
351
+ reverse?: boolean;
352
+ }
353
+ /** Where the value of each axis currently sits, as a position (see {@link DragValueMapping}). */
354
+ interface MappingContext {
355
+ position: () => XY<number>;
356
+ }
357
+ /**
358
+ * Turns pointer movement into a position on each axis: 0 is the `min` end of
359
+ * the travel and 1 the `max` end, before `reverse` and the scaling of
360
+ * {@link AxisOptions} are applied.
361
+ *
362
+ * A mapping holds the state of the drag in progress, so an instance belongs to
363
+ * a single {@link createDragValue} instance.
364
+ */
365
+ interface DragValueMapping {
366
+ /**
367
+ * @returns the position, or null when it cannot be determined and the event
368
+ * should be ignored.
369
+ */
370
+ start: (state: DragState, context: MappingContext) => XY<number> | null;
371
+ move: (state: DragState, context: MappingContext) => XY<number> | null;
372
+ }
373
+ /**
374
+ * Map the pointer onto the bounding rect of an element: the value *is* the
375
+ * position pointed at, so the middle of the element is 0.5.
376
+ *
377
+ * The element is read on every event, so it may be mounted after the drag is
378
+ * set up and may change size while a drag is in progress.
379
+ */
380
+ declare function elementMapping(getElement: () => Element | null | undefined): DragValueMapping;
381
+ /**
382
+ * Move the value away from where it stood when the drag started, by the
383
+ * distance dragged. The pointer position itself carries no meaning, so the
384
+ * value can be adjusted from anywhere on the screen.
385
+ */
386
+ declare function relativeMapping({
387
+ pixelRange
388
+ }?: {
389
+ /**
390
+ * Pixels of movement that span the whole range.
391
+ * @default 100
392
+ */
393
+ pixelRange?: XYInput<number>;
394
+ }): DragValueMapping;
395
+ interface DragValueOptions {
396
+ /** Scaling of each axis; a single value applies to both. */
397
+ axis: XYInput<AxisOptions>;
398
+ /** How pointer movement becomes a position. */
399
+ mapping: DragValueMapping;
400
+ /**
401
+ * The current value of each axis. Read when a drag starts, by mappings that
402
+ * move the value relative to it, such as {@link relativeMapping}.
403
+ */
404
+ getValue?: () => XY<number>;
405
+ /**
406
+ * Report the value on pointer down, before any movement.
407
+ *
408
+ * Enable it where the pointer position *is* the value, so that a plain click
409
+ * jumps to it. Leave it off where the element being dragged is an object in
410
+ * its own right, so that grabbing its edge does not shift it under the
411
+ * pointer.
412
+ *
413
+ * @default false
414
+ */
415
+ updateOnPointerDown?: boolean;
416
+ /** @see DragOptions.threshold */
417
+ threshold?: number;
418
+ /** @see DragOptions.cursor */
419
+ cursor?: string;
420
+ onChange?: (value: XY<number>, state: DragState) => void;
421
+ onDragStart?: (value: XY<number>, state: DragState) => void;
422
+ onDragEnd?: (value: XY<number>, state: DragState) => void;
423
+ }
424
+ interface DragValueInstance {
425
+ /**
426
+ * Replace the given options. Lets a wrapper feed fresh values in without
427
+ * tearing down the listeners, which would abort a drag in progress.
428
+ *
429
+ * `mapping` is fixed for the lifetime of the instance and is ignored here.
430
+ */
431
+ update: (options: Partial<DragValueOptions>) => void;
432
+ destroy: () => void;
433
+ }
434
+ /**
435
+ * Drive a value with a pointer drag.
436
+ *
437
+ * Combines {@link createDrag} with the scaling of `@tremolo-ui/functions`: the
438
+ * mapping decides where the pointer sits on the 0-1 travel of each axis, and
439
+ * the axis options turn that into a value.
440
+ */
441
+ declare function createDragValue(element: Element, options: DragValueOptions): DragValueInstance;
106
442
  //#endregion
107
443
  //#region src/pointer/wheel.d.ts
444
+ interface WheelOptions {
445
+ /**
446
+ * Only report events while the focus is inside the element.
447
+ *
448
+ * A control that reacts to the wheel on hover alone takes the scroll away
449
+ * from the page, so passing over one in a long form silently changes its
450
+ * value. Requiring focus makes that an explicit act.
451
+ *
452
+ * The check is `contains`, not an identity test: the element that actually
453
+ * takes focus is usually a descendant, such as a thumb or an `<input>`, and
454
+ * a caller may have replaced it with markup of their own.
455
+ *
456
+ * @default false
457
+ */
458
+ requireFocus?: boolean;
459
+ }
108
460
  interface WheelInstance {
461
+ /** Replace the given options, keeping the listener in place. */
462
+ update: (options: WheelOptions) => void;
109
463
  destroy: () => void;
110
464
  }
111
465
  /**
@@ -114,7 +468,7 @@ interface WheelInstance {
114
468
  * The listener is registered with `passive: false` so that the handler can call
115
469
  * `preventDefault()` to stop the page from scrolling.
116
470
  */
117
- declare function createWheel(element: Element, onWheel: (event: WheelEvent) => void): WheelInstance;
471
+ declare function createWheel(element: Element, onWheel: (event: WheelEvent) => void, options?: WheelOptions): WheelInstance;
118
472
  //#endregion
119
- export { type DragInstance, type DragOptions, type DragState, type MIDIAccessError, type MIDIAccessInstance, type MIDIAccessState, type MIDIInputHandlers, type MIDIInputInstance, type MIDIMessageInstance, NOT_SUPPORTED, PERMISSION_DENIED, type WheelInstance, createDrag, createMIDIAccess, createMIDIInput, createMIDIMessage, createWheel };
473
+ export { type AnimationCanvasInstance, type AnimationCanvasOptions, type AnimationFrame, type AxisOptions, type CanvasDrawFunction, type CanvasInitFunction, type DragInstance, type DragOptions, type DragState, type DragValueInstance, type DragValueMapping, type DragValueOptions, type DrawingContext, type DrawingState, type DrawingStateValue, type MIDIAccessError, type MIDIAccessInstance, type MIDIAccessState, type MIDIInputHandlers, type MIDIInputInstance, type MIDIMessageInstance, type MappingContext, NOT_SUPPORTED, type NoteSource, PERMISSION_DENIED, type PianoInputInstance, type PianoInputOptions, type WheelInstance, type WheelOptions, type XY, type XYInput, createAnimationCanvas, createDrag, createDragValue, createMIDIAccess, createMIDIInput, createMIDIMessage, createPianoInput, createWheel, drawingState, elementMapping, isDrawingState, relativeMapping, toXY };
120
474
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/midi/access.ts","../src/midi/message.ts","../src/midi/input.ts","../src/pointer/drag.ts","../src/pointer/wheel.ts"],"mappings":";;cACa,iBAAA;;cAEA,aAAA;;KAGD,eAAA,UAAyB,iBAAA,UAA2B,aAAA;AAAA,KAEpD,eAAA;EAAA,SACD,UAAA,EAAY,UAAA;EAAA,SACZ,KAAA,EAAO,eAAA;AAAA;AAAA,UAQD,kBAAA;EAZL;EAcV,OAAA;EACA,QAAA,QAAgB,eAAA;EAfmB;EAiBnC,cAAA,QAAsB,eAAA;EAfZ;EAiBV,SAAA,GAAY,QAAA;EACZ,OAAA;AAAA;;;;;;;iBASc,gBAAA,CAAA,GAAoB,kBAAA;;;UCnCnB,mBAAA;EACf,OAAA;AAAA;;;;ADEF;;iBCMgB,iBAAA,CACd,UAAA,EAAY,UAAA,SACZ,aAAA,GAAgB,KAAA,EAAO,gBAAA,YACtB,mBAAA;;;KCJS,iBAAA;EACV,aAAA,IAAiB,IAAA,UAAc,QAAA;EAC/B,cAAA,IAAkB,IAAA;EAClB,gBAAA,IAAoB,GAAA,UAAa,GAAA;AAAA;AAAA,KAGvB,iBAAA,GAAoB,mBAAA;;;;;iBAMhB,eAAA,CACd,UAAA,EAAY,UAAA;EACV,aAAA;EAAe,cAAA;EAAgB;AAAA,GAAoB,iBAAA,GACpD,iBAAA;;;KCvBS,SAAA;EHCC,iEGCX,CAAA;EACA,CAAA,UHF4B;EGI5B,MAAA;EACA,MAAA,UHHwB;EGKxB,OAAA;EACA,OAAA;EACA,KAAA,EAAO,YAAA;AAAA;AAAA,KAGG,WAAA;;;;AHLZ;;;;EGaE,SAAA;EHZqB;;;;;EGmBrB,MAAA;EAEA,WAAA,IAAe,KAAA,EAAO,SAAA;EACtB,MAAA,IAAU,KAAA,EAAO,SAAA;EACjB,SAAA,IAAa,KAAA,EAAO,SAAA;AAAA;AAAA,UAGL,YAAA;EACf,OAAA;AAAA;;;;;;;AHDF;;;iBGiCgB,UAAA,CACd,OAAA,EAAS,OAAA;EAEP,SAAA,EAAW,UAAA;EACX,MAAA;EACA,WAAA;EACA,MAAA;EACA;AAAA,IACC,WAAA,GACF,YAAA;;;UC7Ec,aAAA;EACf,OAAA;AAAA;;;;AJEF;;;iBIOgB,WAAA,CACd,OAAA,EAAS,OAAA,EACT,OAAA,GAAU,KAAA,EAAO,UAAA,YAChB,aAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/canvas/animation.ts","../src/canvas/context.ts","../src/midi/access.ts","../src/midi/message.ts","../src/midi/input.ts","../src/piano/input.ts","../src/pointer/drag.ts","../src/xy.ts","../src/pointer/dragValue.ts","../src/pointer/wheel.ts"],"mappings":";;;;UAQiB,cAAA;;EAEf,KAAA;EAF6B;EAI7B,MAAA;EAJ6B;EAM7B,KAAA;EAFA;EAIA,SAAA;EAAA;EAEA,WAAA;EAEA;EAAA,GAAA;AAAA;AAAA,KAGU,kBAAA,IACV,OAAA,EAAS,wBAAA,EACT,KAAA,EAAO,cAAA;AAAA,KAGG,kBAAA,IACV,OAAA,EAAS,wBAAA,EACT,IAAA;EAAQ,KAAA;EAAe,MAAA;AAAA;AAAA,UAGR,sBAAA;EARR;EAUP,IAAA,EAAM,kBAAA;EAVe;EAarB,IAAA,GAAO,kBAAA;EAVG;;;;;;EAkBV,OAAA;EAhBuB;;;;AAGzB;EAoBE,IAAA;IAAS,KAAA;IAAe,MAAA;EAAA;EA0BJ;;;;;;;;EAhBpB,YAAA;EAVS;;;;;;EAkBT,gBAAA;EAQoD;AAGtD;;;;;EAHE,iBAAA,GAAoB,gCAAA;AAAA;AAAA,UAGL,uBAA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