keits 0.0.4 → 0.1.0

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 (70) hide show
  1. package/README.md +93 -79
  2. package/dist/dev/api.js +8 -3
  3. package/dist/dev/forms.js +6 -4
  4. package/dist/dev/index.js +26 -35
  5. package/dist/dev/router.js +24 -7
  6. package/dist/dev/shared/{computed-3UO-KiH1.js → computed-DrF8O8b4.js} +1 -1
  7. package/dist/dev/shared/{element-CQPqagu1.js → element-DXwmUAnz.js} +30 -76
  8. package/dist/dev/shared/{graph-D6-x_CWC.js → graph-SIvYLXSv.js} +62 -3
  9. package/dist/dev/shared/hydrate-C8cOsDDH.js +588 -0
  10. package/dist/dev/shared/mount-CDB2HgN5.js +23 -0
  11. package/dist/dev/shared/namespaces-Cz82B0Pr.js +84 -0
  12. package/dist/dev/shared/{owner-Dmge21OW.js → owner-BuwIoI4j.js} +12 -2
  13. package/dist/dev/shared/render-context-k2uu_dM_.js +34 -0
  14. package/dist/dev/shared/render-effect-Uk9dDmuU.js +32 -0
  15. package/dist/dev/shared/{resource-CbXVATvq.js → resource-DlgzdtcG.js} +24 -33
  16. package/dist/dev/shared/{signal-BOXkY-Iv.js → signal-B3xOKbVm.js} +1 -1
  17. package/dist/dev/shared/{store-BzUN1qE5.js → store-0vEg2bQV.js} +7 -3
  18. package/dist/dev/shared/unsafe-keys-CB1P22No.js +8 -0
  19. package/dist/dev/static.js +76 -0
  20. package/dist/dev/svg.js +2 -1
  21. package/dist/dev/testing.js +216 -0
  22. package/dist/dev/vite.js +141 -0
  23. package/dist/prod/api.js +76 -71
  24. package/dist/prod/forms.js +63 -60
  25. package/dist/prod/index.js +56 -64
  26. package/dist/prod/router.js +86 -73
  27. package/dist/prod/shared/{computed-CAPpOLCY.js → computed-BjqJ6Pps.js} +1 -1
  28. package/dist/prod/shared/element-DCit4-3e.js +129 -0
  29. package/dist/prod/shared/{graph-C_aA46c6.js → graph-CR2WKbwr.js} +107 -63
  30. package/dist/prod/shared/hydrate-kKnJbkV7.js +480 -0
  31. package/dist/prod/shared/mount-DbeKIoyD.js +18 -0
  32. package/dist/prod/shared/namespaces-BSRrBJIU.js +71 -0
  33. package/dist/prod/shared/owner-DBi3odT4.js +67 -0
  34. package/dist/prod/shared/render-context-DF8lr1uu.js +30 -0
  35. package/dist/prod/shared/render-effect-UFDi2Pfh.js +25 -0
  36. package/dist/prod/shared/resource-Ch5tVseZ.js +91 -0
  37. package/dist/prod/shared/signal-BDMlfa0Z.js +16 -0
  38. package/dist/prod/shared/store-CvW0DbmK.js +110 -0
  39. package/dist/prod/shared/unsafe-keys-C5PMlerl.js +7 -0
  40. package/dist/prod/static.js +48 -0
  41. package/dist/prod/svg.js +3 -2
  42. package/dist/prod/testing.js +144 -0
  43. package/dist/prod/vite.js +106 -0
  44. package/dist/types/async/render-context.d.ts +10 -0
  45. package/dist/types/core/effect.d.ts +1 -0
  46. package/dist/types/core/graph.d.ts +11 -0
  47. package/dist/types/core/owner.d.ts +1 -0
  48. package/dist/types/core/unsafe-keys.d.ts +2 -0
  49. package/dist/types/dom/hooks.d.ts +4 -0
  50. package/dist/types/dom/types.d.ts +5 -0
  51. package/dist/types/router/index.d.ts +1 -0
  52. package/dist/types/router/match.d.ts +1 -0
  53. package/dist/types/router/types.d.ts +1 -0
  54. package/dist/types/static/head.d.ts +36 -0
  55. package/dist/types/static/hydrate.d.ts +3 -0
  56. package/dist/types/static/index.d.ts +4 -0
  57. package/dist/types/static/island.d.ts +14 -0
  58. package/dist/types/static/json.d.ts +1 -0
  59. package/dist/types/static/render.d.ts +11 -0
  60. package/dist/types/static/server-dom.d.ts +100 -0
  61. package/dist/types/testing/index.d.ts +62 -0
  62. package/dist/types/vite/index.d.ts +24 -0
  63. package/package.json +34 -7
  64. package/dist/dev/shared/render-effect-kOGnLNbL.js +0 -26
  65. package/dist/prod/shared/element-DGyQ01Vs.js +0 -164
  66. package/dist/prod/shared/owner-6BFHIPR9.js +0 -59
  67. package/dist/prod/shared/render-effect-DjaUT3Cn.js +0 -23
  68. package/dist/prod/shared/resource-CNC2DBO3.js +0 -109
  69. package/dist/prod/shared/signal-DGrl3r9T.js +0 -16
  70. package/dist/prod/shared/store-Dcscpk_h.js +0 -109
@@ -1,46 +1,35 @@
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";
1
+ import { t as e } from "./shared/signal-BDMlfa0Z.js";
2
+ import { n as t, t as n } from "./shared/render-effect-UFDi2Pfh.js";
3
+ import { t as r } from "./shared/computed-BjqJ6Pps.js";
4
+ import { a as i, d as a, i as o, p as s, t as c, x as l } from "./shared/graph-CR2WKbwr.js";
5
+ import { a as u, c as d, n as f, o as p, r as m, s as h, t as g } from "./shared/owner-DBi3odT4.js";
6
+ import { a as _, i as v, o as ee } from "./shared/render-context-DF8lr1uu.js";
7
+ import { n as te, r as ne, t as y } from "./shared/store-CvW0DbmK.js";
8
+ import { n as b } from "./shared/element-DCit4-3e.js";
9
+ import { a as x, n as S, s as re } from "./shared/namespaces-BSRrBJIU.js";
10
+ import { t as ie } from "./shared/mount-DbeKIoyD.js";
11
+ import { n as C, t as w } from "./shared/resource-Ch5tVseZ.js";
9
12
  // src/core/env.ts
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;
23
- }
24
- };
25
- }
13
+ var T = typeof window > "u", E = /* @__PURE__ */ b("a"), D = /* @__PURE__ */ b("abbr"), O = /* @__PURE__ */ b("address"), k = /* @__PURE__ */ b("area"), A = /* @__PURE__ */ b("article"), j = /* @__PURE__ */ b("aside"), M = /* @__PURE__ */ b("audio"), N = /* @__PURE__ */ b("b"), P = /* @__PURE__ */ b("base"), F = /* @__PURE__ */ b("bdi"), I = /* @__PURE__ */ b("bdo"), L = /* @__PURE__ */ b("blockquote"), R = /* @__PURE__ */ b("body"), z = /* @__PURE__ */ b("br"), B = /* @__PURE__ */ b("button"), V = /* @__PURE__ */ b("canvas"), H = /* @__PURE__ */ b("caption"), U = /* @__PURE__ */ b("cite"), W = /* @__PURE__ */ b("code"), G = /* @__PURE__ */ b("col"), K = /* @__PURE__ */ b("colgroup"), q = /* @__PURE__ */ b("data"), J = /* @__PURE__ */ b("datalist"), Y = /* @__PURE__ */ b("dd"), ae = /* @__PURE__ */ b("del"), oe = /* @__PURE__ */ b("details"), se = /* @__PURE__ */ b("dfn"), ce = /* @__PURE__ */ b("dialog"), le = /* @__PURE__ */ b("div"), ue = /* @__PURE__ */ b("dl"), de = /* @__PURE__ */ b("dt"), fe = /* @__PURE__ */ b("em"), pe = /* @__PURE__ */ b("embed"), me = /* @__PURE__ */ b("fieldset"), he = /* @__PURE__ */ b("figcaption"), ge = /* @__PURE__ */ b("figure"), _e = /* @__PURE__ */ b("footer"), ve = /* @__PURE__ */ b("form"), ye = /* @__PURE__ */ b("h1"), be = /* @__PURE__ */ b("h2"), xe = /* @__PURE__ */ b("h3"), Se = /* @__PURE__ */ b("h4"), Ce = /* @__PURE__ */ b("h5"), we = /* @__PURE__ */ b("h6"), Te = /* @__PURE__ */ b("head"), Ee = /* @__PURE__ */ b("header"), De = /* @__PURE__ */ b("hgroup"), Oe = /* @__PURE__ */ b("hr"), ke = /* @__PURE__ */ b("html"), Ae = /* @__PURE__ */ b("i"), je = /* @__PURE__ */ b("iframe"), Me = /* @__PURE__ */ b("img"), Ne = /* @__PURE__ */ b("input"), Pe = /* @__PURE__ */ b("ins"), Fe = /* @__PURE__ */ b("kbd"), Ie = /* @__PURE__ */ b("label"), Le = /* @__PURE__ */ b("legend"), Re = /* @__PURE__ */ b("li"), ze = /* @__PURE__ */ b("link"), Be = /* @__PURE__ */ b("main"), Ve = /* @__PURE__ */ b("map"), He = /* @__PURE__ */ b("mark"), Ue = /* @__PURE__ */ b("menu"), We = /* @__PURE__ */ b("meta"), Ge = /* @__PURE__ */ b("meter"), Ke = /* @__PURE__ */ b("nav"), qe = /* @__PURE__ */ b("noscript"), Je = /* @__PURE__ */ b("object"), Ye = /* @__PURE__ */ b("ol"), Xe = /* @__PURE__ */ b("optgroup"), Ze = /* @__PURE__ */ b("option"), Qe = /* @__PURE__ */ b("output"), $e = /* @__PURE__ */ b("p"), et = /* @__PURE__ */ b("picture"), tt = /* @__PURE__ */ b("pre"), nt = /* @__PURE__ */ b("progress"), rt = /* @__PURE__ */ b("q"), it = /* @__PURE__ */ b("rp"), at = /* @__PURE__ */ b("rt"), ot = /* @__PURE__ */ b("ruby"), st = /* @__PURE__ */ b("s"), ct = /* @__PURE__ */ b("samp"), lt = /* @__PURE__ */ b("script"), ut = /* @__PURE__ */ b("search"), dt = /* @__PURE__ */ b("section"), ft = /* @__PURE__ */ b("select"), pt = /* @__PURE__ */ b("slot"), mt = /* @__PURE__ */ b("small"), ht = /* @__PURE__ */ b("source"), gt = /* @__PURE__ */ b("span"), _t = /* @__PURE__ */ b("strong"), vt = /* @__PURE__ */ b("style"), yt = /* @__PURE__ */ b("sub"), bt = /* @__PURE__ */ b("summary"), xt = /* @__PURE__ */ b("sup"), St = /* @__PURE__ */ b("table"), Ct = /* @__PURE__ */ b("tbody"), wt = /* @__PURE__ */ b("td"), Tt = /* @__PURE__ */ b("template"), Et = /* @__PURE__ */ b("textarea"), Dt = /* @__PURE__ */ b("tfoot"), Ot = /* @__PURE__ */ b("th"), kt = /* @__PURE__ */ b("thead"), At = /* @__PURE__ */ b("time"), jt = /* @__PURE__ */ b("title"), Mt = /* @__PURE__ */ b("tr"), Nt = /* @__PURE__ */ b("track"), Pt = /* @__PURE__ */ b("u"), Ft = /* @__PURE__ */ b("ul"), It = /* @__PURE__ */ b("var"), X = /* @__PURE__ */ b("video"), Lt = /* @__PURE__ */ b("wbr");
26
14
  // src/dom/unsafe.ts
27
- function X(e) {
15
+ function Rt(e) {
16
+ if (x.html !== void 0) return x.html(e);
28
17
  let t = document.createElement("template");
29
18
  return t.innerHTML = e, t.content;
30
19
  }
31
20
  // src/flow/range.ts
32
21
  function Z(e, t) {
33
- return d((n) => {
22
+ return f((n) => {
34
23
  let r = e();
35
- if (Lt(r)) return {
24
+ if (zt(r)) return {
36
25
  item: t,
37
26
  index: null,
38
27
  dispose: n,
39
28
  first: r,
40
29
  last: r
41
30
  };
42
- let i = document.createDocumentFragment(), a = b.marker(), o = b.marker();
43
- return i.append(a, o), x(i, r, o), {
31
+ let i = x.fragment(), a = x.marker(), o = x.marker();
32
+ return i.append(a, o), S(i, r, o), {
44
33
  item: t,
45
34
  index: null,
46
35
  dispose: n,
@@ -49,7 +38,7 @@ function Z(e, t) {
49
38
  };
50
39
  });
51
40
  }
52
- function Lt(e) {
41
+ function zt(e) {
53
42
  return typeof e == "object" && !!e && e.nodeType === 1;
54
43
  }
55
44
  function Q(e, t, n) {
@@ -72,8 +61,8 @@ function $(e) {
72
61
  }
73
62
  }
74
63
  // src/flow/for.ts
75
- function Rt(t, r, i) {
76
- let a = b.marker(), o = document.createDocumentFragment();
64
+ function Bt(t, r, i) {
65
+ let a = x.marker(), o = x.fragment();
77
66
  o.append(a);
78
67
  let s = [], l = null;
79
68
  c(() => {
@@ -106,7 +95,7 @@ function Rt(t, r, i) {
106
95
  c[t] = l;
107
96
  }
108
97
  for (let e = 0; e < s.length; e++) r[e] || $(s[e]);
109
- let u = zt(c), f = a;
98
+ let u = Vt(c), f = a;
110
99
  for (let e = o.length - 1; e >= 0; e--) {
111
100
  let n = o[e];
112
101
  u.has(e) || Q(t, n, f), f = n.first;
@@ -122,7 +111,7 @@ function Rt(t, r, i) {
122
111
  }
123
112
  return o;
124
113
  }
125
- function zt(e) {
114
+ function Vt(e) {
126
115
  let t = [], n = Array(e.length);
127
116
  for (let r = 0; r < e.length; r++) {
128
117
  let i = e[r];
@@ -139,51 +128,54 @@ function zt(e) {
139
128
  return r;
140
129
  }
141
130
  // 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;
131
+ function Ht(e, t, n) {
132
+ let i = r(e), a = r(() => !!i()), o = i;
133
+ return () => a() ? l(() => t(o)) : n ? l(n) : null;
145
134
  }
146
135
  // src/flow/show.ts
147
- function Vt(e, t) {
136
+ function Ut(e, t) {
148
137
  let r = t.style.display;
149
138
  return n(() => {
150
139
  e() ? t.style.display = r : t.style.display = "none";
151
140
  }), t;
152
141
  }
153
142
  // src/flow/switch.ts
154
- function Ht(e, t, n) {
143
+ function Wt(e, t, n) {
155
144
  let i = r(e);
156
145
  return () => {
157
146
  let e = t[i()] ?? n;
158
- return e ? a(e) : null;
147
+ return e ? l(e) : null;
159
148
  };
160
149
  }
161
150
  // src/flow/dynamic.ts
162
- function Ut(e, t) {
151
+ function Gt(e, t) {
163
152
  let n = r(e);
164
153
  return () => {
165
154
  let e = n();
166
- return e ? a(() => e(t)) : null;
155
+ return e ? l(() => e(t)) : null;
167
156
  };
168
157
  }
169
158
  // src/flow/catch.ts
170
- function Wt(t, n) {
159
+ function Kt(t, n) {
171
160
  let r = e(null), i = () => r.set(null);
172
161
  return () => {
173
162
  let e = r();
174
- return a(e === null ? () => h(() => {
175
- let e = document.createDocumentFragment();
176
- return x(e, t()), e;
163
+ return l(e === null ? () => g(() => {
164
+ let e = x.fragment();
165
+ return S(e, t()), e;
177
166
  }, (e) => r.set({ error: e })) : () => n(e.error, i));
178
167
  };
179
168
  }
180
169
  // src/flow/portal.ts
181
- function Gt(e, t) {
182
- if (s()) return null;
170
+ function qt(e, t) {
171
+ if (a()) return s(), null;
183
172
  let n = t === void 0 ? document.body : t;
184
173
  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(() => {
174
+ let r = x.marker(), i = x.marker();
175
+ n.append(r, i);
176
+ let o = f((t) => (re(() => S(n, l(e), i)), t));
177
+ return c(() => {
178
+ o();
187
179
  let e = r;
188
180
  for (; e !== null;) {
189
181
  let t = e === i ? null : e.nextSibling;
@@ -192,42 +184,42 @@ function Gt(e, t) {
192
184
  }), null;
193
185
  }
194
186
  // 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);
187
+ function Jt(t, r) {
188
+ let a = e(0), o = /* @__PURE__ */ new Set(), s = { wait(e, t) {
189
+ o.has(e) || (o.add(e), a.set((e) => e + 1), t(() => {
190
+ o.delete(e), a.set((e) => e - 1);
199
191
  }));
200
- } }, u = document.createDocumentFragment(), d = b.marker(), f = b.marker();
192
+ } }, u = x.fragment(), d = x.marker(), f = x.marker();
201
193
  u.append(d, f);
202
- let { release: p } = i(() => _(ee, l, () => x(u, a(t), f))), m = {
194
+ let { release: p } = i(() => _(C, s, () => S(u, l(t), f))), m = {
203
195
  item: null,
204
196
  index: null,
205
197
  dispose: () => {},
206
198
  first: d,
207
199
  last: f
208
- }, h = b.marker(), g = document.createDocumentFragment();
200
+ }, h = x.marker(), g = x.fragment();
209
201
  g.append(h);
210
202
  let v = null;
211
203
  return c(() => v?.dispose()), n(() => {
212
- let e = o() > 0;
213
- a(() => {
204
+ let e = a() > 0;
205
+ l(() => {
214
206
  let t = h.parentNode;
215
207
  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
208
  });
217
209
  }), g;
218
210
  }
219
211
  // src/async/lazy.ts
220
- function qt(e) {
212
+ function Yt(e) {
221
213
  let t, n, r = () => n ??= Promise.resolve(e()).then((e) => t = e.default, (e) => {
222
214
  throw n = void 0, e;
223
215
  });
224
216
  return Object.assign((e) => {
225
- if (t !== void 0) return a(() => t(e));
226
- let n = y(() => t ?? r());
217
+ if (t !== void 0) return l(() => t(e));
218
+ let n = w(() => t ?? r());
227
219
  return () => {
228
220
  let t = n();
229
- return t ? a(() => t(e)) : null;
221
+ return t ? l(() => t(e)) : null;
230
222
  };
231
223
  }, { preload: r });
232
224
  }
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 };
225
+ export { E as $a, D as $abbr, O as $address, k as $area, A as $article, j as $aside, M as $audio, N as $b, P as $base, F as $bdi, I as $bdo, L as $blockquote, R as $body, z as $br, B as $button, V as $canvas, H as $caption, Kt as $catch, U as $cite, W as $code, G as $col, K as $colgroup, q as $data, J as $datalist, Y as $dd, ae as $del, oe as $details, se as $dfn, ce as $dialog, le as $div, ue as $dl, de as $dt, Gt as $dynamic, fe as $em, pe as $embed, me as $fieldset, he as $figcaption, ge as $figure, _e as $footer, Bt as $for, ve as $form, ye as $h1, be as $h2, xe as $h3, Se as $h4, Ce as $h5, we as $h6, Te as $head, Ee as $header, De as $hgroup, Oe as $hr, ke as $html, Ae as $i, Ht as $if, je as $iframe, Me as $img, Ne as $input, Pe as $ins, Fe as $kbd, Ie as $label, Le as $legend, Re as $li, ze as $link, Be as $main, Ve as $map, He as $mark, Ue as $menu, We as $meta, Ge as $meter, Ke as $nav, qe as $noscript, Je as $object, Ye as $ol, Xe as $optgroup, Ze as $option, Qe as $output, $e as $p, et as $picture, qt as $portal, tt as $pre, nt as $progress, rt as $q, it as $rp, at as $rt, ot as $ruby, st as $s, ct as $samp, lt as $script, ut as $search, dt as $section, ft as $select, Ut as $show, pt as $slot, mt as $small, ht as $source, gt as $span, _t as $strong, vt as $style, yt as $sub, bt as $summary, xt as $sup, Jt as $suspense, Wt as $switch, St as $table, Ct as $tbody, wt as $td, Tt as $template, Et as $textarea, Dt as $tfoot, Ot as $th, kt as $thead, At as $time, jt as $title, Mt as $tr, Nt as $track, Pt as $u, Ft as $ul, It as $var, X as $video, Lt as $wbr, o as batch, g as catchError, r as computed, v as createContext, f as createRoot, t as effect, m as getOwner, b as html, S as insert, T as isServer, a as isStaticRender, Yt as lazy, ie as mount, u as onCleanup, p as onMount, _ as provide, y as reconcile, h as renderStatic, w as resource, d as runWithOwner, e as signal, te as store, Rt as unsafeHTML, l as untrack, ne as unwrap, ee as useContext };
@@ -1,7 +1,7 @@
1
- import { t as e } from "./shared/computed-CAPpOLCY.js";
2
- import { t } from "./shared/signal-DGrl3r9T.js";
3
- import { c as n, h as r, i, n as a, p as o, s } from "./shared/graph-C_aA46c6.js";
4
- import { i as c } from "./shared/owner-6BFHIPR9.js";
1
+ import { t as e } from "./shared/computed-BjqJ6Pps.js";
2
+ import { t } from "./shared/signal-BDMlfa0Z.js";
3
+ import { g as n, i as r, l as i, n as a, s as o, x as s } from "./shared/graph-CR2WKbwr.js";
4
+ import { a as c } from "./shared/owner-DBi3odT4.js";
5
5
  // src/router/history.ts
6
6
  var l = () => Math.random().toString(36).slice(2, 10), u = () => window.history.state?.keitsKey ?? "start";
7
7
  function d(e = "") {
@@ -9,7 +9,7 @@ function d(e = "") {
9
9
  return {
10
10
  read() {
11
11
  let e = window.location.pathname;
12
- return t !== "" && e.startsWith(t) && (e = e.slice(t.length)), {
12
+ return t !== "" && (e === t || e.startsWith(`${t}/`)) && (e = e.slice(t.length)), {
13
13
  path: e || "/",
14
14
  search: window.location.search,
15
15
  hash: window.location.hash
@@ -185,8 +185,21 @@ function w(e, t) {
185
185
  return encodeURIComponent(String(r));
186
186
  });
187
187
  }
188
+ async function T(e) {
189
+ let t = [];
190
+ for (let n of _(e)) {
191
+ if (n.keys.includes("*")) continue;
192
+ if (n.keys.length === 0) {
193
+ t.push(n.path);
194
+ continue;
195
+ }
196
+ let e = [...n.routes].reverse().find((e) => e.paths !== void 0);
197
+ if (e !== void 0) for (let r of await e.paths()) t.push(w(n.path, r));
198
+ }
199
+ return [...new Set(t)];
200
+ }
188
201
  // src/router/scroll.ts
189
- function T() {
202
+ function E() {
190
203
  let e = /* @__PURE__ */ new Map();
191
204
  return "scrollRestoration" in window.history && (window.history.scrollRestoration = "manual"), {
192
205
  save(t) {
@@ -197,7 +210,7 @@ function T() {
197
210
  if (o !== void 0) window.scrollTo(o[0], o[1]);
198
211
  else {
199
212
  if (i !== "" && (r || a)) {
200
- let e = document.getElementById(E(i));
213
+ let e = document.getElementById(D(i));
201
214
  if (e !== null) {
202
215
  e.scrollIntoView();
203
216
  return;
@@ -208,7 +221,7 @@ function T() {
208
221
  }
209
222
  };
210
223
  }
211
- function E(e) {
224
+ function D(e) {
212
225
  try {
213
226
  return decodeURIComponent(e.slice(1));
214
227
  } catch {
@@ -216,130 +229,130 @@ function E(e) {
216
229
  }
217
230
  }
218
231
  // src/router/router.ts
219
- function D(l) {
220
- let u = typeof l.history == "object" ? l.history : l.history === "hash" ? f() : d(l.base), p = s(), g = _(l.routes), v = t(u.read(), { equals: (e, t) => e.path === t.path && e.search === t.search && e.hash === t.hash }), b = t(!1), E = t(!1), D = /* @__PURE__ */ new Set(), j = 0, M = l.scroll ?? typeof window < "u" ? T() : null, N = u.key(), P = e(() => b() ? y(g, v().path) : null), F = e(() => P()?.params ?? {}, { equals: A }), I = e(() => S(x(P()), v().search), { equals: A }), L = (e, t) => {
232
+ function O(l) {
233
+ let u = typeof l.history == "object" ? l.history : l.history === "hash" ? f() : typeof window > "u" ? p() : d(l.base), g = o(), v = _(l.routes), b = t(u.read(), { equals: (e, t) => e.path === t.path && e.search === t.search && e.hash === t.hash }), T = t(!1), D = t(!1), O = /* @__PURE__ */ new Set(), M = 0, N = l.scroll ?? typeof window < "u" ? E() : null, P = u.key(), F = e(() => T() ? y(v, b().path) : null), I = e(() => F()?.params ?? {}, { equals: j }), L = e(() => S(x(F()), b().search), { equals: j }), R = (e, t) => {
221
234
  let n = w(e, t?.params), r = t?.query ? C(t.query) : "", i = t?.hash ? `#${t.hash.replace(/^#/, "")}` : "";
222
235
  return n + r + i;
223
236
  };
224
- function R(e, t, s = 0) {
225
- let c = ++j, l = m(e), d = r(b) ? r(v) : null, f = () => {
226
- d !== null && M?.save(N), t === "push" ? u.push(e) : (t === "replace" || s > 0) && u.replace(e), N = u.key();
227
- let n = N;
228
- return i(() => {
229
- if (E.set(!1), b.set(!0), v.set(u.read()), M !== null && d !== null) {
237
+ function z(e, t, o = 0) {
238
+ let c = ++M, l = m(e), d = s(T) ? s(b) : null, f = () => {
239
+ d !== null && N?.save(P), t === "push" ? u.push(e) : (t === "replace" || o > 0) && u.replace(e), P = u.key();
240
+ let i = P;
241
+ return r(() => {
242
+ if (D.set(!1), T.set(!0), b.set(u.read()), N !== null && d !== null) {
230
243
  let e = d.path !== l.path, r = d.hash !== l.hash;
231
- o(null, () => a(() => M.restore(n, t === "pop", e, l.hash, r)));
244
+ n(null, () => a(() => N.restore(i, t === "pop", e, l.hash, r)));
232
245
  }
233
246
  }), !0;
234
247
  };
235
248
  if (d !== null && d.path === l.path) return Promise.resolve(f());
236
- let h = y(g, l.path), _ = {
249
+ let p = y(v, l.path), h = {
237
250
  path: l.path,
238
- route: h?.path ?? null,
239
- params: h?.params ?? {},
251
+ route: p?.path ?? null,
252
+ params: p?.params ?? {},
240
253
  search: l.search,
241
254
  from: d?.path ?? null
242
- }, x = [];
243
- if (d !== null) for (let e of D) x.push(() => e(_));
244
- for (let e of h?.routes ?? []) {
255
+ }, _ = [];
256
+ if (d !== null) for (let e of O) _.push(() => e(h));
257
+ for (let e of p?.routes ?? []) {
245
258
  let t = e.guard;
246
- t && x.push(() => t(_));
259
+ t && _.push(() => t(h));
247
260
  }
248
- let S = (e) => {
249
- if (c !== j) return !1;
261
+ let x = (e) => {
262
+ if (c !== M) return !1;
250
263
  if (e === !0) return f();
251
- if (E.set(!1), typeof e == "string") {
252
- if (s >= 10) throw Error("[keits/router] redirect loop");
253
- return R(e, t === "pop" ? "replace" : t, s + 1);
264
+ if (D.set(!1), typeof e == "string") {
265
+ if (o >= 10) throw Error("[keits/router] redirect loop");
266
+ return z(e, t === "pop" ? "replace" : t, o + 1);
254
267
  }
255
- return t === "pop" && d !== null && (u.push(d.path + d.search + d.hash), N = u.key()), !1;
256
- }, C = (e) => {
257
- c === j && E.set(!1);
268
+ return t === "pop" && d !== null && (u.push(d.path + d.search + d.hash), P = u.key()), !1;
269
+ }, S = (e) => {
270
+ c === M && D.set(!1);
258
271
  try {
259
- return n(e, p), Promise.resolve(!1);
272
+ return i(e, g), Promise.resolve(!1);
260
273
  } catch (e) {
261
274
  return Promise.reject(e);
262
275
  }
263
- }, w = (e) => {
276
+ }, C = (e) => {
264
277
  try {
265
- return Promise.resolve(S(e));
278
+ return Promise.resolve(x(e));
266
279
  } catch (e) {
267
- return C(e);
280
+ return S(e);
268
281
  }
269
- }, T;
282
+ }, w;
270
283
  try {
271
- T = O(x, 0);
284
+ w = k(_, 0);
272
285
  } catch (e) {
273
- return C(e);
286
+ return S(e);
274
287
  }
275
- return k(T) ? (E.set(!0), T.then(w, C)) : w(T);
288
+ return A(w) ? (D.set(!0), w.then(C, S)) : C(w);
276
289
  }
277
- let z = u.listen(() => {
290
+ let B = u.listen(() => {
278
291
  let e = u.read();
279
- R(e.path + e.search + e.hash, "pop");
280
- }), B = u.read();
281
- R(B.path + B.search + B.hash, "start");
282
- let V = (e) => {
292
+ z(e.path + e.search + e.hash, "pop");
293
+ }), V = u.read();
294
+ z(V.path + V.search + V.hash, "start");
295
+ let H = (e) => {
283
296
  let t = h(e, (e) => u.toAppUrl(e));
284
297
  if (t === null) return;
285
298
  e.preventDefault();
286
- let n = r(v);
287
- R(t, t === n.path + n.search + n.hash ? "replace" : "push");
288
- }, H = l.links !== !1 && typeof document < "u";
289
- return H && document.addEventListener("click", V), {
290
- location: () => v(),
291
- match: () => P(),
292
- params: () => F(),
293
- query: () => I(),
294
- pending: () => E(),
295
- navigate: (e, t) => R(e.includes(":") || t?.query || t?.hash ? L(e, t) : e, t?.replace ? "replace" : "push"),
296
- href: (e, t) => u.href(L(e, t)),
299
+ let n = s(b);
300
+ z(t, t === n.path + n.search + n.hash ? "replace" : "push");
301
+ }, U = l.links !== !1 && typeof document < "u";
302
+ return U && document.addEventListener("click", H), {
303
+ location: () => b(),
304
+ match: () => F(),
305
+ params: () => I(),
306
+ query: () => L(),
307
+ pending: () => D(),
308
+ navigate: (e, t) => z(e.includes(":") || t?.query || t?.hash ? R(e, t) : e, t?.replace ? "replace" : "push"),
309
+ href: (e, t) => u.href(R(e, t)),
297
310
  setQuery(e, t) {
298
- let n = r(v), i = {
311
+ let n = s(b), r = {
299
312
  ...Object.fromEntries(new URLSearchParams(n.search)),
300
313
  ...e
301
314
  };
302
- R(n.path + C(i) + n.hash, t?.push ? "push" : "replace");
315
+ z(n.path + C(r) + n.hash, t?.push ? "push" : "replace");
303
316
  },
304
317
  onLeave(e) {
305
- D.add(e), c(() => D.delete(e));
318
+ O.add(e), c(() => O.delete(e));
306
319
  },
307
320
  view() {
308
- let t = (n, i) => {
309
- let a = e(() => P()?.routes[n] ?? null);
321
+ let t = (n, r) => {
322
+ let i = e(() => F()?.routes[n] ?? null);
310
323
  return () => {
311
- let e = a();
312
- return r(() => {
313
- if (e === null) return i?.component ? i.component() : null;
314
- let r = t(n + 1, e);
315
- return e.layout ? e.layout({ children: r }) : r;
324
+ let e = i();
325
+ return s(() => {
326
+ if (e === null) return r?.component ? r.component() : null;
327
+ let i = t(n + 1, e);
328
+ return e.layout ? e.layout({ children: i }) : i;
316
329
  });
317
330
  };
318
331
  };
319
332
  return t(0, null);
320
333
  },
321
334
  isActive(e, t = !1) {
322
- let n = v().path.replace(/\/$/, "") || "/", r = m(e).path.replace(/\/$/, "") || "/";
335
+ let n = b().path.replace(/\/$/, "") || "/", r = m(e).path.replace(/\/$/, "") || "/";
323
336
  return t ? n === r : n === r || n.startsWith(`${r}/`);
324
337
  },
325
338
  dispose() {
326
- z(), H && document.removeEventListener("click", V);
339
+ B(), U && document.removeEventListener("click", H);
327
340
  }
328
341
  };
329
342
  }
330
- function O(e, t) {
343
+ function k(e, t) {
331
344
  for (let n = t; n < e.length; n++) {
332
345
  let t = e[n]();
333
- if (k(t)) return Promise.resolve(t).then((t) => t === !0 ? O(e, n + 1) : t);
346
+ if (A(t)) return Promise.resolve(t).then((t) => t === !0 ? k(e, n + 1) : t);
334
347
  if (t !== !0) return t;
335
348
  }
336
349
  return !0;
337
350
  }
338
- function k(e) {
351
+ function A(e) {
339
352
  return typeof e?.then == "function";
340
353
  }
341
- function A(e, t) {
354
+ function j(e, t) {
342
355
  let n = Object.keys(e);
343
356
  return n.length === Object.keys(t).length && n.every((n) => Object.is(e[n], t[n]));
344
357
  }
345
- export { d as browserHistory, D as createRouter, f as hashHistory, p as memoryHistory };
358
+ export { d as browserHistory, O as createRouter, f as hashHistory, p as memoryHistory, T as staticPaths };
@@ -1,4 +1,4 @@
1
- import { g as e, m as t, r as n } from "./graph-C_aA46c6.js";
1
+ import { S as e, b as t, r as n } from "./graph-CR2WKbwr.js";
2
2
  // src/core/computed.ts
3
3
  function r(r, a) {
4
4
  let o = {