@gurezo/web-serial-rxjs 3.1.1 → 4.0.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 (42) hide show
  1. package/README.ja.md +4 -7
  2. package/README.md +4 -7
  3. package/dist/errors/serial-error-code.d.ts +0 -21
  4. package/dist/errors/serial-error-code.d.ts.map +1 -1
  5. package/dist/errors/serial-error-context.d.ts +1 -6
  6. package/dist/errors/serial-error-context.d.ts.map +1 -1
  7. package/dist/index.d.ts +6 -5
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.mjs +221 -427
  10. package/dist/index.mjs.map +4 -4
  11. package/dist/internal/branded-numbers.d.ts +1 -8
  12. package/dist/internal/branded-numbers.d.ts.map +1 -1
  13. package/dist/session/create-serial-session.d.ts +6 -4
  14. package/dist/session/create-serial-session.d.ts.map +1 -1
  15. package/dist/session/index.d.ts +2 -2
  16. package/dist/session/index.d.ts.map +1 -1
  17. package/dist/session/internal/error-severity.d.ts +0 -1
  18. package/dist/session/internal/error-severity.d.ts.map +1 -1
  19. package/dist/session/internal/has-web-serial-support.d.ts +6 -5
  20. package/dist/session/internal/has-web-serial-support.d.ts.map +1 -1
  21. package/dist/session/internal/line-buffer.d.ts +17 -0
  22. package/dist/session/internal/line-buffer.d.ts.map +1 -1
  23. package/dist/session/internal/port-teardown.d.ts +30 -0
  24. package/dist/session/internal/port-teardown.d.ts.map +1 -0
  25. package/dist/session/internal/receive-pipeline.d.ts +8 -5
  26. package/dist/session/internal/receive-pipeline.d.ts.map +1 -1
  27. package/dist/session/internal/session-error-reporter.d.ts +0 -1
  28. package/dist/session/internal/session-error-reporter.d.ts.map +1 -1
  29. package/dist/session/internal/session-lifecycle.d.ts +3 -5
  30. package/dist/session/internal/session-lifecycle.d.ts.map +1 -1
  31. package/dist/session/serial-session-options.d.ts +62 -94
  32. package/dist/session/serial-session-options.d.ts.map +1 -1
  33. package/dist/session/serial-session.d.ts +9 -75
  34. package/dist/session/serial-session.d.ts.map +1 -1
  35. package/dist/session/session-runtime.d.ts.map +1 -1
  36. package/dist/terminal/create-terminal-buffer.d.ts +24 -1
  37. package/dist/terminal/create-terminal-buffer.d.ts.map +1 -1
  38. package/dist/types.d.ts +5 -0
  39. package/dist/types.d.ts.map +1 -1
  40. package/package.json +2 -2
  41. package/dist/session/internal/receive-replay-buffer.d.ts +0 -38
  42. package/dist/session/internal/receive-replay-buffer.d.ts.map +0 -1
package/README.ja.md CHANGED
@@ -19,19 +19,15 @@ Web Serial API は**デスクトップ**ブラウザでのみサポートされ
19
19
 
20
20
  **Safari** は現時点で Web Serial API をサポートしていません。
21
21
 
22
- `connect$` の前の feature detection には `SerialSession.isBrowserSupported()`(同期的に `boolean`)を使います。
22
+ `connect$` の前の feature detection には `isWebSerialSupported()`(同期的に `boolean`)を使います。
23
23
 
24
24
  ## 接続状態(ライフサイクル UI)
25
25
 
26
- ライフサイクル UI には **`state$`** の `state.status` narrowing を canonical API として使用してください。boolean だけ必要な場合は `state$` から derive してください。`isConnected$` v3.x では引き続き利用可能ですが **非推奨** です。詳細は [v3 移行ガイド](./docs/guide/ja/migration-v3.md#6-isconnected-の非推奨化) を参照してください。
26
+ ライフサイクル UI には **`state$`** の `state.status` narrowing を canonical API として使用してください。boolean だけ必要な場合は `state$` から derive してください。セッション破棄には **`dispose$()`** を使用します(購読により実行されます)。詳細は [v4 への移行](./docs/guide/ja/migration-v4.md) を参照してください。
27
27
 
28
28
  ## 接続中のポート情報(デバイス識別)
29
29
 
30
- `connect$` 成功後、`state$` を `state.status === SerialSessionStatus.Connected` で handling する場合は **`state.portInfo`** を canonical API として使用してください。`getPortInfo()` `portInfo$` v3.x では引き続き利用可能ですが **非推奨** です。`state$` の narrowing へ移行してください。`getCurrentPort()` は削除されました。詳細は [v3 移行ガイド](./docs/guide/ja/migration-v3.md#7-getcurrentport-の削除) を参照してください。
31
-
32
- ## 受信の replay(`receive$` と `receiveReplay$`)
33
-
34
- `receive$` は **non-replay** のままです。購読後に届くチャンクだけが見えます。接続ごとに直近 *N* 件のデコード済みテキスト**チャンク**(read pump の 1 回の `onChunk` あたり 1 件。文字数ではありません)を遅延購読者にも渡したい場合は、`createSerialSession` に `receiveReplay: { enabled: true, bufferSize: 512 }` を指定し、`receiveReplay$` を購読します。`bufferSize` は 1〜65536 の正の safe integer である必要があります。任意の `maxChars` で保持チャンク全体の文字数上限を指定でき、超過時は古いチャンクから破棄し non-fatal の `RECEIVE_REPLAY_BUFFER_OVERFLOW` を `errors$` に emit します。`bufferSize` やチャンクサイズを大きくするとメモリ負荷が増えます。receive replay が **無効**(既定)のとき、`receiveReplay$` は `receive$` と同じ hot ストリームです。`lines$` の行分割に replay は付きません。生チャンクの `receiveReplay$` のみが対象です。
30
+ `connect$` 成功後、`state$` を `state.status === SerialSessionStatus.Connected` で handling する場合は **`state.portInfo`** を canonical API として使用してください。生の `SerialPort` は公開しません。削除された convenience API(`isConnected$`、`portInfo$`、`getPortInfo()`、`destroy$()`、`getCurrentPort()`、`receiveReplay$`、`isBrowserSupported()`)と置換先は [v4 への移行](./docs/guide/ja/migration-v4.md) を参照してください。
35
31
 
36
32
  ## `receive$` と `lines$`
37
33
 
@@ -100,6 +96,7 @@ pnpm add rxjs
100
96
  | [クイックスタート](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/ja/quick-start.md) | ポートを開いて購読までを最短で |
101
97
  | [高度な使用方法](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/ja/advanced-usage.md) | 行フレーミング、擬似リクエスト/レス、リカバリ |
102
98
  | [API の概念と設計メモ](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/ja/concepts.md) | オプション、`SerialError`、型の表形式補足 |
99
+ | [v3 → v4 マイグレーション](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/ja/migration-v4.md) | Phase 1+2 の削除(`receiveReplay$`、`isBrowserSupported()`、オプション整理) |
103
100
  | [v2 → v3 マイグレーション](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/ja/migration-v3.md) | `state$` discriminated union、`SerialSessionStatus`、`context.cause` |
104
101
  | [v1 → v2 マイグレーション](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/ja/migration-v2.md) | 廃止された v1 API の置き換え |
105
102
  | **リポジトリ [README](https://github.com/gurezo/web-serial-rxjs/blob/main/README.ja.md)** | モノレポ構成、**`apps/` のサンプル**、貢献、MCP、プロジェクトアイコン |
package/README.md CHANGED
@@ -19,19 +19,15 @@ Supported desktop browsers:
19
19
 
20
20
  **Safari** does not currently support the Web Serial API.
21
21
 
22
- `SerialSession.isBrowserSupported()` returns a synchronous `boolean` for feature detection before `connect$`.
22
+ `isWebSerialSupported()` returns a synchronous `boolean` for feature detection before `connect$`.
23
23
 
24
24
  ## Connection state (lifecycle UI)
25
25
 
26
- Prefer **`state$`** with `state.status` narrowing as the canonical API for lifecycle UI. Derive a boolean from `state$` when you only need a connected flag. `isConnected$` remains available in v3.x but is **deprecated** see [Migrating to v3](./docs/guide/en/migration-v3.md#6-isconnected-deprecation).
26
+ Prefer **`state$`** with `state.status` narrowing as the canonical API for lifecycle UI. Derive a boolean from `state$` when you only need a connected flag. Session teardown uses **`dispose$()`** (subscribe to run it). See [Migrating to v4](./docs/guide/en/migration-v4.md).
27
27
 
28
28
  ## Port info (device identification)
29
29
 
30
- After a successful `connect$`, use `state.portInfo` when handling `state$` with `state.status === SerialSessionStatus.Connected` — this is the canonical API. `getPortInfo()` and `portInfo$` remain available in v3.x but are **deprecated**; migrate to `state$` narrowing. `getCurrentPort()` has been removed; see [Migrating to v3 – getCurrentPort() removal](./docs/guide/en/migration-v3.md#7-getcurrentport-removal).
31
-
32
- ## Receive replay (`receive$` vs `receiveReplay$`)
33
-
34
- `receive$` is **non-replay**: late subscribers only see chunks emitted after they subscribe. To retain the last *N* decoded text **chunks** per open connection (same bytes as `receive$`, e.g. for boot logs), pass `receiveReplay: { enabled: true, bufferSize: 512 }` to `createSerialSession` and subscribe to `receiveReplay$`. `bufferSize` must be a positive safe integer up to 65536. Optional `maxChars` bounds total buffered characters by discarding oldest chunks (non-fatal `RECEIVE_REPLAY_BUFFER_OVERFLOW` on `errors$`). Larger `bufferSize` or chunk sizes use more memory. When receive replay is **off** (default), `receiveReplay$` is the same hot stream as `receive$`. This option does not add replay to `lines$`—only raw decoder chunks on `receiveReplay$`.
30
+ After a successful `connect$`, use `state.portInfo` when handling `state$` with `state.status === SerialSessionStatus.Connected` — this is the canonical API. Raw `SerialPort` is not exposed. Removed convenience APIs (`isConnected$`, `portInfo$`, `getPortInfo()`, `destroy$()`, `getCurrentPort()`, `receiveReplay$`, `isBrowserSupported()`) and their replacements are documented in [Migrating to v4](./docs/guide/en/migration-v4.md).
35
31
 
36
32
  ## `receive$` vs `lines$`
37
33
 
@@ -104,6 +100,7 @@ pnpm add rxjs
104
100
  | [Quick Start](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/en/quick-start.md) | Open a port and wire subscriptions end-to-end |
105
101
  | [Advanced Usage](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/en/advanced-usage.md) | Line framing, request/response-style flows, recovery |
106
102
  | [API concepts and design notes](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/en/concepts.md) | `SerialSessionOptions`, `SerialError`, and formal details |
103
+ | [v3 → v4 migration](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/en/migration-v4.md) | Phase 1+2 removals (`receiveReplay$`, `isBrowserSupported()`, options cleanup) |
107
104
  | [v2 → v3 migration](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/en/migration-v3.md) | `state$` discriminated union, `SerialSessionStatus`, `context.cause` |
108
105
  | [v1 → v2 migration](https://github.com/gurezo/web-serial-rxjs/blob/main/packages/web-serial-rxjs/docs/guide/en/migration-v2.md) | Replacing the removed v1 `SerialClient` / `ShellClient` API |
109
106
  | [Repository README](https://github.com/gurezo/web-serial-rxjs/blob/main/README.md) | Monorepo layout, **examples** under `apps/`, contributing, MCP, and project icon |
@@ -145,16 +145,6 @@ export declare const SerialErrorCode: {
145
145
  * or ensure the device sends line terminators.
146
146
  */
147
147
  readonly LINE_BUFFER_OVERFLOW: "LINE_BUFFER_OVERFLOW";
148
- /**
149
- * Invalid receive replay options provided.
150
- *
151
- * This error occurs when {@link SerialSessionOptions.receiveReplay} values are
152
- * out of range, such as a non-integer `bufferSize` or `maxChars`.
153
- *
154
- * **Suggested action**: Verify `receiveReplay` options match the documented
155
- * ranges and value types.
156
- */
157
- readonly INVALID_RECEIVE_REPLAY_OPTIONS: "INVALID_RECEIVE_REPLAY_OPTIONS";
158
148
  /**
159
149
  * Invalid terminal buffer options provided.
160
150
  *
@@ -185,17 +175,6 @@ export declare const SerialErrorCode: {
185
175
  * ranges and value types.
186
176
  */
187
177
  readonly INVALID_CONNECTION_OPTIONS: "INVALID_CONNECTION_OPTIONS";
188
- /**
189
- * Receive replay buffer exceeded its configured character limit.
190
- *
191
- * This error occurs when buffered chunks on {@link SerialSession.receiveReplay$}
192
- * exceed {@link SerialSessionOptions.receiveReplay} `maxChars`. Oldest chunks
193
- * are discarded to bound memory; the session remains connected.
194
- *
195
- * **Suggested action**: Increase `receiveReplay.maxChars`, reduce chunk size at
196
- * the source, or subscribe earlier to avoid relying on a large replay buffer.
197
- */
198
- readonly RECEIVE_REPLAY_BUFFER_OVERFLOW: "RECEIVE_REPLAY_BUFFER_OVERFLOW";
199
178
  /**
200
179
  * Session has been disposed and can no longer be used.
201
180
  *
@@ -1 +1 @@
1
- {"version":3,"file":"serial-error-code.d.ts","sourceRoot":"","sources":["../../src/errors/serial-error-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,eAAe;IAC1B;;;;;;;;OAQG;;IAGH;;;;;;;;;;;;;OAaG;;IAGH;;;;;;OAMG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;OAQG;;CAEK,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"serial-error-code.d.ts","sourceRoot":"","sources":["../../src/errors/serial-error-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,eAAe;IAC1B;;;;;;;;OAQG;;IAGH;;;;;;;;;;;;;OAaG;;IAGH;;;;;;OAMG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;OAQG;;CAEK,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
@@ -8,7 +8,7 @@ export type SerialErrorCauseContext = {
8
8
  /**
9
9
  * Machine-readable constraint identifiers for factory-time validation errors.
10
10
  */
11
- export type ValidationErrorConstraint = 'at-least-one-usb-id' | 'usb-id-0-65535' | 'positive-safe-integer' | 'receive-replay-buffer-size-range' | 'receive-replay-max-chars-range' | 'non-negative-safe-integer';
11
+ export type ValidationErrorConstraint = 'at-least-one-usb-id' | 'usb-id-0-65535' | 'positive-safe-integer' | 'non-negative-safe-integer';
12
12
  /**
13
13
  * Structured metadata for `INVALID_*` validation errors thrown at session
14
14
  * factory time. {@link SerialError.message} remains human-readable.
@@ -41,14 +41,9 @@ export interface SerialErrorContextMap {
41
41
  [SerialErrorCode.LINE_BUFFER_OVERFLOW]: {
42
42
  readonly maxChars: number;
43
43
  };
44
- [SerialErrorCode.INVALID_RECEIVE_REPLAY_OPTIONS]: ValidationErrorContext;
45
44
  [SerialErrorCode.INVALID_TERMINAL_BUFFER_OPTIONS]: ValidationErrorContext;
46
45
  [SerialErrorCode.INVALID_LINE_BUFFER_OPTIONS]: ValidationErrorContext;
47
46
  [SerialErrorCode.INVALID_CONNECTION_OPTIONS]: ValidationErrorContext;
48
- [SerialErrorCode.RECEIVE_REPLAY_BUFFER_OVERFLOW]: {
49
- readonly maxChars: number;
50
- readonly bufferSize: number;
51
- };
52
47
  [SerialErrorCode.SESSION_DISPOSED]: undefined;
53
48
  [SerialErrorCode.UNKNOWN]: SerialErrorCauseContext;
54
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"serial-error-context.d.ts","sourceRoot":"","sources":["../../src/errors/serial-error-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GACjC,qBAAqB,GACrB,gBAAgB,GAChB,uBAAuB,GACvB,kCAAkC,GAClC,gCAAgC,GAChC,2BAA2B,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
13
  * `state$` (canonical lifecycle discriminated union) + `errors$` (error event
14
14
  * channel) + `receive$` + `terminalText$` + `lines$` without rebuilding state,
15
15
  * read loops, or write queues. Derive convenience booleans from `state$`
16
- * narrowing; `isConnected$` is deprecated in v3.x.
16
+ * narrowing.
17
17
  *
18
18
  * - {@link createSerialSession} - factory for a {@link SerialSession}
19
19
  * - {@link createTerminalBuffer} - terminal-style display text from {@link SerialSession.receive$}
@@ -45,7 +45,7 @@
45
45
  *
46
46
  * **Safari** does not currently support the Web Serial API.
47
47
  *
48
- * Use {@link SerialSession.isBrowserSupported} for a synchronous feature
48
+ * Use {@link isWebSerialSupported} for a synchronous feature
49
49
  * check before calling {@link SerialSession.connect$}.
50
50
  *
51
51
  * @example
@@ -53,6 +53,7 @@
53
53
  * import { filter } from 'rxjs';
54
54
  * import {
55
55
  * createSerialSession,
56
+ * isWebSerialSupported,
56
57
  * isConnectedSessionState,
57
58
  * SerialSessionStatus,
58
59
  * SerialErrorCode,
@@ -60,7 +61,7 @@
60
61
  *
61
62
  * const session = createSerialSession({ baudRate: 115200 });
62
63
  *
63
- * if (!session.isBrowserSupported()) {
64
+ * if (!isWebSerialSupported()) {
64
65
  * console.error('Web Serial API is not supported in this browser');
65
66
  * } else {
66
67
  * session.state$.subscribe((state) => {
@@ -86,8 +87,8 @@
86
87
  * ```
87
88
  */
88
89
  export { assertNever } from './internal/assert-never';
89
- export { createSerialSession, SerialSessionStatus, isConnectedSessionState, DEFAULT_LINE_BUFFER_OPTIONS, resolveSerialSessionOptions, MAX_RECEIVE_REPLAY_BUFFER_SIZE, MAX_RECEIVE_REPLAY_MAX_CHARS } from './session';
90
- export type { SerialSession, SerialSessionState, IdleSessionState, ConnectingSessionState, ConnectedSessionState, DisconnectingSessionState, UnsupportedSessionState, ErrorSessionState, DisposedSessionState, SerialSessionOptions, SerialSessionFeatureOptions, SerialSessionReceiveReplayOptions, ResolvedSerialSessionOptions, SerialPayload, SerialConnectionOptions, LineBufferOptions, } from './session';
90
+ export { createSerialSession, isWebSerialSupported, SerialSessionStatus, isConnectedSessionState, DEFAULT_LINE_BUFFER_OPTIONS, resolveSerialSessionOptions } from './session';
91
+ export type { SerialSession, SerialSessionState, IdleSessionState, ConnectingSessionState, ConnectedSessionState, DisconnectingSessionState, UnsupportedSessionState, ErrorSessionState, DisposedSessionState, SerialSessionOptions, SerialSessionFeatureOptions, ResolvedSerialSessionOptions, SerialPayload, SerialConnectionOptions, LineBufferOptions, } from './session';
91
92
  export { SerialError } from './errors/serial-error';
92
93
  export type { SerialErrorCauseContext, SerialErrorContextMap, ValidationErrorConstraint, ValidationErrorContext, } from './errors/serial-error';
93
94
  export { SerialErrorCode } from './errors/serial-error-code';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AACtN,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,2BAA2B,EAC3B,iCAAiC,EACjC,4BAA4B,EAC5B,aAAa,EACb,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,YAAY,EACV,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B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