@ganwei-web/gw-base-components-plus 1.0.26 → 1.0.28

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.
@@ -5,7 +5,7 @@ function $e(n, e) {
5
5
  let t = Object.keys(n);
6
6
  if (Object.getOwnPropertySymbols) {
7
7
  let i = Object.getOwnPropertySymbols(n);
8
- e && (i = i.filter(function(s) {
8
+ e && (i = i.filter(function (s) {
9
9
  return Object.getOwnPropertyDescriptor(n, s).enumerable;
10
10
  })), t.push.apply(t, i);
11
11
  }
@@ -14,9 +14,9 @@ function $e(n, e) {
14
14
  function te(n) {
15
15
  for (let e = 1; e < arguments.length; e++) {
16
16
  var t = arguments[e] != null ? arguments[e] : {};
17
- e % 2 ? $e(Object(t), !0).forEach(function(i) {
17
+ e % 2 ? $e(Object(t), !0).forEach(function (i) {
18
18
  bt(n, i, t[i]);
19
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : $e(Object(t)).forEach(function(i) {
19
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : $e(Object(t)).forEach(function (i) {
20
20
  Object.defineProperty(n, i, Object.getOwnPropertyDescriptor(t, i));
21
21
  });
22
22
  }
@@ -77,56 +77,56 @@ let P = {
77
77
  INIT: "INIT",
78
78
  FIXED: "FIXED",
79
79
  DYNAMIC: "DYNAMIC"
80
- }, Re = 2, Ct = /* @__PURE__ */ (function() {
80
+ }, Re = 2, Ct = /* @__PURE__ */ (function () {
81
81
  function n(e, t) {
82
82
  ft(this, n), this.init(e, t);
83
83
  }
84
84
  return gt(n, [{
85
85
  key: "init",
86
- value: function(t, i) {
86
+ value: function (t, i) {
87
87
  this.param = t, this.callUpdate = i, this.sizes = /* @__PURE__ */ new Map(), this.firstRangeTotalSize = 0, this.firstRangeAverageSize = 0, this.lastCalcIndex = 0, this.fixedSizeValue = 0, this.calcType = I.INIT, this.offset = 0, this.direction = "", this.range = /* @__PURE__ */ Object.create(null), t && this.checkRange(0, t.keeps - 1);
88
88
  }
89
89
  }, {
90
90
  key: "destroy",
91
- value: function() {
91
+ value: function () {
92
92
  this.init(null, null);
93
93
  }
94
94
  // return current render range
95
95
  }, {
96
96
  key: "getRange",
97
- value: function() {
97
+ value: function () {
98
98
  let t = /* @__PURE__ */ Object.create(null);
99
99
  return t.start = this.range.start, t.end = this.range.end, t.padFront = this.range.padFront, t.padBehind = this.range.padBehind, t;
100
100
  }
101
101
  }, {
102
102
  key: "isBehind",
103
- value: function() {
103
+ value: function () {
104
104
  return this.direction === P.BEHIND;
105
105
  }
106
106
  }, {
107
107
  key: "isFront",
108
- value: function() {
108
+ value: function () {
109
109
  return this.direction === P.FRONT;
110
110
  }
111
111
  // return start index offset
112
112
  }, {
113
113
  key: "getOffset",
114
- value: function(t) {
114
+ value: function (t) {
115
115
  return (t < 1 ? 0 : this.getIndexOffset(t)) + this.param.slotHeaderSize;
116
116
  }
117
117
  }, {
118
118
  key: "updateParam",
119
- value: function(t, i) {
119
+ value: function (t, i) {
120
120
  let s = this;
121
- this.param && t in this.param && (t === "uniqueIds" && this.sizes.forEach(function(r, a) {
121
+ this.param && t in this.param && (t === "uniqueIds" && this.sizes.forEach(function (r, a) {
122
122
  i.includes(a) || s.sizes.delete(a);
123
123
  }), this.param[t] = i);
124
124
  }
125
125
  // save each size map by id
126
126
  }, {
127
127
  key: "saveSize",
128
- value: function(t, i) {
129
- this.sizes.set(t, i), this.calcType === I.INIT ? (this.fixedSizeValue = i, this.calcType = I.FIXED) : this.calcType === I.FIXED && this.fixedSizeValue !== i && (this.calcType = I.DYNAMIC, delete this.fixedSizeValue), this.calcType !== I.FIXED && typeof this.firstRangeTotalSize < "u" && (this.sizes.size < Math.min(this.param.keeps, this.param.uniqueIds.length) ? (this.firstRangeTotalSize = wt(this.sizes.values()).reduce(function(s, r) {
128
+ value: function (t, i) {
129
+ this.sizes.set(t, i), this.calcType === I.INIT ? (this.fixedSizeValue = i, this.calcType = I.FIXED) : this.calcType === I.FIXED && this.fixedSizeValue !== i && (this.calcType = I.DYNAMIC, delete this.fixedSizeValue), this.calcType !== I.FIXED && typeof this.firstRangeTotalSize < "u" && (this.sizes.size < Math.min(this.param.keeps, this.param.uniqueIds.length) ? (this.firstRangeTotalSize = wt(this.sizes.values()).reduce(function (s, r) {
130
130
  return s + r;
131
131
  }, 0), this.firstRangeAverageSize = Math.round(this.firstRangeTotalSize / this.sizes.size)) : delete this.firstRangeTotalSize);
132
132
  }
@@ -134,26 +134,26 @@ let P = {
134
134
  // try goiong to render next range by a leading buffer according to current direction
135
135
  }, {
136
136
  key: "handleDataSourcesChange",
137
- value: function() {
137
+ value: function () {
138
138
  let t = this.range.start;
139
139
  this.isFront() ? t = t - Re : this.isBehind() && (t = t + Re), t = Math.max(t, 0), this.updateRange(this.range.start, this.getEndByStart(t));
140
140
  }
141
141
  // when slot size change, we also need force update
142
142
  }, {
143
143
  key: "handleSlotSizeChange",
144
- value: function() {
144
+ value: function () {
145
145
  this.handleDataSourcesChange();
146
146
  }
147
147
  // calculating range on scroll
148
148
  }, {
149
149
  key: "handleScroll",
150
- value: function(t) {
150
+ value: function (t) {
151
151
  this.direction = t < this.offset ? P.FRONT : P.BEHIND, this.offset = t, this.param && (this.direction === P.FRONT ? this.handleFront() : this.direction === P.BEHIND && this.handleBehind());
152
152
  }
153
153
  // ----------- public method end -----------
154
154
  }, {
155
155
  key: "handleFront",
156
- value: function() {
156
+ value: function () {
157
157
  let t = this.getScrollOvers();
158
158
  if (!(t > this.range.start)) {
159
159
  let i = Math.max(t - this.param.buffer, 0);
@@ -162,14 +162,14 @@ let P = {
162
162
  }
163
163
  }, {
164
164
  key: "handleBehind",
165
- value: function() {
165
+ value: function () {
166
166
  let t = this.getScrollOvers();
167
167
  t < this.range.start + this.param.buffer || this.checkRange(t, this.getEndByStart(t));
168
168
  }
169
169
  // return the pass overs according to current scroll offset
170
170
  }, {
171
171
  key: "getScrollOvers",
172
- value: function() {
172
+ value: function () {
173
173
  let t = this.offset - this.param.slotHeaderSize;
174
174
  if (t <= 0) { return 0; }
175
175
  if (this.isFixedType()) { return Math.floor(t / this.fixedSizeValue); }
@@ -183,7 +183,7 @@ let P = {
183
183
  // although the call frequency is very high, its only a superposition of numbers
184
184
  }, {
185
185
  key: "getIndexOffset",
186
- value: function(t) {
186
+ value: function (t) {
187
187
  if (!t) { return 0; }
188
188
  for (var i = 0, s = 0, r = 0; r < t; r++) { s = this.sizes.get(this.param.uniqueIds[r]), i = i + (typeof s == "number" ? s : this.getEstimateSize()); }
189
189
  return this.lastCalcIndex = Math.max(this.lastCalcIndex, t - 1), this.lastCalcIndex = Math.min(this.lastCalcIndex, this.getLastIndex()), i;
@@ -191,53 +191,53 @@ let P = {
191
191
  // is fixed size type
192
192
  }, {
193
193
  key: "isFixedType",
194
- value: function() {
194
+ value: function () {
195
195
  return this.calcType === I.FIXED;
196
196
  }
197
197
  // return the real last index
198
198
  }, {
199
199
  key: "getLastIndex",
200
- value: function() {
200
+ value: function () {
201
201
  return this.param.uniqueIds.length - 1;
202
202
  }
203
203
  // in some conditions range is broke, we need correct it
204
204
  // and then decide whether need update to next range
205
205
  }, {
206
206
  key: "checkRange",
207
- value: function(t, i) {
207
+ value: function (t, i) {
208
208
  let s = this.param.keeps, r = this.param.uniqueIds.length;
209
209
  r <= s ? (t = 0, i = this.getLastIndex()) : i - t < s - 1 && (t = i - s + 1), this.range.start !== t && this.updateRange(t, i);
210
210
  }
211
211
  // setting to a new range and rerender
212
212
  }, {
213
213
  key: "updateRange",
214
- value: function(t, i) {
214
+ value: function (t, i) {
215
215
  this.range.start = t, this.range.end = i, this.range.padFront = this.getPadFront(), this.range.padBehind = this.getPadBehind(), this.callUpdate(this.getRange());
216
216
  }
217
217
  // return end base on start
218
218
  }, {
219
219
  key: "getEndByStart",
220
- value: function(t) {
220
+ value: function (t) {
221
221
  let i = t + this.param.keeps - 1, s = Math.min(i, this.getLastIndex());
222
222
  return s;
223
223
  }
224
224
  // return total front offset
225
225
  }, {
226
226
  key: "getPadFront",
227
- value: function() {
227
+ value: function () {
228
228
  return this.isFixedType() ? this.fixedSizeValue * this.range.start : this.getIndexOffset(this.range.start);
229
229
  }
230
230
  // return total behind offset
231
231
  }, {
232
232
  key: "getPadBehind",
233
- value: function() {
233
+ value: function () {
234
234
  let t = this.range.end, i = this.getLastIndex();
235
235
  return this.isFixedType() ? (i - t) * this.fixedSizeValue : this.lastCalcIndex === i ? this.getIndexOffset(i) - this.getIndexOffset(t) : (i - t) * this.getEstimateSize();
236
236
  }
237
237
  // get the item estimate size
238
238
  }, {
239
239
  key: "getEstimateSize",
240
- value: function() {
240
+ value: function () {
241
241
  return this.isFixedType() ? this.fixedSizeValue : this.firstRangeAverageSize || this.param.estimateSize;
242
242
  }
243
243
  }]), n;
@@ -249,7 +249,7 @@ let P = {
249
249
  dataSources: {
250
250
  type: Array,
251
251
  required: !0,
252
- default: function() {
252
+ default: function () {
253
253
  return [];
254
254
  }
255
255
  },
@@ -388,31 +388,31 @@ let P = {
388
388
  horizontal: {
389
389
  type: Boolean
390
390
  }
391
- }, Xe = function(e, t, i) {
392
- let s = null, r = lt(function() {
391
+ }, Xe = function (e, t, i) {
392
+ let s = null, r = lt(function () {
393
393
  return e.horizontal ? "offsetWidth" : "offsetHeight";
394
- }), a = function() {
394
+ }), a = function () {
395
395
  return t.value ? t.value[r.value] : 0;
396
- }, c = function() {
396
+ }, c = function () {
397
397
  let o = e.event, l = e.uniqueKey, d = e.hasInitial;
398
398
  i(o, l, a(), d);
399
399
  };
400
- Ve(function() {
401
- typeof ResizeObserver < "u" && (s = new ResizeObserver(function() {
400
+ Ve(function () {
401
+ typeof ResizeObserver < "u" && (s = new ResizeObserver(function () {
402
402
  c();
403
403
  }), t.value && s.observe(t.value));
404
- }), ht(function() {
404
+ }), ht(function () {
405
405
  c();
406
- }), Je(function() {
406
+ }), Je(function () {
407
407
  s && (s.disconnect(), s = null);
408
408
  });
409
409
  }, Tt = qe({
410
410
  name: "VirtualListItem",
411
411
  props: Et,
412
412
  emits: ["itemResize"],
413
- setup: function(e, t) {
413
+ setup: function (e, t) {
414
414
  let i = t.emit, s = W(null);
415
- return Xe(e, s, i), function() {
415
+ return Xe(e, s, i), function () {
416
416
  let r = e.tag, a = e.component, c = e.extraProps, u = c === void 0 ? {} : c, o = e.index, l = e.source, d = e.scopedSlots, f = d === void 0 ? {} : d, z = e.uniqueKey, B = te(te({}, u), {}, {
417
417
  source: l,
418
418
  index: o
@@ -421,7 +421,7 @@ let P = {
421
421
  key: z,
422
422
  ref: s
423
423
  }, {
424
- default: function() {
424
+ default: function () {
425
425
  return [C(a, te(te({}, B), {}, {
426
426
  scopedSlots: f
427
427
  }), null)];
@@ -433,73 +433,73 @@ let P = {
433
433
  name: "VirtualListSlot",
434
434
  props: qt,
435
435
  emits: ["slotResize"],
436
- setup: function(e, t) {
436
+ setup: function (e, t) {
437
437
  let i = t.slots, s = t.emit, r = W(null);
438
- return Xe(e, r, s), function() {
438
+ return Xe(e, r, s), function () {
439
439
  let a, c = e.tag, u = e.uniqueKey;
440
440
  return C(c, {
441
441
  ref: r,
442
442
  key: u
443
443
  }, {
444
- default: function() {
444
+ default: function () {
445
445
  return [(a = i.default) === null || a === void 0 ? void 0 : a.call(i)];
446
446
  }
447
447
  });
448
448
  };
449
449
  }
450
450
  }), V;
451
- (function(n) {
451
+ (function (n) {
452
452
  n.ITEM = "itemResize", n.SLOT = "slotResize";
453
453
  })(V || (V = {}));
454
454
  let $;
455
- (function(n) {
455
+ (function (n) {
456
456
  n.HEADER = "thead", n.FOOTER = "tfoot";
457
457
  })($ || ($ = {}));
458
458
  let Ot = qe({
459
459
  name: "VirtualList",
460
460
  props: kt,
461
- setup: function(e, t) {
461
+ setup: function (e, t) {
462
462
  let i = t.emit, s = t.slots, r = t.expose, a = e.direction === "horizontal", c = a ? "scrollLeft" : "scrollTop", u = W(null), o = W(), l = W(null), d;
463
- ee(function() {
463
+ ee(function () {
464
464
  return e.dataSources.length;
465
- }, function() {
465
+ }, function () {
466
466
  d.updateParam("uniqueIds", Me()), d.handleDataSourcesChange();
467
- }), ee(function() {
467
+ }), ee(function () {
468
468
  return e.keeps;
469
- }, function(g) {
469
+ }, function (g) {
470
470
  d.updateParam("keeps", g), d.handleSlotSizeChange();
471
- }), ee(function() {
471
+ }), ee(function () {
472
472
  return e.start;
473
- }, function(g) {
473
+ }, function (g) {
474
474
  he(g);
475
- }), ee(function() {
475
+ }), ee(function () {
476
476
  return e.offset;
477
- }, function(g) {
477
+ }, function (g) {
478
478
  return j(g);
479
479
  });
480
- var f = function(p) {
480
+ var f = function (p) {
481
481
  return d.sizes.get(p);
482
- }, z = function() {
482
+ }, z = function () {
483
483
  return e.pageMode ? document.documentElement[c] || document.body[c] : o.value ? Math.ceil(o.value[c]) : 0;
484
- }, B = function() {
484
+ }, B = function () {
485
485
  let p = a ? "clientWidth" : "clientHeight";
486
486
  return e.pageMode ? document.documentElement[p] || document.body[p] : o.value ? Math.ceil(o.value[p]) : 0;
487
- }, Y = function() {
487
+ }, Y = function () {
488
488
  let p = a ? "scrollWidth" : "scrollHeight";
489
489
  return e.pageMode ? document.documentElement[p] || document.body[p] : o.value ? Math.ceil(o.value[p]) : 0;
490
- }, tt = function(p, b, m, k) {
490
+ }, tt = function (p, b, m, k) {
491
491
  i("scroll", k, d.getRange()), d.isFront() && e.dataSources.length && p - e.topThreshold <= 0 ? i("totop") : d.isBehind() && p + b + e.bottomThreshold >= m && i("tobottom");
492
- }, le = function(p) {
492
+ }, le = function (p) {
493
493
  let b = z(), m = B(), k = Y();
494
494
  b < 0 || b + m > k + 1 || !k || (d.handleScroll(b), tt(b, m, k, p));
495
- }, Me = function() {
495
+ }, Me = function () {
496
496
  let p = e.dataKey, b = e.dataSources, m = b === void 0 ? [] : b;
497
- return m.map(function(k) {
497
+ return m.map(function (k) {
498
498
  return typeof p == "function" ? p(k) : k[p];
499
499
  });
500
- }, it = function(p) {
500
+ }, it = function (p) {
501
501
  u.value = p;
502
- }, nt = function() {
502
+ }, nt = function () {
503
503
  d = new Ct({
504
504
  slotHeaderSize: 0,
505
505
  slotFooterSize: 0,
@@ -509,14 +509,14 @@ let Ot = qe({
509
509
  // recommend for a third of keeps
510
510
  uniqueIds: Me()
511
511
  }, it), u.value = d.getRange();
512
- }, he = function(p) {
512
+ }, he = function (p) {
513
513
  if (p >= e.dataSources.length - 1) { je(); } else {
514
514
  let b = d.getOffset(p);
515
515
  j(b);
516
516
  }
517
- }, j = function(p) {
517
+ }, j = function (p) {
518
518
  e.pageMode ? (document.body[c] = p, document.documentElement[c] = p) : o.value && (o.value[c] = p);
519
- }, rt = function() {
519
+ }, rt = function () {
520
520
  for (var p = [], b = u.value, m = b.start, k = b.end, de = e.dataSources, _ = e.dataKey, pe = e.itemClass, fe = e.itemTag, ge = e.itemStyle, be = e.extraProps, Q = e.dataComponent, Z = e.itemScopedSlots, q = m; q <= k; q++) {
521
521
  let N = de[q];
522
522
  if (N) {
@@ -538,34 +538,34 @@ let Ot = qe({
538
538
  } else { console.warn("Cannot get the index '".concat(q, "' from data-sources.")); }
539
539
  }
540
540
  return p;
541
- }, st = function(p, b) {
541
+ }, st = function (p, b) {
542
542
  d.saveSize(p, b), i("resized", p, b);
543
- }, xe = function(p, b, m) {
543
+ }, xe = function (p, b, m) {
544
544
  p === $.HEADER ? d.updateParam("slotHeaderSize", b) : p === $.FOOTER && d.updateParam("slotFooterSize", b), m && d.handleSlotSizeChange();
545
545
  }, je = function g() {
546
546
  if (l.value) {
547
547
  let p = l.value[a ? "offsetLeft" : "offsetTop"];
548
- j(p), setTimeout(function() {
548
+ j(p), setTimeout(function () {
549
549
  z() + B() < Y() && g();
550
550
  }, 3);
551
551
  }
552
- }, ot = function() {
552
+ }, ot = function () {
553
553
  if (o.value) {
554
554
  let p = o.value.getBoundingClientRect(), b = o.value.ownerDocument.defaultView, m = a ? p.left + b.pageXOffset : p.top + b.pageYOffset;
555
555
  d.updateParam("slotHeaderSize", m);
556
556
  }
557
- }, at = function() {
557
+ }, at = function () {
558
558
  return d.sizes.size;
559
559
  };
560
- return ut(function() {
560
+ return ut(function () {
561
561
  nt();
562
- }), ct(function() {
562
+ }), ct(function () {
563
563
  j(d.offset);
564
- }), Ve(function() {
564
+ }), Ve(function () {
565
565
  e.start ? he(e.start) : e.offset && j(e.offset), e.pageMode && (ot(), document.addEventListener("scroll", le, {
566
566
  passive: !1
567
567
  }));
568
- }), Je(function() {
568
+ }), Je(function () {
569
569
  d.destroy(), e.pageMode && document.removeEventListener("scroll", le);
570
570
  }), r({
571
571
  scrollToBottom: je,
@@ -576,7 +576,7 @@ let Ot = qe({
576
576
  getClientSize: B,
577
577
  scrollToOffset: j,
578
578
  scrollToIndex: he
579
- }), function() {
579
+ }), function () {
580
580
  let g = e.pageMode, p = e.rootTag, b = e.wrapTag, m = e.wrapClass, k = e.wrapStyle, de = e.headerTag, _ = e.headerClass, pe = e.headerStyle, fe = e.footerTag, ge = e.footerClass, be = e.footerStyle, Q = u.value, Z = Q.padFront, q = Q.padBehind, N = {
581
581
  padding: a ? "0px ".concat(q, "px 0px ").concat(Z, "px") : "".concat(Z, "px 0px ").concat(q, "px")
582
582
  }, D = k ? Object.assign({}, k, N) : N, _e = s.header, Ge = s.footer;
@@ -584,7 +584,7 @@ let Ot = qe({
584
584
  ref: o,
585
585
  onScroll: !g && le
586
586
  }, {
587
- default: function() {
587
+ default: function () {
588
588
  return [_e && C(ze, {
589
589
  class: _,
590
590
  style: pe,
@@ -593,14 +593,14 @@ let Ot = qe({
593
593
  uniqueKey: $.HEADER,
594
594
  onSlotResize: xe
595
595
  }, {
596
- default: function() {
596
+ default: function () {
597
597
  return [_e()];
598
598
  }
599
599
  }), C(b, {
600
600
  class: m,
601
601
  style: D
602
602
  }, {
603
- default: function() {
603
+ default: function () {
604
604
  return [rt()];
605
605
  }
606
606
  }), Ge && C(ze, {
@@ -611,7 +611,7 @@ let Ot = qe({
611
611
  uniqueKey: $.FOOTER,
612
612
  onSlotResize: xe
613
613
  }, {
614
- default: function() {
614
+ default: function () {
615
615
  return [Ge()];
616
616
  }
617
617
  }), C("div", {
@@ -664,11 +664,11 @@ class Nt {
664
664
  }
665
665
  class ae {
666
666
  constructor() {
667
- this.window = window;
667
+ window = window;
668
668
  try {
669
- window.top.equipGroup, this.window = window.top;
669
+ window.top.equipGroup, window = window.top;
670
670
  } catch {
671
- this.window = window;
671
+ window = window;
672
672
  }
673
673
  }
674
674
  }
@@ -679,11 +679,11 @@ const Ye = {
679
679
  };
680
680
  },
681
681
  created() {
682
- this.window = window;
682
+ window = window;
683
683
  try {
684
- window.top.equipGroup, this.window = window.top;
684
+ window.top.equipGroup, window = window.top;
685
685
  } catch {
686
- this.window = window;
686
+ window = window;
687
687
  }
688
688
  }
689
689
  };
@@ -726,7 +726,7 @@ class It extends ae {
726
726
  const c = `${a}-${r}`;
727
727
  this.setEquipCheckObject(c, !0, !1, a), this.setCheckStatus(c, !0, !1), this.updateExpandControlCheckStatus(a, r);
728
728
  } else {
729
- const c = this.window.equipCache && this.window.equipCache[r];
729
+ const c = window.equipCache && window.equipCache[r];
730
730
  c && (c.groupIds || (c.groupId ? [c.groupId] : [])).forEach((o) => {
731
731
  const l = `${o}-${r}`;
732
732
  this.setEquipCheckObject(l, !0, !1, o), this.setCheckStatus(l, !0, !1), this.updateExpandControlCheckStatus(o, r);
@@ -754,7 +754,7 @@ class It extends ae {
754
754
  r = o[0], a = o[1], c = null;
755
755
  }
756
756
  this.equipControllObject[r] || (this.equipControllObject[r] = []), this.equipControllObject[r].push(Number(a));
757
- const u = this.window.equipCache && this.window.equipCache[r];
757
+ const u = window.equipCache && window.equipCache[r];
758
758
  u && (c != null ? [c] : u.groupIds || (u.groupId ? [u.groupId] : [])).forEach((l) => {
759
759
  const d = `${l}-${r}`, f = `${l}-${r}-${a}`;
760
760
  this.nodesMap[f] && this.setCheckStatus(f, !0, !1), this.nodesMap[d] && this.setCheckStatus(d, !1, !0), this.setEquipCheckObject(d, !1, !0, l);
@@ -783,7 +783,7 @@ class It extends ae {
783
783
  computeGroupStatus(e) {
784
784
  const t = this.groupNodeObject[e];
785
785
  if (!t) { return { checked: !1, indeterminate: !1, selectCount: 0 }; }
786
- const i = this.isSearchStatus ? this.window[`group-${e}-search`] || [] : this.window[`group-${e}${this.aliasName}`] || [];
786
+ const i = this.isSearchStatus ? window[`group-${e}-search`] || [] : window[`group-${e}${this.aliasName}`] || [];
787
787
  let s = 0;
788
788
  i.forEach((d) => {
789
789
  const f = `${e}-${d.equipNo}`;
@@ -812,19 +812,19 @@ class It extends ae {
812
812
  const [t, i] = e.split("-");
813
813
  let s = this.nodesMap[e];
814
814
  if (s) {
815
- if (s.checked) {
815
+ if (s.checked) {
816
816
  let r = s.settings;
817
817
  this.setControlStatus(r, t, i, !0);
818
818
  } else if (!s.checked && !s.indeterminate) {
819
819
  let r = s.settings;
820
820
  this.setControlStatus(r, t, i, !1);
821
821
  } else {
822
- this.equipControllObject[i] && this.equipControllObject[i].forEach((r) => {
822
+ this.equipControllObject[i] && this.equipControllObject[i].forEach((r) => {
823
823
  let a = `${t}-${i}-${r}`;
824
824
  this.nodesMap[a] && this.setCheckStatus(a, !0, !1);
825
- });
826
- }
827
- }
825
+ });
826
+ }
827
+ }
828
828
  });
829
829
  }
830
830
  // 获取选中的分组
@@ -839,12 +839,12 @@ class It extends ae {
839
839
  let e = [], t = /* @__PURE__ */ new Set();
840
840
  return Object.keys(this.equipCheckObject).forEach((i) => {
841
841
  if (this.equipCheckObject[i].checked) {
842
- try {
842
+ try {
843
843
  t.add(Number(i.split("-")[1]));
844
844
  } catch (s) {
845
845
  console.log(s);
846
- }
847
- }
846
+ }
847
+ }
848
848
  }), e = Array.from(t), e;
849
849
  }
850
850
  // 获取选中设备(携带分组)
@@ -899,7 +899,7 @@ class It extends ae {
899
899
  updateAllEquipStatus(e, t) {
900
900
  const i = this.groupNodeObject[e];
901
901
  if (!i) { return; }
902
- (this.isSearchStatus ? this.window[`group-${e}-search`] || [] : this.window[`group-${e}${this.aliasName}`] || []).forEach((r) => {
902
+ (this.isSearchStatus ? window[`group-${e}-search`] || [] : window[`group-${e}${this.aliasName}`] || []).forEach((r) => {
903
903
  const a = `${e}-${r.equipNo}`;
904
904
  this.setEquipCheckObject(a, t, !1, e), this.nodesMap[a] && this.setCheckStatus(a, t, !1);
905
905
  }), i.groups && i.groups.length > 0 && i.groups.forEach((r) => {
@@ -940,7 +940,7 @@ class Mt extends ae {
940
940
  this.clearAllEquipNum();
941
941
  for (let s in this.groupNodeObject) {
942
942
  let r = [];
943
- e ? r = this.window[`group-${s}-search`] : r = this.window[`group-${s}${this.aliasName}`], t && r && r.length && (r = r.filter((c) => i[c.equipNo] === 2));
943
+ e ? r = window[`group-${s}-search`] : r = window[`group-${s}${this.aliasName}`], t && r && r.length && (r = r.filter((c) => i[c.equipNo] === 2));
944
944
  let a = r ? r.length : 0;
945
945
  this.groupNodeObject[s].equipCount = a, a && this.setGroupNum(s, a);
946
946
  }
@@ -955,17 +955,17 @@ class Mt extends ae {
955
955
  // 获取设备总数
956
956
  getAllEquipsNum() {
957
957
  let e = 0;
958
- for (let t in this.groupNodeObject) { this.window[`group-${this.groupNodeObject[t].key}${this.aliasName}`] && (e = e + this.window[`group-${this.groupNodeObject[t].key}${this.aliasName}`].length); }
958
+ for (let t in this.groupNodeObject) { window[`group-${this.groupNodeObject[t].key}${this.aliasName}`] && (e = e + window[`group-${this.groupNodeObject[t].key}${this.aliasName}`].length); }
959
959
  return e;
960
960
  }
961
961
  }
962
- let Te = globalThis && globalThis.__extends || (function() {
963
- let n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
962
+ let Te = globalThis && globalThis.__extends || (function () {
963
+ let n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) {
964
964
  e.__proto__ = t;
965
- } || function(e, t) {
965
+ } || function (e, t) {
966
966
  for (let i in t) { t.hasOwnProperty(i) && (e[i] = t[i]); }
967
967
  };
968
- return function(e, t) {
968
+ return function (e, t) {
969
969
  n(e, t);
970
970
  function i() {
971
971
  this.constructor = e;
@@ -975,7 +975,7 @@ let Te = globalThis && globalThis.__extends || (function() {
975
975
  })(), J = (
976
976
 
977
977
  /** @class */
978
- function(n) {
978
+ function (n) {
979
979
  Te(e, n);
980
980
  function e(t, i) {
981
981
  let s = this.constructor, r = this, a = s.prototype;
@@ -983,192 +983,194 @@ let Te = globalThis && globalThis.__extends || (function() {
983
983
  }
984
984
  return e;
985
985
  })(Error)
986
- , Oe = (
986
+ , Oe = (
987
987
 
988
- /** @class */
989
- function(n) {
990
- Te(e, n);
991
- function e(t) {
992
- let i = this.constructor;
993
- t === void 0 && (t = "A timeout occurred.");
994
- let s = this, r = i.prototype;
995
- return s = n.call(this, t) || this, s.__proto__ = r, s;
996
- }
997
- return e;
998
- })(Error)
999
- , oe = (
1000
-
1001
- /** @class */
1002
- function(n) {
1003
- Te(e, n);
1004
- function e(t) {
1005
- let i = this.constructor;
1006
- t === void 0 && (t = "An abort occurred.");
1007
- let s = this, r = i.prototype;
1008
- return s = n.call(this, t) || this, s.__proto__ = r, s;
1009
- }
1010
- return e;
1011
- })(Error)
1012
- , ve = globalThis && globalThis.__assign || Object.assign || function(n) {
1013
- for (var e, t = 1, i = arguments.length; t < i; t++) {
1014
- e = arguments[t];
1015
- for (let s in e) { Object.prototype.hasOwnProperty.call(e, s) && (n[s] = e[s]); }
1016
- }
1017
- return n;
1018
- }, Qe = (
988
+ /** @class */
989
+ function (n) {
990
+ Te(e, n);
991
+ function e(t) {
992
+ let i = this.constructor;
993
+ t === void 0 && (t = "A timeout occurred.");
994
+ let s = this, r = i.prototype;
995
+ return s = n.call(this, t) || this, s.__proto__ = r, s;
996
+ }
997
+ return e;
998
+ })(Error)
999
+ , oe = (
1019
1000
 
1020
- /** @class */
1021
- function() {
1022
- function n(e, t, i) {
1023
- this.statusCode = e, this.statusText = t, this.content = i;
1001
+ /** @class */
1002
+ function (n) {
1003
+ Te(e, n);
1004
+ function e(t) {
1005
+ let i = this.constructor;
1006
+ t === void 0 && (t = "An abort occurred.");
1007
+ let s = this, r = i.prototype;
1008
+ return s = n.call(this, t) || this, s.__proto__ = r, s;
1009
+ }
1010
+ return e;
1011
+ })(Error)
1012
+ , ve = globalThis && globalThis.__assign || Object.assign || function (n) {
1013
+ for (var e, t = 1, i = arguments.length; t < i; t++) {
1014
+ e = arguments[t];
1015
+ for (let s in e) { Object.prototype.hasOwnProperty.call(e, s) && (n[s] = e[s]); }
1024
1016
  }
1025
1017
  return n;
1026
- })()
1027
- , Ne = (
1018
+ }, Qe = (
1028
1019
 
1029
- /** @class */
1030
- function() {
1031
- function n() {
1032
- }
1033
- return n.prototype.get = function(e, t) {
1034
- return this.send(ve({}, t, { method: "GET", url: e }));
1035
- }, n.prototype.post = function(e, t) {
1036
- return this.send(ve({}, t, { method: "POST", url: e }));
1037
- }, n.prototype.delete = function(e, t) {
1038
- return this.send(ve({}, t, { method: "DELETE", url: e }));
1039
- }, n.prototype.getCookieString = function(e) {
1040
- return "";
1041
- }, n;
1042
- })()
1043
- , h;
1044
- (function(n) {
1020
+ /** @class */
1021
+ function () {
1022
+ function n(e, t, i) {
1023
+ this.statusCode = e, this.statusText = t, this.content = i;
1024
+ }
1025
+ return n;
1026
+ })()
1027
+ , Ne = (
1028
+
1029
+ /** @class */
1030
+ function () {
1031
+ function n() {
1032
+ }
1033
+ return n.prototype.get = function (e, t) {
1034
+ return this.send(ve({}, t, { method: "GET", url: e }));
1035
+ }, n.prototype.post = function (e, t) {
1036
+ return this.send(ve({}, t, { method: "POST", url: e }));
1037
+ }, n.prototype.delete = function (e, t) {
1038
+ return this.send(ve({}, t, { method: "DELETE", url: e }));
1039
+ }, n.prototype.getCookieString = function (e) {
1040
+ return "";
1041
+ }, n;
1042
+ })()
1043
+ , h;
1044
+ (function (n) {
1045
1045
  n[n.Trace = 0] = "Trace", n[n.Debug = 1] = "Debug", n[n.Information = 2] = "Information", n[n.Warning = 3] = "Warning", n[n.Error = 4] = "Error", n[n.Critical = 5] = "Critical", n[n.None = 6] = "None";
1046
1046
  })(h || (h = {}));
1047
1047
  let Ie = (
1048
1048
 
1049
1049
  /** @class */
1050
- function() {
1050
+ function () {
1051
1051
  function n() {
1052
1052
  }
1053
- return n.prototype.log = function(e, t) {
1053
+ return n.prototype.log = function (e, t) {
1054
1054
  }, n.instance = new n(), n;
1055
1055
  })()
1056
- , xt = globalThis && globalThis.__awaiter || function(n, e, t, i) {
1057
- return new (t || (t = Promise))(function(s, r) {
1058
- function a(o) {
1059
- try {
1060
- u(i.next(o));
1061
- } catch (l) {
1062
- r(l);
1056
+ , xt = globalThis && globalThis.__awaiter || function (n, e, t, i) {
1057
+ return new (t || (t = Promise))(function (s, r) {
1058
+ function a(o) {
1059
+ try {
1060
+ u(i.next(o));
1061
+ } catch (l) {
1062
+ r(l);
1063
+ }
1063
1064
  }
1064
- }
1065
- function c(o) {
1066
- try {
1067
- u(i.throw(o));
1068
- } catch (l) {
1069
- r(l);
1065
+ function c(o) {
1066
+ try {
1067
+ u(i.throw(o));
1068
+ } catch (l) {
1069
+ r(l);
1070
+ }
1070
1071
  }
1072
+ function u(o) {
1073
+ o.done ? s(o.value) : new t(function (l) {
1074
+ l(o.value);
1075
+ }).then(a, c);
1076
+ }
1077
+ u((i = i.apply(n, e || [])).next());
1078
+ });
1079
+ }, jt = globalThis && globalThis.__generator || function (n, e) {
1080
+ let t = {
1081
+ label: 0, sent: function () {
1082
+ if (r[0] & 1) { throw r[1]; }
1083
+ return r[1];
1084
+ }, trys: [], ops: []
1085
+ }, i, s, r, a;
1086
+ return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function () {
1087
+ return this;
1088
+ }), a;
1089
+ function c(o) {
1090
+ return function (l) {
1091
+ return u([o, l]);
1092
+ };
1071
1093
  }
1072
1094
  function u(o) {
1073
- o.done ? s(o.value) : new t(function(l) {
1074
- l(o.value);
1075
- }).then(a, c);
1076
- }
1077
- u((i = i.apply(n, e || [])).next());
1078
- });
1079
- }, jt = globalThis && globalThis.__generator || function(n, e) {
1080
- let t = { label: 0, sent: function() {
1081
- if (r[0] & 1) { throw r[1]; }
1082
- return r[1];
1083
- }, trys: [], ops: [] }, i, s, r, a;
1084
- return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
1085
- return this;
1086
- }), a;
1087
- function c(o) {
1088
- return function(l) {
1089
- return u([o, l]);
1090
- };
1091
- }
1092
- function u(o) {
1093
- if (i) { throw new TypeError("Generator is already executing."); }
1094
- for (; t;) {
1095
- try {
1096
- if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
1097
- switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
1098
- case 0:
1099
- case 1:
1100
- r = o;
1101
- break;
1102
- case 4:
1103
- return t.label++, { value: o[1], done: !1 };
1104
- case 5:
1105
- t.label++, s = o[1], o = [0];
1106
- continue;
1107
- case 7:
1108
- o = t.ops.pop(), t.trys.pop();
1109
- continue;
1110
- default:
1111
- if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
1112
- t = 0;
1113
- continue;
1114
- }
1115
- if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
1116
- t.label = o[1];
1117
- break;
1118
- }
1119
- if (o[0] === 6 && t.label < r[1]) {
1120
- t.label = r[1], r = o;
1121
- break;
1122
- }
1123
- if (r && t.label < r[2]) {
1124
- t.label = r[2], t.ops.push(o);
1095
+ if (i) { throw new TypeError("Generator is already executing."); }
1096
+ for (; t;) {
1097
+ try {
1098
+ if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
1099
+ switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
1100
+ case 0:
1101
+ case 1:
1102
+ r = o;
1125
1103
  break;
1126
- }
1127
- r[2] && t.ops.pop(), t.trys.pop();
1128
- continue;
1104
+ case 4:
1105
+ return t.label++, { value: o[1], done: !1 };
1106
+ case 5:
1107
+ t.label++, s = o[1], o = [0];
1108
+ continue;
1109
+ case 7:
1110
+ o = t.ops.pop(), t.trys.pop();
1111
+ continue;
1112
+ default:
1113
+ if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
1114
+ t = 0;
1115
+ continue;
1116
+ }
1117
+ if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
1118
+ t.label = o[1];
1119
+ break;
1120
+ }
1121
+ if (o[0] === 6 && t.label < r[1]) {
1122
+ t.label = r[1], r = o;
1123
+ break;
1124
+ }
1125
+ if (r && t.label < r[2]) {
1126
+ t.label = r[2], t.ops.push(o);
1127
+ break;
1128
+ }
1129
+ r[2] && t.ops.pop(), t.trys.pop();
1130
+ continue;
1131
+ }
1132
+ o = e.call(n, t);
1133
+ } catch (l) {
1134
+ o = [6, l], s = 0;
1135
+ } finally {
1136
+ i = r = 0;
1129
1137
  }
1130
- o = e.call(n, t);
1131
- } catch (l) {
1132
- o = [6, l], s = 0;
1133
- } finally {
1134
- i = r = 0;
1135
- }
1136
- }
1137
- if (o[0] & 5) { throw o[1]; }
1138
- return { value: o[0] ? o[1] : void 0, done: !0 };
1139
- }
1140
- }, S = (
1141
-
1142
- /** @class */
1143
- function() {
1144
- function n() {
1138
+ }
1139
+ if (o[0] & 5) { throw o[1]; }
1140
+ return { value: o[0] ? o[1] : void 0, done: !0 };
1145
1141
  }
1146
- return n.isRequired = function(e, t) {
1147
- if (e == null) { throw new Error("The '" + t + "' argument is required."); }
1148
- }, n.isIn = function(e, t, i) {
1149
- if (!(e in t)) { throw new Error("Unknown " + i + " value: " + e + "."); }
1150
- }, n;
1151
- })()
1152
- ;
1142
+ }, S = (
1143
+
1144
+ /** @class */
1145
+ function () {
1146
+ function n() {
1147
+ }
1148
+ return n.isRequired = function (e, t) {
1149
+ if (e == null) { throw new Error("The '" + t + "' argument is required."); }
1150
+ }, n.isIn = function (e, t, i) {
1151
+ if (!(e in t)) { throw new Error("Unknown " + i + " value: " + e + "."); }
1152
+ }, n;
1153
+ })()
1154
+ ;
1153
1155
  function X(n, e) {
1154
1156
  let t = "";
1155
1157
  return ue(n) ? (t = "Binary data of length " + n.byteLength, e && (t += ". Content: '" + _t(n) + "'")) : typeof n == "string" && (t = "String data of length " + n.length, e && (t += ". Content: '" + n + "'")), t;
1156
1158
  }
1157
1159
  function _t(n) {
1158
1160
  let e = new Uint8Array(n), t = "";
1159
- return e.forEach(function(i) {
1161
+ return e.forEach(function (i) {
1160
1162
  let s = i < 16 ? "0" : "";
1161
1163
  t += "0x" + s + i.toString(16) + " ";
1162
1164
  }), t.substr(0, t.length - 1);
1163
1165
  }
1164
1166
  function ue(n) {
1165
1167
  return n && typeof ArrayBuffer < "u" && (n instanceof ArrayBuffer || // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof
1166
- n.constructor && n.constructor.name === "ArrayBuffer");
1168
+ n.constructor && n.constructor.name === "ArrayBuffer");
1167
1169
  }
1168
1170
  function Ze(n, e, t, i, s, r, a) {
1169
- return xt(this, void 0, void 0, function() {
1171
+ return xt(this, void 0, void 0, function () {
1170
1172
  let c, u, o, l, d;
1171
- return jt(this, function(f) {
1173
+ return jt(this, function (f) {
1172
1174
  switch (f.label) {
1173
1175
  case 0:
1174
1176
  return s ? [4, s()] : [3, 2];
@@ -1196,89 +1198,89 @@ function Gt(n) {
1196
1198
  var Pt = (
1197
1199
 
1198
1200
  /** @class */
1199
- function() {
1201
+ function () {
1200
1202
  function n() {
1201
1203
  this.observers = [];
1202
1204
  }
1203
- return n.prototype.next = function(e) {
1205
+ return n.prototype.next = function (e) {
1204
1206
  for (let t = 0, i = this.observers; t < i.length; t++) {
1205
1207
  let s = i[t];
1206
1208
  s.next(e);
1207
1209
  }
1208
- }, n.prototype.error = function(e) {
1210
+ }, n.prototype.error = function (e) {
1209
1211
  for (let t = 0, i = this.observers; t < i.length; t++) {
1210
1212
  let s = i[t];
1211
1213
  s.error && s.error(e);
1212
1214
  }
1213
- }, n.prototype.complete = function() {
1215
+ }, n.prototype.complete = function () {
1214
1216
  for (let e = 0, t = this.observers; e < t.length; e++) {
1215
1217
  let i = t[e];
1216
1218
  i.complete && i.complete();
1217
1219
  }
1218
- }, n.prototype.subscribe = function(e) {
1220
+ }, n.prototype.subscribe = function (e) {
1219
1221
  return this.observers.push(e), new At(this, e);
1220
1222
  }, n;
1221
1223
  })()
1222
- , At = (
1224
+ , At = (
1223
1225
 
1224
- /** @class */
1225
- function() {
1226
- function n(e, t) {
1227
- this.subject = e, this.observer = t;
1228
- }
1229
- return n.prototype.dispose = function() {
1230
- let e = this.subject.observers.indexOf(this.observer);
1231
- e > -1 && this.subject.observers.splice(e, 1), this.subject.observers.length === 0 && this.subject.cancelCallback && this.subject.cancelCallback().catch(function(t) {
1232
- });
1233
- }, n;
1234
- })()
1235
- , Ce = (
1226
+ /** @class */
1227
+ function () {
1228
+ function n(e, t) {
1229
+ this.subject = e, this.observer = t;
1230
+ }
1231
+ return n.prototype.dispose = function () {
1232
+ let e = this.subject.observers.indexOf(this.observer);
1233
+ e > -1 && this.subject.observers.splice(e, 1), this.subject.observers.length === 0 && this.subject.cancelCallback && this.subject.cancelCallback().catch(function (t) {
1234
+ });
1235
+ }, n;
1236
+ })()
1237
+ , Ce = (
1236
1238
 
1237
- /** @class */
1238
- function() {
1239
- function n(e) {
1240
- this.minimumLogLevel = e;
1241
- }
1242
- return n.prototype.log = function(e, t) {
1243
- if (e >= this.minimumLogLevel) {
1244
- switch (e) {
1245
- case h.Critical:
1246
- case h.Error:
1247
- console.error("[" + (/* @__PURE__ */ new Date()).toISOString() + "] " + h[e] + ": " + t);
1248
- break;
1249
- case h.Warning:
1250
- console.warn("[" + (/* @__PURE__ */ new Date()).toISOString() + "] " + h[e] + ": " + t);
1251
- break;
1252
- case h.Information:
1253
- console.info("[" + (/* @__PURE__ */ new Date()).toISOString() + "] " + h[e] + ": " + t);
1254
- break;
1255
- default:
1256
- console.log("[" + (/* @__PURE__ */ new Date()).toISOString() + "] " + h[e] + ": " + t);
1257
- break;
1258
- }
1259
- }
1260
- }, n;
1261
- })()
1262
- , $t = globalThis && globalThis.__extends || (function() {
1263
- let n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1264
- e.__proto__ = t;
1265
- } || function(e, t) {
1266
- for (let i in t) { t.hasOwnProperty(i) && (e[i] = t[i]); }
1267
- };
1268
- return function(e, t) {
1269
- n(e, t);
1270
- function i() {
1271
- this.constructor = e;
1239
+ /** @class */
1240
+ function () {
1241
+ function n(e) {
1242
+ this.minimumLogLevel = e;
1243
+ }
1244
+ return n.prototype.log = function (e, t) {
1245
+ if (e >= this.minimumLogLevel) {
1246
+ switch (e) {
1247
+ case h.Critical:
1248
+ case h.Error:
1249
+ console.error("[" + (/* @__PURE__ */ new Date()).toISOString() + "] " + h[e] + ": " + t);
1250
+ break;
1251
+ case h.Warning:
1252
+ console.warn("[" + (/* @__PURE__ */ new Date()).toISOString() + "] " + h[e] + ": " + t);
1253
+ break;
1254
+ case h.Information:
1255
+ console.info("[" + (/* @__PURE__ */ new Date()).toISOString() + "] " + h[e] + ": " + t);
1256
+ break;
1257
+ default:
1258
+ console.log("[" + (/* @__PURE__ */ new Date()).toISOString() + "] " + h[e] + ": " + t);
1259
+ break;
1260
+ }
1261
+ }
1262
+ }, n;
1263
+ })()
1264
+ , $t = globalThis && globalThis.__extends || (function () {
1265
+ let n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) {
1266
+ e.__proto__ = t;
1267
+ } || function (e, t) {
1268
+ for (let i in t) { t.hasOwnProperty(i) && (e[i] = t[i]); }
1269
+ };
1270
+ return function (e, t) {
1271
+ n(e, t);
1272
+ function i() {
1273
+ this.constructor = e;
1274
+ }
1275
+ e.prototype = t === null ? Object.create(t) : (i.prototype = t.prototype, new i());
1276
+ };
1277
+ })(), Lt = globalThis && globalThis.__assign || Object.assign || function (n) {
1278
+ for (var e, t = 1, i = arguments.length; t < i; t++) {
1279
+ e = arguments[t];
1280
+ for (let s in e) { Object.prototype.hasOwnProperty.call(e, s) && (n[s] = e[s]); }
1272
1281
  }
1273
- e.prototype = t === null ? Object.create(t) : (i.prototype = t.prototype, new i());
1274
- };
1275
- })(), Lt = globalThis && globalThis.__assign || Object.assign || function(n) {
1276
- for (var e, t = 1, i = arguments.length; t < i; t++) {
1277
- e = arguments[t];
1278
- for (let s in e) { Object.prototype.hasOwnProperty.call(e, s) && (n[s] = e[s]); }
1279
- }
1280
- return n;
1281
- }, re;
1282
+ return n;
1283
+ }, re;
1282
1284
  if (typeof XMLHttpRequest > "u") {
1283
1285
  let Rt = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
1284
1286
  re = Rt("request");
@@ -1286,16 +1288,16 @@ if (typeof XMLHttpRequest > "u") {
1286
1288
  let zt = (
1287
1289
 
1288
1290
  /** @class */
1289
- function(n) {
1291
+ function (n) {
1290
1292
  $t(e, n);
1291
1293
  function e(t) {
1292
1294
  let i = n.call(this) || this;
1293
1295
  if (typeof re > "u") { throw new Error("The 'request' module could not be loaded."); }
1294
1296
  return i.logger = t, i.cookieJar = re.jar(), i.request = re.defaults({ jar: i.cookieJar }), i;
1295
1297
  }
1296
- return e.prototype.send = function(t) {
1298
+ return e.prototype.send = function (t) {
1297
1299
  let i = this;
1298
- return new Promise(function(s, r) {
1300
+ return new Promise(function (s, r) {
1299
1301
  let a;
1300
1302
  ue(t.content) ? a = Buffer.from(t.content) : a = t.content || "";
1301
1303
  let c = i.request(t.url, {
@@ -1308,137 +1310,137 @@ let zt = (
1308
1310
  }, t.headers),
1309
1311
  method: t.method,
1310
1312
  timeout: t.timeout
1311
- }, function(u, o, l) {
1313
+ }, function (u, o, l) {
1312
1314
  if (t.abortSignal && (t.abortSignal.onabort = null), u) {
1313
1315
  u.code === "ETIMEDOUT" && (i.logger.log(h.Warning, "Timeout from HTTP request."), r(new Oe())), i.logger.log(h.Warning, "Error from HTTP request. " + u), r(u);
1314
1316
  return;
1315
1317
  }
1316
1318
  o.statusCode >= 200 && o.statusCode < 300 ? s(new Qe(o.statusCode, o.statusMessage || "", l)) : r(new J(o.statusMessage || "", o.statusCode || 0));
1317
1319
  });
1318
- t.abortSignal && (t.abortSignal.onabort = function() {
1320
+ t.abortSignal && (t.abortSignal.onabort = function () {
1319
1321
  c.abort(), r(new oe());
1320
1322
  });
1321
1323
  });
1322
- }, e.prototype.getCookieString = function(t) {
1324
+ }, e.prototype.getCookieString = function (t) {
1323
1325
  return this.cookieJar.getCookieString(t);
1324
1326
  }, e;
1325
1327
  })(Ne)
1326
- , Bt = globalThis && globalThis.__extends || (function() {
1327
- let n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1328
- e.__proto__ = t;
1329
- } || function(e, t) {
1330
- for (let i in t) { t.hasOwnProperty(i) && (e[i] = t[i]); }
1331
- };
1332
- return function(e, t) {
1333
- n(e, t);
1334
- function i() {
1335
- this.constructor = e;
1336
- }
1337
- e.prototype = t === null ? Object.create(t) : (i.prototype = t.prototype, new i());
1338
- };
1339
- })(), Dt = (
1328
+ , Bt = globalThis && globalThis.__extends || (function () {
1329
+ let n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) {
1330
+ e.__proto__ = t;
1331
+ } || function (e, t) {
1332
+ for (let i in t) { t.hasOwnProperty(i) && (e[i] = t[i]); }
1333
+ };
1334
+ return function (e, t) {
1335
+ n(e, t);
1336
+ function i() {
1337
+ this.constructor = e;
1338
+ }
1339
+ e.prototype = t === null ? Object.create(t) : (i.prototype = t.prototype, new i());
1340
+ };
1341
+ })(), Dt = (
1340
1342
 
1341
- /** @class */
1342
- function(n) {
1343
- Bt(e, n);
1344
- function e(t) {
1345
- let i = n.call(this) || this;
1346
- return i.logger = t, i;
1347
- }
1348
- return e.prototype.send = function(t) {
1349
- let i = this;
1350
- return t.abortSignal && t.abortSignal.aborted ? Promise.reject(new oe()) : t.method ? t.url ? new Promise(function(s, r) {
1351
- let a = new XMLHttpRequest();
1352
- a.open(t.method, t.url, !0), a.withCredentials = !0, a.setRequestHeader("X-Requested-With", "XMLHttpRequest"), a.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
1353
- let c = t.headers;
1354
- c && Object.keys(c).forEach(function(u) {
1355
- a.setRequestHeader(u, c[u]);
1356
- }), t.responseType && (a.responseType = t.responseType), t.abortSignal && (t.abortSignal.onabort = function() {
1357
- a.abort(), r(new oe());
1358
- }), t.timeout && (a.timeout = t.timeout), a.onload = function() {
1359
- t.abortSignal && (t.abortSignal.onabort = null), a.status >= 200 && a.status < 300 ? s(new Qe(a.status, a.statusText, a.response || a.responseText)) : r(new J(a.statusText, a.status));
1360
- }, a.onerror = function() {
1361
- i.logger.log(h.Warning, "Error from HTTP request. " + a.status + ": " + a.statusText + "."), r(new J(a.statusText, a.status));
1362
- }, a.ontimeout = function() {
1363
- i.logger.log(h.Warning, "Timeout from HTTP request."), r(new Oe());
1364
- }, a.send(t.content || "");
1365
- }) : Promise.reject(new Error("No url defined.")) : Promise.reject(new Error("No method defined."));
1366
- }, e;
1367
- })(Ne)
1368
- , Ft = globalThis && globalThis.__extends || (function() {
1369
- let n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1370
- e.__proto__ = t;
1371
- } || function(e, t) {
1372
- for (let i in t) { t.hasOwnProperty(i) && (e[i] = t[i]); }
1373
- };
1374
- return function(e, t) {
1375
- n(e, t);
1376
- function i() {
1377
- this.constructor = e;
1378
- }
1379
- e.prototype = t === null ? Object.create(t) : (i.prototype = t.prototype, new i());
1380
- };
1381
- })(), Ht = (
1343
+ /** @class */
1344
+ function (n) {
1345
+ Bt(e, n);
1346
+ function e(t) {
1347
+ let i = n.call(this) || this;
1348
+ return i.logger = t, i;
1349
+ }
1350
+ return e.prototype.send = function (t) {
1351
+ let i = this;
1352
+ return t.abortSignal && t.abortSignal.aborted ? Promise.reject(new oe()) : t.method ? t.url ? new Promise(function (s, r) {
1353
+ let a = new XMLHttpRequest();
1354
+ a.open(t.method, t.url, !0), a.withCredentials = !0, a.setRequestHeader("X-Requested-With", "XMLHttpRequest"), a.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
1355
+ let c = t.headers;
1356
+ c && Object.keys(c).forEach(function (u) {
1357
+ a.setRequestHeader(u, c[u]);
1358
+ }), t.responseType && (a.responseType = t.responseType), t.abortSignal && (t.abortSignal.onabort = function () {
1359
+ a.abort(), r(new oe());
1360
+ }), t.timeout && (a.timeout = t.timeout), a.onload = function () {
1361
+ t.abortSignal && (t.abortSignal.onabort = null), a.status >= 200 && a.status < 300 ? s(new Qe(a.status, a.statusText, a.response || a.responseText)) : r(new J(a.statusText, a.status));
1362
+ }, a.onerror = function () {
1363
+ i.logger.log(h.Warning, "Error from HTTP request. " + a.status + ": " + a.statusText + "."), r(new J(a.statusText, a.status));
1364
+ }, a.ontimeout = function () {
1365
+ i.logger.log(h.Warning, "Timeout from HTTP request."), r(new Oe());
1366
+ }, a.send(t.content || "");
1367
+ }) : Promise.reject(new Error("No url defined.")) : Promise.reject(new Error("No method defined."));
1368
+ }, e;
1369
+ })(Ne)
1370
+ , Ft = globalThis && globalThis.__extends || (function () {
1371
+ let n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) {
1372
+ e.__proto__ = t;
1373
+ } || function (e, t) {
1374
+ for (let i in t) { t.hasOwnProperty(i) && (e[i] = t[i]); }
1375
+ };
1376
+ return function (e, t) {
1377
+ n(e, t);
1378
+ function i() {
1379
+ this.constructor = e;
1380
+ }
1381
+ e.prototype = t === null ? Object.create(t) : (i.prototype = t.prototype, new i());
1382
+ };
1383
+ })(), Ht = (
1382
1384
 
1383
- /** @class */
1384
- function(n) {
1385
- Ft(e, n);
1386
- function e(t) {
1387
- let i = n.call(this) || this;
1388
- return typeof XMLHttpRequest < "u" ? i.httpClient = new Dt(t) : i.httpClient = new zt(t), i;
1389
- }
1390
- return e.prototype.send = function(t) {
1391
- return t.abortSignal && t.abortSignal.aborted ? Promise.reject(new oe()) : t.method ? t.url ? this.httpClient.send(t) : Promise.reject(new Error("No url defined.")) : Promise.reject(new Error("No method defined."));
1392
- }, e.prototype.getCookieString = function(t) {
1393
- return this.httpClient.getCookieString(t);
1394
- }, e;
1395
- })(Ne)
1396
- , L = (
1385
+ /** @class */
1386
+ function (n) {
1387
+ Ft(e, n);
1388
+ function e(t) {
1389
+ let i = n.call(this) || this;
1390
+ return typeof XMLHttpRequest < "u" ? i.httpClient = new Dt(t) : i.httpClient = new zt(t), i;
1391
+ }
1392
+ return e.prototype.send = function (t) {
1393
+ return t.abortSignal && t.abortSignal.aborted ? Promise.reject(new oe()) : t.method ? t.url ? this.httpClient.send(t) : Promise.reject(new Error("No url defined.")) : Promise.reject(new Error("No method defined."));
1394
+ }, e.prototype.getCookieString = function (t) {
1395
+ return this.httpClient.getCookieString(t);
1396
+ }, e;
1397
+ })(Ne)
1398
+ , L = (
1397
1399
 
1398
- /** @class */
1399
- function() {
1400
- function n() {
1401
- }
1402
- return n.write = function(e) {
1403
- return "" + e + n.RecordSeparator;
1404
- }, n.parse = function(e) {
1405
- if (e[e.length - 1] !== n.RecordSeparator) { throw new Error("Message is incomplete."); }
1406
- let t = e.split(n.RecordSeparator);
1407
- return t.pop(), t;
1408
- }, n.RecordSeparatorCode = 30, n.RecordSeparator = String.fromCharCode(n.RecordSeparatorCode), n;
1409
- })()
1410
- , Ut = (
1400
+ /** @class */
1401
+ function () {
1402
+ function n() {
1403
+ }
1404
+ return n.write = function (e) {
1405
+ return "" + e + n.RecordSeparator;
1406
+ }, n.parse = function (e) {
1407
+ if (e[e.length - 1] !== n.RecordSeparator) { throw new Error("Message is incomplete."); }
1408
+ let t = e.split(n.RecordSeparator);
1409
+ return t.pop(), t;
1410
+ }, n.RecordSeparatorCode = 30, n.RecordSeparator = String.fromCharCode(n.RecordSeparatorCode), n;
1411
+ })()
1412
+ , Ut = (
1411
1413
 
1412
- /** @class */
1413
- function() {
1414
- function n() {
1415
- }
1416
- return n.prototype.writeHandshakeRequest = function(e) {
1417
- return L.write(JSON.stringify(e));
1418
- }, n.prototype.parseHandshakeResponse = function(e) {
1419
- let t, i, s;
1420
- if (ue(e) || typeof Buffer < "u" && e instanceof Buffer) {
1421
- var r = new Uint8Array(e), a = r.indexOf(L.RecordSeparatorCode);
1422
- if (a === -1) { throw new Error("Message is incomplete."); }
1423
- var c = a + 1;
1424
- i = String.fromCharCode.apply(null, r.slice(0, c)), s = r.byteLength > c ? r.slice(c).buffer : null;
1425
- } else {
1426
- var u = e, a = u.indexOf(L.RecordSeparator);
1427
- if (a === -1) { throw new Error("Message is incomplete."); }
1428
- var c = a + 1;
1429
- i = u.substring(0, c), s = u.length > c ? u.substring(c) : null;
1430
- }
1431
- let o = L.parse(i), l = JSON.parse(o[0]);
1432
- if (l.type) { throw new Error("Expected a handshake response from the server."); }
1433
- return t = l, [s, t];
1434
- }, n;
1435
- })()
1436
- , w;
1437
- (function(n) {
1414
+ /** @class */
1415
+ function () {
1416
+ function n() {
1417
+ }
1418
+ return n.prototype.writeHandshakeRequest = function (e) {
1419
+ return L.write(JSON.stringify(e));
1420
+ }, n.prototype.parseHandshakeResponse = function (e) {
1421
+ let t, i, s;
1422
+ if (ue(e) || typeof Buffer < "u" && e instanceof Buffer) {
1423
+ var r = new Uint8Array(e), a = r.indexOf(L.RecordSeparatorCode);
1424
+ if (a === -1) { throw new Error("Message is incomplete."); }
1425
+ var c = a + 1;
1426
+ i = String.fromCharCode.apply(null, r.slice(0, c)), s = r.byteLength > c ? r.slice(c).buffer : null;
1427
+ } else {
1428
+ var u = e, a = u.indexOf(L.RecordSeparator);
1429
+ if (a === -1) { throw new Error("Message is incomplete."); }
1430
+ var c = a + 1;
1431
+ i = u.substring(0, c), s = u.length > c ? u.substring(c) : null;
1432
+ }
1433
+ let o = L.parse(i), l = JSON.parse(o[0]);
1434
+ if (l.type) { throw new Error("Expected a handshake response from the server."); }
1435
+ return t = l, [s, t];
1436
+ }, n;
1437
+ })()
1438
+ , w;
1439
+ (function (n) {
1438
1440
  n[n.Invocation = 1] = "Invocation", n[n.StreamItem = 2] = "StreamItem", n[n.Completion = 3] = "Completion", n[n.StreamInvocation = 4] = "StreamInvocation", n[n.CancelInvocation = 5] = "CancelInvocation", n[n.Ping = 6] = "Ping", n[n.Close = 7] = "Close";
1439
1441
  })(w || (w = {}));
1440
- let Be = globalThis && globalThis.__awaiter || function(n, e, t, i) {
1441
- return new (t || (t = Promise))(function(s, r) {
1442
+ let Be = globalThis && globalThis.__awaiter || function (n, e, t, i) {
1443
+ return new (t || (t = Promise))(function (s, r) {
1442
1444
  function a(o) {
1443
1445
  try {
1444
1446
  u(i.next(o));
@@ -1454,29 +1456,31 @@ let Be = globalThis && globalThis.__awaiter || function(n, e, t, i) {
1454
1456
  }
1455
1457
  }
1456
1458
  function u(o) {
1457
- o.done ? s(o.value) : new t(function(l) {
1459
+ o.done ? s(o.value) : new t(function (l) {
1458
1460
  l(o.value);
1459
1461
  }).then(a, c);
1460
1462
  }
1461
1463
  u((i = i.apply(n, e || [])).next());
1462
1464
  });
1463
- }, De = globalThis && globalThis.__generator || function(n, e) {
1464
- let t = { label: 0, sent: function() {
1465
- if (r[0] & 1) { throw r[1]; }
1466
- return r[1];
1467
- }, trys: [], ops: [] }, i, s, r, a;
1468
- return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
1465
+ }, De = globalThis && globalThis.__generator || function (n, e) {
1466
+ let t = {
1467
+ label: 0, sent: function () {
1468
+ if (r[0] & 1) { throw r[1]; }
1469
+ return r[1];
1470
+ }, trys: [], ops: []
1471
+ }, i, s, r, a;
1472
+ return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function () {
1469
1473
  return this;
1470
1474
  }), a;
1471
1475
  function c(o) {
1472
- return function(l) {
1476
+ return function (l) {
1473
1477
  return u([o, l]);
1474
1478
  };
1475
1479
  }
1476
1480
  function u(o) {
1477
1481
  if (i) { throw new TypeError("Generator is already executing."); }
1478
1482
  for (; t;) {
1479
- try {
1483
+ try {
1480
1484
  if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
1481
1485
  switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
1482
1486
  case 0:
@@ -1516,47 +1520,47 @@ let Be = globalThis && globalThis.__awaiter || function(n, e, t, i) {
1516
1520
  o = [6, l], s = 0;
1517
1521
  } finally {
1518
1522
  i = r = 0;
1519
- }
1520
- }
1523
+ }
1524
+ }
1521
1525
  if (o[0] & 5) { throw o[1]; }
1522
1526
  return { value: o[0] ? o[1] : void 0, done: !0 };
1523
1527
  }
1524
1528
  }, Wt = 30 * 1e3, Kt = 15 * 1e3, R;
1525
- (function(n) {
1529
+ (function (n) {
1526
1530
  n[n.Disconnected = 0] = "Disconnected", n[n.Connected = 1] = "Connected";
1527
1531
  })(R || (R = {}));
1528
1532
  let Vt = (
1529
1533
 
1530
1534
  /** @class */
1531
- function() {
1535
+ function () {
1532
1536
  function n(e, t, i) {
1533
1537
  let s = this;
1534
- S.isRequired(e, "connection"), S.isRequired(t, "logger"), S.isRequired(i, "protocol"), this.serverTimeoutInMilliseconds = Wt, this.keepAliveIntervalInMilliseconds = Kt, this.logger = t, this.protocol = i, this.connection = e, this.handshakeProtocol = new Ut(), this.connection.onreceive = function(r) {
1538
+ S.isRequired(e, "connection"), S.isRequired(t, "logger"), S.isRequired(i, "protocol"), this.serverTimeoutInMilliseconds = Wt, this.keepAliveIntervalInMilliseconds = Kt, this.logger = t, this.protocol = i, this.connection = e, this.handshakeProtocol = new Ut(), this.connection.onreceive = function (r) {
1535
1539
  return s.processIncomingData(r);
1536
- }, this.connection.onclose = function(r) {
1540
+ }, this.connection.onclose = function (r) {
1537
1541
  return s.connectionClosed(r);
1538
1542
  }, this.callbacks = {}, this.methods = {}, this.closedCallbacks = [], this.id = 0, this.receivedHandshakeResponse = !1, this.connectionState = R.Disconnected, this.cachedPingMessage = this.protocol.writeMessage({ type: w.Ping });
1539
1543
  }
1540
- return n.create = function(e, t, i) {
1544
+ return n.create = function (e, t, i) {
1541
1545
  return new n(e, t, i);
1542
1546
  }, Object.defineProperty(n.prototype, "state", {
1543
1547
 
1544
1548
  /** Indicates the state of the {@link HubConnection} to the server. */
1545
- get: function() {
1549
+ get: function () {
1546
1550
  return this.connectionState;
1547
1551
  },
1548
1552
  enumerable: !0,
1549
1553
  configurable: !0
1550
- }), n.prototype.start = function() {
1551
- return Be(this, void 0, void 0, function() {
1554
+ }), n.prototype.start = function () {
1555
+ return Be(this, void 0, void 0, function () {
1552
1556
  let e, t, i = this;
1553
- return De(this, function(s) {
1557
+ return De(this, function (s) {
1554
1558
  switch (s.label) {
1555
1559
  case 0:
1556
1560
  return e = {
1557
1561
  protocol: this.protocol.name,
1558
1562
  version: this.protocol.version
1559
- }, this.logger.log(h.Debug, "Starting HubConnection."), this.receivedHandshakeResponse = !1, t = new Promise(function(r, a) {
1563
+ }, this.logger.log(h.Debug, "Starting HubConnection."), this.receivedHandshakeResponse = !1, t = new Promise(function (r, a) {
1560
1564
  i.handshakeResolver = r, i.handshakeRejecter = a;
1561
1565
  }), [4, this.connection.start(this.protocol.transferFormat)];
1562
1566
  case 1:
@@ -1572,65 +1576,65 @@ let Vt = (
1572
1576
  }
1573
1577
  });
1574
1578
  });
1575
- }, n.prototype.stop = function() {
1579
+ }, n.prototype.stop = function () {
1576
1580
  return this.logger.log(h.Debug, "Stopping HubConnection."), this.cleanupTimeout(), this.cleanupPingTimer(), this.connection.stop();
1577
- }, n.prototype.stream = function(e) {
1581
+ }, n.prototype.stream = function (e) {
1578
1582
  for (var t = this, i = [], s = 1; s < arguments.length; s++) { i[s - 1] = arguments[s]; }
1579
1583
  let r = this.createStreamInvocation(e, i), a, c = new Pt();
1580
- c.cancelCallback = function() {
1584
+ c.cancelCallback = function () {
1581
1585
  let o = t.createCancelInvocation(r.invocationId), l = t.protocol.writeMessage(o);
1582
- return delete t.callbacks[r.invocationId], a.then(function() {
1586
+ return delete t.callbacks[r.invocationId], a.then(function () {
1583
1587
  return t.sendMessage(l);
1584
1588
  });
1585
- }, this.callbacks[r.invocationId] = function(o, l) {
1589
+ }, this.callbacks[r.invocationId] = function (o, l) {
1586
1590
  if (l) {
1587
1591
  c.error(l);
1588
1592
  return;
1589
1593
  } o && (o.type === w.Completion ? o.error ? c.error(new Error(o.error)) : c.complete() : c.next(o.item));
1590
1594
  };
1591
1595
  let u = this.protocol.writeMessage(r);
1592
- return a = this.sendMessage(u).catch(function(o) {
1596
+ return a = this.sendMessage(u).catch(function (o) {
1593
1597
  c.error(o), delete t.callbacks[r.invocationId];
1594
1598
  }), c;
1595
- }, n.prototype.sendMessage = function(e) {
1599
+ }, n.prototype.sendMessage = function (e) {
1596
1600
  return this.resetKeepAliveInterval(), this.connection.send(e);
1597
- }, n.prototype.send = function(e) {
1601
+ }, n.prototype.send = function (e) {
1598
1602
  for (var t = [], i = 1; i < arguments.length; i++) { t[i - 1] = arguments[i]; }
1599
1603
  let s = this.createInvocation(e, t, !0), r = this.protocol.writeMessage(s);
1600
1604
  return this.sendMessage(r);
1601
- }, n.prototype.invoke = function(e) {
1605
+ }, n.prototype.invoke = function (e) {
1602
1606
  for (var t = this, i = [], s = 1; s < arguments.length; s++) { i[s - 1] = arguments[s]; }
1603
- let r = this.createInvocation(e, i, !1), a = new Promise(function(c, u) {
1604
- t.callbacks[r.invocationId] = function(l, d) {
1607
+ let r = this.createInvocation(e, i, !1), a = new Promise(function (c, u) {
1608
+ t.callbacks[r.invocationId] = function (l, d) {
1605
1609
  if (d) {
1606
1610
  u(d);
1607
1611
  return;
1608
1612
  } l && (l.type === w.Completion ? l.error ? u(new Error(l.error)) : c(l.result) : u(new Error("Unexpected message type: " + l.type)));
1609
1613
  };
1610
1614
  let o = t.protocol.writeMessage(r);
1611
- t.sendMessage(o).catch(function(l) {
1615
+ t.sendMessage(o).catch(function (l) {
1612
1616
  u(l), delete t.callbacks[r.invocationId];
1613
1617
  });
1614
1618
  });
1615
1619
  return a;
1616
- }, n.prototype.on = function(e, t) {
1620
+ }, n.prototype.on = function (e, t) {
1617
1621
  !e || !t || (e = e.toLowerCase(), this.methods[e] || (this.methods[e] = []), this.methods[e].indexOf(t) === -1 && this.methods[e].push(t));
1618
- }, n.prototype.off = function(e, t) {
1622
+ }, n.prototype.off = function (e, t) {
1619
1623
  if (e) {
1620
1624
  e = e.toLowerCase();
1621
1625
  let i = this.methods[e];
1622
1626
  if (i) {
1623
- if (t) {
1627
+ if (t) {
1624
1628
  let s = i.indexOf(t);
1625
1629
  s !== -1 && (i.splice(s, 1), i.length === 0 && delete this.methods[e]);
1626
- } else { delete this.methods[e]; }
1627
- }
1630
+ } else { delete this.methods[e]; }
1631
+ }
1628
1632
  }
1629
- }, n.prototype.onclose = function(e) {
1633
+ }, n.prototype.onclose = function (e) {
1630
1634
  e && this.closedCallbacks.push(e);
1631
- }, n.prototype.processIncomingData = function(e) {
1635
+ }, n.prototype.processIncomingData = function (e) {
1632
1636
  if (this.cleanupTimeout(), this.receivedHandshakeResponse || (e = this.processHandshakeResponse(e), this.receivedHandshakeResponse = !0), e) {
1633
- for (let t = this.protocol.parseMessages(e, this.logger), i = 0, s = t; i < s.length; i++) {
1637
+ for (let t = this.protocol.parseMessages(e, this.logger), i = 0, s = t; i < s.length; i++) {
1634
1638
  let r = s[i];
1635
1639
  switch (r.type) {
1636
1640
  case w.Invocation:
@@ -1650,10 +1654,10 @@ let Vt = (
1650
1654
  this.logger.log(h.Warning, "Invalid message type: " + r.type + ".");
1651
1655
  break;
1652
1656
  }
1653
- }
1654
- }
1657
+ }
1658
+ }
1655
1659
  this.resetTimeoutPeriod();
1656
- }, n.prototype.processHandshakeResponse = function(e) {
1660
+ }, n.prototype.processHandshakeResponse = function (e) {
1657
1661
  let t, i, s;
1658
1662
  try {
1659
1663
  t = this.handshakeProtocol.parseHandshakeResponse(e), s = t[0], i = t[1];
@@ -1668,11 +1672,11 @@ let Vt = (
1668
1672
  throw this.logger.log(h.Error, r), this.handshakeRejecter(r), this.connection.stop(new Error(r)), new Error(r);
1669
1673
  } else { this.logger.log(h.Debug, "Server handshake complete."); }
1670
1674
  return this.handshakeResolver(), s;
1671
- }, n.prototype.resetKeepAliveInterval = function() {
1675
+ }, n.prototype.resetKeepAliveInterval = function () {
1672
1676
  let e = this;
1673
- this.cleanupPingTimer(), this.pingServerHandle = setTimeout(function() {
1674
- return Be(e, void 0, void 0, function() {
1675
- return De(this, function(t) {
1677
+ this.cleanupPingTimer(), this.pingServerHandle = setTimeout(function () {
1678
+ return Be(e, void 0, void 0, function () {
1679
+ return De(this, function (t) {
1676
1680
  switch (t.label) {
1677
1681
  case 0:
1678
1682
  if (this.connectionState !== R.Connected) { return [3, 4]; }
@@ -1693,43 +1697,43 @@ let Vt = (
1693
1697
  });
1694
1698
  });
1695
1699
  }, this.keepAliveIntervalInMilliseconds);
1696
- }, n.prototype.resetTimeoutPeriod = function() {
1700
+ }, n.prototype.resetTimeoutPeriod = function () {
1697
1701
  let e = this;
1698
- (!this.connection.features || !this.connection.features.inherentKeepAlive) && (this.timeoutHandle = setTimeout(function() {
1702
+ (!this.connection.features || !this.connection.features.inherentKeepAlive) && (this.timeoutHandle = setTimeout(function () {
1699
1703
  return e.serverTimeout();
1700
1704
  }, this.serverTimeoutInMilliseconds));
1701
- }, n.prototype.serverTimeout = function() {
1705
+ }, n.prototype.serverTimeout = function () {
1702
1706
  this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."));
1703
- }, n.prototype.invokeClientMethod = function(e) {
1707
+ }, n.prototype.invokeClientMethod = function (e) {
1704
1708
  let t = this, i = this.methods[e.target.toLowerCase()];
1705
1709
  if (i) {
1706
- if (i.forEach(function(r) {
1710
+ if (i.forEach(function (r) {
1707
1711
  return r.apply(t, e.arguments);
1708
1712
  }), e.invocationId) {
1709
1713
  let s = "Server requested a response, which is not supported in this version of the client.";
1710
1714
  this.logger.log(h.Error, s), this.connection.stop(new Error(s));
1711
1715
  }
1712
1716
  } else { this.logger.log(h.Warning, "No client method with the name '" + e.target + "' found."); }
1713
- }, n.prototype.connectionClosed = function(e) {
1717
+ }, n.prototype.connectionClosed = function (e) {
1714
1718
  let t = this, i = this.callbacks;
1715
- this.callbacks = {}, this.connectionState = R.Disconnected, this.handshakeRejecter && this.handshakeRejecter(e), Object.keys(i).forEach(function(s) {
1719
+ this.callbacks = {}, this.connectionState = R.Disconnected, this.handshakeRejecter && this.handshakeRejecter(e), Object.keys(i).forEach(function (s) {
1716
1720
  let r = i[s];
1717
1721
  r(null, e || new Error("Invocation canceled due to connection being closed."));
1718
- }), this.cleanupTimeout(), this.cleanupPingTimer(), this.closedCallbacks.forEach(function(s) {
1722
+ }), this.cleanupTimeout(), this.cleanupPingTimer(), this.closedCallbacks.forEach(function (s) {
1719
1723
  return s.apply(t, [e]);
1720
1724
  });
1721
- }, n.prototype.cleanupPingTimer = function() {
1725
+ }, n.prototype.cleanupPingTimer = function () {
1722
1726
  this.pingServerHandle && clearTimeout(this.pingServerHandle);
1723
- }, n.prototype.cleanupTimeout = function() {
1727
+ }, n.prototype.cleanupTimeout = function () {
1724
1728
  this.timeoutHandle && clearTimeout(this.timeoutHandle);
1725
- }, n.prototype.createInvocation = function(e, t, i) {
1729
+ }, n.prototype.createInvocation = function (e, t, i) {
1726
1730
  if (i) {
1727
- return {
1731
+ return {
1728
1732
  arguments: t,
1729
1733
  target: e,
1730
1734
  type: w.Invocation
1731
- };
1732
- }
1735
+ };
1736
+ }
1733
1737
  let s = this.id;
1734
1738
  return this.id++, {
1735
1739
  arguments: t,
@@ -1737,7 +1741,7 @@ let Vt = (
1737
1741
  target: e,
1738
1742
  type: w.Invocation
1739
1743
  };
1740
- }, n.prototype.createStreamInvocation = function(e, t) {
1744
+ }, n.prototype.createStreamInvocation = function (e, t) {
1741
1745
  let i = this.id;
1742
1746
  return this.id++, {
1743
1747
  arguments: t,
@@ -1745,631 +1749,639 @@ let Vt = (
1745
1749
  target: e,
1746
1750
  type: w.StreamInvocation
1747
1751
  };
1748
- }, n.prototype.createCancelInvocation = function(e) {
1752
+ }, n.prototype.createCancelInvocation = function (e) {
1749
1753
  return {
1750
1754
  invocationId: e,
1751
1755
  type: w.CancelInvocation
1752
1756
  };
1753
1757
  }, n;
1754
1758
  })()
1755
- , v;
1756
- (function(n) {
1759
+ , v;
1760
+ (function (n) {
1757
1761
  n[n.None = 0] = "None", n[n.WebSockets = 1] = "WebSockets", n[n.ServerSentEvents = 2] = "ServerSentEvents", n[n.LongPolling = 4] = "LongPolling";
1758
1762
  })(v || (v = {}));
1759
1763
  let y;
1760
- (function(n) {
1764
+ (function (n) {
1761
1765
  n[n.Text = 1] = "Text", n[n.Binary = 2] = "Binary";
1762
1766
  })(y || (y = {}));
1763
1767
  let Jt = (
1764
1768
 
1765
1769
  /** @class */
1766
- function() {
1770
+ function () {
1767
1771
  function n() {
1768
1772
  this.isAborted = !1, this.onabort = null;
1769
1773
  }
1770
- return n.prototype.abort = function() {
1774
+ return n.prototype.abort = function () {
1771
1775
  this.isAborted || (this.isAborted = !0, this.onabort && this.onabort());
1772
1776
  }, Object.defineProperty(n.prototype, "signal", {
1773
- get: function() {
1777
+ get: function () {
1774
1778
  return this;
1775
1779
  },
1776
1780
  enumerable: !0,
1777
1781
  configurable: !0
1778
1782
  }), Object.defineProperty(n.prototype, "aborted", {
1779
- get: function() {
1783
+ get: function () {
1780
1784
  return this.isAborted;
1781
1785
  },
1782
1786
  enumerable: !0,
1783
1787
  configurable: !0
1784
1788
  }), n;
1785
1789
  })()
1786
- , F = globalThis && globalThis.__awaiter || function(n, e, t, i) {
1787
- return new (t || (t = Promise))(function(s, r) {
1788
- function a(o) {
1789
- try {
1790
- u(i.next(o));
1791
- } catch (l) {
1792
- r(l);
1790
+ , F = globalThis && globalThis.__awaiter || function (n, e, t, i) {
1791
+ return new (t || (t = Promise))(function (s, r) {
1792
+ function a(o) {
1793
+ try {
1794
+ u(i.next(o));
1795
+ } catch (l) {
1796
+ r(l);
1797
+ }
1793
1798
  }
1794
- }
1795
- function c(o) {
1796
- try {
1797
- u(i.throw(o));
1798
- } catch (l) {
1799
- r(l);
1799
+ function c(o) {
1800
+ try {
1801
+ u(i.throw(o));
1802
+ } catch (l) {
1803
+ r(l);
1804
+ }
1805
+ }
1806
+ function u(o) {
1807
+ o.done ? s(o.value) : new t(function (l) {
1808
+ l(o.value);
1809
+ }).then(a, c);
1800
1810
  }
1811
+ u((i = i.apply(n, e || [])).next());
1812
+ });
1813
+ }, H = globalThis && globalThis.__generator || function (n, e) {
1814
+ let t = {
1815
+ label: 0, sent: function () {
1816
+ if (r[0] & 1) { throw r[1]; }
1817
+ return r[1];
1818
+ }, trys: [], ops: []
1819
+ }, i, s, r, a;
1820
+ return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function () {
1821
+ return this;
1822
+ }), a;
1823
+ function c(o) {
1824
+ return function (l) {
1825
+ return u([o, l]);
1826
+ };
1801
1827
  }
1802
1828
  function u(o) {
1803
- o.done ? s(o.value) : new t(function(l) {
1804
- l(o.value);
1805
- }).then(a, c);
1806
- }
1807
- u((i = i.apply(n, e || [])).next());
1808
- });
1809
- }, H = globalThis && globalThis.__generator || function(n, e) {
1810
- let t = { label: 0, sent: function() {
1811
- if (r[0] & 1) { throw r[1]; }
1812
- return r[1];
1813
- }, trys: [], ops: [] }, i, s, r, a;
1814
- return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
1815
- return this;
1816
- }), a;
1817
- function c(o) {
1818
- return function(l) {
1819
- return u([o, l]);
1820
- };
1821
- }
1822
- function u(o) {
1823
- if (i) { throw new TypeError("Generator is already executing."); }
1824
- for (; t;) {
1825
- try {
1826
- if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
1827
- switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
1828
- case 0:
1829
- case 1:
1830
- r = o;
1831
- break;
1832
- case 4:
1833
- return t.label++, { value: o[1], done: !1 };
1834
- case 5:
1835
- t.label++, s = o[1], o = [0];
1836
- continue;
1837
- case 7:
1838
- o = t.ops.pop(), t.trys.pop();
1839
- continue;
1840
- default:
1841
- if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
1842
- t = 0;
1843
- continue;
1844
- }
1845
- if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
1846
- t.label = o[1];
1847
- break;
1848
- }
1849
- if (o[0] === 6 && t.label < r[1]) {
1850
- t.label = r[1], r = o;
1851
- break;
1852
- }
1853
- if (r && t.label < r[2]) {
1854
- t.label = r[2], t.ops.push(o);
1829
+ if (i) { throw new TypeError("Generator is already executing."); }
1830
+ for (; t;) {
1831
+ try {
1832
+ if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
1833
+ switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
1834
+ case 0:
1835
+ case 1:
1836
+ r = o;
1855
1837
  break;
1856
- }
1857
- r[2] && t.ops.pop(), t.trys.pop();
1858
- continue;
1838
+ case 4:
1839
+ return t.label++, { value: o[1], done: !1 };
1840
+ case 5:
1841
+ t.label++, s = o[1], o = [0];
1842
+ continue;
1843
+ case 7:
1844
+ o = t.ops.pop(), t.trys.pop();
1845
+ continue;
1846
+ default:
1847
+ if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
1848
+ t = 0;
1849
+ continue;
1850
+ }
1851
+ if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
1852
+ t.label = o[1];
1853
+ break;
1854
+ }
1855
+ if (o[0] === 6 && t.label < r[1]) {
1856
+ t.label = r[1], r = o;
1857
+ break;
1858
+ }
1859
+ if (r && t.label < r[2]) {
1860
+ t.label = r[2], t.ops.push(o);
1861
+ break;
1862
+ }
1863
+ r[2] && t.ops.pop(), t.trys.pop();
1864
+ continue;
1865
+ }
1866
+ o = e.call(n, t);
1867
+ } catch (l) {
1868
+ o = [6, l], s = 0;
1869
+ } finally {
1870
+ i = r = 0;
1859
1871
  }
1860
- o = e.call(n, t);
1861
- } catch (l) {
1862
- o = [6, l], s = 0;
1863
- } finally {
1864
- i = r = 0;
1865
- }
1866
- }
1867
- if (o[0] & 5) { throw o[1]; }
1868
- return { value: o[0] ? o[1] : void 0, done: !0 };
1869
- }
1870
- }, Fe = (
1872
+ }
1873
+ if (o[0] & 5) { throw o[1]; }
1874
+ return { value: o[0] ? o[1] : void 0, done: !0 };
1875
+ }
1876
+ }, Fe = (
1871
1877
 
1872
- /** @class */
1873
- function() {
1874
- function n(e, t, i, s) {
1875
- this.httpClient = e, this.accessTokenFactory = t, this.logger = i, this.pollAbort = new Jt(), this.logMessageContent = s, this.running = !1, this.onreceive = null, this.onclose = null;
1876
- }
1877
- return Object.defineProperty(n.prototype, "pollAborted", {
1878
- // This is an internal type, not exported from 'index' so this is really just internal.
1879
- get: function() {
1880
- return this.pollAbort.aborted;
1881
- },
1882
- enumerable: !0,
1883
- configurable: !0
1884
- }), n.prototype.connect = function(e, t) {
1885
- return F(this, void 0, void 0, function() {
1886
- let i, s, r, a;
1887
- return H(this, function(c) {
1888
- switch (c.label) {
1889
- case 0:
1890
- if (S.isRequired(e, "url"), S.isRequired(t, "transferFormat"), S.isIn(t, y, "transferFormat"), this.url = e, this.logger.log(h.Trace, "(LongPolling transport) Connecting."), t === y.Binary && typeof XMLHttpRequest < "u" && typeof new XMLHttpRequest().responseType != "string") { throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported."); }
1891
- return i = {
1892
- abortSignal: this.pollAbort.signal,
1893
- headers: {},
1894
- timeout: 1e5
1895
- }, t === y.Binary && (i.responseType = "arraybuffer"), [4, this.getAccessToken()];
1896
- case 1:
1897
- return s = c.sent(), this.updateHeaderToken(i, s), r = e + "&_=" + Date.now(), this.logger.log(h.Trace, "(LongPolling transport) polling: " + r + "."), [4, this.httpClient.get(r, i)];
1898
- case 2:
1899
- return a = c.sent(), a.statusCode !== 200 ? (this.logger.log(h.Error, "(LongPolling transport) Unexpected response code: " + a.statusCode + "."), this.closeError = new J(a.statusText || "", a.statusCode), this.running = !1) : this.running = !0, this.receiving = this.poll(this.url, i), [
1900
- 2
1878
+ /** @class */
1879
+ function () {
1880
+ function n(e, t, i, s) {
1881
+ this.httpClient = e, this.accessTokenFactory = t, this.logger = i, this.pollAbort = new Jt(), this.logMessageContent = s, this.running = !1, this.onreceive = null, this.onclose = null;
1882
+ }
1883
+ return Object.defineProperty(n.prototype, "pollAborted", {
1884
+ // This is an internal type, not exported from 'index' so this is really just internal.
1885
+ get: function () {
1886
+ return this.pollAbort.aborted;
1887
+ },
1888
+ enumerable: !0,
1889
+ configurable: !0
1890
+ }), n.prototype.connect = function (e, t) {
1891
+ return F(this, void 0, void 0, function () {
1892
+ let i, s, r, a;
1893
+ return H(this, function (c) {
1894
+ switch (c.label) {
1895
+ case 0:
1896
+ if (S.isRequired(e, "url"), S.isRequired(t, "transferFormat"), S.isIn(t, y, "transferFormat"), this.url = e, this.logger.log(h.Trace, "(LongPolling transport) Connecting."), t === y.Binary && typeof XMLHttpRequest < "u" && typeof new XMLHttpRequest().responseType != "string") { throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported."); }
1897
+ return i = {
1898
+ abortSignal: this.pollAbort.signal,
1899
+ headers: {},
1900
+ timeout: 1e5
1901
+ }, t === y.Binary && (i.responseType = "arraybuffer"), [4, this.getAccessToken()];
1902
+ case 1:
1903
+ return s = c.sent(), this.updateHeaderToken(i, s), r = e + "&_=" + Date.now(), this.logger.log(h.Trace, "(LongPolling transport) polling: " + r + "."), [4, this.httpClient.get(r, i)];
1904
+ case 2:
1905
+ return a = c.sent(), a.statusCode !== 200 ? (this.logger.log(h.Error, "(LongPolling transport) Unexpected response code: " + a.statusCode + "."), this.closeError = new J(a.statusText || "", a.statusCode), this.running = !1) : this.running = !0, this.receiving = this.poll(this.url, i), [
1906
+ 2
1901
1907
 
1902
- /*return*/
1903
- ];
1904
- }
1908
+ /*return*/
1909
+ ];
1910
+ }
1911
+ });
1905
1912
  });
1906
- });
1907
- }, n.prototype.getAccessToken = function() {
1908
- return F(this, void 0, void 0, function() {
1909
- return H(this, function(e) {
1910
- switch (e.label) {
1911
- case 0:
1912
- return this.accessTokenFactory ? [4, this.accessTokenFactory()] : [3, 2];
1913
- case 1:
1914
- return [2, e.sent()];
1915
- case 2:
1916
- return [2, null];
1917
- }
1913
+ }, n.prototype.getAccessToken = function () {
1914
+ return F(this, void 0, void 0, function () {
1915
+ return H(this, function (e) {
1916
+ switch (e.label) {
1917
+ case 0:
1918
+ return this.accessTokenFactory ? [4, this.accessTokenFactory()] : [3, 2];
1919
+ case 1:
1920
+ return [2, e.sent()];
1921
+ case 2:
1922
+ return [2, null];
1923
+ }
1924
+ });
1918
1925
  });
1919
- });
1920
- }, n.prototype.updateHeaderToken = function(e, t) {
1921
- if (e.headers || (e.headers = {}), t) {
1922
- e.headers.Authorization = "Bearer " + t;
1923
- return;
1924
- }
1925
- e.headers.Authorization && delete e.headers.Authorization;
1926
- }, n.prototype.poll = function(e, t) {
1927
- return F(this, void 0, void 0, function() {
1928
- let i, s, r, a;
1929
- return H(this, function(c) {
1930
- switch (c.label) {
1931
- case 0:
1932
- c.trys.push([0, , 8, 9]), c.label = 1;
1933
- case 1:
1934
- return this.running ? [4, this.getAccessToken()] : [3, 7];
1935
- case 2:
1936
- i = c.sent(), this.updateHeaderToken(t, i), c.label = 3;
1937
- case 3:
1938
- return c.trys.push([3, 5, , 6]), s = e + "&_=" + Date.now(), this.logger.log(h.Trace, "(LongPolling transport) polling: " + s + "."), [4, this.httpClient.get(s, t)];
1939
- case 4:
1940
- return r = c.sent(), r.statusCode === 204 ? (this.logger.log(h.Information, "(LongPolling transport) Poll terminated by server."), this.running = !1) : r.statusCode !== 200 ? (this.logger.log(h.Error, "(LongPolling transport) Unexpected response code: " + r.statusCode + "."), this.closeError = new J(r.statusText || "", r.statusCode), this.running = !1) : r.content ? (this.logger.log(h.Trace, "(LongPolling transport) data received. " + X(r.content, this.logMessageContent) + "."), this.onreceive && this.onreceive(r.content)) : this.logger.log(h.Trace, "(LongPolling transport) Poll timed out, reissuing."), [3, 6];
1941
- case 5:
1942
- return a = c.sent(), this.running ? a instanceof Oe ? this.logger.log(h.Trace, "(LongPolling transport) Poll timed out, reissuing.") : (this.closeError = a, this.running = !1) : this.logger.log(h.Trace, "(LongPolling transport) Poll errored after shutdown: " + a.message), [3, 6];
1943
- case 6:
1944
- return [3, 1];
1945
- case 7:
1946
- return [3, 9];
1947
- case 8:
1948
- return this.logger.log(h.Trace, "(LongPolling transport) Polling complete."), this.pollAborted || this.raiseOnClose(), [
1949
- 7
1926
+ }, n.prototype.updateHeaderToken = function (e, t) {
1927
+ if (e.headers || (e.headers = {}), t) {
1928
+ e.headers.Authorization = "Bearer " + t;
1929
+ return;
1930
+ }
1931
+ e.headers.Authorization && delete e.headers.Authorization;
1932
+ }, n.prototype.poll = function (e, t) {
1933
+ return F(this, void 0, void 0, function () {
1934
+ let i, s, r, a;
1935
+ return H(this, function (c) {
1936
+ switch (c.label) {
1937
+ case 0:
1938
+ c.trys.push([0, , 8, 9]), c.label = 1;
1939
+ case 1:
1940
+ return this.running ? [4, this.getAccessToken()] : [3, 7];
1941
+ case 2:
1942
+ i = c.sent(), this.updateHeaderToken(t, i), c.label = 3;
1943
+ case 3:
1944
+ return c.trys.push([3, 5, , 6]), s = e + "&_=" + Date.now(), this.logger.log(h.Trace, "(LongPolling transport) polling: " + s + "."), [4, this.httpClient.get(s, t)];
1945
+ case 4:
1946
+ return r = c.sent(), r.statusCode === 204 ? (this.logger.log(h.Information, "(LongPolling transport) Poll terminated by server."), this.running = !1) : r.statusCode !== 200 ? (this.logger.log(h.Error, "(LongPolling transport) Unexpected response code: " + r.statusCode + "."), this.closeError = new J(r.statusText || "", r.statusCode), this.running = !1) : r.content ? (this.logger.log(h.Trace, "(LongPolling transport) data received. " + X(r.content, this.logMessageContent) + "."), this.onreceive && this.onreceive(r.content)) : this.logger.log(h.Trace, "(LongPolling transport) Poll timed out, reissuing."), [3, 6];
1947
+ case 5:
1948
+ return a = c.sent(), this.running ? a instanceof Oe ? this.logger.log(h.Trace, "(LongPolling transport) Poll timed out, reissuing.") : (this.closeError = a, this.running = !1) : this.logger.log(h.Trace, "(LongPolling transport) Poll errored after shutdown: " + a.message), [3, 6];
1949
+ case 6:
1950
+ return [3, 1];
1951
+ case 7:
1952
+ return [3, 9];
1953
+ case 8:
1954
+ return this.logger.log(h.Trace, "(LongPolling transport) Polling complete."), this.pollAborted || this.raiseOnClose(), [
1955
+ 7
1950
1956
 
1951
- /*endfinally*/
1952
- ];
1953
- case 9:
1954
- return [
1955
- 2
1957
+ /*endfinally*/
1958
+ ];
1959
+ case 9:
1960
+ return [
1961
+ 2
1956
1962
 
1957
- /*return*/
1958
- ];
1959
- }
1963
+ /*return*/
1964
+ ];
1965
+ }
1966
+ });
1960
1967
  });
1961
- });
1962
- }, n.prototype.send = function(e) {
1963
- return F(this, void 0, void 0, function() {
1964
- return H(this, function(t) {
1965
- return this.running ? [2, Ze(this.logger, "LongPolling", this.httpClient, this.url, this.accessTokenFactory, e, this.logMessageContent)] : [2, Promise.reject(new Error("Cannot send until the transport is connected"))];
1968
+ }, n.prototype.send = function (e) {
1969
+ return F(this, void 0, void 0, function () {
1970
+ return H(this, function (t) {
1971
+ return this.running ? [2, Ze(this.logger, "LongPolling", this.httpClient, this.url, this.accessTokenFactory, e, this.logMessageContent)] : [2, Promise.reject(new Error("Cannot send until the transport is connected"))];
1972
+ });
1966
1973
  });
1967
- });
1968
- }, n.prototype.stop = function() {
1969
- return F(this, void 0, void 0, function() {
1970
- let e, t;
1971
- return H(this, function(i) {
1972
- switch (i.label) {
1973
- case 0:
1974
- this.logger.log(h.Trace, "(LongPolling transport) Stopping polling."), this.running = !1, this.pollAbort.abort(), i.label = 1;
1975
- case 1:
1976
- return i.trys.push([1, , 5, 6]), [4, this.receiving];
1977
- case 2:
1978
- return i.sent(), this.logger.log(h.Trace, "(LongPolling transport) sending DELETE request to " + this.url + "."), e = {
1979
- headers: {}
1980
- }, [4, this.getAccessToken()];
1981
- case 3:
1982
- return t = i.sent(), this.updateHeaderToken(e, t), [4, this.httpClient.delete(this.url, e)];
1983
- case 4:
1984
- return i.sent(), this.logger.log(h.Trace, "(LongPolling transport) DELETE request sent."), [3, 6];
1985
- case 5:
1986
- return this.logger.log(h.Trace, "(LongPolling transport) Stop finished."), this.raiseOnClose(), [
1987
- 7
1974
+ }, n.prototype.stop = function () {
1975
+ return F(this, void 0, void 0, function () {
1976
+ let e, t;
1977
+ return H(this, function (i) {
1978
+ switch (i.label) {
1979
+ case 0:
1980
+ this.logger.log(h.Trace, "(LongPolling transport) Stopping polling."), this.running = !1, this.pollAbort.abort(), i.label = 1;
1981
+ case 1:
1982
+ return i.trys.push([1, , 5, 6]), [4, this.receiving];
1983
+ case 2:
1984
+ return i.sent(), this.logger.log(h.Trace, "(LongPolling transport) sending DELETE request to " + this.url + "."), e = {
1985
+ headers: {}
1986
+ }, [4, this.getAccessToken()];
1987
+ case 3:
1988
+ return t = i.sent(), this.updateHeaderToken(e, t), [4, this.httpClient.delete(this.url, e)];
1989
+ case 4:
1990
+ return i.sent(), this.logger.log(h.Trace, "(LongPolling transport) DELETE request sent."), [3, 6];
1991
+ case 5:
1992
+ return this.logger.log(h.Trace, "(LongPolling transport) Stop finished."), this.raiseOnClose(), [
1993
+ 7
1988
1994
 
1989
- /*endfinally*/
1990
- ];
1991
- case 6:
1992
- return [
1993
- 2
1995
+ /*endfinally*/
1996
+ ];
1997
+ case 6:
1998
+ return [
1999
+ 2
1994
2000
 
1995
- /*return*/
1996
- ];
1997
- }
2001
+ /*return*/
2002
+ ];
2003
+ }
2004
+ });
1998
2005
  });
1999
- });
2000
- }, n.prototype.raiseOnClose = function() {
2001
- if (this.onclose) {
2002
- let e = "(LongPolling transport) Firing onclose event.";
2003
- this.closeError && (e += " Error: " + this.closeError), this.logger.log(h.Trace, e), this.onclose(this.closeError);
2006
+ }, n.prototype.raiseOnClose = function () {
2007
+ if (this.onclose) {
2008
+ let e = "(LongPolling transport) Firing onclose event.";
2009
+ this.closeError && (e += " Error: " + this.closeError), this.logger.log(h.Trace, e), this.onclose(this.closeError);
2010
+ }
2011
+ }, n;
2012
+ })()
2013
+ , He = globalThis && globalThis.__awaiter || function (n, e, t, i) {
2014
+ return new (t || (t = Promise))(function (s, r) {
2015
+ function a(o) {
2016
+ try {
2017
+ u(i.next(o));
2018
+ } catch (l) {
2019
+ r(l);
2020
+ }
2004
2021
  }
2005
- }, n;
2006
- })()
2007
- , He = globalThis && globalThis.__awaiter || function(n, e, t, i) {
2008
- return new (t || (t = Promise))(function(s, r) {
2009
- function a(o) {
2010
- try {
2011
- u(i.next(o));
2012
- } catch (l) {
2013
- r(l);
2022
+ function c(o) {
2023
+ try {
2024
+ u(i.throw(o));
2025
+ } catch (l) {
2026
+ r(l);
2027
+ }
2014
2028
  }
2015
- }
2016
- function c(o) {
2017
- try {
2018
- u(i.throw(o));
2019
- } catch (l) {
2020
- r(l);
2029
+ function u(o) {
2030
+ o.done ? s(o.value) : new t(function (l) {
2031
+ l(o.value);
2032
+ }).then(a, c);
2021
2033
  }
2022
- }
2023
- function u(o) {
2024
- o.done ? s(o.value) : new t(function(l) {
2025
- l(o.value);
2026
- }).then(a, c);
2027
- }
2028
- u((i = i.apply(n, e || [])).next());
2029
- });
2030
- }, Ue = globalThis && globalThis.__generator || function(n, e) {
2031
- let t = { label: 0, sent: function() {
2032
- if (r[0] & 1) { throw r[1]; }
2033
- return r[1];
2034
- }, trys: [], ops: [] }, i, s, r, a;
2035
- return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
2036
- return this;
2037
- }), a;
2038
- function c(o) {
2039
- return function(l) {
2040
- return u([o, l]);
2041
- };
2042
- }
2043
- function u(o) {
2044
- if (i) { throw new TypeError("Generator is already executing."); }
2045
- for (; t;) {
2046
- try {
2047
- if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
2048
- switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
2049
- case 0:
2050
- case 1:
2051
- r = o;
2052
- break;
2053
- case 4:
2054
- return t.label++, { value: o[1], done: !1 };
2055
- case 5:
2056
- t.label++, s = o[1], o = [0];
2057
- continue;
2058
- case 7:
2059
- o = t.ops.pop(), t.trys.pop();
2060
- continue;
2061
- default:
2062
- if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
2063
- t = 0;
2064
- continue;
2065
- }
2066
- if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
2067
- t.label = o[1];
2068
- break;
2069
- }
2070
- if (o[0] === 6 && t.label < r[1]) {
2071
- t.label = r[1], r = o;
2072
- break;
2073
- }
2074
- if (r && t.label < r[2]) {
2075
- t.label = r[2], t.ops.push(o);
2076
- break;
2077
- }
2078
- r[2] && t.ops.pop(), t.trys.pop();
2079
- continue;
2080
- }
2081
- o = e.call(n, t);
2082
- } catch (l) {
2083
- o = [6, l], s = 0;
2084
- } finally {
2085
- i = r = 0;
2086
- }
2087
- }
2088
- if (o[0] & 5) { throw o[1]; }
2089
- return { value: o[0] ? o[1] : void 0, done: !0 };
2090
- }
2091
- }, Xt = (
2092
-
2093
- /** @class */
2094
- function() {
2095
- function n(e, t, i, s, r) {
2096
- this.httpClient = e, this.accessTokenFactory = t, this.logger = i, this.logMessageContent = s, this.eventSourceConstructor = r, this.onreceive = null, this.onclose = null;
2097
- }
2098
- return n.prototype.connect = function(e, t) {
2099
- return He(this, void 0, void 0, function() {
2100
- let i, s = this;
2101
- return Ue(this, function(r) {
2102
- switch (r.label) {
2034
+ u((i = i.apply(n, e || [])).next());
2035
+ });
2036
+ }, Ue = globalThis && globalThis.__generator || function (n, e) {
2037
+ let t = {
2038
+ label: 0, sent: function () {
2039
+ if (r[0] & 1) { throw r[1]; }
2040
+ return r[1];
2041
+ }, trys: [], ops: []
2042
+ }, i, s, r, a;
2043
+ return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function () {
2044
+ return this;
2045
+ }), a;
2046
+ function c(o) {
2047
+ return function (l) {
2048
+ return u([o, l]);
2049
+ };
2050
+ }
2051
+ function u(o) {
2052
+ if (i) { throw new TypeError("Generator is already executing."); }
2053
+ for (; t;) {
2054
+ try {
2055
+ if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
2056
+ switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
2103
2057
  case 0:
2104
- return S.isRequired(e, "url"), S.isRequired(t, "transferFormat"), S.isIn(t, y, "transferFormat"), this.logger.log(h.Trace, "(SSE transport) Connecting."), this.url = e, this.accessTokenFactory ? [4, this.accessTokenFactory()] : [3, 2];
2105
2058
  case 1:
2106
- i = r.sent(), i && (e += (e.indexOf("?") < 0 ? "?" : "&") + ("access_token=" + encodeURIComponent(i))), r.label = 2;
2107
- case 2:
2108
- return [2, new Promise(function(a, c) {
2109
- let u = !1;
2110
- if (t !== y.Text) {
2111
- c(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));
2112
- return;
2113
- }
2114
- let o;
2115
- if (typeof window < "u") { o = new s.eventSourceConstructor(e, { withCredentials: !0 }); } else {
2116
- let l = s.httpClient.getCookieString(e);
2117
- o = new s.eventSourceConstructor(e, { withCredentials: !0, headers: { Cookie: l } });
2118
- }
2119
- try {
2120
- o.onmessage = function(d) {
2121
- if (s.onreceive) {
2122
- try {
2123
- s.logger.log(h.Trace, "(SSE transport) data received. " + X(d.data, s.logMessageContent) + "."), s.onreceive(d.data);
2124
- } catch (f) {
2125
- s.close(f);
2126
- return;
2127
- }
2128
- }
2129
- }, o.onerror = function(d) {
2130
- let f = new Error(d.data || "Error occurred");
2131
- u ? s.close(f) : c(f);
2132
- }, o.onopen = function() {
2133
- s.logger.log(h.Information, "SSE connected to " + s.url), s.eventSource = o, u = !0, a();
2134
- };
2135
- } catch (d) {
2136
- c(d);
2137
- return;
2138
- }
2139
- })];
2059
+ r = o;
2060
+ break;
2061
+ case 4:
2062
+ return t.label++, { value: o[1], done: !1 };
2063
+ case 5:
2064
+ t.label++, s = o[1], o = [0];
2065
+ continue;
2066
+ case 7:
2067
+ o = t.ops.pop(), t.trys.pop();
2068
+ continue;
2069
+ default:
2070
+ if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
2071
+ t = 0;
2072
+ continue;
2073
+ }
2074
+ if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
2075
+ t.label = o[1];
2076
+ break;
2077
+ }
2078
+ if (o[0] === 6 && t.label < r[1]) {
2079
+ t.label = r[1], r = o;
2080
+ break;
2081
+ }
2082
+ if (r && t.label < r[2]) {
2083
+ t.label = r[2], t.ops.push(o);
2084
+ break;
2085
+ }
2086
+ r[2] && t.ops.pop(), t.trys.pop();
2087
+ continue;
2140
2088
  }
2089
+ o = e.call(n, t);
2090
+ } catch (l) {
2091
+ o = [6, l], s = 0;
2092
+ } finally {
2093
+ i = r = 0;
2094
+ }
2095
+ }
2096
+ if (o[0] & 5) { throw o[1]; }
2097
+ return { value: o[0] ? o[1] : void 0, done: !0 };
2098
+ }
2099
+ }, Xt = (
2100
+
2101
+ /** @class */
2102
+ function () {
2103
+ function n(e, t, i, s, r) {
2104
+ this.httpClient = e, this.accessTokenFactory = t, this.logger = i, this.logMessageContent = s, this.eventSourceConstructor = r, this.onreceive = null, this.onclose = null;
2105
+ }
2106
+ return n.prototype.connect = function (e, t) {
2107
+ return He(this, void 0, void 0, function () {
2108
+ let i, s = this;
2109
+ return Ue(this, function (r) {
2110
+ switch (r.label) {
2111
+ case 0:
2112
+ return S.isRequired(e, "url"), S.isRequired(t, "transferFormat"), S.isIn(t, y, "transferFormat"), this.logger.log(h.Trace, "(SSE transport) Connecting."), this.url = e, this.accessTokenFactory ? [4, this.accessTokenFactory()] : [3, 2];
2113
+ case 1:
2114
+ i = r.sent(), i && (e += (e.indexOf("?") < 0 ? "?" : "&") + ("access_token=" + encodeURIComponent(i))), r.label = 2;
2115
+ case 2:
2116
+ return [2, new Promise(function (a, c) {
2117
+ let u = !1;
2118
+ if (t !== y.Text) {
2119
+ c(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));
2120
+ return;
2121
+ }
2122
+ let o;
2123
+ if (typeof window < "u") { o = new s.eventSourceConstructor(e, { withCredentials: !0 }); } else {
2124
+ let l = s.httpClient.getCookieString(e);
2125
+ o = new s.eventSourceConstructor(e, { withCredentials: !0, headers: { Cookie: l } });
2126
+ }
2127
+ try {
2128
+ o.onmessage = function (d) {
2129
+ if (s.onreceive) {
2130
+ try {
2131
+ s.logger.log(h.Trace, "(SSE transport) data received. " + X(d.data, s.logMessageContent) + "."), s.onreceive(d.data);
2132
+ } catch (f) {
2133
+ s.close(f);
2134
+ return;
2135
+ }
2136
+ }
2137
+ }, o.onerror = function (d) {
2138
+ let f = new Error(d.data || "Error occurred");
2139
+ u ? s.close(f) : c(f);
2140
+ }, o.onopen = function () {
2141
+ s.logger.log(h.Information, "SSE connected to " + s.url), s.eventSource = o, u = !0, a();
2142
+ };
2143
+ } catch (d) {
2144
+ c(d);
2145
+ return;
2146
+ }
2147
+ })];
2148
+ }
2149
+ });
2141
2150
  });
2142
- });
2143
- }, n.prototype.send = function(e) {
2144
- return He(this, void 0, void 0, function() {
2145
- return Ue(this, function(t) {
2146
- return this.eventSource ? [2, Ze(this.logger, "SSE", this.httpClient, this.url, this.accessTokenFactory, e, this.logMessageContent)] : [2, Promise.reject(new Error("Cannot send until the transport is connected"))];
2151
+ }, n.prototype.send = function (e) {
2152
+ return He(this, void 0, void 0, function () {
2153
+ return Ue(this, function (t) {
2154
+ return this.eventSource ? [2, Ze(this.logger, "SSE", this.httpClient, this.url, this.accessTokenFactory, e, this.logMessageContent)] : [2, Promise.reject(new Error("Cannot send until the transport is connected"))];
2155
+ });
2147
2156
  });
2148
- });
2149
- }, n.prototype.stop = function() {
2150
- return this.close(), Promise.resolve();
2151
- }, n.prototype.close = function(e) {
2152
- this.eventSource && (this.eventSource.close(), this.eventSource = void 0, this.onclose && this.onclose(e));
2153
- }, n;
2154
- })()
2155
- , Yt = globalThis && globalThis.__awaiter || function(n, e, t, i) {
2156
- return new (t || (t = Promise))(function(s, r) {
2157
- function a(o) {
2158
- try {
2159
- u(i.next(o));
2160
- } catch (l) {
2161
- r(l);
2157
+ }, n.prototype.stop = function () {
2158
+ return this.close(), Promise.resolve();
2159
+ }, n.prototype.close = function (e) {
2160
+ this.eventSource && (this.eventSource.close(), this.eventSource = void 0, this.onclose && this.onclose(e));
2161
+ }, n;
2162
+ })()
2163
+ , Yt = globalThis && globalThis.__awaiter || function (n, e, t, i) {
2164
+ return new (t || (t = Promise))(function (s, r) {
2165
+ function a(o) {
2166
+ try {
2167
+ u(i.next(o));
2168
+ } catch (l) {
2169
+ r(l);
2170
+ }
2162
2171
  }
2163
- }
2164
- function c(o) {
2165
- try {
2166
- u(i.throw(o));
2167
- } catch (l) {
2168
- r(l);
2172
+ function c(o) {
2173
+ try {
2174
+ u(i.throw(o));
2175
+ } catch (l) {
2176
+ r(l);
2177
+ }
2169
2178
  }
2179
+ function u(o) {
2180
+ o.done ? s(o.value) : new t(function (l) {
2181
+ l(o.value);
2182
+ }).then(a, c);
2183
+ }
2184
+ u((i = i.apply(n, e || [])).next());
2185
+ });
2186
+ }, Qt = globalThis && globalThis.__generator || function (n, e) {
2187
+ let t = {
2188
+ label: 0, sent: function () {
2189
+ if (r[0] & 1) { throw r[1]; }
2190
+ return r[1];
2191
+ }, trys: [], ops: []
2192
+ }, i, s, r, a;
2193
+ return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function () {
2194
+ return this;
2195
+ }), a;
2196
+ function c(o) {
2197
+ return function (l) {
2198
+ return u([o, l]);
2199
+ };
2170
2200
  }
2171
2201
  function u(o) {
2172
- o.done ? s(o.value) : new t(function(l) {
2173
- l(o.value);
2174
- }).then(a, c);
2175
- }
2176
- u((i = i.apply(n, e || [])).next());
2177
- });
2178
- }, Qt = globalThis && globalThis.__generator || function(n, e) {
2179
- let t = { label: 0, sent: function() {
2180
- if (r[0] & 1) { throw r[1]; }
2181
- return r[1];
2182
- }, trys: [], ops: [] }, i, s, r, a;
2183
- return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
2184
- return this;
2185
- }), a;
2186
- function c(o) {
2187
- return function(l) {
2188
- return u([o, l]);
2189
- };
2190
- }
2191
- function u(o) {
2192
- if (i) { throw new TypeError("Generator is already executing."); }
2193
- for (; t;) {
2194
- try {
2195
- if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
2196
- switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
2197
- case 0:
2198
- case 1:
2199
- r = o;
2200
- break;
2201
- case 4:
2202
- return t.label++, { value: o[1], done: !1 };
2203
- case 5:
2204
- t.label++, s = o[1], o = [0];
2205
- continue;
2206
- case 7:
2207
- o = t.ops.pop(), t.trys.pop();
2208
- continue;
2209
- default:
2210
- if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
2211
- t = 0;
2212
- continue;
2213
- }
2214
- if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
2215
- t.label = o[1];
2216
- break;
2217
- }
2218
- if (o[0] === 6 && t.label < r[1]) {
2219
- t.label = r[1], r = o;
2220
- break;
2221
- }
2222
- if (r && t.label < r[2]) {
2223
- t.label = r[2], t.ops.push(o);
2224
- break;
2225
- }
2226
- r[2] && t.ops.pop(), t.trys.pop();
2227
- continue;
2228
- }
2229
- o = e.call(n, t);
2230
- } catch (l) {
2231
- o = [6, l], s = 0;
2232
- } finally {
2233
- i = r = 0;
2234
- }
2235
- }
2236
- if (o[0] & 5) { throw o[1]; }
2237
- return { value: o[0] ? o[1] : void 0, done: !0 };
2238
- }
2239
- }, Zt = (
2240
-
2241
- /** @class */
2242
- function() {
2243
- function n(e, t, i, s, r) {
2244
- this.logger = i, this.accessTokenFactory = t, this.logMessageContent = s, this.webSocketConstructor = r, this.httpClient = e, this.onreceive = null, this.onclose = null;
2245
- }
2246
- return n.prototype.connect = function(e, t) {
2247
- return Yt(this, void 0, void 0, function() {
2248
- let i, s = this;
2249
- return Qt(this, function(r) {
2250
- switch (r.label) {
2202
+ if (i) { throw new TypeError("Generator is already executing."); }
2203
+ for (; t;) {
2204
+ try {
2205
+ if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
2206
+ switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
2251
2207
  case 0:
2252
- return S.isRequired(e, "url"), S.isRequired(t, "transferFormat"), S.isIn(t, y, "transferFormat"), this.logger.log(h.Trace, "(WebSockets transport) Connecting."), this.accessTokenFactory ? [4, this.accessTokenFactory()] : [3, 2];
2253
2208
  case 1:
2254
- i = r.sent(), i && (e += (e.indexOf("?") < 0 ? "?" : "&") + ("access_token=" + encodeURIComponent(i))), r.label = 2;
2255
- case 2:
2256
- return [2, new Promise(function(a, c) {
2257
- e = e.replace(/^http/, "ws");
2258
- let u, o = s.httpClient.getCookieString(e);
2259
- typeof window > "u" && o && (u = new s.webSocketConstructor(e, void 0, {
2260
- headers: {
2261
- Cookie: "" + o
2262
- }
2263
- })), u || (u = new s.webSocketConstructor(e)), t === y.Binary && (u.binaryType = "arraybuffer"), u.onopen = function(l) {
2264
- s.logger.log(h.Information, "WebSocket connected to " + e + "."), s.webSocket = u, a();
2265
- }, u.onerror = function(l) {
2266
- let d = null;
2267
- typeof ErrorEvent < "u" && l instanceof ErrorEvent && (d = l.error), c(d);
2268
- }, u.onmessage = function(l) {
2269
- s.logger.log(h.Trace, "(WebSockets transport) data received. " + X(l.data, s.logMessageContent) + "."), s.onreceive && s.onreceive(l.data);
2270
- }, u.onclose = function(l) {
2271
- return s.close(l);
2272
- };
2273
- })];
2209
+ r = o;
2210
+ break;
2211
+ case 4:
2212
+ return t.label++, { value: o[1], done: !1 };
2213
+ case 5:
2214
+ t.label++, s = o[1], o = [0];
2215
+ continue;
2216
+ case 7:
2217
+ o = t.ops.pop(), t.trys.pop();
2218
+ continue;
2219
+ default:
2220
+ if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
2221
+ t = 0;
2222
+ continue;
2223
+ }
2224
+ if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
2225
+ t.label = o[1];
2226
+ break;
2227
+ }
2228
+ if (o[0] === 6 && t.label < r[1]) {
2229
+ t.label = r[1], r = o;
2230
+ break;
2231
+ }
2232
+ if (r && t.label < r[2]) {
2233
+ t.label = r[2], t.ops.push(o);
2234
+ break;
2235
+ }
2236
+ r[2] && t.ops.pop(), t.trys.pop();
2237
+ continue;
2274
2238
  }
2275
- });
2276
- });
2277
- }, n.prototype.send = function(e) {
2278
- return this.webSocket && this.webSocket.readyState === this.webSocketConstructor.OPEN ? (this.logger.log(h.Trace, "(WebSockets transport) sending data. " + X(e, this.logMessageContent) + "."), this.webSocket.send(e), Promise.resolve()) : Promise.reject("WebSocket is not in the OPEN state");
2279
- }, n.prototype.stop = function() {
2280
- return this.webSocket && (this.webSocket.onclose = function() {
2281
- }, this.webSocket.onmessage = function() {
2282
- }, this.webSocket.onerror = function() {
2283
- }, this.webSocket.close(), this.webSocket = void 0, this.close(void 0)), Promise.resolve();
2284
- }, n.prototype.close = function(e) {
2285
- this.logger.log(h.Trace, "(WebSockets transport) socket closed."), this.onclose && (e && (e.wasClean === !1 || e.code !== 1e3) ? this.onclose(new Error("WebSocket closed with status code: " + e.code + " (" + e.reason + ").")) : this.onclose());
2286
- }, n;
2287
- })()
2288
- , ie = globalThis && globalThis.__awaiter || function(n, e, t, i) {
2289
- return new (t || (t = Promise))(function(s, r) {
2290
- function a(o) {
2291
- try {
2292
- u(i.next(o));
2293
- } catch (l) {
2294
- r(l);
2239
+ o = e.call(n, t);
2240
+ } catch (l) {
2241
+ o = [6, l], s = 0;
2242
+ } finally {
2243
+ i = r = 0;
2244
+ }
2295
2245
  }
2246
+ if (o[0] & 5) { throw o[1]; }
2247
+ return { value: o[0] ? o[1] : void 0, done: !0 };
2296
2248
  }
2297
- function c(o) {
2298
- try {
2299
- u(i.throw(o));
2300
- } catch (l) {
2301
- r(l);
2249
+ }, Zt = (
2250
+
2251
+ /** @class */
2252
+ function () {
2253
+ function n(e, t, i, s, r) {
2254
+ this.logger = i, this.accessTokenFactory = t, this.logMessageContent = s, this.webSocketConstructor = r, this.httpClient = e, this.onreceive = null, this.onclose = null;
2255
+ }
2256
+ return n.prototype.connect = function (e, t) {
2257
+ return Yt(this, void 0, void 0, function () {
2258
+ let i, s = this;
2259
+ return Qt(this, function (r) {
2260
+ switch (r.label) {
2261
+ case 0:
2262
+ return S.isRequired(e, "url"), S.isRequired(t, "transferFormat"), S.isIn(t, y, "transferFormat"), this.logger.log(h.Trace, "(WebSockets transport) Connecting."), this.accessTokenFactory ? [4, this.accessTokenFactory()] : [3, 2];
2263
+ case 1:
2264
+ i = r.sent(), i && (e += (e.indexOf("?") < 0 ? "?" : "&") + ("access_token=" + encodeURIComponent(i))), r.label = 2;
2265
+ case 2:
2266
+ return [2, new Promise(function (a, c) {
2267
+ e = e.replace(/^http/, "ws");
2268
+ let u, o = s.httpClient.getCookieString(e);
2269
+ typeof window > "u" && o && (u = new s.webSocketConstructor(e, void 0, {
2270
+ headers: {
2271
+ Cookie: "" + o
2272
+ }
2273
+ })), u || (u = new s.webSocketConstructor(e)), t === y.Binary && (u.binaryType = "arraybuffer"), u.onopen = function (l) {
2274
+ s.logger.log(h.Information, "WebSocket connected to " + e + "."), s.webSocket = u, a();
2275
+ }, u.onerror = function (l) {
2276
+ let d = null;
2277
+ typeof ErrorEvent < "u" && l instanceof ErrorEvent && (d = l.error), c(d);
2278
+ }, u.onmessage = function (l) {
2279
+ s.logger.log(h.Trace, "(WebSockets transport) data received. " + X(l.data, s.logMessageContent) + "."), s.onreceive && s.onreceive(l.data);
2280
+ }, u.onclose = function (l) {
2281
+ return s.close(l);
2282
+ };
2283
+ })];
2284
+ }
2285
+ });
2286
+ });
2287
+ }, n.prototype.send = function (e) {
2288
+ return this.webSocket && this.webSocket.readyState === this.webSocketConstructor.OPEN ? (this.logger.log(h.Trace, "(WebSockets transport) sending data. " + X(e, this.logMessageContent) + "."), this.webSocket.send(e), Promise.resolve()) : Promise.reject("WebSocket is not in the OPEN state");
2289
+ }, n.prototype.stop = function () {
2290
+ return this.webSocket && (this.webSocket.onclose = function () {
2291
+ }, this.webSocket.onmessage = function () {
2292
+ }, this.webSocket.onerror = function () {
2293
+ }, this.webSocket.close(), this.webSocket = void 0, this.close(void 0)), Promise.resolve();
2294
+ }, n.prototype.close = function (e) {
2295
+ this.logger.log(h.Trace, "(WebSockets transport) socket closed."), this.onclose && (e && (e.wasClean === !1 || e.code !== 1e3) ? this.onclose(new Error("WebSocket closed with status code: " + e.code + " (" + e.reason + ").")) : this.onclose());
2296
+ }, n;
2297
+ })()
2298
+ , ie = globalThis && globalThis.__awaiter || function (n, e, t, i) {
2299
+ return new (t || (t = Promise))(function (s, r) {
2300
+ function a(o) {
2301
+ try {
2302
+ u(i.next(o));
2303
+ } catch (l) {
2304
+ r(l);
2305
+ }
2306
+ }
2307
+ function c(o) {
2308
+ try {
2309
+ u(i.throw(o));
2310
+ } catch (l) {
2311
+ r(l);
2312
+ }
2302
2313
  }
2314
+ function u(o) {
2315
+ o.done ? s(o.value) : new t(function (l) {
2316
+ l(o.value);
2317
+ }).then(a, c);
2318
+ }
2319
+ u((i = i.apply(n, e || [])).next());
2320
+ });
2321
+ }, U = globalThis && globalThis.__generator || function (n, e) {
2322
+ let t = {
2323
+ label: 0, sent: function () {
2324
+ if (r[0] & 1) { throw r[1]; }
2325
+ return r[1];
2326
+ }, trys: [], ops: []
2327
+ }, i, s, r, a;
2328
+ return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function () {
2329
+ return this;
2330
+ }), a;
2331
+ function c(o) {
2332
+ return function (l) {
2333
+ return u([o, l]);
2334
+ };
2303
2335
  }
2304
2336
  function u(o) {
2305
- o.done ? s(o.value) : new t(function(l) {
2306
- l(o.value);
2307
- }).then(a, c);
2308
- }
2309
- u((i = i.apply(n, e || [])).next());
2310
- });
2311
- }, U = globalThis && globalThis.__generator || function(n, e) {
2312
- let t = { label: 0, sent: function() {
2313
- if (r[0] & 1) { throw r[1]; }
2314
- return r[1];
2315
- }, trys: [], ops: [] }, i, s, r, a;
2316
- return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
2317
- return this;
2318
- }), a;
2319
- function c(o) {
2320
- return function(l) {
2321
- return u([o, l]);
2322
- };
2323
- }
2324
- function u(o) {
2325
- if (i) { throw new TypeError("Generator is already executing."); }
2326
- for (; t;) {
2327
- try {
2328
- if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
2329
- switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
2330
- case 0:
2331
- case 1:
2332
- r = o;
2333
- break;
2334
- case 4:
2335
- return t.label++, { value: o[1], done: !1 };
2336
- case 5:
2337
- t.label++, s = o[1], o = [0];
2338
- continue;
2339
- case 7:
2340
- o = t.ops.pop(), t.trys.pop();
2341
- continue;
2342
- default:
2343
- if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
2344
- t = 0;
2345
- continue;
2346
- }
2347
- if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
2348
- t.label = o[1];
2349
- break;
2350
- }
2351
- if (o[0] === 6 && t.label < r[1]) {
2352
- t.label = r[1], r = o;
2353
- break;
2354
- }
2355
- if (r && t.label < r[2]) {
2356
- t.label = r[2], t.ops.push(o);
2337
+ if (i) { throw new TypeError("Generator is already executing."); }
2338
+ for (; t;) {
2339
+ try {
2340
+ if (i = 1, s && (r = o[0] & 2 ? s.return : o[0] ? s.throw || ((r = s.return) && r.call(s), 0) : s.next) && !(r = r.call(s, o[1])).done) { return r; }
2341
+ switch (s = 0, r && (o = [o[0] & 2, r.value]), o[0]) {
2342
+ case 0:
2343
+ case 1:
2344
+ r = o;
2357
2345
  break;
2358
- }
2359
- r[2] && t.ops.pop(), t.trys.pop();
2360
- continue;
2346
+ case 4:
2347
+ return t.label++, { value: o[1], done: !1 };
2348
+ case 5:
2349
+ t.label++, s = o[1], o = [0];
2350
+ continue;
2351
+ case 7:
2352
+ o = t.ops.pop(), t.trys.pop();
2353
+ continue;
2354
+ default:
2355
+ if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (o[0] === 6 || o[0] === 2)) {
2356
+ t = 0;
2357
+ continue;
2358
+ }
2359
+ if (o[0] === 3 && (!r || o[1] > r[0] && o[1] < r[3])) {
2360
+ t.label = o[1];
2361
+ break;
2362
+ }
2363
+ if (o[0] === 6 && t.label < r[1]) {
2364
+ t.label = r[1], r = o;
2365
+ break;
2366
+ }
2367
+ if (r && t.label < r[2]) {
2368
+ t.label = r[2], t.ops.push(o);
2369
+ break;
2370
+ }
2371
+ r[2] && t.ops.pop(), t.trys.pop();
2372
+ continue;
2373
+ }
2374
+ o = e.call(n, t);
2375
+ } catch (l) {
2376
+ o = [6, l], s = 0;
2377
+ } finally {
2378
+ i = r = 0;
2361
2379
  }
2362
- o = e.call(n, t);
2363
- } catch (l) {
2364
- o = [6, l], s = 0;
2365
- } finally {
2366
- i = r = 0;
2367
- }
2368
- }
2369
- if (o[0] & 5) { throw o[1]; }
2370
- return { value: o[0] ? o[1] : void 0, done: !0 };
2371
- }
2372
- }, We = 100, ke = null, Ee = null;
2380
+ }
2381
+ if (o[0] & 5) { throw o[1]; }
2382
+ return { value: o[0] ? o[1] : void 0, done: !0 };
2383
+ }
2384
+ }, We = 100, ke = null, Ee = null;
2373
2385
  if (typeof window > "u" && typeof require < "u") {
2374
2386
  let Ke = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
2375
2387
  ke = Ke("ws"), Ee = Ke("eventsource");
@@ -2377,20 +2389,20 @@ if (typeof window > "u" && typeof require < "u") {
2377
2389
  let ei = (
2378
2390
 
2379
2391
  /** @class */
2380
- function() {
2392
+ function () {
2381
2393
  function n(e, t) {
2382
2394
  t === void 0 && (t = {}), this.features = {}, S.isRequired(e, "url"), this.logger = Gt(t.logger), this.baseUrl = this.resolveUrl(e), t = t || {}, t.logMessageContent = t.logMessageContent || !1;
2383
2395
  let i = typeof window > "u";
2384
2396
  !i && typeof WebSocket < "u" && !t.WebSocket ? t.WebSocket = WebSocket : i && !t.WebSocket && ke && (t.WebSocket = ke), !i && typeof EventSource < "u" && !t.EventSource ? t.EventSource = EventSource : i && !t.EventSource && typeof Ee < "u" && (t.EventSource = Ee), this.httpClient = t.httpClient || new Ht(this.logger), this.connectionState = 2, this.options = t, this.onreceive = null, this.onclose = null;
2385
2397
  }
2386
- return n.prototype.start = function(e) {
2398
+ return n.prototype.start = function (e) {
2387
2399
  return e = e || y.Binary, S.isIn(e, y, "transferFormat"), this.logger.log(h.Debug, "Starting connection with transfer format '" + y[e] + "'."), this.connectionState !== 2 ? Promise.reject(new Error("Cannot start a connection that is not in the 'Disconnected' state.")) : (this.connectionState = 0, this.startPromise = this.startInternal(e), this.startPromise);
2388
- }, n.prototype.send = function(e) {
2400
+ }, n.prototype.send = function (e) {
2389
2401
  if (this.connectionState !== 1) { throw new Error("Cannot send data if the connection is not in the 'Connected' State."); }
2390
2402
  return this.transport.send(e);
2391
- }, n.prototype.stop = function(e) {
2392
- return ie(this, void 0, void 0, function() {
2393
- return U(this, function(t) {
2403
+ }, n.prototype.stop = function (e) {
2404
+ return ie(this, void 0, void 0, function () {
2405
+ return U(this, function (t) {
2394
2406
  switch (t.label) {
2395
2407
  case 0:
2396
2408
  this.connectionState = 2, this.stopError = e, t.label = 1;
@@ -2413,10 +2425,10 @@ let ei = (
2413
2425
  }
2414
2426
  });
2415
2427
  });
2416
- }, n.prototype.startInternal = function(e) {
2417
- return ie(this, void 0, void 0, function() {
2428
+ }, n.prototype.startInternal = function (e) {
2429
+ return ie(this, void 0, void 0, function () {
2418
2430
  let t, i, s, r, a, c, u, o = this;
2419
- return U(this, function(l) {
2431
+ return U(this, function (l) {
2420
2432
  switch (l.label) {
2421
2433
  case 0:
2422
2434
  t = this.baseUrl, this.accessTokenFactory = this.options.accessTokenFactory, l.label = 1;
@@ -2429,9 +2441,9 @@ let ei = (
2429
2441
  case 4:
2430
2442
  return [3, 11];
2431
2443
  case 5:
2432
- i = null, s = 0, r = function() {
2444
+ i = null, s = 0, r = function () {
2433
2445
  let d;
2434
- return U(this, function(f) {
2446
+ return U(this, function (f) {
2435
2447
  switch (f.label) {
2436
2448
  case 0:
2437
2449
  return [4, a.getNegotiationResponse(t)];
@@ -2439,13 +2451,13 @@ let ei = (
2439
2451
  if (i = f.sent(), a.connectionState === 2) { return [2, { value: void 0 }]; }
2440
2452
  if (i.error) { throw Error(i.error); }
2441
2453
  if (i.ProtocolVersion) { throw Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details."); }
2442
- return i.url && (t = i.url), i.accessToken && (d = i.accessToken, a.accessTokenFactory = function() {
2454
+ return i.url && (t = i.url), i.accessToken && (d = i.accessToken, a.accessTokenFactory = function () {
2443
2455
  return d;
2444
2456
  }), s++, [
2445
- 2
2457
+ 2
2446
2458
 
2447
- /*return*/
2448
- ];
2459
+ /*return*/
2460
+ ];
2449
2461
  }
2450
2462
  });
2451
2463
  }, a = this, l.label = 6;
@@ -2463,7 +2475,7 @@ let ei = (
2463
2475
  case 10:
2464
2476
  l.sent(), l.label = 11;
2465
2477
  case 11:
2466
- return this.transport instanceof Fe && (this.features.inherentKeepAlive = !0), this.transport.onreceive = this.onreceive, this.transport.onclose = function(d) {
2478
+ return this.transport instanceof Fe && (this.features.inherentKeepAlive = !0), this.transport.onreceive = this.onreceive, this.transport.onclose = function (d) {
2467
2479
  return o.stopConnection(d);
2468
2480
  }, this.changeState(
2469
2481
  0,
@@ -2482,10 +2494,10 @@ let ei = (
2482
2494
  }
2483
2495
  });
2484
2496
  });
2485
- }, n.prototype.getNegotiationResponse = function(e) {
2486
- return ie(this, void 0, void 0, function() {
2497
+ }, n.prototype.getNegotiationResponse = function (e) {
2498
+ return ie(this, void 0, void 0, function () {
2487
2499
  let t, i, s, r, a, c;
2488
- return U(this, function(u) {
2500
+ return U(this, function (u) {
2489
2501
  switch (u.label) {
2490
2502
  case 0:
2491
2503
  return this.accessTokenFactory ? [4, this.accessTokenFactory()] : [3, 2];
@@ -2512,12 +2524,12 @@ let ei = (
2512
2524
  }
2513
2525
  });
2514
2526
  });
2515
- }, n.prototype.createConnectUrl = function(e, t) {
2527
+ }, n.prototype.createConnectUrl = function (e, t) {
2516
2528
  return t ? e + (e.indexOf("?") === -1 ? "?" : "&") + ("id=" + t) : e;
2517
- }, n.prototype.createTransport = function(e, t, i, s) {
2518
- return ie(this, void 0, void 0, function() {
2529
+ }, n.prototype.createTransport = function (e, t, i, s) {
2530
+ return ie(this, void 0, void 0, function () {
2519
2531
  let r, a, c, u, o, l, d;
2520
- return U(this, function(f) {
2532
+ return U(this, function (f) {
2521
2533
  switch (f.label) {
2522
2534
  case 0:
2523
2535
  return r = this.createConnectUrl(e, i.connectionId), this.isITransport(t) ? (this.logger.log(h.Debug, "Connection was provided an instance of ITransport, using that directly."), this.transport = t, [4, this.transport.connect(r, s)]) : [3, 2];
@@ -2528,10 +2540,10 @@ let ei = (
2528
2540
 
2529
2541
  /* Connected */
2530
2542
  ), [
2531
- 2
2543
+ 2
2532
2544
 
2533
- /*return*/
2534
- ];
2545
+ /*return*/
2546
+ ];
2535
2547
  case 2:
2536
2548
  a = i.availableTransports || [], c = 0, u = a, f.label = 3;
2537
2549
  case 3:
@@ -2547,10 +2559,10 @@ let ei = (
2547
2559
 
2548
2560
  /* Connected */
2549
2561
  ), [
2550
- 2
2562
+ 2
2551
2563
 
2552
- /*return*/
2553
- ];
2564
+ /*return*/
2565
+ ];
2554
2566
  case 7:
2555
2567
  return d = f.sent(), this.logger.log(h.Error, "Failed to start the transport '" + v[l] + "': " + d), this.connectionState = 2, i.connectionId = void 0, [3, 8];
2556
2568
  case 8:
@@ -2560,7 +2572,7 @@ let ei = (
2560
2572
  }
2561
2573
  });
2562
2574
  });
2563
- }, n.prototype.constructTransport = function(e) {
2575
+ }, n.prototype.constructTransport = function (e) {
2564
2576
  switch (e) {
2565
2577
  case v.WebSockets:
2566
2578
  if (!this.options.WebSocket) { throw new Error("'WebSocket' is not supported in your environment."); }
@@ -2573,47 +2585,47 @@ let ei = (
2573
2585
  default:
2574
2586
  throw new Error("Unknown transport: " + e + ".");
2575
2587
  }
2576
- }, n.prototype.resolveTransport = function(e, t, i) {
2588
+ }, n.prototype.resolveTransport = function (e, t, i) {
2577
2589
  let s = v[e.transport];
2578
2590
  if (s == null) { this.logger.log(h.Debug, "Skipping transport '" + e.transport + "' because it is not supported by this client."); } else {
2579
- let r = e.transferFormats.map(function(a) {
2591
+ let r = e.transferFormats.map(function (a) {
2580
2592
  return y[a];
2581
2593
  });
2582
2594
  if (ti(t, s)) {
2583
- if (r.indexOf(i) >= 0) {
2584
- if (s === v.WebSockets && !this.options.WebSocket || s === v.ServerSentEvents && !this.options.EventSource) { this.logger.log(h.Debug, "Skipping transport '" + v[s] + "' because it is not supported in your environment.'"); } else { return this.logger.log(h.Debug, "Selecting transport '" + v[s] + "'."), s; }
2585
- } else { this.logger.log(h.Debug, "Skipping transport '" + v[s] + "' because it does not support the requested transfer format '" + y[i] + "'."); }
2586
- } else { this.logger.log(h.Debug, "Skipping transport '" + v[s] + "' because it was disabled by the client."); }
2595
+ if (r.indexOf(i) >= 0) {
2596
+ if (s === v.WebSockets && !this.options.WebSocket || s === v.ServerSentEvents && !this.options.EventSource) { this.logger.log(h.Debug, "Skipping transport '" + v[s] + "' because it is not supported in your environment.'"); } else { return this.logger.log(h.Debug, "Selecting transport '" + v[s] + "'."), s; }
2597
+ } else { this.logger.log(h.Debug, "Skipping transport '" + v[s] + "' because it does not support the requested transfer format '" + y[i] + "'."); }
2598
+ } else { this.logger.log(h.Debug, "Skipping transport '" + v[s] + "' because it was disabled by the client."); }
2587
2599
  }
2588
2600
  return null;
2589
- }, n.prototype.isITransport = function(e) {
2601
+ }, n.prototype.isITransport = function (e) {
2590
2602
  return e && typeof e == "object" && "connect" in e;
2591
- }, n.prototype.changeState = function(e, t) {
2603
+ }, n.prototype.changeState = function (e, t) {
2592
2604
  return this.connectionState === e ? (this.connectionState = t, !0) : !1;
2593
- }, n.prototype.stopConnection = function(e) {
2605
+ }, n.prototype.stopConnection = function (e) {
2594
2606
  this.transport = void 0, e = this.stopError || e, e ? this.logger.log(h.Error, "Connection disconnected with error '" + e + "'.") : this.logger.log(h.Information, "Connection disconnected."), this.connectionState = 2, this.onclose && this.onclose(e);
2595
- }, n.prototype.resolveUrl = function(e) {
2607
+ }, n.prototype.resolveUrl = function (e) {
2596
2608
  if (e.lastIndexOf("https://", 0) === 0 || e.lastIndexOf("http://", 0) === 0) { return e; }
2597
2609
  if (typeof window > "u" || !window || !window.document) { throw new Error("Cannot resolve '" + e + "'."); }
2598
2610
  let t = window.document.createElement("a");
2599
2611
  return t.href = e, this.logger.log(h.Information, "Normalizing '" + e + "' to '" + t.href + "'."), t.href;
2600
- }, n.prototype.resolveNegotiateUrl = function(e) {
2612
+ }, n.prototype.resolveNegotiateUrl = function (e) {
2601
2613
  let t = e.indexOf("?"), i = e.substring(0, t === -1 ? e.length : t);
2602
2614
  return i[i.length - 1] !== "/" && (i += "/"), i += "negotiate", i += t === -1 ? "" : e.substring(t), i;
2603
2615
  }, n;
2604
2616
  })()
2605
- ;
2617
+ ;
2606
2618
  function ti(n, e) {
2607
2619
  return !n || (e & n) !== 0;
2608
2620
  }
2609
2621
  let ii = "json", ni = (
2610
2622
 
2611
2623
  /** @class */
2612
- function() {
2624
+ function () {
2613
2625
  function n() {
2614
2626
  this.name = ii, this.version = 1, this.transferFormat = y.Text;
2615
2627
  }
2616
- return n.prototype.parseMessages = function(e, t) {
2628
+ return n.prototype.parseMessages = function (e, t) {
2617
2629
  if (typeof e != "string") { throw new Error("Invalid input for JSON hub protocol. Expected a string."); }
2618
2630
  if (!e) { return []; }
2619
2631
  t === null && (t = Ie.instance);
@@ -2641,41 +2653,41 @@ let ii = "json", ni = (
2641
2653
  s.push(u);
2642
2654
  }
2643
2655
  return s;
2644
- }, n.prototype.writeMessage = function(e) {
2656
+ }, n.prototype.writeMessage = function (e) {
2645
2657
  return L.write(JSON.stringify(e));
2646
- }, n.prototype.isInvocationMessage = function(e) {
2658
+ }, n.prototype.isInvocationMessage = function (e) {
2647
2659
  this.assertNotEmptyString(e.target, "Invalid payload for Invocation message."), e.invocationId !== void 0 && this.assertNotEmptyString(e.invocationId, "Invalid payload for Invocation message.");
2648
- }, n.prototype.isStreamItemMessage = function(e) {
2660
+ }, n.prototype.isStreamItemMessage = function (e) {
2649
2661
  if (this.assertNotEmptyString(e.invocationId, "Invalid payload for StreamItem message."), e.item === void 0) { throw new Error("Invalid payload for StreamItem message."); }
2650
- }, n.prototype.isCompletionMessage = function(e) {
2662
+ }, n.prototype.isCompletionMessage = function (e) {
2651
2663
  if (e.result && e.error) { throw new Error("Invalid payload for Completion message."); }
2652
2664
  !e.result && e.error && this.assertNotEmptyString(e.error, "Invalid payload for Completion message."), this.assertNotEmptyString(e.invocationId, "Invalid payload for Completion message.");
2653
- }, n.prototype.assertNotEmptyString = function(e, t) {
2665
+ }, n.prototype.assertNotEmptyString = function (e, t) {
2654
2666
  if (typeof e != "string" || e === "") { throw new Error(t); }
2655
2667
  }, n;
2656
2668
  })()
2657
- , ri = (
2669
+ , ri = (
2658
2670
 
2659
- /** @class */
2660
- function() {
2661
- function n() {
2662
- }
2663
- return n.prototype.configureLogging = function(e) {
2664
- return S.isRequired(e, "logging"), si(e) ? this.logger = e : this.logger = new Ce(e), this;
2665
- }, n.prototype.withUrl = function(e, t) {
2666
- return S.isRequired(e, "url"), this.url = e, typeof t == "object" ? this.httpConnectionOptions = t : this.httpConnectionOptions = {
2667
- transport: t
2668
- }, this;
2669
- }, n.prototype.withHubProtocol = function(e) {
2670
- return S.isRequired(e, "protocol"), this.protocol = e, this;
2671
- }, n.prototype.build = function() {
2672
- let e = this.httpConnectionOptions || {};
2673
- if (e.logger === void 0 && (e.logger = this.logger), !this.url) { throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection."); }
2674
- let t = new ei(this.url, e);
2675
- return Vt.create(t, this.logger || Ie.instance, this.protocol || new ni());
2676
- }, n;
2677
- })()
2678
- ;
2671
+ /** @class */
2672
+ function () {
2673
+ function n() {
2674
+ }
2675
+ return n.prototype.configureLogging = function (e) {
2676
+ return S.isRequired(e, "logging"), si(e) ? this.logger = e : this.logger = new Ce(e), this;
2677
+ }, n.prototype.withUrl = function (e, t) {
2678
+ return S.isRequired(e, "url"), this.url = e, typeof t == "object" ? this.httpConnectionOptions = t : this.httpConnectionOptions = {
2679
+ transport: t
2680
+ }, this;
2681
+ }, n.prototype.withHubProtocol = function (e) {
2682
+ return S.isRequired(e, "protocol"), this.protocol = e, this;
2683
+ }, n.prototype.build = function () {
2684
+ let e = this.httpConnectionOptions || {};
2685
+ if (e.logger === void 0 && (e.logger = this.logger), !this.url) { throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection."); }
2686
+ let t = new ei(this.url, e);
2687
+ return Vt.create(t, this.logger || Ie.instance, this.protocol || new ni());
2688
+ }, n;
2689
+ })()
2690
+ ;
2679
2691
  function si(n) {
2680
2692
  return n.log !== void 0;
2681
2693
  }
@@ -2736,7 +2748,7 @@ class oi extends ae {
2736
2748
  }
2737
2749
  updateByGroup(e) {
2738
2750
  if (!this.aleadyUpdateStatus[e]) {
2739
- let t = this.window[`group-${e}${this.aliasName}`] || [];
2751
+ let t = window[`group-${e}${this.aliasName}`] || [];
2740
2752
  if (t.length) {
2741
2753
  this.aleadyUpdateStatus[e] = !0;
2742
2754
  let i = !1, s = !0;
@@ -2771,10 +2783,10 @@ class oi extends ae {
2771
2783
  // 优先从 groupCache 反查(按分组隔离存储,数据准确),兜底从 equipCache 获取
2772
2784
  getEquipGroupIds(e) {
2773
2785
  const t = [];
2774
- if (this.window.groupCache && Object.keys(this.window.groupCache).forEach((i) => {
2775
- this.window.groupCache[i] && this.window.groupCache[i][e] && t.push(Number(i));
2786
+ if (window.groupCache && Object.keys(window.groupCache).forEach((i) => {
2787
+ window.groupCache[i] && window.groupCache[i][e] && t.push(Number(i));
2776
2788
  }), t.length === 0) {
2777
- const i = this.window.equipCache && this.window.equipCache[e];
2789
+ const i = window.equipCache && window.equipCache[e];
2778
2790
  if (i) {
2779
2791
  if (i.groupIds && i.groupIds.length > 0) { return i.groupIds; }
2780
2792
  i.groupId && t.push(i.groupId);
@@ -2812,7 +2824,7 @@ class oi extends ae {
2812
2824
  const ai = {
2813
2825
  getSetParm(n) {
2814
2826
  if (window.AxiosBuilder.axios) {
2815
- return window.AxiosBuilder.axios({
2827
+ return window.AxiosBuilder.axios({
2816
2828
  method: "post",
2817
2829
  url: "/IoT/api/v3/EquipList/GetFullSetParmByEquipNo",
2818
2830
  params: n,
@@ -2821,8 +2833,8 @@ const ai = {
2821
2833
  "Content-Type": "application/json;charset=UTF-8",
2822
2834
  "Accept-Language": window.sessionStorage.languageType || "zh-CN"
2823
2835
  }
2824
- });
2825
- }
2836
+ });
2837
+ }
2826
2838
  }
2827
2839
  }, ui = Object.assign(
2828
2840
  {},
@@ -2861,8 +2873,8 @@ class O {
2861
2873
  static deepClone(e, t, i, s, r, a) {
2862
2874
  let c = [];
2863
2875
  if (e) {
2864
- for (let u = 0, o = e.length; u < o; u++) {
2865
- c.push(
2876
+ for (let u = 0, o = e.length; u < o; u++) {
2877
+ c.push(
2866
2878
  {
2867
2879
  isGroup: i,
2868
2880
  key: `${s}-${e[u].id}`,
@@ -2879,9 +2891,9 @@ class O {
2879
2891
  visible: !0,
2880
2892
  settings: []
2881
2893
  }
2882
- );
2883
- }
2884
- }
2894
+ );
2895
+ }
2896
+ }
2885
2897
  return c;
2886
2898
  }
2887
2899
  static copyOrigin(e) {
@@ -2894,11 +2906,11 @@ class O {
2894
2906
  static getPosition(e, t) {
2895
2907
  let i = 0;
2896
2908
  for (let s = 0, r = t.length; s < r; s++) {
2897
- if (t[s].key == e) {
2909
+ if (t[s].key == e) {
2898
2910
  i = s - 30;
2899
2911
  break;
2900
- }
2901
- }
2912
+ }
2913
+ }
2902
2914
  return i;
2903
2915
  }
2904
2916
  // 扁平化
@@ -2915,7 +2927,7 @@ class O {
2915
2927
  */
2916
2928
  static generateUUID() {
2917
2929
  let e = (/* @__PURE__ */ new Date()).getTime();
2918
- return window.performance && typeof window.performance.now == "function" && (e += performance.now()), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(i) {
2930
+ return window.performance && typeof window.performance.now == "function" && (e += performance.now()), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (i) {
2919
2931
  let s = (e + Math.random() * 16) % 16 | 0;
2920
2932
  return e = Math.floor(e / 16), (i === "x" ? s : s & 3 | 8).toString(16);
2921
2933
  });
@@ -2947,8 +2959,8 @@ class li extends ae {
2947
2959
  }
2948
2960
  // 搜索状态将搜索的结果存放缓存中
2949
2961
  updateBySearch(e, t) {
2950
- let i = this.window[`group-${this.groupNodeObject[e].key}${this.aliasName}`];
2951
- i && (i = i.filter((s) => s.title.includes(t)), this.window[`group-${this.groupNodeObject[e].key}-search`] = O.copyOrigin(i));
2962
+ let i = window[`group-${this.groupNodeObject[e].key}${this.aliasName}`];
2963
+ i && (i = i.filter((s) => s.title.includes(t)), window[`group-${this.groupNodeObject[e].key}-search`] = O.copyOrigin(i));
2952
2964
  }
2953
2965
  }
2954
2966
  const ce = (n, e) => {
@@ -2995,7 +3007,7 @@ function pi(n, e, t, i, s, r) {
2995
3007
  type: "text",
2996
3008
  size: "small",
2997
3009
  class: "elBtn",
2998
- icon: " iconfont icon-tubiao20_bianji",
3010
+ icon: "iconfont icon-tubiao20_bianji",
2999
3011
  onClick: e[0] || (e[0] = ne((o) => t.groupEditAndNew(!1, t.source), ["stop"]))
3000
3012
  }, {
3001
3013
  default: G(() => [
@@ -3007,7 +3019,7 @@ function pi(n, e, t, i, s, r) {
3007
3019
  type: "text",
3008
3020
  size: "small",
3009
3021
  class: "elBtn",
3010
- icon: " iconfont icon-gw-icon-tianjia1",
3022
+ icon: "iconfont icon-gw-icon-tianjia1",
3011
3023
  onClick: e[1] || (e[1] = (o) => t.groupEditAndNew(!0, t.source))
3012
3024
  }, {
3013
3025
  default: G(() => [
@@ -3020,7 +3032,7 @@ function pi(n, e, t, i, s, r) {
3020
3032
  type: "danger",
3021
3033
  size: "small",
3022
3034
  onClick: e[2] || (e[2] = ne((o) => t.deleteGroup(t.source), ["stop"])),
3023
- icon: " iconfont icon-tubiao20_shanchu"
3035
+ icon: "iconfont icon-tubiao20_shanchu"
3024
3036
  }, {
3025
3037
  default: G(() => [
3026
3038
  we(K(n.$t("publics.button.deletes")), 1)
@@ -3110,7 +3122,7 @@ const fi = /* @__PURE__ */ ce(hi, [["render", pi]]), gi = {
3110
3122
  },
3111
3123
  computed: {
3112
3124
  getColor() {
3113
- return function(n) {
3125
+ return function (n) {
3114
3126
  this.colorConfig || (this.colorConfig = {
3115
3127
  noComm: "#a0a0a0",
3116
3128
  normal: "#63e03f",
@@ -3407,13 +3419,13 @@ const ki = /* @__PURE__ */ ce(gi, [["render", Ci]]), Ei = {
3407
3419
  // 根据条件过滤
3408
3420
  filterWithAlias(n) {
3409
3421
  if (this.aliasName) {
3410
- let e = this.window[`group-${n}`] || [];
3411
- this.window[`group-${n}${this.aliasName}`] = this.filterData(e);
3422
+ let e = window[`group-${n}`] || [];
3423
+ window[`group-${n}${this.aliasName}`] = this.filterData(e);
3412
3424
  }
3413
3425
  },
3414
3426
  // 更新当前选中
3415
3427
  updateCurrentSelect() {
3416
- this.window.equipCache && this.window.equipCache[this.currentNodeKey] && (this.currentSelect = `${this.window.equipCache[this.currentNodeKey].groupId}-${this.currentNodeKey}`);
3428
+ window.equipCache && window.equipCache[this.currentNodeKey] && (this.currentSelect = `${window.equipCache[this.currentNodeKey].groupId}-${this.currentNodeKey}`);
3417
3429
  },
3418
3430
  // 设备状态变化
3419
3431
  statusChange(n, e, t) {
@@ -3435,7 +3447,7 @@ const ki = /* @__PURE__ */ ce(gi, [["render", Ci]]), Ei = {
3435
3447
  updateList(n) {
3436
3448
  if (this.groupNodeObject[n]) {
3437
3449
  let e = [];
3438
- this.isSearchStatus ? (e = this.window[`group-${n}-search`], this.groupNodeObject[n].equips = [...O.deepClone(e, Number(this.groupNodeObject[n].level) + 1, this.showSettings, n, this.equipCheckObject, this.equipStatusObject)]) : (e = this.window[`group-${n}${this.aliasName}`], this.groupNodeObject[n].equips = [...O.deepClone(e, Number(this.groupNodeObject[n].level) + 1, this.showSettings, n, this.equipCheckObject, this.equipStatusObject)]), this.cacheManage.addNodesMap(this.groupNodeObject[n].equips), this.cacheManage.closeBrotherNode(n), this.visibleList = [], this.updateTreeList(this.data), this.showCheckbox && this.checkStatusManage && e && e.length && this.checkStatusManage.updateGroupCheckStatus(), this.showStatus && this.equipStatusManage && this.equipStatusManage.updateGroupStatus(n), this.updateCurrentSelect();
3450
+ this.isSearchStatus ? (e = window[`group-${n}-search`], this.groupNodeObject[n].equips = [...O.deepClone(e, Number(this.groupNodeObject[n].level) + 1, this.showSettings, n, this.equipCheckObject, this.equipStatusObject)]) : (e = window[`group-${n}${this.aliasName}`], this.groupNodeObject[n].equips = [...O.deepClone(e, Number(this.groupNodeObject[n].level) + 1, this.showSettings, n, this.equipCheckObject, this.equipStatusObject)]), this.cacheManage.addNodesMap(this.groupNodeObject[n].equips), this.cacheManage.closeBrotherNode(n), this.visibleList = [], this.updateTreeList(this.data), this.showCheckbox && this.checkStatusManage && e && e.length && this.checkStatusManage.updateGroupCheckStatus(), this.showStatus && this.equipStatusManage && this.equipStatusManage.updateGroupStatus(n), this.updateCurrentSelect();
3439
3451
  }
3440
3452
  },
3441
3453
  // 更新整个树形结构
@@ -3686,11 +3698,11 @@ function Oi(n, e, t, i, s, r) {
3686
3698
  const Ni = /* @__PURE__ */ ce(Ei, [["render", Oi]]);
3687
3699
  class Ii {
3688
3700
  constructor() {
3689
- this.eGroupNotify = new et("/eGroupNotify", "", ""), this.alreadyUpdate = {}, this.notify = null, this.window = window;
3701
+ this.eGroupNotify = new et("/eGroupNotify", "", ""), this.alreadyUpdate = {}, this.notify = null, window = window;
3690
3702
  try {
3691
- window.top.equipGroup, this.window = window.top;
3703
+ window.top.equipGroup, window = window.top;
3692
3704
  } catch {
3693
- this.window = window;
3705
+ window = window;
3694
3706
  }
3695
3707
  }
3696
3708
  stop() {
@@ -3729,16 +3741,16 @@ class Ii {
3729
3741
  }
3730
3742
  // 获取分组---无权限管理的分组列表--空设备分组不展示
3731
3743
  GetEquipGroupTree(e) {
3732
- this.window.groupList || (this.window.groupList = e, this.notice({ type: "GetEquipGroupTree" }));
3744
+ window.groupList || (window.groupList = e, this.notice({ type: "GetEquipGroupTree" }));
3733
3745
  }
3734
3746
  // 获取全量分组---设备管理使用
3735
3747
  GetAllEquipGroupTree(e) {
3736
- this.window.groupList_manageMent || (this.window.groupList_manageMent = e, this.notice({ type: "GetEquipGroupTreeWidthTreeType" }));
3748
+ window.groupList_manageMent || (window.groupList_manageMent = e, this.notice({ type: "GetEquipGroupTreeWidthTreeType" }));
3737
3749
  }
3738
3750
  // 新增分组
3739
3751
  AddEquipGroup(e) {
3740
3752
  const { parentGroupId: t, groupId: i, groupName: s } = e || {};
3741
- i && (this.window.groupList_manageMent || (this.window.groupList_manageMent = []), this.window.groupList_manageMent.push({
3753
+ i && (window.groupList_manageMent || (window.groupList_manageMent = []), window.groupList_manageMent.push({
3742
3754
  parentId: t,
3743
3755
  id: i,
3744
3756
  name: s,
@@ -3748,9 +3760,9 @@ class Ii {
3748
3760
  // 编辑分组
3749
3761
  EditEquipGroup(e) {
3750
3762
  const { groupId: t, groupName: i } = e;
3751
- this.window.groupList && window.groupList.forEach((s) => {
3763
+ window.groupList && window.groupList.forEach((s) => {
3752
3764
  s.id == t && (s.name = i);
3753
- }), this.window.groupList_manageMent && window.groupList_manageMent.forEach((s) => {
3765
+ }), window.groupList_manageMent && window.groupList_manageMent.forEach((s) => {
3754
3766
  s.id == t && (s.name = i);
3755
3767
  }), this.notice({ type: "EditEquipGroup", data: e });
3756
3768
  }
@@ -3766,41 +3778,41 @@ class Ii {
3766
3778
  // 删除分组
3767
3779
  DeleteEquipGroup(e) {
3768
3780
  e.forEach((t) => {
3769
- if (this.window.groupList) {
3770
- let i = this.window.groupList.findIndex((s) => s.id == t.groupId);
3771
- i > -1 && this.window.groupList.splice(i, 1), this.deleteChildGroup(t.groupId, this.window.groupList);
3781
+ if (window.groupList) {
3782
+ let i = window.groupList.findIndex((s) => s.id == t.groupId);
3783
+ i > -1 && window.groupList.splice(i, 1), this.deleteChildGroup(t.groupId, window.groupList);
3772
3784
  }
3773
- if (this.window.groupList_manageMent) {
3774
- let i = this.window.groupList_manageMent.findIndex((s) => s.id == t.groupId);
3775
- i > -1 && this.window.groupList_manageMent.splice(i, 1), this.deleteChildGroup(t.groupId, this.window.groupList_manageMent);
3785
+ if (window.groupList_manageMent) {
3786
+ let i = window.groupList_manageMent.findIndex((s) => s.id == t.groupId);
3787
+ i > -1 && window.groupList_manageMent.splice(i, 1), this.deleteChildGroup(t.groupId, window.groupList_manageMent);
3776
3788
  }
3777
3789
  }), this.notice({ type: "DeleteEquipGroup", data: e });
3778
3790
  }
3779
3791
  // 获取设备
3780
3792
  GetGroupEquips(e) {
3781
3793
  const { groupId: t, equips: i } = e || {};
3782
- this.alreadyUpdate[t] || (this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[t] = {}, t && i && i instanceof Array && (i.forEach((s) => {
3783
- s.title = s.name, s.groupId = t, s.equipNo = s.id, delete s.name, window.equipCache || (this.window.equipCache = {}), this.window.equipCache[s.id] = s, this.window.groupCache[t][s.id] = s;
3784
- }), this.window[`group-${t}`] = i, this.notice({ type: "GetGroupEquips", data: { groupId: t } }), this.alreadyUpdate[t] = !0));
3794
+ this.alreadyUpdate[t] || (window.groupCache || (window.groupCache = {}), window.groupCache[t] = {}, t && i && i instanceof Array && (i.forEach((s) => {
3795
+ s.title = s.name, s.groupId = t, s.equipNo = s.id, delete s.name, window.equipCache || (window.equipCache = {}), window.equipCache[s.id] = s, window.groupCache[t][s.id] = s;
3796
+ }), window[`group-${t}`] = i, this.notice({ type: "GetGroupEquips", data: { groupId: t } }), this.alreadyUpdate[t] = !0));
3785
3797
  }
3786
3798
  // 新增设备
3787
3799
  AddEquip(e) {
3788
3800
  const { groupId: t, equips: i } = e || {};
3789
- this.window[`group-${t}`] || (this.window[`group-${t}`] = []), this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[t] || (this.window.groupCache[t] = {}), this.window.equipCache || (this.window.equipCache = {});
3790
- let s = this.window[`group-${t}`].length;
3801
+ window[`group-${t}`] || (window[`group-${t}`] = []), window.groupCache || (window.groupCache = {}), window.groupCache[t] || (window.groupCache[t] = {}), window.equipCache || (window.equipCache = {});
3802
+ let s = window[`group-${t}`].length;
3791
3803
  if (t && i) {
3792
3804
  if (i.forEach((r, a) => {
3793
- this.window[`group-${t}`].push(
3805
+ window[`group-${t}`].push(
3794
3806
  {
3795
3807
  equipNo: r.id,
3796
3808
  groupId: t,
3797
3809
  id: r.id,
3798
3810
  title: r.name
3799
3811
  }
3800
- ), this.window.equipCache[r.id] = this.window[`group-${t}`][s + a], this.window.groupCache[t][r.id] = this.window[`group-${t}`][s + a];
3801
- }), !this.exist(t, this.window.groupList)) {
3802
- let r = this.findParentList(t, this.window.groupList_manageMent);
3803
- this.window.groupList.push(...r);
3812
+ ), window.equipCache[r.id] = window[`group-${t}`][s + a], window.groupCache[t][r.id] = window[`group-${t}`][s + a];
3813
+ }), !this.exist(t, window.groupList)) {
3814
+ let r = this.findParentList(t, window.groupList_manageMent);
3815
+ window.groupList.push(...r);
3804
3816
  }
3805
3817
  this.notice({ type: "AddEquip", data: e });
3806
3818
  }
@@ -3809,20 +3821,20 @@ class Ii {
3809
3821
  let t = [], i = !0, s = [];
3810
3822
  const { sourceGroup: r, targetGroupId: a } = e || {};
3811
3823
  a && t.push(a), r.forEach((c) => {
3812
- if (t.push(c.groupId), (!this.window[`group-${a}`] || !this.window[`group-${a}`].length) && (this.window[`group-${a}`] = [], s.push(a)), this.window.groupCache || (this.window.groupCache = {}), this.window.groupCache[a] || (this.window.groupCache[a] = {}), c.equips.forEach((u) => {
3813
- if (u.title = u.name, u.groupId = a, u.equipNo = u.id, this.window[`group-${c.groupId}`]) {
3814
- let o = this.window[`group-${c.groupId}`].findIndex((l) => l.id == u.id);
3815
- o > -1 && this.window[`group-${c.groupId}`].splice(o, 1);
3824
+ if (t.push(c.groupId), (!window[`group-${a}`] || !window[`group-${a}`].length) && (window[`group-${a}`] = [], s.push(a)), window.groupCache || (window.groupCache = {}), window.groupCache[a] || (window.groupCache[a] = {}), c.equips.forEach((u) => {
3825
+ if (u.title = u.name, u.groupId = a, u.equipNo = u.id, window[`group-${c.groupId}`]) {
3826
+ let o = window[`group-${c.groupId}`].findIndex((l) => l.id == u.id);
3827
+ o > -1 && window[`group-${c.groupId}`].splice(o, 1);
3816
3828
  }
3817
- window.equipCache || (this.window.equipCache = {}), this.window.equipCache[u.id] = u, this.window.groupCache[a][u.id] = u, this.window[`group-${a}`].push(u);
3818
- }), !this.window[`group-${c.groupId}`].length) {
3819
- let u = this.window.groupList.findIndex((o) => o.id == c.groupId);
3820
- u > -1 && this.window.groupList.splice(u, 1), this.deleteChildGroup(c.groupId, this.window.groupList);
3829
+ window.equipCache || (window.equipCache = {}), window.equipCache[u.id] = u, window.groupCache[a][u.id] = u, window[`group-${a}`].push(u);
3830
+ }), !window[`group-${c.groupId}`].length) {
3831
+ let u = window.groupList.findIndex((o) => o.id == c.groupId);
3832
+ u > -1 && window.groupList.splice(u, 1), this.deleteChildGroup(c.groupId, window.groupList);
3821
3833
  }
3822
3834
  }), s.forEach((c) => {
3823
- if (!this.exist(c, this.window.groupList)) {
3824
- let u = this.findParentList(c, this.window.groupList_manageMent);
3825
- this.window.groupList.push(...u);
3835
+ if (!this.exist(c, window.groupList)) {
3836
+ let u = this.findParentList(c, window.groupList_manageMent);
3837
+ window.groupList.push(...u);
3826
3838
  }
3827
3839
  }), this.notice({ type: "moveEquips", data: { updateGroups: t, buildTree: i } });
3828
3840
  }
@@ -3833,7 +3845,7 @@ class Ii {
3833
3845
  let i = [];
3834
3846
  if (t) {
3835
3847
  let s = t.findIndex((r) => r.id == e);
3836
- s > -1 && i.push({ ...t[s] }), t[s].parentId && !this.exist(t[s].parentId, this.window.groupList) && i.push(...this.findParentList(t[s].parentId, this.window.groupList_manageMent));
3848
+ s > -1 && i.push({ ...t[s] }), t[s].parentId && !this.exist(t[s].parentId, window.groupList) && i.push(...this.findParentList(t[s].parentId, window.groupList_manageMent));
3837
3849
  }
3838
3850
  return i;
3839
3851
  }
@@ -3841,22 +3853,22 @@ class Ii {
3841
3853
  DeleteEquip(e) {
3842
3854
  const { groupId: t, equips: i } = e || {};
3843
3855
  if (t && i && i instanceof Array) {
3844
- if (this.window[`group-${t}`]) {
3845
- for (let s = 0, r = i.length; s < r; s++) {
3846
- let a = this.window[`group-${t}`].findIndex((c) => c.id == i[s].id);
3847
- a > -1 && this.window[`group-${t}`].splice(a, 1), delete this.window.equipCache[i[s].id], delete this.window.groupCache[t][i[s].id];
3848
- }
3849
- }
3856
+ if (window[`group-${t}`]) {
3857
+ for (let s = 0, r = i.length; s < r; s++) {
3858
+ let a = window[`group-${t}`].findIndex((c) => c.id == i[s].id);
3859
+ a > -1 && window[`group-${t}`].splice(a, 1), delete window.equipCache[i[s].id], delete window.groupCache[t][i[s].id];
3860
+ }
3861
+ }
3850
3862
  this.notice({ type: "DeleteEquip", data: e });
3851
3863
  }
3852
3864
  }
3853
3865
  // 编辑设备
3854
3866
  EditEquip(e) {
3855
3867
  const { equipNo: t, groupId: i, equipName: s } = e || {};
3856
- i && t && (window[`group-${i}`] && (this.window.equipCache[t] = s), this.notice({ type: "EditEquip", data: e }));
3868
+ i && t && (window[`group-${i}`] && (window.equipCache[t] = s), this.notice({ type: "EditEquip", data: e }));
3857
3869
  }
3858
3870
  notice(e) {
3859
- if (this.window.hasIframe) {
3871
+ if (window.hasIframe) {
3860
3872
  let t = document.getElementsByTagName("iframe");
3861
3873
  for (let i of t) { i.contentWindow.postMessage(e); }
3862
3874
  } else { window.postMessage(e, "*"); }
@@ -3884,11 +3896,11 @@ const Mi = {
3884
3896
  }
3885
3897
  },
3886
3898
  mounted() {
3887
- this.treeKey = `equipGroup${this.treeType}`, this.listKey = `groupList${this.treeType}`, this.window[this.treeKey] ? this.list = O.formateList(JSON.parse(JSON.stringify(this.window[this.treeKey]))) : this.window[this.listKey] && this.buildTree(), window.executeQueue || (window.executeQueues = {}), window.executeQueues[this.refId] = this.destroyTree, window.addEventListener("message", (n) => {
3899
+ this.treeKey = `equipGroup${this.treeType}`, this.listKey = `groupList${this.treeType}`, window[this.treeKey] ? this.list = O.formateList(JSON.parse(JSON.stringify(window[this.treeKey]))) : window[this.listKey] && this.buildTree(), window.executeQueue || (window.executeQueues = {}), window.executeQueues[this.refId] = this.destroyTree, window.addEventListener("message", (n) => {
3888
3900
  n && n.data && n.data.type && this[n.data.type] && this[n.data.type]();
3889
3901
  });
3890
3902
  try {
3891
- this.window.hasIframe || this.selfRequest();
3903
+ window.hasIframe || this.selfRequest();
3892
3904
  } catch {
3893
3905
  this.selfRequest();
3894
3906
  }
@@ -3898,15 +3910,15 @@ const Mi = {
3898
3910
  new Ii().Init();
3899
3911
  },
3900
3912
  GetEquipGroupTreeWidthTreeType() {
3901
- this.treeType && this.window[this.listKey] && this.buildTree();
3913
+ this.treeType && window[this.listKey] && this.buildTree();
3902
3914
  },
3903
3915
  GetEquipGroupTree() {
3904
- !this.treeType && this.window[this.listKey] && this.buildTree();
3916
+ !this.treeType && window[this.listKey] && this.buildTree();
3905
3917
  },
3906
3918
  buildTree() {
3907
- if (this.window[this.listKey]) {
3908
- let n = O.listToTreeList(JSON.parse(JSON.stringify(this.window[this.listKey])));
3909
- this.list = O.formateList(JSON.parse(JSON.stringify(n))), this.window[`equipGroup${this.treeType}`] = n, this.hasBuildTree = !0;
3919
+ if (window[this.listKey]) {
3920
+ let n = O.listToTreeList(JSON.parse(JSON.stringify(window[this.listKey])));
3921
+ this.list = O.formateList(JSON.parse(JSON.stringify(n))), window[`equipGroup${this.treeType}`] = n, this.hasBuildTree = !0;
3910
3922
  }
3911
3923
  },
3912
3924
  filterMethod(n) {
@@ -3937,7 +3949,7 @@ function xi(n, e, t, i, s, r) {
3937
3949
  }, { ...n.$attrs, ...n.$props }, pt(n.$listeners), { buildTree: r.buildTree }), null, 16, ["data", "buildTree"]);
3938
3950
  }
3939
3951
  const ye = /* @__PURE__ */ ce(Mi, [["render", xi]]);
3940
- ye.install = function(n) {
3952
+ ye.install = function (n) {
3941
3953
  n.component(ye.name, ye);
3942
3954
  };
3943
3955
  export {