@manyducks.co/dolla 2.0.0-alpha.6 → 2.0.0-alpha.8
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.
- package/README.md +8 -7
- package/dist/index.js +139 -135
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/markup.d.ts +8 -0
- package/dist/nodes/html.d.ts +1 -1
- package/dist/{passthrough-CW8Ezjg-.js → passthrough-9kwwjgWk.js} +322 -287
- package/dist/passthrough-9kwwjgWk.js.map +1 -0
- package/dist/view.d.ts +16 -1
- package/notes/context-vars.md +21 -0
- package/notes/route-middleware.md +42 -0
- package/notes/scratch.md +37 -0
- package/package.json +1 -1
- package/dist/passthrough-CW8Ezjg-.js.map +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var f = (t, e, n) =>
|
|
4
|
-
function
|
|
1
|
+
var se = Object.defineProperty;
|
|
2
|
+
var ue = (t, e, n) => e in t ? se(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var f = (t, e, n) => ue(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
function ce(t) {
|
|
5
5
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
6
6
|
}
|
|
7
|
-
var U = { exports: {} },
|
|
7
|
+
var U = { exports: {} }, z;
|
|
8
8
|
function ae() {
|
|
9
|
-
return
|
|
9
|
+
return z || (z = 1, function(t, e) {
|
|
10
10
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
11
11
|
var n = /* @__PURE__ */ function() {
|
|
12
|
-
function u(
|
|
12
|
+
function u(l, d) {
|
|
13
13
|
var h = [], b = !0, C = !1, v = void 0;
|
|
14
14
|
try {
|
|
15
|
-
for (var $, k =
|
|
16
|
-
} catch (
|
|
17
|
-
C = !0, v =
|
|
15
|
+
for (var $, k = l[Symbol.iterator](); !(b = ($ = k.next()).done) && (h.push($.value), !(d && h.length === d)); b = !0) ;
|
|
16
|
+
} catch (g) {
|
|
17
|
+
C = !0, v = g;
|
|
18
18
|
} finally {
|
|
19
19
|
try {
|
|
20
20
|
!b && k.return && k.return();
|
|
@@ -24,39 +24,39 @@ function ae() {
|
|
|
24
24
|
}
|
|
25
25
|
return h;
|
|
26
26
|
}
|
|
27
|
-
return function(
|
|
28
|
-
if (Array.isArray(
|
|
29
|
-
if (Symbol.iterator in Object(
|
|
27
|
+
return function(l, d) {
|
|
28
|
+
if (Array.isArray(l)) return l;
|
|
29
|
+
if (Symbol.iterator in Object(l)) return u(l, d);
|
|
30
30
|
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
31
31
|
};
|
|
32
32
|
}(), o = function(u) {
|
|
33
|
-
return u.reduce(function(
|
|
34
|
-
return 16 > d ?
|
|
33
|
+
return u.reduce(function(l, d) {
|
|
34
|
+
return 16 > d ? l + "0" + d.toString(16) : l + d.toString(16);
|
|
35
35
|
}, "#");
|
|
36
|
-
}, r = function(u,
|
|
37
|
-
var h = 0.5 > d ? d * (1 +
|
|
38
|
-
var
|
|
39
|
-
return
|
|
36
|
+
}, r = function(u, l, d) {
|
|
37
|
+
var h = 0.5 > d ? d * (1 + l) : d + l - d * l, b = 2 * d - h, C = function(g, m, a) {
|
|
38
|
+
var p = Math.round, y = 0 > a ? a + 1 : 1 < a ? a - 1 : a;
|
|
39
|
+
return y = y < 1 / 6 ? g + 6 * (m - g) * y : y < 1 / 2 ? m : y < 2 / 3 ? g + 6 * (m - g) * (2 / 3 - y) : g, p(255 * y);
|
|
40
40
|
}, v = C(b, h, u + 1 / 3), $ = C(b, h, u), k = C(b, h, u - 1 / 3);
|
|
41
41
|
return [v, $, k];
|
|
42
|
-
}, i = function(u,
|
|
43
|
-
var b = u % 1007 / 1007, C = function(
|
|
44
|
-
return
|
|
45
|
-
}, v = C(b,
|
|
42
|
+
}, i = function(u, l, d, h) {
|
|
43
|
+
var b = u % 1007 / 1007, C = function(g, m, a) {
|
|
44
|
+
return g * (a - m) + m;
|
|
45
|
+
}, v = C(b, l.min, l.max), $ = C(b, d.min, d.max), k = C(b, h.max, h.min);
|
|
46
46
|
return [v, $, k];
|
|
47
47
|
}, s = function(u) {
|
|
48
|
-
return u.split("").reduce(function(
|
|
49
|
-
return
|
|
48
|
+
return u.split("").reduce(function(l, d, h) {
|
|
49
|
+
return l * d.charCodeAt(0) * h + 1;
|
|
50
50
|
}, 1);
|
|
51
51
|
}, c = function(u) {
|
|
52
|
-
var
|
|
53
|
-
return
|
|
52
|
+
var l = u.str, d = u.hue, h = d === void 0 ? { min: 0, max: 360 } : d, b = u.sat, C = b === void 0 ? { min: 0.35, max: 0.65 } : b, v = u.light, $ = v === void 0 ? { min: 0.3, max: 0.7 } : v, k = u.hashFunction, g = k === void 0 ? s : k, m = u.scheme, a = m === void 0 ? "hex" : m, p = i(g(l), h, C, $), y = n(p, 3), N = y[0], E = y[1], W = y[2], H = r(N / 360, E, W), ie = o(H);
|
|
53
|
+
return a === "hsl" ? [N, E, W] : a === "rgb" ? H : ie;
|
|
54
54
|
};
|
|
55
55
|
e.default = c, t.exports = e.default;
|
|
56
56
|
}(U, U.exports)), U.exports;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
const
|
|
58
|
+
var le = ae();
|
|
59
|
+
const de = /* @__PURE__ */ ce(le);
|
|
60
60
|
function _(t) {
|
|
61
61
|
if (t === void 0)
|
|
62
62
|
return "undefined";
|
|
@@ -67,9 +67,9 @@ function _(t) {
|
|
|
67
67
|
case "number":
|
|
68
68
|
return isNaN(t) ? "NaN" : "number";
|
|
69
69
|
case "function":
|
|
70
|
-
return
|
|
70
|
+
return J(t) ? "class" : e;
|
|
71
71
|
case "object":
|
|
72
|
-
return P(t) ? "array" :
|
|
72
|
+
return P(t) ? "array" : he(t) ? "promise" : e;
|
|
73
73
|
default:
|
|
74
74
|
return e;
|
|
75
75
|
}
|
|
@@ -77,59 +77,59 @@ function _(t) {
|
|
|
77
77
|
function P(t) {
|
|
78
78
|
return Array.isArray(t);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function Y(...t) {
|
|
81
81
|
const e = t[0], n = (o) => P(o) && o.every((r) => e(r));
|
|
82
82
|
return t.length < 2 ? n : n(t[1]);
|
|
83
83
|
}
|
|
84
84
|
function Fe(...t) {
|
|
85
|
-
const e = t[0], n =
|
|
85
|
+
const e = t[0], n = O(t[2]) ? t[2] : "Expected an array of valid items. Got type: %t, value: %v", o = (r) => {
|
|
86
86
|
if (P(r) && r.every((i) => e(i)))
|
|
87
87
|
return !0;
|
|
88
|
-
throw new TypeError(
|
|
88
|
+
throw new TypeError(B(r, n));
|
|
89
89
|
};
|
|
90
90
|
return t.length < 2 ? o : o(t[1]);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function O(t) {
|
|
93
93
|
return typeof t == "string";
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
if (
|
|
95
|
+
function Pe(t, e) {
|
|
96
|
+
if (O(t))
|
|
97
97
|
return !0;
|
|
98
|
-
throw new TypeError(
|
|
98
|
+
throw new TypeError(B(t, e ?? "Expected a string. Got type: %t, value: %v"));
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return typeof t == "function" && !
|
|
100
|
+
function A(t) {
|
|
101
|
+
return typeof t == "function" && !J(t);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function fe(t) {
|
|
104
104
|
return typeof t == "number" && !isNaN(t);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function he(t) {
|
|
107
107
|
if (t == null) return !1;
|
|
108
108
|
const e = t;
|
|
109
|
-
return e instanceof Promise ||
|
|
109
|
+
return e instanceof Promise || A(e.then) && A(e.catch) && A(e.finally);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function J(t) {
|
|
112
112
|
return typeof t == "function" && /^\s*class\s+/.test(t.toString());
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
const e = t[0], n =
|
|
114
|
+
function je(...t) {
|
|
115
|
+
const e = t[0], n = O(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, o = (r) => {
|
|
116
116
|
if (r instanceof e)
|
|
117
117
|
return !0;
|
|
118
|
-
throw new TypeError(
|
|
118
|
+
throw new TypeError(B(r, n));
|
|
119
119
|
};
|
|
120
120
|
return t.length < 2 ? o : o(t[1]);
|
|
121
121
|
}
|
|
122
122
|
function L(t) {
|
|
123
123
|
return t != null && typeof t == "object" && !P(t);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function B(t, e) {
|
|
126
126
|
var r;
|
|
127
127
|
const n = _(t), o = ((r = t == null ? void 0 : t.toString) == null ? void 0 : r.call(t)) || String(t);
|
|
128
128
|
return e.replaceAll("%t", n).replaceAll("%v", o);
|
|
129
129
|
}
|
|
130
|
-
const
|
|
130
|
+
const pe = () => {
|
|
131
131
|
};
|
|
132
|
-
function
|
|
132
|
+
function D(t) {
|
|
133
133
|
return t != null && typeof t == "object" && !Array.isArray(t) && Object.getPrototypeOf(t) === Object.getPrototypeOf({});
|
|
134
134
|
}
|
|
135
135
|
function I(t, e) {
|
|
@@ -137,7 +137,7 @@ function I(t, e) {
|
|
|
137
137
|
return !0;
|
|
138
138
|
if (w(t) || w(e))
|
|
139
139
|
return !1;
|
|
140
|
-
if (
|
|
140
|
+
if (D(t) && D(e)) {
|
|
141
141
|
const n = Object.keys(t), o = Object.keys(e);
|
|
142
142
|
if (n.length !== o.length)
|
|
143
143
|
return !1;
|
|
@@ -156,7 +156,7 @@ function I(t, e) {
|
|
|
156
156
|
}
|
|
157
157
|
return t === e;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function me(t, e) {
|
|
160
160
|
const n = (o) => {
|
|
161
161
|
const r = {};
|
|
162
162
|
for (const i in o)
|
|
@@ -165,20 +165,20 @@ function ye(t, e) {
|
|
|
165
165
|
};
|
|
166
166
|
return e == null ? n : n(e);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Ue() {
|
|
169
169
|
if (typeof window < "u" && window.console)
|
|
170
170
|
return window.console;
|
|
171
171
|
if (typeof global < "u" && global.console)
|
|
172
172
|
return global.console;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
return
|
|
174
|
+
function Ie(t) {
|
|
175
|
+
return de({
|
|
176
176
|
str: t,
|
|
177
177
|
sat: { min: 0.35, max: 0.55 },
|
|
178
178
|
light: { min: 0.6, max: 0.6 }
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Le(t) {
|
|
182
182
|
if (t instanceof RegExp)
|
|
183
183
|
return (o) => t.test(o);
|
|
184
184
|
const e = {
|
|
@@ -203,14 +203,14 @@ function qe(t) {
|
|
|
203
203
|
function w(t) {
|
|
204
204
|
return !(t == null || typeof t != "object" || typeof t.get != "function" || typeof t.watch != "function");
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function R(t) {
|
|
207
207
|
return !(t == null || typeof t != "object" || typeof t.set != "function" || typeof t.get != "function" || typeof t.watch != "function");
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function T(t) {
|
|
210
210
|
return w(t) ? t.get() : t;
|
|
211
211
|
}
|
|
212
212
|
function q(t) {
|
|
213
|
-
return
|
|
213
|
+
return R(t) ? {
|
|
214
214
|
get: t.get,
|
|
215
215
|
watch: t.watch
|
|
216
216
|
} : w(t) ? t : {
|
|
@@ -218,137 +218,147 @@ function q(t) {
|
|
|
218
218
|
return t;
|
|
219
219
|
},
|
|
220
220
|
watch(e, n = {}) {
|
|
221
|
-
return n != null && n.lazy || e(t),
|
|
221
|
+
return n != null && n.lazy || e(t), pe;
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
const [n, o] =
|
|
225
|
+
function qe(t, e) {
|
|
226
|
+
const [n, o] = V(t, e);
|
|
227
227
|
return {
|
|
228
228
|
get: n.get,
|
|
229
229
|
watch: n.watch,
|
|
230
230
|
set: o
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Ge(t, e) {
|
|
234
234
|
return {
|
|
235
235
|
get: t.get,
|
|
236
236
|
watch: t.watch,
|
|
237
237
|
set: e
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function _e(t, e) {
|
|
241
241
|
return function(o) {
|
|
242
242
|
const r = t.get();
|
|
243
243
|
let i;
|
|
244
244
|
typeof o == "function" ? i = o(r) : i = o, e(i, r);
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function V(t, e) {
|
|
248
248
|
let n = t, o = [];
|
|
249
249
|
function r() {
|
|
250
250
|
for (const u of o)
|
|
251
|
-
|
|
251
|
+
try {
|
|
252
|
+
u(n);
|
|
253
|
+
} catch (l) {
|
|
254
|
+
console.warn("error in state watcher", u), console.error(l);
|
|
255
|
+
}
|
|
252
256
|
}
|
|
253
|
-
function i(u,
|
|
254
|
-
return e != null && e.equality ? e.equality(u,
|
|
257
|
+
function i(u, l) {
|
|
258
|
+
return e != null && e.equality ? e.equality(u, l) : I(u, l);
|
|
255
259
|
}
|
|
256
260
|
const s = {
|
|
257
261
|
get() {
|
|
258
|
-
return
|
|
262
|
+
return T(n);
|
|
259
263
|
},
|
|
260
|
-
watch(u,
|
|
261
|
-
return o.push(u),
|
|
264
|
+
watch(u, l) {
|
|
265
|
+
return o.push(u), l != null && l.lazy || u(s.get()), function() {
|
|
262
266
|
o.splice(o.indexOf(u), 1);
|
|
263
267
|
};
|
|
264
268
|
}
|
|
265
269
|
};
|
|
266
270
|
function c(u) {
|
|
267
|
-
let
|
|
268
|
-
typeof u == "function" ?
|
|
271
|
+
let l;
|
|
272
|
+
typeof u == "function" ? l = u(n) : l = u, i(l, n) || (n = l, r());
|
|
269
273
|
}
|
|
270
274
|
return [s, c];
|
|
271
275
|
}
|
|
272
|
-
const
|
|
273
|
-
function
|
|
276
|
+
const ye = Symbol("EMPTY");
|
|
277
|
+
function ge(t, e, n) {
|
|
274
278
|
t = t.map(q);
|
|
275
|
-
let o = new Array(t.length).fill(
|
|
276
|
-
function d(
|
|
277
|
-
for (const
|
|
278
|
-
|
|
279
|
+
let o = new Array(t.length).fill(ye, 0, t.length), r, i = [], s = !1, c = [], u, l;
|
|
280
|
+
function d(m = C()) {
|
|
281
|
+
for (const a of i)
|
|
282
|
+
a(m);
|
|
279
283
|
}
|
|
280
|
-
function h(
|
|
281
|
-
return n != null && n.equality ? n.equality(
|
|
284
|
+
function h(m, a) {
|
|
285
|
+
return n != null && n.equality ? n.equality(m, a) : I(m, a);
|
|
282
286
|
}
|
|
283
287
|
function b() {
|
|
284
|
-
const
|
|
285
|
-
for (let
|
|
286
|
-
if (!h(
|
|
287
|
-
v(e(...
|
|
288
|
+
const m = t.map((a) => a.get());
|
|
289
|
+
for (let a = 0; a < t.length; a++)
|
|
290
|
+
if (!h(m[a], o[a])) {
|
|
291
|
+
v(e(...m)), o = m;
|
|
288
292
|
break;
|
|
289
293
|
}
|
|
290
294
|
}
|
|
291
295
|
function C() {
|
|
292
|
-
return s || b(),
|
|
296
|
+
return s || b(), l = T(r), l;
|
|
293
297
|
}
|
|
294
|
-
function v(
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
h(
|
|
298
|
+
function v(m) {
|
|
299
|
+
m !== r && (u && (u(), u = void 0), r = m, l = T(m), w(m) && s && (u = m.watch((a) => {
|
|
300
|
+
const p = T(a);
|
|
301
|
+
h(p, l) || (l = p, d(p));
|
|
298
302
|
})));
|
|
299
303
|
}
|
|
300
304
|
function $() {
|
|
301
|
-
let
|
|
302
|
-
for (let
|
|
303
|
-
const
|
|
305
|
+
let m = [...o];
|
|
306
|
+
for (let a = 0; a < t.length; a++) {
|
|
307
|
+
const p = t[a];
|
|
304
308
|
c.push(
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
o[
|
|
309
|
+
p.watch((y) => {
|
|
310
|
+
const N = o[a];
|
|
311
|
+
if (o[a] = y, s && !h(y, N)) {
|
|
312
|
+
try {
|
|
313
|
+
let E = e(...o);
|
|
314
|
+
v(E);
|
|
315
|
+
} catch (E) {
|
|
316
|
+
console.warn("error when updating source values", o, e.toString()), console.error(E);
|
|
317
|
+
}
|
|
318
|
+
d(T(r));
|
|
319
|
+
}
|
|
308
320
|
})
|
|
309
321
|
);
|
|
310
322
|
}
|
|
311
323
|
s = !0;
|
|
312
|
-
for (let
|
|
313
|
-
if (!h(o[
|
|
314
|
-
v(e(...o)), d(
|
|
324
|
+
for (let a = 0; a < t.length; a++)
|
|
325
|
+
if (!h(o[a], m[a])) {
|
|
326
|
+
v(e(...o)), d(T(r));
|
|
315
327
|
break;
|
|
316
328
|
}
|
|
317
329
|
}
|
|
318
330
|
function k() {
|
|
319
|
-
for (const
|
|
320
|
-
|
|
331
|
+
for (const m of c)
|
|
332
|
+
m();
|
|
321
333
|
c = [], u && (u(), u = void 0), s = !1;
|
|
322
334
|
}
|
|
323
335
|
return {
|
|
324
336
|
get() {
|
|
325
337
|
return C();
|
|
326
338
|
},
|
|
327
|
-
watch(
|
|
328
|
-
return s || $(), i.push(
|
|
329
|
-
i.splice(i.indexOf(
|
|
339
|
+
watch(m, a) {
|
|
340
|
+
return s || $(), i.push(m), a != null && a.lazy || m(C()), function() {
|
|
341
|
+
i.splice(i.indexOf(m), 1), s && i.length === 0 && k();
|
|
330
342
|
};
|
|
331
343
|
}
|
|
332
344
|
};
|
|
333
345
|
}
|
|
334
346
|
function G(t, e) {
|
|
335
347
|
if (t.length === 0)
|
|
336
|
-
throw new TypeError("Expected at least one state.");
|
|
337
|
-
|
|
338
|
-
throw new TypeError("All values must be states");
|
|
339
|
-
return t = t.map(q), t.length > 1 ? be(t, e).watch(() => null) : t[0].watch(e);
|
|
348
|
+
throw new TypeError("Expected at least one state to watch.");
|
|
349
|
+
return t = t.map(q), t.length > 1 ? ge(t, e).watch(() => null) : t[0].watch(e);
|
|
340
350
|
}
|
|
341
|
-
function
|
|
351
|
+
function be(t) {
|
|
342
352
|
for (var e, n, o = arguments, r = 1, i = "", s = "", c = [0], u = function(h) {
|
|
343
353
|
r === 1 && (h || (i = i.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? c.push(h ? o[h] : i) : r === 3 && (h || i) ? (c[1] = h ? o[h] : i, r = 2) : r === 2 && i === "..." && h ? c[2] = Object.assign(c[2] || {}, o[h]) : r === 2 && i && !h ? (c[2] = c[2] || {})[i] = !0 : r >= 5 && (r === 5 ? ((c[2] = c[2] || {})[n] = h ? i ? i + o[h] : o[h] : i, r = 6) : (h || i) && (c[2][n] += h ? i + o[h] : i)), i = "";
|
|
344
|
-
},
|
|
345
|
-
|
|
346
|
-
for (var d = 0; d < t[
|
|
354
|
+
}, l = 0; l < t.length; l++) {
|
|
355
|
+
l && (r === 1 && u(), u(l));
|
|
356
|
+
for (var d = 0; d < t[l].length; d++) e = t[l][d], r === 1 ? e === "<" ? (u(), c = [c, "", null], r = 3) : i += e : r === 4 ? i === "--" && e === ">" ? (r = 1, i = "") : i = e + i[0] : s ? e === s ? s = "" : i += e : e === '"' || e === "'" ? s = e : e === ">" ? (u(), r = 1) : r && (e === "=" ? (r = 5, n = i, i = "") : e === "/" && (r < 5 || t[l][d + 1] === ">") ? (u(), r === 3 && (c = c[0]), r = c, (c = c[0]).push(this.apply(null, r.slice(1))), r = 0) : e === " " || e === " " || e === `
|
|
347
357
|
` || e === "\r" ? (u(), r = 2) : i += e), r === 3 && i === "!--" && (r = 4, c = c[0]);
|
|
348
358
|
}
|
|
349
359
|
return u(), c.length > 2 ? c.slice(1) : c[1];
|
|
350
360
|
}
|
|
351
|
-
class
|
|
361
|
+
class Ce {
|
|
352
362
|
constructor(e) {
|
|
353
363
|
f(this, "node");
|
|
354
364
|
f(this, "endNode");
|
|
@@ -382,7 +392,7 @@ class we {
|
|
|
382
392
|
for (const o of this.connectedContent)
|
|
383
393
|
o.unmount();
|
|
384
394
|
if (this.connectedContent = [], this.node.parentNode != null) {
|
|
385
|
-
e && this.thenContent ? this.connectedContent =
|
|
395
|
+
e && this.thenContent ? this.connectedContent = S(this.elementContext, this.thenContent) : !e && this.elseContent && (this.connectedContent = S(this.elementContext, this.elseContent));
|
|
386
396
|
for (let o = 0; o < this.connectedContent.length; o++) {
|
|
387
397
|
const r = this.connectedContent[o], i = ((n = this.connectedContent[o - 1]) == null ? void 0 : n.node) ?? this.node;
|
|
388
398
|
r.mount(this.node.parentNode, i);
|
|
@@ -391,35 +401,35 @@ class we {
|
|
|
391
401
|
}
|
|
392
402
|
}
|
|
393
403
|
}
|
|
394
|
-
const
|
|
395
|
-
let
|
|
404
|
+
const we = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
405
|
+
let Q = (t = 21) => {
|
|
396
406
|
let e = "", n = crypto.getRandomValues(new Uint8Array(t |= 0));
|
|
397
407
|
for (; t--; )
|
|
398
|
-
e +=
|
|
408
|
+
e += we[n[t] & 63];
|
|
399
409
|
return e;
|
|
400
410
|
};
|
|
401
|
-
const
|
|
402
|
-
class
|
|
411
|
+
const ve = (t) => /^on[A-Z]/.test(t);
|
|
412
|
+
class ke {
|
|
403
413
|
constructor({ tag: e, props: n, children: o, elementContext: r }) {
|
|
404
414
|
f(this, "node");
|
|
405
415
|
f(this, "props");
|
|
406
416
|
f(this, "children");
|
|
407
417
|
f(this, "stopCallbacks", []);
|
|
408
418
|
f(this, "elementContext");
|
|
409
|
-
f(this, "uniqueId",
|
|
419
|
+
f(this, "uniqueId", Q());
|
|
410
420
|
// Track the ref so we can nullify it on unmount.
|
|
411
421
|
f(this, "ref");
|
|
412
422
|
// Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
|
|
413
423
|
f(this, "canClickAway", !1);
|
|
414
424
|
if (r = { ...r }, e.toLowerCase() === "svg" && (r.isSVG = !0), r.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", e) : this.node = document.createElement(e), r.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), n.ref)
|
|
415
|
-
if (
|
|
425
|
+
if (ne(n.ref))
|
|
416
426
|
this.ref = n.ref;
|
|
417
427
|
else
|
|
418
428
|
throw new Error("Expected ref to be a Ref object. Got: " + n.ref);
|
|
419
429
|
this.props = {
|
|
420
|
-
...
|
|
430
|
+
...me(["ref", "class", "className"], n),
|
|
421
431
|
class: n.className ?? n.class
|
|
422
|
-
}, this.children = o ?
|
|
432
|
+
}, this.children = o ? S(r, o) : [], this.elementContext = r;
|
|
423
433
|
}
|
|
424
434
|
get isMounted() {
|
|
425
435
|
return this.node.parentNode != null;
|
|
@@ -477,7 +487,7 @@ class $e {
|
|
|
477
487
|
} else if (r === "eventListeners") {
|
|
478
488
|
const s = i;
|
|
479
489
|
for (const c in s) {
|
|
480
|
-
const u = w(i) ? (
|
|
490
|
+
const u = w(i) ? (l) => i.get()(l) : i;
|
|
481
491
|
e.addEventListener(c, u), this.stopCallbacks.push(() => {
|
|
482
492
|
e.removeEventListener(c, u);
|
|
483
493
|
});
|
|
@@ -490,23 +500,23 @@ class $e {
|
|
|
490
500
|
window.removeEventListener("click", s, c);
|
|
491
501
|
});
|
|
492
502
|
} else if (r === "$$value") {
|
|
493
|
-
if (!
|
|
503
|
+
if (!R(i))
|
|
494
504
|
throw new TypeError(`$$value attribute must be a settable state. Got: ${i}`);
|
|
495
505
|
o(
|
|
496
506
|
i,
|
|
497
507
|
(c) => {
|
|
498
|
-
e.value = String(c);
|
|
508
|
+
c == null ? e.value = "" : e.value = String(c);
|
|
499
509
|
},
|
|
500
510
|
this.getUpdateKey("attr", "value")
|
|
501
511
|
);
|
|
502
512
|
const s = (c) => {
|
|
503
|
-
const u =
|
|
513
|
+
const u = $e(i.get(), c.currentTarget.value);
|
|
504
514
|
i.set(u);
|
|
505
515
|
};
|
|
506
516
|
e.addEventListener("input", s), this.stopCallbacks.push(() => {
|
|
507
517
|
e.removeEventListener("input", s);
|
|
508
518
|
});
|
|
509
|
-
} else if (
|
|
519
|
+
} else if (ve(r)) {
|
|
510
520
|
const s = r.slice(2).toLowerCase(), c = w(i) ? (u) => i.get()(u) : i;
|
|
511
521
|
e.addEventListener(s, c), this.stopCallbacks.push(() => {
|
|
512
522
|
e.removeEventListener(s, c);
|
|
@@ -519,7 +529,7 @@ class $e {
|
|
|
519
529
|
},
|
|
520
530
|
this.getUpdateKey("attr", r)
|
|
521
531
|
);
|
|
522
|
-
else if (!
|
|
532
|
+
else if (!Ne.includes(r))
|
|
523
533
|
if (this.elementContext.isSVG)
|
|
524
534
|
o(
|
|
525
535
|
i,
|
|
@@ -562,6 +572,7 @@ class $e {
|
|
|
562
572
|
case "exportParts":
|
|
563
573
|
case "part":
|
|
564
574
|
case "translate":
|
|
575
|
+
case "type":
|
|
565
576
|
case "title": {
|
|
566
577
|
const s = r.toLowerCase();
|
|
567
578
|
o(
|
|
@@ -603,23 +614,23 @@ class $e {
|
|
|
603
614
|
const s = n.watch((c) => {
|
|
604
615
|
this.elementContext.root.render.update(
|
|
605
616
|
() => {
|
|
606
|
-
|
|
617
|
+
A(i) && i(), e.style.cssText = "", i = this.applyStyles(e, c, o);
|
|
607
618
|
},
|
|
608
619
|
this.getUpdateKey("styles", "*")
|
|
609
620
|
);
|
|
610
621
|
});
|
|
611
622
|
o.push(s), r.push(s);
|
|
612
623
|
} else {
|
|
613
|
-
const i =
|
|
624
|
+
const i = ee(n);
|
|
614
625
|
for (const s in i) {
|
|
615
626
|
const { value: c, priority: u } = i[s];
|
|
616
627
|
if (w(c)) {
|
|
617
|
-
const
|
|
628
|
+
const l = c.watch((d) => {
|
|
618
629
|
this.elementContext.root.render.update(() => {
|
|
619
630
|
d ? e.style.setProperty(s, String(d), u) : e.style.removeProperty(s);
|
|
620
631
|
});
|
|
621
632
|
});
|
|
622
|
-
o.push(
|
|
633
|
+
o.push(l), r.push(l);
|
|
623
634
|
} else c != null && e.style.setProperty(s, String(c));
|
|
624
635
|
}
|
|
625
636
|
}
|
|
@@ -635,20 +646,20 @@ class $e {
|
|
|
635
646
|
const s = n.watch((c) => {
|
|
636
647
|
this.elementContext.root.render.update(
|
|
637
648
|
() => {
|
|
638
|
-
|
|
649
|
+
A(i) && i(), e.removeAttribute("class"), i = this.applyClasses(e, c, o);
|
|
639
650
|
},
|
|
640
651
|
this.getUpdateKey("attr", "class")
|
|
641
652
|
);
|
|
642
653
|
});
|
|
643
654
|
o.push(s), r.push(s);
|
|
644
655
|
} else {
|
|
645
|
-
const i =
|
|
656
|
+
const i = X(n);
|
|
646
657
|
for (const s in i) {
|
|
647
658
|
const c = i[s];
|
|
648
659
|
if (w(c)) {
|
|
649
|
-
const u = c.watch((
|
|
660
|
+
const u = c.watch((l) => {
|
|
650
661
|
this.elementContext.root.render.update(() => {
|
|
651
|
-
|
|
662
|
+
l ? e.classList.add(s) : e.classList.remove(s);
|
|
652
663
|
});
|
|
653
664
|
});
|
|
654
665
|
o.push(u), r.push(u);
|
|
@@ -661,45 +672,45 @@ class $e {
|
|
|
661
672
|
};
|
|
662
673
|
}
|
|
663
674
|
}
|
|
664
|
-
function
|
|
675
|
+
function X(t) {
|
|
665
676
|
let e = {};
|
|
666
|
-
if (
|
|
677
|
+
if (O(t)) {
|
|
667
678
|
const n = t.split(" ");
|
|
668
679
|
for (const o of n)
|
|
669
680
|
e[o] = !0;
|
|
670
|
-
} else L(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(
|
|
671
|
-
Object.assign(e,
|
|
681
|
+
} else L(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((n) => {
|
|
682
|
+
Object.assign(e, X(n));
|
|
672
683
|
});
|
|
673
|
-
return e;
|
|
684
|
+
return delete e.undefined, e;
|
|
674
685
|
}
|
|
675
|
-
function
|
|
686
|
+
function ee(t) {
|
|
676
687
|
let e = {};
|
|
677
|
-
if (
|
|
688
|
+
if (O(t)) {
|
|
678
689
|
const n = t.split(";").filter((o) => o.trim() !== "");
|
|
679
690
|
for (const o of n) {
|
|
680
691
|
const [r, i] = o.split(":"), s = {
|
|
681
692
|
value: i
|
|
682
693
|
};
|
|
683
|
-
i.includes("!important") ? (s.priority = "important", s.value = i.replace("!important", "").trim()) : s.value = i.trim(), e[
|
|
694
|
+
i.includes("!important") ? (s.priority = "important", s.value = i.replace("!important", "").trim()) : s.value = i.trim(), e[Z(r.trim())] = s;
|
|
684
695
|
}
|
|
685
696
|
}
|
|
686
697
|
if (L(t))
|
|
687
698
|
for (const n in t)
|
|
688
|
-
n.startsWith("--") ? e[n] = { value: t[n] } : e[
|
|
699
|
+
n.startsWith("--") ? e[n] = { value: t[n] } : e[Z(n)] = { value: t[n] };
|
|
689
700
|
else Array.isArray(t) && Array.from(t).filter((n) => n != null).forEach((n) => {
|
|
690
|
-
Object.assign(e,
|
|
701
|
+
Object.assign(e, ee(n));
|
|
691
702
|
});
|
|
692
703
|
return e;
|
|
693
704
|
}
|
|
694
|
-
function
|
|
705
|
+
function Z(t) {
|
|
695
706
|
return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, n) => (n ? "-" : "") + e.toLowerCase());
|
|
696
707
|
}
|
|
697
|
-
function
|
|
708
|
+
function $e(t, e) {
|
|
698
709
|
const n = typeof t;
|
|
699
710
|
return n === "string" ? String(e) : n === "number" ? Number(e) : n === "boolean" ? !!e : e;
|
|
700
711
|
}
|
|
701
|
-
const
|
|
702
|
-
class
|
|
712
|
+
const Ne = ["ref", "children", "class", "style", "data"];
|
|
713
|
+
class xe {
|
|
703
714
|
constructor({ states: e, renderFn: n, elementContext: o }) {
|
|
704
715
|
f(this, "node");
|
|
705
716
|
f(this, "endNode");
|
|
@@ -713,7 +724,7 @@ class Se {
|
|
|
713
724
|
start: () => {
|
|
714
725
|
r == null && (r = G(e, (...i) => {
|
|
715
726
|
const s = this.renderFn(...i);
|
|
716
|
-
if (!
|
|
727
|
+
if (!re(s))
|
|
717
728
|
throw console.error(s), new TypeError(
|
|
718
729
|
`Observer received invalid value to render. Got type: ${_(s)}, value: ${s}`
|
|
719
730
|
);
|
|
@@ -744,7 +755,7 @@ class Se {
|
|
|
744
755
|
var o, r;
|
|
745
756
|
if (this.cleanup(), e == null || !this.isMounted)
|
|
746
757
|
return;
|
|
747
|
-
const n = e.map((i) =>
|
|
758
|
+
const n = e.map((i) => te(i) ? i : F(i) ? M(S(this.elementContext, i)) : M(S(this.elementContext, j(i))));
|
|
748
759
|
for (const i of n) {
|
|
749
760
|
const s = ((o = this.connectedViews.at(-1)) == null ? void 0 : o.node) || this.node;
|
|
750
761
|
i.mount(this.node.parentNode, s), this.connectedViews.push(i);
|
|
@@ -755,7 +766,7 @@ class Se {
|
|
|
755
766
|
}
|
|
756
767
|
}
|
|
757
768
|
}
|
|
758
|
-
class
|
|
769
|
+
class Se {
|
|
759
770
|
constructor(e) {
|
|
760
771
|
f(this, "node");
|
|
761
772
|
f(this, "endNode");
|
|
@@ -796,7 +807,7 @@ class Ee {
|
|
|
796
807
|
));
|
|
797
808
|
}
|
|
798
809
|
}
|
|
799
|
-
class
|
|
810
|
+
class Ee {
|
|
800
811
|
constructor(e) {
|
|
801
812
|
f(this, "config");
|
|
802
813
|
f(this, "handle");
|
|
@@ -807,110 +818,136 @@ class Ae {
|
|
|
807
818
|
}
|
|
808
819
|
mount(e, n) {
|
|
809
820
|
const { content: o, parent: r } = this.config;
|
|
810
|
-
|
|
821
|
+
te(o) ? this.handle = o : F(o) ? this.handle = M(S(this.config.elementContext, o)) : this.handle = M(S(this.config.elementContext, j(o))), this.handle.mount(r);
|
|
811
822
|
}
|
|
812
823
|
unmount() {
|
|
813
824
|
var e;
|
|
814
825
|
(e = this.handle) != null && e.isMounted && this.handle.unmount();
|
|
815
826
|
}
|
|
816
827
|
}
|
|
817
|
-
function
|
|
818
|
-
t = { ...t };
|
|
819
|
-
const [r, i] =
|
|
828
|
+
function K(t, e, n, o = []) {
|
|
829
|
+
t = { ...t, data: {}, parent: t };
|
|
830
|
+
const [r, i] = V(S(t, o));
|
|
820
831
|
let s = !1;
|
|
821
|
-
const c = [], u = [],
|
|
832
|
+
const c = [], u = [], l = [], d = [], h = [], b = Q(), [C, v] = V(e.name), $ = t.root.createLogger(C, { uid: b }), k = {
|
|
822
833
|
get uid() {
|
|
823
834
|
return b;
|
|
824
835
|
},
|
|
825
|
-
|
|
826
|
-
|
|
836
|
+
set(a, p) {
|
|
837
|
+
t.data[a] = p;
|
|
827
838
|
},
|
|
828
|
-
|
|
829
|
-
|
|
839
|
+
get(a) {
|
|
840
|
+
let p = t;
|
|
841
|
+
for (; ; ) {
|
|
842
|
+
if (a in p.data)
|
|
843
|
+
return p.data[a];
|
|
844
|
+
if (p.parent)
|
|
845
|
+
p = p.parent;
|
|
846
|
+
else
|
|
847
|
+
break;
|
|
848
|
+
}
|
|
849
|
+
return null;
|
|
830
850
|
},
|
|
831
|
-
|
|
832
|
-
a
|
|
851
|
+
getAll() {
|
|
852
|
+
const a = [];
|
|
853
|
+
let p = t;
|
|
854
|
+
for (; a.push(p.data), p.parent; )
|
|
855
|
+
p = p.parent;
|
|
856
|
+
const y = {};
|
|
857
|
+
for (const N of a.reverse())
|
|
858
|
+
Object.assign(y, N);
|
|
859
|
+
return y;
|
|
833
860
|
},
|
|
834
|
-
|
|
835
|
-
|
|
861
|
+
setName(a) {
|
|
862
|
+
v(a);
|
|
836
863
|
},
|
|
837
|
-
|
|
838
|
-
|
|
864
|
+
beforeMount(a) {
|
|
865
|
+
u.push(a);
|
|
839
866
|
},
|
|
840
|
-
|
|
867
|
+
onMount(a) {
|
|
868
|
+
l.push(a);
|
|
869
|
+
},
|
|
870
|
+
beforeUnmount(a) {
|
|
871
|
+
d.push(a);
|
|
872
|
+
},
|
|
873
|
+
onUnmount(a) {
|
|
874
|
+
h.push(a);
|
|
875
|
+
},
|
|
876
|
+
watch(a, p) {
|
|
841
877
|
if (s) {
|
|
842
|
-
const
|
|
843
|
-
return c.push(
|
|
878
|
+
const y = G(a, p);
|
|
879
|
+
return c.push(y), y;
|
|
844
880
|
} else {
|
|
845
|
-
let
|
|
846
|
-
return
|
|
847
|
-
|
|
848
|
-
}), function
|
|
849
|
-
|
|
881
|
+
let y, N = !1;
|
|
882
|
+
return l.push(() => {
|
|
883
|
+
N || (y = G(a, p), c.push(y));
|
|
884
|
+
}), function E() {
|
|
885
|
+
E != null && (N = !0, E());
|
|
850
886
|
};
|
|
851
887
|
}
|
|
852
888
|
},
|
|
853
889
|
outlet() {
|
|
854
|
-
return
|
|
890
|
+
return x("$outlet", { $children: r });
|
|
855
891
|
}
|
|
856
892
|
};
|
|
857
893
|
Object.assign(k, $);
|
|
858
|
-
let
|
|
859
|
-
function
|
|
860
|
-
let
|
|
894
|
+
let g;
|
|
895
|
+
function m() {
|
|
896
|
+
let a;
|
|
861
897
|
try {
|
|
862
|
-
|
|
863
|
-
} catch (
|
|
864
|
-
throw
|
|
898
|
+
a = e(n, k);
|
|
899
|
+
} catch (p) {
|
|
900
|
+
throw p instanceof Error && $.crash(p), p;
|
|
865
901
|
}
|
|
866
|
-
if (
|
|
902
|
+
if (a instanceof Promise)
|
|
867
903
|
throw new TypeError("View function cannot return a Promise.");
|
|
868
|
-
if (
|
|
869
|
-
|
|
870
|
-
else if (
|
|
871
|
-
|
|
872
|
-
else if (w(
|
|
873
|
-
|
|
874
|
-
|
|
904
|
+
if (a !== null) if (a instanceof Node)
|
|
905
|
+
g = M(S(t, x("$node", { value: a })));
|
|
906
|
+
else if (F(a) || Y(F, a))
|
|
907
|
+
g = M(S(t, a));
|
|
908
|
+
else if (w(a))
|
|
909
|
+
g = M(
|
|
910
|
+
S(t, x("$observer", { states: [a], renderFn: (p) => p }))
|
|
875
911
|
);
|
|
876
912
|
else {
|
|
877
|
-
const
|
|
878
|
-
`Expected '${e.name}' function to return a DOM node, Markup element, Readable or null. Got: ${_(
|
|
913
|
+
const p = new TypeError(
|
|
914
|
+
`Expected '${e.name}' function to return a DOM node, Markup element, Readable or null. Got: ${_(a)}`
|
|
879
915
|
);
|
|
880
|
-
$.crash(
|
|
916
|
+
$.crash(p);
|
|
881
917
|
}
|
|
882
918
|
}
|
|
883
919
|
return {
|
|
884
920
|
get node() {
|
|
885
|
-
return
|
|
921
|
+
return g == null ? void 0 : g.node;
|
|
886
922
|
},
|
|
887
923
|
get isMounted() {
|
|
888
924
|
return s;
|
|
889
925
|
},
|
|
890
|
-
mount(
|
|
891
|
-
const
|
|
892
|
-
if (!
|
|
893
|
-
for (
|
|
926
|
+
mount(a, p) {
|
|
927
|
+
const y = s;
|
|
928
|
+
if (!y)
|
|
929
|
+
for (m(); u.length > 0; )
|
|
894
930
|
u.shift()();
|
|
895
|
-
|
|
896
|
-
for (;
|
|
897
|
-
|
|
931
|
+
g && g.mount(a, p), y || (s = !0, requestAnimationFrame(() => {
|
|
932
|
+
for (; l.length > 0; )
|
|
933
|
+
l.shift()();
|
|
898
934
|
}));
|
|
899
935
|
},
|
|
900
936
|
unmount() {
|
|
901
937
|
for (; d.length > 0; )
|
|
902
938
|
d.shift()();
|
|
903
|
-
for (
|
|
939
|
+
for (g && g.unmount(), s = !1; h.length > 0; )
|
|
904
940
|
h.shift()();
|
|
905
941
|
for (; c.length > 0; )
|
|
906
942
|
c.shift()();
|
|
907
943
|
},
|
|
908
|
-
|
|
909
|
-
|
|
944
|
+
setChildView(a) {
|
|
945
|
+
const p = K(t, a, {});
|
|
946
|
+
return i([p]), p;
|
|
910
947
|
}
|
|
911
948
|
};
|
|
912
949
|
}
|
|
913
|
-
class
|
|
950
|
+
class Ae {
|
|
914
951
|
constructor({ elementContext: e, $items: n, renderFn: o, keyFn: r }) {
|
|
915
952
|
f(this, "node");
|
|
916
953
|
f(this, "endNode");
|
|
@@ -955,18 +992,18 @@ class Me {
|
|
|
955
992
|
for (const u of this.connectedItems)
|
|
956
993
|
n.find((d) => d.key === u.key) || u.handle.unmount();
|
|
957
994
|
for (const u of n) {
|
|
958
|
-
const
|
|
959
|
-
if (
|
|
960
|
-
|
|
995
|
+
const l = this.connectedItems.find((d) => d.key === u.key);
|
|
996
|
+
if (l)
|
|
997
|
+
l.setValue(u.value), l.setIndex(u.index), r[u.index] = l;
|
|
961
998
|
else {
|
|
962
|
-
const [d, h] =
|
|
999
|
+
const [d, h] = V(u.value), [b, C] = V(u.index);
|
|
963
1000
|
r[u.index] = {
|
|
964
1001
|
key: u.key,
|
|
965
1002
|
$value: d,
|
|
966
1003
|
setValue: h,
|
|
967
1004
|
$index: b,
|
|
968
1005
|
setIndex: C,
|
|
969
|
-
handle:
|
|
1006
|
+
handle: K(this.elementContext, Me, {
|
|
970
1007
|
$value: d,
|
|
971
1008
|
$index: b,
|
|
972
1009
|
renderFn: this.renderFn
|
|
@@ -975,8 +1012,8 @@ class Me {
|
|
|
975
1012
|
}
|
|
976
1013
|
}
|
|
977
1014
|
for (let u = 0; u < r.length; u++) {
|
|
978
|
-
const
|
|
979
|
-
|
|
1015
|
+
const l = r[u], d = ((i = r[u - 1]) == null ? void 0 : i.handle.node) ?? this.node;
|
|
1016
|
+
l.handle.mount(this.node.parentNode, d);
|
|
980
1017
|
}
|
|
981
1018
|
if (this.connectedItems = r, this.elementContext.root.getEnv() === "development") {
|
|
982
1019
|
this.node.textContent = `Repeat (${r.length} item${r.length === 1 ? "" : "s"})`;
|
|
@@ -985,10 +1022,10 @@ class Me {
|
|
|
985
1022
|
}
|
|
986
1023
|
}
|
|
987
1024
|
}
|
|
988
|
-
function
|
|
1025
|
+
function Me({ $value: t, $index: e, renderFn: n }, o) {
|
|
989
1026
|
return n(t, e, o);
|
|
990
1027
|
}
|
|
991
|
-
class
|
|
1028
|
+
class Oe {
|
|
992
1029
|
constructor({ value: e }) {
|
|
993
1030
|
f(this, "node", document.createTextNode(""));
|
|
994
1031
|
f(this, "value", "");
|
|
@@ -1010,67 +1047,65 @@ class Te {
|
|
|
1010
1047
|
e != null ? this.node.textContent = e.toString() : this.node.textContent = "";
|
|
1011
1048
|
}
|
|
1012
1049
|
}
|
|
1013
|
-
|
|
1014
|
-
function
|
|
1015
|
-
return L(t) && t[te] === !0;
|
|
1050
|
+
function F(t) {
|
|
1051
|
+
return L(t) && (typeof t.type == "string" || typeof t.type == "function") && Array.isArray(t.children);
|
|
1016
1052
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return L(t) &&
|
|
1053
|
+
function te(t) {
|
|
1054
|
+
return L(t) && A(t.connect) && A(t.disconnect);
|
|
1019
1055
|
}
|
|
1020
1056
|
function j(t) {
|
|
1021
1057
|
return P(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
|
|
1022
1058
|
if (e instanceof Node)
|
|
1023
|
-
return
|
|
1024
|
-
if (e instanceof
|
|
1025
|
-
return
|
|
1026
|
-
if (
|
|
1059
|
+
return x("$node", { value: e });
|
|
1060
|
+
if (e instanceof oe)
|
|
1061
|
+
return x("$node", { value: e.node });
|
|
1062
|
+
if (F(e))
|
|
1027
1063
|
return e;
|
|
1028
|
-
if (
|
|
1029
|
-
return
|
|
1064
|
+
if (O(e) || fe(e))
|
|
1065
|
+
return x("$text", { value: e });
|
|
1030
1066
|
if (w(e))
|
|
1031
|
-
return
|
|
1067
|
+
return x("$observer", {
|
|
1032
1068
|
states: [e],
|
|
1033
1069
|
renderFn: (n) => n
|
|
1034
1070
|
});
|
|
1035
1071
|
throw console.error(e), new TypeError(`Unexpected child type. Got: ${e}`);
|
|
1036
1072
|
});
|
|
1037
1073
|
}
|
|
1038
|
-
function
|
|
1039
|
-
return e != null &&
|
|
1040
|
-
[te]: !0,
|
|
1074
|
+
function x(t, e, ...n) {
|
|
1075
|
+
return e != null && Te(e), {
|
|
1041
1076
|
type: t,
|
|
1042
1077
|
props: e,
|
|
1043
1078
|
children: j(n)
|
|
1044
1079
|
};
|
|
1045
1080
|
}
|
|
1046
|
-
function
|
|
1047
|
-
if (t.ref && !
|
|
1081
|
+
function Te(t) {
|
|
1082
|
+
if (t.ref && !ne(t.ref))
|
|
1048
1083
|
throw console.warn(t.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${t.ref}`);
|
|
1049
1084
|
for (const e in t)
|
|
1050
1085
|
if (e.startsWith("$$") && t[e] !== void 0) {
|
|
1051
|
-
if (!
|
|
1086
|
+
if (!R(t[e]))
|
|
1052
1087
|
throw new TypeError(`Prop '${e}' is named as a SettableState but value is not. Got: ${t[e]}`);
|
|
1053
1088
|
} else if (e.startsWith("$") && t[e] !== void 0 && !w(t[e]))
|
|
1054
1089
|
throw new TypeError(`Prop '${e}' is named as a State but value is not. Got: ${t[e]}`);
|
|
1055
1090
|
}
|
|
1056
|
-
const Be =
|
|
1057
|
-
function
|
|
1091
|
+
const Be = be.bind(x);
|
|
1092
|
+
function Re(t, e, n) {
|
|
1058
1093
|
const o = q(t);
|
|
1059
|
-
return
|
|
1094
|
+
return x("$cond", {
|
|
1060
1095
|
$predicate: o,
|
|
1061
1096
|
thenContent: e,
|
|
1062
1097
|
elseContent: n
|
|
1063
1098
|
});
|
|
1064
1099
|
}
|
|
1065
|
-
function
|
|
1100
|
+
function Ke(t, e, n) {
|
|
1066
1101
|
const o = q(t);
|
|
1067
|
-
return
|
|
1102
|
+
return x("$repeat", { $items: o, keyFn: e, renderFn: n });
|
|
1068
1103
|
}
|
|
1069
|
-
function
|
|
1070
|
-
return
|
|
1104
|
+
function We(t, e) {
|
|
1105
|
+
return x("$portal", { parent: t, content: e });
|
|
1071
1106
|
}
|
|
1072
|
-
function
|
|
1073
|
-
const [t, e] =
|
|
1107
|
+
function He() {
|
|
1108
|
+
const [t, e] = V();
|
|
1074
1109
|
return {
|
|
1075
1110
|
get: t.get,
|
|
1076
1111
|
watch: t.watch,
|
|
@@ -1082,10 +1117,10 @@ function ze() {
|
|
|
1082
1117
|
}
|
|
1083
1118
|
};
|
|
1084
1119
|
}
|
|
1085
|
-
function
|
|
1120
|
+
function ne(t) {
|
|
1086
1121
|
return !(t == null || typeof t != "object" || !t.hasOwnProperty("node"));
|
|
1087
1122
|
}
|
|
1088
|
-
class
|
|
1123
|
+
class oe {
|
|
1089
1124
|
constructor(e) {
|
|
1090
1125
|
f(this, "node");
|
|
1091
1126
|
this.node = e;
|
|
@@ -1100,25 +1135,25 @@ class re {
|
|
|
1100
1135
|
this.node.parentNode && this.node.parentNode.removeChild(this.node);
|
|
1101
1136
|
}
|
|
1102
1137
|
}
|
|
1103
|
-
function
|
|
1138
|
+
function S(t, e) {
|
|
1104
1139
|
return (P(e) ? e : [e]).map((o) => {
|
|
1105
|
-
if (
|
|
1106
|
-
return
|
|
1107
|
-
if (
|
|
1140
|
+
if (A(o.type))
|
|
1141
|
+
return K(t, o.type, o.props, o.children);
|
|
1142
|
+
if (O(o.type))
|
|
1108
1143
|
switch (o.type) {
|
|
1109
1144
|
case "$node": {
|
|
1110
1145
|
const r = o.props;
|
|
1111
|
-
return new
|
|
1146
|
+
return new oe(r.value);
|
|
1112
1147
|
}
|
|
1113
1148
|
case "$text": {
|
|
1114
1149
|
const r = o.props;
|
|
1115
|
-
return new
|
|
1150
|
+
return new Oe({
|
|
1116
1151
|
value: r.value
|
|
1117
1152
|
});
|
|
1118
1153
|
}
|
|
1119
1154
|
case "$cond": {
|
|
1120
1155
|
const r = o.props;
|
|
1121
|
-
return new
|
|
1156
|
+
return new Ce({
|
|
1122
1157
|
$predicate: r.$predicate,
|
|
1123
1158
|
thenContent: r.thenContent,
|
|
1124
1159
|
elseContent: r.elseContent,
|
|
@@ -1127,7 +1162,7 @@ function x(t, e) {
|
|
|
1127
1162
|
}
|
|
1128
1163
|
case "$repeat": {
|
|
1129
1164
|
const r = o.props;
|
|
1130
|
-
return new
|
|
1165
|
+
return new Ae({
|
|
1131
1166
|
$items: r.$items,
|
|
1132
1167
|
keyFn: r.keyFn,
|
|
1133
1168
|
renderFn: r.renderFn,
|
|
@@ -1136,7 +1171,7 @@ function x(t, e) {
|
|
|
1136
1171
|
}
|
|
1137
1172
|
case "$observer": {
|
|
1138
1173
|
const r = o.props;
|
|
1139
|
-
return new
|
|
1174
|
+
return new xe({
|
|
1140
1175
|
states: r.states,
|
|
1141
1176
|
renderFn: r.renderFn,
|
|
1142
1177
|
elementContext: t
|
|
@@ -1144,14 +1179,14 @@ function x(t, e) {
|
|
|
1144
1179
|
}
|
|
1145
1180
|
case "$outlet": {
|
|
1146
1181
|
const r = o.props;
|
|
1147
|
-
return new
|
|
1182
|
+
return new Se({
|
|
1148
1183
|
$children: r.$children,
|
|
1149
1184
|
elementContext: t
|
|
1150
1185
|
});
|
|
1151
1186
|
}
|
|
1152
1187
|
case "$portal": {
|
|
1153
1188
|
const r = o.props;
|
|
1154
|
-
return new
|
|
1189
|
+
return new Ee({
|
|
1155
1190
|
content: r.content,
|
|
1156
1191
|
parent: r.parent,
|
|
1157
1192
|
elementContext: t
|
|
@@ -1160,7 +1195,7 @@ function x(t, e) {
|
|
|
1160
1195
|
default:
|
|
1161
1196
|
if (o.type.startsWith("$"))
|
|
1162
1197
|
throw new Error(`Unknown markup type: ${o.type}`);
|
|
1163
|
-
return new
|
|
1198
|
+
return new ke({
|
|
1164
1199
|
tag: o.type,
|
|
1165
1200
|
props: o.props ?? {},
|
|
1166
1201
|
children: o.children,
|
|
@@ -1171,7 +1206,7 @@ function x(t, e) {
|
|
|
1171
1206
|
throw new TypeError(`Expected a string or view function. Got: ${o.type}`);
|
|
1172
1207
|
});
|
|
1173
1208
|
}
|
|
1174
|
-
function
|
|
1209
|
+
function M(t) {
|
|
1175
1210
|
if (t.length === 1)
|
|
1176
1211
|
return t[0];
|
|
1177
1212
|
const e = document.createComment("Fragment");
|
|
@@ -1202,43 +1237,43 @@ function A(t) {
|
|
|
1202
1237
|
}
|
|
1203
1238
|
};
|
|
1204
1239
|
}
|
|
1205
|
-
function
|
|
1206
|
-
return t == null || t === !1 || typeof t == "string" || typeof t == "number" ||
|
|
1240
|
+
function re(t) {
|
|
1241
|
+
return t == null || t === !1 || typeof t == "string" || typeof t == "number" || F(t) || w(t) || Y(re, t);
|
|
1207
1242
|
}
|
|
1208
|
-
function
|
|
1243
|
+
function ze(t, e) {
|
|
1209
1244
|
return e.outlet();
|
|
1210
1245
|
}
|
|
1211
1246
|
export {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1247
|
+
S as A,
|
|
1248
|
+
_e as B,
|
|
1249
|
+
We as C,
|
|
1250
|
+
Ke as D,
|
|
1251
|
+
ze as P,
|
|
1217
1252
|
w as a,
|
|
1218
1253
|
I as b,
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1254
|
+
Re as c,
|
|
1255
|
+
ge as d,
|
|
1256
|
+
A as e,
|
|
1257
|
+
O as f,
|
|
1258
|
+
V as g,
|
|
1224
1259
|
Be as h,
|
|
1225
1260
|
L as i,
|
|
1226
|
-
|
|
1261
|
+
Pe as j,
|
|
1227
1262
|
Fe as k,
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1263
|
+
Le as l,
|
|
1264
|
+
qe as m,
|
|
1265
|
+
Ge as n,
|
|
1266
|
+
He as o,
|
|
1267
|
+
ne as p,
|
|
1268
|
+
je as q,
|
|
1269
|
+
x as r,
|
|
1270
|
+
Ue as s,
|
|
1236
1271
|
q as t,
|
|
1237
|
-
|
|
1238
|
-
|
|
1272
|
+
pe as u,
|
|
1273
|
+
T as v,
|
|
1239
1274
|
G as w,
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1275
|
+
Ie as x,
|
|
1276
|
+
K as y,
|
|
1277
|
+
M as z
|
|
1243
1278
|
};
|
|
1244
|
-
//# sourceMappingURL=passthrough-
|
|
1279
|
+
//# sourceMappingURL=passthrough-9kwwjgWk.js.map
|