@micro-lc/preview 0.5.0-rc4 → 0.5.0-rc5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,105 +1,2119 @@
1
- const sourceMap = /* @__PURE__ */ new Map();
2
- const tosMap = /* @__PURE__ */ new Map();
3
- const clientIdsToScope = /* @__PURE__ */ new Map();
4
- const isAvailable = (key, map) => {
5
- const iter = map.keys();
6
- let matchingKey;
7
- let { done = false, value } = iter.next();
8
- while (!done && matchingKey === void 0) {
9
- if (value !== void 0 && key.startsWith(value)) {
10
- matchingKey = value;
11
- done = true;
12
- }
13
- const { value: nextValue, done: nextDone = false } = iter.next();
14
- done = nextDone;
15
- value = nextValue;
16
- }
17
- return matchingKey;
18
- };
19
- const send = (clientId, message) => {
20
- self.clients.get(clientId).then((client) => client == null ? void 0 : client.postMessage(message)).catch((err) => console.error(`[SW]: error on ${clientId} - ${String(err)}`));
21
- };
22
- const isWindowClient = (source) => source !== null && "id" in source;
23
- self.addEventListener("install", () => {
24
- self.skipWaiting().catch((err) => console.error(`[SW] error while skipWaiting - ${String(err)}`));
25
- });
26
- self.addEventListener("activate", (event) => {
27
- event.waitUntil(self.clients.claim());
28
- });
29
- self.addEventListener("message", ({ data, source }) => {
30
- if (!isWindowClient(source)) {
31
- return;
32
- }
33
- const { id: clientId } = source;
34
- const workerMessageData = data;
35
- switch (workerMessageData.type) {
36
- case "set-source-map": {
37
- const { content: { scope, dictionary } } = workerMessageData;
38
- const scopedId = scope != null ? scope : clientId;
39
- const clientMaps = Object.entries(dictionary).reduce((maps, [key, value]) => {
40
- const { clientSourceMap, clientTosMap } = maps;
41
- if (Object.keys(value.headers).length > 0) {
42
- clientTosMap.set(value.to, value.headers);
43
- }
44
- clientSourceMap.set(key, value);
45
- return maps;
46
- }, { clientSourceMap: /* @__PURE__ */ new Map(), clientTosMap: /* @__PURE__ */ new Map() });
47
- if (scope) {
48
- clientIdsToScope.set(clientId, scope);
1
+ "use strict";
2
+ (() => {
3
+ // ../../.yarn/cache/tslib-npm-2.5.2-3f1b58afbb-4d3c1e238b.zip/node_modules/tslib/tslib.es6.js
4
+ var extendStatics = function(d, b) {
5
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
6
+ d2.__proto__ = b2;
7
+ } || function(d2, b2) {
8
+ for (var p in b2)
9
+ if (Object.prototype.hasOwnProperty.call(b2, p))
10
+ d2[p] = b2[p];
11
+ };
12
+ return extendStatics(d, b);
13
+ };
14
+ function __extends(d, b) {
15
+ if (typeof b !== "function" && b !== null)
16
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
17
+ extendStatics(d, b);
18
+ function __() {
19
+ this.constructor = d;
20
+ }
21
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
22
+ }
23
+ function __awaiter(thisArg, _arguments, P, generator) {
24
+ function adopt(value) {
25
+ return value instanceof P ? value : new P(function(resolve) {
26
+ resolve(value);
27
+ });
28
+ }
29
+ return new (P || (P = Promise))(function(resolve, reject) {
30
+ function fulfilled(value) {
31
+ try {
32
+ step(generator.next(value));
33
+ } catch (e) {
34
+ reject(e);
35
+ }
36
+ }
37
+ function rejected(value) {
38
+ try {
39
+ step(generator["throw"](value));
40
+ } catch (e) {
41
+ reject(e);
42
+ }
43
+ }
44
+ function step(result) {
45
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
46
+ }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ }
50
+ function __generator(thisArg, body) {
51
+ var _ = { label: 0, sent: function() {
52
+ if (t[0] & 1)
53
+ throw t[1];
54
+ return t[1];
55
+ }, trys: [], ops: [] }, f, y, t, g;
56
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
57
+ return this;
58
+ }), g;
59
+ function verb(n) {
60
+ return function(v) {
61
+ return step([n, v]);
62
+ };
63
+ }
64
+ function step(op) {
65
+ if (f)
66
+ throw new TypeError("Generator is already executing.");
67
+ while (g && (g = 0, op[0] && (_ = 0)), _)
68
+ try {
69
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
70
+ return t;
71
+ if (y = 0, t)
72
+ op = [op[0] & 2, t.value];
73
+ switch (op[0]) {
74
+ case 0:
75
+ case 1:
76
+ t = op;
77
+ break;
78
+ case 4:
79
+ _.label++;
80
+ return { value: op[1], done: false };
81
+ case 5:
82
+ _.label++;
83
+ y = op[1];
84
+ op = [0];
85
+ continue;
86
+ case 7:
87
+ op = _.ops.pop();
88
+ _.trys.pop();
89
+ continue;
90
+ default:
91
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
92
+ _ = 0;
93
+ continue;
94
+ }
95
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
96
+ _.label = op[1];
97
+ break;
98
+ }
99
+ if (op[0] === 6 && _.label < t[1]) {
100
+ _.label = t[1];
101
+ t = op;
102
+ break;
103
+ }
104
+ if (t && _.label < t[2]) {
105
+ _.label = t[2];
106
+ _.ops.push(op);
107
+ break;
108
+ }
109
+ if (t[2])
110
+ _.ops.pop();
111
+ _.trys.pop();
112
+ continue;
113
+ }
114
+ op = body.call(thisArg, _);
115
+ } catch (e) {
116
+ op = [6, e];
117
+ y = 0;
118
+ } finally {
119
+ f = t = 0;
120
+ }
121
+ if (op[0] & 5)
122
+ throw op[1];
123
+ return { value: op[0] ? op[1] : void 0, done: true };
124
+ }
125
+ }
126
+ function __values(o) {
127
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
128
+ if (m)
129
+ return m.call(o);
130
+ if (o && typeof o.length === "number")
131
+ return {
132
+ next: function() {
133
+ if (o && i >= o.length)
134
+ o = void 0;
135
+ return { value: o && o[i++], done: !o };
136
+ }
137
+ };
138
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
139
+ }
140
+ function __read(o, n) {
141
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
142
+ if (!m)
143
+ return o;
144
+ var i = m.call(o), r, ar = [], e;
145
+ try {
146
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
147
+ ar.push(r.value);
148
+ } catch (error) {
149
+ e = { error };
150
+ } finally {
151
+ try {
152
+ if (r && !r.done && (m = i["return"]))
153
+ m.call(i);
154
+ } finally {
155
+ if (e)
156
+ throw e.error;
157
+ }
158
+ }
159
+ return ar;
160
+ }
161
+ function __spreadArray(to, from, pack) {
162
+ if (pack || arguments.length === 2)
163
+ for (var i = 0, l = from.length, ar; i < l; i++) {
164
+ if (ar || !(i in from)) {
165
+ if (!ar)
166
+ ar = Array.prototype.slice.call(from, 0, i);
167
+ ar[i] = from[i];
168
+ }
169
+ }
170
+ return to.concat(ar || Array.prototype.slice.call(from));
171
+ }
172
+ function __await(v) {
173
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
174
+ }
175
+ function __asyncGenerator(thisArg, _arguments, generator) {
176
+ if (!Symbol.asyncIterator)
177
+ throw new TypeError("Symbol.asyncIterator is not defined.");
178
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
179
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
180
+ return this;
181
+ }, i;
182
+ function verb(n) {
183
+ if (g[n])
184
+ i[n] = function(v) {
185
+ return new Promise(function(a, b) {
186
+ q.push([n, v, a, b]) > 1 || resume(n, v);
187
+ });
188
+ };
189
+ }
190
+ function resume(n, v) {
191
+ try {
192
+ step(g[n](v));
193
+ } catch (e) {
194
+ settle(q[0][3], e);
195
+ }
196
+ }
197
+ function step(r) {
198
+ r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
199
+ }
200
+ function fulfill(value) {
201
+ resume("next", value);
202
+ }
203
+ function reject(value) {
204
+ resume("throw", value);
205
+ }
206
+ function settle(f, v) {
207
+ if (f(v), q.shift(), q.length)
208
+ resume(q[0][0], q[0][1]);
209
+ }
210
+ }
211
+ function __asyncValues(o) {
212
+ if (!Symbol.asyncIterator)
213
+ throw new TypeError("Symbol.asyncIterator is not defined.");
214
+ var m = o[Symbol.asyncIterator], i;
215
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
216
+ return this;
217
+ }, i);
218
+ function verb(n) {
219
+ i[n] = o[n] && function(v) {
220
+ return new Promise(function(resolve, reject) {
221
+ v = o[n](v), settle(resolve, reject, v.done, v.value);
222
+ });
223
+ };
224
+ }
225
+ function settle(resolve, reject, d, v) {
226
+ Promise.resolve(v).then(function(v2) {
227
+ resolve({ value: v2, done: d });
228
+ }, reject);
229
+ }
230
+ }
231
+
232
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/isFunction.js
233
+ function isFunction(value) {
234
+ return typeof value === "function";
235
+ }
236
+
237
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js
238
+ function createErrorClass(createImpl) {
239
+ var _super = function(instance) {
240
+ Error.call(instance);
241
+ instance.stack = new Error().stack;
242
+ };
243
+ var ctorFunc = createImpl(_super);
244
+ ctorFunc.prototype = Object.create(Error.prototype);
245
+ ctorFunc.prototype.constructor = ctorFunc;
246
+ return ctorFunc;
247
+ }
248
+
249
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js
250
+ var UnsubscriptionError = createErrorClass(function(_super) {
251
+ return function UnsubscriptionErrorImpl(errors) {
252
+ _super(this);
253
+ this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err, i) {
254
+ return i + 1 + ") " + err.toString();
255
+ }).join("\n ") : "";
256
+ this.name = "UnsubscriptionError";
257
+ this.errors = errors;
258
+ };
259
+ });
260
+
261
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js
262
+ function arrRemove(arr, item) {
263
+ if (arr) {
264
+ var index = arr.indexOf(item);
265
+ 0 <= index && arr.splice(index, 1);
266
+ }
267
+ }
268
+
269
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/Subscription.js
270
+ var Subscription = function() {
271
+ function Subscription2(initialTeardown) {
272
+ this.initialTeardown = initialTeardown;
273
+ this.closed = false;
274
+ this._parentage = null;
275
+ this._finalizers = null;
276
+ }
277
+ Subscription2.prototype.unsubscribe = function() {
278
+ var e_1, _a, e_2, _b;
279
+ var errors;
280
+ if (!this.closed) {
281
+ this.closed = true;
282
+ var _parentage = this._parentage;
283
+ if (_parentage) {
284
+ this._parentage = null;
285
+ if (Array.isArray(_parentage)) {
286
+ try {
287
+ for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {
288
+ var parent_1 = _parentage_1_1.value;
289
+ parent_1.remove(this);
290
+ }
291
+ } catch (e_1_1) {
292
+ e_1 = { error: e_1_1 };
293
+ } finally {
294
+ try {
295
+ if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return))
296
+ _a.call(_parentage_1);
297
+ } finally {
298
+ if (e_1)
299
+ throw e_1.error;
300
+ }
301
+ }
302
+ } else {
303
+ _parentage.remove(this);
304
+ }
305
+ }
306
+ var initialFinalizer = this.initialTeardown;
307
+ if (isFunction(initialFinalizer)) {
308
+ try {
309
+ initialFinalizer();
310
+ } catch (e) {
311
+ errors = e instanceof UnsubscriptionError ? e.errors : [e];
312
+ }
313
+ }
314
+ var _finalizers = this._finalizers;
315
+ if (_finalizers) {
316
+ this._finalizers = null;
317
+ try {
318
+ for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
319
+ var finalizer = _finalizers_1_1.value;
320
+ try {
321
+ execFinalizer(finalizer);
322
+ } catch (err) {
323
+ errors = errors !== null && errors !== void 0 ? errors : [];
324
+ if (err instanceof UnsubscriptionError) {
325
+ errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));
326
+ } else {
327
+ errors.push(err);
328
+ }
329
+ }
330
+ }
331
+ } catch (e_2_1) {
332
+ e_2 = { error: e_2_1 };
333
+ } finally {
334
+ try {
335
+ if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return))
336
+ _b.call(_finalizers_1);
337
+ } finally {
338
+ if (e_2)
339
+ throw e_2.error;
340
+ }
341
+ }
342
+ }
343
+ if (errors) {
344
+ throw new UnsubscriptionError(errors);
345
+ }
346
+ }
347
+ };
348
+ Subscription2.prototype.add = function(teardown) {
349
+ var _a;
350
+ if (teardown && teardown !== this) {
351
+ if (this.closed) {
352
+ execFinalizer(teardown);
353
+ } else {
354
+ if (teardown instanceof Subscription2) {
355
+ if (teardown.closed || teardown._hasParent(this)) {
356
+ return;
357
+ }
358
+ teardown._addParent(this);
359
+ }
360
+ (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
361
+ }
362
+ }
363
+ };
364
+ Subscription2.prototype._hasParent = function(parent) {
365
+ var _parentage = this._parentage;
366
+ return _parentage === parent || Array.isArray(_parentage) && _parentage.includes(parent);
367
+ };
368
+ Subscription2.prototype._addParent = function(parent) {
369
+ var _parentage = this._parentage;
370
+ this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
371
+ };
372
+ Subscription2.prototype._removeParent = function(parent) {
373
+ var _parentage = this._parentage;
374
+ if (_parentage === parent) {
375
+ this._parentage = null;
376
+ } else if (Array.isArray(_parentage)) {
377
+ arrRemove(_parentage, parent);
378
+ }
379
+ };
380
+ Subscription2.prototype.remove = function(teardown) {
381
+ var _finalizers = this._finalizers;
382
+ _finalizers && arrRemove(_finalizers, teardown);
383
+ if (teardown instanceof Subscription2) {
384
+ teardown._removeParent(this);
385
+ }
386
+ };
387
+ Subscription2.EMPTY = function() {
388
+ var empty = new Subscription2();
389
+ empty.closed = true;
390
+ return empty;
391
+ }();
392
+ return Subscription2;
393
+ }();
394
+ var EMPTY_SUBSCRIPTION = Subscription.EMPTY;
395
+ function isSubscription(value) {
396
+ return value instanceof Subscription || value && "closed" in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe);
397
+ }
398
+ function execFinalizer(finalizer) {
399
+ if (isFunction(finalizer)) {
400
+ finalizer();
401
+ } else {
402
+ finalizer.unsubscribe();
403
+ }
404
+ }
405
+
406
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/config.js
407
+ var config = {
408
+ onUnhandledError: null,
409
+ onStoppedNotification: null,
410
+ Promise: void 0,
411
+ useDeprecatedSynchronousErrorHandling: false,
412
+ useDeprecatedNextContext: false
413
+ };
414
+
415
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js
416
+ var timeoutProvider = {
417
+ setTimeout: function(handler, timeout) {
418
+ var args = [];
419
+ for (var _i = 2; _i < arguments.length; _i++) {
420
+ args[_i - 2] = arguments[_i];
421
+ }
422
+ var delegate = timeoutProvider.delegate;
423
+ if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
424
+ return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));
425
+ }
426
+ return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
427
+ },
428
+ clearTimeout: function(handle) {
429
+ var delegate = timeoutProvider.delegate;
430
+ return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
431
+ },
432
+ delegate: void 0
433
+ };
434
+
435
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js
436
+ function reportUnhandledError(err) {
437
+ timeoutProvider.setTimeout(function() {
438
+ var onUnhandledError = config.onUnhandledError;
439
+ if (onUnhandledError) {
440
+ onUnhandledError(err);
49
441
  } else {
50
- clientIdsToScope.delete(clientId);
51
- }
52
- sourceMap.set(scopedId, clientMaps.clientSourceMap);
53
- tosMap.set(scopedId, clientMaps.clientTosMap);
54
- send(clientId, { content: { clientId }, type: "source-map-ack" });
55
- break;
56
- }
57
- case "unload-client": {
58
- clientIdsToScope.delete(clientId);
59
- break;
60
- }
61
- }
62
- });
63
- self.addEventListener("fetch", (event) => {
64
- var _a, _b, _c;
65
- const clientId = event.clientId !== "" ? event.clientId : event.resultingClientId;
66
- const scope = clientIdsToScope.get(clientId);
67
- const scopedId = scope != null ? scope : clientId;
68
- const clientSourceMap = sourceMap.get(scopedId);
69
- if (!clientSourceMap) {
70
- return event.respondWith(self.fetch(event.request));
71
- }
72
- const clientTosMap = tosMap.get(scopedId);
73
- let { request: { url } } = event;
74
- const key = isAvailable(url, clientSourceMap);
75
- const to = isAvailable(url, clientTosMap);
76
- const headers = new Headers(event.request.headers);
77
- let extraQuery = {};
78
- if (key !== void 0) {
79
- const value = (_a = clientSourceMap.get(key)) == null ? void 0 : _a.to;
80
- const extraHeaders = (_b = clientSourceMap.get(key)) == null ? void 0 : _b.headers;
81
- const rest = url.substring(key.length);
82
- extraQuery = (_c = clientSourceMap.get(key)) == null ? void 0 : _c.query;
83
- url = `${value}${rest}`;
84
- Object.entries(extraHeaders).forEach(([headerKey, headerValue]) => headers.set(headerKey, headerValue));
85
- }
86
- if (to !== void 0) {
87
- const extraHeaders = clientTosMap.get(to);
88
- Object.entries(extraHeaders).forEach(([headerKey, headerValue]) => headers.set(headerKey, headerValue));
89
- }
90
- let finalUrl;
91
- try {
92
- const urlInstance = new URL(url);
93
- Object.entries(extraQuery).forEach(([qk, qv]) => urlInstance.searchParams.set(qk, qv));
94
- finalUrl = urlInstance.href;
95
- } catch (e) {
96
- finalUrl = url;
97
- }
98
- console.log({ clientId, clientSourceMap, finalUrl });
99
- event.respondWith(
100
- self.fetch(finalUrl, { ...event.request, headers }).catch((error) => {
101
- console.error(error);
102
- return Promise.reject(error);
103
- })
104
- );
105
- });
442
+ throw err;
443
+ }
444
+ });
445
+ }
446
+
447
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/noop.js
448
+ function noop() {
449
+ }
450
+
451
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js
452
+ var COMPLETE_NOTIFICATION = function() {
453
+ return createNotification("C", void 0, void 0);
454
+ }();
455
+ function errorNotification(error) {
456
+ return createNotification("E", void 0, error);
457
+ }
458
+ function nextNotification(value) {
459
+ return createNotification("N", value, void 0);
460
+ }
461
+ function createNotification(kind, value, error) {
462
+ return {
463
+ kind,
464
+ value,
465
+ error
466
+ };
467
+ }
468
+
469
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/errorContext.js
470
+ var context = null;
471
+ function errorContext(cb) {
472
+ if (config.useDeprecatedSynchronousErrorHandling) {
473
+ var isRoot = !context;
474
+ if (isRoot) {
475
+ context = { errorThrown: false, error: null };
476
+ }
477
+ cb();
478
+ if (isRoot) {
479
+ var _a = context, errorThrown = _a.errorThrown, error = _a.error;
480
+ context = null;
481
+ if (errorThrown) {
482
+ throw error;
483
+ }
484
+ }
485
+ } else {
486
+ cb();
487
+ }
488
+ }
489
+ function captureError(err) {
490
+ if (config.useDeprecatedSynchronousErrorHandling && context) {
491
+ context.errorThrown = true;
492
+ context.error = err;
493
+ }
494
+ }
495
+
496
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/Subscriber.js
497
+ var Subscriber = function(_super) {
498
+ __extends(Subscriber2, _super);
499
+ function Subscriber2(destination) {
500
+ var _this = _super.call(this) || this;
501
+ _this.isStopped = false;
502
+ if (destination) {
503
+ _this.destination = destination;
504
+ if (isSubscription(destination)) {
505
+ destination.add(_this);
506
+ }
507
+ } else {
508
+ _this.destination = EMPTY_OBSERVER;
509
+ }
510
+ return _this;
511
+ }
512
+ Subscriber2.create = function(next, error, complete) {
513
+ return new SafeSubscriber(next, error, complete);
514
+ };
515
+ Subscriber2.prototype.next = function(value) {
516
+ if (this.isStopped) {
517
+ handleStoppedNotification(nextNotification(value), this);
518
+ } else {
519
+ this._next(value);
520
+ }
521
+ };
522
+ Subscriber2.prototype.error = function(err) {
523
+ if (this.isStopped) {
524
+ handleStoppedNotification(errorNotification(err), this);
525
+ } else {
526
+ this.isStopped = true;
527
+ this._error(err);
528
+ }
529
+ };
530
+ Subscriber2.prototype.complete = function() {
531
+ if (this.isStopped) {
532
+ handleStoppedNotification(COMPLETE_NOTIFICATION, this);
533
+ } else {
534
+ this.isStopped = true;
535
+ this._complete();
536
+ }
537
+ };
538
+ Subscriber2.prototype.unsubscribe = function() {
539
+ if (!this.closed) {
540
+ this.isStopped = true;
541
+ _super.prototype.unsubscribe.call(this);
542
+ this.destination = null;
543
+ }
544
+ };
545
+ Subscriber2.prototype._next = function(value) {
546
+ this.destination.next(value);
547
+ };
548
+ Subscriber2.prototype._error = function(err) {
549
+ try {
550
+ this.destination.error(err);
551
+ } finally {
552
+ this.unsubscribe();
553
+ }
554
+ };
555
+ Subscriber2.prototype._complete = function() {
556
+ try {
557
+ this.destination.complete();
558
+ } finally {
559
+ this.unsubscribe();
560
+ }
561
+ };
562
+ return Subscriber2;
563
+ }(Subscription);
564
+ var _bind = Function.prototype.bind;
565
+ function bind(fn, thisArg) {
566
+ return _bind.call(fn, thisArg);
567
+ }
568
+ var ConsumerObserver = function() {
569
+ function ConsumerObserver2(partialObserver) {
570
+ this.partialObserver = partialObserver;
571
+ }
572
+ ConsumerObserver2.prototype.next = function(value) {
573
+ var partialObserver = this.partialObserver;
574
+ if (partialObserver.next) {
575
+ try {
576
+ partialObserver.next(value);
577
+ } catch (error) {
578
+ handleUnhandledError(error);
579
+ }
580
+ }
581
+ };
582
+ ConsumerObserver2.prototype.error = function(err) {
583
+ var partialObserver = this.partialObserver;
584
+ if (partialObserver.error) {
585
+ try {
586
+ partialObserver.error(err);
587
+ } catch (error) {
588
+ handleUnhandledError(error);
589
+ }
590
+ } else {
591
+ handleUnhandledError(err);
592
+ }
593
+ };
594
+ ConsumerObserver2.prototype.complete = function() {
595
+ var partialObserver = this.partialObserver;
596
+ if (partialObserver.complete) {
597
+ try {
598
+ partialObserver.complete();
599
+ } catch (error) {
600
+ handleUnhandledError(error);
601
+ }
602
+ }
603
+ };
604
+ return ConsumerObserver2;
605
+ }();
606
+ var SafeSubscriber = function(_super) {
607
+ __extends(SafeSubscriber2, _super);
608
+ function SafeSubscriber2(observerOrNext, error, complete) {
609
+ var _this = _super.call(this) || this;
610
+ var partialObserver;
611
+ if (isFunction(observerOrNext) || !observerOrNext) {
612
+ partialObserver = {
613
+ next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : void 0,
614
+ error: error !== null && error !== void 0 ? error : void 0,
615
+ complete: complete !== null && complete !== void 0 ? complete : void 0
616
+ };
617
+ } else {
618
+ var context_1;
619
+ if (_this && config.useDeprecatedNextContext) {
620
+ context_1 = Object.create(observerOrNext);
621
+ context_1.unsubscribe = function() {
622
+ return _this.unsubscribe();
623
+ };
624
+ partialObserver = {
625
+ next: observerOrNext.next && bind(observerOrNext.next, context_1),
626
+ error: observerOrNext.error && bind(observerOrNext.error, context_1),
627
+ complete: observerOrNext.complete && bind(observerOrNext.complete, context_1)
628
+ };
629
+ } else {
630
+ partialObserver = observerOrNext;
631
+ }
632
+ }
633
+ _this.destination = new ConsumerObserver(partialObserver);
634
+ return _this;
635
+ }
636
+ return SafeSubscriber2;
637
+ }(Subscriber);
638
+ function handleUnhandledError(error) {
639
+ if (config.useDeprecatedSynchronousErrorHandling) {
640
+ captureError(error);
641
+ } else {
642
+ reportUnhandledError(error);
643
+ }
644
+ }
645
+ function defaultErrorHandler(err) {
646
+ throw err;
647
+ }
648
+ function handleStoppedNotification(notification, subscriber) {
649
+ var onStoppedNotification = config.onStoppedNotification;
650
+ onStoppedNotification && timeoutProvider.setTimeout(function() {
651
+ return onStoppedNotification(notification, subscriber);
652
+ });
653
+ }
654
+ var EMPTY_OBSERVER = {
655
+ closed: true,
656
+ next: noop,
657
+ error: defaultErrorHandler,
658
+ complete: noop
659
+ };
660
+
661
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/symbol/observable.js
662
+ var observable = function() {
663
+ return typeof Symbol === "function" && Symbol.observable || "@@observable";
664
+ }();
665
+
666
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/identity.js
667
+ function identity(x) {
668
+ return x;
669
+ }
670
+
671
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/pipe.js
672
+ function pipeFromArray(fns) {
673
+ if (fns.length === 0) {
674
+ return identity;
675
+ }
676
+ if (fns.length === 1) {
677
+ return fns[0];
678
+ }
679
+ return function piped(input) {
680
+ return fns.reduce(function(prev, fn) {
681
+ return fn(prev);
682
+ }, input);
683
+ };
684
+ }
685
+
686
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/Observable.js
687
+ var Observable = function() {
688
+ function Observable2(subscribe) {
689
+ if (subscribe) {
690
+ this._subscribe = subscribe;
691
+ }
692
+ }
693
+ Observable2.prototype.lift = function(operator) {
694
+ var observable2 = new Observable2();
695
+ observable2.source = this;
696
+ observable2.operator = operator;
697
+ return observable2;
698
+ };
699
+ Observable2.prototype.subscribe = function(observerOrNext, error, complete) {
700
+ var _this = this;
701
+ var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
702
+ errorContext(function() {
703
+ var _a = _this, operator = _a.operator, source = _a.source;
704
+ subscriber.add(operator ? operator.call(subscriber, source) : source ? _this._subscribe(subscriber) : _this._trySubscribe(subscriber));
705
+ });
706
+ return subscriber;
707
+ };
708
+ Observable2.prototype._trySubscribe = function(sink) {
709
+ try {
710
+ return this._subscribe(sink);
711
+ } catch (err) {
712
+ sink.error(err);
713
+ }
714
+ };
715
+ Observable2.prototype.forEach = function(next, promiseCtor) {
716
+ var _this = this;
717
+ promiseCtor = getPromiseCtor(promiseCtor);
718
+ return new promiseCtor(function(resolve, reject) {
719
+ var subscriber = new SafeSubscriber({
720
+ next: function(value) {
721
+ try {
722
+ next(value);
723
+ } catch (err) {
724
+ reject(err);
725
+ subscriber.unsubscribe();
726
+ }
727
+ },
728
+ error: reject,
729
+ complete: resolve
730
+ });
731
+ _this.subscribe(subscriber);
732
+ });
733
+ };
734
+ Observable2.prototype._subscribe = function(subscriber) {
735
+ var _a;
736
+ return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
737
+ };
738
+ Observable2.prototype[observable] = function() {
739
+ return this;
740
+ };
741
+ Observable2.prototype.pipe = function() {
742
+ var operations = [];
743
+ for (var _i = 0; _i < arguments.length; _i++) {
744
+ operations[_i] = arguments[_i];
745
+ }
746
+ return pipeFromArray(operations)(this);
747
+ };
748
+ Observable2.prototype.toPromise = function(promiseCtor) {
749
+ var _this = this;
750
+ promiseCtor = getPromiseCtor(promiseCtor);
751
+ return new promiseCtor(function(resolve, reject) {
752
+ var value;
753
+ _this.subscribe(function(x) {
754
+ return value = x;
755
+ }, function(err) {
756
+ return reject(err);
757
+ }, function() {
758
+ return resolve(value);
759
+ });
760
+ });
761
+ };
762
+ Observable2.create = function(subscribe) {
763
+ return new Observable2(subscribe);
764
+ };
765
+ return Observable2;
766
+ }();
767
+ function getPromiseCtor(promiseCtor) {
768
+ var _a;
769
+ return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
770
+ }
771
+ function isObserver(value) {
772
+ return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
773
+ }
774
+ function isSubscriber(value) {
775
+ return value && value instanceof Subscriber || isObserver(value) && isSubscription(value);
776
+ }
777
+
778
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/lift.js
779
+ function hasLift(source) {
780
+ return isFunction(source === null || source === void 0 ? void 0 : source.lift);
781
+ }
782
+ function operate(init) {
783
+ return function(source) {
784
+ if (hasLift(source)) {
785
+ return source.lift(function(liftedSource) {
786
+ try {
787
+ return init(liftedSource, this);
788
+ } catch (err) {
789
+ this.error(err);
790
+ }
791
+ });
792
+ }
793
+ throw new TypeError("Unable to lift unknown Observable type");
794
+ };
795
+ }
796
+
797
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js
798
+ function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
799
+ return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
800
+ }
801
+ var OperatorSubscriber = function(_super) {
802
+ __extends(OperatorSubscriber2, _super);
803
+ function OperatorSubscriber2(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
804
+ var _this = _super.call(this, destination) || this;
805
+ _this.onFinalize = onFinalize;
806
+ _this.shouldUnsubscribe = shouldUnsubscribe;
807
+ _this._next = onNext ? function(value) {
808
+ try {
809
+ onNext(value);
810
+ } catch (err) {
811
+ destination.error(err);
812
+ }
813
+ } : _super.prototype._next;
814
+ _this._error = onError ? function(err) {
815
+ try {
816
+ onError(err);
817
+ } catch (err2) {
818
+ destination.error(err2);
819
+ } finally {
820
+ this.unsubscribe();
821
+ }
822
+ } : _super.prototype._error;
823
+ _this._complete = onComplete ? function() {
824
+ try {
825
+ onComplete();
826
+ } catch (err) {
827
+ destination.error(err);
828
+ } finally {
829
+ this.unsubscribe();
830
+ }
831
+ } : _super.prototype._complete;
832
+ return _this;
833
+ }
834
+ OperatorSubscriber2.prototype.unsubscribe = function() {
835
+ var _a;
836
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
837
+ var closed_1 = this.closed;
838
+ _super.prototype.unsubscribe.call(this);
839
+ !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
840
+ }
841
+ };
842
+ return OperatorSubscriber2;
843
+ }(Subscriber);
844
+
845
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js
846
+ var ObjectUnsubscribedError = createErrorClass(function(_super) {
847
+ return function ObjectUnsubscribedErrorImpl() {
848
+ _super(this);
849
+ this.name = "ObjectUnsubscribedError";
850
+ this.message = "object unsubscribed";
851
+ };
852
+ });
853
+
854
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/Subject.js
855
+ var Subject = function(_super) {
856
+ __extends(Subject2, _super);
857
+ function Subject2() {
858
+ var _this = _super.call(this) || this;
859
+ _this.closed = false;
860
+ _this.currentObservers = null;
861
+ _this.observers = [];
862
+ _this.isStopped = false;
863
+ _this.hasError = false;
864
+ _this.thrownError = null;
865
+ return _this;
866
+ }
867
+ Subject2.prototype.lift = function(operator) {
868
+ var subject = new AnonymousSubject(this, this);
869
+ subject.operator = operator;
870
+ return subject;
871
+ };
872
+ Subject2.prototype._throwIfClosed = function() {
873
+ if (this.closed) {
874
+ throw new ObjectUnsubscribedError();
875
+ }
876
+ };
877
+ Subject2.prototype.next = function(value) {
878
+ var _this = this;
879
+ errorContext(function() {
880
+ var e_1, _a;
881
+ _this._throwIfClosed();
882
+ if (!_this.isStopped) {
883
+ if (!_this.currentObservers) {
884
+ _this.currentObservers = Array.from(_this.observers);
885
+ }
886
+ try {
887
+ for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {
888
+ var observer = _c.value;
889
+ observer.next(value);
890
+ }
891
+ } catch (e_1_1) {
892
+ e_1 = { error: e_1_1 };
893
+ } finally {
894
+ try {
895
+ if (_c && !_c.done && (_a = _b.return))
896
+ _a.call(_b);
897
+ } finally {
898
+ if (e_1)
899
+ throw e_1.error;
900
+ }
901
+ }
902
+ }
903
+ });
904
+ };
905
+ Subject2.prototype.error = function(err) {
906
+ var _this = this;
907
+ errorContext(function() {
908
+ _this._throwIfClosed();
909
+ if (!_this.isStopped) {
910
+ _this.hasError = _this.isStopped = true;
911
+ _this.thrownError = err;
912
+ var observers = _this.observers;
913
+ while (observers.length) {
914
+ observers.shift().error(err);
915
+ }
916
+ }
917
+ });
918
+ };
919
+ Subject2.prototype.complete = function() {
920
+ var _this = this;
921
+ errorContext(function() {
922
+ _this._throwIfClosed();
923
+ if (!_this.isStopped) {
924
+ _this.isStopped = true;
925
+ var observers = _this.observers;
926
+ while (observers.length) {
927
+ observers.shift().complete();
928
+ }
929
+ }
930
+ });
931
+ };
932
+ Subject2.prototype.unsubscribe = function() {
933
+ this.isStopped = this.closed = true;
934
+ this.observers = this.currentObservers = null;
935
+ };
936
+ Object.defineProperty(Subject2.prototype, "observed", {
937
+ get: function() {
938
+ var _a;
939
+ return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
940
+ },
941
+ enumerable: false,
942
+ configurable: true
943
+ });
944
+ Subject2.prototype._trySubscribe = function(subscriber) {
945
+ this._throwIfClosed();
946
+ return _super.prototype._trySubscribe.call(this, subscriber);
947
+ };
948
+ Subject2.prototype._subscribe = function(subscriber) {
949
+ this._throwIfClosed();
950
+ this._checkFinalizedStatuses(subscriber);
951
+ return this._innerSubscribe(subscriber);
952
+ };
953
+ Subject2.prototype._innerSubscribe = function(subscriber) {
954
+ var _this = this;
955
+ var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;
956
+ if (hasError || isStopped) {
957
+ return EMPTY_SUBSCRIPTION;
958
+ }
959
+ this.currentObservers = null;
960
+ observers.push(subscriber);
961
+ return new Subscription(function() {
962
+ _this.currentObservers = null;
963
+ arrRemove(observers, subscriber);
964
+ });
965
+ };
966
+ Subject2.prototype._checkFinalizedStatuses = function(subscriber) {
967
+ var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;
968
+ if (hasError) {
969
+ subscriber.error(thrownError);
970
+ } else if (isStopped) {
971
+ subscriber.complete();
972
+ }
973
+ };
974
+ Subject2.prototype.asObservable = function() {
975
+ var observable2 = new Observable();
976
+ observable2.source = this;
977
+ return observable2;
978
+ };
979
+ Subject2.create = function(destination, source) {
980
+ return new AnonymousSubject(destination, source);
981
+ };
982
+ return Subject2;
983
+ }(Observable);
984
+ var AnonymousSubject = function(_super) {
985
+ __extends(AnonymousSubject2, _super);
986
+ function AnonymousSubject2(destination, source) {
987
+ var _this = _super.call(this) || this;
988
+ _this.destination = destination;
989
+ _this.source = source;
990
+ return _this;
991
+ }
992
+ AnonymousSubject2.prototype.next = function(value) {
993
+ var _a, _b;
994
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
995
+ };
996
+ AnonymousSubject2.prototype.error = function(err) {
997
+ var _a, _b;
998
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
999
+ };
1000
+ AnonymousSubject2.prototype.complete = function() {
1001
+ var _a, _b;
1002
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
1003
+ };
1004
+ AnonymousSubject2.prototype._subscribe = function(subscriber) {
1005
+ var _a, _b;
1006
+ return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
1007
+ };
1008
+ return AnonymousSubject2;
1009
+ }(Subject);
1010
+
1011
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js
1012
+ var dateTimestampProvider = {
1013
+ now: function() {
1014
+ return (dateTimestampProvider.delegate || Date).now();
1015
+ },
1016
+ delegate: void 0
1017
+ };
1018
+
1019
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/ReplaySubject.js
1020
+ var ReplaySubject = function(_super) {
1021
+ __extends(ReplaySubject2, _super);
1022
+ function ReplaySubject2(_bufferSize, _windowTime, _timestampProvider) {
1023
+ if (_bufferSize === void 0) {
1024
+ _bufferSize = Infinity;
1025
+ }
1026
+ if (_windowTime === void 0) {
1027
+ _windowTime = Infinity;
1028
+ }
1029
+ if (_timestampProvider === void 0) {
1030
+ _timestampProvider = dateTimestampProvider;
1031
+ }
1032
+ var _this = _super.call(this) || this;
1033
+ _this._bufferSize = _bufferSize;
1034
+ _this._windowTime = _windowTime;
1035
+ _this._timestampProvider = _timestampProvider;
1036
+ _this._buffer = [];
1037
+ _this._infiniteTimeWindow = true;
1038
+ _this._infiniteTimeWindow = _windowTime === Infinity;
1039
+ _this._bufferSize = Math.max(1, _bufferSize);
1040
+ _this._windowTime = Math.max(1, _windowTime);
1041
+ return _this;
1042
+ }
1043
+ ReplaySubject2.prototype.next = function(value) {
1044
+ var _a = this, isStopped = _a.isStopped, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow, _timestampProvider = _a._timestampProvider, _windowTime = _a._windowTime;
1045
+ if (!isStopped) {
1046
+ _buffer.push(value);
1047
+ !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);
1048
+ }
1049
+ this._trimBuffer();
1050
+ _super.prototype.next.call(this, value);
1051
+ };
1052
+ ReplaySubject2.prototype._subscribe = function(subscriber) {
1053
+ this._throwIfClosed();
1054
+ this._trimBuffer();
1055
+ var subscription = this._innerSubscribe(subscriber);
1056
+ var _a = this, _infiniteTimeWindow = _a._infiniteTimeWindow, _buffer = _a._buffer;
1057
+ var copy = _buffer.slice();
1058
+ for (var i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {
1059
+ subscriber.next(copy[i]);
1060
+ }
1061
+ this._checkFinalizedStatuses(subscriber);
1062
+ return subscription;
1063
+ };
1064
+ ReplaySubject2.prototype._trimBuffer = function() {
1065
+ var _a = this, _bufferSize = _a._bufferSize, _timestampProvider = _a._timestampProvider, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow;
1066
+ var adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;
1067
+ _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);
1068
+ if (!_infiniteTimeWindow) {
1069
+ var now = _timestampProvider.now();
1070
+ var last = 0;
1071
+ for (var i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) {
1072
+ last = i;
1073
+ }
1074
+ last && _buffer.splice(0, last + 1);
1075
+ }
1076
+ };
1077
+ return ReplaySubject2;
1078
+ }(Subject);
1079
+
1080
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/scheduler/Action.js
1081
+ var Action = function(_super) {
1082
+ __extends(Action2, _super);
1083
+ function Action2(scheduler, work) {
1084
+ return _super.call(this) || this;
1085
+ }
1086
+ Action2.prototype.schedule = function(state, delay) {
1087
+ if (delay === void 0) {
1088
+ delay = 0;
1089
+ }
1090
+ return this;
1091
+ };
1092
+ return Action2;
1093
+ }(Subscription);
1094
+
1095
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js
1096
+ var intervalProvider = {
1097
+ setInterval: function(handler, timeout) {
1098
+ var args = [];
1099
+ for (var _i = 2; _i < arguments.length; _i++) {
1100
+ args[_i - 2] = arguments[_i];
1101
+ }
1102
+ var delegate = intervalProvider.delegate;
1103
+ if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
1104
+ return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));
1105
+ }
1106
+ return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));
1107
+ },
1108
+ clearInterval: function(handle) {
1109
+ var delegate = intervalProvider.delegate;
1110
+ return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);
1111
+ },
1112
+ delegate: void 0
1113
+ };
1114
+
1115
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js
1116
+ var AsyncAction = function(_super) {
1117
+ __extends(AsyncAction2, _super);
1118
+ function AsyncAction2(scheduler, work) {
1119
+ var _this = _super.call(this, scheduler, work) || this;
1120
+ _this.scheduler = scheduler;
1121
+ _this.work = work;
1122
+ _this.pending = false;
1123
+ return _this;
1124
+ }
1125
+ AsyncAction2.prototype.schedule = function(state, delay) {
1126
+ var _a;
1127
+ if (delay === void 0) {
1128
+ delay = 0;
1129
+ }
1130
+ if (this.closed) {
1131
+ return this;
1132
+ }
1133
+ this.state = state;
1134
+ var id = this.id;
1135
+ var scheduler = this.scheduler;
1136
+ if (id != null) {
1137
+ this.id = this.recycleAsyncId(scheduler, id, delay);
1138
+ }
1139
+ this.pending = true;
1140
+ this.delay = delay;
1141
+ this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);
1142
+ return this;
1143
+ };
1144
+ AsyncAction2.prototype.requestAsyncId = function(scheduler, _id, delay) {
1145
+ if (delay === void 0) {
1146
+ delay = 0;
1147
+ }
1148
+ return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);
1149
+ };
1150
+ AsyncAction2.prototype.recycleAsyncId = function(_scheduler, id, delay) {
1151
+ if (delay === void 0) {
1152
+ delay = 0;
1153
+ }
1154
+ if (delay != null && this.delay === delay && this.pending === false) {
1155
+ return id;
1156
+ }
1157
+ if (id != null) {
1158
+ intervalProvider.clearInterval(id);
1159
+ }
1160
+ return void 0;
1161
+ };
1162
+ AsyncAction2.prototype.execute = function(state, delay) {
1163
+ if (this.closed) {
1164
+ return new Error("executing a cancelled action");
1165
+ }
1166
+ this.pending = false;
1167
+ var error = this._execute(state, delay);
1168
+ if (error) {
1169
+ return error;
1170
+ } else if (this.pending === false && this.id != null) {
1171
+ this.id = this.recycleAsyncId(this.scheduler, this.id, null);
1172
+ }
1173
+ };
1174
+ AsyncAction2.prototype._execute = function(state, _delay) {
1175
+ var errored = false;
1176
+ var errorValue;
1177
+ try {
1178
+ this.work(state);
1179
+ } catch (e) {
1180
+ errored = true;
1181
+ errorValue = e ? e : new Error("Scheduled action threw falsy error");
1182
+ }
1183
+ if (errored) {
1184
+ this.unsubscribe();
1185
+ return errorValue;
1186
+ }
1187
+ };
1188
+ AsyncAction2.prototype.unsubscribe = function() {
1189
+ if (!this.closed) {
1190
+ var _a = this, id = _a.id, scheduler = _a.scheduler;
1191
+ var actions = scheduler.actions;
1192
+ this.work = this.state = this.scheduler = null;
1193
+ this.pending = false;
1194
+ arrRemove(actions, this);
1195
+ if (id != null) {
1196
+ this.id = this.recycleAsyncId(scheduler, id, null);
1197
+ }
1198
+ this.delay = null;
1199
+ _super.prototype.unsubscribe.call(this);
1200
+ }
1201
+ };
1202
+ return AsyncAction2;
1203
+ }(Action);
1204
+
1205
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/Scheduler.js
1206
+ var Scheduler = function() {
1207
+ function Scheduler2(schedulerActionCtor, now) {
1208
+ if (now === void 0) {
1209
+ now = Scheduler2.now;
1210
+ }
1211
+ this.schedulerActionCtor = schedulerActionCtor;
1212
+ this.now = now;
1213
+ }
1214
+ Scheduler2.prototype.schedule = function(work, delay, state) {
1215
+ if (delay === void 0) {
1216
+ delay = 0;
1217
+ }
1218
+ return new this.schedulerActionCtor(this, work).schedule(state, delay);
1219
+ };
1220
+ Scheduler2.now = dateTimestampProvider.now;
1221
+ return Scheduler2;
1222
+ }();
1223
+
1224
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js
1225
+ var AsyncScheduler = function(_super) {
1226
+ __extends(AsyncScheduler2, _super);
1227
+ function AsyncScheduler2(SchedulerAction, now) {
1228
+ if (now === void 0) {
1229
+ now = Scheduler.now;
1230
+ }
1231
+ var _this = _super.call(this, SchedulerAction, now) || this;
1232
+ _this.actions = [];
1233
+ _this._active = false;
1234
+ return _this;
1235
+ }
1236
+ AsyncScheduler2.prototype.flush = function(action) {
1237
+ var actions = this.actions;
1238
+ if (this._active) {
1239
+ actions.push(action);
1240
+ return;
1241
+ }
1242
+ var error;
1243
+ this._active = true;
1244
+ do {
1245
+ if (error = action.execute(action.state, action.delay)) {
1246
+ break;
1247
+ }
1248
+ } while (action = actions.shift());
1249
+ this._active = false;
1250
+ if (error) {
1251
+ while (action = actions.shift()) {
1252
+ action.unsubscribe();
1253
+ }
1254
+ throw error;
1255
+ }
1256
+ };
1257
+ return AsyncScheduler2;
1258
+ }(Scheduler);
1259
+
1260
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/scheduler/async.js
1261
+ var asyncScheduler = new AsyncScheduler(AsyncAction);
1262
+ var async = asyncScheduler;
1263
+
1264
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/observable/empty.js
1265
+ var EMPTY = new Observable(function(subscriber) {
1266
+ return subscriber.complete();
1267
+ });
1268
+
1269
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/isScheduler.js
1270
+ function isScheduler(value) {
1271
+ return value && isFunction(value.schedule);
1272
+ }
1273
+
1274
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js
1275
+ var isArrayLike = function(x) {
1276
+ return x && typeof x.length === "number" && typeof x !== "function";
1277
+ };
1278
+
1279
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/isPromise.js
1280
+ function isPromise(value) {
1281
+ return isFunction(value === null || value === void 0 ? void 0 : value.then);
1282
+ }
1283
+
1284
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js
1285
+ function isInteropObservable(input) {
1286
+ return isFunction(input[observable]);
1287
+ }
1288
+
1289
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js
1290
+ function isAsyncIterable(obj) {
1291
+ return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
1292
+ }
1293
+
1294
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js
1295
+ function createInvalidObservableTypeError(input) {
1296
+ return new TypeError("You provided " + (input !== null && typeof input === "object" ? "an invalid object" : "'" + input + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
1297
+ }
1298
+
1299
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/symbol/iterator.js
1300
+ function getSymbolIterator() {
1301
+ if (typeof Symbol !== "function" || !Symbol.iterator) {
1302
+ return "@@iterator";
1303
+ }
1304
+ return Symbol.iterator;
1305
+ }
1306
+ var iterator = getSymbolIterator();
1307
+
1308
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/isIterable.js
1309
+ function isIterable(input) {
1310
+ return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
1311
+ }
1312
+
1313
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js
1314
+ function readableStreamLikeToAsyncGenerator(readableStream) {
1315
+ return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {
1316
+ var reader, _a, value, done;
1317
+ return __generator(this, function(_b) {
1318
+ switch (_b.label) {
1319
+ case 0:
1320
+ reader = readableStream.getReader();
1321
+ _b.label = 1;
1322
+ case 1:
1323
+ _b.trys.push([1, , 9, 10]);
1324
+ _b.label = 2;
1325
+ case 2:
1326
+ if (false)
1327
+ return [3, 8];
1328
+ return [4, __await(reader.read())];
1329
+ case 3:
1330
+ _a = _b.sent(), value = _a.value, done = _a.done;
1331
+ if (!done)
1332
+ return [3, 5];
1333
+ return [4, __await(void 0)];
1334
+ case 4:
1335
+ return [2, _b.sent()];
1336
+ case 5:
1337
+ return [4, __await(value)];
1338
+ case 6:
1339
+ return [4, _b.sent()];
1340
+ case 7:
1341
+ _b.sent();
1342
+ return [3, 2];
1343
+ case 8:
1344
+ return [3, 10];
1345
+ case 9:
1346
+ reader.releaseLock();
1347
+ return [7];
1348
+ case 10:
1349
+ return [2];
1350
+ }
1351
+ });
1352
+ });
1353
+ }
1354
+ function isReadableStreamLike(obj) {
1355
+ return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
1356
+ }
1357
+
1358
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js
1359
+ function innerFrom(input) {
1360
+ if (input instanceof Observable) {
1361
+ return input;
1362
+ }
1363
+ if (input != null) {
1364
+ if (isInteropObservable(input)) {
1365
+ return fromInteropObservable(input);
1366
+ }
1367
+ if (isArrayLike(input)) {
1368
+ return fromArrayLike(input);
1369
+ }
1370
+ if (isPromise(input)) {
1371
+ return fromPromise(input);
1372
+ }
1373
+ if (isAsyncIterable(input)) {
1374
+ return fromAsyncIterable(input);
1375
+ }
1376
+ if (isIterable(input)) {
1377
+ return fromIterable(input);
1378
+ }
1379
+ if (isReadableStreamLike(input)) {
1380
+ return fromReadableStreamLike(input);
1381
+ }
1382
+ }
1383
+ throw createInvalidObservableTypeError(input);
1384
+ }
1385
+ function fromInteropObservable(obj) {
1386
+ return new Observable(function(subscriber) {
1387
+ var obs = obj[observable]();
1388
+ if (isFunction(obs.subscribe)) {
1389
+ return obs.subscribe(subscriber);
1390
+ }
1391
+ throw new TypeError("Provided object does not correctly implement Symbol.observable");
1392
+ });
1393
+ }
1394
+ function fromArrayLike(array) {
1395
+ return new Observable(function(subscriber) {
1396
+ for (var i = 0; i < array.length && !subscriber.closed; i++) {
1397
+ subscriber.next(array[i]);
1398
+ }
1399
+ subscriber.complete();
1400
+ });
1401
+ }
1402
+ function fromPromise(promise) {
1403
+ return new Observable(function(subscriber) {
1404
+ promise.then(function(value) {
1405
+ if (!subscriber.closed) {
1406
+ subscriber.next(value);
1407
+ subscriber.complete();
1408
+ }
1409
+ }, function(err) {
1410
+ return subscriber.error(err);
1411
+ }).then(null, reportUnhandledError);
1412
+ });
1413
+ }
1414
+ function fromIterable(iterable) {
1415
+ return new Observable(function(subscriber) {
1416
+ var e_1, _a;
1417
+ try {
1418
+ for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {
1419
+ var value = iterable_1_1.value;
1420
+ subscriber.next(value);
1421
+ if (subscriber.closed) {
1422
+ return;
1423
+ }
1424
+ }
1425
+ } catch (e_1_1) {
1426
+ e_1 = { error: e_1_1 };
1427
+ } finally {
1428
+ try {
1429
+ if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return))
1430
+ _a.call(iterable_1);
1431
+ } finally {
1432
+ if (e_1)
1433
+ throw e_1.error;
1434
+ }
1435
+ }
1436
+ subscriber.complete();
1437
+ });
1438
+ }
1439
+ function fromAsyncIterable(asyncIterable) {
1440
+ return new Observable(function(subscriber) {
1441
+ process(asyncIterable, subscriber).catch(function(err) {
1442
+ return subscriber.error(err);
1443
+ });
1444
+ });
1445
+ }
1446
+ function fromReadableStreamLike(readableStream) {
1447
+ return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
1448
+ }
1449
+ function process(asyncIterable, subscriber) {
1450
+ var asyncIterable_1, asyncIterable_1_1;
1451
+ var e_2, _a;
1452
+ return __awaiter(this, void 0, void 0, function() {
1453
+ var value, e_2_1;
1454
+ return __generator(this, function(_b) {
1455
+ switch (_b.label) {
1456
+ case 0:
1457
+ _b.trys.push([0, 5, 6, 11]);
1458
+ asyncIterable_1 = __asyncValues(asyncIterable);
1459
+ _b.label = 1;
1460
+ case 1:
1461
+ return [4, asyncIterable_1.next()];
1462
+ case 2:
1463
+ if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done))
1464
+ return [3, 4];
1465
+ value = asyncIterable_1_1.value;
1466
+ subscriber.next(value);
1467
+ if (subscriber.closed) {
1468
+ return [2];
1469
+ }
1470
+ _b.label = 3;
1471
+ case 3:
1472
+ return [3, 1];
1473
+ case 4:
1474
+ return [3, 11];
1475
+ case 5:
1476
+ e_2_1 = _b.sent();
1477
+ e_2 = { error: e_2_1 };
1478
+ return [3, 11];
1479
+ case 6:
1480
+ _b.trys.push([6, , 9, 10]);
1481
+ if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return)))
1482
+ return [3, 8];
1483
+ return [4, _a.call(asyncIterable_1)];
1484
+ case 7:
1485
+ _b.sent();
1486
+ _b.label = 8;
1487
+ case 8:
1488
+ return [3, 10];
1489
+ case 9:
1490
+ if (e_2)
1491
+ throw e_2.error;
1492
+ return [7];
1493
+ case 10:
1494
+ return [7];
1495
+ case 11:
1496
+ subscriber.complete();
1497
+ return [2];
1498
+ }
1499
+ });
1500
+ });
1501
+ }
1502
+
1503
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js
1504
+ function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {
1505
+ if (delay === void 0) {
1506
+ delay = 0;
1507
+ }
1508
+ if (repeat === void 0) {
1509
+ repeat = false;
1510
+ }
1511
+ var scheduleSubscription = scheduler.schedule(function() {
1512
+ work();
1513
+ if (repeat) {
1514
+ parentSubscription.add(this.schedule(null, delay));
1515
+ } else {
1516
+ this.unsubscribe();
1517
+ }
1518
+ }, delay);
1519
+ parentSubscription.add(scheduleSubscription);
1520
+ if (!repeat) {
1521
+ return scheduleSubscription;
1522
+ }
1523
+ }
1524
+
1525
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/EmptyError.js
1526
+ var EmptyError = createErrorClass(function(_super) {
1527
+ return function EmptyErrorImpl() {
1528
+ _super(this);
1529
+ this.name = "EmptyError";
1530
+ this.message = "no elements in sequence";
1531
+ };
1532
+ });
1533
+
1534
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/firstValueFrom.js
1535
+ function firstValueFrom(source, config2) {
1536
+ var hasConfig = typeof config2 === "object";
1537
+ return new Promise(function(resolve, reject) {
1538
+ var subscriber = new SafeSubscriber({
1539
+ next: function(value) {
1540
+ resolve(value);
1541
+ subscriber.unsubscribe();
1542
+ },
1543
+ error: reject,
1544
+ complete: function() {
1545
+ if (hasConfig) {
1546
+ resolve(config2.defaultValue);
1547
+ } else {
1548
+ reject(new EmptyError());
1549
+ }
1550
+ }
1551
+ });
1552
+ source.subscribe(subscriber);
1553
+ });
1554
+ }
1555
+
1556
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/isDate.js
1557
+ function isValidDate(value) {
1558
+ return value instanceof Date && !isNaN(value);
1559
+ }
1560
+
1561
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/operators/map.js
1562
+ function map(project, thisArg) {
1563
+ return operate(function(source, subscriber) {
1564
+ var index = 0;
1565
+ source.subscribe(createOperatorSubscriber(subscriber, function(value) {
1566
+ subscriber.next(project.call(thisArg, value, index++));
1567
+ }));
1568
+ });
1569
+ }
1570
+
1571
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js
1572
+ var isArray = Array.isArray;
1573
+ function callOrApply(fn, args) {
1574
+ return isArray(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);
1575
+ }
1576
+ function mapOneOrManyArgs(fn) {
1577
+ return map(function(args) {
1578
+ return callOrApply(fn, args);
1579
+ });
1580
+ }
1581
+
1582
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js
1583
+ function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {
1584
+ var buffer = [];
1585
+ var active = 0;
1586
+ var index = 0;
1587
+ var isComplete = false;
1588
+ var checkComplete = function() {
1589
+ if (isComplete && !buffer.length && !active) {
1590
+ subscriber.complete();
1591
+ }
1592
+ };
1593
+ var outerNext = function(value) {
1594
+ return active < concurrent ? doInnerSub(value) : buffer.push(value);
1595
+ };
1596
+ var doInnerSub = function(value) {
1597
+ expand && subscriber.next(value);
1598
+ active++;
1599
+ var innerComplete = false;
1600
+ innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function(innerValue) {
1601
+ onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);
1602
+ if (expand) {
1603
+ outerNext(innerValue);
1604
+ } else {
1605
+ subscriber.next(innerValue);
1606
+ }
1607
+ }, function() {
1608
+ innerComplete = true;
1609
+ }, void 0, function() {
1610
+ if (innerComplete) {
1611
+ try {
1612
+ active--;
1613
+ var _loop_1 = function() {
1614
+ var bufferedValue = buffer.shift();
1615
+ if (innerSubScheduler) {
1616
+ executeSchedule(subscriber, innerSubScheduler, function() {
1617
+ return doInnerSub(bufferedValue);
1618
+ });
1619
+ } else {
1620
+ doInnerSub(bufferedValue);
1621
+ }
1622
+ };
1623
+ while (buffer.length && active < concurrent) {
1624
+ _loop_1();
1625
+ }
1626
+ checkComplete();
1627
+ } catch (err) {
1628
+ subscriber.error(err);
1629
+ }
1630
+ }
1631
+ }));
1632
+ };
1633
+ source.subscribe(createOperatorSubscriber(subscriber, outerNext, function() {
1634
+ isComplete = true;
1635
+ checkComplete();
1636
+ }));
1637
+ return function() {
1638
+ additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();
1639
+ };
1640
+ }
1641
+
1642
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js
1643
+ function mergeMap(project, resultSelector, concurrent) {
1644
+ if (concurrent === void 0) {
1645
+ concurrent = Infinity;
1646
+ }
1647
+ if (isFunction(resultSelector)) {
1648
+ return mergeMap(function(a, i) {
1649
+ return map(function(b, ii) {
1650
+ return resultSelector(a, b, i, ii);
1651
+ })(innerFrom(project(a, i)));
1652
+ }, concurrent);
1653
+ } else if (typeof resultSelector === "number") {
1654
+ concurrent = resultSelector;
1655
+ }
1656
+ return operate(function(source, subscriber) {
1657
+ return mergeInternals(source, subscriber, project, concurrent);
1658
+ });
1659
+ }
1660
+
1661
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/observable/fromEvent.js
1662
+ var nodeEventEmitterMethods = ["addListener", "removeListener"];
1663
+ var eventTargetMethods = ["addEventListener", "removeEventListener"];
1664
+ var jqueryMethods = ["on", "off"];
1665
+ function fromEvent(target, eventName, options, resultSelector) {
1666
+ if (isFunction(options)) {
1667
+ resultSelector = options;
1668
+ options = void 0;
1669
+ }
1670
+ if (resultSelector) {
1671
+ return fromEvent(target, eventName, options).pipe(mapOneOrManyArgs(resultSelector));
1672
+ }
1673
+ var _a = __read(isEventTarget(target) ? eventTargetMethods.map(function(methodName) {
1674
+ return function(handler) {
1675
+ return target[methodName](eventName, handler, options);
1676
+ };
1677
+ }) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [], 2), add = _a[0], remove = _a[1];
1678
+ if (!add) {
1679
+ if (isArrayLike(target)) {
1680
+ return mergeMap(function(subTarget) {
1681
+ return fromEvent(subTarget, eventName, options);
1682
+ })(innerFrom(target));
1683
+ }
1684
+ }
1685
+ if (!add) {
1686
+ throw new TypeError("Invalid event target");
1687
+ }
1688
+ return new Observable(function(subscriber) {
1689
+ var handler = function() {
1690
+ var args = [];
1691
+ for (var _i = 0; _i < arguments.length; _i++) {
1692
+ args[_i] = arguments[_i];
1693
+ }
1694
+ return subscriber.next(1 < args.length ? args : args[0]);
1695
+ };
1696
+ add(handler);
1697
+ return function() {
1698
+ return remove(handler);
1699
+ };
1700
+ });
1701
+ }
1702
+ function toCommonHandlerRegistry(target, eventName) {
1703
+ return function(methodName) {
1704
+ return function(handler) {
1705
+ return target[methodName](eventName, handler);
1706
+ };
1707
+ };
1708
+ }
1709
+ function isNodeStyleEventEmitter(target) {
1710
+ return isFunction(target.addListener) && isFunction(target.removeListener);
1711
+ }
1712
+ function isJQueryStyleEventEmitter(target) {
1713
+ return isFunction(target.on) && isFunction(target.off);
1714
+ }
1715
+ function isEventTarget(target) {
1716
+ return isFunction(target.addEventListener) && isFunction(target.removeEventListener);
1717
+ }
1718
+
1719
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/observable/timer.js
1720
+ function timer(dueTime, intervalOrScheduler, scheduler) {
1721
+ if (dueTime === void 0) {
1722
+ dueTime = 0;
1723
+ }
1724
+ if (scheduler === void 0) {
1725
+ scheduler = async;
1726
+ }
1727
+ var intervalDuration = -1;
1728
+ if (intervalOrScheduler != null) {
1729
+ if (isScheduler(intervalOrScheduler)) {
1730
+ scheduler = intervalOrScheduler;
1731
+ } else {
1732
+ intervalDuration = intervalOrScheduler;
1733
+ }
1734
+ }
1735
+ return new Observable(function(subscriber) {
1736
+ var due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;
1737
+ if (due < 0) {
1738
+ due = 0;
1739
+ }
1740
+ var n = 0;
1741
+ return scheduler.schedule(function() {
1742
+ if (!subscriber.closed) {
1743
+ subscriber.next(n++);
1744
+ if (0 <= intervalDuration) {
1745
+ this.schedule(void 0, intervalDuration);
1746
+ } else {
1747
+ subscriber.complete();
1748
+ }
1749
+ }
1750
+ }, due);
1751
+ });
1752
+ }
1753
+
1754
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/observable/interval.js
1755
+ function interval(period, scheduler) {
1756
+ if (period === void 0) {
1757
+ period = 0;
1758
+ }
1759
+ if (scheduler === void 0) {
1760
+ scheduler = asyncScheduler;
1761
+ }
1762
+ if (period < 0) {
1763
+ period = 0;
1764
+ }
1765
+ return timer(period, period, scheduler);
1766
+ }
1767
+
1768
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/operators/filter.js
1769
+ function filter(predicate, thisArg) {
1770
+ return operate(function(source, subscriber) {
1771
+ var index = 0;
1772
+ source.subscribe(createOperatorSubscriber(subscriber, function(value) {
1773
+ return predicate.call(thisArg, value, index++) && subscriber.next(value);
1774
+ }));
1775
+ });
1776
+ }
1777
+
1778
+ // ../../.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/dist/esm5/internal/operators/take.js
1779
+ function take(count) {
1780
+ return count <= 0 ? function() {
1781
+ return EMPTY;
1782
+ } : operate(function(source, subscriber) {
1783
+ var seen = 0;
1784
+ source.subscribe(createOperatorSubscriber(subscriber, function(value) {
1785
+ if (++seen <= count) {
1786
+ subscriber.next(value);
1787
+ if (count <= seen) {
1788
+ subscriber.complete();
1789
+ }
1790
+ }
1791
+ }));
1792
+ });
1793
+ }
1794
+
1795
+ // ../../.yarn/__virtual__/@micro-lc-post-channel-virtual-966ae90fe2/1/packages/post-channel/dist/esm/index.js
1796
+ var fromServiceWorkerToReceiver = (self2, options) => (clientId) => ({
1797
+ postMessage: (message) => {
1798
+ const { errorCatcher: errorCatcher2 = () => () => {
1799
+ }, ...rest } = options ?? {};
1800
+ self2.clients.get(clientId).then((client) => client?.postMessage(message, rest)).catch(errorCatcher2(clientId, message));
1801
+ }
1802
+ });
1803
+ var SynAck = /* @__PURE__ */ ((SynAck2) => {
1804
+ SynAck2["Ack"] = "ack";
1805
+ SynAck2["Syn"] = "syn";
1806
+ return SynAck2;
1807
+ })(SynAck || {});
1808
+ var synackKeys = Object.values(SynAck);
1809
+ var getData = (message) => message.data;
1810
+ var synackFilter = (type) => (data) => data.type === type.toString();
1811
+ var isPostChannelMessage = (message) => {
1812
+ const data = message.data;
1813
+ return typeof data === "object" && data !== null && "type" in data && typeof data.type === "string" && "instance" in data && typeof data.instance === "string" && "content" in data;
1814
+ };
1815
+ var generateDarkColorHex = () => {
1816
+ let color = "#";
1817
+ for (let i = 0; i < 3; i++) {
1818
+ color += `0${Math.floor(Math.random() * Math.pow(16, 2) / 2).toString(16)}`.slice(-2);
1819
+ }
1820
+ return color;
1821
+ };
1822
+ var PostChannel = class {
1823
+ __generateId;
1824
+ __instance;
1825
+ __colors;
1826
+ __listener;
1827
+ __log;
1828
+ __receiver;
1829
+ __subscription;
1830
+ __okToWrite;
1831
+ __write$;
1832
+ __recv$;
1833
+ __connect(instance, period) {
1834
+ const synSubscription = interval(period).subscribe(() => this.__receiver.postMessage({
1835
+ content: instance,
1836
+ instance,
1837
+ type: "syn".toString()
1838
+ }));
1839
+ this.__subscription.add(synSubscription);
1840
+ this.__subscription.add(
1841
+ this.__recv$.pipe(
1842
+ map(getData),
1843
+ filter(synackFilter(
1844
+ "ack"
1845
+ /* Ack */
1846
+ )),
1847
+ filter(({ content }) => content === instance),
1848
+ take(1)
1849
+ ).subscribe(({ instance: foreignInstance }) => {
1850
+ this.__okToWrite.next(0);
1851
+ this.__subscription.add(
1852
+ this.__recv$.pipe(
1853
+ filter(
1854
+ ({ data: { type, instance: incomingInstance } }) => !synackKeys.includes(type) && incomingInstance === foreignInstance
1855
+ )
1856
+ ).subscribe((message) => {
1857
+ this.__listener(message);
1858
+ const { data } = message;
1859
+ if (data._id !== void 0) {
1860
+ this.__receiver.postMessage({
1861
+ ...data,
1862
+ content: data,
1863
+ instance,
1864
+ type: "ack"
1865
+ /* Ack */
1866
+ });
1867
+ }
1868
+ })
1869
+ );
1870
+ synSubscription.unsubscribe();
1871
+ })
1872
+ );
1873
+ this.__subscription.add(
1874
+ this.__recv$.pipe(
1875
+ map(getData),
1876
+ filter(synackFilter(
1877
+ "syn"
1878
+ /* Syn */
1879
+ )),
1880
+ // must check whether is not short-circuiting
1881
+ // in an infinite loop by syncing with itself
1882
+ filter(({ instance: foreignInstance }) => foreignInstance !== instance),
1883
+ take(1)
1884
+ ).subscribe(({ content }) => {
1885
+ this.__receiver.postMessage({
1886
+ content,
1887
+ instance,
1888
+ type: "ack"
1889
+ /* Ack */
1890
+ });
1891
+ })
1892
+ );
1893
+ }
1894
+ __write(message, messageId) {
1895
+ const extra = {};
1896
+ if (messageId !== void 0) {
1897
+ extra._id = messageId;
1898
+ }
1899
+ this.__subscription.add(
1900
+ this.__write$.subscribe(() => {
1901
+ const outgoingMessage = Object.assign(
1902
+ message,
1903
+ {
1904
+ instance: this.__instance,
1905
+ ...extra
1906
+ }
1907
+ );
1908
+ this.__receiver.postMessage(outgoingMessage);
1909
+ this.__log?.(outgoingMessage);
1910
+ })
1911
+ );
1912
+ }
1913
+ constructor(listener, from, to, opts) {
1914
+ this.__generateId = () => globalThis.crypto.randomUUID();
1915
+ const instance = this.__generateId();
1916
+ const messages = new ReplaySubject();
1917
+ const fromSubscription = fromEvent(from, "message").pipe(filter(isPostChannelMessage)).subscribe(messages);
1918
+ this.__subscription = new Subscription();
1919
+ this.__subscription.add(fromSubscription);
1920
+ this.__okToWrite = new ReplaySubject(1);
1921
+ this.__write$ = this.__okToWrite.pipe(take(1));
1922
+ this.__recv$ = messages.asObservable();
1923
+ this.__listener = listener;
1924
+ this.__log = opts?.log && opts.log.bind(this);
1925
+ this.__instance = instance;
1926
+ const color = generateDarkColorHex();
1927
+ this.__colors = {
1928
+ bg: color,
1929
+ fg: `${color}22`
1930
+ };
1931
+ this.__receiver = to;
1932
+ this.__connect(
1933
+ instance,
1934
+ opts?.period ? opts.period : 10
1935
+ );
1936
+ }
1937
+ disconnect() {
1938
+ this.__subscription.unsubscribe();
1939
+ }
1940
+ send(message) {
1941
+ this.__write(message);
1942
+ }
1943
+ ackSend(message) {
1944
+ let done;
1945
+ const promise = new Promise((resolve) => {
1946
+ done = resolve;
1947
+ });
1948
+ const messageId = this.__generateId();
1949
+ this.__subscription.add(
1950
+ this.__recv$.pipe(
1951
+ map(getData),
1952
+ filter(synackFilter(
1953
+ "ack"
1954
+ /* Ack */
1955
+ )),
1956
+ filter(({ _id }) => _id === messageId),
1957
+ take(1)
1958
+ ).subscribe(() => done())
1959
+ );
1960
+ this.__write(message, messageId);
1961
+ return promise;
1962
+ }
1963
+ get instance() {
1964
+ return this.__instance;
1965
+ }
1966
+ get colors() {
1967
+ return this.__colors;
1968
+ }
1969
+ /**
1970
+ * signals readiness on listening and cannot fail but keeps hanging
1971
+ * if not resolved
1972
+ */
1973
+ get ready() {
1974
+ return firstValueFrom(this.__write$).then(() => {
1975
+ });
1976
+ }
1977
+ };
1978
+ var src_default = PostChannel;
1979
+
1980
+ // service-worker.ts
1981
+ var openChannels = /* @__PURE__ */ new Map();
1982
+ var clientIdsToScope = /* @__PURE__ */ new Map();
1983
+ var sourceMap = /* @__PURE__ */ new Map();
1984
+ var tosMap = /* @__PURE__ */ new Map();
1985
+ var isAvailable = (key, map2) => {
1986
+ const iter = map2.keys();
1987
+ let matchingKey;
1988
+ let { done = false, value } = iter.next();
1989
+ while (!done && matchingKey === void 0) {
1990
+ if (value !== void 0 && key.startsWith(value)) {
1991
+ matchingKey = value;
1992
+ done = true;
1993
+ }
1994
+ const { value: nextValue, done: nextDone = false } = iter.next();
1995
+ done = nextDone;
1996
+ value = nextValue;
1997
+ }
1998
+ return matchingKey;
1999
+ };
2000
+ var isWindowClient = (source) => source !== null && "id" in source;
2001
+ var errorCatcher = (clientId) => (error) => console.error(`[SW]: error on ${clientId} - ${String(error)}`);
2002
+ var getReceiver = fromServiceWorkerToReceiver(self, { errorCatcher });
2003
+ var makeListener = (clientId) => {
2004
+ return function listener({ data }) {
2005
+ const workerMessageData = data;
2006
+ switch (workerMessageData.type) {
2007
+ case "set-source-map": {
2008
+ const { content: { scope, dictionary } } = workerMessageData;
2009
+ const scopedId = scope ?? clientId;
2010
+ const clientMaps = Object.entries(dictionary).reduce((maps, [key, value]) => {
2011
+ const { clientSourceMap, clientTosMap } = maps;
2012
+ if (Object.keys(value.headers).length > 0) {
2013
+ clientTosMap.set(encodeURI(value.to), value.headers);
2014
+ }
2015
+ clientSourceMap.set(encodeURI(key), value);
2016
+ return maps;
2017
+ }, { clientSourceMap: /* @__PURE__ */ new Map(), clientTosMap: /* @__PURE__ */ new Map() });
2018
+ if (scope) {
2019
+ clientIdsToScope.set(clientId, scope);
2020
+ } else {
2021
+ clientIdsToScope.delete(clientId);
2022
+ }
2023
+ sourceMap.set(scopedId, clientMaps.clientSourceMap);
2024
+ tosMap.set(scopedId, clientMaps.clientTosMap);
2025
+ break;
2026
+ }
2027
+ case "unload-client": {
2028
+ clientIdsToScope.delete(clientId);
2029
+ openChannels.delete(clientId);
2030
+ this.disconnect();
2031
+ break;
2032
+ }
2033
+ default:
2034
+ break;
2035
+ }
2036
+ };
2037
+ };
2038
+ var createChannel = (clientId) => {
2039
+ const listenerToSubscription = /* @__PURE__ */ new Map();
2040
+ const buffer = new ReplaySubject();
2041
+ const sender = {
2042
+ addEventListener(_, listener) {
2043
+ listenerToSubscription.set(listener, buffer.subscribe((msg) => listener(msg)));
2044
+ },
2045
+ removeEventListener(_, listener) {
2046
+ listenerToSubscription.get(listener)?.unsubscribe();
2047
+ listenerToSubscription.delete(listener);
2048
+ }
2049
+ };
2050
+ return {
2051
+ buffer,
2052
+ channel: new src_default(makeListener(clientId), sender, getReceiver(clientId))
2053
+ };
2054
+ };
2055
+ var getCachedOpenChannel = (clientId) => {
2056
+ let ch = openChannels.get(clientId);
2057
+ if (!ch) {
2058
+ ch = createChannel(clientId);
2059
+ openChannels.set(clientId, ch);
2060
+ }
2061
+ return ch;
2062
+ };
2063
+ self.addEventListener("install", () => {
2064
+ self.skipWaiting().catch((err) => console.error(`[SW] error while skipWaiting - ${String(err)}`));
2065
+ });
2066
+ self.addEventListener("activate", (event) => {
2067
+ event.waitUntil(self.clients.claim());
2068
+ });
2069
+ self.addEventListener("message", (message) => {
2070
+ const { source } = message;
2071
+ if (!isWindowClient(source)) {
2072
+ return;
2073
+ }
2074
+ const { id: clientId } = source;
2075
+ getCachedOpenChannel(clientId).buffer.next(message);
2076
+ });
2077
+ self.addEventListener("fetch", (event) => {
2078
+ const clientId = event.clientId !== "" ? event.clientId : event.resultingClientId;
2079
+ const scope = clientIdsToScope.get(clientId);
2080
+ const scopedId = scope ?? clientId;
2081
+ const clientSourceMap = sourceMap.get(scopedId);
2082
+ if (!clientSourceMap) {
2083
+ return event.respondWith(self.fetch(event.request));
2084
+ }
2085
+ const clientTosMap = tosMap.get(scopedId);
2086
+ let { request: { url } } = event;
2087
+ const key = isAvailable(url, clientSourceMap);
2088
+ const to = isAvailable(url, clientTosMap);
2089
+ const headers = new Headers(event.request.headers);
2090
+ let extraQuery = {};
2091
+ if (key !== void 0) {
2092
+ const value = clientSourceMap.get(key)?.to;
2093
+ const extraHeaders = clientSourceMap.get(key)?.headers;
2094
+ const rest = url.substring(key.length);
2095
+ extraQuery = clientSourceMap.get(key)?.query;
2096
+ url = `${value}${rest}`;
2097
+ Object.entries(extraHeaders).forEach(([headerKey, headerValue]) => headers.set(headerKey, headerValue));
2098
+ }
2099
+ if (to !== void 0) {
2100
+ const extraHeaders = clientTosMap.get(to);
2101
+ Object.entries(extraHeaders).forEach(([headerKey, headerValue]) => headers.set(headerKey, headerValue));
2102
+ }
2103
+ let finalUrl;
2104
+ try {
2105
+ const urlInstance = new URL(url);
2106
+ Object.entries(extraQuery).forEach(([qk, qv]) => urlInstance.searchParams.set(qk, qv));
2107
+ finalUrl = urlInstance.href;
2108
+ } catch {
2109
+ finalUrl = url;
2110
+ }
2111
+ console.log({ clientId, clientSourceMap, finalUrl });
2112
+ event.respondWith(
2113
+ self.fetch(finalUrl, { ...event.request, headers }).catch((error) => {
2114
+ console.error(error);
2115
+ return Promise.reject(error);
2116
+ })
2117
+ );
2118
+ });
2119
+ })();