@manyducks.co/dolla 2.0.0-alpha.3 → 2.0.0-alpha.5

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,63 +1,63 @@
1
- var ue = Object.defineProperty;
2
- var ce = (t, e, n) => e in t ? ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var f = (t, e, n) => ce(t, typeof e != "symbol" ? e + "" : e, n);
4
- function le(t) {
1
+ var ce = Object.defineProperty;
2
+ var le = (t, e, n) => e in t ? ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var f = (t, e, n) => le(t, typeof e != "symbol" ? e + "" : e, n);
4
+ function ae(t) {
5
5
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
6
6
  }
7
- var j = { exports: {} }, W;
8
- function ae() {
7
+ var U = { exports: {} }, W;
8
+ function de() {
9
9
  return W || (W = 1, function(t, e) {
10
10
  Object.defineProperty(e, "__esModule", { value: !0 });
11
11
  var n = /* @__PURE__ */ function() {
12
- function u(l, d) {
13
- var h = [], C = !0, w = !1, k = void 0;
12
+ function u(a, d) {
13
+ var h = [], b = !0, w = !1, v = void 0;
14
14
  try {
15
- for (var $, v = l[Symbol.iterator](); !(C = ($ = v.next()).done) && (h.push($.value), !(d && h.length === d)); C = !0) ;
15
+ for (var $, k = a[Symbol.iterator](); !(b = ($ = k.next()).done) && (h.push($.value), !(d && h.length === d)); b = !0) ;
16
16
  } catch (m) {
17
- w = !0, k = m;
17
+ w = !0, v = m;
18
18
  } finally {
19
19
  try {
20
- !C && v.return && v.return();
20
+ !b && k.return && k.return();
21
21
  } finally {
22
- if (w) throw k;
22
+ if (w) throw v;
23
23
  }
24
24
  }
25
25
  return h;
26
26
  }
27
- return function(l, d) {
28
- if (Array.isArray(l)) return l;
29
- if (Symbol.iterator in Object(l)) return u(l, d);
27
+ return function(a, d) {
28
+ if (Array.isArray(a)) return a;
29
+ if (Symbol.iterator in Object(a)) return u(a, d);
30
30
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
31
31
  };
32
32
  }(), o = function(u) {
33
- return u.reduce(function(l, d) {
34
- return 16 > d ? l + "0" + d.toString(16) : l + d.toString(16);
33
+ return u.reduce(function(a, d) {
34
+ return 16 > d ? a + "0" + d.toString(16) : a + d.toString(16);
35
35
  }, "#");
36
- }, r = function(u, l, d) {
37
- var h = 0.5 > d ? d * (1 + l) : d + l - d * l, C = 2 * d - h, w = function(m, p, a) {
38
- var y = Math.round, g = 0 > a ? a + 1 : 1 < a ? a - 1 : a;
36
+ }, r = function(u, a, d) {
37
+ var h = 0.5 > d ? d * (1 + a) : d + a - d * a, b = 2 * d - h, w = function(m, p, l) {
38
+ var y = Math.round, g = 0 > l ? l + 1 : 1 < l ? l - 1 : l;
39
39
  return g = g < 1 / 6 ? m + 6 * (p - m) * g : g < 1 / 2 ? p : g < 2 / 3 ? m + 6 * (p - m) * (2 / 3 - g) : m, y(255 * g);
40
- }, k = w(C, h, u + 1 / 3), $ = w(C, h, u), v = w(C, h, u - 1 / 3);
41
- return [k, $, v];
42
- }, s = function(u, l, d, h) {
43
- var C = u % 1007 / 1007, w = function(m, p, a) {
44
- return m * (a - p) + p;
45
- }, k = w(C, l.min, l.max), $ = w(C, d.min, d.max), v = w(C, h.max, h.min);
46
- return [k, $, v];
47
- }, i = function(u) {
48
- return u.split("").reduce(function(l, d, h) {
49
- return l * d.charCodeAt(0) * h + 1;
40
+ }, v = w(b, h, u + 1 / 3), $ = w(b, h, u), k = w(b, h, u - 1 / 3);
41
+ return [v, $, k];
42
+ }, i = function(u, a, d, h) {
43
+ var b = u % 1007 / 1007, w = function(m, p, l) {
44
+ return m * (l - p) + p;
45
+ }, v = w(b, a.min, a.max), $ = w(b, d.min, d.max), k = w(b, h.max, h.min);
46
+ return [v, $, k];
47
+ }, s = function(u) {
48
+ return u.split("").reduce(function(a, d, h) {
49
+ return a * d.charCodeAt(0) * h + 1;
50
50
  }, 1);
51
51
  }, c = function(u) {
52
- var l = u.str, d = u.hue, h = d === void 0 ? { min: 0, max: 360 } : d, C = u.sat, w = C === void 0 ? { min: 0.35, max: 0.65 } : C, k = u.light, $ = k === void 0 ? { min: 0.3, max: 0.7 } : k, v = u.hashFunction, m = v === void 0 ? i : v, p = u.scheme, a = p === void 0 ? "hex" : p, y = s(m(l), h, w, $), g = n(y, 3), S = g[0], F = g[1], B = g[2], K = r(S / 360, F, B), ie = o(K);
53
- return a === "hsl" ? [S, F, B] : a === "rgb" ? K : ie;
52
+ var a = u.str, d = u.hue, h = d === void 0 ? { min: 0, max: 360 } : d, b = u.sat, w = b === void 0 ? { min: 0.35, max: 0.65 } : b, v = u.light, $ = v === void 0 ? { min: 0.3, max: 0.7 } : v, k = u.hashFunction, m = k === void 0 ? s : k, p = u.scheme, l = p === void 0 ? "hex" : p, y = i(m(a), h, w, $), g = n(y, 3), x = g[0], F = g[1], B = g[2], K = r(x / 360, F, B), ue = o(K);
53
+ return l === "hsl" ? [x, F, B] : l === "rgb" ? K : ue;
54
54
  };
55
55
  e.default = c, t.exports = e.default;
56
- }(j, j.exports)), j.exports;
56
+ }(U, U.exports)), U.exports;
57
57
  }
58
- var de = ae();
59
- const fe = /* @__PURE__ */ le(de);
60
- function q(t) {
58
+ var fe = de();
59
+ const he = /* @__PURE__ */ ae(fe);
60
+ function G(t) {
61
61
  if (t === void 0)
62
62
  return "undefined";
63
63
  if (t === null)
@@ -67,9 +67,9 @@ function q(t) {
67
67
  case "number":
68
68
  return isNaN(t) ? "NaN" : "number";
69
69
  case "function":
70
- return Y(t) ? "class" : e;
70
+ return Z(t) ? "class" : e;
71
71
  case "object":
72
- return P(t) ? "array" : he(t) ? "promise" : e;
72
+ return P(t) ? "array" : me(t) ? "promise" : e;
73
73
  default:
74
74
  return e;
75
75
  }
@@ -77,42 +77,42 @@ function q(t) {
77
77
  function P(t) {
78
78
  return Array.isArray(t);
79
79
  }
80
- function z(...t) {
80
+ function D(...t) {
81
81
  const e = t[0], n = (o) => P(o) && o.every((r) => e(r));
82
82
  return t.length < 2 ? n : n(t[1]);
83
83
  }
84
- function Oe(...t) {
85
- const e = t[0], n = A(t[2]) ? t[2] : "Expected an array of valid items. Got type: %t, value: %v", o = (r) => {
86
- if (P(r) && r.every((s) => e(s)))
84
+ function Fe(...t) {
85
+ const e = t[0], n = M(t[2]) ? t[2] : "Expected an array of valid items. Got type: %t, value: %v", o = (r) => {
86
+ if (P(r) && r.every((i) => e(i)))
87
87
  return !0;
88
88
  throw new TypeError(_(r, n));
89
89
  };
90
90
  return t.length < 2 ? o : o(t[1]);
91
91
  }
92
- function A(t) {
92
+ function M(t) {
93
93
  return typeof t == "string";
94
94
  }
95
- function Ve(t, e) {
96
- if (A(t))
95
+ function je(t, e) {
96
+ if (M(t))
97
97
  return !0;
98
98
  throw new TypeError(_(t, e ?? "Expected a string. Got type: %t, value: %v"));
99
99
  }
100
100
  function E(t) {
101
- return typeof t == "function" && !Y(t);
101
+ return typeof t == "function" && !Z(t);
102
102
  }
103
- function D(t) {
103
+ function pe(t) {
104
104
  return typeof t == "number" && !isNaN(t);
105
105
  }
106
- function he(t) {
106
+ function me(t) {
107
107
  if (t == null) return !1;
108
108
  const e = t;
109
109
  return e instanceof Promise || E(e.then) && E(e.catch) && E(e.finally);
110
110
  }
111
- function Y(t) {
111
+ function Z(t) {
112
112
  return typeof t == "function" && /^\s*class\s+/.test(t.toString());
113
113
  }
114
- function Pe(...t) {
115
- const e = t[0], n = A(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, o = (r) => {
114
+ function Ue(...t) {
115
+ const e = t[0], n = M(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, o = (r) => {
116
116
  if (r instanceof e)
117
117
  return !0;
118
118
  throw new TypeError(_(r, n));
@@ -124,10 +124,10 @@ function L(t) {
124
124
  }
125
125
  function _(t, e) {
126
126
  var r;
127
- const n = q(t), o = ((r = t == null ? void 0 : t.toString) == null ? void 0 : r.call(t)) || String(t);
127
+ const n = G(t), o = ((r = t == null ? void 0 : t.toString) == null ? void 0 : r.call(t)) || String(t);
128
128
  return e.replaceAll("%t", n).replaceAll("%v", o);
129
129
  }
130
- const Fe = () => {
130
+ const Ie = () => {
131
131
  };
132
132
  function H(t) {
133
133
  return t != null && typeof t == "object" && !Array.isArray(t) && Object.getPrototypeOf(t) === Object.getPrototypeOf({});
@@ -135,7 +135,7 @@ function H(t) {
135
135
  function I(t, e) {
136
136
  if (t === e)
137
137
  return !0;
138
- if (b(t) || b(e))
138
+ if (C(t) || C(e))
139
139
  return !1;
140
140
  if (H(t) && H(e)) {
141
141
  const n = Object.keys(t), o = Object.keys(e);
@@ -156,29 +156,29 @@ function I(t, e) {
156
156
  }
157
157
  return t === e;
158
158
  }
159
- function pe(t, e) {
159
+ function ye(t, e) {
160
160
  const n = (o) => {
161
161
  const r = {};
162
- for (const s in o)
163
- t.includes(s) || (r[s] = o[s]);
162
+ for (const i in o)
163
+ t.includes(i) || (r[i] = o[i]);
164
164
  return r;
165
165
  };
166
166
  return e == null ? n : n(e);
167
167
  }
168
- function Ue() {
168
+ function Le() {
169
169
  if (typeof window < "u" && window.console)
170
170
  return window.console;
171
171
  if (typeof global < "u" && global.console)
172
172
  return global.console;
173
173
  }
174
- function je(t) {
175
- return fe({
174
+ function qe(t) {
175
+ return he({
176
176
  str: t,
177
177
  sat: { min: 0.35, max: 0.55 },
178
178
  light: { min: 0.6, max: 0.6 }
179
179
  });
180
180
  }
181
- function Ie(t) {
181
+ function Ge(t) {
182
182
  if (t instanceof RegExp)
183
183
  return (o) => t.test(o);
184
184
  const e = {
@@ -189,49 +189,49 @@ function Ie(t) {
189
189
  let r = "positive";
190
190
  o.startsWith("-") && (r = "negative", o = o.slice(1)), o === "*" ? e[r].push(function() {
191
191
  return !0;
192
- }) : o.endsWith("*") ? e[r].push(function(s) {
193
- return s.startsWith(o.slice(0, o.length - 1));
194
- }) : e[r].push(function(s) {
195
- return s === o;
192
+ }) : o.endsWith("*") ? e[r].push(function(i) {
193
+ return i.startsWith(o.slice(0, o.length - 1));
194
+ }) : e[r].push(function(i) {
195
+ return i === o;
196
196
  });
197
197
  }
198
198
  return function(o) {
199
- const { positive: r, negative: s } = e;
200
- return !(s.some((i) => i(o)) || r.length > 0 && !r.some((i) => i(o)));
199
+ const { positive: r, negative: i } = e;
200
+ return !(i.some((s) => s(o)) || r.length > 0 && !r.some((s) => s(o)));
201
201
  };
202
202
  }
203
- function b(t) {
203
+ function C(t) {
204
204
  return !(t == null || typeof t != "object" || typeof t.get != "function" || typeof t.watch != "function");
205
205
  }
206
- function Z(t) {
206
+ function Y(t) {
207
207
  return !(t == null || typeof t != "object" || typeof t.set != "function" || typeof t.get != "function" || typeof t.watch != "function");
208
208
  }
209
- function T(t) {
210
- return b(t) ? t.get() : t;
209
+ function O(t) {
210
+ return C(t) ? t.get() : t;
211
211
  }
212
212
  function J(t) {
213
- return b(t) ? t : R(t);
213
+ return C(t) ? t : R(t);
214
214
  }
215
- function Le(t, e) {
216
- const [n, o] = O(t, e);
215
+ function _e(t, e) {
216
+ const [n, o] = T(t, e);
217
217
  return {
218
218
  get: n.get,
219
219
  watch: n.watch,
220
220
  set: o
221
221
  };
222
222
  }
223
- function Ge(t, e) {
223
+ function Re(t, e) {
224
224
  return {
225
225
  get: t.get,
226
226
  watch: t.watch,
227
227
  set: e
228
228
  };
229
229
  }
230
- function qe(t, e) {
230
+ function Be(t, e) {
231
231
  return function(o) {
232
232
  const r = t.get();
233
- let s;
234
- typeof o == "function" ? s = o(r) : s = o, e(s, r);
233
+ let i;
234
+ typeof o == "function" ? i = o(r) : i = o, e(i, r);
235
235
  };
236
236
  }
237
237
  function R(t) {
@@ -245,111 +245,111 @@ function R(t) {
245
245
  }
246
246
  };
247
247
  }
248
- function O(t, e) {
248
+ function T(t, e) {
249
249
  let n = t, o = [];
250
250
  function r() {
251
251
  for (const u of o)
252
252
  u(n);
253
253
  }
254
- function s(u, l) {
255
- return e != null && e.equality ? e.equality(u, l) : I(u, l);
254
+ function i(u, a) {
255
+ return e != null && e.equality ? e.equality(u, a) : I(u, a);
256
256
  }
257
- const i = {
257
+ const s = {
258
258
  get() {
259
- return T(n);
259
+ return O(n);
260
260
  },
261
- watch(u, l) {
262
- return o.push(u), l != null && l.lazy || u(i.get()), function() {
261
+ watch(u, a) {
262
+ return o.push(u), a != null && a.lazy || u(s.get()), function() {
263
263
  o.splice(o.indexOf(u), 1);
264
264
  };
265
265
  }
266
266
  };
267
267
  function c(u) {
268
- let l;
269
- typeof u == "function" ? l = u(n) : l = u, s(l, n) || (n = l, r());
268
+ let a;
269
+ typeof u == "function" ? a = u(n) : a = u, i(a, n) || (n = a, r());
270
270
  }
271
- return [i, c];
271
+ return [s, c];
272
272
  }
273
- const me = Symbol("EMPTY");
274
- function ye(t, e, n) {
275
- t = t.map((p) => b(p) ? p : R(p));
276
- let o = new Array(t.length).fill(me, 0, t.length), r, s = [], i = !1, c = [], u, l;
273
+ const ge = Symbol("EMPTY");
274
+ function be(t, e, n) {
275
+ t = t.map((p) => C(p) ? p : R(p));
276
+ let o = new Array(t.length).fill(ge, 0, t.length), r, i = [], s = !1, c = [], u, a;
277
277
  function d(p = w()) {
278
- for (const a of s)
279
- a(p);
278
+ for (const l of i)
279
+ l(p);
280
280
  }
281
- function h(p, a) {
282
- return n != null && n.equality ? n.equality(p, a) : I(p, a);
281
+ function h(p, l) {
282
+ return n != null && n.equality ? n.equality(p, l) : I(p, l);
283
283
  }
284
- function C() {
285
- const p = t.map((a) => a.get());
286
- for (let a = 0; a < t.length; a++)
287
- if (!h(p[a], o[a])) {
288
- k(e(...p)), o = p;
284
+ function b() {
285
+ const p = t.map((l) => l.get());
286
+ for (let l = 0; l < t.length; l++)
287
+ if (!h(p[l], o[l])) {
288
+ v(e(...p)), o = p;
289
289
  break;
290
290
  }
291
291
  }
292
292
  function w() {
293
- return i || C(), l = T(r), l;
293
+ return s || b(), a = O(r), a;
294
294
  }
295
- function k(p) {
296
- p !== r && (u && (u(), u = void 0), r = p, l = T(p), b(p) && i && (u = p.watch((a) => {
297
- const y = T(a);
298
- h(y, l) || (l = y, d(y));
295
+ function v(p) {
296
+ p !== r && (u && (u(), u = void 0), r = p, a = O(p), C(p) && s && (u = p.watch((l) => {
297
+ const y = O(l);
298
+ h(y, a) || (a = y, d(y));
299
299
  })));
300
300
  }
301
301
  function $() {
302
302
  let p = [...o];
303
- for (let a = 0; a < t.length; a++) {
304
- const y = t[a];
303
+ for (let l = 0; l < t.length; l++) {
304
+ const y = t[l];
305
305
  c.push(
306
306
  y.watch((g) => {
307
- const S = o[a];
308
- o[a] = g, i && !h(g, S) && (k(e(...o)), d(T(r)));
307
+ const x = o[l];
308
+ o[l] = g, s && !h(g, x) && (v(e(...o)), d(O(r)));
309
309
  })
310
310
  );
311
311
  }
312
- i = !0;
313
- for (let a = 0; a < t.length; a++)
314
- if (!h(o[a], p[a])) {
315
- k(e(...o)), d(T(r));
312
+ s = !0;
313
+ for (let l = 0; l < t.length; l++)
314
+ if (!h(o[l], p[l])) {
315
+ v(e(...o)), d(O(r));
316
316
  break;
317
317
  }
318
318
  }
319
- function v() {
319
+ function k() {
320
320
  for (const p of c)
321
321
  p();
322
- c = [], u && (u(), u = void 0), i = !1;
322
+ c = [], u && (u(), u = void 0), s = !1;
323
323
  }
324
324
  return {
325
325
  get() {
326
326
  return w();
327
327
  },
328
- watch(p, a) {
329
- return i || $(), s.push(p), a != null && a.lazy || p(w()), function() {
330
- s.splice(s.indexOf(p), 1), i && s.length === 0 && v();
328
+ watch(p, l) {
329
+ return s || $(), i.push(p), l != null && l.lazy || p(w()), function() {
330
+ i.splice(i.indexOf(p), 1), s && i.length === 0 && k();
331
331
  };
332
332
  }
333
333
  };
334
334
  }
335
- function G(t, e) {
335
+ function q(t, e) {
336
336
  if (t.length === 0)
337
337
  throw new TypeError("Expected at least one signal.");
338
- if (t.some((n) => !b(n)))
338
+ if (t.some((n) => !C(n)))
339
339
  throw new TypeError("All values must be signals");
340
- return t = t.map((n) => b(n) ? n : R(n)), t.length > 1 ? ye(t, e).watch(() => null) : t[0].watch(e);
340
+ return t = t.map((n) => C(n) ? n : R(n)), t.length > 1 ? be(t, e).watch(() => null) : t[0].watch(e);
341
341
  }
342
- function ge(t) {
343
- for (var e, n, o = arguments, r = 1, s = "", i = "", c = [0], u = function(h) {
344
- r === 1 && (h || (s = s.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? c.push(h ? o[h] : s) : r === 3 && (h || s) ? (c[1] = h ? o[h] : s, r = 2) : r === 2 && s === "..." && h ? c[2] = Object.assign(c[2] || {}, o[h]) : r === 2 && s && !h ? (c[2] = c[2] || {})[s] = !0 : r >= 5 && (r === 5 ? ((c[2] = c[2] || {})[n] = h ? s ? s + o[h] : o[h] : s, r = 6) : (h || s) && (c[2][n] += h ? s + o[h] : s)), s = "";
345
- }, l = 0; l < t.length; l++) {
346
- l && (r === 1 && u(), u(l));
347
- for (var d = 0; d < t[l].length; d++) e = t[l][d], r === 1 ? e === "<" ? (u(), c = [c, "", null], r = 3) : s += e : r === 4 ? s === "--" && e === ">" ? (r = 1, s = "") : s = e + s[0] : i ? e === i ? i = "" : s += e : e === '"' || e === "'" ? i = e : e === ">" ? (u(), r = 1) : r && (e === "=" ? (r = 5, n = s, s = "") : e === "/" && (r < 5 || t[l][d + 1] === ">") ? (u(), r === 3 && (c = c[0]), r = c, (c = c[0]).push(this.apply(null, r.slice(1))), r = 0) : e === " " || e === " " || e === `
348
- ` || e === "\r" ? (u(), r = 2) : s += e), r === 3 && s === "!--" && (r = 4, c = c[0]);
342
+ function Ce(t) {
343
+ for (var e, n, o = arguments, r = 1, i = "", s = "", c = [0], u = function(h) {
344
+ r === 1 && (h || (i = i.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? c.push(h ? o[h] : i) : r === 3 && (h || i) ? (c[1] = h ? o[h] : i, r = 2) : r === 2 && i === "..." && h ? c[2] = Object.assign(c[2] || {}, o[h]) : r === 2 && i && !h ? (c[2] = c[2] || {})[i] = !0 : r >= 5 && (r === 5 ? ((c[2] = c[2] || {})[n] = h ? i ? i + o[h] : o[h] : i, r = 6) : (h || i) && (c[2][n] += h ? i + o[h] : i)), i = "";
345
+ }, a = 0; a < t.length; a++) {
346
+ a && (r === 1 && u(), u(a));
347
+ for (var d = 0; d < t[a].length; d++) e = t[a][d], r === 1 ? e === "<" ? (u(), c = [c, "", null], r = 3) : i += e : r === 4 ? i === "--" && e === ">" ? (r = 1, i = "") : i = e + i[0] : s ? e === s ? s = "" : i += e : e === '"' || e === "'" ? s = e : e === ">" ? (u(), r = 1) : r && (e === "=" ? (r = 5, n = i, i = "") : e === "/" && (r < 5 || t[a][d + 1] === ">") ? (u(), r === 3 && (c = c[0]), r = c, (c = c[0]).push(this.apply(null, r.slice(1))), r = 0) : e === " " || e === " " || e === `
348
+ ` || e === "\r" ? (u(), r = 2) : i += e), r === 3 && i === "!--" && (r = 4, c = c[0]);
349
349
  }
350
350
  return u(), c.length > 2 ? c.slice(1) : c[1];
351
351
  }
352
- class Ce {
352
+ class we {
353
353
  constructor(e) {
354
354
  f(this, "node");
355
355
  f(this, "endNode");
@@ -361,7 +361,7 @@ class Ce {
361
361
  f(this, "elementContext");
362
362
  f(this, "initialUpdateHappened", !1);
363
363
  f(this, "previousValue");
364
- this.$predicate = e.$predicate, this.thenContent = e.thenContent ? U(e.thenContent) : void 0, this.elseContent = e.elseContent ? U(e.elseContent) : void 0, this.elementContext = e.elementContext, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Conditional"), this.endNode = document.createComment("/Conditional")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
364
+ this.$predicate = e.$predicate, this.thenContent = e.thenContent ? j(e.thenContent) : void 0, this.elseContent = e.elseContent ? j(e.elseContent) : void 0, this.elementContext = e.elementContext, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Conditional"), this.endNode = document.createComment("/Conditional")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
365
365
  }
366
366
  get isMounted() {
367
367
  return this.node.parentNode != null;
@@ -383,18 +383,24 @@ class Ce {
383
383
  for (const o of this.connectedContent)
384
384
  o.unmount();
385
385
  if (this.connectedContent = [], this.node.parentNode != null) {
386
- e && this.thenContent ? this.connectedContent = x(this.elementContext, this.thenContent) : !e && this.elseContent && (this.connectedContent = x(this.elementContext, this.elseContent));
386
+ e && this.thenContent ? this.connectedContent = S(this.elementContext, this.thenContent) : !e && this.elseContent && (this.connectedContent = S(this.elementContext, this.elseContent));
387
387
  for (let o = 0; o < this.connectedContent.length; o++) {
388
- const r = this.connectedContent[o], s = ((n = this.connectedContent[o - 1]) == null ? void 0 : n.node) ?? this.node;
389
- r.mount(this.node.parentNode, s);
388
+ const r = this.connectedContent[o], i = ((n = this.connectedContent[o - 1]) == null ? void 0 : n.node) ?? this.node;
389
+ r.mount(this.node.parentNode, i);
390
390
  }
391
391
  this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Conditional (${e ? "truthy" : "falsy"})`);
392
392
  }
393
393
  }
394
394
  }
395
- let Q = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((e, n) => (n &= 63, n < 36 ? e += n.toString(36) : n < 62 ? e += (n - 26).toString(36).toUpperCase() : n > 62 ? e += "-" : e += "_", e), "");
396
- const be = (t) => /^on[A-Z]/.test(t);
397
- class we {
395
+ const ve = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
396
+ let Q = (t = 21) => {
397
+ let e = "", n = crypto.getRandomValues(new Uint8Array(t |= 0));
398
+ for (; t--; )
399
+ e += ve[n[t] & 63];
400
+ return e;
401
+ };
402
+ const ke = (t) => /^on[A-Z]/.test(t);
403
+ class $e {
398
404
  constructor({ tag: e, props: n, children: o, elementContext: r }) {
399
405
  f(this, "node");
400
406
  f(this, "props");
@@ -402,17 +408,19 @@ class we {
402
408
  f(this, "stopCallbacks", []);
403
409
  f(this, "elementContext");
404
410
  f(this, "uniqueId", Q());
411
+ // Track the ref so we can nullify it on unmount.
412
+ f(this, "ref");
405
413
  // Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
406
414
  f(this, "canClickAway", !1);
407
415
  if (r = { ...r }, e.toLowerCase() === "svg" && (r.isSVG = !0), r.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", e) : this.node = document.createElement(e), r.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), n.ref)
408
- if (oe(n.ref))
409
- n.ref.node = this.node;
416
+ if (re(n.ref))
417
+ this.ref = n.ref;
410
418
  else
411
419
  throw new Error("Expected ref to be a Ref object. Got: " + n.ref);
412
420
  this.props = {
413
- ...pe(["ref", "class", "className"], n),
421
+ ...ye(["ref", "class", "className"], n),
414
422
  class: n.className ?? n.class
415
- }, this.children = o ? x(r, o) : [], this.elementContext = r;
423
+ }, this.children = o ? S(r, o) : [], this.elementContext = r;
416
424
  }
417
425
  get isMounted() {
418
426
  return this.node.parentNode != null;
@@ -425,7 +433,7 @@ class we {
425
433
  o.mount(this.node);
426
434
  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);
427
435
  }
428
- e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), setTimeout(() => {
436
+ e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null), this.ref && (this.ref.node = this.node), setTimeout(() => {
429
437
  this.canClickAway = !0;
430
438
  }, 0);
431
439
  }
@@ -434,7 +442,7 @@ class we {
434
442
  if (this.isMounted) {
435
443
  for (const n of this.children)
436
444
  n.unmount();
437
- (e = this.node.parentNode) == null || e.removeChild(this.node), this.canClickAway = !1;
445
+ this.ref && (this.ref.node = void 0), (e = this.node.parentNode) == null || e.removeChild(this.node), this.canClickAway = !1;
438
446
  for (const n of this.stopCallbacks)
439
447
  n();
440
448
  this.stopCallbacks = [];
@@ -444,80 +452,80 @@ class we {
444
452
  return `${this.uniqueId}:${e}:${n}`;
445
453
  }
446
454
  applyProps(e, n) {
447
- const o = (r, s, i) => {
448
- b(r) ? this.stopCallbacks.push(
455
+ const o = (r, i, s) => {
456
+ C(r) ? this.stopCallbacks.push(
449
457
  r.watch((c) => {
450
458
  this.elementContext.root.render.update(() => {
451
- s(c);
452
- }, i);
459
+ i(c);
460
+ }, s);
453
461
  })
454
462
  ) : this.elementContext.root.render.update(() => {
455
- s(r);
456
- }, i);
463
+ i(r);
464
+ }, s);
457
465
  };
458
466
  for (const r in n) {
459
- const s = n[r];
467
+ const i = n[r];
460
468
  if (r === "attributes") {
461
- const i = s;
462
- for (const c in i)
469
+ const s = i;
470
+ for (const c in s)
463
471
  o(
464
- i[c],
472
+ s[c],
465
473
  (u) => {
466
474
  u == null ? e.removeAttribute(c) : e.setAttribute(c, String(u));
467
475
  },
468
476
  this.getUpdateKey("attr", c)
469
477
  );
470
478
  } else if (r === "eventListeners") {
471
- const i = s;
472
- for (const c in i) {
473
- const u = b(s) ? (l) => s.get()(l) : s;
479
+ const s = i;
480
+ for (const c in s) {
481
+ const u = C(i) ? (a) => i.get()(a) : i;
474
482
  e.addEventListener(c, u), this.stopCallbacks.push(() => {
475
483
  e.removeEventListener(c, u);
476
484
  });
477
485
  }
478
486
  } else if (r === "onClickOutside" || r === "onclickoutside") {
479
- const i = (u) => {
480
- this.canClickAway && !e.contains(u.target) && (b(s) ? s.get()(u) : s(u));
487
+ const s = (u) => {
488
+ this.canClickAway && !e.contains(u.target) && (C(i) ? i.get()(u) : i(u));
481
489
  }, c = { capture: !0 };
482
- window.addEventListener("click", i, c), this.stopCallbacks.push(() => {
483
- window.removeEventListener("click", i, c);
490
+ window.addEventListener("click", s, c), this.stopCallbacks.push(() => {
491
+ window.removeEventListener("click", s, c);
484
492
  });
485
493
  } else if (r === "$$value") {
486
- if (!Z(s))
487
- throw new TypeError(`$$value attribute must be a settable signal. Got: ${s}`);
494
+ if (!Y(i))
495
+ throw new TypeError(`$$value attribute must be a settable signal. Got: ${i}`);
488
496
  o(
489
- s,
497
+ i,
490
498
  (c) => {
491
499
  e.value = String(c);
492
500
  },
493
501
  this.getUpdateKey("attr", "value")
494
502
  );
495
- const i = (c) => {
496
- const u = ke(s.get(), c.currentTarget.value);
497
- s.set(u);
503
+ const s = (c) => {
504
+ const u = Ne(i.get(), c.currentTarget.value);
505
+ i.set(u);
498
506
  };
499
- e.addEventListener("input", i), this.stopCallbacks.push(() => {
500
- e.removeEventListener("input", i);
507
+ e.addEventListener("input", s), this.stopCallbacks.push(() => {
508
+ e.removeEventListener("input", s);
501
509
  });
502
- } else if (be(r)) {
503
- const i = r.slice(2).toLowerCase(), c = b(s) ? (u) => s.get()(u) : s;
504
- e.addEventListener(i, c), this.stopCallbacks.push(() => {
505
- e.removeEventListener(i, c);
510
+ } else if (ke(r)) {
511
+ const s = r.slice(2).toLowerCase(), c = C(i) ? (u) => i.get()(u) : i;
512
+ e.addEventListener(s, c), this.stopCallbacks.push(() => {
513
+ e.removeEventListener(s, c);
506
514
  });
507
515
  } else if (r.includes("-"))
508
516
  o(
509
- s,
510
- (i) => {
511
- i == null ? e.removeAttribute(r) : e.setAttribute(r, String(i));
517
+ i,
518
+ (s) => {
519
+ s == null ? e.removeAttribute(r) : e.setAttribute(r, String(s));
512
520
  },
513
521
  this.getUpdateKey("attr", r)
514
522
  );
515
- else if (!ve.includes(r))
523
+ else if (!Se.includes(r))
516
524
  if (this.elementContext.isSVG)
517
525
  o(
518
- s,
519
- (i) => {
520
- i != null ? e.setAttribute(r, String(n[r])) : e.removeAttribute(r);
526
+ i,
527
+ (s) => {
528
+ s != null ? e.setAttribute(r, String(n[r])) : e.removeAttribute(r);
521
529
  },
522
530
  this.getUpdateKey("attr", r)
523
531
  );
@@ -526,27 +534,27 @@ class we {
526
534
  case "contentEditable":
527
535
  case "value":
528
536
  o(
529
- s,
530
- (i) => {
531
- e[r] = String(i);
537
+ i,
538
+ (s) => {
539
+ e[r] = String(s);
532
540
  },
533
541
  this.getUpdateKey("prop", r)
534
542
  );
535
543
  break;
536
544
  case "for":
537
545
  o(
538
- s,
539
- (i) => {
540
- e.htmlFor = i;
546
+ i,
547
+ (s) => {
548
+ e.htmlFor = s;
541
549
  },
542
550
  this.getUpdateKey("prop", "htmlFor")
543
551
  );
544
552
  break;
545
553
  case "checked":
546
554
  o(
547
- s,
548
- (i) => {
549
- e.checked = i, i ? e.setAttribute("checked", "") : e.removeAttribute("checked");
555
+ i,
556
+ (s) => {
557
+ e.checked = s, s ? e.setAttribute("checked", "") : e.removeAttribute("checked");
550
558
  },
551
559
  this.getUpdateKey("prop", "checked")
552
560
  );
@@ -556,31 +564,31 @@ class we {
556
564
  case "part":
557
565
  case "translate":
558
566
  case "title": {
559
- const i = r.toLowerCase();
567
+ const s = r.toLowerCase();
560
568
  o(
561
- s,
569
+ i,
562
570
  (c) => {
563
- c == null ? e.removeAttribute(i) : e.setAttribute(i, String(c));
571
+ c == null ? e.removeAttribute(s) : e.setAttribute(s, String(c));
564
572
  },
565
- this.getUpdateKey("attr", i)
573
+ this.getUpdateKey("attr", s)
566
574
  );
567
575
  break;
568
576
  }
569
577
  case "autocomplete":
570
578
  case "autocapitalize":
571
579
  o(
572
- s,
573
- (i) => {
574
- typeof i == "string" ? e.autocomplete = i : i ? e.autocomplete = "on" : e.autocomplete = "off";
580
+ i,
581
+ (s) => {
582
+ typeof s == "string" ? e.autocomplete = s : s ? e.autocomplete = "on" : e.autocomplete = "off";
575
583
  },
576
584
  this.getUpdateKey("prop", r)
577
585
  );
578
586
  break;
579
587
  default: {
580
588
  o(
581
- s,
582
- (i) => {
583
- e[r] = i;
589
+ i,
590
+ (s) => {
591
+ e[r] = s;
584
592
  },
585
593
  this.getUpdateKey("prop", r)
586
594
  );
@@ -591,85 +599,72 @@ class we {
591
599
  }
592
600
  applyStyles(e, n, o) {
593
601
  const r = [];
594
- if (n == null)
595
- e.style.cssText = "";
596
- else if (typeof n == "string")
597
- e.style.cssText = n;
598
- else if (b(n)) {
599
- let s;
600
- const i = n.watch((c) => {
602
+ if (C(n)) {
603
+ let i;
604
+ const s = n.watch((c) => {
601
605
  this.elementContext.root.render.update(
602
606
  () => {
603
- E(s) && s(), e.style.cssText = "", s = this.applyStyles(e, c, o);
607
+ E(i) && i(), e.style.cssText = "", i = this.applyStyles(e, c, o);
604
608
  },
605
609
  this.getUpdateKey("styles", "*")
606
610
  );
607
611
  });
608
- o.push(i), r.push(i);
609
- } else if (L(n)) {
610
- n = n;
611
- for (const s in n) {
612
- const i = n[s], c = s.startsWith("--") ? (u, l) => l == null ? e.style.removeProperty(u) : e.style.setProperty(u, l) : (u, l) => e.style[u] = l ?? "";
613
- if (b(i)) {
614
- const u = i.watch((l) => {
615
- this.elementContext.root.render.update(
616
- () => {
617
- l != null ? c(s, l) : e.style.removeProperty(s);
618
- },
619
- this.getUpdateKey("style", s)
620
- );
612
+ o.push(s), r.push(s);
613
+ } else {
614
+ const i = ee(n);
615
+ for (const s in i) {
616
+ const { value: c, priority: u } = i[s];
617
+ if (C(c)) {
618
+ const a = c.watch((d) => {
619
+ this.elementContext.root.render.update(() => {
620
+ d ? e.style.setProperty(s, String(d), u) : e.style.removeProperty(s);
621
+ });
621
622
  });
622
- o.push(u), r.push(u);
623
- } else if (A(i))
624
- c(s, i);
625
- else if (D(i))
626
- c(s, String(i));
627
- else
628
- throw new TypeError(`Style properties should be strings, $states or numbers. Got (${s}: ${i})`);
623
+ o.push(a), r.push(a);
624
+ } else c != null && e.style.setProperty(s, String(c));
629
625
  }
630
- } else
631
- throw new TypeError(`Expected style property to be a string, $state, or object. Got: ${n}`);
626
+ }
632
627
  return function() {
633
- for (const i of r)
634
- i(), o.splice(o.indexOf(i), 1);
628
+ for (const s of r)
629
+ s(), o.splice(o.indexOf(s), 1);
635
630
  };
636
631
  }
637
632
  applyClasses(e, n, o) {
638
633
  const r = [];
639
- if (b(n)) {
640
- let s;
641
- const i = n.watch((c) => {
634
+ if (C(n)) {
635
+ let i;
636
+ const s = n.watch((c) => {
642
637
  this.elementContext.root.render.update(
643
638
  () => {
644
- E(s) && s(), e.removeAttribute("class"), s = this.applyClasses(e, c, o);
639
+ E(i) && i(), e.removeAttribute("class"), i = this.applyClasses(e, c, o);
645
640
  },
646
641
  this.getUpdateKey("attr", "class")
647
642
  );
648
643
  });
649
- o.push(i), r.push(i);
644
+ o.push(s), r.push(s);
650
645
  } else {
651
- const s = X(n);
652
- for (const i in s) {
653
- const c = s[i];
654
- if (b(c)) {
655
- const u = c.watch((l) => {
646
+ const i = X(n);
647
+ for (const s in i) {
648
+ const c = i[s];
649
+ if (C(c)) {
650
+ const u = c.watch((a) => {
656
651
  this.elementContext.root.render.update(() => {
657
- l ? e.classList.add(i) : e.classList.remove(i);
652
+ a ? e.classList.add(s) : e.classList.remove(s);
658
653
  });
659
654
  });
660
655
  o.push(u), r.push(u);
661
- } else c && e.classList.add(i);
656
+ } else c && e.classList.add(s);
662
657
  }
663
658
  }
664
659
  return function() {
665
- for (const i of r)
666
- i(), o.splice(o.indexOf(i), 1);
660
+ for (const s of r)
661
+ s(), o.splice(o.indexOf(s), 1);
667
662
  };
668
663
  }
669
664
  }
670
665
  function X(t) {
671
666
  let e = {};
672
- if (A(t)) {
667
+ if (M(t)) {
673
668
  const n = t.split(" ");
674
669
  for (const o of n)
675
670
  e[o] = !0;
@@ -678,12 +673,34 @@ function X(t) {
678
673
  });
679
674
  return e;
680
675
  }
681
- function ke(t, e) {
676
+ function ee(t) {
677
+ let e = {};
678
+ if (M(t)) {
679
+ const n = t.split(";").filter((o) => o.trim() !== "");
680
+ for (const o of n) {
681
+ const [r, i] = o.split(":"), s = {
682
+ value: i
683
+ };
684
+ i.includes("!important") ? (s.priority = "important", s.value = i.replace("!important", "").trim()) : s.value = i.trim(), e[z(r.trim())] = s;
685
+ }
686
+ }
687
+ if (L(t))
688
+ for (const n in t)
689
+ n.startsWith("--") ? e[n] = { value: t[n] } : e[z(n)] = { value: t[n] };
690
+ else Array.isArray(t) && Array.from(t).filter((n) => n != null).forEach((n) => {
691
+ Object.assign(e, ee(n));
692
+ });
693
+ return e;
694
+ }
695
+ function z(t) {
696
+ return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, n) => (n ? "-" : "") + e.toLowerCase());
697
+ }
698
+ function Ne(t, e) {
682
699
  const n = typeof t;
683
700
  return n === "string" ? String(e) : n === "number" ? Number(e) : n === "boolean" ? !!e : e;
684
701
  }
685
- const ve = ["ref", "children", "class", "style", "data"];
686
- class $e {
702
+ const Se = ["ref", "children", "class", "style", "data"];
703
+ class xe {
687
704
  constructor({ signals: e, renderFn: n, elementContext: o }) {
688
705
  f(this, "node");
689
706
  f(this, "endNode");
@@ -695,13 +712,13 @@ class $e {
695
712
  let r;
696
713
  this.observerControls = {
697
714
  start: () => {
698
- r == null && (r = G(e, (...s) => {
699
- const i = this.renderFn(...s);
700
- if (!se(i))
701
- throw console.error(i), new TypeError(
702
- `Observer received invalid value to render. Got type: ${q(i)}, value: ${i}`
715
+ r == null && (r = q(e, (...i) => {
716
+ const s = this.renderFn(...i);
717
+ if (!se(s))
718
+ throw console.error(s), new TypeError(
719
+ `Observer received invalid value to render. Got type: ${G(s)}, value: ${s}`
703
720
  );
704
- Array.isArray(i) ? this.update(...i) : this.update(i);
721
+ Array.isArray(s) ? this.update(...s) : this.update(s);
705
722
  }));
706
723
  },
707
724
  stop: () => {
@@ -728,18 +745,18 @@ class $e {
728
745
  var o, r;
729
746
  if (this.cleanup(), e == null || !this.isMounted)
730
747
  return;
731
- const n = e.map((s) => ne(s) ? s : V(s) ? M(x(this.elementContext, s)) : M(x(this.elementContext, U(s))));
732
- for (const s of n) {
733
- const i = ((o = this.connectedViews.at(-1)) == null ? void 0 : o.node) || this.node;
734
- s.mount(this.node.parentNode, i), this.connectedViews.push(s);
748
+ const n = e.map((i) => oe(i) ? i : V(i) ? A(S(this.elementContext, i)) : A(S(this.elementContext, j(i))));
749
+ for (const i of n) {
750
+ const s = ((o = this.connectedViews.at(-1)) == null ? void 0 : o.node) || this.node;
751
+ i.mount(this.node.parentNode, s), this.connectedViews.push(i);
735
752
  }
736
753
  if (this.elementContext.root.getEnv() === "development") {
737
- const s = (r = this.connectedViews.at(-1)) == null ? void 0 : r.node;
738
- this.endNode.previousSibling !== s && this.node.parentNode.insertBefore(this.endNode, (s == null ? void 0 : s.nextSibling) ?? null);
754
+ const i = (r = this.connectedViews.at(-1)) == null ? void 0 : r.node;
755
+ this.endNode.previousSibling !== i && this.node.parentNode.insertBefore(this.endNode, (i == null ? void 0 : i.nextSibling) ?? null);
739
756
  }
740
757
  }
741
758
  }
742
- class Ne {
759
+ class Ee {
743
760
  constructor(e) {
744
761
  f(this, "node");
745
762
  f(this, "endNode");
@@ -768,11 +785,11 @@ class Ne {
768
785
  }
769
786
  update(e) {
770
787
  var n, o, r;
771
- for (const s of this.connectedChildren)
772
- s.unmount();
773
- for (let s = 0; s < e.length; s++) {
774
- const i = e[s], c = s > 0 ? e[s] : void 0;
775
- i.mount(this.node.parentElement, c == null ? void 0 : c.node);
788
+ for (const i of this.connectedChildren)
789
+ i.unmount();
790
+ for (let i = 0; i < e.length; i++) {
791
+ const s = e[i], c = i > 0 ? e[i] : void 0;
792
+ s.mount(this.node.parentElement, c == null ? void 0 : c.node);
776
793
  }
777
794
  this.connectedChildren = e, this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Outlet (${e.length} ${e.length === 1 ? "child" : "children"})`, (r = this.node.parentElement) == null || r.insertBefore(
778
795
  this.endNode,
@@ -780,7 +797,7 @@ class Ne {
780
797
  ));
781
798
  }
782
799
  }
783
- class xe {
800
+ class Ae {
784
801
  constructor(e) {
785
802
  f(this, "config");
786
803
  f(this, "handle");
@@ -791,46 +808,46 @@ class xe {
791
808
  }
792
809
  mount(e, n) {
793
810
  const { content: o, parent: r } = this.config;
794
- ne(o) ? this.handle = o : V(o) ? this.handle = M(x(this.config.elementContext, o)) : this.handle = M(x(this.config.elementContext, U(o))), this.handle.mount(r);
811
+ oe(o) ? this.handle = o : V(o) ? this.handle = A(S(this.config.elementContext, o)) : this.handle = A(S(this.config.elementContext, j(o))), this.handle.mount(r);
795
812
  }
796
813
  unmount() {
797
814
  var e;
798
815
  (e = this.handle) != null && e.isMounted && this.handle.unmount();
799
816
  }
800
817
  }
801
- function ee(t, e, n, o = []) {
818
+ function te(t, e, n, o = []) {
802
819
  t = { ...t };
803
- const [r, s] = O(x(t, o));
804
- let i = !1;
805
- const c = [], u = [], l = [], d = [], h = [], C = Q(), [w, k] = O(e.name), $ = t.root.createLogger(w, { uid: C }), v = {
820
+ const [r, i] = T(S(t, o));
821
+ let s = !1;
822
+ const c = [], u = [], a = [], d = [], h = [], b = Q(), [w, v] = T(e.name), $ = t.root.createLogger(w, { uid: b }), k = {
806
823
  get uid() {
807
- return C;
824
+ return b;
808
825
  },
809
- setName(a) {
810
- k(a);
826
+ setName(l) {
827
+ v(l);
811
828
  },
812
- beforeMount(a) {
813
- u.push(a);
829
+ beforeMount(l) {
830
+ u.push(l);
814
831
  },
815
- onMount(a) {
816
- l.push(a);
832
+ onMount(l) {
833
+ a.push(l);
817
834
  },
818
- beforeUnmount(a) {
819
- d.push(a);
835
+ beforeUnmount(l) {
836
+ d.push(l);
820
837
  },
821
- onUnmount(a) {
822
- h.push(a);
838
+ onUnmount(l) {
839
+ h.push(l);
823
840
  },
824
- watch(a, y) {
825
- if (i) {
826
- const g = G(a, y);
841
+ watch(l, y) {
842
+ if (s) {
843
+ const g = q(l, y);
827
844
  return c.push(g), g;
828
845
  } else {
829
- let g, S = !1;
830
- return l.push(() => {
831
- S || (g = G(a, y), c.push(g));
846
+ let g, x = !1;
847
+ return a.push(() => {
848
+ x || (g = q(l, y), c.push(g));
832
849
  }), function F() {
833
- F != null && (S = !0, F());
850
+ F != null && (x = !0, F());
834
851
  };
835
852
  }
836
853
  },
@@ -838,28 +855,28 @@ function ee(t, e, n, o = []) {
838
855
  return N("$outlet", { $children: r });
839
856
  }
840
857
  };
841
- Object.assign(v, $);
858
+ Object.assign(k, $);
842
859
  let m;
843
860
  function p() {
844
- let a;
861
+ let l;
845
862
  try {
846
- a = e(n, v);
863
+ l = e(n, k);
847
864
  } catch (y) {
848
865
  throw y instanceof Error && $.crash(y), y;
849
866
  }
850
- if (a instanceof Promise)
867
+ if (l instanceof Promise)
851
868
  throw new TypeError("View function cannot return a Promise.");
852
- if (a !== null) if (a instanceof Node)
853
- m = M(x(t, N("$node", { value: a })));
854
- else if (V(a) || z(V, a))
855
- m = M(x(t, a));
856
- else if (b(a))
857
- m = M(
858
- x(t, N("$observer", { signals: [a], renderFn: (y) => y }))
869
+ if (l !== null) if (l instanceof Node)
870
+ m = A(S(t, N("$node", { value: l })));
871
+ else if (V(l) || D(V, l))
872
+ m = A(S(t, l));
873
+ else if (C(l))
874
+ m = A(
875
+ S(t, N("$observer", { signals: [l], renderFn: (y) => y }))
859
876
  );
860
877
  else {
861
878
  const y = new TypeError(
862
- `Expected '${e.name}' function to return a DOM node, Markup element, Readable or null. Got: ${q(a)}`
879
+ `Expected '${e.name}' function to return a DOM node, Markup element, Readable or null. Got: ${G(l)}`
863
880
  );
864
881
  $.crash(y);
865
882
  }
@@ -869,32 +886,32 @@ function ee(t, e, n, o = []) {
869
886
  return m == null ? void 0 : m.node;
870
887
  },
871
888
  get isMounted() {
872
- return i;
889
+ return s;
873
890
  },
874
- mount(a, y) {
875
- const g = i;
891
+ mount(l, y) {
892
+ const g = s;
876
893
  if (!g)
877
894
  for (p(); u.length > 0; )
878
895
  u.shift()();
879
- m && m.mount(a, y), g || (i = !0, requestAnimationFrame(() => {
880
- for (; l.length > 0; )
881
- l.shift()();
896
+ m && m.mount(l, y), g || (s = !0, requestAnimationFrame(() => {
897
+ for (; a.length > 0; )
898
+ a.shift()();
882
899
  }));
883
900
  },
884
901
  unmount() {
885
902
  for (; d.length > 0; )
886
903
  d.shift()();
887
- for (m && m.unmount(), i = !1; h.length > 0; )
904
+ for (m && m.unmount(), s = !1; h.length > 0; )
888
905
  h.shift()();
889
906
  for (; c.length > 0; )
890
907
  c.shift()();
891
908
  },
892
- setChildren(a) {
893
- s(a);
909
+ setChildren(l) {
910
+ i(l);
894
911
  }
895
912
  };
896
913
  }
897
- class Se {
914
+ class Me {
898
915
  constructor({ elementContext: e, $items: n, renderFn: o, keyFn: r }) {
899
916
  f(this, "node");
900
917
  f(this, "endNode");
@@ -924,7 +941,7 @@ class Se {
924
941
  this.connectedItems = [];
925
942
  }
926
943
  _update(e) {
927
- var s, i, c;
944
+ var i, s, c;
928
945
  if (e.length === 0 || !this.isMounted)
929
946
  return this._cleanup();
930
947
  const n = [];
@@ -939,40 +956,40 @@ class Se {
939
956
  for (const u of this.connectedItems)
940
957
  n.find((d) => d.key === u.key) || u.handle.unmount();
941
958
  for (const u of n) {
942
- const l = this.connectedItems.find((d) => d.key === u.key);
943
- if (l)
944
- l.setValue(u.value), l.setIndex(u.index), r[u.index] = l;
959
+ const a = this.connectedItems.find((d) => d.key === u.key);
960
+ if (a)
961
+ a.setValue(u.value), a.setIndex(u.index), r[u.index] = a;
945
962
  else {
946
- const [d, h] = O(u.value), [C, w] = O(u.index);
963
+ const [d, h] = T(u.value), [b, w] = T(u.index);
947
964
  r[u.index] = {
948
965
  key: u.key,
949
966
  $value: d,
950
967
  setValue: h,
951
- $index: C,
968
+ $index: b,
952
969
  setIndex: w,
953
- handle: ee(this.elementContext, Ee, {
970
+ handle: te(this.elementContext, Oe, {
954
971
  $value: d,
955
- $index: C,
972
+ $index: b,
956
973
  renderFn: this.renderFn
957
974
  })
958
975
  };
959
976
  }
960
977
  }
961
978
  for (let u = 0; u < r.length; u++) {
962
- const l = r[u], d = ((s = r[u - 1]) == null ? void 0 : s.handle.node) ?? this.node;
963
- l.handle.mount(this.node.parentNode, d);
979
+ const a = r[u], d = ((i = r[u - 1]) == null ? void 0 : i.handle.node) ?? this.node;
980
+ a.handle.mount(this.node.parentNode, d);
964
981
  }
965
982
  if (this.connectedItems = r, this.elementContext.root.getEnv() === "development") {
966
983
  this.node.textContent = `Repeat (${r.length} item${r.length === 1 ? "" : "s"})`;
967
- const u = ((i = r.at(-1)) == null ? void 0 : i.handle.node) ?? this.node;
984
+ const u = ((s = r.at(-1)) == null ? void 0 : s.handle.node) ?? this.node;
968
985
  (c = this.node.parentNode) == null || c.insertBefore(this.endNode, u.nextSibling);
969
986
  }
970
987
  }
971
988
  }
972
- function Ee({ $value: t, $index: e, renderFn: n }, o) {
989
+ function Oe({ $value: t, $index: e, renderFn: n }, o) {
973
990
  return n(t, e, o);
974
991
  }
975
- class Me {
992
+ class Te {
976
993
  constructor({ value: e }) {
977
994
  f(this, "node", document.createTextNode(""));
978
995
  f(this, "value", "");
@@ -983,7 +1000,7 @@ class Me {
983
1000
  return this.node.parentNode != null;
984
1001
  }
985
1002
  async mount(e, n = null) {
986
- this.isMounted || (b(this.value) ? this.stopCallback = this.value.watch((o) => {
1003
+ this.isMounted || (C(this.value) ? this.stopCallback = this.value.watch((o) => {
987
1004
  this.update(o);
988
1005
  }) : this.update(this.value)), e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null);
989
1006
  }
@@ -994,24 +1011,24 @@ class Me {
994
1011
  e != null ? this.node.textContent = e.toString() : this.node.textContent = "";
995
1012
  }
996
1013
  }
997
- const te = Symbol("Markup");
1014
+ const ne = Symbol("Markup");
998
1015
  function V(t) {
999
- return L(t) && t[te] === !0;
1016
+ return L(t) && t[ne] === !0;
1000
1017
  }
1001
- function ne(t) {
1018
+ function oe(t) {
1002
1019
  return L(t) && E(t.connect) && E(t.disconnect);
1003
1020
  }
1004
- function U(t) {
1021
+ function j(t) {
1005
1022
  return P(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
1006
1023
  if (e instanceof Node)
1007
1024
  return N("$node", { value: e });
1008
- if (e instanceof re)
1025
+ if (e instanceof ie)
1009
1026
  return N("$node", { value: e.node });
1010
1027
  if (V(e))
1011
1028
  return e;
1012
- if (A(e) || D(e))
1029
+ if (M(e) || pe(e))
1013
1030
  return N("$text", { value: e });
1014
- if (b(e))
1031
+ if (C(e))
1015
1032
  return N("$observer", {
1016
1033
  signals: [e],
1017
1034
  renderFn: (n) => n
@@ -1020,25 +1037,25 @@ function U(t) {
1020
1037
  });
1021
1038
  }
1022
1039
  function N(t, e, ...n) {
1023
- return e != null && Ae(e), {
1024
- [te]: !0,
1040
+ return e != null && Ve(e), {
1041
+ [ne]: !0,
1025
1042
  type: t,
1026
1043
  props: e,
1027
- children: U(n)
1044
+ children: j(n)
1028
1045
  };
1029
1046
  }
1030
- function Ae(t) {
1031
- if (t.ref && !oe(t.ref))
1047
+ function Ve(t) {
1048
+ if (t.ref && !re(t.ref))
1032
1049
  throw console.warn(t.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${t.ref}`);
1033
1050
  for (const e in t)
1034
1051
  if (e.startsWith("$$") && t[e] !== void 0) {
1035
- if (!Z(t[e]))
1052
+ if (!Y(t[e]))
1036
1053
  throw new TypeError(`Prop '${e}' is named as a SettableSignal but value is not. Got: ${t[e]}`);
1037
- } else if (e.startsWith("$") && t[e] !== void 0 && !b(t[e]))
1054
+ } else if (e.startsWith("$") && t[e] !== void 0 && !C(t[e]))
1038
1055
  throw new TypeError(`Prop '${e}' is named as a Signal but value is not. Got: ${t[e]}`);
1039
1056
  }
1040
- const _e = ge.bind(N);
1041
- function Re(t, e, n) {
1057
+ const Ke = Ce.bind(N);
1058
+ function We(t, e, n) {
1042
1059
  const o = J(t);
1043
1060
  return N("$cond", {
1044
1061
  $predicate: o,
@@ -1046,15 +1063,15 @@ function Re(t, e, n) {
1046
1063
  elseContent: n
1047
1064
  });
1048
1065
  }
1049
- function Be(t, e, n) {
1066
+ function He(t, e, n) {
1050
1067
  const o = J(t);
1051
1068
  return N("$repeat", { $items: o, keyFn: e, renderFn: n });
1052
1069
  }
1053
- function Ke(t, e) {
1070
+ function ze(t, e) {
1054
1071
  return N("$portal", { parent: t, content: e });
1055
1072
  }
1056
- function We() {
1057
- const [t, e] = O();
1073
+ function De() {
1074
+ const [t, e] = T();
1058
1075
  return {
1059
1076
  get: t.get,
1060
1077
  watch: t.watch,
@@ -1066,10 +1083,10 @@ function We() {
1066
1083
  }
1067
1084
  };
1068
1085
  }
1069
- function oe(t) {
1086
+ function re(t) {
1070
1087
  return !(t == null || typeof t != "object" || !t.hasOwnProperty("node"));
1071
1088
  }
1072
- class re {
1089
+ class ie {
1073
1090
  constructor(e) {
1074
1091
  f(this, "node");
1075
1092
  this.node = e;
@@ -1084,25 +1101,25 @@ class re {
1084
1101
  this.node.parentNode && this.node.parentNode.removeChild(this.node);
1085
1102
  }
1086
1103
  }
1087
- function x(t, e) {
1104
+ function S(t, e) {
1088
1105
  return (P(e) ? e : [e]).map((o) => {
1089
1106
  if (E(o.type))
1090
- return ee(t, o.type, o.props, o.children);
1091
- if (A(o.type))
1107
+ return te(t, o.type, o.props, o.children);
1108
+ if (M(o.type))
1092
1109
  switch (o.type) {
1093
1110
  case "$node": {
1094
1111
  const r = o.props;
1095
- return new re(r.value);
1112
+ return new ie(r.value);
1096
1113
  }
1097
1114
  case "$text": {
1098
1115
  const r = o.props;
1099
- return new Me({
1116
+ return new Te({
1100
1117
  value: r.value
1101
1118
  });
1102
1119
  }
1103
1120
  case "$cond": {
1104
1121
  const r = o.props;
1105
- return new Ce({
1122
+ return new we({
1106
1123
  $predicate: r.$predicate,
1107
1124
  thenContent: r.thenContent,
1108
1125
  elseContent: r.elseContent,
@@ -1111,7 +1128,7 @@ function x(t, e) {
1111
1128
  }
1112
1129
  case "$repeat": {
1113
1130
  const r = o.props;
1114
- return new Se({
1131
+ return new Me({
1115
1132
  $items: r.$items,
1116
1133
  keyFn: r.keyFn,
1117
1134
  renderFn: r.renderFn,
@@ -1120,7 +1137,7 @@ function x(t, e) {
1120
1137
  }
1121
1138
  case "$observer": {
1122
1139
  const r = o.props;
1123
- return new $e({
1140
+ return new xe({
1124
1141
  signals: r.signals,
1125
1142
  renderFn: r.renderFn,
1126
1143
  elementContext: t
@@ -1128,14 +1145,14 @@ function x(t, e) {
1128
1145
  }
1129
1146
  case "$outlet": {
1130
1147
  const r = o.props;
1131
- return new Ne({
1148
+ return new Ee({
1132
1149
  $children: r.$children,
1133
1150
  elementContext: t
1134
1151
  });
1135
1152
  }
1136
1153
  case "$portal": {
1137
1154
  const r = o.props;
1138
- return new xe({
1155
+ return new Ae({
1139
1156
  content: r.content,
1140
1157
  parent: r.parent,
1141
1158
  elementContext: t
@@ -1144,7 +1161,7 @@ function x(t, e) {
1144
1161
  default:
1145
1162
  if (o.type.startsWith("$"))
1146
1163
  throw new Error(`Unknown markup type: ${o.type}`);
1147
- return new we({
1164
+ return new $e({
1148
1165
  tag: o.type,
1149
1166
  props: o.props ?? {},
1150
1167
  children: o.children,
@@ -1155,7 +1172,7 @@ function x(t, e) {
1155
1172
  throw new TypeError(`Expected a string or view function. Got: ${o.type}`);
1156
1173
  });
1157
1174
  }
1158
- function M(t) {
1175
+ function A(t) {
1159
1176
  if (t.length === 1)
1160
1177
  return t[0];
1161
1178
  const e = document.createComment("Fragment");
@@ -1168,11 +1185,11 @@ function M(t) {
1168
1185
  return n;
1169
1186
  },
1170
1187
  mount(o, r) {
1171
- var s;
1188
+ var i;
1172
1189
  o.insertBefore(e, r || null);
1173
- for (const i of t) {
1174
- const c = ((s = t[t.length - 1]) == null ? void 0 : s.node) ?? e;
1175
- i.mount(o, c);
1190
+ for (const s of t) {
1191
+ const c = ((i = t[t.length - 1]) == null ? void 0 : i.node) ?? e;
1192
+ s.mount(o, c);
1176
1193
  }
1177
1194
  n = !0;
1178
1195
  },
@@ -1187,42 +1204,42 @@ function M(t) {
1187
1204
  };
1188
1205
  }
1189
1206
  function se(t) {
1190
- return t == null || t === !1 || typeof t == "string" || typeof t == "number" || V(t) || b(t) || z(se, t);
1207
+ return t == null || t === !1 || typeof t == "string" || typeof t == "number" || V(t) || C(t) || D(se, t);
1191
1208
  }
1192
- function He(t, e) {
1209
+ function Ze(t, e) {
1193
1210
  return e.outlet();
1194
1211
  }
1195
1212
  export {
1196
- x as A,
1197
- qe as B,
1198
- Ke as C,
1199
- Be as D,
1200
- He as P,
1201
- b as a,
1213
+ S as A,
1214
+ Be as B,
1215
+ ze as C,
1216
+ He as D,
1217
+ Ze as P,
1218
+ C as a,
1202
1219
  I as b,
1203
- Re as c,
1204
- ye as d,
1220
+ We as c,
1221
+ be as d,
1205
1222
  E as e,
1206
- A as f,
1207
- O as g,
1208
- _e as h,
1223
+ M as f,
1224
+ T as g,
1225
+ Ke as h,
1209
1226
  L as i,
1210
- Ve as j,
1211
- Oe as k,
1212
- Ie as l,
1213
- Le as m,
1214
- T as n,
1215
- We as o,
1216
- oe as p,
1217
- Pe as q,
1227
+ je as j,
1228
+ Fe as k,
1229
+ Ge as l,
1230
+ _e as m,
1231
+ O as n,
1232
+ De as o,
1233
+ re as p,
1234
+ Ue as q,
1218
1235
  N as r,
1219
1236
  J as s,
1220
- Ge as t,
1221
- Ue as u,
1222
- Fe as v,
1223
- G as w,
1224
- je as x,
1225
- ee as y,
1226
- M as z
1237
+ Re as t,
1238
+ Le as u,
1239
+ Ie as v,
1240
+ q as w,
1241
+ qe as x,
1242
+ te as y,
1243
+ A as z
1227
1244
  };
1228
- //# sourceMappingURL=passthrough-DrtCifRF.js.map
1245
+ //# sourceMappingURL=passthrough-CtoBcpag.js.map