@orbcharts/core 4.0.0-pre-alpha.3 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,107 +1,107 @@
1
- var Ae = function(t, e) {
2
- return Ae = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
1
+ var _e = function(t, e) {
2
+ return _e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
3
3
  r.__proto__ = n;
4
4
  } || function(r, n) {
5
- for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (r[o] = n[o]);
6
- }, Ae(t, e);
5
+ for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (r[s] = n[s]);
6
+ }, _e(t, e);
7
7
  };
8
- function W(t, e) {
8
+ function Z(t, e) {
9
9
  if (typeof e != "function" && e !== null)
10
10
  throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
11
- Ae(t, e);
11
+ _e(t, e);
12
12
  function r() {
13
13
  this.constructor = t;
14
14
  }
15
15
  t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
16
16
  }
17
- function gt(t, e, r, n) {
18
- function o(s) {
19
- return s instanceof r ? s : new r(function(u) {
20
- u(s);
17
+ function bt(t, e, r, n) {
18
+ function s(o) {
19
+ return o instanceof r ? o : new r(function(u) {
20
+ u(o);
21
21
  });
22
22
  }
23
- return new (r || (r = Promise))(function(s, u) {
24
- function a(h) {
23
+ return new (r || (r = Promise))(function(o, u) {
24
+ function a(f) {
25
25
  try {
26
- i(n.next(h));
27
- } catch (b) {
28
- u(b);
26
+ i(n.next(f));
27
+ } catch (w) {
28
+ u(w);
29
29
  }
30
30
  }
31
- function l(h) {
31
+ function c(f) {
32
32
  try {
33
- i(n.throw(h));
34
- } catch (b) {
35
- u(b);
33
+ i(n.throw(f));
34
+ } catch (w) {
35
+ u(w);
36
36
  }
37
37
  }
38
- function i(h) {
39
- h.done ? s(h.value) : o(h.value).then(a, l);
38
+ function i(f) {
39
+ f.done ? o(f.value) : s(f.value).then(a, c);
40
40
  }
41
41
  i((n = n.apply(t, e || [])).next());
42
42
  });
43
43
  }
44
- function Ue(t, e) {
44
+ function ze(t, e) {
45
45
  var r = { label: 0, sent: function() {
46
- if (s[0] & 1) throw s[1];
47
- return s[1];
48
- }, trys: [], ops: [] }, n, o, s, u = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
46
+ if (o[0] & 1) throw o[1];
47
+ return o[1];
48
+ }, trys: [], ops: [] }, n, s, o, u = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
49
49
  return u.next = a(0), u.throw = a(1), u.return = a(2), typeof Symbol == "function" && (u[Symbol.iterator] = function() {
50
50
  return this;
51
51
  }), u;
52
52
  function a(i) {
53
- return function(h) {
54
- return l([i, h]);
53
+ return function(f) {
54
+ return c([i, f]);
55
55
  };
56
56
  }
57
- function l(i) {
57
+ function c(i) {
58
58
  if (n) throw new TypeError("Generator is already executing.");
59
59
  for (; u && (u = 0, i[0] && (r = 0)), r; ) try {
60
- if (n = 1, o && (s = i[0] & 2 ? o.return : i[0] ? o.throw || ((s = o.return) && s.call(o), 0) : o.next) && !(s = s.call(o, i[1])).done) return s;
61
- switch (o = 0, s && (i = [i[0] & 2, s.value]), i[0]) {
60
+ if (n = 1, s && (o = i[0] & 2 ? s.return : i[0] ? s.throw || ((o = s.return) && o.call(s), 0) : s.next) && !(o = o.call(s, i[1])).done) return o;
61
+ switch (s = 0, o && (i = [i[0] & 2, o.value]), i[0]) {
62
62
  case 0:
63
63
  case 1:
64
- s = i;
64
+ o = i;
65
65
  break;
66
66
  case 4:
67
67
  return r.label++, { value: i[1], done: !1 };
68
68
  case 5:
69
- r.label++, o = i[1], i = [0];
69
+ r.label++, s = i[1], i = [0];
70
70
  continue;
71
71
  case 7:
72
72
  i = r.ops.pop(), r.trys.pop();
73
73
  continue;
74
74
  default:
75
- if (s = r.trys, !(s = s.length > 0 && s[s.length - 1]) && (i[0] === 6 || i[0] === 2)) {
75
+ if (o = r.trys, !(o = o.length > 0 && o[o.length - 1]) && (i[0] === 6 || i[0] === 2)) {
76
76
  r = 0;
77
77
  continue;
78
78
  }
79
- if (i[0] === 3 && (!s || i[1] > s[0] && i[1] < s[3])) {
79
+ if (i[0] === 3 && (!o || i[1] > o[0] && i[1] < o[3])) {
80
80
  r.label = i[1];
81
81
  break;
82
82
  }
83
- if (i[0] === 6 && r.label < s[1]) {
84
- r.label = s[1], s = i;
83
+ if (i[0] === 6 && r.label < o[1]) {
84
+ r.label = o[1], o = i;
85
85
  break;
86
86
  }
87
- if (s && r.label < s[2]) {
88
- r.label = s[2], r.ops.push(i);
87
+ if (o && r.label < o[2]) {
88
+ r.label = o[2], r.ops.push(i);
89
89
  break;
90
90
  }
91
- s[2] && r.ops.pop(), r.trys.pop();
91
+ o[2] && r.ops.pop(), r.trys.pop();
92
92
  continue;
93
93
  }
94
94
  i = e.call(t, r);
95
- } catch (h) {
96
- i = [6, h], o = 0;
95
+ } catch (f) {
96
+ i = [6, f], s = 0;
97
97
  } finally {
98
- n = s = 0;
98
+ n = o = 0;
99
99
  }
100
100
  if (i[0] & 5) throw i[1];
101
101
  return { value: i[0] ? i[1] : void 0, done: !0 };
102
102
  }
103
103
  }
104
- function ue(t) {
104
+ function ce(t) {
105
105
  var e = typeof Symbol == "function" && Symbol.iterator, r = e && t[e], n = 0;
106
106
  if (r) return r.call(t);
107
107
  if (t && typeof t.length == "number") return {
@@ -114,173 +114,173 @@ function ue(t) {
114
114
  function le(t, e) {
115
115
  var r = typeof Symbol == "function" && t[Symbol.iterator];
116
116
  if (!r) return t;
117
- var n = r.call(t), o, s = [], u;
117
+ var n = r.call(t), s, o = [], u;
118
118
  try {
119
- for (; (e === void 0 || e-- > 0) && !(o = n.next()).done; ) s.push(o.value);
119
+ for (; (e === void 0 || e-- > 0) && !(s = n.next()).done; ) o.push(s.value);
120
120
  } catch (a) {
121
121
  u = { error: a };
122
122
  } finally {
123
123
  try {
124
- o && !o.done && (r = n.return) && r.call(n);
124
+ s && !s.done && (r = n.return) && r.call(n);
125
125
  } finally {
126
126
  if (u) throw u.error;
127
127
  }
128
128
  }
129
- return s;
129
+ return o;
130
130
  }
131
- function ce(t, e, r) {
132
- if (r || arguments.length === 2) for (var n = 0, o = e.length, s; n < o; n++)
133
- (s || !(n in e)) && (s || (s = Array.prototype.slice.call(e, 0, n)), s[n] = e[n]);
134
- return t.concat(s || Array.prototype.slice.call(e));
131
+ function fe(t, e, r) {
132
+ if (r || arguments.length === 2) for (var n = 0, s = e.length, o; n < s; n++)
133
+ (o || !(n in e)) && (o || (o = Array.prototype.slice.call(e, 0, n)), o[n] = e[n]);
134
+ return t.concat(o || Array.prototype.slice.call(e));
135
135
  }
136
- function ie(t) {
137
- return this instanceof ie ? (this.v = t, this) : new ie(t);
136
+ function ue(t) {
137
+ return this instanceof ue ? (this.v = t, this) : new ue(t);
138
138
  }
139
- function bt(t, e, r) {
139
+ function wt(t, e, r) {
140
140
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
141
- var n = r.apply(t, e || []), o, s = [];
142
- return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), a("next"), a("throw"), a("return", u), o[Symbol.asyncIterator] = function() {
141
+ var n = r.apply(t, e || []), s, o = [];
142
+ return s = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), a("next"), a("throw"), a("return", u), s[Symbol.asyncIterator] = function() {
143
143
  return this;
144
- }, o;
145
- function u(m) {
146
- return function(v) {
147
- return Promise.resolve(v).then(m, b);
144
+ }, s;
145
+ function u(y) {
146
+ return function(A) {
147
+ return Promise.resolve(A).then(y, w);
148
148
  };
149
149
  }
150
- function a(m, v) {
151
- n[m] && (o[m] = function(y) {
152
- return new Promise(function(d, E) {
153
- s.push([m, y, d, E]) > 1 || l(m, y);
150
+ function a(y, A) {
151
+ n[y] && (s[y] = function(v) {
152
+ return new Promise(function(d, b) {
153
+ o.push([y, v, d, b]) > 1 || c(y, v);
154
154
  });
155
- }, v && (o[m] = v(o[m])));
155
+ }, A && (s[y] = A(s[y])));
156
156
  }
157
- function l(m, v) {
157
+ function c(y, A) {
158
158
  try {
159
- i(n[m](v));
160
- } catch (y) {
161
- w(s[0][3], y);
159
+ i(n[y](A));
160
+ } catch (v) {
161
+ S(o[0][3], v);
162
162
  }
163
163
  }
164
- function i(m) {
165
- m.value instanceof ie ? Promise.resolve(m.value.v).then(h, b) : w(s[0][2], m);
164
+ function i(y) {
165
+ y.value instanceof ue ? Promise.resolve(y.value.v).then(f, w) : S(o[0][2], y);
166
166
  }
167
- function h(m) {
168
- l("next", m);
167
+ function f(y) {
168
+ c("next", y);
169
169
  }
170
- function b(m) {
171
- l("throw", m);
170
+ function w(y) {
171
+ c("throw", y);
172
172
  }
173
- function w(m, v) {
174
- m(v), s.shift(), s.length && l(s[0][0], s[0][1]);
173
+ function S(y, A) {
174
+ y(A), o.shift(), o.length && c(o[0][0], o[0][1]);
175
175
  }
176
176
  }
177
- function wt(t) {
177
+ function Et(t) {
178
178
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
179
179
  var e = t[Symbol.asyncIterator], r;
180
- return e ? e.call(t) : (t = typeof ue == "function" ? ue(t) : t[Symbol.iterator](), r = {}, n("next"), n("throw"), n("return"), r[Symbol.asyncIterator] = function() {
180
+ return e ? e.call(t) : (t = typeof ce == "function" ? ce(t) : t[Symbol.iterator](), r = {}, n("next"), n("throw"), n("return"), r[Symbol.asyncIterator] = function() {
181
181
  return this;
182
182
  }, r);
183
- function n(s) {
184
- r[s] = t[s] && function(u) {
185
- return new Promise(function(a, l) {
186
- u = t[s](u), o(a, l, u.done, u.value);
183
+ function n(o) {
184
+ r[o] = t[o] && function(u) {
185
+ return new Promise(function(a, c) {
186
+ u = t[o](u), s(a, c, u.done, u.value);
187
187
  });
188
188
  };
189
189
  }
190
- function o(s, u, a, l) {
191
- Promise.resolve(l).then(function(i) {
192
- s({ value: i, done: a });
190
+ function s(o, u, a, c) {
191
+ Promise.resolve(c).then(function(i) {
192
+ o({ value: i, done: a });
193
193
  }, u);
194
194
  }
195
195
  }
196
- function j(t) {
196
+ function V(t) {
197
197
  return typeof t == "function";
198
198
  }
199
- function Te(t) {
199
+ function Oe(t) {
200
200
  var e = function(n) {
201
201
  Error.call(n), n.stack = new Error().stack;
202
202
  }, r = t(e);
203
203
  return r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, r;
204
204
  }
205
- var xe = Te(function(t) {
205
+ var Ae = Oe(function(t) {
206
206
  return function(r) {
207
207
  t(this), this.message = r ? r.length + ` errors occurred during unsubscription:
208
- ` + r.map(function(n, o) {
209
- return o + 1 + ") " + n.toString();
208
+ ` + r.map(function(n, s) {
209
+ return s + 1 + ") " + n.toString();
210
210
  }).join(`
211
211
  `) : "", this.name = "UnsubscriptionError", this.errors = r;
212
212
  };
213
213
  });
214
- function we(t, e) {
214
+ function Ee(t, e) {
215
215
  if (t) {
216
216
  var r = t.indexOf(e);
217
217
  0 <= r && t.splice(r, 1);
218
218
  }
219
219
  }
220
- var de = function() {
220
+ var ve = function() {
221
221
  function t(e) {
222
222
  this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
223
223
  }
224
224
  return t.prototype.unsubscribe = function() {
225
- var e, r, n, o, s;
225
+ var e, r, n, s, o;
226
226
  if (!this.closed) {
227
227
  this.closed = !0;
228
228
  var u = this._parentage;
229
229
  if (u)
230
230
  if (this._parentage = null, Array.isArray(u))
231
231
  try {
232
- for (var a = ue(u), l = a.next(); !l.done; l = a.next()) {
233
- var i = l.value;
232
+ for (var a = ce(u), c = a.next(); !c.done; c = a.next()) {
233
+ var i = c.value;
234
234
  i.remove(this);
235
235
  }
236
- } catch (y) {
237
- e = { error: y };
236
+ } catch (v) {
237
+ e = { error: v };
238
238
  } finally {
239
239
  try {
240
- l && !l.done && (r = a.return) && r.call(a);
240
+ c && !c.done && (r = a.return) && r.call(a);
241
241
  } finally {
242
242
  if (e) throw e.error;
243
243
  }
244
244
  }
245
245
  else
246
246
  u.remove(this);
247
- var h = this.initialTeardown;
248
- if (j(h))
247
+ var f = this.initialTeardown;
248
+ if (V(f))
249
249
  try {
250
- h();
251
- } catch (y) {
252
- s = y instanceof xe ? y.errors : [y];
250
+ f();
251
+ } catch (v) {
252
+ o = v instanceof Ae ? v.errors : [v];
253
253
  }
254
- var b = this._finalizers;
255
- if (b) {
254
+ var w = this._finalizers;
255
+ if (w) {
256
256
  this._finalizers = null;
257
257
  try {
258
- for (var w = ue(b), m = w.next(); !m.done; m = w.next()) {
259
- var v = m.value;
258
+ for (var S = ce(w), y = S.next(); !y.done; y = S.next()) {
259
+ var A = y.value;
260
260
  try {
261
- ke(v);
262
- } catch (y) {
263
- s = s ?? [], y instanceof xe ? s = ce(ce([], le(s)), le(y.errors)) : s.push(y);
261
+ je(A);
262
+ } catch (v) {
263
+ o = o ?? [], v instanceof Ae ? o = fe(fe([], le(o)), le(v.errors)) : o.push(v);
264
264
  }
265
265
  }
266
- } catch (y) {
267
- n = { error: y };
266
+ } catch (v) {
267
+ n = { error: v };
268
268
  } finally {
269
269
  try {
270
- m && !m.done && (o = w.return) && o.call(w);
270
+ y && !y.done && (s = S.return) && s.call(S);
271
271
  } finally {
272
272
  if (n) throw n.error;
273
273
  }
274
274
  }
275
275
  }
276
- if (s)
277
- throw new xe(s);
276
+ if (o)
277
+ throw new Ae(o);
278
278
  }
279
279
  }, t.prototype.add = function(e) {
280
280
  var r;
281
281
  if (e && e !== this)
282
282
  if (this.closed)
283
- ke(e);
283
+ je(e);
284
284
  else {
285
285
  if (e instanceof t) {
286
286
  if (e.closed || e._hasParent(this))
@@ -297,52 +297,52 @@ var de = function() {
297
297
  this._parentage = Array.isArray(r) ? (r.push(e), r) : r ? [r, e] : e;
298
298
  }, t.prototype._removeParent = function(e) {
299
299
  var r = this._parentage;
300
- r === e ? this._parentage = null : Array.isArray(r) && we(r, e);
300
+ r === e ? this._parentage = null : Array.isArray(r) && Ee(r, e);
301
301
  }, t.prototype.remove = function(e) {
302
302
  var r = this._finalizers;
303
- r && we(r, e), e instanceof t && e._removeParent(this);
303
+ r && Ee(r, e), e instanceof t && e._removeParent(this);
304
304
  }, t.EMPTY = function() {
305
305
  var e = new t();
306
306
  return e.closed = !0, e;
307
307
  }(), t;
308
- }(), ze = de.EMPTY;
308
+ }(), Ge = ve.EMPTY;
309
309
  function qe(t) {
310
- return t instanceof de || t && "closed" in t && j(t.remove) && j(t.add) && j(t.unsubscribe);
310
+ return t instanceof ve || t && "closed" in t && V(t.remove) && V(t.add) && V(t.unsubscribe);
311
311
  }
312
- function ke(t) {
313
- j(t) ? t() : t.unsubscribe();
312
+ function je(t) {
313
+ V(t) ? t() : t.unsubscribe();
314
314
  }
315
- var Et = {
315
+ var xt = {
316
316
  Promise: void 0
317
- }, xt = {
317
+ }, At = {
318
318
  setTimeout: function(t, e) {
319
319
  for (var r = [], n = 2; n < arguments.length; n++)
320
320
  r[n - 2] = arguments[n];
321
- return setTimeout.apply(void 0, ce([t, e], le(r)));
321
+ return setTimeout.apply(void 0, fe([t, e], le(r)));
322
322
  },
323
323
  clearTimeout: function(t) {
324
324
  return clearTimeout(t);
325
325
  },
326
326
  delegate: void 0
327
327
  };
328
- function Ge(t) {
329
- xt.setTimeout(function() {
328
+ function We(t) {
329
+ At.setTimeout(function() {
330
330
  throw t;
331
331
  });
332
332
  }
333
- function _e() {
333
+ function Te() {
334
334
  }
335
- function be(t) {
335
+ function we(t) {
336
336
  t();
337
337
  }
338
- var Oe = function(t) {
339
- W(e, t);
338
+ var Ie = function(t) {
339
+ Z(e, t);
340
340
  function e(r) {
341
341
  var n = t.call(this) || this;
342
- return n.isStopped = !1, r ? (n.destination = r, qe(r) && r.add(n)) : n.destination = _t, n;
342
+ return n.isStopped = !1, r ? (n.destination = r, qe(r) && r.add(n)) : n.destination = Tt, n;
343
343
  }
344
- return e.create = function(r, n, o) {
345
- return new he(r, n, o);
344
+ return e.create = function(r, n, s) {
345
+ return new ye(r, n, s);
346
346
  }, e.prototype.next = function(r) {
347
347
  this.isStopped || this._next(r);
348
348
  }, e.prototype.error = function(r) {
@@ -366,7 +366,7 @@ var Oe = function(t) {
366
366
  this.unsubscribe();
367
367
  }
368
368
  }, e;
369
- }(de), St = function() {
369
+ }(ve), St = function() {
370
370
  function t(e) {
371
371
  this.partialObserver = e;
372
372
  }
@@ -376,7 +376,7 @@ var Oe = function(t) {
376
376
  try {
377
377
  r.next(e);
378
378
  } catch (n) {
379
- ge(n);
379
+ be(n);
380
380
  }
381
381
  }, t.prototype.error = function(e) {
382
382
  var r = this.partialObserver;
@@ -384,42 +384,42 @@ var Oe = function(t) {
384
384
  try {
385
385
  r.error(e);
386
386
  } catch (n) {
387
- ge(n);
387
+ be(n);
388
388
  }
389
389
  else
390
- ge(e);
390
+ be(e);
391
391
  }, t.prototype.complete = function() {
392
392
  var e = this.partialObserver;
393
393
  if (e.complete)
394
394
  try {
395
395
  e.complete();
396
396
  } catch (r) {
397
- ge(r);
397
+ be(r);
398
398
  }
399
399
  }, t;
400
- }(), he = function(t) {
401
- W(e, t);
402
- function e(r, n, o) {
403
- var s = t.call(this) || this, u;
404
- return j(r) || !r ? u = {
400
+ }(), ye = function(t) {
401
+ Z(e, t);
402
+ function e(r, n, s) {
403
+ var o = t.call(this) || this, u;
404
+ return V(r) || !r ? u = {
405
405
  next: r ?? void 0,
406
406
  error: n ?? void 0,
407
- complete: o ?? void 0
408
- } : u = r, s.destination = new St(u), s;
407
+ complete: s ?? void 0
408
+ } : u = r, o.destination = new St(u), o;
409
409
  }
410
410
  return e;
411
- }(Oe);
412
- function ge(t) {
413
- Ge(t);
411
+ }(Ie);
412
+ function be(t) {
413
+ We(t);
414
414
  }
415
- function At(t) {
415
+ function _t(t) {
416
416
  throw t;
417
417
  }
418
- var _t = {
418
+ var Tt = {
419
419
  closed: !0,
420
- next: _e,
421
- error: At,
422
- complete: _e
420
+ next: Te,
421
+ error: _t,
422
+ complete: Te
423
423
  }, Ce = function() {
424
424
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
425
425
  }();
@@ -428,8 +428,8 @@ function me(t) {
428
428
  }
429
429
  function $t(t) {
430
430
  return t.length === 0 ? me : t.length === 1 ? t[0] : function(r) {
431
- return t.reduce(function(n, o) {
432
- return o(n);
431
+ return t.reduce(function(n, s) {
432
+ return s(n);
433
433
  }, r);
434
434
  };
435
435
  }
@@ -441,11 +441,11 @@ var R = function() {
441
441
  var r = new t();
442
442
  return r.source = this, r.operator = e, r;
443
443
  }, t.prototype.subscribe = function(e, r, n) {
444
- var o = this, s = Ot(e) ? e : new he(e, r, n);
445
- return be(function() {
446
- var u = o, a = u.operator, l = u.source;
447
- s.add(a ? a.call(s, l) : l ? o._subscribe(s) : o._trySubscribe(s));
448
- }), s;
444
+ var s = this, o = It(e) ? e : new ye(e, r, n);
445
+ return we(function() {
446
+ var u = s, a = u.operator, c = u.source;
447
+ o.add(a ? a.call(o, c) : c ? s._subscribe(o) : s._trySubscribe(o));
448
+ }), o;
449
449
  }, t.prototype._trySubscribe = function(e) {
450
450
  try {
451
451
  return this._subscribe(e);
@@ -454,17 +454,17 @@ var R = function() {
454
454
  }
455
455
  }, t.prototype.forEach = function(e, r) {
456
456
  var n = this;
457
- return r = Me(r), new r(function(o, s) {
458
- var u = new he({
457
+ return r = Me(r), new r(function(s, o) {
458
+ var u = new ye({
459
459
  next: function(a) {
460
460
  try {
461
461
  e(a);
462
- } catch (l) {
463
- s(l), u.unsubscribe();
462
+ } catch (c) {
463
+ o(c), u.unsubscribe();
464
464
  }
465
465
  },
466
- error: s,
467
- complete: o
466
+ error: o,
467
+ complete: s
468
468
  });
469
469
  n.subscribe(u);
470
470
  });
@@ -479,14 +479,14 @@ var R = function() {
479
479
  return $t(e)(this);
480
480
  }, t.prototype.toPromise = function(e) {
481
481
  var r = this;
482
- return e = Me(e), new e(function(n, o) {
483
- var s;
482
+ return e = Me(e), new e(function(n, s) {
483
+ var o;
484
484
  r.subscribe(function(u) {
485
- return s = u;
485
+ return o = u;
486
486
  }, function(u) {
487
- return o(u);
487
+ return s(u);
488
488
  }, function() {
489
- return n(s);
489
+ return n(o);
490
490
  });
491
491
  });
492
492
  }, t.create = function(e) {
@@ -495,18 +495,18 @@ var R = function() {
495
495
  }();
496
496
  function Me(t) {
497
497
  var e;
498
- return (e = t ?? Et.Promise) !== null && e !== void 0 ? e : Promise;
499
- }
500
- function Tt(t) {
501
- return t && j(t.next) && j(t.error) && j(t.complete);
498
+ return (e = t ?? xt.Promise) !== null && e !== void 0 ? e : Promise;
502
499
  }
503
500
  function Ot(t) {
504
- return t && t instanceof Oe || Tt(t) && qe(t);
501
+ return t && V(t.next) && V(t.error) && V(t.complete);
502
+ }
503
+ function It(t) {
504
+ return t && t instanceof Ie || Ot(t) && qe(t);
505
505
  }
506
506
  function Ct(t) {
507
- return j(t == null ? void 0 : t.lift);
507
+ return V(t == null ? void 0 : t.lift);
508
508
  }
509
- function U(t) {
509
+ function z(t) {
510
510
  return function(e) {
511
511
  if (Ct(e))
512
512
  return e.lift(function(r) {
@@ -519,36 +519,36 @@ function U(t) {
519
519
  throw new TypeError("Unable to lift unknown Observable type");
520
520
  };
521
521
  }
522
- function N(t, e, r, n, o) {
523
- return new It(t, e, r, n, o);
522
+ function U(t, e, r, n, s) {
523
+ return new Bt(t, e, r, n, s);
524
524
  }
525
- var It = function(t) {
526
- W(e, t);
527
- function e(r, n, o, s, u, a) {
528
- var l = t.call(this, r) || this;
529
- return l.onFinalize = u, l.shouldUnsubscribe = a, l._next = n ? function(i) {
525
+ var Bt = function(t) {
526
+ Z(e, t);
527
+ function e(r, n, s, o, u, a) {
528
+ var c = t.call(this, r) || this;
529
+ return c.onFinalize = u, c.shouldUnsubscribe = a, c._next = n ? function(i) {
530
530
  try {
531
531
  n(i);
532
- } catch (h) {
533
- r.error(h);
532
+ } catch (f) {
533
+ r.error(f);
534
534
  }
535
- } : t.prototype._next, l._error = s ? function(i) {
535
+ } : t.prototype._next, c._error = o ? function(i) {
536
536
  try {
537
- s(i);
538
- } catch (h) {
539
- r.error(h);
537
+ o(i);
538
+ } catch (f) {
539
+ r.error(f);
540
540
  } finally {
541
541
  this.unsubscribe();
542
542
  }
543
- } : t.prototype._error, l._complete = o ? function() {
543
+ } : t.prototype._error, c._complete = s ? function() {
544
544
  try {
545
- o();
545
+ s();
546
546
  } catch (i) {
547
547
  r.error(i);
548
548
  } finally {
549
549
  this.unsubscribe();
550
550
  }
551
- } : t.prototype._complete, l;
551
+ } : t.prototype._complete, c;
552
552
  }
553
553
  return e.prototype.unsubscribe = function() {
554
554
  var r;
@@ -557,56 +557,56 @@ var It = function(t) {
557
557
  t.prototype.unsubscribe.call(this), !n && ((r = this.onFinalize) === null || r === void 0 || r.call(this));
558
558
  }
559
559
  }, e;
560
- }(Oe), Bt = Te(function(t) {
560
+ }(Ie), Pt = Oe(function(t) {
561
561
  return function() {
562
562
  t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
563
563
  };
564
564
  }), oe = function(t) {
565
- W(e, t);
565
+ Z(e, t);
566
566
  function e() {
567
567
  var r = t.call(this) || this;
568
568
  return r.closed = !1, r.currentObservers = null, r.observers = [], r.isStopped = !1, r.hasError = !1, r.thrownError = null, r;
569
569
  }
570
570
  return e.prototype.lift = function(r) {
571
- var n = new je(this, this);
571
+ var n = new Le(this, this);
572
572
  return n.operator = r, n;
573
573
  }, e.prototype._throwIfClosed = function() {
574
574
  if (this.closed)
575
- throw new Bt();
575
+ throw new Pt();
576
576
  }, e.prototype.next = function(r) {
577
577
  var n = this;
578
- be(function() {
579
- var o, s;
578
+ we(function() {
579
+ var s, o;
580
580
  if (n._throwIfClosed(), !n.isStopped) {
581
581
  n.currentObservers || (n.currentObservers = Array.from(n.observers));
582
582
  try {
583
- for (var u = ue(n.currentObservers), a = u.next(); !a.done; a = u.next()) {
584
- var l = a.value;
585
- l.next(r);
583
+ for (var u = ce(n.currentObservers), a = u.next(); !a.done; a = u.next()) {
584
+ var c = a.value;
585
+ c.next(r);
586
586
  }
587
587
  } catch (i) {
588
- o = { error: i };
588
+ s = { error: i };
589
589
  } finally {
590
590
  try {
591
- a && !a.done && (s = u.return) && s.call(u);
591
+ a && !a.done && (o = u.return) && o.call(u);
592
592
  } finally {
593
- if (o) throw o.error;
593
+ if (s) throw s.error;
594
594
  }
595
595
  }
596
596
  }
597
597
  });
598
598
  }, e.prototype.error = function(r) {
599
599
  var n = this;
600
- be(function() {
600
+ we(function() {
601
601
  if (n._throwIfClosed(), !n.isStopped) {
602
602
  n.hasError = n.isStopped = !0, n.thrownError = r;
603
- for (var o = n.observers; o.length; )
604
- o.shift().error(r);
603
+ for (var s = n.observers; s.length; )
604
+ s.shift().error(r);
605
605
  }
606
606
  });
607
607
  }, e.prototype.complete = function() {
608
608
  var r = this;
609
- be(function() {
609
+ we(function() {
610
610
  if (r._throwIfClosed(), !r.isStopped) {
611
611
  r.isStopped = !0;
612
612
  for (var n = r.observers; n.length; )
@@ -627,40 +627,40 @@ var It = function(t) {
627
627
  }, e.prototype._subscribe = function(r) {
628
628
  return this._throwIfClosed(), this._checkFinalizedStatuses(r), this._innerSubscribe(r);
629
629
  }, e.prototype._innerSubscribe = function(r) {
630
- var n = this, o = this, s = o.hasError, u = o.isStopped, a = o.observers;
631
- return s || u ? ze : (this.currentObservers = null, a.push(r), new de(function() {
632
- n.currentObservers = null, we(a, r);
630
+ var n = this, s = this, o = s.hasError, u = s.isStopped, a = s.observers;
631
+ return o || u ? Ge : (this.currentObservers = null, a.push(r), new ve(function() {
632
+ n.currentObservers = null, Ee(a, r);
633
633
  }));
634
634
  }, e.prototype._checkFinalizedStatuses = function(r) {
635
- var n = this, o = n.hasError, s = n.thrownError, u = n.isStopped;
636
- o ? r.error(s) : u && r.complete();
635
+ var n = this, s = n.hasError, o = n.thrownError, u = n.isStopped;
636
+ s ? r.error(o) : u && r.complete();
637
637
  }, e.prototype.asObservable = function() {
638
638
  var r = new R();
639
639
  return r.source = this, r;
640
640
  }, e.create = function(r, n) {
641
- return new je(r, n);
641
+ return new Le(r, n);
642
642
  }, e;
643
- }(R), je = function(t) {
644
- W(e, t);
643
+ }(R), Le = function(t) {
644
+ Z(e, t);
645
645
  function e(r, n) {
646
- var o = t.call(this) || this;
647
- return o.destination = r, o.source = n, o;
646
+ var s = t.call(this) || this;
647
+ return s.destination = r, s.source = n, s;
648
648
  }
649
649
  return e.prototype.next = function(r) {
650
- var n, o;
651
- (o = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || o === void 0 || o.call(n, r);
650
+ var n, s;
651
+ (s = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || s === void 0 || s.call(n, r);
652
652
  }, e.prototype.error = function(r) {
653
- var n, o;
654
- (o = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || o === void 0 || o.call(n, r);
653
+ var n, s;
654
+ (s = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || s === void 0 || s.call(n, r);
655
655
  }, e.prototype.complete = function() {
656
656
  var r, n;
657
657
  (n = (r = this.destination) === null || r === void 0 ? void 0 : r.complete) === null || n === void 0 || n.call(r);
658
658
  }, e.prototype._subscribe = function(r) {
659
- var n, o;
660
- return (o = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(r)) !== null && o !== void 0 ? o : ze;
659
+ var n, s;
660
+ return (s = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(r)) !== null && s !== void 0 ? s : Ge;
661
661
  }, e;
662
- }(oe), D = function(t) {
663
- W(e, t);
662
+ }(oe), N = function(t) {
663
+ Z(e, t);
664
664
  function e(r) {
665
665
  var n = t.call(this) || this;
666
666
  return n._value = r, n;
@@ -675,114 +675,114 @@ var It = function(t) {
675
675
  var n = t.prototype._subscribe.call(this, r);
676
676
  return !n.closed && r.next(this._value), n;
677
677
  }, e.prototype.getValue = function() {
678
- var r = this, n = r.hasError, o = r.thrownError, s = r._value;
678
+ var r = this, n = r.hasError, s = r.thrownError, o = r._value;
679
679
  if (n)
680
- throw o;
681
- return this._throwIfClosed(), s;
680
+ throw s;
681
+ return this._throwIfClosed(), o;
682
682
  }, e.prototype.next = function(r) {
683
683
  t.prototype.next.call(this, this._value = r);
684
684
  }, e;
685
- }(oe), Ie = {
685
+ }(oe), Be = {
686
686
  now: function() {
687
- return (Ie.delegate || Date).now();
687
+ return (Be.delegate || Date).now();
688
688
  },
689
689
  delegate: void 0
690
- }, Pt = function(t) {
691
- W(e, t);
692
- function e(r, n, o) {
693
- r === void 0 && (r = 1 / 0), n === void 0 && (n = 1 / 0), o === void 0 && (o = Ie);
694
- var s = t.call(this) || this;
695
- return s._bufferSize = r, s._windowTime = n, s._timestampProvider = o, s._buffer = [], s._infiniteTimeWindow = !0, s._infiniteTimeWindow = n === 1 / 0, s._bufferSize = Math.max(1, r), s._windowTime = Math.max(1, n), s;
690
+ }, kt = function(t) {
691
+ Z(e, t);
692
+ function e(r, n, s) {
693
+ r === void 0 && (r = 1 / 0), n === void 0 && (n = 1 / 0), s === void 0 && (s = Be);
694
+ var o = t.call(this) || this;
695
+ return o._bufferSize = r, o._windowTime = n, o._timestampProvider = s, o._buffer = [], o._infiniteTimeWindow = !0, o._infiniteTimeWindow = n === 1 / 0, o._bufferSize = Math.max(1, r), o._windowTime = Math.max(1, n), o;
696
696
  }
697
697
  return e.prototype.next = function(r) {
698
- var n = this, o = n.isStopped, s = n._buffer, u = n._infiniteTimeWindow, a = n._timestampProvider, l = n._windowTime;
699
- o || (s.push(r), !u && s.push(a.now() + l)), this._trimBuffer(), t.prototype.next.call(this, r);
698
+ var n = this, s = n.isStopped, o = n._buffer, u = n._infiniteTimeWindow, a = n._timestampProvider, c = n._windowTime;
699
+ s || (o.push(r), !u && o.push(a.now() + c)), this._trimBuffer(), t.prototype.next.call(this, r);
700
700
  }, e.prototype._subscribe = function(r) {
701
701
  this._throwIfClosed(), this._trimBuffer();
702
- for (var n = this._innerSubscribe(r), o = this, s = o._infiniteTimeWindow, u = o._buffer, a = u.slice(), l = 0; l < a.length && !r.closed; l += s ? 1 : 2)
703
- r.next(a[l]);
702
+ for (var n = this._innerSubscribe(r), s = this, o = s._infiniteTimeWindow, u = s._buffer, a = u.slice(), c = 0; c < a.length && !r.closed; c += o ? 1 : 2)
703
+ r.next(a[c]);
704
704
  return this._checkFinalizedStatuses(r), n;
705
705
  }, e.prototype._trimBuffer = function() {
706
- var r = this, n = r._bufferSize, o = r._timestampProvider, s = r._buffer, u = r._infiniteTimeWindow, a = (u ? 1 : 2) * n;
707
- if (n < 1 / 0 && a < s.length && s.splice(0, s.length - a), !u) {
708
- for (var l = o.now(), i = 0, h = 1; h < s.length && s[h] <= l; h += 2)
709
- i = h;
710
- i && s.splice(0, i + 1);
706
+ var r = this, n = r._bufferSize, s = r._timestampProvider, o = r._buffer, u = r._infiniteTimeWindow, a = (u ? 1 : 2) * n;
707
+ if (n < 1 / 0 && a < o.length && o.splice(0, o.length - a), !u) {
708
+ for (var c = s.now(), i = 0, f = 1; f < o.length && o[f] <= c; f += 2)
709
+ i = f;
710
+ i && o.splice(0, i + 1);
711
711
  }
712
712
  }, e;
713
- }(oe), kt = function(t) {
714
- W(e, t);
713
+ }(oe), jt = function(t) {
714
+ Z(e, t);
715
715
  function e(r, n) {
716
716
  return t.call(this) || this;
717
717
  }
718
718
  return e.prototype.schedule = function(r, n) {
719
719
  return this;
720
720
  }, e;
721
- }(de), Le = {
721
+ }(ve), Ve = {
722
722
  setInterval: function(t, e) {
723
723
  for (var r = [], n = 2; n < arguments.length; n++)
724
724
  r[n - 2] = arguments[n];
725
- return setInterval.apply(void 0, ce([t, e], le(r)));
725
+ return setInterval.apply(void 0, fe([t, e], le(r)));
726
726
  },
727
727
  clearInterval: function(t) {
728
728
  return clearInterval(t);
729
729
  },
730
730
  delegate: void 0
731
731
  }, Mt = function(t) {
732
- W(e, t);
732
+ Z(e, t);
733
733
  function e(r, n) {
734
- var o = t.call(this, r, n) || this;
735
- return o.scheduler = r, o.work = n, o.pending = !1, o;
734
+ var s = t.call(this, r, n) || this;
735
+ return s.scheduler = r, s.work = n, s.pending = !1, s;
736
736
  }
737
737
  return e.prototype.schedule = function(r, n) {
738
- var o;
738
+ var s;
739
739
  if (n === void 0 && (n = 0), this.closed)
740
740
  return this;
741
741
  this.state = r;
742
- var s = this.id, u = this.scheduler;
743
- return s != null && (this.id = this.recycleAsyncId(u, s, n)), this.pending = !0, this.delay = n, this.id = (o = this.id) !== null && o !== void 0 ? o : this.requestAsyncId(u, this.id, n), this;
744
- }, e.prototype.requestAsyncId = function(r, n, o) {
745
- return o === void 0 && (o = 0), Le.setInterval(r.flush.bind(r, this), o);
746
- }, e.prototype.recycleAsyncId = function(r, n, o) {
747
- if (o === void 0 && (o = 0), o != null && this.delay === o && this.pending === !1)
742
+ var o = this.id, u = this.scheduler;
743
+ return o != null && (this.id = this.recycleAsyncId(u, o, n)), this.pending = !0, this.delay = n, this.id = (s = this.id) !== null && s !== void 0 ? s : this.requestAsyncId(u, this.id, n), this;
744
+ }, e.prototype.requestAsyncId = function(r, n, s) {
745
+ return s === void 0 && (s = 0), Ve.setInterval(r.flush.bind(r, this), s);
746
+ }, e.prototype.recycleAsyncId = function(r, n, s) {
747
+ if (s === void 0 && (s = 0), s != null && this.delay === s && this.pending === !1)
748
748
  return n;
749
- n != null && Le.clearInterval(n);
749
+ n != null && Ve.clearInterval(n);
750
750
  }, e.prototype.execute = function(r, n) {
751
751
  if (this.closed)
752
752
  return new Error("executing a cancelled action");
753
753
  this.pending = !1;
754
- var o = this._execute(r, n);
755
- if (o)
756
- return o;
754
+ var s = this._execute(r, n);
755
+ if (s)
756
+ return s;
757
757
  this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
758
758
  }, e.prototype._execute = function(r, n) {
759
- var o = !1, s;
759
+ var s = !1, o;
760
760
  try {
761
761
  this.work(r);
762
762
  } catch (u) {
763
- o = !0, s = u || new Error("Scheduled action threw falsy error");
763
+ s = !0, o = u || new Error("Scheduled action threw falsy error");
764
764
  }
765
- if (o)
766
- return this.unsubscribe(), s;
765
+ if (s)
766
+ return this.unsubscribe(), o;
767
767
  }, e.prototype.unsubscribe = function() {
768
768
  if (!this.closed) {
769
- var r = this, n = r.id, o = r.scheduler, s = o.actions;
770
- this.work = this.state = this.scheduler = null, this.pending = !1, we(s, this), n != null && (this.id = this.recycleAsyncId(o, n, null)), this.delay = null, t.prototype.unsubscribe.call(this);
769
+ var r = this, n = r.id, s = r.scheduler, o = s.actions;
770
+ this.work = this.state = this.scheduler = null, this.pending = !1, Ee(o, this), n != null && (this.id = this.recycleAsyncId(s, n, null)), this.delay = null, t.prototype.unsubscribe.call(this);
771
771
  }
772
772
  }, e;
773
- }(kt), Ve = function() {
773
+ }(jt), Ke = function() {
774
774
  function t(e, r) {
775
775
  r === void 0 && (r = t.now), this.schedulerActionCtor = e, this.now = r;
776
776
  }
777
777
  return t.prototype.schedule = function(e, r, n) {
778
778
  return r === void 0 && (r = 0), new this.schedulerActionCtor(this, e).schedule(n, r);
779
- }, t.now = Ie.now, t;
780
- }(), jt = function(t) {
781
- W(e, t);
779
+ }, t.now = Be.now, t;
780
+ }(), Lt = function(t) {
781
+ Z(e, t);
782
782
  function e(r, n) {
783
- n === void 0 && (n = Ve.now);
784
- var o = t.call(this, r, n) || this;
785
- return o.actions = [], o._active = !1, o;
783
+ n === void 0 && (n = Ke.now);
784
+ var s = t.call(this, r, n) || this;
785
+ return s.actions = [], s._active = !1, s;
786
786
  }
787
787
  return e.prototype.flush = function(r) {
788
788
  var n = this.actions;
@@ -790,72 +790,72 @@ var It = function(t) {
790
790
  n.push(r);
791
791
  return;
792
792
  }
793
- var o;
793
+ var s;
794
794
  this._active = !0;
795
795
  do
796
- if (o = r.execute(r.state, r.delay))
796
+ if (s = r.execute(r.state, r.delay))
797
797
  break;
798
798
  while (r = n.shift());
799
- if (this._active = !1, o) {
799
+ if (this._active = !1, s) {
800
800
  for (; r = n.shift(); )
801
801
  r.unsubscribe();
802
- throw o;
802
+ throw s;
803
803
  }
804
804
  }, e;
805
- }(Ve), Lt = new jt(Mt), se = new R(function(t) {
805
+ }(Ke), Vt = new Lt(Mt), ae = new R(function(t) {
806
806
  return t.complete();
807
807
  });
808
- function Vt(t) {
809
- return t && j(t.schedule);
808
+ function Kt(t) {
809
+ return t && V(t.schedule);
810
810
  }
811
- function We(t) {
811
+ function Ye(t) {
812
812
  return t[t.length - 1];
813
813
  }
814
814
  function Rt(t) {
815
- return j(We(t)) ? t.pop() : void 0;
815
+ return V(Ye(t)) ? t.pop() : void 0;
816
816
  }
817
- function Ye(t) {
818
- return Vt(We(t)) ? t.pop() : void 0;
817
+ function Ze(t) {
818
+ return Kt(Ye(t)) ? t.pop() : void 0;
819
819
  }
820
- var Ze = function(t) {
820
+ var Je = function(t) {
821
821
  return t && typeof t.length == "number" && typeof t != "function";
822
822
  };
823
- function Je(t) {
824
- return j(t == null ? void 0 : t.then);
825
- }
826
823
  function He(t) {
827
- return j(t[Ce]);
824
+ return V(t == null ? void 0 : t.then);
828
825
  }
829
826
  function Qe(t) {
830
- return Symbol.asyncIterator && j(t == null ? void 0 : t[Symbol.asyncIterator]);
827
+ return V(t[Ce]);
831
828
  }
832
829
  function Xe(t) {
830
+ return Symbol.asyncIterator && V(t == null ? void 0 : t[Symbol.asyncIterator]);
831
+ }
832
+ function et(t) {
833
833
  return new TypeError("You provided " + (t !== null && typeof t == "object" ? "an invalid object" : "'" + t + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
834
834
  }
835
- function Kt() {
835
+ function Ft() {
836
836
  return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
837
837
  }
838
- var et = Kt();
839
- function tt(t) {
840
- return j(t == null ? void 0 : t[et]);
841
- }
838
+ var tt = Ft();
842
839
  function rt(t) {
843
- return bt(this, arguments, function() {
844
- var r, n, o, s;
845
- return Ue(this, function(u) {
840
+ return V(t == null ? void 0 : t[tt]);
841
+ }
842
+ function nt(t) {
843
+ return wt(this, arguments, function() {
844
+ var r, n, s, o;
845
+ return ze(this, function(u) {
846
846
  switch (u.label) {
847
847
  case 0:
848
848
  r = t.getReader(), u.label = 1;
849
849
  case 1:
850
850
  u.trys.push([1, , 9, 10]), u.label = 2;
851
851
  case 2:
852
- return [4, ie(r.read())];
852
+ return [4, ue(r.read())];
853
853
  case 3:
854
- return n = u.sent(), o = n.value, s = n.done, s ? [4, ie(void 0)] : [3, 5];
854
+ return n = u.sent(), s = n.value, o = n.done, o ? [4, ue(void 0)] : [3, 5];
855
855
  case 4:
856
856
  return [2, u.sent()];
857
857
  case 5:
858
- return [4, ie(o)];
858
+ return [4, ue(s)];
859
859
  case 6:
860
860
  return [4, u.sent()];
861
861
  case 7:
@@ -870,58 +870,58 @@ function rt(t) {
870
870
  });
871
871
  });
872
872
  }
873
- function nt(t) {
874
- return j(t == null ? void 0 : t.getReader);
873
+ function st(t) {
874
+ return V(t == null ? void 0 : t.getReader);
875
875
  }
876
- function X(t) {
876
+ function te(t) {
877
877
  if (t instanceof R)
878
878
  return t;
879
879
  if (t != null) {
880
- if (He(t))
881
- return Ft(t);
882
- if (Ze(t))
880
+ if (Qe(t))
883
881
  return Dt(t);
884
882
  if (Je(t))
885
883
  return Nt(t);
886
- if (Qe(t))
887
- return ot(t);
888
- if (tt(t))
884
+ if (He(t))
889
885
  return Ut(t);
890
- if (nt(t))
886
+ if (Xe(t))
887
+ return ot(t);
888
+ if (rt(t))
891
889
  return zt(t);
890
+ if (st(t))
891
+ return Gt(t);
892
892
  }
893
- throw Xe(t);
893
+ throw et(t);
894
894
  }
895
- function Ft(t) {
895
+ function Dt(t) {
896
896
  return new R(function(e) {
897
897
  var r = t[Ce]();
898
- if (j(r.subscribe))
898
+ if (V(r.subscribe))
899
899
  return r.subscribe(e);
900
900
  throw new TypeError("Provided object does not correctly implement Symbol.observable");
901
901
  });
902
902
  }
903
- function Dt(t) {
903
+ function Nt(t) {
904
904
  return new R(function(e) {
905
905
  for (var r = 0; r < t.length && !e.closed; r++)
906
906
  e.next(t[r]);
907
907
  e.complete();
908
908
  });
909
909
  }
910
- function Nt(t) {
910
+ function Ut(t) {
911
911
  return new R(function(e) {
912
912
  t.then(function(r) {
913
913
  e.closed || (e.next(r), e.complete());
914
914
  }, function(r) {
915
915
  return e.error(r);
916
- }).then(null, Ge);
916
+ }).then(null, We);
917
917
  });
918
918
  }
919
- function Ut(t) {
919
+ function zt(t) {
920
920
  return new R(function(e) {
921
921
  var r, n;
922
922
  try {
923
- for (var o = ue(t), s = o.next(); !s.done; s = o.next()) {
924
- var u = s.value;
923
+ for (var s = ce(t), o = s.next(); !o.done; o = s.next()) {
924
+ var u = o.value;
925
925
  if (e.next(u), e.closed)
926
926
  return;
927
927
  }
@@ -929,7 +929,7 @@ function Ut(t) {
929
929
  r = { error: a };
930
930
  } finally {
931
931
  try {
932
- s && !s.done && (n = o.return) && n.call(o);
932
+ o && !o.done && (n = s.return) && n.call(s);
933
933
  } finally {
934
934
  if (r) throw r.error;
935
935
  }
@@ -944,38 +944,38 @@ function ot(t) {
944
944
  });
945
945
  });
946
946
  }
947
- function zt(t) {
948
- return ot(rt(t));
947
+ function Gt(t) {
948
+ return ot(nt(t));
949
949
  }
950
950
  function qt(t, e) {
951
- var r, n, o, s;
952
- return gt(this, void 0, void 0, function() {
951
+ var r, n, s, o;
952
+ return bt(this, void 0, void 0, function() {
953
953
  var u, a;
954
- return Ue(this, function(l) {
955
- switch (l.label) {
954
+ return ze(this, function(c) {
955
+ switch (c.label) {
956
956
  case 0:
957
- l.trys.push([0, 5, 6, 11]), r = wt(t), l.label = 1;
957
+ c.trys.push([0, 5, 6, 11]), r = Et(t), c.label = 1;
958
958
  case 1:
959
959
  return [4, r.next()];
960
960
  case 2:
961
- if (n = l.sent(), !!n.done) return [3, 4];
961
+ if (n = c.sent(), !!n.done) return [3, 4];
962
962
  if (u = n.value, e.next(u), e.closed)
963
963
  return [2];
964
- l.label = 3;
964
+ c.label = 3;
965
965
  case 3:
966
966
  return [3, 1];
967
967
  case 4:
968
968
  return [3, 11];
969
969
  case 5:
970
- return a = l.sent(), o = { error: a }, [3, 11];
970
+ return a = c.sent(), s = { error: a }, [3, 11];
971
971
  case 6:
972
- return l.trys.push([6, , 9, 10]), n && !n.done && (s = r.return) ? [4, s.call(r)] : [3, 8];
972
+ return c.trys.push([6, , 9, 10]), n && !n.done && (o = r.return) ? [4, o.call(r)] : [3, 8];
973
973
  case 7:
974
- l.sent(), l.label = 8;
974
+ c.sent(), c.label = 8;
975
975
  case 8:
976
976
  return [3, 10];
977
977
  case 9:
978
- if (o) throw o.error;
978
+ if (s) throw s.error;
979
979
  return [7];
980
980
  case 10:
981
981
  return [7];
@@ -985,45 +985,45 @@ function qt(t, e) {
985
985
  });
986
986
  });
987
987
  }
988
- function re(t, e, r, n, o) {
989
- n === void 0 && (n = 0), o === void 0 && (o = !1);
990
- var s = e.schedule(function() {
991
- r(), o ? t.add(this.schedule(null, n)) : this.unsubscribe();
988
+ function se(t, e, r, n, s) {
989
+ n === void 0 && (n = 0), s === void 0 && (s = !1);
990
+ var o = e.schedule(function() {
991
+ r(), s ? t.add(this.schedule(null, n)) : this.unsubscribe();
992
992
  }, n);
993
- if (t.add(s), !o)
994
- return s;
995
- }
996
- function st(t, e) {
997
- return e === void 0 && (e = 0), U(function(r, n) {
998
- r.subscribe(N(n, function(o) {
999
- return re(n, t, function() {
1000
- return n.next(o);
993
+ if (t.add(o), !s)
994
+ return o;
995
+ }
996
+ function at(t, e) {
997
+ return e === void 0 && (e = 0), z(function(r, n) {
998
+ r.subscribe(U(n, function(s) {
999
+ return se(n, t, function() {
1000
+ return n.next(s);
1001
1001
  }, e);
1002
1002
  }, function() {
1003
- return re(n, t, function() {
1003
+ return se(n, t, function() {
1004
1004
  return n.complete();
1005
1005
  }, e);
1006
- }, function(o) {
1007
- return re(n, t, function() {
1008
- return n.error(o);
1006
+ }, function(s) {
1007
+ return se(n, t, function() {
1008
+ return n.error(s);
1009
1009
  }, e);
1010
1010
  }));
1011
1011
  });
1012
1012
  }
1013
- function at(t, e) {
1014
- return e === void 0 && (e = 0), U(function(r, n) {
1013
+ function it(t, e) {
1014
+ return e === void 0 && (e = 0), z(function(r, n) {
1015
1015
  n.add(t.schedule(function() {
1016
1016
  return r.subscribe(n);
1017
1017
  }, e));
1018
1018
  });
1019
1019
  }
1020
- function Gt(t, e) {
1021
- return X(t).pipe(at(e), st(e));
1022
- }
1023
1020
  function Wt(t, e) {
1024
- return X(t).pipe(at(e), st(e));
1021
+ return te(t).pipe(it(e), at(e));
1025
1022
  }
1026
1023
  function Yt(t, e) {
1024
+ return te(t).pipe(it(e), at(e));
1025
+ }
1026
+ function Zt(t, e) {
1027
1027
  return new R(function(r) {
1028
1028
  var n = 0;
1029
1029
  return e.schedule(function() {
@@ -1031,98 +1031,98 @@ function Yt(t, e) {
1031
1031
  });
1032
1032
  });
1033
1033
  }
1034
- function Zt(t, e) {
1034
+ function Jt(t, e) {
1035
1035
  return new R(function(r) {
1036
1036
  var n;
1037
- return re(r, e, function() {
1038
- n = t[et](), re(r, e, function() {
1039
- var o, s, u;
1037
+ return se(r, e, function() {
1038
+ n = t[tt](), se(r, e, function() {
1039
+ var s, o, u;
1040
1040
  try {
1041
- o = n.next(), s = o.value, u = o.done;
1041
+ s = n.next(), o = s.value, u = s.done;
1042
1042
  } catch (a) {
1043
1043
  r.error(a);
1044
1044
  return;
1045
1045
  }
1046
- u ? r.complete() : r.next(s);
1046
+ u ? r.complete() : r.next(o);
1047
1047
  }, 0, !0);
1048
1048
  }), function() {
1049
- return j(n == null ? void 0 : n.return) && n.return();
1049
+ return V(n == null ? void 0 : n.return) && n.return();
1050
1050
  };
1051
1051
  });
1052
1052
  }
1053
- function it(t, e) {
1053
+ function ut(t, e) {
1054
1054
  if (!t)
1055
1055
  throw new Error("Iterable cannot be null");
1056
1056
  return new R(function(r) {
1057
- re(r, e, function() {
1057
+ se(r, e, function() {
1058
1058
  var n = t[Symbol.asyncIterator]();
1059
- re(r, e, function() {
1060
- n.next().then(function(o) {
1061
- o.done ? r.complete() : r.next(o.value);
1059
+ se(r, e, function() {
1060
+ n.next().then(function(s) {
1061
+ s.done ? r.complete() : r.next(s.value);
1062
1062
  });
1063
1063
  }, 0, !0);
1064
1064
  });
1065
1065
  });
1066
1066
  }
1067
- function Jt(t, e) {
1068
- return it(rt(t), e);
1069
- }
1070
1067
  function Ht(t, e) {
1068
+ return ut(nt(t), e);
1069
+ }
1070
+ function Qt(t, e) {
1071
1071
  if (t != null) {
1072
- if (He(t))
1073
- return Gt(t, e);
1074
- if (Ze(t))
1075
- return Yt(t, e);
1076
- if (Je(t))
1077
- return Wt(t, e);
1078
1072
  if (Qe(t))
1079
- return it(t, e);
1080
- if (tt(t))
1073
+ return Wt(t, e);
1074
+ if (Je(t))
1081
1075
  return Zt(t, e);
1082
- if (nt(t))
1076
+ if (He(t))
1077
+ return Yt(t, e);
1078
+ if (Xe(t))
1079
+ return ut(t, e);
1080
+ if (rt(t))
1083
1081
  return Jt(t, e);
1082
+ if (st(t))
1083
+ return Ht(t, e);
1084
1084
  }
1085
- throw Xe(t);
1085
+ throw et(t);
1086
1086
  }
1087
- function Be(t, e) {
1088
- return e ? Ht(t, e) : X(t);
1087
+ function Pe(t, e) {
1088
+ return e ? Qt(t, e) : te(t);
1089
1089
  }
1090
- function Qt() {
1090
+ function Xt() {
1091
1091
  for (var t = [], e = 0; e < arguments.length; e++)
1092
1092
  t[e] = arguments[e];
1093
- var r = Ye(t);
1094
- return Be(t, r);
1093
+ var r = Ze(t);
1094
+ return Pe(t, r);
1095
1095
  }
1096
- var ut = Te(function(t) {
1096
+ var ct = Oe(function(t) {
1097
1097
  return function() {
1098
1098
  t(this), this.name = "EmptyError", this.message = "no elements in sequence";
1099
1099
  };
1100
1100
  });
1101
1101
  function q(t, e) {
1102
- return U(function(r, n) {
1103
- var o = 0;
1104
- r.subscribe(N(n, function(s) {
1105
- n.next(t.call(e, s, o++));
1102
+ return z(function(r, n) {
1103
+ var s = 0;
1104
+ r.subscribe(U(n, function(o) {
1105
+ n.next(t.call(e, o, s++));
1106
1106
  }));
1107
1107
  });
1108
1108
  }
1109
- var Xt = Array.isArray;
1110
- function er(t, e) {
1111
- return Xt(e) ? t.apply(void 0, ce([], le(e))) : t(e);
1109
+ var er = Array.isArray;
1110
+ function tr(t, e) {
1111
+ return er(e) ? t.apply(void 0, fe([], le(e))) : t(e);
1112
1112
  }
1113
- function tr(t) {
1113
+ function rr(t) {
1114
1114
  return q(function(e) {
1115
- return er(t, e);
1115
+ return tr(t, e);
1116
1116
  });
1117
1117
  }
1118
- var rr = Array.isArray, nr = Object.getPrototypeOf, or = Object.prototype, sr = Object.keys;
1119
- function ar(t) {
1118
+ var nr = Array.isArray, sr = Object.getPrototypeOf, or = Object.prototype, ar = Object.keys;
1119
+ function ir(t) {
1120
1120
  if (t.length === 1) {
1121
1121
  var e = t[0];
1122
- if (rr(e))
1122
+ if (nr(e))
1123
1123
  return { args: e, keys: null };
1124
- if (ir(e)) {
1125
- var r = sr(e);
1124
+ if (ur(e)) {
1125
+ var r = ar(e);
1126
1126
  return {
1127
1127
  args: r.map(function(n) {
1128
1128
  return e[n];
@@ -1133,147 +1133,147 @@ function ar(t) {
1133
1133
  }
1134
1134
  return { args: t, keys: null };
1135
1135
  }
1136
- function ir(t) {
1137
- return t && typeof t == "object" && nr(t) === or;
1136
+ function ur(t) {
1137
+ return t && typeof t == "object" && sr(t) === or;
1138
1138
  }
1139
- function ur(t, e) {
1140
- return t.reduce(function(r, n, o) {
1141
- return r[n] = e[o], r;
1139
+ function cr(t, e) {
1140
+ return t.reduce(function(r, n, s) {
1141
+ return r[n] = e[s], r;
1142
1142
  }, {});
1143
1143
  }
1144
- function Y() {
1144
+ function H() {
1145
1145
  for (var t = [], e = 0; e < arguments.length; e++)
1146
1146
  t[e] = arguments[e];
1147
- var r = Ye(t), n = Rt(t), o = ar(t), s = o.args, u = o.keys;
1148
- if (s.length === 0)
1149
- return Be([], r);
1150
- var a = new R(lr(s, r, u ? function(l) {
1151
- return ur(u, l);
1147
+ var r = Ze(t), n = Rt(t), s = ir(t), o = s.args, u = s.keys;
1148
+ if (o.length === 0)
1149
+ return Pe([], r);
1150
+ var a = new R(lr(o, r, u ? function(c) {
1151
+ return cr(u, c);
1152
1152
  } : me));
1153
- return n ? a.pipe(tr(n)) : a;
1153
+ return n ? a.pipe(rr(n)) : a;
1154
1154
  }
1155
1155
  function lr(t, e, r) {
1156
1156
  return r === void 0 && (r = me), function(n) {
1157
1157
  Re(e, function() {
1158
- for (var o = t.length, s = new Array(o), u = o, a = o, l = function(h) {
1158
+ for (var s = t.length, o = new Array(s), u = s, a = s, c = function(f) {
1159
1159
  Re(e, function() {
1160
- var b = Be(t[h], e), w = !1;
1161
- b.subscribe(N(n, function(m) {
1162
- s[h] = m, w || (w = !0, a--), a || n.next(r(s.slice()));
1160
+ var w = Pe(t[f], e), S = !1;
1161
+ w.subscribe(U(n, function(y) {
1162
+ o[f] = y, S || (S = !0, a--), a || n.next(r(o.slice()));
1163
1163
  }, function() {
1164
1164
  --u || n.complete();
1165
1165
  }));
1166
1166
  }, n);
1167
- }, i = 0; i < o; i++)
1168
- l(i);
1167
+ }, i = 0; i < s; i++)
1168
+ c(i);
1169
1169
  }, n);
1170
1170
  };
1171
1171
  }
1172
1172
  function Re(t, e, r) {
1173
- t ? re(r, t, e) : e();
1173
+ t ? se(r, t, e) : e();
1174
1174
  }
1175
- function cr(t) {
1175
+ function fr(t) {
1176
1176
  return new R(function(e) {
1177
- X(t()).subscribe(e);
1177
+ te(t()).subscribe(e);
1178
1178
  });
1179
1179
  }
1180
- function fr(t, e, r) {
1181
- return cr(function() {
1180
+ function hr(t, e, r) {
1181
+ return fr(function() {
1182
1182
  return t() ? e : r;
1183
1183
  });
1184
1184
  }
1185
- function ye(t, e) {
1186
- return U(function(r, n) {
1187
- var o = 0;
1188
- r.subscribe(N(n, function(s) {
1189
- return t.call(e, s, o++) && n.next(s);
1185
+ function pe(t, e) {
1186
+ return z(function(r, n) {
1187
+ var s = 0;
1188
+ r.subscribe(U(n, function(o) {
1189
+ return t.call(e, o, s++) && n.next(o);
1190
1190
  }));
1191
1191
  });
1192
1192
  }
1193
- function ae(t) {
1194
- return U(function(e, r) {
1195
- var n = null, o = !1, s;
1196
- n = e.subscribe(N(r, void 0, void 0, function(u) {
1197
- s = X(t(u, ae(t)(e))), n ? (n.unsubscribe(), n = null, s.subscribe(r)) : o = !0;
1198
- })), o && (n.unsubscribe(), n = null, s.subscribe(r));
1193
+ function ie(t) {
1194
+ return z(function(e, r) {
1195
+ var n = null, s = !1, o;
1196
+ n = e.subscribe(U(r, void 0, void 0, function(u) {
1197
+ o = te(t(u, ie(t)(e))), n ? (n.unsubscribe(), n = null, o.subscribe(r)) : s = !0;
1198
+ })), s && (n.unsubscribe(), n = null, o.subscribe(r));
1199
1199
  });
1200
1200
  }
1201
- function G(t, e) {
1202
- return e === void 0 && (e = Lt), U(function(r, n) {
1203
- var o = null, s = null, u = null, a = function() {
1204
- if (o) {
1205
- o.unsubscribe(), o = null;
1206
- var i = s;
1207
- s = null, n.next(i);
1201
+ function W(t, e) {
1202
+ return e === void 0 && (e = Vt), z(function(r, n) {
1203
+ var s = null, o = null, u = null, a = function() {
1204
+ if (s) {
1205
+ s.unsubscribe(), s = null;
1206
+ var i = o;
1207
+ o = null, n.next(i);
1208
1208
  }
1209
1209
  };
1210
- function l() {
1211
- var i = u + t, h = e.now();
1212
- if (h < i) {
1213
- o = this.schedule(void 0, i - h), n.add(o);
1210
+ function c() {
1211
+ var i = u + t, f = e.now();
1212
+ if (f < i) {
1213
+ s = this.schedule(void 0, i - f), n.add(s);
1214
1214
  return;
1215
1215
  }
1216
1216
  a();
1217
1217
  }
1218
- r.subscribe(N(n, function(i) {
1219
- s = i, u = e.now(), o || (o = e.schedule(l, t), n.add(o));
1218
+ r.subscribe(U(n, function(i) {
1219
+ o = i, u = e.now(), s || (s = e.schedule(c, t), n.add(s));
1220
1220
  }, function() {
1221
1221
  a(), n.complete();
1222
1222
  }, void 0, function() {
1223
- s = o = null;
1223
+ o = s = null;
1224
1224
  }));
1225
1225
  });
1226
1226
  }
1227
- function hr(t) {
1228
- return U(function(e, r) {
1227
+ function yr(t) {
1228
+ return z(function(e, r) {
1229
1229
  var n = !1;
1230
- e.subscribe(N(r, function(o) {
1231
- n = !0, r.next(o);
1230
+ e.subscribe(U(r, function(s) {
1231
+ n = !0, r.next(s);
1232
1232
  }, function() {
1233
1233
  n || r.next(t), r.complete();
1234
1234
  }));
1235
1235
  });
1236
1236
  }
1237
- function yr(t) {
1237
+ function pr(t) {
1238
1238
  return t <= 0 ? function() {
1239
- return se;
1240
- } : U(function(e, r) {
1239
+ return ae;
1240
+ } : z(function(e, r) {
1241
1241
  var n = 0;
1242
- e.subscribe(N(r, function(o) {
1243
- ++n <= t && (r.next(o), t <= n && r.complete());
1242
+ e.subscribe(U(r, function(s) {
1243
+ ++n <= t && (r.next(s), t <= n && r.complete());
1244
1244
  }));
1245
1245
  });
1246
1246
  }
1247
- function pr(t, e) {
1248
- return e === void 0 && (e = me), t = t ?? dr, U(function(r, n) {
1249
- var o, s = !0;
1250
- r.subscribe(N(n, function(u) {
1247
+ function dr(t, e) {
1248
+ return e === void 0 && (e = me), t = t ?? vr, z(function(r, n) {
1249
+ var s, o = !0;
1250
+ r.subscribe(U(n, function(u) {
1251
1251
  var a = e(u);
1252
- (s || !t(o, a)) && (s = !1, o = a, n.next(u));
1252
+ (o || !t(s, a)) && (o = !1, s = a, n.next(u));
1253
1253
  }));
1254
1254
  });
1255
1255
  }
1256
- function dr(t, e) {
1256
+ function vr(t, e) {
1257
1257
  return t === e;
1258
1258
  }
1259
1259
  function mr(t) {
1260
- return t === void 0 && (t = vr), U(function(e, r) {
1260
+ return t === void 0 && (t = gr), z(function(e, r) {
1261
1261
  var n = !1;
1262
- e.subscribe(N(r, function(o) {
1263
- n = !0, r.next(o);
1262
+ e.subscribe(U(r, function(s) {
1263
+ n = !0, r.next(s);
1264
1264
  }, function() {
1265
1265
  return n ? r.complete() : r.error(t());
1266
1266
  }));
1267
1267
  });
1268
1268
  }
1269
- function vr() {
1270
- return new ut();
1269
+ function gr() {
1270
+ return new ct();
1271
1271
  }
1272
- function gr(t, e) {
1272
+ function br(t, e) {
1273
1273
  var r = arguments.length >= 2;
1274
1274
  return function(n) {
1275
- return n.pipe(me, yr(1), r ? hr(e) : mr(function() {
1276
- return new ut();
1275
+ return n.pipe(me, pr(1), r ? yr(e) : mr(function() {
1276
+ return new ct();
1277
1277
  }));
1278
1278
  };
1279
1279
  }
@@ -1281,32 +1281,32 @@ function lt(t) {
1281
1281
  t === void 0 && (t = {});
1282
1282
  var e = t.connector, r = e === void 0 ? function() {
1283
1283
  return new oe();
1284
- } : e, n = t.resetOnError, o = n === void 0 ? !0 : n, s = t.resetOnComplete, u = s === void 0 ? !0 : s, a = t.resetOnRefCountZero, l = a === void 0 ? !0 : a;
1284
+ } : e, n = t.resetOnError, s = n === void 0 ? !0 : n, o = t.resetOnComplete, u = o === void 0 ? !0 : o, a = t.resetOnRefCountZero, c = a === void 0 ? !0 : a;
1285
1285
  return function(i) {
1286
- var h, b, w, m = 0, v = !1, y = !1, d = function() {
1287
- b == null || b.unsubscribe(), b = void 0;
1288
- }, E = function() {
1289
- d(), h = w = void 0, v = y = !1;
1290
- }, p = function() {
1291
- var _ = h;
1292
- E(), _ == null || _.unsubscribe();
1286
+ var f, w, S, y = 0, A = !1, v = !1, d = function() {
1287
+ w == null || w.unsubscribe(), w = void 0;
1288
+ }, b = function() {
1289
+ d(), f = S = void 0, A = v = !1;
1290
+ }, O = function() {
1291
+ var I = f;
1292
+ b(), I == null || I.unsubscribe();
1293
1293
  };
1294
- return U(function(_, T) {
1295
- m++, !y && !v && d();
1296
- var S = w = w ?? r();
1297
- T.add(function() {
1298
- m--, m === 0 && !y && !v && (b = Se(p, l));
1299
- }), S.subscribe(T), !h && m > 0 && (h = new he({
1300
- next: function(x) {
1301
- return S.next(x);
1294
+ return z(function(I, h) {
1295
+ y++, !v && !A && d();
1296
+ var p = S = S ?? r();
1297
+ h.add(function() {
1298
+ y--, y === 0 && !v && !A && (w = Se(O, c));
1299
+ }), p.subscribe(h), !f && y > 0 && (f = new ye({
1300
+ next: function(E) {
1301
+ return p.next(E);
1302
1302
  },
1303
- error: function(x) {
1304
- y = !0, d(), b = Se(E, o, x), S.error(x);
1303
+ error: function(E) {
1304
+ v = !0, d(), w = Se(b, s, E), p.error(E);
1305
1305
  },
1306
1306
  complete: function() {
1307
- v = !0, d(), b = Se(E, u), S.complete();
1307
+ A = !0, d(), w = Se(b, u), p.complete();
1308
1308
  }
1309
- }), X(_).subscribe(h));
1309
+ }), te(I).subscribe(f));
1310
1310
  })(i);
1311
1311
  };
1312
1312
  }
@@ -1318,106 +1318,106 @@ function Se(t, e) {
1318
1318
  return;
1319
1319
  }
1320
1320
  if (e !== !1) {
1321
- var o = new he({
1321
+ var s = new ye({
1322
1322
  next: function() {
1323
- o.unsubscribe(), t();
1323
+ s.unsubscribe(), t();
1324
1324
  }
1325
1325
  });
1326
- return X(e.apply(void 0, ce([], le(r)))).subscribe(o);
1326
+ return te(e.apply(void 0, fe([], le(r)))).subscribe(s);
1327
1327
  }
1328
1328
  }
1329
- function te(t, e, r) {
1330
- var n, o = !1;
1329
+ function ne(t, e, r) {
1330
+ var n, s = !1;
1331
1331
  return n = t, lt({
1332
1332
  connector: function() {
1333
- return new Pt(n, e, r);
1333
+ return new kt(n, e, r);
1334
1334
  },
1335
1335
  resetOnError: !0,
1336
1336
  resetOnComplete: !1,
1337
- resetOnRefCountZero: o
1337
+ resetOnRefCountZero: s
1338
1338
  });
1339
1339
  }
1340
- function br(t, e) {
1341
- return U(function(r, n) {
1342
- var o = null, s = 0, u = !1, a = function() {
1343
- return u && !o && n.complete();
1340
+ function wr(t, e) {
1341
+ return z(function(r, n) {
1342
+ var s = null, o = 0, u = !1, a = function() {
1343
+ return u && !s && n.complete();
1344
1344
  };
1345
- r.subscribe(N(n, function(l) {
1346
- o == null || o.unsubscribe();
1347
- var i = 0, h = s++;
1348
- X(t(l, h)).subscribe(o = N(n, function(b) {
1349
- return n.next(e ? e(l, b, h, i++) : b);
1345
+ r.subscribe(U(n, function(c) {
1346
+ s == null || s.unsubscribe();
1347
+ var i = 0, f = o++;
1348
+ te(t(c, f)).subscribe(s = U(n, function(w) {
1349
+ return n.next(e ? e(c, w, f, i++) : w);
1350
1350
  }, function() {
1351
- o = null, a();
1351
+ s = null, a();
1352
1352
  }));
1353
1353
  }, function() {
1354
1354
  u = !0, a();
1355
1355
  }));
1356
1356
  });
1357
1357
  }
1358
- function wr(t) {
1359
- return U(function(e, r) {
1360
- X(t).subscribe(N(r, function() {
1358
+ function Er(t) {
1359
+ return z(function(e, r) {
1360
+ te(t).subscribe(U(r, function() {
1361
1361
  return r.complete();
1362
- }, _e)), !r.closed && e.subscribe(r);
1362
+ }, Te)), !r.closed && e.subscribe(r);
1363
1363
  });
1364
1364
  }
1365
- function Er(t) {
1365
+ function xr(t) {
1366
1366
  const e = t.filter((r) => r !== null && !isNaN(r));
1367
1367
  return e.length === 0 ? null : e.reduce((r, n) => r + n, 0);
1368
1368
  }
1369
- function xr(t) {
1369
+ function Ar(t) {
1370
1370
  const e = t.filter((n) => n !== null && !isNaN(n));
1371
- return e.length === 0 ? null : e.reduce((n, o) => n + o, 0) / e.length;
1371
+ return e.length === 0 ? null : e.reduce((n, s) => n + s, 0) / e.length;
1372
1372
  }
1373
1373
  function Sr(t) {
1374
- const e = t.filter((o) => o !== null && !isNaN(o));
1374
+ const e = t.filter((s) => s !== null && !isNaN(s));
1375
1375
  if (e.length === 0) return null;
1376
- const r = [...e].sort((o, s) => o - s), n = Math.floor(r.length / 2);
1376
+ const r = [...e].sort((s, o) => s - o), n = Math.floor(r.length / 2);
1377
1377
  return r.length % 2 === 0 ? (r[n - 1] + r[n]) / 2 : r[n];
1378
1378
  }
1379
- function Ar(t) {
1379
+ function _r(t) {
1380
1380
  const e = t.filter((r) => r !== null && !isNaN(r));
1381
1381
  return e.length === 0 ? null : Math.min(...e);
1382
1382
  }
1383
- function _r(t) {
1383
+ function Tr(t) {
1384
1384
  const e = t.filter((r) => r !== null && !isNaN(r));
1385
1385
  return e.length === 0 ? null : Math.max(...e);
1386
1386
  }
1387
1387
  function $r(t) {
1388
1388
  return t.filter((e) => e !== null && !isNaN(e)).length;
1389
1389
  }
1390
- function Tr(t) {
1390
+ function Or(t) {
1391
1391
  const e = t.filter((r) => r !== null && !isNaN(r));
1392
1392
  return e.length > 0 ? e[0] : null;
1393
1393
  }
1394
- function pe(t, e) {
1394
+ function de(t, e) {
1395
1395
  switch (e) {
1396
1396
  case "sum":
1397
- return Er(t);
1398
- case "mean":
1399
1397
  return xr(t);
1398
+ case "mean":
1399
+ return Ar(t);
1400
1400
  case "median":
1401
1401
  return Sr(t);
1402
1402
  case "min":
1403
- return Ar(t);
1404
- case "max":
1405
1403
  return _r(t);
1404
+ case "max":
1405
+ return Tr(t);
1406
1406
  case "count":
1407
1407
  return $r(t);
1408
1408
  case "none":
1409
- return Tr(t);
1409
+ return Or(t);
1410
1410
  default:
1411
1411
  throw new Error(`Unknown aggregate type: ${e}`);
1412
1412
  }
1413
1413
  }
1414
- function Or(t, e) {
1414
+ function Ir(t, e) {
1415
1415
  let r;
1416
1416
  e.colorScheme === "auto" ? r = "light" : r = e.colorScheme;
1417
- const n = e.colors[r].data, o = t % n.length;
1418
- return n[o];
1417
+ const n = e.colors[r].data, s = t % n.length;
1418
+ return n[s];
1419
1419
  }
1420
- function K(t, e, r) {
1420
+ function D(t, e, r) {
1421
1421
  let n;
1422
1422
  switch (t) {
1423
1423
  case "index":
@@ -1435,33 +1435,33 @@ function K(t, e, r) {
1435
1435
  default:
1436
1436
  n = 0;
1437
1437
  }
1438
- return Or(n, r);
1438
+ return Ir(n, r);
1439
1439
  }
1440
- function Q(t) {
1440
+ function ee(t) {
1441
1441
  return Object.prototype.toString.call(t) === "[object Object]";
1442
1442
  }
1443
1443
  function Cr(t) {
1444
1444
  return Object.prototype.toString.call(t) === "[object Function]";
1445
1445
  }
1446
- function ct(t) {
1446
+ function ft(t) {
1447
1447
  return !!(t && t.nodeType);
1448
1448
  }
1449
- function H(t, e) {
1450
- if (Q(e) === !1 || Q(t) === !1)
1449
+ function Y(t, e) {
1450
+ if (ee(e) === !1 || ee(t) === !1)
1451
1451
  return Object.assign({}, t);
1452
- const r = (n, o) => {
1453
- const s = Object.assign({}, n);
1454
- for (let u of Object.keys(o)) {
1452
+ const r = (n, s) => {
1453
+ const o = Object.assign({}, n);
1454
+ for (let u of Object.keys(s)) {
1455
1455
  if (!(u in n))
1456
1456
  continue;
1457
1457
  let a;
1458
- Q(o[u]) && Q(n[u]) ? (a = r(n[u], o[u]), s[u] = a) : s[u] = o[u];
1458
+ ee(s[u]) && ee(n[u]) ? (a = r(n[u], s[u]), o[u] = a) : o[u] = s[u];
1459
1459
  }
1460
- return s;
1460
+ return o;
1461
1461
  };
1462
1462
  return r(t, e);
1463
1463
  }
1464
- function Yr(t = 0) {
1464
+ function Zr(t = 0) {
1465
1465
  try {
1466
1466
  let e = t.toString().split(".");
1467
1467
  return e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), e.join(".");
@@ -1469,56 +1469,59 @@ function Yr(t = 0) {
1469
1469
  console.error(e);
1470
1470
  }
1471
1471
  }
1472
- function Ir(t) {
1472
+ function Br(t) {
1473
1473
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1474
1474
  return e.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"), e.setAttribute("xmls", "http://www.w3.org/2000/svg"), e.setAttribute("version", "1.1"), e.style.position = "absolute", t && e.classList.add(t), e;
1475
1475
  }
1476
- function Zr(t) {
1476
+ function Jr(t) {
1477
1477
  const e = document.createElement("canvas");
1478
1478
  return e.style.position = "absolute", t && e.classList.add(t), e;
1479
1479
  }
1480
- function Br(t) {
1480
+ function Pr(t) {
1481
1481
  const e = document.createElementNS("http://www.w3.org/2000/svg", "g");
1482
1482
  return t && e.classList.add(t), e;
1483
1483
  }
1484
- function ft(t) {
1484
+ function ht(t) {
1485
1485
  const e = document.createElement("canvas");
1486
1486
  return t && e.classList.add(t), e;
1487
1487
  }
1488
- function Jr(t) {
1488
+ function Hr(t) {
1489
1489
  const e = document.createElement("div");
1490
1490
  return t && e.classList.add(t), e;
1491
1491
  }
1492
- function Pr(t) {
1493
- if (ct(t))
1492
+ function kr(t) {
1493
+ if (ft(t))
1494
1494
  for (; t.firstChild; )
1495
1495
  t.removeChild(t.firstChild);
1496
1496
  }
1497
- function ht(t) {
1497
+ function $(t, e, r = "") {
1498
+ return e.ignore ? "" : t[e.from] || r;
1499
+ }
1500
+ function yt(t) {
1498
1501
  return `[OrbCharts ${t}]:`;
1499
1502
  }
1500
- function z(t) {
1501
- return `${ht("error")} ${t.message}`;
1503
+ function G(t) {
1504
+ return `${yt("error")} ${t.message}`;
1502
1505
  }
1503
- function fe({ from: t, systemMessage: e }) {
1506
+ function he({ from: t, systemMessage: e }) {
1504
1507
  return `unexpected error from '${t}':
1505
1508
  ${e}`;
1506
1509
  }
1507
- function Z({ columnName: t, expectToBe: e, from: r }) {
1510
+ function Q({ columnName: t, expectToBe: e, from: r }) {
1508
1511
  return `Invalid value: '${t}' must be '${e}'
1509
1512
 
1510
1513
  ----> find in '${r}'`;
1511
1514
  }
1512
- function J({ columnName: t, expectToBe: e, from: r }) {
1513
- return `${ht("warning")} Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
1515
+ function X({ columnName: t, expectToBe: e, from: r }) {
1516
+ return `${yt("warning")} Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
1514
1517
 
1515
1518
  ----> find in '${r}'`;
1516
1519
  }
1517
- function kr(t) {
1520
+ function jr(t) {
1518
1521
  return new R((e) => {
1519
1522
  const r = new ResizeObserver((n) => {
1520
- const o = n[0];
1521
- o && o.contentRect && e.next(o.contentRect);
1523
+ const s = n[0];
1524
+ s && s.contentRect && e.next(s.contentRect);
1522
1525
  });
1523
1526
  return r.observe(t), function() {
1524
1527
  r.unobserve(t);
@@ -1528,48 +1531,50 @@ function kr(t) {
1528
1531
  function Mr(t) {
1529
1532
  return `orbcharts-${t}`;
1530
1533
  }
1531
- function jr(t, e) {
1534
+ function Lr(t, e) {
1532
1535
  return `${Mr(t)}-${e}`;
1533
1536
  }
1534
- function Lr(t, e) {
1537
+ function Vr(t, e) {
1535
1538
  const r = {
1536
- string: (s) => typeof s == "string",
1537
- number: (s) => typeof s == "number",
1538
- boolean: (s) => typeof s == "boolean",
1539
- object: (s) => Q(s),
1539
+ string: (o) => typeof o == "string",
1540
+ number: (o) => typeof o == "number",
1541
+ boolean: (o) => typeof o == "boolean",
1542
+ object: (o) => ee(o),
1540
1543
  // 嚴格判斷是否為純物件
1541
- "object[]": (s) => Array.isArray(s) && s.every((u) => Q(u)),
1542
- "string[]": (s) => Array.isArray(s) && s.every((u) => typeof u == "string"),
1543
- "number[]": (s) => Array.isArray(s) && s.every((u) => typeof u == "number"),
1544
- Function: (s) => Cr(s),
1545
- null: (s) => s === null,
1546
- undefined: (s) => s === void 0
1544
+ "object[]": (o) => Array.isArray(o) && o.every((u) => ee(u)),
1545
+ "string[]": (o) => Array.isArray(o) && o.every((u) => typeof u == "string"),
1546
+ "number[]": (o) => Array.isArray(o) && o.every((u) => typeof u == "number"),
1547
+ Function: (o) => Cr(o),
1548
+ null: (o) => o === null,
1549
+ undefined: (o) => o === void 0
1547
1550
  }, n = {
1548
- ColorType: (s) => s === "none" || s === "data" || s === "primary" || s === "secondary" || s === "dataContrast" || s === "background"
1551
+ ColorType: (o) => o === "none" || o === "data" || o === "primary" || o === "secondary" || o === "dataContrast" || o === "background"
1549
1552
  };
1550
- return Object.keys(t).find((s) => {
1551
- if (e[s]) {
1552
- const u = e[s], a = t[s];
1553
+ return Object.keys(t).find((o) => {
1554
+ if (e[o]) {
1555
+ const u = e[o], a = t[o];
1556
+ if (a === void 0)
1557
+ return !1;
1553
1558
  if (u.toBeTypes) {
1554
- if (u.toBeTypes.some((h) => r[h](a)) === !1)
1559
+ if (u.toBeTypes.some((f) => r[f](a)) === !1)
1555
1560
  return !0;
1556
1561
  } else if (u.toBe) {
1557
- const { toBe: l, test: i } = u;
1562
+ const { toBe: c, test: i } = u;
1558
1563
  if (i(a) === !1)
1559
1564
  return !0;
1560
1565
  } else if (u.toBeOption) {
1561
- const l = u.toBeOption;
1562
- if (n[l](a) === !1)
1566
+ const c = u.toBeOption;
1567
+ if (n[c](a) === !1)
1563
1568
  return !0;
1564
1569
  }
1565
1570
  }
1566
1571
  return !1;
1567
1572
  });
1568
1573
  }
1569
- function V(t, e) {
1570
- const r = Lr(t, e);
1574
+ function K(t, e) {
1575
+ const r = Vr(t, e);
1571
1576
  if (r) {
1572
- const n = e[r], o = n.toBeTypes ? n.toBeTypes.join(" | ") : n.toBe ? n.toBe : n.toBeOption ? n.toBeOption : "";
1577
+ const n = e[r], s = n.toBeTypes ? n.toBeTypes.join(" | ") : n.toBe ? n.toBe : n.toBeOption ? n.toBeOption : "";
1573
1578
  return {
1574
1579
  status: "error",
1575
1580
  // message: createValidatorErrorMessage({
@@ -1578,7 +1583,7 @@ function V(t, e) {
1578
1583
  // from
1579
1584
  // })
1580
1585
  columnName: r,
1581
- expectToBe: o
1586
+ expectToBe: s
1582
1587
  };
1583
1588
  } else
1584
1589
  return {
@@ -1587,22 +1592,25 @@ function V(t, e) {
1587
1592
  expectToBe: ""
1588
1593
  };
1589
1594
  }
1590
- const Ke = {
1595
+ const Fe = {
1591
1596
  width: "auto",
1592
1597
  height: "auto",
1593
1598
  resizeDebounce: 50
1594
- }, Fe = {
1599
+ }, De = {
1595
1600
  dataset: {
1596
1601
  from: "dataset",
1597
- sort: "original"
1602
+ sort: "original",
1603
+ ignore: !1
1598
1604
  },
1599
1605
  series: {
1600
1606
  from: "series",
1601
- sort: "original"
1607
+ sort: "original",
1608
+ ignore: !1
1602
1609
  },
1603
1610
  category: {
1604
1611
  from: "category",
1605
- sort: "original"
1612
+ sort: "original",
1613
+ ignore: !1
1606
1614
  },
1607
1615
  value: {
1608
1616
  from: "value",
@@ -1615,9 +1623,9 @@ const Ke = {
1615
1623
  { from: "z", name: "z" }
1616
1624
  ],
1617
1625
  color: {
1618
- from: "series"
1626
+ by: "series"
1619
1627
  }
1620
- }, De = {
1628
+ }, Ne = {
1621
1629
  // colorScheme: 'light',
1622
1630
  // colors: {
1623
1631
  // light: {
@@ -1640,16 +1648,36 @@ const Ke = {
1640
1648
  colors: {
1641
1649
  light: {
1642
1650
  data: [
1643
- "#0088FF",
1644
- "#FF3232",
1645
- "#38BEA8",
1646
- "#6F3BD5",
1647
- "#314285",
1648
- "#42C724",
1649
- "#D52580",
1650
- "#F4721B",
1651
- "#D117EA",
1652
- "#7E7D7D"
1651
+ // "#0088FF",
1652
+ // "#FF3232",
1653
+ // "#38BEA8",
1654
+ // "#6F3BD5",
1655
+ // "#314285",
1656
+ // "#42C724",
1657
+ // "#D52580",
1658
+ // "#F4721B",
1659
+ // "#D117EA",
1660
+ // "#7E7D7D"
1661
+ "#4E79A7",
1662
+ // blue
1663
+ "#F28E2B",
1664
+ // orange
1665
+ "#E15759",
1666
+ // red
1667
+ "#76B7B2",
1668
+ // teal
1669
+ "#59A14F",
1670
+ // green
1671
+ "#EDC948",
1672
+ // yellow (已調過不刺眼)
1673
+ "#B07AA1",
1674
+ // purple
1675
+ "#FF9DA7",
1676
+ // pink
1677
+ "#9C755F",
1678
+ // brown
1679
+ "#BAB0AC"
1680
+ // gray
1653
1681
  ],
1654
1682
  primary: "#000000",
1655
1683
  secondary: "#e0e0e0",
@@ -1658,16 +1686,36 @@ const Ke = {
1658
1686
  },
1659
1687
  dark: {
1660
1688
  data: [
1661
- "#4BABFF",
1662
- "#FF6C6C",
1663
- "#7DD3C4",
1664
- "#8E6BC9",
1665
- "#5366AC",
1666
- "#86DC72",
1667
- "#FF72BB",
1668
- "#F9B052",
1669
- "#EF76FF",
1670
- "#C4C4C4"
1689
+ // "#4BABFF",
1690
+ // "#FF6C6C",
1691
+ // "#7DD3C4",
1692
+ // "#8E6BC9",
1693
+ // "#5366AC",
1694
+ // "#86DC72",
1695
+ // "#FF72BB",
1696
+ // "#F9B052",
1697
+ // "#EF76FF",
1698
+ // "#C4C4C4"
1699
+ "#7EA6E0",
1700
+ // blue (亮化)
1701
+ "#FFB86B",
1702
+ // orange
1703
+ "#FF7A7A",
1704
+ // red
1705
+ "#6ED0CC",
1706
+ // teal
1707
+ "#7ED97A",
1708
+ // green
1709
+ "#FFE06E",
1710
+ // yellow
1711
+ "#D4A5D8",
1712
+ // purple
1713
+ "#FFB3BA",
1714
+ // pink
1715
+ "#C89F7A",
1716
+ // brown
1717
+ "#D3D3D3"
1718
+ // gray
1671
1719
  ],
1672
1720
  primary: "#FFFFFF",
1673
1721
  secondary: "#e0e0e0",
@@ -1676,673 +1724,673 @@ const Ke = {
1676
1724
  }
1677
1725
  },
1678
1726
  fontSize: "0.875rem"
1679
- }, Vr = (t, e, r) => {
1680
- const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
1681
- o ? t.forEach((a, l) => {
1727
+ }, Kr = (t, e, r) => {
1728
+ const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
1729
+ s ? t.forEach((a, c) => {
1682
1730
  a.forEach((i) => {
1683
- const h = i[e.dataset.from] || `dataset-${l}`;
1684
- n.has(h) || n.set(h, []), n.get(h).push(i);
1731
+ const f = $(i, e.dataset, `dataset-${c}`);
1732
+ n.has(f) || n.set(f, []), n.get(f).push(i);
1685
1733
  });
1686
1734
  }) : t.forEach((a) => {
1687
- const l = a[e.dataset.from] || "default";
1688
- n.has(l) || n.set(l, []), n.get(l).push(a);
1735
+ const c = $(a, e.dataset, "");
1736
+ n.has(c) || n.set(c, []), n.get(c).push(a);
1689
1737
  });
1690
- let s = Array.from(n.keys());
1738
+ let o = Array.from(n.keys());
1691
1739
  if (Array.isArray(e.dataset.sort))
1692
- s = e.dataset.sort.filter((a) => n.has(a)).concat(s.filter((a) => !e.dataset.sort.includes(a)));
1740
+ o = e.dataset.sort.filter((a) => n.has(a)).concat(o.filter((a) => !e.dataset.sort.includes(a)));
1693
1741
  else if (e.dataset.sort === "original") {
1694
1742
  const a = [];
1695
- o ? t.forEach((l, i) => {
1696
- l.forEach((h) => {
1697
- const b = h[e.dataset.from] || `dataset-${i}`;
1698
- a.includes(b) || a.push(b);
1743
+ s ? t.forEach((c, i) => {
1744
+ c.forEach((f) => {
1745
+ const w = $(f, e.dataset, `dataset-${i}`);
1746
+ a.includes(w) || a.push(w);
1699
1747
  });
1700
- }) : t.forEach((l) => {
1701
- const i = l[e.dataset.from] || "default";
1748
+ }) : t.forEach((c) => {
1749
+ const i = $(c, e.dataset, "");
1702
1750
  a.includes(i) || a.push(i);
1703
- }), s = a;
1704
- } else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
1751
+ }), o = a;
1752
+ } else e.dataset.sort === "alphabetical" && o.sort((a, c) => a.localeCompare(c, void 0, { numeric: !0 }));
1705
1753
  const u = [];
1706
- return s.forEach((a, l) => {
1707
- const i = n.get(a), h = /* @__PURE__ */ new Map();
1708
- i.forEach((y) => {
1709
- const d = y[e.series.from] || "default";
1710
- h.has(d) || h.set(d, []), h.get(d).push(y);
1754
+ return o.forEach((a, c) => {
1755
+ const i = n.get(a), f = /* @__PURE__ */ new Map();
1756
+ i.forEach((v) => {
1757
+ const d = $(v, e.series, "");
1758
+ f.has(d) || f.set(d, []), f.get(d).push(v);
1711
1759
  });
1712
- let b = Array.from(h.keys());
1760
+ let w = Array.from(f.keys());
1713
1761
  if (Array.isArray(e.series.sort))
1714
- b = e.series.sort.filter((y) => h.has(y)).concat(b.filter((y) => !e.series.sort.includes(y)));
1762
+ w = e.series.sort.filter((v) => f.has(v)).concat(w.filter((v) => !e.series.sort.includes(v)));
1715
1763
  else if (e.series.sort === "original") {
1716
- const y = [];
1764
+ const v = [];
1717
1765
  i.forEach((d) => {
1718
- const E = d[e.series.from] || "default";
1719
- y.includes(E) || y.push(E);
1720
- }), b = y;
1721
- } else e.series.sort === "alphabetical" && b.sort((y, d) => y.localeCompare(d, void 0, { numeric: !0 }));
1722
- const w = [];
1766
+ const b = $(d, e.series, "");
1767
+ v.includes(b) || v.push(b);
1768
+ }), w = v;
1769
+ } else e.series.sort === "alphabetical" && w.sort((v, d) => v.localeCompare(d, void 0, { numeric: !0 }));
1770
+ const S = [];
1723
1771
  if (e.category.sort === "original")
1724
- i.forEach((y) => {
1725
- const d = y[e.category.from] || "default";
1726
- w.includes(d) || w.push(d);
1772
+ i.forEach((v) => {
1773
+ const d = $(v, e.category, "");
1774
+ S.includes(d) || S.push(d);
1727
1775
  });
1728
1776
  else if (e.category.sort === "alphabetical") {
1729
- const y = /* @__PURE__ */ new Set();
1777
+ const v = /* @__PURE__ */ new Set();
1730
1778
  i.forEach((d) => {
1731
- y.add(d[e.category.from] || "default");
1732
- }), w.push(...Array.from(y).sort((d, E) => d.localeCompare(E, void 0, { numeric: !0 })));
1779
+ v.add($(d, e.category, ""));
1780
+ }), S.push(...Array.from(v).sort((d, b) => d.localeCompare(b, void 0, { numeric: !0 })));
1733
1781
  } else if (Array.isArray(e.category.sort)) {
1734
- const y = [];
1735
- i.forEach((E) => {
1736
- const p = E[e.category.from] || "default";
1737
- y.includes(p) || y.push(p);
1782
+ const v = [];
1783
+ i.forEach((b) => {
1784
+ const O = $(b, e.category, "");
1785
+ v.includes(O) || v.push(O);
1738
1786
  });
1739
1787
  const d = e.category.sort;
1740
- w.push(
1741
- ...d.filter((E) => y.includes(E)),
1742
- ...y.filter((E) => !d.includes(E))
1788
+ S.push(
1789
+ ...d.filter((b) => v.includes(b)),
1790
+ ...v.filter((b) => !d.includes(b))
1743
1791
  );
1744
1792
  }
1745
- const m = /* @__PURE__ */ new Map();
1746
- w.forEach((y, d) => {
1747
- m.set(y, d);
1793
+ const y = /* @__PURE__ */ new Map();
1794
+ S.forEach((v, d) => {
1795
+ y.set(v, d);
1748
1796
  });
1749
- const v = [];
1750
- b.forEach((y, d) => {
1751
- const E = h.get(y), p = /* @__PURE__ */ new Map();
1752
- E.forEach((S) => {
1753
- const x = S[e.category.from] || "default";
1754
- p.has(x) || p.set(x, []), p.get(x).push(S);
1797
+ const A = [];
1798
+ w.forEach((v, d) => {
1799
+ const b = f.get(v), O = /* @__PURE__ */ new Map();
1800
+ b.forEach((p) => {
1801
+ const E = $(p, e.category, "");
1802
+ O.has(E) || O.set(E, []), O.get(E).push(p);
1755
1803
  });
1756
- const _ = w.filter((S) => p.has(S)), T = [];
1757
- e.category.sort === "original" && e.value.aggregate === "none" ? (E.forEach((S, x) => {
1758
- const B = S[e.category.from] || "default", C = m.get(B), c = S[e.value.from];
1759
- T.push({
1760
- id: S.id || `${a}-${y}-${B}-${x}`,
1804
+ const I = S.filter((p) => O.has(p)), h = [];
1805
+ e.category.sort === "original" && e.value.aggregate === "none" ? (b.forEach((p, E) => {
1806
+ const k = $(p, e.category, ""), C = y.get(k), l = p[e.value.from];
1807
+ h.push({
1808
+ id: p.id || `${a}-${v}-${k}-${E}`,
1761
1809
  index: C,
1762
1810
  // Series 模式下 index 對應 categoryIndex
1763
1811
  modelType: "series",
1764
- name: S.name || "",
1765
- data: S.data,
1766
- value: typeof c == "number" ? c : null,
1767
- color: K(e.color.from, {
1812
+ name: p.name || "",
1813
+ data: p.data,
1814
+ value: typeof l == "number" ? l : null,
1815
+ color: D(e.color.by, {
1768
1816
  index: C,
1769
1817
  seriesIndex: d,
1770
1818
  categoryIndex: C,
1771
- datasetIndex: l
1819
+ datasetIndex: c
1772
1820
  }, r),
1773
- series: y,
1821
+ series: v,
1774
1822
  seriesIndex: d,
1775
- category: B,
1823
+ category: k,
1776
1824
  categoryIndex: C
1777
1825
  });
1778
- }), e.value.sort === "asc" ? T.sort((S, x) => S.value === null && x.value === null ? 0 : S.value === null ? 1 : x.value === null ? -1 : S.value - x.value) : e.value.sort === "desc" && T.sort((S, x) => S.value === null && x.value === null ? 0 : S.value === null ? 1 : x.value === null ? -1 : x.value - S.value)) : _.forEach((S) => {
1779
- const x = m.get(S), B = p.get(S);
1826
+ }), e.value.sort === "asc" ? h.sort((p, E) => p.value === null && E.value === null ? 0 : p.value === null ? 1 : E.value === null ? -1 : p.value - E.value) : e.value.sort === "desc" && h.sort((p, E) => p.value === null && E.value === null ? 0 : p.value === null ? 1 : E.value === null ? -1 : E.value - p.value)) : I.forEach((p) => {
1827
+ const E = y.get(p), k = O.get(p);
1780
1828
  if (e.value.aggregate === "none") {
1781
- let C = B.map((c, f) => {
1782
- const g = c[e.value.from];
1829
+ let C = k.map((l, m) => {
1830
+ const T = l[e.value.from];
1783
1831
  return {
1784
- id: c.id || `${a}-${y}-${S}-${f}`,
1785
- index: x,
1832
+ id: l.id || `${a}-${v}-${p}-${m}`,
1833
+ index: E,
1786
1834
  // Series 模式下 index 對應 categoryIndex
1787
1835
  modelType: "series",
1788
- name: c.name || "",
1789
- data: c.data,
1790
- value: typeof g == "number" ? g : null,
1791
- color: K(e.color.from, {
1792
- index: x,
1836
+ name: l.name || "",
1837
+ data: l.data,
1838
+ value: typeof T == "number" ? T : null,
1839
+ color: D(e.color.by, {
1840
+ index: E,
1793
1841
  seriesIndex: d,
1794
- categoryIndex: x,
1795
- datasetIndex: l
1842
+ categoryIndex: E,
1843
+ datasetIndex: c
1796
1844
  }, r),
1797
- series: y,
1845
+ series: v,
1798
1846
  seriesIndex: d,
1799
- category: S,
1800
- categoryIndex: x
1847
+ category: p,
1848
+ categoryIndex: E
1801
1849
  };
1802
1850
  });
1803
- e.value.sort === "asc" ? C.sort((c, f) => c.value === null && f.value === null ? 0 : c.value === null ? 1 : f.value === null ? -1 : c.value - f.value) : e.value.sort === "desc" && C.sort((c, f) => c.value === null && f.value === null ? 0 : c.value === null ? 1 : f.value === null ? -1 : f.value - c.value), T.push(...C);
1851
+ e.value.sort === "asc" ? C.sort((l, m) => l.value === null && m.value === null ? 0 : l.value === null ? 1 : m.value === null ? -1 : l.value - m.value) : e.value.sort === "desc" && C.sort((l, m) => l.value === null && m.value === null ? 0 : l.value === null ? 1 : m.value === null ? -1 : m.value - l.value), h.push(...C);
1804
1852
  } else {
1805
- const C = B.map((A) => {
1853
+ const C = k.map((B) => {
1806
1854
  if (e.value.aggregate === "count")
1807
1855
  return 1;
1808
- const $ = A[e.value.from];
1809
- return typeof $ == "number" ? $ : null;
1810
- }), c = pe(C, e.value.aggregate), f = B[0], g = {
1811
- id: f.id || `${a}-${y}-${S}-aggregated`,
1812
- index: x,
1856
+ const g = B[e.value.from];
1857
+ return typeof g == "number" ? g : null;
1858
+ }), l = de(C, e.value.aggregate), m = k[0], T = {
1859
+ id: m.id || `${a}-${v}-${p}-aggregated`,
1860
+ index: E,
1813
1861
  // Series 模式下 index 對應 categoryIndex
1814
1862
  modelType: "series",
1815
- name: f.name || S,
1816
- data: f.data,
1817
- value: c,
1818
- color: K(e.color.from, {
1819
- index: x,
1863
+ name: m.name || p,
1864
+ data: m.data,
1865
+ value: l,
1866
+ color: D(e.color.by, {
1867
+ index: E,
1820
1868
  seriesIndex: d,
1821
- categoryIndex: x,
1822
- datasetIndex: l
1869
+ categoryIndex: E,
1870
+ datasetIndex: c
1823
1871
  }, r),
1824
- series: y,
1872
+ series: v,
1825
1873
  seriesIndex: d,
1826
- category: S,
1827
- categoryIndex: x
1874
+ category: p,
1875
+ categoryIndex: E
1828
1876
  };
1829
- T.push(g);
1877
+ h.push(T);
1830
1878
  }
1831
- }), v.push(T);
1832
- }), u.push(v);
1879
+ }), A.push(h);
1880
+ }), u.push(A);
1833
1881
  }), u;
1834
1882
  }, Rr = (t, e, r) => {
1835
- const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
1836
- o ? t.forEach((a, l) => {
1883
+ const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
1884
+ s ? t.forEach((a, c) => {
1837
1885
  a.forEach((i) => {
1838
- const h = i[e.dataset.from] || `dataset-${l}`;
1839
- n.has(h) || n.set(h, []), n.get(h).push(i);
1886
+ const f = $(i, e.dataset, `dataset-${c}`);
1887
+ n.has(f) || n.set(f, []), n.get(f).push(i);
1840
1888
  });
1841
1889
  }) : t.forEach((a) => {
1842
- const l = a[e.dataset.from] || "default";
1843
- n.has(l) || n.set(l, []), n.get(l).push(a);
1890
+ const c = $(a, e.dataset, "");
1891
+ n.has(c) || n.set(c, []), n.get(c).push(a);
1844
1892
  });
1845
- let s = Array.from(n.keys());
1893
+ let o = Array.from(n.keys());
1846
1894
  if (Array.isArray(e.dataset.sort))
1847
- s = e.dataset.sort.filter((a) => n.has(a)).concat(s.filter((a) => !e.dataset.sort.includes(a)));
1895
+ o = e.dataset.sort.filter((a) => n.has(a)).concat(o.filter((a) => !e.dataset.sort.includes(a)));
1848
1896
  else if (e.dataset.sort === "original") {
1849
1897
  const a = [];
1850
- o ? t.forEach((l, i) => {
1851
- l.forEach((h) => {
1852
- const b = h[e.dataset.from] || `dataset-${i}`;
1853
- a.includes(b) || a.push(b);
1898
+ s ? t.forEach((c, i) => {
1899
+ c.forEach((f) => {
1900
+ const w = $(f, e.dataset, `dataset-${i}`);
1901
+ a.includes(w) || a.push(w);
1854
1902
  });
1855
- }) : t.forEach((l) => {
1856
- const i = l[e.dataset.from] || "default";
1903
+ }) : t.forEach((c) => {
1904
+ const i = $(c, e.dataset, "");
1857
1905
  a.includes(i) || a.push(i);
1858
- }), s = a;
1859
- } else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
1906
+ }), o = a;
1907
+ } else e.dataset.sort === "alphabetical" && o.sort((a, c) => a.localeCompare(c, void 0, { numeric: !0 }));
1860
1908
  const u = [];
1861
- return s.forEach((a, l) => {
1862
- const i = n.get(a), h = /* @__PURE__ */ new Map();
1909
+ return o.forEach((a, c) => {
1910
+ const i = n.get(a), f = /* @__PURE__ */ new Map();
1863
1911
  i.forEach((d) => {
1864
- const E = d[e.series.from] || "default";
1865
- h.has(E) || h.set(E, []), h.get(E).push(d);
1912
+ const b = $(d, e.series, "");
1913
+ f.has(b) || f.set(b, []), f.get(b).push(d);
1866
1914
  });
1867
- let b = Array.from(h.keys());
1915
+ let w = Array.from(f.keys());
1868
1916
  if (Array.isArray(e.series.sort))
1869
- b = e.series.sort.filter((d) => h.has(d)).concat(b.filter((d) => !e.series.sort.includes(d)));
1917
+ w = e.series.sort.filter((d) => f.has(d)).concat(w.filter((d) => !e.series.sort.includes(d)));
1870
1918
  else if (e.series.sort === "original") {
1871
1919
  const d = [];
1872
- i.forEach((E) => {
1873
- const p = E[e.series.from] || "default";
1874
- d.includes(p) || d.push(p);
1875
- }), b = d;
1876
- } else e.series.sort === "alphabetical" && b.sort((d, E) => d.localeCompare(E, void 0, { numeric: !0 }));
1877
- const w = [];
1920
+ i.forEach((b) => {
1921
+ const O = $(b, e.series, "");
1922
+ d.includes(O) || d.push(O);
1923
+ }), w = d;
1924
+ } else e.series.sort === "alphabetical" && w.sort((d, b) => d.localeCompare(b, void 0, { numeric: !0 }));
1925
+ const S = [];
1878
1926
  i.forEach((d) => {
1879
- const E = d[e.category.from] || "default";
1880
- w.includes(E) || w.push(E);
1927
+ const b = $(d, e.category, "");
1928
+ S.includes(b) || S.push(b);
1881
1929
  });
1882
- const m = new Set(w);
1883
- let v = Array.from(m);
1884
- Array.isArray(e.category.sort) ? v = e.category.sort.filter((d) => m.has(d)).concat(v.filter((d) => !e.category.sort.includes(d))) : e.category.sort === "original" ? v = w : e.category.sort === "alphabetical" && v.sort((d, E) => d.localeCompare(E, void 0, { numeric: !0 }));
1885
- const y = [];
1886
- b.forEach((d, E) => {
1887
- const p = h.get(d), _ = /* @__PURE__ */ new Map();
1888
- p.forEach((S) => {
1889
- const x = S[e.category.from] || "default";
1890
- _.has(x) || _.set(x, []), _.get(x).push(S);
1930
+ const y = new Set(S);
1931
+ let A = Array.from(y);
1932
+ Array.isArray(e.category.sort) ? A = e.category.sort.filter((d) => y.has(d)).concat(A.filter((d) => !e.category.sort.includes(d))) : e.category.sort === "original" ? A = S : e.category.sort === "alphabetical" && A.sort((d, b) => d.localeCompare(b, void 0, { numeric: !0 }));
1933
+ const v = [];
1934
+ w.forEach((d, b) => {
1935
+ const O = f.get(d), I = /* @__PURE__ */ new Map();
1936
+ O.forEach((p) => {
1937
+ const E = $(p, e.category, "");
1938
+ I.has(E) || I.set(E, []), I.get(E).push(p);
1891
1939
  });
1892
- const T = [];
1893
- v.forEach((S, x) => {
1894
- const B = _.get(S);
1895
- if (!B)
1896
- T.push({
1897
- id: `${a}-${d}-${S}-null`,
1898
- index: x,
1940
+ const h = [];
1941
+ A.forEach((p, E) => {
1942
+ const k = I.get(p);
1943
+ if (!k)
1944
+ h.push({
1945
+ id: `${a}-${d}-${p}-null`,
1946
+ index: E,
1899
1947
  modelType: "grid",
1900
- name: S,
1948
+ name: p,
1901
1949
  data: void 0,
1902
1950
  value: null,
1903
- color: K(e.color.from, {
1904
- index: x,
1905
- seriesIndex: E,
1906
- categoryIndex: x,
1907
- datasetIndex: l
1951
+ color: D(e.color.by, {
1952
+ index: E,
1953
+ seriesIndex: b,
1954
+ categoryIndex: E,
1955
+ datasetIndex: c
1908
1956
  }, r),
1909
1957
  series: d,
1910
- seriesIndex: E,
1911
- category: S,
1912
- categoryIndex: x
1958
+ seriesIndex: b,
1959
+ category: p,
1960
+ categoryIndex: E
1913
1961
  });
1914
1962
  else if (e.value.aggregate === "none") {
1915
- let C = B.map((c, f) => {
1916
- const g = c[e.value.from];
1963
+ let C = k.map((l, m) => {
1964
+ const T = l[e.value.from];
1917
1965
  return {
1918
- id: c.id || `${a}-${d}-${S}-${f}`,
1919
- index: x,
1966
+ id: l.id || `${a}-${d}-${p}-${m}`,
1967
+ index: E,
1920
1968
  // Grid 模式下 index 對應 categoryIndex
1921
1969
  modelType: "grid",
1922
- name: c.name || "",
1923
- data: c.data,
1924
- value: typeof g == "number" ? g : null,
1925
- color: K(e.color.from, {
1926
- index: x,
1927
- seriesIndex: E,
1928
- categoryIndex: x,
1929
- datasetIndex: l
1970
+ name: l.name || "",
1971
+ data: l.data,
1972
+ value: typeof T == "number" ? T : null,
1973
+ color: D(e.color.by, {
1974
+ index: E,
1975
+ seriesIndex: b,
1976
+ categoryIndex: E,
1977
+ datasetIndex: c
1930
1978
  }, r),
1931
1979
  series: d,
1932
- seriesIndex: E,
1933
- category: S,
1934
- categoryIndex: x
1980
+ seriesIndex: b,
1981
+ category: p,
1982
+ categoryIndex: E
1935
1983
  };
1936
1984
  });
1937
- e.value.sort === "asc" ? C.sort((c, f) => c.value === null && f.value === null ? 0 : c.value === null ? 1 : f.value === null ? -1 : c.value - f.value) : e.value.sort === "desc" && C.sort((c, f) => c.value === null && f.value === null ? 0 : c.value === null ? 1 : f.value === null ? -1 : f.value - c.value), T.push(...C);
1985
+ e.value.sort === "asc" ? C.sort((l, m) => l.value === null && m.value === null ? 0 : l.value === null ? 1 : m.value === null ? -1 : l.value - m.value) : e.value.sort === "desc" && C.sort((l, m) => l.value === null && m.value === null ? 0 : l.value === null ? 1 : m.value === null ? -1 : m.value - l.value), h.push(...C);
1938
1986
  } else {
1939
- const C = B.map((A) => {
1987
+ const C = k.map((B) => {
1940
1988
  if (e.value.aggregate === "count")
1941
1989
  return 1;
1942
- const $ = A[e.value.from];
1943
- return typeof $ == "number" ? $ : null;
1944
- }), c = pe(C, e.value.aggregate), f = B[0], g = {
1945
- id: f.id || `${a}-${d}-${S}-aggregated`,
1946
- index: x,
1990
+ const g = B[e.value.from];
1991
+ return typeof g == "number" ? g : null;
1992
+ }), l = de(C, e.value.aggregate), m = k[0], T = {
1993
+ id: m.id || `${a}-${d}-${p}-aggregated`,
1994
+ index: E,
1947
1995
  // Grid 模式下 index 對應 categoryIndex
1948
1996
  modelType: "grid",
1949
- name: f.name || S,
1950
- data: f.data,
1951
- value: c,
1952
- color: K(e.color.from, {
1953
- index: x,
1954
- seriesIndex: E,
1955
- categoryIndex: x,
1956
- datasetIndex: l
1997
+ name: m.name || p,
1998
+ data: m.data,
1999
+ value: l,
2000
+ color: D(e.color.by, {
2001
+ index: E,
2002
+ seriesIndex: b,
2003
+ categoryIndex: E,
2004
+ datasetIndex: c
1957
2005
  }, r),
1958
2006
  series: d,
1959
- seriesIndex: E,
1960
- category: S,
1961
- categoryIndex: x
2007
+ seriesIndex: b,
2008
+ category: p,
2009
+ categoryIndex: E
1962
2010
  };
1963
- T.push(g);
2011
+ h.push(T);
1964
2012
  }
1965
- }), y.push(T);
1966
- }), u.push(y);
2013
+ }), v.push(h);
2014
+ }), u.push(v);
1967
2015
  }), u;
1968
- }, Kr = (t, e, r) => {
1969
- const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
1970
- o ? t.forEach((a, l) => {
2016
+ }, Fr = (t, e, r) => {
2017
+ const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
2018
+ s ? t.forEach((a, c) => {
1971
2019
  a.forEach((i) => {
1972
- const h = i[e.dataset.from] || `dataset-${l}`;
1973
- n.has(h) || n.set(h, []), n.get(h).push(i);
2020
+ const f = $(i, e.dataset, `dataset-${c}`);
2021
+ n.has(f) || n.set(f, []), n.get(f).push(i);
1974
2022
  });
1975
2023
  }) : t.forEach((a) => {
1976
- const l = a[e.dataset.from] || "default";
1977
- n.has(l) || n.set(l, []), n.get(l).push(a);
2024
+ const c = $(a, e.dataset, "");
2025
+ n.has(c) || n.set(c, []), n.get(c).push(a);
1978
2026
  });
1979
- let s = Array.from(n.keys());
2027
+ let o = Array.from(n.keys());
1980
2028
  if (Array.isArray(e.dataset.sort))
1981
- s = e.dataset.sort.filter((a) => n.has(a)).concat(s.filter((a) => !e.dataset.sort.includes(a)));
2029
+ o = e.dataset.sort.filter((a) => n.has(a)).concat(o.filter((a) => !e.dataset.sort.includes(a)));
1982
2030
  else if (e.dataset.sort === "original") {
1983
2031
  const a = [];
1984
- o ? t.forEach((l, i) => {
1985
- l.forEach((h) => {
1986
- const b = h[e.dataset.from] || `dataset-${i}`;
1987
- a.includes(b) || a.push(b);
2032
+ s ? t.forEach((c, i) => {
2033
+ c.forEach((f) => {
2034
+ const w = $(f, e.dataset, `dataset-${i}`);
2035
+ a.includes(w) || a.push(w);
1988
2036
  });
1989
- }) : t.forEach((l) => {
1990
- const i = l[e.dataset.from] || "default";
2037
+ }) : t.forEach((c) => {
2038
+ const i = $(c, e.dataset, "");
1991
2039
  a.includes(i) || a.push(i);
1992
- }), s = a;
1993
- } else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
2040
+ }), o = a;
2041
+ } else e.dataset.sort === "alphabetical" && o.sort((a, c) => a.localeCompare(c, void 0, { numeric: !0 }));
1994
2042
  const u = [];
1995
- return s.forEach((a, l) => {
1996
- const i = n.get(a), h = /* @__PURE__ */ new Map();
1997
- i.forEach((m) => {
1998
- const v = m[e.series.from] || "default";
1999
- h.has(v) || h.set(v, []), h.get(v).push(m);
2043
+ return o.forEach((a, c) => {
2044
+ const i = n.get(a), f = /* @__PURE__ */ new Map();
2045
+ i.forEach((y) => {
2046
+ const A = $(y, e.series, "");
2047
+ f.has(A) || f.set(A, []), f.get(A).push(y);
2000
2048
  });
2001
- let b = Array.from(h.keys());
2049
+ let w = Array.from(f.keys());
2002
2050
  if (Array.isArray(e.series.sort))
2003
- b = e.series.sort.filter((m) => h.has(m)).concat(b.filter((m) => !e.series.sort.includes(m)));
2051
+ w = e.series.sort.filter((y) => f.has(y)).concat(w.filter((y) => !e.series.sort.includes(y)));
2004
2052
  else if (e.series.sort === "original") {
2005
- const m = [];
2006
- i.forEach((v) => {
2007
- const y = v[e.series.from] || "default";
2008
- m.includes(y) || m.push(y);
2009
- }), b = m;
2010
- } else e.series.sort === "alphabetical" && b.sort((m, v) => m.localeCompare(v, void 0, { numeric: !0 }));
2011
- const w = [];
2012
- b.forEach((m, v) => {
2013
- const y = h.get(m), d = /* @__PURE__ */ new Map();
2014
- y.forEach((_) => {
2015
- const T = _[e.category.from] || "default";
2016
- d.has(T) || d.set(T, []), d.get(T).push(_);
2053
+ const y = [];
2054
+ i.forEach((A) => {
2055
+ const v = $(A, e.series, "");
2056
+ y.includes(v) || y.push(v);
2057
+ }), w = y;
2058
+ } else e.series.sort === "alphabetical" && w.sort((y, A) => y.localeCompare(A, void 0, { numeric: !0 }));
2059
+ const S = [];
2060
+ w.forEach((y, A) => {
2061
+ const v = f.get(y), d = /* @__PURE__ */ new Map();
2062
+ v.forEach((I) => {
2063
+ const h = $(I, e.category, "");
2064
+ d.has(h) || d.set(h, []), d.get(h).push(I);
2017
2065
  });
2018
- let E = Array.from(d.keys());
2066
+ let b = Array.from(d.keys());
2019
2067
  if (Array.isArray(e.category.sort))
2020
- E = e.category.sort.filter((_) => d.has(_)).concat(E.filter((_) => !e.category.sort.includes(_)));
2068
+ b = e.category.sort.filter((I) => d.has(I)).concat(b.filter((I) => !e.category.sort.includes(I)));
2021
2069
  else if (e.category.sort === "original") {
2022
- const _ = [];
2023
- y.forEach((T) => {
2024
- const S = T[e.category.from] || "default";
2025
- _.includes(S) || _.push(S);
2026
- }), E = _;
2027
- } else e.category.sort === "alphabetical" && E.sort((_, T) => _.localeCompare(T, void 0, { numeric: !0 }));
2028
- const p = [];
2029
- E.forEach((_, T) => {
2030
- d.get(_).forEach((x, B) => {
2031
- const C = e.multivariate.map((f, g) => ({
2032
- index: g,
2033
- name: f.name,
2070
+ const I = [];
2071
+ v.forEach((h) => {
2072
+ const p = $(h, e.category, "");
2073
+ I.includes(p) || I.push(p);
2074
+ }), b = I;
2075
+ } else e.category.sort === "alphabetical" && b.sort((I, h) => I.localeCompare(h, void 0, { numeric: !0 }));
2076
+ const O = [];
2077
+ b.forEach((I, h) => {
2078
+ d.get(I).forEach((E, k) => {
2079
+ const C = e.multivariate.map((m, T) => ({
2080
+ index: T,
2081
+ name: m.name,
2034
2082
  value: (() => {
2035
- const A = x[f.from];
2036
- return typeof A == "number" ? A : null;
2083
+ const B = E[m.from];
2084
+ return typeof B == "number" ? B : null;
2037
2085
  })()
2038
- })), c = {
2039
- id: x.id || `${a}-${m}-${_}-${B}`,
2040
- index: B,
2086
+ })), l = {
2087
+ id: E.id || `${a}-${y}-${I}-${k}`,
2088
+ index: k,
2041
2089
  modelType: "multivariate",
2042
- name: x.name || "",
2043
- data: x.data,
2090
+ name: E.name || "",
2091
+ data: E.data,
2044
2092
  value: null,
2045
2093
  // MultivariateData 的主要值在 values 陣列中,這裡設為 null
2046
- color: K(e.color.from, {
2047
- index: B,
2048
- seriesIndex: v,
2049
- categoryIndex: T,
2050
- datasetIndex: l
2094
+ color: D(e.color.by, {
2095
+ index: k,
2096
+ seriesIndex: A,
2097
+ categoryIndex: h,
2098
+ datasetIndex: c
2051
2099
  }, r),
2052
2100
  multivariate: C,
2053
- series: m,
2054
- seriesIndex: v,
2055
- category: _,
2056
- categoryIndex: T
2101
+ series: y,
2102
+ seriesIndex: A,
2103
+ category: I,
2104
+ categoryIndex: h
2057
2105
  };
2058
- p.push(c);
2106
+ O.push(l);
2059
2107
  });
2060
- }), w.push(p);
2061
- }), u.push(w);
2108
+ }), S.push(O);
2109
+ }), u.push(S);
2062
2110
  }), u;
2063
- }, Fr = (t, e, r) => {
2064
- const n = Array.isArray(t[0]), o = [], s = [];
2111
+ }, Dr = (t, e, r) => {
2112
+ const n = Array.isArray(t[0]), s = [], o = [];
2065
2113
  n ? t.forEach((i) => {
2066
- i.forEach((h) => {
2067
- h.source && h.target ? s.push(h) : o.push(h);
2114
+ i.forEach((f) => {
2115
+ f.source && f.target ? o.push(f) : s.push(f);
2068
2116
  });
2069
2117
  }) : t.forEach((i) => {
2070
- i.source && i.target ? s.push(i) : o.push(i);
2118
+ i.source && i.target ? o.push(i) : s.push(i);
2071
2119
  });
2072
2120
  const u = /* @__PURE__ */ new Map();
2073
- n ? t.forEach((i, h) => {
2074
- i.forEach((b) => {
2075
- if (!b.source || !b.target) {
2076
- const w = b[e.dataset.from] || `dataset-${h}`;
2077
- u.has(w) || u.set(w, []), u.get(w).push(b);
2121
+ n ? t.forEach((i, f) => {
2122
+ i.forEach((w) => {
2123
+ if (!w.source || !w.target) {
2124
+ const S = $(w, e.dataset, `dataset-${f}`);
2125
+ u.has(S) || u.set(S, []), u.get(S).push(w);
2078
2126
  }
2079
2127
  });
2080
- }) : o.forEach((i) => {
2081
- const h = i[e.dataset.from] || "default";
2082
- u.has(h) || u.set(h, []), u.get(h).push(i);
2128
+ }) : s.forEach((i) => {
2129
+ const f = $(i, e.dataset, "");
2130
+ u.has(f) || u.set(f, []), u.get(f).push(i);
2083
2131
  });
2084
2132
  let a = Array.from(u.keys());
2085
2133
  if (Array.isArray(e.dataset.sort))
2086
2134
  a = e.dataset.sort.filter((i) => u.has(i)).concat(a.filter((i) => !e.dataset.sort.includes(i)));
2087
2135
  else if (e.dataset.sort === "original") {
2088
2136
  const i = [];
2089
- n ? t.forEach((h, b) => {
2090
- h.forEach((w) => {
2091
- if (!w.source || !w.target) {
2092
- const m = w[e.dataset.from] || `dataset-${b}`;
2093
- i.includes(m) || i.push(m);
2137
+ n ? t.forEach((f, w) => {
2138
+ f.forEach((S) => {
2139
+ if (!S.source || !S.target) {
2140
+ const y = $(S, e.dataset, `dataset-${w}`);
2141
+ i.includes(y) || i.push(y);
2094
2142
  }
2095
2143
  });
2096
- }) : o.forEach((h) => {
2097
- const b = h[e.dataset.from] || "default";
2098
- i.includes(b) || i.push(b);
2144
+ }) : s.forEach((f) => {
2145
+ const w = $(f, e.dataset, "");
2146
+ i.includes(w) || i.push(w);
2099
2147
  }), a = i;
2100
- } else e.dataset.sort === "alphabetical" && a.sort((i, h) => i.localeCompare(h, void 0, { numeric: !0 }));
2101
- const l = [];
2102
- return a.forEach((i, h) => {
2103
- const b = u.get(i), w = [], m = /* @__PURE__ */ new Map();
2104
- b.forEach((c) => {
2105
- const f = c[e.series.from] || "default";
2106
- m.has(f) || m.set(f, []), m.get(f).push(c);
2148
+ } else e.dataset.sort === "alphabetical" && a.sort((i, f) => i.localeCompare(f, void 0, { numeric: !0 }));
2149
+ const c = [];
2150
+ return a.forEach((i, f) => {
2151
+ const w = u.get(i), S = [], y = /* @__PURE__ */ new Map();
2152
+ w.forEach((l) => {
2153
+ const m = $(l, e.series, "");
2154
+ y.has(m) || y.set(m, []), y.get(m).push(l);
2107
2155
  });
2108
- let v = Array.from(m.keys());
2156
+ let A = Array.from(y.keys());
2109
2157
  if (Array.isArray(e.series.sort))
2110
- v = e.series.sort.filter((c) => m.has(c)).concat(v.filter((c) => !e.series.sort.includes(c)));
2158
+ A = e.series.sort.filter((l) => y.has(l)).concat(A.filter((l) => !e.series.sort.includes(l)));
2111
2159
  else if (e.series.sort === "original") {
2112
- const c = [];
2113
- b.forEach((f) => {
2114
- const g = f[e.series.from] || "default";
2115
- c.includes(g) || c.push(g);
2116
- }), v = c;
2117
- } else e.series.sort === "alphabetical" && v.sort((c, f) => c.localeCompare(f, void 0, { numeric: !0 }));
2118
- v.forEach((c, f) => {
2119
- const g = m.get(c), A = /* @__PURE__ */ new Map();
2120
- g.forEach((O) => {
2121
- const I = O[e.category.from] || "default";
2122
- A.has(I) || A.set(I, []), A.get(I).push(O);
2160
+ const l = [];
2161
+ w.forEach((m) => {
2162
+ const T = $(m, e.series, "");
2163
+ l.includes(T) || l.push(T);
2164
+ }), A = l;
2165
+ } else e.series.sort === "alphabetical" && A.sort((l, m) => l.localeCompare(m, void 0, { numeric: !0 }));
2166
+ A.forEach((l, m) => {
2167
+ const T = y.get(l), B = /* @__PURE__ */ new Map();
2168
+ T.forEach((x) => {
2169
+ const _ = $(x, e.category, "");
2170
+ B.has(_) || B.set(_, []), B.get(_).push(x);
2123
2171
  });
2124
- let $ = Array.from(A.keys());
2172
+ let g = Array.from(B.keys());
2125
2173
  if (Array.isArray(e.category.sort))
2126
- $ = e.category.sort.filter((O) => A.has(O)).concat($.filter((O) => !e.category.sort.includes(O)));
2174
+ g = e.category.sort.filter((x) => B.has(x)).concat(g.filter((x) => !e.category.sort.includes(x)));
2127
2175
  else if (e.category.sort === "original") {
2128
- const O = [];
2129
- g.forEach((I) => {
2130
- const L = I[e.category.from] || "default";
2131
- O.includes(L) || O.push(L);
2132
- }), $ = O;
2133
- } else e.category.sort === "alphabetical" && $.sort((O, I) => O.localeCompare(I, void 0, { numeric: !0 }));
2134
- $.forEach((O, I) => {
2135
- const L = A.get(O);
2176
+ const x = [];
2177
+ T.forEach((_) => {
2178
+ const P = $(_, e.category, "");
2179
+ x.includes(P) || x.push(P);
2180
+ }), g = x;
2181
+ } else e.category.sort === "alphabetical" && g.sort((x, _) => x.localeCompare(_, void 0, { numeric: !0 }));
2182
+ g.forEach((x, _) => {
2183
+ const P = B.get(x);
2136
2184
  if (e.value.aggregate === "none") {
2137
- let M = L.map((P, k) => {
2138
- const F = P[e.value.from];
2185
+ let j = P.map((M, L) => {
2186
+ const F = M[e.value.from];
2139
2187
  return {
2140
- id: P.id || `${i}-${c}-${O}-${k}`,
2141
- index: w.length + k,
2188
+ id: M.id || `${i}-${l}-${x}-${L}`,
2189
+ index: S.length + L,
2142
2190
  // 在所有 nodes 中的索引
2143
2191
  modelType: "graph",
2144
- name: P.name || "",
2145
- data: P.data,
2192
+ name: M.name || "",
2193
+ data: M.data,
2146
2194
  value: typeof F == "number" ? F : null,
2147
- color: K(e.color.from, {
2148
- index: I,
2149
- seriesIndex: f,
2150
- categoryIndex: I,
2151
- datasetIndex: h
2195
+ color: D(e.color.by, {
2196
+ index: _,
2197
+ seriesIndex: m,
2198
+ categoryIndex: _,
2199
+ datasetIndex: f
2152
2200
  }, r),
2153
- series: c,
2154
- seriesIndex: f,
2155
- category: O,
2156
- categoryIndex: I
2201
+ series: l,
2202
+ seriesIndex: m,
2203
+ category: x,
2204
+ categoryIndex: _
2157
2205
  };
2158
2206
  });
2159
- e.value.sort === "asc" ? M.sort((P, k) => P.value === null && k.value === null ? 0 : P.value === null ? 1 : k.value === null ? -1 : P.value - k.value) : e.value.sort === "desc" && M.sort((P, k) => P.value === null && k.value === null ? 0 : P.value === null ? 1 : k.value === null ? -1 : k.value - P.value), w.push(...M);
2207
+ e.value.sort === "asc" ? j.sort((M, L) => M.value === null && L.value === null ? 0 : M.value === null ? 1 : L.value === null ? -1 : M.value - L.value) : e.value.sort === "desc" && j.sort((M, L) => M.value === null && L.value === null ? 0 : M.value === null ? 1 : L.value === null ? -1 : L.value - M.value), S.push(...j);
2160
2208
  } else {
2161
- const M = L.map((ne) => {
2209
+ const j = P.map((J) => {
2162
2210
  if (e.value.aggregate === "count")
2163
2211
  return 1;
2164
- const ee = ne[e.value.from];
2165
- return typeof ee == "number" ? ee : null;
2166
- }), P = pe(M, e.value.aggregate), k = L[0], F = {
2167
- id: k.id || `${i}-${c}-${O}-aggregated`,
2168
- index: w.length,
2212
+ const re = J[e.value.from];
2213
+ return typeof re == "number" ? re : null;
2214
+ }), M = de(j, e.value.aggregate), L = P[0], F = {
2215
+ id: L.id || `${i}-${l}-${x}-aggregated`,
2216
+ index: S.length,
2169
2217
  // 在所有 nodes 中的索引
2170
2218
  modelType: "graph",
2171
- name: k.name || O,
2172
- data: k.data,
2173
- value: P,
2174
- color: K(e.color.from, {
2175
- index: I,
2176
- seriesIndex: f,
2177
- categoryIndex: I,
2178
- datasetIndex: h
2219
+ name: L.name || x,
2220
+ data: L.data,
2221
+ value: M,
2222
+ color: D(e.color.by, {
2223
+ index: _,
2224
+ seriesIndex: m,
2225
+ categoryIndex: _,
2226
+ datasetIndex: f
2179
2227
  }, r),
2180
- series: c,
2181
- seriesIndex: f,
2182
- category: O,
2183
- categoryIndex: I
2228
+ series: l,
2229
+ seriesIndex: m,
2230
+ category: x,
2231
+ categoryIndex: _
2184
2232
  };
2185
- w.push(F);
2233
+ S.push(F);
2186
2234
  }
2187
2235
  });
2188
2236
  });
2189
- const y = [], d = /* @__PURE__ */ new Map();
2190
- w.forEach((c) => {
2191
- const f = o.find((g) => g.id === c.id || g.name === c.name);
2192
- f != null && f.id && d.set(f.id, c.index), f != null && f.name && d.set(f.name, c.index);
2237
+ const v = [], d = /* @__PURE__ */ new Map();
2238
+ S.forEach((l) => {
2239
+ const m = s.find((T) => T.id === l.id || T.name === l.name);
2240
+ m != null && m.id && d.set(m.id, l.index), m != null && m.name && d.set(m.name, l.index);
2193
2241
  });
2194
- const E = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
2195
- w.forEach((c) => {
2196
- E.has(c.series) || E.set(c.series, c.seriesIndex), p.has(c.category) || p.set(c.category, c.categoryIndex);
2242
+ const b = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map();
2243
+ S.forEach((l) => {
2244
+ b.has(l.series) || b.set(l.series, l.seriesIndex), O.has(l.category) || O.set(l.category, l.categoryIndex);
2197
2245
  });
2198
- let _ = E.size, T = p.size;
2199
- const S = (c) => (E.has(c) || E.set(c, _++), E.get(c)), x = (c) => (p.has(c) || p.set(c, T++), p.get(c)), B = s.filter((c) => (c[e.dataset.from] || "default") === i), C = /* @__PURE__ */ new Map();
2200
- B.forEach((c) => {
2201
- const f = c.source, g = c.target, A = c[e.series.from] || "default", $ = c[e.category.from] || "default", O = `${f}-${g}-${A}-${$}`;
2202
- C.has(O) || C.set(O, []), C.get(O).push(c);
2203
- }), Array.from(C.entries()).forEach(([c, f], g) => {
2204
- const A = f[0], $ = A.source, O = A.target, I = d.get($) ?? -1, L = d.get(O) ?? -1;
2205
- if (I >= 0 && L >= 0)
2246
+ let I = b.size, h = O.size;
2247
+ const p = (l) => (b.has(l) || b.set(l, I++), b.get(l)), E = (l) => (O.has(l) || O.set(l, h++), O.get(l)), k = o.filter((l) => $(l, e.dataset, "") === i), C = /* @__PURE__ */ new Map();
2248
+ k.forEach((l) => {
2249
+ const m = l.source, T = l.target, B = $(l, e.series, ""), g = $(l, e.category, ""), x = `${m}-${T}-${B}-${g}`;
2250
+ C.has(x) || C.set(x, []), C.get(x).push(l);
2251
+ }), Array.from(C.entries()).forEach(([l, m], T) => {
2252
+ const B = m[0], g = B.source, x = B.target, _ = d.get(g) ?? -1, P = d.get(x) ?? -1;
2253
+ if (_ >= 0 && P >= 0)
2206
2254
  if (e.value.aggregate === "none")
2207
- f.forEach((M, P) => {
2208
- const k = M[e.value.from], F = M[e.series.from] || "default", ne = M[e.category.from] || "default", ee = S(F), ve = x(ne), Ee = {
2209
- id: M.id || `edge-${g}-${P}`,
2210
- index: y.length,
2255
+ m.forEach((j, M) => {
2256
+ const L = j[e.value.from], F = $(j, e.series, ""), J = $(j, e.category, ""), re = p(F), ge = E(J), xe = {
2257
+ id: j.id || `edge-${T}-${M}`,
2258
+ index: v.length,
2211
2259
  modelType: "graph",
2212
- name: M.name || "",
2213
- data: M.data,
2214
- value: typeof k == "number" ? k : null,
2215
- color: K(e.color.from, {
2216
- index: y.length,
2217
- seriesIndex: ee,
2218
- categoryIndex: ve,
2219
- datasetIndex: h
2260
+ name: j.name || "",
2261
+ data: j.data,
2262
+ value: typeof L == "number" ? L : null,
2263
+ color: D(e.color.by, {
2264
+ index: v.length,
2265
+ seriesIndex: re,
2266
+ categoryIndex: ge,
2267
+ datasetIndex: f
2220
2268
  }, r),
2221
2269
  series: F,
2222
- seriesIndex: ee,
2223
- category: ne,
2224
- categoryIndex: ve,
2225
- source: $,
2226
- sourceIndex: I,
2227
- target: O,
2228
- targetIndex: L
2270
+ seriesIndex: re,
2271
+ category: J,
2272
+ categoryIndex: ge,
2273
+ source: g,
2274
+ sourceIndex: _,
2275
+ target: x,
2276
+ targetIndex: P
2229
2277
  };
2230
- y.push(Ee);
2278
+ v.push(xe);
2231
2279
  });
2232
2280
  else {
2233
- const M = f.map((Ee) => {
2281
+ const j = m.map((xe) => {
2234
2282
  if (e.value.aggregate === "count")
2235
2283
  return 1;
2236
- const Pe = Ee[e.value.from];
2237
- return typeof Pe == "number" ? Pe : null;
2238
- }), P = pe(M, e.value.aggregate), k = A[e.series.from] || "default", F = A[e.category.from] || "default", ne = S(k), ee = x(F), ve = {
2239
- id: A.id || `edge-${g}-aggregated`,
2240
- index: y.length,
2284
+ const ke = xe[e.value.from];
2285
+ return typeof ke == "number" ? ke : null;
2286
+ }), M = de(j, e.value.aggregate), L = $(B, e.series, ""), F = $(B, e.category, ""), J = p(L), re = E(F), ge = {
2287
+ id: B.id || `edge-${T}-aggregated`,
2288
+ index: v.length,
2241
2289
  modelType: "graph",
2242
- name: A.name || "",
2243
- data: A.data,
2244
- value: P,
2245
- color: K(e.color.from, {
2246
- index: y.length,
2247
- seriesIndex: ne,
2248
- categoryIndex: ee,
2249
- datasetIndex: h
2290
+ name: B.name || "",
2291
+ data: B.data,
2292
+ value: M,
2293
+ color: D(e.color.by, {
2294
+ index: v.length,
2295
+ seriesIndex: J,
2296
+ categoryIndex: re,
2297
+ datasetIndex: f
2250
2298
  }, r),
2251
- series: k,
2252
- seriesIndex: ne,
2299
+ series: L,
2300
+ seriesIndex: J,
2253
2301
  category: F,
2254
- categoryIndex: ee,
2255
- source: $,
2256
- sourceIndex: I,
2257
- target: O,
2258
- targetIndex: L
2302
+ categoryIndex: re,
2303
+ source: g,
2304
+ sourceIndex: _,
2305
+ target: x,
2306
+ targetIndex: P
2259
2307
  };
2260
- y.push(ve);
2308
+ v.push(ge);
2261
2309
  }
2262
- }), l.push({ nodes: w, edges: y });
2263
- }), l;
2264
- }, Dr = (t, e, r) => {
2265
- const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
2266
- o ? t.forEach((a, l) => {
2310
+ }), c.push({ nodes: S, edges: v });
2311
+ }), c;
2312
+ }, Nr = (t, e, r) => {
2313
+ const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
2314
+ s ? t.forEach((a, c) => {
2267
2315
  a.forEach((i) => {
2268
- const h = i[e.dataset.from] || `dataset-${l}`;
2269
- n.has(h) || n.set(h, []), n.get(h).push(i);
2316
+ const f = $(i, e.dataset, `dataset-${c}`);
2317
+ n.has(f) || n.set(f, []), n.get(f).push(i);
2270
2318
  });
2271
2319
  }) : t.forEach((a) => {
2272
- const l = a[e.dataset.from] || "default";
2273
- n.has(l) || n.set(l, []), n.get(l).push(a);
2320
+ const c = $(a, e.dataset, "");
2321
+ n.has(c) || n.set(c, []), n.get(c).push(a);
2274
2322
  });
2275
- let s = Array.from(n.keys());
2323
+ let o = Array.from(n.keys());
2276
2324
  if (Array.isArray(e.dataset.sort))
2277
- s = e.dataset.sort.filter((a) => n.has(a)).concat(s.filter((a) => !e.dataset.sort.includes(a)));
2325
+ o = e.dataset.sort.filter((a) => n.has(a)).concat(o.filter((a) => !e.dataset.sort.includes(a)));
2278
2326
  else if (e.dataset.sort === "original") {
2279
2327
  const a = [];
2280
- o ? t.forEach((l, i) => {
2281
- l.forEach((h) => {
2282
- const b = h[e.dataset.from] || `dataset-${i}`;
2283
- a.includes(b) || a.push(b);
2328
+ s ? t.forEach((c, i) => {
2329
+ c.forEach((f) => {
2330
+ const w = $(f, e.dataset, `dataset-${i}`);
2331
+ a.includes(w) || a.push(w);
2284
2332
  });
2285
- }) : t.forEach((l) => {
2286
- const i = l[e.dataset.from] || "default";
2333
+ }) : t.forEach((c) => {
2334
+ const i = $(c, e.dataset, "");
2287
2335
  a.includes(i) || a.push(i);
2288
- }), s = a;
2289
- } else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
2336
+ }), o = a;
2337
+ } else e.dataset.sort === "alphabetical" && o.sort((a, c) => a.localeCompare(c, void 0, { numeric: !0 }));
2290
2338
  const u = [];
2291
- return s.forEach((a, l) => {
2292
- const i = n.get(a), h = /* @__PURE__ */ new Map();
2293
- i.forEach((c) => {
2294
- const f = c[e.series.from] || "default";
2295
- h.has(f) || h.set(f, []), h.get(f).push(c);
2339
+ return o.forEach((a, c) => {
2340
+ const i = n.get(a), f = /* @__PURE__ */ new Map();
2341
+ i.forEach((l) => {
2342
+ const m = $(l, e.series, "");
2343
+ f.has(m) || f.set(m, []), f.get(m).push(l);
2296
2344
  });
2297
- let b = Array.from(h.keys());
2345
+ let w = Array.from(f.keys());
2298
2346
  if (Array.isArray(e.series.sort))
2299
- b = e.series.sort.filter((c) => h.has(c)).concat(b.filter((c) => !e.series.sort.includes(c)));
2347
+ w = e.series.sort.filter((l) => f.has(l)).concat(w.filter((l) => !e.series.sort.includes(l)));
2300
2348
  else if (e.series.sort === "original") {
2301
- const c = [];
2302
- i.forEach((f) => {
2303
- const g = f[e.series.from] || "default";
2304
- c.includes(g) || c.push(g);
2305
- }), b = c;
2306
- } else e.series.sort === "alphabetical" && b.sort((c, f) => c.localeCompare(f, void 0, { numeric: !0 }));
2307
- const w = /* @__PURE__ */ new Map();
2308
- i.forEach((c) => {
2309
- const f = c[e.category.from] || "default";
2310
- w.has(f) || w.set(f, []), w.get(f).push(c);
2349
+ const l = [];
2350
+ i.forEach((m) => {
2351
+ const T = $(m, e.series, "");
2352
+ l.includes(T) || l.push(T);
2353
+ }), w = l;
2354
+ } else e.series.sort === "alphabetical" && w.sort((l, m) => l.localeCompare(m, void 0, { numeric: !0 }));
2355
+ const S = /* @__PURE__ */ new Map();
2356
+ i.forEach((l) => {
2357
+ const m = $(l, e.category, "");
2358
+ S.has(m) || S.set(m, []), S.get(m).push(l);
2311
2359
  });
2312
- let m = Array.from(w.keys());
2360
+ let y = Array.from(S.keys());
2313
2361
  if (Array.isArray(e.category.sort))
2314
- m = e.category.sort.filter((c) => w.has(c)).concat(m.filter((c) => !e.category.sort.includes(c)));
2362
+ y = e.category.sort.filter((l) => S.has(l)).concat(y.filter((l) => !e.category.sort.includes(l)));
2315
2363
  else if (e.category.sort === "original") {
2316
- const c = [];
2317
- i.forEach((f) => {
2318
- const g = f[e.category.from] || "default";
2319
- c.includes(g) || c.push(g);
2320
- }), m = c;
2321
- } else e.category.sort === "alphabetical" && m.sort((c, f) => c.localeCompare(f, void 0, { numeric: !0 }));
2322
- const v = /* @__PURE__ */ new Map();
2323
- i.forEach((c) => {
2324
- const f = c.id || "unknown";
2325
- v.has(f) || v.set(f, []), v.get(f).push(c);
2364
+ const l = [];
2365
+ i.forEach((m) => {
2366
+ const T = $(m, e.category, "");
2367
+ l.includes(T) || l.push(T);
2368
+ }), y = l;
2369
+ } else e.category.sort === "alphabetical" && y.sort((l, m) => l.localeCompare(m, void 0, { numeric: !0 }));
2370
+ const A = /* @__PURE__ */ new Map();
2371
+ i.forEach((l) => {
2372
+ const m = l.id || "unknown";
2373
+ A.has(m) || A.set(m, []), A.get(m).push(l);
2326
2374
  });
2327
- let y = 0;
2328
- const d = b[0] || "default", E = b.indexOf(d), p = /* @__PURE__ */ new Map();
2329
- Array.from(v.entries()).forEach(([c, f]) => {
2330
- const g = f[0], A = g[e.series.from] || "default", $ = b.indexOf(A), O = g[e.category.from] || "default", I = m.indexOf(O);
2375
+ let v = 0;
2376
+ const d = w[0] || "", b = w.indexOf(d), O = /* @__PURE__ */ new Map();
2377
+ Array.from(A.entries()).forEach(([l, m]) => {
2378
+ const T = m[0], B = $(T, e.series, ""), g = w.indexOf(B), x = $(T, e.category, ""), _ = y.indexOf(x);
2331
2379
  if (e.value.aggregate === "none") {
2332
- const L = g[e.value.from], M = {
2333
- id: c,
2334
- index: y++,
2380
+ const P = T[e.value.from], j = {
2381
+ id: l,
2382
+ index: v++,
2335
2383
  modelType: "tree",
2336
- name: g.name || c,
2337
- data: g.data,
2338
- value: typeof L == "number" ? L : null,
2339
- color: K(e.color.from, {
2340
- index: y - 1,
2341
- seriesIndex: $,
2342
- categoryIndex: I,
2343
- datasetIndex: l
2384
+ name: T.name || l,
2385
+ data: T.data,
2386
+ value: typeof P == "number" ? P : null,
2387
+ color: D(e.color.by, {
2388
+ index: v - 1,
2389
+ seriesIndex: g,
2390
+ categoryIndex: _,
2391
+ datasetIndex: c
2344
2392
  }, r),
2345
- parent: g.parent || null,
2393
+ parent: T.parent || null,
2346
2394
  parentIndex: null,
2347
2395
  // 稍後設定
2348
2396
  depth: 0,
@@ -2350,32 +2398,32 @@ const Ke = {
2350
2398
  seq: 0,
2351
2399
  // 稍後計算
2352
2400
  children: [],
2353
- series: A,
2354
- seriesIndex: $,
2355
- category: O,
2356
- categoryIndex: I
2401
+ series: B,
2402
+ seriesIndex: g,
2403
+ category: x,
2404
+ categoryIndex: _
2357
2405
  };
2358
- p.set(c, M);
2406
+ O.set(l, j);
2359
2407
  } else {
2360
- const L = f.map((k) => {
2408
+ const P = m.map((L) => {
2361
2409
  if (e.value.aggregate === "count")
2362
2410
  return 1;
2363
- const F = k[e.value.from];
2411
+ const F = L[e.value.from];
2364
2412
  return typeof F == "number" ? F : null;
2365
- }), M = pe(L, e.value.aggregate), P = {
2366
- id: c,
2367
- index: y++,
2413
+ }), j = de(P, e.value.aggregate), M = {
2414
+ id: l,
2415
+ index: v++,
2368
2416
  modelType: "tree",
2369
- name: g.name || c,
2370
- data: g.data,
2371
- value: M,
2372
- color: K(e.color.from, {
2373
- index: y - 1,
2374
- seriesIndex: $,
2375
- categoryIndex: I,
2376
- datasetIndex: l
2417
+ name: T.name || l,
2418
+ data: T.data,
2419
+ value: j,
2420
+ color: D(e.color.by, {
2421
+ index: v - 1,
2422
+ seriesIndex: g,
2423
+ categoryIndex: _,
2424
+ datasetIndex: c
2377
2425
  }, r),
2378
- parent: g.parent || null,
2426
+ parent: T.parent || null,
2379
2427
  parentIndex: null,
2380
2428
  // 稍後設定
2381
2429
  depth: 0,
@@ -2383,45 +2431,45 @@ const Ke = {
2383
2431
  seq: 0,
2384
2432
  // 稍後計算
2385
2433
  children: [],
2386
- series: A,
2387
- seriesIndex: $,
2388
- category: O,
2389
- categoryIndex: I
2434
+ series: B,
2435
+ seriesIndex: g,
2436
+ category: x,
2437
+ categoryIndex: _
2390
2438
  };
2391
- p.set(c, P);
2439
+ O.set(l, M);
2392
2440
  }
2393
2441
  });
2394
- const _ = Array.from(p.values()), T = /* @__PURE__ */ new Map();
2395
- _.forEach((c) => {
2396
- T.set(c.id, c.index);
2397
- }), _.forEach((c) => {
2398
- c.parent && T.has(c.parent) && (c.parentIndex = T.get(c.parent));
2442
+ const I = Array.from(O.values()), h = /* @__PURE__ */ new Map();
2443
+ I.forEach((l) => {
2444
+ h.set(l.id, l.index);
2445
+ }), I.forEach((l) => {
2446
+ l.parent && h.has(l.parent) && (l.parentIndex = h.get(l.parent));
2399
2447
  });
2400
- const S = [], x = /* @__PURE__ */ new Map();
2401
- _.forEach((c) => {
2402
- c.parent === null ? S.push(c) : (x.has(c.parent) || x.set(c.parent, []), x.get(c.parent).push(c));
2448
+ const p = [], E = /* @__PURE__ */ new Map();
2449
+ I.forEach((l) => {
2450
+ l.parent === null ? p.push(l) : (E.has(l.parent) || E.set(l.parent, []), E.get(l.parent).push(l));
2403
2451
  });
2404
- function B(c, f) {
2405
- c.depth = f;
2406
- const g = x.get(c.id) || [];
2407
- return e.value.sort === "asc" ? g.sort((A, $) => A.value === null && $.value === null ? 0 : A.value === null ? 1 : $.value === null ? -1 : A.value - $.value) : e.value.sort === "desc" && g.sort((A, $) => A.value === null && $.value === null ? 0 : A.value === null ? 1 : $.value === null ? -1 : $.value - A.value), g.forEach((A, $) => {
2408
- A.seq = $;
2409
- }), c.children = g.map((A) => B(A, f + 1)), c;
2452
+ function k(l, m) {
2453
+ l.depth = m;
2454
+ const T = E.get(l.id) || [];
2455
+ return e.value.sort === "asc" ? T.sort((B, g) => B.value === null && g.value === null ? 0 : B.value === null ? 1 : g.value === null ? -1 : B.value - g.value) : e.value.sort === "desc" && T.sort((B, g) => B.value === null && g.value === null ? 0 : B.value === null ? 1 : g.value === null ? -1 : g.value - B.value), T.forEach((B, g) => {
2456
+ B.seq = g;
2457
+ }), l.children = T.map((B) => k(B, m + 1)), l;
2410
2458
  }
2411
- const C = S.map((c) => B(c, 0));
2459
+ const C = p.map((l) => k(l, 0));
2412
2460
  if (C.length === 0)
2413
2461
  u.push({
2414
2462
  id: `empty-${a}`,
2415
- index: y++,
2463
+ index: v++,
2416
2464
  modelType: "tree",
2417
2465
  name: "Empty Tree",
2418
2466
  data: {},
2419
2467
  value: null,
2420
- color: K(e.color.from, {
2421
- index: y - 1,
2422
- seriesIndex: E < 0 ? 0 : E,
2468
+ color: D(e.color.by, {
2469
+ index: v - 1,
2470
+ seriesIndex: b < 0 ? 0 : b,
2423
2471
  categoryIndex: 0,
2424
- datasetIndex: l
2472
+ datasetIndex: c
2425
2473
  }, r),
2426
2474
  parent: null,
2427
2475
  parentIndex: null,
@@ -2429,84 +2477,84 @@ const Ke = {
2429
2477
  seq: 0,
2430
2478
  children: [],
2431
2479
  series: d,
2432
- seriesIndex: E < 0 ? 0 : E,
2433
- category: "default",
2480
+ seriesIndex: b < 0 ? 0 : b,
2481
+ category: "",
2434
2482
  categoryIndex: 0
2435
2483
  });
2436
2484
  else if (C.length === 1)
2437
2485
  u.push(C[0]);
2438
2486
  else {
2439
- const c = {
2487
+ const l = {
2440
2488
  id: `virtual-root-${a}`,
2441
- index: y++,
2489
+ index: v++,
2442
2490
  modelType: "tree",
2443
2491
  name: `Virtual Root (${a})`,
2444
2492
  data: {},
2445
2493
  value: null,
2446
- color: K(e.color.from, {
2447
- index: y - 1,
2448
- seriesIndex: E < 0 ? 0 : E,
2494
+ color: D(e.color.by, {
2495
+ index: v - 1,
2496
+ seriesIndex: b < 0 ? 0 : b,
2449
2497
  categoryIndex: 0,
2450
- datasetIndex: l
2498
+ datasetIndex: c
2451
2499
  }, r),
2452
2500
  parent: null,
2453
2501
  parentIndex: null,
2454
2502
  depth: 0,
2455
2503
  seq: 0,
2456
- children: C.map((f, g) => {
2457
- const A = ($, O) => ($.depth = O, O === 1 && ($.seq = g), $.children = $.children.map((I) => A(I, O + 1)), $);
2458
- return A(f, 1);
2504
+ children: C.map((m, T) => {
2505
+ const B = (g, x) => (g.depth = x, x === 1 && (g.seq = T), g.children = g.children.map((_) => B(_, x + 1)), g);
2506
+ return B(m, 1);
2459
2507
  }),
2460
2508
  series: d,
2461
- seriesIndex: E < 0 ? 0 : E,
2462
- category: "default",
2509
+ seriesIndex: b < 0 ? 0 : b,
2510
+ category: "",
2463
2511
  categoryIndex: 0
2464
2512
  };
2465
- u.push(c);
2513
+ u.push(l);
2466
2514
  }
2467
2515
  }), u;
2468
2516
  };
2469
- function Nr(t, e, r) {
2517
+ function Ur(t, e, r) {
2470
2518
  const n = e.map((a) => r[a]).filter((a) => a && a.parentNode === t);
2471
2519
  if (n.length === 0) return;
2472
- let o = !0, s = null;
2520
+ let s = !0, o = null;
2473
2521
  for (const a of n) {
2474
- if (s && s.nextElementSibling !== a) {
2475
- o = !1;
2522
+ if (o && o.nextElementSibling !== a) {
2523
+ s = !1;
2476
2524
  break;
2477
2525
  }
2478
- s = a;
2526
+ o = a;
2479
2527
  }
2480
- if (o) return;
2528
+ if (s) return;
2481
2529
  const u = document.createDocumentFragment();
2482
2530
  e.forEach((a) => {
2483
- const l = r[a];
2484
- l && l.parentNode === t && u.appendChild(l);
2531
+ const c = r[a];
2532
+ c && c.parentNode === t && u.appendChild(c);
2485
2533
  }), t.appendChild(u);
2486
2534
  }
2487
- function Ne(t, e, r, n, o) {
2535
+ function Ue(t, e, r, n, s) {
2488
2536
  Object.keys(r).filter((i) => !e.includes(i)).forEach((i) => {
2489
- const h = r[i];
2490
- h && h.parentNode === t && t.removeChild(h), delete r[i];
2537
+ const f = r[i];
2538
+ f && f.parentNode === t && t.removeChild(f), delete r[i];
2491
2539
  });
2492
2540
  const a = e.filter((i) => !r[i]);
2493
2541
  a.forEach((i) => {
2494
- const h = n(i);
2495
- r[i] = h, t.appendChild(h);
2542
+ const f = n(i);
2543
+ r[i] = f, t.appendChild(f);
2496
2544
  }), e.filter((i) => r[i] && !a.includes(i)).forEach((i) => {
2497
2545
  r[i];
2498
- }), e.length > 0 && Nr(t, e, r);
2546
+ }), e.length > 0 && Ur(t, e, r);
2499
2547
  }
2500
- function Ur(t) {
2501
- return V({ element: t }, {
2548
+ function zr(t) {
2549
+ return K({ element: t }, {
2502
2550
  element: {
2503
2551
  toBe: "Dom",
2504
- test: (r) => ct(r)
2552
+ test: (r) => ft(r)
2505
2553
  }
2506
2554
  });
2507
2555
  }
2508
- function zr(t) {
2509
- return V(t, {
2556
+ function Gr(t) {
2557
+ return K(t, {
2510
2558
  width: {
2511
2559
  toBe: '"auto" | number',
2512
2560
  test: (r) => r === "auto" || typeof r == "number"
@@ -2521,8 +2569,8 @@ function zr(t) {
2521
2569
  }
2522
2570
  });
2523
2571
  }
2524
- function yt(t) {
2525
- const e = V(t, {
2572
+ function pt(t) {
2573
+ const e = K(t, {
2526
2574
  colorScheme: {
2527
2575
  toBe: '"dark" | "light" | "auto"',
2528
2576
  test: (r) => r === "dark" || r === "light" || r === "auto"
@@ -2536,7 +2584,7 @@ function yt(t) {
2536
2584
  }
2537
2585
  });
2538
2586
  if (t.colors) {
2539
- const r = V(t.colors, {
2587
+ const r = K(t.colors, {
2540
2588
  light: {
2541
2589
  toBeTypes: ["object"],
2542
2590
  test: (n) => n.data && n.primary && n.secondary && n.dataContrast && n.background
@@ -2549,7 +2597,7 @@ function yt(t) {
2549
2597
  if (r.status === "error")
2550
2598
  return r;
2551
2599
  if (t.colors.light) {
2552
- const n = V(t.colors.light, {
2600
+ const n = K(t.colors.light, {
2553
2601
  data: {
2554
2602
  toBeTypes: ["string[]"]
2555
2603
  },
@@ -2570,7 +2618,7 @@ function yt(t) {
2570
2618
  return n;
2571
2619
  }
2572
2620
  if (t.colors.dark) {
2573
- const n = V(t.colors.dark, {
2621
+ const n = K(t.colors.dark, {
2574
2622
  data: {
2575
2623
  toBeTypes: ["string[]"]
2576
2624
  },
@@ -2593,8 +2641,8 @@ function yt(t) {
2593
2641
  }
2594
2642
  return e;
2595
2643
  }
2596
- function pt(t) {
2597
- const e = V(t, {
2644
+ function dt(t) {
2645
+ const e = K(t, {
2598
2646
  dataset: {
2599
2647
  toBeTypes: ["object"]
2600
2648
  },
@@ -2615,46 +2663,55 @@ function pt(t) {
2615
2663
  }
2616
2664
  });
2617
2665
  if (t.dataset) {
2618
- const r = V(t.dataset, {
2666
+ const r = K(t.dataset, {
2619
2667
  from: {
2620
2668
  toBeTypes: ["string"]
2621
2669
  },
2622
2670
  sort: {
2623
2671
  toBe: '"original" | "alphabetical" | string[]',
2624
- test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((o) => typeof o == "string")
2672
+ test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((s) => typeof s == "string")
2673
+ },
2674
+ ignore: {
2675
+ toBeTypes: ["boolean"]
2625
2676
  }
2626
2677
  });
2627
2678
  if (r.status === "error")
2628
2679
  return r;
2629
2680
  }
2630
2681
  if (t.series) {
2631
- const r = V(t.series, {
2682
+ const r = K(t.series, {
2632
2683
  from: {
2633
2684
  toBeTypes: ["string"]
2634
2685
  },
2635
2686
  sort: {
2636
2687
  toBe: '"original" | "alphabetical" | string[]',
2637
- test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((o) => typeof o == "string")
2688
+ test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((s) => typeof s == "string")
2689
+ },
2690
+ ignore: {
2691
+ toBeTypes: ["boolean"]
2638
2692
  }
2639
2693
  });
2640
2694
  if (r.status === "error")
2641
2695
  return r;
2642
2696
  }
2643
2697
  if (t.category) {
2644
- const r = V(t.category, {
2698
+ const r = K(t.category, {
2645
2699
  from: {
2646
2700
  toBeTypes: ["string"]
2647
2701
  },
2648
2702
  sort: {
2649
2703
  toBe: '"original" | "alphabetical" | string[]',
2650
- test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((o) => typeof o == "string")
2704
+ test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((s) => typeof s == "string")
2705
+ },
2706
+ ignore: {
2707
+ toBeTypes: ["boolean"]
2651
2708
  }
2652
2709
  });
2653
2710
  if (r.status === "error")
2654
2711
  return r;
2655
2712
  }
2656
2713
  if (t.value) {
2657
- const r = V(t.value, {
2714
+ const r = K(t.value, {
2658
2715
  from: {
2659
2716
  toBeTypes: ["string"]
2660
2717
  },
@@ -2671,18 +2728,18 @@ function pt(t) {
2671
2728
  return r;
2672
2729
  }
2673
2730
  if (t.multivariate) {
2674
- const r = V({ multivariate: t.multivariate }, {
2731
+ const r = K({ multivariate: t.multivariate }, {
2675
2732
  multivariate: {
2676
2733
  toBe: "EncodingMultivariateItem[]",
2677
- test: (n) => Array.isArray(n) && n.every((o) => typeof o.from == "string" && typeof o.label == "string")
2734
+ test: (n) => Array.isArray(n) && n.every((s) => typeof s.from == "string" && typeof s.label == "string")
2678
2735
  }
2679
2736
  });
2680
2737
  if (r.status === "error")
2681
2738
  return r;
2682
2739
  }
2683
2740
  if (t.color) {
2684
- const r = V(t.color, {
2685
- from: {
2741
+ const r = K(t.color, {
2742
+ by: {
2686
2743
  toBe: '"index" | "series" | "category" | "dataset"',
2687
2744
  test: (n) => ["index", "series", "category", "dataset"].includes(n)
2688
2745
  }
@@ -2692,27 +2749,27 @@ function pt(t) {
2692
2749
  }
2693
2750
  return e;
2694
2751
  }
2695
- function dt(t) {
2696
- return V({ data: t }, {
2752
+ function vt(t) {
2753
+ return K({ data: t }, {
2697
2754
  data: {
2698
2755
  toBe: "RawDataColumn[] | RawDataColumn[][]",
2699
2756
  // 畢免資料量過大檢查不完,不深度檢查
2700
- test: (r) => Array.isArray(r) && r.every((n) => Array.isArray(n) || Q(n))
2757
+ test: (r) => Array.isArray(r) && r.every((n) => Array.isArray(n) || ee(n))
2701
2758
  }
2702
2759
  });
2703
2760
  }
2704
2761
  function $e(t) {
2705
- return V({ plugins: t }, {
2762
+ return K({ plugins: t }, {
2706
2763
  plugins: {
2707
2764
  toBe: "PluginEntity[]",
2708
- test: (r) => Array.isArray(r) && r.every((n) => Q(n) && typeof n._name == "string" && typeof n._injectContext == "function")
2765
+ test: (r) => Array.isArray(r) && r.every((n) => ee(n) && typeof n._name == "string" && typeof n._injectContext == "function")
2709
2766
  }
2710
2767
  });
2711
2768
  }
2712
2769
  function qr(t) {
2713
2770
  if (!t)
2714
2771
  return { status: "success", columnName: "", expectToBe: "" };
2715
- const e = V(t, {
2772
+ const e = K(t, {
2716
2773
  size: {
2717
2774
  toBeTypes: ["object"]
2718
2775
  },
@@ -2729,28 +2786,28 @@ function qr(t) {
2729
2786
  },
2730
2787
  plugins: {
2731
2788
  toBe: "PluginEntity[]",
2732
- test: (r) => Array.isArray(r) && r.every((n) => Q(n) && typeof n._name == "string" && typeof n._injectContext == "function")
2789
+ test: (r) => Array.isArray(r) && r.every((n) => ee(n) && typeof n._name == "string" && typeof n._injectContext == "function")
2733
2790
  }
2734
2791
  });
2735
2792
  if (e.status === "error")
2736
2793
  return e;
2737
2794
  if (t.size) {
2738
- const r = zr(t.size);
2795
+ const r = Gr(t.size);
2739
2796
  if (r.status === "error")
2740
2797
  return r;
2741
2798
  }
2742
2799
  if (t.theme) {
2743
- const r = yt(t.theme);
2800
+ const r = pt(t.theme);
2744
2801
  if (r.status === "error")
2745
2802
  return r;
2746
2803
  }
2747
2804
  if (t.encoding) {
2748
- const r = pt(t.encoding);
2805
+ const r = dt(t.encoding);
2749
2806
  if (r.status === "error")
2750
2807
  return r;
2751
2808
  }
2752
2809
  if (t.data) {
2753
- const r = dt(t.data);
2810
+ const r = vt(t.data);
2754
2811
  if (r.status === "error")
2755
2812
  return r;
2756
2813
  }
@@ -2761,494 +2818,504 @@ function qr(t) {
2761
2818
  }
2762
2819
  return e;
2763
2820
  }
2764
- function Gr({ svgElement$: t, canvasElement$: e, pluginsInstance$: r }) {
2765
- let n = [], o = [];
2766
- const s = (l, i, h) => {
2767
- const b = r.getValue().reduce((v, y, d) => (v[y._getId()] = d, v), {}), w = h.map((v) => ({
2768
- ...v,
2769
- pluginSeq: b[v.pluginId]
2821
+ function Wr({ svgElement$: t, canvasElement$: e, pluginsInstance$: r }) {
2822
+ let n = [], s = [];
2823
+ const o = (c, i, f) => {
2824
+ const w = r.getValue().reduce((A, v, d) => (A[v._getId()] = d, A), {}), S = f.map((A) => ({
2825
+ ...A,
2826
+ pluginSeq: w[A.pluginId]
2770
2827
  }));
2771
- return (l === "svg" ? n : o).filter((v) => v.pluginId !== i).map((v) => ({
2772
- ...v,
2773
- pluginSeq: b[v.pluginId]
2774
- })).concat(w).sort((v, y) => v.layerIndex - y.layerIndex || v.pluginSeq - y.pluginSeq);
2828
+ return (c === "svg" ? n : s).filter((A) => A.pluginId !== i).map((A) => ({
2829
+ ...A,
2830
+ pluginSeq: w[A.pluginId]
2831
+ })).concat(S).sort((A, v) => A.layerIndex - v.layerIndex || A.pluginSeq - v.pluginSeq);
2775
2832
  }, u = {}, a = {};
2776
- return (l, i, h) => {
2777
- const b = l === "svg" ? t.getValue() : e.getValue();
2778
- if (!b)
2833
+ return (c, i, f) => {
2834
+ const w = c === "svg" ? t.getValue() : e.getValue();
2835
+ if (!w)
2779
2836
  return {};
2780
- const w = l === "svg" ? u : a, m = s(l, i, h), v = m.map((d) => jr(d.pluginId, d.layerName));
2781
- return l === "svg" ? (Ne(
2782
- b,
2783
- v,
2837
+ const S = c === "svg" ? u : a, y = o(c, i, f), A = y.map((d) => Lr(d.pluginId, d.layerName));
2838
+ return c === "svg" ? (Ue(
2784
2839
  w,
2785
- (d) => Br(d)
2786
- ), n = m) : (Ne(
2787
- b,
2788
- v,
2840
+ A,
2841
+ S,
2842
+ (d) => Pr(d)
2843
+ ), n = y) : (Ue(
2789
2844
  w,
2790
- (d) => ft(d)
2791
- ), o = m), Object.entries(w).reduce((d, [E, p]) => {
2792
- const [_, T, S] = E.split("-");
2793
- return T === i && (d[S] = p), d;
2845
+ A,
2846
+ S,
2847
+ (d) => ht(d)
2848
+ ), s = y), Object.entries(S).reduce((d, [b, O]) => {
2849
+ const [I, h, p] = b.split("-");
2850
+ return h === i && (d[p] = O), d;
2794
2851
  }, {});
2795
2852
  };
2796
2853
  }
2797
- const Wr = (t, e) => {
2854
+ const Yr = (t, e) => {
2798
2855
  try {
2799
- const { status: v, columnName: y, expectToBe: d } = qr(e);
2800
- if (v === "error")
2801
- throw new Error(Z({
2802
- columnName: y,
2803
- expectToBe: d,
2856
+ const { status: b, columnName: O, expectToBe: I } = qr(e);
2857
+ if (b === "error")
2858
+ throw new Error(Q({
2859
+ columnName: O,
2860
+ expectToBe: I,
2804
2861
  from: "Chart.constructor"
2805
2862
  }));
2806
- if (v === "warning")
2807
- console.warn(J({
2808
- columnName: y,
2809
- expectToBe: d,
2863
+ if (b === "warning")
2864
+ console.warn(X({
2865
+ columnName: O,
2866
+ expectToBe: I,
2810
2867
  from: "Chart.constructor"
2811
2868
  }));
2812
2869
  else {
2813
- const { status: E, columnName: p, expectToBe: _ } = Ur(t);
2814
- if (E === "error")
2815
- throw new Error(Z({
2870
+ const { status: h, columnName: p, expectToBe: E } = zr(t);
2871
+ if (h === "error")
2872
+ throw new Error(Q({
2816
2873
  columnName: p,
2817
- expectToBe: _,
2874
+ expectToBe: E,
2818
2875
  from: "Chart.constructor"
2819
2876
  }));
2820
- E === "warning" && console.warn(J({
2877
+ h === "warning" && console.warn(X({
2821
2878
  columnName: p,
2822
- expectToBe: _,
2879
+ expectToBe: E,
2823
2880
  from: "Chart.constructor"
2824
2881
  }));
2825
2882
  }
2826
- } catch (v) {
2827
- throw new Error(v);
2883
+ } catch (b) {
2884
+ throw new Error(b);
2828
2885
  }
2829
- const r = new oe(), n = new D((e == null ? void 0 : e.data) || []), o = e && e.encoding ? H(Fe, e.encoding) : Fe, s = new D(o), u = e && e.theme ? H(De, e.theme) : De, a = new D(u), l = new D((e == null ? void 0 : e.plugins) || []), i = e && e.size ? H(Ke, e.size) : Ke, h = new D(i), b = new D(null), w = new D(null), m = (() => {
2830
- const v = h.pipe(
2831
- br((f) => fr(
2832
- () => f.width === "auto" || f.height === "auto",
2886
+ const r = new oe(), n = new N((e == null ? void 0 : e.data) || []), s = e && e.encoding ? Y(De, e.encoding) : De, o = new N(s), u = e && e.theme ? Y(Ne, e.theme) : Ne, a = new N(u), c = new N((e == null ? void 0 : e.plugins) || []), i = e && e.size ? Y(Fe, e.size) : Fe, f = new N(i), w = new N(null), S = new N(null), y = (() => {
2887
+ const b = f.pipe(
2888
+ wr((g) => hr(
2889
+ () => g.width === "auto" || g.height === "auto",
2833
2890
  // 有 'auto' 的話就監聽element的尺寸
2834
- kr(t).pipe(
2835
- q((g) => ({
2836
- width: f.width === "auto" ? g.width : f.width,
2837
- height: f.height === "auto" ? g.height <= 0 ? g.width : g.height : f.height
2891
+ jr(t).pipe(
2892
+ q((x) => ({
2893
+ width: g.width === "auto" ? x.width : g.width,
2894
+ height: g.height === "auto" ? x.height <= 0 ? x.width : x.height : g.height
2838
2895
  })),
2839
- G(f.resizeDebounce),
2840
- pr((g, A) => JSON.stringify(g) === JSON.stringify(A))
2896
+ W(g.resizeDebounce),
2897
+ dr((x, _) => JSON.stringify(x) === JSON.stringify(_))
2841
2898
  ),
2842
- Qt({
2843
- width: f.width,
2844
- height: f.height
2899
+ Xt({
2900
+ width: g.width,
2901
+ height: g.height
2845
2902
  })
2846
2903
  )),
2847
- wr(r),
2848
- te(1)
2849
- ), y = s.asObservable().pipe(
2850
- te(1)
2851
- ), d = Y([
2904
+ Er(r),
2905
+ ne(1)
2906
+ ), O = o.asObservable().pipe(
2907
+ ne(1)
2908
+ ), I = H([
2852
2909
  n,
2853
- s,
2910
+ o,
2854
2911
  a
2855
2912
  ]).pipe(
2856
- G(0),
2857
- q(([f, g, A]) => {
2913
+ W(0),
2914
+ q(([g, x, _]) => {
2858
2915
  try {
2859
- return Vr(f, g, A);
2860
- } catch ($) {
2861
- throw new Error(fe({
2916
+ return Kr(g, x, _);
2917
+ } catch (P) {
2918
+ throw new Error(he({
2862
2919
  from: "Chart.seriesData$",
2863
- systemMessage: $
2920
+ systemMessage: P
2864
2921
  }));
2865
2922
  }
2866
2923
  }),
2867
- ae((f) => (console.error(z(f)), se)),
2868
- te(1)
2869
- ), E = Y([
2924
+ ie((g) => (console.error(G(g)), ae)),
2925
+ ne(1)
2926
+ ), h = H([
2870
2927
  n,
2871
- s,
2928
+ o,
2872
2929
  a
2873
2930
  ]).pipe(
2874
- G(0),
2875
- q(([f, g, A]) => {
2931
+ W(0),
2932
+ q(([g, x, _]) => {
2876
2933
  try {
2877
- return Rr(f, g, A);
2878
- } catch ($) {
2879
- throw new Error(fe({
2934
+ return Rr(g, x, _);
2935
+ } catch (P) {
2936
+ throw new Error(he({
2880
2937
  from: "Chart.gridData$",
2881
- systemMessage: $
2938
+ systemMessage: P
2882
2939
  }));
2883
2940
  }
2884
2941
  }),
2885
- ae((f) => (console.error(z(f)), se)),
2886
- te(1)
2887
- ), p = Y([
2942
+ ie((g) => (console.error(G(g)), ae)),
2943
+ ne(1)
2944
+ ), p = H([
2888
2945
  n,
2889
- s,
2946
+ o,
2890
2947
  a
2891
2948
  ]).pipe(
2892
- G(0),
2893
- q(([f, g, A]) => {
2949
+ W(0),
2950
+ q(([g, x, _]) => {
2894
2951
  try {
2895
- return Kr(f, g, A);
2896
- } catch ($) {
2897
- throw new Error(fe({
2952
+ return Fr(g, x, _);
2953
+ } catch (P) {
2954
+ throw new Error(he({
2898
2955
  from: "Chart.multivariateData$",
2899
- systemMessage: $
2956
+ systemMessage: P
2900
2957
  }));
2901
2958
  }
2902
2959
  }),
2903
- ae((f) => (console.error(z(f)), se)),
2904
- te(1)
2905
- ), _ = Y([
2960
+ ie((g) => (console.error(G(g)), ae)),
2961
+ ne(1)
2962
+ ), E = H([
2906
2963
  n,
2907
- s,
2964
+ o,
2908
2965
  a
2909
2966
  ]).pipe(
2910
- G(0),
2911
- q(([f, g, A]) => {
2967
+ W(0),
2968
+ q(([g, x, _]) => {
2912
2969
  try {
2913
- return Fr(f, g, A);
2914
- } catch ($) {
2915
- throw new Error(fe({
2970
+ return Dr(g, x, _);
2971
+ } catch (P) {
2972
+ throw new Error(he({
2916
2973
  from: "Chart.graphData$",
2917
- systemMessage: $
2974
+ systemMessage: P
2918
2975
  }));
2919
2976
  }
2920
2977
  }),
2921
- ae((f) => (console.error(z(f)), se)),
2922
- te(1)
2923
- ), T = Y([
2978
+ ie((g) => (console.error(G(g)), ae)),
2979
+ ne(1)
2980
+ ), k = H([
2924
2981
  n,
2925
- s,
2982
+ o,
2926
2983
  a
2927
2984
  ]).pipe(
2928
- G(0),
2929
- q(([f, g, A]) => {
2985
+ W(0),
2986
+ q(([g, x, _]) => {
2930
2987
  try {
2931
- return Dr(f, g, A);
2932
- } catch ($) {
2933
- throw new Error(fe({
2988
+ return Nr(g, x, _);
2989
+ } catch (P) {
2990
+ throw new Error(he({
2934
2991
  from: "Chart.treeData$",
2935
- systemMessage: $
2992
+ systemMessage: P
2936
2993
  }));
2937
2994
  }
2938
2995
  }),
2939
- ae((f) => (console.error(z(f)), se)),
2940
- te(1)
2941
- ), S = new D([]);
2942
- l.subscribe((f) => {
2943
- const g = {}, A = f.map((O) => {
2996
+ ie((g) => (console.error(G(g)), ae)),
2997
+ ne(1)
2998
+ ), C = new N([]);
2999
+ c.subscribe((g) => {
3000
+ const x = {}, _ = g.map((j) => {
2944
3001
  var L;
2945
- let I = O._getId();
2946
- if (g[I]) {
2947
- const M = ((L = g[I].split("[")[1]) == null ? void 0 : L.split("]")[0]) || "0", P = parseInt(M) + 1;
2948
- I = `${I.split("[")[0]}[${P}]`;
3002
+ let M = j._getId();
3003
+ if (x[M]) {
3004
+ const F = ((L = x[M].split("[")[1]) == null ? void 0 : L.split("]")[0]) || "0", J = parseInt(F) + 1;
3005
+ M = `${M.split("[")[0]}[${J}]`;
2949
3006
  }
2950
- return g[I] = O._getId(), I;
3007
+ return x[M] = j._getId(), M;
2951
3008
  });
2952
- f.forEach((O, I) => O._setId(A[I]));
2953
- const $ = f.map((O) => ({
2954
- id: O._getId(),
2955
- name: O._name,
2956
- elementType: O._elementType,
2957
- shownLayers: O.getShownLayerNames()
3009
+ g.forEach((j, M) => j._setId(_[M]));
3010
+ const P = g.map((j) => ({
3011
+ id: j._getId(),
3012
+ name: j._name,
3013
+ elementType: j._elementType,
3014
+ shownLayers: j.getShownLayerNames()
2958
3015
  }));
2959
- S.next($);
3016
+ C.next(P);
2960
3017
  });
2961
- const x = a.asObservable().pipe(
2962
- te(1)
2963
- ), B = new oe(), C = B.asObservable().pipe(
3018
+ const l = a.asObservable().pipe(
3019
+ ne(1)
3020
+ ), m = new oe(), T = m.asObservable().pipe(
2964
3021
  lt()
2965
3022
  );
2966
3023
  return {
2967
3024
  root: t,
2968
3025
  svg: null,
2969
3026
  canvas: null,
2970
- size$: v,
2971
- encoding$: y,
2972
- seriesData$: d,
2973
- gridData$: E,
3027
+ size$: b,
3028
+ encoding$: O,
3029
+ seriesData$: I,
3030
+ gridData$: h,
2974
3031
  multivariateData$: p,
2975
- graphData$: _,
2976
- treeData$: T,
2977
- plugins$: S,
2978
- theme$: x,
2979
- event$: C,
2980
- eventTrigger$: B,
2981
- _updateLayerElements: Gr({
2982
- svgElement$: b,
2983
- canvasElement$: w,
2984
- pluginsInstance$: l
3032
+ graphData$: E,
3033
+ treeData$: k,
3034
+ plugins$: C,
3035
+ theme$: l,
3036
+ event$: T,
3037
+ eventTrigger$: m,
3038
+ _updateLayerElements: Wr({
3039
+ svgElement$: w,
3040
+ canvasElement$: S,
3041
+ pluginsInstance$: c
2985
3042
  })
2986
3043
  };
2987
3044
  })();
2988
- return l.subscribe((v) => {
2989
- let y = !1, d = !1;
2990
- v.forEach((E) => {
2991
- E._elementType === "svg" ? y = !0 : E._elementType === "canvas" && (d = !0);
2992
- }), y && !m.svg ? (m.svg = Ir("orbcharts-root-svg"), m.root.appendChild(m.svg), b.next(m.svg)) : !y && m.svg && (m.svg.remove(), m.svg = null, b.next(null)), d && !m.canvas ? (m.canvas = ft("orbcharts-root-canvas"), m.root.appendChild(m.canvas), w.next(m.canvas)) : !d && m.canvas && (m.canvas.remove(), m.canvas = null, w.next(null)), v.forEach((E) => {
2993
- E._injectContext(m);
3045
+ let A = null;
3046
+ const v = () => (A || (A = document.createElement("div"), A.classList.add("orbcharts-container"), A.style.position = "relative", t.appendChild(A)), A);
3047
+ let d = [];
3048
+ return c.subscribe((b) => {
3049
+ d.filter((p) => !b.includes(p)).forEach((p) => {
3050
+ y._updateLayerElements(p._elementType, p._getId(), []), p.destroy();
3051
+ }), d = b;
3052
+ let I = !1, h = !1;
3053
+ b.forEach((p) => {
3054
+ p._elementType === "svg" ? I = !0 : p._elementType === "canvas" && (h = !0);
3055
+ }), I && !y.svg ? (y.svg = Br("orbcharts-root-svg"), v().appendChild(y.svg), w.next(y.svg)) : !I && y.svg && (y.svg.remove(), y.svg = null, w.next(null)), h && !y.canvas ? (y.canvas = ht("orbcharts-root-canvas"), v().appendChild(y.canvas), S.next(y.canvas)) : !h && y.canvas && (y.canvas.remove(), y.canvas = null, S.next(null)), b.forEach((p) => {
3056
+ p._injectContext(y);
2994
3057
  });
2995
- }), Y({
2996
- size: m.size$,
2997
- svg: b
3058
+ }), H({
3059
+ size: y.size$,
3060
+ svg: w
2998
3061
  }).pipe(
2999
- G(0),
3000
- ye(({ svg: v }) => !!v)
3001
- ).subscribe(({ size: v, svg: y }) => {
3002
- y && (y.setAttribute("width", v.width.toString()), y.setAttribute("height", v.height.toString()));
3003
- }), Y({
3004
- size: m.size$,
3005
- canvas: w
3062
+ W(0),
3063
+ pe(({ svg: b }) => !!b)
3064
+ ).subscribe(({ size: b, svg: O }) => {
3065
+ O && (O.setAttribute("width", b.width.toString()), O.setAttribute("height", b.height.toString()));
3066
+ }), H({
3067
+ size: y.size$,
3068
+ canvas: S
3006
3069
  }).pipe(
3007
- G(0),
3008
- ye(({ canvas: v }) => !!v)
3009
- ).subscribe(({ size: v, canvas: y }) => {
3010
- y && (y.width = v.width, y.height = v.height);
3070
+ W(0),
3071
+ pe(({ canvas: b }) => !!b)
3072
+ ).subscribe(({ size: b, canvas: O }) => {
3073
+ O && (O.width = b.width, O.height = b.height);
3011
3074
  }), /* @__PURE__ */ (() => {
3012
- function v(f) {
3013
- h.next(f);
3075
+ function b(g) {
3076
+ f.next(g);
3014
3077
  }
3015
- function y(f) {
3078
+ function O(g) {
3016
3079
  try {
3017
- const { status: g, columnName: A, expectToBe: $ } = dt(f);
3018
- if (g === "error")
3019
- throw new Error(Z({
3020
- columnName: A,
3021
- expectToBe: $,
3080
+ const { status: x, columnName: _, expectToBe: P } = vt(g);
3081
+ if (x === "error")
3082
+ throw new Error(Q({
3083
+ columnName: _,
3084
+ expectToBe: P,
3022
3085
  from: "Chart.setData"
3023
3086
  }));
3024
- g === "warning" && console.warn(J({
3025
- columnName: A,
3026
- expectToBe: $,
3087
+ x === "warning" && console.warn(X({
3088
+ columnName: _,
3089
+ expectToBe: P,
3027
3090
  from: "Chart.setData"
3028
3091
  }));
3029
- } catch (g) {
3030
- console.error(z(g));
3092
+ } catch (x) {
3093
+ console.error(G(x));
3031
3094
  }
3032
- n.next(f);
3095
+ n.next(g);
3033
3096
  }
3034
- function d(f) {
3097
+ function I(g) {
3035
3098
  try {
3036
- const { status: A, columnName: $, expectToBe: O } = pt(f);
3037
- if (A === "error")
3038
- throw new Error(Z({
3039
- columnName: $,
3040
- expectToBe: O,
3099
+ const { status: _, columnName: P, expectToBe: j } = dt(g);
3100
+ if (_ === "error")
3101
+ throw new Error(Q({
3102
+ columnName: P,
3103
+ expectToBe: j,
3041
3104
  from: "Chart.updateEncoding"
3042
3105
  }));
3043
- A === "warning" && console.warn(J({
3044
- columnName: $,
3045
- expectToBe: O,
3106
+ _ === "warning" && console.warn(X({
3107
+ columnName: P,
3108
+ expectToBe: j,
3046
3109
  from: "Chart.updateEncoding"
3047
3110
  }));
3048
- } catch (A) {
3049
- console.error(z(A));
3111
+ } catch (_) {
3112
+ console.error(G(_));
3050
3113
  }
3051
- const g = H(s.getValue(), f);
3052
- s.next(g);
3114
+ const x = Y(o.getValue(), g);
3115
+ o.next(x);
3053
3116
  }
3054
- function E(f) {
3055
- s.next(f);
3117
+ function h(g) {
3118
+ o.next(g);
3056
3119
  }
3057
3120
  function p() {
3058
- return s.getValue();
3121
+ return o.getValue();
3059
3122
  }
3060
- function _(f) {
3123
+ function E(g) {
3061
3124
  try {
3062
- const { status: g, columnName: A, expectToBe: $ } = $e(f);
3063
- if (g === "error")
3064
- throw new Error(Z({
3065
- columnName: A,
3066
- expectToBe: $,
3125
+ const { status: x, columnName: _, expectToBe: P } = $e(g);
3126
+ if (x === "error")
3127
+ throw new Error(Q({
3128
+ columnName: _,
3129
+ expectToBe: P,
3067
3130
  from: "Chart.setPlugins"
3068
3131
  }));
3069
- g === "warning" && console.warn(J({
3070
- columnName: A,
3071
- expectToBe: $,
3132
+ x === "warning" && console.warn(X({
3133
+ columnName: _,
3134
+ expectToBe: P,
3072
3135
  from: "Chart.setPlugins"
3073
3136
  }));
3074
- } catch (g) {
3075
- console.error(z(g));
3137
+ } catch (x) {
3138
+ console.error(G(x));
3076
3139
  }
3077
- l.next(f);
3140
+ c.next(g);
3078
3141
  }
3079
- function T(f) {
3142
+ function k(g) {
3080
3143
  try {
3081
- const { status: g, columnName: A, expectToBe: $ } = $e([f]);
3082
- if (g === "error")
3083
- throw new Error(Z({
3084
- columnName: A,
3085
- expectToBe: $,
3144
+ const { status: x, columnName: _, expectToBe: P } = $e([g]);
3145
+ if (x === "error")
3146
+ throw new Error(Q({
3147
+ columnName: _,
3148
+ expectToBe: P,
3086
3149
  from: "Chart.addPlugin"
3087
3150
  }));
3088
- g === "warning" && console.warn(J({
3089
- columnName: A,
3090
- expectToBe: $,
3151
+ x === "warning" && console.warn(X({
3152
+ columnName: _,
3153
+ expectToBe: P,
3091
3154
  from: "Chart.addPlugin"
3092
3155
  }));
3093
- } catch (g) {
3094
- console.error(z(g));
3156
+ } catch (x) {
3157
+ console.error(G(x));
3095
3158
  }
3096
- l.next([...l.getValue(), f]);
3159
+ c.next([...c.getValue(), g]);
3097
3160
  }
3098
- function S(f) {
3099
- l.next(l.getValue().filter((g) => g._getId() !== f));
3161
+ function C(g) {
3162
+ c.next(c.getValue().filter((x) => x._getId() !== g));
3100
3163
  }
3101
- function x(f) {
3164
+ function l(g) {
3102
3165
  try {
3103
- const { status: A, columnName: $, expectToBe: O } = yt(f);
3104
- if (A === "error")
3105
- throw new Error(Z({
3106
- columnName: $,
3107
- expectToBe: O,
3166
+ const { status: _, columnName: P, expectToBe: j } = pt(g);
3167
+ if (_ === "error")
3168
+ throw new Error(Q({
3169
+ columnName: P,
3170
+ expectToBe: j,
3108
3171
  from: "Chart.updateTheme"
3109
3172
  }));
3110
- A === "warning" && console.warn(J({
3111
- columnName: $,
3112
- expectToBe: O,
3173
+ _ === "warning" && console.warn(X({
3174
+ columnName: P,
3175
+ expectToBe: j,
3113
3176
  from: "Chart.updateTheme"
3114
3177
  }));
3115
- } catch (A) {
3116
- console.error(z(A));
3178
+ } catch (_) {
3179
+ console.error(G(_));
3117
3180
  }
3118
- const g = H(a.getValue(), f);
3119
- a.next(g);
3181
+ const x = Y(a.getValue(), g);
3182
+ a.next(x);
3120
3183
  }
3121
- function B(f) {
3122
- a.next(f);
3184
+ function m(g) {
3185
+ a.next(g);
3123
3186
  }
3124
- function C() {
3187
+ function T() {
3125
3188
  return a.getValue();
3126
3189
  }
3127
- function c() {
3128
- r.next(void 0), Pr(t);
3190
+ function B() {
3191
+ r.next(void 0), kr(t), A = null;
3129
3192
  }
3130
3193
  return {
3131
- resize: v,
3132
- setData: y,
3194
+ resize: b,
3195
+ setData: O,
3133
3196
  // setEncoding,
3134
- updateEncoding: d,
3135
- forceReplaceEncoding: E,
3197
+ updateEncoding: I,
3198
+ forceReplaceEncoding: h,
3136
3199
  getEncoding: p,
3137
- setPlugins: _,
3138
- addPlugin: T,
3139
- removePlugin: S,
3200
+ setPlugins: E,
3201
+ addPlugin: k,
3202
+ removePlugin: C,
3140
3203
  // setTheme,
3141
- updateTheme: x,
3142
- forceReplaceTheme: B,
3143
- getTheme: C,
3144
- destroy: c,
3145
- context: m
3204
+ updateTheme: l,
3205
+ forceReplaceTheme: m,
3206
+ getTheme: T,
3207
+ destroy: B,
3208
+ context: y
3146
3209
  };
3147
3210
  })();
3148
3211
  };
3149
- class Hr {
3212
+ class Qr {
3150
3213
  constructor(e, r) {
3151
- return Wr(e, r);
3214
+ return Yr(e, r);
3152
3215
  }
3153
3216
  }
3154
3217
  const mt = (t, e, r) => {
3155
- let n = e.name, o = () => {
3218
+ let n = e.name, s = () => {
3156
3219
  };
3157
- const s = new D(null), u = s.pipe(
3158
- ye((p) => p !== null)
3159
- ), a = {
3220
+ const o = new N(null), u = o.pipe(
3221
+ pe((h) => h !== null)
3222
+ ), a = e.layers.map((h) => new h()), c = {
3160
3223
  // 將陣列轉成字典
3161
- ...e.layers.reduce((p, _) => (p[_._name] = _, p), {})
3162
- }, l = () => new Set(e.layers.map((p) => p._name)), i = (p) => {
3163
- if (p) {
3164
- const _ = l();
3165
- return Object.keys(p).filter((S) => _.has(S));
3224
+ ...a.reduce((h, p) => (h[p._name] = p, h), {})
3225
+ }, i = () => new Set(a.map((h) => h._name)), f = (h) => {
3226
+ if (h) {
3227
+ const p = i();
3228
+ return Object.keys(h).filter((k) => p.has(k));
3166
3229
  }
3167
3230
  return [];
3168
- }, h = e.layers.reduce((p, _) => (_._initShow && p.push(_._name), p), []), b = i(r), w = new D(
3169
- new Set(b.length > 0 ? b : h)
3170
- ), m = w.pipe(
3171
- q((p) => Array.from(p).map((T) => {
3172
- var S;
3231
+ }, w = a.reduce((h, p) => (p._initShow && h.push(p._name), h), []), S = f(r), y = new N(
3232
+ new Set(S.length > 0 ? S : w)
3233
+ ), A = y.pipe(
3234
+ q((h) => Array.from(h).map((E) => {
3235
+ var k;
3173
3236
  return [
3174
- T,
3175
- ((S = e.layers.find((x) => x._name === T)) == null ? void 0 : S._layerIndex) ?? -1
3237
+ E,
3238
+ ((k = a.find((C) => C._name === E)) == null ? void 0 : k._layerIndex) ?? -1
3176
3239
  ];
3177
- }).filter(([, T]) => T !== -1).sort((T, S) => T[1] - S[1]).map(([T]) => T))
3178
- ), v = new D(
3240
+ }).filter(([, E]) => E !== -1).sort((E, k) => E[1] - k[1]).map(([E]) => E))
3241
+ );
3242
+ let v = Y(
3243
+ e.defaultParams ?? {},
3244
+ r ?? {}
3245
+ );
3246
+ const d = new N(
3179
3247
  r ?? {}
3180
- ), y = new oe(), d = new R((p) => {
3181
- v.subscribe((_) => {
3248
+ ), b = new oe(), O = new R((h) => {
3249
+ d.subscribe((p) => {
3182
3250
  try {
3183
- const { status: S, columnName: x, expectToBe: B } = e.validator(_);
3184
- if (S === "error")
3185
- throw new Error(Z({
3186
- columnName: x,
3187
- expectToBe: B,
3251
+ const { status: E, columnName: k, expectToBe: C } = e.validator(p);
3252
+ if (E === "error")
3253
+ throw new Error(Q({
3254
+ columnName: k,
3255
+ expectToBe: C,
3188
3256
  from: `${e.name}.params$`
3189
3257
  }));
3190
- S === "warning" && console.warn(J({
3191
- columnName: x,
3192
- expectToBe: B,
3258
+ E === "warning" && console.warn(X({
3259
+ columnName: k,
3260
+ expectToBe: C,
3193
3261
  from: `${e.name}.params$`
3194
3262
  }));
3195
- } catch (S) {
3196
- console.error(z(S));
3263
+ } catch (E) {
3264
+ console.error(G(E));
3197
3265
  }
3198
- const T = H(e.defaultParams, _ ?? {});
3199
- p.next(T);
3200
- }), y.subscribe((_) => {
3201
- p.next(_);
3266
+ h.next(v);
3267
+ }), b.subscribe((p) => {
3268
+ h.next(p);
3202
3269
  });
3203
- }), E = u.pipe(
3204
- q((p) => ({
3205
- context: p,
3270
+ }), I = u.pipe(
3271
+ q((h) => ({
3272
+ context: h,
3206
3273
  // 初始化時 context 有可能被 in place 擴展
3207
- pluginParams$: d
3274
+ pluginParams$: O
3208
3275
  })),
3209
- gr()
3276
+ br()
3210
3277
  // 只做初始化
3211
3278
  );
3212
- return Y({
3213
- pluginSetupProps: E,
3214
- ShownLayerNameSet: w,
3215
- shownLayerNamesSeq: m
3279
+ return H({
3280
+ pluginSetupProps: I,
3281
+ ShownLayerNameSet: y,
3282
+ shownLayerNamesSeq: A
3216
3283
  }).pipe(
3217
- G(0)
3218
- ).subscribe(({ pluginSetupProps: p, ShownLayerNameSet: _, shownLayerNamesSeq: T }) => {
3219
- const S = p.context._updateLayerElements(
3284
+ W(0)
3285
+ ).subscribe(({ pluginSetupProps: h, ShownLayerNameSet: p, shownLayerNamesSeq: E }) => {
3286
+ const k = h.context._updateLayerElements(
3220
3287
  t,
3221
3288
  n,
3222
- T.map((x) => ({
3289
+ E.map((C) => ({
3223
3290
  pluginId: n,
3224
3291
  pluginName: e.name,
3225
- layerName: x,
3226
- layerIndex: a[x]._layerIndex
3292
+ layerName: C,
3293
+ layerIndex: c[C]._layerIndex
3227
3294
  }))
3228
3295
  );
3229
- e.setup && (o = e.setup(p)), e.layers.forEach((x) => {
3230
- var B, C;
3231
- if (_.has(x._name)) {
3232
- const c = t === "svg" ? {
3296
+ e.setup && (s = e.setup(h)), a.forEach((C) => {
3297
+ var l, m;
3298
+ if (p.has(C._name)) {
3299
+ const T = t === "svg" ? {
3233
3300
  // svgG: (pluginSetupProps as PluginSetupProps<'svg', ExtendContext, PluginParams>).svgG.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
3234
- svgG: S[x._name],
3301
+ svgG: k[C._name],
3235
3302
  // canvas: context.root.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
3236
3303
  // context: Object.assign({}, context) as ChartContext<ExtendContext>,
3237
- context: p.context,
3238
- pluginParams$: d,
3239
- initLayerParams: ((B = v.getValue()) == null ? void 0 : B[x._name]) || {}
3304
+ context: h.context,
3305
+ pluginParams$: O,
3306
+ initLayerParams: ((l = d.getValue()) == null ? void 0 : l[C._name]) || {}
3240
3307
  } : {
3241
3308
  // svgG: context.root.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
3242
3309
  // canvas: (pluginSetupProps as PluginSetupProps<'canvas', ExtendContext, PluginParams>).canvas.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
3243
- canvas: S[x._name],
3310
+ canvas: k[C._name],
3244
3311
  // context: Object.assign({}, context) as ChartContext<ExtendContext>,
3245
- context: p.context,
3246
- pluginParams$: d,
3247
- initLayerParams: ((C = v.getValue()) == null ? void 0 : C[x._name]) || {}
3312
+ context: h.context,
3313
+ pluginParams$: O,
3314
+ initLayerParams: ((m = d.getValue()) == null ? void 0 : m[C._name]) || {}
3248
3315
  };
3249
- x._enable(c);
3316
+ C._enable(T);
3250
3317
  } else
3251
- x._disable();
3318
+ C._disable();
3252
3319
  });
3253
3320
  }), {
3254
3321
  // name: `${config.name}-${Math.random().toString(36).substr(2, 9)}`,
@@ -3262,51 +3329,56 @@ const mt = (t, e, r) => {
3262
3329
  // contextExtension,
3263
3330
  // layer visibility controls
3264
3331
  _getId: () => n,
3265
- _setId: (p) => {
3266
- n = p;
3332
+ _setId: (h) => {
3333
+ n = h;
3267
3334
  },
3268
3335
  // 由 chart 注入 context
3269
- _injectContext: (p) => {
3270
- s.next(Object.assign({}, p));
3336
+ _injectContext: (h) => {
3337
+ o.next(Object.assign({}, h));
3271
3338
  },
3272
- show: (p) => {
3273
- p = Array.isArray(p) ? p : [p], w.next(/* @__PURE__ */ new Set([...Array.from(w.getValue()), ...p]));
3339
+ show: (h) => {
3340
+ h = Array.isArray(h) ? h : [h], y.next(/* @__PURE__ */ new Set([...Array.from(y.getValue()), ...h]));
3274
3341
  },
3275
- showOnly: (p) => {
3276
- p = Array.isArray(p) ? p : [p], w.next(/* @__PURE__ */ new Set([...p]));
3342
+ showOnly: (h) => {
3343
+ h = Array.isArray(h) ? h : [h], y.next(/* @__PURE__ */ new Set([...h]));
3277
3344
  },
3278
3345
  showAll: () => {
3279
- w.next(l());
3346
+ y.next(i());
3280
3347
  },
3281
- hide: (p) => {
3282
- p = Array.isArray(p) ? p : [p], w.next(/* @__PURE__ */ new Set([...Array.from(w.getValue()).filter((_) => !p.includes(_))]));
3348
+ hide: (h) => {
3349
+ h = Array.isArray(h) ? h : [h], y.next(/* @__PURE__ */ new Set([...Array.from(y.getValue()).filter((p) => !h.includes(p))]));
3283
3350
  },
3284
3351
  hideAll: () => {
3285
- w.next(/* @__PURE__ */ new Set());
3352
+ y.next(/* @__PURE__ */ new Set());
3286
3353
  },
3287
- toggle: (p) => {
3288
- p = Array.isArray(p) ? p : [p], Array.from(w.getValue()).forEach((_) => {
3289
- p.includes(_) ? p.splice(p.indexOf(_), 1) : p.push(_);
3290
- }), w.next(new Set(p));
3354
+ toggle: (h) => {
3355
+ h = Array.isArray(h) ? h : [h], Array.from(y.getValue()).forEach((p) => {
3356
+ h.includes(p) ? h.splice(h.indexOf(p), 1) : h.push(p);
3357
+ }), y.next(new Set(h));
3291
3358
  },
3292
- getShownLayerNames: () => Array.from(w.getValue()),
3359
+ getShownLayerNames: () => Array.from(y.getValue()),
3293
3360
  // layer params
3294
3361
  // setLayers: (partial: DeepPartial<PluginParams>) => {
3295
3362
  // params = { ...params, ...partial }
3296
3363
  // },
3297
- updateParams: (p) => {
3298
- v.next(p), Object.keys(p).forEach((_) => {
3299
- const T = a[_];
3300
- T && T._updateParams(p[_]);
3364
+ updateParams: (h) => {
3365
+ v = Y(v, h), d.next(h), Object.keys(h).forEach((p) => {
3366
+ const E = c[p];
3367
+ E && E._updateParams(h[p]);
3301
3368
  });
3302
3369
  },
3303
- forceReplaceParams: (p) => {
3304
- y.next(p), Object.keys(p).forEach((_) => {
3305
- const T = a[_];
3306
- T && T._forceReplaceParams(p[_]);
3370
+ forceReplaceParams: (h) => {
3371
+ v = h, b.next(h), Object.keys(h).forEach((p) => {
3372
+ const E = c[p];
3373
+ E && E._forceReplaceParams(h[p]);
3307
3374
  });
3308
3375
  },
3309
- getParams: () => e.layers.reduce((p, _) => (p[_._name] = _._getParams(), p), {}),
3376
+ getParams: () => {
3377
+ const h = Object.assign({}, v);
3378
+ return a.forEach((p) => {
3379
+ h[p._name] = p._getParams();
3380
+ }), h;
3381
+ },
3310
3382
  // layer: <LayerName extends keyof PluginParams>(name: LayerName) => ({
3311
3383
  // // set: (partial: DeepPartial<PluginParams[LayerName]>) => {
3312
3384
  // // if (params[name]) {
@@ -3332,8 +3404,8 @@ const mt = (t, e, r) => {
3332
3404
  // }
3333
3405
  // }),
3334
3406
  destroy: () => {
3335
- o(), s.complete(), w.complete(), e.layers.forEach((p) => {
3336
- p._destroy();
3407
+ s(), o.complete(), y.complete(), a.forEach((h) => {
3408
+ h._destroy();
3337
3409
  });
3338
3410
  }
3339
3411
  // // outputs
@@ -3341,22 +3413,22 @@ const mt = (t, e, r) => {
3341
3413
  // subscriber.next(params)
3342
3414
  // })
3343
3415
  };
3344
- }, Qr = (t) => class {
3416
+ }, Xr = (t) => class {
3345
3417
  constructor(r) {
3346
3418
  return mt("svg", t, r);
3347
3419
  }
3348
- }, vt = (t, e) => {
3349
- const r = new D(Object.assign({}, e.defaultParams));
3420
+ }, gt = (t, e) => {
3421
+ const r = new N(Object.assign({}, e.defaultParams));
3350
3422
  let n = () => {
3351
3423
  };
3352
- const o = new D(null), s = o.pipe(
3353
- ye((u) => u !== null)
3424
+ const s = new N(null), o = s.pipe(
3425
+ pe((u) => u !== null)
3354
3426
  );
3355
- return Y({
3427
+ return H({
3356
3428
  layerParams: r,
3357
- enabledProps: s
3429
+ enabledProps: o
3358
3430
  }).pipe(
3359
- G(0)
3431
+ W(0)
3360
3432
  ).subscribe(({ layerParams: u, enabledProps: a }) => {
3361
3433
  n(), n = t === "svg" ? e.setup({
3362
3434
  svgG: a.svgG,
@@ -3365,7 +3437,7 @@ const mt = (t, e, r) => {
3365
3437
  context: a.context,
3366
3438
  pluginParams$: a.pluginParams$,
3367
3439
  layerParams$: r.pipe(
3368
- q((l) => H(l, a.initLayerParams ?? {}))
3440
+ q((c) => Y(c, a.initLayerParams ?? {}))
3369
3441
  )
3370
3442
  }) : e.setup({
3371
3443
  // svgG: enabledProps.svgG,
@@ -3374,10 +3446,10 @@ const mt = (t, e, r) => {
3374
3446
  context: a.context,
3375
3447
  pluginParams$: a.pluginParams$,
3376
3448
  layerParams$: r.pipe(
3377
- q((l) => H(l, a.initLayerParams ?? {}))
3449
+ q((c) => Y(c, a.initLayerParams ?? {}))
3378
3450
  )
3379
3451
  });
3380
- }), o.pipe(ye((u) => u === null)).subscribe(() => {
3452
+ }), s.pipe(pe((u) => u === null)).subscribe(() => {
3381
3453
  n();
3382
3454
  }), {
3383
3455
  _name: e.name,
@@ -3385,32 +3457,32 @@ const mt = (t, e, r) => {
3385
3457
  _layerIndex: e.layerIndex,
3386
3458
  _initShow: e.initShow,
3387
3459
  _enable: (u) => {
3388
- o.next(u);
3460
+ s.next(u);
3389
3461
  },
3390
3462
  _disable: () => {
3391
- o.next(null);
3463
+ s.next(null);
3392
3464
  },
3393
3465
  // setParams: (partial) => {
3394
3466
  // previousParams$.next(deepOverwrite(defaultParams$.getValue(), partial))
3395
3467
  // },
3396
3468
  _updateParams: (u) => {
3397
3469
  try {
3398
- const { status: l, columnName: i, expectToBe: h } = e.validator(u);
3399
- if (l === "error")
3400
- throw new Error(Z({
3470
+ const { status: c, columnName: i, expectToBe: f } = e.validator(u);
3471
+ if (c === "error")
3472
+ throw new Error(Q({
3401
3473
  columnName: i,
3402
- expectToBe: h,
3474
+ expectToBe: f,
3403
3475
  from: `${e.name}.params$`
3404
3476
  }));
3405
- l === "warning" && console.warn(J({
3477
+ c === "warning" && console.warn(X({
3406
3478
  columnName: i,
3407
- expectToBe: h,
3479
+ expectToBe: f,
3408
3480
  from: `${e.name}.params$`
3409
3481
  }));
3410
- } catch (l) {
3411
- console.error(z(l));
3482
+ } catch (c) {
3483
+ console.error(G(c));
3412
3484
  }
3413
- const a = H(r.getValue(), u);
3485
+ const a = Y(r.getValue(), u);
3414
3486
  r.next(a);
3415
3487
  },
3416
3488
  _forceReplaceParams: (u) => {
@@ -3423,56 +3495,57 @@ const mt = (t, e, r) => {
3423
3495
  // enableProps$.next(true)
3424
3496
  // },
3425
3497
  _destroy: () => {
3426
- o.next(null), o.complete(), r.complete();
3498
+ s.next(null), s.complete(), r.complete();
3427
3499
  }
3428
3500
  };
3429
- }, en = (t) => class {
3501
+ }, tn = (t) => class {
3430
3502
  constructor() {
3431
- return vt("svg", t);
3503
+ return gt("svg", t);
3432
3504
  }
3433
- }, rn = (t) => class {
3505
+ }, nn = (t) => class {
3434
3506
  constructor(r) {
3435
3507
  return mt("canvas", t, r);
3436
3508
  }
3437
3509
  }, on = (t) => class {
3438
3510
  constructor() {
3439
- return vt("canvas", t);
3511
+ return gt("canvas", t);
3440
3512
  }
3441
3513
  };
3442
3514
  export {
3443
- Hr as OrbCharts,
3444
- pe as aggregate,
3515
+ Qr as OrbCharts,
3516
+ de as aggregate,
3445
3517
  $r as count,
3446
- ft as createCanvas,
3447
- Zr as createCanvasElement,
3448
- Jr as createDiv,
3449
- jr as createLayerClassName,
3450
- ht as createMessagePrefix,
3451
- z as createOrbChartsErrorMessage,
3518
+ ht as createCanvas,
3519
+ Jr as createCanvasElement,
3520
+ Hr as createDiv,
3521
+ Lr as createLayerClassName,
3522
+ yt as createMessagePrefix,
3523
+ G as createOrbChartsErrorMessage,
3452
3524
  Mr as createPluginClassName,
3453
- Ir as createSVG,
3454
- Br as createSVGGroup,
3455
- fe as createUnexpectedErrorMessage,
3456
- Z as createValidatorErrorMessage,
3457
- J as createValidatorWarningMessage,
3458
- H as deepOverwrite,
3525
+ Br as createSVG,
3526
+ Pr as createSVGGroup,
3527
+ he as createUnexpectedErrorMessage,
3528
+ Q as createValidatorErrorMessage,
3529
+ X as createValidatorWarningMessage,
3530
+ Y as deepOverwrite,
3459
3531
  on as defineCanvasLayer,
3460
- rn as defineCanvasPlugin,
3461
- en as defineSVGLayer,
3462
- Qr as defineSVGPlugin,
3463
- Yr as formatCommaNumber,
3464
- K as getColorByFrom,
3465
- Or as getColorByIndex,
3466
- ct as isDom,
3532
+ nn as defineCanvasPlugin,
3533
+ tn as defineSVGLayer,
3534
+ Xr as defineSVGPlugin,
3535
+ Zr as formatCommaNumber,
3536
+ D as getColorByFrom,
3537
+ Ir as getColorByIndex,
3538
+ ft as isDom,
3467
3539
  Cr as isFunction,
3468
- Q as isPlainObject,
3469
- _r as max,
3470
- xr as mean,
3540
+ ee as isPlainObject,
3541
+ Tr as max,
3542
+ Ar as mean,
3471
3543
  Sr as median,
3472
- Ar as min,
3473
- Tr as none,
3474
- Pr as removeElementChildren,
3475
- kr as resizeObservable,
3476
- Er as sum,
3477
- V as validateObject
3544
+ _r as min,
3545
+ Or as none,
3546
+ kr as removeElementChildren,
3547
+ jr as resizeObservable,
3548
+ $ as resolveGroupKey,
3549
+ xr as sum,
3550
+ K as validateObject
3478
3551
  };