@florent-uzio/custody 2.2.0 → 2.3.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 (40) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/models/custody-types.d.ts +565 -338
  6. package/dist/models/custody-types.d.ts.map +1 -1
  7. package/dist/ripple-custody.d.ts +55 -10
  8. package/dist/ripple-custody.d.ts.map +1 -1
  9. package/dist/ripple-custody.js +54 -21
  10. package/dist/ripple-custody.js.map +1 -1
  11. package/dist/services/xrpl/index.d.ts +1 -0
  12. package/dist/services/xrpl/index.d.ts.map +1 -1
  13. package/dist/services/xrpl/index.js +1 -4
  14. package/dist/services/xrpl/index.js.map +1 -1
  15. package/dist/services/xrpl/xrpl.adapters.d.ts +23 -5
  16. package/dist/services/xrpl/xrpl.adapters.d.ts.map +1 -1
  17. package/dist/services/xrpl/xrpl.adapters.js +244 -161
  18. package/dist/services/xrpl/xrpl.adapters.js.map +1 -1
  19. package/dist/services/xrpl/xrpl.builders.d.ts +22 -0
  20. package/dist/services/xrpl/xrpl.builders.d.ts.map +1 -0
  21. package/dist/services/xrpl/xrpl.builders.js +107 -0
  22. package/dist/services/xrpl/xrpl.builders.js.map +1 -0
  23. package/dist/services/xrpl/xrpl.crypto.d.ts +6 -0
  24. package/dist/services/xrpl/xrpl.crypto.d.ts.map +1 -0
  25. package/dist/services/xrpl/xrpl.crypto.js +19 -0
  26. package/dist/services/xrpl/xrpl.crypto.js.map +1 -0
  27. package/dist/services/xrpl/xrpl.http-adapters.d.ts.map +1 -1
  28. package/dist/services/xrpl/xrpl.http-adapters.js +5 -0
  29. package/dist/services/xrpl/xrpl.http-adapters.js.map +1 -1
  30. package/dist/services/xrpl/xrpl.ports.d.ts +7 -1
  31. package/dist/services/xrpl/xrpl.ports.d.ts.map +1 -1
  32. package/dist/services/xrpl/xrpl.service.d.ts +79 -36
  33. package/dist/services/xrpl/xrpl.service.d.ts.map +1 -1
  34. package/dist/services/xrpl/xrpl.service.js +178 -182
  35. package/dist/services/xrpl/xrpl.service.js.map +1 -1
  36. package/dist/services/xrpl/xrpl.types.d.ts +108 -7
  37. package/dist/services/xrpl/xrpl.types.d.ts.map +1 -1
  38. package/dist/services/xrpl/xrpl.types.js +0 -28
  39. package/dist/services/xrpl/xrpl.types.js.map +1 -1
  40. package/package.json +1 -1
@@ -2,7 +2,7 @@ import type { SubmittableTransaction } from "xrpl";
2
2
  import { createAccounts, createChannels, createDomains, createEndpoints, createEvents, createGenesis, createIntents, createLedgers, createPolicies, createRequests, createTickers, createTransactions, createUserInvitations, createUsers, createVaults } from "./namespaces/index.js";
3
3
  import type { RippleCustodyClientOptions } from "./ripple-custody.types.js";
4
4
  import type { Core_IntentResponse } from "./services/intents/intents.types.js";
5
- import { type Core_XrplOperation, type RawSignAndWaitOptions, type RawSignAndWaitResult, type XrplIntentOptions } from "./services/xrpl/index.js";
5
+ import { type BatchPayloadInput, type Core_ApiBatchSigningData, type Core_BatchSigner, type Core_XrplOperation, type GetBatchSignatureParams, type RawSignAndWaitOptions, type RawSignAndWaitResult, type SignBatchPayloadHandle, type SignBatchPayloadOptions, type SignBatchPayloadResult, type WaitForSignatureOptions, type XrplIntentOptions } from "./services/xrpl/index.js";
6
6
  export declare class RippleCustody {
7
7
  private readonly apiService;
8
8
  private readonly authService;
@@ -67,20 +67,65 @@ export declare class RippleCustody {
67
67
  */
68
68
  rawSignAndWait: (xrplTransaction: SubmittableTransaction, options?: RawSignAndWaitOptions) => Promise<RawSignAndWaitResult>;
69
69
  /**
70
- * Proposes a raw sign intent for a Batch transaction envelope for a single inner account.
71
- * @param batch - The autofilled Batch transaction
72
- * @param signerAddress - The XRPL address of the inner account to sign for
73
- * @param options - Optional configuration for the raw sign intent
74
- * @returns The proposed intent response
70
+ * Step 1 of the XLS-56 Batch flow dry-runs a Batch and returns the
71
+ * canonical signing data. Each participant signs `signingPayload` with
72
+ * their own XRPL key; collect signatures and pass them to `proposeBatch`.
73
+ *
74
+ * @param payload - Submitter, execution mode, and inner entries
75
+ * @param options - Optional configuration for the dry-run intent
76
+ * @returns The batch signing data (signingPayload, hash, resolved transactions)
75
77
  */
78
+ dryRunBatch: (payload: BatchPayloadInput, options?: XrplIntentOptions) => Promise<Core_ApiBatchSigningData>;
76
79
  /**
77
- * Signs a Batch transaction envelope for a single inner account and waits
78
- * for the manifest signature. Call once per inner account.
79
- * @param batch - The autofilled Batch transaction
80
+ * Step 2 of the XLS-56 Batch flow signs the `signingPayload` from a dry
81
+ * run for an inner account managed by this custody instance and waits for
82
+ * the manifest signature. Call once per locally-managed signer.
83
+ *
84
+ * @param signingPayload - Hex-encoded payload from `dryRunBatch`
80
85
  * @param signerAddress - The XRPL address of the inner account to sign for
81
86
  * @param options - Optional configuration for the raw sign intent and polling
82
- * @returns The signature and signing public key in uppercase hex
87
+ * @returns Signature, public key, and pre-built BatchSigner shapes
88
+ */
89
+ signBatchPayloadAndWait: (signingPayload: string, signerAddress: string, options?: SignBatchPayloadOptions) => Promise<SignBatchPayloadResult>;
90
+ /**
91
+ * Step 2 of the XLS-56 Batch flow (non-blocking) — proposes the raw sign
92
+ * intent for an inner account managed by this custody instance and returns
93
+ * immediately, without waiting for the manifest signature.
94
+ *
95
+ * Use when the operator approves signatures out-of-band: persist the
96
+ * returned handle and pass it to `getBatchSignature` later to fetch the
97
+ * signature once available.
98
+ *
99
+ * @param signingPayload - Hex-encoded payload from `dryRunBatch`
100
+ * @param signerAddress - The XRPL address of the inner account to sign for
101
+ * @param options - Optional configuration for the raw sign intent
102
+ * @returns A handle with the manifest ID and fields needed to retrieve the signature
103
+ */
104
+ signBatchPayload: (signingPayload: string, signerAddress: string, options?: SignBatchPayloadOptions) => Promise<SignBatchPayloadHandle>;
105
+ /**
106
+ * Retrieves the signature for a payload proposed via `signBatchPayload`,
107
+ * building the BatchSigner shapes when available.
108
+ *
109
+ * Performs a single fetch by default; returns `undefined` if the operator
110
+ * has not approved the signature yet. Pass `maxRetries`/`intervalMs` to opt
111
+ * into light polling.
112
+ *
113
+ * @param params - Fields from the `signBatchPayload` handle (a handle may be passed directly)
114
+ * @param options - Optional polling configuration (defaults to a single attempt)
115
+ * @returns Signature and BatchSigner shapes, or `undefined` if not yet signed
116
+ */
117
+ getBatchSignature: (params: GetBatchSignatureParams, options?: WaitForSignatureOptions) => Promise<SignBatchPayloadResult | undefined>;
118
+ /**
119
+ * Step 3 of the XLS-56 Batch flow — submits the Batch with collected
120
+ * `batchSigners`. Reuse `options.payloadId`/`options.requestId` if you
121
+ * need referential identity with the dry-run.
122
+ *
123
+ * @param payload - Same submitter, execution mode, and entries as the dry-run
124
+ * @param batchSigners - Signatures collected in Step 2
125
+ * @param options - Optional configuration for the intent
126
+ * @returns The proposed intent response
83
127
  */
128
+ proposeBatch: (payload: BatchPayloadInput, batchSigners: Core_BatchSigner[], options?: XrplIntentOptions) => Promise<Core_IntentResponse>;
84
129
  /**
85
130
  * Get the compressed secp256k1 public key for an XRPL account.
86
131
  * @param params - The domain ID and account ID
@@ -1 +1 @@
1
- {"version":3,"file":"ripple-custody.d.ts","sourceRoot":"","sources":["../src/ripple-custody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,MAAM,CAAA;AAClD,OAAO,EACL,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,YAAY,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAG3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,qBAAq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,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;gBAE/C,OAAO,EAAE,0BAA0B;IAmC/C,SAAgB,IAAI;QAClB;;WAEG;;QAGH;;WAEG;;MAEJ;IAGD,SAAgB,IAAI;QAClB;;;;;;;;;;WAUG;gCAEO;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,kBAAkB,CAAA;SAAE,YAChD,iBAAiB,KAC1B,OAAO,CAAC,mBAAmB,CAAC;QAE/B;;;;;WAKG;mCAEgB,sBAAsB,YAC7B,iBAAiB,KAC1B,OAAO,CAAC,mBAAmB,CAAC;QAE/B;;;;;;WAMG;0CAEgB,sBAAsB,YAC7B,qBAAqB,KAC9B,OAAO,CAAC,oBAAoB,CAAC;QAEhC;;;;;;;;WAQG;+BAEQ,iBAAiB,YAChB,iBAAiB,KAC1B,OAAO,CAAC,wBAAwB,CAAC;QAEpC;;;;;;;;;WASG;kDAEe,MAAM,iBACP,MAAM,YACX,uBAAuB,KAChC,OAAO,CAAC,sBAAsB,CAAC;QAGlC;;;;;;;;;;;;;WAaG;2CAEe,MAAM,iBACP,MAAM,YACX,uBAAuB,KAChC,OAAO,CAAC,sBAAsB,CAAC;QAGlC;;;;;;;;;;;WAWG;oCAEO,uBAAuB,YACrB,uBAAuB,KAChC,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;QAG9C;;;;;;;;;WASG;gCAEQ,iBAAiB,gBACZ,gBAAgB,EAAE,YACtB,iBAAiB,KAC1B,OAAO,CAAC,mBAAmB,CAAC;QAG/B;;;;WAIG;+BAC0B;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,KAAG,OAAO,CAAC,MAAM,CAAC;MAEvF;CACF"}
@@ -101,32 +101,65 @@ export class RippleCustody {
101
101
  */
102
102
  rawSignAndWait: async (xrplTransaction, options) => this.xrplService.rawSignAndWait(xrplTransaction, options),
103
103
  /**
104
- * Proposes a raw sign intent for a Batch transaction envelope for a single inner account.
105
- * @param batch - The autofilled Batch transaction
106
- * @param signerAddress - The XRPL address of the inner account to sign for
107
- * @param options - Optional configuration for the raw sign intent
108
- * @returns The proposed intent response
104
+ * Step 1 of the XLS-56 Batch flow dry-runs a Batch and returns the
105
+ * canonical signing data. Each participant signs `signingPayload` with
106
+ * their own XRPL key; collect signatures and pass them to `proposeBatch`.
107
+ *
108
+ * @param payload - Submitter, execution mode, and inner entries
109
+ * @param options - Optional configuration for the dry-run intent
110
+ * @returns The batch signing data (signingPayload, hash, resolved transactions)
109
111
  */
110
- // rawSignInnerBatch: async (
111
- // batch: Batch,
112
- // signerAddress: string,
113
- // options?: RawSignInnerBatchOptions,
114
- // ): Promise<Core_IntentResponse> =>
115
- // this.xrplService.rawSignInnerBatch(batch, signerAddress, options),
112
+ dryRunBatch: async (payload, options) => this.xrplService.dryRunBatch(payload, options),
116
113
  /**
117
- * Signs a Batch transaction envelope for a single inner account and waits
118
- * for the manifest signature. Call once per inner account.
119
- * @param batch - The autofilled Batch transaction
114
+ * Step 2 of the XLS-56 Batch flow signs the `signingPayload` from a dry
115
+ * run for an inner account managed by this custody instance and waits for
116
+ * the manifest signature. Call once per locally-managed signer.
117
+ *
118
+ * @param signingPayload - Hex-encoded payload from `dryRunBatch`
120
119
  * @param signerAddress - The XRPL address of the inner account to sign for
121
120
  * @param options - Optional configuration for the raw sign intent and polling
122
- * @returns The signature and signing public key in uppercase hex
121
+ * @returns Signature, public key, and pre-built BatchSigner shapes
122
+ */
123
+ signBatchPayloadAndWait: async (signingPayload, signerAddress, options) => this.xrplService.signBatchPayloadAndWait(signingPayload, signerAddress, options),
124
+ /**
125
+ * Step 2 of the XLS-56 Batch flow (non-blocking) — proposes the raw sign
126
+ * intent for an inner account managed by this custody instance and returns
127
+ * immediately, without waiting for the manifest signature.
128
+ *
129
+ * Use when the operator approves signatures out-of-band: persist the
130
+ * returned handle and pass it to `getBatchSignature` later to fetch the
131
+ * signature once available.
132
+ *
133
+ * @param signingPayload - Hex-encoded payload from `dryRunBatch`
134
+ * @param signerAddress - The XRPL address of the inner account to sign for
135
+ * @param options - Optional configuration for the raw sign intent
136
+ * @returns A handle with the manifest ID and fields needed to retrieve the signature
137
+ */
138
+ signBatchPayload: async (signingPayload, signerAddress, options) => this.xrplService.signBatchPayload(signingPayload, signerAddress, options),
139
+ /**
140
+ * Retrieves the signature for a payload proposed via `signBatchPayload`,
141
+ * building the BatchSigner shapes when available.
142
+ *
143
+ * Performs a single fetch by default; returns `undefined` if the operator
144
+ * has not approved the signature yet. Pass `maxRetries`/`intervalMs` to opt
145
+ * into light polling.
146
+ *
147
+ * @param params - Fields from the `signBatchPayload` handle (a handle may be passed directly)
148
+ * @param options - Optional polling configuration (defaults to a single attempt)
149
+ * @returns Signature and BatchSigner shapes, or `undefined` if not yet signed
150
+ */
151
+ getBatchSignature: async (params, options) => this.xrplService.getBatchSignature(params, options),
152
+ /**
153
+ * Step 3 of the XLS-56 Batch flow — submits the Batch with collected
154
+ * `batchSigners`. Reuse `options.payloadId`/`options.requestId` if you
155
+ * need referential identity with the dry-run.
156
+ *
157
+ * @param payload - Same submitter, execution mode, and entries as the dry-run
158
+ * @param batchSigners - Signatures collected in Step 2
159
+ * @param options - Optional configuration for the intent
160
+ * @returns The proposed intent response
123
161
  */
124
- // rawSignInnerBatchAndWait: async (
125
- // batch: Batch,
126
- // signerAddress: string,
127
- // options?: RawSignInnerBatchOptions,
128
- // ): Promise<RawSignInnerBatchAndWaitResult> =>
129
- // this.xrplService.rawSignInnerBatchAndWait(batch, signerAddress, options),
162
+ proposeBatch: async (payload, batchSigners, options) => this.xrplService.proposeBatch(payload, batchSigners, options),
130
163
  /**
131
164
  * Get the compressed secp256k1 public key for an XRPL account.
132
165
  * @param params - The domain ID and account ID
@@ -1 +1 @@
1
- {"version":3,"file":"ripple-custody.js","sourceRoot":"","sources":["../src/ripple-custody.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,E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,EAAE,CACnC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,cAAc,EAAE,aAAa,EAAE,OAAO,CAAC;QAE3E;;;;;;;;;;;WAWG;QACH,iBAAiB,EAAE,KAAK,EACtB,MAA+B,EAC/B,OAAiC,EACY,EAAE,CAC/C,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC;QAErD;;;;;;;;;WASG;QACH,YAAY,EAAE,KAAK,EACjB,OAA0B,EAC1B,YAAgC,EAChC,OAA2B,EACG,EAAE,CAChC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC;QAE/D;;;;WAIG;QACH,YAAY,EAAE,KAAK,EAAE,MAA+C,EAAmB,EAAE,CACvF,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC;KACxC,CAAA;CACF"}
@@ -1,3 +1,4 @@
1
+ export { batchSignersToCustodyBatchSigners, batchToCustodyBatchPayload, batchToCustodyInnerTransactions, } from "./xrpl.adapters.js";
1
2
  export { createHttpPorts } from "./xrpl.http-adapters.js";
2
3
  export type { XrplPorts } from "./xrpl.ports.js";
3
4
  export * from "./xrpl.service.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/xrpl/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/xrpl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA"}
@@ -1,7 +1,4 @@
1
- // export {
2
- // batchSignersToCustodyBatchSigners,
3
- // rawTransactionsToInnerTransactions,
4
- // } from "./xrpl.adapters.js"
1
+ export { batchSignersToCustodyBatchSigners, batchToCustodyBatchPayload, batchToCustodyInnerTransactions, } from "./xrpl.adapters.js";
5
2
  export { createHttpPorts } from "./xrpl.http-adapters.js";
6
3
  export * from "./xrpl.service.js";
7
4
  export * from "./xrpl.types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/xrpl/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,uCAAuC;AACvC,wCAAwC;AACxC,8BAA8B;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/xrpl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA"}
@@ -1,13 +1,31 @@
1
- export {};
1
+ import { type Batch, type BatchSigner } from "xrpl";
2
+ import type { BatchPayloadInput, CustodyBatchSigner, CustodyInnerTransaction } from "./xrpl.types.js";
2
3
  /**
3
4
  * Converts an XRPL SDK BatchSigners array (from a signed Batch transaction)
4
5
  * to the batchSigners format required by the Ripple Custody API.
5
6
  */
7
+ export declare const batchSignersToCustodyBatchSigners: (batchSigners: BatchSigner[]) => CustodyBatchSigner[];
6
8
  /**
7
- * Converts an XRPL SDK Batch.RawTransactions array to the innerTransactions
8
- * format required by the Ripple Custody API.
9
+ * Converts an autofilled xrpl.js Batch into a `BatchPayloadInput` for
10
+ * `dryRunBatch` / `proposeBatch`.
9
11
  *
10
- * Supported transaction types: Payment, OfferCreate, TrustSet, AccountSet, TicketCreate.
11
- * Throws for any other type.
12
+ * - `Flags` is required and must set exactly one execution-mode flag
13
+ * (`tfAllOrNothing` / `tfOnlyOne` / `tfUntilFailure` / `tfIndependent`)
14
+ * - When `Sequence` is present on the outer Batch, it is mapped to
15
+ * `{ type: "AccountSequence", value: Sequence }`; otherwise `sequencing`
16
+ * is omitted so the service default `{ type: "PlatformManaged" }` applies
17
+ * - `LastLedgerSequence` is passed through when present
18
+ * - `BatchSigners` on the input is ignored — collect signatures separately
19
+ * and pass them to `proposeBatch`
12
20
  */
21
+ export declare const batchToCustodyBatchPayload: (batch: Batch) => BatchPayloadInput;
22
+ /**
23
+ * Converts an xrpl.js Batch transaction to the inner transactions array
24
+ * required by the Ripple Custody API.
25
+ *
26
+ * Each inner transaction is emitted as a `SubmitterOperation` when its
27
+ * `Account` matches the outer `Batch.Account` (the submitter), and as a
28
+ * `ParticipantOperation` otherwise.
29
+ */
30
+ export declare const batchToCustodyInnerTransactions: (batch: Pick<Batch, "Account" | "RawTransactions">) => CustodyInnerTransaction[];
13
31
  //# sourceMappingURL=xrpl.adapters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"xrpl.adapters.d.ts","sourceRoot":"","sources":["../../../src/services/xrpl/xrpl.adapters.ts"],"names":[],"mappings":";AAiRA;;;GAGG;AAWH;;;;;;GAMG"}
1
+ {"version":3,"file":"xrpl.adapters.d.ts","sourceRoot":"","sources":["../../../src/services/xrpl/xrpl.adapters.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,KAAK,EAEV,KAAK,WAAW,EAOjB,MAAM,MAAM,CAAA;AAGb,OAAO,KAAK,EACV,iBAAiB,EAIjB,kBAAkB,EAClB,uBAAuB,EAGxB,MAAM,iBAAiB,CAAA;AAkQxB;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAC5C,cAAc,WAAW,EAAE,KAC1B,kBAAkB,EASpB,CAAA;AAyCD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,GAAI,OAAO,KAAK,KAAG,iBAYzD,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAC1C,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB,CAAC,KAChD,uBAAuB,EAmBzB,CAAA"}