@manyducks.co/dolla 2.0.0-alpha.62 → 2.0.0-alpha.64

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,60 +1,60 @@
1
- var it = Object.defineProperty;
2
- var B = (i) => {
3
- throw TypeError(i);
1
+ var nt = Object.defineProperty;
2
+ var K = (o) => {
3
+ throw TypeError(o);
4
4
  };
5
- var nt = (i, o, t) => o in i ? it(i, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[o] = t;
6
- var a = (i, o, t) => nt(i, typeof o != "symbol" ? o + "" : o, t), j = (i, o, t) => o.has(i) || B("Cannot " + t);
7
- var O = (i, o, t) => (j(i, o, "read from private field"), t ? t.call(i) : o.get(i)), V = (i, o, t) => o.has(i) ? B("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(i) : o.set(i, t), T = (i, o, t, e) => (j(i, o, "write to private field"), e ? e.call(i, t) : o.set(i, t), t);
8
- import { c as m, t as rt, i as C, b as D } from "./typeChecking-CbltMOUt.js";
9
- import { u as I, g as x, f as Y, h as M, e as v, t as J, o as ct, i as at, b as ht, $ as _, d as ut } from "./signals-gCwiIe5X.js";
10
- import { c as lt, g as dt } from "./logger-Bl496yfY.js";
11
- var g = /* @__PURE__ */ ((i) => (i[i.WILL_MOUNT = 0] = "WILL_MOUNT", i[i.DID_MOUNT = 1] = "DID_MOUNT", i[i.WILL_UNMOUNT = 2] = "WILL_UNMOUNT", i[i.DID_UNMOUNT = 3] = "DID_UNMOUNT", i[i.DISPOSE = 4] = "DISPOSE", i))(g || {});
12
- const U = Symbol("name"), d = Symbol("lifecycle"), b = Symbol("parent"), y = Symbol("stores"), w = Symbol("state");
13
- class ft {
14
- constructor(o) {
5
+ var rt = (o, i, t) => i in o ? nt(o, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[i] = t;
6
+ var a = (o, i, t) => rt(o, typeof i != "symbol" ? i + "" : i, t), j = (o, i, t) => i.has(o) || K("Cannot " + t);
7
+ var _ = (o, i, t) => (j(o, i, "read from private field"), t ? t.call(o) : i.get(o)), V = (o, i, t) => i.has(o) ? K("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(o) : i.set(o, t), T = (o, i, t, e) => (j(o, i, "write to private field"), e ? e.call(o, t) : i.set(o, t), t);
8
+ import { c as m, t as ct, i as D, b as R } from "./typeChecking-CbltMOUt.js";
9
+ import { u as L, g as x, i as $, j as S, e as w, I as v, t as Q, c as at, o as ht, k as ut, b as lt, w as F, d as dt, m as ft } from "./signals-DbDmN2gr.js";
10
+ import { c as mt } from "./logger-B7RBYtzP.js";
11
+ var b = /* @__PURE__ */ ((o) => (o[o.WILL_MOUNT = 0] = "WILL_MOUNT", o[o.DID_MOUNT = 1] = "DID_MOUNT", o[o.WILL_UNMOUNT = 2] = "WILL_UNMOUNT", o[o.DID_UNMOUNT = 3] = "DID_UNMOUNT", o[o.DISPOSE = 4] = "DISPOSE", o))(b || {});
12
+ const U = Symbol("name"), d = Symbol("lifecycle"), g = Symbol("parent"), N = Symbol("stores"), y = Symbol("state");
13
+ class pt {
14
+ constructor(i) {
15
15
  a(this, "context");
16
16
  a(this, "state", 0);
17
17
  a(this, "listeners", /* @__PURE__ */ new Map());
18
18
  a(this, "bound");
19
- this.context = o;
19
+ this.context = i;
20
20
  }
21
21
  /**
22
22
  * Listen for a certain event to be emitted. Listeners are called when the event results in a state change.
23
23
  */
24
- on(o, t) {
25
- const e = this.listeners.get(o);
26
- e ? e.add(t) : this.listeners.set(o, /* @__PURE__ */ new Set([t]));
24
+ on(i, t) {
25
+ const e = this.listeners.get(i);
26
+ e ? e.add(t) : this.listeners.set(i, /* @__PURE__ */ new Set([t]));
27
27
  }
28
28
  /**
29
29
  * Stop a particular listener from being called when an event is emitted.
30
30
  */
31
- off(o, t) {
32
- const e = this.listeners.get(o);
33
- e && (e.delete(t), e.size === 0 && this.listeners.delete(o));
31
+ off(i, t) {
32
+ const e = this.listeners.get(i);
33
+ e && (e.delete(t), e.size === 0 && this.listeners.delete(i));
34
34
  }
35
35
  /**
36
36
  * Advance the lifecycle state machine.
37
37
  */
38
- emit(o) {
39
- switch (o) {
38
+ emit(i) {
39
+ switch (i) {
40
40
  case 0: {
41
- this.state < 1 ? (this.state = 1, this.notify(o)) : this.context.crash(new Error(`Tried to WILL_MOUNT context at state ${this.state}`));
41
+ this.state < 1 ? (this.state = 1, this.notify(i)) : this.context.crash(new Error(`Tried to WILL_MOUNT context at state ${this.state}`));
42
42
  break;
43
43
  }
44
44
  case 1: {
45
- this.state >= 1 && this.state < 2 ? (this.state = 2, this.notify(o)) : this.context.crash(new Error(`Tried to WILL_UNMOUNT context at state ${this.state}`));
45
+ this.state >= 1 && this.state < 2 ? (this.state = 2, this.notify(i)) : this.context.crash(new Error(`Tried to WILL_UNMOUNT context at state ${this.state}`));
46
46
  break;
47
47
  }
48
48
  case 2: {
49
- this.state >= 2 && this.state < 3 ? (this.notify(o), this.state = 3) : this.context.crash(new Error(`Tried to WILL_UNMOUNT context at state ${this.state}`));
49
+ this.state >= 2 && this.state < 3 ? (this.notify(i), this.state = 3) : this.context.crash(new Error(`Tried to WILL_UNMOUNT context at state ${this.state}`));
50
50
  break;
51
51
  }
52
52
  case 3: {
53
- this.state >= 3 && this.state < 4 ? (this.state = 4 % 4, this.notify(o)) : this.context.crash(new Error(`Tried to DID_UNMOUNT context at state ${this.state}`));
53
+ this.state >= 3 && this.state < 4 ? (this.state = 4 % 4, this.notify(i)) : this.context.crash(new Error(`Tried to DID_UNMOUNT context at state ${this.state}`));
54
54
  break;
55
55
  }
56
56
  case 4: {
57
- this.state === 0 ? (this.notify(o), this.listeners.clear(), this.bound = void 0, this.context[w] = void 0, this.context[y] = void 0, this.state = 5) : this.context.crash(new Error(`Tried to DISPOSE context at state ${this.state}`));
57
+ this.state === 0 ? (this.notify(i), this.listeners.clear(), this.bound = void 0, this.context[y] = void 0, this.context[N] = void 0, this.state = 5) : this.context.crash(new Error(`Tried to DISPOSE context at state ${this.state}`));
58
58
  break;
59
59
  }
60
60
  }
@@ -62,93 +62,96 @@ class ft {
62
62
  /**
63
63
  * Bind `context` to this lifecycle; when any event is emitted here it will be emitted for `context` as well.
64
64
  */
65
- bind(o) {
66
- this.bound ? this.bound.add(o) : this.bound = /* @__PURE__ */ new Set([o]);
65
+ bind(i) {
66
+ this.bound ? this.bound.add(i) : this.bound = /* @__PURE__ */ new Set([i]);
67
67
  }
68
68
  /**
69
69
  * Call all the event's listeners and re-emit to bound contexts.
70
70
  */
71
- notify(o) {
72
- const t = this.listeners.get(o);
71
+ notify(i) {
72
+ const t = this.listeners.get(i);
73
73
  if (t)
74
74
  for (const e of t)
75
75
  e();
76
76
  if (this.bound)
77
77
  for (const e of this.bound)
78
- e[d].emit(o);
78
+ e[d].emit(i);
79
79
  }
80
80
  }
81
- var z, F, H, Z, K, N;
82
- K = U, Z = d, H = b, F = y, z = w;
83
- const L = class L {
84
- constructor(o, t) {
85
- V(this, N);
86
- a(this, K);
87
- a(this, Z, new ft(this));
81
+ var z, H, Z, Y, J, k;
82
+ J = U, Y = d, Z = g, H = N, z = y;
83
+ const O = class O {
84
+ constructor(i, t) {
85
+ V(this, k);
86
+ a(this, J);
87
+ a(this, Y, new pt(this));
88
+ a(this, Z);
88
89
  a(this, H);
89
- a(this, F);
90
90
  a(this, z);
91
- T(this, N, o), this[U] = I(o);
92
- const e = lt(() => x(O(this, N)), t == null ? void 0 : t.logger), s = Object.getOwnPropertyDescriptors(e);
91
+ T(this, k, i), this[U] = L(i);
92
+ const e = mt(() => x(_(this, k)), t == null ? void 0 : t.logger), s = Object.getOwnPropertyDescriptors(e);
93
93
  for (const n in s)
94
94
  Object.defineProperty(this, n, s[n]);
95
95
  }
96
96
  get isMounted() {
97
- const { state: o } = this[d];
98
- return o >= 2 && o < 4;
97
+ const { state: i } = this[d];
98
+ return i >= 2 && i < 4;
99
99
  }
100
100
  /**
101
101
  * Returns a new Context with this one as its parent.
102
102
  */
103
- static linked(o, t, e) {
104
- const s = new L(t, e);
105
- return s[b] = o, e != null && e.bindLifecycleToParent && o[d].bind(s), s;
103
+ static linked(i, t, e) {
104
+ const s = new O(t, e);
105
+ return s[g] = i, e != null && e.bindLifecycleToParent && i[d].bind(s), s;
106
106
  }
107
107
  /**
108
108
  * Emit a lifecycle event to `context`.
109
109
  */
110
- static emit(o, t) {
111
- o[d].emit(t);
110
+ static emit(i, t) {
111
+ i[d].emit(t);
112
112
  }
113
113
  /**
114
114
  * Traverses _parent contexts until arriving at one that doesn't have a parent itself.
115
115
  * Returns null if this context is the parent.
116
116
  */
117
- static getRoot(o) {
118
- let t = o[b];
119
- for (; t != null && t[b]; )
120
- t = t[b];
117
+ static getRoot(i) {
118
+ let t = i[g];
119
+ for (; t != null && t[g]; )
120
+ t = t[g];
121
121
  return t ?? null;
122
122
  }
123
+ // nextTick(callback: () => void) {
124
+ // scheduler.nextTick(callback);
125
+ // }
123
126
  /**
124
127
  * Returns the current name of this context.
125
128
  */
126
129
  getName() {
127
- return I(O(this, N));
130
+ return L(_(this, k));
128
131
  }
129
132
  /**
130
133
  * Sets a new name for this context.
131
134
  */
132
- setName(o) {
133
- T(this, N, o), this[U] = I(o);
135
+ setName(i) {
136
+ T(this, k, i), this[U] = L(i);
134
137
  }
135
138
  /**
136
139
  * Creates an instance of a store and attaches it to this context.
137
140
  */
138
- addStore(o, t) {
141
+ addStore(i, t) {
139
142
  var s;
140
- if ((s = this[y]) != null && s.get(o)) {
141
- let n = o.name ? `'${o.name}'` : "this store";
143
+ if ((s = this[N]) != null && s.get(i)) {
144
+ let n = i.name ? `'${i.name}'` : "this store";
142
145
  throw this.crash(new Error(`An instance of ${n} was already added on this context.`));
143
146
  }
144
- const e = L.linked(this, o.name, {
147
+ const e = O.linked(this, i.name, {
145
148
  bindLifecycleToParent: !0,
146
- logger: { tag: Y(), tagName: "uid" }
149
+ logger: { tag: $(), tagName: "uid" }
147
150
  });
148
151
  try {
149
- this[y] || (this[y] = /* @__PURE__ */ new Map());
150
- const n = M(e), c = o.call(e, t, e);
151
- M(n), this[y].set(o, c);
152
+ this[N] || (this[N] = /* @__PURE__ */ new Map());
153
+ const n = S(e), c = i.call(e, t, e);
154
+ S(n), this[N].set(i, c);
152
155
  } catch (n) {
153
156
  throw this.crash(n);
154
157
  }
@@ -159,71 +162,71 @@ const L = class L {
159
162
  * 1. An instance of the store is found and returned.
160
163
  * 2. No instance is found and an error is thrown.
161
164
  */
162
- getStore(o) {
165
+ getStore(i) {
163
166
  var s;
164
- if (!m(o))
167
+ if (!m(i))
165
168
  throw new Error("Invalid store.");
166
169
  let t = this, e;
167
- for (; e = (s = t[y]) == null ? void 0 : s.get(o), e == null && t[b] != null; )
168
- t = t[b];
170
+ for (; e = (s = t[N]) == null ? void 0 : s.get(i), e == null && t[g] != null; )
171
+ t = t[g];
169
172
  if (e == null)
170
- throw this.crash(new Error(`Store '${o.name}' is not provided by this context.`));
173
+ throw this.crash(new Error(`Store '${i.name}' is not provided by this context.`));
171
174
  return e;
172
175
  }
173
176
  /**
174
177
  * Schedule a callback function to run just before this context is mounted.
175
178
  */
176
- beforeMount(o) {
177
- return this[d].on(0, o), () => this[d].off(0, o);
179
+ beforeMount(i) {
180
+ return this[d].on(0, i), () => this[d].off(0, i);
178
181
  }
179
182
  /**
180
183
  * Schedule a callback function to run after this context is mounted.
181
184
  */
182
- onMount(o) {
183
- return this[d].on(1, o), () => this[d].off(1, o);
185
+ onMount(i) {
186
+ return this[d].on(1, i), () => this[d].off(1, i);
184
187
  }
185
188
  /**
186
189
  * Schedule a callback function to run just before this context is unmounted.
187
190
  */
188
- beforeUnmount(o) {
189
- return this[d].on(2, o), () => this[d].off(2, o);
191
+ beforeUnmount(i) {
192
+ return this[d].on(2, i), () => this[d].off(2, i);
190
193
  }
191
194
  /**
192
195
  * Schedule a callback function to run after this context is unmounted.
193
196
  */
194
- onUnmount(o) {
195
- return this[d].on(3, o), () => this[d].off(3, o);
197
+ onUnmount(i) {
198
+ return this[d].on(3, i), () => this[d].off(3, i);
196
199
  }
197
- effect(o) {
200
+ effect(i) {
198
201
  const t = () => {
199
202
  try {
200
- return o();
203
+ return i();
201
204
  } catch (e) {
202
205
  this.error(e), e instanceof Error ? this.crash(e) : typeof e == "string" ? this.crash(new Error(e)) : this.crash(new Error("Unknown error thrown in effect callback"));
203
206
  }
204
207
  };
205
208
  if (this[d].state >= 1) {
206
- const e = v(t);
209
+ const e = w(t, { _type: v });
207
210
  return this[d].on(3, e), e;
208
211
  } else {
209
212
  let e, s = !1;
210
213
  return this[d].on(0, () => {
211
- s || (e = v(t), this[d].on(3, e));
214
+ s || (e = w(t, { _type: v }), this[d].on(3, e));
212
215
  }), () => {
213
216
  e != null && (s = !0, e());
214
217
  };
215
218
  }
216
219
  }
217
- getState(o, t) {
220
+ getState(i, t) {
218
221
  var c;
219
222
  const e = (t == null ? void 0 : t.immediate) ?? !1;
220
223
  let s = this, n;
221
- for (; n = (c = s[w]) == null ? void 0 : c.get(o), n === void 0 && !e && s[b] != null; )
222
- s = s[b];
224
+ for (; n = (c = s[y]) == null ? void 0 : c.get(i), n === void 0 && !e && s[g] != null; )
225
+ s = s[g];
223
226
  if (n === void 0) {
224
227
  if (t != null && Object.hasOwn(t, "fallback"))
225
228
  return t.fallback;
226
- throw new Error(`Expected a value for '${String(o)}' but got undefined.`);
229
+ throw new Error(`Expected a value for '${String(i)}' but got undefined.`);
227
230
  }
228
231
  return n;
229
232
  }
@@ -233,30 +236,30 @@ const L = class L {
233
236
  * Pass `options.immediate` to only include state stored on this context.
234
237
  * By default all state stored on parent contexts is also included.
235
238
  */
236
- getStateMap(o) {
239
+ getStateMap(i) {
237
240
  let t = this;
238
- const e = (o == null ? void 0 : o.immediate) ?? !1, s = [];
239
- for (; t[w] && s.push(...t[w].entries()), !e && t[b] != null; )
240
- t = t[b];
241
+ const e = (i == null ? void 0 : i.immediate) ?? !1, s = [];
242
+ for (; t[y] && s.push(...t[y].entries()), !e && t[g] != null; )
243
+ t = t[g];
241
244
  return new Map(s.reverse());
242
245
  }
243
- setState(...o) {
244
- if (this[w] || (this[w] = /* @__PURE__ */ new Map()), o.length === 2)
245
- this[w].set(o[0], o[1]);
246
- else if (rt(o[0]) === "array")
247
- for (const [t, e] of o[0])
248
- e === void 0 ? this[w].delete(t) : this[w].set(t, e);
246
+ setState(...i) {
247
+ if (this[y] || (this[y] = /* @__PURE__ */ new Map()), i.length === 2)
248
+ this[y].set(i[0], i[1]);
249
+ else if (ct(i[0]) === "array")
250
+ for (const [t, e] of i[0])
251
+ e === void 0 ? this[y].delete(t) : this[y].set(t, e);
249
252
  else
250
253
  throw new Error("Invalid arguments.");
251
254
  return this;
252
255
  }
253
256
  };
254
- N = new WeakMap();
255
- let f = L;
256
- function Lt(i, o) {
257
- return new f(i, o);
257
+ k = new WeakMap();
258
+ let f = O;
259
+ function _t(o, i) {
260
+ return new f(o, i);
258
261
  }
259
- class k {
262
+ class M {
260
263
  /**
261
264
  * Returns a single DOM node to represent this MarkupNode's position in the DOM.
262
265
  * Usually the parent element, but it can be an empty Text node used as a marker.
@@ -276,7 +279,7 @@ class k {
276
279
  * Mount this node to a `parent` element.
277
280
  * If passed, this node will be mounted as the next sibling of `after`.
278
281
  */
279
- mount(o, t) {
282
+ mount(i, t) {
280
283
  throw new Error("mount method is not implemented");
281
284
  }
282
285
  /**
@@ -287,17 +290,17 @@ class k {
287
290
  *
288
291
  * @param skipDOM - No DOM updates will be performed when true. Lifecycle methods will be called regardless.
289
292
  */
290
- unmount(o) {
293
+ unmount(i) {
291
294
  throw new Error("unmount method is not implemented");
292
295
  }
293
296
  /**
294
297
  * Moves a node without unmounting and remounting (if the browser supports Element.moveBefore).
295
298
  */
296
- move(o, t) {
299
+ move(i, t) {
297
300
  throw new Error("move method is not implemented");
298
301
  }
299
302
  }
300
- class $ extends k {
303
+ class P extends M {
301
304
  constructor(t) {
302
305
  super();
303
306
  a(this, "root");
@@ -326,7 +329,7 @@ class $ extends k {
326
329
  this.mount(t, e);
327
330
  }
328
331
  }
329
- class A extends k {
332
+ class C extends M {
330
333
  constructor(t, e) {
331
334
  super();
332
335
  a(this, "root", document.createTextNode(""));
@@ -343,16 +346,19 @@ class A extends k {
343
346
  return this.root.parentElement != null;
344
347
  }
345
348
  mount(t, e) {
346
- this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe = v(() => {
347
- try {
348
- const s = this.$slot();
349
- I(() => {
350
- this.update(J(s));
351
- });
352
- } catch (s) {
353
- this.context.crash(s);
354
- }
355
- }));
349
+ this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe = w(
350
+ () => {
351
+ try {
352
+ const s = this.$slot();
353
+ L(() => {
354
+ this.update(Q(s));
355
+ });
356
+ } catch (s) {
357
+ this.context.crash(s);
358
+ }
359
+ },
360
+ { _type: v }
361
+ ));
356
362
  }
357
363
  unmount(t = !1) {
358
364
  var e, s;
@@ -380,7 +386,7 @@ class A extends k {
380
386
  update(t) {
381
387
  var c, r, h;
382
388
  if (this.cleanup(!1), t.length === 0 || !this.isMounted()) return;
383
- const e = W(this.context, t);
389
+ const e = B(this.context, t);
384
390
  for (const u of e) {
385
391
  const l = ((c = this.children.at(-1)) == null ? void 0 : c.getRoot()) || this.root;
386
392
  u.mount(this.root.parentElement, l), this.children.push(u);
@@ -389,8 +395,8 @@ class A extends k {
389
395
  "moveBefore" in s ? s.moveBefore(this.root, n) : s.insertBefore(this.root, n);
390
396
  }
391
397
  }
392
- const Q = Symbol("ViewNode");
393
- class X extends k {
398
+ const X = Symbol("ViewNode");
399
+ class tt extends M {
394
400
  /**
395
401
  * @param context - Parent contenxt to link to.
396
402
  * @param view - View function to mount.
@@ -398,17 +404,17 @@ class X extends k {
398
404
  */
399
405
  constructor(t, e, s) {
400
406
  super();
401
- a(this, "uniqueId", Y());
402
- a(this, "context");
407
+ a(this, "id", $());
403
408
  a(this, "props");
409
+ a(this, "context");
404
410
  a(this, "view");
405
411
  a(this, "node");
406
412
  this.context = f.linked(t, e.name ?? "anonymous view", {
407
413
  logger: {
408
- tag: this.uniqueId,
414
+ tag: this.id,
409
415
  tagName: "uid"
410
416
  }
411
- }), this.context.setState(Q, this), this.props = s, this.view = e;
417
+ }), this.context.setState(X, this), this.props = s, this.view = e;
412
418
  }
413
419
  getRoot() {
414
420
  var t;
@@ -423,28 +429,29 @@ class X extends k {
423
429
  if (!s) {
424
430
  const { context: n, props: c, view: r } = this;
425
431
  try {
426
- const h = M(n), u = r.call(n, c, n);
427
- M(h), u != null && u !== !1 && (this.node = ot(u, n));
432
+ const h = S(n), u = r.call(n, c, n);
433
+ S(h), u != null && u !== !1 && (this.node = ot(u, n));
428
434
  } catch (h) {
429
435
  throw h instanceof Error && n.crash(h), h;
430
436
  }
431
- f.emit(this.context, g.WILL_MOUNT);
437
+ f.emit(this.context, b.WILL_MOUNT);
432
438
  }
433
- this.node && this.node.mount(t, e), s || f.emit(this.context, g.DID_MOUNT);
439
+ this.node && this.node.mount(t, e), s || f.emit(this.context, b.DID_MOUNT);
434
440
  }
435
441
  unmount(t = !1) {
436
- f.emit(this.context, g.WILL_UNMOUNT), this.node && this.node.unmount(t), f.emit(this.context, g.DID_UNMOUNT), f.emit(this.context, g.DISPOSE);
442
+ f.emit(this.context, b.WILL_UNMOUNT), this.node && this.node.unmount(t), f.emit(this.context, b.DID_UNMOUNT), f.emit(this.context, b.DISPOSE);
437
443
  }
438
444
  move(t, e) {
439
445
  var s;
440
446
  (s = this.node) == null || s.move(t, e);
441
447
  }
442
448
  }
443
- const mt = (i) => /^on[A-Z]/.test(i), P = Symbol("HTML.isSVG"), pt = ["class", "className", "ref", "mixin", "children"];
444
- class bt extends k {
449
+ const gt = (o) => /^on[A-Z]/.test(o), A = Symbol("HTML.isSVG"), bt = ["class", "className", "ref", "mixin", "children"];
450
+ class yt extends M {
445
451
  constructor(t, e, s) {
446
452
  super();
447
453
  a(this, "root");
454
+ a(this, "id", $());
448
455
  a(this, "tag");
449
456
  a(this, "props");
450
457
  a(this, "context");
@@ -454,17 +461,17 @@ class bt extends k {
454
461
  a(this, "ref");
455
462
  // Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
456
463
  a(this, "canClickAway", !1);
457
- if (this.tag = e, this.props = s, this.context = f.linked(t, q.bind(this)), e.toLowerCase() === "svg" && this.context.setState(P, !0), this.context.getState(P, { fallback: !1 }) ? this.root = document.createElementNS("http://www.w3.org/2000/svg", e) : this.root = document.createElement(e), dt() === "development") {
458
- const c = this.context.getState(Q, { fallback: null });
464
+ if (this.tag = e, this.props = s, this.context = f.linked(t, G.bind(this)), e.toLowerCase() === "svg" && this.context.setState(A, !0), this.context.getState(A, { fallback: !1 }) ? this.root = document.createElementNS("http://www.w3.org/2000/svg", e) : this.root = document.createElement(e), at() === "development") {
465
+ const c = this.context.getState(X, { fallback: null });
459
466
  c && (this.root.dataset.view = c.context.getName());
460
467
  }
461
468
  if (s.mixin)
462
- for (const c of J(s.mixin)) {
463
- const r = f.linked(this.context, q.bind(this), {
469
+ for (const c of Q(s.mixin)) {
470
+ const r = f.linked(this.context, G.bind(this), {
464
471
  bindLifecycleToParent: !0,
465
472
  logger: { tagName: c.name === "mixin" ? void 0 : "mixin", tag: c.name }
466
- }), h = M(r);
467
- c(this.root, r), M(h);
473
+ }), h = S(r);
474
+ c(this.root, r), S(h);
468
475
  }
469
476
  const n = s.className ?? s.class;
470
477
  if (this.applyProps(this.root, s), s.style && this.applyStyles(this.root, s.style, this.unsubscribers), n && this.applyClasses(this.root, n, this.unsubscribers), s.ref)
@@ -472,7 +479,7 @@ class bt extends k {
472
479
  this.ref = s.ref, this.ref(this.root);
473
480
  else
474
481
  throw new Error("Expected ref to be a function. Got: " + s.ref);
475
- s.children && (this.childNodes = W(this.context, s.children));
482
+ s.children && (this.childNodes = B(this.context, s.children));
476
483
  }
477
484
  getRoot() {
478
485
  return this.root;
@@ -483,23 +490,23 @@ class bt extends k {
483
490
  mount(t, e) {
484
491
  const s = this.isMounted();
485
492
  if (!s) {
486
- f.emit(this.context, g.WILL_MOUNT);
493
+ f.emit(this.context, b.WILL_MOUNT);
487
494
  for (let n = 0; n < this.childNodes.length; n++) {
488
495
  const c = this.childNodes[n], r = n > 0 ? this.childNodes[n - 1].getRoot() : void 0;
489
496
  c.mount(this.root, r);
490
497
  }
491
498
  }
492
- t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.canClickAway = !0, s || f.emit(this.context, g.DID_MOUNT);
499
+ t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.canClickAway = !0, s || f.emit(this.context, b.DID_MOUNT);
493
500
  }
494
501
  unmount(t = !1) {
495
502
  var e;
496
- f.emit(this.context, g.WILL_UNMOUNT), t || (e = this.root.parentNode) == null || e.removeChild(this.root);
503
+ f.emit(this.context, b.WILL_UNMOUNT), t || (e = this.root.parentNode) == null || e.removeChild(this.root);
497
504
  for (const s of this.childNodes)
498
505
  s.unmount(!0);
499
506
  this.canClickAway = !1;
500
507
  for (const s of this.unsubscribers)
501
508
  s();
502
- this.unsubscribers.length = 0, this.ref && this.ref(void 0), f.emit(this.context, g.DID_UNMOUNT), f.emit(this.context, g.DISPOSE);
509
+ this.unsubscribers.length = 0, this.ref && this.ref(void 0), f.emit(this.context, b.DID_UNMOUNT), f.emit(this.context, b.DISPOSE);
503
510
  }
504
511
  move(t, e) {
505
512
  if ("moveBefore" in t)
@@ -511,19 +518,25 @@ class bt extends k {
511
518
  else
512
519
  this.mount(t, e);
513
520
  }
514
- attachProp(t, e) {
521
+ attachProp(t, e, s) {
515
522
  m(t) ? this.unsubscribers.push(
516
- v(() => {
517
- try {
518
- e(t());
519
- } catch (s) {
520
- this.context.error(s), this.context.crash(s);
521
- }
522
- })
523
+ w(
524
+ () => {
525
+ try {
526
+ e(t());
527
+ } catch (n) {
528
+ this.context.error(n), this.context.crash(n);
529
+ }
530
+ },
531
+ { _type: v }
532
+ )
523
533
  ) : e(t);
524
534
  }
535
+ getKey(t) {
536
+ return this.id + ":" + t;
537
+ }
525
538
  applyProps(t, e) {
526
- for (const s in ct(pt, e)) {
539
+ for (const s in ht(bt, e)) {
527
540
  const n = e[s];
528
541
  if (s === "on:clickoutside" || s === "onClickOutside" || s === "onclickoutside") {
529
542
  const c = (h) => {
@@ -534,92 +547,144 @@ class bt extends k {
534
547
  });
535
548
  } else if (s.startsWith("prop:")) {
536
549
  const c = s.substring(5);
537
- this.attachProp(n, (r) => {
538
- t[c] = r;
539
- });
550
+ this.attachProp(
551
+ n,
552
+ (r) => {
553
+ t[c] = r;
554
+ },
555
+ this.getKey(c)
556
+ );
540
557
  } else if (s.startsWith("on:")) {
541
558
  const c = s.substring(3);
542
559
  let r;
543
560
  m(n) ? (t.addEventListener(c, n), this.unsubscribers.push(() => {
544
561
  t.removeEventListener(c, n);
545
- })) : this.attachProp(n, (h) => {
546
- !h && r ? t.removeEventListener(c, r) : h != null && (r && r !== h && t.removeEventListener(c, r), t.addEventListener(c, h)), r = h;
547
- });
562
+ })) : this.attachProp(
563
+ n,
564
+ (h) => {
565
+ !h && r ? t.removeEventListener(c, r) : h != null && (r && r !== h && t.removeEventListener(c, r), t.addEventListener(c, h)), r = h;
566
+ },
567
+ this.getKey(c)
568
+ );
548
569
  } else if (s.startsWith("attr:")) {
549
570
  const c = s.substring(5).toLowerCase();
550
- this.attachProp(n, (r) => {
551
- r != null ? t.setAttribute(c, String(r)) : t.removeAttribute(c);
552
- });
553
- } else if (m(n) && mt(s)) {
571
+ this.attachProp(
572
+ n,
573
+ (r) => {
574
+ r != null ? t.setAttribute(c, String(r)) : t.removeAttribute(c);
575
+ },
576
+ this.getKey(c)
577
+ );
578
+ } else if (m(n) && gt(s)) {
554
579
  const c = s.slice(2).toLowerCase(), r = n;
555
580
  t.addEventListener(c, r), this.unsubscribers.push(() => {
556
581
  t.removeEventListener(c, r);
557
582
  });
558
- } else if (s.startsWith("on") && m(n) && gt.includes(s.substring(2)))
583
+ } else if (s.startsWith("on") && m(n) && wt.includes(s.substring(2)))
559
584
  t[s] = n, this.unsubscribers.push(() => {
560
585
  t[s] = void 0;
561
586
  });
562
587
  else if (s.includes("-"))
563
- this.attachProp(n, (c) => {
564
- c == null ? t.removeAttribute(s) : t.setAttribute(s, String(c));
565
- });
566
- else if (this.context.getState(P, { fallback: !1 }))
567
- this.attachProp(n, (c) => {
568
- c != null ? t.setAttribute(s, String(e[s])) : t.removeAttribute(s);
569
- });
588
+ this.attachProp(
589
+ n,
590
+ (c) => {
591
+ c == null ? t.removeAttribute(s) : t.setAttribute(s, String(c));
592
+ },
593
+ this.getKey(s)
594
+ );
595
+ else if (this.context.getState(A, { fallback: !1 }))
596
+ this.attachProp(
597
+ n,
598
+ (c) => {
599
+ c != null ? t.setAttribute(s, String(e[s])) : t.removeAttribute(s);
600
+ },
601
+ this.getKey(s)
602
+ );
570
603
  else
571
604
  switch (s) {
572
605
  case "contentEditable":
573
606
  case "value":
574
- this.attachProp(n, (r) => {
575
- t[s] = String(r);
576
- });
607
+ this.attachProp(
608
+ n,
609
+ (r) => {
610
+ t[s] = String(r);
611
+ },
612
+ this.getKey(s)
613
+ );
577
614
  break;
578
615
  case "for":
579
- this.attachProp(n, (r) => {
580
- t.htmlFor = r;
581
- });
616
+ this.attachProp(
617
+ n,
618
+ (r) => {
619
+ t.htmlFor = r;
620
+ },
621
+ this.getKey(s)
622
+ );
582
623
  break;
583
624
  case "innerHTML":
584
- this.attachProp(n, (r) => {
585
- t.innerHTML = r;
586
- });
625
+ this.attachProp(
626
+ n,
627
+ (r) => {
628
+ t.innerHTML = r;
629
+ },
630
+ this.getKey(s)
631
+ );
587
632
  break;
588
633
  case "title":
589
- this.attachProp(n, (r) => {
590
- r == null ? t.removeAttribute(s) : t.setAttribute(s, String(r));
591
- });
634
+ this.attachProp(
635
+ n,
636
+ (r) => {
637
+ r == null ? t.removeAttribute(s) : t.setAttribute(s, String(r));
638
+ },
639
+ this.getKey(s)
640
+ );
592
641
  case "checked":
593
- this.attachProp(n, (r) => {
594
- t.checked = r, r ? t.setAttribute("checked", "") : t.removeAttribute("checked");
595
- });
642
+ this.attachProp(
643
+ n,
644
+ (r) => {
645
+ t.checked = r, r ? t.setAttribute("checked", "") : t.removeAttribute("checked");
646
+ },
647
+ this.getKey(s)
648
+ );
596
649
  break;
597
650
  case "dataset":
598
651
  let c = {};
599
- this.attachProp(n, (r) => {
600
- if (C(r)) {
601
- const h = {};
602
- for (const u in r)
603
- h[at(u)] = String(r[u]);
604
- for (const u in c)
605
- Object.hasOwn(h, u) || (delete t.dataset[u], delete c[u]);
606
- for (const u in h)
607
- c[u] !== h[u] && (t.dataset[u] = h[u], c[u] = h[u]);
608
- } else
609
- for (const h in c)
610
- delete t.dataset[h];
611
- });
652
+ this.attachProp(
653
+ n,
654
+ (r) => {
655
+ if (D(r)) {
656
+ const h = {};
657
+ for (const u in r)
658
+ h[ut(u)] = String(r[u]);
659
+ for (const u in c)
660
+ Object.hasOwn(h, u) || (delete t.dataset[u], delete c[u]);
661
+ for (const u in h)
662
+ c[u] !== h[u] && (t.dataset[u] = h[u], c[u] = h[u]);
663
+ } else
664
+ for (const h in c)
665
+ delete t.dataset[h];
666
+ },
667
+ this.getKey(s)
668
+ );
612
669
  break;
613
670
  case "autocomplete":
614
671
  case "autocapitalize":
615
- this.attachProp(n, (r) => {
616
- typeof r == "string" ? t[s] = r : r ? t[s] = "on" : t[s] = "off";
617
- });
672
+ this.attachProp(
673
+ n,
674
+ (r) => {
675
+ typeof r == "string" ? t[s] = r : r ? t[s] = "on" : t[s] = "off";
676
+ },
677
+ this.getKey(s)
678
+ );
618
679
  break;
619
680
  default: {
620
- this.attachProp(n, (r) => {
621
- t[s] = r;
622
- });
681
+ this.attachProp(
682
+ n,
683
+ (r) => {
684
+ t[s] = r;
685
+ },
686
+ this.getKey(s)
687
+ );
623
688
  break;
624
689
  }
625
690
  }
@@ -629,18 +694,24 @@ class bt extends k {
629
694
  const n = [];
630
695
  if (m(e)) {
631
696
  let c;
632
- const r = v(() => {
633
- m(c) && c(), t.style.cssText = "", c = this.applyStyles(t, x(e), s);
634
- });
697
+ const r = w(
698
+ () => {
699
+ m(c) && c(), t.style.cssText = "", c = this.applyStyles(t, x(e), s);
700
+ },
701
+ { _type: v }
702
+ );
635
703
  s.push(r), n.push(r);
636
704
  } else {
637
- const c = et(e);
705
+ const c = st(e);
638
706
  for (const r in c) {
639
707
  const { value: h, priority: u } = c[r];
640
708
  if (m(h)) {
641
- const l = v(() => {
642
- x(h) ? t.style.setProperty(r, String(x(h)), u) : t.style.removeProperty(r);
643
- });
709
+ const l = w(
710
+ () => {
711
+ x(h) ? t.style.setProperty(r, String(x(h)), u) : t.style.removeProperty(r);
712
+ },
713
+ { _type: v }
714
+ );
644
715
  s.push(l), n.push(l);
645
716
  } else h != null && t.style.setProperty(r, String(h));
646
717
  }
@@ -654,18 +725,24 @@ class bt extends k {
654
725
  const n = [];
655
726
  if (m(e)) {
656
727
  let c;
657
- const r = v(() => {
658
- m(c) && c(), t.removeAttribute("class"), c = this.applyClasses(t, x(e), s);
659
- });
728
+ const r = w(
729
+ () => {
730
+ m(c) && c(), t.removeAttribute("class"), c = this.applyClasses(t, x(e), s);
731
+ },
732
+ { _type: v }
733
+ );
660
734
  s.push(r), n.push(r);
661
735
  } else {
662
- const c = tt(e);
736
+ const c = et(e);
663
737
  for (const r in c) {
664
738
  const h = c[r];
665
739
  if (m(h)) {
666
- const u = v(() => {
667
- x(h) ? t.classList.add(r) : t.classList.remove(r);
668
- });
740
+ const u = w(
741
+ () => {
742
+ x(h) ? t.classList.add(r) : t.classList.remove(r);
743
+ },
744
+ { _type: v }
745
+ );
669
746
  s.push(u), n.push(u);
670
747
  } else h && t.classList.add(r);
671
748
  }
@@ -676,49 +753,49 @@ class bt extends k {
676
753
  };
677
754
  }
678
755
  }
679
- function tt(i) {
680
- let o = {};
681
- if (D(i)) {
682
- const t = i.split(" ");
756
+ function et(o) {
757
+ let i = {};
758
+ if (R(o)) {
759
+ const t = o.split(" ");
683
760
  for (const e of t)
684
- o[e] = !0;
685
- } else C(i) ? Object.assign(o, i) : Array.isArray(i) && Array.from(i).filter(Boolean).forEach((t) => {
686
- Object.assign(o, tt(t));
761
+ i[e] = !0;
762
+ } else D(o) ? Object.assign(i, o) : Array.isArray(o) && Array.from(o).filter(Boolean).forEach((t) => {
763
+ Object.assign(i, et(t));
687
764
  });
688
- return delete o.undefined, o;
765
+ return delete i.undefined, i;
689
766
  }
690
- function et(i) {
691
- let o = {};
692
- if (D(i)) {
693
- const t = i.split(";").filter((e) => e.trim() !== "");
767
+ function st(o) {
768
+ let i = {};
769
+ if (R(o)) {
770
+ const t = o.split(";").filter((e) => e.trim() !== "");
694
771
  for (const e of t) {
695
772
  const [s, n] = e.split(":"), c = {
696
773
  value: n
697
774
  };
698
- n.includes("!important") ? (c.priority = "important", c.value = n.replace("!important", "").trim()) : c.value = n.trim(), o[G(s.trim())] = c;
775
+ n.includes("!important") ? (c.priority = "important", c.value = n.replace("!important", "").trim()) : c.value = n.trim(), i[q(s.trim())] = c;
699
776
  }
700
777
  }
701
- if (C(i))
702
- for (const t in i)
703
- t.startsWith("--") ? o[t] = { value: i[t] } : o[G(t)] = { value: i[t] };
704
- else Array.isArray(i) && Array.from(i).filter((t) => t != null).forEach((t) => {
705
- Object.assign(o, et(t));
778
+ if (D(o))
779
+ for (const t in o)
780
+ t.startsWith("--") ? i[t] = { value: o[t] } : i[q(t)] = { value: o[t] };
781
+ else Array.isArray(o) && Array.from(o).filter((t) => t != null).forEach((t) => {
782
+ Object.assign(i, st(t));
706
783
  });
707
- return o;
784
+ return i;
708
785
  }
709
- function q() {
710
- const i = this.getRoot();
711
- if (i == null) return this.tag;
712
- let o = this.getRoot().tagName.toLowerCase();
713
- if (i.id && (o += `#${i.id}`), i.classList.length > 0)
714
- for (const t of i.classList.values())
715
- o += `.${t}`;
716
- return o;
786
+ function G() {
787
+ const o = this.getRoot();
788
+ if (o == null) return this.tag;
789
+ let i = this.getRoot().tagName.toLowerCase();
790
+ if (o.id && (i += `#${o.id}`), o.classList.length > 0)
791
+ for (const t of o.classList.values())
792
+ i += `.${t}`;
793
+ return i;
717
794
  }
718
- function G(i) {
719
- return i.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (o, t) => (t ? "-" : "") + o.toLowerCase());
795
+ function q(o) {
796
+ return o.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (i, t) => (t ? "-" : "") + i.toLowerCase());
720
797
  }
721
- const gt = [
798
+ const wt = [
722
799
  // Element
723
800
  "animationcancel",
724
801
  "animationend",
@@ -808,7 +885,7 @@ const gt = [
808
885
  "reset",
809
886
  "submit"
810
887
  ];
811
- class wt extends k {
888
+ class vt extends M {
812
889
  constructor(t, e, s) {
813
890
  super();
814
891
  a(this, "context");
@@ -835,7 +912,7 @@ class wt extends k {
835
912
  move(t, e) {
836
913
  }
837
914
  }
838
- class vt extends k {
915
+ class xt extends M {
839
916
  constructor(t, e, s, n) {
840
917
  super();
841
918
  a(this, "root", document.createTextNode(""));
@@ -854,12 +931,15 @@ class vt extends k {
854
931
  return this.root.parentElement != null;
855
932
  }
856
933
  mount(t, e) {
857
- this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe = v(() => {
858
- let s = this.items();
859
- s == null && (s = [], this.context.warn("repeat() received empty value for items", s)), I(() => {
860
- this._update(Array.from(s));
861
- });
862
- }));
934
+ this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe = w(
935
+ () => {
936
+ let s = this.items();
937
+ s == null && (s = [], this.context.warn("repeat() received empty value for items", s)), L(() => {
938
+ this._update(Array.from(s));
939
+ });
940
+ },
941
+ { _type: v }
942
+ ));
863
943
  }
864
944
  unmount(t = !1) {
865
945
  var e;
@@ -890,20 +970,20 @@ class vt extends k {
890
970
  const n = [];
891
971
  for (const l of this.connectedItems.values())
892
972
  !e.has(l.key) && l.node.isMounted() && l.node.unmount(!1);
893
- ht(() => {
973
+ lt(() => {
894
974
  for (const l of e.values()) {
895
975
  const p = this.connectedItems.get(l.key);
896
976
  if (p && p.node.isMounted())
897
- p.$item(l.value), p.$index(l.index), n[l.index] = p;
977
+ p.item.set(l.value), p.index.set(l.index), n[l.index] = p;
898
978
  else {
899
- const S = _(l.value, { equals: ut }), E = _(l.index);
979
+ const E = F(l.value, { equals: dt }), I = F(l.index);
900
980
  n[l.index] = {
901
981
  key: l.key,
902
- $item: S,
903
- $index: E,
904
- node: new X(this.context, yt, {
905
- $item: () => S(),
906
- $index: () => E(),
982
+ item: E,
983
+ index: I,
984
+ node: new tt(this.context, kt, {
985
+ item: () => E(),
986
+ index: () => I(),
907
987
  render: this.render
908
988
  })
909
989
  };
@@ -911,8 +991,8 @@ class vt extends k {
911
991
  }
912
992
  });
913
993
  for (let l = 0; l < n.length; l++) {
914
- const p = n[l], S = ((r = n[l - 1]) == null ? void 0 : r.node.getRoot()) ?? this.root, E = this.connectedItems.get(p.key);
915
- E && E.node.isMounted() ? p.node.move(this.root.parentElement, S) : p.node.mount(this.root.parentElement, S);
994
+ const p = n[l], E = ((r = n[l - 1]) == null ? void 0 : r.node.getRoot()) ?? this.root, I = this.connectedItems.get(p.key);
995
+ I && I.node.isMounted() ? p.node.move(this.root.parentElement, E) : p.node.mount(this.root.parentElement, E);
916
996
  }
917
997
  this.connectedItems.clear();
918
998
  for (const l of n)
@@ -921,12 +1001,12 @@ class vt extends k {
921
1001
  (u = this.root.parentNode) == null || u.insertBefore(this.root, c.nextSibling);
922
1002
  }
923
1003
  }
924
- const xt = "dolla.RepeatItemView";
925
- function yt(i, o) {
926
- return o.setName(xt), i.render.call(o, i.$item, i.$index, o);
1004
+ const Nt = "dolla.RepeatItemView";
1005
+ function kt(o, i) {
1006
+ return i.setName(Nt), o.render.call(i, o.item, o.index, i);
927
1007
  }
928
- class st {
929
- constructor(o, t) {
1008
+ class it {
1009
+ constructor(i, t) {
930
1010
  /**
931
1011
  * In the case of a view, type will be the View function itself. It can also hold an identifier for special nodes like "$cond", "$repeat", etc.
932
1012
  * DOM nodes can be created by name, such as HTML elements like "div", "ul" or "span", SVG elements like ""
@@ -937,101 +1017,101 @@ class st {
937
1017
  * Includes a `children` prop if children were passed.
938
1018
  */
939
1019
  a(this, "props");
940
- this.type = o, this.props = t;
1020
+ this.type = i, this.props = t;
941
1021
  }
942
1022
  }
943
- var Nt = /* @__PURE__ */ ((i) => (i.DOM = "$dom", i.Dynamic = "$dynamic", i.Portal = "$portal", i.Repeat = "$repeat", i))(Nt || {});
944
- function R(i, o) {
945
- return new st(i, o ?? {});
1023
+ var Mt = /* @__PURE__ */ ((o) => (o.DOM = "$dom", o.Dynamic = "$dynamic", o.Portal = "$portal", o.Repeat = "$repeat", o))(Mt || {});
1024
+ function W(o, i) {
1025
+ return new it(o, i ?? {});
946
1026
  }
947
- function kt(i, o, t) {
948
- return R("$dynamic", {
949
- source: _(() => {
950
- const e = x(i);
951
- return e && o ? o : !e && t ? t : null;
1027
+ function St(o, i, t) {
1028
+ return W("$dynamic", {
1029
+ source: ft(() => {
1030
+ const e = x(o);
1031
+ return e && i ? i : !e && t ? t : null;
952
1032
  })
953
1033
  });
954
1034
  }
955
- function Ot(i, o, t) {
956
- return kt(i, t, o);
1035
+ function Tt(o, i, t) {
1036
+ return St(o, t, i);
957
1037
  }
958
- function Tt(i, o, t) {
959
- return R("$repeat", { items: () => x(i), key: o, render: t });
1038
+ function Ut(o, i, t) {
1039
+ return W("$repeat", { items: () => x(o), key: i, render: t });
960
1040
  }
961
- function Ut(i, o) {
962
- return R("$portal", { parent: i, content: o });
1041
+ function Pt(o, i) {
1042
+ return W("$portal", { parent: o, content: i });
963
1043
  }
964
- function ot(i, o = new f("$")) {
965
- const t = W(o, i);
966
- return t.length === 1 ? t[0] : new A(o, () => t);
1044
+ function ot(o, i = new f("$")) {
1045
+ const t = B(i, o);
1046
+ return t.length === 1 ? t[0] : new C(i, () => t);
967
1047
  }
968
- function W(i, ...o) {
969
- const t = o.flat(1 / 0), e = [];
1048
+ function B(o, ...i) {
1049
+ const t = i.flat(1 / 0), e = [];
970
1050
  for (const s of t)
971
1051
  if (!(s == null || s === !1)) {
972
1052
  if (s instanceof Node) {
973
- e.push(new $(s));
1053
+ e.push(new P(s));
974
1054
  continue;
975
1055
  }
976
- if (s instanceof st)
1056
+ if (s instanceof it)
977
1057
  if (m(s.type)) {
978
- e.push(new X(i, s.type, s.props));
1058
+ e.push(new tt(o, s.type, s.props));
979
1059
  continue;
980
- } else if (D(s.type))
1060
+ } else if (R(s.type))
981
1061
  switch (s.type) {
982
1062
  case "$dom": {
983
1063
  const n = s.props;
984
- e.push(new $(n.value));
1064
+ e.push(new P(n.value));
985
1065
  continue;
986
1066
  }
987
1067
  case "$dynamic": {
988
1068
  const n = s.props;
989
- e.push(new A(i, n.source));
1069
+ e.push(new C(o, n.source));
990
1070
  continue;
991
1071
  }
992
1072
  case "$portal": {
993
1073
  const n = s.props;
994
- e.push(new wt(i, n.content, n.parent));
1074
+ e.push(new vt(o, n.content, n.parent));
995
1075
  continue;
996
1076
  }
997
1077
  case "$repeat": {
998
1078
  const n = s.props;
999
- e.push(new vt(i, n.items, n.key, n.render));
1079
+ e.push(new xt(o, n.items, n.key, n.render));
1000
1080
  continue;
1001
1081
  }
1002
1082
  default:
1003
- e.push(new bt(i, s.type, s.props));
1083
+ e.push(new yt(o, s.type, s.props));
1004
1084
  continue;
1005
1085
  }
1006
1086
  else
1007
1087
  throw new TypeError(`Expected a string or view function. Got: ${s.type}`);
1008
- if (s instanceof k) {
1088
+ if (s instanceof M) {
1009
1089
  e.push(s);
1010
1090
  continue;
1011
1091
  }
1012
1092
  if (m(s)) {
1013
- e.push(new A(i, s));
1093
+ e.push(new C(o, s));
1014
1094
  continue;
1015
1095
  }
1016
- e.push(new $(document.createTextNode(String(s))));
1096
+ e.push(new P(document.createTextNode(String(s))));
1017
1097
  }
1018
1098
  return e;
1019
1099
  }
1020
1100
  export {
1021
1101
  f as C,
1022
- A as D,
1023
- g as L,
1024
- k as M,
1025
- vt as R,
1026
- X as V,
1027
- Tt as a,
1028
- Nt as b,
1029
- Lt as c,
1030
- st as d,
1031
- R as m,
1032
- Ut as p,
1102
+ C as D,
1103
+ b as L,
1104
+ it as M,
1105
+ xt as R,
1106
+ tt as V,
1107
+ M as a,
1108
+ Ut as b,
1109
+ _t as c,
1110
+ Mt as d,
1111
+ W as m,
1112
+ Pt as p,
1033
1113
  ot as r,
1034
- Ot as u,
1035
- kt as w
1114
+ Tt as u,
1115
+ St as w
1036
1116
  };
1037
- //# sourceMappingURL=markup-UzKSsawX.js.map
1117
+ //# sourceMappingURL=markup-DeZDwQ9F.js.map