@manyducks.co/dolla 2.0.0-alpha.44 → 2.0.0-alpha.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
- var Oe = Object.defineProperty;
1
+ var $e = Object.defineProperty;
2
2
  var oe = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
- var $e = (t, e, s) => e in t ? Oe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
6
- var l = (t, e, s) => $e(t, typeof e != "symbol" ? e + "" : e, s), F = (t, e, s) => e.has(t) || oe("Cannot " + s);
7
- var w = (t, e, s) => (F(t, e, "read from private field"), s ? s.call(t) : e.get(t)), L = (t, e, s) => e.has(t) ? oe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), $ = (t, e, s, n) => (F(t, e, "write to private field"), n ? n.call(t, s) : e.set(t, s), s), ue = (t, e, s) => (F(t, e, "access private method"), s);
5
+ var Ie = (t, e, s) => e in t ? $e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
6
+ var c = (t, e, s) => Ie(t, typeof e != "symbol" ? e + "" : e, s), W = (t, e, s) => e.has(t) || oe("Cannot " + s);
7
+ var w = (t, e, s) => (W(t, e, "read from private field"), s ? s.call(t) : e.get(t)), T = (t, e, s) => e.has(t) ? oe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), $ = (t, e, s, n) => (W(t, e, "write to private field"), n ? n.call(t, s) : e.set(t, s), s), ue = (t, e, s) => (W(t, e, "access private method"), s);
8
8
  var M = /* @__PURE__ */ ((t) => (t[t.Computed = 1] = "Computed", t[t.Effect = 2] = "Effect", t[t.Tracking = 4] = "Tracking", t[t.Notified = 8] = "Notified", t[t.Recursed = 16] = "Recursed", t[t.Dirty = 32] = "Dirty", t[t.PendingComputed = 64] = "PendingComputed", t[t.PendingEffect = 128] = "PendingEffect", t[t.Propagated = 224] = "Propagated", t))(M || {});
9
- function ye({
9
+ function ve({
10
10
  updateComputed: t,
11
11
  notifyEffect: e
12
12
  }) {
@@ -20,17 +20,17 @@ function ye({
20
20
  * @returns The newly created link object if the two are not already linked; otherwise `undefined`.
21
21
  */
22
22
  link(r, u) {
23
- const c = u.depsTail;
24
- if (c !== void 0 && c.dep === r)
23
+ const l = u.depsTail;
24
+ if (l !== void 0 && l.dep === r)
25
25
  return;
26
- const h = c !== void 0 ? c.nextDep : u.deps;
27
- if (h !== void 0 && h.dep === r) {
28
- u.depsTail = h;
26
+ const d = l !== void 0 ? l.nextDep : u.deps;
27
+ if (d !== void 0 && d.dep === r) {
28
+ u.depsTail = d;
29
29
  return;
30
30
  }
31
- const d = r.subsTail;
32
- if (!(d !== void 0 && d.sub === u && a(d, u)))
33
- return i(r, u, h, c);
31
+ const a = r.subsTail;
32
+ if (!(a !== void 0 && a.sub === u && p(a, u)))
33
+ return i(r, u, d, l);
34
34
  },
35
35
  /**
36
36
  * Traverses and marks subscribers starting from the provided link.
@@ -42,26 +42,26 @@ function ye({
42
42
  * @param link - The starting link from which propagation begins.
43
43
  */
44
44
  propagate(r) {
45
- let u = 32, c = r, h = 0;
45
+ let u = 32, l = r, d = 0;
46
46
  e: do {
47
- const d = r.sub, p = d.flags;
48
- if (!(p & 244) && (d.flags = p | u | 8, !0) || p & 16 && !(p & 4) && (d.flags = p & -17 | u | 8, !0) || !(p & 224) && a(r, d) && (d.flags = p | 16 | u | 8, d.subs !== void 0)) {
49
- const x = d.subs;
50
- if (x !== void 0) {
51
- x.nextSub !== void 0 ? (x.prevSub = c, r = c = x, u = 64, ++h) : (r = x, u = p & 2 ? 128 : 64);
47
+ const a = r.sub, h = a.flags;
48
+ if (!(h & 244) && (a.flags = h | u | 8, !0) || h & 16 && !(h & 4) && (a.flags = h & -17 | u | 8, !0) || !(h & 224) && p(r, a) && (a.flags = h | 16 | u | 8, a.subs !== void 0)) {
49
+ const N = a.subs;
50
+ if (N !== void 0) {
51
+ N.nextSub !== void 0 ? (N.prevSub = l, r = l = N, u = 64, ++d) : (r = N, u = h & 2 ? 128 : 64);
52
52
  continue;
53
53
  }
54
- p & 2 && (n !== void 0 ? n.depsTail.nextDep = d.deps : s = d, n = d);
55
- } else p & (4 | u) ? !(p & u) && p & 224 && a(r, d) && (d.flags = p | u) : (d.flags = p | u | 8, (p & 10) === 2 && (n !== void 0 ? n.depsTail.nextDep = d.deps : s = d, n = d));
56
- if ((r = c.nextSub) !== void 0) {
57
- c = r, u = h ? 64 : 32;
54
+ h & 2 && (n !== void 0 ? n.depsTail.nextDep = a.deps : s = a, n = a);
55
+ } else h & (4 | u) ? !(h & u) && h & 224 && p(r, a) && (a.flags = h | u) : (a.flags = h | u | 8, (h & 10) === 2 && (n !== void 0 ? n.depsTail.nextDep = a.deps : s = a, n = a));
56
+ if ((r = l.nextSub) !== void 0) {
57
+ l = r, u = d ? 64 : 32;
58
58
  continue;
59
59
  }
60
- for (; h; ) {
61
- --h;
62
- const re = c.dep.subs;
63
- if (c = re.prevSub, re.prevSub = void 0, (r = c.nextSub) !== void 0) {
64
- c = r, u = h ? 64 : 32;
60
+ for (; d; ) {
61
+ --d;
62
+ const re = l.dep.subs;
63
+ if (l = re.prevSub, re.prevSub = void 0, (r = l.nextSub) !== void 0) {
64
+ l = r, u = d ? 64 : 32;
65
65
  continue e;
66
66
  }
67
67
  }
@@ -90,8 +90,8 @@ function ye({
90
90
  endTracking(r) {
91
91
  const u = r.depsTail;
92
92
  if (u !== void 0) {
93
- const c = u.nextDep;
94
- c !== void 0 && (m(c), u.nextDep = void 0);
93
+ const l = u.nextDep;
94
+ l !== void 0 && (m(l), u.nextDep = void 0);
95
95
  } else r.deps !== void 0 && (m(r.deps), r.deps = void 0);
96
96
  r.flags &= -5;
97
97
  },
@@ -120,8 +120,8 @@ function ye({
120
120
  */
121
121
  processComputedUpdate(r, u) {
122
122
  if ((u & 32 || (o(r.deps) || (r.flags = u & -65, !1))) && t(r)) {
123
- const c = r.subs;
124
- c !== void 0 && f(c);
123
+ const l = r.subs;
124
+ l !== void 0 && f(l);
125
125
  }
126
126
  },
127
127
  /**
@@ -138,11 +138,11 @@ function ye({
138
138
  processPendingInnerEffects(r, u) {
139
139
  if (u & 128) {
140
140
  r.flags = u & -129;
141
- let c = r.deps;
141
+ let l = r.deps;
142
142
  do {
143
- const h = c.dep;
144
- "flags" in h && h.flags & 2 && h.flags & 224 && e(h), c = c.nextDep;
145
- } while (c !== void 0);
143
+ const d = l.dep;
144
+ "flags" in d && d.flags & 2 && d.flags & 224 && e(d), l = l.nextDep;
145
+ } while (l !== void 0);
146
146
  }
147
147
  },
148
148
  /**
@@ -154,153 +154,153 @@ function ye({
154
154
  */
155
155
  processEffectNotifications() {
156
156
  for (; s !== void 0; ) {
157
- const r = s, u = r.depsTail, c = u.nextDep;
158
- c !== void 0 ? (u.nextDep = void 0, s = c.sub) : (s = void 0, n = void 0), e(r) || (r.flags &= -9);
157
+ const r = s, u = r.depsTail, l = u.nextDep;
158
+ l !== void 0 ? (u.nextDep = void 0, s = l.sub) : (s = void 0, n = void 0), e(r) || (r.flags &= -9);
159
159
  }
160
160
  }
161
161
  };
162
- function i(r, u, c, h) {
163
- const d = {
162
+ function i(r, u, l, d) {
163
+ const a = {
164
164
  dep: r,
165
165
  sub: u,
166
- nextDep: c,
166
+ nextDep: l,
167
167
  prevSub: void 0,
168
168
  nextSub: void 0
169
169
  };
170
- if (h === void 0 ? u.deps = d : h.nextDep = d, r.subs === void 0)
171
- r.subs = d;
170
+ if (d === void 0 ? u.deps = a : d.nextDep = a, r.subs === void 0)
171
+ r.subs = a;
172
172
  else {
173
- const p = r.subsTail;
174
- d.prevSub = p, p.nextSub = d;
173
+ const h = r.subsTail;
174
+ a.prevSub = h, h.nextSub = a;
175
175
  }
176
- return u.depsTail = d, r.subsTail = d, d;
176
+ return u.depsTail = a, r.subsTail = a, a;
177
177
  }
178
178
  function o(r) {
179
- let u = 0, c;
179
+ let u = 0, l;
180
180
  e: do {
181
- c = !1;
182
- const h = r.dep;
183
- if ("flags" in h) {
184
- const d = h.flags;
185
- if ((d & 33) === 33) {
186
- if (t(h)) {
187
- const p = h.subs;
188
- p.nextSub !== void 0 && f(p), c = !0;
181
+ l = !1;
182
+ const d = r.dep;
183
+ if ("flags" in d) {
184
+ const a = d.flags;
185
+ if ((a & 33) === 33) {
186
+ if (t(d)) {
187
+ const h = d.subs;
188
+ h.nextSub !== void 0 && f(h), l = !0;
189
189
  }
190
- } else if ((d & 65) === 65) {
191
- const p = h.subs;
192
- p.nextSub !== void 0 && (p.prevSub = r), r = h.deps, ++u;
190
+ } else if ((a & 65) === 65) {
191
+ const h = d.subs;
192
+ h.nextSub !== void 0 && (h.prevSub = r), r = d.deps, ++u;
193
193
  continue;
194
194
  }
195
195
  }
196
- if (!c && r.nextDep !== void 0) {
196
+ if (!l && r.nextDep !== void 0) {
197
197
  r = r.nextDep;
198
198
  continue;
199
199
  }
200
200
  if (u) {
201
- let d = r.sub;
201
+ let a = r.sub;
202
202
  do {
203
203
  --u;
204
- const p = d.subs;
205
- if (c) {
206
- if (t(d)) {
207
- (r = p.prevSub) !== void 0 ? (p.prevSub = void 0, f(d.subs), d = r.sub) : d = p.sub;
204
+ const h = a.subs;
205
+ if (l) {
206
+ if (t(a)) {
207
+ (r = h.prevSub) !== void 0 ? (h.prevSub = void 0, f(a.subs), a = r.sub) : a = h.sub;
208
208
  continue;
209
209
  }
210
210
  } else
211
- d.flags &= -65;
212
- if ((r = p.prevSub) !== void 0) {
213
- if (p.prevSub = void 0, r.nextDep !== void 0) {
211
+ a.flags &= -65;
212
+ if ((r = h.prevSub) !== void 0) {
213
+ if (h.prevSub = void 0, r.nextDep !== void 0) {
214
214
  r = r.nextDep;
215
215
  continue e;
216
216
  }
217
- d = r.sub;
217
+ a = r.sub;
218
218
  } else {
219
- if ((r = p.nextDep) !== void 0)
219
+ if ((r = h.nextDep) !== void 0)
220
220
  continue e;
221
- d = p.sub;
221
+ a = h.sub;
222
222
  }
223
- c = !1;
223
+ l = !1;
224
224
  } while (u);
225
225
  }
226
- return c;
226
+ return l;
227
227
  } while (!0);
228
228
  }
229
229
  function f(r) {
230
230
  do {
231
- const u = r.sub, c = u.flags;
232
- (c & 96) === 64 && (u.flags = c | 32 | 8, (c & 10) === 2 && (n !== void 0 ? n.depsTail.nextDep = u.deps : s = u, n = u)), r = r.nextSub;
231
+ const u = r.sub, l = u.flags;
232
+ (l & 96) === 64 && (u.flags = l | 32 | 8, (l & 10) === 2 && (n !== void 0 ? n.depsTail.nextDep = u.deps : s = u, n = u)), r = r.nextSub;
233
233
  } while (r !== void 0);
234
234
  }
235
- function a(r, u) {
236
- const c = u.depsTail;
237
- if (c !== void 0) {
238
- let h = u.deps;
235
+ function p(r, u) {
236
+ const l = u.depsTail;
237
+ if (l !== void 0) {
238
+ let d = u.deps;
239
239
  do {
240
- if (h === r)
240
+ if (d === r)
241
241
  return !0;
242
- if (h === c)
242
+ if (d === l)
243
243
  break;
244
- h = h.nextDep;
245
- } while (h !== void 0);
244
+ d = d.nextDep;
245
+ } while (d !== void 0);
246
246
  }
247
247
  return !1;
248
248
  }
249
249
  function m(r) {
250
250
  do {
251
- const u = r.dep, c = r.nextDep, h = r.nextSub, d = r.prevSub;
252
- if (h !== void 0 ? h.prevSub = d : u.subsTail = d, d !== void 0 ? d.nextSub = h : u.subs = h, u.subs === void 0 && "deps" in u) {
253
- const p = u.flags;
254
- p & 32 || (u.flags = p | 32);
255
- const x = u.deps;
256
- if (x !== void 0) {
257
- r = x, u.depsTail.nextDep = c, u.deps = void 0, u.depsTail = void 0;
251
+ const u = r.dep, l = r.nextDep, d = r.nextSub, a = r.prevSub;
252
+ if (d !== void 0 ? d.prevSub = a : u.subsTail = a, a !== void 0 ? a.nextSub = d : u.subs = d, u.subs === void 0 && "deps" in u) {
253
+ const h = u.flags;
254
+ h & 32 || (u.flags = h | 32);
255
+ const N = u.deps;
256
+ if (N !== void 0) {
257
+ r = N, u.depsTail.nextDep = l, u.deps = void 0, u.depsTail = void 0;
258
258
  continue;
259
259
  }
260
260
  }
261
- r = c;
261
+ r = l;
262
262
  } while (r !== void 0);
263
263
  }
264
264
  }
265
265
  var {
266
- link: ft,
267
- propagate: lt,
268
- updateDirtyFlag: Ie,
269
- startTracking: ve,
270
- endTracking: we,
271
- processEffectNotifications: at,
272
- processComputedUpdate: dt,
273
- processPendingInnerEffects: be
274
- } = ye({
266
+ link: lt,
267
+ propagate: at,
268
+ updateDirtyFlag: Ve,
269
+ startTracking: we,
270
+ endTracking: be,
271
+ processEffectNotifications: dt,
272
+ processComputedUpdate: ht,
273
+ processPendingInnerEffects: Ne
274
+ } = ve({
275
275
  updateComputed(t) {
276
- ve(t);
276
+ we(t);
277
277
  try {
278
278
  const e = t.currentValue, s = t.getter(e);
279
279
  return e !== s ? (t.currentValue = s, !0) : !1;
280
280
  } finally {
281
- we(t);
281
+ be(t);
282
282
  }
283
283
  },
284
284
  notifyEffect(t) {
285
- return "isScope" in t ? _e(t) : Ve(t);
285
+ return "isScope" in t ? qe(t) : _e(t);
286
286
  }
287
287
  });
288
288
  function je(t) {
289
- ve(t);
289
+ we(t);
290
290
  try {
291
291
  t.fn();
292
292
  } finally {
293
- we(t);
293
+ be(t);
294
294
  }
295
295
  }
296
- function Ve(t) {
296
+ function _e(t) {
297
297
  const e = t.flags;
298
- return e & 32 || e & 64 && Ie(t, e) ? je(t) : be(t, t.flags), !0;
298
+ return e & 32 || e & 64 && Ve(t, e) ? je(t) : Ne(t, t.flags), !0;
299
299
  }
300
- function _e(t) {
301
- return t.flags & 128 ? (be(t, t.flags), !0) : !1;
300
+ function qe(t) {
301
+ return t.flags & 128 ? (Ne(t, t.flags), !0) : !1;
302
302
  }
303
- function A(t) {
303
+ function D(t) {
304
304
  const e = typeof t;
305
305
  switch (e) {
306
306
  case "undefined":
@@ -318,125 +318,125 @@ function A(t) {
318
318
  function _(t) {
319
319
  return Array.isArray(t);
320
320
  }
321
- function X(t, e) {
321
+ function J(t, e) {
322
322
  return _(e) && e.every((s) => t(s));
323
323
  }
324
- function ht(t, e, s) {
325
- if (X(t, e))
324
+ function pt(t, e, s) {
325
+ if (J(t, e))
326
326
  return !0;
327
- throw new TypeError(G(e, s));
327
+ throw new TypeError(F(e, s));
328
328
  }
329
329
  function O(t) {
330
330
  return typeof t == "string";
331
331
  }
332
- function pt(t, e) {
332
+ function mt(t, e) {
333
333
  if (O(t))
334
334
  return !0;
335
- throw new TypeError(G(t, e ?? "Expected a string. Got type: %t, value: %v"));
335
+ throw new TypeError(F(t, e ?? "Expected a string. Got type: %t, value: %v"));
336
336
  }
337
- function E(t) {
338
- return A(t) === "function";
337
+ function S(t) {
338
+ return D(t) === "function";
339
339
  }
340
- function qe(t) {
340
+ function Ue(t) {
341
341
  return typeof t == "number" && !isNaN(t);
342
342
  }
343
- function mt(...t) {
343
+ function gt(...t) {
344
344
  const e = t[0], s = O(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, n = (i) => {
345
345
  if (i instanceof e)
346
346
  return !0;
347
- throw new TypeError(G(i, s));
347
+ throw new TypeError(F(i, s));
348
348
  };
349
349
  return t.length < 2 ? n : n(t[1]);
350
350
  }
351
- function J(t) {
351
+ function Q(t) {
352
352
  return t != null && typeof t == "object" && !_(t);
353
353
  }
354
- function gt(t, e) {
355
- if (J(t))
354
+ function yt(t, e) {
355
+ if (Q(t))
356
356
  return !0;
357
- throw new TypeError(G(t, e));
357
+ throw new TypeError(F(t, e));
358
358
  }
359
- function G(t, e) {
359
+ function F(t, e) {
360
360
  var i;
361
- const s = A(t), n = ((i = t == null ? void 0 : t.toString) == null ? void 0 : i.call(t)) || String(t);
361
+ const s = D(t), n = ((i = t == null ? void 0 : t.toString) == null ? void 0 : i.call(t)) || String(t);
362
362
  return e.replaceAll("%t", s).replaceAll("%v", n);
363
363
  }
364
- let T, P = [];
364
+ let k, P = [];
365
365
  const {
366
- link: Q,
367
- propagate: Ue,
366
+ link: Y,
367
+ propagate: Re,
368
368
  updateDirtyFlag: ze,
369
- startTracking: Y,
370
- endTracking: ee,
371
- processEffectNotifications: Re,
372
- processComputedUpdate: Be,
369
+ startTracking: ee,
370
+ endTracking: te,
371
+ processEffectNotifications: Be,
372
+ processComputedUpdate: Fe,
373
373
  processPendingInnerEffects: Ge
374
- } = ye({
374
+ } = ve({
375
375
  updateComputed(t) {
376
376
  const e = g;
377
- g = t, P.length = 0, Y(t);
377
+ g = t, P.length = 0, ee(t);
378
378
  try {
379
379
  const s = t.currentValue, n = t.getter(s);
380
380
  return t.equals(s, n) ? !1 : (t.currentValue = n, !0);
381
381
  } finally {
382
- g = e, T !== void 0 && (T(P), T = void 0), ee(t);
382
+ g = e, k !== void 0 && (k(P), k = void 0), te(t);
383
383
  }
384
384
  },
385
385
  notifyEffect(t) {
386
386
  const e = t.flags;
387
- return e & M.Dirty || e & M.PendingComputed && ze(t, e) ? Ne(t) : Ge(t, t.flags), !0;
387
+ return e & M.Dirty || e & M.PendingComputed && ze(t, e) ? xe(t) : Ge(t, t.flags), !0;
388
388
  }
389
389
  });
390
390
  let g;
391
- const C = [];
392
- let W = !1;
393
- function Fe() {
394
- W || (W = !0, queueMicrotask(() => {
395
- W = !1;
396
- for (let t = 0; t < C.length; t++) {
397
- const e = C[t], s = g;
398
- g = e, P.length = 0, Y(e);
391
+ const L = [];
392
+ let Z = !1;
393
+ function We() {
394
+ Z || (Z = !0, queueMicrotask(() => {
395
+ Z = !1;
396
+ for (let t = 0; t < L.length; t++) {
397
+ const e = L[t], s = g;
398
+ g = e, P.length = 0, ee(e);
399
399
  try {
400
400
  e.fn();
401
401
  } finally {
402
- g = s, ee(e), T !== void 0 && (T(P), T = void 0);
402
+ g = s, te(e), k !== void 0 && (k(P), k = void 0);
403
403
  }
404
404
  }
405
- C.length = 0;
405
+ L.length = 0;
406
406
  }));
407
407
  }
408
- function Ne(t) {
409
- C.push(t), Fe();
410
- }
411
- function We() {
412
- Y(this), ee(this), queueMicrotask(() => {
413
- C.splice(C.indexOf(this), 1);
414
- });
408
+ function xe(t) {
409
+ L.push(t), We();
415
410
  }
416
- const xe = [];
417
411
  function Ze() {
418
- xe.push(g), g = void 0;
412
+ ee(this), te(this), queueMicrotask(() => {
413
+ L.splice(L.indexOf(this), 1);
414
+ });
419
415
  }
416
+ const Ee = [];
420
417
  function He() {
421
- g = xe.pop();
418
+ Ee.push(g), g = void 0;
419
+ }
420
+ function Ke() {
421
+ g = Ee.pop();
422
422
  }
423
- var b, j;
423
+ var b, V;
424
424
  class Me {
425
425
  constructor(e, s) {
426
- L(this, b);
427
- L(this, j);
428
- l(this, "name");
426
+ T(this, b);
427
+ T(this, V);
428
+ c(this, "name");
429
429
  $(this, b, {
430
430
  currentValue: e,
431
431
  subs: void 0,
432
432
  subsTail: void 0
433
- }), $(this, j, (s == null ? void 0 : s.equals) ?? Object.is), s != null && s.name && (this.name = s.name);
433
+ }), $(this, V, (s == null ? void 0 : s.equals) ?? Object.is), s != null && s.name && (this.name = s.name);
434
434
  }
435
435
  /**
436
436
  * Returns the latest value. The signal is tracked as a dependency if called within `effect` or `compose`.
437
437
  */
438
438
  get() {
439
- return g !== void 0 && (Q(w(this, b), g), P.push(this)), w(this, b).currentValue;
439
+ return g !== void 0 && (Y(w(this, b), g), P.push(this)), w(this, b).currentValue;
440
440
  }
441
441
  /**
442
442
  * Returns the latest value. The signal is NOT tracked if called within `effect` or `compose`.
@@ -453,10 +453,10 @@ class Me {
453
453
  * count.set(count.get() + 1);
454
454
  */
455
455
  set(e) {
456
- if (!w(this, j).call(this, w(this, b).currentValue, e)) {
456
+ if (!w(this, V).call(this, w(this, b).currentValue, e)) {
457
457
  w(this, b).currentValue = e;
458
458
  const s = w(this, b).subs;
459
- s !== void 0 && (Ue(s), Re());
459
+ s !== void 0 && (Re(s), Be());
460
460
  }
461
461
  }
462
462
  /**
@@ -506,15 +506,15 @@ class Me {
506
506
  this.set(e);
507
507
  }
508
508
  }
509
- b = new WeakMap(), j = new WeakMap();
510
- var D, V, B, ke;
511
- class Ee {
509
+ b = new WeakMap(), V = new WeakMap();
510
+ var A, j, B, ke;
511
+ class Se {
512
512
  constructor(e, s) {
513
- L(this, B);
514
- L(this, D);
515
- L(this, V);
516
- l(this, "name");
517
- $(this, V, e), $(this, D, {
513
+ T(this, B);
514
+ T(this, A);
515
+ T(this, j);
516
+ c(this, "name");
517
+ $(this, j, e), $(this, A, {
518
518
  currentValue: void 0,
519
519
  equals: (s == null ? void 0 : s.equals) ?? Object.is,
520
520
  subs: void 0,
@@ -526,11 +526,11 @@ class Ee {
526
526
  }), s != null && s.name && (this.name = s.name);
527
527
  }
528
528
  get() {
529
- return g !== void 0 && (Q(w(this, D), g), P.push(this)), this.peek();
529
+ return g !== void 0 && (Y(w(this, A), g), P.push(this)), this.peek();
530
530
  }
531
531
  peek() {
532
- const e = w(this, D), s = e.flags;
533
- return s & (M.Dirty | M.PendingComputed) && Be(e, s), e.currentValue;
532
+ const e = w(this, A), s = e.flags;
533
+ return s & (M.Dirty | M.PendingComputed) && Fe(e, s), e.currentValue;
534
534
  }
535
535
  /**
536
536
  * @deprecated use `get()`
@@ -539,38 +539,38 @@ class Ee {
539
539
  return this.peek();
540
540
  }
541
541
  }
542
- D = new WeakMap(), V = new WeakMap(), B = new WeakSet(), ke = function(e) {
543
- let s = w(this, V).call(this, e);
542
+ A = new WeakMap(), j = new WeakMap(), B = new WeakSet(), ke = function(e) {
543
+ let s = w(this, j).call(this, e);
544
544
  return y(s) && (s = s.get()), s;
545
545
  };
546
546
  function y(t) {
547
- return t instanceof Me || t instanceof Ee;
547
+ return t instanceof Me || t instanceof Se;
548
548
  }
549
- function K(t, e) {
549
+ function X(t, e) {
550
550
  return new Me(t, e);
551
551
  }
552
- function te(t, e) {
553
- return new Ee(t, e);
552
+ function se(t, e) {
553
+ return new Se(t, e);
554
554
  }
555
- function Ke(t, e) {
556
- if (E(e))
555
+ function Xe(t, e) {
556
+ if (S(e))
557
557
  t.update(e);
558
558
  else if (arguments.length > 1)
559
559
  t.set(e);
560
560
  else
561
- return (s) => Ke(t, s);
561
+ return (s) => Xe(t, s);
562
562
  }
563
563
  function I(t) {
564
564
  return y(t) ? t.get() : t;
565
565
  }
566
- function yt(t) {
566
+ function vt(t) {
567
567
  return y(t) ? t.peek() : t;
568
568
  }
569
- function se(t) {
570
- Ze(), t(), He();
569
+ function G(t) {
570
+ He(), t(), Ke();
571
571
  }
572
- function vt(t) {
573
- T = t;
572
+ function wt(t) {
573
+ k = t;
574
574
  }
575
575
  function v(t) {
576
576
  const e = {
@@ -581,21 +581,21 @@ function v(t) {
581
581
  depsTail: void 0,
582
582
  flags: M.Effect
583
583
  };
584
- return g !== void 0 && Q(e, g), Ne(e), We.bind(e);
584
+ return g !== void 0 && Y(e, g), xe(e), Ze.bind(e);
585
585
  }
586
- const wt = () => {
586
+ const bt = () => {
587
587
  };
588
- let Z = 1;
589
- function Se() {
590
- return Z = Z % Number.MAX_SAFE_INTEGER + 1, Z.toString(36) + Date.now().toString(36);
588
+ let H = 1;
589
+ function Te() {
590
+ return H = H % Number.MAX_SAFE_INTEGER + 1, H.toString(36) + Date.now().toString(36);
591
591
  }
592
- function bt(t, e) {
592
+ function Nt(t, e) {
593
593
  return Object.is(t, e);
594
594
  }
595
- function Nt(t, e) {
595
+ function xt(t, e) {
596
596
  if (Object.is(t, e)) return !0;
597
- const s = A(t);
598
- if (s !== A(e))
597
+ const s = D(t);
598
+ if (s !== D(e))
599
599
  return !1;
600
600
  switch (s) {
601
601
  case "object":
@@ -616,7 +616,7 @@ function Nt(t, e) {
616
616
  if (t[i] !== e[i]) return !1;
617
617
  return !0;
618
618
  case "set":
619
- if (E(t.symmetricDifference))
619
+ if (S(t.symmetricDifference))
620
620
  return t.symmetricDifference(e).size === 0;
621
621
  for (const i of t.keys())
622
622
  if (t[i] !== e.get(i)) return !1;
@@ -624,20 +624,20 @@ function Nt(t, e) {
624
624
  }
625
625
  return !1;
626
626
  }
627
- function H(t, e) {
627
+ function K(t, e) {
628
628
  if (t === e) return !0;
629
629
  if (t && e && typeof t == "object" && typeof e == "object") {
630
630
  if (t.constructor !== e.constructor) return !1;
631
631
  var s, n, i;
632
632
  if (Array.isArray(t)) {
633
633
  if (s = t.length, s != e.length) return !1;
634
- for (n = s; n-- !== 0; ) if (!H(t[n], e[n])) return !1;
634
+ for (n = s; n-- !== 0; ) if (!K(t[n], e[n])) return !1;
635
635
  return !0;
636
636
  }
637
637
  if (t instanceof Map && e instanceof Map) {
638
638
  if (t.size !== e.size) return !1;
639
639
  for (n of t.entries()) if (!e.has(n[0])) return !1;
640
- for (n of t.entries()) if (!H(n[1], e.get(n[0]))) return !1;
640
+ for (n of t.entries()) if (!K(n[1], e.get(n[0]))) return !1;
641
641
  return !0;
642
642
  }
643
643
  if (t instanceof Set && e instanceof Set) {
@@ -657,19 +657,19 @@ function H(t, e) {
657
657
  for (n = s; n-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(e, i[n])) return !1;
658
658
  for (n = s; n-- !== 0; ) {
659
659
  var o = i[n];
660
- if (!H(t[o], e[o])) return !1;
660
+ if (!K(t[o], e[o])) return !1;
661
661
  }
662
662
  return !0;
663
663
  }
664
664
  return t !== t && e !== e;
665
665
  }
666
- function Xe(t, e) {
666
+ function Je(t, e) {
667
667
  const s = {};
668
668
  for (const n in e)
669
669
  t.includes(n) || (s[n] = e[n]);
670
670
  return s;
671
671
  }
672
- function xt(t) {
672
+ function Et(t) {
673
673
  let e = 0;
674
674
  for (let s = 0; s < t.length; s++)
675
675
  e = (e + t.charCodeAt(s) * 10) % 360;
@@ -697,26 +697,13 @@ function Mt(t) {
697
697
  return !(o.some((f) => f(n)) || i.length > 0 && !i.some((f) => f(n)));
698
698
  };
699
699
  }
700
- const k = Symbol.for("DollaMarkupElement"), Et = Symbol.for("DollaRouter");
701
- function kt(t, e) {
702
- return e.outlet();
703
- }
704
- function Je(t) {
705
- for (var e, s, n = arguments, i = 1, o = "", f = "", a = [0], m = function(c) {
706
- i === 1 && (c || (o = o.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? a.push(c ? n[c] : o) : i === 3 && (c || o) ? (a[1] = c ? n[c] : o, i = 2) : i === 2 && o === "..." && c ? a[2] = Object.assign(a[2] || {}, n[c]) : i === 2 && o && !c ? (a[2] = a[2] || {})[o] = !0 : i >= 5 && (i === 5 ? ((a[2] = a[2] || {})[s] = c ? o ? o + n[c] : n[c] : o, i = 6) : (c || o) && (a[2][s] += c ? o + n[c] : o)), o = "";
707
- }, r = 0; r < t.length; r++) {
708
- r && (i === 1 && m(), m(r));
709
- for (var u = 0; u < t[r].length; u++) e = t[r][u], i === 1 ? e === "<" ? (m(), a = [a, "", null], i = 3) : o += e : i === 4 ? o === "--" && e === ">" ? (i = 1, o = "") : o = e + o[0] : f ? e === f ? f = "" : o += e : e === '"' || e === "'" ? f = e : e === ">" ? (m(), i = 1) : i && (e === "=" ? (i = 5, s = o, o = "") : e === "/" && (i < 5 || t[r][u + 1] === ">") ? (m(), i === 3 && (a = a[0]), i = a, (a = a[0]).push(this.apply(null, i.slice(1))), i = 0) : e === " " || e === " " || e === `
710
- ` || e === "\r" ? (m(), i = 2) : o += e), i === 3 && o === "!--" && (i = 4, a = a[0]);
711
- }
712
- return m(), a.length > 2 ? a.slice(1) : a[1];
713
- }
700
+ const E = Symbol.for("DollaMarkupElement"), St = Symbol.for("DollaRouter");
714
701
  var le;
715
- le = k;
702
+ le = E;
716
703
  class ce {
717
704
  constructor(e) {
718
- l(this, le, !0);
719
- l(this, "domNode");
705
+ c(this, le, !0);
706
+ c(this, "domNode");
720
707
  this.domNode = e;
721
708
  }
722
709
  get isMounted() {
@@ -730,15 +717,15 @@ class ce {
730
717
  }
731
718
  }
732
719
  var ae;
733
- ae = k;
720
+ ae = E;
734
721
  class Qe {
735
722
  constructor(e) {
736
- l(this, ae, !0);
737
- l(this, "domNode", document.createTextNode(""));
738
- l(this, "children", []);
739
- l(this, "elementContext");
740
- l(this, "source");
741
- l(this, "unsubscribe");
723
+ c(this, ae, !0);
724
+ c(this, "domNode", document.createTextNode(""));
725
+ c(this, "children", []);
726
+ c(this, "elementContext");
727
+ c(this, "source");
728
+ c(this, "unsubscribe");
742
729
  this.source = e.source, this.elementContext = e.elementContext;
743
730
  }
744
731
  get isMounted() {
@@ -747,11 +734,11 @@ class Qe {
747
734
  mount(e, s) {
748
735
  this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = v(() => {
749
736
  const n = this.source.get();
750
- if (!Pe(n))
737
+ if (!Oe(n))
751
738
  throw console.error(n), new TypeError(
752
- `Dynamic received invalid value to render. Got type: ${A(n)}, value: ${n}`
739
+ `Dynamic received invalid value to render. Got type: ${D(n)}, value: ${n}`
753
740
  );
754
- se(() => {
741
+ G(() => {
755
742
  this.update(_(n) ? n : [n]);
756
743
  });
757
744
  }));
@@ -766,46 +753,46 @@ class Qe {
766
753
  this.children = [];
767
754
  }
768
755
  update(e) {
769
- var o, f, a;
756
+ var o, f, p;
770
757
  if (this.cleanup(!1), e == null || e.length === 0 || !this.isMounted)
771
758
  return;
772
- const s = e.flatMap((m) => De(m) ? m : S(this.elementContext, ne(m)));
759
+ const s = e.flatMap((m) => De(m) ? m : C(this.elementContext, ne(m)));
773
760
  for (const m of s) {
774
761
  const r = ((o = this.children.at(-1)) == null ? void 0 : o.domNode) || this.domNode;
775
762
  m.mount(this.domNode.parentNode, r), this.children.push(m);
776
763
  }
777
- const n = this.domNode.parentNode, i = ((a = (f = this.children.at(-1)) == null ? void 0 : f.domNode) == null ? void 0 : a.nextSibling) ?? null;
764
+ const n = this.domNode.parentNode, i = ((p = (f = this.children.at(-1)) == null ? void 0 : f.domNode) == null ? void 0 : p.nextSibling) ?? null;
778
765
  n.insertBefore(this.domNode, i);
779
766
  }
780
767
  }
781
768
  const Ye = (t) => /^on[A-Z]/.test(t);
782
769
  var de;
783
- de = k;
770
+ de = E;
784
771
  class et {
785
772
  constructor({ tag: e, props: s, children: n, elementContext: i }) {
786
- l(this, de, !0);
787
- l(this, "domNode");
788
- l(this, "props");
789
- l(this, "childMarkup", []);
790
- l(this, "children", []);
791
- l(this, "unsubscribers", []);
792
- l(this, "elementContext");
773
+ c(this, de, !0);
774
+ c(this, "domNode");
775
+ c(this, "props");
776
+ c(this, "childMarkup", []);
777
+ c(this, "children", []);
778
+ c(this, "unsubscribers", []);
779
+ c(this, "elementContext");
793
780
  // Track the ref so we can nullify it on unmount.
794
- l(this, "ref");
781
+ c(this, "ref");
795
782
  // Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
796
- l(this, "canClickAway", !1);
783
+ c(this, "canClickAway", !1);
797
784
  if (e.toLowerCase() === "svg" && (i = {
798
785
  ...i,
799
786
  isSVG: !0
800
787
  }), i.isSVG ? this.domNode = document.createElementNS("http://www.w3.org/2000/svg", e) : this.domNode = document.createElement(e), i.root.getEnv() === "development" && i.viewName && (this.domNode.dataset.view = i.viewName), s.ref)
801
- if (E(s.ref))
788
+ if (S(s.ref))
802
789
  this.ref = s.ref, this.ref(this.domNode);
803
790
  else
804
791
  throw new Error("Expected ref to be a function. Got: " + s.ref);
805
792
  this.props = {
806
- ...Xe(["ref", "class", "className"], s),
793
+ ...Je(["ref", "class", "className"], s),
807
794
  class: s.className ?? s.class
808
- }, n && (this.childMarkup = n), this.elementContext = i;
795
+ }, n && (this.childMarkup = ne(n)), this.elementContext = i;
809
796
  }
810
797
  get isMounted() {
811
798
  return this.domNode.parentNode != null;
@@ -814,7 +801,7 @@ class et {
814
801
  if (e == null)
815
802
  throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${e}`);
816
803
  if (!this.isMounted) {
817
- this.childMarkup.length > 0 && (this.children = S(this.elementContext, this.childMarkup));
804
+ this.childMarkup.length > 0 && (this.children = C(this.elementContext, this.childMarkup));
818
805
  for (let n = 0; n < this.children.length; n++) {
819
806
  const i = this.children[n], o = n > 0 ? this.children[n - 1].domNode : void 0;
820
807
  i.mount(this.domNode, o);
@@ -848,14 +835,14 @@ class et {
848
835
  for (const n in s) {
849
836
  const i = s[n];
850
837
  if (n === "on:clickoutside" || n === "onClickOutside" || n === "onclickoutside") {
851
- const o = (a) => {
852
- this.canClickAway && !e.contains(a.target) && (y(i) ? i.peek()(a) : i(a));
838
+ const o = (p) => {
839
+ this.canClickAway && !e.contains(p.target) && (y(i) ? i.peek()(p) : i(p));
853
840
  }, f = { capture: !0 };
854
841
  window.addEventListener("click", o, f), this.unsubscribers.push(() => {
855
842
  window.removeEventListener("click", o, f);
856
843
  });
857
844
  } else if (Ye(n)) {
858
- const o = n.slice(2).toLowerCase(), f = y(i) ? (a) => i.peek()(a) : i;
845
+ const o = n.slice(2).toLowerCase(), f = y(i) ? (p) => i.peek()(p) : i;
859
846
  e.addEventListener(o, f), this.unsubscribers.push(() => {
860
847
  e.removeEventListener(o, f);
861
848
  });
@@ -881,6 +868,10 @@ class et {
881
868
  e.htmlFor = o;
882
869
  });
883
870
  break;
871
+ case "title":
872
+ this.attachProp(i, (o) => {
873
+ o == null ? e.removeAttribute(n) : e.setAttribute(n, String(o));
874
+ });
884
875
  case "checked":
885
876
  this.attachProp(i, (o) => {
886
877
  e.checked = o, o ? e.setAttribute("checked", "") : e.removeAttribute("checked");
@@ -901,8 +892,8 @@ class et {
901
892
  } else if (n.startsWith("on:")) {
902
893
  const o = n.substring(3);
903
894
  let f;
904
- this.attachProp(i, (a) => {
905
- !a && f ? e.removeEventListener(o, f) : a != null && (f && f !== a && e.removeEventListener(o, f), e.addEventListener(o, a)), f = a;
895
+ this.attachProp(i, (p) => {
896
+ !p && f ? e.removeEventListener(o, f) : p != null && (f && f !== p && e.removeEventListener(o, f), e.addEventListener(o, p)), f = p;
906
897
  });
907
898
  } else if (n.startsWith("attr:")) {
908
899
  const o = n.substring(5).toLowerCase();
@@ -923,19 +914,19 @@ class et {
923
914
  if (y(s)) {
924
915
  let o;
925
916
  const f = v(() => {
926
- E(o) && o(), e.style.cssText = "", o = this.applyStyles(e, I(s), n);
917
+ S(o) && o(), e.style.cssText = "", o = this.applyStyles(e, I(s), n);
927
918
  });
928
919
  n.push(f), i.push(f);
929
920
  } else {
930
- const o = Le(s);
921
+ const o = Ce(s);
931
922
  for (const f in o) {
932
- const { value: a, priority: m } = o[f];
933
- if (y(a)) {
923
+ const { value: p, priority: m } = o[f];
924
+ if (y(p)) {
934
925
  const r = v(() => {
935
- a.get() ? e.style.setProperty(f, String(a.get()), m) : e.style.removeProperty(f);
926
+ p.get() ? e.style.setProperty(f, String(p.get()), m) : e.style.removeProperty(f);
936
927
  });
937
928
  n.push(r), i.push(r);
938
- } else a != null && e.style.setProperty(f, String(a));
929
+ } else p != null && e.style.setProperty(f, String(p));
939
930
  }
940
931
  }
941
932
  return function() {
@@ -948,19 +939,19 @@ class et {
948
939
  if (y(s)) {
949
940
  let o;
950
941
  const f = v(() => {
951
- E(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, I(s), n);
942
+ S(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, I(s), n);
952
943
  });
953
944
  n.push(f), i.push(f);
954
945
  } else {
955
- const o = Te(s);
946
+ const o = Le(s);
956
947
  for (const f in o) {
957
- const a = o[f];
958
- if (y(a)) {
948
+ const p = o[f];
949
+ if (y(p)) {
959
950
  const m = v(() => {
960
- I(a) ? e.classList.add(f) : e.classList.remove(f);
951
+ I(p) ? e.classList.add(f) : e.classList.remove(f);
961
952
  });
962
953
  n.push(m), i.push(m);
963
- } else a && e.classList.add(f);
954
+ } else p && e.classList.add(f);
964
955
  }
965
956
  }
966
957
  return function() {
@@ -969,18 +960,18 @@ class et {
969
960
  };
970
961
  }
971
962
  }
972
- function Te(t) {
963
+ function Le(t) {
973
964
  let e = {};
974
965
  if (O(t)) {
975
966
  const s = t.split(" ");
976
967
  for (const n of s)
977
968
  e[n] = !0;
978
- } else J(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((s) => {
979
- Object.assign(e, Te(s));
969
+ } else Q(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((s) => {
970
+ Object.assign(e, Le(s));
980
971
  });
981
972
  return delete e.undefined, e;
982
973
  }
983
- function Le(t) {
974
+ function Ce(t) {
984
975
  let e = {};
985
976
  if (O(t)) {
986
977
  const s = t.split(";").filter((n) => n.trim() !== "");
@@ -991,11 +982,11 @@ function Le(t) {
991
982
  o.includes("!important") ? (f.priority = "important", f.value = o.replace("!important", "").trim()) : f.value = o.trim(), e[fe(i.trim())] = f;
992
983
  }
993
984
  }
994
- if (J(t))
985
+ if (Q(t))
995
986
  for (const s in t)
996
987
  s.startsWith("--") ? e[s] = { value: t[s] } : e[fe(s)] = { value: t[s] };
997
988
  else Array.isArray(t) && Array.from(t).filter((s) => s != null).forEach((s) => {
998
- Object.assign(e, Le(s));
989
+ Object.assign(e, Ce(s));
999
990
  });
1000
991
  return e;
1001
992
  }
@@ -1005,7 +996,7 @@ function fe(t) {
1005
996
  const tt = ["ref", "children", "class", "style", "data"];
1006
997
  let st = class {
1007
998
  constructor(e) {
1008
- l(this, "store");
999
+ c(this, "store");
1009
1000
  this.store = e;
1010
1001
  const s = Object.getOwnPropertyDescriptors(this.store.logger);
1011
1002
  for (const n in s)
@@ -1021,7 +1012,7 @@ let st = class {
1021
1012
  this.store.name = e, this.store.logger.setName(e);
1022
1013
  }
1023
1014
  get(e) {
1024
- if (E(e)) {
1015
+ if (S(e)) {
1025
1016
  let s = this.store.elementContext, n;
1026
1017
  for (; n = s.stores.get(e), n == null && s.parent != null; )
1027
1018
  s = s.parent;
@@ -1054,18 +1045,18 @@ let st = class {
1054
1045
  };
1055
1046
  class nt {
1056
1047
  constructor(e, s) {
1057
- l(this, "fn");
1058
- l(this, "_options");
1048
+ c(this, "fn");
1049
+ c(this, "_options");
1059
1050
  /**
1060
1051
  * Value is guaranteed to be set after `attach` is called.
1061
1052
  */
1062
- l(this, "value");
1063
- l(this, "isMounted", !1);
1064
- l(this, "elementContext");
1065
- l(this, "lifecycleListeners", { mount: [], unmount: [] });
1066
- l(this, "logger");
1067
- l(this, "id", Se());
1068
- l(this, "name");
1053
+ c(this, "value");
1054
+ c(this, "isMounted", !1);
1055
+ c(this, "elementContext");
1056
+ c(this, "lifecycleListeners", { mount: [], unmount: [] });
1057
+ c(this, "logger");
1058
+ c(this, "id", Te());
1059
+ c(this, "name");
1069
1060
  this.fn = e, this.name = e.name, this._options = s;
1070
1061
  }
1071
1062
  /**
@@ -1101,7 +1092,7 @@ class U extends Error {
1101
1092
  }
1102
1093
  class it {
1103
1094
  constructor(e) {
1104
- l(this, "view");
1095
+ c(this, "view");
1105
1096
  this.view = e;
1106
1097
  const s = Object.getOwnPropertyDescriptors(this.view.logger);
1107
1098
  for (const n in s)
@@ -1133,7 +1124,7 @@ class it {
1133
1124
  }
1134
1125
  }
1135
1126
  get(e) {
1136
- if (E(e)) {
1127
+ if (S(e)) {
1137
1128
  let s = this.view.elementContext, n;
1138
1129
  for (; n = s.stores.get(e), n == null && s.parent != null; )
1139
1130
  s = s.parent;
@@ -1169,30 +1160,32 @@ class it {
1169
1160
  }
1170
1161
  }
1171
1162
  outlet() {
1172
- return N("$outlet", { children: this.view.children });
1163
+ return x("$outlet", { view: this.view.elementContext.route });
1173
1164
  }
1174
1165
  }
1175
1166
  var he;
1176
- he = k;
1167
+ he = E;
1177
1168
  const ie = class ie {
1178
- constructor(e, s, n, i = []) {
1179
- l(this, he, !0);
1180
- l(this, "uniqueId", Se());
1181
- l(this, "elementContext");
1182
- l(this, "logger");
1183
- l(this, "props");
1184
- l(this, "fn");
1185
- l(this, "element");
1186
- l(this, "childMarkup");
1187
- l(this, "children", K([]));
1188
- l(this, "lifecycleListeners", { beforeMount: [], mount: [], beforeUnmount: [], unmount: [] });
1189
- l(this, "isMounted", !1);
1169
+ constructor(e, s, n, i) {
1170
+ c(this, he, !0);
1171
+ c(this, "uniqueId", Te());
1172
+ c(this, "elementContext");
1173
+ c(this, "logger");
1174
+ c(this, "props");
1175
+ c(this, "fn");
1176
+ c(this, "element");
1177
+ c(this, "lifecycleListeners", { beforeMount: [], mount: [], beforeUnmount: [], unmount: [] });
1178
+ c(this, "isMounted", !1);
1190
1179
  this.elementContext = {
1191
1180
  ...e,
1192
1181
  parent: e,
1193
1182
  viewName: s.name,
1194
- stores: /* @__PURE__ */ new Map()
1195
- }, this.logger = e.root.createLogger(s.name || "🌇 anonymous view", { uid: this.uniqueId }), this.props = n, this.fn = s, this.childMarkup = i;
1183
+ stores: /* @__PURE__ */ new Map(),
1184
+ route: X()
1185
+ }, this.logger = e.root.createLogger(s.name || "🌇 anonymous view", { uid: this.uniqueId }), this.props = {
1186
+ ...n,
1187
+ children: i
1188
+ }, this.fn = s;
1196
1189
  }
1197
1190
  /*===============================*\
1198
1191
  || "Public" API ||
@@ -1221,10 +1214,9 @@ const ie = class ie {
1221
1214
  s();
1222
1215
  this.lifecycleListeners.beforeMount.length = 0, this.lifecycleListeners.mount.length = 0, this.lifecycleListeners.beforeUnmount.length = 0, this.lifecycleListeners.unmount.length = 0;
1223
1216
  }
1224
- setChildView(e) {
1225
- this.childMarkup = [];
1217
+ setRouteView(e) {
1226
1218
  const s = new ie(this.elementContext, e, {});
1227
- return this.children.set([s]), s;
1219
+ return this.elementContext.route.set(s), s;
1228
1220
  }
1229
1221
  /*===============================*\
1230
1222
  || Internal ||
@@ -1233,39 +1225,39 @@ const ie = class ie {
1233
1225
  const e = new it(this);
1234
1226
  let s;
1235
1227
  try {
1236
- s = this.fn.call(e, this.props, e), this.childMarkup.length && this.children.set(S(this.elementContext, this.childMarkup));
1228
+ s = this.fn.call(e, this.props, e);
1237
1229
  } catch (n) {
1238
1230
  throw n instanceof Error && this.logger.crash(n), n;
1239
1231
  }
1240
1232
  if (s !== null) if (s instanceof Node)
1241
- this.element = q(S(this.elementContext, N("$node", { value: s })));
1233
+ this.element = q(C(this.elementContext, x("$node", { value: s })));
1242
1234
  else if (y(s))
1243
1235
  this.element = q(
1244
- S(this.elementContext, N("$dynamic", { source: s }))
1236
+ C(this.elementContext, x("$dynamic", { source: s }))
1245
1237
  );
1246
- else if (R(s) || X(R, s))
1247
- this.element = q(S(this.elementContext, s));
1238
+ else if (z(s) || J(z, s))
1239
+ this.element = q(C(this.elementContext, s));
1248
1240
  else {
1249
1241
  const n = new TypeError(
1250
- `Expected '${this.fn.name}' function to return a DOM node, Markup element, Readable or null. Got: ${A(s)}`
1242
+ `Expected '${this.fn.name}' function to return a DOM node, Markup element, Readable or null. Got: ${D(s)}`
1251
1243
  );
1252
1244
  this.logger.crash(n);
1253
1245
  }
1254
1246
  }
1255
1247
  };
1256
- let z = ie;
1248
+ let R = ie;
1257
1249
  var pe;
1258
- pe = k;
1250
+ pe = E;
1259
1251
  class rt {
1260
1252
  constructor({ elementContext: e, items: s, renderFn: n, keyFn: i }) {
1261
- l(this, pe, !0);
1262
- l(this, "domNode", document.createTextNode(""));
1263
- l(this, "items");
1264
- l(this, "unsubscribe", null);
1265
- l(this, "connectedItems", []);
1266
- l(this, "elementContext");
1267
- l(this, "renderFn");
1268
- l(this, "keyFn");
1253
+ c(this, pe, !0);
1254
+ c(this, "domNode", document.createTextNode(""));
1255
+ c(this, "items");
1256
+ c(this, "unsubscribe", null);
1257
+ c(this, "connectedItems", []);
1258
+ c(this, "elementContext");
1259
+ c(this, "renderFn");
1260
+ c(this, "keyFn");
1269
1261
  this.elementContext = e, this.items = s, this.renderFn = n, this.keyFn = i;
1270
1262
  }
1271
1263
  get isMounted() {
@@ -1274,7 +1266,7 @@ class rt {
1274
1266
  mount(e, s) {
1275
1267
  this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = v(() => {
1276
1268
  let n = this.items.get();
1277
- n == null && (n = [], console.log("list received empty value", n, this)), se(() => {
1269
+ n == null && (n = [], console.log("list received empty value", n, this)), G(() => {
1278
1270
  this._update(Array.from(n));
1279
1271
  });
1280
1272
  }));
@@ -1289,7 +1281,7 @@ class rt {
1289
1281
  this.connectedItems = [];
1290
1282
  }
1291
1283
  _update(e) {
1292
- var f, a, m;
1284
+ var f, p, m;
1293
1285
  if (e.length === 0 || !this.isMounted)
1294
1286
  return this._cleanup(!1);
1295
1287
  const s = [];
@@ -1302,31 +1294,31 @@ class rt {
1302
1294
  });
1303
1295
  const i = [];
1304
1296
  for (const r of this.connectedItems)
1305
- s.find((c) => c.key === r.key) || r.element.unmount(!1);
1297
+ s.find((l) => l.key === r.key) || r.element.unmount(!1);
1306
1298
  for (const r of s) {
1307
- const u = this.connectedItems.find((c) => c.key === r.key);
1299
+ const u = this.connectedItems.find((l) => l.key === r.key);
1308
1300
  if (u)
1309
1301
  u.item.set(r.value), u.index.set(r.index), i[r.index] = u;
1310
1302
  else {
1311
- const c = K(r.value), h = K(r.index);
1303
+ const l = X(r.value), d = X(r.index);
1312
1304
  i[r.index] = {
1313
1305
  key: r.key,
1314
- item: c,
1315
- index: h,
1316
- element: new z(this.elementContext, ot, {
1317
- item: te(() => c.get()),
1318
- index: h,
1306
+ item: l,
1307
+ index: d,
1308
+ element: new R(this.elementContext, ot, {
1309
+ item: se(() => l.get()),
1310
+ index: d,
1319
1311
  renderFn: this.renderFn
1320
1312
  })
1321
1313
  };
1322
1314
  }
1323
1315
  }
1324
1316
  for (let r = 0; r < i.length; r++) {
1325
- const u = i[r], c = ((f = i[r - 1]) == null ? void 0 : f.element.domNode) ?? this.domNode;
1326
- u.element.mount(this.domNode.parentNode, c);
1317
+ const u = i[r], l = ((f = i[r - 1]) == null ? void 0 : f.element.domNode) ?? this.domNode;
1318
+ u.element.mount(this.domNode.parentNode, l);
1327
1319
  }
1328
1320
  this.connectedItems = i;
1329
- const o = ((a = i.at(-1)) == null ? void 0 : a.element.domNode) ?? this.domNode;
1321
+ const o = ((p = i.at(-1)) == null ? void 0 : p.element.domNode) ?? this.domNode;
1330
1322
  (m = this.domNode.parentNode) == null || m.insertBefore(this.domNode, o.nextSibling);
1331
1323
  }
1332
1324
  }
@@ -1334,21 +1326,21 @@ function ot(t, e) {
1334
1326
  return e.name = "@ListItem", t.renderFn.call(e, t.item, t.index, e);
1335
1327
  }
1336
1328
  var me;
1337
- me = k;
1338
- class Ce {
1329
+ me = E;
1330
+ class Ae {
1339
1331
  constructor(e) {
1340
- l(this, me, !0);
1341
- l(this, "domNode", document.createTextNode(""));
1342
- l(this, "isMounted", !1);
1343
- l(this, "source");
1344
- l(this, "elements", []);
1345
- l(this, "unsubscribe");
1332
+ c(this, me, !0);
1333
+ c(this, "domNode", document.createTextNode(""));
1334
+ c(this, "isMounted", !1);
1335
+ c(this, "source");
1336
+ c(this, "elements", []);
1337
+ c(this, "unsubscribe");
1346
1338
  this.source = e;
1347
1339
  }
1348
1340
  mount(e, s) {
1349
1341
  this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), y(this.source) ? this.unsubscribe = v(() => {
1350
1342
  const n = I(this.source);
1351
- se(() => {
1343
+ G(() => {
1352
1344
  this.update(n);
1353
1345
  });
1354
1346
  }) : this.update(this.elements));
@@ -1373,12 +1365,12 @@ class Ce {
1373
1365
  }
1374
1366
  }
1375
1367
  var ge;
1376
- ge = k;
1368
+ ge = E;
1377
1369
  class ut {
1378
1370
  constructor(e) {
1379
- l(this, ge, !0);
1380
- l(this, "config");
1381
- l(this, "element");
1371
+ c(this, ge, !0);
1372
+ c(this, "config");
1373
+ c(this, "element");
1382
1374
  this.config = e;
1383
1375
  }
1384
1376
  get isMounted() {
@@ -1386,52 +1378,81 @@ class ut {
1386
1378
  }
1387
1379
  mount(e, s) {
1388
1380
  const { content: n, parent: i } = this.config;
1389
- De(n) ? this.element = n : this.element = q(S(this.config.elementContext, ne(n))), this.element.mount(i);
1381
+ De(n) ? this.element = n : this.element = q(C(this.config.elementContext, ne(n))), this.element.mount(i);
1390
1382
  }
1391
1383
  unmount(e = !1) {
1392
1384
  var s;
1393
1385
  (s = this.element) != null && s.isMounted && this.element.unmount(!1);
1394
1386
  }
1395
1387
  }
1396
- function R(t) {
1397
- return t instanceof Ae;
1388
+ var ye;
1389
+ ye = E;
1390
+ class ct {
1391
+ constructor(e) {
1392
+ c(this, ye, !0);
1393
+ c(this, "domNode", document.createTextNode(""));
1394
+ c(this, "isMounted", !1);
1395
+ c(this, "view");
1396
+ c(this, "mountedView");
1397
+ c(this, "unsubscribe");
1398
+ this.view = e;
1399
+ }
1400
+ mount(e, s) {
1401
+ this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = v(() => {
1402
+ const n = this.view.get();
1403
+ G(() => {
1404
+ this.update(n);
1405
+ });
1406
+ }));
1407
+ }
1408
+ unmount(e = !1) {
1409
+ this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.isMounted && (this.cleanup(e), this.isMounted = !1);
1410
+ }
1411
+ cleanup(e) {
1412
+ this.mountedView && this.mountedView.unmount(e), this.mountedView = void 0;
1413
+ }
1414
+ update(e) {
1415
+ this.cleanup(!1), e && (e.mount(this.domNode.parentElement, this.domNode), this.mountedView = e);
1416
+ }
1417
+ }
1418
+ function z(t) {
1419
+ return t instanceof Pe;
1398
1420
  }
1399
1421
  function De(t) {
1400
- return (t == null ? void 0 : t[k]) === !0;
1422
+ return (t == null ? void 0 : t[E]) === !0;
1401
1423
  }
1402
1424
  function ne(t) {
1403
- return _(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => R(e) ? e : e instanceof Node ? N("$node", { value: e }) : y(e) ? N("$dynamic", { source: e }) : N("$text", { value: e }));
1425
+ return _(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => z(e) ? e : e instanceof Node ? x("$node", { value: e }) : y(e) ? x("$dynamic", { source: e }) : x("$text", { value: e }));
1404
1426
  }
1405
- function N(t, e, ...s) {
1406
- return new Ae(t, e, ...s);
1427
+ function x(t, e, ...s) {
1428
+ return new Pe(t, e, ...s);
1407
1429
  }
1408
- class Ae {
1430
+ class Pe {
1409
1431
  constructor(e, s, ...n) {
1410
- l(this, "type");
1411
- l(this, "props");
1412
- l(this, "children");
1413
- this.type = e, this.props = s, this.children = ne(n);
1432
+ c(this, "type");
1433
+ c(this, "props");
1434
+ c(this, "children");
1435
+ this.type = e, this.props = s, this.children = n;
1414
1436
  }
1415
1437
  }
1416
- const Tt = Je.bind(N);
1417
- function Lt(t, e, s) {
1418
- return N("$dynamic", {
1419
- source: te(() => {
1438
+ function Tt(t, e, s) {
1439
+ return x("$dynamic", {
1440
+ source: se(() => {
1420
1441
  const n = I(t);
1421
1442
  return n && e ? e : !n && s ? s : null;
1422
1443
  })
1423
1444
  });
1424
1445
  }
1425
- function Ct(t, e, s) {
1426
- return N("$list", { items: te(() => t), keyFn: e, renderFn: s });
1446
+ function Lt(t, e, s) {
1447
+ return x("$list", { items: se(() => t), keyFn: e, renderFn: s });
1427
1448
  }
1428
- function Dt(t, e) {
1429
- return N("$portal", { parent: t, content: e });
1449
+ function Ct(t, e) {
1450
+ return x("$portal", { parent: t, content: e });
1430
1451
  }
1431
- function S(t, e) {
1452
+ function C(t, e) {
1432
1453
  return (_(e) ? e : [e]).map((n) => {
1433
- if (E(n.type))
1434
- return new z(t, n.type, n.props, n.children);
1454
+ if (S(n.type))
1455
+ return new R(t, n.type, n.props, n.children);
1435
1456
  if (O(n.type))
1436
1457
  switch (n.type) {
1437
1458
  case "$node": {
@@ -1458,9 +1479,13 @@ function S(t, e) {
1458
1479
  elementContext: t
1459
1480
  });
1460
1481
  }
1482
+ case "$fragment": {
1483
+ const i = n.props;
1484
+ return new Ae(i.children);
1485
+ }
1461
1486
  case "$outlet": {
1462
1487
  const i = n.props;
1463
- return new Ce(i.children);
1488
+ return new ct(i.view);
1464
1489
  }
1465
1490
  case "$portal": {
1466
1491
  const i = n.props;
@@ -1485,45 +1510,43 @@ function S(t, e) {
1485
1510
  });
1486
1511
  }
1487
1512
  function q(t) {
1488
- return t.length === 1 ? t[0] : new Ce(t);
1513
+ return t.length === 1 ? t[0] : new Ae(t);
1489
1514
  }
1490
- function Pe(t) {
1491
- return t == null || t === !1 || O(t) || qe(t) || R(t) || y(t) || X(Pe, t);
1515
+ function Oe(t) {
1516
+ return t == null || t === !1 || O(t) || Ue(t) || z(t) || y(t) || J(Oe, t);
1492
1517
  }
1493
1518
  export {
1494
- vt as A,
1495
- bt as B,
1496
- Dt as C,
1497
- Ct as D,
1498
- Et as I,
1499
- kt as P,
1519
+ Nt as A,
1520
+ Lt as B,
1521
+ Ct as C,
1522
+ St as I,
1500
1523
  nt as S,
1501
- z as V,
1502
- ht as a,
1503
- pt as b,
1504
- K as c,
1505
- te as d,
1506
- gt as e,
1524
+ R as V,
1525
+ pt as a,
1526
+ mt as b,
1527
+ X as c,
1528
+ se as d,
1529
+ yt as e,
1507
1530
  O as f,
1508
- J as g,
1509
- H as h,
1510
- E as i,
1531
+ Q as g,
1532
+ K as h,
1533
+ S as i,
1511
1534
  I as j,
1512
- Lt as k,
1513
- Tt as l,
1514
- Mt as m,
1535
+ Tt as k,
1536
+ Mt as l,
1537
+ x as m,
1515
1538
  U as n,
1516
- mt as o,
1517
- N as p,
1518
- q,
1519
- S as r,
1520
- Nt as s,
1521
- A as t,
1522
- wt as u,
1523
- xt as v,
1524
- v as w,
1525
- Ke as x,
1526
- yt as y,
1527
- se as z
1539
+ gt as o,
1540
+ q as p,
1541
+ C as q,
1542
+ bt as r,
1543
+ xt as s,
1544
+ D as t,
1545
+ Et as u,
1546
+ v,
1547
+ wt as w,
1548
+ vt as x,
1549
+ Xe as y,
1550
+ G as z
1528
1551
  };
1529
- //# sourceMappingURL=markup-aCjkIk4X.js.map
1552
+ //# sourceMappingURL=markup-DZcvFR50.js.map