@workglow/postgres 0.2.36 → 0.2.37
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/job-queue/PostgresJobStore.d.ts +29 -0
- package/dist/job-queue/PostgresJobStore.d.ts.map +1 -0
- package/dist/job-queue/PostgresMessageQueue.d.ts +38 -0
- package/dist/job-queue/PostgresMessageQueue.d.ts.map +1 -0
- package/dist/job-queue/PostgresQueueStorage.d.ts +41 -10
- package/dist/job-queue/PostgresQueueStorage.d.ts.map +1 -1
- package/dist/job-queue/PostgresRateLimiterStorage.d.ts +1 -2
- package/dist/job-queue/PostgresRateLimiterStorage.d.ts.map +1 -1
- package/dist/job-queue/browser.js +401 -53
- package/dist/job-queue/browser.js.map +11 -8
- package/dist/job-queue/common.d.ts +3 -0
- package/dist/job-queue/common.d.ts.map +1 -1
- package/dist/job-queue/createPostgresQueue.d.ts +22 -0
- package/dist/job-queue/createPostgresQueue.d.ts.map +1 -0
- package/dist/job-queue/node.js +401 -53
- package/dist/job-queue/node.js.map +11 -8
- package/dist/migrations/PostgresMigrationRunner.d.ts +1 -1
- package/dist/migrations/PostgresMigrationRunner.d.ts.map +1 -1
- package/dist/migrations/postgresQueueMigrations.d.ts +9 -1
- package/dist/migrations/postgresQueueMigrations.d.ts.map +1 -1
- package/dist/migrations/postgresRateLimiterMigrations.d.ts +1 -1
- package/dist/migrations/postgresRateLimiterMigrations.d.ts.map +1 -1
- package/dist/storage/PostgresKvStorage.d.ts +1 -1
- package/dist/storage/PostgresKvStorage.d.ts.map +1 -1
- package/dist/storage/PostgresTabularStorage.d.ts +1 -1
- package/dist/storage/PostgresTabularStorage.d.ts.map +1 -1
- package/dist/storage/PostgresVectorStorage.d.ts +1 -1
- package/dist/storage/PostgresVectorStorage.d.ts.map +1 -1
- package/dist/storage/browser.js +28 -12
- package/dist/storage/browser.js.map +5 -5
- package/dist/storage/node.js +28 -12
- package/dist/storage/node.js.map +6 -6
- package/dist/text/PostgresFtsTextIndex.d.ts.map +1 -1
- package/dist/text/browser.js.map +2 -2
- package/dist/text/node.js.map +2 -2
- package/package.json +7 -7
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { IJobStore, JobRecord, JobStatus, MessageId } from "@workglow/job-queue";
|
|
7
|
+
import type { PostgresPendingWrite } from "./PostgresMessageQueue";
|
|
8
|
+
import type { PostgresQueueStorage } from "./PostgresQueueStorage";
|
|
9
|
+
export declare class PostgresJobStore<Input, Output> implements IJobStore<Input, Output> {
|
|
10
|
+
/** @internal — shared with the paired message queue */
|
|
11
|
+
readonly core: PostgresQueueStorage<Input, Output>;
|
|
12
|
+
/** @internal — shared transient buffer for saveResult/saveError. */
|
|
13
|
+
private readonly pending;
|
|
14
|
+
constructor(core: PostgresQueueStorage<Input, Output>, pending: Map<unknown, PostgresPendingWrite<Output>>);
|
|
15
|
+
get(id: MessageId): Promise<JobRecord<Input, Output> | undefined>;
|
|
16
|
+
peek(status?: JobStatus, num?: number): Promise<readonly JobRecord<Input, Output>[]>;
|
|
17
|
+
size(status?: JobStatus): Promise<number>;
|
|
18
|
+
getByRunId(runId: string): Promise<readonly JobRecord<Input, Output>[]>;
|
|
19
|
+
outputForInput(input: Input): Promise<Output | null>;
|
|
20
|
+
saveProgress(id: MessageId, progress: number, message: string, details: Record<string, any> | null): Promise<void>;
|
|
21
|
+
saveResult(id: MessageId, output: Output): Promise<void>;
|
|
22
|
+
saveError(id: MessageId, error: string, errorCode: string | null, abortRequested: boolean): Promise<void>;
|
|
23
|
+
deleteByStatusAndAge(status: JobStatus, olderThanMs: number): Promise<void>;
|
|
24
|
+
delete(id: MessageId): Promise<void>;
|
|
25
|
+
deleteAll(): Promise<void>;
|
|
26
|
+
abort(id: MessageId): Promise<void>;
|
|
27
|
+
saveStatus(id: MessageId, status: JobStatus): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=PostgresJobStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresJobStore.d.ts","sourceRoot":"","sources":["../../src/job-queue/PostgresJobStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,qBAAa,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAE,YAAW,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;IAC9E,uDAAuD;IACvD,SAAgB,IAAI,EAAE,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAE1D,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6C;IAErE,YACE,IAAI,EAAE,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,EACzC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC,EAIpD;IAED,GAAG,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,CAEhE;IAEK,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,CAEzF;IAED,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAExC;IAEK,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,CAE5E;IAED,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEnD;IAEK,YAAY,CAChB,EAAE,EAAE,SAAS,EACb,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAClC,OAAO,CAAC,IAAI,CAAC,CAEf;IAEK,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7D;IAEK,SAAS,CACb,EAAE,EAAE,SAAS,EACb,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,cAAc,EAAE,OAAO,GACtB,OAAO,CAAC,IAAI,CAAC,CAMf;IAEK,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhF;IAEK,MAAM,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzC;IAEK,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAG/B;IAEK,KAAK,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAExC;IAEK,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhE;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { IClaim, IMessageQueue, JobStorageFormat, MessageId, QueueChangePayload, QueueStorageScope, QueueSubscribeOptions, SendOptions } from "@workglow/job-queue";
|
|
7
|
+
import type { PostgresQueueStorage } from "./PostgresQueueStorage";
|
|
8
|
+
/**
|
|
9
|
+
* Per-id buffer that lets {@link IJobStore.saveResult}/{@link IJobStore.saveError}
|
|
10
|
+
* stage output/error until the terminal claim.ack()/fail() persists them in
|
|
11
|
+
* a single complete() call (avoids double-bumping `attempts`).
|
|
12
|
+
*/
|
|
13
|
+
export type PostgresPendingWrite<Output> = {
|
|
14
|
+
output?: Output | null;
|
|
15
|
+
error?: string | null;
|
|
16
|
+
errorCode?: string | null;
|
|
17
|
+
abortRequested?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare class PostgresMessageQueue<Input, Output> implements IMessageQueue<JobStorageFormat<Input, Output>> {
|
|
20
|
+
readonly scope: QueueStorageScope;
|
|
21
|
+
/** @internal — shared with the paired job store */
|
|
22
|
+
readonly core: PostgresQueueStorage<Input, Output>;
|
|
23
|
+
/** @internal — shared transient buffer for saveResult/saveError. */
|
|
24
|
+
private readonly pending;
|
|
25
|
+
constructor(core: PostgresQueueStorage<Input, Output>, pending: Map<unknown, PostgresPendingWrite<Output>>);
|
|
26
|
+
send(body: JobStorageFormat<Input, Output>, opts?: SendOptions): Promise<MessageId>;
|
|
27
|
+
sendBatch(bodies: readonly JobStorageFormat<Input, Output>[], opts?: SendOptions): Promise<readonly MessageId[]>;
|
|
28
|
+
receive(opts: {
|
|
29
|
+
workerId: string;
|
|
30
|
+
leaseMs: number;
|
|
31
|
+
max?: number;
|
|
32
|
+
}): Promise<readonly IClaim<JobStorageFormat<Input, Output>>[]>;
|
|
33
|
+
releaseClaim(id: MessageId): Promise<void>;
|
|
34
|
+
migrate(): Promise<void>;
|
|
35
|
+
getMigrations(): ReadonlyArray<unknown>;
|
|
36
|
+
subscribeToChanges(callback: (change: QueueChangePayload<any, any>) => void, options?: QueueSubscribeOptions): () => void;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=PostgresMessageQueue.d.ts.map
|
|
@@ -0,0 +1 @@
|
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E,EAClD,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,SAAS,SAAS,EAAE,CAAC,CAM/B;IAEK,OAAO,CAAC,IAAI,EAAE;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,SAAS,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAkB9D;IAEK,YAAY,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/C;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7B;IAED,aAAa,IAAI,aAAa,CAAC,OAAO,CAAC,CAEtC;IAED,kBAAkB,CAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,IAAI,EACxD,OAAO,CAAC,EAAE,qBAAqB,GAC9B,MAAM,IAAI,CAEZ;CACF"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import type { Pool } from "@workglow/postgres/storage";
|
|
7
|
-
import { JobStatus } from "@workglow/job-queue";
|
|
8
6
|
import type { IQueueStorage, JobStorageFormat, PrefixColumn, QueueChangePayload, QueueStorageOptions, QueueSubscribeOptions } from "@workglow/job-queue";
|
|
7
|
+
import { JobStatus } from "@workglow/job-queue";
|
|
8
|
+
import type { Pool } from "@workglow/postgres/storage";
|
|
9
9
|
export declare const POSTGRES_QUEUE_STORAGE: import("@workglow/util").ServiceToken<IQueueStorage<any, any>>;
|
|
10
10
|
/**
|
|
11
11
|
* PostgreSQL implementation of a job queue.
|
|
@@ -63,10 +63,22 @@ export declare class PostgresQueueStorage<Input, Output> implements IQueueStorag
|
|
|
63
63
|
peek(status?: JobStatus, num?: number): Promise<Array<JobStorageFormat<Input, Output>>>;
|
|
64
64
|
/**
|
|
65
65
|
* Retrieves the next available job that is ready to be processed.
|
|
66
|
+
* Claims PENDING jobs ready to run, and also reclaims PROCESSING jobs whose
|
|
67
|
+
* lease has expired (crash recovery). Sets lease_expires_at on the claimed row.
|
|
66
68
|
* @param workerId - Worker ID to associate with the job (required)
|
|
69
|
+
* @param opts - Optional options including leaseMs (default 30000)
|
|
67
70
|
* @returns The next job or undefined if no job is available
|
|
68
71
|
*/
|
|
69
|
-
next(workerId: string
|
|
72
|
+
next(workerId: string, opts?: {
|
|
73
|
+
leaseMs?: number;
|
|
74
|
+
}): Promise<JobStorageFormat<Input, Output> | undefined>;
|
|
75
|
+
/**
|
|
76
|
+
* Extend the lease on a currently PROCESSING job.
|
|
77
|
+
* @param id - The ID of the job to extend the lease for
|
|
78
|
+
* @param workerId - Worker ID that must match the current lease owner (lease_owner)
|
|
79
|
+
* @param ms - Number of milliseconds to extend the lease by
|
|
80
|
+
*/
|
|
81
|
+
extendLease(id: unknown, workerId: string, ms: number): Promise<void>;
|
|
70
82
|
/**
|
|
71
83
|
* Retrieves the number of jobs in the queue with a specific status.
|
|
72
84
|
* @param status - The status of the jobs to count
|
|
@@ -76,10 +88,27 @@ export declare class PostgresQueueStorage<Input, Output> implements IQueueStorag
|
|
|
76
88
|
/**
|
|
77
89
|
* Marks a job as complete with its output or error.
|
|
78
90
|
* Enhanced error handling:
|
|
79
|
-
* - For a retryable error, increments
|
|
91
|
+
* - For a retryable error, increments attempts and updates visible_at.
|
|
80
92
|
* - Marks a job as FAILED immediately for permanent or generic errors.
|
|
81
93
|
*/
|
|
82
94
|
complete(jobDetails: JobStorageFormat<Input, Output>): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Terminal write that does NOT bump `attempts`. See IQueueStorage.finalize
|
|
97
|
+
* for the rationale (avoids double-counting on ack/fail because the lease
|
|
98
|
+
* reclaim path already charged the attempt at next() time).
|
|
99
|
+
*/
|
|
100
|
+
finalize(id: unknown, fields: {
|
|
101
|
+
output?: Output | null;
|
|
102
|
+
error?: string | null;
|
|
103
|
+
error_code?: string | null;
|
|
104
|
+
status?: JobStatus;
|
|
105
|
+
completed_at?: string | null;
|
|
106
|
+
abort_requested_at?: string | null;
|
|
107
|
+
lease_owner?: string | null;
|
|
108
|
+
progress?: number;
|
|
109
|
+
progress_message?: string;
|
|
110
|
+
progress_details?: Record<string, any> | null;
|
|
111
|
+
}): Promise<void>;
|
|
83
112
|
/**
|
|
84
113
|
* Clears all jobs from the queue.
|
|
85
114
|
*/
|
|
@@ -91,17 +120,19 @@ export declare class PostgresQueueStorage<Input, Output> implements IQueueStorag
|
|
|
91
120
|
*/
|
|
92
121
|
outputForInput(input: Input): Promise<Output | null>;
|
|
93
122
|
/**
|
|
94
|
-
* Aborts a job
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
123
|
+
* Aborts a job.
|
|
124
|
+
* - If PENDING: immediately mark as FAILED with abort_requested_at set.
|
|
125
|
+
* - If PROCESSING: set abort_requested_at only (leave status as PROCESSING).
|
|
126
|
+
* - Otherwise: no-op.
|
|
98
127
|
*/
|
|
99
128
|
abort(jobId: unknown): Promise<void>;
|
|
100
129
|
/**
|
|
101
|
-
* Releases a claimed job back to PENDING without incrementing
|
|
130
|
+
* Releases a claimed job back to PENDING without incrementing attempts.
|
|
102
131
|
* @param jobId - The id of the claimed job to release.
|
|
103
132
|
*/
|
|
104
|
-
|
|
133
|
+
releaseClaim(jobId: unknown): Promise<void>;
|
|
134
|
+
/** Force-overwrite status without touching attempts (used to persist DISABLED after lease release). */
|
|
135
|
+
saveStatus(jobId: unknown, status: string): Promise<void>;
|
|
105
136
|
/**
|
|
106
137
|
* Retrieves all jobs for a given job run ID.
|
|
107
138
|
* @param job_run_id - The ID of the job run to retrieve
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostgresQueueStorage.d.ts","sourceRoot":"","sources":["../../src/job-queue/PostgresQueueStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"PostgresQueueStorage.d.ts","sourceRoot":"","sources":["../../src/job-queue/PostgresQueueStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAmB,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAcvD,eAAO,MAAM,sBAAsB,gEAElC,CAAC;AAaF;;;GAGG;AACH,qBAAa,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAE,YAAW,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC;IAUpF,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI;IAC3B,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM;IAVtC,SAAgB,KAAK,EAAG,SAAS,CAAU;IAC3C,oCAAoC;IACpC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IACrD,sCAAsC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;IAC3E,uCAAuC;IACvC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAErC,YACqB,EAAE,EAAE,IAAI,EACR,SAAS,EAAE,MAAM,EACpC,OAAO,CAAC,EAAE,mBAAmB,EAe9B;IAED,mFAAmF;IACnF,OAAO,CAAC,sBAAsB;IAI9B,6CAA6C;IAC7C,OAAO,CAAC,oBAAoB;IAI5B;;;;OAIG;IACI,aAAa,mDAEnB;IAED;;;;OAIG;IACU,OAAO,IAAI,OA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AI,CAAC,CAMjD;IAED;;;;OAIG;IACU,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAW3F;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACI,kBAAkB,CACvB,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAC7D,OAAO,CAAC,EAAE,qBAAqB,GAC9B,MAAM,IAAI,CA+JZ;CACF"}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import type { IRateLimiterStorage, PrefixColumn, RateLimiterStorageOptions, RateLimiterStorageScope } from "@workglow/job-queue";
|
|
6
7
|
import type { Pool } from "@workglow/postgres/storage";
|
|
7
|
-
import type { PrefixColumn } from "@workglow/job-queue";
|
|
8
|
-
import type { IRateLimiterStorage, RateLimiterStorageOptions, RateLimiterStorageScope } from "@workglow/job-queue";
|
|
9
8
|
export declare const POSTGRES_RATE_LIMITER_STORAGE: import("@workglow/util").ServiceToken<IRateLimiterStorage>;
|
|
10
9
|
/**
|
|
11
10
|
* PostgreSQL implementation of rate limiter storage.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostgresRateLimiterStorage.d.ts","sourceRoot":"","sources":["../../src/job-queue/PostgresRateLimiterStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"PostgresRateLimiterStorage.d.ts","sourceRoot":"","sources":["../../src/job-queue/PostgresRateLimiterStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,IAAI,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