@sheetxl/react 0.4.13 → 0.4.14

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,1377 @@
1
+ /**
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.4.14
3
+ *
4
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ function _e(g, j) {
8
+ for (var O = 0; O < j.length; O++) {
9
+ const o = j[O];
10
+ if (typeof o != "string" && !Array.isArray(o)) {
11
+ for (const a in o) if (a !== "default" && !(a in g)) {
12
+ const s = Object.getOwnPropertyDescriptor(o, a);
13
+ s && Object.defineProperty(g, a, s.get ? s : { enumerable: !0, get: () => o[a] });
14
+ }
15
+ }
16
+ }
17
+ return Object.freeze(Object.defineProperty(g, Symbol.toStringTag, { value: "Module" }));
18
+ }
19
+ var K, W = {}, G = {}, A = {}, X = {}, $, U = {};
20
+ function me() {
21
+ if ($) return U;
22
+ $ = 1;
23
+ var g = U && U.__awaiter || function(o, a, s, n) {
24
+ return new (s || (s = Promise))(function(e, u) {
25
+ function h(_) {
26
+ try {
27
+ P(n.next(_));
28
+ } catch (f) {
29
+ u(f);
30
+ }
31
+ }
32
+ function d(_) {
33
+ try {
34
+ P(n.throw(_));
35
+ } catch (f) {
36
+ u(f);
37
+ }
38
+ }
39
+ function P(_) {
40
+ var f;
41
+ _.done ? e(_.value) : (f = _.value, f instanceof s ? f : new s(function(r) {
42
+ r(f);
43
+ })).then(h, d);
44
+ }
45
+ P((n = n.apply(o, a || [])).next());
46
+ });
47
+ }, j = U && U.__generator || function(o, a) {
48
+ var s, n, e, u, h = { label: 0, sent: function() {
49
+ if (1 & e[0]) throw e[1];
50
+ return e[1];
51
+ }, trys: [], ops: [] };
52
+ return u = { next: d(0), throw: d(1), return: d(2) }, typeof Symbol == "function" && (u[Symbol.iterator] = function() {
53
+ return this;
54
+ }), u;
55
+ function d(P) {
56
+ return function(_) {
57
+ return function(f) {
58
+ if (s) throw new TypeError("Generator is already executing.");
59
+ for (; h; ) try {
60
+ if (s = 1, n && (e = 2 & f[0] ? n.return : f[0] ? n.throw || ((e = n.return) && e.call(n), 0) : n.next) && !(e = e.call(n, f[1])).done) return e;
61
+ switch (n = 0, e && (f = [2 & f[0], e.value]), f[0]) {
62
+ case 0:
63
+ case 1:
64
+ e = f;
65
+ break;
66
+ case 4:
67
+ return h.label++, { value: f[1], done: !1 };
68
+ case 5:
69
+ h.label++, n = f[1], f = [0];
70
+ continue;
71
+ case 7:
72
+ f = h.ops.pop(), h.trys.pop();
73
+ continue;
74
+ default:
75
+ if (e = h.trys, !((e = e.length > 0 && e[e.length - 1]) || f[0] !== 6 && f[0] !== 2)) {
76
+ h = 0;
77
+ continue;
78
+ }
79
+ if (f[0] === 3 && (!e || f[1] > e[0] && f[1] < e[3])) {
80
+ h.label = f[1];
81
+ break;
82
+ }
83
+ if (f[0] === 6 && h.label < e[1]) {
84
+ h.label = e[1], e = f;
85
+ break;
86
+ }
87
+ if (e && h.label < e[2]) {
88
+ h.label = e[2], h.ops.push(f);
89
+ break;
90
+ }
91
+ e[2] && h.ops.pop(), h.trys.pop();
92
+ continue;
93
+ }
94
+ f = a.call(o, h);
95
+ } catch (r) {
96
+ f = [6, r], n = 0;
97
+ } finally {
98
+ s = e = 0;
99
+ }
100
+ if (5 & f[0]) throw f[1];
101
+ return { value: f[0] ? f[1] : void 0, done: !0 };
102
+ }([P, _]);
103
+ };
104
+ }
105
+ };
106
+ Object.defineProperty(U, "__esModule", { value: !0 }), U.JsDelivrSourceResolver = void 0;
107
+ var O = function() {
108
+ function o() {
109
+ }
110
+ return o.prototype.resolvePackageJson = function(a, s, n) {
111
+ return g(this, void 0, void 0, function() {
112
+ return j(this, function(e) {
113
+ switch (e.label) {
114
+ case 0:
115
+ return [4, this.resolveFile("https://cdn.jsdelivr.net/npm/".concat(a).concat(s ? "@".concat(s) : "").concat(n ? "/".concat(n) : "", "/package.json"))];
116
+ case 1:
117
+ return [2, e.sent()];
118
+ }
119
+ });
120
+ });
121
+ }, o.prototype.resolveSourceFile = function(a, s, n) {
122
+ return g(this, void 0, void 0, function() {
123
+ return j(this, function(e) {
124
+ switch (e.label) {
125
+ case 0:
126
+ return [4, this.resolveFile("https://cdn.jsdelivr.net/npm/".concat(a).concat(s ? "@".concat(s) : "", "/").concat(n))];
127
+ case 1:
128
+ return [2, e.sent()];
129
+ }
130
+ });
131
+ });
132
+ }, o.prototype.resolveFile = function(a) {
133
+ return g(this, void 0, void 0, function() {
134
+ var s;
135
+ return j(this, function(n) {
136
+ switch (n.label) {
137
+ case 0:
138
+ return [4, fetch(a, { method: "GET" })];
139
+ case 1:
140
+ return (s = n.sent()).ok ? [4, s.text()] : [3, 3];
141
+ case 2:
142
+ return [2, n.sent()];
143
+ case 3:
144
+ if (s.status === 404) return [2, ""];
145
+ throw Error("Error other than 404 while fetching from Unpkg at ".concat(a));
146
+ case 4:
147
+ return [2];
148
+ }
149
+ });
150
+ });
151
+ }, o;
152
+ }();
153
+ return U.JsDelivrSourceResolver = O, U;
154
+ }
155
+ var H, Q, Y, C = {}, F = {};
156
+ function q() {
157
+ if (Q) return H;
158
+ function g(o) {
159
+ if (typeof o != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(o));
160
+ }
161
+ function j(o, a) {
162
+ for (var s, n = "", e = 0, u = -1, h = 0, d = 0; d <= o.length; ++d) {
163
+ if (d < o.length) s = o.charCodeAt(d);
164
+ else {
165
+ if (s === 47) break;
166
+ s = 47;
167
+ }
168
+ if (s === 47) {
169
+ if (!(u === d - 1 || h === 1)) if (u !== d - 1 && h === 2) {
170
+ if (n.length < 2 || e !== 2 || n.charCodeAt(n.length - 1) !== 46 || n.charCodeAt(n.length - 2) !== 46) {
171
+ if (n.length > 2) {
172
+ var P = n.lastIndexOf("/");
173
+ if (P !== n.length - 1) {
174
+ P === -1 ? (n = "", e = 0) : e = (n = n.slice(0, P)).length - 1 - n.lastIndexOf("/"), u = d, h = 0;
175
+ continue;
176
+ }
177
+ } else if (n.length === 2 || n.length === 1) {
178
+ n = "", e = 0, u = d, h = 0;
179
+ continue;
180
+ }
181
+ }
182
+ a && (n.length > 0 ? n += "/.." : n = "..", e = 2);
183
+ } else n.length > 0 ? n += "/" + o.slice(u + 1, d) : n = o.slice(u + 1, d), e = d - u - 1;
184
+ u = d, h = 0;
185
+ } else s === 46 && h !== -1 ? ++h : h = -1;
186
+ }
187
+ return n;
188
+ }
189
+ Q = 1;
190
+ var O = { resolve: function() {
191
+ for (var o, a = "", s = !1, n = arguments.length - 1; n >= -1 && !s; n--) {
192
+ var e;
193
+ n >= 0 ? e = arguments[n] : (o === void 0 && (o = process.cwd()), e = o), g(e), e.length !== 0 && (a = e + "/" + a, s = e.charCodeAt(0) === 47);
194
+ }
195
+ return a = j(a, !s), s ? a.length > 0 ? "/" + a : "/" : a.length > 0 ? a : ".";
196
+ }, normalize: function(o) {
197
+ if (g(o), o.length === 0) return ".";
198
+ var a = o.charCodeAt(0) === 47, s = o.charCodeAt(o.length - 1) === 47;
199
+ return (o = j(o, !a)).length !== 0 || a || (o = "."), o.length > 0 && s && (o += "/"), a ? "/" + o : o;
200
+ }, isAbsolute: function(o) {
201
+ return g(o), o.length > 0 && o.charCodeAt(0) === 47;
202
+ }, join: function() {
203
+ if (arguments.length === 0) return ".";
204
+ for (var o, a = 0; a < arguments.length; ++a) {
205
+ var s = arguments[a];
206
+ g(s), s.length > 0 && (o === void 0 ? o = s : o += "/" + s);
207
+ }
208
+ return o === void 0 ? "." : O.normalize(o);
209
+ }, relative: function(o, a) {
210
+ if (g(o), g(a), o === a || (o = O.resolve(o)) === (a = O.resolve(a))) return "";
211
+ for (var s = 1; s < o.length && o.charCodeAt(s) === 47; ++s) ;
212
+ for (var n = o.length, e = n - s, u = 1; u < a.length && a.charCodeAt(u) === 47; ++u) ;
213
+ for (var h = a.length - u, d = e < h ? e : h, P = -1, _ = 0; _ <= d; ++_) {
214
+ if (_ === d) {
215
+ if (h > d) {
216
+ if (a.charCodeAt(u + _) === 47) return a.slice(u + _ + 1);
217
+ if (_ === 0) return a.slice(u + _);
218
+ } else e > d && (o.charCodeAt(s + _) === 47 ? P = _ : _ === 0 && (P = 0));
219
+ break;
220
+ }
221
+ var f = o.charCodeAt(s + _);
222
+ if (f !== a.charCodeAt(u + _)) break;
223
+ f === 47 && (P = _);
224
+ }
225
+ var r = "";
226
+ for (_ = s + P + 1; _ <= n; ++_) _ !== n && o.charCodeAt(_) !== 47 || (r.length === 0 ? r += ".." : r += "/..");
227
+ return r.length > 0 ? r + a.slice(u + P) : (u += P, a.charCodeAt(u) === 47 && ++u, a.slice(u));
228
+ }, _makeLong: function(o) {
229
+ return o;
230
+ }, dirname: function(o) {
231
+ if (g(o), o.length === 0) return ".";
232
+ for (var a = o.charCodeAt(0), s = a === 47, n = -1, e = !0, u = o.length - 1; u >= 1; --u) if ((a = o.charCodeAt(u)) === 47) {
233
+ if (!e) {
234
+ n = u;
235
+ break;
236
+ }
237
+ } else e = !1;
238
+ return n === -1 ? s ? "/" : "." : s && n === 1 ? "//" : o.slice(0, n);
239
+ }, basename: function(o, a) {
240
+ if (a !== void 0 && typeof a != "string") throw new TypeError('"ext" argument must be a string');
241
+ g(o);
242
+ var s, n = 0, e = -1, u = !0;
243
+ if (a !== void 0 && a.length > 0 && a.length <= o.length) {
244
+ if (a.length === o.length && a === o) return "";
245
+ var h = a.length - 1, d = -1;
246
+ for (s = o.length - 1; s >= 0; --s) {
247
+ var P = o.charCodeAt(s);
248
+ if (P === 47) {
249
+ if (!u) {
250
+ n = s + 1;
251
+ break;
252
+ }
253
+ } else d === -1 && (u = !1, d = s + 1), h >= 0 && (P === a.charCodeAt(h) ? --h === -1 && (e = s) : (h = -1, e = d));
254
+ }
255
+ return n === e ? e = d : e === -1 && (e = o.length), o.slice(n, e);
256
+ }
257
+ for (s = o.length - 1; s >= 0; --s) if (o.charCodeAt(s) === 47) {
258
+ if (!u) {
259
+ n = s + 1;
260
+ break;
261
+ }
262
+ } else e === -1 && (u = !1, e = s + 1);
263
+ return e === -1 ? "" : o.slice(n, e);
264
+ }, extname: function(o) {
265
+ g(o);
266
+ for (var a = -1, s = 0, n = -1, e = !0, u = 0, h = o.length - 1; h >= 0; --h) {
267
+ var d = o.charCodeAt(h);
268
+ if (d !== 47) n === -1 && (e = !1, n = h + 1), d === 46 ? a === -1 ? a = h : u !== 1 && (u = 1) : a !== -1 && (u = -1);
269
+ else if (!e) {
270
+ s = h + 1;
271
+ break;
272
+ }
273
+ }
274
+ return a === -1 || n === -1 || u === 0 || u === 1 && a === n - 1 && a === s + 1 ? "" : o.slice(a, n);
275
+ }, format: function(o) {
276
+ if (o === null || typeof o != "object") throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof o);
277
+ return function(a, s) {
278
+ var n = s.dir || s.root, e = s.base || (s.name || "") + (s.ext || "");
279
+ return n ? n === s.root ? n + e : n + a + e : e;
280
+ }("/", o);
281
+ }, parse: function(o) {
282
+ g(o);
283
+ var a = { root: "", dir: "", base: "", ext: "", name: "" };
284
+ if (o.length === 0) return a;
285
+ var s, n = o.charCodeAt(0), e = n === 47;
286
+ e ? (a.root = "/", s = 1) : s = 0;
287
+ for (var u = -1, h = 0, d = -1, P = !0, _ = o.length - 1, f = 0; _ >= s; --_) if ((n = o.charCodeAt(_)) !== 47) d === -1 && (P = !1, d = _ + 1), n === 46 ? u === -1 ? u = _ : f !== 1 && (f = 1) : u !== -1 && (f = -1);
288
+ else if (!P) {
289
+ h = _ + 1;
290
+ break;
291
+ }
292
+ return u === -1 || d === -1 || f === 0 || f === 1 && u === d - 1 && u === h + 1 ? d !== -1 && (a.base = a.name = h === 0 && e ? o.slice(1, d) : o.slice(h, d)) : (h === 0 && e ? (a.name = o.slice(1, u), a.base = o.slice(1, d)) : (a.name = o.slice(h, u), a.base = o.slice(h, d)), a.ext = o.slice(u, d)), h > 0 ? a.dir = o.slice(0, h - 1) : e && (a.dir = "/"), a;
293
+ }, sep: "/", delimiter: ":", win32: null, posix: null };
294
+ return O.posix = O, H = O;
295
+ }
296
+ var Z, J = {};
297
+ function be() {
298
+ if (Z) return J;
299
+ Z = 1;
300
+ var g = J && J.__importDefault || function(O) {
301
+ return O && O.__esModule ? O : { default: O };
302
+ };
303
+ Object.defineProperty(J, "__esModule", { value: !0 }), J.importResourcePathToString = void 0;
304
+ var j = g(q());
305
+ return J.importResourcePathToString = function(O) {
306
+ var o;
307
+ switch (O.kind) {
308
+ case "package":
309
+ return j.default.join(O.packageName, (o = O.importPath) !== null && o !== void 0 ? o : "", "package.json");
310
+ case "relative":
311
+ return j.default.join(O.sourcePath, O.importPath);
312
+ case "relative-in-package":
313
+ return j.default.join(O.packageName, O.sourcePath, O.importPath);
314
+ }
315
+ }, J;
316
+ }
317
+ var ee, B = {};
318
+ function ke() {
319
+ return ee ? B : (ee = 1, Object.defineProperty(B, "__esModule", { value: !0 }), B.invokeUpdate = void 0, B.invokeUpdate = function(g, j) {
320
+ var O, o = "".concat(g.type, ": ");
321
+ switch (g.type) {
322
+ case "CodeChanged":
323
+ case "ResolveNewImports":
324
+ o += "";
325
+ break;
326
+ case "LookedUpTypeFile":
327
+ o += '"'.concat(g.path, '" was ').concat(g.success ? "sucessfully" : "not sucessfully", " looked up");
328
+ break;
329
+ case "AttemptedLookUpFile":
330
+ o += '"'.concat(g.path, '" was ').concat(g.success ? "sucessfully" : "not sucessfully", " attempted to looked up");
331
+ break;
332
+ case "LookedUpPackage":
333
+ o += 'package.json for package "'.concat(g.package, '" was ').concat(g.success ? "sucessfully" : "not sucessfully", " looked up").concat(g.definitelyTyped ? " (found in definitely typed repo)" : "");
334
+ break;
335
+ case "LoadedFromCache":
336
+ o += '"'.concat(g.importPath, '" was loaded from cache');
337
+ break;
338
+ case "StoredToCache":
339
+ o += '"'.concat(g.importPath, '" was stored to cache');
340
+ }
341
+ o.endsWith(": ") && (o = o.slice(void 0, -2)), (O = j.onUpdate) === null || O === void 0 || O.call(j, g, o);
342
+ }, B);
343
+ }
344
+ var te, re, ne, oe, z = {};
345
+ function we() {
346
+ if (te) return z;
347
+ te = 1, Object.defineProperty(z, "__esModule", { value: !0 }), z.RecursionDepth = void 0;
348
+ var g = function() {
349
+ function j(O, o, a) {
350
+ o === void 0 && (o = 0), a === void 0 && (a = 0), this.options = O, this.fileRecursionDepth = o, this.packageRecursionDepth = a;
351
+ }
352
+ return j.prototype.nextPackage = function() {
353
+ return new j(this.options, this.fileRecursionDepth, this.packageRecursionDepth + 1);
354
+ }, j.prototype.nextFile = function() {
355
+ return new j(this.options, this.fileRecursionDepth + 1, this.packageRecursionDepth);
356
+ }, j.prototype.same = function() {
357
+ return new j(this.options, this.fileRecursionDepth, this.packageRecursionDepth);
358
+ }, j.prototype.shouldStop = function() {
359
+ return this.options.fileRecursionDepth > 0 && this.fileRecursionDepth >= this.options.fileRecursionDepth || this.options.packageRecursionDepth > 0 && this.packageRecursionDepth >= this.options.packageRecursionDepth;
360
+ }, j;
361
+ }();
362
+ return z.RecursionDepth = g, z;
363
+ }
364
+ function Pe() {
365
+ if (re) return C;
366
+ re = 1;
367
+ var g = C && C.__assign || function() {
368
+ return g = Object.assign || function(r) {
369
+ for (var t, c = 1, l = arguments.length; c < l; c++) for (var i in t = arguments[c]) Object.prototype.hasOwnProperty.call(t, i) && (r[i] = t[i]);
370
+ return r;
371
+ }, g.apply(this, arguments);
372
+ }, j = C && C.__createBinding || (Object.create ? function(r, t, c, l) {
373
+ l === void 0 && (l = c);
374
+ var i = Object.getOwnPropertyDescriptor(t, c);
375
+ i && !("get" in i ? !t.__esModule : i.writable || i.configurable) || (i = { enumerable: !0, get: function() {
376
+ return t[c];
377
+ } }), Object.defineProperty(r, l, i);
378
+ } : function(r, t, c, l) {
379
+ l === void 0 && (l = c), r[l] = t[c];
380
+ }), O = C && C.__setModuleDefault || (Object.create ? function(r, t) {
381
+ Object.defineProperty(r, "default", { enumerable: !0, value: t });
382
+ } : function(r, t) {
383
+ r.default = t;
384
+ }), o = C && C.__importStar || function(r) {
385
+ if (r && r.__esModule) return r;
386
+ var t = {};
387
+ if (r != null) for (var c in r) c !== "default" && Object.prototype.hasOwnProperty.call(r, c) && j(t, r, c);
388
+ return O(t, r), t;
389
+ }, a = C && C.__awaiter || function(r, t, c, l) {
390
+ return new (c || (c = Promise))(function(i, m) {
391
+ function v(k) {
392
+ try {
393
+ y(l.next(k));
394
+ } catch (p) {
395
+ m(p);
396
+ }
397
+ }
398
+ function b(k) {
399
+ try {
400
+ y(l.throw(k));
401
+ } catch (p) {
402
+ m(p);
403
+ }
404
+ }
405
+ function y(k) {
406
+ var p;
407
+ k.done ? i(k.value) : (p = k.value, p instanceof c ? p : new c(function(w) {
408
+ w(p);
409
+ })).then(v, b);
410
+ }
411
+ y((l = l.apply(r, t || [])).next());
412
+ });
413
+ }, s = C && C.__generator || function(r, t) {
414
+ var c, l, i, m, v = { label: 0, sent: function() {
415
+ if (1 & i[0]) throw i[1];
416
+ return i[1];
417
+ }, trys: [], ops: [] };
418
+ return m = { next: b(0), throw: b(1), return: b(2) }, typeof Symbol == "function" && (m[Symbol.iterator] = function() {
419
+ return this;
420
+ }), m;
421
+ function b(y) {
422
+ return function(k) {
423
+ return function(p) {
424
+ if (c) throw new TypeError("Generator is already executing.");
425
+ for (; v; ) try {
426
+ if (c = 1, l && (i = 2 & p[0] ? l.return : p[0] ? l.throw || ((i = l.return) && i.call(l), 0) : l.next) && !(i = i.call(l, p[1])).done) return i;
427
+ switch (l = 0, i && (p = [2 & p[0], i.value]), p[0]) {
428
+ case 0:
429
+ case 1:
430
+ i = p;
431
+ break;
432
+ case 4:
433
+ return v.label++, { value: p[1], done: !1 };
434
+ case 5:
435
+ v.label++, l = p[1], p = [0];
436
+ continue;
437
+ case 7:
438
+ p = v.ops.pop(), v.trys.pop();
439
+ continue;
440
+ default:
441
+ if (i = v.trys, !((i = i.length > 0 && i[i.length - 1]) || p[0] !== 6 && p[0] !== 2)) {
442
+ v = 0;
443
+ continue;
444
+ }
445
+ if (p[0] === 3 && (!i || p[1] > i[0] && p[1] < i[3])) {
446
+ v.label = p[1];
447
+ break;
448
+ }
449
+ if (p[0] === 6 && v.label < i[1]) {
450
+ v.label = i[1], i = p;
451
+ break;
452
+ }
453
+ if (i && v.label < i[2]) {
454
+ v.label = i[2], v.ops.push(p);
455
+ break;
456
+ }
457
+ i[2] && v.ops.pop(), v.trys.pop();
458
+ continue;
459
+ }
460
+ p = t.call(r, v);
461
+ } catch (w) {
462
+ p = [6, w], l = 0;
463
+ } finally {
464
+ c = i = 0;
465
+ }
466
+ if (5 & p[0]) throw p[1];
467
+ return { value: p[0] ? p[1] : void 0, done: !0 };
468
+ }([y, k]);
469
+ };
470
+ }
471
+ }, n = C && C.__values || function(r) {
472
+ var t = typeof Symbol == "function" && Symbol.iterator, c = t && r[t], l = 0;
473
+ if (c) return c.call(r);
474
+ if (r && typeof r.length == "number") return { next: function() {
475
+ return r && l >= r.length && (r = void 0), { value: r && r[l++], done: !r };
476
+ } };
477
+ throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
478
+ }, e = C && C.__read || function(r, t) {
479
+ var c = typeof Symbol == "function" && r[Symbol.iterator];
480
+ if (!c) return r;
481
+ var l, i, m = c.call(r), v = [];
482
+ try {
483
+ for (; (t === void 0 || t-- > 0) && !(l = m.next()).done; ) v.push(l.value);
484
+ } catch (b) {
485
+ i = { error: b };
486
+ } finally {
487
+ try {
488
+ l && !l.done && (c = m.return) && c.call(m);
489
+ } finally {
490
+ if (i) throw i.error;
491
+ }
492
+ }
493
+ return v;
494
+ };
495
+ Object.defineProperty(C, "__esModule", { value: !0 }), C.ImportResolver = void 0;
496
+ var u = function() {
497
+ if (Y) return F;
498
+ Y = 1;
499
+ var r = F && F.__createBinding || (Object.create ? function(b, y, k, p) {
500
+ p === void 0 && (p = k);
501
+ var w = Object.getOwnPropertyDescriptor(y, k);
502
+ w && !("get" in w ? !y.__esModule : w.writable || w.configurable) || (w = { enumerable: !0, get: function() {
503
+ return y[k];
504
+ } }), Object.defineProperty(b, p, w);
505
+ } : function(b, y, k, p) {
506
+ p === void 0 && (p = k), b[p] = y[k];
507
+ }), t = F && F.__setModuleDefault || (Object.create ? function(b, y) {
508
+ Object.defineProperty(b, "default", { enumerable: !0, value: y });
509
+ } : function(b, y) {
510
+ b.default = y;
511
+ }), c = F && F.__importStar || function(b) {
512
+ if (b && b.__esModule) return b;
513
+ var y = {};
514
+ if (b != null) for (var k in b) k !== "default" && Object.prototype.hasOwnProperty.call(b, k) && r(y, b, k);
515
+ return t(y, b), y;
516
+ }, l = F && F.__read || function(b, y) {
517
+ var k = typeof Symbol == "function" && b[Symbol.iterator];
518
+ if (!k) return b;
519
+ var p, w, S = k.call(b), D = [];
520
+ try {
521
+ for (; (y === void 0 || y-- > 0) && !(p = S.next()).done; ) D.push(p.value);
522
+ } catch (x) {
523
+ w = { error: x };
524
+ } finally {
525
+ try {
526
+ p && !p.done && (k = S.return) && k.call(S);
527
+ } finally {
528
+ if (w) throw w.error;
529
+ }
530
+ }
531
+ return D;
532
+ }, i = F && F.__spreadArray || function(b, y, k) {
533
+ if (k || arguments.length === 2) for (var p, w = 0, S = y.length; w < S; w++) !p && w in y || (p || (p = Array.prototype.slice.call(y, 0, w)), p[w] = y[w]);
534
+ return b.concat(p || Array.prototype.slice.call(y));
535
+ };
536
+ Object.defineProperty(F, "__esModule", { value: !0 }), F.DependencyParser = void 0;
537
+ var m = c(q()), v = function() {
538
+ function b() {
539
+ this.REGEX_CLEAN = /[\n|\r]/g, this.REGEX_DETECT_IMPORT = /(?:(?:(?:import)|(?:export))(?:.)*?from\s+["']([^"']+)["'])|(?:((?:require|import))(?:\s+)?\(["']([^"']+)["']\))|(?:\/+\s+<reference\s+path=["']([^"']+)["']\s+\/>)/g, this.REGEX_NODE_MODULE = /^node:([\w\W\/]+)$/;
540
+ }
541
+ return b.prototype.parseDependencies = function(y, k) {
542
+ var p = this;
543
+ return i([], l(y.matchAll(this.REGEX_DETECT_IMPORT)), !1).map(function(w) {
544
+ var S, D;
545
+ return (D = (S = w[1]) !== null && S !== void 0 ? S : w[2]) !== null && D !== void 0 ? D : w[3];
546
+ }).filter(function(w) {
547
+ return !!w;
548
+ }).map(function(w) {
549
+ return p.resolvePath(w, k);
550
+ });
551
+ }, b.prototype.resolvePath = function(y, k) {
552
+ var p = y.match(this.REGEX_NODE_MODULE);
553
+ if (p) return { kind: "relative-in-package", packageName: "@types/node", importPath: "".concat(p[1], ".d.ts"), sourcePath: "" };
554
+ if (typeof k == "string") {
555
+ if (y.startsWith(".")) return { kind: "relative", importPath: y, sourcePath: k };
556
+ if (y.startsWith("@")) {
557
+ var w = y.split("/");
558
+ return { kind: "package", packageName: "".concat(w[0], "/").concat(w[1]), importPath: w.slice(2).join("/") };
559
+ }
560
+ return { kind: "package", packageName: (w = y.split("/"))[0], importPath: w.slice(1).join("/") };
561
+ }
562
+ switch (k.kind) {
563
+ case "package":
564
+ throw Error("TODO?");
565
+ case "relative":
566
+ throw Error("TODO2?");
567
+ case "relative-in-package":
568
+ return y.startsWith(".") ? { kind: "relative-in-package", packageName: k.packageName, sourcePath: m.join(k.sourcePath, k.importPath), importPath: y } : y.startsWith("@") ? (w = y.split("/"), { kind: "package", packageName: "".concat(w[0], "/").concat(w[1]), importPath: w.slice(2).join("/") }) : { kind: "package", packageName: (w = y.split("/"))[0], importPath: w.slice(1).join("/") };
569
+ }
570
+ }, b;
571
+ }();
572
+ return F.DependencyParser = v, F;
573
+ }(), h = be(), d = o(q()), P = ke(), _ = we(), f = function() {
574
+ function r(t) {
575
+ var c, l;
576
+ if (this.options = t, this.loadedFiles = [], this.dependencyParser = new u.DependencyParser(), this.cache = t.sourceCache, this.sourceResolver = t.sourceResolver, this.newImportsResolved = !1, this.monaco = t.monaco, t.preloadPackages && t.versions) {
577
+ this.versions = t.versions;
578
+ try {
579
+ for (var i = n(Object.entries(t.versions)), m = i.next(); !m.done; m = i.next()) {
580
+ var v = e(m.value, 2), b = v[0];
581
+ v[1], this.resolveImport({ kind: "package", packageName: b, importPath: "" }, new _.RecursionDepth(this.options)).catch(function(y) {
582
+ console.error(y);
583
+ });
584
+ }
585
+ } catch (y) {
586
+ c = { error: y };
587
+ } finally {
588
+ try {
589
+ m && !m.done && (l = i.return) && l.call(i);
590
+ } finally {
591
+ if (c) throw c.error;
592
+ }
593
+ }
594
+ }
595
+ }
596
+ return r.prototype.wereNewImportsResolved = function() {
597
+ return this.newImportsResolved;
598
+ }, r.prototype.resetNewImportsResolved = function() {
599
+ this.newImportsResolved = !1;
600
+ }, r.prototype.resolveImportsInFile = function(t, c, l) {
601
+ var i, m, v;
602
+ return a(this, void 0, void 0, function() {
603
+ var b, y, k, p, w, S, D, x;
604
+ return s(this, function(R) {
605
+ switch (R.label) {
606
+ case 0:
607
+ if (l.shouldStop()) return [2];
608
+ b = this.dependencyParser.parseDependencies(t, c), R.label = 1;
609
+ case 1:
610
+ R.trys.push([1, 8, 9, 10]), y = n(b), k = y.next(), R.label = 2;
611
+ case 2:
612
+ if (k.done) return [3, 7];
613
+ p = k.value, R.label = 3;
614
+ case 3:
615
+ return R.trys.push([3, 5, , 6]), [4, this.resolveImport(p, l)];
616
+ case 4:
617
+ return R.sent(), [3, 6];
618
+ case 5:
619
+ return w = R.sent(), this.options.onError ? (m = (i = this.options).onError) === null || m === void 0 || m.call(i, (v = w.message) !== null && v !== void 0 ? v : w) : console.error(w), [3, 6];
620
+ case 6:
621
+ return k = y.next(), [3, 2];
622
+ case 7:
623
+ return [3, 10];
624
+ case 8:
625
+ return S = R.sent(), D = { error: S }, [3, 10];
626
+ case 9:
627
+ try {
628
+ k && !k.done && (x = y.return) && x.call(y);
629
+ } finally {
630
+ if (D) throw D.error;
631
+ }
632
+ return [7];
633
+ case 10:
634
+ return [2];
635
+ }
636
+ });
637
+ });
638
+ }, r.prototype.resolveImport = function(t, c) {
639
+ return a(this, void 0, void 0, function() {
640
+ var l, i;
641
+ return s(this, function(m) {
642
+ switch (m.label) {
643
+ case 0:
644
+ if (l = this.hashImportResourcePath(t), this.loadedFiles.includes(l)) return [2];
645
+ switch (this.loadedFiles.push(l), t.kind) {
646
+ case "package":
647
+ return [3, 1];
648
+ case "relative":
649
+ return [3, 5];
650
+ case "relative-in-package":
651
+ return [3, 6];
652
+ }
653
+ return [3, 8];
654
+ case 1:
655
+ return [4, this.resolveImportFromPackageRoot(t)];
656
+ case 2:
657
+ return (i = m.sent()) ? [4, this.resolveImportInPackage(i, c.nextPackage().nextFile())] : [3, 4];
658
+ case 3:
659
+ case 7:
660
+ return [2, m.sent()];
661
+ case 4:
662
+ return [3, 8];
663
+ case 5:
664
+ throw Error("Not implemented yet");
665
+ case 6:
666
+ return [4, this.resolveImportInPackage(t, c.nextFile())];
667
+ case 8:
668
+ return [2];
669
+ }
670
+ });
671
+ });
672
+ }, r.prototype.resolveImportInPackage = function(t, c) {
673
+ return a(this, void 0, void 0, function() {
674
+ var l, i, m;
675
+ return s(this, function(v) {
676
+ switch (v.label) {
677
+ case 0:
678
+ return [4, this.loadSourceFileContents(t)];
679
+ case 1:
680
+ return (l = v.sent()) ? (i = l.source, m = l.at, this.createModel(i, this.monaco.Uri.parse(this.options.fileRootPath + d.join("node_modules/".concat(t.packageName), m))), [4, this.resolveImportsInFile(i, { kind: "relative-in-package", packageName: t.packageName, sourcePath: d.dirname(m), importPath: "" }, c)]) : [3, 3];
681
+ case 2:
682
+ v.sent(), v.label = 3;
683
+ case 3:
684
+ return [2];
685
+ }
686
+ });
687
+ });
688
+ }, r.prototype.resolveImportFromPackageRoot = function(t) {
689
+ var c, l, i, m, v, b, y, k, p;
690
+ return a(this, void 0, void 0, function() {
691
+ var w, S, D, x, R, N, V, E, T;
692
+ return s(this, function(M) {
693
+ switch (M.label) {
694
+ case 0:
695
+ return w = { type: "LookedUpPackage", package: t.packageName, definitelyTyped: !1, success: !1 }, !this.options.onlySpecifiedPackages || !((c = this.versions) === null || c === void 0) && c[t.packageName] || !((l = this.versions) === null || l === void 0) && l["@types/" + t.packageName] ? (S = (m = (i = t.importPath) === null || i === void 0 ? void 0 : i.length) !== null && m !== void 0 && m, D = S ? "/".concat(t.importPath) : "", [4, this.resolvePackageJson(t.packageName, (v = this.versions) === null || v === void 0 ? void 0 : v[t.packageName], S ? t.importPath : void 0)]) : ((0, P.invokeUpdate)(w, this.options), [2]);
696
+ case 1:
697
+ return (x = M.sent()) || !S ? [3, 3] : [4, this.resolvePackageJson(t.packageName, (b = this.versions) === null || b === void 0 ? void 0 : b[t.packageName])];
698
+ case 2:
699
+ x = M.sent(), D = "", M.label = 3;
700
+ case 3:
701
+ return x ? (R = JSON.parse(x)).typings || R.types ? (T = R.typings || R.types, this.createModel(x, this.monaco.Uri.parse("".concat(this.options.fileRootPath, "node_modules/").concat(t.packageName).concat(D, "/package.json"))), (0, P.invokeUpdate)({ type: "LookedUpPackage", package: t.packageName, definitelyTyped: !1, success: !0 }, this.options), this.setVersion(t.packageName, R.version), [2, { kind: "relative-in-package", packageName: t.packageName, sourcePath: "", importPath: d.join((y = t.importPath) !== null && y !== void 0 ? y : "", T.startsWith("./") ? T.slice(2) : T) }]) : [3, 4] : [3, 7];
702
+ case 4:
703
+ return N = "@types/".concat(t.packageName.startsWith("@") ? t.packageName.slice(1).replace(/\//, "__") : t.packageName), [4, this.resolvePackageJson(N, (k = this.versions) === null || k === void 0 ? void 0 : k[N])];
704
+ case 5:
705
+ if (V = M.sent()) {
706
+ if ((E = JSON.parse(V)).typings || E.types) return T = E.typings || E.types, this.createModel(V, this.monaco.Uri.parse("".concat(this.options.fileRootPath, "node_modules/").concat(N, "/package.json"))), (0, P.invokeUpdate)({ type: "LookedUpPackage", package: N, definitelyTyped: !0, success: !0 }, this.options), this.setVersion(N, E.version), [2, { kind: "relative-in-package", packageName: N, sourcePath: "", importPath: d.join((p = t.importPath) !== null && p !== void 0 ? p : "", T.startsWith("./") ? T.slice(2) : T) }];
707
+ (0, P.invokeUpdate)(w, this.options);
708
+ } else (0, P.invokeUpdate)(w, this.options);
709
+ M.label = 6;
710
+ case 6:
711
+ return [3, 8];
712
+ case 7:
713
+ (0, P.invokeUpdate)(w, this.options), M.label = 8;
714
+ case 8:
715
+ return [2];
716
+ }
717
+ });
718
+ });
719
+ }, r.prototype.loadSourceFileContents = function(t) {
720
+ return a(this, void 0, void 0, function() {
721
+ var c, l, i, m, v, b, y, k, p, w, S, D, x, R, N, V;
722
+ return s(this, function(E) {
723
+ switch (E.label) {
724
+ case 0:
725
+ return c = d.join(t.packageName, t.sourcePath, t.importPath), l = { type: "LookedUpTypeFile", path: c, definitelyTyped: !1, success: !1 }, i = t.packageName, m = this.getVersion(t.packageName), (v = [".d.ts", "/index.d.ts", ".ts", ".tsx", "/index.ts", "/index.tsx"]).map(function(T) {
726
+ return t.importPath.endsWith(T);
727
+ }).reduce(function(T, M) {
728
+ return T || M;
729
+ }, !1) ? [4, this.resolveSourceFile(i, m, d.join(t.sourcePath, t.importPath))] : [3, 2];
730
+ case 1:
731
+ return (R = E.sent()) ? [2, { source: R, at: d.join(t.sourcePath, t.importPath) }] : [3, 9];
732
+ case 2:
733
+ E.trys.push([2, 7, 8, 9]), b = n(v), y = b.next(), E.label = 3;
734
+ case 3:
735
+ return y.done ? [3, 6] : (k = y.value, p = d.join(t.sourcePath, t.importPath), x = (k === ".d.ts" && p.endsWith(".js") ? p.slice(0, -3) : p) + k, [4, this.resolveSourceFile(i, m, x)]);
736
+ case 4:
737
+ if (R = E.sent(), (0, P.invokeUpdate)({ type: "AttemptedLookUpFile", path: d.join(i, x), success: !!R }, this.options), R) return (0, P.invokeUpdate)({ type: "LookedUpTypeFile", path: d.join(i, x), success: !0 }, this.options), [2, { source: R, at: x }];
738
+ E.label = 5;
739
+ case 5:
740
+ return y = b.next(), [3, 3];
741
+ case 6:
742
+ return [3, 9];
743
+ case 7:
744
+ return w = E.sent(), N = { error: w }, [3, 9];
745
+ case 8:
746
+ try {
747
+ y && !y.done && (V = b.return) && V.call(b);
748
+ } finally {
749
+ if (N) throw N.error;
750
+ }
751
+ return [7];
752
+ case 9:
753
+ return [4, this.resolvePackageJson(i, m, d.join(t.sourcePath, t.importPath))];
754
+ case 10:
755
+ return (S = E.sent()) && (D = JSON.parse(S).types) ? (x = d.join(t.sourcePath, t.importPath, D), [4, this.resolveSourceFile(i, m, x)]) : [3, 12];
756
+ case 11:
757
+ if (R = E.sent()) return (0, P.invokeUpdate)({ type: "LookedUpTypeFile", path: d.join(i, x), success: !0 }, this.options), [2, { source: R, at: x }];
758
+ E.label = 12;
759
+ case 12:
760
+ return (0, P.invokeUpdate)(l, this.options), [2, null];
761
+ }
762
+ });
763
+ });
764
+ }, r.prototype.getVersion = function(t) {
765
+ var c;
766
+ return (c = this.versions) === null || c === void 0 ? void 0 : c[t];
767
+ }, r.prototype.setVersions = function(t) {
768
+ var c, l;
769
+ this.versions = t, (l = (c = this.options).onUpdateVersions) === null || l === void 0 || l.call(c, t);
770
+ }, r.prototype.setVersion = function(t, c) {
771
+ var l;
772
+ this.setVersions(g(g({}, this.versions), ((l = {})[t] = c, l)));
773
+ }, r.prototype.createModel = function(t, c) {
774
+ c = c.with({ path: c.path.replace("@types/", "") }), this.monaco.editor.getModel(c) || (this.monaco.editor.createModel(t, "typescript", c), this.newImportsResolved = !0);
775
+ }, r.prototype.hashImportResourcePath = function(t) {
776
+ return (0, h.importResourcePathToString)(t);
777
+ }, r.prototype.resolvePackageJson = function(t, c, l) {
778
+ return a(this, void 0, void 0, function() {
779
+ var i, m, v, b;
780
+ return s(this, function(y) {
781
+ switch (y.label) {
782
+ case 0:
783
+ return i = d.join(t + (c ? "@".concat(c) : ""), l ?? "", "package.json"), m = !1, v = void 0, this.cache.isFileAvailable ? [4, this.cache.isFileAvailable(i)] : [3, 2];
784
+ case 1:
785
+ return m = y.sent(), [3, 4];
786
+ case 2:
787
+ return [4, this.cache.getFile(i)];
788
+ case 3:
789
+ v = y.sent(), m = v !== void 0, y.label = 4;
790
+ case 4:
791
+ return m ? v == null ? [3, 5] : (b = v, [3, 7]) : [3, 8];
792
+ case 5:
793
+ return [4, this.cache.getFile(i)];
794
+ case 6:
795
+ b = y.sent(), y.label = 7;
796
+ case 7:
797
+ return [2, b];
798
+ case 8:
799
+ return [4, this.sourceResolver.resolvePackageJson(t, c, l)];
800
+ case 9:
801
+ return (v = y.sent()) && this.cache.storeFile(i, v), [2, v];
802
+ }
803
+ });
804
+ });
805
+ }, r.prototype.resolveSourceFile = function(t, c, l) {
806
+ return a(this, void 0, void 0, function() {
807
+ var i, m, v, b;
808
+ return s(this, function(y) {
809
+ switch (y.label) {
810
+ case 0:
811
+ return i = d.join(t + (c ? "@".concat(c) : ""), l), m = !1, v = void 0, this.cache.isFileAvailable ? [4, this.cache.isFileAvailable(i)] : [3, 2];
812
+ case 1:
813
+ return m = y.sent(), [3, 4];
814
+ case 2:
815
+ return [4, this.cache.getFile(i)];
816
+ case 3:
817
+ v = y.sent(), m = v !== void 0, y.label = 4;
818
+ case 4:
819
+ return m ? ((0, P.invokeUpdate)({ type: "LoadedFromCache", importPath: i }, this.options), v == null ? [3, 5] : (b = v, [3, 7])) : [3, 8];
820
+ case 5:
821
+ return [4, this.cache.getFile(i)];
822
+ case 6:
823
+ b = y.sent(), y.label = 7;
824
+ case 7:
825
+ return [2, b];
826
+ case 8:
827
+ return [4, this.sourceResolver.resolveSourceFile(t, c, l)];
828
+ case 9:
829
+ return (v = y.sent()) && ((0, P.invokeUpdate)({ type: "StoredToCache", importPath: i }, this.options), this.cache.storeFile(i, v)), [2, v];
830
+ }
831
+ });
832
+ });
833
+ }, r;
834
+ }();
835
+ return C.ImportResolver = f, C;
836
+ }
837
+ function Oe() {
838
+ if (ne) return A;
839
+ ne = 1;
840
+ var g = A && A.__assign || function() {
841
+ return g = Object.assign || function(r) {
842
+ for (var t, c = 1, l = arguments.length; c < l; c++) for (var i in t = arguments[c]) Object.prototype.hasOwnProperty.call(t, i) && (r[i] = t[i]);
843
+ return r;
844
+ }, g.apply(this, arguments);
845
+ }, j = A && A.__createBinding || (Object.create ? function(r, t, c, l) {
846
+ l === void 0 && (l = c);
847
+ var i = Object.getOwnPropertyDescriptor(t, c);
848
+ i && !("get" in i ? !t.__esModule : i.writable || i.configurable) || (i = { enumerable: !0, get: function() {
849
+ return t[c];
850
+ } }), Object.defineProperty(r, l, i);
851
+ } : function(r, t, c, l) {
852
+ l === void 0 && (l = c), r[l] = t[c];
853
+ }), O = A && A.__setModuleDefault || (Object.create ? function(r, t) {
854
+ Object.defineProperty(r, "default", { enumerable: !0, value: t });
855
+ } : function(r, t) {
856
+ r.default = t;
857
+ }), o = A && A.__importStar || function(r) {
858
+ if (r && r.__esModule) return r;
859
+ var t = {};
860
+ if (r != null) for (var c in r) c !== "default" && Object.prototype.hasOwnProperty.call(r, c) && j(t, r, c);
861
+ return O(t, r), t;
862
+ }, a = A && A.__awaiter || function(r, t, c, l) {
863
+ return new (c || (c = Promise))(function(i, m) {
864
+ function v(k) {
865
+ try {
866
+ y(l.next(k));
867
+ } catch (p) {
868
+ m(p);
869
+ }
870
+ }
871
+ function b(k) {
872
+ try {
873
+ y(l.throw(k));
874
+ } catch (p) {
875
+ m(p);
876
+ }
877
+ }
878
+ function y(k) {
879
+ var p;
880
+ k.done ? i(k.value) : (p = k.value, p instanceof c ? p : new c(function(w) {
881
+ w(p);
882
+ })).then(v, b);
883
+ }
884
+ y((l = l.apply(r, t || [])).next());
885
+ });
886
+ }, s = A && A.__generator || function(r, t) {
887
+ var c, l, i, m, v = { label: 0, sent: function() {
888
+ if (1 & i[0]) throw i[1];
889
+ return i[1];
890
+ }, trys: [], ops: [] };
891
+ return m = { next: b(0), throw: b(1), return: b(2) }, typeof Symbol == "function" && (m[Symbol.iterator] = function() {
892
+ return this;
893
+ }), m;
894
+ function b(y) {
895
+ return function(k) {
896
+ return function(p) {
897
+ if (c) throw new TypeError("Generator is already executing.");
898
+ for (; v; ) try {
899
+ if (c = 1, l && (i = 2 & p[0] ? l.return : p[0] ? l.throw || ((i = l.return) && i.call(l), 0) : l.next) && !(i = i.call(l, p[1])).done) return i;
900
+ switch (l = 0, i && (p = [2 & p[0], i.value]), p[0]) {
901
+ case 0:
902
+ case 1:
903
+ i = p;
904
+ break;
905
+ case 4:
906
+ return v.label++, { value: p[1], done: !1 };
907
+ case 5:
908
+ v.label++, l = p[1], p = [0];
909
+ continue;
910
+ case 7:
911
+ p = v.ops.pop(), v.trys.pop();
912
+ continue;
913
+ default:
914
+ if (i = v.trys, !((i = i.length > 0 && i[i.length - 1]) || p[0] !== 6 && p[0] !== 2)) {
915
+ v = 0;
916
+ continue;
917
+ }
918
+ if (p[0] === 3 && (!i || p[1] > i[0] && p[1] < i[3])) {
919
+ v.label = p[1];
920
+ break;
921
+ }
922
+ if (p[0] === 6 && v.label < i[1]) {
923
+ v.label = i[1], i = p;
924
+ break;
925
+ }
926
+ if (i && v.label < i[2]) {
927
+ v.label = i[2], v.ops.push(p);
928
+ break;
929
+ }
930
+ i[2] && v.ops.pop(), v.trys.pop();
931
+ continue;
932
+ }
933
+ p = t.call(r, v);
934
+ } catch (w) {
935
+ p = [6, w], l = 0;
936
+ } finally {
937
+ c = i = 0;
938
+ }
939
+ if (5 & p[0]) throw p[1];
940
+ return { value: p[0] ? p[1] : void 0, done: !0 };
941
+ }([y, k]);
942
+ };
943
+ }
944
+ }, n = A && A.__values || function(r) {
945
+ var t = typeof Symbol == "function" && Symbol.iterator, c = t && r[t], l = 0;
946
+ if (c) return c.call(r);
947
+ if (r && typeof r.length == "number") return { next: function() {
948
+ return r && l >= r.length && (r = void 0), { value: r && r[l++], done: !r };
949
+ } };
950
+ throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
951
+ };
952
+ Object.defineProperty(A, "__esModule", { value: !0 }), A.AutoTypingsCore = void 0;
953
+ var e = function() {
954
+ if (K) return X;
955
+ K = 1, Object.defineProperty(X, "__esModule", { value: !0 }), X.DummySourceCache = void 0;
956
+ var r = function() {
957
+ function t() {
958
+ }
959
+ return t.prototype.getFile = function(c) {
960
+ return Promise.resolve(void 0);
961
+ }, t.prototype.isFileAvailable = function(c) {
962
+ return Promise.resolve(!1);
963
+ }, t.prototype.storeFile = function(c, l) {
964
+ return Promise.resolve(void 0);
965
+ }, t.prototype.clear = function() {
966
+ return Promise.resolve(void 0);
967
+ }, t;
968
+ }();
969
+ return X.DummySourceCache = r, X;
970
+ }(), u = me(), h = Pe(), d = o(q()), P = ke(), _ = we(), f = function() {
971
+ function r(t, c) {
972
+ var l = this;
973
+ this.editor = t, this.options = c, this.disposables = [], this.importResolver = new h.ImportResolver(c);
974
+ var i = t.onDidChangeModelContent(function(m) {
975
+ l.debouncedResolveContents();
976
+ });
977
+ this.disposables.push(i), this.resolveContents(), c.dontAdaptEditorOptions || c.monaco.languages.typescript.typescriptDefaults.setCompilerOptions(g(g({}, c.monaco.languages.typescript.typescriptDefaults.getCompilerOptions()), { moduleResolution: c.monaco.languages.typescript.ModuleResolutionKind.NodeJs, allowSyntheticDefaultImports: !0, rootDir: c.fileRootPath }));
978
+ }
979
+ return r.create = function(t, c) {
980
+ var l, i;
981
+ return a(this, void 0, void 0, function() {
982
+ var m;
983
+ return s(this, function(v) {
984
+ if (c?.shareCache && c.sourceCache && !r.sharedCache && (r.sharedCache = c.sourceCache), !(m = c?.monaco)) throw new Error("monacoInstance not found, you can specify the monaco instance via options.monaco");
985
+ return [2, new r(t, g(g({ fileRootPath: "inmemory://model/", onlySpecifiedPackages: !1, preloadPackages: !1, shareCache: !1, dontAdaptEditorOptions: !1, dontRefreshModelValueAfterResolvement: !1, sourceCache: (l = r.sharedCache) !== null && l !== void 0 ? l : new e.DummySourceCache(), sourceResolver: (i = c?.sourceResolver) !== null && i !== void 0 ? i : new u.JsDelivrSourceResolver(), debounceDuration: 4e3, fileRecursionDepth: 10, packageRecursionDepth: 3 }, c), { monaco: m }))];
986
+ });
987
+ });
988
+ }, r.prototype.dispose = function() {
989
+ var t, c;
990
+ try {
991
+ for (var l = n(this.disposables), i = l.next(); !i.done; i = l.next())
992
+ i.value.dispose();
993
+ } catch (m) {
994
+ t = { error: m };
995
+ } finally {
996
+ try {
997
+ i && !i.done && (c = l.return) && c.call(l);
998
+ } finally {
999
+ if (t) throw t.error;
1000
+ }
1001
+ }
1002
+ }, r.prototype.setVersions = function(t) {
1003
+ this.importResolver.setVersions(t), this.options.versions = t;
1004
+ }, r.prototype.clearCache = function() {
1005
+ return a(this, void 0, void 0, function() {
1006
+ return s(this, function(t) {
1007
+ switch (t.label) {
1008
+ case 0:
1009
+ return [4, this.options.sourceCache.clear()];
1010
+ case 1:
1011
+ return t.sent(), [2];
1012
+ }
1013
+ });
1014
+ });
1015
+ }, r.prototype.debouncedResolveContents = function() {
1016
+ var t = this;
1017
+ this.isResolving || ((0, P.invokeUpdate)({ type: "CodeChanged" }, this.options), this.options.debounceDuration <= 0 ? this.resolveContents() : (this.debounceTimer !== void 0 && clearTimeout(this.debounceTimer), this.debounceTimer = setTimeout(function() {
1018
+ return a(t, void 0, void 0, function() {
1019
+ return s(this, function(c) {
1020
+ switch (c.label) {
1021
+ case 0:
1022
+ return [4, this.resolveContents()];
1023
+ case 1:
1024
+ return c.sent(), this.debounceTimer = void 0, [2];
1025
+ }
1026
+ });
1027
+ });
1028
+ }, this.options.debounceDuration)));
1029
+ }, r.prototype.resolveContents = function() {
1030
+ var t;
1031
+ return a(this, void 0, void 0, function() {
1032
+ var c, l, i, m;
1033
+ return s(this, function(v) {
1034
+ switch (v.label) {
1035
+ case 0:
1036
+ if (this.isResolving = !0, (0, P.invokeUpdate)({ type: "ResolveNewImports" }, this.options), !(c = this.editor.getModel())) throw Error("No model");
1037
+ l = c.getLinesContent(), v.label = 1;
1038
+ case 1:
1039
+ return v.trys.push([1, 3, , 4]), [4, this.importResolver.resolveImportsInFile(l.join(`
1040
+ `), d.dirname(c.uri.toString()), new _.RecursionDepth(this.options))];
1041
+ case 2:
1042
+ return v.sent(), [3, 4];
1043
+ case 3:
1044
+ if (i = v.sent(), !this.options.onError) throw i;
1045
+ return this.options.onError((t = i.message) !== null && t !== void 0 ? t : i), [3, 4];
1046
+ case 4:
1047
+ return this.importResolver.wereNewImportsResolved() && (this.options.dontRefreshModelValueAfterResolvement || (m = this.editor.getPosition(), c.setValue(c.getValue()), m && this.editor.setPosition(m)), this.importResolver.resetNewImportsResolved()), this.isResolving = !1, [2];
1048
+ }
1049
+ });
1050
+ });
1051
+ }, r;
1052
+ }();
1053
+ return A.AutoTypingsCore = f, A;
1054
+ }
1055
+ var ae, I = {};
1056
+ function je() {
1057
+ if (ae) return I;
1058
+ ae = 1;
1059
+ var g = I && I.__awaiter || function(a, s, n, e) {
1060
+ return new (n || (n = Promise))(function(u, h) {
1061
+ function d(f) {
1062
+ try {
1063
+ _(e.next(f));
1064
+ } catch (r) {
1065
+ h(r);
1066
+ }
1067
+ }
1068
+ function P(f) {
1069
+ try {
1070
+ _(e.throw(f));
1071
+ } catch (r) {
1072
+ h(r);
1073
+ }
1074
+ }
1075
+ function _(f) {
1076
+ var r;
1077
+ f.done ? u(f.value) : (r = f.value, r instanceof n ? r : new n(function(t) {
1078
+ t(r);
1079
+ })).then(d, P);
1080
+ }
1081
+ _((e = e.apply(a, s || [])).next());
1082
+ });
1083
+ }, j = I && I.__generator || function(a, s) {
1084
+ var n, e, u, h, d = { label: 0, sent: function() {
1085
+ if (1 & u[0]) throw u[1];
1086
+ return u[1];
1087
+ }, trys: [], ops: [] };
1088
+ return h = { next: P(0), throw: P(1), return: P(2) }, typeof Symbol == "function" && (h[Symbol.iterator] = function() {
1089
+ return this;
1090
+ }), h;
1091
+ function P(_) {
1092
+ return function(f) {
1093
+ return function(r) {
1094
+ if (n) throw new TypeError("Generator is already executing.");
1095
+ for (; d; ) try {
1096
+ if (n = 1, e && (u = 2 & r[0] ? e.return : r[0] ? e.throw || ((u = e.return) && u.call(e), 0) : e.next) && !(u = u.call(e, r[1])).done) return u;
1097
+ switch (e = 0, u && (r = [2 & r[0], u.value]), r[0]) {
1098
+ case 0:
1099
+ case 1:
1100
+ u = r;
1101
+ break;
1102
+ case 4:
1103
+ return d.label++, { value: r[1], done: !1 };
1104
+ case 5:
1105
+ d.label++, e = r[1], r = [0];
1106
+ continue;
1107
+ case 7:
1108
+ r = d.ops.pop(), d.trys.pop();
1109
+ continue;
1110
+ default:
1111
+ if (u = d.trys, !((u = u.length > 0 && u[u.length - 1]) || r[0] !== 6 && r[0] !== 2)) {
1112
+ d = 0;
1113
+ continue;
1114
+ }
1115
+ if (r[0] === 3 && (!u || r[1] > u[0] && r[1] < u[3])) {
1116
+ d.label = r[1];
1117
+ break;
1118
+ }
1119
+ if (r[0] === 6 && d.label < u[1]) {
1120
+ d.label = u[1], u = r;
1121
+ break;
1122
+ }
1123
+ if (u && d.label < u[2]) {
1124
+ d.label = u[2], d.ops.push(r);
1125
+ break;
1126
+ }
1127
+ u[2] && d.ops.pop(), d.trys.pop();
1128
+ continue;
1129
+ }
1130
+ r = s.call(a, d);
1131
+ } catch (t) {
1132
+ r = [6, t], e = 0;
1133
+ } finally {
1134
+ n = u = 0;
1135
+ }
1136
+ if (5 & r[0]) throw r[1];
1137
+ return { value: r[0] ? r[1] : void 0, done: !0 };
1138
+ }([_, f]);
1139
+ };
1140
+ }
1141
+ }, O = I && I.__values || function(a) {
1142
+ var s = typeof Symbol == "function" && Symbol.iterator, n = s && a[s], e = 0;
1143
+ if (n) return n.call(a);
1144
+ if (a && typeof a.length == "number") return { next: function() {
1145
+ return a && e >= a.length && (a = void 0), { value: a && a[e++], done: !a };
1146
+ } };
1147
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1148
+ };
1149
+ Object.defineProperty(I, "__esModule", { value: !0 }), I.LocalStorageCache = void 0;
1150
+ var o = function() {
1151
+ function a() {
1152
+ this.localCache = {};
1153
+ }
1154
+ return a.prototype.getFile = function(s) {
1155
+ var n;
1156
+ return g(this, void 0, void 0, function() {
1157
+ return j(this, function(e) {
1158
+ try {
1159
+ return [2, (n = localStorage.getItem(a.LOCALSTORAGE_PREFIX + s)) !== null && n !== void 0 ? n : void 0];
1160
+ } catch {
1161
+ return [2, this.localCache[s]];
1162
+ }
1163
+ return [2];
1164
+ });
1165
+ });
1166
+ }, a.prototype.storeFile = function(s, n) {
1167
+ return g(this, void 0, void 0, function() {
1168
+ return j(this, function(e) {
1169
+ this.localCache[s] = n;
1170
+ try {
1171
+ localStorage.setItem(a.LOCALSTORAGE_PREFIX + s, n);
1172
+ } catch {
1173
+ }
1174
+ return [2];
1175
+ });
1176
+ });
1177
+ }, a.prototype.clear = function() {
1178
+ return g(this, void 0, void 0, function() {
1179
+ var s, n, e, u, h, d, P;
1180
+ return j(this, function(_) {
1181
+ for (this.localCache = {}, s = [], n = 0; n < localStorage.length; n++) (h = localStorage.key(n)) != null && h.startsWith(a.LOCALSTORAGE_PREFIX) && s.push(h);
1182
+ try {
1183
+ for (e = O(s), u = e.next(); !u.done; u = e.next()) h = u.value, localStorage.removeItem(h);
1184
+ } catch (f) {
1185
+ d = { error: f };
1186
+ } finally {
1187
+ try {
1188
+ u && !u.done && (P = e.return) && P.call(e);
1189
+ } finally {
1190
+ if (d) throw d.error;
1191
+ }
1192
+ }
1193
+ return [2];
1194
+ });
1195
+ });
1196
+ }, a.LOCALSTORAGE_PREFIX = "__autotyper_cache_", a;
1197
+ }();
1198
+ return I.LocalStorageCache = o, I;
1199
+ }
1200
+ var ie, se = {}, ce, ue = {}, le, pe = {}, he, fe = {}, de, ve, ye, ge, L = {};
1201
+ function Re() {
1202
+ if (de) return L;
1203
+ de = 1;
1204
+ var g = L && L.__awaiter || function(o, a, s, n) {
1205
+ return new (s || (s = Promise))(function(e, u) {
1206
+ function h(_) {
1207
+ try {
1208
+ P(n.next(_));
1209
+ } catch (f) {
1210
+ u(f);
1211
+ }
1212
+ }
1213
+ function d(_) {
1214
+ try {
1215
+ P(n.throw(_));
1216
+ } catch (f) {
1217
+ u(f);
1218
+ }
1219
+ }
1220
+ function P(_) {
1221
+ var f;
1222
+ _.done ? e(_.value) : (f = _.value, f instanceof s ? f : new s(function(r) {
1223
+ r(f);
1224
+ })).then(h, d);
1225
+ }
1226
+ P((n = n.apply(o, a || [])).next());
1227
+ });
1228
+ }, j = L && L.__generator || function(o, a) {
1229
+ var s, n, e, u, h = { label: 0, sent: function() {
1230
+ if (1 & e[0]) throw e[1];
1231
+ return e[1];
1232
+ }, trys: [], ops: [] };
1233
+ return u = { next: d(0), throw: d(1), return: d(2) }, typeof Symbol == "function" && (u[Symbol.iterator] = function() {
1234
+ return this;
1235
+ }), u;
1236
+ function d(P) {
1237
+ return function(_) {
1238
+ return function(f) {
1239
+ if (s) throw new TypeError("Generator is already executing.");
1240
+ for (; h; ) try {
1241
+ if (s = 1, n && (e = 2 & f[0] ? n.return : f[0] ? n.throw || ((e = n.return) && e.call(n), 0) : n.next) && !(e = e.call(n, f[1])).done) return e;
1242
+ switch (n = 0, e && (f = [2 & f[0], e.value]), f[0]) {
1243
+ case 0:
1244
+ case 1:
1245
+ e = f;
1246
+ break;
1247
+ case 4:
1248
+ return h.label++, { value: f[1], done: !1 };
1249
+ case 5:
1250
+ h.label++, n = f[1], f = [0];
1251
+ continue;
1252
+ case 7:
1253
+ f = h.ops.pop(), h.trys.pop();
1254
+ continue;
1255
+ default:
1256
+ if (e = h.trys, !((e = e.length > 0 && e[e.length - 1]) || f[0] !== 6 && f[0] !== 2)) {
1257
+ h = 0;
1258
+ continue;
1259
+ }
1260
+ if (f[0] === 3 && (!e || f[1] > e[0] && f[1] < e[3])) {
1261
+ h.label = f[1];
1262
+ break;
1263
+ }
1264
+ if (f[0] === 6 && h.label < e[1]) {
1265
+ h.label = e[1], e = f;
1266
+ break;
1267
+ }
1268
+ if (e && h.label < e[2]) {
1269
+ h.label = e[2], h.ops.push(f);
1270
+ break;
1271
+ }
1272
+ e[2] && h.ops.pop(), h.trys.pop();
1273
+ continue;
1274
+ }
1275
+ f = a.call(o, h);
1276
+ } catch (r) {
1277
+ f = [6, r], n = 0;
1278
+ } finally {
1279
+ s = e = 0;
1280
+ }
1281
+ if (5 & f[0]) throw f[1];
1282
+ return { value: f[0] ? f[1] : void 0, done: !0 };
1283
+ }([P, _]);
1284
+ };
1285
+ }
1286
+ };
1287
+ Object.defineProperty(L, "__esModule", { value: !0 }), L.UnpkgSourceResolver = void 0;
1288
+ var O = function() {
1289
+ function o() {
1290
+ }
1291
+ return o.prototype.resolvePackageJson = function(a, s, n) {
1292
+ return g(this, void 0, void 0, function() {
1293
+ return j(this, function(e) {
1294
+ switch (e.label) {
1295
+ case 0:
1296
+ return [4, this.resolveFile("https://unpkg.com/".concat(a).concat(s ? "@".concat(s) : "").concat(n ? "/".concat(n) : "", "/package.json"))];
1297
+ case 1:
1298
+ return [2, e.sent()];
1299
+ }
1300
+ });
1301
+ });
1302
+ }, o.prototype.resolveSourceFile = function(a, s, n) {
1303
+ return g(this, void 0, void 0, function() {
1304
+ return j(this, function(e) {
1305
+ switch (e.label) {
1306
+ case 0:
1307
+ return [4, this.resolveFile("https://unpkg.com/".concat(a).concat(s ? "@".concat(s) : "", "/").concat(n))];
1308
+ case 1:
1309
+ return [2, e.sent()];
1310
+ }
1311
+ });
1312
+ });
1313
+ }, o.prototype.resolveFile = function(a) {
1314
+ return g(this, void 0, void 0, function() {
1315
+ var s;
1316
+ return j(this, function(n) {
1317
+ switch (n.label) {
1318
+ case 0:
1319
+ return [4, fetch(a, { method: "GET" })];
1320
+ case 1:
1321
+ return (s = n.sent()).ok ? [4, s.text()] : [3, 3];
1322
+ case 2:
1323
+ return [2, n.sent()];
1324
+ case 3:
1325
+ if (s.status === 404) return [2, ""];
1326
+ throw Error("Error other than 404 while fetching from Unpkg at ".concat(a));
1327
+ case 4:
1328
+ return [2];
1329
+ }
1330
+ });
1331
+ });
1332
+ }, o;
1333
+ }();
1334
+ return L.UnpkgSourceResolver = O, L;
1335
+ }
1336
+ function Ce() {
1337
+ return ve || (ve = 1, g = W, j = W && W.__createBinding || (Object.create ? function(o, a, s, n) {
1338
+ n === void 0 && (n = s);
1339
+ var e = Object.getOwnPropertyDescriptor(a, s);
1340
+ e && !("get" in e ? !a.__esModule : e.writable || e.configurable) || (e = { enumerable: !0, get: function() {
1341
+ return a[s];
1342
+ } }), Object.defineProperty(o, n, e);
1343
+ } : function(o, a, s, n) {
1344
+ n === void 0 && (n = s), o[n] = a[s];
1345
+ }), O = W && W.__exportStar || function(o, a) {
1346
+ for (var s in o) s === "default" || Object.prototype.hasOwnProperty.call(a, s) || j(a, o, s);
1347
+ }, Object.defineProperty(g, "__esModule", { value: !0 }), O(function() {
1348
+ if (oe) return G;
1349
+ oe = 1;
1350
+ var o, a = G && G.__extends || (o = function(n, e) {
1351
+ return o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(u, h) {
1352
+ u.__proto__ = h;
1353
+ } || function(u, h) {
1354
+ for (var d in h) Object.prototype.hasOwnProperty.call(h, d) && (u[d] = h[d]);
1355
+ }, o(n, e);
1356
+ }, function(n, e) {
1357
+ if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
1358
+ function u() {
1359
+ this.constructor = n;
1360
+ }
1361
+ o(n, e), n.prototype = e === null ? Object.create(e) : (u.prototype = e.prototype, new u());
1362
+ });
1363
+ Object.defineProperty(G, "__esModule", { value: !0 }), G.AutoTypings = void 0;
1364
+ var s = function(n) {
1365
+ function e(u, h) {
1366
+ return n.call(this, u, h) || this;
1367
+ }
1368
+ return a(e, n), e;
1369
+ }(Oe().AutoTypingsCore);
1370
+ return G.AutoTypings = s, G;
1371
+ }(), g), O(be(), g), O(je(), g), O((ie || (ie = 1, Object.defineProperty(se, "__esModule", { value: !0 })), se), g), O((ce || (ce = 1, Object.defineProperty(ue, "__esModule", { value: !0 })), ue), g), O((le || (le = 1, Object.defineProperty(pe, "__esModule", { value: !0 })), pe), g), O((he || (he = 1, Object.defineProperty(fe, "__esModule", { value: !0 })), fe), g), O(Re(), g), O(me(), g)), W;
1372
+ var g, j, O;
1373
+ }
1374
+ const Se = _e({ __proto__: null }, [ge ? ye : (ge = 1, ye = Ce())]);
1375
+ export {
1376
+ Se as c
1377
+ };