@manyducks.co/dolla 2.0.0-alpha.21 → 2.0.0-alpha.23

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.
Files changed (43) hide show
  1. package/dist/{modules/render.d.ts → core/batch.d.ts} +4 -1
  2. package/dist/{modules → core}/dolla.d.ts +25 -9
  3. package/dist/{markup.d.ts → core/markup.d.ts} +6 -6
  4. package/dist/{nodes → core/nodes}/cond.d.ts +4 -2
  5. package/dist/{nodes → core/nodes}/html.d.ts +2 -0
  6. package/dist/{nodes → core/nodes}/observer.d.ts +4 -1
  7. package/dist/core/nodes/outlet.d.ts +18 -0
  8. package/dist/{nodes → core/nodes}/portal.d.ts +4 -2
  9. package/dist/{nodes → core/nodes}/repeat.d.ts +5 -3
  10. package/dist/{nodes → core/nodes}/text.d.ts +2 -0
  11. package/dist/{view.d.ts → core/nodes/view.d.ts} +8 -6
  12. package/dist/{state.d.ts → core/state.d.ts} +3 -4
  13. package/dist/core/symbols.d.ts +5 -0
  14. package/dist/index.d.ts +9 -8
  15. package/dist/index.js +670 -1038
  16. package/dist/index.js.map +1 -1
  17. package/dist/jsx-dev-runtime.d.ts +2 -2
  18. package/dist/jsx-dev-runtime.js +2 -2
  19. package/dist/jsx-dev-runtime.js.map +1 -1
  20. package/dist/jsx-runtime.d.ts +3 -3
  21. package/dist/jsx-runtime.js +2 -2
  22. package/dist/jsx-runtime.js.map +1 -1
  23. package/dist/modules/http.d.ts +2 -0
  24. package/dist/modules/i18n.d.ts +2 -2
  25. package/dist/modules/router.d.ts +27 -48
  26. package/dist/{passthrough-6Lrg96Id.js → passthrough-C9975ULD.js} +636 -576
  27. package/dist/passthrough-C9975ULD.js.map +1 -0
  28. package/dist/typeChecking.d.ts +2 -2
  29. package/dist/types.d.ts +2 -2
  30. package/dist/utils.d.ts +14 -1
  31. package/dist/views/default-crash-view.d.ts +1 -1
  32. package/dist/views/passthrough.d.ts +2 -2
  33. package/docs/http.md +16 -0
  34. package/docs/router.md +19 -0
  35. package/index.d.ts +2 -2
  36. package/notes/TODO.md +6 -0
  37. package/notes/scratch.md +2 -2
  38. package/package.json +3 -6
  39. package/vite.config.js +0 -10
  40. package/dist/nodes/outlet.d.ts +0 -22
  41. package/dist/passthrough-6Lrg96Id.js.map +0 -1
  42. /package/dist/{routing.d.ts → modules/router.utils.d.ts} +0 -0
  43. /package/dist/{routing.test.d.ts → modules/router.utils.test.d.ts} +0 -0
@@ -1,157 +1,239 @@
1
- var me = Object.defineProperty;
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);
1
+ var Oe = Object.defineProperty;
2
+ var Pe = (s, e, t) => e in s ? Oe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var o = (s, e, t) => Pe(s, typeof e != "symbol" ? e + "" : e, t);
4
4
  function we(s) {
5
5
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
6
6
  }
7
- var O = { exports: {} }, Z;
8
- function ye() {
9
- return Z || (Z = 1, function(s, e) {
7
+ var O = { exports: {} }, Q;
8
+ function qe() {
9
+ return Q || (Q = 1, function(s, e) {
10
10
  Object.defineProperty(e, "__esModule", { value: !0 });
11
11
  var t = /* @__PURE__ */ function() {
12
- function l(c, h) {
13
- var d = [], f = !0, m = !1, v = void 0;
12
+ function a(l, h) {
13
+ var f = [], d = !0, m = !1, S = void 0;
14
14
  try {
15
- for (var S, b = c[Symbol.iterator](); !(f = (S = b.next()).done) && (d.push(S.value), !(h && d.length === h)); f = !0) ;
15
+ for (var E, C = l[Symbol.iterator](); !(d = (E = C.next()).done) && (f.push(E.value), !(h && f.length === h)); d = !0) ;
16
16
  } catch (g) {
17
- m = !0, v = g;
17
+ m = !0, S = g;
18
18
  } finally {
19
19
  try {
20
- !f && b.return && b.return();
20
+ !d && C.return && C.return();
21
21
  } finally {
22
- if (m) throw v;
22
+ if (m) throw S;
23
23
  }
24
24
  }
25
- return d;
25
+ return f;
26
26
  }
27
- return function(c, h) {
28
- if (Array.isArray(c)) return c;
29
- if (Symbol.iterator in Object(c)) return l(c, h);
27
+ return function(l, h) {
28
+ if (Array.isArray(l)) return l;
29
+ if (Symbol.iterator in Object(l)) return a(l, h);
30
30
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
31
31
  };
32
- }(), n = function(l) {
33
- return l.reduce(function(c, h) {
34
- return 16 > h ? c + "0" + h.toString(16) : c + h.toString(16);
32
+ }(), n = function(a) {
33
+ return a.reduce(function(l, h) {
34
+ return 16 > h ? l + "0" + h.toString(16) : l + h.toString(16);
35
35
  }, "#");
36
- }, i = function(l, c, h) {
37
- var d = 0.5 > h ? h * (1 + c) : h + c - h * c, f = 2 * h - d, m = function(g, k, _) {
38
- var L = Math.round, w = 0 > _ ? _ + 1 : 1 < _ ? _ - 1 : _;
39
- return w = w < 1 / 6 ? g + 6 * (k - g) * w : w < 1 / 2 ? k : w < 2 / 3 ? g + 6 * (k - g) * (2 / 3 - w) : g, L(255 * w);
40
- }, v = m(f, d, l + 1 / 3), S = m(f, d, l), b = m(f, d, l - 1 / 3);
41
- return [v, S, b];
42
- }, o = function(l, c, h, d) {
43
- var f = l % 1007 / 1007, m = function(g, k, _) {
44
- return g * (_ - k) + k;
45
- }, v = m(f, c.min, c.max), S = m(f, h.min, h.max), b = m(f, d.max, d.min);
46
- return [v, S, b];
47
- }, u = function(l) {
48
- return l.split("").reduce(function(c, h, d) {
49
- return c * h.charCodeAt(0) * d + 1;
36
+ }, r = function(a, l, h) {
37
+ var f = 0.5 > h ? h * (1 + l) : h + l - h * l, d = 2 * h - f, m = function(g, k, v) {
38
+ var j = Math.round, w = 0 > v ? v + 1 : 1 < v ? v - 1 : v;
39
+ return w = w < 1 / 6 ? g + 6 * (k - g) * w : w < 1 / 2 ? k : w < 2 / 3 ? g + 6 * (k - g) * (2 / 3 - w) : g, j(255 * w);
40
+ }, S = m(d, f, a + 1 / 3), E = m(d, f, a), C = m(d, f, a - 1 / 3);
41
+ return [S, E, C];
42
+ }, i = function(a, l, h, f) {
43
+ var d = a % 1007 / 1007, m = function(g, k, v) {
44
+ return g * (v - k) + k;
45
+ }, S = m(d, l.min, l.max), E = m(d, h.min, h.max), C = m(d, f.max, f.min);
46
+ return [S, E, C];
47
+ }, u = function(a) {
48
+ return a.split("").reduce(function(l, h, f) {
49
+ return l * h.charCodeAt(0) * f + 1;
50
50
  }, 1);
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 = n(Y);
53
- return _ === "hsl" ? [D, H, z] : _ === "rgb" ? Y : pe;
51
+ }, c = function(a) {
52
+ var l = a.str, h = a.hue, f = h === void 0 ? { min: 0, max: 360 } : h, d = a.sat, m = d === void 0 ? { min: 0.35, max: 0.65 } : d, S = a.light, E = S === void 0 ? { min: 0.3, max: 0.7 } : S, C = a.hashFunction, g = C === void 0 ? u : C, k = a.scheme, v = k === void 0 ? "hex" : k, j = i(g(l), f, m, E), w = t(j, 3), Y = w[0], Z = w[1], X = w[2], J = r(Y / 360, Z, X), Te = n(J);
53
+ return v === "hsl" ? [Y, Z, X] : v === "rgb" ? J : Te;
54
54
  };
55
- e.default = a, s.exports = e.default;
55
+ e.default = c, s.exports = e.default;
56
56
  }(O, O.exports)), O.exports;
57
57
  }
58
- var Ce = ye();
59
- const be = /* @__PURE__ */ we(Ce);
60
- function G(s) {
61
- if (s === void 0)
62
- return "undefined";
63
- if (s === null)
64
- return "null";
58
+ var Ue = qe();
59
+ const We = /* @__PURE__ */ we(Ue);
60
+ function N(s) {
65
61
  const e = typeof s;
66
62
  switch (e) {
63
+ case "undefined":
64
+ return e;
67
65
  case "number":
68
- return isNaN(s) ? "NaN" : "number";
66
+ return isNaN(s) ? "NaN" : e;
69
67
  case "function":
70
- return oe(s) ? "class" : e;
68
+ return /^\s*class\s+/.test(s.toString()) ? "class" : e;
71
69
  case "object":
72
- return M(s) ? "array" : ve(s) ? "promise" : e;
70
+ return s === null ? "null" : s instanceof Promise ? "promise" : s instanceof Map ? "map" : s instanceof Set ? "set" : Array.isArray(s) ? "array" : e;
73
71
  default:
74
72
  return e;
75
73
  }
76
74
  }
77
- function M(s) {
75
+ function lt(s, e) {
76
+ if (!s)
77
+ throw new TypeError(
78
+ F(s, e || "Failed assertion. Value is not truthy. Got type: %t, value: %v")
79
+ );
80
+ }
81
+ function V(s) {
78
82
  return Array.isArray(s);
79
83
  }
80
- function ie(...s) {
81
- const e = s[0], t = (n) => M(n) && n.every((i) => e(i));
84
+ function ye(...s) {
85
+ const e = s[0], t = (n) => V(n) && n.every((r) => e(r));
82
86
  return s.length < 2 ? t : t(s[1]);
83
87
  }
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
- if (M(i) && i.every((o) => e(o)))
88
+ function ht(...s) {
89
+ const e = s[0], t = x(s[2]) ? s[2] : "Expected an array of valid items. Got type: %t, value: %v", n = (r) => {
90
+ if (V(r) && r.every((i) => e(i)))
87
91
  return !0;
88
- throw new TypeError(j(i, t));
92
+ throw new TypeError(F(r, t));
89
93
  };
90
94
  return s.length < 2 ? n : n(s[1]);
91
95
  }
92
- function $(s) {
96
+ function x(s) {
93
97
  return typeof s == "string";
94
98
  }
95
- function ze(s, e) {
96
- if ($(s))
99
+ function ft(s, e) {
100
+ if (x(s))
97
101
  return !0;
98
- throw new TypeError(j(s, e ?? "Expected a string. Got type: %t, value: %v"));
102
+ throw new TypeError(F(s, e ?? "Expected a string. Got type: %t, value: %v"));
99
103
  }
100
- function x(s) {
101
- return typeof s == "function" && !oe(s);
104
+ function P(s) {
105
+ return typeof s == "function" && !Fe(s);
102
106
  }
103
107
  function _e(s) {
104
108
  return typeof s == "number" && !isNaN(s);
105
109
  }
106
- function ve(s) {
107
- if (s == null) return !1;
108
- const e = s;
109
- return e instanceof Promise || x(e.then) && x(e.catch) && x(e.finally);
110
- }
111
- function oe(s) {
110
+ function Fe(s) {
112
111
  return typeof s == "function" && /^\s*class\s+/.test(s.toString());
113
112
  }
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
- if (i instanceof e)
113
+ function dt(...s) {
114
+ const e = s[0], t = x(s[2]) ? s[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, n = (r) => {
115
+ if (r instanceof e)
117
116
  return !0;
118
- throw new TypeError(j(i, t));
117
+ throw new TypeError(F(r, t));
119
118
  };
120
119
  return s.length < 2 ? n : n(s[1]);
121
120
  }
122
- function W(s) {
123
- return s != null && typeof s == "object" && !M(s);
121
+ function Ce(s) {
122
+ return s != null && typeof s == "object" && !V(s);
124
123
  }
125
- function j(s, e) {
126
- var i;
127
- const t = G(s), n = ((i = s == null ? void 0 : s.toString) == null ? void 0 : i.call(s)) || String(s);
124
+ function F(s, e) {
125
+ var r;
126
+ const t = N(s), n = ((r = s == null ? void 0 : s.toString) == null ? void 0 : r.call(s)) || String(s);
128
127
  return e.replaceAll("%t", t).replaceAll("%v", n);
129
128
  }
130
- const ke = () => {
129
+ var I, ee;
130
+ function Le() {
131
+ return ee || (ee = 1, I = function s(e, t) {
132
+ if (e === t) return !0;
133
+ if (e && t && typeof e == "object" && typeof t == "object") {
134
+ if (e.constructor !== t.constructor) return !1;
135
+ var n, r, i;
136
+ if (Array.isArray(e)) {
137
+ if (n = e.length, n != t.length) return !1;
138
+ for (r = n; r-- !== 0; )
139
+ if (!s(e[r], t[r])) return !1;
140
+ return !0;
141
+ }
142
+ if (e instanceof Map && t instanceof Map) {
143
+ if (e.size !== t.size) return !1;
144
+ for (r of e.entries())
145
+ if (!t.has(r[0])) return !1;
146
+ for (r of e.entries())
147
+ if (!s(r[1], t.get(r[0]))) return !1;
148
+ return !0;
149
+ }
150
+ if (e instanceof Set && t instanceof Set) {
151
+ if (e.size !== t.size) return !1;
152
+ for (r of e.entries())
153
+ if (!t.has(r[0])) return !1;
154
+ return !0;
155
+ }
156
+ if (ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
157
+ if (n = e.length, n != t.length) return !1;
158
+ for (r = n; r-- !== 0; )
159
+ if (e[r] !== t[r]) return !1;
160
+ return !0;
161
+ }
162
+ if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
163
+ if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf();
164
+ if (e.toString !== Object.prototype.toString) return e.toString() === t.toString();
165
+ if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
166
+ for (r = n; r-- !== 0; )
167
+ if (!Object.prototype.hasOwnProperty.call(t, i[r])) return !1;
168
+ for (r = n; r-- !== 0; ) {
169
+ var u = i[r];
170
+ if (!s(e[u], t[u])) return !1;
171
+ }
172
+ return !0;
173
+ }
174
+ return e !== e && t !== t;
175
+ }), I;
176
+ }
177
+ var je = Le();
178
+ const Ie = /* @__PURE__ */ we(je), Re = () => {
131
179
  };
132
- function Se(s, e) {
180
+ let R = 1;
181
+ function ve() {
182
+ return R = R % Number.MAX_SAFE_INTEGER + 1, R.toString(36) + Date.now().toString(36);
183
+ }
184
+ function be(s, e) {
185
+ return s === e;
186
+ }
187
+ function pt(s, e) {
188
+ if (s === e) return !0;
189
+ const t = N(s);
190
+ if (t !== N(e))
191
+ return !1;
192
+ switch (t) {
193
+ case "object":
194
+ let n = 0;
195
+ for (const r in s) {
196
+ if (s[r] !== e[r]) return !1;
197
+ n++;
198
+ }
199
+ return Object.keys(e).length === n;
200
+ case "array":
201
+ if (s.length !== e.length) return !1;
202
+ for (let r = 0; r < s.length; r++)
203
+ if (s[r] !== e[r]) return !1;
204
+ return !0;
205
+ case "map":
206
+ if (s.size !== e.size) return !1;
207
+ for (const r of s.keys())
208
+ if (s[r] !== e[r]) return !1;
209
+ return !0;
210
+ case "set":
211
+ if (P(s.symmetricDifference))
212
+ return s.symmetricDifference(e).size === 0;
213
+ for (const r of s.keys())
214
+ if (s[r] !== e.get(r)) return !1;
215
+ return !0;
216
+ }
217
+ return !1;
218
+ }
219
+ const mt = Ie;
220
+ function Ge(s, e) {
133
221
  const t = (n) => {
134
- const i = {};
135
- for (const o in n)
136
- s.includes(o) || (i[o] = n[o]);
137
- return i;
222
+ const r = {};
223
+ for (const i in n)
224
+ s.includes(i) || (r[i] = n[i]);
225
+ return r;
138
226
  };
139
227
  return e == null ? t : t(e);
140
228
  }
141
- function Ze() {
142
- if (typeof window < "u" && window.console)
143
- return window.console;
144
- if (typeof global < "u" && global.console)
145
- return global.console;
146
- }
147
- function xe(s) {
148
- return be({
229
+ function De(s) {
230
+ return We({
149
231
  str: s,
150
232
  sat: { min: 0.35, max: 0.55 },
151
233
  light: { min: 0.6, max: 0.6 }
152
234
  });
153
235
  }
154
- function Je(s) {
236
+ function gt(s) {
155
237
  if (s instanceof RegExp)
156
238
  return (n) => s.test(n);
157
239
  const e = {
@@ -159,21 +241,21 @@ function Je(s) {
159
241
  negative: []
160
242
  }, t = s.split(",").map((n) => n.trim()).filter((n) => n !== "");
161
243
  for (let n of t) {
162
- let i = "positive";
163
- n.startsWith("-") && (i = "negative", n = n.slice(1)), n === "*" ? e[i].push(function() {
244
+ let r = "positive";
245
+ n.startsWith("-") && (r = "negative", n = n.slice(1)), n === "*" ? e[r].push(function() {
164
246
  return !0;
165
- }) : n.endsWith("*") ? e[i].push(function(o) {
166
- return o.startsWith(n.slice(0, n.length - 1));
167
- }) : e[i].push(function(o) {
168
- return o === n;
247
+ }) : n.endsWith("*") ? e[r].push(function(i) {
248
+ return i.startsWith(n.slice(0, n.length - 1));
249
+ }) : e[r].push(function(i) {
250
+ return i === n;
169
251
  });
170
252
  }
171
253
  return function(n) {
172
- const { positive: i, negative: o } = e;
173
- return !(o.some((u) => u(n)) || i.length > 0 && !i.some((u) => u(n)));
254
+ const { positive: r, negative: i } = e;
255
+ return !(i.some((u) => u(n)) || r.length > 0 && !r.some((u) => u(n)));
174
256
  };
175
257
  }
176
- const P = {
258
+ const T = Symbol.for("DollaState"), D = Symbol.for("DollaSettableState"), Se = Symbol.for("DollaRef"), ke = Symbol.for("DollaMarkup"), b = Symbol.for("DollaMarkupElement"), q = {
177
259
  watcherCount: 0,
178
260
  increment() {
179
261
  this.watcherCount++, this._log();
@@ -188,7 +270,7 @@ const P = {
188
270
  console.log(
189
271
  `%c[DOLLA_DEV_DEBUG] %c${this._label}%c%c%c`,
190
272
  "color:#e44c4c;font-weight:bold",
191
- `color:${xe(this._label)};font-weight:bold`,
273
+ `color:${De(this._label)};font-weight:bold`,
192
274
  "color:#777",
193
275
  "color:#aaa",
194
276
  "color:#777",
@@ -196,39 +278,36 @@ const P = {
196
278
  ), this._timeout = null;
197
279
  }, 200));
198
280
  }
199
- }, T = Symbol("State"), B = Symbol("SettableState"), re = Symbol("Ref");
281
+ };
200
282
  function p(s) {
201
283
  return (s == null ? void 0 : s[T]) === !0;
202
284
  }
203
- function R(s) {
204
- return (s == null ? void 0 : s[B]) === !0;
205
- }
206
- function ue(s) {
207
- return (s == null ? void 0 : s[re]) === !0;
285
+ function B(s) {
286
+ return (s == null ? void 0 : s[D]) === !0;
208
287
  }
209
288
  function Ee(s) {
289
+ return (s == null ? void 0 : s[Se]) === !0;
290
+ }
291
+ function Be(s) {
210
292
  return p(s) ? s.get() : s;
211
293
  }
212
- function F(s) {
213
- return R(s) ? new U(s) : p(s) ? s : new U({
294
+ function L(s) {
295
+ return B(s) ? new U(s) : p(s) ? s : new U({
214
296
  get() {
215
297
  return s;
216
298
  },
217
299
  watch(e, t = {}) {
218
- return t != null && t.lazy || e(s), ke;
300
+ return t != null && t.lazy || e(s), Re;
219
301
  }
220
302
  });
221
303
  }
222
- class A {
304
+ class z {
223
305
  constructor(e, t) {
224
- r(this, "value");
225
- r(this, "watchers", []);
226
- r(this, "equals", A.defaultEquals);
306
+ o(this, "value");
307
+ o(this, "watchers", []);
308
+ o(this, "equals", be);
227
309
  this.value = e, t != null && t.equals && (this.equals = t.equals);
228
310
  }
229
- static defaultEquals(e, t) {
230
- return e === t;
231
- }
232
311
  get() {
233
312
  return this.value;
234
313
  }
@@ -244,19 +323,19 @@ class A {
244
323
  }
245
324
  }
246
325
  watch(e, t) {
247
- return this.watchers.push(e), t != null && t.lazy || e(this.value), P.increment(), () => {
326
+ return this.watchers.push(e), t != null && t.lazy || e(this.value), q.increment(), () => {
248
327
  const n = this.watchers.indexOf(e);
249
- n > -1 && this.watchers.splice(n, 1), P.decrement();
328
+ n > -1 && this.watchers.splice(n, 1), q.decrement();
250
329
  };
251
330
  }
252
331
  }
253
- var X;
254
- X = T;
332
+ var se;
333
+ se = T;
255
334
  class U {
256
335
  constructor(e) {
257
336
  // Instances will pass isState() with this symbol
258
- r(this, X, !0);
259
- r(this, "__value");
337
+ o(this, se, !0);
338
+ o(this, "__value");
260
339
  if (e == null)
261
340
  throw new TypeError("Value is null");
262
341
  this.__value = e;
@@ -268,18 +347,18 @@ class U {
268
347
  return this.__value.watch(e, t);
269
348
  }
270
349
  }
271
- function I(s, e) {
272
- const t = new A(s, e);
273
- return [new U(t), (i) => t.set(i)];
350
+ function G(s, e) {
351
+ const t = new z(s, e);
352
+ return [new U(t), (r) => t.set(r)];
274
353
  }
275
- var ee, te;
276
- te = T, ee = B;
277
- class $e {
354
+ var re, ie;
355
+ ie = T, re = D;
356
+ class ze {
278
357
  constructor(e) {
279
358
  // Instances will pass isState() and isSettableState() with these symbols
280
- r(this, te, !0);
281
- r(this, ee, !0);
282
- r(this, "__value");
359
+ o(this, ie, !0);
360
+ o(this, re, !0);
361
+ o(this, "__value");
283
362
  if (e == null)
284
363
  throw new TypeError("Value is null");
285
364
  this.__value = e;
@@ -294,66 +373,66 @@ class $e {
294
373
  return this.__value.watch(e, t);
295
374
  }
296
375
  }
297
- function Qe(s, e) {
298
- return new $e(new A(s, e));
376
+ function wt(s, e) {
377
+ return new ze(new z(s, e));
299
378
  }
300
- function Xe(s, e) {
379
+ function yt(s, e) {
301
380
  return {
302
381
  [T]: !0,
303
- [B]: !0,
382
+ [D]: !0,
304
383
  get: s.get.bind(s),
305
384
  watch: s.watch.bind(s),
306
385
  set: e
307
386
  };
308
387
  }
309
- function et(s, e) {
388
+ function _t(s, e) {
310
389
  return function(n) {
311
- const i = s.get();
312
- let o;
313
- typeof n == "function" ? o = n(i) : o = n, e(o, i);
390
+ const r = s.get();
391
+ let i;
392
+ typeof n == "function" ? i = n(r) : i = n, e(i, r);
314
393
  };
315
394
  }
316
- const J = Symbol("EMPTY");
317
- class Ne {
395
+ const te = Symbol("EMPTY");
396
+ class Ke {
318
397
  constructor(e, t, n) {
319
- r(this, "equals", A.defaultEquals);
398
+ o(this, "equals", be);
320
399
  /**
321
400
  * Array of states this holder's value is derived from.
322
401
  */
323
- r(this, "sources", []);
402
+ o(this, "sources", []);
324
403
  /**
325
404
  * The function that does the deriving. Receives source values and returns a derived value.
326
405
  */
327
- r(this, "fn");
406
+ o(this, "fn");
328
407
  /**
329
408
  *
330
409
  */
331
- r(this, "sourceWatcher", K());
410
+ o(this, "sourceWatcher", K());
332
411
  /**
333
412
  * Array of functions awaiting notification when this holder's value changes.
334
413
  */
335
- r(this, "watchers", []);
414
+ o(this, "watchers", []);
336
415
  /**
337
416
  * True when this holder is actively watching sources.
338
417
  */
339
- r(this, "isWatchingSources", !1);
418
+ o(this, "isWatchingSources", !1);
340
419
  /**
341
420
  * Latest values as received from sources.
342
421
  */
343
- r(this, "previousSourceValues");
422
+ o(this, "previousSourceValues");
344
423
  /**
345
424
  * The current value as returned from `fn` (may be a State)
346
425
  */
347
- r(this, "value", J);
426
+ o(this, "value", te);
348
427
  /**
349
428
  * The current unwrapped value.
350
429
  */
351
- r(this, "rawValue");
430
+ o(this, "rawValue");
352
431
  /**
353
432
  * When value is a State, this function will stop watching its value.
354
433
  */
355
- r(this, "stopWatchingCurrentValue");
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);
434
+ o(this, "stopWatchingCurrentValue");
435
+ this.sources = e.map(L), this.fn = t, n != null && n.equals && (this.equals = n.equals), this.previousSourceValues = new Array(e.length).fill(te, 0, e.length);
357
436
  }
358
437
  /*==========================*\
359
438
  || "Public" methods ||
@@ -364,8 +443,8 @@ class Ne {
364
443
  watch(e, t) {
365
444
  this.isWatchingSources || this.startWatchingSources();
366
445
  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();
446
+ return n.push(e), t != null && t.lazy || e(this.rawValue), q.increment(), () => {
447
+ n.splice(n.indexOf(e), 1), this.isWatchingSources && n.length === 0 && this.stopWatchingSources(), q.decrement();
369
448
  };
370
449
  }
371
450
  /*==========================*\
@@ -377,26 +456,26 @@ class Ne {
377
456
  }
378
457
  update() {
379
458
  const e = this.sources, t = this.previousSourceValues;
380
- let n = !1, i;
381
- for (let o = 0; o < e.length; o++)
382
- i = e[o].get(), !n && !this.equals(i, t[o]) && (n = !0), t[o] = i;
459
+ let n = !1, r;
460
+ for (let i = 0; i < e.length; i++)
461
+ r = e[i].get(), !n && !this.equals(r, t[i]) && (n = !0), t[i] = r;
383
462
  n && this.setValue(this.fn(...t));
384
463
  }
385
464
  getValue() {
386
465
  return this.isWatchingSources || this.update(), this.rawValue;
387
466
  }
388
467
  setValue(e) {
389
- this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = e, this.rawValue = Ee(e), this.isWatchingSources && p(e) ? this.stopWatchingCurrentValue = e.watch((t) => {
468
+ this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = e, this.rawValue = Be(e), this.isWatchingSources && p(e) ? this.stopWatchingCurrentValue = e.watch((t) => {
390
469
  this.rawValue = t, this.notify(t);
391
470
  }) : this.notify(this.rawValue);
392
471
  }
393
472
  startWatchingSources() {
394
473
  const e = this.previousSourceValues;
395
474
  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
- const o = this.fn(...e);
399
- this.equals(o, this.value) || this.setValue(o);
475
+ this.sourceWatcher.watch([this.sources[n]], (r) => {
476
+ if (e[n] = r, this.isWatchingSources) {
477
+ const i = this.fn(...e);
478
+ this.equals(i, this.value) || this.setValue(i);
400
479
  }
401
480
  });
402
481
  this.isWatchingSources = !0;
@@ -407,18 +486,18 @@ class Ne {
407
486
  this.sourceWatcher.stopAll(), this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.isWatchingSources = !1;
408
487
  }
409
488
  }
410
- function Me(s, e, t) {
411
- const n = new Ne(s, e, t);
489
+ function He(s, e, t) {
490
+ const n = new Ke(s, e, t);
412
491
  return new U(n);
413
492
  }
414
- var ne, se;
415
- se = re, ne = T;
416
- class Ae {
493
+ var oe, ue;
494
+ ue = Se, oe = T;
495
+ class Ye {
417
496
  constructor(e) {
418
497
  // Instances will pass isRef() and isState() with these symbols
419
- r(this, se, !0);
420
- r(this, ne, !0);
421
- r(this, "__value");
498
+ o(this, ue, !0);
499
+ o(this, oe, !0);
500
+ o(this, "__value");
422
501
  this.__value = e;
423
502
  }
424
503
  get() {
@@ -434,8 +513,8 @@ class Ae {
434
513
  this.__value.set(e);
435
514
  }
436
515
  }
437
- function tt() {
438
- return new Ae(new A(void 0));
516
+ function Ct() {
517
+ return new Ye(new z(void 0));
439
518
  }
440
519
  function K() {
441
520
  const s = [];
@@ -443,11 +522,11 @@ function K() {
443
522
  watch(e, t) {
444
523
  if (e.length === 0)
445
524
  throw new TypeError("Expected at least one state to watch.");
446
- e = e.map(F);
525
+ e = e.map(L);
447
526
  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();
527
+ return e.length > 1 ? n = He(e, t).watch(() => null) : n = e[0].watch(t), s.push(n), () => {
528
+ let r = s.indexOf(n);
529
+ r > -1 && s.splice(r, 1), n();
451
530
  };
452
531
  },
453
532
  stopAll() {
@@ -456,29 +535,32 @@ function K() {
456
535
  }
457
536
  };
458
537
  }
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
- c && (i === 1 && l(), l(c));
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
- ` || e === "\r" ? (l(), i = 2) : o += e), i === 3 && o === "!--" && (i = 4, a = a[0]);
538
+ function Ze(s) {
539
+ for (var e, t, n = arguments, r = 1, i = "", u = "", c = [0], a = function(f) {
540
+ r === 1 && (f || (i = i.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? c.push(f ? n[f] : i) : r === 3 && (f || i) ? (c[1] = f ? n[f] : i, r = 2) : r === 2 && i === "..." && f ? c[2] = Object.assign(c[2] || {}, n[f]) : r === 2 && i && !f ? (c[2] = c[2] || {})[i] = !0 : r >= 5 && (r === 5 ? ((c[2] = c[2] || {})[t] = f ? i ? i + n[f] : n[f] : i, r = 6) : (f || i) && (c[2][t] += f ? i + n[f] : i)), i = "";
541
+ }, l = 0; l < s.length; l++) {
542
+ l && (r === 1 && a(), a(l));
543
+ for (var h = 0; h < s[l].length; h++) e = s[l][h], r === 1 ? e === "<" ? (a(), c = [c, "", null], r = 3) : i += e : r === 4 ? i === "--" && e === ">" ? (r = 1, i = "") : i = e + i[0] : u ? e === u ? u = "" : i += e : e === '"' || e === "'" ? u = e : e === ">" ? (a(), r = 1) : r && (e === "=" ? (r = 5, t = i, i = "") : e === "/" && (r < 5 || s[l][h + 1] === ">") ? (a(), r === 3 && (c = c[0]), r = c, (c = c[0]).push(this.apply(null, r.slice(1))), r = 0) : e === " " || e === " " || e === `
544
+ ` || e === "\r" ? (a(), r = 2) : i += e), r === 3 && i === "!--" && (r = 4, c = c[0]);
466
545
  }
467
- return l(), a.length > 2 ? a.slice(1) : a[1];
546
+ return a(), c.length > 2 ? c.slice(1) : c[1];
468
547
  }
469
- class Te {
548
+ var ae;
549
+ ae = b;
550
+ class Xe {
470
551
  constructor(e) {
471
- r(this, "node");
472
- r(this, "endNode");
473
- r(this, "$predicate");
474
- r(this, "stopCallback");
475
- r(this, "thenContent");
476
- r(this, "elseContent");
477
- r(this, "connectedContent", []);
478
- r(this, "elementContext");
479
- r(this, "initialUpdateHappened", !1);
480
- r(this, "previousValue");
481
- this.$predicate = e.$predicate, this.thenContent = e.thenContent ? V(e.thenContent) : void 0, this.elseContent = e.elseContent ? V(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(""));
552
+ o(this, ae, !0);
553
+ o(this, "node");
554
+ o(this, "endNode");
555
+ o(this, "$predicate");
556
+ o(this, "stopCallback");
557
+ o(this, "thenContent");
558
+ o(this, "elseContent");
559
+ o(this, "connectedContent", []);
560
+ o(this, "elementContext");
561
+ o(this, "initialUpdateHappened", !1);
562
+ o(this, "previousValue");
563
+ this.$predicate = e.$predicate, this.thenContent = e.thenContent ? A(e.thenContent) : void 0, this.elseContent = e.elseContent ? A(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(""));
482
564
  }
483
565
  get isMounted() {
484
566
  return this.node.parentNode != null;
@@ -491,8 +573,8 @@ class Te {
491
573
  unmount(e = !1) {
492
574
  var t, n;
493
575
  this.stopCallback && (this.stopCallback(), this.stopCallback = void 0);
494
- for (const i of this.connectedContent)
495
- i.unmount(e);
576
+ for (const r of this.connectedContent)
577
+ r.unmount(e);
496
578
  this.connectedContent = [], this.isMounted && ((t = this.node.parentNode) == null || t.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode));
497
579
  }
498
580
  update(e) {
@@ -500,44 +582,40 @@ class Te {
500
582
  for (const n of this.connectedContent)
501
583
  n.unmount(!1);
502
584
  if (this.connectedContent = [], this.node.parentNode != null) {
503
- e && this.thenContent ? this.connectedContent = C(this.elementContext, this.thenContent) : !e && this.elseContent && (this.connectedContent = C(this.elementContext, this.elseContent));
585
+ e && this.thenContent ? this.connectedContent = _(this.elementContext, this.thenContent) : !e && this.elseContent && (this.connectedContent = _(this.elementContext, this.elseContent));
504
586
  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
- i.mount(this.node.parentNode, o);
587
+ const r = this.connectedContent[n], i = ((t = this.connectedContent[n - 1]) == null ? void 0 : t.node) ?? this.node;
588
+ r.mount(this.node.parentNode, i);
507
589
  }
508
590
  this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Conditional (${e ? "truthy" : "falsy"})`);
509
591
  }
510
592
  }
511
593
  }
512
- const Oe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
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
- return e;
518
- };
519
- const Pe = (s) => /^on[A-Z]/.test(s);
520
- class Ue {
521
- constructor({ tag: e, props: t, children: n, elementContext: i }) {
522
- r(this, "node");
523
- r(this, "props");
524
- r(this, "children");
525
- r(this, "stopCallbacks", []);
526
- r(this, "elementContext");
527
- r(this, "uniqueId", ae());
594
+ const Je = (s) => /^on[A-Z]/.test(s);
595
+ var ce;
596
+ ce = b;
597
+ class Qe {
598
+ constructor({ tag: e, props: t, children: n, elementContext: r }) {
599
+ o(this, ce, !0);
600
+ o(this, "node");
601
+ o(this, "props");
602
+ o(this, "children");
603
+ o(this, "stopCallbacks", []);
604
+ o(this, "elementContext");
605
+ o(this, "uniqueId", ve());
528
606
  // Track the ref so we can nullify it on unmount.
529
- r(this, "ref");
607
+ o(this, "ref");
530
608
  // Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
531
- r(this, "canClickAway", !1);
532
- if (i = { ...i }, e.toLowerCase() === "svg" && (i.isSVG = !0), i.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", e) : this.node = document.createElement(e), i.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), t.ref)
533
- if (ue(t.ref))
609
+ o(this, "canClickAway", !1);
610
+ 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), t.ref)
611
+ if (Ee(t.ref))
534
612
  this.ref = t.ref;
535
613
  else
536
614
  throw new Error("Expected ref to be a Ref object. Got: " + t.ref);
537
615
  this.props = {
538
- ...Se(["ref", "class", "className"], t),
616
+ ...Ge(["ref", "class", "className"], t),
539
617
  class: t.className ?? t.class
540
- }, this.children = n ? C(i, n) : [], this.elementContext = i;
618
+ }, this.children = n ? _(r, n) : [], this.elementContext = r;
541
619
  }
542
620
  get isMounted() {
543
621
  return this.node.parentNode != null;
@@ -570,79 +648,79 @@ class Ue {
570
648
  }
571
649
  attachProp(e, t, n) {
572
650
  p(e) ? this.stopCallbacks.push(
573
- e.watch((i) => {
574
- this.elementContext.root.render.write(() => {
575
- t(i);
651
+ e.watch((r) => {
652
+ this.elementContext.root.batch.write(() => {
653
+ t(r);
576
654
  }, n);
577
655
  })
578
- ) : this.elementContext.root.render.write(() => {
656
+ ) : this.elementContext.root.batch.write(() => {
579
657
  t(e);
580
658
  }, n);
581
659
  }
582
660
  applyProps(e, t) {
583
661
  for (const n in t) {
584
- const i = t[n];
662
+ const r = t[n];
585
663
  if (n === "attributes") {
586
- const o = i;
587
- for (const u in o)
664
+ const i = r;
665
+ for (const u in i)
588
666
  this.attachProp(
589
- o[u],
590
- (a) => {
591
- a == null ? e.removeAttribute(u) : e.setAttribute(u, String(a));
667
+ i[u],
668
+ (c) => {
669
+ c == null ? e.removeAttribute(u) : e.setAttribute(u, String(c));
592
670
  },
593
671
  this.getUpdateKey("attr", u)
594
672
  );
595
673
  } else if (n === "eventListeners") {
596
- const o = i;
597
- for (const u in o) {
598
- const a = p(i) ? (l) => i.get()(l) : i;
599
- e.addEventListener(u, a), this.stopCallbacks.push(() => {
600
- e.removeEventListener(u, a);
674
+ const i = r;
675
+ for (const u in i) {
676
+ const c = p(r) ? (a) => r.get()(a) : r;
677
+ e.addEventListener(u, c), this.stopCallbacks.push(() => {
678
+ e.removeEventListener(u, c);
601
679
  });
602
680
  }
603
681
  } else if (n === "onClickOutside" || n === "onclickoutside") {
604
- const o = (a) => {
605
- this.canClickAway && !e.contains(a.target) && (p(i) ? i.get()(a) : i(a));
682
+ const i = (c) => {
683
+ this.canClickAway && !e.contains(c.target) && (p(r) ? r.get()(c) : r(c));
606
684
  }, u = { capture: !0 };
607
- window.addEventListener("click", o, u), this.stopCallbacks.push(() => {
608
- window.removeEventListener("click", o, u);
685
+ window.addEventListener("click", i, u), this.stopCallbacks.push(() => {
686
+ window.removeEventListener("click", i, u);
609
687
  });
610
688
  } else if (n === "$$value") {
611
- if (!R(i))
612
- throw new TypeError(`$$value attribute must be a settable state. Got: ${i}`);
689
+ if (!B(r))
690
+ throw new TypeError(`$$value attribute must be a settable state. Got: ${r}`);
613
691
  this.attachProp(
614
- i,
692
+ r,
615
693
  (u) => {
616
694
  u == null ? e.value = "" : e.value = String(u);
617
695
  },
618
696
  this.getUpdateKey("attr", "value")
619
697
  );
620
- const o = (u) => {
621
- const a = We(i.get(), u.currentTarget.value);
622
- i.set(a);
698
+ const i = (u) => {
699
+ const c = et(r.get(), u.currentTarget.value);
700
+ r.set(c);
623
701
  };
624
- e.addEventListener("input", o), this.stopCallbacks.push(() => {
625
- e.removeEventListener("input", o);
702
+ e.addEventListener("input", i), this.stopCallbacks.push(() => {
703
+ e.removeEventListener("input", i);
626
704
  });
627
- } else if (Pe(n)) {
628
- const o = n.slice(2).toLowerCase(), u = p(i) ? (a) => i.get()(a) : i;
629
- e.addEventListener(o, u), this.stopCallbacks.push(() => {
630
- e.removeEventListener(o, u);
705
+ } else if (Je(n)) {
706
+ const i = n.slice(2).toLowerCase(), u = p(r) ? (c) => r.get()(c) : r;
707
+ e.addEventListener(i, u), this.stopCallbacks.push(() => {
708
+ e.removeEventListener(i, u);
631
709
  });
632
710
  } else if (n.includes("-"))
633
711
  this.attachProp(
634
- i,
635
- (o) => {
636
- o == null ? e.removeAttribute(n) : e.setAttribute(n, String(o));
712
+ r,
713
+ (i) => {
714
+ i == null ? e.removeAttribute(n) : e.setAttribute(n, String(i));
637
715
  },
638
716
  this.getUpdateKey("attr", n)
639
717
  );
640
- else if (!Fe.includes(n))
718
+ else if (!tt.includes(n))
641
719
  if (this.elementContext.isSVG)
642
720
  this.attachProp(
643
- i,
644
- (o) => {
645
- o != null ? e.setAttribute(n, String(t[n])) : e.removeAttribute(n);
721
+ r,
722
+ (i) => {
723
+ i != null ? e.setAttribute(n, String(t[n])) : e.removeAttribute(n);
646
724
  },
647
725
  this.getUpdateKey("attr", n)
648
726
  );
@@ -651,27 +729,27 @@ class Ue {
651
729
  case "contentEditable":
652
730
  case "value":
653
731
  this.attachProp(
654
- i,
655
- (o) => {
656
- e[n] = String(o);
732
+ r,
733
+ (i) => {
734
+ e[n] = String(i);
657
735
  },
658
736
  this.getUpdateKey("prop", n)
659
737
  );
660
738
  break;
661
739
  case "for":
662
740
  this.attachProp(
663
- i,
664
- (o) => {
665
- e.htmlFor = o;
741
+ r,
742
+ (i) => {
743
+ e.htmlFor = i;
666
744
  },
667
745
  this.getUpdateKey("prop", "htmlFor")
668
746
  );
669
747
  break;
670
748
  case "checked":
671
749
  this.attachProp(
672
- i,
673
- (o) => {
674
- e.checked = o, o ? e.setAttribute("checked", "") : e.removeAttribute("checked");
750
+ r,
751
+ (i) => {
752
+ e.checked = i, i ? e.setAttribute("checked", "") : e.removeAttribute("checked");
675
753
  },
676
754
  this.getUpdateKey("prop", "checked")
677
755
  );
@@ -682,31 +760,31 @@ class Ue {
682
760
  case "translate":
683
761
  case "type":
684
762
  case "title": {
685
- const o = n.toLowerCase();
763
+ const i = n.toLowerCase();
686
764
  this.attachProp(
687
- i,
765
+ r,
688
766
  (u) => {
689
- u == null ? e.removeAttribute(o) : e.setAttribute(o, String(u));
767
+ u == null ? e.removeAttribute(i) : e.setAttribute(i, String(u));
690
768
  },
691
- this.getUpdateKey("attr", o)
769
+ this.getUpdateKey("attr", i)
692
770
  );
693
771
  break;
694
772
  }
695
773
  case "autocomplete":
696
774
  case "autocapitalize":
697
775
  this.attachProp(
698
- i,
699
- (o) => {
700
- typeof o == "string" ? e.autocomplete = o : o ? e.autocomplete = "on" : e.autocomplete = "off";
776
+ r,
777
+ (i) => {
778
+ typeof i == "string" ? e.autocomplete = i : i ? e.autocomplete = "on" : e.autocomplete = "off";
701
779
  },
702
780
  this.getUpdateKey("prop", n)
703
781
  );
704
782
  break;
705
783
  default: {
706
784
  this.attachProp(
707
- i,
708
- (o) => {
709
- e[n] = o;
785
+ r,
786
+ (i) => {
787
+ e[n] = i;
710
788
  },
711
789
  this.getUpdateKey("prop", n)
712
790
  );
@@ -716,132 +794,135 @@ class Ue {
716
794
  }
717
795
  }
718
796
  applyStyles(e, t, n) {
719
- const i = [];
797
+ const r = [];
720
798
  if (p(t)) {
721
- let o;
722
- const u = t.watch((a) => {
723
- this.elementContext.root.render.write(
799
+ let i;
800
+ const u = t.watch((c) => {
801
+ this.elementContext.root.batch.write(
724
802
  () => {
725
- x(o) && o(), e.style.cssText = "", o = this.applyStyles(e, a, n);
803
+ P(i) && i(), e.style.cssText = "", i = this.applyStyles(e, c, n);
726
804
  },
727
805
  this.getUpdateKey("styles", "*")
728
806
  );
729
807
  });
730
- n.push(u), i.push(u);
808
+ n.push(u), r.push(u);
731
809
  } else {
732
- const o = ce(t);
733
- for (const u in o) {
734
- const { value: a, priority: l } = o[u];
735
- if (p(a)) {
736
- const c = a.watch((h) => {
737
- this.elementContext.root.render.write(() => {
738
- h ? e.style.setProperty(u, String(h), l) : e.style.removeProperty(u);
810
+ const i = Me(t);
811
+ for (const u in i) {
812
+ const { value: c, priority: a } = i[u];
813
+ if (p(c)) {
814
+ const l = c.watch((h) => {
815
+ this.elementContext.root.batch.write(() => {
816
+ h ? e.style.setProperty(u, String(h), a) : e.style.removeProperty(u);
739
817
  });
740
818
  });
741
- n.push(c), i.push(c);
742
- } else a != null && e.style.setProperty(u, String(a));
819
+ n.push(l), r.push(l);
820
+ } else c != null && e.style.setProperty(u, String(c));
743
821
  }
744
822
  }
745
823
  return function() {
746
- for (const u of i)
824
+ for (const u of r)
747
825
  u(), n.splice(n.indexOf(u), 1);
748
826
  };
749
827
  }
750
828
  applyClasses(e, t, n) {
751
- const i = [];
829
+ const r = [];
752
830
  if (p(t)) {
753
- let o;
754
- const u = t.watch((a) => {
755
- this.elementContext.root.render.write(
831
+ let i;
832
+ const u = t.watch((c) => {
833
+ this.elementContext.root.batch.write(
756
834
  () => {
757
- x(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, a, n);
835
+ P(i) && i(), e.removeAttribute("class"), i = this.applyClasses(e, c, n);
758
836
  },
759
837
  this.getUpdateKey("attr", "class")
760
838
  );
761
839
  });
762
- n.push(u), i.push(u);
840
+ n.push(u), r.push(u);
763
841
  } else {
764
- const o = le(t);
765
- for (const u in o) {
766
- const a = o[u];
767
- if (p(a)) {
768
- const l = a.watch((c) => {
769
- this.elementContext.root.render.write(() => {
770
- c ? e.classList.add(u) : e.classList.remove(u);
842
+ const i = xe(t);
843
+ for (const u in i) {
844
+ const c = i[u];
845
+ if (p(c)) {
846
+ const a = c.watch((l) => {
847
+ this.elementContext.root.batch.write(() => {
848
+ l ? e.classList.add(u) : e.classList.remove(u);
771
849
  });
772
850
  });
773
- n.push(l), i.push(l);
774
- } else a && e.classList.add(u);
851
+ n.push(a), r.push(a);
852
+ } else c && e.classList.add(u);
775
853
  }
776
854
  }
777
855
  return function() {
778
- for (const u of i)
856
+ for (const u of r)
779
857
  u(), n.splice(n.indexOf(u), 1);
780
858
  };
781
859
  }
782
860
  }
783
- function le(s) {
861
+ function xe(s) {
784
862
  let e = {};
785
- if ($(s)) {
863
+ if (x(s)) {
786
864
  const t = s.split(" ");
787
865
  for (const n of t)
788
866
  e[n] = !0;
789
- } else W(s) ? Object.assign(e, s) : Array.isArray(s) && Array.from(s).filter(Boolean).forEach((t) => {
790
- Object.assign(e, le(t));
867
+ } else Ce(s) ? Object.assign(e, s) : Array.isArray(s) && Array.from(s).filter(Boolean).forEach((t) => {
868
+ Object.assign(e, xe(t));
791
869
  });
792
870
  return delete e.undefined, e;
793
871
  }
794
- function ce(s) {
872
+ function Me(s) {
795
873
  let e = {};
796
- if ($(s)) {
874
+ if (x(s)) {
797
875
  const t = s.split(";").filter((n) => n.trim() !== "");
798
876
  for (const n of t) {
799
- const [i, o] = n.split(":"), u = {
800
- value: o
877
+ const [r, i] = n.split(":"), u = {
878
+ value: i
801
879
  };
802
- o.includes("!important") ? (u.priority = "important", u.value = o.replace("!important", "").trim()) : u.value = o.trim(), e[Q(i.trim())] = u;
880
+ i.includes("!important") ? (u.priority = "important", u.value = i.replace("!important", "").trim()) : u.value = i.trim(), e[ne(r.trim())] = u;
803
881
  }
804
882
  }
805
- if (W(s))
883
+ if (Ce(s))
806
884
  for (const t in s)
807
- t.startsWith("--") ? e[t] = { value: s[t] } : e[Q(t)] = { value: s[t] };
885
+ t.startsWith("--") ? e[t] = { value: s[t] } : e[ne(t)] = { value: s[t] };
808
886
  else Array.isArray(s) && Array.from(s).filter((t) => t != null).forEach((t) => {
809
- Object.assign(e, ce(t));
887
+ Object.assign(e, Me(t));
810
888
  });
811
889
  return e;
812
890
  }
813
- function Q(s) {
891
+ function ne(s) {
814
892
  return s.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, t) => (t ? "-" : "") + e.toLowerCase());
815
893
  }
816
- function We(s, e) {
894
+ function et(s, e) {
817
895
  const t = typeof s;
818
896
  return t === "string" ? String(e) : t === "number" ? Number(e) : t === "boolean" ? !!e : e;
819
897
  }
820
- const Fe = ["ref", "children", "class", "style", "data"];
821
- class qe {
898
+ const tt = ["ref", "children", "class", "style", "data"];
899
+ var le;
900
+ le = b;
901
+ class nt {
822
902
  constructor({ states: e, renderFn: t, elementContext: n }) {
823
- r(this, "node");
824
- r(this, "endNode");
825
- r(this, "connectedViews", []);
826
- r(this, "renderFn");
827
- r(this, "elementContext");
828
- r(this, "observerControls");
829
- r(this, "watcher", K());
903
+ o(this, le, !0);
904
+ o(this, "node");
905
+ o(this, "endNode");
906
+ o(this, "connectedViews", []);
907
+ o(this, "renderFn");
908
+ o(this, "elementContext");
909
+ o(this, "observerControls");
910
+ o(this, "watcher", K());
830
911
  this.elementContext = n, this.renderFn = t, this.node = document.createComment("Observer"), this.endNode = document.createComment("/Observer");
831
- let i;
912
+ let r;
832
913
  this.observerControls = {
833
914
  start: () => {
834
- i == null && (i = this.watcher.watch(e, (...o) => {
835
- const u = this.renderFn(...o);
836
- if (!fe(u))
837
- throw console.error(u), new TypeError(
838
- `Observer received invalid value to render. Got type: ${G(u)}, value: ${u}`
915
+ r == null && (r = this.watcher.watch(e, (...i) => {
916
+ let u = this.renderFn(...i);
917
+ if (!Ve(u))
918
+ throw console.error(u, i), new TypeError(
919
+ `Observer received invalid value to render. Got type: ${N(u)}, value: ${u}`
839
920
  );
840
921
  Array.isArray(u) ? this.update(...u) : this.update(u);
841
922
  }));
842
923
  },
843
924
  stop: () => {
844
- i != null && (i(), i = void 0);
925
+ r != null && (r(), r = void 0);
845
926
  }
846
927
  };
847
928
  }
@@ -861,82 +942,78 @@ class qe {
861
942
  (t = this.connectedViews.pop()) == null || t.unmount(e);
862
943
  }
863
944
  update(...e) {
864
- var n, i;
945
+ var n, r;
865
946
  if (this.cleanup(!1), e == null || !this.isMounted)
866
947
  return;
867
- const t = e.map((o) => he(o) ? o : N(o) ? E(C(this.elementContext, o)) : E(C(this.elementContext, V(o))));
868
- for (const o of t) {
948
+ const t = e.map((i) => Ne(i) ? i : $(i) ? M(_(this.elementContext, i)) : M(_(this.elementContext, A(i))));
949
+ for (const i of t) {
869
950
  const u = ((n = this.connectedViews.at(-1)) == null ? void 0 : n.node) || this.node;
870
- o.mount(this.node.parentNode, u), this.connectedViews.push(o);
951
+ i.mount(this.node.parentNode, u), this.connectedViews.push(i);
871
952
  }
872
953
  if (this.elementContext.root.getEnv() === "development") {
873
- const o = (i = this.connectedViews.at(-1)) == null ? void 0 : i.node;
874
- this.endNode.previousSibling !== o && this.node.parentNode.insertBefore(this.endNode, (o == null ? void 0 : o.nextSibling) ?? null);
954
+ const i = (r = this.connectedViews.at(-1)) == null ? void 0 : r.node;
955
+ this.endNode.previousSibling !== i && this.node.parentNode.insertBefore(this.endNode, (i == null ? void 0 : i.nextSibling) ?? null);
875
956
  }
876
957
  }
877
958
  }
878
- class Le {
959
+ var he;
960
+ he = b;
961
+ class $e {
879
962
  constructor(e) {
880
- r(this, "node");
881
- r(this, "endNode");
882
- r(this, "$children");
883
- r(this, "stopCallback");
884
- r(this, "mountedChildren", []);
885
- r(this, "elementContext");
886
- this.$children = e.$children, this.elementContext = e.elementContext, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Outlet"), this.endNode = document.createComment("/Outlet")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
887
- }
888
- get isMounted() {
889
- var e;
890
- return ((e = this.node) == null ? void 0 : e.parentNode) != null;
963
+ o(this, he, !0);
964
+ o(this, "node", document.createTextNode(""));
965
+ o(this, "isMounted", !1);
966
+ o(this, "elements");
967
+ o(this, "children", []);
968
+ o(this, "stopCallback");
969
+ this.elements = e;
891
970
  }
892
971
  mount(e, t) {
893
- this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.stopCallback = this.$children.watch((n) => {
972
+ this.isMounted || (this.isMounted = !0, e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), p(this.elements) ? this.stopCallback = this.elements.watch((n) => {
894
973
  this.update(n);
895
- }));
974
+ }) : this.update(this.children));
896
975
  }
897
976
  unmount(e = !1) {
898
- var t;
899
977
  if (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.isMounted) {
900
- for (const n of this.mountedChildren)
901
- n.unmount(e);
902
- this.mountedChildren = [], (t = this.endNode.parentNode) == null || t.removeChild(this.endNode);
978
+ for (const t of this.children)
979
+ t.unmount(e);
980
+ this.children = [], this.isMounted = !1;
903
981
  }
904
982
  }
905
983
  update(e) {
906
- var t, n, i;
907
- for (const o of this.mountedChildren)
908
- o.unmount(!1);
909
- for (let o = 0; o < e.length; o++) {
910
- const u = e[o], a = o > 0 ? e[o] : void 0;
911
- u.mount(this.node.parentElement, a == null ? void 0 : a.node);
984
+ for (const t of this.children)
985
+ t.unmount(!1);
986
+ for (let t = 0; t < e.length; t++) {
987
+ const n = e[t], r = t > 0 ? e[t] : void 0;
988
+ n.mount(this.node.parentElement, r == null ? void 0 : r.node);
912
989
  }
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
- this.endNode,
915
- ((n = (t = this.mountedChildren[this.mountedChildren.length - 1]) == null ? void 0 : t.node) == null ? void 0 : n.nextSibling) ?? null
916
- ));
990
+ this.children = e;
917
991
  }
918
992
  }
919
- class Ie {
993
+ var fe;
994
+ fe = b;
995
+ class st {
920
996
  constructor(e) {
921
- r(this, "config");
922
- r(this, "element");
997
+ o(this, fe, !0);
998
+ o(this, "config");
999
+ o(this, "element");
923
1000
  this.config = e;
924
1001
  }
925
1002
  get isMounted() {
926
1003
  return this.element ? this.element.isMounted : !1;
927
1004
  }
928
1005
  mount(e, t) {
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);
1006
+ const { content: n, parent: r } = this.config;
1007
+ Ne(n) ? this.element = n : $(n) ? this.element = M(_(this.config.elementContext, n)) : this.element = M(_(this.config.elementContext, A(n))), this.element.mount(r);
931
1008
  }
932
1009
  unmount(e = !1) {
933
1010
  var t;
934
1011
  (t = this.element) != null && t.isMounted && this.element.unmount(e);
935
1012
  }
936
1013
  }
937
- class Ge {
1014
+ class rt {
938
1015
  constructor(e) {
939
- r(this, "__view");
1016
+ o(this, "__view");
940
1017
  this.__view = e;
941
1018
  const t = Object.getOwnPropertyDescriptors(this.__view._logger);
942
1019
  for (const n in t)
@@ -969,8 +1046,8 @@ class Ge {
969
1046
  for (; e.push(t.data), t.parent; )
970
1047
  t = t.parent;
971
1048
  const n = {};
972
- for (const i of e.reverse())
973
- Object.assign(n, i);
1049
+ for (const r of e.reverse())
1050
+ Object.assign(n, r);
974
1051
  return n;
975
1052
  }
976
1053
  beforeMount(e) {
@@ -990,11 +1067,11 @@ class Ge {
990
1067
  if (n.isMounted)
991
1068
  return n._watcher.watch(e, t);
992
1069
  {
993
- let i, o = !1;
1070
+ let r, i = !1;
994
1071
  return n._onMountCallbacks.push(() => {
995
- o || (i = n._watcher.watch(e, t));
1072
+ i || (r = n._watcher.watch(e, t));
996
1073
  }), () => {
997
- i != null && (o = !0, i());
1074
+ r != null && (i = !0, r());
998
1075
  };
999
1076
  }
1000
1077
  }
@@ -1002,25 +1079,26 @@ class Ge {
1002
1079
  return y("$outlet", { $children: this.__view._$children });
1003
1080
  }
1004
1081
  }
1005
- class q {
1006
- constructor(e, t, n, i = []) {
1007
- r(this, "uniqueId", ae());
1008
- r(this, "_elementContext");
1009
- r(this, "_logger");
1010
- r(this, "_view");
1011
- r(this, "_props");
1012
- r(this, "_element");
1013
- r(this, "_$children");
1014
- r(this, "_setChildren");
1015
- r(this, "_watcher", K());
1016
- r(this, "_beforeMountCallbacks", []);
1017
- r(this, "_onMountCallbacks", []);
1018
- r(this, "_beforeUnmountCallbacks", []);
1019
- r(this, "_onUnmountCallbacks", []);
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 = n;
1022
- const [o, u] = I(C(e, i));
1023
- this._$children = o, this._setChildren = u;
1082
+ var de;
1083
+ de = b;
1084
+ const H = class H {
1085
+ constructor(e, t, n, r = []) {
1086
+ o(this, de, !0);
1087
+ o(this, "uniqueId", ve());
1088
+ o(this, "_elementContext");
1089
+ o(this, "_logger");
1090
+ o(this, "_view");
1091
+ o(this, "_props");
1092
+ o(this, "_element");
1093
+ o(this, "_$children");
1094
+ o(this, "_setChildren");
1095
+ o(this, "_watcher", K());
1096
+ o(this, "_beforeMountCallbacks", []);
1097
+ o(this, "_onMountCallbacks", []);
1098
+ o(this, "_beforeUnmountCallbacks", []);
1099
+ o(this, "_onUnmountCallbacks", []);
1100
+ o(this, "isMounted", !1);
1101
+ this._elementContext = { ...e, data: {}, parent: e }, this._logger = e.root.createLogger(t.name, { uid: this.uniqueId }), this._view = t, this._props = n, [this._$children, this._setChildren] = G(_(e, r));
1024
1102
  }
1025
1103
  /*===============================*\
1026
1104
  || "Public" API ||
@@ -1047,14 +1125,14 @@ class q {
1047
1125
  this._watcher.stopAll();
1048
1126
  }
1049
1127
  setChildView(e) {
1050
- const t = new q(this._elementContext, e, {});
1128
+ const t = new H(this._elementContext, e, {});
1051
1129
  return this._setChildren([t]), t;
1052
1130
  }
1053
1131
  /*===============================*\
1054
1132
  || Internal ||
1055
1133
  \*===============================*/
1056
1134
  initialize() {
1057
- const e = new Ge(this);
1135
+ const e = new rt(this);
1058
1136
  let t;
1059
1137
  try {
1060
1138
  t = this._view(this._props, e);
@@ -1062,32 +1140,36 @@ class q {
1062
1140
  throw n instanceof Error && this._logger.crash(n), n;
1063
1141
  }
1064
1142
  if (t !== null) if (t instanceof Node)
1065
- this._element = E(C(this._elementContext, y("$node", { value: t })));
1066
- else if (N(t) || ie(N, t))
1067
- this._element = E(C(this._elementContext, t));
1143
+ this._element = M(_(this._elementContext, y("$node", { value: t })));
1144
+ else if ($(t) || ye($, t))
1145
+ this._element = M(_(this._elementContext, t));
1068
1146
  else if (p(t))
1069
- this._element = E(
1070
- C(this._elementContext, y("$observer", { states: [t], renderFn: (n) => n }))
1147
+ this._element = M(
1148
+ _(this._elementContext, y("$observer", { states: [t], renderFn: (n) => n }))
1071
1149
  );
1072
1150
  else {
1073
1151
  const n = new TypeError(
1074
- `Expected '${this._view.name}' function to return a DOM node, Markup element, Readable or null. Got: ${G(t)}`
1152
+ `Expected '${this._view.name}' function to return a DOM node, Markup element, Readable or null. Got: ${N(t)}`
1075
1153
  );
1076
1154
  this._logger.crash(n);
1077
1155
  }
1078
1156
  }
1079
- }
1080
- class je {
1081
- constructor({ elementContext: e, $items: t, renderFn: n, keyFn: i }) {
1082
- r(this, "node");
1083
- r(this, "endNode");
1084
- r(this, "$items");
1085
- r(this, "stopCallback");
1086
- r(this, "connectedItems", []);
1087
- r(this, "elementContext");
1088
- r(this, "renderFn");
1089
- r(this, "keyFn");
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(""));
1157
+ };
1158
+ let W = H;
1159
+ var pe;
1160
+ pe = b;
1161
+ class it {
1162
+ constructor({ elementContext: e, $items: t, renderFn: n, keyFn: r }) {
1163
+ o(this, pe, !0);
1164
+ o(this, "node");
1165
+ o(this, "endNode");
1166
+ o(this, "$items");
1167
+ o(this, "stopCallback");
1168
+ o(this, "connectedItems", []);
1169
+ o(this, "elementContext");
1170
+ o(this, "renderFn");
1171
+ o(this, "keyFn");
1172
+ this.elementContext = e, this.$items = t, this.renderFn = n, this.keyFn = r, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Repeat"), this.endNode = document.createComment("/Repeat")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
1091
1173
  }
1092
1174
  get isMounted() {
1093
1175
  return this.node.parentNode != null;
@@ -1107,59 +1189,62 @@ class je {
1107
1189
  this.connectedItems = [];
1108
1190
  }
1109
1191
  _update(e) {
1110
- var o, u, a;
1192
+ var i, u, c;
1111
1193
  if (e.length === 0 || !this.isMounted)
1112
1194
  return this._cleanup(!1);
1113
1195
  const t = [];
1114
1196
  let n = 0;
1115
- for (const l of e)
1197
+ for (const a of e)
1116
1198
  t.push({
1117
- key: this.keyFn(l, n),
1118
- value: l,
1199
+ key: this.keyFn(a, n),
1200
+ value: a,
1119
1201
  index: n++
1120
1202
  });
1121
- const i = [];
1122
- for (const l of this.connectedItems)
1123
- t.find((h) => h.key === l.key) || l.element.unmount(!1);
1124
- for (const l of t) {
1125
- const c = this.connectedItems.find((h) => h.key === l.key);
1126
- if (c)
1127
- c.setValue(l.value), c.setIndex(l.index), i[l.index] = c;
1203
+ const r = [];
1204
+ for (const a of this.connectedItems)
1205
+ t.find((h) => h.key === a.key) || a.element.unmount(!1);
1206
+ for (const a of t) {
1207
+ const l = this.connectedItems.find((h) => h.key === a.key);
1208
+ if (l)
1209
+ l.setValue(a.value), l.setIndex(a.index), r[a.index] = l;
1128
1210
  else {
1129
- const [h, d] = I(l.value), [f, m] = I(l.index);
1130
- i[l.index] = {
1131
- key: l.key,
1211
+ const [h, f] = G(a.value), [d, m] = G(a.index);
1212
+ r[a.index] = {
1213
+ key: a.key,
1132
1214
  $value: h,
1133
- setValue: d,
1134
- $index: f,
1215
+ setValue: f,
1216
+ $index: d,
1135
1217
  setIndex: m,
1136
- element: new q(this.elementContext, Be, {
1218
+ element: new W(this.elementContext, ot, {
1137
1219
  $value: h,
1138
- $index: f,
1220
+ $index: d,
1139
1221
  renderFn: this.renderFn
1140
1222
  })
1141
1223
  };
1142
1224
  }
1143
1225
  }
1144
- for (let l = 0; l < i.length; l++) {
1145
- const c = i[l], h = ((o = i[l - 1]) == null ? void 0 : o.element.node) ?? this.node;
1146
- c.element.mount(this.node.parentNode, h);
1226
+ for (let a = 0; a < r.length; a++) {
1227
+ const l = r[a], h = ((i = r[a - 1]) == null ? void 0 : i.element.node) ?? this.node;
1228
+ l.element.mount(this.node.parentNode, h);
1147
1229
  }
1148
- if (this.connectedItems = i, this.elementContext.root.getEnv() === "development") {
1149
- this.node.textContent = `Repeat (${i.length} item${i.length === 1 ? "" : "s"})`;
1150
- const l = ((u = i.at(-1)) == null ? void 0 : u.element.node) ?? this.node;
1151
- (a = this.node.parentNode) == null || a.insertBefore(this.endNode, l.nextSibling);
1230
+ if (this.connectedItems = r, this.elementContext.root.getEnv() === "development") {
1231
+ this.node.textContent = `Repeat (${r.length} item${r.length === 1 ? "" : "s"})`;
1232
+ const a = ((u = r.at(-1)) == null ? void 0 : u.element.node) ?? this.node;
1233
+ (c = this.node.parentNode) == null || c.insertBefore(this.endNode, a.nextSibling);
1152
1234
  }
1153
1235
  }
1154
1236
  }
1155
- function Be({ $value: s, $index: e, renderFn: t }, n) {
1237
+ function ot({ $value: s, $index: e, renderFn: t }, n) {
1156
1238
  return t(s, e, n);
1157
1239
  }
1158
- class Re {
1240
+ var me;
1241
+ me = b;
1242
+ class ut {
1159
1243
  constructor({ value: e }) {
1160
- r(this, "node", document.createTextNode(""));
1161
- r(this, "value", "");
1162
- r(this, "stopCallback");
1244
+ o(this, me, !0);
1245
+ o(this, "node", document.createTextNode(""));
1246
+ o(this, "value", "");
1247
+ o(this, "stopCallback");
1163
1248
  this.value = e;
1164
1249
  }
1165
1250
  get isMounted() {
@@ -1177,21 +1262,21 @@ class Re {
1177
1262
  e != null ? this.node.textContent = e.toString() : this.node.textContent = "";
1178
1263
  }
1179
1264
  }
1180
- function N(s) {
1181
- return W(s) && (typeof s.type == "string" || typeof s.type == "function") && Array.isArray(s.children);
1265
+ function $(s) {
1266
+ return (s == null ? void 0 : s[ke]) === !0;
1182
1267
  }
1183
- function he(s) {
1184
- return W(s) && x(s.connect) && x(s.disconnect);
1268
+ function Ne(s) {
1269
+ return (s == null ? void 0 : s[b]) === !0;
1185
1270
  }
1186
- function V(s) {
1187
- return M(s) || (s = [s]), s.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
1271
+ function A(s) {
1272
+ return V(s) || (s = [s]), s.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
1188
1273
  if (e instanceof Node)
1189
1274
  return y("$node", { value: e });
1190
- if (e instanceof de)
1275
+ if (e instanceof Ae)
1191
1276
  return y("$node", { value: e.node });
1192
- if (N(e))
1277
+ if ($(e))
1193
1278
  return e;
1194
- if ($(e) || _e(e))
1279
+ if (x(e) || _e(e))
1195
1280
  return y("$text", { value: e });
1196
1281
  if (p(e))
1197
1282
  return y("$observer", {
@@ -1202,41 +1287,45 @@ function V(s) {
1202
1287
  });
1203
1288
  }
1204
1289
  function y(s, e, ...t) {
1205
- return e != null && Ke(e), {
1290
+ return e != null && at(e), {
1291
+ [ke]: !0,
1206
1292
  type: s,
1207
1293
  props: e,
1208
- children: V(t)
1294
+ children: A(t)
1209
1295
  };
1210
1296
  }
1211
- function Ke(s) {
1212
- if (s.ref && !ue(s.ref))
1297
+ function at(s) {
1298
+ if (s.ref && !Ee(s.ref))
1213
1299
  throw console.warn(s.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${s.ref}`);
1214
1300
  for (const e in s)
1215
1301
  if (e.startsWith("$$") && s[e] !== void 0) {
1216
- if (!R(s[e]))
1302
+ if (!B(s[e]))
1217
1303
  throw new TypeError(`Prop '${e}' is named as a SettableState but value is not. Got: ${s[e]}`);
1218
1304
  } else if (e.startsWith("$") && s[e] !== void 0 && !p(s[e]))
1219
1305
  throw new TypeError(`Prop '${e}' is named as a State but value is not. Got: ${s[e]}`);
1220
1306
  }
1221
- const nt = Ve.bind(y);
1222
- function st(s, e, t) {
1223
- const n = F(s);
1307
+ const vt = Ze.bind(y);
1308
+ function bt(s, e, t) {
1309
+ const n = L(s);
1224
1310
  return y("$cond", {
1225
1311
  $predicate: n,
1226
1312
  thenContent: e,
1227
1313
  elseContent: t
1228
1314
  });
1229
1315
  }
1230
- function it(s, e, t) {
1231
- const n = F(s);
1316
+ function St(s, e, t) {
1317
+ const n = L(s);
1232
1318
  return y("$repeat", { $items: n, keyFn: e, renderFn: t });
1233
1319
  }
1234
- function ot(s, e) {
1320
+ function kt(s, e) {
1235
1321
  return y("$portal", { parent: s, content: e });
1236
1322
  }
1237
- class de {
1323
+ var ge;
1324
+ ge = b;
1325
+ class Ae {
1238
1326
  constructor(e) {
1239
- r(this, "node");
1327
+ o(this, ge, !0);
1328
+ o(this, "node");
1240
1329
  this.node = e;
1241
1330
  }
1242
1331
  get isMounted() {
@@ -1249,67 +1338,64 @@ class de {
1249
1338
  this.node.parentNode && this.node.parentNode.removeChild(this.node);
1250
1339
  }
1251
1340
  }
1252
- function C(s, e) {
1253
- return (M(e) ? e : [e]).map((n) => {
1341
+ function _(s, e) {
1342
+ return (V(e) ? e : [e]).map((n) => {
1343
+ if (P(n.type))
1344
+ return new W(s, n.type, n.props, n.children);
1254
1345
  if (x(n.type))
1255
- return new q(s, n.type, n.props, n.children);
1256
- if ($(n.type))
1257
1346
  switch (n.type) {
1258
1347
  case "$node": {
1259
- const i = n.props;
1260
- return new de(i.value);
1348
+ const r = n.props;
1349
+ return new Ae(r.value);
1261
1350
  }
1262
1351
  case "$text": {
1263
- const i = n.props;
1264
- return new Re({
1265
- value: i.value
1352
+ const r = n.props;
1353
+ return new ut({
1354
+ value: r.value
1266
1355
  });
1267
1356
  }
1268
1357
  case "$cond": {
1269
- const i = n.props;
1270
- return new Te({
1271
- $predicate: i.$predicate,
1272
- thenContent: i.thenContent,
1273
- elseContent: i.elseContent,
1358
+ const r = n.props;
1359
+ return new Xe({
1360
+ $predicate: r.$predicate,
1361
+ thenContent: r.thenContent,
1362
+ elseContent: r.elseContent,
1274
1363
  elementContext: s
1275
1364
  });
1276
1365
  }
1277
1366
  case "$repeat": {
1278
- const i = n.props;
1279
- return new je({
1280
- $items: i.$items,
1281
- keyFn: i.keyFn,
1282
- renderFn: i.renderFn,
1367
+ const r = n.props;
1368
+ return new it({
1369
+ $items: r.$items,
1370
+ keyFn: r.keyFn,
1371
+ renderFn: r.renderFn,
1283
1372
  elementContext: s
1284
1373
  });
1285
1374
  }
1286
1375
  case "$observer": {
1287
- const i = n.props;
1288
- return new qe({
1289
- states: i.states,
1290
- renderFn: i.renderFn,
1376
+ const r = n.props;
1377
+ return new nt({
1378
+ states: r.states,
1379
+ renderFn: r.renderFn,
1291
1380
  elementContext: s
1292
1381
  });
1293
1382
  }
1294
1383
  case "$outlet": {
1295
- const i = n.props;
1296
- return new Le({
1297
- $children: i.$children,
1298
- elementContext: s
1299
- });
1384
+ const r = n.props;
1385
+ return new $e(r.$children);
1300
1386
  }
1301
1387
  case "$portal": {
1302
- const i = n.props;
1303
- return new Ie({
1304
- content: i.content,
1305
- parent: i.parent,
1388
+ const r = n.props;
1389
+ return new st({
1390
+ content: r.content,
1391
+ parent: r.parent,
1306
1392
  elementContext: s
1307
1393
  });
1308
1394
  }
1309
1395
  default:
1310
1396
  if (n.type.startsWith("$"))
1311
1397
  throw new Error(`Unknown markup type: ${n.type}`);
1312
- return new Ue({
1398
+ return new Qe({
1313
1399
  tag: n.type,
1314
1400
  props: n.props ?? {},
1315
1401
  children: n.children,
@@ -1320,74 +1406,48 @@ function C(s, e) {
1320
1406
  throw new TypeError(`Expected a string or view function. Got: ${n.type}`);
1321
1407
  });
1322
1408
  }
1323
- function E(s) {
1324
- if (s.length === 1)
1325
- return s[0];
1326
- const e = document.createComment("Fragment");
1327
- let t = !1;
1328
- return {
1329
- get node() {
1330
- return e;
1331
- },
1332
- get isMounted() {
1333
- return t;
1334
- },
1335
- mount(n, i) {
1336
- var o;
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
- }
1342
- t = !0;
1343
- },
1344
- unmount(n) {
1345
- if (t) {
1346
- for (const i of s)
1347
- i.unmount(!0);
1348
- e.remove();
1349
- }
1350
- t = !1;
1351
- }
1352
- };
1409
+ function M(s) {
1410
+ return s.length === 1 ? s[0] : new $e(s);
1353
1411
  }
1354
- function fe(s) {
1355
- return s == null || s === !1 || typeof s == "string" || typeof s == "number" || N(s) || p(s) || ie(fe, s);
1412
+ function Ve(s) {
1413
+ return s == null || s === !1 || x(s) || _e(s) || $(s) || p(s) || ye(Ve, s);
1356
1414
  }
1357
- function rt(s, e) {
1415
+ function Et(s, e) {
1358
1416
  return e.outlet();
1359
1417
  }
1360
1418
  export {
1361
- et as A,
1362
- ot as B,
1363
- it as C,
1364
- rt as P,
1365
- q as V,
1366
- I as a,
1419
+ _ as A,
1420
+ _t as B,
1421
+ be as C,
1422
+ kt as D,
1423
+ St as E,
1424
+ Et as P,
1425
+ W as V,
1426
+ G as a,
1367
1427
  x as b,
1368
- st as c,
1369
- Me as d,
1370
- $ as e,
1371
- ze as f,
1372
- we as g,
1373
- nt as h,
1374
- W as i,
1375
- He as j,
1376
- K as k,
1377
- Je as l,
1378
- Qe as m,
1379
- Xe as n,
1380
- F as o,
1381
- tt as p,
1382
- ue as q,
1383
- Ye as r,
1384
- y as s,
1385
- G as t,
1386
- Ze as u,
1387
- Ee as v,
1388
- ke as w,
1389
- xe as x,
1390
- E as y,
1391
- C as z
1428
+ bt as c,
1429
+ He as d,
1430
+ mt as e,
1431
+ P as f,
1432
+ ft as g,
1433
+ vt as h,
1434
+ Ce as i,
1435
+ ht as j,
1436
+ lt as k,
1437
+ K as l,
1438
+ gt as m,
1439
+ wt as n,
1440
+ yt as o,
1441
+ L as p,
1442
+ Ct as q,
1443
+ Ee as r,
1444
+ pt as s,
1445
+ N as t,
1446
+ dt as u,
1447
+ Be as v,
1448
+ y as w,
1449
+ Re as x,
1450
+ De as y,
1451
+ M as z
1392
1452
  };
1393
- //# sourceMappingURL=passthrough-6Lrg96Id.js.map
1453
+ //# sourceMappingURL=passthrough-C9975ULD.js.map