@spscommerce/utils 6.13.1 → 7.0.1

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.
package/lib/index.es.js CHANGED
@@ -1,180 +1,109 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- function _mergeNamespaces(n, m) {
18
- m.forEach(function(e) {
19
- Object.keys(e).forEach(function(k) {
20
- if (k !== "default" && !(k in n)) {
21
- var d = Object.getOwnPropertyDescriptor(e, k);
22
- Object.defineProperty(n, k, d.get ? d : {
23
- enumerable: true,
24
- get: function() {
25
- return e[k];
26
- }
27
- });
28
- }
29
- });
30
- });
31
- return Object.freeze(n);
32
- }
33
- function flatten(arg) {
34
- if (!Array.isArray(arg)) {
35
- return arg;
36
- }
37
- return arg.reduce((acc, x) => acc.concat(flatten(x)), []);
38
- }
39
- function isSubset(candidate, array) {
40
- const set = new Set(array);
41
- for (const member of candidate) {
42
- if (!set.has(member)) {
43
- return false;
44
- }
45
- }
46
- return true;
47
- }
48
- function resetDebouncedFn() {
49
- this.pending = false;
50
- if (typeof this.id === "number") {
51
- clearTimeout(this.id);
52
- delete this.id;
53
- return true;
54
- }
55
- return false;
56
- }
57
- function debounce(functionToDebounce, milliseconds, thisArg) {
58
- const debFn = function debouncedFn(...args) {
59
- return new Promise((resolve, reject) => {
60
- debFn.reset();
61
- debFn.pending = true;
62
- function executor() {
63
- void (async () => {
1
+ function Me(e) {
2
+ return Array.isArray(e) ? e.reduce((t, n) => t.concat(Me(n)), []) : e;
3
+ }
4
+ function nt(e, t) {
5
+ const n = new Set(t);
6
+ for (const r of e)
7
+ if (!n.has(r))
8
+ return !1;
9
+ return !0;
10
+ }
11
+ function je() {
12
+ return this.pending = !1, typeof this.id < "u" ? (clearTimeout(this.id), delete this.id, !0) : !1;
13
+ }
14
+ function De(e, t, n) {
15
+ const r = function(...i) {
16
+ return new Promise((c, m) => {
17
+ r.reset(), r.pending = !0;
18
+ function h() {
19
+ (async () => {
64
20
  try {
65
- let output = functionToDebounce.apply(thisArg || this, args);
66
- if (output instanceof Promise) {
67
- output = await output;
68
- }
69
- resolve(output);
70
- } catch (err) {
71
- reject(err);
21
+ let u = e.apply(n || this, i);
22
+ u instanceof Promise && (u = await u), c(u);
23
+ } catch (u) {
24
+ m(u);
72
25
  } finally {
73
- debFn.reset();
26
+ r.reset();
74
27
  }
75
28
  })();
76
29
  }
77
- debFn.id = window.setTimeout(executor, milliseconds);
30
+ r.id = window.setTimeout(h, t);
78
31
  });
79
32
  };
80
- debFn.reset = resetDebouncedFn.bind(debFn);
81
- return debFn;
33
+ return r.reset = je.bind(r), r;
82
34
  }
83
- function resetLockedFn() {
84
- this.pending = false;
85
- if (typeof this.id === "number") {
86
- window.cancelAnimationFrame(this.id);
87
- delete this.id;
88
- return true;
89
- }
90
- return false;
35
+ function ke() {
36
+ return this.pending = !1, typeof this.id == "number" ? (window.cancelAnimationFrame(this.id), delete this.id, !0) : !1;
91
37
  }
92
- function lockToAnimationFrames(functionToLock, thisArg) {
93
- const lockFn = function lockedFn(...args) {
94
- if (lockFn.pending) {
95
- lockFn.reset();
96
- }
97
- lockFn.id = window.requestAnimationFrame(() => {
98
- if (functionToLock) {
99
- functionToLock.apply(thisArg || this, args);
100
- }
101
- lockFn.reset();
102
- });
103
- lockFn.pending = true;
38
+ function Fe(e, t) {
39
+ const n = function(...o) {
40
+ n.pending && n.reset(), n.id = window.requestAnimationFrame(() => {
41
+ e && e.apply(t || this, o), n.reset();
42
+ }), n.pending = !0;
104
43
  };
105
- lockFn.pending = false;
106
- lockFn.reset = resetLockedFn.bind(lockFn);
107
- return lockFn;
108
- }
109
- function onNextTick(fn, thisArg) {
110
- const boundFn = thisArg ? fn.bind(thisArg) : fn;
111
- setTimeout(boundFn, 0);
112
- }
113
- const Op = {
114
- add: (a, b) => a + b,
115
- and: (a, b) => a && b,
116
- band: (a, b) => a & b,
117
- bor: (a, b) => a | b,
118
- bxor: (a, b) => a ^ b,
119
- bnot: (a) => ~a,
120
- decr: (a) => a - 1,
121
- div: (a, b) => a / b,
122
- eq: (a, b) => a === b,
123
- exp: (a, b) => a ** b,
124
- gt: (a, b) => a > b,
125
- gte: (a, b) => a >= b,
126
- incr: (a) => a + 1,
127
- lshift: (a, b) => a << b,
128
- lt: (a, b) => a < b,
129
- lte: (a, b) => a <= b,
130
- mul: (a, b) => a * b,
131
- neg: (a) => -a,
132
- neq: (a, b) => a !== b,
133
- not: (a) => !a,
134
- or: (a, b) => a || b,
135
- rem: (a, b) => a % b,
136
- rshift: (a, b) => a >> b,
137
- rshift_zf: (a, b) => a >>> b,
138
- sub: (a, b) => a - b,
139
- xor: (a, b) => (a || b) && !(a && b)
44
+ return n.pending = !1, n.reset = ke.bind(n), n;
45
+ }
46
+ function rt(e, t) {
47
+ const n = t ? e.bind(t) : e;
48
+ setTimeout(n, 0);
49
+ }
50
+ const W = {
51
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
52
+ add: (e, t) => e + t,
53
+ and: (e, t) => e && t,
54
+ band: (e, t) => e & t,
55
+ bor: (e, t) => e | t,
56
+ bxor: (e, t) => e ^ t,
57
+ bnot: (e) => ~e,
58
+ decr: (e) => e - 1,
59
+ div: (e, t) => e / t,
60
+ eq: (e, t) => e === t,
61
+ exp: (e, t) => e ** t,
62
+ gt: (e, t) => e > t,
63
+ gte: (e, t) => e >= t,
64
+ incr: (e) => e + 1,
65
+ lshift: (e, t) => e << t,
66
+ lt: (e, t) => e < t,
67
+ lte: (e, t) => e <= t,
68
+ mul: (e, t) => e * t,
69
+ neg: (e) => -e,
70
+ neq: (e, t) => e !== t,
71
+ not: (e) => !e,
72
+ or: (e, t) => e || t,
73
+ rem: (e, t) => e % t,
74
+ rshift: (e, t) => e >> t,
75
+ rshift_zf: (e, t) => e >>> t,
76
+ sub: (e, t) => e - t,
77
+ xor: (e, t) => (e || t) && !(e && t)
140
78
  };
141
- function range(start, end) {
142
- if (!Number.isInteger(start)) {
79
+ function at(e, t) {
80
+ if (!Number.isInteger(e))
143
81
  throw new Error("start must be an integer");
144
- }
145
- if (!Number.isInteger(end)) {
82
+ if (!Number.isInteger(t))
146
83
  throw new Error("end must be an integer");
147
- }
148
- return new Array(Math.abs(end - start) + 1).fill(start).map(start > end ? Op.sub : Op.add);
149
- }
150
- class CustomEvent {
151
- constructor(eventName, initDict = {}) {
152
- let event;
153
- if (typeof Event === "function") {
154
- event = new Event(eventName, initDict);
155
- } else {
156
- event = document.createEvent("Event");
157
- event.initEvent(eventName, initDict.bubbles, initDict.cancelable);
158
- for (const key of Object.keys(initDict)) {
159
- if (key !== "bubbles" && key !== "cancelable") {
160
- event[key] = initDict[key];
161
- }
162
- }
84
+ return new Array(Math.abs(t - e) + 1).fill(e).map(e > t ? W.sub : W.add);
85
+ }
86
+ class ot {
87
+ constructor(t, n = {}) {
88
+ let r;
89
+ if (typeof Event == "function")
90
+ r = new Event(t, n);
91
+ else {
92
+ r = document.createEvent("Event"), r.initEvent(t, n.bubbles, n.cancelable);
93
+ for (const i of Object.keys(n))
94
+ i !== "bubbles" && i !== "cancelable" && (r[i] = n[i]);
163
95
  }
164
- Object.setPrototypeOf(this, event);
165
- const descriptors = Object.getOwnPropertyDescriptors(Event.prototype);
166
- for (const propKey of Object.keys(descriptors)) {
167
- const descriptor = descriptors[propKey];
168
- for (const key of Object.keys(descriptor)) {
169
- if (typeof descriptor[key] === "function") {
170
- descriptor[key] = descriptor[key].bind(event);
171
- }
172
- }
96
+ Object.setPrototypeOf(this, r);
97
+ const o = Object.getOwnPropertyDescriptors(Event.prototype);
98
+ for (const i of Object.keys(o)) {
99
+ const c = o[i];
100
+ for (const m of Object.keys(c))
101
+ typeof c[m] == "function" && (c[m] = c[m].bind(r));
173
102
  }
174
- Object.defineProperties(this, descriptors);
103
+ Object.defineProperties(this, o);
175
104
  }
176
105
  }
177
- const EDI_DOCUMENT_TYPE = Object.freeze({
106
+ const it = Object.freeze({
178
107
  100: { name: "Insurance Plan Description" },
179
108
  101: { name: "Name and Address Lists" },
180
109
  104: { name: "Air Shipment Information" },
@@ -475,550 +404,452 @@ const EDI_DOCUMENT_TYPE = Object.freeze({
475
404
  998: { name: "Set Cancellation" },
476
405
  999: { name: "Implementation Acknowledgment" }
477
406
  });
478
- function castToNumber() {
479
- return (target, key) => {
480
- const internalKey = `_${String(key)}`;
481
- Object.defineProperties(target, {
482
- [internalKey]: {
483
- enumerable: false,
484
- configurable: true,
485
- writable: true,
407
+ function ct() {
408
+ return (e, t) => {
409
+ const n = `_${String(t)}`;
410
+ Object.defineProperties(e, {
411
+ [n]: {
412
+ enumerable: !1,
413
+ configurable: !0,
414
+ writable: !0,
486
415
  value: void 0
487
416
  },
488
- [key]: {
489
- enumerable: true,
490
- configurable: true,
417
+ [t]: {
418
+ enumerable: !0,
419
+ configurable: !0,
491
420
  get() {
492
- return this[internalKey];
421
+ return this[n];
493
422
  },
494
- set(newValue) {
495
- this[internalKey] = Number(newValue);
423
+ set(r) {
424
+ this[n] = Number(r);
496
425
  }
497
426
  }
498
427
  });
499
428
  };
500
429
  }
501
- function debounced(ms) {
502
- return (target, propertyKey, descriptor) => {
503
- const originalDescriptorCopy = __spreadValues({}, descriptor);
504
- originalDescriptorCopy.get = function get() {
505
- const newDescriptorWithDebounced = __spreadValues({}, originalDescriptorCopy);
506
- newDescriptorWithDebounced.value = debounce(originalDescriptorCopy.value, ms, this);
507
- Object.defineProperty(this, propertyKey, newDescriptorWithDebounced);
508
- return newDescriptorWithDebounced.value;
509
- };
510
- originalDescriptorCopy.configurable = true;
511
- delete originalDescriptorCopy.writable;
512
- delete originalDescriptorCopy.value;
513
- return originalDescriptorCopy;
514
- };
515
- }
516
- function lockedToAnimationFrames(target, propertyKey, descriptor) {
517
- const originalDescriptorCopy = __spreadValues({}, descriptor);
518
- descriptor.get = function get() {
519
- const newDescriptor = __spreadValues({}, originalDescriptorCopy);
520
- newDescriptor.value = lockToAnimationFrames(originalDescriptorCopy.value, this);
521
- Object.defineProperty(this, propertyKey, newDescriptor);
522
- return newDescriptor.value;
430
+ function st(e) {
431
+ return (t, n, r) => {
432
+ const o = { ...r };
433
+ return o.get = function() {
434
+ const c = { ...o };
435
+ return c.value = De(o.value, e, this), Object.defineProperty(this, n, c), c.value;
436
+ }, o.configurable = !0, delete o.writable, delete o.value, o;
523
437
  };
524
- descriptor.configurable = true;
525
- delete descriptor.writable;
526
- delete descriptor.value;
527
- return descriptor;
528
438
  }
529
- function simpleMetadataDecoratorApplicator(metadata, defaults, target, key, descriptor) {
530
- const updatedDescriptor = descriptor || Object.getOwnPropertyDescriptor(target, key);
531
- const getter = updatedDescriptor.get;
532
- const { value } = updatedDescriptor;
533
- updatedDescriptor.get = function get() {
534
- const self2 = this;
535
- const fn = value || getter.call(this);
536
- const boundFn = fn.bind(this);
537
- const updatedMetadata = __spreadValues(__spreadValues({}, defaults), metadata);
538
- for (const prop of Object.keys(defaults)) {
539
- if (typeof metadata[prop] === "function") {
540
- Object.defineProperty(boundFn, prop, {
541
- get() {
542
- return updatedMetadata[prop](self2);
543
- }
544
- });
545
- } else {
546
- boundFn[prop] = updatedMetadata[prop];
547
- }
548
- }
549
- Object.defineProperty(this, key, {
550
- writable: true,
551
- configurable: true,
552
- enumerable: updatedDescriptor.enumerable,
553
- value: boundFn
554
- });
555
- return boundFn;
556
- };
557
- delete updatedDescriptor.value;
558
- delete updatedDescriptor.writable;
559
- return updatedDescriptor;
560
- }
561
- function tickDelay(target, propertyKey, descriptor) {
562
- const originalDescriptorCopy = __spreadValues({}, descriptor);
563
- originalDescriptorCopy.get = function get() {
564
- const newDescriptor = __spreadValues({}, originalDescriptorCopy);
565
- const boundFn = originalDescriptorCopy.value.bind(this);
566
- newDescriptor.value = () => setTimeout(boundFn, 0);
567
- Object.defineProperty(this, propertyKey, newDescriptor);
568
- return newDescriptor.value;
569
- };
570
- originalDescriptorCopy.configurable = true;
571
- delete originalDescriptorCopy.writable;
572
- delete originalDescriptorCopy.value;
573
- return originalDescriptorCopy;
574
- }
575
- function constrain(n, range2) {
576
- if (!n || n < range2[0]) {
577
- return range2[0];
578
- }
579
- if (n > range2[1]) {
580
- return range2[1];
581
- }
582
- return n;
583
- }
584
- function decimalRound(num, decimalPlaces = 0) {
585
- const integralAndFractionalSplit = String(num).split(".");
586
- const allDecimalPlaces = integralAndFractionalSplit.length > 1 ? integralAndFractionalSplit[1].length : 0;
587
- let roundedNum = num;
588
- for (let i = allDecimalPlaces - 1; i >= decimalPlaces; i -= 1) {
589
- roundedNum = Number(`${Math.round(Number(`${roundedNum}e${i}`))}e-${i}`);
590
- }
591
- return roundedNum;
592
- }
593
- function toFileSizeString(n, precision = 2) {
594
- if (n > Number.MAX_SAFE_INTEGER) {
595
- throw new Error("Number is greater than MAX_SAFE_INTEGER; toFileSizeString does not support orders of magnitude higher than petabytes for this reason until BigInt achieves broad browser support.");
596
- }
597
- const magnitude = Math.min(Math.floor(Math.log(n) / Math.log(1024)), 5);
598
- const unit = [
439
+ function mt(e, t, n) {
440
+ const r = { ...n };
441
+ return n.get = function() {
442
+ const i = { ...r };
443
+ return i.value = Fe(r.value, this), Object.defineProperty(this, t, i), i.value;
444
+ }, n.configurable = !0, delete n.writable, delete n.value, n;
445
+ }
446
+ function ut(e, t, n, r, o) {
447
+ const i = o || Object.getOwnPropertyDescriptor(n, r), c = i.get, { value: m } = i;
448
+ return i.get = function() {
449
+ const u = this, d = (m || c.call(this)).bind(this), b = { ...t, ...e };
450
+ for (const p of Object.keys(t))
451
+ typeof e[p] == "function" ? Object.defineProperty(d, p, {
452
+ get() {
453
+ return b[p](u);
454
+ }
455
+ }) : d[p] = b[p];
456
+ return Object.defineProperty(this, r, {
457
+ writable: !0,
458
+ configurable: !0,
459
+ enumerable: i.enumerable,
460
+ value: d
461
+ }), d;
462
+ }, delete i.value, delete i.writable, i;
463
+ }
464
+ function lt(e, t, n) {
465
+ const r = { ...n };
466
+ return r.get = function() {
467
+ const i = { ...r }, c = r.value.bind(this);
468
+ return i.value = () => setTimeout(c, 0), Object.defineProperty(this, t, i), i.value;
469
+ }, r.configurable = !0, delete r.writable, delete r.value, r;
470
+ }
471
+ function ft(e, t) {
472
+ return !e || e < t[0] ? t[0] : e > t[1] ? t[1] : e;
473
+ }
474
+ function Ne(e, t = 0) {
475
+ const n = String(e).split("."), r = n.length > 1 ? n[1].length : 0;
476
+ let o = e;
477
+ for (let i = r - 1; i >= t; i -= 1)
478
+ o = +`${Math.round(+`${o}e${i}`)}e-${i}`;
479
+ return o;
480
+ }
481
+ function dt(e, t = 2) {
482
+ if (e > Number.MAX_SAFE_INTEGER)
483
+ throw new Error(
484
+ "Number is greater than MAX_SAFE_INTEGER; toFileSizeString does not support orders of magnitude higher than petabytes for this reason until BigInt achieves broad browser support."
485
+ );
486
+ const n = Math.min(Math.floor(Math.log(e) / Math.log(1024)), 5), r = [
599
487
  "B",
600
488
  "KB",
601
489
  "MB",
602
490
  "GB",
603
491
  "TB",
604
492
  "PB"
605
- ][magnitude];
606
- const decimalPlaces = magnitude ? precision : 0;
607
- return decimalRound(n / 1024 ** magnitude, decimalPlaces).toFixed(decimalPlaces) + unit;
608
- }
609
- function crumblePath(path) {
610
- return typeof path === "string" ? path.match(/[^.[\]]+/g) || [] : [].concat(path);
611
- }
612
- function copyProperty(propName, sourceObject, destObject) {
613
- Object.defineProperty(destObject, propName, Object.getOwnPropertyDescriptor(sourceObject, propName));
614
- }
615
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
616
- var objectTag = "[object Object]";
617
- function isHostObject(value) {
618
- var result = false;
619
- if (value != null && typeof value.toString != "function") {
493
+ ][n], o = n ? t : 0;
494
+ return Ne(e / 1024 ** n, o).toFixed(o) + r;
495
+ }
496
+ function k(e) {
497
+ return typeof e == "string" ? e.match(/[^.[\]]+/g) || [] : [].concat(e);
498
+ }
499
+ function Le(e, t, n) {
500
+ Object.defineProperty(
501
+ n,
502
+ e,
503
+ Object.getOwnPropertyDescriptor(t, e)
504
+ );
505
+ }
506
+ var I = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
507
+ function F(e) {
508
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
509
+ }
510
+ var Be = "[object Object]";
511
+ function qe(e) {
512
+ var t = !1;
513
+ if (e != null && typeof e.toString != "function")
620
514
  try {
621
- result = !!(value + "");
622
- } catch (e) {
515
+ t = !!(e + "");
516
+ } catch {
623
517
  }
624
- }
625
- return result;
518
+ return t;
626
519
  }
627
- function overArg(func, transform) {
628
- return function(arg) {
629
- return func(transform(arg));
520
+ function xe(e, t) {
521
+ return function(n) {
522
+ return e(t(n));
630
523
  };
631
524
  }
632
- var funcProto = Function.prototype, objectProto = Object.prototype;
633
- var funcToString = funcProto.toString;
634
- var hasOwnProperty = objectProto.hasOwnProperty;
635
- var objectCtorString = funcToString.call(Object);
636
- var objectToString = objectProto.toString;
637
- var getPrototype = overArg(Object.getPrototypeOf, Object);
638
- function isObjectLike(value) {
639
- return !!value && typeof value == "object";
640
- }
641
- function isPlainObject(value) {
642
- if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) {
643
- return false;
644
- }
645
- var proto = getPrototype(value);
646
- if (proto === null) {
647
- return true;
525
+ var Ve = Function.prototype, J = Object.prototype, Q = Ve.toString, _e = J.hasOwnProperty, Ge = Q.call(Object), $e = J.toString, Ue = xe(Object.getPrototypeOf, Object);
526
+ function We(e) {
527
+ return !!e && typeof e == "object";
528
+ }
529
+ function ze(e) {
530
+ if (!We(e) || $e.call(e) != Be || qe(e))
531
+ return !1;
532
+ var t = Ue(e);
533
+ if (t === null)
534
+ return !0;
535
+ var n = _e.call(t, "constructor") && t.constructor;
536
+ return typeof n == "function" && n instanceof n && Q.call(n) == Ge;
537
+ }
538
+ var He = ze;
539
+ const f = /* @__PURE__ */ F(He);
540
+ function Ke(e) {
541
+ Object.freeze(e);
542
+ for (const t of Object.keys(e)) {
543
+ const n = e[t];
544
+ (f(n) || Array.isArray(n)) && Ke(n);
545
+ }
546
+ }
547
+ var Xe = /* @__PURE__ */ ((e) => (e[e.ADDITION = 0] = "ADDITION", e[e.DELETION = 1] = "DELETION", e[e.ALTERATION = 2] = "ALTERATION", e))(Xe || {});
548
+ function Je(e, t, n = []) {
549
+ let r = [];
550
+ for (const o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) {
551
+ const i = Object.prototype.hasOwnProperty.call(e, o), c = Object.prototype.hasOwnProperty.call(t, o);
552
+ i && !c ? r.push({
553
+ type: 1,
554
+ key: o,
555
+ parentPath: n,
556
+ objects: [e, t]
557
+ }) : !i && c ? r.push({
558
+ type: 0,
559
+ key: o,
560
+ parentPath: n,
561
+ objects: [e, t]
562
+ }) : f(e[o]) && f(t[o]) || Array.isArray(e[o]) && Array.isArray(t[o]) ? r = r.concat(
563
+ Je(
564
+ e[o],
565
+ t[o],
566
+ [...n, o]
567
+ )
568
+ ) : e[o] !== t[o] && r.push({
569
+ type: 2,
570
+ key: o,
571
+ parentPath: n,
572
+ objects: [e, t]
573
+ });
648
574
  }
649
- var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
650
- return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
575
+ return r;
651
576
  }
652
- var lodash_isplainobject = isPlainObject;
653
- function deepFreeze(obj) {
654
- Object.freeze(obj);
655
- for (const key of Object.keys(obj)) {
656
- const val = obj[key];
657
- if (lodash_isplainobject(val) || Array.isArray(val)) {
658
- deepFreeze(val);
659
- }
577
+ function Qe(e, t) {
578
+ for (const n of Object.keys(e)) {
579
+ const r = e[n];
580
+ f(r) || Array.isArray(r) ? Qe(r, t) : t(n, r, e);
660
581
  }
661
582
  }
662
- var DiffChange;
663
- (function(DiffChange2) {
664
- DiffChange2[DiffChange2["ADDITION"] = 0] = "ADDITION";
665
- DiffChange2[DiffChange2["DELETION"] = 1] = "DELETION";
666
- DiffChange2[DiffChange2["ALTERATION"] = 2] = "ALTERATION";
667
- })(DiffChange || (DiffChange = {}));
668
- function diff(o1, o2, parentPath = []) {
669
- let d = [];
670
- for (const key of new Set([...Object.keys(o1), ...Object.keys(o2)])) {
671
- const o1HasKey = Object.prototype.hasOwnProperty.call(o1, key);
672
- const o2HasKey = Object.prototype.hasOwnProperty.call(o2, key);
673
- if (o1HasKey && !o2HasKey) {
674
- d.push({
675
- type: 1,
676
- key,
677
- parentPath,
678
- objects: [o1, o2]
679
- });
680
- } else if (!o1HasKey && o2HasKey) {
681
- d.push({
682
- type: 0,
683
- key,
684
- parentPath,
685
- objects: [o1, o2]
686
- });
687
- } else if (lodash_isplainobject(o1[key]) && lodash_isplainobject(o2[key]) || Array.isArray(o1[key]) && Array.isArray(o2[key])) {
688
- d = d.concat(diff(o1[key], o2[key], [...parentPath, key]));
689
- } else if (o1[key] !== o2[key]) {
690
- d.push({
691
- type: 2,
692
- key,
693
- parentPath,
694
- objects: [o1, o2]
695
- });
583
+ function Ye(e, t, n = []) {
584
+ t(n, e);
585
+ for (const r of Object.keys(e)) {
586
+ const o = e[r];
587
+ if (f(o) || Array.isArray(o)) {
588
+ const i = n.concat(r);
589
+ Ye(o, t, i);
696
590
  }
697
591
  }
698
- return d;
699
592
  }
700
- function forEachEntryDeep(object, fn) {
701
- for (const key of Object.keys(object)) {
702
- const value = object[key];
703
- if (lodash_isplainobject(value) || Array.isArray(value)) {
704
- forEachEntryDeep(value, fn);
705
- } else {
706
- fn(key, value, object);
707
- }
708
- }
593
+ function Ze(e) {
594
+ return e == null;
709
595
  }
710
- function forEachNestedObject(object, fn, path = []) {
711
- fn(path, object);
712
- for (const key of Object.keys(object)) {
713
- const value = object[key];
714
- if (lodash_isplainobject(value) || Array.isArray(value)) {
715
- const newPath = path.concat(key);
716
- forEachNestedObject(value, fn, newPath);
717
- }
596
+ var et = Ze;
597
+ const z = /* @__PURE__ */ F(et);
598
+ var A = { exports: {} };
599
+ A.exports;
600
+ (function(e, t) {
601
+ var n = 9007199254740991, r = "[object Arguments]", o = "[object Function]", i = "[object GeneratorFunction]", c = "[object Map]", m = "[object Object]", h = "[object Promise]", u = "[object Set]", O = "[object WeakMap]", d = "[object DataView]", b = /[\\^$.*+?()[\]{}|]/g, p = /^\[object .+?Constructor\]$/, ne = typeof I == "object" && I && I.Object === Object && I, re = typeof self == "object" && self && self.Object === Object && self, g = ne || re || Function("return this")(), N = t && !t.nodeType && t, L = N && !0 && e && !e.nodeType && e, ae = L && L.exports === N;
602
+ function oe(a, s) {
603
+ return a == null ? void 0 : a[s];
718
604
  }
719
- }
720
- function isNil$1(value) {
721
- return value == null;
722
- }
723
- var lodash_isnil = isNil$1;
724
- var isNilImport = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ _mergeNamespaces({
725
- __proto__: null,
726
- [Symbol.toStringTag]: "Module",
727
- "default": lodash_isnil
728
- }, [lodash_isnil]));
729
- var lodash_isempty$1 = { exports: {} };
730
- (function(module, exports) {
731
- var MAX_SAFE_INTEGER = 9007199254740991;
732
- var argsTag = "[object Arguments]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", objectTag2 = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
733
- var dataViewTag = "[object DataView]";
734
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
735
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
736
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
737
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
738
- var root = freeGlobal || freeSelf || Function("return this")();
739
- var freeExports = exports && !exports.nodeType && exports;
740
- var freeModule = freeExports && true && module && !module.nodeType && module;
741
- var moduleExports = freeModule && freeModule.exports === freeExports;
742
- function getValue(object, key) {
743
- return object == null ? void 0 : object[key];
744
- }
745
- function isHostObject2(value) {
746
- var result = false;
747
- if (value != null && typeof value.toString != "function") {
605
+ function ie(a) {
606
+ var s = !1;
607
+ if (a != null && typeof a.toString != "function")
748
608
  try {
749
- result = !!(value + "");
750
- } catch (e) {
609
+ s = !!(a + "");
610
+ } catch {
751
611
  }
752
- }
753
- return result;
612
+ return s;
754
613
  }
755
- function overArg2(func, transform) {
756
- return function(arg) {
757
- return func(transform(arg));
614
+ function ce(a, s) {
615
+ return function(l) {
616
+ return a(s(l));
758
617
  };
759
618
  }
760
- var funcProto2 = Function.prototype, objectProto2 = Object.prototype;
761
- var coreJsData = root["__core-js_shared__"];
762
- var maskSrcKey = function() {
763
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
764
- return uid ? "Symbol(src)_1." + uid : "";
765
- }();
766
- var funcToString2 = funcProto2.toString;
767
- var hasOwnProperty2 = objectProto2.hasOwnProperty;
768
- var objectToString2 = objectProto2.toString;
769
- var reIsNative = RegExp("^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
770
- var Buffer2 = moduleExports ? root.Buffer : void 0, propertyIsEnumerable = objectProto2.propertyIsEnumerable;
771
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg2(Object.keys, Object);
772
- var DataView = getNative(root, "DataView"), Map = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap");
773
- var nonEnumShadows = !propertyIsEnumerable.call({ "valueOf": 1 }, "valueOf");
774
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap);
775
- function baseGetTag(value) {
776
- return objectToString2.call(value);
777
- }
778
- function baseIsNative(value) {
779
- if (!isObject(value) || isMasked(value)) {
780
- return false;
781
- }
782
- var pattern = isFunction(value) || isHostObject2(value) ? reIsNative : reIsHostCtor;
783
- return pattern.test(toSource(value));
784
- }
785
- function getNative(object, key) {
786
- var value = getValue(object, key);
787
- return baseIsNative(value) ? value : void 0;
788
- }
789
- var getTag = baseGetTag;
790
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
791
- getTag = function(value) {
792
- var result = objectToString2.call(value), Ctor = result == objectTag2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
793
- if (ctorString) {
794
- switch (ctorString) {
795
- case dataViewCtorString:
796
- return dataViewTag;
797
- case mapCtorString:
798
- return mapTag;
799
- case promiseCtorString:
800
- return promiseTag;
801
- case setCtorString:
802
- return setTag;
803
- case weakMapCtorString:
804
- return weakMapTag;
805
- }
619
+ var se = Function.prototype, C = Object.prototype, P = g["__core-js_shared__"], B = function() {
620
+ var a = /[^.]+$/.exec(P && P.keys && P.keys.IE_PROTO || "");
621
+ return a ? "Symbol(src)_1." + a : "";
622
+ }(), q = se.toString, T = C.hasOwnProperty, v = C.toString, me = RegExp(
623
+ "^" + q.call(T).replace(b, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
624
+ ), x = ae ? g.Buffer : void 0, V = C.propertyIsEnumerable, ue = x ? x.isBuffer : void 0, le = ce(Object.keys, Object), E = S(g, "DataView"), w = S(g, "Map"), M = S(g, "Promise"), j = S(g, "Set"), D = S(g, "WeakMap"), fe = !V.call({ valueOf: 1 }, "valueOf"), de = R(E), pe = R(w), ge = R(M), ye = R(j), Re = R(D);
625
+ function he(a) {
626
+ return v.call(a);
627
+ }
628
+ function Se(a) {
629
+ if (!$(a) || be(a))
630
+ return !1;
631
+ var s = G(a) || ie(a) ? me : p;
632
+ return s.test(R(a));
633
+ }
634
+ function S(a, s) {
635
+ var l = oe(a, s);
636
+ return Se(l) ? l : void 0;
637
+ }
638
+ var y = he;
639
+ (E && y(new E(new ArrayBuffer(1))) != d || w && y(new w()) != c || M && y(M.resolve()) != h || j && y(new j()) != u || D && y(new D()) != O) && (y = function(a) {
640
+ var s = v.call(a), l = s == m ? a.constructor : void 0, U = l ? R(l) : void 0;
641
+ if (U)
642
+ switch (U) {
643
+ case de:
644
+ return d;
645
+ case pe:
646
+ return c;
647
+ case ge:
648
+ return h;
649
+ case ye:
650
+ return u;
651
+ case Re:
652
+ return O;
806
653
  }
807
- return result;
808
- };
809
- }
810
- function isMasked(func) {
811
- return !!maskSrcKey && maskSrcKey in func;
654
+ return s;
655
+ });
656
+ function be(a) {
657
+ return !!B && B in a;
812
658
  }
813
- function isPrototype(value) {
814
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2;
815
- return value === proto;
659
+ function Ce(a) {
660
+ var s = a && a.constructor, l = typeof s == "function" && s.prototype || C;
661
+ return a === l;
816
662
  }
817
- function toSource(func) {
818
- if (func != null) {
663
+ function R(a) {
664
+ if (a != null) {
819
665
  try {
820
- return funcToString2.call(func);
821
- } catch (e) {
666
+ return q.call(a);
667
+ } catch {
822
668
  }
823
669
  try {
824
- return func + "";
825
- } catch (e) {
670
+ return a + "";
671
+ } catch {
826
672
  }
827
673
  }
828
674
  return "";
829
675
  }
830
- function isArguments(value) {
831
- return isArrayLikeObject(value) && hasOwnProperty2.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString2.call(value) == argsTag);
832
- }
833
- var isArray = Array.isArray;
834
- function isArrayLike(value) {
835
- return value != null && isLength(value.length) && !isFunction(value);
836
- }
837
- function isArrayLikeObject(value) {
838
- return isObjectLike2(value) && isArrayLike(value);
839
- }
840
- var isBuffer = nativeIsBuffer || stubFalse;
841
- function isEmpty2(value) {
842
- if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isArguments(value))) {
843
- return !value.length;
844
- }
845
- var tag = getTag(value);
846
- if (tag == mapTag || tag == setTag) {
847
- return !value.size;
848
- }
849
- if (nonEnumShadows || isPrototype(value)) {
850
- return !nativeKeys(value).length;
851
- }
852
- for (var key in value) {
853
- if (hasOwnProperty2.call(value, key)) {
854
- return false;
855
- }
856
- }
857
- return true;
858
- }
859
- function isFunction(value) {
860
- var tag = isObject(value) ? objectToString2.call(value) : "";
861
- return tag == funcTag || tag == genTag;
862
- }
863
- function isLength(value) {
864
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
865
- }
866
- function isObject(value) {
867
- var type = typeof value;
868
- return !!value && (type == "object" || type == "function");
869
- }
870
- function isObjectLike2(value) {
871
- return !!value && typeof value == "object";
872
- }
873
- function stubFalse() {
874
- return false;
875
- }
876
- module.exports = isEmpty2;
877
- })(lodash_isempty$1, lodash_isempty$1.exports);
878
- var lodash_isempty = lodash_isempty$1.exports;
879
- var isEmptyImport = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ _mergeNamespaces({
880
- __proto__: null,
881
- [Symbol.toStringTag]: "Module",
882
- "default": lodash_isempty
883
- }, [lodash_isempty$1.exports]));
884
- const isNil = lodash_isnil || isNilImport;
885
- const isEmpty$1 = lodash_isempty || isEmptyImport;
886
- function getPath(object, path, defaultValue, allOptional = false) {
887
- if (isEmpty$1(path)) {
888
- return object;
889
- }
890
- let value = object;
891
- for (const crumb of crumblePath(path)) {
892
- let key = crumb;
893
- let optional;
894
- if (typeof crumb === "string") {
895
- [
896
- ,
897
- key,
898
- optional
899
- ] = /^([^?]+)(\?)?$/.exec(crumb);
900
- }
901
- value = value[key];
902
- if (isNil(value) && (optional || allOptional)) {
903
- return defaultValue;
904
- }
905
- }
906
- return isNil(value) ? defaultValue : value;
907
- }
908
- function omit(obj, ...keys) {
909
- const keySet = new Set(keys);
910
- const result = {};
911
- for (const k of Object.keys(obj)) {
912
- if (!keySet.has(k)) {
913
- result[k] = obj[k];
914
- }
915
- }
916
- return result;
917
- }
918
- const isEmpty = lodash_isempty || isEmptyImport;
919
- function setPath(object, path, newValue) {
920
- if (typeof object !== "object") {
676
+ function ve(a) {
677
+ return Ae(a) && T.call(a, "callee") && (!V.call(a, "callee") || v.call(a) == r);
678
+ }
679
+ var Ie = Array.isArray;
680
+ function _(a) {
681
+ return a != null && Te(a.length) && !G(a);
682
+ }
683
+ function Ae(a) {
684
+ return Ee(a) && _(a);
685
+ }
686
+ var Oe = ue || we;
687
+ function Pe(a) {
688
+ if (_(a) && (Ie(a) || typeof a == "string" || typeof a.splice == "function" || Oe(a) || ve(a)))
689
+ return !a.length;
690
+ var s = y(a);
691
+ if (s == c || s == u)
692
+ return !a.size;
693
+ if (fe || Ce(a))
694
+ return !le(a).length;
695
+ for (var l in a)
696
+ if (T.call(a, l))
697
+ return !1;
698
+ return !0;
699
+ }
700
+ function G(a) {
701
+ var s = $(a) ? v.call(a) : "";
702
+ return s == o || s == i;
703
+ }
704
+ function Te(a) {
705
+ return typeof a == "number" && a > -1 && a % 1 == 0 && a <= n;
706
+ }
707
+ function $(a) {
708
+ var s = typeof a;
709
+ return !!a && (s == "object" || s == "function");
710
+ }
711
+ function Ee(a) {
712
+ return !!a && typeof a == "object";
713
+ }
714
+ function we() {
715
+ return !1;
716
+ }
717
+ e.exports = Pe;
718
+ })(A, A.exports);
719
+ var tt = A.exports;
720
+ const Y = /* @__PURE__ */ F(tt);
721
+ function H(e, t, n, r = !1) {
722
+ if (Y(t))
723
+ return e;
724
+ let o = e;
725
+ for (const i of k(t)) {
726
+ let c = i, m;
727
+ if (typeof i == "string" && ([
728
+ ,
729
+ c,
730
+ m
731
+ ] = /^([^?]+)(\?)?$/.exec(i)), o = o[c], z(o) && (m || r))
732
+ return n;
733
+ }
734
+ return z(o) ? n : o;
735
+ }
736
+ function pt(e, ...t) {
737
+ const n = new Set(t), r = {};
738
+ for (const o of Object.keys(e))
739
+ n.has(o) || (r[o] = e[o]);
740
+ return r;
741
+ }
742
+ function gt(e, t, n) {
743
+ if (typeof e != "object")
921
744
  throw new Error("object is required");
922
- }
923
- if (isEmpty(path)) {
745
+ if (Y(t))
924
746
  throw new Error("path is required");
925
- }
926
- const crumbs = crumblePath(path);
927
- const finalCrumb = crumbs.splice(crumbs.length - 1, 1)[0];
928
- let current = object;
929
- for (const crumb of crumbs) {
930
- current = current[crumb];
931
- if (typeof current !== "object") {
932
- throw new Error(`Cannot set value at given path: Path deadends at ${String(crumb)}`);
933
- }
934
- }
935
- current[finalCrumb] = newValue;
936
- }
937
- function* traversePath(object, path) {
938
- yield object;
939
- let obj = object;
940
- for (const crumb of crumblePath(path)) {
941
- obj = obj[crumb];
942
- yield obj;
943
- }
944
- }
945
- function mergeDeep(...objectsToMerge) {
946
- const result = {};
947
- for (const mergee of objectsToMerge) {
948
- for (const key of Object.keys(mergee)) {
949
- if (Object.prototype.hasOwnProperty.call(result, key) && Object.getOwnPropertyDescriptor(result, key).writable && lodash_isplainobject(result[key])) {
950
- result[key] = mergeDeep(result[key], mergee[key]);
951
- } else if (lodash_isplainobject(mergee[key])) {
952
- result[key] = mergeDeep({}, mergee[key]);
953
- } else {
954
- result[key] = mergee[key];
955
- }
956
- }
957
- }
958
- return result;
959
- }
960
- function mergePropertiesDeep(...objectsToMerge) {
961
- const result = {};
962
- for (const mergee of objectsToMerge) {
963
- for (const key of Object.keys(mergee)) {
964
- if (Object.prototype.hasOwnProperty.call(result, key) && Object.getOwnPropertyDescriptor(result, key).writable && lodash_isplainobject(result[key])) {
965
- result[key] = mergePropertiesDeep(result[key], mergee[key]);
966
- } else if (lodash_isplainobject(mergee[key])) {
967
- result[key] = mergePropertiesDeep({}, mergee[key]);
968
- } else {
969
- copyProperty(key, mergee, result);
970
- }
971
- }
972
- }
973
- return result;
974
- }
975
- function values(object) {
976
- const vals = [];
977
- for (const key of Object.keys(object)) {
978
- vals.push(object[key]);
979
- }
980
- return vals;
981
- }
982
- function code(strings, ...interpolations) {
983
- const s = strings.reduce((a, b, i) => `${a}${i <= interpolations.length ? String(interpolations[i - 1]) : ""}${b}`);
984
- const leadingWhitespace = Math.min(...s.split(/[\r\n]/).filter((l) => l.trim()).map((l) => /^ */.exec(l)[0].length));
985
- return s.replace(new RegExp(`^ {${leadingWhitespace}}`, "gm"), "").trim();
986
- }
987
- function parseFileSize(fileSize) {
988
- const unitMatch = /[A-Z]?B$/.exec(fileSize);
989
- if (!unitMatch) {
990
- throw new Error(`Input to parseFileSize ("${fileSize}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`);
991
- }
992
- const [unit] = unitMatch;
993
- const num = Number(fileSize.replace(unit, ""));
994
- if (Number.isNaN(num)) {
995
- throw new Error(`Could not parse a number out of input to parseFileSize ("${fileSize}")`);
996
- }
997
- const magnitude = [
747
+ const r = k(t), o = r.splice(r.length - 1, 1)[0];
748
+ let i = e;
749
+ for (const c of r)
750
+ if (i = i[c], typeof i != "object")
751
+ throw new Error(`Cannot set value at given path: Path deadends at ${String(c)}`);
752
+ i[o] = n;
753
+ }
754
+ function* yt(e, t) {
755
+ yield e;
756
+ let n = e;
757
+ for (const r of k(t))
758
+ n = n[r], yield n;
759
+ }
760
+ function K(...e) {
761
+ const t = {};
762
+ for (const n of e)
763
+ for (const r of Object.keys(n))
764
+ Object.prototype.hasOwnProperty.call(t, r) && Object.getOwnPropertyDescriptor(t, r).writable && f(t[r]) ? t[r] = K(t[r], n[r]) : f(n[r]) ? t[r] = K({}, n[r]) : t[r] = n[r];
765
+ return t;
766
+ }
767
+ function X(...e) {
768
+ const t = {};
769
+ for (const n of e)
770
+ for (const r of Object.keys(n))
771
+ Object.prototype.hasOwnProperty.call(t, r) && Object.getOwnPropertyDescriptor(t, r).writable && f(t[r]) ? t[r] = X(t[r], n[r]) : f(n[r]) ? t[r] = X({}, n[r]) : Le(r, n, t);
772
+ return t;
773
+ }
774
+ function Rt(e) {
775
+ const t = [];
776
+ for (const n of Object.keys(e))
777
+ t.push(e[n]);
778
+ return t;
779
+ }
780
+ function ht(e, ...t) {
781
+ const n = e.reduce((o, i, c) => `${o}${c <= t.length ? String(t[c - 1]) : ""}${i}`), r = Math.min(
782
+ ...n.split(/[\r\n]/).filter((o) => o.trim()).map((o) => /^ */.exec(o)[0].length)
783
+ );
784
+ return n.replace(new RegExp(`^ {${r}}`, "gm"), "").trim();
785
+ }
786
+ function St(e) {
787
+ const t = /[A-Z]?B$/.exec(e);
788
+ if (!t)
789
+ throw new Error(
790
+ `Input to parseFileSize ("${e}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`
791
+ );
792
+ const [n] = t, r = Number(e.replace(n, ""));
793
+ if (Number.isNaN(r))
794
+ throw new Error(`Could not parse a number out of input to parseFileSize ("${e}")`);
795
+ const o = [
998
796
  "B",
999
797
  "KB",
1000
798
  "MB",
1001
799
  "GB",
1002
800
  "TB",
1003
801
  "PB"
1004
- ].indexOf(unit);
1005
- if (magnitude === -1) {
802
+ ].indexOf(n);
803
+ if (o === -1)
1006
804
  throw new Error("parseFileSize does not support units above PB");
1007
- }
1008
- return Math.ceil(num * 1024 ** magnitude);
1009
- }
1010
- const REGEX_REPLACEMENT = /(<%=|{{)(.+?)(%>|}})/g;
1011
- const REGEX_IF = /<%\?(.+?)%>(.+?)<\/%>/g;
1012
- const SYMBOL_TEMPLATE_SOURCE = Symbol("sps.utils.templateSrc");
1013
- function template(string) {
1014
- const fn = (data) => string.replace(REGEX_IF, (match, pathToCheck, content) => getPath(data, pathToCheck.trim()) ? content : "").replace(REGEX_REPLACEMENT, (match, _, pathToInterpolate) => getPath(data, pathToInterpolate.trim(), ""));
1015
- fn[SYMBOL_TEMPLATE_SOURCE] = string;
1016
- return fn;
1017
- }
1018
- function isTemplate(x) {
1019
- return typeof x === "string" && (REGEX_REPLACEMENT.test(x) || REGEX_IF.test(x));
1020
- }
1021
- function isTemplateFn(x) {
1022
- return typeof x === "function" && Object.prototype.hasOwnProperty.call(x, SYMBOL_TEMPLATE_SOURCE);
1023
- }
1024
- export { CustomEvent, DiffChange, EDI_DOCUMENT_TYPE, Op, castToNumber, code, constrain, copyProperty, crumblePath, debounce, debounced, decimalRound, deepFreeze, diff, flatten, forEachEntryDeep, forEachNestedObject, getPath, isSubset, isTemplate, isTemplateFn, lockToAnimationFrames, lockedToAnimationFrames, mergeDeep, mergePropertiesDeep, omit, onNextTick, parseFileSize, range, setPath, simpleMetadataDecoratorApplicator, template, tickDelay, toFileSizeString, traversePath, values };
805
+ return Math.ceil(r * 1024 ** o);
806
+ }
807
+ const Z = /(<%=|{{)(.+?)(%>|}})/g, ee = /<%\?(.+?)%>(.+?)<\/%>/g, te = Symbol("sps.utils.templateSrc");
808
+ function bt(e) {
809
+ const t = (n) => e.replace(ee, (r, o, i) => H(n, o.trim()) ? i : "").replace(Z, (r, o, i) => H(n, i.trim(), ""));
810
+ return t[te] = e, t;
811
+ }
812
+ function Ct(e) {
813
+ return typeof e == "string" && (Z.test(e) || ee.test(e));
814
+ }
815
+ function vt(e) {
816
+ return typeof e == "function" && Object.prototype.hasOwnProperty.call(e, te);
817
+ }
818
+ export {
819
+ ot as CustomEvent,
820
+ Xe as DiffChange,
821
+ it as EDI_DOCUMENT_TYPE,
822
+ W as Op,
823
+ ct as castToNumber,
824
+ ht as code,
825
+ ft as constrain,
826
+ Le as copyProperty,
827
+ k as crumblePath,
828
+ De as debounce,
829
+ st as debounced,
830
+ Ne as decimalRound,
831
+ Ke as deepFreeze,
832
+ Je as diff,
833
+ Me as flatten,
834
+ Qe as forEachEntryDeep,
835
+ Ye as forEachNestedObject,
836
+ H as getPath,
837
+ nt as isSubset,
838
+ Ct as isTemplate,
839
+ vt as isTemplateFn,
840
+ Fe as lockToAnimationFrames,
841
+ mt as lockedToAnimationFrames,
842
+ K as mergeDeep,
843
+ X as mergePropertiesDeep,
844
+ pt as omit,
845
+ rt as onNextTick,
846
+ St as parseFileSize,
847
+ at as range,
848
+ gt as setPath,
849
+ ut as simpleMetadataDecoratorApplicator,
850
+ bt as template,
851
+ lt as tickDelay,
852
+ dt as toFileSizeString,
853
+ yt as traversePath,
854
+ Rt as values
855
+ };