@typeonce/ritmo-browser 0.9.0 → 0.11.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 (58) hide show
  1. package/CHANGELOG.md +285 -0
  2. package/README.md +6 -3
  3. package/dist/Controls.d.ts +495 -0
  4. package/dist/Controls.d.ts.map +1 -0
  5. package/dist/Controls.js +343 -0
  6. package/dist/Controls.js.map +1 -0
  7. package/dist/Gamepad.d.ts +375 -0
  8. package/dist/Gamepad.d.ts.map +1 -0
  9. package/dist/Gamepad.js +452 -0
  10. package/dist/Gamepad.js.map +1 -0
  11. package/dist/InputCapture.d.ts +47 -14
  12. package/dist/InputCapture.d.ts.map +1 -1
  13. package/dist/InputCapture.js +1 -1
  14. package/dist/InputCapture.js.map +1 -1
  15. package/dist/Keyboard.d.ts +184 -21
  16. package/dist/Keyboard.d.ts.map +1 -1
  17. package/dist/Keyboard.js +257 -91
  18. package/dist/Keyboard.js.map +1 -1
  19. package/dist/Pointer.d.ts +231 -62
  20. package/dist/Pointer.d.ts.map +1 -1
  21. package/dist/Pointer.js +205 -145
  22. package/dist/Pointer.js.map +1 -1
  23. package/dist/Touch.d.ts +73 -27
  24. package/dist/Touch.d.ts.map +1 -1
  25. package/dist/Touch.js +25 -30
  26. package/dist/Touch.js.map +1 -1
  27. package/dist/index.d.ts +10 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +10 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/internal/buttons.d.ts +52 -0
  32. package/dist/internal/buttons.d.ts.map +1 -0
  33. package/dist/internal/buttons.js +211 -0
  34. package/dist/internal/buttons.js.map +1 -0
  35. package/dist/internal/introspect.d.ts +14 -0
  36. package/dist/internal/introspect.d.ts.map +1 -0
  37. package/dist/internal/introspect.js +19 -0
  38. package/dist/internal/introspect.js.map +1 -0
  39. package/dist/internal/used.d.ts +8 -0
  40. package/dist/internal/used.d.ts.map +1 -0
  41. package/dist/internal/used.js +14 -0
  42. package/dist/internal/used.js.map +1 -0
  43. package/dist/internal/vectors.d.ts +24 -0
  44. package/dist/internal/vectors.d.ts.map +1 -0
  45. package/dist/internal/vectors.js +22 -0
  46. package/dist/internal/vectors.js.map +1 -0
  47. package/package.json +5 -3
  48. package/src/Controls.ts +799 -0
  49. package/src/Gamepad.ts +747 -0
  50. package/src/InputCapture.ts +44 -22
  51. package/src/Keyboard.ts +395 -68
  52. package/src/Pointer.ts +392 -164
  53. package/src/Touch.ts +111 -54
  54. package/src/index.ts +10 -1
  55. package/src/internal/buttons.ts +222 -0
  56. package/src/internal/introspect.ts +23 -0
  57. package/src/internal/used.ts +14 -0
  58. package/src/internal/vectors.ts +36 -0
package/dist/Pointer.d.ts CHANGED
@@ -1,68 +1,174 @@
1
1
  /**
2
- * Mouse and pen input over one element: position and button edges. Touches
3
- * are ignored by default; on-screen touch controls are `Touch`.
2
+ * Mouse and pen input over one element: bound actions, raw buttons, and the
3
+ * position. Touches are ignored by default; on-screen touch controls are
4
+ * `Touch`.
4
5
  *
5
- * Games that aim with the mouse read one snapshot per update, like keyboard
6
- * actions. The module owns the browser plumbing: element-relative
7
- * coordinates, press/release edges that survive clicks shorter than one
8
- * frame, pointer capture so a release outside the element is still seen,
9
- * suppressing the context menu, clearing buttons on window blur, and listener
10
- * cleanup. It does not know about the ECS; `InputCapture.system(...)` copies
11
- * snapshots from a service into a resource, directly or through an adapter
12
- * that merges pointer and keyboard snapshots.
6
+ * `Pointer.actions(target, window, bindings)` binds game actions to
7
+ * buttons, like `Keyboard.actions` and `Gamepad.actions`, so the pointer
8
+ * merges into `Controls` (group it with the keyboard there, so the two count
9
+ * as one device for `lastUsed` and `available`). Games that aim with the
10
+ * mouse read `position`. The module owns the browser plumbing:
11
+ * element-relative coordinates, press/release edges that survive clicks
12
+ * shorter than one frame, pointer capture so a release outside the element
13
+ * is still seen, suppressing the context menu, clearing buttons on window
14
+ * blur, and listener cleanup. It does not know about the ECS;
15
+ * `InputCapture.system(...)` copies snapshots into a resource.
13
16
  *
14
17
  * Positions are in CSS pixels relative to the element's top-left corner.
15
18
  * Converting them into world coordinates (camera, zoom, projection) is game
16
- * code.
19
+ * code. `rebind(...)` swaps the buttons of the same actions, and
20
+ * `parseRebinding(...)` validates saved ones.
21
+ *
22
+ * The wheel reports both ways games use it: `wheel` is how far it scrolled
23
+ * (zoom), and the `wheelUp`/`wheelDown`/`wheelLeft`/`wheelRight` buttons
24
+ * pulse once per notch, so a stepping action (next weapon) binds them and
25
+ * merges with a gamepad bumper. For mouse look, pass `lock: document`: a
26
+ * click locks the pointer to the element, `movement` keeps reporting raw
27
+ * motion, and `locked` turns `false` when the player presses Escape.
17
28
  *
18
29
  * @module Pointer
19
30
  * @docGroup browser
20
31
  *
21
32
  * @example
22
33
  * ```ts
23
- * const pointer = Pointer.track(canvas, window)
34
+ * const bindings = { fire: ["primary"], aim: ["secondary"], nextWeapon: ["wheelDown"] } as const
35
+ * const mouse = Pointer.actions(canvas, window, bindings, { lock: document })
36
+ *
37
+ * // Once per update (through InputCapture in a game):
38
+ * const input = mouse.snapshot()
39
+ * aimAt(input.position)
40
+ * if (input.actions.fire.pressed) fire()
41
+ *
42
+ * // Zoom with the wheel, look with a locked pointer:
43
+ * zoomBy(input.wheel.y)
44
+ * if (input.locked) turn(input.movement.x)
24
45
  *
25
- * // Once per update:
26
- * const snapshot = pointer.snapshot()
27
- * aimAt(snapshot.position)
28
- * if (snapshot.primary.held) fire()
46
+ * // Settings screen: bind the button the player clicks.
47
+ * const clicked = Pointer.buttonNames.find((button) => input.buttons[button].pressed)
48
+ * if (clicked !== undefined) mouse.rebind({ fire: [clicked], aim: ["secondary"], nextWeapon: ["wheelDown"] })
29
49
  *
30
50
  * // On teardown:
31
- * pointer.dispose()
51
+ * mouse.dispose()
32
52
  * ```
33
53
  *
34
- * For tests, replays, and headless runs, `scripted(...)` plays a timeline of
35
- * moves, presses, and releases, and `recording(...)` wraps a live pointer to
36
- * capture the timeline a session produced. `parseTimeline(...)` validates a
37
- * timeline loaded from JSON.
54
+ * For tests, replays, and headless runs, `scripted(bindings, timeline)`
55
+ * plays a timeline of moves, presses, and releases, and `recording(...)`
56
+ * wraps a live pointer to capture the timeline a session produced.
57
+ * `parseTimeline(...)` validates a timeline loaded from JSON.
38
58
  */
59
+ import type * as System from "@typeonce/ritmo/System";
39
60
  import * as Result from "@typeonce/ritmo/Result";
40
61
  import type { ActionState } from "./Keyboard.ts";
62
+ import * as ButtonsInternal from "./internal/buttons.ts";
41
63
  export type { ActionState };
42
- /** The buttons a snapshot reports, from `PointerEvent.button` 0, 2, and 1. */
43
- export type Button = "primary" | "secondary" | "middle";
64
+ /** The physical buttons, in `PointerEvent.button` order 0 to 4. */
65
+ declare const physicalButtons: readonly ["primary", "middle", "secondary", "back", "forward"];
66
+ /** A button that goes down and up, unlike the wheel's pulses: what a timeline presses and releases. */
67
+ export type PhysicalButton = (typeof physicalButtons)[number];
68
+ /**
69
+ * The buttons a snapshot reports: the main (usually left) button, the wheel
70
+ * button, the secondary (usually right) button, the side buttons, then the
71
+ * wheel's four directions. A wheel direction is a pulse, pressed and
72
+ * released in the same window, once per {@link wheelStep} pixels scrolled,
73
+ * so it binds actions that step (next weapon) and merges with a gamepad
74
+ * bumper in `Controls`; read the snapshot's `wheel` for how far it scrolled
75
+ * (zoom).
76
+ */
77
+ export declare const buttonNames: readonly ["primary", "middle", "secondary", "back", "forward", "wheelUp", "wheelDown", "wheelLeft", "wheelRight"];
78
+ /** One pointer button, see {@link buttonNames}. */
79
+ export type Button = (typeof buttonNames)[number];
80
+ /** Pixels scrolled per wheel pulse: one notch of a typical mouse wheel. */
81
+ export declare const wheelStep = 100;
82
+ /** Whether `name` is a pointer button, for validating stored bindings. */
83
+ export declare const isButton: (name: unknown) => name is Button;
84
+ /**
85
+ * Action name to the buttons that trigger it. Every action needs at least
86
+ * one button; `{}` tracks the position and raw buttons only.
87
+ */
88
+ export type Bindings = Readonly<Record<string, readonly [Button, ...Array<Button>]>>;
89
+ /**
90
+ * New buttons for the same actions, for {@link Actions.rebind}. Load saved
91
+ * ones with {@link parseRebinding}.
92
+ */
93
+ export type Rebinding<B extends Bindings> = {
94
+ readonly [Action in keyof B]: readonly [Button, ...Array<Button>];
95
+ };
96
+ /**
97
+ * Rejects actions a rebinding names that the bindings do not have, so
98
+ * {@link Actions.rebind} takes exactly the actions it was made with.
99
+ */
100
+ export type OnlyActionsOf<R, B extends Bindings> = {
101
+ readonly [Name in Exclude<keyof R, keyof B>]: `${Name & string} is not an action of these bindings`;
102
+ };
44
103
  /** A position in CSS pixels relative to the element's top-left corner. */
45
104
  export interface Position {
46
105
  readonly x: number;
47
106
  readonly y: number;
48
107
  }
49
- export interface Snapshot {
108
+ /** A change in CSS pixels since the previous snapshot. */
109
+ export interface Delta {
110
+ readonly x: number;
111
+ readonly y: number;
112
+ }
113
+ /**
114
+ * The pointer's state, with the same core as the other devices' snapshots
115
+ * (`actions`, `vectors`, and `used`) so `Controls` can merge it.
116
+ */
117
+ export interface Snapshot<B extends Bindings> {
118
+ /** Every bound action's state. */
119
+ readonly actions: {
120
+ readonly [Action in keyof B]: ActionState;
121
+ };
122
+ /** None: a pointer binds no vector actions (read `position` and `movement`); there for the snapshot core every device shares. */
123
+ readonly vectors: {
124
+ readonly [Action in never]: Delta;
125
+ };
126
+ /** Every button's state by name, whatever the bindings (capture the button to bind from here). */
127
+ readonly buttons: {
128
+ readonly [Name in Button]: ActionState;
129
+ };
50
130
  /** The last position the pointer was seen at, or where it was last left. */
51
131
  readonly position: Position;
132
+ /**
133
+ * How far the pointer moved since the previous snapshot, from the raw
134
+ * motion (`movementX`/`movementY`), which keeps coming while the pointer is
135
+ * locked and the position stands still: read it for mouse look.
136
+ */
137
+ readonly movement: Delta;
138
+ /** How far the wheel scrolled since the previous snapshot, in CSS pixels (positive `y` scrolls down). */
139
+ readonly wheel: Delta;
52
140
  /** Whether the pointer is currently over the element (or captured by it). */
53
141
  readonly over: boolean;
54
- readonly primary: ActionState;
55
- readonly secondary: ActionState;
56
- readonly middle: ActionState;
57
- }
58
- export interface Pointer {
59
142
  /**
60
- * Returns the pointer state and starts a new press/release window.
143
+ * Whether the pointer is locked to the element (with the `lock` option).
144
+ * The player leaves the lock with Escape; show "click to resume" while it
145
+ * is `false`.
146
+ */
147
+ readonly locked: boolean;
148
+ /**
149
+ * Some button was pressed in this window or is held, or the pointer moved
150
+ * or scrolled over the element: the player is using the pointer.
61
151
  */
62
- snapshot(): Snapshot;
152
+ readonly used: boolean;
153
+ }
154
+ /**
155
+ * A pointer bound to actions, built with {@link actions} (live),
156
+ * {@link scripted}, or {@link recording}. Capture it with
157
+ * `InputCapture.system(...)`, or group it with the keyboard in `Controls`.
158
+ */
159
+ export interface Actions<B extends Bindings> extends System.Consumes<"snapshot"> {
160
+ /** Returns the pointer state and starts a new press/release window. */
161
+ snapshot(): Snapshot<B>;
63
162
  /**
64
- * Removes the event listeners.
163
+ * Binds the same actions to new buttons, from the next snapshot, for a
164
+ * settings screen where players remap controls (capture the button to bind
165
+ * from the snapshot's `buttons`). An action held only through buttons it
166
+ * lost reports `released`; a button held across the rebind holds a newly
167
+ * bound action only once it is pressed again. It takes exactly the actions
168
+ * the pointer was made with.
65
169
  */
170
+ rebind<const R extends Rebinding<B>>(bindings: R & OnlyActionsOf<R, B>): void;
171
+ /** Removes the event listeners. */
66
172
  dispose(): void;
67
173
  }
68
174
  /**
@@ -71,6 +177,9 @@ export interface Pointer {
71
177
  export interface PointerEventLike {
72
178
  readonly clientX: number;
73
179
  readonly clientY: number;
180
+ /** Raw motion since the previous event; events without it count as 0. */
181
+ readonly movementX?: number;
182
+ readonly movementY?: number;
74
183
  readonly button: number;
75
184
  readonly pointerId: number;
76
185
  /** `"mouse"`, `"pen"`, or `"touch"`; events without it count as mouse. */
@@ -89,12 +198,35 @@ export interface PointerTarget {
89
198
  removeEventListener(type: "contextmenu", listener: (event: {
90
199
  preventDefault(): void;
91
200
  }) => void): void;
201
+ addEventListener(type: "wheel", listener: (event: WheelEventLike) => void, options: {
202
+ readonly passive: false;
203
+ }): void;
204
+ removeEventListener(type: "wheel", listener: (event: WheelEventLike) => void): void;
92
205
  getBoundingClientRect(): {
93
206
  readonly left: number;
94
207
  readonly top: number;
95
208
  };
96
209
  setPointerCapture?(pointerId: number): void;
97
210
  releasePointerCapture?(pointerId: number): void;
211
+ /** Called on a click with the `lock` option while the pointer is not locked. */
212
+ requestPointerLock?(): unknown;
213
+ }
214
+ /** The subset of `WheelEvent` the module reads. */
215
+ export interface WheelEventLike {
216
+ readonly deltaX: number;
217
+ readonly deltaY: number;
218
+ /** 0 for pixels, 1 for lines (16 px each), 2 for pages (800 px each). */
219
+ readonly deltaMode: number;
220
+ preventDefault(): void;
221
+ }
222
+ /**
223
+ * Where the pointer lock is observed, usually `document`, for the `lock`
224
+ * option.
225
+ */
226
+ export interface LockHost {
227
+ readonly pointerLockElement: unknown;
228
+ addEventListener(type: "pointerlockchange", listener: () => void): void;
229
+ removeEventListener(type: "pointerlockchange", listener: () => void): void;
98
230
  }
99
231
  /**
100
232
  * Where window blur is observed, usually `window`. Buttons held when the
@@ -104,7 +236,8 @@ export interface BlurHost {
104
236
  addEventListener(type: "blur", listener: () => void): void;
105
237
  removeEventListener(type: "blur", listener: () => void): void;
106
238
  }
107
- export interface TrackOptions {
239
+ /** Options for {@link actions}. */
240
+ export interface ActionsOptions {
108
241
  /**
109
242
  * Suppress the context menu over the element, so the secondary button is
110
243
  * usable. Defaults to `true`.
@@ -116,59 +249,76 @@ export interface TrackOptions {
116
249
  * also a click.
117
250
  */
118
251
  readonly pointerTypes?: ReadonlyArray<string>;
252
+ /**
253
+ * Keep the page from scrolling while the wheel turns over the element.
254
+ * Defaults to `true`.
255
+ */
256
+ readonly preventScroll?: boolean;
257
+ /**
258
+ * Lock the pointer to the element on a click, for mouse look: pass where
259
+ * the lock is observed (usually `document`). Browsers grant a lock only
260
+ * inside a click, so the module requests it in its own listener; the
261
+ * click that locks is not reported as a press. Read `locked` and
262
+ * `movement`.
263
+ */
264
+ readonly lock?: LockHost;
119
265
  }
120
266
  /**
121
- * A snapshot with no buttons down, for initializing an input resource before
122
- * the first capture.
267
+ * A snapshot with no buttons down and no use yet, for initializing an input
268
+ * resource before the first capture.
123
269
  */
124
- export declare const idle: (position?: Position) => Snapshot;
270
+ export declare const idle: <const B extends Bindings>(bindings: B, position?: Position) => Snapshot<B>;
125
271
  /**
126
- * Starts tracking the pointer over `target`. `blurHost` (usually `window`)
127
- * releases held buttons when the page loses focus.
272
+ * Starts tracking the pointer over `target` with `bindings`, until
273
+ * `dispose()`. `blurHost` (usually `window`) releases held buttons when the
274
+ * page loses focus; a cancelled pointer and leaving the pointer lock release
275
+ * them too. Use `Touch.actions` for on-screen touch controls.
128
276
  */
129
- export declare const track: (target: PointerTarget, blurHost: BlurHost, options?: TrackOptions) => Pointer;
277
+ export declare const actions: <const B extends Bindings>(target: PointerTarget, blurHost: BlurHost, bindings: B, options?: ActionsOptions) => Actions<B>;
130
278
  /**
131
- * Pointer changes applied just before one snapshot: the move first, then
132
- * presses, then releases. `frame` is the snapshot's index, counting from 0 at
133
- * the first `snapshot()` call. A button both pressed and released in one frame
134
- * is a click shorter than a frame.
279
+ * Pointer changes applied just before one snapshot: the move, the raw
280
+ * motion, and the wheel first, then presses, then releases. `frame` is the
281
+ * snapshot's index, counting from 0 at the first `snapshot()` call. A button
282
+ * both pressed and released in one frame is a click shorter than a frame.
283
+ * Wheel pulses come from `wheel`, not from `press`.
135
284
  */
136
285
  export interface TimelineEntry {
137
286
  readonly frame: number;
138
287
  readonly move?: Position;
139
- readonly press?: ReadonlyArray<Button>;
140
- readonly release?: ReadonlyArray<Button>;
288
+ readonly movement?: Delta;
289
+ readonly wheel?: Delta;
290
+ /** Locks or unlocks the pointer from this frame on; unlocking releases what was held. */
291
+ readonly locked?: boolean;
292
+ readonly press?: ReadonlyArray<PhysicalButton>;
293
+ readonly release?: ReadonlyArray<PhysicalButton>;
141
294
  }
142
295
  /**
143
296
  * Pointer changes by snapshot index. Plain data, so it round-trips through
144
- * JSON; load it back with `parseTimeline`.
297
+ * JSON; load it back with `parseTimeline`. It names buttons, not actions, so
298
+ * a replay follows the bindings as live play does.
145
299
  */
146
300
  export type Timeline = ReadonlyArray<TimelineEntry>;
147
- /**
148
- * A pointer driven by a timeline instead of an element.
149
- */
150
- export interface Scripted extends Pointer {
301
+ /** A pointer driven by a timeline instead of an element. */
302
+ export interface Scripted<B extends Bindings> extends Actions<B> {
151
303
  /** Number of snapshots taken so far, which is the next frame index. */
152
304
  readonly frames: () => number;
153
305
  }
154
306
  /**
155
- * Plays `timeline`: before the snapshot at index `frame`, every entry for that
156
- * frame is applied. Buttons stay held from their press until their release.
157
- * The scripted pointer is always over the element.
158
- */
159
- export declare const scripted: (timeline: Timeline, start?: Position) => Scripted;
160
- /**
161
- * A live pointer that also records the timeline it produces.
307
+ * Plays `timeline` with `bindings`: before the snapshot at index `frame`,
308
+ * every entry for that frame is applied. Buttons stay held from their press
309
+ * until their release. The scripted pointer is always over the element.
162
310
  */
163
- export interface Recording extends Pointer {
164
- /** The recorded timeline; `scripted(timeline)` replays the same positions and buttons. */
311
+ export declare const scripted: <const B extends Bindings>(bindings: B, timeline: Timeline, start?: Position) => Scripted<B>;
312
+ /** A live pointer that also records the timeline it produces. */
313
+ export interface Recording<B extends Bindings> extends Actions<B> {
314
+ /** The recorded timeline; `scripted(bindings, timeline)` replays the same positions and buttons. */
165
315
  readonly timeline: () => Timeline;
166
316
  }
167
317
  /**
168
318
  * Wraps `pointer` and records, for every snapshot, the position when it moved
169
319
  * and the buttons pressed and released since the previous one.
170
320
  */
171
- export declare const recording: (pointer: Pointer) => Recording;
321
+ export declare const recording: <B extends Bindings>(pointer: Actions<B>) => Recording<B>;
172
322
  /**
173
323
  * Why loaded data is not a pointer timeline. `path` points at the offending
174
324
  * value, for example `[3].move.x`.
@@ -180,8 +330,27 @@ export interface InvalidTimeline {
180
330
  }
181
331
  /**
182
332
  * Validates untrusted data, such as a parsed JSON file, as a pointer
183
- * timeline: an array of entries with a non-negative integer `frame`, an
184
- * optional finite `move`, and optional `press`/`release` arrays of buttons.
333
+ * timeline: an array of entries with a non-negative integer `frame`,
334
+ * optional finite `move`, `movement`, and `wheel`, an optional boolean
335
+ * `locked`, and optional `press`/`release` arrays of physical buttons.
185
336
  */
186
337
  export declare const parseTimeline: (data: unknown) => Result.Result<Timeline, InvalidTimeline>;
338
+ /**
339
+ * Why loaded data is not a rebinding for the bindings. `path` points at the
340
+ * offending value, for example `fire[1]`.
341
+ */
342
+ export type InvalidRebinding = ButtonsInternal.InvalidRebinding;
343
+ /**
344
+ * Validates untrusted data, such as saved settings parsed from JSON, as new
345
+ * buttons for `bindings`: an object with exactly the same action names, each
346
+ * mapped to a non-empty array of button names. Pass the result to
347
+ * {@link Actions.rebind}; on failure, keep the defaults.
348
+ *
349
+ * @example
350
+ * ```ts
351
+ * const saved = Pointer.parseRebinding(bindings, JSON.parse(stored))
352
+ * if (saved.ok) mouse.rebind(saved.value)
353
+ * ```
354
+ */
355
+ export declare const parseRebinding: <const B extends Bindings>(bindings: B, data: unknown) => Result.Result<Rebinding<B>, InvalidRebinding>;
187
356
  //# sourceMappingURL=Pointer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pointer.d.ts","sourceRoot":"","sources":["../src/Pointer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAA;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,YAAY,EAAE,WAAW,EAAE,CAAA;AAE3B,8EAA8E;AAC9E,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAA;AAOvD,0EAA0E;AAC1E,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,E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