@apicity/fal 0.1.0-alpha.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.
@@ -0,0 +1,8 @@
1
+ export interface EndpointExample {
2
+ source: string;
3
+ payload: unknown;
4
+ }
5
+ declare const EXAMPLES: Record<string, EndpointExample>;
6
+ export default EXAMPLES;
7
+ export declare function attachExamples<T>(provider: T): T;
8
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../src/example.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAqW7C,CAAC;AAEF,eAAe,QAAQ,CAAC;AAOxB,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CA6ChD"}
@@ -0,0 +1,442 @@
1
+ // Auto-generated by `pnpm run gen:examples` — do not edit by hand.
2
+ // Source: tests/recordings/<provider>_*/<test>_*/recording.har
3
+ //
4
+ // Each entry is the green-path payload for one endpoint, mined from a real
5
+ // integration-test recording. `attachExamples` walks the provider tree and
6
+ // hangs the matching entry off each endpoint function as `.example`.
7
+ const EXAMPLES = {
8
+ "POST bytedance.seedance2p0.fast.imageToVideo": {
9
+ "source": "fal/bytedance-seedance2p0-fast-image-to-video",
10
+ "payload": {
11
+ "prompt": "A white odd-eyed cat blinks slowly and tilts its head, soft breeze through fur, cinematic close-up.",
12
+ "image_url": "<inline image/jpeg data URL — replace with a real URL or upload>",
13
+ "resolution": "480p",
14
+ "duration": "4",
15
+ "aspect_ratio": "1:1",
16
+ "generate_audio": false
17
+ }
18
+ },
19
+ "POST bytedance.seedance2p0.fast.textToVideo": {
20
+ "source": "fal/bytedance-seedance2p0-fast-text-to-video",
21
+ "payload": {
22
+ "prompt": "A white odd-eyed cat blinks slowly and tilts its head, soft breeze through fur, cinematic close-up.",
23
+ "resolution": "480p",
24
+ "duration": "4",
25
+ "aspect_ratio": "1:1",
26
+ "generate_audio": false
27
+ }
28
+ },
29
+ "POST bytedance.seedance2p0.imageToVideo": {
30
+ "source": "fal/bytedance-seedance2p0-image-to-video",
31
+ "payload": {
32
+ "prompt": "A white odd-eyed cat blinks slowly and tilts its head, soft breeze through fur, cinematic close-up.",
33
+ "image_url": "<inline image/jpeg data URL — replace with a real URL or upload>",
34
+ "resolution": "480p",
35
+ "duration": "4",
36
+ "aspect_ratio": "1:1",
37
+ "generate_audio": false
38
+ }
39
+ },
40
+ "POST bytedance.seedance2p0.textToVideo": {
41
+ "source": "fal/bytedance-seedance2p0-text-to-video",
42
+ "payload": {
43
+ "prompt": "A white odd-eyed cat blinks slowly and tilts its head, soft breeze through fur, cinematic close-up.",
44
+ "resolution": "480p",
45
+ "duration": "4",
46
+ "aspect_ratio": "1:1",
47
+ "generate_audio": false
48
+ }
49
+ },
50
+ "POST bytedance.seedream.v5.lite.edit": {
51
+ "source": "fal/bytedance-seedream-v5-lite-edit",
52
+ "payload": {
53
+ "prompt": "Change the background to a beautiful sunset beach scene with palm trees",
54
+ "image_urls": [
55
+ "<inline image/jpeg data URL — replace with a real URL or upload>"
56
+ ],
57
+ "num_images": 1,
58
+ "enable_safety_checker": true
59
+ }
60
+ },
61
+ "POST bytedance.seedream.v5.lite.textToImage": {
62
+ "source": "fal/bytedance-seedream-v5-lite-text-to-image",
63
+ "payload": {
64
+ "prompt": "A photorealistic red fox sitting in a snowy forest clearing at golden hour",
65
+ "num_images": 1,
66
+ "enable_safety_checker": true
67
+ }
68
+ },
69
+ "POST falAi.elevenlabs.speechToText.scribeV2": {
70
+ "source": "fal/elevenlabs-speech-to-text-scribe-v2",
71
+ "payload": {
72
+ "audio_url": "https://storage.googleapis.com/falserverless/example_inputs/elevenlabs/scribe_v2_in.mp3",
73
+ "language_code": "eng",
74
+ "tag_audio_events": true,
75
+ "diarize": true
76
+ }
77
+ },
78
+ "POST gptImage1p5.edit": {
79
+ "source": "fal/gpt-image-1.5",
80
+ "payload": {
81
+ "prompt": "An action shot of a black lab swimming in an inground suburban swimming pool.",
82
+ "num_images": 1,
83
+ "image_size": "1024x1024",
84
+ "output_format": "png",
85
+ "quality": "low"
86
+ }
87
+ },
88
+ "POST hunyuan.v3.instructEdit": {
89
+ "source": "fal/hunyuan-image-v3-instruct-edit",
90
+ "payload": {
91
+ "prompt": "Turn this cat into a watercolor painting",
92
+ "image_urls": [
93
+ "<inline image/jpeg data URL — replace with a real URL or upload>"
94
+ ],
95
+ "num_images": 1,
96
+ "enable_safety_checker": true
97
+ }
98
+ },
99
+ "POST klingVideo.o3p4k.imageToVideo": {
100
+ "source": "fal/kling-video-o3p4k-image-to-video",
101
+ "payload": {
102
+ "image_url": "<inline image/jpeg data URL — replace with a real URL or upload>",
103
+ "prompt": "the man waves at the camera as the wind blows his hair",
104
+ "duration": "5",
105
+ "generate_audio": false
106
+ }
107
+ },
108
+ "POST klingVideo.o3p4k.referenceToVideo": {
109
+ "source": "fal/kling-video-o3p4k-reference-to-video",
110
+ "payload": {
111
+ "start_image_url": "<inline image/jpeg data URL — replace with a real URL or upload>",
112
+ "prompt": "the man waves at the camera as the wind blows his hair",
113
+ "duration": "5",
114
+ "generate_audio": false,
115
+ "aspect_ratio": "16:9"
116
+ }
117
+ },
118
+ "POST klingVideo.o3p4k.textToVideo": {
119
+ "source": "fal/kling-video-o3p4k-text-to-video",
120
+ "payload": {
121
+ "prompt": "A mecha lands on the ground to save the city, and says \"I'm here\", in anime style",
122
+ "aspect_ratio": "16:9",
123
+ "duration": "5",
124
+ "generate_audio": false
125
+ }
126
+ },
127
+ "POST klingVideo.v3.pro.imageToVideo": {
128
+ "source": "fal/kling-video-v3-pro-image-to-video",
129
+ "payload": {
130
+ "start_image_url": "<inline image/jpeg data URL — replace with a real URL or upload>",
131
+ "prompt": "the man waves at the camera as the wind blows his hair",
132
+ "duration": "5",
133
+ "generate_audio": false
134
+ }
135
+ },
136
+ "POST klingVideo.v3.pro.textToVideo": {
137
+ "source": "fal/kling-video-v3-pro-text-to-video",
138
+ "payload": {
139
+ "prompt": "A white odd-eyed cat blinks slowly and tilts its head, soft breeze through fur, cinematic close-up.",
140
+ "aspect_ratio": "1:1",
141
+ "duration": "5",
142
+ "generate_audio": false
143
+ }
144
+ },
145
+ "POST klingVideo.v3.standard.imageToVideo": {
146
+ "source": "fal/kling-video-v3-standard-image-to-video",
147
+ "payload": {
148
+ "start_image_url": "<inline image/jpeg data URL — replace with a real URL or upload>",
149
+ "prompt": "the man waves at the camera as the wind blows his hair",
150
+ "duration": "5",
151
+ "generate_audio": false
152
+ }
153
+ },
154
+ "POST klingVideo.v3.standard.textToVideo": {
155
+ "source": "fal/kling-video-v3-standard-text-to-video",
156
+ "payload": {
157
+ "prompt": "A white odd-eyed cat blinks slowly and tilts its head, soft breeze through fur, cinematic close-up.",
158
+ "aspect_ratio": "1:1",
159
+ "duration": "5",
160
+ "generate_audio": false
161
+ }
162
+ },
163
+ "POST nanoBanana.edit": {
164
+ "source": "fal/nano-banana",
165
+ "payload": {
166
+ "prompt": "An action shot of a black lab swimming in an inground suburban swimming pool.",
167
+ "num_images": 1,
168
+ "aspect_ratio": "1:1",
169
+ "output_format": "png",
170
+ "safety_tolerance": "4"
171
+ }
172
+ },
173
+ "POST nanoBanana2.edit": {
174
+ "source": "fal/nano-banana-2",
175
+ "payload": {
176
+ "prompt": "An action shot of a black lab swimming in an inground suburban swimming pool.",
177
+ "num_images": 1,
178
+ "aspect_ratio": "1:1",
179
+ "output_format": "png",
180
+ "safety_tolerance": "4",
181
+ "resolution": "1K"
182
+ }
183
+ },
184
+ "POST nanoBananaPro.edit": {
185
+ "source": "fal/nano-banana-pro",
186
+ "payload": {
187
+ "prompt": "An action shot of a black lab swimming in an inground suburban swimming pool.",
188
+ "num_images": 1,
189
+ "aspect_ratio": "1:1",
190
+ "output_format": "png",
191
+ "safety_tolerance": "4",
192
+ "resolution": "1K"
193
+ }
194
+ },
195
+ "POST qwenImage": {
196
+ "source": "fal/qwen-image",
197
+ "payload": {
198
+ "prompt": "An action shot of a black lab swimming in an inground suburban swimming pool.",
199
+ "num_images": 1,
200
+ "image_size": "square_hd",
201
+ "output_format": "png",
202
+ "num_inference_steps": 30
203
+ }
204
+ },
205
+ "POST qwenImage.edit": {
206
+ "source": "fal/qwen-image-edit",
207
+ "payload": {
208
+ "prompt": "change the background to a red mercedes convertible on the california coastline at sunset",
209
+ "image_url": "<inline image/jpeg data URL — replace with a real URL or upload>",
210
+ "num_images": 1
211
+ }
212
+ },
213
+ "POST sora2.imageToVideo": {
214
+ "source": "fal/sora-2-image-to-video",
215
+ "payload": {
216
+ "prompt": "the man waves at the camera as the wind blows his hair",
217
+ "image_url": "<inline image/jpeg data URL — replace with a real URL or upload>",
218
+ "aspect_ratio": "16:9",
219
+ "duration": 4
220
+ }
221
+ },
222
+ "POST sora2.textToVideo": {
223
+ "source": "fal/sora-2",
224
+ "payload": {
225
+ "prompt": "A black lab swimming in an inground suburban swimming pool at sunset.",
226
+ "aspect_ratio": "16:9",
227
+ "duration": 4
228
+ }
229
+ },
230
+ "POST storage.upload.initiate": {
231
+ "source": "fal/storage-upload-initiate",
232
+ "payload": {
233
+ "file_name": "cat1.jpg",
234
+ "content_type": "image/jpeg"
235
+ }
236
+ },
237
+ "POST v1.models.pricing.estimate": {
238
+ "source": "fal/estimate-cost",
239
+ "payload": {
240
+ "estimate_type": "unit_price",
241
+ "endpoints": {
242
+ "fal-ai/flux/dev": {
243
+ "unit_quantity": 100
244
+ }
245
+ }
246
+ }
247
+ },
248
+ "POST veo3p1.imageToVideo": {
249
+ "source": "fal/veo3-1",
250
+ "payload": {
251
+ "prompt": "A black lab swimming in an inground suburban swimming pool at sunset.",
252
+ "aspect_ratio": "16:9",
253
+ "duration": "4s",
254
+ "resolution": "720p",
255
+ "generate_audio": false
256
+ }
257
+ },
258
+ "POST wan.v2p7.edit": {
259
+ "source": "fal/wan-v2p7-edit",
260
+ "payload": {
261
+ "prompt": "Turn image 1 into a watercolor painting.",
262
+ "image_urls": [
263
+ "https://storage.googleapis.com/falserverless/model_tests/wan/dragon-warrior.jpg"
264
+ ],
265
+ "num_images": 1,
266
+ "enable_safety_checker": true
267
+ }
268
+ },
269
+ "POST wan.v2p7.imageToVideo": {
270
+ "source": "fal/wan-v2p7-image-to-video",
271
+ "payload": {
272
+ "prompt": "A white odd-eyed cat blinks slowly and tilts its head, soft breeze through fur, cinematic close-up.",
273
+ "image_url": "<inline image/jpeg data URL — replace with a real URL or upload>",
274
+ "resolution": "720p",
275
+ "duration": 2
276
+ }
277
+ },
278
+ "POST wan.v2p7.pro.edit": {
279
+ "source": "fal/wan-v2p7-pro-edit",
280
+ "payload": {
281
+ "prompt": "Turn image 1 into a watercolor painting.",
282
+ "image_urls": [
283
+ "https://storage.googleapis.com/falserverless/model_tests/wan/dragon-warrior.jpg"
284
+ ],
285
+ "num_images": 1,
286
+ "enable_safety_checker": true
287
+ }
288
+ },
289
+ "POST wan.v2p7.pro.textToImage": {
290
+ "source": "fal/wan-v2p7-pro-text-to-image",
291
+ "payload": {
292
+ "prompt": "An astronaut riding a horse in a photorealistic style.",
293
+ "max_images": 1,
294
+ "enable_safety_checker": true
295
+ }
296
+ },
297
+ "POST wan.v2p7.textToImage": {
298
+ "source": "fal/wan-v2p7-text-to-image",
299
+ "payload": {
300
+ "prompt": "An astronaut riding a horse in a photorealistic style.",
301
+ "max_images": 1,
302
+ "enable_safety_checker": true
303
+ }
304
+ },
305
+ "POST wan.v2p7.textToVideo": {
306
+ "source": "fal/wan-v2p7-text-to-video",
307
+ "payload": {
308
+ "prompt": "A white odd-eyed cat blinks slowly and tilts its head, soft breeze through fur, cinematic close-up.",
309
+ "resolution": "720p",
310
+ "duration": 2,
311
+ "aspect_ratio": "1:1"
312
+ }
313
+ },
314
+ "POST xai.grokImagineImage.edit": {
315
+ "source": "fal/xai-grok-imagine-image-edit",
316
+ "payload": {
317
+ "prompt": "Make this scene more realistic but still keep the game vibes",
318
+ "num_images": 1,
319
+ "resolution": "1k",
320
+ "output_format": "jpeg",
321
+ "image_urls": [
322
+ "https://v3b.fal.media/files/b/0a8b911d/Abk8vStrvmSPlzUqI_NN3_image_043.png"
323
+ ]
324
+ }
325
+ },
326
+ "POST xai.grokImagineVideo.editVideo": {
327
+ "source": "fal/xai-grok-imagine-video-edit-video",
328
+ "payload": {
329
+ "prompt": "Colorize the video with warm sunset tones",
330
+ "video_url": "<inline video/mp4 data URL — replace with a real URL or upload>",
331
+ "resolution": "480p"
332
+ }
333
+ },
334
+ "POST xai.grokImagineVideo.extendVideo": {
335
+ "source": "fal/xai-grok-imagine-video-extend-video",
336
+ "payload": {
337
+ "prompt": "The camera slowly zooms out to reveal the city skyline at sunset",
338
+ "video_url": "<inline video/mp4 data URL — replace with a real URL or upload>",
339
+ "duration": 4
340
+ }
341
+ },
342
+ "POST xai.grokImagineVideo.imageToVideo": {
343
+ "source": "fal/xai-grok-imagine-video-image-to-video",
344
+ "payload": {
345
+ "prompt": "the man waves at the camera as the wind blows his hair",
346
+ "image_url": "<inline image/jpeg data URL — replace with a real URL or upload>",
347
+ "duration": 6,
348
+ "aspect_ratio": "16:9",
349
+ "resolution": "720p"
350
+ }
351
+ },
352
+ "POST xai.grokImagineVideo.referenceToVideo": {
353
+ "source": "fal/xai-grok-imagine-video-reference-to-video",
354
+ "payload": {
355
+ "prompt": "A @Image1 walking through a sunlit meadow, cinematic slow motion",
356
+ "reference_image_urls": [
357
+ "<inline image/jpeg data URL — replace with a real URL or upload>"
358
+ ],
359
+ "duration": 6,
360
+ "aspect_ratio": "16:9",
361
+ "resolution": "480p"
362
+ }
363
+ }
364
+ };
365
+ export default EXAMPLES;
366
+ // Walks each "<METHOD> <dotPath>" key onto the provider's tree. Tries the
367
+ // standard `provider.<method>.<dotPath>` shape first, then a few fallbacks
368
+ // to cover providers with non-standard layouts (fal's `.run.` namespace,
369
+ // kie's sub-providers, `free`'s flat root). Returns the same provider for
370
+ // drop-in use as `return attachExamples({ ... });`.
371
+ export function attachExamples(provider) {
372
+ const root = provider;
373
+ const HTTP_KEYS = new Set(["post", "get", "put", "delete", "patch", "head"]);
374
+ for (const [key, example] of Object.entries(EXAMPLES)) {
375
+ const sp = key.indexOf(" ");
376
+ if (sp < 0)
377
+ continue;
378
+ const method = key.slice(0, sp).toLowerCase();
379
+ const segs = key.slice(sp + 1).split(".");
380
+ const candidates = [
381
+ root[method],
382
+ root[method]?.run,
383
+ root,
384
+ ];
385
+ if (segs.length > 1) {
386
+ const sub = root[segs[0]];
387
+ if (sub && typeof sub === "object") {
388
+ const subMethod = sub[method];
389
+ if (subMethod)
390
+ candidates.push({ __nested: subMethod, __segs: segs.slice(1) });
391
+ }
392
+ }
393
+ let attached = false;
394
+ for (const c of candidates) {
395
+ const fn = walkToFn(c, segs);
396
+ if (fn) {
397
+ Object.assign(fn, { example });
398
+ attached = true;
399
+ break;
400
+ }
401
+ }
402
+ if (attached)
403
+ continue;
404
+ for (const k of Object.keys(root)) {
405
+ if (HTTP_KEYS.has(k))
406
+ continue;
407
+ if (!segs.includes(k))
408
+ continue;
409
+ const sub = root[k];
410
+ if (!sub || typeof sub !== "object")
411
+ continue;
412
+ const subMethod = sub[method];
413
+ if (!subMethod)
414
+ continue;
415
+ const fn = walkToFn(subMethod, segs);
416
+ if (fn) {
417
+ Object.assign(fn, { example });
418
+ break;
419
+ }
420
+ }
421
+ }
422
+ return provider;
423
+ }
424
+ function walkToFn(start, segs) {
425
+ if (start && typeof start === "object" && "__nested" in start) {
426
+ const wrapper = start;
427
+ return walkToFn(wrapper.__nested, wrapper.__segs);
428
+ }
429
+ let cur = start;
430
+ for (const seg of segs) {
431
+ if (cur === null || cur === undefined)
432
+ return null;
433
+ const t = typeof cur;
434
+ if (t !== "object" && t !== "function")
435
+ return null;
436
+ cur = cur[seg];
437
+ }
438
+ return typeof cur === "function"
439
+ ? cur
440
+ : null;
441
+ }
442
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","sourceRoot":"","sources":["../../src/example.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,qEAAqE;AAOrE,MAAM,QAAQ,GAAoC;IAChD,8CAA8C,EAAE;QAC9C,QAAQ,EAAE,+CAA+C;QACzD,SAAS,EAAE;YACT,QAAQ,EAAE,qGAAqG;YAC/G,WAAW,EAAE,kEAAkE;YAC/E,YAAY,EAAE,MAAM;YACpB,UAAU,EAAE,GAAG;YACf,cAAc,EAAE,KAAK;YACrB,gBAAgB,EAAE,KAAK;SACxB;KACF;IACD,6CAA6C,EAAE;QAC7C,QAAQ,EAAE,8CAA8C;QACxD,SAAS,EAAE;YACT,QAAQ,EAAE,qGAAqG;YAC/G,YAAY,EAAE,MAAM;YACpB,UAAU,EAAE,GAAG;YACf,cAAc,EAAE,KAAK;YACrB,gBAAgB,EAAE,KAAK;SACxB;KACF;IACD,yCAAyC,EAAE;QACzC,QAAQ,EAAE,0CAA0C;QACpD,SAAS,EAAE;YACT,QAAQ,EAAE,qGAAqG;YAC/G,WAAW,EAAE,kEAAkE;YAC/E,YAAY,EAAE,MAAM;YACpB,UAAU,EAAE,GAAG;YACf,cAAc,EAAE,KAAK;YACrB,gBAAgB,EAAE,KAAK;SACxB;KACF;IACD,wCAAwC,EAAE;QACxC,QAAQ,EAAE,yCAAyC;QACnD,SAAS,EAAE;YACT,QAAQ,EAAE,qGAAqG;YAC/G,YAAY,EAAE,MAAM;YACpB,UAAU,EAAE,GAAG;YACf,cAAc,EAAE,KAAK;YACrB,gBAAgB,EAAE,KAAK;SACxB;KACF;IACD,sCAAsC,EAAE;QACtC,QAAQ,EAAE,qCAAqC;QAC/C,SAAS,EAAE;YACT,QAAQ,EAAE,yEAAyE;YACnF,YAAY,EAAE;gBACZ,k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CAAC;QACnD,MAAM,CAAC,GAAG,OAAO,GAAG,CAAC;QACrB,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,UAAU;YAAE,OAAO,IAAI,CAAC;QACpD,GAAG,GAAI,GAA+B,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,OAAO,GAAG,KAAK,UAAU;QAC9B,CAAC,CAAE,GAAuC;QAC1C,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { FalOptions, FalProvider, FalStorageLifecycle } from "./types";
2
+ export declare function buildQueryString(params: Record<string, unknown>): string;
3
+ export declare function fal(opts: FalOptions): FalProvider;
4
+ export declare function uploadFile(provider: FalProvider, args: {
5
+ data: Uint8Array | Buffer | Blob;
6
+ filename: string;
7
+ contentType: string;
8
+ storage_type?: "fal-cdn-v3";
9
+ lifecycle?: FalStorageLifecycle;
10
+ }, signal?: AbortSignal): Promise<string>;
11
+ //# sourceMappingURL=fal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fal.d.ts","sourceRoot":"","sources":["../../src/fal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,WAAW,EAsGX,mBAAmB,EA2BpB,MAAM,SAAS,CAAC;AA0EjB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAgBxE;AAmED,wBAAgB,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,CAuyEjD;AAKD,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE;IACJ,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC,EACD,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,CAAC,CAgCjB"}