what-core 0.14.0 → 0.15.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 (145) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -38
  3. package/a11y.d.ts +128 -0
  4. package/data.d.ts +294 -0
  5. package/dist/a11y.js +510 -0
  6. package/dist/a11y.min.js +413 -0
  7. package/dist/actions.js +158 -0
  8. package/dist/actions.min.js +112 -0
  9. package/dist/animation.js +481 -0
  10. package/dist/animation.min.js +295 -0
  11. package/dist/async.js +180 -0
  12. package/dist/async.min.js +134 -0
  13. package/dist/components.js +577 -0
  14. package/dist/components.min.js +413 -0
  15. package/dist/data.js +1212 -0
  16. package/dist/data.min.js +918 -0
  17. package/dist/diagnostics.js +187 -0
  18. package/dist/diagnostics.min.js +134 -0
  19. package/dist/dom.js +796 -0
  20. package/dist/dom.min.js +603 -0
  21. package/dist/entries/a11y.js +43 -0
  22. package/dist/entries/a11y.min.js +43 -0
  23. package/dist/entries/data.js +29 -0
  24. package/dist/entries/data.min.js +29 -0
  25. package/dist/entries/dom.js +45 -0
  26. package/dist/entries/dom.min.js +45 -0
  27. package/dist/entries/form.js +31 -0
  28. package/dist/entries/form.min.js +31 -0
  29. package/dist/entries/internal.js +123 -0
  30. package/dist/entries/internal.min.js +123 -0
  31. package/dist/entries/motion.js +23 -0
  32. package/dist/entries/motion.min.js +23 -0
  33. package/dist/entries/ui.js +25 -0
  34. package/dist/entries/ui.min.js +25 -0
  35. package/dist/env.js +5 -0
  36. package/dist/env.min.js +5 -0
  37. package/dist/errors.js +1518 -0
  38. package/dist/errors.min.js +548 -0
  39. package/dist/form.js +936 -0
  40. package/dist/form.min.js +703 -0
  41. package/dist/guardrails.js +84 -0
  42. package/dist/guardrails.min.js +55 -0
  43. package/dist/h.js +232 -0
  44. package/dist/h.min.js +171 -0
  45. package/dist/head.js +241 -0
  46. package/dist/head.min.js +207 -0
  47. package/dist/helpers.js +126 -0
  48. package/dist/helpers.min.js +98 -0
  49. package/dist/hooks.js +255 -0
  50. package/dist/hooks.min.js +153 -0
  51. package/dist/hot.js +215 -0
  52. package/dist/hot.min.js +24 -0
  53. package/dist/hydration-data.js +495 -0
  54. package/dist/hydration-data.min.js +371 -0
  55. package/dist/import-changes.js +273 -0
  56. package/dist/import-changes.min.js +272 -0
  57. package/dist/index.js +95 -0
  58. package/dist/index.min.js +95 -227
  59. package/dist/jsx-dev-runtime.js +10 -0
  60. package/dist/jsx-dev-runtime.min.js +10 -1
  61. package/dist/jsx-runtime.js +27 -0
  62. package/dist/jsx-runtime.min.js +15 -1
  63. package/dist/live.js +54 -0
  64. package/dist/live.min.js +49 -0
  65. package/dist/markup-rules.js +250 -0
  66. package/dist/markup-rules.min.js +213 -0
  67. package/dist/reactive.js +3334 -0
  68. package/dist/reactive.min.js +2033 -0
  69. package/dist/render.js +4746 -0
  70. package/dist/render.min.js +2797 -1
  71. package/dist/scheduler.js +225 -0
  72. package/dist/scheduler.min.js +162 -0
  73. package/dist/selector.js +11 -0
  74. package/dist/selector.min.js +10 -0
  75. package/dist/server-context.js +148 -0
  76. package/dist/server-context.min.js +121 -0
  77. package/dist/skeleton.js +342 -0
  78. package/dist/skeleton.min.js +310 -0
  79. package/dist/store.js +72 -0
  80. package/dist/store.min.js +50 -0
  81. package/dist/testing.js +720 -0
  82. package/dist/testing.min.js +458 -1
  83. package/dist/vnode-adoption.js +19 -0
  84. package/dist/vnode-adoption.min.js +19 -0
  85. package/dist/vnode-renderer.js +61 -0
  86. package/dist/vnode-renderer.min.js +47 -0
  87. package/dom.d.ts +44 -0
  88. package/form.d.ts +218 -0
  89. package/hot.d.ts +35 -0
  90. package/index.d.ts +421 -736
  91. package/internal.d.ts +284 -0
  92. package/jsx-runtime.d.ts +160 -137
  93. package/markup-rules.d.ts +83 -0
  94. package/motion.d.ts +156 -0
  95. package/package.json +117 -3
  96. package/render.d.ts +278 -29
  97. package/src/a11y.js +64 -59
  98. package/src/actions.js +226 -0
  99. package/src/animation.js +105 -57
  100. package/src/async.js +259 -0
  101. package/src/components.js +495 -144
  102. package/src/data.js +1410 -1159
  103. package/src/diagnostics.js +263 -0
  104. package/src/dom.js +1159 -872
  105. package/src/entries/a11y.js +24 -0
  106. package/src/entries/data.js +17 -0
  107. package/src/entries/dom.js +29 -0
  108. package/src/entries/form.js +16 -0
  109. package/src/entries/internal.js +63 -0
  110. package/src/entries/motion.js +13 -0
  111. package/src/entries/ui.js +13 -0
  112. package/src/env-development.js +12 -0
  113. package/src/env.js +33 -0
  114. package/src/errors.js +1144 -168
  115. package/src/form.js +723 -225
  116. package/src/guardrails.js +38 -126
  117. package/src/h.js +227 -152
  118. package/src/head.js +189 -19
  119. package/src/helpers.js +47 -75
  120. package/src/hooks.js +233 -248
  121. package/src/hot.js +316 -0
  122. package/src/hydration-data.js +859 -16
  123. package/src/import-changes.js +156 -0
  124. package/src/index.js +38 -188
  125. package/src/jsx-dev-runtime.js +7 -14
  126. package/src/jsx-runtime.js +25 -9
  127. package/src/live.js +80 -0
  128. package/src/markup-rules.js +387 -0
  129. package/src/reactive.js +4400 -862
  130. package/src/render.js +6502 -2570
  131. package/src/scheduler.js +56 -21
  132. package/src/selector.js +31 -0
  133. package/src/server-context.js +252 -22
  134. package/src/skeleton.js +22 -12
  135. package/src/store.js +17 -31
  136. package/src/testing.js +389 -63
  137. package/src/vnode-adoption.js +48 -0
  138. package/src/vnode-renderer.js +114 -0
  139. package/testing.d.ts +81 -1
  140. package/ui.d.ts +20 -0
  141. package/dist/chunk-6YOUZ6T4.min.js +0 -1
  142. package/dist/chunk-FN6HXME3.min.js +0 -11
  143. package/dist/chunk-VKZY7JPN.min.js +0 -1
  144. package/src/agent-context.js +0 -127
  145. package/src/warnings.js +0 -193
@@ -0,0 +1,84 @@
1
+ // src/guardrails.js
2
+ import { IMPORT_CHANGES } from "./import-changes.js";
3
+ import * as rootEntry from "./index.js";
4
+ var guardrails = {
5
+ importValidation: true
6
+ };
7
+ function configureGuardrails(overrides) {
8
+ Object.assign(guardrails, overrides);
9
+ }
10
+ function getGuardrailConfig() {
11
+ return { ...guardrails };
12
+ }
13
+ var exportIndex = null;
14
+ function exportsIndex() {
15
+ if (exportIndex === null) {
16
+ const changed = /* @__PURE__ */ new Map();
17
+ for (const change of IMPORT_CHANGES) {
18
+ changed.set(change.name, change);
19
+ if (change.as) changed.set(change.as, change);
20
+ }
21
+ exportIndex = { valid: new Set(Object.keys(rootEntry)), changed };
22
+ }
23
+ return exportIndex;
24
+ }
25
+ function validateImports(importNames) {
26
+ if (!(process.env.NODE_ENV !== "production") || !guardrails.importValidation) return [];
27
+ const { valid, changed } = exportsIndex();
28
+ const invalid = [];
29
+ for (const name of importNames) {
30
+ if (valid.has(name)) continue;
31
+ const change = changed.get(name);
32
+ if (change) {
33
+ invalid.push({
34
+ name,
35
+ message: `"${name}" is not exported by what-framework.`,
36
+ suggestion: change.answer
37
+ });
38
+ } else {
39
+ const closest = findClosest(name);
40
+ invalid.push({
41
+ name,
42
+ message: `"${name}" is not a valid export from what-framework.`,
43
+ suggestion: closest ? `Check the API reference. Did you mean ${closest}?` : "Check the API reference."
44
+ });
45
+ }
46
+ }
47
+ return invalid;
48
+ }
49
+ function findClosest(input) {
50
+ const lower = input.toLowerCase();
51
+ let best = null;
52
+ let bestDist = Infinity;
53
+ for (const name of exportsIndex().valid) {
54
+ const dist = levenshtein(lower, name.toLowerCase());
55
+ if (dist < bestDist) {
56
+ bestDist = dist;
57
+ best = name;
58
+ }
59
+ }
60
+ return bestDist <= 3 ? best : null;
61
+ }
62
+ function levenshtein(a, b) {
63
+ if (a.length === 0) return b.length;
64
+ if (b.length === 0) return a.length;
65
+ const matrix = [];
66
+ for (let i = 0; i <= b.length; i++) matrix[i] = [i];
67
+ for (let j = 0; j <= a.length; j++) matrix[0][j] = j;
68
+ for (let i = 1; i <= b.length; i++) {
69
+ for (let j = 1; j <= a.length; j++) {
70
+ const cost = b[i - 1] === a[j - 1] ? 0 : 1;
71
+ matrix[i][j] = Math.min(
72
+ matrix[i - 1][j] + 1,
73
+ matrix[i][j - 1] + 1,
74
+ matrix[i - 1][j - 1] + cost
75
+ );
76
+ }
77
+ }
78
+ return matrix[b.length][a.length];
79
+ }
80
+ export {
81
+ configureGuardrails,
82
+ getGuardrailConfig,
83
+ validateImports
84
+ };
@@ -0,0 +1,55 @@
1
+ // src/guardrails.js
2
+ import { IMPORT_CHANGES as c } from "./import-changes.min.js";
3
+ import * as u from "./index.min.js";
4
+ var a = {
5
+ importValidation: !0
6
+ };
7
+ function m(n) {
8
+ Object.assign(a, n);
9
+ }
10
+ function p() {
11
+ return { ...a };
12
+ }
13
+ var s = null;
14
+ function f() {
15
+ if (s === null) {
16
+ let n = /* @__PURE__ */ new Map();
17
+ for (let o of c)
18
+ n.set(o.name, o), o.as && n.set(o.as, o);
19
+ s = { valid: new Set(Object.keys(u)), changed: n };
20
+ }
21
+ return s;
22
+ }
23
+ function w(n) {
24
+ return [];
25
+ }
26
+ function g(n) {
27
+ let o = n.toLowerCase(), r = null, e = 1 / 0;
28
+ for (let t of f().valid) {
29
+ let i = h(o, t.toLowerCase());
30
+ i < e && (e = i, r = t);
31
+ }
32
+ return e <= 3 ? r : null;
33
+ }
34
+ function h(n, o) {
35
+ if (n.length === 0) return o.length;
36
+ if (o.length === 0) return n.length;
37
+ let r = [];
38
+ for (let e = 0; e <= o.length; e++) r[e] = [e];
39
+ for (let e = 0; e <= n.length; e++) r[0][e] = e;
40
+ for (let e = 1; e <= o.length; e++)
41
+ for (let t = 1; t <= n.length; t++) {
42
+ let i = o[e - 1] === n[t - 1] ? 0 : 1;
43
+ r[e][t] = Math.min(
44
+ r[e - 1][t] + 1,
45
+ r[e][t - 1] + 1,
46
+ r[e - 1][t - 1] + i
47
+ );
48
+ }
49
+ return r[o.length][n.length];
50
+ }
51
+ export {
52
+ m as configureGuardrails,
53
+ p as getGuardrailConfig,
54
+ w as validateImports
55
+ };
package/dist/h.js ADDED
@@ -0,0 +1,232 @@
1
+ // src/h.js
2
+ import { createDOM, _setVNodeProp, _isUnsafeAttr } from "./dom.js";
3
+ import { _vnodeRows, _isSvgParent } from "./render.js";
4
+ import { VNode } from "./vnode-renderer.js";
5
+ import { installVNodeRuntime } from "./vnode-adoption.js";
6
+ import { _symbolChild } from "./reactive.js";
7
+ import { isServerRender } from "./server-context.js";
8
+ function vnodeProducer(produce) {
9
+ installVNodeRuntime(
10
+ // `inParent` 1: a vnode rendered as a value of `parent` (render.js
11
+ // valuesToNodes) is SVG in an SVG element, which only this renderer asks,
12
+ // so a program that makes no vnode does not carry the question.
13
+ (vnode, parent, isSvg, inParent) => createDOM(vnode, parent, isSvg || inParent === 1 && _isSvgParent(parent)),
14
+ (value, rows, isSvg, scope, end, adopted) => _vnodeRows(value, rows, isSvg, scope, end, adopted),
15
+ (el, key, value, isSvg) => _setVNodeProp(el, key, value, isSvg),
16
+ (key, value) => _isUnsafeAttr(key, value)
17
+ );
18
+ return produce;
19
+ }
20
+ var EMPTY_OBJ = /* @__PURE__ */ Object.create(null);
21
+ var EMPTY_ARR = [];
22
+ var h = /* @__PURE__ */ vnodeProducer(function h2(tag, props) {
23
+ props = props || EMPTY_OBJ;
24
+ const argLen = arguments.length;
25
+ let flat;
26
+ if (argLen <= 2) {
27
+ flat = typeof tag === "string" && props.children != null ? _flattenSingle(props.children) : EMPTY_ARR;
28
+ } else if (argLen === 3) {
29
+ flat = _flattenSingle(arguments[2]);
30
+ } else {
31
+ const out = [];
32
+ for (let i = 2; i < argLen; i++) {
33
+ _flattenInto(arguments[i], out);
34
+ }
35
+ flat = out;
36
+ }
37
+ const keyed = props.key !== void 0 && (typeof props.key !== "function" || props.key._signal === true || props.key.length === 0);
38
+ const key = keyed ? props.key ?? null : null;
39
+ if (keyed) {
40
+ const { key: _key, ...rest } = props;
41
+ props = rest;
42
+ }
43
+ return new VNode(tag, props, flat, key);
44
+ });
45
+ var _jsxVNode = /* @__PURE__ */ vnodeProducer(function _jsxVNode2(tag, props, children, key) {
46
+ let flat;
47
+ if (children === void 0) flat = EMPTY_ARR;
48
+ else if (Array.isArray(children)) {
49
+ flat = [];
50
+ _flattenInto(children, flat);
51
+ } else flat = _flattenSingle(children);
52
+ return new VNode(tag, props, flat, key);
53
+ });
54
+ var _vnode = /* @__PURE__ */ vnodeProducer(function _vnode2(tag, props, children) {
55
+ return new VNode(tag, props, children, null);
56
+ });
57
+ function lowered(Component) {
58
+ Component._lowered = true;
59
+ return Component;
60
+ }
61
+ var Fragment = /* @__PURE__ */ lowered(function Fragment2({ children }) {
62
+ return children;
63
+ });
64
+ function _flattenSingle(child) {
65
+ if (child == null || typeof child === "boolean" || typeof child === "symbol") {
66
+ if ((process.env.NODE_ENV !== "production") && typeof child === "symbol") symbolChild(child);
67
+ return EMPTY_ARR;
68
+ }
69
+ if (Array.isArray(child)) {
70
+ const out = [];
71
+ _flattenInto(child, out);
72
+ return out;
73
+ }
74
+ const type = typeof child;
75
+ return [type === "object" || type === "function" ? child : String(child)];
76
+ }
77
+ function symbolChild(child) {
78
+ _symbolChild(child, isServerRender() ? "server" : "client");
79
+ }
80
+ function _flattenInto(child, out) {
81
+ if (child == null || typeof child === "boolean" || typeof child === "symbol") {
82
+ if ((process.env.NODE_ENV !== "production") && typeof child === "symbol") symbolChild(child);
83
+ return;
84
+ }
85
+ if (Array.isArray(child)) {
86
+ for (let i = 0; i < child.length; i++) {
87
+ _flattenInto(child[i], out);
88
+ }
89
+ return;
90
+ }
91
+ const type = typeof child;
92
+ out.push(type === "object" || type === "function" ? child : String(child));
93
+ }
94
+ var VOID_TAGS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
95
+ var PLACEHOLDER = /^\x00(\d+)\x00/;
96
+ var OPEN_TAG = /^<(?:([a-zA-Z][\w:.-]*)|\x00(\d+)\x00)/;
97
+ var ATTR_NAME = /^[a-zA-Z_@:][\w:.-]*/;
98
+ function html(strings, ...values) {
99
+ const src = strings.reduce((acc, str, i) => acc + str + (i < values.length ? `\0${i}\0` : ""), "");
100
+ const nodes = [];
101
+ parseChildren(src.trim(), 0, values, nodes, true);
102
+ return nodes.length === 1 ? nodes[0] : nodes;
103
+ }
104
+ function parseChildren(src, i, values, out, topLevel) {
105
+ let text = "";
106
+ const flushText = () => {
107
+ const t = jsxText(text);
108
+ if (t) out.push(t);
109
+ text = "";
110
+ };
111
+ while (i < src.length) {
112
+ if (src[i] === "<") {
113
+ if (src.startsWith("<!--", i)) {
114
+ const close = src.indexOf("-->", i + 4);
115
+ i = close === -1 ? src.length : close + 3;
116
+ continue;
117
+ }
118
+ if (src[i + 1] === "/") {
119
+ const close = src.indexOf(">", i + 2);
120
+ i = close === -1 ? src.length : close + 1;
121
+ if (topLevel) continue;
122
+ flushText();
123
+ return i;
124
+ }
125
+ const el = parseElement(src, i, values);
126
+ if (el) {
127
+ flushText();
128
+ out.push(el.node);
129
+ i = el.end;
130
+ continue;
131
+ }
132
+ }
133
+ const ph = src[i] === "\0" && PLACEHOLDER.exec(src.slice(i));
134
+ if (ph) {
135
+ flushText();
136
+ out.push(values[Number(ph[1])]);
137
+ i += ph[0].length;
138
+ continue;
139
+ }
140
+ text += src[i++];
141
+ }
142
+ flushText();
143
+ return i;
144
+ }
145
+ function parseElement(src, start, values) {
146
+ const open = OPEN_TAG.exec(src.slice(start));
147
+ if (!open) return null;
148
+ const tag = open[1] ?? values[Number(open[2])];
149
+ let i = start + open[0].length;
150
+ const props = {};
151
+ let selfClosed = false;
152
+ while (i < src.length) {
153
+ while (i < src.length && /\s/.test(src[i])) i++;
154
+ if (src.startsWith("/>", i)) {
155
+ selfClosed = true;
156
+ i += 2;
157
+ break;
158
+ }
159
+ if (src[i] === ">") {
160
+ i++;
161
+ break;
162
+ }
163
+ const spread = PLACEHOLDER.exec(src.slice(src.startsWith("...", i) ? i + 3 : i));
164
+ if (spread) {
165
+ Object.assign(props, values[Number(spread[1])]);
166
+ i += (src.startsWith("...", i) ? 3 : 0) + spread[0].length;
167
+ continue;
168
+ }
169
+ const name = ATTR_NAME.exec(src.slice(i));
170
+ if (!name) {
171
+ i++;
172
+ continue;
173
+ }
174
+ i += name[0].length;
175
+ while (i < src.length && /\s/.test(src[i])) i++;
176
+ if (src[i] !== "=") {
177
+ props[name[0]] = true;
178
+ continue;
179
+ }
180
+ i++;
181
+ while (i < src.length && /\s/.test(src[i])) i++;
182
+ const quote = src[i] === '"' || src[i] === "'" ? src[i++] : null;
183
+ const parts = [];
184
+ let str = "";
185
+ while (i < src.length && (quote ? src[i] !== quote : !/[\s>]/.test(src[i]) && !src.startsWith("/>", i))) {
186
+ const ph = src[i] === "\0" && PLACEHOLDER.exec(src.slice(i));
187
+ if (ph) {
188
+ if (str) parts.push(str);
189
+ str = "";
190
+ parts.push(values[Number(ph[1])]);
191
+ i += ph[0].length;
192
+ } else str += src[i++];
193
+ }
194
+ if (quote) i++;
195
+ if (str) parts.push(str);
196
+ props[name[0]] = attrValue(parts, quote);
197
+ }
198
+ const children = [];
199
+ if (!selfClosed && !(typeof tag === "string" && VOID_TAGS.has(tag.toLowerCase()))) {
200
+ i = parseChildren(src, i, values, children, false);
201
+ }
202
+ return {
203
+ node: h(tag, Object.keys(props).length ? props : null, ...children),
204
+ end: i
205
+ };
206
+ }
207
+ function attrValue(parts, quoted) {
208
+ if (parts.length === 1 && typeof parts[0] !== "string") return parts[0];
209
+ if (parts.length === 0) return quoted ? "" : true;
210
+ const join = () => parts.map((p) => typeof p === "function" ? p() : p).join("");
211
+ return parts.some((p) => typeof p === "function") ? join : join();
212
+ }
213
+ function jsxText(raw) {
214
+ if (!/[\r\n]/.test(raw)) return raw;
215
+ const lines = raw.split(/\r\n|\n|\r/);
216
+ let out = "";
217
+ for (let k = 0; k < lines.length; k++) {
218
+ let line = lines[k].replace(/\t/g, " ");
219
+ if (k > 0) line = line.replace(/^ +/, "");
220
+ if (k < lines.length - 1) line = line.replace(/ +$/, "");
221
+ if (line) out += (out ? " " : "") + line;
222
+ }
223
+ return out;
224
+ }
225
+ export {
226
+ Fragment,
227
+ _jsxVNode,
228
+ _vnode,
229
+ h,
230
+ html,
231
+ lowered
232
+ };
package/dist/h.min.js ADDED
@@ -0,0 +1,171 @@
1
+ // src/h.js
2
+ import { createDOM as w, _setVNodeProp as A, _isUnsafeAttr as N } from "./dom.min.js";
3
+ import { _vnodeRows as j, _isSvgParent as O } from "./render.min.js";
4
+ import { VNode as b } from "./vnode-renderer.min.js";
5
+ import { installVNodeRuntime as E } from "./vnode-adoption.min.js";
6
+ function d(e) {
7
+ return E(
8
+ // `inParent` 1: a vnode rendered as a value of `parent` (render.js
9
+ // valuesToNodes) is SVG in an SVG element, which only this renderer asks,
10
+ // so a program that makes no vnode does not carry the question.
11
+ (n, o, l, i) => w(n, o, l || i === 1 && O(o)),
12
+ (n, o, l, i, t, f) => j(n, o, l, i, t, f),
13
+ (n, o, l, i) => A(n, o, l, i),
14
+ (n, o) => N(n, o)
15
+ ), e;
16
+ }
17
+ var V = /* @__PURE__ */ Object.create(null), p = [], T = /* @__PURE__ */ d(function(n, o) {
18
+ o = o || V;
19
+ let l = arguments.length, i;
20
+ if (l <= 2)
21
+ i = typeof n == "string" && o.children != null ? _(o.children) : p;
22
+ else if (l === 3)
23
+ i = _(arguments[2]);
24
+ else {
25
+ let r = [];
26
+ for (let u = 2; u < l; u++)
27
+ y(arguments[u], r);
28
+ i = r;
29
+ }
30
+ let t = o.key !== void 0 && (typeof o.key != "function" || o.key._signal === !0 || o.key.length === 0), f = t ? o.key ?? null : null;
31
+ if (t) {
32
+ let { key: r, ...u } = o;
33
+ o = u;
34
+ }
35
+ return new b(n, o, i, f);
36
+ }), G = /* @__PURE__ */ d(function(n, o, l, i) {
37
+ let t;
38
+ return l === void 0 ? t = p : Array.isArray(l) ? (t = [], y(l, t)) : t = _(l), new b(n, o, t, i);
39
+ }), I = /* @__PURE__ */ d(function(n, o, l) {
40
+ return new b(n, o, l, null);
41
+ });
42
+ function C(e) {
43
+ return e._lowered = !0, e;
44
+ }
45
+ var Y = /* @__PURE__ */ C(function({ children: n }) {
46
+ return n;
47
+ });
48
+ function _(e) {
49
+ if (e == null || typeof e == "boolean" || typeof e == "symbol")
50
+ return p;
51
+ if (Array.isArray(e)) {
52
+ let o = [];
53
+ return y(e, o), o;
54
+ }
55
+ let n = typeof e;
56
+ return [n === "object" || n === "function" ? e : String(e)];
57
+ }
58
+ function y(e, n) {
59
+ if (e == null || typeof e == "boolean" || typeof e == "symbol")
60
+ return;
61
+ if (Array.isArray(e)) {
62
+ for (let l = 0; l < e.length; l++)
63
+ y(e[l], n);
64
+ return;
65
+ }
66
+ let o = typeof e;
67
+ n.push(o === "object" || o === "function" ? e : String(e));
68
+ }
69
+ var P = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]), x = /^\x00(\d+)\x00/, R = /^<(?:([a-zA-Z][\w:.-]*)|\x00(\d+)\x00)/, S = /^[a-zA-Z_@:][\w:.-]*/;
70
+ function Z(e, ...n) {
71
+ let o = e.reduce((i, t, f) => i + t + (f < n.length ? `\0${f}\0` : ""), ""), l = [];
72
+ return k(o.trim(), 0, n, l, !0), l.length === 1 ? l[0] : l;
73
+ }
74
+ function k(e, n, o, l, i) {
75
+ let t = "", f = () => {
76
+ let r = L(t);
77
+ r && l.push(r), t = "";
78
+ };
79
+ for (; n < e.length; ) {
80
+ if (e[n] === "<") {
81
+ if (e.startsWith("<!--", n)) {
82
+ let s = e.indexOf("-->", n + 4);
83
+ n = s === -1 ? e.length : s + 3;
84
+ continue;
85
+ }
86
+ if (e[n + 1] === "/") {
87
+ let s = e.indexOf(">", n + 2);
88
+ if (n = s === -1 ? e.length : s + 1, i) continue;
89
+ return f(), n;
90
+ }
91
+ let u = D(e, n, o);
92
+ if (u) {
93
+ f(), l.push(u.node), n = u.end;
94
+ continue;
95
+ }
96
+ }
97
+ let r = e[n] === "\0" && x.exec(e.slice(n));
98
+ if (r) {
99
+ f(), l.push(o[Number(r[1])]), n += r[0].length;
100
+ continue;
101
+ }
102
+ t += e[n++];
103
+ }
104
+ return f(), n;
105
+ }
106
+ function D(e, n, o) {
107
+ let l = R.exec(e.slice(n));
108
+ if (!l) return null;
109
+ let i = l[1] ?? o[Number(l[2])], t = n + l[0].length, f = {}, r = !1;
110
+ for (; t < e.length; ) {
111
+ for (; t < e.length && /\s/.test(e[t]); ) t++;
112
+ if (e.startsWith("/>", t)) {
113
+ r = !0, t += 2;
114
+ break;
115
+ }
116
+ if (e[t] === ">") {
117
+ t++;
118
+ break;
119
+ }
120
+ let s = x.exec(e.slice(e.startsWith("...", t) ? t + 3 : t));
121
+ if (s) {
122
+ Object.assign(f, o[Number(s[1])]), t += (e.startsWith("...", t) ? 3 : 0) + s[0].length;
123
+ continue;
124
+ }
125
+ let h = S.exec(e.slice(t));
126
+ if (!h) {
127
+ t++;
128
+ continue;
129
+ }
130
+ for (t += h[0].length; t < e.length && /\s/.test(e[t]); ) t++;
131
+ if (e[t] !== "=") {
132
+ f[h[0]] = !0;
133
+ continue;
134
+ }
135
+ for (t++; t < e.length && /\s/.test(e[t]); ) t++;
136
+ let a = e[t] === '"' || e[t] === "'" ? e[t++] : null, g = [], c = "";
137
+ for (; t < e.length && (a ? e[t] !== a : !/[\s>]/.test(e[t]) && !e.startsWith("/>", t)); ) {
138
+ let m = e[t] === "\0" && x.exec(e.slice(t));
139
+ m ? (c && g.push(c), c = "", g.push(o[Number(m[1])]), t += m[0].length) : c += e[t++];
140
+ }
141
+ a && t++, c && g.push(c), f[h[0]] = W(g, a);
142
+ }
143
+ let u = [];
144
+ return !r && !(typeof i == "string" && P.has(i.toLowerCase())) && (t = k(e, t, o, u, !1)), {
145
+ node: T(i, Object.keys(f).length ? f : null, ...u),
146
+ end: t
147
+ };
148
+ }
149
+ function W(e, n) {
150
+ if (e.length === 1 && typeof e[0] != "string") return e[0];
151
+ if (e.length === 0) return n ? "" : !0;
152
+ let o = () => e.map((l) => typeof l == "function" ? l() : l).join("");
153
+ return e.some((l) => typeof l == "function") ? o : o();
154
+ }
155
+ function L(e) {
156
+ if (!/[\r\n]/.test(e)) return e;
157
+ let n = e.split(/\r\n|\n|\r/), o = "";
158
+ for (let l = 0; l < n.length; l++) {
159
+ let i = n[l].replace(/\t/g, " ");
160
+ l > 0 && (i = i.replace(/^ +/, "")), l < n.length - 1 && (i = i.replace(/ +$/, "")), i && (o += (o ? " " : "") + i);
161
+ }
162
+ return o;
163
+ }
164
+ export {
165
+ Y as Fragment,
166
+ G as _jsxVNode,
167
+ I as _vnode,
168
+ T as h,
169
+ Z as html,
170
+ C as lowered
171
+ };