@manyducks.co/dolla 2.0.0-alpha.19 → 2.0.0-alpha.20

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,12 +1,12 @@
1
1
  var me = Object.defineProperty;
2
- var ge = (n, e, t) => e in n ? me(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var r = (n, e, t) => ge(n, typeof e != "symbol" ? e + "" : e, t);
4
- function we(n) {
5
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
2
+ var ge = (s, e, t) => e in s ? me(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var r = (s, e, t) => ge(s, typeof e != "symbol" ? e + "" : e, t);
4
+ function we(s) {
5
+ return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
6
6
  }
7
7
  var O = { exports: {} }, Z;
8
8
  function ye() {
9
- return Z || (Z = 1, function(n, e) {
9
+ return Z || (Z = 1, function(s, e) {
10
10
  Object.defineProperty(e, "__esModule", { value: !0 });
11
11
  var t = /* @__PURE__ */ function() {
12
12
  function l(c, h) {
@@ -29,7 +29,7 @@ function ye() {
29
29
  if (Symbol.iterator in Object(c)) return l(c, h);
30
30
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
31
31
  };
32
- }(), s = function(l) {
32
+ }(), n = function(l) {
33
33
  return l.reduce(function(c, h) {
34
34
  return 16 > h ? c + "0" + h.toString(16) : c + h.toString(16);
35
35
  }, "#");
@@ -49,91 +49,91 @@ function ye() {
49
49
  return c * h.charCodeAt(0) * d + 1;
50
50
  }, 1);
51
51
  }, a = function(l) {
52
- var c = l.str, h = l.hue, d = h === void 0 ? { min: 0, max: 360 } : h, f = l.sat, m = f === void 0 ? { min: 0.35, max: 0.65 } : f, v = l.light, S = v === void 0 ? { min: 0.3, max: 0.7 } : v, b = l.hashFunction, g = b === void 0 ? u : b, k = l.scheme, _ = k === void 0 ? "hex" : k, L = o(g(c), d, m, S), w = t(L, 3), D = w[0], H = w[1], z = w[2], Y = i(D / 360, H, z), pe = s(Y);
52
+ var c = l.str, h = l.hue, d = h === void 0 ? { min: 0, max: 360 } : h, f = l.sat, m = f === void 0 ? { min: 0.35, max: 0.65 } : f, v = l.light, S = v === void 0 ? { min: 0.3, max: 0.7 } : v, b = l.hashFunction, g = b === void 0 ? u : b, k = l.scheme, _ = k === void 0 ? "hex" : k, L = o(g(c), d, m, S), w = t(L, 3), D = w[0], H = w[1], z = w[2], Y = i(D / 360, H, z), pe = n(Y);
53
53
  return _ === "hsl" ? [D, H, z] : _ === "rgb" ? Y : pe;
54
54
  };
55
- e.default = a, n.exports = e.default;
55
+ e.default = a, s.exports = e.default;
56
56
  }(O, O.exports)), O.exports;
57
57
  }
58
58
  var Ce = ye();
59
59
  const be = /* @__PURE__ */ we(Ce);
60
- function G(n) {
61
- if (n === void 0)
60
+ function G(s) {
61
+ if (s === void 0)
62
62
  return "undefined";
63
- if (n === null)
63
+ if (s === null)
64
64
  return "null";
65
- const e = typeof n;
65
+ const e = typeof s;
66
66
  switch (e) {
67
67
  case "number":
68
- return isNaN(n) ? "NaN" : "number";
68
+ return isNaN(s) ? "NaN" : "number";
69
69
  case "function":
70
- return oe(n) ? "class" : e;
70
+ return oe(s) ? "class" : e;
71
71
  case "object":
72
- return M(n) ? "array" : ve(n) ? "promise" : e;
72
+ return M(s) ? "array" : ve(s) ? "promise" : e;
73
73
  default:
74
74
  return e;
75
75
  }
76
76
  }
77
- function M(n) {
78
- return Array.isArray(n);
77
+ function M(s) {
78
+ return Array.isArray(s);
79
79
  }
80
- function ie(...n) {
81
- const e = n[0], t = (s) => M(s) && s.every((i) => e(i));
82
- return n.length < 2 ? t : t(n[1]);
80
+ function ie(...s) {
81
+ const e = s[0], t = (n) => M(n) && n.every((i) => e(i));
82
+ return s.length < 2 ? t : t(s[1]);
83
83
  }
84
- function He(...n) {
85
- const e = n[0], t = $(n[2]) ? n[2] : "Expected an array of valid items. Got type: %t, value: %v", s = (i) => {
84
+ function He(...s) {
85
+ const e = s[0], t = $(s[2]) ? s[2] : "Expected an array of valid items. Got type: %t, value: %v", n = (i) => {
86
86
  if (M(i) && i.every((o) => e(o)))
87
87
  return !0;
88
88
  throw new TypeError(j(i, t));
89
89
  };
90
- return n.length < 2 ? s : s(n[1]);
90
+ return s.length < 2 ? n : n(s[1]);
91
91
  }
92
- function $(n) {
93
- return typeof n == "string";
92
+ function $(s) {
93
+ return typeof s == "string";
94
94
  }
95
- function ze(n, e) {
96
- if ($(n))
95
+ function ze(s, e) {
96
+ if ($(s))
97
97
  return !0;
98
- throw new TypeError(j(n, e ?? "Expected a string. Got type: %t, value: %v"));
98
+ throw new TypeError(j(s, e ?? "Expected a string. Got type: %t, value: %v"));
99
99
  }
100
- function x(n) {
101
- return typeof n == "function" && !oe(n);
100
+ function x(s) {
101
+ return typeof s == "function" && !oe(s);
102
102
  }
103
- function _e(n) {
104
- return typeof n == "number" && !isNaN(n);
103
+ function _e(s) {
104
+ return typeof s == "number" && !isNaN(s);
105
105
  }
106
- function ve(n) {
107
- if (n == null) return !1;
108
- const e = n;
106
+ function ve(s) {
107
+ if (s == null) return !1;
108
+ const e = s;
109
109
  return e instanceof Promise || x(e.then) && x(e.catch) && x(e.finally);
110
110
  }
111
- function oe(n) {
112
- return typeof n == "function" && /^\s*class\s+/.test(n.toString());
111
+ function oe(s) {
112
+ return typeof s == "function" && /^\s*class\s+/.test(s.toString());
113
113
  }
114
- function Ye(...n) {
115
- const e = n[0], t = $(n[2]) ? n[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, s = (i) => {
114
+ function Ye(...s) {
115
+ const e = s[0], t = $(s[2]) ? s[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, n = (i) => {
116
116
  if (i instanceof e)
117
117
  return !0;
118
118
  throw new TypeError(j(i, t));
119
119
  };
120
- return n.length < 2 ? s : s(n[1]);
120
+ return s.length < 2 ? n : n(s[1]);
121
121
  }
122
- function W(n) {
123
- return n != null && typeof n == "object" && !M(n);
122
+ function W(s) {
123
+ return s != null && typeof s == "object" && !M(s);
124
124
  }
125
- function j(n, e) {
125
+ function j(s, e) {
126
126
  var i;
127
- const t = G(n), s = ((i = n == null ? void 0 : n.toString) == null ? void 0 : i.call(n)) || String(n);
128
- return e.replaceAll("%t", t).replaceAll("%v", s);
127
+ const t = G(s), n = ((i = s == null ? void 0 : s.toString) == null ? void 0 : i.call(s)) || String(s);
128
+ return e.replaceAll("%t", t).replaceAll("%v", n);
129
129
  }
130
130
  const ke = () => {
131
131
  };
132
- function Se(n, e) {
133
- const t = (s) => {
132
+ function Se(s, e) {
133
+ const t = (n) => {
134
134
  const i = {};
135
- for (const o in s)
136
- n.includes(o) || (i[o] = s[o]);
135
+ for (const o in n)
136
+ s.includes(o) || (i[o] = n[o]);
137
137
  return i;
138
138
  };
139
139
  return e == null ? t : t(e);
@@ -144,33 +144,33 @@ function Ze() {
144
144
  if (typeof global < "u" && global.console)
145
145
  return global.console;
146
146
  }
147
- function xe(n) {
147
+ function xe(s) {
148
148
  return be({
149
- str: n,
149
+ str: s,
150
150
  sat: { min: 0.35, max: 0.55 },
151
151
  light: { min: 0.6, max: 0.6 }
152
152
  });
153
153
  }
154
- function Je(n) {
155
- if (n instanceof RegExp)
156
- return (s) => n.test(s);
154
+ function Je(s) {
155
+ if (s instanceof RegExp)
156
+ return (n) => s.test(n);
157
157
  const e = {
158
158
  positive: [],
159
159
  negative: []
160
- }, t = n.split(",").map((s) => s.trim()).filter((s) => s !== "");
161
- for (let s of t) {
160
+ }, t = s.split(",").map((n) => n.trim()).filter((n) => n !== "");
161
+ for (let n of t) {
162
162
  let i = "positive";
163
- s.startsWith("-") && (i = "negative", s = s.slice(1)), s === "*" ? e[i].push(function() {
163
+ n.startsWith("-") && (i = "negative", n = n.slice(1)), n === "*" ? e[i].push(function() {
164
164
  return !0;
165
- }) : s.endsWith("*") ? e[i].push(function(o) {
166
- return o.startsWith(s.slice(0, s.length - 1));
165
+ }) : n.endsWith("*") ? e[i].push(function(o) {
166
+ return o.startsWith(n.slice(0, n.length - 1));
167
167
  }) : e[i].push(function(o) {
168
- return o === s;
168
+ return o === n;
169
169
  });
170
170
  }
171
- return function(s) {
171
+ return function(n) {
172
172
  const { positive: i, negative: o } = e;
173
- return !(o.some((u) => u(s)) || i.length > 0 && !i.some((u) => u(s)));
173
+ return !(o.some((u) => u(n)) || i.length > 0 && !i.some((u) => u(n)));
174
174
  };
175
175
  }
176
176
  const P = {
@@ -197,25 +197,25 @@ const P = {
197
197
  }, 200));
198
198
  }
199
199
  }, T = Symbol("State"), B = Symbol("SettableState"), re = Symbol("Ref");
200
- function p(n) {
201
- return (n == null ? void 0 : n[T]) === !0;
200
+ function p(s) {
201
+ return (s == null ? void 0 : s[T]) === !0;
202
202
  }
203
- function R(n) {
204
- return (n == null ? void 0 : n[B]) === !0;
203
+ function R(s) {
204
+ return (s == null ? void 0 : s[B]) === !0;
205
205
  }
206
- function ue(n) {
207
- return (n == null ? void 0 : n[re]) === !0;
206
+ function ue(s) {
207
+ return (s == null ? void 0 : s[re]) === !0;
208
208
  }
209
- function Ee(n) {
210
- return p(n) ? n.get() : n;
209
+ function Ee(s) {
210
+ return p(s) ? s.get() : s;
211
211
  }
212
- function F(n) {
213
- return R(n) ? new U(n) : p(n) ? n : new U({
212
+ function F(s) {
213
+ return R(s) ? new U(s) : p(s) ? s : new U({
214
214
  get() {
215
- return n;
215
+ return s;
216
216
  },
217
217
  watch(e, t = {}) {
218
- return t != null && t.lazy || e(n), ke;
218
+ return t != null && t.lazy || e(s), ke;
219
219
  }
220
220
  });
221
221
  }
@@ -245,8 +245,8 @@ class A {
245
245
  }
246
246
  watch(e, t) {
247
247
  return this.watchers.push(e), t != null && t.lazy || e(this.value), P.increment(), () => {
248
- const s = this.watchers.indexOf(e);
249
- s > -1 && this.watchers.splice(s, 1), P.decrement();
248
+ const n = this.watchers.indexOf(e);
249
+ n > -1 && this.watchers.splice(n, 1), P.decrement();
250
250
  };
251
251
  }
252
252
  }
@@ -268,8 +268,8 @@ class U {
268
268
  return this.__value.watch(e, t);
269
269
  }
270
270
  }
271
- function I(n, e) {
272
- const t = new A(n, e);
271
+ function I(s, e) {
272
+ const t = new A(s, e);
273
273
  return [new U(t), (i) => t.set(i)];
274
274
  }
275
275
  var ee, te;
@@ -294,28 +294,28 @@ class $e {
294
294
  return this.__value.watch(e, t);
295
295
  }
296
296
  }
297
- function Qe(n, e) {
298
- return new $e(new A(n, e));
297
+ function Qe(s, e) {
298
+ return new $e(new A(s, e));
299
299
  }
300
- function Xe(n, e) {
300
+ function Xe(s, e) {
301
301
  return {
302
302
  [T]: !0,
303
303
  [B]: !0,
304
- get: n.get.bind(n),
305
- watch: n.watch.bind(n),
304
+ get: s.get.bind(s),
305
+ watch: s.watch.bind(s),
306
306
  set: e
307
307
  };
308
308
  }
309
- function et(n, e) {
310
- return function(s) {
311
- const i = n.get();
309
+ function et(s, e) {
310
+ return function(n) {
311
+ const i = s.get();
312
312
  let o;
313
- typeof s == "function" ? o = s(i) : o = s, e(o, i);
313
+ typeof n == "function" ? o = n(i) : o = n, e(o, i);
314
314
  };
315
315
  }
316
316
  const J = Symbol("EMPTY");
317
317
  class Ne {
318
- constructor(e, t, s) {
318
+ constructor(e, t, n) {
319
319
  r(this, "equals", A.defaultEquals);
320
320
  /**
321
321
  * Array of states this holder's value is derived from.
@@ -353,7 +353,7 @@ class Ne {
353
353
  * When value is a State, this function will stop watching its value.
354
354
  */
355
355
  r(this, "stopWatchingCurrentValue");
356
- this.sources = e.map(F), this.fn = t, s != null && s.equals && (this.equals = s.equals), this.previousSourceValues = new Array(e.length).fill(J, 0, e.length);
356
+ this.sources = e.map(F), this.fn = t, n != null && n.equals && (this.equals = n.equals), this.previousSourceValues = new Array(e.length).fill(J, 0, e.length);
357
357
  }
358
358
  /*==========================*\
359
359
  || "Public" methods ||
@@ -363,9 +363,9 @@ class Ne {
363
363
  }
364
364
  watch(e, t) {
365
365
  this.isWatchingSources || this.startWatchingSources();
366
- const s = this.watchers;
367
- return s.push(e), t != null && t.lazy || e(this.rawValue), P.increment(), () => {
368
- s.splice(s.indexOf(e), 1), this.isWatchingSources && s.length === 0 && this.stopWatchingSources(), P.decrement();
366
+ const n = this.watchers;
367
+ return n.push(e), t != null && t.lazy || e(this.rawValue), P.increment(), () => {
368
+ n.splice(n.indexOf(e), 1), this.isWatchingSources && n.length === 0 && this.stopWatchingSources(), P.decrement();
369
369
  };
370
370
  }
371
371
  /*==========================*\
@@ -377,10 +377,10 @@ class Ne {
377
377
  }
378
378
  update() {
379
379
  const e = this.sources, t = this.previousSourceValues;
380
- let s = !1, i;
380
+ let n = !1, i;
381
381
  for (let o = 0; o < e.length; o++)
382
- i = e[o].get(), !s && !this.equals(i, t[o]) && (s = !0), t[o] = i;
383
- s && this.setValue(this.fn(...t));
382
+ i = e[o].get(), !n && !this.equals(i, t[o]) && (n = !0), t[o] = i;
383
+ n && this.setValue(this.fn(...t));
384
384
  }
385
385
  getValue() {
386
386
  return this.isWatchingSources || this.update(), this.rawValue;
@@ -392,9 +392,9 @@ class Ne {
392
392
  }
393
393
  startWatchingSources() {
394
394
  const e = this.previousSourceValues;
395
- for (let s = 0; s < this.sources.length; s++)
396
- this.sourceWatcher.watch([this.sources[s]], (i) => {
397
- if (e[s] = i, this.isWatchingSources) {
395
+ for (let n = 0; n < this.sources.length; n++)
396
+ this.sourceWatcher.watch([this.sources[n]], (i) => {
397
+ if (e[n] = i, this.isWatchingSources) {
398
398
  const o = this.fn(...e);
399
399
  this.equals(o, this.value) || this.setValue(o);
400
400
  }
@@ -407,9 +407,9 @@ class Ne {
407
407
  this.sourceWatcher.stopAll(), this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.isWatchingSources = !1;
408
408
  }
409
409
  }
410
- function Me(n, e, t) {
411
- const s = new Ne(n, e, t);
412
- return new U(s);
410
+ function Me(s, e, t) {
411
+ const n = new Ne(s, e, t);
412
+ return new U(n);
413
413
  }
414
414
  var ne, se;
415
415
  se = re, ne = T;
@@ -438,30 +438,30 @@ function tt() {
438
438
  return new Ae(new A(void 0));
439
439
  }
440
440
  function K() {
441
- const n = [];
441
+ const s = [];
442
442
  return {
443
443
  watch(e, t) {
444
444
  if (e.length === 0)
445
445
  throw new TypeError("Expected at least one state to watch.");
446
446
  e = e.map(F);
447
- let s;
448
- return e.length > 1 ? s = Me(e, t).watch(() => null) : s = e[0].watch(t), n.push(s), () => {
449
- let i = n.indexOf(s);
450
- i > -1 && n.splice(i, 1), s();
447
+ let n;
448
+ return e.length > 1 ? n = Me(e, t).watch(() => null) : n = e[0].watch(t), s.push(n), () => {
449
+ let i = s.indexOf(n);
450
+ i > -1 && s.splice(i, 1), n();
451
451
  };
452
452
  },
453
453
  stopAll() {
454
- for (; n.length > 0; )
455
- n.pop()();
454
+ for (; s.length > 0; )
455
+ s.pop()();
456
456
  }
457
457
  };
458
458
  }
459
- function Ve(n) {
460
- for (var e, t, s = arguments, i = 1, o = "", u = "", a = [0], l = function(d) {
461
- i === 1 && (d || (o = o.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? a.push(d ? s[d] : o) : i === 3 && (d || o) ? (a[1] = d ? s[d] : o, i = 2) : i === 2 && o === "..." && d ? a[2] = Object.assign(a[2] || {}, s[d]) : i === 2 && o && !d ? (a[2] = a[2] || {})[o] = !0 : i >= 5 && (i === 5 ? ((a[2] = a[2] || {})[t] = d ? o ? o + s[d] : s[d] : o, i = 6) : (d || o) && (a[2][t] += d ? o + s[d] : o)), o = "";
462
- }, c = 0; c < n.length; c++) {
459
+ function Ve(s) {
460
+ for (var e, t, n = arguments, i = 1, o = "", u = "", a = [0], l = function(d) {
461
+ i === 1 && (d || (o = o.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? a.push(d ? n[d] : o) : i === 3 && (d || o) ? (a[1] = d ? n[d] : o, i = 2) : i === 2 && o === "..." && d ? a[2] = Object.assign(a[2] || {}, n[d]) : i === 2 && o && !d ? (a[2] = a[2] || {})[o] = !0 : i >= 5 && (i === 5 ? ((a[2] = a[2] || {})[t] = d ? o ? o + n[d] : n[d] : o, i = 6) : (d || o) && (a[2][t] += d ? o + n[d] : o)), o = "";
462
+ }, c = 0; c < s.length; c++) {
463
463
  c && (i === 1 && l(), l(c));
464
- for (var h = 0; h < n[c].length; h++) e = n[c][h], i === 1 ? e === "<" ? (l(), a = [a, "", null], i = 3) : o += e : i === 4 ? o === "--" && e === ">" ? (i = 1, o = "") : o = e + o[0] : u ? e === u ? u = "" : o += e : e === '"' || e === "'" ? u = e : e === ">" ? (l(), i = 1) : i && (e === "=" ? (i = 5, t = o, o = "") : e === "/" && (i < 5 || n[c][h + 1] === ">") ? (l(), i === 3 && (a = a[0]), i = a, (a = a[0]).push(this.apply(null, i.slice(1))), i = 0) : e === " " || e === " " || e === `
464
+ for (var h = 0; h < s[c].length; h++) e = s[c][h], i === 1 ? e === "<" ? (l(), a = [a, "", null], i = 3) : o += e : i === 4 ? o === "--" && e === ">" ? (i = 1, o = "") : o = e + o[0] : u ? e === u ? u = "" : o += e : e === '"' || e === "'" ? u = e : e === ">" ? (l(), i = 1) : i && (e === "=" ? (i = 5, t = o, o = "") : e === "/" && (i < 5 || s[c][h + 1] === ">") ? (l(), i === 3 && (a = a[0]), i = a, (a = a[0]).push(this.apply(null, i.slice(1))), i = 0) : e === " " || e === " " || e === `
465
465
  ` || e === "\r" ? (l(), i = 2) : o += e), i === 3 && o === "!--" && (i = 4, a = a[0]);
466
466
  }
467
467
  return l(), a.length > 2 ? a.slice(1) : a[1];
@@ -484,25 +484,25 @@ class Te {
484
484
  return this.node.parentNode != null;
485
485
  }
486
486
  mount(e, t) {
487
- this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.elementContext.root.getEnv() === "development" && e.insertBefore(this.endNode, this.node.nextSibling), this.stopCallback = this.$predicate.watch((s) => {
488
- (!this.initialUpdateHappened || s && !this.previousValue || !s && this.previousValue) && (this.update(s), this.initialUpdateHappened = !0, this.previousValue = s);
487
+ this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.elementContext.root.getEnv() === "development" && e.insertBefore(this.endNode, this.node.nextSibling), this.stopCallback = this.$predicate.watch((n) => {
488
+ (!this.initialUpdateHappened || n && !this.previousValue || !n && this.previousValue) && (this.update(n), this.initialUpdateHappened = !0, this.previousValue = n);
489
489
  }));
490
490
  }
491
- unmount() {
492
- var e, t;
491
+ unmount(e) {
492
+ var t, n;
493
493
  this.stopCallback && (this.stopCallback(), this.stopCallback = void 0);
494
- for (const s of this.connectedContent)
495
- s.unmount();
496
- this.connectedContent = [], this.isMounted && ((e = this.node.parentNode) == null || e.removeChild(this.node), (t = this.endNode.parentNode) == null || t.removeChild(this.endNode));
494
+ for (const i of this.connectedContent)
495
+ i.unmount(e);
496
+ this.connectedContent = [], this.isMounted && ((t = this.node.parentNode) == null || t.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode));
497
497
  }
498
498
  update(e) {
499
499
  var t;
500
- for (const s of this.connectedContent)
501
- s.unmount();
500
+ for (const n of this.connectedContent)
501
+ n.unmount(!1);
502
502
  if (this.connectedContent = [], this.node.parentNode != null) {
503
503
  e && this.thenContent ? this.connectedContent = C(this.elementContext, this.thenContent) : !e && this.elseContent && (this.connectedContent = C(this.elementContext, this.elseContent));
504
- for (let s = 0; s < this.connectedContent.length; s++) {
505
- const i = this.connectedContent[s], o = ((t = this.connectedContent[s - 1]) == null ? void 0 : t.node) ?? this.node;
504
+ for (let n = 0; n < this.connectedContent.length; n++) {
505
+ const i = this.connectedContent[n], o = ((t = this.connectedContent[n - 1]) == null ? void 0 : t.node) ?? this.node;
506
506
  i.mount(this.node.parentNode, o);
507
507
  }
508
508
  this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Conditional (${e ? "truthy" : "falsy"})`);
@@ -510,15 +510,15 @@ class Te {
510
510
  }
511
511
  }
512
512
  const Oe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
513
- let ae = (n = 21) => {
514
- let e = "", t = crypto.getRandomValues(new Uint8Array(n |= 0));
515
- for (; n--; )
516
- e += Oe[t[n] & 63];
513
+ let ae = (s = 21) => {
514
+ let e = "", t = crypto.getRandomValues(new Uint8Array(s |= 0));
515
+ for (; s--; )
516
+ e += Oe[t[s] & 63];
517
517
  return e;
518
518
  };
519
- const Pe = (n) => /^on[A-Z]/.test(n);
519
+ const Pe = (s) => /^on[A-Z]/.test(s);
520
520
  class Ue {
521
- constructor({ tag: e, props: t, children: s, elementContext: i }) {
521
+ constructor({ tag: e, props: t, children: n, elementContext: i }) {
522
522
  r(this, "node");
523
523
  r(this, "props");
524
524
  r(this, "children");
@@ -537,7 +537,7 @@ class Ue {
537
537
  this.props = {
538
538
  ...Se(["ref", "class", "className"], t),
539
539
  class: t.className ?? t.class
540
- }, this.children = s ? C(i, s) : [], this.elementContext = i;
540
+ }, this.children = n ? C(i, n) : [], this.elementContext = i;
541
541
  }
542
542
  get isMounted() {
543
543
  return this.node.parentNode != null;
@@ -546,43 +546,43 @@ class Ue {
546
546
  if (e == null)
547
547
  throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${e}`);
548
548
  if (!this.isMounted) {
549
- for (const s of this.children)
550
- s.mount(this.node);
549
+ for (const n of this.children)
550
+ n.mount(this.node);
551
551
  this.applyProps(this.node, this.props), this.props.style && this.applyStyles(this.node, this.props.style, this.stopCallbacks), this.props.class && this.applyClasses(this.node, this.props.class, this.stopCallbacks);
552
552
  }
553
553
  e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.ref && (this.ref.node = this.node), setTimeout(() => {
554
554
  this.canClickAway = !0;
555
555
  }, 0);
556
556
  }
557
- unmount() {
558
- var e;
557
+ unmount(e) {
558
+ var t;
559
559
  if (this.isMounted) {
560
- for (const t of this.children)
561
- t.unmount();
562
- this.ref && (this.ref.node = void 0), (e = this.node.parentNode) == null || e.removeChild(this.node), this.canClickAway = !1;
563
- for (const t of this.stopCallbacks)
564
- t();
560
+ for (const n of this.children)
561
+ n.unmount(!0);
562
+ this.ref && (this.ref.node = void 0), e || (t = this.node.parentNode) == null || t.removeChild(this.node), this.canClickAway = !1;
563
+ for (const n of this.stopCallbacks)
564
+ n();
565
565
  this.stopCallbacks = [];
566
566
  }
567
567
  }
568
568
  getUpdateKey(e, t) {
569
569
  return `${this.uniqueId}:${e}:${t}`;
570
570
  }
571
- attachProp(e, t, s) {
571
+ attachProp(e, t, n) {
572
572
  p(e) ? this.stopCallbacks.push(
573
573
  e.watch((i) => {
574
574
  this.elementContext.root.render.write(() => {
575
575
  t(i);
576
- }, s);
576
+ }, n);
577
577
  })
578
578
  ) : this.elementContext.root.render.write(() => {
579
579
  t(e);
580
- }, s);
580
+ }, n);
581
581
  }
582
582
  applyProps(e, t) {
583
- for (const s in t) {
584
- const i = t[s];
585
- if (s === "attributes") {
583
+ for (const n in t) {
584
+ const i = t[n];
585
+ if (n === "attributes") {
586
586
  const o = i;
587
587
  for (const u in o)
588
588
  this.attachProp(
@@ -592,7 +592,7 @@ class Ue {
592
592
  },
593
593
  this.getUpdateKey("attr", u)
594
594
  );
595
- } else if (s === "eventListeners") {
595
+ } else if (n === "eventListeners") {
596
596
  const o = i;
597
597
  for (const u in o) {
598
598
  const a = p(i) ? (l) => i.get()(l) : i;
@@ -600,14 +600,14 @@ class Ue {
600
600
  e.removeEventListener(u, a);
601
601
  });
602
602
  }
603
- } else if (s === "onClickOutside" || s === "onclickoutside") {
603
+ } else if (n === "onClickOutside" || n === "onclickoutside") {
604
604
  const o = (a) => {
605
605
  this.canClickAway && !e.contains(a.target) && (p(i) ? i.get()(a) : i(a));
606
606
  }, u = { capture: !0 };
607
607
  window.addEventListener("click", o, u), this.stopCallbacks.push(() => {
608
608
  window.removeEventListener("click", o, u);
609
609
  });
610
- } else if (s === "$$value") {
610
+ } else if (n === "$$value") {
611
611
  if (!R(i))
612
612
  throw new TypeError(`$$value attribute must be a settable state. Got: ${i}`);
613
613
  this.attachProp(
@@ -624,38 +624,38 @@ class Ue {
624
624
  e.addEventListener("input", o), this.stopCallbacks.push(() => {
625
625
  e.removeEventListener("input", o);
626
626
  });
627
- } else if (Pe(s)) {
628
- const o = s.slice(2).toLowerCase(), u = p(i) ? (a) => i.get()(a) : i;
627
+ } else if (Pe(n)) {
628
+ const o = n.slice(2).toLowerCase(), u = p(i) ? (a) => i.get()(a) : i;
629
629
  e.addEventListener(o, u), this.stopCallbacks.push(() => {
630
630
  e.removeEventListener(o, u);
631
631
  });
632
- } else if (s.includes("-"))
632
+ } else if (n.includes("-"))
633
633
  this.attachProp(
634
634
  i,
635
635
  (o) => {
636
- o == null ? e.removeAttribute(s) : e.setAttribute(s, String(o));
636
+ o == null ? e.removeAttribute(n) : e.setAttribute(n, String(o));
637
637
  },
638
- this.getUpdateKey("attr", s)
638
+ this.getUpdateKey("attr", n)
639
639
  );
640
- else if (!Fe.includes(s))
640
+ else if (!Fe.includes(n))
641
641
  if (this.elementContext.isSVG)
642
642
  this.attachProp(
643
643
  i,
644
644
  (o) => {
645
- o != null ? e.setAttribute(s, String(t[s])) : e.removeAttribute(s);
645
+ o != null ? e.setAttribute(n, String(t[n])) : e.removeAttribute(n);
646
646
  },
647
- this.getUpdateKey("attr", s)
647
+ this.getUpdateKey("attr", n)
648
648
  );
649
649
  else
650
- switch (s) {
650
+ switch (n) {
651
651
  case "contentEditable":
652
652
  case "value":
653
653
  this.attachProp(
654
654
  i,
655
655
  (o) => {
656
- e[s] = String(o);
656
+ e[n] = String(o);
657
657
  },
658
- this.getUpdateKey("prop", s)
658
+ this.getUpdateKey("prop", n)
659
659
  );
660
660
  break;
661
661
  case "for":
@@ -682,7 +682,7 @@ class Ue {
682
682
  case "translate":
683
683
  case "type":
684
684
  case "title": {
685
- const o = s.toLowerCase();
685
+ const o = n.toLowerCase();
686
686
  this.attachProp(
687
687
  i,
688
688
  (u) => {
@@ -699,35 +699,35 @@ class Ue {
699
699
  (o) => {
700
700
  typeof o == "string" ? e.autocomplete = o : o ? e.autocomplete = "on" : e.autocomplete = "off";
701
701
  },
702
- this.getUpdateKey("prop", s)
702
+ this.getUpdateKey("prop", n)
703
703
  );
704
704
  break;
705
705
  default: {
706
706
  this.attachProp(
707
707
  i,
708
708
  (o) => {
709
- e[s] = o;
709
+ e[n] = o;
710
710
  },
711
- this.getUpdateKey("prop", s)
711
+ this.getUpdateKey("prop", n)
712
712
  );
713
713
  break;
714
714
  }
715
715
  }
716
716
  }
717
717
  }
718
- applyStyles(e, t, s) {
718
+ applyStyles(e, t, n) {
719
719
  const i = [];
720
720
  if (p(t)) {
721
721
  let o;
722
722
  const u = t.watch((a) => {
723
723
  this.elementContext.root.render.write(
724
724
  () => {
725
- x(o) && o(), e.style.cssText = "", o = this.applyStyles(e, a, s);
725
+ x(o) && o(), e.style.cssText = "", o = this.applyStyles(e, a, n);
726
726
  },
727
727
  this.getUpdateKey("styles", "*")
728
728
  );
729
729
  });
730
- s.push(u), i.push(u);
730
+ n.push(u), i.push(u);
731
731
  } else {
732
732
  const o = ce(t);
733
733
  for (const u in o) {
@@ -738,28 +738,28 @@ class Ue {
738
738
  h ? e.style.setProperty(u, String(h), l) : e.style.removeProperty(u);
739
739
  });
740
740
  });
741
- s.push(c), i.push(c);
741
+ n.push(c), i.push(c);
742
742
  } else a != null && e.style.setProperty(u, String(a));
743
743
  }
744
744
  }
745
745
  return function() {
746
746
  for (const u of i)
747
- u(), s.splice(s.indexOf(u), 1);
747
+ u(), n.splice(n.indexOf(u), 1);
748
748
  };
749
749
  }
750
- applyClasses(e, t, s) {
750
+ applyClasses(e, t, n) {
751
751
  const i = [];
752
752
  if (p(t)) {
753
753
  let o;
754
754
  const u = t.watch((a) => {
755
755
  this.elementContext.root.render.write(
756
756
  () => {
757
- x(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, a, s);
757
+ x(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, a, n);
758
758
  },
759
759
  this.getUpdateKey("attr", "class")
760
760
  );
761
761
  });
762
- s.push(u), i.push(u);
762
+ n.push(u), i.push(u);
763
763
  } else {
764
764
  const o = le(t);
765
765
  for (const u in o) {
@@ -770,56 +770,56 @@ class Ue {
770
770
  c ? e.classList.add(u) : e.classList.remove(u);
771
771
  });
772
772
  });
773
- s.push(l), i.push(l);
773
+ n.push(l), i.push(l);
774
774
  } else a && e.classList.add(u);
775
775
  }
776
776
  }
777
777
  return function() {
778
778
  for (const u of i)
779
- u(), s.splice(s.indexOf(u), 1);
779
+ u(), n.splice(n.indexOf(u), 1);
780
780
  };
781
781
  }
782
782
  }
783
- function le(n) {
783
+ function le(s) {
784
784
  let e = {};
785
- if ($(n)) {
786
- const t = n.split(" ");
787
- for (const s of t)
788
- e[s] = !0;
789
- } else W(n) ? Object.assign(e, n) : Array.isArray(n) && Array.from(n).filter(Boolean).forEach((t) => {
785
+ if ($(s)) {
786
+ const t = s.split(" ");
787
+ for (const n of t)
788
+ e[n] = !0;
789
+ } else W(s) ? Object.assign(e, s) : Array.isArray(s) && Array.from(s).filter(Boolean).forEach((t) => {
790
790
  Object.assign(e, le(t));
791
791
  });
792
792
  return delete e.undefined, e;
793
793
  }
794
- function ce(n) {
794
+ function ce(s) {
795
795
  let e = {};
796
- if ($(n)) {
797
- const t = n.split(";").filter((s) => s.trim() !== "");
798
- for (const s of t) {
799
- const [i, o] = s.split(":"), u = {
796
+ if ($(s)) {
797
+ const t = s.split(";").filter((n) => n.trim() !== "");
798
+ for (const n of t) {
799
+ const [i, o] = n.split(":"), u = {
800
800
  value: o
801
801
  };
802
802
  o.includes("!important") ? (u.priority = "important", u.value = o.replace("!important", "").trim()) : u.value = o.trim(), e[Q(i.trim())] = u;
803
803
  }
804
804
  }
805
- if (W(n))
806
- for (const t in n)
807
- t.startsWith("--") ? e[t] = { value: n[t] } : e[Q(t)] = { value: n[t] };
808
- else Array.isArray(n) && Array.from(n).filter((t) => t != null).forEach((t) => {
805
+ if (W(s))
806
+ for (const t in s)
807
+ t.startsWith("--") ? e[t] = { value: s[t] } : e[Q(t)] = { value: s[t] };
808
+ else Array.isArray(s) && Array.from(s).filter((t) => t != null).forEach((t) => {
809
809
  Object.assign(e, ce(t));
810
810
  });
811
811
  return e;
812
812
  }
813
- function Q(n) {
814
- return n.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, t) => (t ? "-" : "") + e.toLowerCase());
813
+ function Q(s) {
814
+ return s.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, t) => (t ? "-" : "") + e.toLowerCase());
815
815
  }
816
- function We(n, e) {
817
- const t = typeof n;
816
+ function We(s, e) {
817
+ const t = typeof s;
818
818
  return t === "string" ? String(e) : t === "number" ? Number(e) : t === "boolean" ? !!e : e;
819
819
  }
820
820
  const Fe = ["ref", "children", "class", "style", "data"];
821
821
  class qe {
822
- constructor({ states: e, renderFn: t, elementContext: s }) {
822
+ constructor({ states: e, renderFn: t, elementContext: n }) {
823
823
  r(this, "node");
824
824
  r(this, "endNode");
825
825
  r(this, "connectedViews", []);
@@ -827,7 +827,7 @@ class qe {
827
827
  r(this, "elementContext");
828
828
  r(this, "observerControls");
829
829
  r(this, "watcher", K());
830
- this.elementContext = s, this.renderFn = t, this.node = document.createComment("Observer"), this.endNode = document.createComment("/Observer");
830
+ this.elementContext = n, this.renderFn = t, this.node = document.createComment("Observer"), this.endNode = document.createComment("/Observer");
831
831
  let i;
832
832
  this.observerControls = {
833
833
  start: () => {
@@ -851,22 +851,22 @@ class qe {
851
851
  mount(e, t) {
852
852
  this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.observerControls.start());
853
853
  }
854
- unmount() {
855
- var e;
856
- this.observerControls.stop(), this.watcher.stopAll(), this.isMounted && (this.cleanup(), (e = this.node.parentNode) == null || e.removeChild(this.node));
854
+ unmount(e) {
855
+ var t;
856
+ this.observerControls.stop(), this.watcher.stopAll(), this.isMounted && (this.cleanup(e), (t = this.node.parentNode) == null || t.removeChild(this.node));
857
857
  }
858
- cleanup() {
859
- var e;
858
+ cleanup(e) {
859
+ var t;
860
860
  for (; this.connectedViews.length > 0; )
861
- (e = this.connectedViews.pop()) == null || e.unmount();
861
+ (t = this.connectedViews.pop()) == null || t.unmount(e);
862
862
  }
863
863
  update(...e) {
864
- var s, i;
865
- if (this.cleanup(), e == null || !this.isMounted)
864
+ var n, i;
865
+ if (this.cleanup(!1), e == null || !this.isMounted)
866
866
  return;
867
867
  const t = e.map((o) => he(o) ? o : N(o) ? E(C(this.elementContext, o)) : E(C(this.elementContext, V(o))));
868
868
  for (const o of t) {
869
- const u = ((s = this.connectedViews.at(-1)) == null ? void 0 : s.node) || this.node;
869
+ const u = ((n = this.connectedViews.at(-1)) == null ? void 0 : n.node) || this.node;
870
870
  o.mount(this.node.parentNode, u), this.connectedViews.push(o);
871
871
  }
872
872
  if (this.elementContext.root.getEnv() === "development") {
@@ -890,29 +890,29 @@ class Le {
890
890
  return ((e = this.node) == null ? void 0 : e.parentNode) != null;
891
891
  }
892
892
  mount(e, t) {
893
- this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.stopCallback = this.$children.watch((s) => {
894
- this.update(s);
893
+ this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.stopCallback = this.$children.watch((n) => {
894
+ this.update(n);
895
895
  }));
896
896
  }
897
- unmount() {
898
- var e;
897
+ unmount(e) {
898
+ var t;
899
899
  if (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.isMounted) {
900
- for (const t of this.mountedChildren)
901
- t.unmount();
902
- this.mountedChildren = [], (e = this.endNode.parentNode) == null || e.removeChild(this.endNode);
900
+ for (const n of this.mountedChildren)
901
+ n.unmount(e);
902
+ this.mountedChildren = [], (t = this.endNode.parentNode) == null || t.removeChild(this.endNode);
903
903
  }
904
904
  }
905
905
  update(e) {
906
- var t, s, i;
906
+ var t, n, i;
907
907
  for (const o of this.mountedChildren)
908
- o.unmount();
908
+ o.unmount(!1);
909
909
  for (let o = 0; o < e.length; o++) {
910
910
  const u = e[o], a = o > 0 ? e[o] : void 0;
911
911
  u.mount(this.node.parentElement, a == null ? void 0 : a.node);
912
912
  }
913
913
  this.mountedChildren = e, this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Outlet (${e.length} ${e.length === 1 ? "child" : "children"})`, (i = this.node.parentElement) == null || i.insertBefore(
914
914
  this.endNode,
915
- ((s = (t = this.mountedChildren[this.mountedChildren.length - 1]) == null ? void 0 : t.node) == null ? void 0 : s.nextSibling) ?? null
915
+ ((n = (t = this.mountedChildren[this.mountedChildren.length - 1]) == null ? void 0 : t.node) == null ? void 0 : n.nextSibling) ?? null
916
916
  ));
917
917
  }
918
918
  }
@@ -926,12 +926,12 @@ class Ie {
926
926
  return this.element ? this.element.isMounted : !1;
927
927
  }
928
928
  mount(e, t) {
929
- const { content: s, parent: i } = this.config;
930
- he(s) ? this.element = s : N(s) ? this.element = E(C(this.config.elementContext, s)) : this.element = E(C(this.config.elementContext, V(s))), this.element.mount(i);
929
+ const { content: n, parent: i } = this.config;
930
+ he(n) ? this.element = n : N(n) ? this.element = E(C(this.config.elementContext, n)) : this.element = E(C(this.config.elementContext, V(n))), this.element.mount(i);
931
931
  }
932
- unmount() {
933
- var e;
934
- (e = this.element) != null && e.isMounted && this.element.unmount();
932
+ unmount(e) {
933
+ var t;
934
+ (t = this.element) != null && t.isMounted && this.element.unmount(e);
935
935
  }
936
936
  }
937
937
  class Ge {
@@ -939,8 +939,8 @@ class Ge {
939
939
  r(this, "__view");
940
940
  this.__view = e;
941
941
  const t = Object.getOwnPropertyDescriptors(this.__view._logger);
942
- for (const s in t)
943
- s !== "getName" && Object.defineProperty(this, s, t[s]);
942
+ for (const n in t)
943
+ n !== "getName" && Object.defineProperty(this, n, t[n]);
944
944
  }
945
945
  get uid() {
946
946
  return this.__view.uniqueId;
@@ -968,10 +968,10 @@ class Ge {
968
968
  let t = this.__view._elementContext;
969
969
  for (; e.push(t.data), t.parent; )
970
970
  t = t.parent;
971
- const s = {};
971
+ const n = {};
972
972
  for (const i of e.reverse())
973
- Object.assign(s, i);
974
- return s;
973
+ Object.assign(n, i);
974
+ return n;
975
975
  }
976
976
  beforeMount(e) {
977
977
  this.__view._beforeMountCallbacks.push(e);
@@ -986,13 +986,13 @@ class Ge {
986
986
  this.__view._onUnmountCallbacks.push(e);
987
987
  }
988
988
  watch(e, t) {
989
- const s = this.__view;
990
- if (s.isMounted)
991
- return s._watcher.watch(e, t);
989
+ const n = this.__view;
990
+ if (n.isMounted)
991
+ return n._watcher.watch(e, t);
992
992
  {
993
993
  let i, o = !1;
994
- return s._onMountCallbacks.push(() => {
995
- o || (i = s._watcher.watch(e, t));
994
+ return n._onMountCallbacks.push(() => {
995
+ o || (i = n._watcher.watch(e, t));
996
996
  }), () => {
997
997
  i != null && (o = !0, i());
998
998
  };
@@ -1003,7 +1003,7 @@ class Ge {
1003
1003
  }
1004
1004
  }
1005
1005
  class q {
1006
- constructor(e, t, s, i = []) {
1006
+ constructor(e, t, n, i = []) {
1007
1007
  r(this, "uniqueId", ae());
1008
1008
  r(this, "_elementContext");
1009
1009
  r(this, "_logger");
@@ -1018,7 +1018,7 @@ class q {
1018
1018
  r(this, "_beforeUnmountCallbacks", []);
1019
1019
  r(this, "_onUnmountCallbacks", []);
1020
1020
  r(this, "isMounted", !1);
1021
- this._elementContext = { ...e, data: {}, parent: e }, this._logger = e.root.createLogger(t.name, { uid: this.uniqueId }), this._view = t, this._props = s;
1021
+ this._elementContext = { ...e, data: {}, parent: e }, this._logger = e.root.createLogger(t.name, { uid: this.uniqueId }), this._view = t, this._props = n;
1022
1022
  const [o, u] = I(C(e, i));
1023
1023
  this._$children = o, this._setChildren = u;
1024
1024
  }
@@ -1030,19 +1030,19 @@ class q {
1030
1030
  return (e = this._element) == null ? void 0 : e.node;
1031
1031
  }
1032
1032
  mount(e, t) {
1033
- const s = this.isMounted;
1034
- if (!s)
1033
+ const n = this.isMounted;
1034
+ if (!n)
1035
1035
  for (this.initialize(); this._beforeMountCallbacks.length > 0; )
1036
1036
  this._beforeMountCallbacks.shift()();
1037
- this._element && this._element.mount(e, t), s || (this.isMounted = !0, requestAnimationFrame(() => {
1037
+ this._element && this._element.mount(e, t), n || (this.isMounted = !0, requestAnimationFrame(() => {
1038
1038
  for (; this._onMountCallbacks.length > 0; )
1039
1039
  this._onMountCallbacks.shift()();
1040
1040
  }));
1041
1041
  }
1042
- unmount() {
1042
+ unmount(e) {
1043
1043
  for (; this._beforeUnmountCallbacks.length > 0; )
1044
1044
  this._beforeUnmountCallbacks.shift()();
1045
- for (this._element && this._element.unmount(), this.isMounted = !1; this._onUnmountCallbacks.length > 0; )
1045
+ for (this._element && this._element.unmount(e), this.isMounted = !1; this._onUnmountCallbacks.length > 0; )
1046
1046
  this._onUnmountCallbacks.shift()();
1047
1047
  this._watcher.stopAll();
1048
1048
  }
@@ -1058,8 +1058,8 @@ class q {
1058
1058
  let t;
1059
1059
  try {
1060
1060
  t = this._view(this._props, e);
1061
- } catch (s) {
1062
- throw s instanceof Error && this._logger.crash(s), s;
1061
+ } catch (n) {
1062
+ throw n instanceof Error && this._logger.crash(n), n;
1063
1063
  }
1064
1064
  if (t !== null) if (t instanceof Node)
1065
1065
  this._element = E(C(this._elementContext, y("$node", { value: t })));
@@ -1067,18 +1067,18 @@ class q {
1067
1067
  this._element = E(C(this._elementContext, t));
1068
1068
  else if (p(t))
1069
1069
  this._element = E(
1070
- C(this._elementContext, y("$observer", { states: [t], renderFn: (s) => s }))
1070
+ C(this._elementContext, y("$observer", { states: [t], renderFn: (n) => n }))
1071
1071
  );
1072
1072
  else {
1073
- const s = new TypeError(
1073
+ const n = new TypeError(
1074
1074
  `Expected '${this._view.name}' function to return a DOM node, Markup element, Readable or null. Got: ${G(t)}`
1075
1075
  );
1076
- this._logger.crash(s);
1076
+ this._logger.crash(n);
1077
1077
  }
1078
1078
  }
1079
1079
  }
1080
1080
  class je {
1081
- constructor({ elementContext: e, $items: t, renderFn: s, keyFn: i }) {
1081
+ constructor({ elementContext: e, $items: t, renderFn: n, keyFn: i }) {
1082
1082
  r(this, "node");
1083
1083
  r(this, "endNode");
1084
1084
  r(this, "$items");
@@ -1087,40 +1087,40 @@ class je {
1087
1087
  r(this, "elementContext");
1088
1088
  r(this, "renderFn");
1089
1089
  r(this, "keyFn");
1090
- this.elementContext = e, this.$items = t, this.renderFn = s, this.keyFn = i, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Repeat"), this.endNode = document.createComment("/Repeat")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
1090
+ this.elementContext = e, this.$items = t, this.renderFn = n, this.keyFn = i, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Repeat"), this.endNode = document.createComment("/Repeat")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
1091
1091
  }
1092
1092
  get isMounted() {
1093
1093
  return this.node.parentNode != null;
1094
1094
  }
1095
1095
  mount(e, t) {
1096
- this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.stopCallback = this.$items.watch((s) => {
1097
- this._update(Array.from(s));
1096
+ this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.stopCallback = this.$items.watch((n) => {
1097
+ this._update(Array.from(n));
1098
1098
  }));
1099
1099
  }
1100
- unmount() {
1101
- var e, t;
1102
- this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.isMounted && ((e = this.node.parentNode) == null || e.removeChild(this.node), (t = this.endNode.parentNode) == null || t.removeChild(this.endNode)), this._cleanup();
1100
+ unmount(e) {
1101
+ var t, n;
1102
+ this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), !e && this.isMounted && ((t = this.node.parentNode) == null || t.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode)), this._cleanup(e);
1103
1103
  }
1104
- _cleanup() {
1105
- for (const e of this.connectedItems)
1106
- e.element.unmount();
1104
+ _cleanup(e) {
1105
+ for (const t of this.connectedItems)
1106
+ t.element.unmount(e);
1107
1107
  this.connectedItems = [];
1108
1108
  }
1109
1109
  _update(e) {
1110
1110
  var o, u, a;
1111
1111
  if (e.length === 0 || !this.isMounted)
1112
- return this._cleanup();
1112
+ return this._cleanup(!1);
1113
1113
  const t = [];
1114
- let s = 0;
1114
+ let n = 0;
1115
1115
  for (const l of e)
1116
1116
  t.push({
1117
- key: this.keyFn(l, s),
1117
+ key: this.keyFn(l, n),
1118
1118
  value: l,
1119
- index: s++
1119
+ index: n++
1120
1120
  });
1121
1121
  const i = [];
1122
1122
  for (const l of this.connectedItems)
1123
- t.find((h) => h.key === l.key) || l.element.unmount();
1123
+ t.find((h) => h.key === l.key) || l.element.unmount(!1);
1124
1124
  for (const l of t) {
1125
1125
  const c = this.connectedItems.find((h) => h.key === l.key);
1126
1126
  if (c)
@@ -1152,8 +1152,8 @@ class je {
1152
1152
  }
1153
1153
  }
1154
1154
  }
1155
- function Be({ $value: n, $index: e, renderFn: t }, s) {
1156
- return t(n, e, s);
1155
+ function Be({ $value: s, $index: e, renderFn: t }, n) {
1156
+ return t(s, e, n);
1157
1157
  }
1158
1158
  class Re {
1159
1159
  constructor({ value: e }) {
@@ -1166,25 +1166,25 @@ class Re {
1166
1166
  return this.node.parentNode != null;
1167
1167
  }
1168
1168
  async mount(e, t = null) {
1169
- this.isMounted || (p(this.value) ? this.stopCallback = this.value.watch((s) => {
1170
- this.update(s);
1169
+ this.isMounted || (p(this.value) ? this.stopCallback = this.value.watch((n) => {
1170
+ this.update(n);
1171
1171
  }) : this.update(this.value)), e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null);
1172
1172
  }
1173
- async unmount() {
1174
- this.isMounted && (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.node.parentNode.removeChild(this.node));
1173
+ async unmount(e) {
1174
+ this.isMounted && (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), e || this.node.parentNode.removeChild(this.node));
1175
1175
  }
1176
1176
  update(e) {
1177
1177
  e != null ? this.node.textContent = e.toString() : this.node.textContent = "";
1178
1178
  }
1179
1179
  }
1180
- function N(n) {
1181
- return W(n) && (typeof n.type == "string" || typeof n.type == "function") && Array.isArray(n.children);
1180
+ function N(s) {
1181
+ return W(s) && (typeof s.type == "string" || typeof s.type == "function") && Array.isArray(s.children);
1182
1182
  }
1183
- function he(n) {
1184
- return W(n) && x(n.connect) && x(n.disconnect);
1183
+ function he(s) {
1184
+ return W(s) && x(s.connect) && x(s.disconnect);
1185
1185
  }
1186
- function V(n) {
1187
- return M(n) || (n = [n]), n.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
1186
+ function V(s) {
1187
+ return M(s) || (s = [s]), s.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
1188
1188
  if (e instanceof Node)
1189
1189
  return y("$node", { value: e });
1190
1190
  if (e instanceof de)
@@ -1201,38 +1201,38 @@ function V(n) {
1201
1201
  throw console.error(e), new TypeError(`Unexpected child type. Got: ${e}`);
1202
1202
  });
1203
1203
  }
1204
- function y(n, e, ...t) {
1204
+ function y(s, e, ...t) {
1205
1205
  return e != null && Ke(e), {
1206
- type: n,
1206
+ type: s,
1207
1207
  props: e,
1208
1208
  children: V(t)
1209
1209
  };
1210
1210
  }
1211
- function Ke(n) {
1212
- if (n.ref && !ue(n.ref))
1213
- throw console.warn(n.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${n.ref}`);
1214
- for (const e in n)
1215
- if (e.startsWith("$$") && n[e] !== void 0) {
1216
- if (!R(n[e]))
1217
- throw new TypeError(`Prop '${e}' is named as a SettableState but value is not. Got: ${n[e]}`);
1218
- } else if (e.startsWith("$") && n[e] !== void 0 && !p(n[e]))
1219
- throw new TypeError(`Prop '${e}' is named as a State but value is not. Got: ${n[e]}`);
1211
+ function Ke(s) {
1212
+ if (s.ref && !ue(s.ref))
1213
+ throw console.warn(s.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${s.ref}`);
1214
+ for (const e in s)
1215
+ if (e.startsWith("$$") && s[e] !== void 0) {
1216
+ if (!R(s[e]))
1217
+ throw new TypeError(`Prop '${e}' is named as a SettableState but value is not. Got: ${s[e]}`);
1218
+ } else if (e.startsWith("$") && s[e] !== void 0 && !p(s[e]))
1219
+ throw new TypeError(`Prop '${e}' is named as a State but value is not. Got: ${s[e]}`);
1220
1220
  }
1221
1221
  const nt = Ve.bind(y);
1222
- function st(n, e, t) {
1223
- const s = F(n);
1222
+ function st(s, e, t) {
1223
+ const n = F(s);
1224
1224
  return y("$cond", {
1225
- $predicate: s,
1225
+ $predicate: n,
1226
1226
  thenContent: e,
1227
1227
  elseContent: t
1228
1228
  });
1229
1229
  }
1230
- function it(n, e, t) {
1231
- const s = F(n);
1232
- return y("$repeat", { $items: s, keyFn: e, renderFn: t });
1230
+ function it(s, e, t) {
1231
+ const n = F(s);
1232
+ return y("$repeat", { $items: n, keyFn: e, renderFn: t });
1233
1233
  }
1234
- function ot(n, e) {
1235
- return y("$portal", { parent: n, content: e });
1234
+ function ot(s, e) {
1235
+ return y("$portal", { parent: s, content: e });
1236
1236
  }
1237
1237
  class de {
1238
1238
  constructor(e) {
@@ -1249,80 +1249,80 @@ class de {
1249
1249
  this.node.parentNode && this.node.parentNode.removeChild(this.node);
1250
1250
  }
1251
1251
  }
1252
- function C(n, e) {
1253
- return (M(e) ? e : [e]).map((s) => {
1254
- if (x(s.type))
1255
- return new q(n, s.type, s.props, s.children);
1256
- if ($(s.type))
1257
- switch (s.type) {
1252
+ function C(s, e) {
1253
+ return (M(e) ? e : [e]).map((n) => {
1254
+ if (x(n.type))
1255
+ return new q(s, n.type, n.props, n.children);
1256
+ if ($(n.type))
1257
+ switch (n.type) {
1258
1258
  case "$node": {
1259
- const i = s.props;
1259
+ const i = n.props;
1260
1260
  return new de(i.value);
1261
1261
  }
1262
1262
  case "$text": {
1263
- const i = s.props;
1263
+ const i = n.props;
1264
1264
  return new Re({
1265
1265
  value: i.value
1266
1266
  });
1267
1267
  }
1268
1268
  case "$cond": {
1269
- const i = s.props;
1269
+ const i = n.props;
1270
1270
  return new Te({
1271
1271
  $predicate: i.$predicate,
1272
1272
  thenContent: i.thenContent,
1273
1273
  elseContent: i.elseContent,
1274
- elementContext: n
1274
+ elementContext: s
1275
1275
  });
1276
1276
  }
1277
1277
  case "$repeat": {
1278
- const i = s.props;
1278
+ const i = n.props;
1279
1279
  return new je({
1280
1280
  $items: i.$items,
1281
1281
  keyFn: i.keyFn,
1282
1282
  renderFn: i.renderFn,
1283
- elementContext: n
1283
+ elementContext: s
1284
1284
  });
1285
1285
  }
1286
1286
  case "$observer": {
1287
- const i = s.props;
1287
+ const i = n.props;
1288
1288
  return new qe({
1289
1289
  states: i.states,
1290
1290
  renderFn: i.renderFn,
1291
- elementContext: n
1291
+ elementContext: s
1292
1292
  });
1293
1293
  }
1294
1294
  case "$outlet": {
1295
- const i = s.props;
1295
+ const i = n.props;
1296
1296
  return new Le({
1297
1297
  $children: i.$children,
1298
- elementContext: n
1298
+ elementContext: s
1299
1299
  });
1300
1300
  }
1301
1301
  case "$portal": {
1302
- const i = s.props;
1302
+ const i = n.props;
1303
1303
  return new Ie({
1304
1304
  content: i.content,
1305
1305
  parent: i.parent,
1306
- elementContext: n
1306
+ elementContext: s
1307
1307
  });
1308
1308
  }
1309
1309
  default:
1310
- if (s.type.startsWith("$"))
1311
- throw new Error(`Unknown markup type: ${s.type}`);
1310
+ if (n.type.startsWith("$"))
1311
+ throw new Error(`Unknown markup type: ${n.type}`);
1312
1312
  return new Ue({
1313
- tag: s.type,
1314
- props: s.props ?? {},
1315
- children: s.children,
1316
- elementContext: n
1313
+ tag: n.type,
1314
+ props: n.props ?? {},
1315
+ children: n.children,
1316
+ elementContext: s
1317
1317
  });
1318
1318
  }
1319
1319
  else
1320
- throw new TypeError(`Expected a string or view function. Got: ${s.type}`);
1320
+ throw new TypeError(`Expected a string or view function. Got: ${n.type}`);
1321
1321
  });
1322
1322
  }
1323
- function E(n) {
1324
- if (n.length === 1)
1325
- return n[0];
1323
+ function E(s) {
1324
+ if (s.length === 1)
1325
+ return s[0];
1326
1326
  const e = document.createComment("Fragment");
1327
1327
  let t = !1;
1328
1328
  return {
@@ -1332,29 +1332,29 @@ function E(n) {
1332
1332
  get isMounted() {
1333
1333
  return t;
1334
1334
  },
1335
- mount(s, i) {
1335
+ mount(n, i) {
1336
1336
  var o;
1337
- s.insertBefore(e, i || null);
1338
- for (const u of n) {
1339
- const a = ((o = n[n.length - 1]) == null ? void 0 : o.node) ?? e;
1340
- u.mount(s, a);
1337
+ n.insertBefore(e, i || null);
1338
+ for (const u of s) {
1339
+ const a = ((o = s[s.length - 1]) == null ? void 0 : o.node) ?? e;
1340
+ u.mount(n, a);
1341
1341
  }
1342
1342
  t = !0;
1343
1343
  },
1344
- unmount() {
1344
+ unmount(n) {
1345
1345
  if (t) {
1346
- for (const s of n)
1347
- s.unmount();
1346
+ for (const i of s)
1347
+ i.unmount(!0);
1348
1348
  e.remove();
1349
1349
  }
1350
1350
  t = !1;
1351
1351
  }
1352
1352
  };
1353
1353
  }
1354
- function fe(n) {
1355
- return n == null || n === !1 || typeof n == "string" || typeof n == "number" || N(n) || p(n) || ie(fe, n);
1354
+ function fe(s) {
1355
+ return s == null || s === !1 || typeof s == "string" || typeof s == "number" || N(s) || p(s) || ie(fe, s);
1356
1356
  }
1357
- function rt(n, e) {
1357
+ function rt(s, e) {
1358
1358
  return e.outlet();
1359
1359
  }
1360
1360
  export {
@@ -1390,4 +1390,4 @@ export {
1390
1390
  E as y,
1391
1391
  C as z
1392
1392
  };
1393
- //# sourceMappingURL=passthrough-DcOD0Wf3.js.map
1393
+ //# sourceMappingURL=passthrough-DrILnMr2.js.map