keits 0.0.3 → 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 (75) hide show
  1. package/README.md +93 -79
  2. package/dist/dev/api.js +275 -0
  3. package/dist/dev/forms.js +330 -0
  4. package/dist/dev/index.js +26 -326
  5. package/dist/dev/router.js +24 -5
  6. package/dist/dev/shared/computed-DrF8O8b4.js +40 -0
  7. package/dist/dev/shared/{element-C4DfKtZW.js → element-DXwmUAnz.js} +32 -111
  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-BuwIoI4j.js +72 -0
  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-DlgzdtcG.js +145 -0
  16. package/dist/dev/shared/signal-B3xOKbVm.js +24 -0
  17. package/dist/dev/shared/store-0vEg2bQV.js +152 -0
  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 +215 -0
  24. package/dist/prod/forms.js +240 -0
  25. package/dist/prod/index.js +110 -327
  26. package/dist/prod/router.js +83 -68
  27. package/dist/prod/shared/computed-BjqJ6Pps.js +33 -0
  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/api/cache.d.ts +16 -0
  45. package/dist/types/api/client.d.ts +42 -0
  46. package/dist/types/api/error.d.ts +16 -0
  47. package/dist/types/api/index.d.ts +3 -0
  48. package/dist/types/api/url.d.ts +5 -0
  49. package/dist/types/async/render-context.d.ts +10 -0
  50. package/dist/types/core/effect.d.ts +1 -0
  51. package/dist/types/core/graph.d.ts +11 -0
  52. package/dist/types/core/owner.d.ts +1 -0
  53. package/dist/types/core/unsafe-keys.d.ts +2 -0
  54. package/dist/types/dom/hooks.d.ts +4 -0
  55. package/dist/types/dom/types.d.ts +5 -0
  56. package/dist/types/forms/form.d.ts +55 -0
  57. package/dist/types/forms/index.d.ts +2 -0
  58. package/dist/types/forms/paths.d.ts +6 -0
  59. package/dist/types/forms/types.d.ts +38 -0
  60. package/dist/types/router/index.d.ts +1 -0
  61. package/dist/types/router/match.d.ts +1 -0
  62. package/dist/types/router/types.d.ts +1 -0
  63. package/dist/types/static/head.d.ts +36 -0
  64. package/dist/types/static/hydrate.d.ts +3 -0
  65. package/dist/types/static/index.d.ts +4 -0
  66. package/dist/types/static/island.d.ts +14 -0
  67. package/dist/types/static/json.d.ts +1 -0
  68. package/dist/types/static/render.d.ts +11 -0
  69. package/dist/types/static/server-dom.d.ts +100 -0
  70. package/dist/types/testing/index.d.ts +62 -0
  71. package/dist/types/vite/index.d.ts +24 -0
  72. package/package.json +46 -5
  73. package/dist/dev/shared/owner-DlUsXKXE.js +0 -122
  74. package/dist/prod/shared/element-DUtXb3px.js +0 -187
  75. package/dist/prod/shared/owner-DgJNPM0P.js +0 -104
@@ -1,5 +1,7 @@
1
- import { c as e, i as t, l as n } from "./shared/owner-DgJNPM0P.js";
2
- import { c as r, h as i, i as a, n as o, p as s, s as c } from "./shared/graph-C_aA46c6.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";
3
5
  // src/router/history.ts
4
6
  var l = () => Math.random().toString(36).slice(2, 10), u = () => window.history.state?.keitsKey ?? "start";
5
7
  function d(e = "") {
@@ -7,7 +9,7 @@ function d(e = "") {
7
9
  return {
8
10
  read() {
9
11
  let e = window.location.pathname;
10
- return t !== "" && e.startsWith(t) && (e = e.slice(t.length)), {
12
+ return t !== "" && (e === t || e.startsWith(`${t}/`)) && (e = e.slice(t.length)), {
11
13
  path: e || "/",
12
14
  search: window.location.search,
13
15
  hash: window.location.hash
@@ -183,8 +185,21 @@ function w(e, t) {
183
185
  return encodeURIComponent(String(r));
184
186
  });
185
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
+ }
186
201
  // src/router/scroll.ts
187
- function T() {
202
+ function E() {
188
203
  let e = /* @__PURE__ */ new Map();
189
204
  return "scrollRestoration" in window.history && (window.history.scrollRestoration = "manual"), {
190
205
  save(t) {
@@ -195,7 +210,7 @@ function T() {
195
210
  if (o !== void 0) window.scrollTo(o[0], o[1]);
196
211
  else {
197
212
  if (i !== "" && (r || a)) {
198
- let e = document.getElementById(E(i));
213
+ let e = document.getElementById(D(i));
199
214
  if (e !== null) {
200
215
  e.scrollIntoView();
201
216
  return;
@@ -206,7 +221,7 @@ function T() {
206
221
  }
207
222
  };
208
223
  }
209
- function E(e) {
224
+ function D(e) {
210
225
  try {
211
226
  return decodeURIComponent(e.slice(1));
212
227
  } catch {
@@ -214,100 +229,100 @@ function E(e) {
214
229
  }
215
230
  }
216
231
  // src/router/router.ts
217
- function D(l) {
218
- let u = typeof l.history == "object" ? l.history : l.history === "hash" ? f() : d(l.base), p = c(), g = _(l.routes), v = n(u.read(), { equals: (e, t) => e.path === t.path && e.search === t.search && e.hash === t.hash }), b = n(!1), E = n(!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) => {
219
234
  let n = w(e, t?.params), r = t?.query ? C(t.query) : "", i = t?.hash ? `#${t.hash.replace(/^#/, "")}` : "";
220
235
  return n + r + i;
221
236
  };
222
- function R(e, t, n = 0) {
223
- let c = ++j, l = m(e), d = i(b) ? i(v) : null, f = () => {
224
- d !== null && M?.save(N), t === "push" ? u.push(e) : (t === "replace" || n > 0) && u.replace(e), N = u.key();
225
- let r = N;
226
- return a(() => {
227
- if (E.set(!1), b.set(!0), v.set(u.read()), M !== null && d !== null) {
228
- let e = d.path !== l.path, n = d.hash !== l.hash;
229
- s(null, () => o(() => M.restore(r, t === "pop", e, l.hash, n)));
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) {
243
+ let e = d.path !== l.path, r = d.hash !== l.hash;
244
+ n(null, () => a(() => N.restore(i, t === "pop", e, l.hash, r)));
230
245
  }
231
246
  }), !0;
232
247
  };
233
248
  if (d !== null && d.path === l.path) return Promise.resolve(f());
234
- let h = y(g, l.path), _ = {
249
+ let p = y(v, l.path), h = {
235
250
  path: l.path,
236
- route: h?.path ?? null,
237
- params: h?.params ?? {},
251
+ route: p?.path ?? null,
252
+ params: p?.params ?? {},
238
253
  search: l.search,
239
254
  from: d?.path ?? null
240
- }, x = [];
241
- if (d !== null) for (let e of D) x.push(() => e(_));
242
- 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 ?? []) {
243
258
  let t = e.guard;
244
- t && x.push(() => t(_));
259
+ t && _.push(() => t(h));
245
260
  }
246
- let S = (e) => {
247
- if (c !== j) return !1;
261
+ let x = (e) => {
262
+ if (c !== M) return !1;
248
263
  if (e === !0) return f();
249
- if (E.set(!1), typeof e == "string") {
250
- if (n >= 10) throw Error("[keits/router] redirect loop");
251
- return R(e, t === "pop" ? "replace" : t, n + 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);
252
267
  }
253
- return t === "pop" && d !== null && (u.push(d.path + d.search + d.hash), N = u.key()), !1;
254
- }, C = (e) => {
255
- 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);
256
271
  try {
257
- return r(e, p), Promise.resolve(!1);
272
+ return i(e, g), Promise.resolve(!1);
258
273
  } catch (e) {
259
274
  return Promise.reject(e);
260
275
  }
261
- }, w = (e) => {
276
+ }, C = (e) => {
262
277
  try {
263
- return Promise.resolve(S(e));
278
+ return Promise.resolve(x(e));
264
279
  } catch (e) {
265
- return C(e);
280
+ return S(e);
266
281
  }
267
- }, T;
282
+ }, w;
268
283
  try {
269
- T = O(x, 0);
284
+ w = k(_, 0);
270
285
  } catch (e) {
271
- return C(e);
286
+ return S(e);
272
287
  }
273
- 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);
274
289
  }
275
- let z = u.listen(() => {
290
+ let B = u.listen(() => {
276
291
  let e = u.read();
277
- R(e.path + e.search + e.hash, "pop");
278
- }), B = u.read();
279
- R(B.path + B.search + B.hash, "start");
280
- 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) => {
281
296
  let t = h(e, (e) => u.toAppUrl(e));
282
297
  if (t === null) return;
283
298
  e.preventDefault();
284
- let n = i(v);
285
- R(t, t === n.path + n.search + n.hash ? "replace" : "push");
286
- }, H = l.links !== !1 && typeof document < "u";
287
- return H && document.addEventListener("click", V), {
288
- location: () => v(),
289
- match: () => P(),
290
- params: () => F(),
291
- query: () => I(),
292
- pending: () => E(),
293
- navigate: (e, t) => R(e.includes(":") || t?.query || t?.hash ? L(e, t) : e, t?.replace ? "replace" : "push"),
294
- 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)),
295
310
  setQuery(e, t) {
296
- let n = i(v), r = {
311
+ let n = s(b), r = {
297
312
  ...Object.fromEntries(new URLSearchParams(n.search)),
298
313
  ...e
299
314
  };
300
- R(n.path + C(r) + n.hash, t?.push ? "push" : "replace");
315
+ z(n.path + C(r) + n.hash, t?.push ? "push" : "replace");
301
316
  },
302
317
  onLeave(e) {
303
- D.add(e), t(() => D.delete(e));
318
+ O.add(e), c(() => O.delete(e));
304
319
  },
305
320
  view() {
306
321
  let t = (n, r) => {
307
- let a = e(() => P()?.routes[n] ?? null);
322
+ let i = e(() => F()?.routes[n] ?? null);
308
323
  return () => {
309
- let e = a();
310
- return i(() => {
324
+ let e = i();
325
+ return s(() => {
311
326
  if (e === null) return r?.component ? r.component() : null;
312
327
  let i = t(n + 1, e);
313
328
  return e.layout ? e.layout({ children: i }) : i;
@@ -317,27 +332,27 @@ function D(l) {
317
332
  return t(0, null);
318
333
  },
319
334
  isActive(e, t = !1) {
320
- let n = v().path.replace(/\/$/, "") || "/", r = m(e).path.replace(/\/$/, "") || "/";
335
+ let n = b().path.replace(/\/$/, "") || "/", r = m(e).path.replace(/\/$/, "") || "/";
321
336
  return t ? n === r : n === r || n.startsWith(`${r}/`);
322
337
  },
323
338
  dispose() {
324
- z(), H && document.removeEventListener("click", V);
339
+ B(), U && document.removeEventListener("click", H);
325
340
  }
326
341
  };
327
342
  }
328
- function O(e, t) {
343
+ function k(e, t) {
329
344
  for (let n = t; n < e.length; n++) {
330
345
  let t = e[n]();
331
- 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);
332
347
  if (t !== !0) return t;
333
348
  }
334
349
  return !0;
335
350
  }
336
- function k(e) {
351
+ function A(e) {
337
352
  return typeof e?.then == "function";
338
353
  }
339
- function A(e, t) {
354
+ function j(e, t) {
340
355
  let n = Object.keys(e);
341
356
  return n.length === Object.keys(t).length && n.every((n) => Object.is(e[n], t[n]));
342
357
  }
343
- 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 };
@@ -0,0 +1,33 @@
1
+ import { S as e, b as t, r as n } from "./graph-CR2WKbwr.js";
2
+ // src/core/computed.ts
3
+ function r(r, a) {
4
+ let o = {
5
+ kind: 2,
6
+ fn: r,
7
+ value: void 0,
8
+ equals: a?.equals ?? Object.is,
9
+ hasValue: !1,
10
+ hasError: !1,
11
+ error: void 0,
12
+ computing: !1,
13
+ state: 2,
14
+ sources: [],
15
+ observers: [],
16
+ seenBy: 0,
17
+ flushId: 0,
18
+ flushRuns: 0,
19
+ owner: null,
20
+ children: null,
21
+ cleanups: null,
22
+ disposed: !1
23
+ };
24
+ return n(o), () => {
25
+ if (o.computing) throw i(o);
26
+ if (o.state !== 0 && e(o), t(o), o.hasError) throw o.error;
27
+ return o.value;
28
+ };
29
+ }
30
+ function i(e) {
31
+ return /* @__PURE__ */ Error("[keits] cycle detected");
32
+ }
33
+ export { r as t };
@@ -0,0 +1,129 @@
1
+ import { a as e, n as t } from "./namespaces-BSRrBJIU.js";
2
+ import { d as n, g as r, i, l as a, s as o } from "./graph-CR2WKbwr.js";
3
+ import { t as s } from "./unsafe-keys-C5PMlerl.js";
4
+ import { t as c } from "./render-effect-UFDi2Pfh.js";
5
+ // src/dom/events.ts
6
+ function l(e, t, r) {
7
+ let i = r, a;
8
+ if (Array.isArray(r) && ([i, a] = r), typeof i != "function") throw Error("[keits] bad handler");
9
+ n() || u(e, t.slice(2), i, a);
10
+ }
11
+ function u(e, t, n, s) {
12
+ let c = o();
13
+ e.addEventListener(t, (e) => {
14
+ i(() => {
15
+ try {
16
+ let t = r(c, () => n(e));
17
+ d(t) && t.then(void 0, (e) => i(() => a(e, c)));
18
+ } catch (e) {
19
+ a(e, c);
20
+ }
21
+ });
22
+ }, s);
23
+ }
24
+ function d(e) {
25
+ return typeof e?.then == "function";
26
+ }
27
+ // src/dom/props.ts
28
+ var f = /* @__PURE__ */ new Set([
29
+ "innerhtml",
30
+ "outerhtml",
31
+ "srcdoc"
32
+ ]), p = /* @__PURE__ */ new Set([
33
+ "href",
34
+ "src",
35
+ "action",
36
+ "formaction",
37
+ "poster",
38
+ "cite",
39
+ "data",
40
+ "xlink:href",
41
+ "to",
42
+ "from",
43
+ "values"
44
+ ]), m = "about:invalid#keits-blocked";
45
+ function h(e, t) {
46
+ for (let n in t) {
47
+ let r = t[n];
48
+ n !== "ref" && (n === "class" ? b(e, r) : n === "style" ? w(e, r) : n.toLowerCase().startsWith("on") ? l(e, n, r) : typeof r == "function" ? c(() => g(e, n, r())) : g(e, n, r));
49
+ }
50
+ }
51
+ function g(e, t, r) {
52
+ let i = t.toLowerCase();
53
+ if (f.has(i) || s.has(t) || i.startsWith("on") && typeof r == "string") throw Error("[keits] unsafe prop");
54
+ p.has(i) && r != null && r !== !1 && _(String(r)) && (r = m), t in e && e.namespaceURI !== "http://www.w3.org/2000/svg" ? (e[t] = r, n() && v(e, t, r)) : t.startsWith("aria-") && typeof r == "boolean" ? e.setAttribute(t, String(r)) : r == null || r === !1 ? e.removeAttribute(t) : e.setAttribute(t, r === !0 ? "" : String(r));
55
+ }
56
+ function _(e) {
57
+ return e.replace(/[\u0000-\u0020]/g, "").toLowerCase().split(";").some((e) => e.startsWith("javascript:"));
58
+ }
59
+ function v(e, t, n) {
60
+ t === "value" ? e.localName === "textarea" ? e.textContent = n == null ? "" : String(n) : e.localName === "select" ? y(e, n == null ? "" : String(n)) : n == null ? e.removeAttribute("value") : e.setAttribute("value", String(n)) : (t === "checked" || t === "selected") && e.toggleAttribute(t, n === !0);
61
+ }
62
+ function y(e, t) {
63
+ for (let n = e.firstChild; n !== null; n = n.nextSibling) {
64
+ if (n.nodeType !== 1) continue;
65
+ let e = n;
66
+ e.localName === "option" ? e.toggleAttribute("selected", (e.getAttribute("value") ?? e.textContent) === t) : y(e, t);
67
+ }
68
+ }
69
+ function b(e, t) {
70
+ if (typeof t == "function") {
71
+ c(() => x(e, C(t())));
72
+ return;
73
+ }
74
+ let n = [], r = [];
75
+ S(t, n, (e, t) => r.push([e, t])), n.length > 0 && e.classList.add(...n);
76
+ for (let [t, n] of r) c(() => e.classList.toggle(t, n()));
77
+ }
78
+ function x(e, t) {
79
+ t === "" ? e.removeAttribute("class") : e.setAttribute("class", t);
80
+ }
81
+ function S(e, t, n) {
82
+ if (e) {
83
+ if (typeof e == "string") for (let n of e.split(/\s+/)) n && t.push(n);
84
+ else if (Array.isArray(e)) for (let r of e) S(r, t, n);
85
+ else for (let [r, i] of Object.entries(e)) typeof i == "function" ? n ? n(r, i) : i() && t.push(r) : i && t.push(r);
86
+ }
87
+ }
88
+ function C(e) {
89
+ let t = [];
90
+ return S(e, t), t.join(" ");
91
+ }
92
+ function w(e, t) {
93
+ let n = e.style;
94
+ if (typeof t == "function") {
95
+ let e = [];
96
+ c(() => {
97
+ let r = t();
98
+ if (typeof r == "string" || r == null) {
99
+ n.cssText = r ?? "", e = [];
100
+ return;
101
+ }
102
+ let i = Object.keys(r);
103
+ for (let t of e) t in r || n.removeProperty(t);
104
+ for (let e of i) E(n, e, T(r[e]));
105
+ e = i;
106
+ });
107
+ } else if (typeof t == "string") n.cssText = t;
108
+ else if (t != null) for (let [e, r] of Object.entries(t)) typeof r == "function" ? c(() => E(n, e, r())) : E(n, e, r);
109
+ }
110
+ function T(e) {
111
+ return typeof e == "function" ? e() : e;
112
+ }
113
+ function E(e, t, n) {
114
+ n == null || n === "" ? e.removeProperty(t) : e.setProperty(t, String(n));
115
+ }
116
+ // src/dom/element.ts
117
+ function D(e) {
118
+ return O(e, null);
119
+ }
120
+ function O(n, r) {
121
+ return (i, a) => {
122
+ let o = e.element(n, r);
123
+ return k(i) ? (t(o, a), h(o, i), typeof i.ref == "function" && i.ref(o)) : i == null ? t(o, a) : t(o, i), o;
124
+ };
125
+ }
126
+ function k(e) {
127
+ return typeof e == "object" && !!e && !Array.isArray(e) && typeof e.nodeType != "number";
128
+ }
129
+ export { D as n, O as t };