@haiilo/catalyst 6.2.3 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/catalyst/catalyst.css +52 -19
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/index.esm.js +2 -2
  5. package/dist/catalyst/index.esm.js.map +1 -1
  6. package/dist/catalyst/p-90e9d18f.entry.js +10 -0
  7. package/dist/catalyst/p-90e9d18f.entry.js.map +1 -0
  8. package/dist/catalyst/p-dd8ae83e.js +2 -0
  9. package/dist/catalyst/p-dd8ae83e.js.map +1 -0
  10. package/dist/catalyst/scss/vendor/_flatpickr.scss +62 -14
  11. package/dist/cjs/{cat-alert_25.cjs.entry.js → cat-alert_26.cjs.entry.js} +7194 -8022
  12. package/dist/cjs/cat-alert_26.cjs.entry.js.map +1 -0
  13. package/dist/cjs/catalyst.cjs.js +1 -1
  14. package/dist/cjs/index.cjs.js +28 -8
  15. package/dist/cjs/index.cjs.js.map +1 -1
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/cjs/of-d9fa1990.js +1435 -0
  18. package/dist/cjs/of-d9fa1990.js.map +1 -0
  19. package/dist/collection/collection-manifest.json +1 -0
  20. package/dist/collection/components/cat-button-group/cat-button-group.js +4 -0
  21. package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -1
  22. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js +41 -20
  23. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -1
  24. package/dist/collection/components/cat-datepicker/cat-datepicker.format.js +22 -0
  25. package/dist/collection/components/cat-datepicker/cat-datepicker.format.js.map +1 -0
  26. package/dist/collection/components/cat-datepicker/cat-datepicker.js +30 -48
  27. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  28. package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js.map +1 -1
  29. package/dist/collection/components/cat-datepicker/cat-datepicker.mode.js +2 -0
  30. package/dist/collection/components/cat-datepicker/cat-datepicker.mode.js.map +1 -0
  31. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.css +1146 -0
  32. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js +10 -0
  33. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js.map +1 -0
  34. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +236 -0
  35. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js.map +1 -0
  36. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +20 -0
  37. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +1 -0
  38. package/dist/collection/components/cat-dropdown/cat-dropdown.css +1 -1
  39. package/dist/collection/components/cat-input/cat-input.css +3 -0
  40. package/dist/collection/components/cat-input/cat-input.js +3 -2
  41. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  42. package/dist/collection/components/cat-select/cat-select.css +1 -1
  43. package/dist/collection/components/cat-select/connectors.js +20 -0
  44. package/dist/collection/components/cat-select/connectors.js.map +1 -0
  45. package/dist/collection/components/cat-textarea/cat-textarea.css +4 -0
  46. package/dist/collection/components/cat-textarea/cat-textarea.js +1 -0
  47. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  48. package/dist/collection/components/cat-tooltip/cat-tooltip.css +1 -1
  49. package/dist/collection/index.js +4 -3
  50. package/dist/collection/index.js.map +1 -1
  51. package/dist/collection/scss/vendor/_flatpickr.scss +62 -14
  52. package/dist/components/cat-button-group.js.map +1 -1
  53. package/dist/components/cat-datepicker-inline.d.ts +11 -0
  54. package/dist/components/cat-datepicker-inline.js +100 -0
  55. package/dist/components/cat-datepicker-inline.js.map +1 -0
  56. package/dist/components/cat-datepicker.js +21 -2767
  57. package/dist/components/cat-datepicker.js.map +1 -1
  58. package/dist/components/cat-datepicker.locale.js +2768 -0
  59. package/dist/components/cat-datepicker.locale.js.map +1 -0
  60. package/dist/components/cat-dropdown2.js +1 -1
  61. package/dist/components/cat-dropdown2.js.map +1 -1
  62. package/dist/components/cat-input2.js +4 -3
  63. package/dist/components/cat-input2.js.map +1 -1
  64. package/dist/components/cat-scrollable2.js +2 -910
  65. package/dist/components/cat-scrollable2.js.map +1 -1
  66. package/dist/components/cat-select-demo.js +4 -2
  67. package/dist/components/cat-select-demo.js.map +1 -1
  68. package/dist/components/cat-select2.js +5 -8
  69. package/dist/components/cat-select2.js.map +1 -1
  70. package/dist/components/cat-textarea.js +2 -1
  71. package/dist/components/cat-textarea.js.map +1 -1
  72. package/dist/components/cat-tooltip.js +1 -1
  73. package/dist/components/cat-tooltip.js.map +1 -1
  74. package/dist/components/from.js +912 -0
  75. package/dist/components/from.js.map +1 -0
  76. package/dist/components/index.js +21 -1
  77. package/dist/components/index.js.map +1 -1
  78. package/dist/components/of.js +10 -0
  79. package/dist/components/of.js.map +1 -0
  80. package/dist/esm/{cat-alert_25.entry.js → cat-alert_26.entry.js} +7177 -8006
  81. package/dist/esm/cat-alert_26.entry.js.map +1 -0
  82. package/dist/esm/catalyst.js +1 -1
  83. package/dist/esm/index.js +22 -3
  84. package/dist/esm/index.js.map +1 -1
  85. package/dist/esm/loader.js +1 -1
  86. package/dist/esm/of-5472d434.js +1408 -0
  87. package/dist/esm/of-5472d434.js.map +1 -0
  88. package/dist/types/components/cat-button-group/cat-button-group.d.ts +4 -0
  89. package/dist/types/components/cat-datepicker/cat-datepicker.config.d.ts +13 -1
  90. package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +4 -3
  91. package/dist/types/components/cat-datepicker/cat-datepicker.format.d.ts +2 -0
  92. package/dist/types/components/cat-datepicker/cat-datepicker.locale.d.ts +2 -2
  93. package/dist/types/components/cat-datepicker/cat-datepicker.mode.d.ts +1 -0
  94. package/dist/types/components/cat-datepicker-inline/cat-datepicker-inline.d.ts +43 -0
  95. package/dist/types/components/cat-select/connectors.d.ts +8 -0
  96. package/dist/types/components.d.ts +97 -2
  97. package/dist/types/index.d.ts +4 -3
  98. package/package.json +3 -3
  99. package/dist/catalyst/p-0c98e803.entry.js +0 -10
  100. package/dist/catalyst/p-0c98e803.entry.js.map +0 -1
  101. package/dist/catalyst/p-42e63e08.js +0 -2
  102. package/dist/catalyst/p-42e63e08.js.map +0 -1
  103. package/dist/cjs/cat-alert_25.cjs.entry.js.map +0 -1
  104. package/dist/cjs/cat-icon-registry-5c292d3f.js +0 -502
  105. package/dist/cjs/cat-icon-registry-5c292d3f.js.map +0 -1
  106. package/dist/esm/cat-alert_25.entry.js.map +0 -1
  107. package/dist/esm/cat-icon-registry-4fc73466.js +0 -494
  108. package/dist/esm/cat-icon-registry-4fc73466.js.map +0 -1
@@ -0,0 +1,912 @@
1
+ function isFunction(value) {
2
+ return typeof value === 'function';
3
+ }
4
+
5
+ function createErrorClass(createImpl) {
6
+ const _super = (instance) => {
7
+ Error.call(instance);
8
+ instance.stack = new Error().stack;
9
+ };
10
+ const ctorFunc = createImpl(_super);
11
+ ctorFunc.prototype = Object.create(Error.prototype);
12
+ ctorFunc.prototype.constructor = ctorFunc;
13
+ return ctorFunc;
14
+ }
15
+
16
+ const UnsubscriptionError = createErrorClass((_super) => function UnsubscriptionErrorImpl(errors) {
17
+ _super(this);
18
+ this.message = errors
19
+ ? `${errors.length} errors occurred during unsubscription:
20
+ ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}`
21
+ : '';
22
+ this.name = 'UnsubscriptionError';
23
+ this.errors = errors;
24
+ });
25
+
26
+ function arrRemove(arr, item) {
27
+ if (arr) {
28
+ const index = arr.indexOf(item);
29
+ 0 <= index && arr.splice(index, 1);
30
+ }
31
+ }
32
+
33
+ class Subscription {
34
+ constructor(initialTeardown) {
35
+ this.initialTeardown = initialTeardown;
36
+ this.closed = false;
37
+ this._parentage = null;
38
+ this._finalizers = null;
39
+ }
40
+ unsubscribe() {
41
+ let errors;
42
+ if (!this.closed) {
43
+ this.closed = true;
44
+ const { _parentage } = this;
45
+ if (_parentage) {
46
+ this._parentage = null;
47
+ if (Array.isArray(_parentage)) {
48
+ for (const parent of _parentage) {
49
+ parent.remove(this);
50
+ }
51
+ }
52
+ else {
53
+ _parentage.remove(this);
54
+ }
55
+ }
56
+ const { initialTeardown: initialFinalizer } = this;
57
+ if (isFunction(initialFinalizer)) {
58
+ try {
59
+ initialFinalizer();
60
+ }
61
+ catch (e) {
62
+ errors = e instanceof UnsubscriptionError ? e.errors : [e];
63
+ }
64
+ }
65
+ const { _finalizers } = this;
66
+ if (_finalizers) {
67
+ this._finalizers = null;
68
+ for (const finalizer of _finalizers) {
69
+ try {
70
+ execFinalizer(finalizer);
71
+ }
72
+ catch (err) {
73
+ errors = errors !== null && errors !== void 0 ? errors : [];
74
+ if (err instanceof UnsubscriptionError) {
75
+ errors = [...errors, ...err.errors];
76
+ }
77
+ else {
78
+ errors.push(err);
79
+ }
80
+ }
81
+ }
82
+ }
83
+ if (errors) {
84
+ throw new UnsubscriptionError(errors);
85
+ }
86
+ }
87
+ }
88
+ add(teardown) {
89
+ var _a;
90
+ if (teardown && teardown !== this) {
91
+ if (this.closed) {
92
+ execFinalizer(teardown);
93
+ }
94
+ else {
95
+ if (teardown instanceof Subscription) {
96
+ if (teardown.closed || teardown._hasParent(this)) {
97
+ return;
98
+ }
99
+ teardown._addParent(this);
100
+ }
101
+ (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
102
+ }
103
+ }
104
+ }
105
+ _hasParent(parent) {
106
+ const { _parentage } = this;
107
+ return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
108
+ }
109
+ _addParent(parent) {
110
+ const { _parentage } = this;
111
+ this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
112
+ }
113
+ _removeParent(parent) {
114
+ const { _parentage } = this;
115
+ if (_parentage === parent) {
116
+ this._parentage = null;
117
+ }
118
+ else if (Array.isArray(_parentage)) {
119
+ arrRemove(_parentage, parent);
120
+ }
121
+ }
122
+ remove(teardown) {
123
+ const { _finalizers } = this;
124
+ _finalizers && arrRemove(_finalizers, teardown);
125
+ if (teardown instanceof Subscription) {
126
+ teardown._removeParent(this);
127
+ }
128
+ }
129
+ }
130
+ Subscription.EMPTY = (() => {
131
+ const empty = new Subscription();
132
+ empty.closed = true;
133
+ return empty;
134
+ })();
135
+ const EMPTY_SUBSCRIPTION = Subscription.EMPTY;
136
+ function isSubscription(value) {
137
+ return (value instanceof Subscription ||
138
+ (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
139
+ }
140
+ function execFinalizer(finalizer) {
141
+ if (isFunction(finalizer)) {
142
+ finalizer();
143
+ }
144
+ else {
145
+ finalizer.unsubscribe();
146
+ }
147
+ }
148
+
149
+ const config = {
150
+ onUnhandledError: null,
151
+ onStoppedNotification: null,
152
+ Promise: undefined,
153
+ useDeprecatedSynchronousErrorHandling: false,
154
+ useDeprecatedNextContext: false,
155
+ };
156
+
157
+ const timeoutProvider = {
158
+ setTimeout(handler, timeout, ...args) {
159
+ const { delegate } = timeoutProvider;
160
+ if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
161
+ return delegate.setTimeout(handler, timeout, ...args);
162
+ }
163
+ return setTimeout(handler, timeout, ...args);
164
+ },
165
+ clearTimeout(handle) {
166
+ const { delegate } = timeoutProvider;
167
+ return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
168
+ },
169
+ delegate: undefined,
170
+ };
171
+
172
+ function reportUnhandledError(err) {
173
+ timeoutProvider.setTimeout(() => {
174
+ const { onUnhandledError } = config;
175
+ if (onUnhandledError) {
176
+ onUnhandledError(err);
177
+ }
178
+ else {
179
+ throw err;
180
+ }
181
+ });
182
+ }
183
+
184
+ function noop() { }
185
+
186
+ const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined))();
187
+ function errorNotification(error) {
188
+ return createNotification('E', undefined, error);
189
+ }
190
+ function nextNotification(value) {
191
+ return createNotification('N', value, undefined);
192
+ }
193
+ function createNotification(kind, value, error) {
194
+ return {
195
+ kind,
196
+ value,
197
+ error,
198
+ };
199
+ }
200
+
201
+ function errorContext(cb) {
202
+ {
203
+ cb();
204
+ }
205
+ }
206
+
207
+ class Subscriber extends Subscription {
208
+ constructor(destination) {
209
+ super();
210
+ this.isStopped = false;
211
+ if (destination) {
212
+ this.destination = destination;
213
+ if (isSubscription(destination)) {
214
+ destination.add(this);
215
+ }
216
+ }
217
+ else {
218
+ this.destination = EMPTY_OBSERVER;
219
+ }
220
+ }
221
+ static create(next, error, complete) {
222
+ return new SafeSubscriber(next, error, complete);
223
+ }
224
+ next(value) {
225
+ if (this.isStopped) {
226
+ handleStoppedNotification(nextNotification(value), this);
227
+ }
228
+ else {
229
+ this._next(value);
230
+ }
231
+ }
232
+ error(err) {
233
+ if (this.isStopped) {
234
+ handleStoppedNotification(errorNotification(err), this);
235
+ }
236
+ else {
237
+ this.isStopped = true;
238
+ this._error(err);
239
+ }
240
+ }
241
+ complete() {
242
+ if (this.isStopped) {
243
+ handleStoppedNotification(COMPLETE_NOTIFICATION, this);
244
+ }
245
+ else {
246
+ this.isStopped = true;
247
+ this._complete();
248
+ }
249
+ }
250
+ unsubscribe() {
251
+ if (!this.closed) {
252
+ this.isStopped = true;
253
+ super.unsubscribe();
254
+ this.destination = null;
255
+ }
256
+ }
257
+ _next(value) {
258
+ this.destination.next(value);
259
+ }
260
+ _error(err) {
261
+ try {
262
+ this.destination.error(err);
263
+ }
264
+ finally {
265
+ this.unsubscribe();
266
+ }
267
+ }
268
+ _complete() {
269
+ try {
270
+ this.destination.complete();
271
+ }
272
+ finally {
273
+ this.unsubscribe();
274
+ }
275
+ }
276
+ }
277
+ const _bind = Function.prototype.bind;
278
+ function bind(fn, thisArg) {
279
+ return _bind.call(fn, thisArg);
280
+ }
281
+ class ConsumerObserver {
282
+ constructor(partialObserver) {
283
+ this.partialObserver = partialObserver;
284
+ }
285
+ next(value) {
286
+ const { partialObserver } = this;
287
+ if (partialObserver.next) {
288
+ try {
289
+ partialObserver.next(value);
290
+ }
291
+ catch (error) {
292
+ handleUnhandledError(error);
293
+ }
294
+ }
295
+ }
296
+ error(err) {
297
+ const { partialObserver } = this;
298
+ if (partialObserver.error) {
299
+ try {
300
+ partialObserver.error(err);
301
+ }
302
+ catch (error) {
303
+ handleUnhandledError(error);
304
+ }
305
+ }
306
+ else {
307
+ handleUnhandledError(err);
308
+ }
309
+ }
310
+ complete() {
311
+ const { partialObserver } = this;
312
+ if (partialObserver.complete) {
313
+ try {
314
+ partialObserver.complete();
315
+ }
316
+ catch (error) {
317
+ handleUnhandledError(error);
318
+ }
319
+ }
320
+ }
321
+ }
322
+ class SafeSubscriber extends Subscriber {
323
+ constructor(observerOrNext, error, complete) {
324
+ super();
325
+ let partialObserver;
326
+ if (isFunction(observerOrNext) || !observerOrNext) {
327
+ partialObserver = {
328
+ next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined,
329
+ error: error !== null && error !== void 0 ? error : undefined,
330
+ complete: complete !== null && complete !== void 0 ? complete : undefined,
331
+ };
332
+ }
333
+ else {
334
+ let context;
335
+ if (this && config.useDeprecatedNextContext) {
336
+ context = Object.create(observerOrNext);
337
+ context.unsubscribe = () => this.unsubscribe();
338
+ partialObserver = {
339
+ next: observerOrNext.next && bind(observerOrNext.next, context),
340
+ error: observerOrNext.error && bind(observerOrNext.error, context),
341
+ complete: observerOrNext.complete && bind(observerOrNext.complete, context),
342
+ };
343
+ }
344
+ else {
345
+ partialObserver = observerOrNext;
346
+ }
347
+ }
348
+ this.destination = new ConsumerObserver(partialObserver);
349
+ }
350
+ }
351
+ function handleUnhandledError(error) {
352
+ {
353
+ reportUnhandledError(error);
354
+ }
355
+ }
356
+ function defaultErrorHandler(err) {
357
+ throw err;
358
+ }
359
+ function handleStoppedNotification(notification, subscriber) {
360
+ const { onStoppedNotification } = config;
361
+ onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));
362
+ }
363
+ const EMPTY_OBSERVER = {
364
+ closed: true,
365
+ next: noop,
366
+ error: defaultErrorHandler,
367
+ complete: noop,
368
+ };
369
+
370
+ const observable = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();
371
+
372
+ function identity(x) {
373
+ return x;
374
+ }
375
+
376
+ function pipeFromArray(fns) {
377
+ if (fns.length === 0) {
378
+ return identity;
379
+ }
380
+ if (fns.length === 1) {
381
+ return fns[0];
382
+ }
383
+ return function piped(input) {
384
+ return fns.reduce((prev, fn) => fn(prev), input);
385
+ };
386
+ }
387
+
388
+ class Observable {
389
+ constructor(subscribe) {
390
+ if (subscribe) {
391
+ this._subscribe = subscribe;
392
+ }
393
+ }
394
+ lift(operator) {
395
+ const observable = new Observable();
396
+ observable.source = this;
397
+ observable.operator = operator;
398
+ return observable;
399
+ }
400
+ subscribe(observerOrNext, error, complete) {
401
+ const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
402
+ errorContext(() => {
403
+ const { operator, source } = this;
404
+ subscriber.add(operator
405
+ ?
406
+ operator.call(subscriber, source)
407
+ : source
408
+ ?
409
+ this._subscribe(subscriber)
410
+ :
411
+ this._trySubscribe(subscriber));
412
+ });
413
+ return subscriber;
414
+ }
415
+ _trySubscribe(sink) {
416
+ try {
417
+ return this._subscribe(sink);
418
+ }
419
+ catch (err) {
420
+ sink.error(err);
421
+ }
422
+ }
423
+ forEach(next, promiseCtor) {
424
+ promiseCtor = getPromiseCtor(promiseCtor);
425
+ return new promiseCtor((resolve, reject) => {
426
+ const subscriber = new SafeSubscriber({
427
+ next: (value) => {
428
+ try {
429
+ next(value);
430
+ }
431
+ catch (err) {
432
+ reject(err);
433
+ subscriber.unsubscribe();
434
+ }
435
+ },
436
+ error: reject,
437
+ complete: resolve,
438
+ });
439
+ this.subscribe(subscriber);
440
+ });
441
+ }
442
+ _subscribe(subscriber) {
443
+ var _a;
444
+ return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
445
+ }
446
+ [observable]() {
447
+ return this;
448
+ }
449
+ pipe(...operations) {
450
+ return pipeFromArray(operations)(this);
451
+ }
452
+ toPromise(promiseCtor) {
453
+ promiseCtor = getPromiseCtor(promiseCtor);
454
+ return new promiseCtor((resolve, reject) => {
455
+ let value;
456
+ this.subscribe((x) => (value = x), (err) => reject(err), () => resolve(value));
457
+ });
458
+ }
459
+ }
460
+ Observable.create = (subscribe) => {
461
+ return new Observable(subscribe);
462
+ };
463
+ function getPromiseCtor(promiseCtor) {
464
+ var _a;
465
+ return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
466
+ }
467
+ function isObserver(value) {
468
+ return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
469
+ }
470
+ function isSubscriber(value) {
471
+ return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
472
+ }
473
+
474
+ function hasLift(source) {
475
+ return isFunction(source === null || source === void 0 ? void 0 : source.lift);
476
+ }
477
+ function operate(init) {
478
+ return (source) => {
479
+ if (hasLift(source)) {
480
+ return source.lift(function (liftedSource) {
481
+ try {
482
+ return init(liftedSource, this);
483
+ }
484
+ catch (err) {
485
+ this.error(err);
486
+ }
487
+ });
488
+ }
489
+ throw new TypeError('Unable to lift unknown Observable type');
490
+ };
491
+ }
492
+
493
+ function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
494
+ return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
495
+ }
496
+ class OperatorSubscriber extends Subscriber {
497
+ constructor(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
498
+ super(destination);
499
+ this.onFinalize = onFinalize;
500
+ this.shouldUnsubscribe = shouldUnsubscribe;
501
+ this._next = onNext
502
+ ? function (value) {
503
+ try {
504
+ onNext(value);
505
+ }
506
+ catch (err) {
507
+ destination.error(err);
508
+ }
509
+ }
510
+ : super._next;
511
+ this._error = onError
512
+ ? function (err) {
513
+ try {
514
+ onError(err);
515
+ }
516
+ catch (err) {
517
+ destination.error(err);
518
+ }
519
+ finally {
520
+ this.unsubscribe();
521
+ }
522
+ }
523
+ : super._error;
524
+ this._complete = onComplete
525
+ ? function () {
526
+ try {
527
+ onComplete();
528
+ }
529
+ catch (err) {
530
+ destination.error(err);
531
+ }
532
+ finally {
533
+ this.unsubscribe();
534
+ }
535
+ }
536
+ : super._complete;
537
+ }
538
+ unsubscribe() {
539
+ var _a;
540
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
541
+ const { closed } = this;
542
+ super.unsubscribe();
543
+ !closed && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
544
+ }
545
+ }
546
+ }
547
+
548
+ function isScheduler(value) {
549
+ return value && isFunction(value.schedule);
550
+ }
551
+
552
+ function last(arr) {
553
+ return arr[arr.length - 1];
554
+ }
555
+ function popScheduler(args) {
556
+ return isScheduler(last(args)) ? args.pop() : undefined;
557
+ }
558
+ function popNumber(args, defaultValue) {
559
+ return typeof last(args) === 'number' ? args.pop() : defaultValue;
560
+ }
561
+
562
+ /******************************************************************************
563
+ Copyright (c) Microsoft Corporation.
564
+
565
+ Permission to use, copy, modify, and/or distribute this software for any
566
+ purpose with or without fee is hereby granted.
567
+
568
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
569
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
570
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
571
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
572
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
573
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
574
+ PERFORMANCE OF THIS SOFTWARE.
575
+ ***************************************************************************** */
576
+
577
+ function __awaiter(thisArg, _arguments, P, generator) {
578
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
579
+ return new (P || (P = Promise))(function (resolve, reject) {
580
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
581
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
582
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
583
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
584
+ });
585
+ }
586
+
587
+ function __values(o) {
588
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
589
+ if (m) return m.call(o);
590
+ if (o && typeof o.length === "number") return {
591
+ next: function () {
592
+ if (o && i >= o.length) o = void 0;
593
+ return { value: o && o[i++], done: !o };
594
+ }
595
+ };
596
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
597
+ }
598
+
599
+ function __await(v) {
600
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
601
+ }
602
+
603
+ function __asyncGenerator(thisArg, _arguments, generator) {
604
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
605
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
606
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
607
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
608
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
609
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
610
+ function fulfill(value) { resume("next", value); }
611
+ function reject(value) { resume("throw", value); }
612
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
613
+ }
614
+
615
+ function __asyncValues(o) {
616
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
617
+ var m = o[Symbol.asyncIterator], i;
618
+ 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 () { return this; }, i);
619
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
620
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
621
+ }
622
+
623
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
624
+ var e = new Error(message);
625
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
626
+ };
627
+
628
+ const isArrayLike = ((x) => x && typeof x.length === 'number' && typeof x !== 'function');
629
+
630
+ function isPromise(value) {
631
+ return isFunction(value === null || value === void 0 ? void 0 : value.then);
632
+ }
633
+
634
+ function isInteropObservable(input) {
635
+ return isFunction(input[observable]);
636
+ }
637
+
638
+ function isAsyncIterable(obj) {
639
+ return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
640
+ }
641
+
642
+ function createInvalidObservableTypeError(input) {
643
+ 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.`);
644
+ }
645
+
646
+ function getSymbolIterator() {
647
+ if (typeof Symbol !== 'function' || !Symbol.iterator) {
648
+ return '@@iterator';
649
+ }
650
+ return Symbol.iterator;
651
+ }
652
+ const iterator = getSymbolIterator();
653
+
654
+ function isIterable(input) {
655
+ return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
656
+ }
657
+
658
+ function readableStreamLikeToAsyncGenerator(readableStream) {
659
+ return __asyncGenerator(this, arguments, function* readableStreamLikeToAsyncGenerator_1() {
660
+ const reader = readableStream.getReader();
661
+ try {
662
+ while (true) {
663
+ const { value, done } = yield __await(reader.read());
664
+ if (done) {
665
+ return yield __await(void 0);
666
+ }
667
+ yield yield __await(value);
668
+ }
669
+ }
670
+ finally {
671
+ reader.releaseLock();
672
+ }
673
+ });
674
+ }
675
+ function isReadableStreamLike(obj) {
676
+ return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
677
+ }
678
+
679
+ function innerFrom(input) {
680
+ if (input instanceof Observable) {
681
+ return input;
682
+ }
683
+ if (input != null) {
684
+ if (isInteropObservable(input)) {
685
+ return fromInteropObservable(input);
686
+ }
687
+ if (isArrayLike(input)) {
688
+ return fromArrayLike(input);
689
+ }
690
+ if (isPromise(input)) {
691
+ return fromPromise(input);
692
+ }
693
+ if (isAsyncIterable(input)) {
694
+ return fromAsyncIterable(input);
695
+ }
696
+ if (isIterable(input)) {
697
+ return fromIterable(input);
698
+ }
699
+ if (isReadableStreamLike(input)) {
700
+ return fromReadableStreamLike(input);
701
+ }
702
+ }
703
+ throw createInvalidObservableTypeError(input);
704
+ }
705
+ function fromInteropObservable(obj) {
706
+ return new Observable((subscriber) => {
707
+ const obs = obj[observable]();
708
+ if (isFunction(obs.subscribe)) {
709
+ return obs.subscribe(subscriber);
710
+ }
711
+ throw new TypeError('Provided object does not correctly implement Symbol.observable');
712
+ });
713
+ }
714
+ function fromArrayLike(array) {
715
+ return new Observable((subscriber) => {
716
+ for (let i = 0; i < array.length && !subscriber.closed; i++) {
717
+ subscriber.next(array[i]);
718
+ }
719
+ subscriber.complete();
720
+ });
721
+ }
722
+ function fromPromise(promise) {
723
+ return new Observable((subscriber) => {
724
+ promise
725
+ .then((value) => {
726
+ if (!subscriber.closed) {
727
+ subscriber.next(value);
728
+ subscriber.complete();
729
+ }
730
+ }, (err) => subscriber.error(err))
731
+ .then(null, reportUnhandledError);
732
+ });
733
+ }
734
+ function fromIterable(iterable) {
735
+ return new Observable((subscriber) => {
736
+ for (const value of iterable) {
737
+ subscriber.next(value);
738
+ if (subscriber.closed) {
739
+ return;
740
+ }
741
+ }
742
+ subscriber.complete();
743
+ });
744
+ }
745
+ function fromAsyncIterable(asyncIterable) {
746
+ return new Observable((subscriber) => {
747
+ process(asyncIterable, subscriber).catch((err) => subscriber.error(err));
748
+ });
749
+ }
750
+ function fromReadableStreamLike(readableStream) {
751
+ return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
752
+ }
753
+ function process(asyncIterable, subscriber) {
754
+ var asyncIterable_1, asyncIterable_1_1;
755
+ var e_1, _a;
756
+ return __awaiter(this, void 0, void 0, function* () {
757
+ try {
758
+ for (asyncIterable_1 = __asyncValues(asyncIterable); asyncIterable_1_1 = yield asyncIterable_1.next(), !asyncIterable_1_1.done;) {
759
+ const value = asyncIterable_1_1.value;
760
+ subscriber.next(value);
761
+ if (subscriber.closed) {
762
+ return;
763
+ }
764
+ }
765
+ }
766
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
767
+ finally {
768
+ try {
769
+ if (asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return)) yield _a.call(asyncIterable_1);
770
+ }
771
+ finally { if (e_1) throw e_1.error; }
772
+ }
773
+ subscriber.complete();
774
+ });
775
+ }
776
+
777
+ function executeSchedule(parentSubscription, scheduler, work, delay = 0, repeat = false) {
778
+ const scheduleSubscription = scheduler.schedule(function () {
779
+ work();
780
+ if (repeat) {
781
+ parentSubscription.add(this.schedule(null, delay));
782
+ }
783
+ else {
784
+ this.unsubscribe();
785
+ }
786
+ }, delay);
787
+ parentSubscription.add(scheduleSubscription);
788
+ if (!repeat) {
789
+ return scheduleSubscription;
790
+ }
791
+ }
792
+
793
+ function observeOn(scheduler, delay = 0) {
794
+ return operate((source, subscriber) => {
795
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => executeSchedule(subscriber, scheduler, () => subscriber.next(value), delay), () => executeSchedule(subscriber, scheduler, () => subscriber.complete(), delay), (err) => executeSchedule(subscriber, scheduler, () => subscriber.error(err), delay)));
796
+ });
797
+ }
798
+
799
+ function subscribeOn(scheduler, delay = 0) {
800
+ return operate((source, subscriber) => {
801
+ subscriber.add(scheduler.schedule(() => source.subscribe(subscriber), delay));
802
+ });
803
+ }
804
+
805
+ function scheduleObservable(input, scheduler) {
806
+ return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
807
+ }
808
+
809
+ function schedulePromise(input, scheduler) {
810
+ return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
811
+ }
812
+
813
+ function scheduleArray(input, scheduler) {
814
+ return new Observable((subscriber) => {
815
+ let i = 0;
816
+ return scheduler.schedule(function () {
817
+ if (i === input.length) {
818
+ subscriber.complete();
819
+ }
820
+ else {
821
+ subscriber.next(input[i++]);
822
+ if (!subscriber.closed) {
823
+ this.schedule();
824
+ }
825
+ }
826
+ });
827
+ });
828
+ }
829
+
830
+ function scheduleIterable(input, scheduler) {
831
+ return new Observable((subscriber) => {
832
+ let iterator$1;
833
+ executeSchedule(subscriber, scheduler, () => {
834
+ iterator$1 = input[iterator]();
835
+ executeSchedule(subscriber, scheduler, () => {
836
+ let value;
837
+ let done;
838
+ try {
839
+ ({ value, done } = iterator$1.next());
840
+ }
841
+ catch (err) {
842
+ subscriber.error(err);
843
+ return;
844
+ }
845
+ if (done) {
846
+ subscriber.complete();
847
+ }
848
+ else {
849
+ subscriber.next(value);
850
+ }
851
+ }, 0, true);
852
+ });
853
+ return () => isFunction(iterator$1 === null || iterator$1 === void 0 ? void 0 : iterator$1.return) && iterator$1.return();
854
+ });
855
+ }
856
+
857
+ function scheduleAsyncIterable(input, scheduler) {
858
+ if (!input) {
859
+ throw new Error('Iterable cannot be null');
860
+ }
861
+ return new Observable((subscriber) => {
862
+ executeSchedule(subscriber, scheduler, () => {
863
+ const iterator = input[Symbol.asyncIterator]();
864
+ executeSchedule(subscriber, scheduler, () => {
865
+ iterator.next().then((result) => {
866
+ if (result.done) {
867
+ subscriber.complete();
868
+ }
869
+ else {
870
+ subscriber.next(result.value);
871
+ }
872
+ });
873
+ }, 0, true);
874
+ });
875
+ });
876
+ }
877
+
878
+ function scheduleReadableStreamLike(input, scheduler) {
879
+ return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);
880
+ }
881
+
882
+ function scheduled(input, scheduler) {
883
+ if (input != null) {
884
+ if (isInteropObservable(input)) {
885
+ return scheduleObservable(input, scheduler);
886
+ }
887
+ if (isArrayLike(input)) {
888
+ return scheduleArray(input, scheduler);
889
+ }
890
+ if (isPromise(input)) {
891
+ return schedulePromise(input, scheduler);
892
+ }
893
+ if (isAsyncIterable(input)) {
894
+ return scheduleAsyncIterable(input, scheduler);
895
+ }
896
+ if (isIterable(input)) {
897
+ return scheduleIterable(input, scheduler);
898
+ }
899
+ if (isReadableStreamLike(input)) {
900
+ return scheduleReadableStreamLike(input, scheduler);
901
+ }
902
+ }
903
+ throw createInvalidObservableTypeError(input);
904
+ }
905
+
906
+ function from(input, scheduler) {
907
+ return scheduler ? scheduled(input, scheduler) : innerFrom(input);
908
+ }
909
+
910
+ export { EMPTY_SUBSCRIPTION as E, Observable as O, Subscription as S, arrRemove as a, createOperatorSubscriber as b, createErrorClass as c, executeSchedule as d, errorContext as e, from as f, isFunction as g, identity as h, innerFrom as i, isArrayLike as j, isScheduler as k, popNumber as l, noop as n, operate as o, popScheduler as p };
911
+
912
+ //# sourceMappingURL=from.js.map