@vidact/runtime 0.2.0-beta.0 → 0.2.0-beta.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 (244) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +1 -1
  3. package/dist/actions.d.ts +32 -30
  4. package/dist/actions.d.ts.map +1 -1
  5. package/dist/actions.js +251 -266
  6. package/dist/actions.js.map +1 -1
  7. package/dist/async.d.ts +20 -17
  8. package/dist/async.d.ts.map +1 -1
  9. package/dist/async.js +18 -17
  10. package/dist/async.js.map +1 -1
  11. package/dist/compiled/async-resource.d.ts +9 -6
  12. package/dist/compiled/async-resource.d.ts.map +1 -1
  13. package/dist/compiled/async-resource.js +69 -77
  14. package/dist/compiled/async-resource.js.map +1 -1
  15. package/dist/compiled/core.d.ts +136 -147
  16. package/dist/compiled/core.d.ts.map +1 -1
  17. package/dist/compiled/core.js +2669 -2985
  18. package/dist/compiled/core.js.map +1 -1
  19. package/dist/compiled/types.d.ts +44 -56
  20. package/dist/compiled/types.d.ts.map +1 -1
  21. package/dist/compiled/types.js +10 -6
  22. package/dist/compiled/types.js.map +1 -1
  23. package/dist/compiled/validation.d.ts +4 -1
  24. package/dist/compiled/validation.d.ts.map +1 -1
  25. package/dist/compiled/validation.js +17 -20
  26. package/dist/compiled/validation.js.map +1 -1
  27. package/dist/component-spread.d.ts +5 -3
  28. package/dist/component-spread.d.ts.map +1 -1
  29. package/dist/component-spread.js +49 -67
  30. package/dist/component-spread.js.map +1 -1
  31. package/dist/concurrent.d.ts +20 -18
  32. package/dist/concurrent.d.ts.map +1 -1
  33. package/dist/concurrent.js +191 -210
  34. package/dist/concurrent.js.map +1 -1
  35. package/dist/direct-dom.d.ts +17 -12
  36. package/dist/direct-dom.d.ts.map +1 -1
  37. package/dist/direct-dom.js +187 -221
  38. package/dist/direct-dom.js.map +1 -1
  39. package/dist/dom/attributes.d.ts +9 -6
  40. package/dist/dom/attributes.d.ts.map +1 -1
  41. package/dist/dom/attributes.js +65 -47
  42. package/dist/dom/attributes.js.map +1 -1
  43. package/dist/dom/events.d.ts +5 -2
  44. package/dist/dom/events.d.ts.map +1 -1
  45. package/dist/dom/events.js +53 -65
  46. package/dist/dom/events.js.map +1 -1
  47. package/dist/dom/forms.d.ts +9 -6
  48. package/dist/dom/forms.d.ts.map +1 -1
  49. package/dist/dom/forms.js +152 -198
  50. package/dist/dom/forms.js.map +1 -1
  51. package/dist/dom/intrinsic.d.ts +17 -15
  52. package/dist/dom/intrinsic.d.ts.map +1 -1
  53. package/dist/dom/intrinsic.js +48 -50
  54. package/dist/dom/intrinsic.js.map +1 -1
  55. package/dist/dom/namespace.d.ts +4 -1
  56. package/dist/dom/namespace.d.ts.map +1 -1
  57. package/dist/dom/namespace.js +25 -28
  58. package/dist/dom/namespace.js.map +1 -1
  59. package/dist/dom/namespaces.d.ts +11 -8
  60. package/dist/dom/namespaces.d.ts.map +1 -1
  61. package/dist/dom/namespaces.js +14 -12
  62. package/dist/dom/namespaces.js.map +1 -1
  63. package/dist/dom/properties.d.ts +18 -16
  64. package/dist/dom/properties.d.ts.map +1 -1
  65. package/dist/dom/properties.js +273 -296
  66. package/dist/dom/properties.js.map +1 -1
  67. package/dist/dom/style-properties.d.ts +4 -1
  68. package/dist/dom/style-properties.d.ts.map +1 -1
  69. package/dist/dom/style-properties.js +49 -45
  70. package/dist/dom/style-properties.js.map +1 -1
  71. package/dist/dom/styles.d.ts +5 -2
  72. package/dist/dom/styles.d.ts.map +1 -1
  73. package/dist/dom/styles.js +47 -67
  74. package/dist/dom/styles.js.map +1 -1
  75. package/dist/dom-forms.d.ts +4 -1
  76. package/dist/dom-forms.d.ts.map +1 -1
  77. package/dist/dom-forms.js +16 -13
  78. package/dist/dom-forms.js.map +1 -1
  79. package/dist/dom-styles.d.ts +4 -1
  80. package/dist/dom-styles.d.ts.map +1 -1
  81. package/dist/dom-styles.js +10 -7
  82. package/dist/dom-styles.js.map +1 -1
  83. package/dist/framework-hydrate.d.ts +20 -17
  84. package/dist/framework-hydrate.d.ts.map +1 -1
  85. package/dist/framework-hydrate.js +128 -146
  86. package/dist/framework-hydrate.js.map +1 -1
  87. package/dist/framework-protocol.d.ts +27 -25
  88. package/dist/framework-protocol.d.ts.map +1 -1
  89. package/dist/framework-protocol.js +173 -211
  90. package/dist/framework-protocol.js.map +1 -1
  91. package/dist/framework.d.ts +34 -32
  92. package/dist/framework.d.ts.map +1 -1
  93. package/dist/framework.js +74 -93
  94. package/dist/framework.js.map +1 -1
  95. package/dist/hydrate.d.ts +11 -8
  96. package/dist/hydrate.d.ts.map +1 -1
  97. package/dist/hydrate.js +13 -9
  98. package/dist/hydrate.js.map +1 -1
  99. package/dist/hydration-bridge.d.ts +61 -58
  100. package/dist/hydration-bridge.d.ts.map +1 -1
  101. package/dist/hydration-bridge.js +67 -66
  102. package/dist/hydration-bridge.js.map +1 -1
  103. package/dist/hydration.d.ts +31 -28
  104. package/dist/hydration.d.ts.map +1 -1
  105. package/dist/hydration.js +376 -462
  106. package/dist/hydration.js.map +1 -1
  107. package/dist/index.d.ts +13 -13
  108. package/dist/index.js +11 -13
  109. package/dist/indexed-list.d.ts +8 -5
  110. package/dist/indexed-list.d.ts.map +1 -1
  111. package/dist/indexed-list.js +14 -7
  112. package/dist/indexed-list.js.map +1 -1
  113. package/dist/jsx-runtime.d.ts +10 -8
  114. package/dist/jsx-runtime.d.ts.map +1 -1
  115. package/dist/jsx-runtime.js +28 -23
  116. package/dist/jsx-runtime.js.map +1 -1
  117. package/dist/keyed-list.d.ts +13 -14
  118. package/dist/keyed-list.d.ts.map +1 -1
  119. package/dist/keyed-list.js +132 -160
  120. package/dist/keyed-list.js.map +1 -1
  121. package/dist/metadata.d.ts +6 -3
  122. package/dist/metadata.d.ts.map +1 -1
  123. package/dist/metadata.js +131 -164
  124. package/dist/metadata.js.map +1 -1
  125. package/dist/nested-prop.d.ts +4 -2
  126. package/dist/nested-prop.d.ts.map +1 -1
  127. package/dist/nested-prop.js +17 -16
  128. package/dist/nested-prop.js.map +1 -1
  129. package/dist/profiling.d.ts +11 -8
  130. package/dist/profiling.d.ts.map +1 -1
  131. package/dist/profiling.js +17 -17
  132. package/dist/profiling.js.map +1 -1
  133. package/dist/protocol.d.ts +5 -2
  134. package/dist/protocol.d.ts.map +1 -1
  135. package/dist/protocol.js +8 -5
  136. package/dist/protocol.js.map +1 -1
  137. package/dist/raw-html.d.ts +5 -2
  138. package/dist/raw-html.d.ts.map +1 -1
  139. package/dist/raw-html.js +86 -146
  140. package/dist/raw-html.js.map +1 -1
  141. package/dist/ref.d.ts +8 -3
  142. package/dist/ref.d.ts.map +1 -1
  143. package/dist/ref.js +10 -2
  144. package/dist/ref.js.map +1 -1
  145. package/dist/renderable-protocol.d.ts +26 -8
  146. package/dist/renderable-protocol.d.ts.map +1 -1
  147. package/dist/renderable-protocol.js +30 -9
  148. package/dist/renderable-protocol.js.map +1 -1
  149. package/dist/renderable.d.ts +27 -22
  150. package/dist/renderable.d.ts.map +1 -1
  151. package/dist/renderable.js +141 -133
  152. package/dist/renderable.js.map +1 -1
  153. package/dist/retained-ui.d.ts +9 -6
  154. package/dist/retained-ui.d.ts.map +1 -1
  155. package/dist/retained-ui.js +12 -10
  156. package/dist/retained-ui.js.map +1 -1
  157. package/dist/root.d.ts +18 -15
  158. package/dist/root.d.ts.map +1 -1
  159. package/dist/root.js +73 -85
  160. package/dist/root.js.map +1 -1
  161. package/dist/scheduler.d.ts +10 -8
  162. package/dist/scheduler.d.ts.map +1 -1
  163. package/dist/scheduler.js +97 -105
  164. package/dist/scheduler.js.map +1 -1
  165. package/dist/server-framework.d.ts +45 -42
  166. package/dist/server-framework.d.ts.map +1 -1
  167. package/dist/server-framework.js +209 -217
  168. package/dist/server-framework.js.map +1 -1
  169. package/dist/server.d.ts +130 -128
  170. package/dist/server.d.ts.map +1 -1
  171. package/dist/server.js +592 -706
  172. package/dist/server.js.map +1 -1
  173. package/dist/shared/promise.d.ts +6 -3
  174. package/dist/shared/promise.d.ts.map +1 -1
  175. package/dist/shared/promise.js +21 -19
  176. package/dist/shared/promise.js.map +1 -1
  177. package/dist/source-mask.d.ts +9 -6
  178. package/dist/source-mask.d.ts.map +1 -1
  179. package/dist/source-mask.js +45 -63
  180. package/dist/source-mask.js.map +1 -1
  181. package/dist/spread.d.ts +5 -2
  182. package/dist/spread.d.ts.map +1 -1
  183. package/dist/spread.js +79 -99
  184. package/dist/spread.js.map +1 -1
  185. package/dist/state-slot.d.ts +18 -15
  186. package/dist/state-slot.d.ts.map +1 -1
  187. package/dist/state-slot.js +43 -42
  188. package/dist/state-slot.js.map +1 -1
  189. package/dist/testing.d.ts +9 -6
  190. package/dist/testing.d.ts.map +1 -1
  191. package/dist/testing.js +16 -12
  192. package/dist/testing.js.map +1 -1
  193. package/package.json +8 -7
  194. package/src/actions.ts +415 -0
  195. package/src/async.ts +78 -0
  196. package/src/compiled/async-resource.ts +113 -0
  197. package/src/compiled/core.ts +4026 -0
  198. package/src/compiled/types.ts +96 -0
  199. package/src/compiled/validation.ts +23 -0
  200. package/src/component-spread.ts +86 -0
  201. package/src/concurrent.ts +310 -0
  202. package/src/direct-dom.ts +365 -0
  203. package/src/dom/attributes.ts +55 -0
  204. package/src/dom/events.ts +93 -0
  205. package/src/dom/forms.ts +220 -0
  206. package/src/dom/intrinsic.ts +94 -0
  207. package/src/dom/namespace.ts +30 -0
  208. package/src/dom/namespaces.ts +14 -0
  209. package/src/dom/properties.ts +355 -0
  210. package/src/dom/style-properties.ts +46 -0
  211. package/src/dom/styles.ts +86 -0
  212. package/src/dom-forms.ts +23 -0
  213. package/src/dom-styles.ts +11 -0
  214. package/src/env.d.ts +6 -0
  215. package/src/framework-hydrate.ts +224 -0
  216. package/src/framework-protocol.ts +335 -0
  217. package/src/framework.ts +161 -0
  218. package/src/hydrate.ts +38 -0
  219. package/src/hydration-bridge.ts +183 -0
  220. package/src/hydration.ts +556 -0
  221. package/src/index.ts +92 -0
  222. package/src/indexed-list.ts +20 -0
  223. package/src/jsx-runtime.ts +55 -0
  224. package/src/keyed-list.ts +233 -0
  225. package/src/metadata.ts +212 -0
  226. package/src/nested-prop.ts +27 -0
  227. package/src/profiling.ts +43 -0
  228. package/src/protocol.ts +8 -0
  229. package/src/raw-html.ts +206 -0
  230. package/src/ref.ts +13 -0
  231. package/src/renderable-protocol.ts +63 -0
  232. package/src/renderable.ts +283 -0
  233. package/src/retained-ui.ts +19 -0
  234. package/src/root.ts +122 -0
  235. package/src/scheduler.ts +136 -0
  236. package/src/server-framework.ts +397 -0
  237. package/src/server.ts +1143 -0
  238. package/src/shared/promise.ts +28 -0
  239. package/src/source-mask.ts +83 -0
  240. package/src/spread.ts +131 -0
  241. package/src/state-slot.ts +76 -0
  242. package/src/testing.ts +27 -0
  243. package/dist/index.d.ts.map +0 -1
  244. package/dist/index.js.map +0 -1
package/dist/server.js CHANGED
@@ -1,793 +1,679 @@
1
- // oxlint-disable-next-line typescript/triple-slash-reference -- Include compiler feature defines.
2
- /// <reference path="./env.d.ts" />
3
- import { LINK_IDENTITY_PROPS, META_IDENTITY_PROPS, SERVER_BOOLEAN_ATTRIBUTES, VALID_ATTRIBUTE_NAME, serverHtmlAttributeName, } from './dom/attributes.js';
4
- import { UNITLESS_STYLE_PROPERTIES } from './dom/style-properties.js';
5
- import { isPromiseLike } from './shared/promise.js';
6
- const SERVER_NODE = Symbol.for('vidact.v1.ServerNode');
7
- const SERVER_NODE_KIND = Symbol.for('vidact.v1.ServerNodeKind');
8
- const SERVER_CONTEXT = Symbol('Vidact.ServerContext');
9
- const SERVER_ASYNC_RESOURCE = Symbol('Vidact.ServerAsyncResource');
10
- const SERVER_SUSPENSION = Symbol('Vidact.ServerSuspension');
11
- const SERVER_RENDERABLE = Symbol.for('vidact.v1.ServerRenderable');
12
- export function createRenderable(input, construct) {
13
- return {
14
- props: input,
15
- [SERVER_RENDERABLE]: { input, construct },
16
- };
17
- }
18
- export function isRenderable(value) {
19
- return (typeof value === 'object' &&
20
- value !== null &&
21
- Object.hasOwn(value, SERVER_RENDERABLE) &&
22
- typeof value[SERVER_RENDERABLE]?.construct === 'function');
23
- }
24
- export function renderableToArray(value) {
25
- if (!isRenderable(value))
26
- throw new TypeError('expected a compiled server renderable');
27
- return [value];
28
- }
29
- export function renderableMarker(value) {
30
- if (!isRenderable(value))
31
- throw new TypeError('expected a compiled server renderable');
32
- return undefined;
33
- }
34
- export function cloneRenderable(value, overrides = {}) {
35
- if (!isRenderable(value))
36
- throw new TypeError('expected a compiled server renderable');
37
- const renderable = value[SERVER_RENDERABLE];
38
- return renderable.construct({ ...renderable.input, ...overrides });
39
- }
40
- export function cloneRenderableComponent(props) {
41
- return cloneRenderable(props.value, props.overrides);
42
- }
43
- export function renderableProps(input) {
44
- return Object.fromEntries(Object.entries(input).filter(([name]) => !['children', 'key', 'ref'].includes(name)));
45
- }
46
- export function renderableChildren(input) {
47
- return input.children;
48
- }
49
- export function renderableRef(_input) {
50
- return undefined;
51
- }
52
- export function forwardedRef(_props) {
53
- return undefined;
54
- }
55
- export function dynamicIntrinsicComponent(props) {
56
- if (typeof props.tag !== 'string') {
57
- throw new TypeError('dynamic intrinsic construction requires a string tag');
58
- }
59
- const input = props.props;
60
- return jsx(props.tag, {
61
- ...renderableProps(input),
62
- children: renderableChildren(input),
63
- });
64
- }
65
- const VOID_ELEMENTS = new Set([
66
- 'area',
67
- 'base',
68
- 'br',
69
- 'col',
70
- 'embed',
71
- 'hr',
72
- 'img',
73
- 'input',
74
- 'keygen',
75
- 'link',
76
- 'menuitem',
77
- 'meta',
78
- 'param',
79
- 'source',
80
- 'track',
81
- 'wbr',
1
+ import { isPromiseLike } from "./shared/promise.js";
2
+ import { UNITLESS_STYLE_PROPERTIES } from "./dom/style-properties.js";
3
+ import { LINK_IDENTITY_PROPS, META_IDENTITY_PROPS, SERVER_BOOLEAN_ATTRIBUTES, VALID_ATTRIBUTE_NAME, serverHtmlAttributeName } from "./dom/attributes.js";
4
+ //#region src/server.ts
5
+ const SERVER_NODE = Symbol.for("vidact.v1.ServerNode");
6
+ const SERVER_NODE_KIND = Symbol.for("vidact.v1.ServerNodeKind");
7
+ const SERVER_CONTEXT = Symbol("Vidact.ServerContext");
8
+ const SERVER_ASYNC_RESOURCE = Symbol("Vidact.ServerAsyncResource");
9
+ const SERVER_SUSPENSION = Symbol("Vidact.ServerSuspension");
10
+ const SERVER_RENDERABLE = Symbol.for("vidact.v1.ServerRenderable");
11
+ function createRenderable(input, construct) {
12
+ return {
13
+ props: input,
14
+ [SERVER_RENDERABLE]: {
15
+ input,
16
+ construct
17
+ }
18
+ };
19
+ }
20
+ function isRenderable(value) {
21
+ return typeof value === "object" && value !== null && Object.hasOwn(value, SERVER_RENDERABLE) && typeof value[SERVER_RENDERABLE]?.construct === "function";
22
+ }
23
+ function renderableToArray(value) {
24
+ if (!isRenderable(value)) throw new TypeError("expected a compiled server renderable");
25
+ return [value];
26
+ }
27
+ function renderableMarker(value) {
28
+ if (!isRenderable(value)) throw new TypeError("expected a compiled server renderable");
29
+ }
30
+ function cloneRenderable(value, overrides = {}, childrenOverride) {
31
+ if (!isRenderable(value)) throw new TypeError("expected a compiled server renderable");
32
+ const renderable = value[SERVER_RENDERABLE];
33
+ const input = {
34
+ ...renderable.input,
35
+ ...overrides
36
+ };
37
+ if (arguments.length >= 3) input.children = childrenOverride;
38
+ return renderable.construct(input);
39
+ }
40
+ function cloneRenderableComponent(props) {
41
+ if (Object.hasOwn(props, "childrenOverride")) return cloneRenderable(props.value, props.overrides, props.childrenOverride);
42
+ return cloneRenderable(props.value, props.overrides);
43
+ }
44
+ function keyedFragmentComponent(props) {
45
+ return props.children;
46
+ }
47
+ function renderableProps(input) {
48
+ return Object.fromEntries(Object.entries(input).filter(([name]) => ![
49
+ "children",
50
+ "key",
51
+ "ref"
52
+ ].includes(name)));
53
+ }
54
+ function renderableChildren(input) {
55
+ return input.children;
56
+ }
57
+ function renderableRef(_input) {}
58
+ function forwardedRef(_props) {}
59
+ function dynamicIntrinsicComponent(props) {
60
+ if (typeof props.tag !== "string") throw new TypeError("dynamic intrinsic construction requires a string tag");
61
+ const input = { ...props.props };
62
+ if (Object.hasOwn(props, "childrenOverride")) input.children = props.childrenOverride;
63
+ return jsx(props.tag, {
64
+ ...renderableProps(input),
65
+ children: renderableChildren(input)
66
+ });
67
+ }
68
+ const VOID_ELEMENTS = /* @__PURE__ */ new Set([
69
+ "area",
70
+ "base",
71
+ "br",
72
+ "col",
73
+ "embed",
74
+ "hr",
75
+ "img",
76
+ "input",
77
+ "keygen",
78
+ "link",
79
+ "menuitem",
80
+ "meta",
81
+ "param",
82
+ "source",
83
+ "track",
84
+ "wbr"
82
85
  ]);
83
- const HYDRATION_PREFIX = 'vidact:v1';
84
- const UNSAFE_HTML = typeof __VIDACT_UNSAFE_HTML__ !== 'undefined' && __VIDACT_UNSAFE_HTML__;
86
+ const HYDRATION_PREFIX = "vidact:v1";
87
+ const UNSAFE_HTML = typeof __VIDACT_UNSAFE_HTML__ !== "undefined" && __VIDACT_UNSAFE_HTML__;
85
88
  let activeRender;
86
89
  let activeFrameworkRender;
87
- const serverBuiltins = new WeakSet();
90
+ const serverBuiltins = /* @__PURE__ */ new WeakSet();
88
91
  serverBuiltins.add(dynamicIntrinsicComponent);
89
92
  serverBuiltins.add(cloneRenderableComponent);
90
- const serverPromiseResources = new WeakMap();
91
- const FRAMEWORK_HEAD_PLACEHOLDER = '<!--vidact-framework:v1:head-->';
92
- export const Fragment = Symbol('Vidact.ServerFragment');
93
+ serverBuiltins.add(keyedFragmentComponent);
94
+ const serverPromiseResources = /* @__PURE__ */ new WeakMap();
95
+ const FRAMEWORK_HEAD_PLACEHOLDER = "<!--vidact-framework:v1:head-->";
96
+ const Fragment = Symbol("Vidact.ServerFragment");
93
97
  /** @internal */
94
- export function createServerFrameworkRenderContext(signal) {
95
- return {
96
- signal,
97
- pending: new Set(),
98
- cache: new Map(),
99
- head: new Map(),
100
- stylePrecedence: [],
101
- sawHead: false,
102
- };
98
+ function createServerFrameworkRenderContext(signal) {
99
+ return {
100
+ signal,
101
+ pending: /* @__PURE__ */ new Set(),
102
+ cache: /* @__PURE__ */ new Map(),
103
+ head: /* @__PURE__ */ new Map(),
104
+ stylePrecedence: [],
105
+ sawHead: false
106
+ };
103
107
  }
104
108
  /** @internal */
105
- export function withServerFrameworkRenderContext(context, operation) {
106
- const previous = activeFrameworkRender;
107
- activeFrameworkRender = context;
108
- try {
109
- return operation();
110
- }
111
- finally {
112
- activeFrameworkRender = previous;
113
- }
114
- }
115
- export function cache(operation) {
116
- return (...arguments_) => {
117
- const context = activeFrameworkRender;
118
- if (context === undefined)
119
- return operation(...arguments_);
120
- let entries = context.cache.get(operation);
121
- if (entries === undefined) {
122
- entries = [];
123
- context.cache.set(operation, entries);
124
- }
125
- const existing = entries.find((entry) => entry.args.length === arguments_.length &&
126
- entry.args.every((argument, index) => Object.is(argument, arguments_[index])));
127
- if (existing !== undefined) {
128
- if (existing.status === 'rejected')
129
- throw existing.value;
130
- return existing.value;
131
- }
132
- try {
133
- const value = operation(...arguments_);
134
- entries.push({ args: [...arguments_], status: 'fulfilled', value });
135
- return value;
136
- }
137
- catch (error) {
138
- entries.push({ args: [...arguments_], status: 'rejected', value: error });
139
- throw error;
140
- }
141
- };
142
- }
143
- export function cacheSignal() {
144
- return activeFrameworkRender?.signal ?? null;
145
- }
146
- export function preconnect(href, options = {}) {
147
- registerResourceHint('preconnect', href, options);
148
- }
149
- export function prefetchDNS(href) {
150
- registerResourceHint('dns-prefetch', href, {});
151
- }
152
- export function preload(href, options) {
153
- registerResourceHint('preload', href, options);
154
- }
155
- export function preloadModule(href, options = {}) {
156
- registerResourceHint('modulepreload', href, options);
157
- }
158
- export function preinit(href, options) {
159
- if (options.as === 'style') {
160
- registerHeadEntry(`style:${href}`, `<link rel="stylesheet" href="${escapeAttribute(href)}"${serializeHintOptions(options)}>`, `2:${options.precedence ?? 'default'}`);
161
- return;
162
- }
163
- registerHeadEntry(`script:${href}`, `<script src="${escapeAttribute(href)}"${serializeHintOptions(options)}></script>`, '3:script');
164
- }
165
- export function preinitModule(href, options = {}) {
166
- registerHeadEntry(`module:${href}`, `<script type="module" src="${escapeAttribute(href)}"${serializeHintOptions(options)}></script>`, '3:script');
167
- }
168
- export function jsx(type, props, _key) {
169
- return createServerElement(type, props, false);
170
- }
171
- export function jsxs(type, props, _key) {
172
- return createServerElement(type, props, true);
173
- }
174
- export function jsxDEV(type, props, _key, isStaticChildren = false) {
175
- return createServerElement(type, props, isStaticChildren);
176
- }
177
- export function createElement(type, props, ...children) {
178
- const nextProps = { ...props };
179
- if (children.length === 1)
180
- nextProps.children = children[0];
181
- else if (children.length > 1)
182
- nextProps.children = children;
183
- return createServerElement(type, nextProps, children.length > 1);
109
+ function withServerFrameworkRenderContext(context, operation) {
110
+ const previous = activeFrameworkRender;
111
+ activeFrameworkRender = context;
112
+ try {
113
+ return operation();
114
+ } finally {
115
+ activeFrameworkRender = previous;
116
+ }
117
+ }
118
+ function cache(operation) {
119
+ return (...arguments_) => {
120
+ const context = activeFrameworkRender;
121
+ if (context === void 0) return operation(...arguments_);
122
+ let entries = context.cache.get(operation);
123
+ if (entries === void 0) {
124
+ entries = [];
125
+ context.cache.set(operation, entries);
126
+ }
127
+ const existing = entries.find((entry) => entry.args.length === arguments_.length && entry.args.every((argument, index) => Object.is(argument, arguments_[index])));
128
+ if (existing !== void 0) {
129
+ if (existing.status === "rejected") throw existing.value;
130
+ return existing.value;
131
+ }
132
+ try {
133
+ const value = operation(...arguments_);
134
+ entries.push({
135
+ args: [...arguments_],
136
+ status: "fulfilled",
137
+ value
138
+ });
139
+ return value;
140
+ } catch (error) {
141
+ entries.push({
142
+ args: [...arguments_],
143
+ status: "rejected",
144
+ value: error
145
+ });
146
+ throw error;
147
+ }
148
+ };
149
+ }
150
+ function cacheSignal() {
151
+ return activeFrameworkRender?.signal ?? null;
152
+ }
153
+ function preconnect(href, options = {}) {
154
+ registerResourceHint("preconnect", href, options);
155
+ }
156
+ function prefetchDNS(href) {
157
+ registerResourceHint("dns-prefetch", href, {});
158
+ }
159
+ function preload(href, options) {
160
+ registerResourceHint("preload", href, options);
161
+ }
162
+ function preloadModule(href, options = {}) {
163
+ registerResourceHint("modulepreload", href, options);
164
+ }
165
+ function preinit(href, options) {
166
+ if (options.as === "style") {
167
+ registerHeadEntry(`style:${href}`, `<link rel="stylesheet" href="${escapeAttribute(href)}"${serializeHintOptions(options)}>`, `2:${options.precedence ?? "default"}`);
168
+ return;
169
+ }
170
+ registerHeadEntry(`script:${href}`, `<script src="${escapeAttribute(href)}"${serializeHintOptions(options)}><\/script>`, "3:script");
171
+ }
172
+ function preinitModule(href, options = {}) {
173
+ registerHeadEntry(`module:${href}`, `<script type="module" src="${escapeAttribute(href)}"${serializeHintOptions(options)}><\/script>`, "3:script");
174
+ }
175
+ function jsx(type, props, _key) {
176
+ return createServerElement(type, props, false);
177
+ }
178
+ function jsxs(type, props, _key) {
179
+ return createServerElement(type, props, true);
180
+ }
181
+ function jsxDEV(type, props, _key, isStaticChildren = false) {
182
+ return createServerElement(type, props, isStaticChildren);
183
+ }
184
+ function createElement(type, props, ...children) {
185
+ const nextProps = { ...props };
186
+ if (children.length === 1) nextProps.children = children[0];
187
+ else if (children.length > 1) nextProps.children = children;
188
+ return createServerElement(type, nextProps, children.length > 1);
184
189
  }
185
190
  /** @internal */
186
- export function createServerHydrationBoundary(value, hostProps = {}) {
187
- return serverNode((context) => {
188
- const boundaryIndex = context.nextBoundary;
189
- context.nextBoundary += 1;
190
- const identifierPrefix = `${context.identifierPrefix}b${boundaryIndex}-`;
191
- const boundaryContext = {
192
- hydrationMarkers: true,
193
- identifierPrefix,
194
- nextBoundary: 0,
195
- nextId: 0,
196
- activityHidden: false,
197
- };
198
- const attributes = serializeAttributes({
199
- ...hostProps,
200
- 'data-vidact-identifier-prefix': identifierPrefix,
201
- }, context.activityHidden);
202
- return `<div${attributes}>${hydrationRange('r', serializeSlot(value, boundaryContext))}</div>`;
203
- }, 'transparent');
191
+ function createServerHydrationBoundary(value, hostProps = {}) {
192
+ return serverNode((context) => {
193
+ const boundaryIndex = context.nextBoundary;
194
+ context.nextBoundary += 1;
195
+ const identifierPrefix = `${context.identifierPrefix}b${boundaryIndex}-`;
196
+ const boundaryContext = {
197
+ hydrationMarkers: true,
198
+ identifierPrefix,
199
+ nextBoundary: 0,
200
+ nextId: 0,
201
+ activityHidden: false
202
+ };
203
+ return `<div${serializeAttributes({
204
+ ...hostProps,
205
+ "data-vidact-identifier-prefix": identifierPrefix
206
+ }, context.activityHidden)}>${hydrationRange("r", serializeSlot(value, boundaryContext))}</div>`;
207
+ }, "transparent");
204
208
  }
205
209
  function createServerElement(type, props, multipleChildren) {
206
- if (type === Fragment) {
207
- return serverNode((context) => Object.hasOwn(props ?? {}, 'children')
208
- ? multipleChildren
209
- ? serializeChildren(props?.children, context, true)
210
- : serializeSlot(props?.children, context)
211
- : '', 'transparent');
212
- }
213
- if (isRenderable(type)) {
214
- return serverNode((context) => serializeSlot(cloneRenderable(type, props ?? {}), context), 'component');
215
- }
216
- if (typeof type === 'function') {
217
- const builtin = serverBuiltins.has(type);
218
- return serverNode((context) => {
219
- const content = serializeSlot(type(props ?? {}), context);
220
- return context.hydrationMarkers && !builtin ? hydrationRange('c', content) : content;
221
- }, builtin ? 'transparent' : 'component');
222
- }
223
- if (!VALID_ATTRIBUTE_NAME.test(type))
224
- throw new TypeError(`invalid server element name ${type}`);
225
- return serverNode((context) => serializeIntrinsicElement(type, props, multipleChildren, context), 'intrinsic');
210
+ if (type === Fragment) return serverNode((context) => Object.hasOwn(props ?? {}, "children") ? multipleChildren ? serializeChildren(props?.children, context, true) : serializeSlot(props?.children, context) : "", "transparent");
211
+ if (isRenderable(type)) return serverNode((context) => serializeSlot(cloneRenderable(type, props ?? {}), context), "component");
212
+ if (typeof type === "function") {
213
+ const builtin = serverBuiltins.has(type);
214
+ return serverNode((context) => {
215
+ const content = serializeSlot(type(props ?? {}), context);
216
+ return context.hydrationMarkers && !builtin ? hydrationRange("c", content) : content;
217
+ }, builtin ? "transparent" : "component");
218
+ }
219
+ if (!VALID_ATTRIBUTE_NAME.test(type)) throw new TypeError(`invalid server element name ${type}`);
220
+ return serverNode((context) => serializeIntrinsicElement(type, props, multipleChildren, context), "intrinsic");
226
221
  }
227
222
  function serializeIntrinsicElement(type, props, multipleChildren, context) {
228
- if (activeFrameworkRender !== undefined && isHoistableHeadElement(type, props)) {
229
- const hydrationMarkers = context.hydrationMarkers;
230
- context.hydrationMarkers = false;
231
- try {
232
- const html = serializeIntrinsicContents(type, props, multipleChildren, context);
233
- registerHeadEntry(metadataKey(type, props), html, metadataPrecedence(type, props));
234
- return '';
235
- }
236
- finally {
237
- context.hydrationMarkers = hydrationMarkers;
238
- }
239
- }
240
- return serializeIntrinsicContents(type, props, multipleChildren, context);
223
+ if (activeFrameworkRender !== void 0 && isHoistableHeadElement(type, props)) {
224
+ const hydrationMarkers = context.hydrationMarkers;
225
+ context.hydrationMarkers = false;
226
+ try {
227
+ const html = serializeIntrinsicContents(type, props, multipleChildren, context);
228
+ registerHeadEntry(metadataKey(type, props), html, metadataPrecedence(type, props));
229
+ return "";
230
+ } finally {
231
+ context.hydrationMarkers = hydrationMarkers;
232
+ }
233
+ }
234
+ return serializeIntrinsicContents(type, props, multipleChildren, context);
241
235
  }
242
236
  function serializeIntrinsicContents(type, props, multipleChildren, context) {
243
- const hiddenByActivity = context.activityHidden;
244
- const previousActivityHidden = context.activityHidden;
245
- context.activityHidden = false;
246
- try {
247
- const attributes = serializeAttributes(props, hiddenByActivity);
248
- if (VOID_ELEMENTS.has(type)) {
249
- if (hasRenderableChild(props?.children) || readRawHtml(props) !== undefined) {
250
- throw new TypeError(`${type} is a void element and cannot have children or raw HTML`);
251
- }
252
- return `<${type}${attributes}>`;
253
- }
254
- const rawHtml = readRawHtml(props);
255
- if (rawHtml !== undefined && hasRenderableChild(props?.children)) {
256
- throw new TypeError('cannot set both children and dangerouslySetInnerHTML');
257
- }
258
- const hasChildren = Object.hasOwn(props ?? {}, 'children');
259
- const children = rawHtml === undefined
260
- ? hasChildren
261
- ? multipleChildren
262
- ? serializeChildren(props?.children, context, !isRawTextElement(type))
263
- : serializeSlot(props?.children, context, !isRawTextElement(type))
264
- : ''
265
- : context.hydrationMarkers
266
- ? hydrationRange('h', assertSafeHydrationRawHtml(rawHtml))
267
- : rawHtml;
268
- if (type === 'head' && activeFrameworkRender !== undefined) {
269
- activeFrameworkRender.sawHead = true;
270
- return `<head${attributes}>${children}${FRAMEWORK_HEAD_PLACEHOLDER}</head>`;
271
- }
272
- return `<${type}${attributes}>${children}</${type}>`;
273
- }
274
- finally {
275
- context.activityHidden = previousActivityHidden;
276
- }
277
- }
278
- export function renderToString(value, options = {}) {
279
- const previous = activeRender;
280
- beginFrameworkRenderPass();
281
- const context = {
282
- hydrationMarkers: true,
283
- identifierPrefix: options.identifierPrefix ?? '',
284
- nextBoundary: 0,
285
- nextId: 0,
286
- activityHidden: false,
287
- };
288
- activeRender = context;
289
- try {
290
- const html = hydrationRange('r', serializeSlot(typeof value === 'function' ? value() : value, context));
291
- return finalizeFrameworkHtml(html);
292
- }
293
- finally {
294
- activeRender = previous;
295
- }
296
- }
297
- export function renderToStaticMarkup(value, options = {}) {
298
- const previous = activeRender;
299
- beginFrameworkRenderPass();
300
- const context = {
301
- hydrationMarkers: false,
302
- identifierPrefix: options.identifierPrefix ?? '',
303
- nextBoundary: 0,
304
- nextId: 0,
305
- activityHidden: false,
306
- };
307
- activeRender = context;
308
- try {
309
- return finalizeFrameworkHtml(serializeChild(typeof value === 'function' ? value() : value, context));
310
- }
311
- finally {
312
- activeRender = previous;
313
- }
314
- }
315
- export function useState(initial) {
316
- const value = typeof initial === 'function' ? initial() : initial;
317
- return [value, serverDispatch];
318
- }
319
- export function useReducer(_reducer, initial, initialize) {
320
- return [initialize === undefined ? initial : initialize(initial), serverDispatch];
321
- }
322
- export function startTransition(action) {
323
- void action();
324
- }
325
- export function useTransition() {
326
- return [false, startTransition];
327
- }
328
- export function useDeferredValue(value, _initialValue) {
329
- return value;
330
- }
331
- export function flushSync(operation) {
332
- return operation?.();
333
- }
334
- export function useActionState(_action, initialState, permalink) {
335
- const dispatch = (_payload) => serverDispatch();
336
- if (permalink !== undefined)
337
- Object.defineProperty(dispatch, 'permalink', { value: permalink });
338
- return [initialState, dispatch, false];
339
- }
340
- export function useOptimistic(passthrough, _reducer) {
341
- return [passthrough, serverDispatch];
342
- }
343
- export function useFormStatus() {
344
- return { pending: false, data: null, method: 'get', action: null };
345
- }
346
- export function useMemo(factory, _dependencies) {
347
- return factory();
348
- }
349
- export function useCallback(callback, _dependencies) {
350
- return callback;
351
- }
352
- export function useRef(initial) {
353
- return { current: initial };
354
- }
355
- export function useEffect(_create, _dependencies) { }
356
- export const useLayoutEffect = useEffect;
357
- export const useInsertionEffect = useEffect;
358
- export function useImperativeHandle(_ref, _create, _dependencies) { }
359
- export function useEffectEvent(callback) {
360
- return callback;
361
- }
362
- export function useSyncExternalStore(_subscribe, getSnapshot, getServerSnapshot) {
363
- return (getServerSnapshot ?? getSnapshot)();
364
- }
365
- export function useId() {
366
- const context = (activeRender ??= {
367
- hydrationMarkers: true,
368
- identifierPrefix: '',
369
- nextBoundary: 0,
370
- nextId: 0,
371
- activityHidden: false,
372
- });
373
- const id = `:${context.identifierPrefix}r${context.nextId}:`;
374
- context.nextId += 1;
375
- return id;
376
- }
377
- export function createContext(defaultValue) {
378
- let context;
379
- const Provider = (props) => serverNode((renderContext) => {
380
- context[SERVER_CONTEXT].stack.push(props.value);
381
- try {
382
- return serializeChild(props.children, renderContext);
383
- }
384
- finally {
385
- context[SERVER_CONTEXT].stack.pop();
386
- }
387
- }, 'transparent');
388
- context = { [SERVER_CONTEXT]: { defaultValue, stack: [] }, Provider };
389
- serverBuiltins.add(Provider);
390
- return context;
391
- }
392
- export function useContext(context) {
393
- const state = context[SERVER_CONTEXT];
394
- return state.stack.length === 0 ? state.defaultValue : state.stack.at(-1);
395
- }
396
- export function createResource(input) {
397
- if (!isPromiseLike(input))
398
- throw new TypeError('createResource requires a promise-like value');
399
- const existing = serverPromiseResources.get(input);
400
- if (existing !== undefined)
401
- return existing;
402
- let state = { status: 'pending' };
403
- const resource = { promise: input };
404
- Object.defineProperty(resource, SERVER_ASYNC_RESOURCE, { get: () => state });
405
- serverPromiseResources.set(input, resource);
406
- void Promise.resolve(input).then((value) => {
407
- if (state.status === 'pending')
408
- state = { status: 'fulfilled', value };
409
- }, (reason) => {
410
- if (state.status === 'pending')
411
- state = { status: 'rejected', reason };
412
- });
413
- return resource;
414
- }
415
- export function use(input) {
416
- if (isServerContext(input))
417
- return useContext(input);
418
- const resource = isServerAsyncResource(input) ? input : createResource(input);
419
- const state = resource[SERVER_ASYNC_RESOURCE];
420
- if (state.status === 'fulfilled')
421
- return state.value;
422
- if (state.status === 'rejected')
423
- throw state.reason;
424
- throw { [SERVER_SUSPENSION]: true, resource };
425
- }
426
- export function lazy(load) {
427
- let resource;
428
- return (props) => {
429
- resource ??= createResource(load());
430
- const module = use(resource);
431
- if (typeof module?.default !== 'function') {
432
- throw new TypeError('lazy loader must resolve to a default component export');
433
- }
434
- return module.default(props);
435
- };
436
- }
437
- export function Suspense(props) {
438
- const render = props.children;
439
- const fallback = props.fallback;
440
- if (typeof render !== 'function' || typeof fallback !== 'function') {
441
- throw new TypeError('Suspense children and fallback must be compiler-generated render functions');
442
- }
443
- return serverNode((context) => {
444
- try {
445
- return serializeChild(render(), context);
446
- }
447
- catch (error) {
448
- if (!isServerSuspension(error))
449
- throw error;
450
- activeFrameworkRender?.pending.add(error.resource.promise);
451
- const pendingMarker = context.hydrationMarkers ? `<!--${HYDRATION_PREFIX}:p-->` : '';
452
- return pendingMarker + serializeChild(fallback(), context);
453
- }
454
- }, 'transparent');
237
+ const hiddenByActivity = context.activityHidden;
238
+ const previousActivityHidden = context.activityHidden;
239
+ context.activityHidden = false;
240
+ try {
241
+ const attributes = serializeAttributes(props, hiddenByActivity);
242
+ if (VOID_ELEMENTS.has(type)) {
243
+ if (hasRenderableChild(props?.children) || readRawHtml(props) !== void 0) throw new TypeError(`${type} is a void element and cannot have children or raw HTML`);
244
+ return `<${type}${attributes}>`;
245
+ }
246
+ const rawHtml = readRawHtml(props);
247
+ if (rawHtml !== void 0 && hasRenderableChild(props?.children)) throw new TypeError("cannot set both children and dangerouslySetInnerHTML");
248
+ const hasChildren = Object.hasOwn(props ?? {}, "children");
249
+ const children = rawHtml === void 0 ? hasChildren ? multipleChildren ? serializeChildren(props?.children, context, !isRawTextElement(type)) : serializeSlot(props?.children, context, !isRawTextElement(type)) : "" : context.hydrationMarkers ? hydrationRange("h", assertSafeHydrationRawHtml(rawHtml)) : rawHtml;
250
+ if (type === "head" && activeFrameworkRender !== void 0) {
251
+ activeFrameworkRender.sawHead = true;
252
+ return `<head${attributes}>${children}${FRAMEWORK_HEAD_PLACEHOLDER}</head>`;
253
+ }
254
+ return `<${type}${attributes}>${children}</${type}>`;
255
+ } finally {
256
+ context.activityHidden = previousActivityHidden;
257
+ }
258
+ }
259
+ function renderToString(value, options = {}) {
260
+ const previous = activeRender;
261
+ beginFrameworkRenderPass();
262
+ const context = {
263
+ hydrationMarkers: true,
264
+ identifierPrefix: options.identifierPrefix ?? "",
265
+ nextBoundary: 0,
266
+ nextId: 0,
267
+ activityHidden: false
268
+ };
269
+ activeRender = context;
270
+ try {
271
+ return finalizeFrameworkHtml(hydrationRange("r", serializeSlot(typeof value === "function" ? value() : value, context)));
272
+ } finally {
273
+ activeRender = previous;
274
+ }
275
+ }
276
+ function renderToStaticMarkup(value, options = {}) {
277
+ const previous = activeRender;
278
+ beginFrameworkRenderPass();
279
+ const context = {
280
+ hydrationMarkers: false,
281
+ identifierPrefix: options.identifierPrefix ?? "",
282
+ nextBoundary: 0,
283
+ nextId: 0,
284
+ activityHidden: false
285
+ };
286
+ activeRender = context;
287
+ try {
288
+ return finalizeFrameworkHtml(serializeChild(typeof value === "function" ? value() : value, context));
289
+ } finally {
290
+ activeRender = previous;
291
+ }
292
+ }
293
+ function useState(initial) {
294
+ return [typeof initial === "function" ? initial() : initial, serverDispatch];
295
+ }
296
+ function useReducer(_reducer, initial, initialize) {
297
+ return [initialize === void 0 ? initial : initialize(initial), serverDispatch];
298
+ }
299
+ function startTransition(action) {
300
+ action();
301
+ }
302
+ function useTransition() {
303
+ return [false, startTransition];
304
+ }
305
+ function useDeferredValue(value, _initialValue) {
306
+ return value;
307
+ }
308
+ function flushSync(operation) {
309
+ return operation?.();
310
+ }
311
+ function useActionState(_action, initialState, permalink) {
312
+ const dispatch = (_payload) => serverDispatch();
313
+ if (permalink !== void 0) Object.defineProperty(dispatch, "permalink", { value: permalink });
314
+ return [
315
+ initialState,
316
+ dispatch,
317
+ false
318
+ ];
319
+ }
320
+ function useOptimistic(passthrough, _reducer) {
321
+ return [passthrough, serverDispatch];
322
+ }
323
+ function useFormStatus() {
324
+ return {
325
+ pending: false,
326
+ data: null,
327
+ method: "get",
328
+ action: null
329
+ };
330
+ }
331
+ function useMemo(factory, _dependencies) {
332
+ return factory();
333
+ }
334
+ function useCallback(callback, _dependencies) {
335
+ return callback;
336
+ }
337
+ function useRef(initial) {
338
+ return { current: initial };
339
+ }
340
+ function createRef() {
341
+ return { current: null };
342
+ }
343
+ function useEffect(_create, _dependencies) {}
344
+ const useLayoutEffect = useEffect;
345
+ const useInsertionEffect = useEffect;
346
+ function useImperativeHandle(_ref, _create, _dependencies) {}
347
+ function useEffectEvent(callback) {
348
+ return callback;
349
+ }
350
+ function useSyncExternalStore(_subscribe, getSnapshot, getServerSnapshot) {
351
+ return (getServerSnapshot ?? getSnapshot)();
352
+ }
353
+ function useId() {
354
+ const context = activeRender ??= {
355
+ hydrationMarkers: true,
356
+ identifierPrefix: "",
357
+ nextBoundary: 0,
358
+ nextId: 0,
359
+ activityHidden: false
360
+ };
361
+ const id = `:${context.identifierPrefix}r${context.nextId}:`;
362
+ context.nextId += 1;
363
+ return id;
364
+ }
365
+ function createContext(defaultValue) {
366
+ let context;
367
+ const Provider = (props) => serverNode((renderContext) => {
368
+ context[SERVER_CONTEXT].stack.push(props.value);
369
+ try {
370
+ return serializeChild(props.children, renderContext);
371
+ } finally {
372
+ context[SERVER_CONTEXT].stack.pop();
373
+ }
374
+ }, "transparent");
375
+ context = {
376
+ [SERVER_CONTEXT]: {
377
+ defaultValue,
378
+ stack: []
379
+ },
380
+ Provider
381
+ };
382
+ serverBuiltins.add(Provider);
383
+ return context;
384
+ }
385
+ function useContext(context) {
386
+ const state = context[SERVER_CONTEXT];
387
+ return state.stack.length === 0 ? state.defaultValue : state.stack.at(-1);
388
+ }
389
+ function createResource(input) {
390
+ if (!isPromiseLike(input)) throw new TypeError("createResource requires a promise-like value");
391
+ const existing = serverPromiseResources.get(input);
392
+ if (existing !== void 0) return existing;
393
+ let state = { status: "pending" };
394
+ const resource = { promise: input };
395
+ Object.defineProperty(resource, SERVER_ASYNC_RESOURCE, { get: () => state });
396
+ serverPromiseResources.set(input, resource);
397
+ Promise.resolve(input).then((value) => {
398
+ if (state.status === "pending") state = {
399
+ status: "fulfilled",
400
+ value
401
+ };
402
+ }, (reason) => {
403
+ if (state.status === "pending") state = {
404
+ status: "rejected",
405
+ reason
406
+ };
407
+ });
408
+ return resource;
409
+ }
410
+ function use(input) {
411
+ if (isServerContext(input)) return useContext(input);
412
+ const resource = isServerAsyncResource(input) ? input : createResource(input);
413
+ const state = resource[SERVER_ASYNC_RESOURCE];
414
+ if (state.status === "fulfilled") return state.value;
415
+ if (state.status === "rejected") throw state.reason;
416
+ throw {
417
+ [SERVER_SUSPENSION]: true,
418
+ resource
419
+ };
420
+ }
421
+ function lazy(load) {
422
+ let resource;
423
+ return (props) => {
424
+ resource ??= createResource(load());
425
+ const module = use(resource);
426
+ if (typeof module?.default !== "function") throw new TypeError("lazy loader must resolve to a default component export");
427
+ return module.default(props);
428
+ };
429
+ }
430
+ function Suspense(props) {
431
+ const render = props.children;
432
+ const fallback = props.fallback;
433
+ if (typeof render !== "function" || typeof fallback !== "function") throw new TypeError("Suspense children and fallback must be compiler-generated render functions");
434
+ return serverNode((context) => {
435
+ try {
436
+ return serializeChild(render(), context);
437
+ } catch (error) {
438
+ if (!isServerSuspension(error)) throw error;
439
+ activeFrameworkRender?.pending.add(error.resource.promise);
440
+ return (context.hydrationMarkers ? `<!--${HYDRATION_PREFIX}:p-->` : "") + serializeChild(fallback(), context);
441
+ }
442
+ }, "transparent");
455
443
  }
456
444
  serverBuiltins.add(Suspense);
457
- export function Activity(props) {
458
- const render = props.children;
459
- if (typeof render !== 'function') {
460
- throw new TypeError('Activity children must be a compiler-generated render function');
461
- }
462
- if (props.mode !== 'visible' && props.mode !== 'hidden') {
463
- throw new TypeError('Activity mode must be "visible" or "hidden"');
464
- }
465
- return serverNode((context) => {
466
- const previousActivityHidden = context.activityHidden;
467
- context.activityHidden = props.mode === 'hidden' || previousActivityHidden;
468
- try {
469
- return serializeChild(render(), context);
470
- }
471
- finally {
472
- context.activityHidden = previousActivityHidden;
473
- }
474
- }, 'transparent');
445
+ function Activity(props) {
446
+ const render = props.children;
447
+ if (typeof render !== "function") throw new TypeError("Activity children must be a compiler-generated render function");
448
+ if (props.mode !== "visible" && props.mode !== "hidden") throw new TypeError("Activity mode must be \"visible\" or \"hidden\"");
449
+ return serverNode((context) => {
450
+ const previousActivityHidden = context.activityHidden;
451
+ context.activityHidden = props.mode === "hidden" || previousActivityHidden;
452
+ try {
453
+ return serializeChild(render(), context);
454
+ } finally {
455
+ context.activityHidden = previousActivityHidden;
456
+ }
457
+ }, "transparent");
475
458
  }
476
459
  serverBuiltins.add(Activity);
477
- export function Profiler(props) {
478
- const render = props.children;
479
- if (typeof render !== 'function') {
480
- throw new TypeError('Profiler children must be a compiler-generated render function');
481
- }
482
- if (typeof props.id !== 'string')
483
- throw new TypeError('Profiler id must be a string');
484
- if (typeof props.onRender !== 'function') {
485
- throw new TypeError('Profiler onRender must be a function');
486
- }
487
- return render();
460
+ function Profiler(props) {
461
+ const render = props.children;
462
+ if (typeof render !== "function") throw new TypeError("Profiler children must be a compiler-generated render function");
463
+ if (typeof props.id !== "string") throw new TypeError("Profiler id must be a string");
464
+ if (typeof props.onRender !== "function") throw new TypeError("Profiler onRender must be a function");
465
+ return render();
488
466
  }
489
467
  serverBuiltins.add(Profiler);
490
- export function useDebugValue(_value, _format) { }
491
- export function captureOwnerStack() {
492
- return null;
468
+ function useDebugValue(_value, _format) {}
469
+ function captureOwnerStack() {
470
+ return null;
493
471
  }
494
- export function createPortal(_children, _container) {
495
- throw new Error('portals cannot be emitted by the server target; render portal content in the client root');
472
+ function createPortal(_children, _container) {
473
+ throw new Error("portals cannot be emitted by the server target; render portal content in the client root");
496
474
  }
497
475
  function serverNode(render, kind) {
498
- return { [SERVER_NODE]: render, [SERVER_NODE_KIND]: kind };
476
+ return {
477
+ [SERVER_NODE]: render,
478
+ [SERVER_NODE_KIND]: kind
479
+ };
499
480
  }
500
481
  function isServerNode(value) {
501
- return typeof value === 'object' && value !== null && SERVER_NODE in value;
482
+ return typeof value === "object" && value !== null && SERVER_NODE in value;
502
483
  }
503
484
  function isServerContext(value) {
504
- return typeof value === 'object' && value !== null && SERVER_CONTEXT in value;
485
+ return typeof value === "object" && value !== null && SERVER_CONTEXT in value;
505
486
  }
506
487
  function isServerAsyncResource(value) {
507
- return typeof value === 'object' && value !== null && SERVER_ASYNC_RESOURCE in value;
488
+ return typeof value === "object" && value !== null && SERVER_ASYNC_RESOURCE in value;
508
489
  }
509
490
  function isServerSuspension(value) {
510
- return typeof value === 'object' && value !== null && SERVER_SUSPENSION in value;
491
+ return typeof value === "object" && value !== null && SERVER_SUSPENSION in value;
511
492
  }
512
493
  function serializeChild(value, context, markScalar = true) {
513
- if (value === null || value === undefined || typeof value === 'boolean') {
514
- return context.hydrationMarkers && markScalar ? hydrationRange('t', '') : '';
515
- }
516
- if (isServerNode(value)) {
517
- const content = value[SERVER_NODE](context);
518
- return context.hydrationMarkers && value[SERVER_NODE_KIND] === 'intrinsic'
519
- ? hydrationRange('s', content)
520
- : content;
521
- }
522
- if (isRenderable(value))
523
- return serializeChild(cloneRenderable(value), context, markScalar);
524
- if (Array.isArray(value)) {
525
- const content = value.map((child) => serializeChild(child, context, markScalar)).join('');
526
- return context.hydrationMarkers ? hydrationRange('a', content) : content;
527
- }
528
- if (typeof value === 'object' || typeof value === 'function' || typeof value === 'symbol') {
529
- throw new TypeError('unsupported server child value');
530
- }
531
- const content = escapeText(String(value));
532
- if (context.activityHidden && content !== '') {
533
- throw new TypeError('initially hidden Activity server children require a host element root');
534
- }
535
- return context.hydrationMarkers && markScalar ? hydrationRange('t', content) : content;
494
+ if (value === null || value === void 0 || typeof value === "boolean") return context.hydrationMarkers && markScalar ? hydrationRange("t", "") : "";
495
+ if (isServerNode(value)) {
496
+ const content = value[SERVER_NODE](context);
497
+ return context.hydrationMarkers && value[SERVER_NODE_KIND] === "intrinsic" ? hydrationRange("s", content) : content;
498
+ }
499
+ if (isRenderable(value)) return serializeChild(cloneRenderable(value), context, markScalar);
500
+ if (Array.isArray(value)) {
501
+ const content = value.map((child) => serializeChild(child, context, markScalar)).join("");
502
+ return context.hydrationMarkers ? hydrationRange("a", content) : content;
503
+ }
504
+ if (typeof value === "object" || typeof value === "function" || typeof value === "symbol") throw new TypeError("unsupported server child value");
505
+ const content = escapeText(String(value));
506
+ if (context.activityHidden && content !== "") throw new TypeError("initially hidden Activity server children require a host element root");
507
+ return context.hydrationMarkers && markScalar ? hydrationRange("t", content) : content;
536
508
  }
537
509
  function hasRenderableChild(value) {
538
- if (value === null || value === undefined || typeof value === 'boolean')
539
- return false;
540
- return !Array.isArray(value) || value.some(hasRenderableChild);
510
+ if (value === null || value === void 0 || typeof value === "boolean") return false;
511
+ return !Array.isArray(value) || value.some(hasRenderableChild);
541
512
  }
542
513
  function serializeAttributes(props, hiddenByActivity = false) {
543
- if (props === null)
544
- return ' style="display:none!important"';
545
- const attributes = Object.keys(props)
546
- .toSorted()
547
- .map((name) => name === 'style'
548
- ? serializeStyleAttribute(props[name], hiddenByActivity)
549
- : serializeAttribute(name, props[name]))
550
- .join('');
551
- return hiddenByActivity && !Object.hasOwn(props, 'style')
552
- ? `${attributes} style="display:none!important"`
553
- : attributes;
514
+ if (props === null) return " style=\"display:none!important\"";
515
+ const attributes = Object.keys(props).toSorted().map((name) => name === "style" ? serializeStyleAttribute(props[name], hiddenByActivity) : serializeAttribute(name, props[name])).join("");
516
+ return hiddenByActivity && !Object.hasOwn(props, "style") ? `${attributes} style="display:none!important"` : attributes;
554
517
  }
555
518
  function serializeAttribute(name, value) {
556
- if ((name === 'action' || name === 'formAction') &&
557
- typeof value === 'function' &&
558
- typeof Reflect.get(value, 'permalink') === 'string') {
559
- return ` ${serverHtmlAttributeName(name)}="${escapeAttribute(Reflect.get(value, 'permalink'))}"`;
560
- }
561
- if (name === 'children' ||
562
- name === 'dangerouslySetInnerHTML' ||
563
- name === 'key' ||
564
- name === 'precedence' ||
565
- name === 'ref' ||
566
- /^on/i.test(name) ||
567
- value === null ||
568
- value === undefined ||
569
- typeof value === 'function' ||
570
- typeof value === 'symbol') {
571
- return '';
572
- }
573
- if (name === 'style')
574
- return serializeStyleAttribute(value);
575
- const normalizedName = serverHtmlAttributeName(name);
576
- if (name.startsWith('data-') || name.startsWith('aria-')) {
577
- return ` ${normalizedName}="${escapeAttribute(String(value))}"`;
578
- }
579
- if (SERVER_BOOLEAN_ATTRIBUTES.has(name))
580
- return value ? ` ${normalizedName}=""` : '';
581
- if (typeof value === 'boolean')
582
- return '';
583
- if (!VALID_ATTRIBUTE_NAME.test(normalizedName))
584
- return '';
585
- return ` ${normalizedName}="${escapeAttribute(String(value))}"`;
519
+ if ((name === "action" || name === "formAction") && typeof value === "function" && typeof Reflect.get(value, "permalink") === "string") return ` ${serverHtmlAttributeName(name)}="${escapeAttribute(Reflect.get(value, "permalink"))}"`;
520
+ if (name === "children" || name === "dangerouslySetInnerHTML" || name === "key" || name === "precedence" || name === "ref" || /^on/i.test(name) || value === null || value === void 0 || typeof value === "function" || typeof value === "symbol") return "";
521
+ if (name === "style") return serializeStyleAttribute(value);
522
+ const normalizedName = serverHtmlAttributeName(name);
523
+ if (name.startsWith("data-") || name.startsWith("aria-")) return ` ${normalizedName}="${escapeAttribute(String(value))}"`;
524
+ if (SERVER_BOOLEAN_ATTRIBUTES.has(name)) return value ? ` ${normalizedName}=""` : "";
525
+ if (typeof value === "boolean") return "";
526
+ if (!VALID_ATTRIBUTE_NAME.test(normalizedName)) return "";
527
+ return ` ${normalizedName}="${escapeAttribute(String(value))}"`;
586
528
  }
587
529
  function beginFrameworkRenderPass() {
588
- const framework = activeFrameworkRender;
589
- if (framework === undefined)
590
- return;
591
- if (framework.signal.aborted)
592
- throw frameworkAbortReason(framework.signal);
593
- framework.pending.clear();
594
- framework.head.clear();
595
- framework.stylePrecedence.length = 0;
596
- framework.sawHead = false;
530
+ const framework = activeFrameworkRender;
531
+ if (framework === void 0) return;
532
+ if (framework.signal.aborted) throw frameworkAbortReason(framework.signal);
533
+ framework.pending.clear();
534
+ framework.head.clear();
535
+ framework.stylePrecedence.length = 0;
536
+ framework.sawHead = false;
597
537
  }
598
538
  function finalizeFrameworkHtml(html) {
599
- const framework = activeFrameworkRender;
600
- if (framework === undefined)
601
- return html;
602
- const head = [...framework.head.entries()]
603
- .toSorted(([, left], [, right]) => compareHeadPrecedence(framework, left, right))
604
- .map(([, entry]) => entry.html)
605
- .join('');
606
- if (framework.sawHead)
607
- return html.replace(FRAMEWORK_HEAD_PLACEHOLDER, head);
608
- if (head === '')
609
- return html;
610
- const htmlStart = html.indexOf('<html');
611
- if (htmlStart !== -1) {
612
- const htmlOpenEnd = html.indexOf('>', htmlStart);
613
- if (htmlOpenEnd !== -1) {
614
- return `${html.slice(0, htmlOpenEnd + 1)}<head>${head}</head>${html.slice(htmlOpenEnd + 1)}`;
615
- }
616
- }
617
- return `<head>${head}</head>${html}`;
539
+ const framework = activeFrameworkRender;
540
+ if (framework === void 0) return html;
541
+ const head = [...framework.head.entries()].toSorted(([, left], [, right]) => compareHeadPrecedence(framework, left, right)).map(([, entry]) => entry.html).join("");
542
+ if (framework.sawHead) return html.replace(FRAMEWORK_HEAD_PLACEHOLDER, head);
543
+ if (head === "") return html;
544
+ const htmlStart = html.indexOf("<html");
545
+ if (htmlStart !== -1) {
546
+ const htmlOpenEnd = html.indexOf(">", htmlStart);
547
+ if (htmlOpenEnd !== -1) return `${html.slice(0, htmlOpenEnd + 1)}<head>${head}</head>${html.slice(htmlOpenEnd + 1)}`;
548
+ }
549
+ return `<head>${head}</head>${html}`;
618
550
  }
619
551
  function isHoistableHeadElement(type, props) {
620
- if (type === 'title' || type === 'meta')
621
- return !hasOwnProp(props, 'itemProp');
622
- if (type === 'link') {
623
- if (['itemProp', 'onLoad', 'onError', 'disabled'].some((name) => hasOwnProp(props, name))) {
624
- return false;
625
- }
626
- return props?.rel !== 'stylesheet' || typeof props.precedence === 'string';
627
- }
628
- if (type === 'style') {
629
- return typeof props?.href === 'string' && typeof props.precedence === 'string';
630
- }
631
- return type === 'script' && props?.async === true && typeof props.src === 'string';
552
+ if (type === "title" || type === "meta") return !hasOwnProp(props, "itemProp");
553
+ if (type === "link") {
554
+ if ([
555
+ "itemProp",
556
+ "onLoad",
557
+ "onError",
558
+ "disabled"
559
+ ].some((name) => hasOwnProp(props, name))) return false;
560
+ return props?.rel !== "stylesheet" || typeof props.precedence === "string";
561
+ }
562
+ if (type === "style") return typeof props?.href === "string" && typeof props.precedence === "string";
563
+ return type === "script" && props?.async === true && typeof props.src === "string";
632
564
  }
633
565
  function hasOwnProp(props, name) {
634
- return props !== null && Object.hasOwn(props, name);
566
+ return props !== null && Object.hasOwn(props, name);
635
567
  }
636
568
  function metadataKey(type, props) {
637
- if (type === 'title')
638
- return 'title';
639
- if (type === 'meta') {
640
- for (const name of META_IDENTITY_PROPS) {
641
- const value = props?.[name];
642
- if (value !== undefined)
643
- return `meta:${name}:${String(value)}`;
644
- }
645
- }
646
- if (type === 'link')
647
- return `link:${LINK_IDENTITY_PROPS.map((name) => String(props?.[name] ?? '')).join(':')}`;
648
- if (type === 'style')
649
- return `style:${String(props?.href ?? '')}`;
650
- if (type === 'script')
651
- return `script:${String(props?.src ?? '')}`;
652
- return `${type}:${JSON.stringify(props)}`;
569
+ if (type === "title") return "title";
570
+ if (type === "meta") for (const name of META_IDENTITY_PROPS) {
571
+ const value = props?.[name];
572
+ if (value !== void 0) return `meta:${name}:${String(value)}`;
573
+ }
574
+ if (type === "link") return `link:${LINK_IDENTITY_PROPS.map((name) => String(props?.[name] ?? "")).join(":")}`;
575
+ if (type === "style") return `style:${String(props?.href ?? "")}`;
576
+ if (type === "script") return `script:${String(props?.src ?? "")}`;
577
+ return `${type}:${JSON.stringify(props)}`;
653
578
  }
654
579
  function metadataPrecedence(type, props) {
655
- if (type === 'style' || (type === 'link' && props?.rel === 'stylesheet')) {
656
- return `2:${String(props?.precedence ?? 'default')}`;
657
- }
658
- if (type === 'script')
659
- return '3:script';
660
- return '1:metadata';
580
+ if (type === "style" || type === "link" && props?.rel === "stylesheet") return `2:${String(props?.precedence ?? "default")}`;
581
+ if (type === "script") return "3:script";
582
+ return "1:metadata";
661
583
  }
662
584
  function registerResourceHint(relation, href, options) {
663
- if (typeof href !== 'string' || href.length === 0)
664
- throw new TypeError('resource href must be non-empty');
665
- const as = 'as' in options && typeof options.as === 'string' ? ` as="${escapeAttribute(options.as)}"` : '';
666
- registerHeadEntry(`hint:${relation}:${href}:${as}`, `<link rel="${relation}" href="${escapeAttribute(href)}"${as}${serializeHintOptions(options)}>`, '0:hint');
585
+ if (typeof href !== "string" || href.length === 0) throw new TypeError("resource href must be non-empty");
586
+ const as = "as" in options && typeof options.as === "string" ? ` as="${escapeAttribute(options.as)}"` : "";
587
+ registerHeadEntry(`hint:${relation}:${href}:${as}`, `<link rel="${relation}" href="${escapeAttribute(href)}"${as}${serializeHintOptions(options)}>`, "0:hint");
667
588
  }
668
589
  function registerHeadEntry(key, html, precedence) {
669
- const framework = activeFrameworkRender;
670
- if (framework === undefined)
671
- return;
672
- if (precedence.startsWith('2:')) {
673
- const stylePrecedence = precedence.slice(2);
674
- if (!framework.stylePrecedence.includes(stylePrecedence)) {
675
- framework.stylePrecedence.push(stylePrecedence);
676
- }
677
- }
678
- framework.head.set(key, { html, precedence });
590
+ const framework = activeFrameworkRender;
591
+ if (framework === void 0) return;
592
+ if (precedence.startsWith("2:")) {
593
+ const stylePrecedence = precedence.slice(2);
594
+ if (!framework.stylePrecedence.includes(stylePrecedence)) framework.stylePrecedence.push(stylePrecedence);
595
+ }
596
+ framework.head.set(key, {
597
+ html,
598
+ precedence
599
+ });
679
600
  }
680
601
  function compareHeadPrecedence(framework, left, right) {
681
- const leftRank = Number(left.precedence[0]);
682
- const rightRank = Number(right.precedence[0]);
683
- if (leftRank !== rightRank)
684
- return leftRank - rightRank;
685
- if (leftRank !== 2)
686
- return 0;
687
- return (framework.stylePrecedence.indexOf(left.precedence.slice(2)) -
688
- framework.stylePrecedence.indexOf(right.precedence.slice(2)));
602
+ const leftRank = Number(left.precedence[0]);
603
+ const rightRank = Number(right.precedence[0]);
604
+ if (leftRank !== rightRank) return leftRank - rightRank;
605
+ if (leftRank !== 2) return 0;
606
+ return framework.stylePrecedence.indexOf(left.precedence.slice(2)) - framework.stylePrecedence.indexOf(right.precedence.slice(2));
689
607
  }
690
608
  function serializeHintOptions(options) {
691
- const attributes = [];
692
- if (options.crossOrigin !== undefined) {
693
- attributes.push(` crossorigin="${escapeAttribute(options.crossOrigin)}"`);
694
- }
695
- if ('fetchPriority' in options && options.fetchPriority !== undefined) {
696
- attributes.push(` fetchpriority="${options.fetchPriority}"`);
697
- }
698
- if ('imageSizes' in options && options.imageSizes !== undefined) {
699
- attributes.push(` imagesizes="${escapeAttribute(options.imageSizes)}"`);
700
- }
701
- if ('imageSrcSet' in options && options.imageSrcSet !== undefined) {
702
- attributes.push(` imagesrcset="${escapeAttribute(options.imageSrcSet)}"`);
703
- }
704
- if ('integrity' in options && options.integrity !== undefined) {
705
- attributes.push(` integrity="${escapeAttribute(options.integrity)}"`);
706
- }
707
- if ('nonce' in options && options.nonce !== undefined) {
708
- attributes.push(` nonce="${escapeAttribute(options.nonce)}"`);
709
- }
710
- if ('referrerPolicy' in options && options.referrerPolicy !== undefined) {
711
- attributes.push(` referrerpolicy="${escapeAttribute(options.referrerPolicy)}"`);
712
- }
713
- if ('type' in options && options.type !== undefined) {
714
- attributes.push(` type="${escapeAttribute(options.type)}"`);
715
- }
716
- return attributes.join('');
609
+ const attributes = [];
610
+ if (options.crossOrigin !== void 0) attributes.push(` crossorigin="${escapeAttribute(options.crossOrigin)}"`);
611
+ if ("fetchPriority" in options && options.fetchPriority !== void 0) attributes.push(` fetchpriority="${options.fetchPriority}"`);
612
+ if ("imageSizes" in options && options.imageSizes !== void 0) attributes.push(` imagesizes="${escapeAttribute(options.imageSizes)}"`);
613
+ if ("imageSrcSet" in options && options.imageSrcSet !== void 0) attributes.push(` imagesrcset="${escapeAttribute(options.imageSrcSet)}"`);
614
+ if ("integrity" in options && options.integrity !== void 0) attributes.push(` integrity="${escapeAttribute(options.integrity)}"`);
615
+ if ("nonce" in options && options.nonce !== void 0) attributes.push(` nonce="${escapeAttribute(options.nonce)}"`);
616
+ if ("referrerPolicy" in options && options.referrerPolicy !== void 0) attributes.push(` referrerpolicy="${escapeAttribute(options.referrerPolicy)}"`);
617
+ if ("type" in options && options.type !== void 0) attributes.push(` type="${escapeAttribute(options.type)}"`);
618
+ return attributes.join("");
717
619
  }
718
620
  function frameworkAbortReason(signal) {
719
- return signal.reason ?? new DOMException('The operation was aborted', 'AbortError');
621
+ return signal.reason ?? new DOMException("The operation was aborted", "AbortError");
720
622
  }
721
623
  function serializeStyleAttribute(value, hiddenByActivity = false) {
722
- if (typeof value === 'string') {
723
- const separator = value === '' || value.endsWith(';') ? '' : ';';
724
- const style = hiddenByActivity ? `${value}${separator}display:none!important` : value;
725
- return style === '' ? '' : ` style="${escapeAttribute(style)}"`;
726
- }
727
- if (typeof value !== 'object' || value === null || Array.isArray(value)) {
728
- return hiddenByActivity ? ' style="display:none!important"' : '';
729
- }
730
- const declarations = Object.entries(value)
731
- .toSorted(([left], [right]) => left.localeCompare(right))
732
- .flatMap(([name, item]) => {
733
- if (item === null || item === undefined || typeof item === 'boolean' || item === '')
734
- return [];
735
- const cssName = name.startsWith('--') ? name : camelToKebab(name);
736
- const cssValue = typeof item === 'number' && item !== 0 && !UNITLESS_STYLE_PROPERTIES.has(name)
737
- ? `${item}px`
738
- : item;
739
- return `${cssName}:${String(cssValue)}`;
740
- });
741
- if (hiddenByActivity)
742
- declarations.push('display:none!important');
743
- return declarations.length === 0 ? '' : ` style="${escapeAttribute(declarations.join(';'))}"`;
624
+ if (typeof value === "string") {
625
+ const separator = value === "" || value.endsWith(";") ? "" : ";";
626
+ const style = hiddenByActivity ? `${value}${separator}display:none!important` : value;
627
+ return style === "" ? "" : ` style="${escapeAttribute(style)}"`;
628
+ }
629
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return hiddenByActivity ? " style=\"display:none!important\"" : "";
630
+ const declarations = Object.entries(value).toSorted(([left], [right]) => left.localeCompare(right)).flatMap(([name, item]) => {
631
+ if (item === null || item === void 0 || typeof item === "boolean" || item === "") return [];
632
+ const cssName = name.startsWith("--") ? name : camelToKebab(name);
633
+ const cssValue = typeof item === "number" && item !== 0 && !UNITLESS_STYLE_PROPERTIES.has(name) ? `${item}px` : item;
634
+ return `${cssName}:${String(cssValue)}`;
635
+ });
636
+ if (hiddenByActivity) declarations.push("display:none!important");
637
+ return declarations.length === 0 ? "" : ` style="${escapeAttribute(declarations.join(";"))}"`;
744
638
  }
745
639
  function camelToKebab(name) {
746
- return name
747
- .replace(/[A-Z]/g, (character) => `-${character.toLowerCase()}`)
748
- .replace(/^ms-/, '-ms-');
640
+ return name.replace(/[A-Z]/g, (character) => `-${character.toLowerCase()}`).replace(/^ms-/, "-ms-");
749
641
  }
750
642
  function readRawHtml(props) {
751
- const value = props?.dangerouslySetInnerHTML;
752
- if (value === null || value === undefined)
753
- return undefined;
754
- if (!UNSAFE_HTML) {
755
- throw new Error('dangerouslySetInnerHTML requires the unsafe-html compiler feature');
756
- }
757
- if (typeof value !== 'object' || !('__html' in value)) {
758
- throw new TypeError('dangerouslySetInnerHTML must be an object with an __html property');
759
- }
760
- const html = Reflect.get(value, '__html');
761
- return html === null || html === undefined ? '' : String(html);
643
+ const value = props?.dangerouslySetInnerHTML;
644
+ if (value === null || value === void 0) return void 0;
645
+ if (!UNSAFE_HTML) throw new Error("dangerouslySetInnerHTML requires the unsafe-html compiler feature");
646
+ if (typeof value !== "object" || !("__html" in value)) throw new TypeError("dangerouslySetInnerHTML must be an object with an __html property");
647
+ const html = Reflect.get(value, "__html");
648
+ return html === null || html === void 0 ? "" : String(html);
762
649
  }
763
650
  function escapeText(value) {
764
- return value.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;');
651
+ return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
765
652
  }
766
653
  function escapeAttribute(value) {
767
- return escapeText(value).replaceAll('"', '&quot;').replaceAll("'", '&#x27;');
654
+ return escapeText(value).replaceAll("\"", "&quot;").replaceAll("'", "&#x27;");
768
655
  }
769
656
  function serializeChildren(value, context, markScalar) {
770
- return Array.isArray(value)
771
- ? value.map((child) => serializeSlot(child, context, markScalar)).join('')
772
- : serializeSlot(value, context, markScalar);
657
+ return Array.isArray(value) ? value.map((child) => serializeSlot(child, context, markScalar)).join("") : serializeSlot(value, context, markScalar);
773
658
  }
774
659
  function serializeSlot(value, context, markScalar = true) {
775
- const content = serializeChild(value, context, markScalar);
776
- return context.hydrationMarkers ? hydrationRange('b', content) : content;
660
+ const content = serializeChild(value, context, markScalar);
661
+ return context.hydrationMarkers ? hydrationRange("b", content) : content;
777
662
  }
778
663
  function hydrationRange(kind, content) {
779
- return `<!--${HYDRATION_PREFIX}:${kind}-->${content}<!--/${HYDRATION_PREFIX}:${kind}-->`;
664
+ return `<!--${HYDRATION_PREFIX}:${kind}-->${content}<!--/${HYDRATION_PREFIX}:${kind}-->`;
780
665
  }
781
666
  function assertSafeHydrationRawHtml(value) {
782
- if (/<!--\/?vidact:v\d+:/i.test(value)) {
783
- throw new Error('raw HTML cannot contain Vidact hydration marker syntax');
784
- }
785
- return value;
667
+ if (/<!--\/?vidact:v\d+:/i.test(value)) throw new Error("raw HTML cannot contain Vidact hydration marker syntax");
668
+ return value;
786
669
  }
787
670
  function isRawTextElement(type) {
788
- return type === 'script' || type === 'style' || type === 'textarea' || type === 'title';
671
+ return type === "script" || type === "style" || type === "textarea" || type === "title";
789
672
  }
790
673
  function serverDispatch() {
791
- throw new Error('state dispatch is unavailable during server rendering');
674
+ throw new Error("state dispatch is unavailable during server rendering");
792
675
  }
676
+ //#endregion
677
+ export { Activity, Fragment, Profiler, Suspense, cache, cacheSignal, captureOwnerStack, cloneRenderable, cloneRenderableComponent, createContext, createElement, createPortal, createRef, createRenderable, createResource, createServerFrameworkRenderContext, createServerHydrationBoundary, dynamicIntrinsicComponent, flushSync, forwardedRef, isRenderable, jsx, jsxDEV, jsxs, keyedFragmentComponent, lazy, preconnect, prefetchDNS, preinit, preinitModule, preload, preloadModule, renderToStaticMarkup, renderToString, renderableChildren, renderableMarker, renderableProps, renderableRef, renderableToArray, startTransition, use, useActionState, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useEffectEvent, useFormStatus, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition, withServerFrameworkRenderContext };
678
+
793
679
  //# sourceMappingURL=server.js.map