keits 0.0.2 → 0.0.4

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.
Files changed (63) hide show
  1. package/dist/dev/api.js +270 -0
  2. package/dist/dev/forms.js +328 -0
  3. package/dist/dev/index.js +290 -294
  4. package/dist/dev/router.js +445 -0
  5. package/dist/dev/shared/computed-3UO-KiH1.js +40 -0
  6. package/dist/dev/shared/element-CQPqagu1.js +222 -0
  7. package/dist/dev/shared/graph-D6-x_CWC.js +324 -0
  8. package/dist/dev/shared/owner-Dmge21OW.js +62 -0
  9. package/dist/dev/shared/render-effect-kOGnLNbL.js +26 -0
  10. package/dist/dev/shared/resource-CbXVATvq.js +154 -0
  11. package/dist/dev/shared/signal-BOXkY-Iv.js +24 -0
  12. package/dist/dev/shared/store-BzUN1qE5.js +148 -0
  13. package/dist/dev/svg.js +1 -1
  14. package/dist/prod/api.js +210 -0
  15. package/dist/prod/forms.js +237 -0
  16. package/dist/prod/index.js +209 -234
  17. package/dist/prod/router.js +345 -0
  18. package/dist/prod/shared/computed-CAPpOLCY.js +33 -0
  19. package/dist/prod/shared/element-DGyQ01Vs.js +164 -0
  20. package/dist/prod/shared/graph-C_aA46c6.js +240 -0
  21. package/dist/prod/shared/owner-6BFHIPR9.js +59 -0
  22. package/dist/prod/shared/render-effect-DjaUT3Cn.js +23 -0
  23. package/dist/prod/shared/resource-CNC2DBO3.js +109 -0
  24. package/dist/prod/shared/signal-DGrl3r9T.js +16 -0
  25. package/dist/prod/shared/store-Dcscpk_h.js +109 -0
  26. package/dist/prod/svg.js +1 -1
  27. package/dist/types/api/cache.d.ts +16 -0
  28. package/dist/types/api/client.d.ts +42 -0
  29. package/dist/types/api/error.d.ts +16 -0
  30. package/dist/types/api/index.d.ts +3 -0
  31. package/dist/types/api/url.d.ts +5 -0
  32. package/dist/types/async/index.d.ts +2 -0
  33. package/dist/types/async/lazy.d.ts +7 -0
  34. package/dist/types/async/resource.d.ts +23 -0
  35. package/dist/types/async/suspense-context.d.ts +4 -0
  36. package/dist/types/core/graph.d.ts +8 -0
  37. package/dist/types/dom/types.d.ts +1 -1
  38. package/dist/types/flow/catch.d.ts +2 -0
  39. package/dist/types/flow/dynamic.d.ts +6 -0
  40. package/dist/types/flow/for.d.ts +7 -0
  41. package/dist/types/flow/if.d.ts +4 -0
  42. package/dist/types/flow/index.d.ts +8 -0
  43. package/dist/types/flow/portal.d.ts +2 -0
  44. package/dist/types/flow/range.d.ts +11 -0
  45. package/dist/types/flow/show.d.ts +1 -0
  46. package/dist/types/flow/suspense.d.ts +2 -0
  47. package/dist/types/flow/switch.d.ts +9 -0
  48. package/dist/types/forms/form.d.ts +55 -0
  49. package/dist/types/forms/index.d.ts +2 -0
  50. package/dist/types/forms/paths.d.ts +6 -0
  51. package/dist/types/forms/types.d.ts +38 -0
  52. package/dist/types/index.d.ts +2 -0
  53. package/dist/types/router/history.d.ts +21 -0
  54. package/dist/types/router/index.d.ts +3 -0
  55. package/dist/types/router/links.d.ts +1 -0
  56. package/dist/types/router/match.d.ts +15 -0
  57. package/dist/types/router/router.d.ts +10 -0
  58. package/dist/types/router/scroll.d.ts +5 -0
  59. package/dist/types/router/types.d.ts +87 -0
  60. package/dist/types/svg/types.d.ts +1 -1
  61. package/package.json +37 -6
  62. package/dist/dev/shared/element-By0uLZli.js +0 -544
  63. package/dist/prod/shared/element-C8c5hIhH.js +0 -394
@@ -1,258 +1,233 @@
1
- import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, s as m, u as h, v as g, x as _, y as v } from "./shared/element-C8c5hIhH.js";
2
- // src/core/signal.ts
3
- function y(e, t) {
4
- let n = {
5
- kind: 0,
6
- value: e,
7
- equals: t?.equals ?? Object.is,
8
- observers: [],
9
- seenBy: 0
10
- };
11
- return Object.assign(() => (g(n), n.value), { set: (e) => {
12
- let t = typeof e == "function" ? e(n.value) : e;
13
- n.equals !== !1 && n.equals(n.value, t) || (n.value = t, o(n));
14
- } });
15
- }
16
- // src/core/computed.ts
17
- function b(e, t) {
18
- let r = {
19
- kind: 2,
20
- fn: e,
21
- value: void 0,
22
- equals: t?.equals ?? Object.is,
23
- hasValue: !1,
24
- hasError: !1,
25
- error: void 0,
26
- computing: !1,
27
- state: 2,
28
- sources: [],
29
- observers: [],
30
- seenBy: 0,
31
- flushId: 0,
32
- flushRuns: 0,
33
- owner: null,
34
- children: null,
35
- cleanups: null,
36
- disposed: !1
37
- };
38
- return l(r), () => {
39
- if (r.computing) throw x(r);
40
- if (r.state !== 0 && n(r), g(r), r.hasError) throw r.error;
41
- return r.value;
42
- };
43
- }
44
- function x(e) {
45
- return /* @__PURE__ */ Error("[keits] cycle detected");
46
- }
1
+ import { t as e } from "./shared/signal-DGrl3r9T.js";
2
+ import { n as t, t as n } from "./shared/render-effect-DjaUT3Cn.js";
3
+ import { t as r } from "./shared/computed-CAPpOLCY.js";
4
+ import { a as i, h as a, i as o, l as s, t as c } from "./shared/graph-C_aA46c6.js";
5
+ import { a as l, i as u, n as d, o as f, r as p, s as m, t as h } from "./shared/owner-6BFHIPR9.js";
6
+ import { a as g, i as _, n as ee, r as v, t as y } from "./shared/resource-CNC2DBO3.js";
7
+ import { n as te, r as ne, t as re } from "./shared/store-Dcscpk_h.js";
8
+ import { a as b, i as x, n as S } from "./shared/element-DGyQ01Vs.js";
47
9
  // src/core/env.ts
48
- var S = typeof window > "u";
49
- // src/core/owner.ts
50
- function C() {
51
- return a();
52
- }
53
- function w(t, n) {
54
- return e(t, n);
55
- }
56
- function T(t) {
57
- let n = {
58
- kind: 3,
59
- owner: a(),
60
- children: null,
61
- cleanups: null,
62
- disposed: !1,
63
- handler: null
64
- }, r = () => h(() => i(n));
65
- return h(() => {
66
- try {
67
- return e(n, () => t(r));
68
- } catch (e) {
69
- throw i(n), e;
10
+ var ie = typeof window > "u", C = /* @__PURE__ */ S("a"), w = /* @__PURE__ */ S("abbr"), T = /* @__PURE__ */ S("address"), E = /* @__PURE__ */ S("area"), D = /* @__PURE__ */ S("article"), O = /* @__PURE__ */ S("aside"), k = /* @__PURE__ */ S("audio"), A = /* @__PURE__ */ S("b"), j = /* @__PURE__ */ S("base"), M = /* @__PURE__ */ S("bdi"), N = /* @__PURE__ */ S("bdo"), P = /* @__PURE__ */ S("blockquote"), F = /* @__PURE__ */ S("body"), I = /* @__PURE__ */ S("br"), L = /* @__PURE__ */ S("button"), R = /* @__PURE__ */ S("canvas"), z = /* @__PURE__ */ S("caption"), B = /* @__PURE__ */ S("cite"), V = /* @__PURE__ */ S("code"), H = /* @__PURE__ */ S("col"), U = /* @__PURE__ */ S("colgroup"), W = /* @__PURE__ */ S("data"), G = /* @__PURE__ */ S("datalist"), K = /* @__PURE__ */ S("dd"), q = /* @__PURE__ */ S("del"), J = /* @__PURE__ */ S("details"), Y = /* @__PURE__ */ S("dfn"), ae = /* @__PURE__ */ S("dialog"), oe = /* @__PURE__ */ S("div"), se = /* @__PURE__ */ S("dl"), ce = /* @__PURE__ */ S("dt"), le = /* @__PURE__ */ S("em"), ue = /* @__PURE__ */ S("embed"), de = /* @__PURE__ */ S("fieldset"), fe = /* @__PURE__ */ S("figcaption"), pe = /* @__PURE__ */ S("figure"), me = /* @__PURE__ */ S("footer"), he = /* @__PURE__ */ S("form"), ge = /* @__PURE__ */ S("h1"), _e = /* @__PURE__ */ S("h2"), ve = /* @__PURE__ */ S("h3"), ye = /* @__PURE__ */ S("h4"), be = /* @__PURE__ */ S("h5"), xe = /* @__PURE__ */ S("h6"), Se = /* @__PURE__ */ S("head"), Ce = /* @__PURE__ */ S("header"), we = /* @__PURE__ */ S("hgroup"), Te = /* @__PURE__ */ S("hr"), Ee = /* @__PURE__ */ S("html"), De = /* @__PURE__ */ S("i"), Oe = /* @__PURE__ */ S("iframe"), ke = /* @__PURE__ */ S("img"), Ae = /* @__PURE__ */ S("input"), je = /* @__PURE__ */ S("ins"), Me = /* @__PURE__ */ S("kbd"), Ne = /* @__PURE__ */ S("label"), Pe = /* @__PURE__ */ S("legend"), Fe = /* @__PURE__ */ S("li"), Ie = /* @__PURE__ */ S("link"), Le = /* @__PURE__ */ S("main"), Re = /* @__PURE__ */ S("map"), ze = /* @__PURE__ */ S("mark"), Be = /* @__PURE__ */ S("menu"), Ve = /* @__PURE__ */ S("meta"), He = /* @__PURE__ */ S("meter"), Ue = /* @__PURE__ */ S("nav"), We = /* @__PURE__ */ S("noscript"), Ge = /* @__PURE__ */ S("object"), Ke = /* @__PURE__ */ S("ol"), qe = /* @__PURE__ */ S("optgroup"), Je = /* @__PURE__ */ S("option"), Ye = /* @__PURE__ */ S("output"), Xe = /* @__PURE__ */ S("p"), Ze = /* @__PURE__ */ S("picture"), Qe = /* @__PURE__ */ S("pre"), $e = /* @__PURE__ */ S("progress"), et = /* @__PURE__ */ S("q"), tt = /* @__PURE__ */ S("rp"), nt = /* @__PURE__ */ S("rt"), rt = /* @__PURE__ */ S("ruby"), it = /* @__PURE__ */ S("s"), at = /* @__PURE__ */ S("samp"), ot = /* @__PURE__ */ S("script"), st = /* @__PURE__ */ S("search"), ct = /* @__PURE__ */ S("section"), lt = /* @__PURE__ */ S("select"), ut = /* @__PURE__ */ S("slot"), dt = /* @__PURE__ */ S("small"), ft = /* @__PURE__ */ S("source"), pt = /* @__PURE__ */ S("span"), mt = /* @__PURE__ */ S("strong"), ht = /* @__PURE__ */ S("style"), gt = /* @__PURE__ */ S("sub"), _t = /* @__PURE__ */ S("summary"), vt = /* @__PURE__ */ S("sup"), yt = /* @__PURE__ */ S("table"), bt = /* @__PURE__ */ S("tbody"), xt = /* @__PURE__ */ S("td"), St = /* @__PURE__ */ S("template"), Ct = /* @__PURE__ */ S("textarea"), wt = /* @__PURE__ */ S("tfoot"), Tt = /* @__PURE__ */ S("th"), Et = /* @__PURE__ */ S("thead"), Dt = /* @__PURE__ */ S("time"), Ot = /* @__PURE__ */ S("title"), kt = /* @__PURE__ */ S("tr"), At = /* @__PURE__ */ S("track"), jt = /* @__PURE__ */ S("u"), Mt = /* @__PURE__ */ S("ul"), Nt = /* @__PURE__ */ S("var"), Pt = /* @__PURE__ */ S("video"), Ft = /* @__PURE__ */ S("wbr");
11
+ // src/dom/mount.ts
12
+ function It(e, t) {
13
+ if (t === null) throw Error("[keits] no target");
14
+ let n = b.marker(), r = b.marker();
15
+ t.append(n, r);
16
+ let i = d((n) => (x(t, e(), r), n));
17
+ return () => {
18
+ i();
19
+ let e = n;
20
+ for (; e !== null;) {
21
+ let t = e === r ? null : e.nextSibling;
22
+ e.remove(), e = t;
70
23
  }
71
- });
72
- }
73
- function E(e) {
74
- m(e);
75
- }
76
- function D(e) {
77
- r(e);
78
- }
79
- function ee(t, n) {
80
- let r = {
81
- kind: 3,
82
- owner: null,
83
- children: null,
84
- cleanups: null,
85
- disposed: !1,
86
- handler: n
87
24
  };
88
- return l(r), h(() => {
89
- try {
90
- return e(r, t);
91
- } catch (e) {
92
- p(e, r);
93
- return;
94
- }
95
- });
96
- }
97
- function te(e) {
98
- return _(() => T((t) => {
99
- try {
100
- return e();
101
- } finally {
102
- t();
103
- }
104
- }));
105
25
  }
106
- // src/core/context.ts
107
- function O(e, t) {
108
- return { defaultValue: e };
26
+ // src/dom/unsafe.ts
27
+ function X(e) {
28
+ let t = document.createElement("template");
29
+ return t.innerHTML = e, t.content;
109
30
  }
110
- function k(t, n, r) {
111
- let i = {
112
- kind: 3,
113
- owner: null,
114
- children: null,
115
- cleanups: null,
116
- disposed: !1,
117
- handler: null,
118
- context: {
119
- key: t,
120
- value: n
121
- }
122
- };
123
- return l(i), e(i, r);
31
+ // src/flow/range.ts
32
+ function Z(e, t) {
33
+ return d((n) => {
34
+ let r = e();
35
+ if (Lt(r)) return {
36
+ item: t,
37
+ index: null,
38
+ dispose: n,
39
+ first: r,
40
+ last: r
41
+ };
42
+ let i = document.createDocumentFragment(), a = b.marker(), o = b.marker();
43
+ return i.append(a, o), x(i, r, o), {
44
+ item: t,
45
+ index: null,
46
+ dispose: n,
47
+ first: a,
48
+ last: o
49
+ };
50
+ });
124
51
  }
125
- function A(e) {
126
- for (let t = a(); t !== null; t = t.owner) if (t.kind === 3 && t.context?.key === e) return t.context.value;
127
- return e.defaultValue;
52
+ function Lt(e) {
53
+ return typeof e == "object" && !!e && e.nodeType === 1;
128
54
  }
129
- // src/core/store.ts
130
- var j = Symbol("raw"), M = Symbol("shape"), N = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), F = 0;
131
- function I(e, t) {
132
- let n = z(e);
133
- return [n, (e) => {
134
- F++;
135
- try {
136
- v(() => h(() => e(n)));
137
- } finally {
138
- F--;
139
- }
140
- }];
141
- }
142
- function L(e) {
143
- if (typeof e == "object" && e) {
144
- let t = e[j];
145
- if (t !== void 0) return t;
55
+ function Q(e, t, n) {
56
+ if (t.first === t.last) {
57
+ e.insertBefore(t.first, n);
58
+ return;
59
+ }
60
+ let r = t.first;
61
+ for (; r !== null;) {
62
+ let i = r === t.last ? null : r.nextSibling;
63
+ e.insertBefore(r, n), r = i;
146
64
  }
147
- return e;
148
- }
149
- function R(e) {
150
- if (typeof e != "object" || !e) return !1;
151
- if (Array.isArray(e)) return !0;
152
- let t = Object.getPrototypeOf(e);
153
- return t === Object.prototype || t === null;
154
- }
155
- function z(e) {
156
- if (!R(e)) return e;
157
- let t = N.get(e);
158
- return t === void 0 && (t = new Proxy(e, U), N.set(e, t)), t;
159
- }
160
- function B(e, t) {
161
- let n = P.get(e);
162
- n === void 0 && P.set(e, n = /* @__PURE__ */ new Map());
163
- let r = n.get(t);
164
- return r === void 0 && n.set(t, r = {
165
- kind: 0,
166
- observers: [],
167
- seenBy: 0
168
- }), r;
169
- }
170
- function V(e, t) {
171
- let n = P.get(e)?.get(t);
172
- n !== void 0 && o(n);
173
65
  }
174
- function H(e) {
175
- return !1;
66
+ function $(e) {
67
+ e.dispose();
68
+ let t = e.first;
69
+ for (; t !== null;) {
70
+ let n = t === e.last ? null : t.nextSibling;
71
+ t.remove(), t = n;
72
+ }
176
73
  }
177
- var U = {
178
- get(e, t) {
179
- if (t === j) return e;
180
- let n = e[t];
181
- return s() && (Object.hasOwn(e, t) || !(t in e)) && g(B(e, t)), z(n);
182
- },
183
- has(e, t) {
184
- return s() && g(B(e, t)), t in e;
185
- },
186
- ownKeys(e) {
187
- return s() && g(B(e, M)), Reflect.ownKeys(e);
188
- },
189
- set(e, t, n) {
190
- if (F === 0) {
191
- let t = H(e);
192
- if (t) throw t;
193
- return !1;
74
+ // src/flow/for.ts
75
+ function Rt(t, r, i) {
76
+ let a = b.marker(), o = document.createDocumentFragment();
77
+ o.append(a);
78
+ let s = [], l = null;
79
+ c(() => {
80
+ for (let e of s) e.dispose();
81
+ l?.dispose();
82
+ }), n(() => {
83
+ let e = t();
84
+ u(e ? Array.from(e) : []);
85
+ });
86
+ function u(e) {
87
+ let t = a.parentNode;
88
+ if (e.length === 0) {
89
+ for (let e of s) $(e);
90
+ s = [], l === null && i?.fallback && (l = Z(i.fallback, null), Q(t, l, a));
91
+ return;
194
92
  }
195
- let r = e, i = L(n), a = Object.hasOwn(e, t), o = r[t], s = Array.isArray(e), c = s ? e.length : 0;
196
- if (a && Object.is(o, i)) return !0;
197
- if (r[t] = i, V(e, t), a || V(e, M), s) {
198
- let n = e.length;
199
- if (n !== c) {
200
- t !== "length" && V(e, "length"), V(e, M);
201
- for (let t = n; t < c; t++) V(e, String(t));
202
- }
93
+ l !== null && ($(l), l = null);
94
+ let n = /* @__PURE__ */ new Map();
95
+ s.forEach((e, t) => {
96
+ let r = n.get(e.item);
97
+ r ? r.push(t) : n.set(e.item, [t]);
98
+ });
99
+ let r = Array(s.length).fill(!1), o = Array(e.length), c = Array(e.length);
100
+ for (let t = 0; t < e.length; t++) {
101
+ let i = e[t], a = n.get(i), l = a !== void 0 && a.length > 0 ? a.shift() : -1;
102
+ if (l >= 0) {
103
+ let e = s[l];
104
+ e.index(t), r[l] = !0, o[t] = e;
105
+ } else o[t] = d(i, t);
106
+ c[t] = l;
203
107
  }
204
- return !0;
205
- },
206
- deleteProperty(e, t) {
207
- if (F === 0) {
208
- let t = H(e);
209
- if (t) throw t;
210
- return !1;
108
+ for (let e = 0; e < s.length; e++) r[e] || $(s[e]);
109
+ let u = zt(c), f = a;
110
+ for (let e = o.length - 1; e >= 0; e--) {
111
+ let n = o[e];
112
+ u.has(e) || Q(t, n, f), f = n.first;
211
113
  }
212
- return Object.hasOwn(e, t) && (delete e[t], V(e, t), V(e, M)), !0;
114
+ s = o;
213
115
  }
214
- };
215
- function W(e, t, n = {}) {
216
- G(z(L(e)), L(t), n.key);
217
- }
218
- function G(e, t, n) {
219
- let r = L(e), i = e;
220
- if (Array.isArray(r) && Array.isArray(t)) {
221
- let e = /* @__PURE__ */ new Map();
222
- if (n !== void 0) for (let t of r) R(t) && e.set(t[n], t);
223
- for (let a = 0; a < t.length; a++) {
224
- let o = t[a], s = n !== void 0 && R(o) ? e.get(o[n]) : r[a];
225
- i[a] = K(s, o, n);
116
+ function d(t, n) {
117
+ let i = () => {}, a = Z(() => {
118
+ let a = e(n);
119
+ return i = a.set, r(t, a);
120
+ }, t);
121
+ return a.index = i, a;
122
+ }
123
+ return o;
124
+ }
125
+ function zt(e) {
126
+ let t = [], n = Array(e.length);
127
+ for (let r = 0; r < e.length; r++) {
128
+ let i = e[r];
129
+ if (i < 0) continue;
130
+ let a = 0, o = t.length;
131
+ for (; a < o;) {
132
+ let n = a + o >> 1;
133
+ e[t[n]] < i ? a = n + 1 : o = n;
226
134
  }
227
- r.length !== t.length && (i.length = t.length);
228
- } else {
229
- for (let e of Object.keys(t)) i[e] = K(r[e], t[e], n);
230
- for (let e of Object.keys(r)) Object.hasOwn(t, e) || delete i[e];
135
+ n[r] = a > 0 ? t[a - 1] : -1, t[a] = r;
231
136
  }
137
+ let r = /* @__PURE__ */ new Set(), i = t.length > 0 ? t[t.length - 1] : -1;
138
+ for (; i >= 0;) r.add(i), i = n[i];
139
+ return r;
140
+ }
141
+ // src/flow/if.ts
142
+ function Bt(e, t, n) {
143
+ let i = r(e), o = r(() => !!i()), s = i;
144
+ return () => o() ? a(() => t(s)) : n ? a(n) : null;
145
+ }
146
+ // src/flow/show.ts
147
+ function Vt(e, t) {
148
+ let r = t.style.display;
149
+ return n(() => {
150
+ e() ? t.style.display = r : t.style.display = "none";
151
+ }), t;
152
+ }
153
+ // src/flow/switch.ts
154
+ function Ht(e, t, n) {
155
+ let i = r(e);
156
+ return () => {
157
+ let e = t[i()] ?? n;
158
+ return e ? a(e) : null;
159
+ };
232
160
  }
233
- function K(e, t, n) {
234
- return R(e) && R(t) && Array.isArray(e) === Array.isArray(t) ? (G(z(e), t, n), e) : t;
161
+ // src/flow/dynamic.ts
162
+ function Ut(e, t) {
163
+ let n = r(e);
164
+ return () => {
165
+ let e = n();
166
+ return e ? a(() => e(t)) : null;
167
+ };
235
168
  }
236
- // src/dom/tags.ts
237
- var q = /* @__PURE__ */ d("a"), J = /* @__PURE__ */ d("abbr"), Y = /* @__PURE__ */ d("address"), X = /* @__PURE__ */ d("area"), Z = /* @__PURE__ */ d("article"), Q = /* @__PURE__ */ d("aside"), ne = /* @__PURE__ */ d("audio"), re = /* @__PURE__ */ d("b"), ie = /* @__PURE__ */ d("base"), ae = /* @__PURE__ */ d("bdi"), oe = /* @__PURE__ */ d("bdo"), se = /* @__PURE__ */ d("blockquote"), ce = /* @__PURE__ */ d("body"), le = /* @__PURE__ */ d("br"), ue = /* @__PURE__ */ d("button"), de = /* @__PURE__ */ d("canvas"), fe = /* @__PURE__ */ d("caption"), pe = /* @__PURE__ */ d("cite"), me = /* @__PURE__ */ d("code"), he = /* @__PURE__ */ d("col"), ge = /* @__PURE__ */ d("colgroup"), _e = /* @__PURE__ */ d("data"), ve = /* @__PURE__ */ d("datalist"), ye = /* @__PURE__ */ d("dd"), be = /* @__PURE__ */ d("del"), xe = /* @__PURE__ */ d("details"), Se = /* @__PURE__ */ d("dfn"), Ce = /* @__PURE__ */ d("dialog"), we = /* @__PURE__ */ d("div"), Te = /* @__PURE__ */ d("dl"), Ee = /* @__PURE__ */ d("dt"), De = /* @__PURE__ */ d("em"), Oe = /* @__PURE__ */ d("embed"), ke = /* @__PURE__ */ d("fieldset"), Ae = /* @__PURE__ */ d("figcaption"), je = /* @__PURE__ */ d("figure"), Me = /* @__PURE__ */ d("footer"), Ne = /* @__PURE__ */ d("form"), Pe = /* @__PURE__ */ d("h1"), Fe = /* @__PURE__ */ d("h2"), Ie = /* @__PURE__ */ d("h3"), Le = /* @__PURE__ */ d("h4"), Re = /* @__PURE__ */ d("h5"), ze = /* @__PURE__ */ d("h6"), Be = /* @__PURE__ */ d("head"), Ve = /* @__PURE__ */ d("header"), He = /* @__PURE__ */ d("hgroup"), Ue = /* @__PURE__ */ d("hr"), We = /* @__PURE__ */ d("html"), Ge = /* @__PURE__ */ d("i"), Ke = /* @__PURE__ */ d("iframe"), qe = /* @__PURE__ */ d("img"), Je = /* @__PURE__ */ d("input"), Ye = /* @__PURE__ */ d("ins"), Xe = /* @__PURE__ */ d("kbd"), Ze = /* @__PURE__ */ d("label"), Qe = /* @__PURE__ */ d("legend"), $e = /* @__PURE__ */ d("li"), et = /* @__PURE__ */ d("link"), tt = /* @__PURE__ */ d("main"), nt = /* @__PURE__ */ d("map"), rt = /* @__PURE__ */ d("mark"), it = /* @__PURE__ */ d("menu"), at = /* @__PURE__ */ d("meta"), ot = /* @__PURE__ */ d("meter"), st = /* @__PURE__ */ d("nav"), ct = /* @__PURE__ */ d("noscript"), lt = /* @__PURE__ */ d("object"), ut = /* @__PURE__ */ d("ol"), dt = /* @__PURE__ */ d("optgroup"), ft = /* @__PURE__ */ d("option"), pt = /* @__PURE__ */ d("output"), mt = /* @__PURE__ */ d("p"), ht = /* @__PURE__ */ d("picture"), gt = /* @__PURE__ */ d("pre"), _t = /* @__PURE__ */ d("progress"), vt = /* @__PURE__ */ d("q"), yt = /* @__PURE__ */ d("rp"), bt = /* @__PURE__ */ d("rt"), xt = /* @__PURE__ */ d("ruby"), St = /* @__PURE__ */ d("s"), Ct = /* @__PURE__ */ d("samp"), wt = /* @__PURE__ */ d("script"), Tt = /* @__PURE__ */ d("search"), Et = /* @__PURE__ */ d("section"), Dt = /* @__PURE__ */ d("select"), Ot = /* @__PURE__ */ d("slot"), kt = /* @__PURE__ */ d("small"), At = /* @__PURE__ */ d("source"), jt = /* @__PURE__ */ d("span"), Mt = /* @__PURE__ */ d("strong"), Nt = /* @__PURE__ */ d("style"), Pt = /* @__PURE__ */ d("sub"), Ft = /* @__PURE__ */ d("summary"), It = /* @__PURE__ */ d("sup"), Lt = /* @__PURE__ */ d("table"), Rt = /* @__PURE__ */ d("tbody"), zt = /* @__PURE__ */ d("td"), Bt = /* @__PURE__ */ d("template"), $ = /* @__PURE__ */ d("textarea"), Vt = /* @__PURE__ */ d("tfoot"), Ht = /* @__PURE__ */ d("th"), Ut = /* @__PURE__ */ d("thead"), Wt = /* @__PURE__ */ d("time"), Gt = /* @__PURE__ */ d("title"), Kt = /* @__PURE__ */ d("tr"), qt = /* @__PURE__ */ d("track"), Jt = /* @__PURE__ */ d("u"), Yt = /* @__PURE__ */ d("ul"), Xt = /* @__PURE__ */ d("var"), Zt = /* @__PURE__ */ d("video"), Qt = /* @__PURE__ */ d("wbr");
238
- // src/dom/mount.ts
239
- function $t(e, n) {
240
- if (n === null) throw Error("[keits] no target");
241
- let r = t.marker(), i = t.marker();
242
- n.append(r, i);
243
- let a = T((t) => (c(n, e(), i), t));
169
+ // src/flow/catch.ts
170
+ function Wt(t, n) {
171
+ let r = e(null), i = () => r.set(null);
244
172
  return () => {
245
- a();
173
+ let e = r();
174
+ return a(e === null ? () => h(() => {
175
+ let e = document.createDocumentFragment();
176
+ return x(e, t()), e;
177
+ }, (e) => r.set({ error: e })) : () => n(e.error, i));
178
+ };
179
+ }
180
+ // src/flow/portal.ts
181
+ function Gt(e, t) {
182
+ if (s()) return null;
183
+ let n = t === void 0 ? document.body : t;
184
+ if (n === null) throw Error("[keits] no target");
185
+ let r = b.marker(), i = b.marker();
186
+ return n.append(r, i), x(n, a(e), i), c(() => {
246
187
  let e = r;
247
188
  for (; e !== null;) {
248
189
  let t = e === i ? null : e.nextSibling;
249
190
  e.remove(), e = t;
250
191
  }
251
- };
252
- }
253
- // src/dom/unsafe.ts
254
- function en(e) {
255
- let t = document.createElement("template");
256
- return t.innerHTML = e, t.content;
257
- }
258
- export { q as $a, J as $abbr, Y as $address, X as $area, Z as $article, Q as $aside, ne as $audio, re as $b, ie as $base, ae as $bdi, oe as $bdo, se as $blockquote, ce as $body, le as $br, ue as $button, de as $canvas, fe as $caption, pe as $cite, me as $code, he as $col, ge as $colgroup, _e as $data, ve as $datalist, ye as $dd, be as $del, xe as $details, Se as $dfn, Ce as $dialog, we as $div, Te as $dl, Ee as $dt, De as $em, Oe as $embed, ke as $fieldset, Ae as $figcaption, je as $figure, Me as $footer, Ne as $form, Pe as $h1, Fe as $h2, Ie as $h3, Le as $h4, Re as $h5, ze as $h6, Be as $head, Ve as $header, He as $hgroup, Ue as $hr, We as $html, Ge as $i, Ke as $iframe, qe as $img, Je as $input, Ye as $ins, Xe as $kbd, Ze as $label, Qe as $legend, $e as $li, et as $link, tt as $main, nt as $map, rt as $mark, it as $menu, at as $meta, ot as $meter, st as $nav, ct as $noscript, lt as $object, ut as $ol, dt as $optgroup, ft as $option, pt as $output, mt as $p, ht as $picture, gt as $pre, _t as $progress, vt as $q, yt as $rp, bt as $rt, xt as $ruby, St as $s, Ct as $samp, wt as $script, Tt as $search, Et as $section, Dt as $select, Ot as $slot, kt as $small, At as $source, jt as $span, Mt as $strong, Nt as $style, Pt as $sub, Ft as $summary, It as $sup, Lt as $table, Rt as $tbody, zt as $td, Bt as $template, $ as $textarea, Vt as $tfoot, Ht as $th, Ut as $thead, Wt as $time, Gt as $title, Kt as $tr, qt as $track, Jt as $u, Yt as $ul, Xt as $var, Zt as $video, Qt as $wbr, h as batch, ee as catchError, b as computed, O as createContext, T as createRoot, f as effect, C as getOwner, d as html, c as insert, S as isServer, u as isStaticRender, $t as mount, E as onCleanup, D as onMount, k as provide, W as reconcile, te as renderStatic, w as runWithOwner, y as signal, I as store, en as unsafeHTML, v as untrack, L as unwrap, A as useContext };
192
+ }), null;
193
+ }
194
+ // src/flow/suspense.ts
195
+ function Kt(t, r) {
196
+ let o = e(0), s = /* @__PURE__ */ new Set(), l = { wait(e, t) {
197
+ s.has(e) || (s.add(e), o.set((e) => e + 1), t(() => {
198
+ s.delete(e), o.set((e) => e - 1);
199
+ }));
200
+ } }, u = document.createDocumentFragment(), d = b.marker(), f = b.marker();
201
+ u.append(d, f);
202
+ let { release: p } = i(() => _(ee, l, () => x(u, a(t), f))), m = {
203
+ item: null,
204
+ index: null,
205
+ dispose: () => {},
206
+ first: d,
207
+ last: f
208
+ }, h = b.marker(), g = document.createDocumentFragment();
209
+ g.append(h);
210
+ let v = null;
211
+ return c(() => v?.dispose()), n(() => {
212
+ let e = o() > 0;
213
+ a(() => {
214
+ let t = h.parentNode;
215
+ e ? (Q(u, m, null), v === null && (v = Z(r, null), Q(t, v, h))) : (v !== null && ($(v), v = null), Q(t, m, h), p());
216
+ });
217
+ }), g;
218
+ }
219
+ // src/async/lazy.ts
220
+ function qt(e) {
221
+ let t, n, r = () => n ??= Promise.resolve(e()).then((e) => t = e.default, (e) => {
222
+ throw n = void 0, e;
223
+ });
224
+ return Object.assign((e) => {
225
+ if (t !== void 0) return a(() => t(e));
226
+ let n = y(() => t ?? r());
227
+ return () => {
228
+ let t = n();
229
+ return t ? a(() => t(e)) : null;
230
+ };
231
+ }, { preload: r });
232
+ }
233
+ export { C as $a, w as $abbr, T as $address, E as $area, D as $article, O as $aside, k as $audio, A as $b, j as $base, M as $bdi, N as $bdo, P as $blockquote, F as $body, I as $br, L as $button, R as $canvas, z as $caption, Wt as $catch, B as $cite, V as $code, H as $col, U as $colgroup, W as $data, G as $datalist, K as $dd, q as $del, J as $details, Y as $dfn, ae as $dialog, oe as $div, se as $dl, ce as $dt, Ut as $dynamic, le as $em, ue as $embed, de as $fieldset, fe as $figcaption, pe as $figure, me as $footer, Rt as $for, he as $form, ge as $h1, _e as $h2, ve as $h3, ye as $h4, be as $h5, xe as $h6, Se as $head, Ce as $header, we as $hgroup, Te as $hr, Ee as $html, De as $i, Bt as $if, Oe as $iframe, ke as $img, Ae as $input, je as $ins, Me as $kbd, Ne as $label, Pe as $legend, Fe as $li, Ie as $link, Le as $main, Re as $map, ze as $mark, Be as $menu, Ve as $meta, He as $meter, Ue as $nav, We as $noscript, Ge as $object, Ke as $ol, qe as $optgroup, Je as $option, Ye as $output, Xe as $p, Ze as $picture, Gt as $portal, Qe as $pre, $e as $progress, et as $q, tt as $rp, nt as $rt, rt as $ruby, it as $s, at as $samp, ot as $script, st as $search, ct as $section, lt as $select, Vt as $show, ut as $slot, dt as $small, ft as $source, pt as $span, mt as $strong, ht as $style, gt as $sub, _t as $summary, vt as $sup, Kt as $suspense, Ht as $switch, yt as $table, bt as $tbody, xt as $td, St as $template, Ct as $textarea, wt as $tfoot, Tt as $th, Et as $thead, Dt as $time, Ot as $title, kt as $tr, At as $track, jt as $u, Mt as $ul, Nt as $var, Pt as $video, Ft as $wbr, o as batch, h as catchError, r as computed, v as createContext, d as createRoot, t as effect, p as getOwner, S as html, x as insert, ie as isServer, s as isStaticRender, qt as lazy, It as mount, u as onCleanup, l as onMount, _ as provide, re as reconcile, f as renderStatic, y as resource, m as runWithOwner, e as signal, te as store, X as unsafeHTML, a as untrack, ne as unwrap, g as useContext };