@manyducks.co/dolla 2.0.0-alpha.46 → 2.0.0-alpha.48
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 +31 -15
- package/dist/core/context.d.ts +2 -2
- package/dist/core/markup.d.ts +25 -24
- package/dist/core/nodes/dynamic.d.ts +2 -2
- package/dist/core/nodes/fragment.d.ts +2 -2
- package/dist/core/nodes/outlet.d.ts +2 -2
- package/dist/core/nodes/{list.d.ts → repeat.d.ts} +6 -6
- package/dist/core/nodes/view.d.ts +3 -3
- package/dist/core/signals-api.d.ts +42 -0
- package/dist/core/signals.d.ts +16 -194
- package/dist/core/store.d.ts +2 -2
- package/dist/fragment-CTSra5ph.js +8 -0
- package/dist/fragment-CTSra5ph.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +443 -398
- 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-BJffA2Ls.js → markup-D67RWnAp.js} +639 -735
- package/dist/markup-D67RWnAp.js.map +1 -0
- package/dist/router/index.d.ts +22 -8
- package/dist/router/router.utils.d.ts +3 -3
- package/dist/translate/index.d.ts +10 -10
- package/dist/types.d.ts +9 -9
- package/docs/http.md +3 -3
- package/docs/signals.md +83 -66
- package/examples/webcomponent/index.html +14 -0
- package/examples/webcomponent/main.js +165 -0
- package/notes/molecule.md +35 -0
- package/notes/splitting.md +5 -0
- package/package.json +1 -1
- package/dist/core/ref.d.ts +0 -28
- package/dist/core/views/for.d.ts +0 -9
- package/dist/fragment-CYt92o5I.js +0 -8
- package/dist/fragment-CYt92o5I.js.map +0 -1
- package/dist/markup-BJffA2Ls.js.map +0 -1
- package/dist/router/router.d.ts +0 -0
- /package/dist/core/{signals.test.d.ts → signals-api.test.d.ts} +0 -0
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
var c = (t, e, s) => _e(t, typeof e != "symbol" ? e + "" : e, s), H = (t, e, s) => e.has(t) || ce("Cannot " + s);
|
|
7
|
-
var g = (t, e, s) => (H(t, e, "read from private field"), s ? s.call(t) : e.get(t)), E = (t, e, s) => e.has(t) ? ce("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), L = (t, e, s, n) => (H(t, e, "write to private field"), n ? n.call(t, s) : e.set(t, s), s), fe = (t, e, s) => (H(t, e, "access private method"), s);
|
|
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 be({
|
|
1
|
+
var Ne = Object.defineProperty;
|
|
2
|
+
var xe = (t, e, s) => e in t ? Ne(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var f = (t, e, s) => xe(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
var E = /* @__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))(E || {});
|
|
5
|
+
function oe({
|
|
10
6
|
updateComputed: t,
|
|
11
7
|
notifyEffect: e
|
|
12
8
|
}) {
|
|
@@ -19,18 +15,18 @@ function be({
|
|
|
19
15
|
* @param sub - The subscriber that depends on this dependency.
|
|
20
16
|
* @returns The newly created link object if the two are not already linked; otherwise `undefined`.
|
|
21
17
|
*/
|
|
22
|
-
link(
|
|
18
|
+
link(o, u) {
|
|
23
19
|
const l = u.depsTail;
|
|
24
|
-
if (l !== void 0 && l.dep ===
|
|
20
|
+
if (l !== void 0 && l.dep === o)
|
|
25
21
|
return;
|
|
26
22
|
const d = l !== void 0 ? l.nextDep : u.deps;
|
|
27
|
-
if (d !== void 0 && d.dep ===
|
|
23
|
+
if (d !== void 0 && d.dep === o) {
|
|
28
24
|
u.depsTail = d;
|
|
29
25
|
return;
|
|
30
26
|
}
|
|
31
|
-
const a =
|
|
27
|
+
const a = o.subsTail;
|
|
32
28
|
if (!(a !== void 0 && a.sub === u && p(a, u)))
|
|
33
|
-
return i(
|
|
29
|
+
return i(o, u, d, l);
|
|
34
30
|
},
|
|
35
31
|
/**
|
|
36
32
|
* Traverses and marks subscribers starting from the provided link.
|
|
@@ -41,27 +37,27 @@ function be({
|
|
|
41
37
|
*
|
|
42
38
|
* @param link - The starting link from which propagation begins.
|
|
43
39
|
*/
|
|
44
|
-
propagate(
|
|
45
|
-
let u = 32, l =
|
|
40
|
+
propagate(o) {
|
|
41
|
+
let u = 32, l = o, d = 0;
|
|
46
42
|
e: do {
|
|
47
|
-
const a =
|
|
48
|
-
if (!(h & 244) && (a.flags = h | u | 8, !0) || h & 16 && !(h & 4) && (a.flags = h & -17 | u | 8, !0) || !(h & 224) && p(
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
|
|
43
|
+
const a = o.sub, h = a.flags;
|
|
44
|
+
if (!(h & 244) && (a.flags = h | u | 8, !0) || h & 16 && !(h & 4) && (a.flags = h & -17 | u | 8, !0) || !(h & 224) && p(o, a) && (a.flags = h | 16 | u | 8, a.subs !== void 0)) {
|
|
45
|
+
const w = a.subs;
|
|
46
|
+
if (w !== void 0) {
|
|
47
|
+
w.nextSub !== void 0 ? (w.prevSub = l, o = l = w, u = 64, ++d) : (o = w, u = h & 2 ? 128 : 64);
|
|
52
48
|
continue;
|
|
53
49
|
}
|
|
54
50
|
h & 2 && (n !== void 0 ? n.depsTail.nextDep = a.deps : s = a, n = a);
|
|
55
|
-
} else h & (4 | u) ? !(h & u) && h & 224 && p(
|
|
56
|
-
if ((
|
|
57
|
-
l =
|
|
51
|
+
} else h & (4 | u) ? !(h & u) && h & 224 && p(o, 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));
|
|
52
|
+
if ((o = l.nextSub) !== void 0) {
|
|
53
|
+
l = o, u = d ? 64 : 32;
|
|
58
54
|
continue;
|
|
59
55
|
}
|
|
60
56
|
for (; d; ) {
|
|
61
57
|
--d;
|
|
62
|
-
const
|
|
63
|
-
if (l =
|
|
64
|
-
l =
|
|
58
|
+
const W = l.dep.subs;
|
|
59
|
+
if (l = W.prevSub, W.prevSub = void 0, (o = l.nextSub) !== void 0) {
|
|
60
|
+
l = o, u = d ? 64 : 32;
|
|
65
61
|
continue e;
|
|
66
62
|
}
|
|
67
63
|
}
|
|
@@ -76,8 +72,8 @@ function be({
|
|
|
76
72
|
*
|
|
77
73
|
* @param sub - The subscriber to start tracking.
|
|
78
74
|
*/
|
|
79
|
-
startTracking(
|
|
80
|
-
|
|
75
|
+
startTracking(o) {
|
|
76
|
+
o.depsTail = void 0, o.flags = o.flags & -249 | 4;
|
|
81
77
|
},
|
|
82
78
|
/**
|
|
83
79
|
* Concludes tracking of dependencies for the specified subscriber.
|
|
@@ -87,13 +83,13 @@ function be({
|
|
|
87
83
|
*
|
|
88
84
|
* @param sub - The subscriber whose tracking is ending.
|
|
89
85
|
*/
|
|
90
|
-
endTracking(
|
|
91
|
-
const u =
|
|
86
|
+
endTracking(o) {
|
|
87
|
+
const u = o.depsTail;
|
|
92
88
|
if (u !== void 0) {
|
|
93
89
|
const l = u.nextDep;
|
|
94
|
-
l !== void 0 && (
|
|
95
|
-
} else
|
|
96
|
-
|
|
90
|
+
l !== void 0 && (g(l), u.nextDep = void 0);
|
|
91
|
+
} else o.deps !== void 0 && (g(o.deps), o.deps = void 0);
|
|
92
|
+
o.flags &= -5;
|
|
97
93
|
},
|
|
98
94
|
/**
|
|
99
95
|
* Updates the dirty flag for the given subscriber based on its dependencies.
|
|
@@ -105,8 +101,8 @@ function be({
|
|
|
105
101
|
* @param flags - The current flag set for this subscriber.
|
|
106
102
|
* @returns `true` if the subscriber is marked as Dirty; otherwise `false`.
|
|
107
103
|
*/
|
|
108
|
-
updateDirtyFlag(
|
|
109
|
-
return o
|
|
104
|
+
updateDirtyFlag(o, u) {
|
|
105
|
+
return r(o.deps) ? (o.flags = u | 32, !0) : (o.flags = u & -65, !1);
|
|
110
106
|
},
|
|
111
107
|
/**
|
|
112
108
|
* Updates the computed subscriber if necessary before its value is accessed.
|
|
@@ -118,10 +114,10 @@ function be({
|
|
|
118
114
|
* @param computed - The computed subscriber to update.
|
|
119
115
|
* @param flags - The current flag set for this subscriber.
|
|
120
116
|
*/
|
|
121
|
-
processComputedUpdate(
|
|
122
|
-
if ((u & 32 || (o
|
|
123
|
-
const l =
|
|
124
|
-
l !== void 0 &&
|
|
117
|
+
processComputedUpdate(o, u) {
|
|
118
|
+
if ((u & 32 || (r(o.deps) || (o.flags = u & -65, !1))) && t(o)) {
|
|
119
|
+
const l = o.subs;
|
|
120
|
+
l !== void 0 && c(l);
|
|
125
121
|
}
|
|
126
122
|
},
|
|
127
123
|
/**
|
|
@@ -135,10 +131,10 @@ function be({
|
|
|
135
131
|
* @param sub - The subscriber which may have pending effects.
|
|
136
132
|
* @param flags - The current flags on the subscriber to check.
|
|
137
133
|
*/
|
|
138
|
-
processPendingInnerEffects(
|
|
134
|
+
processPendingInnerEffects(o, u) {
|
|
139
135
|
if (u & 128) {
|
|
140
|
-
|
|
141
|
-
let l =
|
|
136
|
+
o.flags = u & -129;
|
|
137
|
+
let l = o.deps;
|
|
142
138
|
do {
|
|
143
139
|
const d = l.dep;
|
|
144
140
|
"flags" in d && d.flags & 2 && d.flags & 224 && e(d), l = l.nextDep;
|
|
@@ -154,69 +150,69 @@ function be({
|
|
|
154
150
|
*/
|
|
155
151
|
processEffectNotifications() {
|
|
156
152
|
for (; s !== void 0; ) {
|
|
157
|
-
const
|
|
158
|
-
l !== void 0 ? (u.nextDep = void 0, s = l.sub) : (s = void 0, n = void 0), e(
|
|
153
|
+
const o = s, u = o.depsTail, l = u.nextDep;
|
|
154
|
+
l !== void 0 ? (u.nextDep = void 0, s = l.sub) : (s = void 0, n = void 0), e(o) || (o.flags &= -9);
|
|
159
155
|
}
|
|
160
156
|
}
|
|
161
157
|
};
|
|
162
|
-
function i(
|
|
158
|
+
function i(o, u, l, d) {
|
|
163
159
|
const a = {
|
|
164
|
-
dep:
|
|
160
|
+
dep: o,
|
|
165
161
|
sub: u,
|
|
166
162
|
nextDep: l,
|
|
167
163
|
prevSub: void 0,
|
|
168
164
|
nextSub: void 0
|
|
169
165
|
};
|
|
170
|
-
if (d === void 0 ? u.deps = a : d.nextDep = a,
|
|
171
|
-
|
|
166
|
+
if (d === void 0 ? u.deps = a : d.nextDep = a, o.subs === void 0)
|
|
167
|
+
o.subs = a;
|
|
172
168
|
else {
|
|
173
|
-
const h =
|
|
169
|
+
const h = o.subsTail;
|
|
174
170
|
a.prevSub = h, h.nextSub = a;
|
|
175
171
|
}
|
|
176
|
-
return u.depsTail = a,
|
|
172
|
+
return u.depsTail = a, o.subsTail = a, a;
|
|
177
173
|
}
|
|
178
|
-
function o
|
|
174
|
+
function r(o) {
|
|
179
175
|
let u = 0, l;
|
|
180
176
|
e: do {
|
|
181
177
|
l = !1;
|
|
182
|
-
const d =
|
|
178
|
+
const d = o.dep;
|
|
183
179
|
if ("flags" in d) {
|
|
184
180
|
const a = d.flags;
|
|
185
181
|
if ((a & 33) === 33) {
|
|
186
182
|
if (t(d)) {
|
|
187
183
|
const h = d.subs;
|
|
188
|
-
h.nextSub !== void 0 &&
|
|
184
|
+
h.nextSub !== void 0 && c(h), l = !0;
|
|
189
185
|
}
|
|
190
186
|
} else if ((a & 65) === 65) {
|
|
191
187
|
const h = d.subs;
|
|
192
|
-
h.nextSub !== void 0 && (h.prevSub =
|
|
188
|
+
h.nextSub !== void 0 && (h.prevSub = o), o = d.deps, ++u;
|
|
193
189
|
continue;
|
|
194
190
|
}
|
|
195
191
|
}
|
|
196
|
-
if (!l &&
|
|
197
|
-
|
|
192
|
+
if (!l && o.nextDep !== void 0) {
|
|
193
|
+
o = o.nextDep;
|
|
198
194
|
continue;
|
|
199
195
|
}
|
|
200
196
|
if (u) {
|
|
201
|
-
let a =
|
|
197
|
+
let a = o.sub;
|
|
202
198
|
do {
|
|
203
199
|
--u;
|
|
204
200
|
const h = a.subs;
|
|
205
201
|
if (l) {
|
|
206
202
|
if (t(a)) {
|
|
207
|
-
(
|
|
203
|
+
(o = h.prevSub) !== void 0 ? (h.prevSub = void 0, c(a.subs), a = o.sub) : a = h.sub;
|
|
208
204
|
continue;
|
|
209
205
|
}
|
|
210
206
|
} else
|
|
211
207
|
a.flags &= -65;
|
|
212
|
-
if ((
|
|
213
|
-
if (h.prevSub = void 0,
|
|
214
|
-
|
|
208
|
+
if ((o = h.prevSub) !== void 0) {
|
|
209
|
+
if (h.prevSub = void 0, o.nextDep !== void 0) {
|
|
210
|
+
o = o.nextDep;
|
|
215
211
|
continue e;
|
|
216
212
|
}
|
|
217
|
-
a =
|
|
213
|
+
a = o.sub;
|
|
218
214
|
} else {
|
|
219
|
-
if ((
|
|
215
|
+
if ((o = h.nextDep) !== void 0)
|
|
220
216
|
continue e;
|
|
221
217
|
a = h.sub;
|
|
222
218
|
}
|
|
@@ -226,18 +222,18 @@ function be({
|
|
|
226
222
|
return l;
|
|
227
223
|
} while (!0);
|
|
228
224
|
}
|
|
229
|
-
function
|
|
225
|
+
function c(o) {
|
|
230
226
|
do {
|
|
231
|
-
const u =
|
|
232
|
-
(l & 96) === 64 && (u.flags = l | 32 | 8, (l & 10) === 2 && (n !== void 0 ? n.depsTail.nextDep = u.deps : s = u, n = u)),
|
|
233
|
-
} while (
|
|
227
|
+
const u = o.sub, l = u.flags;
|
|
228
|
+
(l & 96) === 64 && (u.flags = l | 32 | 8, (l & 10) === 2 && (n !== void 0 ? n.depsTail.nextDep = u.deps : s = u, n = u)), o = o.nextSub;
|
|
229
|
+
} while (o !== void 0);
|
|
234
230
|
}
|
|
235
|
-
function p(
|
|
231
|
+
function p(o, u) {
|
|
236
232
|
const l = u.depsTail;
|
|
237
233
|
if (l !== void 0) {
|
|
238
234
|
let d = u.deps;
|
|
239
235
|
do {
|
|
240
|
-
if (d ===
|
|
236
|
+
if (d === o)
|
|
241
237
|
return !0;
|
|
242
238
|
if (d === l)
|
|
243
239
|
break;
|
|
@@ -246,59 +242,59 @@ function be({
|
|
|
246
242
|
}
|
|
247
243
|
return !1;
|
|
248
244
|
}
|
|
249
|
-
function
|
|
245
|
+
function g(o) {
|
|
250
246
|
do {
|
|
251
|
-
const u =
|
|
247
|
+
const u = o.dep, l = o.nextDep, d = o.nextSub, a = o.prevSub;
|
|
252
248
|
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
249
|
const h = u.flags;
|
|
254
250
|
h & 32 || (u.flags = h | 32);
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
|
|
251
|
+
const w = u.deps;
|
|
252
|
+
if (w !== void 0) {
|
|
253
|
+
o = w, u.depsTail.nextDep = l, u.deps = void 0, u.depsTail = void 0;
|
|
258
254
|
continue;
|
|
259
255
|
}
|
|
260
256
|
}
|
|
261
|
-
|
|
262
|
-
} while (
|
|
257
|
+
o = l;
|
|
258
|
+
} while (o !== void 0);
|
|
263
259
|
}
|
|
264
260
|
}
|
|
265
261
|
var {
|
|
266
|
-
link:
|
|
267
|
-
propagate:
|
|
268
|
-
updateDirtyFlag:
|
|
269
|
-
startTracking:
|
|
270
|
-
endTracking:
|
|
271
|
-
processEffectNotifications:
|
|
272
|
-
processComputedUpdate:
|
|
273
|
-
processPendingInnerEffects:
|
|
274
|
-
} =
|
|
262
|
+
link: Je,
|
|
263
|
+
propagate: Qe,
|
|
264
|
+
updateDirtyFlag: Ee,
|
|
265
|
+
startTracking: re,
|
|
266
|
+
endTracking: ue,
|
|
267
|
+
processEffectNotifications: Ye,
|
|
268
|
+
processComputedUpdate: et,
|
|
269
|
+
processPendingInnerEffects: ce
|
|
270
|
+
} = oe({
|
|
275
271
|
updateComputed(t) {
|
|
276
|
-
|
|
272
|
+
re(t);
|
|
277
273
|
try {
|
|
278
274
|
const e = t.currentValue, s = t.getter(e);
|
|
279
275
|
return e !== s ? (t.currentValue = s, !0) : !1;
|
|
280
276
|
} finally {
|
|
281
|
-
|
|
277
|
+
ue(t);
|
|
282
278
|
}
|
|
283
279
|
},
|
|
284
280
|
notifyEffect(t) {
|
|
285
|
-
return "isScope" in t ?
|
|
281
|
+
return "isScope" in t ? Te(t) : Me(t);
|
|
286
282
|
}
|
|
287
283
|
});
|
|
288
|
-
function
|
|
289
|
-
|
|
284
|
+
function Se(t) {
|
|
285
|
+
re(t);
|
|
290
286
|
try {
|
|
291
287
|
t.fn();
|
|
292
288
|
} finally {
|
|
293
|
-
|
|
289
|
+
ue(t);
|
|
294
290
|
}
|
|
295
291
|
}
|
|
296
|
-
function
|
|
292
|
+
function Me(t) {
|
|
297
293
|
const e = t.flags;
|
|
298
|
-
return e & 32 || e & 64 &&
|
|
294
|
+
return e & 32 || e & 64 && Ee(t, e) ? Se(t) : ce(t, t.flags), !0;
|
|
299
295
|
}
|
|
300
|
-
function
|
|
301
|
-
return t.flags & 128 ? (
|
|
296
|
+
function Te(t) {
|
|
297
|
+
return t.flags & 128 ? (ce(t, t.flags), !0) : !1;
|
|
302
298
|
}
|
|
303
299
|
function T(t) {
|
|
304
300
|
const e = typeof t;
|
|
@@ -315,296 +311,184 @@ function T(t) {
|
|
|
315
311
|
return e;
|
|
316
312
|
}
|
|
317
313
|
}
|
|
318
|
-
function
|
|
314
|
+
function L(t) {
|
|
319
315
|
return Array.isArray(t);
|
|
320
316
|
}
|
|
321
|
-
function
|
|
322
|
-
return
|
|
317
|
+
function V(t, e) {
|
|
318
|
+
return L(e) && e.every((s) => t(s));
|
|
323
319
|
}
|
|
324
|
-
function
|
|
325
|
-
if (
|
|
320
|
+
function tt(t, e, s) {
|
|
321
|
+
if (V(t, e))
|
|
326
322
|
return !0;
|
|
327
|
-
throw new TypeError(
|
|
323
|
+
throw new TypeError(I(e, s));
|
|
328
324
|
}
|
|
329
|
-
function
|
|
325
|
+
function k(t) {
|
|
330
326
|
return typeof t == "string";
|
|
331
327
|
}
|
|
332
|
-
function
|
|
333
|
-
if (
|
|
328
|
+
function st(t, e) {
|
|
329
|
+
if (k(t))
|
|
334
330
|
return !0;
|
|
335
|
-
throw new TypeError(
|
|
331
|
+
throw new TypeError(I(t, e ?? "Expected a string. Got type: %t, value: %v"));
|
|
336
332
|
}
|
|
337
|
-
function
|
|
333
|
+
function m(t) {
|
|
338
334
|
return T(t) === "function";
|
|
339
335
|
}
|
|
340
|
-
function
|
|
336
|
+
function Le(t) {
|
|
341
337
|
return typeof t == "number" && !isNaN(t);
|
|
342
338
|
}
|
|
343
|
-
function
|
|
344
|
-
const e = t[0], s =
|
|
339
|
+
function nt(...t) {
|
|
340
|
+
const e = t[0], s = k(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, n = (i) => {
|
|
345
341
|
if (i instanceof e)
|
|
346
342
|
return !0;
|
|
347
|
-
throw new TypeError(
|
|
343
|
+
throw new TypeError(I(i, s));
|
|
348
344
|
};
|
|
349
345
|
return t.length < 2 ? n : n(t[1]);
|
|
350
346
|
}
|
|
351
|
-
function
|
|
352
|
-
return t != null && typeof t == "object" && !
|
|
347
|
+
function R(t) {
|
|
348
|
+
return t != null && typeof t == "object" && !L(t);
|
|
353
349
|
}
|
|
354
|
-
function
|
|
355
|
-
if (
|
|
350
|
+
function it(t, e) {
|
|
351
|
+
if (R(t))
|
|
356
352
|
return !0;
|
|
357
|
-
throw new TypeError(
|
|
353
|
+
throw new TypeError(I(t, e));
|
|
358
354
|
}
|
|
359
|
-
function
|
|
355
|
+
function I(t, e) {
|
|
360
356
|
var i;
|
|
361
357
|
const s = T(t), n = ((i = t == null ? void 0 : t.toString) == null ? void 0 : i.call(t)) || String(t);
|
|
362
358
|
return e.replaceAll("%t", s).replaceAll("%v", n);
|
|
363
359
|
}
|
|
364
|
-
let A, P = [];
|
|
365
360
|
const {
|
|
366
|
-
link:
|
|
367
|
-
propagate:
|
|
368
|
-
updateDirtyFlag:
|
|
369
|
-
startTracking:
|
|
370
|
-
endTracking:
|
|
371
|
-
processEffectNotifications:
|
|
372
|
-
processComputedUpdate:
|
|
373
|
-
processPendingInnerEffects:
|
|
374
|
-
} =
|
|
361
|
+
link: B,
|
|
362
|
+
propagate: ke,
|
|
363
|
+
updateDirtyFlag: Ce,
|
|
364
|
+
startTracking: G,
|
|
365
|
+
endTracking: z,
|
|
366
|
+
processEffectNotifications: Ae,
|
|
367
|
+
processComputedUpdate: De,
|
|
368
|
+
processPendingInnerEffects: Oe
|
|
369
|
+
} = oe({
|
|
375
370
|
updateComputed(t) {
|
|
376
|
-
const e =
|
|
377
|
-
|
|
371
|
+
const e = v;
|
|
372
|
+
v = t, G(t);
|
|
378
373
|
try {
|
|
379
|
-
const s = t.
|
|
380
|
-
return t.equals(s, n) ? !1 : (t.
|
|
374
|
+
const s = t.current, n = t.getter(s);
|
|
375
|
+
return t.equals(s, n) ? !1 : (t.current = n, !0);
|
|
381
376
|
} finally {
|
|
382
|
-
|
|
377
|
+
v = e, z(t);
|
|
383
378
|
}
|
|
384
379
|
},
|
|
385
380
|
notifyEffect(t) {
|
|
386
381
|
const e = t.flags;
|
|
387
|
-
return e &
|
|
382
|
+
return e & E.Dirty || e & E.PendingComputed && Ce(t, e) ? fe(t) : Oe(t, t.flags), !0;
|
|
388
383
|
}
|
|
389
384
|
});
|
|
390
|
-
let
|
|
391
|
-
const
|
|
392
|
-
let
|
|
393
|
-
function
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
for (let t = 0; t <
|
|
397
|
-
const e =
|
|
398
|
-
|
|
385
|
+
let v;
|
|
386
|
+
const S = [];
|
|
387
|
+
let q = !1;
|
|
388
|
+
function Pe() {
|
|
389
|
+
q || (q = !0, queueMicrotask(() => {
|
|
390
|
+
q = !1;
|
|
391
|
+
for (let t = 0; t < S.length; t++) {
|
|
392
|
+
const e = S[t], s = v;
|
|
393
|
+
v = e, G(e);
|
|
399
394
|
try {
|
|
400
|
-
e.fn();
|
|
395
|
+
e.cleanup && (ae(), e.cleanup(), de()), e.cleanup = e.fn() ?? void 0;
|
|
401
396
|
} finally {
|
|
402
|
-
|
|
397
|
+
v = s, z(e);
|
|
403
398
|
}
|
|
404
399
|
}
|
|
405
|
-
|
|
400
|
+
S.length = 0;
|
|
406
401
|
}));
|
|
407
402
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
403
|
+
function fe(t) {
|
|
404
|
+
S.push(t), Pe();
|
|
410
405
|
}
|
|
411
|
-
function
|
|
412
|
-
|
|
413
|
-
|
|
406
|
+
function $e() {
|
|
407
|
+
G(this), z(this), queueMicrotask(() => {
|
|
408
|
+
S.splice(S.indexOf(this), 1), this.cleanup && this.cleanup();
|
|
414
409
|
});
|
|
415
410
|
}
|
|
416
|
-
const
|
|
417
|
-
function
|
|
418
|
-
|
|
411
|
+
const le = [];
|
|
412
|
+
function ae() {
|
|
413
|
+
le.push(v), v = void 0;
|
|
419
414
|
}
|
|
420
|
-
function
|
|
421
|
-
|
|
415
|
+
function de() {
|
|
416
|
+
v = le.pop();
|
|
422
417
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
E(this, V);
|
|
428
|
-
E(this, j);
|
|
429
|
-
L(this, b, {
|
|
430
|
-
currentValue: e,
|
|
431
|
-
subs: void 0,
|
|
432
|
-
subsTail: void 0
|
|
433
|
-
}), L(this, V, (s == null ? void 0 : s.equals) ?? Object.is), s != null && s.name && L(this, j, s.name);
|
|
434
|
-
}
|
|
435
|
-
get name() {
|
|
436
|
-
return g(this, j) || `anonymous ${this[Symbol.toStringTag]}`;
|
|
437
|
-
}
|
|
438
|
-
get [Symbol.toStringTag]() {
|
|
439
|
-
return `Atom<${T(g(this, b).currentValue)}>`;
|
|
440
|
-
}
|
|
441
|
-
/**
|
|
442
|
-
* Returns the latest value. The signal is tracked as a dependency if called within `effect` or `compose`.
|
|
443
|
-
*/
|
|
444
|
-
get() {
|
|
445
|
-
return y !== void 0 && (te(g(this, b), y), P.push(this)), g(this, b).currentValue;
|
|
446
|
-
}
|
|
447
|
-
/**
|
|
448
|
-
* Returns the latest value. The signal is NOT tracked if called within `effect` or `compose`.
|
|
449
|
-
*/
|
|
450
|
-
peek() {
|
|
451
|
-
return g(this, b).currentValue;
|
|
452
|
-
}
|
|
453
|
-
/**
|
|
454
|
-
* Replaces the current value with `next`.
|
|
455
|
-
*
|
|
456
|
-
* @example
|
|
457
|
-
* const count = atom(0);
|
|
458
|
-
* count.set(2);
|
|
459
|
-
* count.set(count.get() + 1);
|
|
460
|
-
*/
|
|
461
|
-
set(e) {
|
|
462
|
-
if (!g(this, V).call(this, g(this, b).currentValue, e)) {
|
|
463
|
-
g(this, b).currentValue = e;
|
|
464
|
-
const s = g(this, b).subs;
|
|
465
|
-
s !== void 0 && (Fe(s), We());
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* Passes the current value to `fn` and sets the return value as the next value.
|
|
470
|
-
*
|
|
471
|
-
* @example
|
|
472
|
-
* const count = atom(0);
|
|
473
|
-
* count.update((current) => current + 1);
|
|
474
|
-
* count.update((current) => current * 5);
|
|
475
|
-
*
|
|
476
|
-
* // Also works very well with Immer `produce` for complex objects.
|
|
477
|
-
* const items = atom([{ name: "Alice", age: 26 }, { name: "Bob", age: 33 }]);
|
|
478
|
-
*
|
|
479
|
-
* // Without Immer:
|
|
480
|
-
* items.update((current) => {
|
|
481
|
-
* // Return a new array with Bob's age increased by 1.
|
|
482
|
-
* const newItems = [...current];
|
|
483
|
-
* newItems[1] = {
|
|
484
|
-
* ...newItems[1],
|
|
485
|
-
* age: newItems[1].age + 1
|
|
486
|
-
* };
|
|
487
|
-
* return newItems;
|
|
488
|
-
* });
|
|
489
|
-
*
|
|
490
|
-
* // With Immer:
|
|
491
|
-
* import { produce } from "immer";
|
|
492
|
-
*
|
|
493
|
-
* items.update(produce((draft) => {
|
|
494
|
-
* // Mutate draft to increase Bob's age by 1.
|
|
495
|
-
* // Results in a new object with this patch applied.
|
|
496
|
-
* draft[1].age++;
|
|
497
|
-
* }));
|
|
498
|
-
*/
|
|
499
|
-
update(e) {
|
|
500
|
-
this.set(e(this.peek()));
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* @deprecated use `get()`
|
|
504
|
-
*/
|
|
505
|
-
get value() {
|
|
506
|
-
return this.peek();
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* @deprecated use `set()`
|
|
510
|
-
*/
|
|
511
|
-
set value(e) {
|
|
512
|
-
this.set(e);
|
|
513
|
-
}
|
|
418
|
+
const Z = Symbol("SIGNAL"), he = Symbol("SOURCE");
|
|
419
|
+
function _(t) {
|
|
420
|
+
let e;
|
|
421
|
+
return ae(), e = b(t), de(), e;
|
|
514
422
|
}
|
|
515
|
-
b
|
|
516
|
-
|
|
517
|
-
class Te {
|
|
518
|
-
constructor(e, s) {
|
|
519
|
-
E(this, G);
|
|
520
|
-
E(this, C);
|
|
521
|
-
E(this, _);
|
|
522
|
-
E(this, q);
|
|
523
|
-
L(this, _, e), L(this, C, {
|
|
524
|
-
currentValue: void 0,
|
|
525
|
-
equals: (s == null ? void 0 : s.equals) ?? Object.is,
|
|
526
|
-
subs: void 0,
|
|
527
|
-
subsTail: void 0,
|
|
528
|
-
deps: void 0,
|
|
529
|
-
depsTail: void 0,
|
|
530
|
-
flags: M.Computed | M.Dirty,
|
|
531
|
-
getter: fe(this, G, Le).bind(this)
|
|
532
|
-
}), s != null && s.name && L(this, q, s.name);
|
|
533
|
-
}
|
|
534
|
-
get name() {
|
|
535
|
-
return g(this, q) || `anonymous ${this[Symbol.toStringTag]}`;
|
|
536
|
-
}
|
|
537
|
-
get [Symbol.toStringTag]() {
|
|
538
|
-
return `Composed<${T(g(this, C).currentValue)}>`;
|
|
539
|
-
}
|
|
540
|
-
get() {
|
|
541
|
-
return y !== void 0 && (te(g(this, C), y), P.push(this)), this.peek();
|
|
542
|
-
}
|
|
543
|
-
peek() {
|
|
544
|
-
const e = g(this, C), s = e.flags;
|
|
545
|
-
return s & (M.Dirty | M.PendingComputed) && Ze(e, s), e.currentValue;
|
|
546
|
-
}
|
|
547
|
-
/**
|
|
548
|
-
* @deprecated use `get()`
|
|
549
|
-
*/
|
|
550
|
-
get value() {
|
|
551
|
-
return this.peek();
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
C = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), G = new WeakSet(), Le = function(e) {
|
|
555
|
-
let s = g(this, _).call(this, e);
|
|
556
|
-
return v(s) && (s = s.get()), s;
|
|
557
|
-
};
|
|
558
|
-
function v(t) {
|
|
559
|
-
return t instanceof ke || t instanceof Te;
|
|
560
|
-
}
|
|
561
|
-
function Q(t, e) {
|
|
562
|
-
return new ke(t, e);
|
|
563
|
-
}
|
|
564
|
-
function ie(t, e) {
|
|
565
|
-
return new Te(t, e);
|
|
423
|
+
function b(t) {
|
|
424
|
+
return m(t) ? t() : t;
|
|
566
425
|
}
|
|
567
|
-
function
|
|
568
|
-
|
|
569
|
-
t
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
return v(
|
|
577
|
-
}
|
|
578
|
-
function Nt(t) {
|
|
579
|
-
return v(t) ? t.peek() : t;
|
|
426
|
+
function y(t) {
|
|
427
|
+
const e = {
|
|
428
|
+
fn: t,
|
|
429
|
+
subs: void 0,
|
|
430
|
+
subsTail: void 0,
|
|
431
|
+
deps: void 0,
|
|
432
|
+
depsTail: void 0,
|
|
433
|
+
flags: E.Effect
|
|
434
|
+
};
|
|
435
|
+
return v !== void 0 && B(e, v), fe(e), $e.bind(e);
|
|
580
436
|
}
|
|
581
|
-
function
|
|
582
|
-
|
|
437
|
+
function D(t, e) {
|
|
438
|
+
return m(t) ? Ie(t, e) : H(t === void 0 ? void 0 : t, e);
|
|
583
439
|
}
|
|
584
|
-
function
|
|
585
|
-
|
|
440
|
+
function H(t, e) {
|
|
441
|
+
const s = {
|
|
442
|
+
current: t,
|
|
443
|
+
subs: void 0,
|
|
444
|
+
subsTail: void 0
|
|
445
|
+
}, n = (e == null ? void 0 : e.equals) ?? Object.is, i = function() {
|
|
446
|
+
if (arguments.length > 0) {
|
|
447
|
+
let r = arguments[0];
|
|
448
|
+
if (typeof r == "function" && (r = r(s.current)), !n(s.current, r)) {
|
|
449
|
+
s.current = r;
|
|
450
|
+
const c = s.subs;
|
|
451
|
+
c !== void 0 && (ke(c), Ae());
|
|
452
|
+
}
|
|
453
|
+
} else
|
|
454
|
+
return v !== void 0 && B(s, v), s.current;
|
|
455
|
+
};
|
|
456
|
+
return i._type = he, i;
|
|
586
457
|
}
|
|
587
|
-
function
|
|
458
|
+
function Ie(t, e) {
|
|
459
|
+
if (m(t) && t._type === Z)
|
|
460
|
+
return t._type === he ? () => t() : t;
|
|
588
461
|
const s = {
|
|
589
|
-
|
|
462
|
+
current: void 0,
|
|
463
|
+
equals: (e == null ? void 0 : e.equals) ?? Object.is,
|
|
590
464
|
subs: void 0,
|
|
591
465
|
subsTail: void 0,
|
|
592
466
|
deps: void 0,
|
|
593
467
|
depsTail: void 0,
|
|
594
|
-
flags:
|
|
468
|
+
flags: E.Computed | E.Dirty,
|
|
469
|
+
getter: (i) => {
|
|
470
|
+
const r = t(i);
|
|
471
|
+
return b(r);
|
|
472
|
+
}
|
|
473
|
+
}, n = function() {
|
|
474
|
+
if (arguments.length > 0)
|
|
475
|
+
throw new Error("Signals cannot be set as their values are derived from the sources they depend on.");
|
|
476
|
+
v !== void 0 && B(s, v);
|
|
477
|
+
const i = s.flags;
|
|
478
|
+
return i & (E.Dirty | E.PendingComputed) && De(s, i), s.current;
|
|
595
479
|
};
|
|
596
|
-
return
|
|
480
|
+
return n._type = Z, n;
|
|
597
481
|
}
|
|
598
|
-
const
|
|
482
|
+
const ot = () => {
|
|
599
483
|
};
|
|
600
|
-
let
|
|
601
|
-
function
|
|
602
|
-
return
|
|
484
|
+
let U = 1;
|
|
485
|
+
function pe() {
|
|
486
|
+
return U = U % Number.MAX_SAFE_INTEGER + 1, U.toString(36) + Date.now().toString(36);
|
|
603
487
|
}
|
|
604
|
-
function
|
|
488
|
+
function rt(t, e) {
|
|
605
489
|
return Object.is(t, e);
|
|
606
490
|
}
|
|
607
|
-
function
|
|
491
|
+
function ut(t, e) {
|
|
608
492
|
if (Object.is(t, e)) return !0;
|
|
609
493
|
const s = T(t);
|
|
610
494
|
if (s !== T(e))
|
|
@@ -628,7 +512,7 @@ function Mt(t, e) {
|
|
|
628
512
|
if (t[i] !== e[i]) return !1;
|
|
629
513
|
return !0;
|
|
630
514
|
case "set":
|
|
631
|
-
if (
|
|
515
|
+
if (m(t.symmetricDifference))
|
|
632
516
|
return t.symmetricDifference(e).size === 0;
|
|
633
517
|
for (const i of t.keys())
|
|
634
518
|
if (t[i] !== e.get(i)) return !1;
|
|
@@ -636,20 +520,20 @@ function Mt(t, e) {
|
|
|
636
520
|
}
|
|
637
521
|
return !1;
|
|
638
522
|
}
|
|
639
|
-
function
|
|
523
|
+
function C(t, e) {
|
|
640
524
|
if (t === e) return !0;
|
|
641
525
|
if (t && e && typeof t == "object" && typeof e == "object") {
|
|
642
526
|
if (t.constructor !== e.constructor) return !1;
|
|
643
527
|
var s, n, i;
|
|
644
528
|
if (Array.isArray(t)) {
|
|
645
529
|
if (s = t.length, s != e.length) return !1;
|
|
646
|
-
for (n = s; n-- !== 0; ) if (!
|
|
530
|
+
for (n = s; n-- !== 0; ) if (!C(t[n], e[n])) return !1;
|
|
647
531
|
return !0;
|
|
648
532
|
}
|
|
649
533
|
if (t instanceof Map && e instanceof Map) {
|
|
650
534
|
if (t.size !== e.size) return !1;
|
|
651
535
|
for (n of t.entries()) if (!e.has(n[0])) return !1;
|
|
652
|
-
for (n of t.entries()) if (!
|
|
536
|
+
for (n of t.entries()) if (!C(n[1], e.get(n[0]))) return !1;
|
|
653
537
|
return !0;
|
|
654
538
|
}
|
|
655
539
|
if (t instanceof Set && e instanceof Set) {
|
|
@@ -668,26 +552,26 @@ function J(t, e) {
|
|
|
668
552
|
if (i = Object.keys(t), s = i.length, s !== Object.keys(e).length) return !1;
|
|
669
553
|
for (n = s; n-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(e, i[n])) return !1;
|
|
670
554
|
for (n = s; n-- !== 0; ) {
|
|
671
|
-
var
|
|
672
|
-
if (!
|
|
555
|
+
var r = i[n];
|
|
556
|
+
if (!C(t[r], e[r])) return !1;
|
|
673
557
|
}
|
|
674
558
|
return !0;
|
|
675
559
|
}
|
|
676
560
|
return t !== t && e !== e;
|
|
677
561
|
}
|
|
678
|
-
function
|
|
562
|
+
function _e(t, e) {
|
|
679
563
|
const s = {};
|
|
680
564
|
for (const n in e)
|
|
681
565
|
t.includes(n) || (s[n] = e[n]);
|
|
682
566
|
return s;
|
|
683
567
|
}
|
|
684
|
-
function
|
|
568
|
+
function ct(t) {
|
|
685
569
|
let e = 0;
|
|
686
570
|
for (let s = 0; s < t.length; s++)
|
|
687
571
|
e = (e + t.charCodeAt(s) * 10) % 360;
|
|
688
572
|
return `oklch(0.68 0.15 ${e}deg)`;
|
|
689
573
|
}
|
|
690
|
-
function
|
|
574
|
+
function ft(t) {
|
|
691
575
|
if (t instanceof RegExp)
|
|
692
576
|
return (n) => t.test(n);
|
|
693
577
|
const e = {
|
|
@@ -698,24 +582,24 @@ function Tt(t) {
|
|
|
698
582
|
let i = "positive";
|
|
699
583
|
n.startsWith("-") && (i = "negative", n = n.slice(1)), n === "*" ? e[i].push(function() {
|
|
700
584
|
return !0;
|
|
701
|
-
}) : n.endsWith("*") ? e[i].push(function(
|
|
702
|
-
return
|
|
703
|
-
}) : e[i].push(function(
|
|
704
|
-
return
|
|
585
|
+
}) : n.endsWith("*") ? e[i].push(function(r) {
|
|
586
|
+
return r.startsWith(n.slice(0, n.length - 1));
|
|
587
|
+
}) : e[i].push(function(r) {
|
|
588
|
+
return r === n;
|
|
705
589
|
});
|
|
706
590
|
}
|
|
707
591
|
return function(n) {
|
|
708
|
-
const { positive: i, negative:
|
|
709
|
-
return !(
|
|
592
|
+
const { positive: i, negative: r } = e;
|
|
593
|
+
return !(r.some((c) => c(n)) || i.length > 0 && !i.some((c) => c(n)));
|
|
710
594
|
};
|
|
711
595
|
}
|
|
712
|
-
const
|
|
713
|
-
var
|
|
714
|
-
|
|
715
|
-
class
|
|
596
|
+
const x = Symbol.for("DollaMarkupElement"), lt = Symbol.for("DollaRouter");
|
|
597
|
+
var J;
|
|
598
|
+
J = x;
|
|
599
|
+
class K {
|
|
716
600
|
constructor(e) {
|
|
717
|
-
|
|
718
|
-
|
|
601
|
+
f(this, J, !0);
|
|
602
|
+
f(this, "domNode");
|
|
719
603
|
this.domNode = e;
|
|
720
604
|
}
|
|
721
605
|
get isMounted() {
|
|
@@ -728,30 +612,30 @@ class le {
|
|
|
728
612
|
this.domNode.parentNode && !e && this.domNode.parentNode.removeChild(this.domNode);
|
|
729
613
|
}
|
|
730
614
|
}
|
|
731
|
-
var
|
|
732
|
-
|
|
733
|
-
class
|
|
615
|
+
var Q;
|
|
616
|
+
Q = x;
|
|
617
|
+
class je {
|
|
734
618
|
constructor(e) {
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
619
|
+
f(this, Q, !0);
|
|
620
|
+
f(this, "domNode", document.createTextNode(""));
|
|
621
|
+
f(this, "children", []);
|
|
622
|
+
f(this, "elementContext");
|
|
623
|
+
f(this, "source");
|
|
624
|
+
f(this, "unsubscribe");
|
|
741
625
|
this.source = e.source, this.elementContext = e.elementContext;
|
|
742
626
|
}
|
|
743
627
|
get isMounted() {
|
|
744
628
|
return this.domNode.parentNode != null;
|
|
745
629
|
}
|
|
746
630
|
mount(e, s) {
|
|
747
|
-
this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe =
|
|
748
|
-
const n = this.source
|
|
749
|
-
if (!
|
|
631
|
+
this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = y(() => {
|
|
632
|
+
const n = this.source();
|
|
633
|
+
if (!we(n))
|
|
750
634
|
throw console.error(n), new TypeError(
|
|
751
635
|
`Dynamic received invalid value to render. Got type: ${T(n)}, value: ${n}`
|
|
752
636
|
);
|
|
753
|
-
|
|
754
|
-
this.update(
|
|
637
|
+
_(() => {
|
|
638
|
+
this.update(L(n) ? n : [n]);
|
|
755
639
|
});
|
|
756
640
|
}));
|
|
757
641
|
}
|
|
@@ -765,46 +649,85 @@ class tt {
|
|
|
765
649
|
this.children = [];
|
|
766
650
|
}
|
|
767
651
|
update(e) {
|
|
768
|
-
var
|
|
652
|
+
var r, c, p;
|
|
769
653
|
if (this.cleanup(!1), e == null || e.length === 0 || !this.isMounted)
|
|
770
654
|
return;
|
|
771
|
-
const s = e.flatMap((
|
|
772
|
-
for (const
|
|
773
|
-
const
|
|
774
|
-
|
|
655
|
+
const s = e.flatMap((g) => ye(g) ? g : M(this.elementContext, j(g)));
|
|
656
|
+
for (const g of s) {
|
|
657
|
+
const o = ((r = this.children.at(-1)) == null ? void 0 : r.domNode) || this.domNode;
|
|
658
|
+
g.mount(this.domNode.parentNode, o), this.children.push(g);
|
|
775
659
|
}
|
|
776
|
-
const n = this.domNode.parentNode, i = ((p = (
|
|
660
|
+
const n = this.domNode.parentNode, i = ((p = (c = this.children.at(-1)) == null ? void 0 : c.domNode) == null ? void 0 : p.nextSibling) ?? null;
|
|
777
661
|
"moveBefore" in n ? n.moveBefore(this.domNode, i) : n.insertBefore(this.domNode, i);
|
|
778
662
|
}
|
|
779
663
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
664
|
+
var Y;
|
|
665
|
+
Y = x;
|
|
666
|
+
class me {
|
|
667
|
+
constructor(e) {
|
|
668
|
+
f(this, Y, !0);
|
|
669
|
+
f(this, "domNode", document.createTextNode(""));
|
|
670
|
+
f(this, "isMounted", !1);
|
|
671
|
+
f(this, "source");
|
|
672
|
+
f(this, "elements", []);
|
|
673
|
+
f(this, "unsubscribe");
|
|
674
|
+
this.source = e;
|
|
675
|
+
}
|
|
676
|
+
mount(e, s) {
|
|
677
|
+
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), m(this.source) ? this.unsubscribe = y(() => {
|
|
678
|
+
const n = b(this.source);
|
|
679
|
+
_(() => {
|
|
680
|
+
this.update(n);
|
|
681
|
+
});
|
|
682
|
+
}) : this.update(this.elements));
|
|
683
|
+
}
|
|
684
|
+
unmount(e = !1) {
|
|
685
|
+
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.isMounted && (this.cleanup(e), this.isMounted = !1);
|
|
686
|
+
}
|
|
687
|
+
cleanup(e) {
|
|
688
|
+
for (const s of this.elements)
|
|
689
|
+
s.unmount(e);
|
|
690
|
+
this.elements = [];
|
|
691
|
+
}
|
|
692
|
+
update(e) {
|
|
693
|
+
var s, n;
|
|
694
|
+
if (this.cleanup(!1), e.length > 0) {
|
|
695
|
+
for (let i = 0; i < e.length; i++) {
|
|
696
|
+
const r = e[i], c = i > 0 ? this.elements[i - 1] : void 0;
|
|
697
|
+
r.mount(this.domNode.parentElement, c == null ? void 0 : c.domNode), this.elements.push(r);
|
|
698
|
+
}
|
|
699
|
+
(n = this.domNode.parentNode) == null || n.insertBefore(this.domNode, ((s = this.elements.at(-1)) == null ? void 0 : s.domNode) ?? null);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
const qe = (t) => /^on[A-Z]/.test(t);
|
|
704
|
+
var ee;
|
|
705
|
+
ee = x;
|
|
706
|
+
class Ue {
|
|
784
707
|
constructor({ tag: e, props: s, children: n, elementContext: i }) {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
708
|
+
f(this, ee, !0);
|
|
709
|
+
f(this, "domNode");
|
|
710
|
+
f(this, "props");
|
|
711
|
+
f(this, "childMarkup", []);
|
|
712
|
+
f(this, "children", []);
|
|
713
|
+
f(this, "unsubscribers", []);
|
|
714
|
+
f(this, "elementContext");
|
|
792
715
|
// Track the ref so we can nullify it on unmount.
|
|
793
|
-
|
|
716
|
+
f(this, "ref");
|
|
794
717
|
// Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
|
|
795
|
-
|
|
718
|
+
f(this, "canClickAway", !1);
|
|
796
719
|
if (e.toLowerCase() === "svg" && (i = {
|
|
797
720
|
...i,
|
|
798
721
|
isSVG: !0
|
|
799
722
|
}), 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)
|
|
800
|
-
if (
|
|
723
|
+
if (m(s.ref))
|
|
801
724
|
this.ref = s.ref, this.ref(this.domNode);
|
|
802
725
|
else
|
|
803
726
|
throw new Error("Expected ref to be a function. Got: " + s.ref);
|
|
804
727
|
this.props = {
|
|
805
|
-
...
|
|
728
|
+
..._e(["ref", "class", "className"], s),
|
|
806
729
|
class: s.className ?? s.class
|
|
807
|
-
}, n && (this.childMarkup =
|
|
730
|
+
}, n && (this.childMarkup = j(n)), this.elementContext = i;
|
|
808
731
|
}
|
|
809
732
|
get isMounted() {
|
|
810
733
|
return this.domNode.parentNode != null;
|
|
@@ -813,10 +736,10 @@ class nt {
|
|
|
813
736
|
if (e == null)
|
|
814
737
|
throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${e}`);
|
|
815
738
|
if (!this.isMounted) {
|
|
816
|
-
this.childMarkup.length > 0 && (this.children =
|
|
739
|
+
this.childMarkup.length > 0 && (this.children = M(this.elementContext, this.childMarkup));
|
|
817
740
|
for (let n = 0; n < this.children.length; n++) {
|
|
818
|
-
const i = this.children[n],
|
|
819
|
-
i.mount(this.domNode,
|
|
741
|
+
const i = this.children[n], r = n > 0 ? this.children[n - 1].domNode : void 0;
|
|
742
|
+
i.mount(this.domNode, r);
|
|
820
743
|
}
|
|
821
744
|
this.applyProps(this.domNode, this.props), this.props.style && this.applyStyles(this.domNode, this.props.style, this.unsubscribers), this.props.class && this.applyClasses(this.domNode, this.props.class, this.unsubscribers);
|
|
822
745
|
}
|
|
@@ -837,9 +760,9 @@ class nt {
|
|
|
837
760
|
}
|
|
838
761
|
}
|
|
839
762
|
attachProp(e, s) {
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
s(e
|
|
763
|
+
m(e) ? this.unsubscribers.push(
|
|
764
|
+
y(() => {
|
|
765
|
+
s(e());
|
|
843
766
|
})
|
|
844
767
|
) : s(e);
|
|
845
768
|
}
|
|
@@ -847,74 +770,81 @@ class nt {
|
|
|
847
770
|
for (const n in s) {
|
|
848
771
|
const i = s[n];
|
|
849
772
|
if (n === "on:clickoutside" || n === "onClickOutside" || n === "onclickoutside") {
|
|
850
|
-
const
|
|
851
|
-
this.canClickAway && !e.contains(p.target) &&
|
|
852
|
-
},
|
|
853
|
-
window.addEventListener("click",
|
|
854
|
-
window.removeEventListener("click",
|
|
773
|
+
const r = (p) => {
|
|
774
|
+
this.canClickAway && !e.contains(p.target) && i(p);
|
|
775
|
+
}, c = { capture: !0 };
|
|
776
|
+
window.addEventListener("click", r, c), this.unsubscribers.push(() => {
|
|
777
|
+
window.removeEventListener("click", r, c);
|
|
855
778
|
});
|
|
856
|
-
} else if (
|
|
857
|
-
const
|
|
858
|
-
e.addEventListener(
|
|
859
|
-
e.removeEventListener(
|
|
779
|
+
} else if (m(i) && qe(n)) {
|
|
780
|
+
const r = n.slice(2).toLowerCase(), c = i;
|
|
781
|
+
e.addEventListener(r, c), this.unsubscribers.push(() => {
|
|
782
|
+
e.removeEventListener(r, c);
|
|
783
|
+
});
|
|
784
|
+
} else if (m(i) && Re.includes(n)) {
|
|
785
|
+
const r = n.substring(2);
|
|
786
|
+
e.addEventListener(r, i), this.unsubscribers.push(() => {
|
|
787
|
+
e.removeEventListener(r, i);
|
|
860
788
|
});
|
|
861
789
|
} else if (n.includes("-"))
|
|
862
|
-
this.attachProp(i, (
|
|
863
|
-
|
|
790
|
+
this.attachProp(i, (r) => {
|
|
791
|
+
r == null ? e.removeAttribute(n) : e.setAttribute(n, String(r));
|
|
864
792
|
});
|
|
865
|
-
else if (!
|
|
793
|
+
else if (!Ve.includes(n))
|
|
866
794
|
if (this.elementContext.isSVG)
|
|
867
|
-
this.attachProp(i, (
|
|
868
|
-
|
|
795
|
+
this.attachProp(i, (r) => {
|
|
796
|
+
r != null ? e.setAttribute(n, String(s[n])) : e.removeAttribute(n);
|
|
869
797
|
});
|
|
870
798
|
else
|
|
871
799
|
switch (n) {
|
|
872
800
|
case "contentEditable":
|
|
873
801
|
case "value":
|
|
874
|
-
this.attachProp(i, (
|
|
875
|
-
e[n] = String(
|
|
802
|
+
this.attachProp(i, (r) => {
|
|
803
|
+
e[n] = String(r);
|
|
876
804
|
});
|
|
877
805
|
break;
|
|
878
806
|
case "for":
|
|
879
|
-
this.attachProp(i, (
|
|
880
|
-
e.htmlFor =
|
|
807
|
+
this.attachProp(i, (r) => {
|
|
808
|
+
e.htmlFor = r;
|
|
881
809
|
});
|
|
882
810
|
break;
|
|
883
811
|
case "title":
|
|
884
|
-
this.attachProp(i, (
|
|
885
|
-
|
|
812
|
+
this.attachProp(i, (r) => {
|
|
813
|
+
r == null ? e.removeAttribute(n) : e.setAttribute(n, String(r));
|
|
886
814
|
});
|
|
887
815
|
case "checked":
|
|
888
|
-
this.attachProp(i, (
|
|
889
|
-
e.checked =
|
|
816
|
+
this.attachProp(i, (r) => {
|
|
817
|
+
e.checked = r, r ? e.setAttribute("checked", "") : e.removeAttribute("checked");
|
|
890
818
|
});
|
|
891
819
|
break;
|
|
892
820
|
case "autocomplete":
|
|
893
821
|
case "autocapitalize":
|
|
894
|
-
this.attachProp(i, (
|
|
895
|
-
typeof
|
|
822
|
+
this.attachProp(i, (r) => {
|
|
823
|
+
typeof r == "string" ? e[n] = r : r ? e[n] = "on" : e[n] = "off";
|
|
896
824
|
});
|
|
897
825
|
break;
|
|
898
826
|
default: {
|
|
899
827
|
if (n.startsWith("prop:")) {
|
|
900
|
-
const
|
|
901
|
-
this.attachProp(i, (
|
|
902
|
-
e[
|
|
828
|
+
const r = n.substring(5);
|
|
829
|
+
this.attachProp(i, (c) => {
|
|
830
|
+
e[r] = c;
|
|
903
831
|
});
|
|
904
832
|
} else if (n.startsWith("on:")) {
|
|
905
|
-
const
|
|
906
|
-
let
|
|
907
|
-
|
|
908
|
-
|
|
833
|
+
const r = n.substring(3);
|
|
834
|
+
let c;
|
|
835
|
+
m(i) ? (e.addEventListener(r, i), this.unsubscribers.push(() => {
|
|
836
|
+
e.removeEventListener(r, i);
|
|
837
|
+
})) : this.attachProp(i, (p) => {
|
|
838
|
+
!p && c ? e.removeEventListener(r, c) : p != null && (c && c !== p && e.removeEventListener(r, c), e.addEventListener(r, p)), c = p;
|
|
909
839
|
});
|
|
910
840
|
} else if (n.startsWith("attr:")) {
|
|
911
|
-
const
|
|
912
|
-
this.attachProp(i, (
|
|
913
|
-
|
|
841
|
+
const r = n.substring(5).toLowerCase();
|
|
842
|
+
this.attachProp(i, (c) => {
|
|
843
|
+
c != null ? e.setAttribute(r, String(c)) : e.removeAttribute(r);
|
|
914
844
|
});
|
|
915
845
|
} else
|
|
916
|
-
this.attachProp(i, (
|
|
917
|
-
e[n] =
|
|
846
|
+
this.attachProp(i, (r) => {
|
|
847
|
+
e[n] = r;
|
|
918
848
|
});
|
|
919
849
|
break;
|
|
920
850
|
}
|
|
@@ -923,92 +853,143 @@ class nt {
|
|
|
923
853
|
}
|
|
924
854
|
applyStyles(e, s, n) {
|
|
925
855
|
const i = [];
|
|
926
|
-
if (
|
|
927
|
-
let
|
|
928
|
-
const
|
|
929
|
-
|
|
856
|
+
if (m(s)) {
|
|
857
|
+
let r;
|
|
858
|
+
const c = y(() => {
|
|
859
|
+
m(r) && r(), e.style.cssText = "", r = this.applyStyles(e, b(s), n);
|
|
930
860
|
});
|
|
931
|
-
n.push(
|
|
861
|
+
n.push(c), i.push(c);
|
|
932
862
|
} else {
|
|
933
|
-
const
|
|
934
|
-
for (const
|
|
935
|
-
const { value: p, priority:
|
|
936
|
-
if (
|
|
937
|
-
const
|
|
938
|
-
p
|
|
863
|
+
const r = ve(s);
|
|
864
|
+
for (const c in r) {
|
|
865
|
+
const { value: p, priority: g } = r[c];
|
|
866
|
+
if (m(p)) {
|
|
867
|
+
const o = y(() => {
|
|
868
|
+
b(p) ? e.style.setProperty(c, String(b(p)), g) : e.style.removeProperty(c);
|
|
939
869
|
});
|
|
940
|
-
n.push(
|
|
941
|
-
} else p != null && e.style.setProperty(
|
|
870
|
+
n.push(o), i.push(o);
|
|
871
|
+
} else p != null && e.style.setProperty(c, String(p));
|
|
942
872
|
}
|
|
943
873
|
}
|
|
944
874
|
return function() {
|
|
945
|
-
for (const
|
|
946
|
-
|
|
875
|
+
for (const c of i)
|
|
876
|
+
c(), n.splice(n.indexOf(c), 1);
|
|
947
877
|
};
|
|
948
878
|
}
|
|
949
879
|
applyClasses(e, s, n) {
|
|
950
880
|
const i = [];
|
|
951
|
-
if (
|
|
952
|
-
let
|
|
953
|
-
const
|
|
954
|
-
|
|
881
|
+
if (m(s)) {
|
|
882
|
+
let r;
|
|
883
|
+
const c = y(() => {
|
|
884
|
+
m(r) && r(), e.removeAttribute("class"), r = this.applyClasses(e, b(s), n);
|
|
955
885
|
});
|
|
956
|
-
n.push(
|
|
886
|
+
n.push(c), i.push(c);
|
|
957
887
|
} else {
|
|
958
|
-
const
|
|
959
|
-
for (const
|
|
960
|
-
const p =
|
|
961
|
-
if (
|
|
962
|
-
const
|
|
963
|
-
|
|
888
|
+
const r = ge(s);
|
|
889
|
+
for (const c in r) {
|
|
890
|
+
const p = r[c];
|
|
891
|
+
if (m(p)) {
|
|
892
|
+
const g = y(() => {
|
|
893
|
+
b(p) ? e.classList.add(c) : e.classList.remove(c);
|
|
964
894
|
});
|
|
965
|
-
n.push(
|
|
966
|
-
} else p && e.classList.add(
|
|
895
|
+
n.push(g), i.push(g);
|
|
896
|
+
} else p && e.classList.add(c);
|
|
967
897
|
}
|
|
968
898
|
}
|
|
969
899
|
return function() {
|
|
970
|
-
for (const
|
|
971
|
-
|
|
900
|
+
for (const c of i)
|
|
901
|
+
c(), n.splice(n.indexOf(c), 1);
|
|
972
902
|
};
|
|
973
903
|
}
|
|
974
904
|
}
|
|
975
|
-
function
|
|
905
|
+
function ge(t) {
|
|
976
906
|
let e = {};
|
|
977
|
-
if (
|
|
907
|
+
if (k(t)) {
|
|
978
908
|
const s = t.split(" ");
|
|
979
909
|
for (const n of s)
|
|
980
910
|
e[n] = !0;
|
|
981
|
-
} else
|
|
982
|
-
Object.assign(e,
|
|
911
|
+
} else R(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((s) => {
|
|
912
|
+
Object.assign(e, ge(s));
|
|
983
913
|
});
|
|
984
914
|
return delete e.undefined, e;
|
|
985
915
|
}
|
|
986
|
-
function
|
|
916
|
+
function ve(t) {
|
|
987
917
|
let e = {};
|
|
988
|
-
if (
|
|
918
|
+
if (k(t)) {
|
|
989
919
|
const s = t.split(";").filter((n) => n.trim() !== "");
|
|
990
920
|
for (const n of s) {
|
|
991
|
-
const [i,
|
|
992
|
-
value:
|
|
921
|
+
const [i, r] = n.split(":"), c = {
|
|
922
|
+
value: r
|
|
993
923
|
};
|
|
994
|
-
|
|
924
|
+
r.includes("!important") ? (c.priority = "important", c.value = r.replace("!important", "").trim()) : c.value = r.trim(), e[X(i.trim())] = c;
|
|
995
925
|
}
|
|
996
926
|
}
|
|
997
|
-
if (
|
|
927
|
+
if (R(t))
|
|
998
928
|
for (const s in t)
|
|
999
|
-
s.startsWith("--") ? e[s] = { value: t[s] } : e[
|
|
929
|
+
s.startsWith("--") ? e[s] = { value: t[s] } : e[X(s)] = { value: t[s] };
|
|
1000
930
|
else Array.isArray(t) && Array.from(t).filter((s) => s != null).forEach((s) => {
|
|
1001
|
-
Object.assign(e,
|
|
931
|
+
Object.assign(e, ve(s));
|
|
1002
932
|
});
|
|
1003
933
|
return e;
|
|
1004
934
|
}
|
|
1005
|
-
function
|
|
935
|
+
function X(t) {
|
|
1006
936
|
return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, s) => (s ? "-" : "") + e.toLowerCase());
|
|
1007
937
|
}
|
|
1008
|
-
const
|
|
1009
|
-
|
|
938
|
+
const Ve = ["ref", "children", "class", "style", "data"], Re = ["onsubmit", "onclick", "ontransitionend"];
|
|
939
|
+
var te;
|
|
940
|
+
te = x;
|
|
941
|
+
class Be {
|
|
942
|
+
constructor(e) {
|
|
943
|
+
f(this, te, !0);
|
|
944
|
+
f(this, "domNode", document.createTextNode(""));
|
|
945
|
+
f(this, "isMounted", !1);
|
|
946
|
+
f(this, "view");
|
|
947
|
+
f(this, "mountedView");
|
|
948
|
+
f(this, "unsubscribe");
|
|
949
|
+
this.view = e;
|
|
950
|
+
}
|
|
951
|
+
mount(e, s) {
|
|
952
|
+
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = y(() => {
|
|
953
|
+
const n = this.view();
|
|
954
|
+
_(() => {
|
|
955
|
+
this.update(n);
|
|
956
|
+
});
|
|
957
|
+
}));
|
|
958
|
+
}
|
|
959
|
+
unmount(e = !1) {
|
|
960
|
+
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.isMounted && (this.cleanup(e), this.isMounted = !1);
|
|
961
|
+
}
|
|
962
|
+
cleanup(e) {
|
|
963
|
+
this.mountedView && this.mountedView.unmount(e), this.mountedView = void 0;
|
|
964
|
+
}
|
|
965
|
+
update(e) {
|
|
966
|
+
this.cleanup(!1), e && (e.mount(this.domNode.parentElement, this.domNode), this.mountedView = e);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
var se;
|
|
970
|
+
se = x;
|
|
971
|
+
class Ge {
|
|
972
|
+
constructor(e) {
|
|
973
|
+
f(this, se, !0);
|
|
974
|
+
f(this, "config");
|
|
975
|
+
f(this, "element");
|
|
976
|
+
this.config = e;
|
|
977
|
+
}
|
|
978
|
+
get isMounted() {
|
|
979
|
+
return this.element ? this.element.isMounted : !1;
|
|
980
|
+
}
|
|
981
|
+
mount(e, s) {
|
|
982
|
+
const { content: n, parent: i } = this.config;
|
|
983
|
+
ye(n) ? this.element = n : this.element = A(M(this.config.elementContext, j(n))), this.element.mount(i);
|
|
984
|
+
}
|
|
985
|
+
unmount(e = !1) {
|
|
986
|
+
var s;
|
|
987
|
+
(s = this.element) != null && s.isMounted && this.element.unmount(!1);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
let ze = class {
|
|
1010
991
|
constructor(e) {
|
|
1011
|
-
|
|
992
|
+
f(this, "store");
|
|
1012
993
|
this.store = e;
|
|
1013
994
|
const s = Object.getOwnPropertyDescriptors(this.store.logger);
|
|
1014
995
|
for (const n in s)
|
|
@@ -1024,15 +1005,15 @@ let rt = class {
|
|
|
1024
1005
|
this.store.name = e, this.store.logger.setName(e);
|
|
1025
1006
|
}
|
|
1026
1007
|
get(e) {
|
|
1027
|
-
if (
|
|
1008
|
+
if (m(e)) {
|
|
1028
1009
|
let s = this.store.elementContext, n;
|
|
1029
1010
|
for (; n = s.stores.get(e), n == null && s.parent != null; )
|
|
1030
1011
|
s = s.parent;
|
|
1031
1012
|
if (n == null)
|
|
1032
|
-
throw new
|
|
1013
|
+
throw new O(`Store '${e.name}' is not provided on this context.`);
|
|
1033
1014
|
return n.value;
|
|
1034
1015
|
} else
|
|
1035
|
-
throw new
|
|
1016
|
+
throw new O("Invalid store.");
|
|
1036
1017
|
}
|
|
1037
1018
|
onMount(e) {
|
|
1038
1019
|
this.store.lifecycleListeners.mount.push(e);
|
|
@@ -1040,35 +1021,35 @@ let rt = class {
|
|
|
1040
1021
|
onUnmount(e) {
|
|
1041
1022
|
this.store.lifecycleListeners.unmount.push(e);
|
|
1042
1023
|
}
|
|
1043
|
-
effect(e
|
|
1044
|
-
const
|
|
1045
|
-
if (
|
|
1046
|
-
const
|
|
1047
|
-
return
|
|
1024
|
+
effect(e) {
|
|
1025
|
+
const s = this.store;
|
|
1026
|
+
if (s.isMounted) {
|
|
1027
|
+
const n = y(e);
|
|
1028
|
+
return s.lifecycleListeners.unmount.push(n), n;
|
|
1048
1029
|
} else {
|
|
1049
|
-
let
|
|
1050
|
-
return
|
|
1051
|
-
|
|
1030
|
+
let n, i = !1;
|
|
1031
|
+
return s.lifecycleListeners.mount.push(() => {
|
|
1032
|
+
i || (n = y(e), s.lifecycleListeners.unmount.push(n));
|
|
1052
1033
|
}), () => {
|
|
1053
|
-
|
|
1034
|
+
n != null && (i = !0, n());
|
|
1054
1035
|
};
|
|
1055
1036
|
}
|
|
1056
1037
|
}
|
|
1057
1038
|
};
|
|
1058
|
-
class
|
|
1039
|
+
class Fe {
|
|
1059
1040
|
constructor(e, s) {
|
|
1060
|
-
|
|
1061
|
-
|
|
1041
|
+
f(this, "fn");
|
|
1042
|
+
f(this, "_options");
|
|
1062
1043
|
/**
|
|
1063
1044
|
* Value is guaranteed to be set after `attach` is called.
|
|
1064
1045
|
*/
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1046
|
+
f(this, "value");
|
|
1047
|
+
f(this, "isMounted", !1);
|
|
1048
|
+
f(this, "elementContext");
|
|
1049
|
+
f(this, "lifecycleListeners", { mount: [], unmount: [] });
|
|
1050
|
+
f(this, "logger");
|
|
1051
|
+
f(this, "id", pe());
|
|
1052
|
+
f(this, "name");
|
|
1072
1053
|
this.fn = e, this.name = e.name, this._options = s;
|
|
1073
1054
|
}
|
|
1074
1055
|
/**
|
|
@@ -1079,7 +1060,7 @@ class ot {
|
|
|
1079
1060
|
if (e.stores.has(this.fn))
|
|
1080
1061
|
return !1;
|
|
1081
1062
|
this.elementContext = e, this.logger = e.root.createLogger(this.name);
|
|
1082
|
-
const s = new
|
|
1063
|
+
const s = new ze(this);
|
|
1083
1064
|
try {
|
|
1084
1065
|
this.value = this.fn.call(s, this._options, s);
|
|
1085
1066
|
} catch (n) {
|
|
@@ -1100,11 +1081,11 @@ class ot {
|
|
|
1100
1081
|
this.lifecycleListeners.unmount.length = 0;
|
|
1101
1082
|
}
|
|
1102
1083
|
}
|
|
1103
|
-
class
|
|
1084
|
+
class O extends Error {
|
|
1104
1085
|
}
|
|
1105
|
-
class
|
|
1086
|
+
class We {
|
|
1106
1087
|
constructor(e) {
|
|
1107
|
-
|
|
1088
|
+
f(this, "view");
|
|
1108
1089
|
this.view = e;
|
|
1109
1090
|
const s = Object.getOwnPropertyDescriptors(this.view.logger);
|
|
1110
1091
|
for (const n in s)
|
|
@@ -1123,7 +1104,7 @@ class ut {
|
|
|
1123
1104
|
this.view.elementContext.viewName = e, this.view.logger.setName(e);
|
|
1124
1105
|
}
|
|
1125
1106
|
provide(e, s) {
|
|
1126
|
-
const n = new
|
|
1107
|
+
const n = new Fe(e, s);
|
|
1127
1108
|
if (n.attach(this.view.elementContext))
|
|
1128
1109
|
return this.view.lifecycleListeners.mount.push(() => {
|
|
1129
1110
|
n.handleMount();
|
|
@@ -1131,20 +1112,20 @@ class ut {
|
|
|
1131
1112
|
n.handleUnmount();
|
|
1132
1113
|
}), n.value;
|
|
1133
1114
|
{
|
|
1134
|
-
let
|
|
1135
|
-
return this.view.logger.warn(`An instance of ${
|
|
1115
|
+
let r = e.name ? `'${e.name}'` : "this store";
|
|
1116
|
+
return this.view.logger.warn(`An instance of ${r} was already attached to this context.`), this.get(e);
|
|
1136
1117
|
}
|
|
1137
1118
|
}
|
|
1138
1119
|
get(e) {
|
|
1139
|
-
if (
|
|
1120
|
+
if (m(e)) {
|
|
1140
1121
|
let s = this.view.elementContext, n;
|
|
1141
1122
|
for (; n = s.stores.get(e), n == null && s.parent != null; )
|
|
1142
1123
|
s = s.parent;
|
|
1143
1124
|
if (n == null)
|
|
1144
|
-
throw new
|
|
1125
|
+
throw new O(`Store '${e.name}' is not provided on this context.`);
|
|
1145
1126
|
return n.value;
|
|
1146
1127
|
} else
|
|
1147
|
-
throw new
|
|
1128
|
+
throw new O("Invalid store.");
|
|
1148
1129
|
}
|
|
1149
1130
|
beforeMount(e) {
|
|
1150
1131
|
this.view.lifecycleListeners.beforeMount.push(e);
|
|
@@ -1158,42 +1139,42 @@ class ut {
|
|
|
1158
1139
|
onUnmount(e) {
|
|
1159
1140
|
this.view.lifecycleListeners.unmount.push(e);
|
|
1160
1141
|
}
|
|
1161
|
-
effect(e
|
|
1142
|
+
effect(e) {
|
|
1162
1143
|
if (this.view.isMounted) {
|
|
1163
|
-
const
|
|
1164
|
-
return this.view.lifecycleListeners.unmount.push(
|
|
1144
|
+
const s = y(e);
|
|
1145
|
+
return this.view.lifecycleListeners.unmount.push(s), s;
|
|
1165
1146
|
} else {
|
|
1166
|
-
let
|
|
1147
|
+
let s, n = !1;
|
|
1167
1148
|
return this.view.lifecycleListeners.mount.push(() => {
|
|
1168
|
-
|
|
1149
|
+
n || (s = y(e), this.view.lifecycleListeners.unmount.push(s));
|
|
1169
1150
|
}), () => {
|
|
1170
|
-
|
|
1151
|
+
s != null && (n = !0, s());
|
|
1171
1152
|
};
|
|
1172
1153
|
}
|
|
1173
1154
|
}
|
|
1174
1155
|
outlet() {
|
|
1175
|
-
return
|
|
1156
|
+
return N("$outlet", { view: this.view.elementContext.route });
|
|
1176
1157
|
}
|
|
1177
1158
|
}
|
|
1178
|
-
var
|
|
1179
|
-
|
|
1180
|
-
const
|
|
1159
|
+
var ne;
|
|
1160
|
+
ne = x;
|
|
1161
|
+
const F = class F {
|
|
1181
1162
|
constructor(e, s, n, i) {
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1163
|
+
f(this, ne, !0);
|
|
1164
|
+
f(this, "uniqueId", pe());
|
|
1165
|
+
f(this, "elementContext");
|
|
1166
|
+
f(this, "logger");
|
|
1167
|
+
f(this, "props");
|
|
1168
|
+
f(this, "fn");
|
|
1169
|
+
f(this, "element");
|
|
1170
|
+
f(this, "lifecycleListeners", { beforeMount: [], mount: [], beforeUnmount: [], unmount: [] });
|
|
1171
|
+
f(this, "isMounted", !1);
|
|
1191
1172
|
this.elementContext = {
|
|
1192
1173
|
...e,
|
|
1193
1174
|
parent: e,
|
|
1194
1175
|
viewName: s.name,
|
|
1195
1176
|
stores: /* @__PURE__ */ new Map(),
|
|
1196
|
-
route:
|
|
1177
|
+
route: D()
|
|
1197
1178
|
}, this.logger = e.root.createLogger(s.name || "🌇 anonymous view", { uid: this.uniqueId }), this.props = {
|
|
1198
1179
|
...n,
|
|
1199
1180
|
children: i
|
|
@@ -1227,14 +1208,14 @@ const oe = class oe {
|
|
|
1227
1208
|
this.lifecycleListeners.beforeMount.length = 0, this.lifecycleListeners.mount.length = 0, this.lifecycleListeners.beforeUnmount.length = 0, this.lifecycleListeners.unmount.length = 0;
|
|
1228
1209
|
}
|
|
1229
1210
|
setRouteView(e) {
|
|
1230
|
-
const s = new
|
|
1231
|
-
return this.elementContext.route
|
|
1211
|
+
const s = new F(this.elementContext, e, {});
|
|
1212
|
+
return this.elementContext.route(s), s;
|
|
1232
1213
|
}
|
|
1233
1214
|
/*===============================*\
|
|
1234
1215
|
|| Internal ||
|
|
1235
1216
|
\*===============================*/
|
|
1236
1217
|
_initialize() {
|
|
1237
|
-
const e = new
|
|
1218
|
+
const e = new We(this);
|
|
1238
1219
|
let s;
|
|
1239
1220
|
try {
|
|
1240
1221
|
s = this.fn.call(e, this.props, e);
|
|
@@ -1242,43 +1223,43 @@ const oe = class oe {
|
|
|
1242
1223
|
throw n instanceof Error && this.logger.crash(n), n;
|
|
1243
1224
|
}
|
|
1244
1225
|
if (s !== null) if (s instanceof Node)
|
|
1245
|
-
this.element =
|
|
1246
|
-
else if (
|
|
1247
|
-
this.element =
|
|
1248
|
-
|
|
1226
|
+
this.element = A(M(this.elementContext, N("$node", { value: s })));
|
|
1227
|
+
else if (m(s))
|
|
1228
|
+
this.element = A(
|
|
1229
|
+
M(this.elementContext, N("$dynamic", { source: s }))
|
|
1249
1230
|
);
|
|
1250
|
-
else if (
|
|
1251
|
-
this.element =
|
|
1231
|
+
else if ($(s) || V($, s))
|
|
1232
|
+
this.element = A(M(this.elementContext, s));
|
|
1252
1233
|
else {
|
|
1253
1234
|
const n = new TypeError(
|
|
1254
|
-
`Expected '${this.fn.name}' function to return a DOM node, Markup element,
|
|
1235
|
+
`Expected '${this.fn.name}' function to return a DOM node, Markup element, Signal or null. Got: ${T(s)}`
|
|
1255
1236
|
);
|
|
1256
1237
|
this.logger.crash(n);
|
|
1257
1238
|
}
|
|
1258
1239
|
}
|
|
1259
1240
|
};
|
|
1260
|
-
let
|
|
1261
|
-
var
|
|
1262
|
-
|
|
1263
|
-
class
|
|
1241
|
+
let P = F;
|
|
1242
|
+
var ie;
|
|
1243
|
+
ie = x;
|
|
1244
|
+
class Ze {
|
|
1264
1245
|
constructor({ elementContext: e, items: s, renderFn: n, keyFn: i }) {
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1246
|
+
f(this, ie, !0);
|
|
1247
|
+
f(this, "domNode", document.createTextNode(""));
|
|
1248
|
+
f(this, "items");
|
|
1249
|
+
f(this, "unsubscribe", null);
|
|
1250
|
+
f(this, "connectedItems", []);
|
|
1251
|
+
f(this, "elementContext");
|
|
1252
|
+
f(this, "renderFn");
|
|
1253
|
+
f(this, "keyFn");
|
|
1273
1254
|
this.elementContext = e, this.items = s, this.renderFn = n, this.keyFn = i;
|
|
1274
1255
|
}
|
|
1275
1256
|
get isMounted() {
|
|
1276
1257
|
return this.domNode.parentNode != null;
|
|
1277
1258
|
}
|
|
1278
1259
|
mount(e, s) {
|
|
1279
|
-
this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe =
|
|
1280
|
-
let n = this.items
|
|
1281
|
-
n == null && (n = [], console.log("
|
|
1260
|
+
this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = y(() => {
|
|
1261
|
+
let n = this.items();
|
|
1262
|
+
n == null && (n = [], console.log("repeat received empty value", n, this)), _(() => {
|
|
1282
1263
|
this._update(Array.from(n));
|
|
1283
1264
|
});
|
|
1284
1265
|
}));
|
|
@@ -1293,197 +1274,126 @@ class ct {
|
|
|
1293
1274
|
this.connectedItems = [];
|
|
1294
1275
|
}
|
|
1295
1276
|
_update(e) {
|
|
1296
|
-
var
|
|
1277
|
+
var c, p, g;
|
|
1297
1278
|
if (e.length === 0 || !this.isMounted)
|
|
1298
1279
|
return this._cleanup(!1);
|
|
1299
1280
|
const s = [];
|
|
1300
1281
|
let n = 0;
|
|
1301
|
-
for (const
|
|
1282
|
+
for (const o of e)
|
|
1302
1283
|
s.push({
|
|
1303
|
-
key: this.keyFn(
|
|
1304
|
-
value:
|
|
1284
|
+
key: this.keyFn(o, n),
|
|
1285
|
+
value: o,
|
|
1305
1286
|
index: n++
|
|
1306
1287
|
});
|
|
1307
1288
|
const i = [];
|
|
1308
|
-
for (const
|
|
1309
|
-
s.find((l) => l.key ===
|
|
1310
|
-
for (const
|
|
1311
|
-
const u = this.connectedItems.find((l) => l.key ===
|
|
1289
|
+
for (const o of this.connectedItems)
|
|
1290
|
+
s.find((l) => l.key === o.key) || o.element.unmount(!1);
|
|
1291
|
+
for (const o of s) {
|
|
1292
|
+
const u = this.connectedItems.find((l) => l.key === o.key);
|
|
1312
1293
|
if (u)
|
|
1313
|
-
u.item
|
|
1294
|
+
u.item(o.value), u.index(o.index), i[o.index] = u;
|
|
1314
1295
|
else {
|
|
1315
|
-
const l =
|
|
1316
|
-
i[
|
|
1317
|
-
key:
|
|
1296
|
+
const l = D(o.value, { equals: C }), d = D(o.index);
|
|
1297
|
+
i[o.index] = {
|
|
1298
|
+
key: o.key,
|
|
1318
1299
|
item: l,
|
|
1319
1300
|
index: d,
|
|
1320
|
-
element: new
|
|
1321
|
-
item:
|
|
1322
|
-
index: d,
|
|
1301
|
+
element: new P(this.elementContext, He, {
|
|
1302
|
+
item: () => l(),
|
|
1303
|
+
index: () => d(),
|
|
1323
1304
|
renderFn: this.renderFn
|
|
1324
1305
|
})
|
|
1325
1306
|
};
|
|
1326
1307
|
}
|
|
1327
1308
|
}
|
|
1328
|
-
for (let
|
|
1329
|
-
const u = i[
|
|
1309
|
+
for (let o = 0; o < i.length; o++) {
|
|
1310
|
+
const u = i[o], l = ((c = i[o - 1]) == null ? void 0 : c.element.domNode) ?? this.domNode;
|
|
1330
1311
|
u.element.mount(this.domNode.parentNode, l);
|
|
1331
1312
|
}
|
|
1332
1313
|
this.connectedItems = i;
|
|
1333
|
-
const
|
|
1334
|
-
(
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
function ft(t, e) {
|
|
1338
|
-
return e.name = "@ListItem", t.renderFn.call(e, t.item, t.index, e);
|
|
1339
|
-
}
|
|
1340
|
-
var ye;
|
|
1341
|
-
ye = S;
|
|
1342
|
-
class $e {
|
|
1343
|
-
constructor(e) {
|
|
1344
|
-
c(this, ye, !0);
|
|
1345
|
-
c(this, "domNode", document.createTextNode(""));
|
|
1346
|
-
c(this, "isMounted", !1);
|
|
1347
|
-
c(this, "source");
|
|
1348
|
-
c(this, "elements", []);
|
|
1349
|
-
c(this, "unsubscribe");
|
|
1350
|
-
this.source = e;
|
|
1351
|
-
}
|
|
1352
|
-
mount(e, s) {
|
|
1353
|
-
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), v(this.source) ? this.unsubscribe = w(() => {
|
|
1354
|
-
const n = I(this.source);
|
|
1355
|
-
Z(() => {
|
|
1356
|
-
this.update(n);
|
|
1357
|
-
});
|
|
1358
|
-
}) : this.update(this.elements));
|
|
1359
|
-
}
|
|
1360
|
-
unmount(e = !1) {
|
|
1361
|
-
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.isMounted && (this.cleanup(e), this.isMounted = !1);
|
|
1362
|
-
}
|
|
1363
|
-
cleanup(e) {
|
|
1364
|
-
for (const s of this.elements)
|
|
1365
|
-
s.unmount(e);
|
|
1366
|
-
this.elements = [];
|
|
1367
|
-
}
|
|
1368
|
-
update(e) {
|
|
1369
|
-
var s, n;
|
|
1370
|
-
if (this.cleanup(!1), e.length > 0) {
|
|
1371
|
-
for (let i = 0; i < e.length; i++) {
|
|
1372
|
-
const o = e[i], f = i > 0 ? this.elements[i - 1] : void 0;
|
|
1373
|
-
o.mount(this.domNode.parentElement, f == null ? void 0 : f.domNode), this.elements.push(o);
|
|
1374
|
-
}
|
|
1375
|
-
(n = this.domNode.parentNode) == null || n.insertBefore(this.domNode, ((s = this.elements.at(-1)) == null ? void 0 : s.domNode) ?? null);
|
|
1376
|
-
}
|
|
1314
|
+
const r = ((p = i.at(-1)) == null ? void 0 : p.element.domNode) ?? this.domNode;
|
|
1315
|
+
(g = this.domNode.parentNode) == null || g.insertBefore(this.domNode, r.nextSibling);
|
|
1377
1316
|
}
|
|
1378
1317
|
}
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
class lt {
|
|
1382
|
-
constructor(e) {
|
|
1383
|
-
c(this, ve, !0);
|
|
1384
|
-
c(this, "config");
|
|
1385
|
-
c(this, "element");
|
|
1386
|
-
this.config = e;
|
|
1387
|
-
}
|
|
1388
|
-
get isMounted() {
|
|
1389
|
-
return this.element ? this.element.isMounted : !1;
|
|
1390
|
-
}
|
|
1391
|
-
mount(e, s) {
|
|
1392
|
-
const { content: n, parent: i } = this.config;
|
|
1393
|
-
Pe(n) ? this.element = n : this.element = B($(this.config.elementContext, re(n))), this.element.mount(i);
|
|
1394
|
-
}
|
|
1395
|
-
unmount(e = !1) {
|
|
1396
|
-
var s;
|
|
1397
|
-
(s = this.element) != null && s.isMounted && this.element.unmount(!1);
|
|
1398
|
-
}
|
|
1318
|
+
function He(t, e) {
|
|
1319
|
+
return e.name = "@RepeatItem", t.renderFn.call(e, t.item, t.index, e);
|
|
1399
1320
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
class at {
|
|
1403
|
-
constructor(e) {
|
|
1404
|
-
c(this, we, !0);
|
|
1405
|
-
c(this, "domNode", document.createTextNode(""));
|
|
1406
|
-
c(this, "isMounted", !1);
|
|
1407
|
-
c(this, "view");
|
|
1408
|
-
c(this, "mountedView");
|
|
1409
|
-
c(this, "unsubscribe");
|
|
1410
|
-
this.view = e;
|
|
1411
|
-
}
|
|
1412
|
-
mount(e, s) {
|
|
1413
|
-
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = w(() => {
|
|
1414
|
-
const n = this.view.get();
|
|
1415
|
-
Z(() => {
|
|
1416
|
-
this.update(n);
|
|
1417
|
-
});
|
|
1418
|
-
}));
|
|
1419
|
-
}
|
|
1420
|
-
unmount(e = !1) {
|
|
1421
|
-
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.isMounted && (this.cleanup(e), this.isMounted = !1);
|
|
1422
|
-
}
|
|
1423
|
-
cleanup(e) {
|
|
1424
|
-
this.mountedView && this.mountedView.unmount(e), this.mountedView = void 0;
|
|
1425
|
-
}
|
|
1426
|
-
update(e) {
|
|
1427
|
-
this.cleanup(!1), e && (e.mount(this.domNode.parentElement, this.domNode), this.mountedView = e);
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
function F(t) {
|
|
1431
|
-
return t instanceof Oe;
|
|
1321
|
+
function $(t) {
|
|
1322
|
+
return t instanceof be;
|
|
1432
1323
|
}
|
|
1433
|
-
function
|
|
1434
|
-
return (t == null ? void 0 : t[
|
|
1324
|
+
function ye(t) {
|
|
1325
|
+
return (t == null ? void 0 : t[x]) === !0;
|
|
1435
1326
|
}
|
|
1436
|
-
function
|
|
1437
|
-
|
|
1327
|
+
function j(t) {
|
|
1328
|
+
L(t) || (t = [t]);
|
|
1329
|
+
const e = [];
|
|
1330
|
+
for (const s of t)
|
|
1331
|
+
if (!(s == null || s === !1)) {
|
|
1332
|
+
if (s instanceof Node) {
|
|
1333
|
+
e.push(N("$node", { value: s }));
|
|
1334
|
+
continue;
|
|
1335
|
+
}
|
|
1336
|
+
if ($(s)) {
|
|
1337
|
+
e.push(s);
|
|
1338
|
+
continue;
|
|
1339
|
+
}
|
|
1340
|
+
if (m(s)) {
|
|
1341
|
+
e.push(N("$dynamic", { source: s }));
|
|
1342
|
+
continue;
|
|
1343
|
+
}
|
|
1344
|
+
if (L(s)) {
|
|
1345
|
+
e.push(...j(s));
|
|
1346
|
+
continue;
|
|
1347
|
+
}
|
|
1348
|
+
e.push(N("$text", { value: s }));
|
|
1349
|
+
}
|
|
1350
|
+
return e;
|
|
1438
1351
|
}
|
|
1439
|
-
function
|
|
1440
|
-
return new
|
|
1352
|
+
function N(t, e, ...s) {
|
|
1353
|
+
return new be(t, e, ...s);
|
|
1441
1354
|
}
|
|
1442
|
-
class
|
|
1355
|
+
class be {
|
|
1443
1356
|
constructor(e, s, ...n) {
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1357
|
+
f(this, "type");
|
|
1358
|
+
f(this, "props");
|
|
1359
|
+
f(this, "children");
|
|
1447
1360
|
this.type = e, this.props = s, this.children = n;
|
|
1448
1361
|
}
|
|
1449
1362
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return
|
|
1452
|
-
source:
|
|
1453
|
-
const n =
|
|
1363
|
+
function Ke(t, e, s) {
|
|
1364
|
+
return N("$dynamic", {
|
|
1365
|
+
source: D(() => {
|
|
1366
|
+
const n = b(t);
|
|
1454
1367
|
return n && e ? e : !n && s ? s : null;
|
|
1455
1368
|
})
|
|
1456
1369
|
});
|
|
1457
1370
|
}
|
|
1458
|
-
function
|
|
1459
|
-
return
|
|
1460
|
-
}
|
|
1461
|
-
function Dt(t, e, s) {
|
|
1462
|
-
return Ie(t, s, e);
|
|
1371
|
+
function dt(t, e, s) {
|
|
1372
|
+
return Ke(t, s, e);
|
|
1463
1373
|
}
|
|
1464
|
-
function
|
|
1465
|
-
return
|
|
1374
|
+
function ht(t, e, s) {
|
|
1375
|
+
return N("$repeat", { items: () => b(t), keyFn: e, renderFn: s });
|
|
1466
1376
|
}
|
|
1467
|
-
function
|
|
1468
|
-
return
|
|
1377
|
+
function pt(t, e) {
|
|
1378
|
+
return N("$portal", { parent: t, content: e });
|
|
1469
1379
|
}
|
|
1470
|
-
function
|
|
1471
|
-
return (
|
|
1380
|
+
function M(t, e) {
|
|
1381
|
+
return (L(e) ? e : [e]).map((n) => {
|
|
1382
|
+
if (m(n.type))
|
|
1383
|
+
return new P(t, n.type, n.props, n.children);
|
|
1472
1384
|
if (k(n.type))
|
|
1473
|
-
return new z(t, n.type, n.props, n.children);
|
|
1474
|
-
if (O(n.type))
|
|
1475
1385
|
switch (n.type) {
|
|
1476
1386
|
case "$node": {
|
|
1477
1387
|
const i = n.props;
|
|
1478
|
-
return new
|
|
1388
|
+
return new K(i.value);
|
|
1479
1389
|
}
|
|
1480
1390
|
case "$text": {
|
|
1481
1391
|
const i = n.props;
|
|
1482
|
-
return new
|
|
1392
|
+
return new K(document.createTextNode(String(i.value)));
|
|
1483
1393
|
}
|
|
1484
|
-
case "$
|
|
1394
|
+
case "$repeat": {
|
|
1485
1395
|
const i = n.props;
|
|
1486
|
-
return new
|
|
1396
|
+
return new Ze({
|
|
1487
1397
|
items: i.items,
|
|
1488
1398
|
keyFn: i.keyFn,
|
|
1489
1399
|
renderFn: i.renderFn,
|
|
@@ -1492,31 +1402,29 @@ function $(t, e) {
|
|
|
1492
1402
|
}
|
|
1493
1403
|
case "$dynamic": {
|
|
1494
1404
|
const i = n.props;
|
|
1495
|
-
return new
|
|
1405
|
+
return new je({
|
|
1496
1406
|
source: i.source,
|
|
1497
1407
|
elementContext: t
|
|
1498
1408
|
});
|
|
1499
1409
|
}
|
|
1500
1410
|
case "$fragment": {
|
|
1501
1411
|
const i = n.props;
|
|
1502
|
-
return new
|
|
1412
|
+
return new me(i.children);
|
|
1503
1413
|
}
|
|
1504
1414
|
case "$outlet": {
|
|
1505
1415
|
const i = n.props;
|
|
1506
|
-
return new
|
|
1416
|
+
return new Be(i.view);
|
|
1507
1417
|
}
|
|
1508
1418
|
case "$portal": {
|
|
1509
1419
|
const i = n.props;
|
|
1510
|
-
return new
|
|
1420
|
+
return new Ge({
|
|
1511
1421
|
content: i.content,
|
|
1512
1422
|
parent: i.parent,
|
|
1513
1423
|
elementContext: t
|
|
1514
1424
|
});
|
|
1515
1425
|
}
|
|
1516
1426
|
default:
|
|
1517
|
-
|
|
1518
|
-
throw new Error(`Unknown markup type: ${n.type}`);
|
|
1519
|
-
return new nt({
|
|
1427
|
+
return new Ue({
|
|
1520
1428
|
tag: n.type,
|
|
1521
1429
|
props: n.props ?? {},
|
|
1522
1430
|
children: n.children,
|
|
@@ -1527,46 +1435,42 @@ function $(t, e) {
|
|
|
1527
1435
|
throw new TypeError(`Expected a string or view function. Got: ${n.type}`);
|
|
1528
1436
|
});
|
|
1529
1437
|
}
|
|
1530
|
-
function
|
|
1531
|
-
return t.length === 1 ? t[0] : new
|
|
1438
|
+
function A(t) {
|
|
1439
|
+
return t.length === 1 ? t[0] : new me(t);
|
|
1532
1440
|
}
|
|
1533
|
-
function
|
|
1534
|
-
return t == null || t === !1 ||
|
|
1441
|
+
function we(t) {
|
|
1442
|
+
return t == null || t === !1 || m(t) || k(t) || Le(t) || $(t) || V(we, t);
|
|
1535
1443
|
}
|
|
1536
1444
|
export {
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
B as p,
|
|
1561
|
-
$ as q,
|
|
1562
|
-
St as r,
|
|
1563
|
-
Mt as s,
|
|
1445
|
+
D as $,
|
|
1446
|
+
lt as I,
|
|
1447
|
+
Fe as S,
|
|
1448
|
+
P as V,
|
|
1449
|
+
tt as a,
|
|
1450
|
+
st as b,
|
|
1451
|
+
it as c,
|
|
1452
|
+
L as d,
|
|
1453
|
+
R as e,
|
|
1454
|
+
k as f,
|
|
1455
|
+
C as g,
|
|
1456
|
+
b as h,
|
|
1457
|
+
m as i,
|
|
1458
|
+
ft as j,
|
|
1459
|
+
O as k,
|
|
1460
|
+
nt as l,
|
|
1461
|
+
N as m,
|
|
1462
|
+
A as n,
|
|
1463
|
+
M as o,
|
|
1464
|
+
_ as p,
|
|
1465
|
+
ot as q,
|
|
1466
|
+
ct as r,
|
|
1467
|
+
ut as s,
|
|
1564
1468
|
T as t,
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1469
|
+
y as u,
|
|
1470
|
+
rt as v,
|
|
1471
|
+
Ke as w,
|
|
1472
|
+
pt as x,
|
|
1473
|
+
ht as y,
|
|
1474
|
+
dt as z
|
|
1571
1475
|
};
|
|
1572
|
-
//# sourceMappingURL=markup-
|
|
1476
|
+
//# sourceMappingURL=markup-D67RWnAp.js.map
|