@immediately-run/sandpack-client 2.19.8

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 (49) hide show
  1. package/README.md +26 -0
  2. package/dist/.ir-build-stamp.json +6 -0
  3. package/dist/base-DBh7xJX9.mjs +48 -0
  4. package/dist/base-DelKLlDk.js +50 -0
  5. package/dist/clients/base.d.ts +34 -0
  6. package/dist/clients/event-emitter.d.ts +10 -0
  7. package/dist/clients/iframe-factory.d.ts +27 -0
  8. package/dist/clients/index.d.ts +4 -0
  9. package/dist/clients/node/client.utils.d.ts +7 -0
  10. package/dist/clients/node/iframe.utils.d.ts +3 -0
  11. package/dist/clients/node/index.d.ts +49 -0
  12. package/dist/clients/node/index.js +631 -0
  13. package/dist/clients/node/index.mjs +629 -0
  14. package/dist/clients/node/inject-scripts/historyListener.d.ts +5 -0
  15. package/dist/clients/node/inject-scripts/index.d.ts +1 -0
  16. package/dist/clients/node/inject-scripts/resize.d.ts +5 -0
  17. package/dist/clients/node/taskManager.d.ts +20 -0
  18. package/dist/clients/node/types.d.ts +63 -0
  19. package/dist/clients/runtime/file-resolver-protocol.d.ts +17 -0
  20. package/dist/clients/runtime/iframe-protocol.d.ts +17 -0
  21. package/dist/clients/runtime/immutable-fetch-protocol.d.ts +39 -0
  22. package/dist/clients/runtime/index.d.ts +76 -0
  23. package/dist/clients/runtime/index.js +1046 -0
  24. package/dist/clients/runtime/index.mjs +1044 -0
  25. package/dist/clients/runtime/mime.d.ts +1 -0
  26. package/dist/clients/runtime/types.d.ts +129 -0
  27. package/dist/clients/runtime/utils.d.ts +8 -0
  28. package/dist/clients/static/index.d.ts +25 -0
  29. package/dist/clients/static/utils.d.ts +5 -0
  30. package/dist/consoleHook-DQVWjDRE.mjs +230 -0
  31. package/dist/consoleHook-znXctRzh.js +236 -0
  32. package/dist/fs/SandpackFS.d.ts +116 -0
  33. package/dist/iframe-factory-BcC-S_XQ.js +54 -0
  34. package/dist/iframe-factory-DybmkzJZ.mjs +51 -0
  35. package/dist/index--fILWAw8.js +210 -0
  36. package/dist/index-rbhm_KmF.mjs +208 -0
  37. package/dist/index.d.ts +4 -0
  38. package/dist/index.js +53 -0
  39. package/dist/index.mjs +40 -0
  40. package/dist/inject-scripts/consoleHook.d.ts +6 -0
  41. package/dist/types-BFONOA2L.mjs +531 -0
  42. package/dist/types-BIIEoWr6.js +534 -0
  43. package/dist/types.d.ts +348 -0
  44. package/dist/utils-BiVyytui.js +262 -0
  45. package/dist/utils-DG1HA4RZ.mjs +250 -0
  46. package/dist/utils.d.ts +18 -0
  47. package/dist/utils.js +13 -0
  48. package/dist/utils.mjs +2 -0
  49. package/package.json +82 -0
@@ -0,0 +1,531 @@
1
+ import { _ as __awaiter, a as __generator, h as __assign } from './utils-DG1HA4RZ.mjs';
2
+ import { mount, bindContext, resolveMountConfig, InMemory } from '@zenfs/core';
3
+
4
+ /**
5
+ * Path (within the SandpackFS) of the sidecar metadata file. Anything below
6
+ * `/.sandpack/` is treated as internal and excluded from {@link SandpackFS.list}.
7
+ */
8
+ var META_PATH = "/.sandpack/meta.json";
9
+ var META_DIR = "/.sandpack";
10
+ var mountCounter = 0;
11
+ var normalize = function (path) {
12
+ return path.startsWith("/") ? path : "/".concat(path);
13
+ };
14
+ /**
15
+ * A filesystem-shaped handle over the files Sandpack renders. It wraps a
16
+ * ZenFS @see FileSystem mounted at a unique path prefix so multiple
17
+ * `SandpackProvider` instances stay isolated.
18
+ *
19
+ * All reads / writes are async. Changes emit a single coalesced notification
20
+ * (watcher or explicit helper calls) so React can subscribe via
21
+ * `useSyncExternalStore`.
22
+ */
23
+ var SandpackFS = /** @class */ (function () {
24
+ function SandpackFS(fsContext, remotePortFactory,
25
+ // Invoked after a LOCAL editor write (writeFile) lands in the backing fs,
26
+ // with the normalized repo-relative path. The host uses it to record overlay
27
+ // provenance (COW_OVERLAY_PROVENANCE_SPEC §5 — the writer declares intent);
28
+ // iframe writes go through `remotePortFactory`/`handleRemoteChange` instead.
29
+ onWrite) {
30
+ this.fsContext = fsContext;
31
+ this.remotePortFactory = remotePortFactory;
32
+ this.onWrite = onWrite;
33
+ this.listeners = new Set();
34
+ this.metaCache = {};
35
+ this.sidecarEnvironment = undefined;
36
+ this.sidecarMode = undefined;
37
+ this.disposed = false;
38
+ }
39
+ /**
40
+ * Create the `MessagePort` shared with the child iframe, wiring the iframe's
41
+ * write notifications back into this instance. The host's factory forwards
42
+ * `onRemoteChange` to `exportZenFS`, which calls it whenever the iframe writes
43
+ * a file over the Port — surfaced here as an `external` change.
44
+ */
45
+ SandpackFS.prototype.connectRemote = function () {
46
+ var _this = this;
47
+ return this.remotePortFactory(function (path) { return _this.handleRemoteChange(path); });
48
+ };
49
+ /**
50
+ * Create a new filesystem backed by an InMemory store and seed it with the
51
+ * given files.
52
+ */
53
+ SandpackFS.fromFiles = function () {
54
+ return __awaiter(this, arguments, void 0, function (files, options, remotePortFactory, onWrite) {
55
+ var id, prefix, backend, ctxt, instance;
56
+ if (files === void 0) { files = {}; }
57
+ if (options === void 0) { options = {}; }
58
+ return __generator(this, function (_a) {
59
+ switch (_a.label) {
60
+ case 0:
61
+ id = ++mountCounter;
62
+ prefix = "/__sandpack_".concat(id);
63
+ return [4 /*yield*/, resolveMountConfig({ backend: InMemory })];
64
+ case 1:
65
+ backend = _a.sent();
66
+ mount(prefix, backend);
67
+ ctxt = bindContext({ root: prefix });
68
+ instance = new SandpackFS(ctxt, remotePortFactory, onWrite);
69
+ if (options.environment !== undefined) {
70
+ instance.sidecarEnvironment = options.environment;
71
+ }
72
+ if (options.mode !== undefined) {
73
+ instance.sidecarMode = options.mode;
74
+ }
75
+ return [4 /*yield*/, instance.writeInitial(files)];
76
+ case 2:
77
+ _a.sent();
78
+ return [2 /*return*/, instance];
79
+ }
80
+ });
81
+ });
82
+ };
83
+ /**
84
+ * Adopt an existing ZenFS filesystem. The caller is responsible for its
85
+ * lifecycle - {@link dispose} will unmount but not destroy the underlying
86
+ * store.
87
+ */
88
+ SandpackFS.fromFileSystemContext = function (
89
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
+ fsContext, remotePortFactory, onWrite) {
91
+ return __awaiter(this, void 0, void 0, function () {
92
+ var instance;
93
+ return __generator(this, function (_a) {
94
+ switch (_a.label) {
95
+ case 0:
96
+ instance = new SandpackFS(fsContext, remotePortFactory, onWrite);
97
+ return [4 /*yield*/, instance.ensureMetaDir()];
98
+ case 1:
99
+ _a.sent();
100
+ return [4 /*yield*/, instance.refreshMetaCache()];
101
+ case 2:
102
+ _a.sent();
103
+ return [2 /*return*/, instance];
104
+ }
105
+ });
106
+ });
107
+ };
108
+ // ------------------------------------------------------------------
109
+ // Core file ops
110
+ // ------------------------------------------------------------------
111
+ /**
112
+ * Return every visible file path (leading `/`). Metadata sidecar and
113
+ * everything under `/.sandpack/` is excluded.
114
+ */
115
+ SandpackFS.prototype.list = function () {
116
+ return __awaiter(this, void 0, void 0, function () {
117
+ var paths;
118
+ return __generator(this, function (_a) {
119
+ switch (_a.label) {
120
+ case 0:
121
+ paths = [];
122
+ return [4 /*yield*/, this.walk("/", paths)];
123
+ case 1:
124
+ _a.sent();
125
+ paths.sort();
126
+ return [2 /*return*/, paths];
127
+ }
128
+ });
129
+ });
130
+ };
131
+ SandpackFS.prototype.readFile = function (path) {
132
+ return __awaiter(this, void 0, void 0, function () {
133
+ return __generator(this, function (_a) {
134
+ switch (_a.label) {
135
+ case 0: return [4 /*yield*/, this.fsContext.fs.promises.readFile(this.toAbs(path), "utf8")];
136
+ case 1: return [2 /*return*/, (_a.sent())];
137
+ }
138
+ });
139
+ });
140
+ };
141
+ SandpackFS.prototype.writeFile = function (path, content) {
142
+ return __awaiter(this, void 0, void 0, function () {
143
+ var abs, normalized;
144
+ var _a;
145
+ return __generator(this, function (_b) {
146
+ switch (_b.label) {
147
+ case 0:
148
+ abs = this.toAbs(path);
149
+ return [4 /*yield*/, this.ensureParent(abs)];
150
+ case 1:
151
+ _b.sent();
152
+ return [4 /*yield*/, this.fsContext.fs.promises.writeFile(abs, content)];
153
+ case 2:
154
+ _b.sent();
155
+ normalized = normalize(path);
156
+ this.notify({ path: normalized, external: false });
157
+ // A local editor write — declare it to the host's provenance recorder.
158
+ (_a = this.onWrite) === null || _a === void 0 ? void 0 : _a.call(this, normalized);
159
+ return [2 /*return*/];
160
+ }
161
+ });
162
+ });
163
+ };
164
+ SandpackFS.prototype.unlink = function (path) {
165
+ return __awaiter(this, void 0, void 0, function () {
166
+ var normalized;
167
+ return __generator(this, function (_a) {
168
+ switch (_a.label) {
169
+ case 0: return [4 /*yield*/, this.fsContext.fs.promises.unlink(this.toAbs(path))];
170
+ case 1:
171
+ _a.sent();
172
+ normalized = normalize(path);
173
+ if (!(normalized in this.metaCache)) return [3 /*break*/, 3];
174
+ delete this.metaCache[normalized];
175
+ return [4 /*yield*/, this.persistMeta()];
176
+ case 2:
177
+ _a.sent();
178
+ _a.label = 3;
179
+ case 3:
180
+ this.notify({ path: normalized, external: false });
181
+ return [2 /*return*/];
182
+ }
183
+ });
184
+ });
185
+ };
186
+ SandpackFS.prototype.exists = function (path) {
187
+ return __awaiter(this, void 0, void 0, function () {
188
+ return __generator(this, function (_b) {
189
+ switch (_b.label) {
190
+ case 0:
191
+ _b.trys.push([0, 2, , 3]);
192
+ return [4 /*yield*/, this.fsContext.fs.promises.stat(this.toAbs(path))];
193
+ case 1:
194
+ _b.sent();
195
+ return [2 /*return*/, true];
196
+ case 2:
197
+ _b.sent();
198
+ return [2 /*return*/, false];
199
+ case 3: return [2 /*return*/];
200
+ }
201
+ });
202
+ });
203
+ };
204
+ // ------------------------------------------------------------------
205
+ // Metadata
206
+ // ------------------------------------------------------------------
207
+ SandpackFS.prototype.getAllMetadata = function () {
208
+ return __assign({}, this.metaCache);
209
+ };
210
+ SandpackFS.prototype.getMetadata = function (path) {
211
+ var _a;
212
+ return __assign({}, ((_a = this.metaCache[normalize(path)]) !== null && _a !== void 0 ? _a : {}));
213
+ };
214
+ SandpackFS.prototype.setMetadata = function (path, patch) {
215
+ return __awaiter(this, void 0, void 0, function () {
216
+ var key, next;
217
+ var _a;
218
+ return __generator(this, function (_b) {
219
+ switch (_b.label) {
220
+ case 0:
221
+ key = normalize(path);
222
+ next = __assign(__assign({}, ((_a = this.metaCache[key]) !== null && _a !== void 0 ? _a : {})), patch);
223
+ Object.keys(next).forEach(function (k) {
224
+ if (next[k] === undefined) {
225
+ delete next[k];
226
+ }
227
+ });
228
+ if (Object.keys(next).length === 0) {
229
+ delete this.metaCache[key];
230
+ }
231
+ else {
232
+ this.metaCache[key] = next;
233
+ }
234
+ return [4 /*yield*/, this.persistMeta()];
235
+ case 1:
236
+ _b.sent();
237
+ this.notify({ path: key, external: false });
238
+ return [2 /*return*/];
239
+ }
240
+ });
241
+ });
242
+ };
243
+ SandpackFS.prototype.getEnvironment = function () {
244
+ return this.sidecarEnvironment;
245
+ };
246
+ SandpackFS.prototype.setEnvironment = function (environment) {
247
+ return __awaiter(this, void 0, void 0, function () {
248
+ return __generator(this, function (_a) {
249
+ switch (_a.label) {
250
+ case 0:
251
+ this.sidecarEnvironment = environment;
252
+ return [4 /*yield*/, this.persistMeta()];
253
+ case 1:
254
+ _a.sent();
255
+ return [2 /*return*/];
256
+ }
257
+ });
258
+ });
259
+ };
260
+ SandpackFS.prototype.getMode = function () {
261
+ return this.sidecarMode;
262
+ };
263
+ SandpackFS.prototype.setMode = function (mode) {
264
+ return __awaiter(this, void 0, void 0, function () {
265
+ return __generator(this, function (_a) {
266
+ switch (_a.label) {
267
+ case 0:
268
+ this.sidecarMode = mode;
269
+ return [4 /*yield*/, this.persistMeta()];
270
+ case 1:
271
+ _a.sent();
272
+ return [2 /*return*/];
273
+ }
274
+ });
275
+ });
276
+ };
277
+ // ------------------------------------------------------------------
278
+ // Change detection
279
+ // ------------------------------------------------------------------
280
+ /**
281
+ * Subscribe to any mutation. Each change carries its `path` and an `external`
282
+ * flag (`true` = written by the child iframe, `false` = a local edit). See
283
+ * {@link SandpackFSChange}.
284
+ */
285
+ SandpackFS.prototype.onChange = function (cb) {
286
+ var _this = this;
287
+ this.listeners.add(cb);
288
+ return function () {
289
+ _this.listeners.delete(cb);
290
+ };
291
+ };
292
+ /**
293
+ * Record a write made by the child iframe (relayed from the `attachFS`
294
+ * boundary in the host). Surfaces as an `external` change so the editor can
295
+ * reflect it — distinct from local edits, which never reach here.
296
+ */
297
+ SandpackFS.prototype.handleRemoteChange = function (path) {
298
+ if (this.disposed)
299
+ return;
300
+ this.notify({ path: normalize(path), external: true });
301
+ };
302
+ // ------------------------------------------------------------------
303
+ // Internals
304
+ // ------------------------------------------------------------------
305
+ SandpackFS.prototype.toAbs = function (path) {
306
+ return normalize(path);
307
+ };
308
+ SandpackFS.prototype.notify = function (change) {
309
+ this.listeners.forEach(function (listener) {
310
+ try {
311
+ listener(change);
312
+ }
313
+ catch (err) {
314
+ console.error("[sandpack-client]: SandpackFS listener threw", err);
315
+ }
316
+ });
317
+ };
318
+ SandpackFS.prototype.ensureMetaDir = function () {
319
+ return __awaiter(this, void 0, void 0, function () {
320
+ return __generator(this, function (_b) {
321
+ switch (_b.label) {
322
+ case 0:
323
+ _b.trys.push([0, 2, , 3]);
324
+ return [4 /*yield*/, this.fsContext.fs.promises.mkdir(META_DIR, {
325
+ recursive: true,
326
+ })];
327
+ case 1:
328
+ _b.sent();
329
+ return [3 /*break*/, 3];
330
+ case 2:
331
+ _b.sent();
332
+ return [3 /*break*/, 3];
333
+ case 3: return [2 /*return*/];
334
+ }
335
+ });
336
+ });
337
+ };
338
+ SandpackFS.prototype.ensureParent = function (absPath) {
339
+ return __awaiter(this, void 0, void 0, function () {
340
+ var lastSlash, dir;
341
+ return __generator(this, function (_b) {
342
+ switch (_b.label) {
343
+ case 0:
344
+ lastSlash = absPath.lastIndexOf("/");
345
+ if (lastSlash <= 0)
346
+ return [2 /*return*/];
347
+ dir = absPath.slice(0, lastSlash);
348
+ if (!dir || dir === "/")
349
+ return [2 /*return*/];
350
+ _b.label = 1;
351
+ case 1:
352
+ _b.trys.push([1, 3, , 4]);
353
+ return [4 /*yield*/, this.fsContext.fs.promises.mkdir(dir, { recursive: true })];
354
+ case 2:
355
+ _b.sent();
356
+ return [3 /*break*/, 4];
357
+ case 3:
358
+ _b.sent();
359
+ return [3 /*break*/, 4];
360
+ case 4: return [2 /*return*/];
361
+ }
362
+ });
363
+ });
364
+ };
365
+ SandpackFS.prototype.walk = function (relDir, out) {
366
+ return __awaiter(this, void 0, void 0, function () {
367
+ var absDir, entries, _i, entries_1, entry, relPath, absEntry, isDir, stat;
368
+ return __generator(this, function (_c) {
369
+ switch (_c.label) {
370
+ case 0:
371
+ absDir = this.toAbs(relDir);
372
+ _c.label = 1;
373
+ case 1:
374
+ _c.trys.push([1, 3, , 4]);
375
+ return [4 /*yield*/, this.fsContext.fs.promises.readdir(absDir)];
376
+ case 2:
377
+ entries = (_c.sent());
378
+ return [3 /*break*/, 4];
379
+ case 3:
380
+ _c.sent();
381
+ return [2 /*return*/];
382
+ case 4:
383
+ _i = 0, entries_1 = entries;
384
+ _c.label = 5;
385
+ case 5:
386
+ if (!(_i < entries_1.length)) return [3 /*break*/, 13];
387
+ entry = entries_1[_i];
388
+ relPath = (relDir === "/" ? "" : relDir) + "/" + entry;
389
+ if (relPath.startsWith(META_DIR))
390
+ return [3 /*break*/, 12];
391
+ absEntry = this.toAbs(relPath);
392
+ isDir = false;
393
+ _c.label = 6;
394
+ case 6:
395
+ _c.trys.push([6, 8, , 9]);
396
+ return [4 /*yield*/, this.fsContext.fs.promises.stat(absEntry)];
397
+ case 7:
398
+ stat = _c.sent();
399
+ isDir = stat.isDirectory();
400
+ return [3 /*break*/, 9];
401
+ case 8:
402
+ _c.sent();
403
+ return [3 /*break*/, 12];
404
+ case 9:
405
+ if (!isDir) return [3 /*break*/, 11];
406
+ return [4 /*yield*/, this.walk(relPath, out)];
407
+ case 10:
408
+ _c.sent();
409
+ return [3 /*break*/, 12];
410
+ case 11:
411
+ out.push(relPath);
412
+ _c.label = 12;
413
+ case 12:
414
+ _i++;
415
+ return [3 /*break*/, 5];
416
+ case 13: return [2 /*return*/];
417
+ }
418
+ });
419
+ });
420
+ };
421
+ SandpackFS.prototype.writeInitial = function (files) {
422
+ return __awaiter(this, void 0, void 0, function () {
423
+ var meta, _i, _a, _b, rawPath, entry, path, abs, fileMeta;
424
+ return __generator(this, function (_c) {
425
+ switch (_c.label) {
426
+ case 0: return [4 /*yield*/, this.ensureMetaDir()];
427
+ case 1:
428
+ _c.sent();
429
+ meta = {};
430
+ _i = 0, _a = Object.entries(files);
431
+ _c.label = 2;
432
+ case 2:
433
+ if (!(_i < _a.length)) return [3 /*break*/, 6];
434
+ _b = _a[_i], rawPath = _b[0], entry = _b[1];
435
+ path = normalize(rawPath);
436
+ abs = this.toAbs(path);
437
+ return [4 /*yield*/, this.ensureParent(abs)];
438
+ case 3:
439
+ _c.sent();
440
+ return [4 /*yield*/, this.fsContext.fs.promises.writeFile(abs, entry.code)];
441
+ case 4:
442
+ _c.sent();
443
+ fileMeta = {};
444
+ if (entry.hidden !== undefined)
445
+ fileMeta.hidden = entry.hidden;
446
+ if (entry.active !== undefined)
447
+ fileMeta.active = entry.active;
448
+ if (entry.readOnly !== undefined)
449
+ fileMeta.readOnly = entry.readOnly;
450
+ if (Object.keys(fileMeta).length > 0)
451
+ meta[path] = fileMeta;
452
+ _c.label = 5;
453
+ case 5:
454
+ _i++;
455
+ return [3 /*break*/, 2];
456
+ case 6:
457
+ this.metaCache = meta;
458
+ return [4 /*yield*/, this.persistMeta()];
459
+ case 7:
460
+ _c.sent();
461
+ return [2 /*return*/];
462
+ }
463
+ });
464
+ });
465
+ };
466
+ SandpackFS.prototype.persistMeta = function () {
467
+ return __awaiter(this, void 0, void 0, function () {
468
+ var sidecar;
469
+ return __generator(this, function (_a) {
470
+ switch (_a.label) {
471
+ case 0: return [4 /*yield*/, this.ensureMetaDir()];
472
+ case 1:
473
+ _a.sent();
474
+ sidecar = { files: this.metaCache };
475
+ if (this.sidecarEnvironment !== undefined) {
476
+ sidecar.environment = this.sidecarEnvironment;
477
+ }
478
+ if (this.sidecarMode !== undefined) {
479
+ sidecar.mode = this.sidecarMode;
480
+ }
481
+ return [4 /*yield*/, this.fsContext.fs.promises.writeFile(this.toAbs(META_PATH), JSON.stringify(sidecar))];
482
+ case 2:
483
+ _a.sent();
484
+ return [2 /*return*/];
485
+ }
486
+ });
487
+ });
488
+ };
489
+ SandpackFS.prototype.refreshMetaCache = function () {
490
+ return __awaiter(this, void 0, void 0, function () {
491
+ var raw, parsed;
492
+ return __generator(this, function (_b) {
493
+ switch (_b.label) {
494
+ case 0:
495
+ _b.trys.push([0, 2, , 3]);
496
+ return [4 /*yield*/, this.fsContext.fs.promises.readFile(this.toAbs(META_PATH), "utf8")];
497
+ case 1:
498
+ raw = (_b.sent());
499
+ parsed = JSON.parse(raw);
500
+ if ("files" in parsed && typeof parsed.files === "object") {
501
+ this.metaCache = parsed.files;
502
+ this.sidecarEnvironment = parsed.environment;
503
+ this.sidecarMode = parsed.mode;
504
+ }
505
+ else {
506
+ // Legacy format: plain FileMetaMap
507
+ this.metaCache = parsed;
508
+ }
509
+ return [3 /*break*/, 3];
510
+ case 2:
511
+ _b.sent();
512
+ this.metaCache = {};
513
+ return [3 /*break*/, 3];
514
+ case 3: return [2 /*return*/];
515
+ }
516
+ });
517
+ });
518
+ };
519
+ return SandpackFS;
520
+ }());
521
+
522
+ var SandpackLogLevel;
523
+ (function (SandpackLogLevel) {
524
+ SandpackLogLevel[SandpackLogLevel["None"] = 0] = "None";
525
+ SandpackLogLevel[SandpackLogLevel["Error"] = 10] = "Error";
526
+ SandpackLogLevel[SandpackLogLevel["Warning"] = 20] = "Warning";
527
+ SandpackLogLevel[SandpackLogLevel["Info"] = 30] = "Info";
528
+ SandpackLogLevel[SandpackLogLevel["Debug"] = 40] = "Debug";
529
+ })(SandpackLogLevel || (SandpackLogLevel = {}));
530
+
531
+ export { META_PATH as M, SandpackFS as S, SandpackLogLevel as a };