@manyducks.co/dolla 2.0.0-alpha.15 → 2.0.0-alpha.16

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,25 +1,25 @@
1
- var wt = Object.defineProperty;
2
- var Ct = (e, t, n) => t in e ? wt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var u = (e, t, n) => Ct(e, typeof t != "symbol" ? t + "" : t, n);
4
- function it(e) {
1
+ var yt = Object.defineProperty;
2
+ var wt = (e, t, n) => t in e ? yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var u = (e, t, n) => wt(e, typeof t != "symbol" ? t + "" : t, n);
4
+ function ot(e) {
5
5
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
6
6
  }
7
- var P = { exports: {} }, Q;
8
- function vt() {
9
- return Q || (Q = 1, function(e, t) {
7
+ var P = { exports: {} }, J;
8
+ function Ct() {
9
+ return J || (J = 1, function(e, t) {
10
10
  Object.defineProperty(t, "__esModule", { value: !0 });
11
11
  var n = /* @__PURE__ */ function() {
12
12
  function a(h, d) {
13
- var f = [], y = !0, C = !1, S = void 0;
13
+ var f = [], y = !0, w = !1, S = void 0;
14
14
  try {
15
- for (var b, v = h[Symbol.iterator](); !(y = (b = v.next()).done) && (f.push(b.value), !(d && f.length === d)); y = !0) ;
15
+ for (var v, b = h[Symbol.iterator](); !(y = (v = b.next()).done) && (f.push(v.value), !(d && f.length === d)); y = !0) ;
16
16
  } catch (m) {
17
- C = !0, S = m;
17
+ w = !0, S = m;
18
18
  } finally {
19
19
  try {
20
- !y && v.return && v.return();
20
+ !y && b.return && b.return();
21
21
  } finally {
22
- if (C) throw S;
22
+ if (w) throw S;
23
23
  }
24
24
  }
25
25
  return f;
@@ -34,29 +34,29 @@ function vt() {
34
34
  return 16 > d ? h + "0" + d.toString(16) : h + d.toString(16);
35
35
  }, "#");
36
36
  }, r = function(a, h, d) {
37
- var f = 0.5 > d ? d * (1 + h) : d + h - d * h, y = 2 * d - f, C = function(m, E, l) {
37
+ var f = 0.5 > d ? d * (1 + h) : d + h - d * h, y = 2 * d - f, w = function(m, E, l) {
38
38
  var p = Math.round, g = 0 > l ? l + 1 : 1 < l ? l - 1 : l;
39
39
  return g = g < 1 / 6 ? m + 6 * (E - m) * g : g < 1 / 2 ? E : g < 2 / 3 ? m + 6 * (E - m) * (2 / 3 - g) : m, p(255 * g);
40
- }, S = C(y, f, a + 1 / 3), b = C(y, f, a), v = C(y, f, a - 1 / 3);
41
- return [S, b, v];
40
+ }, S = w(y, f, a + 1 / 3), v = w(y, f, a), b = w(y, f, a - 1 / 3);
41
+ return [S, v, b];
42
42
  }, o = function(a, h, d, f) {
43
- var y = a % 1007 / 1007, C = function(m, E, l) {
43
+ var y = a % 1007 / 1007, w = function(m, E, l) {
44
44
  return m * (l - E) + E;
45
- }, S = C(y, h.min, h.max), b = C(y, d.min, d.max), v = C(y, f.max, f.min);
46
- return [S, b, v];
45
+ }, S = w(y, h.min, h.max), v = w(y, d.min, d.max), b = w(y, f.max, f.min);
46
+ return [S, v, b];
47
47
  }, i = function(a) {
48
48
  return a.split("").reduce(function(h, d, f) {
49
49
  return h * d.charCodeAt(0) * f + 1;
50
50
  }, 1);
51
51
  }, c = function(a) {
52
- var h = a.str, d = a.hue, f = d === void 0 ? { min: 0, max: 360 } : d, y = a.sat, C = y === void 0 ? { min: 0.35, max: 0.65 } : y, S = a.light, b = S === void 0 ? { min: 0.3, max: 0.7 } : S, v = a.hashFunction, m = v === void 0 ? i : v, E = a.scheme, l = E === void 0 ? "hex" : E, p = o(m(h), f, C, b), g = n(p, 3), N = g[0], Y = g[1], Z = g[2], J = r(N / 360, Y, Z), yt = s(J);
53
- return l === "hsl" ? [N, Y, Z] : l === "rgb" ? J : yt;
52
+ var h = a.str, d = a.hue, f = d === void 0 ? { min: 0, max: 360 } : d, y = a.sat, w = y === void 0 ? { min: 0.35, max: 0.65 } : y, S = a.light, v = S === void 0 ? { min: 0.3, max: 0.7 } : S, b = a.hashFunction, m = b === void 0 ? i : b, E = a.scheme, l = E === void 0 ? "hex" : E, p = o(m(h), f, w, v), g = n(p, 3), N = g[0], z = g[1], Y = g[2], Z = r(N / 360, z, Y), gt = s(Z);
53
+ return l === "hsl" ? [N, z, Y] : l === "rgb" ? Z : gt;
54
54
  };
55
55
  t.default = c, e.exports = t.default;
56
56
  }(P, P.exports)), P.exports;
57
57
  }
58
- var bt = vt();
59
- const St = /* @__PURE__ */ it(bt);
58
+ var bt = Ct();
59
+ const vt = /* @__PURE__ */ ot(bt);
60
60
  function R(e) {
61
61
  if (e === void 0)
62
62
  return "undefined";
@@ -67,9 +67,9 @@ function R(e) {
67
67
  case "number":
68
68
  return isNaN(e) ? "NaN" : "number";
69
69
  case "function":
70
- return ct(e) ? "class" : t;
70
+ return ut(e) ? "class" : t;
71
71
  case "object":
72
- return M(e) ? "array" : kt(e) ? "promise" : t;
72
+ return M(e) ? "array" : Et(e) ? "promise" : t;
73
73
  default:
74
74
  return t;
75
75
  }
@@ -77,11 +77,11 @@ function R(e) {
77
77
  function M(e) {
78
78
  return Array.isArray(e);
79
79
  }
80
- function ut(...e) {
80
+ function it(...e) {
81
81
  const t = e[0], n = (s) => M(s) && s.every((r) => t(r));
82
82
  return e.length < 2 ? n : n(e[1]);
83
83
  }
84
- function Zt(...e) {
84
+ function Yt(...e) {
85
85
  const t = e[0], n = A(e[2]) ? e[2] : "Expected an array of valid items. Got type: %t, value: %v", s = (r) => {
86
86
  if (M(r) && r.every((o) => t(o)))
87
87
  return !0;
@@ -92,26 +92,26 @@ function Zt(...e) {
92
92
  function A(e) {
93
93
  return typeof e == "string";
94
94
  }
95
- function Jt(e, t) {
95
+ function Zt(e, t) {
96
96
  if (A(e))
97
97
  return !0;
98
98
  throw new TypeError(G(e, t ?? "Expected a string. Got type: %t, value: %v"));
99
99
  }
100
100
  function $(e) {
101
- return typeof e == "function" && !ct(e);
101
+ return typeof e == "function" && !ut(e);
102
102
  }
103
- function Et(e) {
103
+ function St(e) {
104
104
  return typeof e == "number" && !isNaN(e);
105
105
  }
106
- function kt(e) {
106
+ function Et(e) {
107
107
  if (e == null) return !1;
108
108
  const t = e;
109
109
  return t instanceof Promise || $(t.then) && $(t.catch) && $(t.finally);
110
110
  }
111
- function ct(e) {
111
+ function ut(e) {
112
112
  return typeof e == "function" && /^\s*class\s+/.test(e.toString());
113
113
  }
114
- function Qt(...e) {
114
+ function Jt(...e) {
115
115
  const t = e[0], n = A(e[2]) ? e[2] : `Expected instance of ${t.name}. Got type: %t, value: %v`, s = (r) => {
116
116
  if (r instanceof t)
117
117
  return !0;
@@ -127,9 +127,9 @@ function G(e, t) {
127
127
  const n = R(e), s = ((r = e == null ? void 0 : e.toString) == null ? void 0 : r.call(e)) || String(e);
128
128
  return t.replaceAll("%t", n).replaceAll("%v", s);
129
129
  }
130
- var I, X;
131
- function xt() {
132
- return X || (X = 1, I = function e(t, n) {
130
+ var I, Q;
131
+ function kt() {
132
+ return Q || (Q = 1, I = function e(t, n) {
133
133
  if (t === n) return !0;
134
134
  if (t && n && typeof t == "object" && typeof n == "object") {
135
135
  if (t.constructor !== n.constructor) return !1;
@@ -140,26 +140,6 @@ function xt() {
140
140
  if (!e(t[r], n[r])) return !1;
141
141
  return !0;
142
142
  }
143
- if (t instanceof Map && n instanceof Map) {
144
- if (t.size !== n.size) return !1;
145
- for (r of t.entries())
146
- if (!n.has(r[0])) return !1;
147
- for (r of t.entries())
148
- if (!e(r[1], n.get(r[0]))) return !1;
149
- return !0;
150
- }
151
- if (t instanceof Set && n instanceof Set) {
152
- if (t.size !== n.size) return !1;
153
- for (r of t.entries())
154
- if (!n.has(r[0])) return !1;
155
- return !0;
156
- }
157
- if (ArrayBuffer.isView(t) && ArrayBuffer.isView(n)) {
158
- if (s = t.length, s != n.length) return !1;
159
- for (r = s; r-- !== 0; )
160
- if (t[r] !== n[r]) return !1;
161
- return !0;
162
- }
163
143
  if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
164
144
  if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
165
145
  if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
@@ -175,13 +155,10 @@ function xt() {
175
155
  return t !== t && n !== n;
176
156
  }), I;
177
157
  }
178
- var Nt = xt();
179
- const $t = /* @__PURE__ */ it(Nt), _t = () => {
158
+ var xt = kt();
159
+ const Qt = /* @__PURE__ */ ot(xt), Nt = () => {
180
160
  };
181
- function Xt(e, t) {
182
- return e === t ? !0 : w(e) || w(t) ? !1 : $t(e, t);
183
- }
184
- function At(e, t) {
161
+ function $t(e, t) {
185
162
  const n = (s) => {
186
163
  const r = {};
187
164
  for (const o in s)
@@ -190,20 +167,20 @@ function At(e, t) {
190
167
  };
191
168
  return t == null ? n : n(t);
192
169
  }
193
- function te() {
170
+ function Xt() {
194
171
  if (typeof window < "u" && window.console)
195
172
  return window.console;
196
173
  if (typeof global < "u" && global.console)
197
174
  return global.console;
198
175
  }
199
- function Vt(e) {
200
- return St({
176
+ function _t(e) {
177
+ return vt({
201
178
  str: e,
202
179
  sat: { min: 0.35, max: 0.55 },
203
180
  light: { min: 0.6, max: 0.6 }
204
181
  });
205
182
  }
206
- function ee(e) {
183
+ function te(e) {
207
184
  if (e instanceof RegExp)
208
185
  return (s) => e.test(s);
209
186
  const t = {
@@ -240,7 +217,7 @@ const q = {
240
217
  console.log(
241
218
  `%c[DOLLA_DEV_DEBUG] %c${this._label}%c%c%c`,
242
219
  "color:#e44c4c;font-weight:bold",
243
- `color:${Vt(this._label)};font-weight:bold`,
220
+ `color:${_t(this._label)};font-weight:bold`,
244
221
  "color:#777",
245
222
  "color:#aaa",
246
223
  "color:#777",
@@ -248,26 +225,26 @@ const q = {
248
225
  ), this._timeout = null;
249
226
  }, 200));
250
227
  }
251
- }, U = Symbol("State"), D = Symbol("SettableState"), at = Symbol("Ref");
252
- function w(e) {
228
+ }, U = Symbol("State"), B = Symbol("SettableState"), ct = Symbol("Ref");
229
+ function C(e) {
253
230
  return (e == null ? void 0 : e[U]) === !0;
254
231
  }
255
- function K(e) {
256
- return (e == null ? void 0 : e[D]) === !0;
232
+ function D(e) {
233
+ return (e == null ? void 0 : e[B]) === !0;
257
234
  }
258
- function lt(e) {
259
- return (e == null ? void 0 : e[at]) === !0;
235
+ function at(e) {
236
+ return (e == null ? void 0 : e[ct]) === !0;
260
237
  }
261
- function B(e) {
262
- return w(e) ? e.get() : e;
238
+ function At(e) {
239
+ return C(e) ? e.get() : e;
263
240
  }
264
241
  function j(e) {
265
- return K(e) ? new W(e) : w(e) ? e : new W({
242
+ return D(e) ? new F(e) : C(e) ? e : new F({
266
243
  get() {
267
244
  return e;
268
245
  },
269
246
  watch(t, n = {}) {
270
- return n != null && n.lazy || t(e), _t;
247
+ return n != null && n.lazy || t(e), Nt;
271
248
  }
272
249
  });
273
250
  }
@@ -285,29 +262,29 @@ class T {
285
262
  return this.value;
286
263
  }
287
264
  set(t) {
288
- if (typeof t == "function" && (t = t(this.value)), !this.equals(this.value, t)) {
265
+ if (typeof t == "function" && (t = t(this.value)), !this.equals(t, this.value)) {
289
266
  this.value = t;
290
267
  try {
291
268
  for (const n of this.watchers)
292
269
  n(t);
293
270
  } catch (n) {
294
- throw console.error("Error in watcher"), n;
271
+ throw console.error("Error in watcher", n), n;
295
272
  }
296
273
  }
297
274
  }
298
275
  watch(t, n) {
299
- return this.watchers.indexOf(t) === -1 && this.watchers.push(t), n != null && n.lazy || t(this.value), q.increment(), () => {
276
+ return this.watchers.push(t), n != null && n.lazy || t(this.value), q.increment(), () => {
300
277
  const s = this.watchers.indexOf(t);
301
278
  s > -1 && this.watchers.splice(s, 1), q.decrement();
302
279
  };
303
280
  }
304
281
  }
305
- var nt;
306
- nt = U;
307
- class W {
282
+ var et;
283
+ et = U;
284
+ class F {
308
285
  constructor(t) {
309
286
  // Instances will pass isState() with this symbol
310
- u(this, nt, !0);
287
+ u(this, et, !0);
311
288
  u(this, "__value");
312
289
  if (t == null)
313
290
  throw new TypeError("Value is null");
@@ -320,17 +297,17 @@ class W {
320
297
  return this.__value.watch(t, n);
321
298
  }
322
299
  }
323
- function F(e, t) {
300
+ function W(e, t) {
324
301
  const n = new T(e, t);
325
- return [new W(n), (r) => n.set(r)];
302
+ return [new F(n), (r) => n.set(r)];
326
303
  }
327
- var st, rt;
328
- rt = U, st = D;
329
- class Mt {
304
+ var nt, st;
305
+ st = U, nt = B;
306
+ class Vt {
330
307
  constructor(t) {
331
308
  // Instances will pass isState() and isSettableState() with these symbols
332
- u(this, rt, !0);
333
309
  u(this, st, !0);
310
+ u(this, nt, !0);
334
311
  u(this, "__value");
335
312
  if (t == null)
336
313
  throw new TypeError("Value is null");
@@ -346,27 +323,27 @@ class Mt {
346
323
  return this.__value.watch(t, n);
347
324
  }
348
325
  }
349
- function ne(e, t) {
350
- return new Mt(new T(e, t));
326
+ function ee(e, t) {
327
+ return new Vt(new T(e, t));
351
328
  }
352
- function se(e, t) {
329
+ function ne(e, t) {
353
330
  return {
354
331
  [U]: !0,
355
- [D]: !0,
332
+ [B]: !0,
356
333
  get: e.get.bind(e),
357
334
  watch: e.watch.bind(e),
358
335
  set: t
359
336
  };
360
337
  }
361
- function re(e, t) {
338
+ function se(e, t) {
362
339
  return function(s) {
363
340
  const r = e.get();
364
341
  let o;
365
342
  typeof s == "function" ? o = s(r) : o = s, t(o, r);
366
343
  };
367
344
  }
368
- const tt = Symbol("EMPTY");
369
- class Tt {
345
+ const X = Symbol("EMPTY");
346
+ class Mt {
370
347
  constructor(t, n, s) {
371
348
  u(this, "equals", T.defaultEquals);
372
349
  /**
@@ -380,7 +357,7 @@ class Tt {
380
357
  /**
381
358
  *
382
359
  */
383
- u(this, "sourceWatcher", H());
360
+ u(this, "sourceWatcher", K());
384
361
  /**
385
362
  * Array of functions awaiting notification when this holder's value changes.
386
363
  */
@@ -396,7 +373,7 @@ class Tt {
396
373
  /**
397
374
  * The current value as returned from `fn` (may be a State)
398
375
  */
399
- u(this, "value", tt);
376
+ u(this, "value", X);
400
377
  /**
401
378
  * The current unwrapped value.
402
379
  */
@@ -405,7 +382,7 @@ class Tt {
405
382
  * When value is a State, this function will stop watching its value.
406
383
  */
407
384
  u(this, "stopWatchingCurrentValue");
408
- this.sources = t.map(j), this.fn = n, s != null && s.equals && (this.equals = s.equals), this.previousSourceValues = new Array(t.length).fill(tt, 0, t.length);
385
+ this.sources = t.map(j), this.fn = n, s != null && s.equals && (this.equals = s.equals), this.previousSourceValues = new Array(t.length).fill(X, 0, t.length);
409
386
  }
410
387
  /*==========================*\
411
388
  || "Public" methods ||
@@ -416,7 +393,7 @@ class Tt {
416
393
  watch(t, n) {
417
394
  this.isWatchingSources || this.startWatchingSources();
418
395
  const s = this.watchers;
419
- return s.push(t), n != null && n.lazy || t(this.getValue()), q.increment(), () => {
396
+ return s.push(t), n != null && n.lazy || t(this.rawValue), q.increment(), () => {
420
397
  s.splice(s.indexOf(t), 1), this.isWatchingSources && s.length === 0 && this.stopWatchingSources(), q.decrement();
421
398
  };
422
399
  }
@@ -428,59 +405,47 @@ class Tt {
428
405
  n(t);
429
406
  }
430
407
  update() {
431
- const t = this.sources.map((n) => n.get());
432
- for (let n = 0; n < this.sources.length; n++)
433
- if (!this.equals(t[n], this.previousSourceValues[n])) {
434
- this.setValue(this.fn(...t)), this.previousSourceValues = t;
435
- break;
436
- }
408
+ const t = this.sources, n = this.previousSourceValues;
409
+ let s = !1, r;
410
+ for (let o = 0; o < t.length; o++)
411
+ r = t[o].get(), !s && !this.equals(r, n[o]) && (s = !0), n[o] = r;
412
+ s && this.setValue(this.fn(...n));
437
413
  }
438
414
  getValue() {
439
- return this.isWatchingSources || this.update(), this.rawValue = B(this.value), this.rawValue;
415
+ return this.isWatchingSources || this.update(), this.rawValue;
440
416
  }
441
417
  setValue(t) {
442
- t !== this.value && (this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = t, this.rawValue = B(t), w(t) && this.isWatchingSources && (this.stopWatchingCurrentValue = t.watch((n) => {
443
- const s = B(n);
444
- this.equals(s, this.rawValue) || (this.rawValue = s, this.notify(s));
445
- })));
418
+ this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = t, this.rawValue = At(t), this.isWatchingSources && C(t) ? this.stopWatchingCurrentValue = t.watch((n) => {
419
+ this.rawValue = n, this.notify(n);
420
+ }) : this.notify(this.rawValue);
446
421
  }
447
422
  startWatchingSources() {
448
423
  const t = this.previousSourceValues;
449
- let n = [...t];
450
424
  for (let s = 0; s < this.sources.length; s++)
451
425
  this.sourceWatcher.watch([this.sources[s]], (r) => {
452
- const o = t[s];
453
- if (t[s] = r, this.isWatchingSources && !this.equals(r, o)) {
454
- try {
455
- let i = this.fn(...t);
456
- this.setValue(i);
457
- } catch (i) {
458
- console.warn("error when updating source values", t, this.fn.toString()), console.error(i);
459
- }
460
- this.notify(this.rawValue);
426
+ if (t[s] = r, this.isWatchingSources) {
427
+ const o = this.fn(...t);
428
+ this.equals(o, this.value) || this.setValue(o);
461
429
  }
462
430
  });
463
431
  this.isWatchingSources = !0;
464
- for (let s = 0; s < this.sources.length; s++)
465
- if (!this.equals(t[s], n[s])) {
466
- this.setValue(this.fn(...t)), this.notify(this.rawValue);
467
- break;
468
- }
432
+ const n = this.fn(...t);
433
+ this.equals(n, this.value) || this.setValue(n);
469
434
  }
470
435
  stopWatchingSources() {
471
436
  this.sourceWatcher.stopAll(), this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.isWatchingSources = !1;
472
437
  }
473
438
  }
474
- function Ot(e, t, n) {
475
- const s = new Tt(e, t, n);
476
- return new W(s);
439
+ function Tt(e, t, n) {
440
+ const s = new Mt(e, t, n);
441
+ return new F(s);
477
442
  }
478
- var ot;
479
- ot = at;
480
- class Pt {
443
+ var rt;
444
+ rt = ct;
445
+ class Ot {
481
446
  constructor(t) {
482
447
  // Instances will pass isRef() with this symbol
483
- u(this, ot, !0);
448
+ u(this, rt, !0);
484
449
  u(this, "__value");
485
450
  this.__value = t;
486
451
  }
@@ -497,10 +462,10 @@ class Pt {
497
462
  this.__value.set(t);
498
463
  }
499
464
  }
500
- function oe() {
501
- return new Pt(new T(void 0));
465
+ function re() {
466
+ return new Ot(new T(void 0));
502
467
  }
503
- function H() {
468
+ function K() {
504
469
  const e = [];
505
470
  return {
506
471
  watch(t, n) {
@@ -508,7 +473,7 @@ function H() {
508
473
  throw new TypeError("Expected at least one state to watch.");
509
474
  t = t.map(j);
510
475
  let s;
511
- return t.length > 1 ? s = Ot(t, n).watch(() => null) : s = t[0].watch(n), e.push(s), () => {
476
+ return t.length > 1 ? s = Tt(t, n).watch(() => null) : s = t[0].watch(n), e.push(s), () => {
512
477
  let r = e.indexOf(s);
513
478
  r > -1 && e.splice(r, 1), s();
514
479
  };
@@ -519,7 +484,7 @@ function H() {
519
484
  }
520
485
  };
521
486
  }
522
- function qt(e) {
487
+ function Pt(e) {
523
488
  for (var t, n, s = arguments, r = 1, o = "", i = "", c = [0], a = function(f) {
524
489
  r === 1 && (f || (o = o.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? c.push(f ? s[f] : o) : r === 3 && (f || o) ? (c[1] = f ? s[f] : o, r = 2) : r === 2 && o === "..." && f ? c[2] = Object.assign(c[2] || {}, s[f]) : r === 2 && o && !f ? (c[2] = c[2] || {})[o] = !0 : r >= 5 && (r === 5 ? ((c[2] = c[2] || {})[n] = f ? o ? o + s[f] : s[f] : o, r = 6) : (f || o) && (c[2][n] += f ? o + s[f] : o)), o = "";
525
490
  }, h = 0; h < e.length; h++) {
@@ -529,7 +494,7 @@ function qt(e) {
529
494
  }
530
495
  return a(), c.length > 2 ? c.slice(1) : c[1];
531
496
  }
532
- class Wt {
497
+ class qt {
533
498
  constructor(t) {
534
499
  u(this, "node");
535
500
  u(this, "endNode");
@@ -573,32 +538,32 @@ class Wt {
573
538
  }
574
539
  }
575
540
  const Ft = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
576
- let ht = (e = 21) => {
541
+ let lt = (e = 21) => {
577
542
  let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
578
543
  for (; e--; )
579
544
  t += Ft[n[e] & 63];
580
545
  return t;
581
546
  };
582
- const Lt = (e) => /^on[A-Z]/.test(e);
583
- class Ut {
547
+ const Wt = (e) => /^on[A-Z]/.test(e);
548
+ class Lt {
584
549
  constructor({ tag: t, props: n, children: s, elementContext: r }) {
585
550
  u(this, "node");
586
551
  u(this, "props");
587
552
  u(this, "children");
588
553
  u(this, "stopCallbacks", []);
589
554
  u(this, "elementContext");
590
- u(this, "uniqueId", ht());
555
+ u(this, "uniqueId", lt());
591
556
  // Track the ref so we can nullify it on unmount.
592
557
  u(this, "ref");
593
558
  // Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
594
559
  u(this, "canClickAway", !1);
595
560
  if (r = { ...r }, t.toLowerCase() === "svg" && (r.isSVG = !0), r.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", t) : this.node = document.createElement(t), r.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), n.ref)
596
- if (lt(n.ref))
561
+ if (at(n.ref))
597
562
  this.ref = n.ref;
598
563
  else
599
564
  throw new Error("Expected ref to be a Ref object. Got: " + n.ref);
600
565
  this.props = {
601
- ...At(["ref", "class", "className"], n),
566
+ ...$t(["ref", "class", "className"], n),
602
567
  class: n.className ?? n.class
603
568
  }, this.children = s ? x(r, s) : [], this.elementContext = r;
604
569
  }
@@ -632,7 +597,7 @@ class Ut {
632
597
  return `${this.uniqueId}:${t}:${n}`;
633
598
  }
634
599
  attachProp(t, n, s) {
635
- w(t) ? this.stopCallbacks.push(
600
+ C(t) ? this.stopCallbacks.push(
636
601
  t.watch((r) => {
637
602
  this.elementContext.root.render.update(() => {
638
603
  n(r);
@@ -658,20 +623,20 @@ class Ut {
658
623
  } else if (s === "eventListeners") {
659
624
  const o = r;
660
625
  for (const i in o) {
661
- const c = w(r) ? (a) => r.get()(a) : r;
626
+ const c = C(r) ? (a) => r.get()(a) : r;
662
627
  t.addEventListener(i, c), this.stopCallbacks.push(() => {
663
628
  t.removeEventListener(i, c);
664
629
  });
665
630
  }
666
631
  } else if (s === "onClickOutside" || s === "onclickoutside") {
667
632
  const o = (c) => {
668
- this.canClickAway && !t.contains(c.target) && (w(r) ? r.get()(c) : r(c));
633
+ this.canClickAway && !t.contains(c.target) && (C(r) ? r.get()(c) : r(c));
669
634
  }, i = { capture: !0 };
670
635
  window.addEventListener("click", o, i), this.stopCallbacks.push(() => {
671
636
  window.removeEventListener("click", o, i);
672
637
  });
673
638
  } else if (s === "$$value") {
674
- if (!K(r))
639
+ if (!D(r))
675
640
  throw new TypeError(`$$value attribute must be a settable state. Got: ${r}`);
676
641
  this.attachProp(
677
642
  r,
@@ -681,14 +646,14 @@ class Ut {
681
646
  this.getUpdateKey("attr", "value")
682
647
  );
683
648
  const o = (i) => {
684
- const c = jt(r.get(), i.currentTarget.value);
649
+ const c = Ut(r.get(), i.currentTarget.value);
685
650
  r.set(c);
686
651
  };
687
652
  t.addEventListener("input", o), this.stopCallbacks.push(() => {
688
653
  t.removeEventListener("input", o);
689
654
  });
690
- } else if (Lt(s)) {
691
- const o = s.slice(2).toLowerCase(), i = w(r) ? (c) => r.get()(c) : r;
655
+ } else if (Wt(s)) {
656
+ const o = s.slice(2).toLowerCase(), i = C(r) ? (c) => r.get()(c) : r;
692
657
  t.addEventListener(o, i), this.stopCallbacks.push(() => {
693
658
  t.removeEventListener(o, i);
694
659
  });
@@ -700,7 +665,7 @@ class Ut {
700
665
  },
701
666
  this.getUpdateKey("attr", s)
702
667
  );
703
- else if (!It.includes(s))
668
+ else if (!jt.includes(s))
704
669
  if (this.elementContext.isSVG)
705
670
  this.attachProp(
706
671
  r,
@@ -780,7 +745,7 @@ class Ut {
780
745
  }
781
746
  applyStyles(t, n, s) {
782
747
  const r = [];
783
- if (w(n)) {
748
+ if (C(n)) {
784
749
  let o;
785
750
  const i = n.watch((c) => {
786
751
  this.elementContext.root.render.update(
@@ -792,10 +757,10 @@ class Ut {
792
757
  });
793
758
  s.push(i), r.push(i);
794
759
  } else {
795
- const o = ft(n);
760
+ const o = dt(n);
796
761
  for (const i in o) {
797
762
  const { value: c, priority: a } = o[i];
798
- if (w(c)) {
763
+ if (C(c)) {
799
764
  const h = c.watch((d) => {
800
765
  this.elementContext.root.render.update(() => {
801
766
  d ? t.style.setProperty(i, String(d), a) : t.style.removeProperty(i);
@@ -812,7 +777,7 @@ class Ut {
812
777
  }
813
778
  applyClasses(t, n, s) {
814
779
  const r = [];
815
- if (w(n)) {
780
+ if (C(n)) {
816
781
  let o;
817
782
  const i = n.watch((c) => {
818
783
  this.elementContext.root.render.update(
@@ -824,10 +789,10 @@ class Ut {
824
789
  });
825
790
  s.push(i), r.push(i);
826
791
  } else {
827
- const o = dt(n);
792
+ const o = ht(n);
828
793
  for (const i in o) {
829
794
  const c = o[i];
830
- if (w(c)) {
795
+ if (C(c)) {
831
796
  const a = c.watch((h) => {
832
797
  this.elementContext.root.render.update(() => {
833
798
  h ? t.classList.add(i) : t.classList.remove(i);
@@ -843,18 +808,18 @@ class Ut {
843
808
  };
844
809
  }
845
810
  }
846
- function dt(e) {
811
+ function ht(e) {
847
812
  let t = {};
848
813
  if (A(e)) {
849
814
  const n = e.split(" ");
850
815
  for (const s of n)
851
816
  t[s] = !0;
852
817
  } else L(e) ? Object.assign(t, e) : Array.isArray(e) && Array.from(e).filter(Boolean).forEach((n) => {
853
- Object.assign(t, dt(n));
818
+ Object.assign(t, ht(n));
854
819
  });
855
820
  return delete t.undefined, t;
856
821
  }
857
- function ft(e) {
822
+ function dt(e) {
858
823
  let t = {};
859
824
  if (A(e)) {
860
825
  const n = e.split(";").filter((s) => s.trim() !== "");
@@ -862,26 +827,26 @@ function ft(e) {
862
827
  const [r, o] = s.split(":"), i = {
863
828
  value: o
864
829
  };
865
- o.includes("!important") ? (i.priority = "important", i.value = o.replace("!important", "").trim()) : i.value = o.trim(), t[et(r.trim())] = i;
830
+ o.includes("!important") ? (i.priority = "important", i.value = o.replace("!important", "").trim()) : i.value = o.trim(), t[tt(r.trim())] = i;
866
831
  }
867
832
  }
868
833
  if (L(e))
869
834
  for (const n in e)
870
- n.startsWith("--") ? t[n] = { value: e[n] } : t[et(n)] = { value: e[n] };
835
+ n.startsWith("--") ? t[n] = { value: e[n] } : t[tt(n)] = { value: e[n] };
871
836
  else Array.isArray(e) && Array.from(e).filter((n) => n != null).forEach((n) => {
872
- Object.assign(t, ft(n));
837
+ Object.assign(t, dt(n));
873
838
  });
874
839
  return t;
875
840
  }
876
- function et(e) {
841
+ function tt(e) {
877
842
  return e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, n) => (n ? "-" : "") + t.toLowerCase());
878
843
  }
879
- function jt(e, t) {
844
+ function Ut(e, t) {
880
845
  const n = typeof e;
881
846
  return n === "string" ? String(t) : n === "number" ? Number(t) : n === "boolean" ? !!t : t;
882
847
  }
883
- const It = ["ref", "children", "class", "style", "data"];
884
- class Bt {
848
+ const jt = ["ref", "children", "class", "style", "data"];
849
+ class It {
885
850
  constructor({ states: t, renderFn: n, elementContext: s }) {
886
851
  u(this, "node");
887
852
  u(this, "endNode");
@@ -889,14 +854,14 @@ class Bt {
889
854
  u(this, "renderFn");
890
855
  u(this, "elementContext");
891
856
  u(this, "observerControls");
892
- u(this, "watcher", H());
857
+ u(this, "watcher", K());
893
858
  this.elementContext = s, this.renderFn = n, this.node = document.createComment("Observer"), this.endNode = document.createComment("/Observer");
894
859
  let r;
895
860
  this.observerControls = {
896
861
  start: () => {
897
862
  r == null && (r = this.watcher.watch(t, (...o) => {
898
863
  const i = this.renderFn(...o);
899
- if (!gt(i))
864
+ if (!mt(i))
900
865
  throw console.error(i), new TypeError(
901
866
  `Observer received invalid value to render. Got type: ${R(i)}, value: ${i}`
902
867
  );
@@ -927,7 +892,7 @@ class Bt {
927
892
  var s, r;
928
893
  if (this.cleanup(), t == null || !this.isMounted)
929
894
  return;
930
- const n = t.map((o) => pt(o) ? o : V(o) ? _(x(this.elementContext, o)) : _(x(this.elementContext, O(o))));
895
+ const n = t.map((o) => ft(o) ? o : V(o) ? _(x(this.elementContext, o)) : _(x(this.elementContext, O(o))));
931
896
  for (const o of n) {
932
897
  const i = ((s = this.connectedViews.at(-1)) == null ? void 0 : s.node) || this.node;
933
898
  o.mount(this.node.parentNode, i), this.connectedViews.push(o);
@@ -990,18 +955,18 @@ class Gt {
990
955
  }
991
956
  mount(t, n) {
992
957
  const { content: s, parent: r } = this.config;
993
- pt(s) ? this.element = s : V(s) ? this.element = _(x(this.config.elementContext, s)) : this.element = _(x(this.config.elementContext, O(s))), this.element.mount(r);
958
+ ft(s) ? this.element = s : V(s) ? this.element = _(x(this.config.elementContext, s)) : this.element = _(x(this.config.elementContext, O(s))), this.element.mount(r);
994
959
  }
995
960
  unmount() {
996
961
  var t;
997
962
  (t = this.element) != null && t.isMounted && this.element.unmount();
998
963
  }
999
964
  }
1000
- function z(e, t, n, s = []) {
965
+ function H(e, t, n, s = []) {
1001
966
  e = { ...e, data: {}, parent: e };
1002
- const [r, o] = F(x(e, s));
967
+ const [r, o] = W(x(e, s));
1003
968
  let i = !1;
1004
- const c = H(), a = [], h = [], d = [], f = [], y = ht(), [C, S] = F(t.name), b = e.root.createLogger(C, { uid: y }), v = {
969
+ const c = K(), a = [], h = [], d = [], f = [], y = lt(), [w, S] = W(t.name), v = e.root.createLogger(w, { uid: y }), b = {
1005
970
  get uid() {
1006
971
  return y;
1007
972
  },
@@ -1061,22 +1026,22 @@ function z(e, t, n, s = []) {
1061
1026
  return k("$outlet", { $children: r });
1062
1027
  }
1063
1028
  };
1064
- Object.assign(v, b);
1029
+ Object.assign(b, v);
1065
1030
  let m;
1066
1031
  function E() {
1067
1032
  let l;
1068
1033
  try {
1069
- l = t(n, v);
1034
+ l = t(n, b);
1070
1035
  } catch (p) {
1071
- throw p instanceof Error && b.crash(p), p;
1036
+ throw p instanceof Error && v.crash(p), p;
1072
1037
  }
1073
1038
  if (l instanceof Promise)
1074
1039
  throw new TypeError("View function cannot return a Promise.");
1075
1040
  if (l !== null) if (l instanceof Node)
1076
1041
  m = _(x(e, k("$node", { value: l })));
1077
- else if (V(l) || ut(V, l))
1042
+ else if (V(l) || it(V, l))
1078
1043
  m = _(x(e, l));
1079
- else if (w(l))
1044
+ else if (C(l))
1080
1045
  m = _(
1081
1046
  x(e, k("$observer", { states: [l], renderFn: (p) => p }))
1082
1047
  );
@@ -1084,7 +1049,7 @@ function z(e, t, n, s = []) {
1084
1049
  const p = new TypeError(
1085
1050
  `Expected '${t.name}' function to return a DOM node, Markup element, Readable or null. Got: ${R(l)}`
1086
1051
  );
1087
- b.crash(p);
1052
+ v.crash(p);
1088
1053
  }
1089
1054
  }
1090
1055
  return {
@@ -1112,12 +1077,12 @@ function z(e, t, n, s = []) {
1112
1077
  c.stopAll();
1113
1078
  },
1114
1079
  setChildView(l) {
1115
- const p = z(e, l, {});
1080
+ const p = H(e, l, {});
1116
1081
  return o([p]), p;
1117
1082
  }
1118
1083
  };
1119
1084
  }
1120
- class Dt {
1085
+ class Bt {
1121
1086
  constructor({ elementContext: t, $items: n, renderFn: s, keyFn: r }) {
1122
1087
  u(this, "node");
1123
1088
  u(this, "endNode");
@@ -1166,14 +1131,14 @@ class Dt {
1166
1131
  if (h)
1167
1132
  h.setValue(a.value), h.setIndex(a.index), r[a.index] = h;
1168
1133
  else {
1169
- const [d, f] = F(a.value), [y, C] = F(a.index);
1134
+ const [d, f] = W(a.value), [y, w] = W(a.index);
1170
1135
  r[a.index] = {
1171
1136
  key: a.key,
1172
1137
  $value: d,
1173
1138
  setValue: f,
1174
1139
  $index: y,
1175
- setIndex: C,
1176
- element: z(this.elementContext, Kt, {
1140
+ setIndex: w,
1141
+ element: H(this.elementContext, Dt, {
1177
1142
  $value: d,
1178
1143
  $index: y,
1179
1144
  renderFn: this.renderFn
@@ -1192,10 +1157,10 @@ class Dt {
1192
1157
  }
1193
1158
  }
1194
1159
  }
1195
- function Kt({ $value: e, $index: t, renderFn: n }, s) {
1160
+ function Dt({ $value: e, $index: t, renderFn: n }, s) {
1196
1161
  return n(e, t, s);
1197
1162
  }
1198
- class Ht {
1163
+ class Kt {
1199
1164
  constructor({ value: t }) {
1200
1165
  u(this, "node", document.createTextNode(""));
1201
1166
  u(this, "value", "");
@@ -1206,7 +1171,7 @@ class Ht {
1206
1171
  return this.node.parentNode != null;
1207
1172
  }
1208
1173
  async mount(t, n = null) {
1209
- this.isMounted || (w(this.value) ? this.stopCallback = this.value.watch((s) => {
1174
+ this.isMounted || (C(this.value) ? this.stopCallback = this.value.watch((s) => {
1210
1175
  this.update(s);
1211
1176
  }) : this.update(this.value)), t.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null);
1212
1177
  }
@@ -1220,20 +1185,20 @@ class Ht {
1220
1185
  function V(e) {
1221
1186
  return L(e) && (typeof e.type == "string" || typeof e.type == "function") && Array.isArray(e.children);
1222
1187
  }
1223
- function pt(e) {
1188
+ function ft(e) {
1224
1189
  return L(e) && $(e.connect) && $(e.disconnect);
1225
1190
  }
1226
1191
  function O(e) {
1227
1192
  return M(e) || (e = [e]), e.flat(1 / 0).filter((t) => t != null && t !== !1).map((t) => {
1228
1193
  if (t instanceof Node)
1229
1194
  return k("$node", { value: t });
1230
- if (t instanceof mt)
1195
+ if (t instanceof pt)
1231
1196
  return k("$node", { value: t.node });
1232
1197
  if (V(t))
1233
1198
  return t;
1234
- if (A(t) || Et(t))
1199
+ if (A(t) || St(t))
1235
1200
  return k("$text", { value: t });
1236
- if (w(t))
1201
+ if (C(t))
1237
1202
  return k("$observer", {
1238
1203
  states: [t],
1239
1204
  renderFn: (n) => n
@@ -1242,24 +1207,24 @@ function O(e) {
1242
1207
  });
1243
1208
  }
1244
1209
  function k(e, t, ...n) {
1245
- return t != null && zt(t), {
1210
+ return t != null && Ht(t), {
1246
1211
  type: e,
1247
1212
  props: t,
1248
1213
  children: O(n)
1249
1214
  };
1250
1215
  }
1251
- function zt(e) {
1252
- if (e.ref && !lt(e.ref))
1216
+ function Ht(e) {
1217
+ if (e.ref && !at(e.ref))
1253
1218
  throw console.warn(e.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${e.ref}`);
1254
1219
  for (const t in e)
1255
1220
  if (t.startsWith("$$") && e[t] !== void 0) {
1256
- if (!K(e[t]))
1221
+ if (!D(e[t]))
1257
1222
  throw new TypeError(`Prop '${t}' is named as a SettableState but value is not. Got: ${e[t]}`);
1258
- } else if (t.startsWith("$") && e[t] !== void 0 && !w(e[t]))
1223
+ } else if (t.startsWith("$") && e[t] !== void 0 && !C(e[t]))
1259
1224
  throw new TypeError(`Prop '${t}' is named as a State but value is not. Got: ${e[t]}`);
1260
1225
  }
1261
- const ie = qt.bind(k);
1262
- function ue(e, t, n) {
1226
+ const oe = Pt.bind(k);
1227
+ function ie(e, t, n) {
1263
1228
  const s = j(e);
1264
1229
  return k("$cond", {
1265
1230
  $predicate: s,
@@ -1267,14 +1232,14 @@ function ue(e, t, n) {
1267
1232
  elseContent: n
1268
1233
  });
1269
1234
  }
1270
- function ce(e, t, n) {
1235
+ function ue(e, t, n) {
1271
1236
  const s = j(e);
1272
1237
  return k("$repeat", { $items: s, keyFn: t, renderFn: n });
1273
1238
  }
1274
- function ae(e, t) {
1239
+ function ce(e, t) {
1275
1240
  return k("$portal", { parent: e, content: t });
1276
1241
  }
1277
- class mt {
1242
+ class pt {
1278
1243
  constructor(t) {
1279
1244
  u(this, "node");
1280
1245
  this.node = t;
@@ -1292,22 +1257,22 @@ class mt {
1292
1257
  function x(e, t) {
1293
1258
  return (M(t) ? t : [t]).map((s) => {
1294
1259
  if ($(s.type))
1295
- return z(e, s.type, s.props, s.children);
1260
+ return H(e, s.type, s.props, s.children);
1296
1261
  if (A(s.type))
1297
1262
  switch (s.type) {
1298
1263
  case "$node": {
1299
1264
  const r = s.props;
1300
- return new mt(r.value);
1265
+ return new pt(r.value);
1301
1266
  }
1302
1267
  case "$text": {
1303
1268
  const r = s.props;
1304
- return new Ht({
1269
+ return new Kt({
1305
1270
  value: r.value
1306
1271
  });
1307
1272
  }
1308
1273
  case "$cond": {
1309
1274
  const r = s.props;
1310
- return new Wt({
1275
+ return new qt({
1311
1276
  $predicate: r.$predicate,
1312
1277
  thenContent: r.thenContent,
1313
1278
  elseContent: r.elseContent,
@@ -1316,7 +1281,7 @@ function x(e, t) {
1316
1281
  }
1317
1282
  case "$repeat": {
1318
1283
  const r = s.props;
1319
- return new Dt({
1284
+ return new Bt({
1320
1285
  $items: r.$items,
1321
1286
  keyFn: r.keyFn,
1322
1287
  renderFn: r.renderFn,
@@ -1325,7 +1290,7 @@ function x(e, t) {
1325
1290
  }
1326
1291
  case "$observer": {
1327
1292
  const r = s.props;
1328
- return new Bt({
1293
+ return new It({
1329
1294
  states: r.states,
1330
1295
  renderFn: r.renderFn,
1331
1296
  elementContext: e
@@ -1349,7 +1314,7 @@ function x(e, t) {
1349
1314
  default:
1350
1315
  if (s.type.startsWith("$"))
1351
1316
  throw new Error(`Unknown markup type: ${s.type}`);
1352
- return new Ut({
1317
+ return new Lt({
1353
1318
  tag: s.type,
1354
1319
  props: s.props ?? {},
1355
1320
  children: s.children,
@@ -1391,43 +1356,43 @@ function _(e) {
1391
1356
  }
1392
1357
  };
1393
1358
  }
1394
- function gt(e) {
1395
- return e == null || e === !1 || typeof e == "string" || typeof e == "number" || V(e) || w(e) || ut(gt, e);
1359
+ function mt(e) {
1360
+ return e == null || e === !1 || typeof e == "string" || typeof e == "number" || V(e) || C(e) || it(mt, e);
1396
1361
  }
1397
- function le(e, t) {
1362
+ function ae(e, t) {
1398
1363
  return t.outlet();
1399
1364
  }
1400
1365
  export {
1401
1366
  x as A,
1402
- re as B,
1403
- ae as C,
1404
- ce as D,
1405
- le as P,
1406
- F as a,
1407
- Xt as b,
1408
- ue as c,
1409
- Ot as d,
1367
+ se as B,
1368
+ ce as C,
1369
+ ue as D,
1370
+ ae as P,
1371
+ W as a,
1372
+ Qt as b,
1373
+ ie as c,
1374
+ Tt as d,
1410
1375
  $ as e,
1411
1376
  A as f,
1412
- Jt as g,
1413
- ie as h,
1377
+ Zt as g,
1378
+ oe as h,
1414
1379
  L as i,
1415
- Zt as j,
1416
- H as k,
1417
- ee as l,
1418
- ne as m,
1419
- se as n,
1380
+ Yt as j,
1381
+ K as k,
1382
+ te as l,
1383
+ ee as m,
1384
+ ne as n,
1420
1385
  j as o,
1421
- oe as p,
1422
- lt as q,
1423
- Qt as r,
1386
+ re as p,
1387
+ at as q,
1388
+ Jt as r,
1424
1389
  k as s,
1425
1390
  R as t,
1426
- te as u,
1427
- B as v,
1428
- _t as w,
1429
- Vt as x,
1430
- z as y,
1391
+ Xt as u,
1392
+ At as v,
1393
+ Nt as w,
1394
+ _t as x,
1395
+ H as y,
1431
1396
  _ as z
1432
1397
  };
1433
- //# sourceMappingURL=passthrough-CBbog_A9.js.map
1398
+ //# sourceMappingURL=passthrough-DUh0_zQF.js.map