@ecopages/radiant 0.3.0-alpha.8 → 0.3.0-beta.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 (213) hide show
  1. package/dist/README.md +315 -0
  2. package/dist/client/app-bootstrap.d.ts +19 -0
  3. package/dist/client/app-bootstrap.js +3 -0
  4. package/dist/client/app-bootstrap.js.map +10 -0
  5. package/dist/context/decorators/consume-context.js +2 -2
  6. package/dist/context/decorators/consume-context.js.map +4 -4
  7. package/dist/context/decorators/context-selector.js +2 -2
  8. package/dist/context/decorators/context-selector.js.map +8 -7
  9. package/dist/context/decorators/legacy/consume-context.js +2 -2
  10. package/dist/context/decorators/legacy/consume-context.js.map +4 -4
  11. package/dist/context/decorators/legacy/context-selector-field.js +2 -2
  12. package/dist/context/decorators/legacy/context-selector-field.js.map +4 -4
  13. package/dist/context/decorators/legacy/context-selector.js +2 -2
  14. package/dist/context/decorators/legacy/context-selector.js.map +4 -4
  15. package/dist/context/decorators/legacy/provide-context.js +2 -2
  16. package/dist/context/decorators/legacy/provide-context.js.map +4 -4
  17. package/dist/context/decorators/on-context-update.js +2 -2
  18. package/dist/context/decorators/on-context-update.js.map +4 -4
  19. package/dist/context/decorators/provide-context.js +2 -2
  20. package/dist/context/decorators/provide-context.js.map +4 -4
  21. package/dist/context/decorators/standard-legacy-dispatch.d.ts +6 -0
  22. package/dist/context/decorators/standard-legacy-dispatch.js +3 -0
  23. package/dist/context/decorators/standard-legacy-dispatch.js.map +10 -0
  24. package/dist/context/index.js +2 -2
  25. package/dist/context/index.js.map +11 -10
  26. package/dist/controller-registry.js +2 -2
  27. package/dist/controller-registry.js.map +3 -3
  28. package/dist/core/event-subscription-registry.d.ts +16 -0
  29. package/dist/core/event-subscription-registry.js +3 -0
  30. package/dist/core/event-subscription-registry.js.map +10 -0
  31. package/dist/core/host-ssr-registry.d.ts +13 -0
  32. package/dist/core/host-ssr-registry.js +3 -0
  33. package/dist/core/host-ssr-registry.js.map +10 -0
  34. package/dist/core/hydration-capable-host.d.ts +8 -0
  35. package/dist/core/hydration-capable-host.js +3 -0
  36. package/dist/core/hydration-capable-host.js.map +10 -0
  37. package/dist/core/radiant-controller.d.ts +36 -15
  38. package/dist/core/radiant-controller.js +2 -2
  39. package/dist/core/radiant-controller.js.map +13 -6
  40. package/dist/core/{radiant-component-ssr.d.ts → radiant-element-ssr-host.d.ts} +16 -16
  41. package/dist/core/radiant-element-ssr-host.js +3 -0
  42. package/dist/core/radiant-element-ssr-host.js.map +10 -0
  43. package/dist/core/radiant-element-ssr-registry.d.ts +18 -0
  44. package/dist/core/radiant-element-ssr-registry.js +3 -0
  45. package/dist/core/radiant-element-ssr-registry.js.map +10 -0
  46. package/dist/core/radiant-element.d.ts +38 -138
  47. package/dist/core/radiant-element.js +2 -2
  48. package/dist/core/radiant-element.js.map +21 -10
  49. package/dist/core/reactive-host.d.ts +3 -16
  50. package/dist/core/reactive-host.js +2 -2
  51. package/dist/core/reactive-host.js.map +7 -4
  52. package/dist/core/reactive-jsx-value.d.ts +2 -1
  53. package/dist/core/reactive-jsx-value.js.map +2 -2
  54. package/dist/core/reactive-prop-core.d.ts +44 -0
  55. package/dist/core/reactive-prop-core.js +3 -0
  56. package/dist/core/reactive-prop-core.js.map +11 -0
  57. package/dist/core/reactive-prop-metadata.d.ts +1 -1
  58. package/dist/core/reactive-prop-metadata.js +2 -2
  59. package/dist/core/reactive-prop-metadata.js.map +2 -2
  60. package/dist/core/reactive-property-state.d.ts +17 -0
  61. package/dist/core/reactive-property-state.js +3 -0
  62. package/dist/core/reactive-property-state.js.map +12 -0
  63. package/dist/core/reactivity-adapter.d.ts +8 -0
  64. package/dist/core/reactivity-adapter.js +3 -0
  65. package/dist/core/reactivity-adapter.js.map +12 -0
  66. package/dist/core/reactivity-contract.d.ts +39 -0
  67. package/dist/core/reactivity-contract.js +2 -0
  68. package/dist/core/reactivity-contract.js.map +9 -0
  69. package/dist/core/reactivity-runtime.d.ts +18 -0
  70. package/dist/core/reactivity-runtime.js +3 -0
  71. package/dist/core/reactivity-runtime.js.map +11 -0
  72. package/dist/core/reactivity-signals.d.ts +10 -0
  73. package/dist/core/reactivity-signals.js +3 -0
  74. package/dist/core/reactivity-signals.js.map +10 -0
  75. package/dist/core/render-runtime.d.ts +28 -0
  76. package/dist/core/render-runtime.js +3 -0
  77. package/dist/core/render-runtime.js.map +16 -0
  78. package/dist/core/render-scheduler.d.ts +22 -0
  79. package/dist/core/render-scheduler.js +3 -0
  80. package/dist/core/render-scheduler.js.map +10 -0
  81. package/dist/core/slot-projection-runtime.js +2 -2
  82. package/dist/core/slot-projection-runtime.js.map +3 -3
  83. package/dist/decorators/attr.js +2 -2
  84. package/dist/decorators/attr.js.map +6 -5
  85. package/dist/decorators/controller.js +2 -2
  86. package/dist/decorators/controller.js.map +3 -3
  87. package/dist/decorators/event.js +2 -2
  88. package/dist/decorators/event.js.map +3 -3
  89. package/dist/decorators/legacy/attr.js +2 -2
  90. package/dist/decorators/legacy/attr.js.map +6 -5
  91. package/dist/decorators/legacy/event.js +2 -2
  92. package/dist/decorators/legacy/event.js.map +3 -3
  93. package/dist/decorators/legacy/host-readiness.d.ts +8 -0
  94. package/dist/decorators/legacy/host-readiness.js +3 -0
  95. package/dist/decorators/legacy/host-readiness.js.map +11 -0
  96. package/dist/decorators/legacy/instance-initializers.d.ts +16 -0
  97. package/dist/decorators/legacy/instance-initializers.js +2 -2
  98. package/dist/decorators/legacy/instance-initializers.js.map +3 -3
  99. package/dist/decorators/legacy/on-event.js +2 -2
  100. package/dist/decorators/legacy/on-event.js.map +6 -5
  101. package/dist/decorators/legacy/on-updated.d.ts +1 -1
  102. package/dist/decorators/legacy/on-updated.js +2 -2
  103. package/dist/decorators/legacy/on-updated.js.map +4 -4
  104. package/dist/decorators/legacy/query-slot.js +2 -2
  105. package/dist/decorators/legacy/query-slot.js.map +5 -5
  106. package/dist/decorators/legacy/query.js +2 -2
  107. package/dist/decorators/legacy/query.js.map +3 -3
  108. package/dist/decorators/legacy/reactive-field.js +2 -2
  109. package/dist/decorators/legacy/reactive-field.js.map +3 -3
  110. package/dist/decorators/legacy/reactive-prop.d.ts +1 -1
  111. package/dist/decorators/legacy/reactive-prop.js +2 -2
  112. package/dist/decorators/legacy/reactive-prop.js.map +7 -6
  113. package/dist/decorators/legacy/signal.d.ts +1 -1
  114. package/dist/decorators/legacy/signal.js +2 -2
  115. package/dist/decorators/legacy/signal.js.map +6 -5
  116. package/dist/decorators/on-event.js +2 -2
  117. package/dist/decorators/on-event.js.map +6 -5
  118. package/dist/decorators/on-updated.js +2 -2
  119. package/dist/decorators/on-updated.js.map +4 -4
  120. package/dist/decorators/prop.d.ts +1 -1
  121. package/dist/decorators/prop.js +2 -2
  122. package/dist/decorators/prop.js.map +9 -8
  123. package/dist/decorators/query-slot.js +2 -2
  124. package/dist/decorators/query-slot.js.map +6 -6
  125. package/dist/decorators/query.js +2 -2
  126. package/dist/decorators/query.js.map +3 -3
  127. package/dist/decorators/shared/reactive-attr.d.ts +1 -1
  128. package/dist/decorators/shared/reactive-attr.js +2 -2
  129. package/dist/decorators/shared/reactive-attr.js.map +5 -4
  130. package/dist/decorators/signal.js +2 -2
  131. package/dist/decorators/signal.js.map +7 -6
  132. package/dist/decorators/standard/attr.js +2 -2
  133. package/dist/decorators/standard/attr.js.map +5 -4
  134. package/dist/decorators/standard/on-event.js +2 -2
  135. package/dist/decorators/standard/on-event.js.map +5 -4
  136. package/dist/decorators/standard/query-slot.d.ts +0 -1
  137. package/dist/decorators/standard/query-slot.js +2 -2
  138. package/dist/decorators/standard/query-slot.js.map +4 -4
  139. package/dist/decorators/standard/reactive-field.js +2 -2
  140. package/dist/decorators/standard/reactive-field.js.map +3 -3
  141. package/dist/decorators/standard/reactive-prop.d.ts +1 -1
  142. package/dist/decorators/standard/reactive-prop.js +2 -2
  143. package/dist/decorators/standard/reactive-prop.js.map +6 -5
  144. package/dist/decorators/standard/signal.d.ts +1 -1
  145. package/dist/decorators/standard/signal.js +2 -2
  146. package/dist/decorators/standard/signal.js.map +5 -4
  147. package/dist/decorators/state.js +2 -2
  148. package/dist/decorators/state.js.map +4 -4
  149. package/dist/helpers/create-event-listener.js +2 -2
  150. package/dist/helpers/create-event-listener.js.map +5 -4
  151. package/dist/helpers/create-query-slot.d.ts +0 -1
  152. package/dist/helpers/create-query-slot.js +2 -2
  153. package/dist/helpers/create-query-slot.js.map +3 -3
  154. package/dist/helpers/index.js +2 -2
  155. package/dist/helpers/index.js.map +6 -5
  156. package/dist/index.js +2 -2
  157. package/dist/index.js.map +37 -25
  158. package/dist/package.json +209 -0
  159. package/dist/server/host-attribute-serialization.d.ts +46 -0
  160. package/dist/server/host-attribute-serialization.js +3 -0
  161. package/dist/server/host-attribute-serialization.js.map +12 -0
  162. package/dist/server/host-script-composition.d.ts +42 -0
  163. package/dist/server/host-script-composition.js +3 -0
  164. package/dist/server/host-script-composition.js.map +10 -0
  165. package/dist/server/install-light-dom-shim.js +2 -2
  166. package/dist/server/install-light-dom-shim.js.map +3 -3
  167. package/dist/server/internal-radiant-host.d.ts +2 -0
  168. package/dist/server/internal-radiant-host.js +3 -0
  169. package/dist/server/internal-radiant-host.js.map +9 -0
  170. package/dist/server/light-dom-shim.d.ts +9 -0
  171. package/dist/server/light-dom-shim.js +2 -2
  172. package/dist/server/light-dom-shim.js.map +3 -3
  173. package/dist/server/radiant-element-ssr-bridge.d.ts +21 -0
  174. package/dist/server/radiant-element-ssr-bridge.js +3 -0
  175. package/dist/server/radiant-element-ssr-bridge.js.map +24 -0
  176. package/dist/server/radiant-element-ssr-extractor.d.ts +2 -0
  177. package/dist/server/radiant-element-ssr-extractor.js +3 -0
  178. package/dist/server/radiant-element-ssr-extractor.js.map +12 -0
  179. package/dist/server/radiant-element-ssr-service.d.ts +13 -0
  180. package/dist/server/radiant-element-ssr-service.js +3 -0
  181. package/dist/server/radiant-element-ssr-service.js.map +22 -0
  182. package/dist/server/radiant-element-ssr.d.ts +1 -0
  183. package/dist/server/radiant-element-ssr.js +3 -0
  184. package/dist/server/radiant-element-ssr.js.map +24 -0
  185. package/dist/server/render-component.d.ts +3 -9
  186. package/dist/server/render-component.js +2 -2
  187. package/dist/server/render-component.js.map +17 -9
  188. package/dist/server/render-controller.js +2 -2
  189. package/dist/server/render-controller.js.map +19 -11
  190. package/dist/server/render-fragment.d.ts +7 -0
  191. package/dist/server/render-fragment.js +3 -0
  192. package/dist/server/render-fragment.js.map +10 -0
  193. package/dist/server/slot-projection-html.js +2 -2
  194. package/dist/server/slot-projection-html.js.map +3 -3
  195. package/dist/tools/escape-css-identifier.d.ts +1 -0
  196. package/dist/tools/escape-css-identifier.js +3 -0
  197. package/dist/tools/escape-css-identifier.js.map +10 -0
  198. package/dist/tools/index.d.ts +1 -0
  199. package/dist/tools/index.js +2 -2
  200. package/dist/tools/index.js.map +4 -3
  201. package/dist/utils/escape-html-attribute.d.ts +2 -0
  202. package/dist/utils/escape-html-attribute.js +3 -0
  203. package/dist/utils/escape-html-attribute.js.map +10 -0
  204. package/package.json +12 -5
  205. package/dist/core/radiant-component-ssr-registry.d.ts +0 -54
  206. package/dist/core/radiant-component-ssr-registry.js +0 -3
  207. package/dist/core/radiant-component-ssr-registry.js.map +0 -10
  208. package/dist/core/radiant-component-ssr.js +0 -3
  209. package/dist/core/radiant-component-ssr.js.map +0 -14
  210. package/dist/server/radiant-component-ssr-runtime.d.ts +0 -9
  211. package/dist/server/radiant-component-ssr-runtime.js +0 -3
  212. package/dist/server/radiant-component-ssr-runtime.js.map +0 -17
  213. package/size-budget.json +0 -25
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "87C567B9D118F84464756E2164756E21",
8
+ "names": []
9
+ }
@@ -2,6 +2,9 @@ type MinimalCustomElementRegistry = {
2
2
  define(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void;
3
3
  get(name: string): CustomElementConstructor | undefined;
4
4
  };
5
+ type MinimalCssNamespace = {
6
+ escape(value: string): string;
7
+ };
5
8
  /**
6
9
  * Minimal window-like runtime surface exposed by the SSR light-DOM shim.
7
10
  *
@@ -11,6 +14,8 @@ type MinimalCustomElementRegistry = {
11
14
  export type LightDomShimWindow = {
12
15
  /** Event constructor exposed to SSR-created components. */
13
16
  CustomEvent: typeof CustomEvent;
17
+ /** Document constructor exposed to SSR-created components. */
18
+ Document: typeof Document;
14
19
  /** Element constructor exposed to SSR-created components. */
15
20
  Element: typeof Element;
16
21
  /** Event constructor exposed to SSR-created components. */
@@ -23,6 +28,10 @@ export type LightDomShimWindow = {
23
28
  HTMLElement: typeof HTMLElement;
24
29
  /** Node constructor exposed to SSR-created components. */
25
30
  Node: typeof Node;
31
+ /** Minimal document instance exposed to SSR-created components. */
32
+ document: Document;
33
+ /** Minimal CSS namespace exposed to SSR-created components. */
34
+ CSS: MinimalCssNamespace;
26
35
  /** Custom element registry used while rendering in SSR. */
27
36
  customElements: MinimalCustomElementRegistry;
28
37
  };
@@ -1,3 +1,3 @@
1
- var D=((r)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(s,f)=>(typeof require<"u"?require:s)[f]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Q=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function z(r){let s=[],f=0;while(f<r.length){let c=f;if(r.startsWith("<!--",f)){let y=r.indexOf("-->",f+4);f=y===-1?r.length:y+3,s.push(r.slice(c,f));continue}if(r[f]!=="<"){let y=r.indexOf("<",f);f=y===-1?r.length:y,s.push(r.slice(c,f));continue}let u=O(r,f);if(!u){s.push(r.slice(c));break}if(u.type!=="open"||u.selfClosing||Q.has(u.tagName)){f=u.end,s.push(r.slice(c,f));continue}f=u.end;let k=1;while(f<r.length&&k>0){let y=r.indexOf("<",f);if(y===-1){f=r.length;break}let p=O(r,y);if(!p){f=r.length;break}if(f=p.end,p.type==="comment"||p.type==="declaration")continue;if(p.type==="open"&&!p.selfClosing&&!Q.has(p.tagName)){k+=1;continue}if(p.type==="close")k-=1}s.push(r.slice(c,f))}return s.filter((c)=>c!=="")}function Y(r,s){let f;for(let c=s+1;c<r.length;c+=1){let u=r[c];if(f){if(u===f)f=void 0;continue}if(u==='"'||u==="'"){f=u;continue}if(u===">")return c+1}return r.length}function F(r){let s={},f=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let c of r.matchAll(f)){let[,u,k,y,p]=c;if(!u)continue;s[u]=k??y??p??""}return s}function O(r,s){if(r.startsWith("<!--",s)){let j=r.indexOf("-->",s+4);return{end:j===-1?r.length:j+3,type:"comment"}}let f=Y(r,s),c=r.slice(s+1,f-1).trim();if(c==="")return;if(c.startsWith("!")||c.startsWith("?"))return{end:f,type:"declaration"};if(c.startsWith("/"))return{end:f,type:"close"};let u=/\/\s*$/.test(c),k=u?c.replace(/\/\s*$/,"").trim():c,y=k.split(/[\s/>]/,1)[0]?.toLowerCase()??"",p=y.length,_=k.slice(p).trim(),X=u||Q.has(y)?"":R(r,s,f,y);return{attributes:F(_),end:f,innerHtml:X,selfClosing:u,tagName:y,type:"open"}}function R(r,s,f,c){let u=f,k=1;while(u<r.length&&k>0){let y=r.indexOf("<",u);if(y===-1)return r.slice(f);let p=O(r,y);if(!p)return r.slice(f);if(p.type==="open"&&p.tagName===c&&!p.selfClosing&&!Q.has(c))k+=1;if(p.type==="close"){if(r.slice(y+2,p.end-1).trim().toLowerCase()===c){if(k-=1,k===0)return r.slice(f,y)}}u=p.end}return r.slice(f)}class b extends EventTarget{nodeType;static ELEMENT_NODE=1;static TEXT_NODE=3;childNodes=[];parentNode=null;constructor(r){super();this.nodeType=r}append(...r){for(let s of r)this.appendChild(typeof s==="string"?V(s):s)}appendChild(r){if("parentNode"in r&&r.parentNode&&"removeChild"in r.parentNode)r.parentNode.removeChild(r);return this.childNodes.push(r),r.parentNode=this,r}removeChild(r){let s=this.childNodes.indexOf(r);if(s===-1)return r;return this.childNodes.splice(s,1),r.parentNode=null,r}replaceChildren(...r){for(let s of this.childNodes)s.parentNode=null;this.childNodes=[],this.append(...r)}get textContent(){return this.childNodes.map((r)=>r.textContent??"").join("")}set textContent(r){this.replaceChildren(r??"")}}class G extends b{value;constructor(r){super(b.TEXT_NODE);this.value=r}get textContent(){return this.value}set textContent(r){this.value=r??""}}class $ extends b{attributes=new Map;fragmentHtml;fragmentText;localName;tagName;constructor(r="div"){super(b.ELEMENT_NODE);this.localName=r.toLowerCase(),this.tagName=this.localName.toUpperCase()}hasAttribute(r){return this.attributes.has(r)}getAttribute(r){return this.attributes.get(r)??null}getAttributeNames(){return Array.from(this.attributes.keys())}setAttribute(r,s){this.fragmentHtml=void 0,this.attributes.set(r,String(s))}removeAttribute(r){this.fragmentHtml=void 0,this.attributes.delete(r)}querySelector(){return null}querySelectorAll(){return[]}matches(){return!1}get outerHTML(){if(this.fragmentHtml!==void 0)return this.fragmentHtml;let r=Array.from(this.attributes.entries()).map(([s,f])=>` ${s}="${T(f)}"`).join("");return`<${this.localName}${r}>${this.innerHTML}</${this.localName}>`}get innerHTML(){return this.childNodes.map((r)=>C(r)).join("")}set innerHTML(r){this.fragmentHtml=void 0,this.fragmentText=void 0,this.replaceChildren(...U(r))}get textContent(){return this.fragmentText??super.textContent??""}set textContent(r){this.fragmentHtml=void 0,this.fragmentText=r??"",super.textContent=r}setSerializedFragment(r,s,f){this.fragmentHtml=r,this.fragmentText=s,this.attributes=new Map(Object.entries(f)),this.replaceChildren()}}class B{bubbles;cancelable;composed;type;constructor(r,s={}){this.type=r,this.bubbles=s.bubbles??!1,this.cancelable=s.cancelable??!1,this.composed=s.composed??!1}}class Z extends B{detail;constructor(r,s={}){super(r,s);this.detail=s.detail}}class A extends ${isConnected=!1;constructor(r="div"){super(r)}insertAdjacentHTML(r,s){this.append(...U(s))}}class q extends A{constructor(){super("script")}}class J{definitions=new Map;define(r,s){if(this.definitions.has(r))return;this.definitions.set(r,s)}get(r){return this.definitions.get(r)}}var P;function V(r){return new G(r)}function K(){let r=globalThis,s=r.customElements;if(typeof r.Node>"u"||typeof r.Element>"u"||typeof r.HTMLElement>"u"||!s||typeof s.define!=="function"||typeof s.get!=="function")return;return r.window??{CustomEvent:r.CustomEvent??Z,Element:r.Element,Event:r.Event??B,EventTarget:r.EventTarget??EventTarget,HTMLScriptElement:r.HTMLScriptElement??r.HTMLElement,HTMLElement:r.HTMLElement,Node:r.Node,customElements:s}}function w(){let r=K();if(r)return r;return x()}function h(){return w(),{prepareHost(r,s={}){if(s.authoredContent!==void 0)r.innerHTML=s.authoredContent}}}function x(){let r=K();if(r)return r;if(P)return P;let s=new J,f=globalThis.Event??B,c=globalThis.CustomEvent??Z,u=globalThis.EventTarget??EventTarget;return P={CustomEvent:c,Element:$,Event:f,EventTarget:u,HTMLScriptElement:q,HTMLElement:A,Node:b,customElements:s},Object.assign(globalThis,{CustomEvent:c,Element:$,Event:f,EventTarget:u,HTMLScriptElement:q,HTMLElement:A,Node:b,customElements:s,window:P}),P}function W(r,s){let f=s.tagName==="script"?new q:new A(s.tagName);return f.setSerializedFragment(r,L(s.innerHtml),s.attributes),f}function T(r){return r.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function L(r){return r.replace(/<!--.*?-->/gs,"").replace(/<[^>]+>/g,"")}function U(r){return z(r).map((s)=>{if(!s.startsWith("<"))return V(s);let f=O(s,0);if(!f||f.type!=="open")return V(s);return W(s,f)})}function C(r){if(r.nodeType===b.TEXT_NODE)return r.textContent??"";return"outerHTML"in r&&typeof r.outerHTML==="string"?r.outerHTML:r.textContent??""}export{x as installLightDomShim,w as ensureLightDomShim,h as createServerRenderEnvironment};
1
+ var r=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(O,Q)=>(typeof require<"u"?require:O)[Q]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});var F=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(f){let O=[],Q=0;while(Q<f.length){let $=Q;if(f.startsWith("<!--",Q)){let B=f.indexOf("-->",Q+4);Q=B===-1?f.length:B+3,O.push(f.slice($,Q));continue}if(f[Q]!=="<"){let B=f.indexOf("<",Q);Q=B===-1?f.length:B,O.push(f.slice($,Q));continue}let q=G(f,Q);if(!q){O.push(f.slice($));break}if(q.type!=="open"||q.selfClosing||F.has(q.tagName)){Q=q.end,O.push(f.slice($,Q));continue}Q=q.end;let Z=1;while(Q<f.length&&Z>0){let B=f.indexOf("<",Q);if(B===-1){Q=f.length;break}let V=G(f,B);if(!V){Q=f.length;break}if(Q=V.end,V.type==="comment"||V.type==="declaration")continue;if(V.type==="open"&&!V.selfClosing&&!F.has(V.tagName)){Z+=1;continue}if(V.type==="close")Z-=1}O.push(f.slice($,Q))}return O.filter(($)=>$!=="")}function w(f,O){let Q;for(let $=O+1;$<f.length;$+=1){let q=f[$];if(Q){if(q===Q)Q=void 0;continue}if(q==='"'||q==="'"){Q=q;continue}if(q===">")return $+1}return f.length}function C(f){let O={},Q=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let $ of f.matchAll(Q)){let[,q,Z,B,V]=$;if(!q)continue;O[q]=Z??B??V??""}return O}function G(f,O){if(f.startsWith("<!--",O)){let y=f.indexOf("-->",O+4);return{end:y===-1?f.length:y+3,type:"comment"}}let Q=w(f,O),$=f.slice(O+1,Q-1).trim();if($==="")return;if($.startsWith("!")||$.startsWith("?"))return{end:Q,type:"declaration"};if($.startsWith("/"))return{end:Q,type:"close"};let q=/\/\s*$/.test($),Z=q?$.replace(/\/\s*$/,"").trim():$,B=Z.split(/[\s/>]/,1)[0]?.toLowerCase()??"",V=B.length,Y=Z.slice(V).trim(),I=q||F.has(B)?"":k(f,O,Q,B);return{attributes:C(Y),end:Q,innerHtml:I,selfClosing:q,tagName:B,type:"open"}}function k(f,O,Q,$){let q=Q,Z=1;while(q<f.length&&Z>0){let B=f.indexOf("<",q);if(B===-1)return f.slice(Q);let V=G(f,B);if(!V)return f.slice(Q);if(V.type==="open"&&V.tagName===$&&!V.selfClosing&&!F.has($))Z+=1;if(V.type==="close"){if(f.slice(B+2,V.end-1).trim().toLowerCase()===$){if(Z-=1,Z===0)return f.slice(Q,B)}}q=V.end}return f.slice(Q)}class _ extends EventTarget{nodeType;static DOCUMENT_NODE=9;static ELEMENT_NODE=1;static TEXT_NODE=3;childNodes=[];ownerDocument;parentNode=null;constructor(f,O=null){super();this.nodeType=f;this.ownerDocument=O}append(...f){for(let O of f)this.appendChild(typeof O==="string"?S(O):O)}appendChild(f){if("parentNode"in f&&f.parentNode&&"removeChild"in f.parentNode)f.parentNode.removeChild(f);return this.childNodes.push(f),f.ownerDocument=this.nodeType===_.DOCUMENT_NODE?this:this.ownerDocument,f.parentNode=this,f}removeChild(f){let O=this.childNodes.indexOf(f);if(O===-1)return f;return this.childNodes.splice(O,1),f.parentNode=null,f}replaceChildren(...f){for(let O of this.childNodes)O.parentNode=null;this.childNodes=[],this.append(...f)}get textContent(){return this.childNodes.map((f)=>f.textContent??"").join("")}set textContent(f){this.replaceChildren(f??"")}getRootNode(){let f=this;while("parentNode"in f&&f.parentNode)f=f.parentNode;return f}}class U extends _{value;constructor(f,O=z()){super(_.TEXT_NODE,O);this.value=f}get textContent(){return this.value}set textContent(f){this.value=f??""}}class x{element;constructor(f){this.element=f}add(...f){let O=new Set(this.readTokens());for(let Q of f)if(Q!=="")O.add(Q);this.writeTokens([...O])}remove(...f){let O=new Set(this.readTokens());for(let Q of f)O.delete(Q);this.writeTokens([...O])}toggle(f,O){let Q=this.contains(f);if(O??!Q)return this.add(f),!0;return this.remove(f),!1}contains(f){return this.readTokens().includes(f)}toString(){return this.value}get value(){return this.element.getAttribute("class")??""}readTokens(){return this.value.split(/\s+/).map((f)=>f.trim()).filter((f)=>f.length>0)}writeTokens(f){if(f.length===0){this.element.removeAttribute("class");return}this.element.setAttribute("class",f.join(" "))}}class R extends _{attributes=new Map;classListValue;datasetValue;fragmentHtml;fragmentText;localName;tagName;constructor(f="div",O=z()){super(_.ELEMENT_NODE,O);this.localName=f.toLowerCase(),this.tagName=this.localName.toUpperCase()}get id(){return this.getAttribute("id")??""}set id(f){if(f===""){this.removeAttribute("id");return}this.setAttribute("id",f)}get classList(){return this.classListValue??=new x(this),this.classListValue}get dataset(){return this.datasetValue??=new Proxy({},{deleteProperty:(f,O)=>{if(typeof O!=="string")return!1;return this.removeAttribute(K(O)),!0},get:(f,O)=>{if(typeof O!=="string")return;return this.getAttribute(K(O))??void 0},getOwnPropertyDescriptor:(f,O)=>{if(typeof O!=="string")return;return{configurable:!0,enumerable:!0,value:this.getAttribute(K(O))??void 0,writable:!0}},has:(f,O)=>{return typeof O==="string"&&this.hasAttribute(K(O))},ownKeys:()=>{return this.getAttributeNames().filter((f)=>f.startsWith("data-")).map((f)=>p(f.slice(5)))},set:(f,O,Q)=>{if(typeof O!=="string")return!1;return this.setAttribute(K(O),String(Q)),!0}}),this.datasetValue}hasAttribute(f){return this.attributes.has(f)}getAttribute(f){return this.attributes.get(f)??null}getAttributeNames(){return Array.from(this.attributes.keys())}setAttribute(f,O){this.fragmentHtml=void 0,this.attributes.set(f,String(O))}toggleAttribute(f,O){if(O??!this.hasAttribute(f))return this.setAttribute(f,""),!0;return this.removeAttribute(f),!1}removeAttribute(f){this.fragmentHtml=void 0,this.attributes.delete(f)}querySelector(){return null}querySelectorAll(){return[]}matches(){return!1}get outerHTML(){if(this.fragmentHtml!==void 0)return this.fragmentHtml;let f=Array.from(this.attributes.entries()).map(([O,Q])=>` ${O}="${D(Q)}"`).join("");return`<${this.localName}${f}>${this.innerHTML}</${this.localName}>`}get innerHTML(){return this.childNodes.map((f)=>v(f)).join("")}set innerHTML(f){this.fragmentHtml=void 0,this.fragmentText=void 0,this.replaceChildren(...T(f,this.ownerDocument))}get textContent(){return this.fragmentText??super.textContent??""}set textContent(f){this.fragmentHtml=void 0,this.fragmentText=f??"",super.textContent=f}setSerializedFragment(f,O,Q){this.fragmentHtml=f,this.fragmentText=O,this.attributes=new Map(Object.entries(Q)),this.replaceChildren()}}class A{bubbles;cancelable;composed;type;constructor(f,O={}){this.type=f,this.bubbles=O.bubbles??!1,this.cancelable=O.cancelable??!1,this.composed=O.composed??!1}}class P extends A{detail;constructor(f,O={}){super(f,O);this.detail=O.detail}}class j extends R{isConnected=!1;constructor(f="div",O=z()){super(f,O)}insertAdjacentHTML(f,O){this.append(...T(O,this.ownerDocument))}}class X extends j{constructor(f=z()){super("script",f)}}class b extends _{constructor(){super(_.DOCUMENT_NODE)}createElement(f){return f.toLowerCase()==="script"?new X(this):new j(f,this)}createTextNode(f){return new U(f,this)}querySelector(){return null}querySelectorAll(){return[]}}class H{definitions=new Map;define(f,O){if(this.definitions.has(f))return;this.definitions.set(f,O)}get(f){return this.definitions.get(f)}}var J,W={escape(f){return u(String(f))}};function S(f){return new U(f,z())}function z(){return globalThis.document??null}function L(){let f=globalThis,O=f.customElements;if(typeof f.Node>"u"||typeof f.Document>"u"||typeof f.Element>"u"||typeof f.HTMLElement>"u"||typeof f.document>"u"||!O||typeof O.define!=="function"||typeof O.get!=="function")return;return f.window??{CSS:f.CSS??W,CustomEvent:f.CustomEvent??P,Document:f.Document,Element:f.Element,Event:f.Event??A,EventTarget:f.EventTarget??EventTarget,HTMLScriptElement:f.HTMLScriptElement??f.HTMLElement,HTMLElement:f.HTMLElement,Node:f.Node,document:f.document,customElements:O}}function h(){let f=L();if(f)return f;return g()}function i(){return h(),{prepareHost(f,O={}){if(O.authoredContent!==void 0)f.innerHTML=O.authoredContent}}}function g(){let f=L();if(f)return f;if(J)return J;let O=new H,Q=new b,$=globalThis.Event??A,q=globalThis.CustomEvent??P,Z=b,B=globalThis.EventTarget??EventTarget;return J={CSS:globalThis.CSS??W,CustomEvent:q,Document:Z,Element:R,Event:$,EventTarget:B,HTMLScriptElement:X,HTMLElement:j,Node:_,document:Q,customElements:O},Object.assign(globalThis,{CSS:globalThis.CSS??W,CustomEvent:q,Document:Z,Element:R,Event:$,EventTarget:B,HTMLScriptElement:X,HTMLElement:j,Node:_,document:Q,customElements:O,window:J}),J}function N(f,O,Q){let $=O.tagName==="script"?new X(Q):new j(O.tagName,Q);return $.setSerializedFragment(f,E(O.innerHtml),O.attributes),$}function D(f){return f.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function E(f){return f.replace(/<!--.*?-->/gs,"").replace(/<[^>]+>/g,"")}function T(f,O=z()){return s(f).map((Q)=>{if(!Q.startsWith("<"))return new U(Q,O);let $=G(Q,0);if(!$||$.type!=="open")return new U(Q,O);return N(Q,$,O)})}function K(f){return`data-${f.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function p(f){return f.replace(/-([a-z])/g,(O,Q)=>Q.toUpperCase())}function u(f){let O="";for(let Q=0;Q<f.length;Q+=1){let $=f[Q]??"",q=$.codePointAt(0)??0;if(q===0){O+="�";continue}let Z=q>=1&&q<=31||q===127,B=Q===0&&q>=48&&q<=57,V=Q===1&&q>=48&&q<=57&&(f[0]??"")==="-",Y=Q===0&&$==="-"&&f.length===1;if(Z||B||V){O+=`\\${q.toString(16)} `;continue}if(q>=128||$==="-"||$==="_"||q>=48&&q<=57||q>=65&&q<=90||q>=97&&q<=122){O+=Y?`\\${$}`:$;continue}O+=`\\${$}`}return O}function v(f){if(f.nodeType===_.TEXT_NODE)return f.textContent??"";return"outerHTML"in f&&typeof f.outerHTML==="string"?f.outerHTML:f.textContent??""}export{g as installLightDomShim,h as ensureLightDomShim,i as createServerRenderEnvironment};
2
2
 
3
- //# debugId=83537DC714E1513D64756E2164756E21
3
+ //# debugId=701B97612CD77C2264756E2164756E21
@@ -3,9 +3,9 @@
3
3
  "sources": ["../src/server/html-parser.ts", "../src/server/light-dom-shim.ts"],
4
4
  "sourcesContent": [
5
5
  "export type ParsedHtmlTag = {\n\tattributes: Record<string, string>;\n\tend: number;\n\tinnerHtml: string;\n\tselfClosing: boolean;\n\ttagName: string;\n\ttype: 'open';\n};\n\nexport type ParsedHtmlToken =\n\t| ParsedHtmlTag\n\t| {\n\t\t\tend: number;\n\t\t\ttype: 'close';\n\t }\n\t| {\n\t\t\tend: number;\n\t\t\ttype: 'comment' | 'declaration';\n\t };\n\nexport const voidElementNames = new Set([\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n]);\n\nexport function collectTopLevelHtmlFragments(html: string): string[] {\n\tconst fragments: string[] = [];\n\tlet index = 0;\n\n\twhile (index < html.length) {\n\t\tconst fragmentStart = index;\n\n\t\tif (html.startsWith('<!--', index)) {\n\t\t\tconst commentEnd = html.indexOf('-->', index + 4);\n\t\t\tindex = commentEnd === -1 ? html.length : commentEnd + 3;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (html[index] !== '<') {\n\t\t\tconst nextTagIndex = html.indexOf('<', index);\n\t\t\tindex = nextTagIndex === -1 ? html.length : nextTagIndex;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst token = parseHtmlTagToken(html, index);\n\n\t\tif (!token) {\n\t\t\tfragments.push(html.slice(fragmentStart));\n\t\t\tbreak;\n\t\t}\n\n\t\tif (token.type !== 'open' || token.selfClosing || voidElementNames.has(token.tagName)) {\n\t\t\tindex = token.end;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tindex = token.end;\n\t\tlet depth = 1;\n\n\t\twhile (index < html.length && depth > 0) {\n\t\t\tconst nextTagIndex = html.indexOf('<', index);\n\n\t\t\tif (nextTagIndex === -1) {\n\t\t\t\tindex = html.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst nestedToken = parseHtmlTagToken(html, nextTagIndex);\n\n\t\t\tif (!nestedToken) {\n\t\t\t\tindex = html.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tindex = nestedToken.end;\n\n\t\t\tif (nestedToken.type === 'comment' || nestedToken.type === 'declaration') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nestedToken.type === 'open' && !nestedToken.selfClosing && !voidElementNames.has(nestedToken.tagName)) {\n\t\t\t\tdepth += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nestedToken.type === 'close') {\n\t\t\t\tdepth -= 1;\n\t\t\t}\n\t\t}\n\n\t\tfragments.push(html.slice(fragmentStart, index));\n\t}\n\n\treturn fragments.filter((fragment) => fragment !== '');\n}\n\nexport function findHtmlTagEnd(html: string, startIndex: number): number {\n\tlet quote: '\"' | \"'\" | undefined;\n\n\tfor (let index = startIndex + 1; index < html.length; index += 1) {\n\t\tconst character = html[index];\n\n\t\tif (quote) {\n\t\t\tif (character === quote) {\n\t\t\t\tquote = undefined;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === '\"' || character === \"'\") {\n\t\t\tquote = character;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === '>') {\n\t\t\treturn index + 1;\n\t\t}\n\t}\n\n\treturn html.length;\n}\n\nexport function parseAttributes(rawAttributes: string): Record<string, string> {\n\tconst attributes: Record<string, string> = {};\n\tconst attributePattern = /([:^@A-Za-z0-9_.-]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'>/]+)))?/g;\n\n\tfor (const match of rawAttributes.matchAll(attributePattern)) {\n\t\tconst [, name, doubleQuoted, singleQuoted, bareValue] = match;\n\n\t\tif (!name) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[name] = doubleQuoted ?? singleQuoted ?? bareValue ?? '';\n\t}\n\n\treturn attributes;\n}\n\nexport function parseHtmlTagToken(html: string, startIndex: number): ParsedHtmlToken | undefined {\n\tif (html.startsWith('<!--', startIndex)) {\n\t\tconst endIndex = html.indexOf('-->', startIndex + 4);\n\t\treturn {\n\t\t\tend: endIndex === -1 ? html.length : endIndex + 3,\n\t\t\ttype: 'comment',\n\t\t};\n\t}\n\n\tconst endIndex = findHtmlTagEnd(html, startIndex);\n\tconst rawToken = html.slice(startIndex + 1, endIndex - 1).trim();\n\n\tif (rawToken === '') {\n\t\treturn undefined;\n\t}\n\n\tif (rawToken.startsWith('!') || rawToken.startsWith('?')) {\n\t\treturn {\n\t\t\tend: endIndex,\n\t\t\ttype: 'declaration',\n\t\t};\n\t}\n\n\tif (rawToken.startsWith('/')) {\n\t\treturn {\n\t\t\tend: endIndex,\n\t\t\ttype: 'close',\n\t\t};\n\t}\n\n\tconst selfClosing = /\\/\\s*$/.test(rawToken);\n\tconst tagBody = selfClosing ? rawToken.replace(/\\/\\s*$/, '').trim() : rawToken;\n\tconst tagName = tagBody.split(/[\\s/>]/, 1)[0]?.toLowerCase() ?? '';\n\tconst attributesStart = tagName.length;\n\tconst rawAttributes = tagBody.slice(attributesStart).trim();\n\tconst innerHtml =\n\t\tselfClosing || voidElementNames.has(tagName)\n\t\t\t? ''\n\t\t\t: extractInnerHtmlFragment(html, startIndex, endIndex, tagName);\n\n\treturn {\n\t\tattributes: parseAttributes(rawAttributes),\n\t\tend: endIndex,\n\t\tinnerHtml,\n\t\tselfClosing,\n\t\ttagName,\n\t\ttype: 'open',\n\t};\n}\n\nexport function extractInnerHtmlFragment(\n\thtml: string,\n\tstartIndex: number,\n\ttagEndIndex: number,\n\ttagName: string,\n): string {\n\tlet index = tagEndIndex;\n\tlet depth = 1;\n\n\twhile (index < html.length && depth > 0) {\n\t\tconst nextTagIndex = html.indexOf('<', index);\n\n\t\tif (nextTagIndex === -1) {\n\t\t\treturn html.slice(tagEndIndex);\n\t\t}\n\n\t\tconst nextTag = parseHtmlTagToken(html, nextTagIndex);\n\n\t\tif (!nextTag) {\n\t\t\treturn html.slice(tagEndIndex);\n\t\t}\n\n\t\tif (\n\t\t\tnextTag.type === 'open' &&\n\t\t\tnextTag.tagName === tagName &&\n\t\t\t!nextTag.selfClosing &&\n\t\t\t!voidElementNames.has(tagName)\n\t\t) {\n\t\t\tdepth += 1;\n\t\t}\n\n\t\tif (nextTag.type === 'close') {\n\t\t\tconst closingName = html\n\t\t\t\t.slice(nextTagIndex + 2, nextTag.end - 1)\n\t\t\t\t.trim()\n\t\t\t\t.toLowerCase();\n\n\t\t\tif (closingName === tagName) {\n\t\t\t\tdepth -= 1;\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\treturn html.slice(tagEndIndex, nextTagIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tindex = nextTag.end;\n\t}\n\n\treturn html.slice(tagEndIndex);\n}\n",
6
- "import { collectTopLevelHtmlFragments, parseHtmlTagToken, type ParsedHtmlTag } from './html-parser';\n\ntype MinimalCustomElementRegistry = {\n\tdefine(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void;\n\tget(name: string): CustomElementConstructor | undefined;\n};\n\n/**\n * Minimal window-like runtime surface exposed by the SSR light-DOM shim.\n *\n * This is intentionally much smaller than a browser `window`; it only includes\n * the constructors and registry access that Radiant SSR currently needs.\n */\nexport type LightDomShimWindow = {\n\t/** Event constructor exposed to SSR-created components. */\n\tCustomEvent: typeof CustomEvent;\n\t/** Element constructor exposed to SSR-created components. */\n\tElement: typeof Element;\n\t/** Event constructor exposed to SSR-created components. */\n\tEvent: typeof Event;\n\t/** EventTarget constructor exposed to SSR-created components. */\n\tEventTarget: typeof EventTarget;\n\t/** HTMLScriptElement constructor used by slot projection payload parsing. */\n\tHTMLScriptElement: typeof HTMLScriptElement;\n\t/** HTMLElement constructor exposed to SSR-created components. */\n\tHTMLElement: typeof HTMLElement;\n\t/** Node constructor exposed to SSR-created components. */\n\tNode: typeof Node;\n\t/** Custom element registry used while rendering in SSR. */\n\tcustomElements: MinimalCustomElementRegistry;\n};\n\n/** Host preparation options accepted by the server render environment. */\nexport type PrepareServerRenderHostOptions = {\n\t/** Serialized light-DOM content to attach to the host before SSR. */\n\tauthoredContent?: string;\n};\n\n/** Reusable SSR environment used to prepare component hosts before rendering. */\nexport type ServerRenderEnvironment = {\n\t/** Prepares the host instance for rendering, including authored light-DOM content. */\n\tprepareHost(host: HTMLElement, options?: PrepareServerRenderHostOptions): void;\n};\n\ntype MinimalParentNode = Node & ParentNode;\n\nclass MinimalNode extends EventTarget {\n\tstatic readonly ELEMENT_NODE = 1;\n\tstatic readonly TEXT_NODE = 3;\n\n\tpublic childNodes: Node[] = [];\n\tpublic parentNode: MinimalParentNode | null = null;\n\n\tconstructor(public readonly nodeType: number) {\n\t\tsuper();\n\t}\n\n\tappend(...nodes: Array<Node | string>): void {\n\t\tfor (const node of nodes) {\n\t\t\tthis.appendChild(typeof node === 'string' ? createTextNode(node) : node);\n\t\t}\n\t}\n\n\tappendChild<TNode extends Node>(node: TNode): TNode {\n\t\tif ('parentNode' in node && node.parentNode && 'removeChild' in node.parentNode) {\n\t\t\t(node.parentNode as Node & { removeChild(node: Node): Node }).removeChild(node);\n\t\t}\n\n\t\tthis.childNodes.push(node);\n\t\t(node as Node & { parentNode: MinimalParentNode | null }).parentNode = this as unknown as MinimalParentNode;\n\t\treturn node;\n\t}\n\n\tremoveChild<TNode extends Node>(node: TNode): TNode {\n\t\tconst nodeIndex = this.childNodes.indexOf(node);\n\n\t\tif (nodeIndex === -1) {\n\t\t\treturn node;\n\t\t}\n\n\t\tthis.childNodes.splice(nodeIndex, 1);\n\t\t(node as Node & { parentNode: MinimalParentNode | null }).parentNode = null;\n\t\treturn node;\n\t}\n\n\treplaceChildren(...nodes: Array<Node | string>): void {\n\t\tfor (const child of this.childNodes) {\n\t\t\t(child as Node & { parentNode: MinimalParentNode | null }).parentNode = null;\n\t\t}\n\n\t\tthis.childNodes = [];\n\t\tthis.append(...nodes);\n\t}\n\n\tget textContent(): string | null {\n\t\treturn this.childNodes.map((child) => child.textContent ?? '').join('');\n\t}\n\n\tset textContent(value: string | null) {\n\t\tthis.replaceChildren(value ?? '');\n\t}\n}\n\nclass MinimalTextNode extends MinimalNode {\n\tconstructor(private value: string) {\n\t\tsuper(MinimalNode.TEXT_NODE);\n\t}\n\n\toverride get textContent(): string {\n\t\treturn this.value;\n\t}\n\n\toverride set textContent(value: string | null) {\n\t\tthis.value = value ?? '';\n\t}\n}\n\nclass MinimalElement extends MinimalNode {\n\tprivate attributes = new Map<string, string>();\n\tprivate fragmentHtml?: string;\n\tprivate fragmentText?: string;\n\n\tpublic readonly localName: string;\n\tpublic readonly tagName: string;\n\n\tconstructor(tagName = 'div') {\n\t\tsuper(MinimalNode.ELEMENT_NODE);\n\t\tthis.localName = tagName.toLowerCase();\n\t\tthis.tagName = this.localName.toUpperCase();\n\t}\n\n\thasAttribute(name: string): boolean {\n\t\treturn this.attributes.has(name);\n\t}\n\n\tgetAttribute(name: string): string | null {\n\t\treturn this.attributes.get(name) ?? null;\n\t}\n\n\tgetAttributeNames(): string[] {\n\t\treturn Array.from(this.attributes.keys());\n\t}\n\n\tsetAttribute(name: string, value: unknown): void {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.attributes.set(name, String(value));\n\t}\n\n\tremoveAttribute(name: string): void {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.attributes.delete(name);\n\t}\n\n\tquerySelector(): Element | null {\n\t\treturn null;\n\t}\n\n\tquerySelectorAll(): Element[] {\n\t\treturn [];\n\t}\n\n\tmatches(): boolean {\n\t\treturn false;\n\t}\n\n\tget outerHTML(): string {\n\t\tif (this.fragmentHtml !== undefined) {\n\t\t\treturn this.fragmentHtml;\n\t\t}\n\n\t\tconst attributes = Array.from(this.attributes.entries())\n\t\t\t.map(([name, value]) => ` ${name}=\"${escapeHtmlAttribute(value)}\"`)\n\t\t\t.join('');\n\n\t\treturn `<${this.localName}${attributes}>${this.innerHTML}</${this.localName}>`;\n\t}\n\n\tget innerHTML(): string {\n\t\treturn this.childNodes.map((child) => serializeNodeHtml(child)).join('');\n\t}\n\n\tset innerHTML(html: string) {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.fragmentText = undefined;\n\t\tthis.replaceChildren(...parseHtmlToNodes(html));\n\t}\n\n\toverride get textContent(): string {\n\t\treturn this.fragmentText ?? super.textContent ?? '';\n\t}\n\n\toverride set textContent(value: string | null) {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.fragmentText = value ?? '';\n\t\tsuper.textContent = value;\n\t}\n\n\tsetSerializedFragment(fragmentHtml: string, fragmentText: string, attributes: Record<string, string>): void {\n\t\tthis.fragmentHtml = fragmentHtml;\n\t\tthis.fragmentText = fragmentText;\n\t\tthis.attributes = new Map(Object.entries(attributes));\n\t\tthis.replaceChildren();\n\t}\n}\n\nclass MinimalEvent {\n\tpublic readonly bubbles: boolean;\n\tpublic readonly cancelable: boolean;\n\tpublic readonly composed: boolean;\n\tpublic readonly type: string;\n\n\tconstructor(type: string, eventInitDict: EventInit = {}) {\n\t\tthis.type = type;\n\t\tthis.bubbles = eventInitDict.bubbles ?? false;\n\t\tthis.cancelable = eventInitDict.cancelable ?? false;\n\t\tthis.composed = eventInitDict.composed ?? false;\n\t}\n}\n\nclass MinimalCustomEvent<T = unknown> extends MinimalEvent {\n\tpublic readonly detail: T;\n\n\tconstructor(type: string, eventInitDict: CustomEventInit<T> = {}) {\n\t\tsuper(type, eventInitDict);\n\t\tthis.detail = eventInitDict.detail as T;\n\t}\n}\n\nclass MinimalHTMLElement extends MinimalElement {\n\tpublic isConnected = false;\n\n\tconstructor(tagName = 'div') {\n\t\tsuper(tagName);\n\t}\n\n\tinsertAdjacentHTML(_position: InsertPosition, html: string): void {\n\t\tthis.append(...parseHtmlToNodes(html));\n\t}\n\n\tconnectedCallback?(): void;\n\tattributeChangedCallback?(name: string, oldValue: string | null, newValue: string | null): void;\n\tdisconnectedCallback?(): void;\n}\n\nclass MinimalHtmlScriptElement extends MinimalHTMLElement {\n\tconstructor() {\n\t\tsuper('script');\n\t}\n}\n\nclass MinimalCustomElementsRegistry implements MinimalCustomElementRegistry {\n\tprivate definitions = new Map<string, CustomElementConstructor>();\n\n\tdefine(name: string, constructor: CustomElementConstructor): void {\n\t\tif (this.definitions.has(name)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.definitions.set(name, constructor);\n\t}\n\n\tget(name: string): CustomElementConstructor | undefined {\n\t\treturn this.definitions.get(name);\n\t}\n}\n\nlet installedWindow: LightDomShimWindow | undefined;\n\nfunction createTextNode(value: string): Node {\n\treturn new MinimalTextNode(value) as unknown as Node;\n}\n\nfunction getExistingWindowLike(): LightDomShimWindow | undefined {\n\tconst globalScope = globalThis as typeof globalThis & {\n\t\tCustomEvent?: typeof CustomEvent;\n\t\tElement?: typeof Element;\n\t\tEvent?: typeof Event;\n\t\tEventTarget?: typeof EventTarget;\n\t\tHTMLScriptElement?: typeof HTMLScriptElement;\n\t\tHTMLElement?: typeof HTMLElement;\n\t\tNode?: typeof Node;\n\t\tcustomElements?: MinimalCustomElementRegistry;\n\t\twindow?: LightDomShimWindow;\n\t};\n\tconst existingCustomElements = globalScope.customElements;\n\n\tif (\n\t\ttypeof globalScope.Node === 'undefined' ||\n\t\ttypeof globalScope.Element === 'undefined' ||\n\t\ttypeof globalScope.HTMLElement === 'undefined' ||\n\t\t!existingCustomElements ||\n\t\ttypeof existingCustomElements.define !== 'function' ||\n\t\ttypeof existingCustomElements.get !== 'function'\n\t) {\n\t\treturn undefined;\n\t}\n\n\treturn (\n\t\tglobalScope.window ?? {\n\t\t\tCustomEvent: (globalScope.CustomEvent ?? MinimalCustomEvent) as typeof CustomEvent,\n\t\t\tElement: globalScope.Element,\n\t\t\tEvent: (globalScope.Event ?? MinimalEvent) as typeof Event,\n\t\t\tEventTarget: (globalScope.EventTarget ?? EventTarget) as typeof EventTarget,\n\t\t\tHTMLScriptElement: (globalScope.HTMLScriptElement ?? globalScope.HTMLElement) as typeof HTMLScriptElement,\n\t\t\tHTMLElement: globalScope.HTMLElement,\n\t\t\tNode: globalScope.Node,\n\t\t\tcustomElements: existingCustomElements,\n\t\t}\n\t);\n}\n\n/** Ensures that a minimal window-like SSR runtime is available and returns it. */\nexport function ensureLightDomShim(): LightDomShimWindow {\n\tconst existingWindow = getExistingWindowLike();\n\n\tif (existingWindow) {\n\t\treturn existingWindow;\n\t}\n\n\treturn installLightDomShim();\n}\n\n/**\n * Creates a reusable SSR environment that can prepare a component host with\n * authored light-DOM content before rendering.\n *\n * Adapters can reuse a single environment across multiple render calls when\n * they want a single host-preparation entrypoint backed by the installed shim.\n */\n\nexport function createServerRenderEnvironment(): ServerRenderEnvironment {\n\tensureLightDomShim();\n\n\treturn {\n\t\tprepareHost(host: HTMLElement, options: PrepareServerRenderHostOptions = {}): void {\n\t\t\tif (options.authoredContent !== undefined) {\n\t\t\t\thost.innerHTML = options.authoredContent;\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Installs the smallest global surface needed to instantiate Radiant custom elements during SSR.\n */\nexport function installLightDomShim(): LightDomShimWindow {\n\tconst existingWindow = getExistingWindowLike();\n\n\tif (existingWindow) {\n\t\treturn existingWindow;\n\t}\n\n\tif (installedWindow) {\n\t\treturn installedWindow;\n\t}\n\n\tconst customElements = new MinimalCustomElementsRegistry();\n\tconst EventConstructor = (globalThis.Event ?? MinimalEvent) as typeof Event;\n\tconst CustomEventConstructor = (globalThis.CustomEvent ?? MinimalCustomEvent) as typeof CustomEvent;\n\tconst EventTargetConstructor = (globalThis.EventTarget ?? EventTarget) as typeof EventTarget;\n\tinstalledWindow = {\n\t\tCustomEvent: CustomEventConstructor,\n\t\tElement: MinimalElement as unknown as typeof Element,\n\t\tEvent: EventConstructor,\n\t\tEventTarget: EventTargetConstructor,\n\t\tHTMLScriptElement: MinimalHtmlScriptElement as unknown as typeof HTMLScriptElement,\n\t\tHTMLElement: MinimalHTMLElement as unknown as typeof HTMLElement,\n\t\tNode: MinimalNode as unknown as typeof Node,\n\t\tcustomElements,\n\t};\n\n\tObject.assign(globalThis, {\n\t\tCustomEvent: CustomEventConstructor,\n\t\tElement: MinimalElement,\n\t\tEvent: EventConstructor,\n\t\tEventTarget: EventTargetConstructor,\n\t\tHTMLScriptElement: MinimalHtmlScriptElement,\n\t\tHTMLElement: MinimalHTMLElement,\n\t\tNode: MinimalNode,\n\t\tcustomElements,\n\t\twindow: installedWindow,\n\t});\n\n\treturn installedWindow;\n}\n\nfunction createElementFromFragment(fragment: string, tag: ParsedHtmlTag): Node {\n\tconst element =\n\t\ttag.tagName === 'script'\n\t\t\t? (new MinimalHtmlScriptElement() as MinimalElement)\n\t\t\t: new MinimalHTMLElement(tag.tagName);\n\n\telement.setSerializedFragment(fragment, extractTextContent(tag.innerHtml), tag.attributes);\n\treturn element as unknown as Node;\n}\n\nfunction escapeHtmlAttribute(value: string): string {\n\treturn value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n\nfunction extractTextContent(html: string): string {\n\treturn html.replace(/<!--.*?-->/gs, '').replace(/<[^>]+>/g, '');\n}\n\nfunction parseHtmlToNodes(html: string): Node[] {\n\treturn collectTopLevelHtmlFragments(html).map((fragment) => {\n\t\tif (!fragment.startsWith('<')) {\n\t\t\treturn createTextNode(fragment);\n\t\t}\n\n\t\tconst tag = parseHtmlTagToken(fragment, 0);\n\n\t\tif (!tag || tag.type !== 'open') {\n\t\t\treturn createTextNode(fragment);\n\t\t}\n\n\t\treturn createElementFromFragment(fragment, tag);\n\t});\n}\n\nfunction serializeNodeHtml(node: Node): string {\n\tif (node.nodeType === MinimalNode.TEXT_NODE) {\n\t\treturn node.textContent ?? '';\n\t}\n\n\treturn 'outerHTML' in node && typeof node.outerHTML === 'string' ? node.outerHTML : (node.textContent ?? '');\n}\n"
6
+ "import { collectTopLevelHtmlFragments, parseHtmlTagToken, type ParsedHtmlTag } from './html-parser';\n\ntype MinimalCustomElementRegistry = {\n\tdefine(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void;\n\tget(name: string): CustomElementConstructor | undefined;\n};\n\ntype MinimalCssNamespace = {\n\tescape(value: string): string;\n};\n\n/**\n * Minimal window-like runtime surface exposed by the SSR light-DOM shim.\n *\n * This is intentionally much smaller than a browser `window`; it only includes\n * the constructors and registry access that Radiant SSR currently needs.\n */\nexport type LightDomShimWindow = {\n\t/** Event constructor exposed to SSR-created components. */\n\tCustomEvent: typeof CustomEvent;\n\t/** Document constructor exposed to SSR-created components. */\n\tDocument: typeof Document;\n\t/** Element constructor exposed to SSR-created components. */\n\tElement: typeof Element;\n\t/** Event constructor exposed to SSR-created components. */\n\tEvent: typeof Event;\n\t/** EventTarget constructor exposed to SSR-created components. */\n\tEventTarget: typeof EventTarget;\n\t/** HTMLScriptElement constructor used by slot projection payload parsing. */\n\tHTMLScriptElement: typeof HTMLScriptElement;\n\t/** HTMLElement constructor exposed to SSR-created components. */\n\tHTMLElement: typeof HTMLElement;\n\t/** Node constructor exposed to SSR-created components. */\n\tNode: typeof Node;\n\t/** Minimal document instance exposed to SSR-created components. */\n\tdocument: Document;\n\t/** Minimal CSS namespace exposed to SSR-created components. */\n\tCSS: MinimalCssNamespace;\n\t/** Custom element registry used while rendering in SSR. */\n\tcustomElements: MinimalCustomElementRegistry;\n};\n\n/** Host preparation options accepted by the server render environment. */\nexport type PrepareServerRenderHostOptions = {\n\t/** Serialized light-DOM content to attach to the host before SSR. */\n\tauthoredContent?: string;\n};\n\n/** Reusable SSR environment used to prepare component hosts before rendering. */\nexport type ServerRenderEnvironment = {\n\t/** Prepares the host instance for rendering, including authored light-DOM content. */\n\tprepareHost(host: HTMLElement, options?: PrepareServerRenderHostOptions): void;\n};\n\ntype MinimalParentNode = Node & ParentNode;\n\nclass MinimalNode extends EventTarget {\n\tstatic readonly DOCUMENT_NODE = 9;\n\tstatic readonly ELEMENT_NODE = 1;\n\tstatic readonly TEXT_NODE = 3;\n\n\tpublic childNodes: Node[] = [];\n\tpublic ownerDocument: Document | null;\n\tpublic parentNode: MinimalParentNode | null = null;\n\n\tconstructor(\n\t\tpublic readonly nodeType: number,\n\t\townerDocument: Document | null = null,\n\t) {\n\t\tsuper();\n\t\tthis.ownerDocument = ownerDocument;\n\t}\n\n\tappend(...nodes: Array<Node | string>): void {\n\t\tfor (const node of nodes) {\n\t\t\tthis.appendChild(typeof node === 'string' ? createTextNode(node) : node);\n\t\t}\n\t}\n\n\tappendChild<TNode extends Node>(node: TNode): TNode {\n\t\tif ('parentNode' in node && node.parentNode && 'removeChild' in node.parentNode) {\n\t\t\t(node.parentNode as Node & { removeChild(node: Node): Node }).removeChild(node);\n\t\t}\n\n\t\tthis.childNodes.push(node);\n\t\t(node as Node & { ownerDocument: Document | null }).ownerDocument =\n\t\t\tthis.nodeType === MinimalNode.DOCUMENT_NODE ? (this as unknown as Document) : this.ownerDocument;\n\t\t(node as Node & { parentNode: MinimalParentNode | null }).parentNode = this as unknown as MinimalParentNode;\n\t\treturn node;\n\t}\n\n\tremoveChild<TNode extends Node>(node: TNode): TNode {\n\t\tconst nodeIndex = this.childNodes.indexOf(node);\n\n\t\tif (nodeIndex === -1) {\n\t\t\treturn node;\n\t\t}\n\n\t\tthis.childNodes.splice(nodeIndex, 1);\n\t\t(node as Node & { parentNode: MinimalParentNode | null }).parentNode = null;\n\t\treturn node;\n\t}\n\n\treplaceChildren(...nodes: Array<Node | string>): void {\n\t\tfor (const child of this.childNodes) {\n\t\t\t(child as Node & { parentNode: MinimalParentNode | null }).parentNode = null;\n\t\t}\n\n\t\tthis.childNodes = [];\n\t\tthis.append(...nodes);\n\t}\n\n\tget textContent(): string | null {\n\t\treturn this.childNodes.map((child) => child.textContent ?? '').join('');\n\t}\n\n\tset textContent(value: string | null) {\n\t\tthis.replaceChildren(value ?? '');\n\t}\n\n\tgetRootNode(): Node {\n\t\tlet current: Node = this as unknown as Node;\n\n\t\twhile ('parentNode' in current && current.parentNode) {\n\t\t\tcurrent = current.parentNode;\n\t\t}\n\n\t\treturn current;\n\t}\n}\n\nclass MinimalTextNode extends MinimalNode {\n\tconstructor(\n\t\tprivate value: string,\n\t\townerDocument: Document | null = getInstalledDocumentLike(),\n\t) {\n\t\tsuper(MinimalNode.TEXT_NODE, ownerDocument);\n\t}\n\n\toverride get textContent(): string {\n\t\treturn this.value;\n\t}\n\n\toverride set textContent(value: string | null) {\n\t\tthis.value = value ?? '';\n\t}\n}\n\nclass MinimalClassList {\n\tconstructor(private readonly element: MinimalElement) {}\n\n\tadd(...tokens: string[]): void {\n\t\tconst nextTokens = new Set(this.readTokens());\n\n\t\tfor (const token of tokens) {\n\t\t\tif (token !== '') {\n\t\t\t\tnextTokens.add(token);\n\t\t\t}\n\t\t}\n\n\t\tthis.writeTokens([...nextTokens]);\n\t}\n\n\tremove(...tokens: string[]): void {\n\t\tconst nextTokens = new Set(this.readTokens());\n\n\t\tfor (const token of tokens) {\n\t\t\tnextTokens.delete(token);\n\t\t}\n\n\t\tthis.writeTokens([...nextTokens]);\n\t}\n\n\ttoggle(token: string, force?: boolean): boolean {\n\t\tconst hasToken = this.contains(token);\n\t\tconst shouldAdd = force ?? !hasToken;\n\n\t\tif (shouldAdd) {\n\t\t\tthis.add(token);\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.remove(token);\n\t\treturn false;\n\t}\n\n\tcontains(token: string): boolean {\n\t\treturn this.readTokens().includes(token);\n\t}\n\n\ttoString(): string {\n\t\treturn this.value;\n\t}\n\n\tget value(): string {\n\t\treturn this.element.getAttribute('class') ?? '';\n\t}\n\n\tprivate readTokens(): string[] {\n\t\treturn this.value\n\t\t\t.split(/\\s+/)\n\t\t\t.map((token) => token.trim())\n\t\t\t.filter((token) => token.length > 0);\n\t}\n\n\tprivate writeTokens(tokens: string[]): void {\n\t\tif (tokens.length === 0) {\n\t\t\tthis.element.removeAttribute('class');\n\t\t\treturn;\n\t\t}\n\n\t\tthis.element.setAttribute('class', tokens.join(' '));\n\t}\n}\n\nclass MinimalElement extends MinimalNode {\n\tprivate attributes = new Map<string, string>();\n\tprivate classListValue?: MinimalClassList;\n\tprivate datasetValue?: DOMStringMap;\n\tprivate fragmentHtml?: string;\n\tprivate fragmentText?: string;\n\n\tpublic readonly localName: string;\n\tpublic readonly tagName: string;\n\n\tconstructor(tagName = 'div', ownerDocument: Document | null = getInstalledDocumentLike()) {\n\t\tsuper(MinimalNode.ELEMENT_NODE, ownerDocument);\n\t\tthis.localName = tagName.toLowerCase();\n\t\tthis.tagName = this.localName.toUpperCase();\n\t}\n\n\tget id(): string {\n\t\treturn this.getAttribute('id') ?? '';\n\t}\n\n\tset id(value: string) {\n\t\tif (value === '') {\n\t\t\tthis.removeAttribute('id');\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setAttribute('id', value);\n\t}\n\n\tget classList(): DOMTokenList {\n\t\tthis.classListValue ??= new MinimalClassList(this);\n\t\treturn this.classListValue as unknown as DOMTokenList;\n\t}\n\n\tget dataset(): DOMStringMap {\n\t\tthis.datasetValue ??= new Proxy(\n\t\t\t{},\n\t\t\t{\n\t\t\t\tdeleteProperty: (_target, property) => {\n\t\t\t\t\tif (typeof property !== 'string') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.removeAttribute(toDataAttributeName(property));\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\tget: (_target, property) => {\n\t\t\t\t\tif (typeof property !== 'string') {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this.getAttribute(toDataAttributeName(property)) ?? undefined;\n\t\t\t\t},\n\t\t\t\tgetOwnPropertyDescriptor: (_target, property) => {\n\t\t\t\t\tif (typeof property !== 'string') {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: this.getAttribute(toDataAttributeName(property)) ?? undefined,\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\thas: (_target, property) => {\n\t\t\t\t\treturn typeof property === 'string' && this.hasAttribute(toDataAttributeName(property));\n\t\t\t\t},\n\t\t\t\townKeys: () => {\n\t\t\t\t\treturn this.getAttributeNames()\n\t\t\t\t\t\t.filter((name) => name.startsWith('data-'))\n\t\t\t\t\t\t.map((name) => toDatasetPropertyName(name.slice(5)));\n\t\t\t\t},\n\t\t\t\tset: (_target, property, value) => {\n\t\t\t\t\tif (typeof property !== 'string') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.setAttribute(toDataAttributeName(property), String(value));\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t},\n\t\t) as DOMStringMap;\n\n\t\treturn this.datasetValue;\n\t}\n\n\thasAttribute(name: string): boolean {\n\t\treturn this.attributes.has(name);\n\t}\n\n\tgetAttribute(name: string): string | null {\n\t\treturn this.attributes.get(name) ?? null;\n\t}\n\n\tgetAttributeNames(): string[] {\n\t\treturn Array.from(this.attributes.keys());\n\t}\n\n\tsetAttribute(name: string, value: unknown): void {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.attributes.set(name, String(value));\n\t}\n\n\ttoggleAttribute(name: string, force?: boolean): boolean {\n\t\tconst shouldHaveAttribute = force ?? !this.hasAttribute(name);\n\n\t\tif (shouldHaveAttribute) {\n\t\t\tthis.setAttribute(name, '');\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.removeAttribute(name);\n\t\treturn false;\n\t}\n\n\tremoveAttribute(name: string): void {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.attributes.delete(name);\n\t}\n\n\tquerySelector(): Element | null {\n\t\treturn null;\n\t}\n\n\tquerySelectorAll(): Element[] {\n\t\treturn [];\n\t}\n\n\tmatches(): boolean {\n\t\treturn false;\n\t}\n\n\tget outerHTML(): string {\n\t\tif (this.fragmentHtml !== undefined) {\n\t\t\treturn this.fragmentHtml;\n\t\t}\n\n\t\tconst attributes = Array.from(this.attributes.entries())\n\t\t\t.map(([name, value]) => ` ${name}=\"${escapeHtmlAttribute(value)}\"`)\n\t\t\t.join('');\n\n\t\treturn `<${this.localName}${attributes}>${this.innerHTML}</${this.localName}>`;\n\t}\n\n\tget innerHTML(): string {\n\t\treturn this.childNodes.map((child) => serializeNodeHtml(child)).join('');\n\t}\n\n\tset innerHTML(html: string) {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.fragmentText = undefined;\n\t\tthis.replaceChildren(...parseHtmlToNodes(html, this.ownerDocument));\n\t}\n\n\toverride get textContent(): string {\n\t\treturn this.fragmentText ?? super.textContent ?? '';\n\t}\n\n\toverride set textContent(value: string | null) {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.fragmentText = value ?? '';\n\t\tsuper.textContent = value;\n\t}\n\n\tsetSerializedFragment(fragmentHtml: string, fragmentText: string, attributes: Record<string, string>): void {\n\t\tthis.fragmentHtml = fragmentHtml;\n\t\tthis.fragmentText = fragmentText;\n\t\tthis.attributes = new Map(Object.entries(attributes));\n\t\tthis.replaceChildren();\n\t}\n}\n\nclass MinimalEvent {\n\tpublic readonly bubbles: boolean;\n\tpublic readonly cancelable: boolean;\n\tpublic readonly composed: boolean;\n\tpublic readonly type: string;\n\n\tconstructor(type: string, eventInitDict: EventInit = {}) {\n\t\tthis.type = type;\n\t\tthis.bubbles = eventInitDict.bubbles ?? false;\n\t\tthis.cancelable = eventInitDict.cancelable ?? false;\n\t\tthis.composed = eventInitDict.composed ?? false;\n\t}\n}\n\nclass MinimalCustomEvent<T = unknown> extends MinimalEvent {\n\tpublic readonly detail: T;\n\n\tconstructor(type: string, eventInitDict: CustomEventInit<T> = {}) {\n\t\tsuper(type, eventInitDict);\n\t\tthis.detail = eventInitDict.detail as T;\n\t}\n}\n\nclass MinimalHTMLElement extends MinimalElement {\n\tpublic isConnected = false;\n\n\tconstructor(tagName = 'div', ownerDocument: Document | null = getInstalledDocumentLike()) {\n\t\tsuper(tagName, ownerDocument);\n\t}\n\n\tinsertAdjacentHTML(_position: InsertPosition, html: string): void {\n\t\tthis.append(...parseHtmlToNodes(html, this.ownerDocument));\n\t}\n\n\tconnectedCallback?(): void;\n\tattributeChangedCallback?(name: string, oldValue: string | null, newValue: string | null): void;\n\tdisconnectedCallback?(): void;\n}\n\nclass MinimalHtmlScriptElement extends MinimalHTMLElement {\n\tconstructor(ownerDocument: Document | null = getInstalledDocumentLike()) {\n\t\tsuper('script', ownerDocument);\n\t}\n}\n\nclass MinimalDocument extends MinimalNode {\n\tconstructor() {\n\t\tsuper(MinimalNode.DOCUMENT_NODE);\n\t}\n\n\tcreateElement(tagName: string): HTMLElement {\n\t\treturn (tagName.toLowerCase() === 'script'\n\t\t\t? new MinimalHtmlScriptElement(this as unknown as Document)\n\t\t\t: new MinimalHTMLElement(tagName, this as unknown as Document)) as unknown as HTMLElement;\n\t}\n\n\tcreateTextNode(value: string): Text {\n\t\treturn new MinimalTextNode(value, this as unknown as Document) as unknown as Text;\n\t}\n\n\tquerySelector(): Element | null {\n\t\treturn null;\n\t}\n\n\tquerySelectorAll(): Element[] {\n\t\treturn [];\n\t}\n}\n\nclass MinimalCustomElementsRegistry implements MinimalCustomElementRegistry {\n\tprivate definitions = new Map<string, CustomElementConstructor>();\n\n\tdefine(name: string, constructor: CustomElementConstructor): void {\n\t\tif (this.definitions.has(name)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.definitions.set(name, constructor);\n\t}\n\n\tget(name: string): CustomElementConstructor | undefined {\n\t\treturn this.definitions.get(name);\n\t}\n}\n\nlet installedWindow: LightDomShimWindow | undefined;\n\nconst minimalCssNamespace: MinimalCssNamespace = {\n\tescape(value: string): string {\n\t\treturn escapeCssIdentifier(String(value));\n\t},\n};\n\nfunction createTextNode(value: string): Node {\n\treturn new MinimalTextNode(value, getInstalledDocumentLike()) as unknown as Node;\n}\n\nfunction getInstalledDocumentLike(): Document | null {\n\treturn ((globalThis as typeof globalThis & { document?: Document }).document ?? null) as Document | null;\n}\n\nfunction getExistingWindowLike(): LightDomShimWindow | undefined {\n\tconst globalScope = globalThis as typeof globalThis & {\n\t\tCSS?: MinimalCssNamespace;\n\t\tCustomEvent?: typeof CustomEvent;\n\t\tDocument?: typeof Document;\n\t\tElement?: typeof Element;\n\t\tEvent?: typeof Event;\n\t\tEventTarget?: typeof EventTarget;\n\t\tHTMLScriptElement?: typeof HTMLScriptElement;\n\t\tHTMLElement?: typeof HTMLElement;\n\t\tNode?: typeof Node;\n\t\tdocument?: Document;\n\t\tcustomElements?: MinimalCustomElementRegistry;\n\t\twindow?: LightDomShimWindow;\n\t};\n\tconst existingCustomElements = globalScope.customElements;\n\n\tif (\n\t\ttypeof globalScope.Node === 'undefined' ||\n\t\ttypeof globalScope.Document === 'undefined' ||\n\t\ttypeof globalScope.Element === 'undefined' ||\n\t\ttypeof globalScope.HTMLElement === 'undefined' ||\n\t\ttypeof globalScope.document === 'undefined' ||\n\t\t!existingCustomElements ||\n\t\ttypeof existingCustomElements.define !== 'function' ||\n\t\ttypeof existingCustomElements.get !== 'function'\n\t) {\n\t\treturn undefined;\n\t}\n\n\treturn (\n\t\tglobalScope.window ?? {\n\t\t\tCSS: globalScope.CSS ?? minimalCssNamespace,\n\t\t\tCustomEvent: (globalScope.CustomEvent ?? MinimalCustomEvent) as typeof CustomEvent,\n\t\t\tDocument: globalScope.Document,\n\t\t\tElement: globalScope.Element,\n\t\t\tEvent: (globalScope.Event ?? MinimalEvent) as typeof Event,\n\t\t\tEventTarget: (globalScope.EventTarget ?? EventTarget) as typeof EventTarget,\n\t\t\tHTMLScriptElement: (globalScope.HTMLScriptElement ?? globalScope.HTMLElement) as typeof HTMLScriptElement,\n\t\t\tHTMLElement: globalScope.HTMLElement,\n\t\t\tNode: globalScope.Node,\n\t\t\tdocument: globalScope.document,\n\t\t\tcustomElements: existingCustomElements,\n\t\t}\n\t);\n}\n\n/** Ensures that a minimal window-like SSR runtime is available and returns it. */\nexport function ensureLightDomShim(): LightDomShimWindow {\n\tconst existingWindow = getExistingWindowLike();\n\n\tif (existingWindow) {\n\t\treturn existingWindow;\n\t}\n\n\treturn installLightDomShim();\n}\n\n/**\n * Creates a reusable SSR environment that can prepare a component host with\n * authored light-DOM content before rendering.\n *\n * Adapters can reuse a single environment across multiple render calls when\n * they want a single host-preparation entrypoint backed by the installed shim.\n */\n\nexport function createServerRenderEnvironment(): ServerRenderEnvironment {\n\tensureLightDomShim();\n\n\treturn {\n\t\tprepareHost(host: HTMLElement, options: PrepareServerRenderHostOptions = {}): void {\n\t\t\tif (options.authoredContent !== undefined) {\n\t\t\t\thost.innerHTML = options.authoredContent;\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Installs the smallest global surface needed to instantiate Radiant custom elements during SSR.\n */\nexport function installLightDomShim(): LightDomShimWindow {\n\tconst existingWindow = getExistingWindowLike();\n\n\tif (existingWindow) {\n\t\treturn existingWindow;\n\t}\n\n\tif (installedWindow) {\n\t\treturn installedWindow;\n\t}\n\n\tconst customElements = new MinimalCustomElementsRegistry();\n\tconst document = new MinimalDocument() as unknown as Document;\n\tconst EventConstructor = (globalThis.Event ?? MinimalEvent) as typeof Event;\n\tconst CustomEventConstructor = (globalThis.CustomEvent ?? MinimalCustomEvent) as typeof CustomEvent;\n\tconst DocumentConstructor = MinimalDocument as unknown as typeof Document;\n\tconst EventTargetConstructor = (globalThis.EventTarget ?? EventTarget) as typeof EventTarget;\n\tinstalledWindow = {\n\t\tCSS: (globalThis.CSS as MinimalCssNamespace | undefined) ?? minimalCssNamespace,\n\t\tCustomEvent: CustomEventConstructor,\n\t\tDocument: DocumentConstructor,\n\t\tElement: MinimalElement as unknown as typeof Element,\n\t\tEvent: EventConstructor,\n\t\tEventTarget: EventTargetConstructor,\n\t\tHTMLScriptElement: MinimalHtmlScriptElement as unknown as typeof HTMLScriptElement,\n\t\tHTMLElement: MinimalHTMLElement as unknown as typeof HTMLElement,\n\t\tNode: MinimalNode as unknown as typeof Node,\n\t\tdocument,\n\t\tcustomElements,\n\t};\n\n\tObject.assign(globalThis, {\n\t\tCSS: (globalThis.CSS as MinimalCssNamespace | undefined) ?? minimalCssNamespace,\n\t\tCustomEvent: CustomEventConstructor,\n\t\tDocument: DocumentConstructor,\n\t\tElement: MinimalElement,\n\t\tEvent: EventConstructor,\n\t\tEventTarget: EventTargetConstructor,\n\t\tHTMLScriptElement: MinimalHtmlScriptElement,\n\t\tHTMLElement: MinimalHTMLElement,\n\t\tNode: MinimalNode,\n\t\tdocument,\n\t\tcustomElements,\n\t\twindow: installedWindow,\n\t});\n\n\treturn installedWindow;\n}\n\nfunction createElementFromFragment(fragment: string, tag: ParsedHtmlTag, ownerDocument: Document | null): Node {\n\tconst element =\n\t\ttag.tagName === 'script'\n\t\t\t? (new MinimalHtmlScriptElement(ownerDocument) as MinimalElement)\n\t\t\t: new MinimalHTMLElement(tag.tagName, ownerDocument);\n\n\telement.setSerializedFragment(fragment, extractTextContent(tag.innerHtml), tag.attributes);\n\treturn element as unknown as Node;\n}\n\nfunction escapeHtmlAttribute(value: string): string {\n\treturn value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n\nfunction extractTextContent(html: string): string {\n\treturn html.replace(/<!--.*?-->/gs, '').replace(/<[^>]+>/g, '');\n}\n\nfunction parseHtmlToNodes(html: string, ownerDocument: Document | null = getInstalledDocumentLike()): Node[] {\n\treturn collectTopLevelHtmlFragments(html).map((fragment) => {\n\t\tif (!fragment.startsWith('<')) {\n\t\t\treturn new MinimalTextNode(fragment, ownerDocument) as unknown as Node;\n\t\t}\n\n\t\tconst tag = parseHtmlTagToken(fragment, 0);\n\n\t\tif (!tag || tag.type !== 'open') {\n\t\t\treturn new MinimalTextNode(fragment, ownerDocument) as unknown as Node;\n\t\t}\n\n\t\treturn createElementFromFragment(fragment, tag, ownerDocument);\n\t});\n}\n\nfunction toDataAttributeName(property: string): string {\n\treturn `data-${property.replace(/([A-Z])/g, '-$1').toLowerCase()}`;\n}\n\nfunction toDatasetPropertyName(attributeName: string): string {\n\treturn attributeName.replace(/-([a-z])/g, (_match, character: string) => character.toUpperCase());\n}\n\nfunction escapeCssIdentifier(value: string): string {\n\tlet escaped = '';\n\n\tfor (let index = 0; index < value.length; index += 1) {\n\t\tconst character = value[index] ?? '';\n\t\tconst codePoint = character.codePointAt(0) ?? 0;\n\n\t\tif (codePoint === 0) {\n\t\t\tescaped += '\\uFFFD';\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isControlCharacter = (codePoint >= 0x0001 && codePoint <= 0x001f) || codePoint === 0x007f;\n\t\tconst startsWithDigit = index === 0 && codePoint >= 0x0030 && codePoint <= 0x0039;\n\t\tconst startsWithHyphenDigit =\n\t\t\tindex === 1 && codePoint >= 0x0030 && codePoint <= 0x0039 && (value[0] ?? '') === '-';\n\t\tconst isSingleHyphen = index === 0 && character === '-' && value.length === 1;\n\n\t\tif (isControlCharacter || startsWithDigit || startsWithHyphenDigit) {\n\t\t\tescaped += `\\\\${codePoint.toString(16)} `;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (\n\t\t\tcodePoint >= 0x0080 ||\n\t\t\tcharacter === '-' ||\n\t\t\tcharacter === '_' ||\n\t\t\t(codePoint >= 0x0030 && codePoint <= 0x0039) ||\n\t\t\t(codePoint >= 0x0041 && codePoint <= 0x005a) ||\n\t\t\t(codePoint >= 0x0061 && codePoint <= 0x007a)\n\t\t) {\n\t\t\tescaped += isSingleHyphen ? `\\\\${character}` : character;\n\t\t\tcontinue;\n\t\t}\n\n\t\tescaped += `\\\\${character}`;\n\t}\n\n\treturn escaped;\n}\n\nfunction serializeNodeHtml(node: Node): string {\n\tif (node.nodeType === MinimalNode.TEXT_NODE) {\n\t\treturn node.textContent ?? '';\n\t}\n\n\treturn 'outerHTML' in node && typeof node.outerHTML === 'string' ? node.outerHTML : (node.textContent ?? '');\n}\n"
7
7
  ],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@ecopages/jsx';
2
+ import type { RenderToStringOptions } from '@ecopages/jsx/server';
3
+ import { RadiantElementSsrService } from './radiant-element-ssr-service';
4
+ import type { RadiantElementRenderBridge, RadiantElementServerRenderSsrCapable, RadiantElementSsrRuntime, RadiantElementTrackedRenderSsrCapable } from '../core/radiant-element-ssr-registry';
5
+ export declare function createRadiantElementSsrService(component: object): RadiantElementSsrService;
6
+ export declare function renderRadiantElementHost(component: RadiantElementServerRenderSsrCapable): JsxRenderable;
7
+ export declare function renderRegisteredRadiantElementHost(component: unknown): JsxRenderable | undefined;
8
+ export declare function renderRadiantElementHostToString(component: RadiantElementServerRenderSsrCapable, options?: RenderToStringOptions): string;
9
+ export declare function renderRegisteredRadiantElementHostToString(component: unknown, options?: RenderToStringOptions): string | undefined;
10
+ export declare function resolveRegisteredRadiantElementPreview(component: unknown, markup: string): JsxRenderable | undefined;
11
+ export declare function renderRadiantElementViewToString(component: RadiantElementTrackedRenderSsrCapable, options?: RenderToStringOptions): string;
12
+ export declare function getRadiantElementHostSsrAttributes(component: RadiantElementServerRenderSsrCapable): Record<string, string>;
13
+ export declare function resolveRadiantElementRenderBridge(component: object): RadiantElementRenderBridge | undefined;
14
+ export declare function resolveRadiantElementSsrHostBridge(component: object): object | undefined;
15
+ export declare function withRadiantServerCustomElementRenderBridge<T>(render: () => T): T;
16
+ export declare function getRadiantElementTrackedRenderOutput(component: RadiantElementTrackedRenderSsrCapable): {
17
+ containsSlots: boolean;
18
+ value: JsxRenderable;
19
+ };
20
+ export declare function getOrCreateRadiantElementSsrRuntime(): RadiantElementSsrRuntime;
21
+ export declare function withServerRadiantElementSsrRuntime<T>(render: () => T): T;
@@ -0,0 +1,3 @@
1
+ var t=((P)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(P,{get:(q,D)=>(typeof require<"u"?require:q)[D]}):P)(function(P){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+P+'" is not supported')});var K=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function EP(P,q,D){let W=P.constructor,Q=W[K]??[];if(Q.some(($)=>$.name===q))return;Q.push({name:q,options:D}),W[K]=Q}function B(P){return(P.constructor[K]??[]).slice()}var w=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),R=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),e=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function zP(P,q){C(P,w,q)}function IP(P,q){C(P,R,q)}function M(P){Y(P,w)}function x(P){let q=P;Y(P,R,q[e]??=new Set)}function C(P,q,D){let W=P,Q=Object.prototype.hasOwnProperty.call(W,q)?W[q]:void 0;if(Array.isArray(Q)){Q.push(D);return}Object.defineProperty(W,q,{value:[D]})}function Y(P,q,D,W=Object.getPrototypeOf(P)){if(!W||W===Object.prototype)return;Y(P,q,D,Object.getPrototypeOf(W));let Q=W[q];if(!Array.isArray(Q))return;for(let $ of Q){if(D?.has($))continue;$(P),D?.add($)}}function k(P,q){switch(q){case"construct":M(P);break;case"connect":case"ssr":x(P);break}}function L(P){switch(P){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function PP(P){switch(typeof P){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(P))return"array";if(Object.prototype.toString.call(P)==="[object Object]")return"object"}function qP(P){switch(P){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function DP(P){try{return JSON.parse(P)}catch{throw TypeError("Invalid JSON string")}}var WP={array(P){let q=DP(P);if(!Array.isArray(q))throw TypeError(`Expected an array but got a value of type "${typeof q}"`);return q},boolean(P){return!(P==="0"||String(P).toLowerCase()==="false")},number(P){return Number(P.replace(/_/g,""))},object(P){let q=JSON.parse(P);if(q===null||typeof q!=="object"||Array.isArray(q))throw TypeError(`expected value of type "object" but instead got value "${P}" of type "${PP(q)}"`);return q},string(P){return P}},O={default:z,array:f,object:f};function f(P){return JSON.stringify(P)}function z(P){return`${P}`}function E(P,q){let D=L(q);if(!D)throw TypeError(`[radiant-element] Unknown type "${q}"`);return WP[D](P)}function I(P,q){let D=L(q);if(!D)throw TypeError(`[radiant-element] Unknown type "${q}"`);return(O[D]??O.default??z)(P)}function QP(P){return typeof P==="boolean"}function $P(P){return typeof P==="number"}function FP(P){return typeof P==="string"}function ZP(P){return Array.isArray(P)}function JP(P){return typeof P==="object"&&!Array.isArray(P)&&P!==null}function TP(P,q){switch(P){case Boolean:return QP(q);case Number:return $P(q);case String:return FP(q);case Array:return ZP(q);case Object:return JP(q);default:return!1}}var AP=(P,q,D,W)=>{if(q===Boolean){let $=P.getAttribute(D);if($===null)return W;return $===""?!0:E($,q)}let Q=P.getAttribute(D);return Q!==null?E(Q,q):W??qP(q)};import{getActiveSsrScopeValue as jP,withActiveSsrScopeValue as XP}from"@ecopages/jsx/server";var _=Symbol.for("@ecopages/radiant.element-ssr-runtime");function SP(){return jP(_)}function N(P,q){return XP(_,P,q)}var g=Symbol.for("@ecopages/radiant.customElementTagName");function hP(P,q){P[g]=q}function T(P){return P[g]}function A(P){return P.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function V(P){let q={},D=new Set;return GP(P,q,D),UP(P,q,D),KP(P,q),q}function v(P){return Object.entries(P).map(([q,D])=>` ${q}="${A(D)}"`).join("")}function GP(P,q,D){for(let W of P.getReactiveProperties()){let Q=P.getPropertyValue(W.name);if(Q===void 0||Q===null||Q===!1)continue;q[W.attribute]=String(W.converter.toAttribute(Q)),D.add(W.attribute)}}function UP(P,q,D){for(let W of P.getReactivePropDefinitions()){let Q=W.options.attribute??W.name;if(D.has(Q))continue;let $=P.getPropertyValue(W.name);if($===void 0||$===null||$===!1)continue;q[Q]=String(I($,W.options.type)),D.add(Q)}}function KP(P,q){for(let D of P.getAttributeNames()){let W=P.getAttribute(D);if(W!==null)q[D]=W}}var S=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function b(){return globalThis}function h(P){b()[S]=P}function uP(P){return b()[S]?.(P)}var J;function d(){if(J!==void 0)return J;try{let{AsyncLocalStorage:P}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return J=new P,J}catch{return J=null,null}}var y=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function m(){let P=globalThis;return P[y]??=[],P[y]}function l(P){if(P.length===0)return()=>{return};let q=new Map;for(let Q of P)q.set(Q.getContextKey(),Q);let D=d();if(D){let Q=D.getStore()??[],$=[...Q,q];return D.enterWith($),()=>{D.enterWith(Q)}}let W=m();return W.push(q),()=>{let Q=W.lastIndexOf(q);if(Q>=0)W.splice(Q,1)}}function c(P){let q=d()?.getStore()??m();for(let D=q.length-1;D>=0;D-=1){let W=q[D]?.get(P);if(W)return W}return}function iP(P){let q=c(P);if(!q)return;return q.getContext()}h((P)=>c(P));function u(P,q){if(!q)return`${P.hostContent}${P.authoredHydrationMarkup}${P.slotProjectionScript}`;return`${P.hostContent}${P.slotProjectionScript}${P.hydrationScripts}`}function F(P){if(YP(P))return P;return}function YP(P){return typeof P.constructor==="function"&&typeof P.getAttribute==="function"&&typeof P.getAttributeNames==="function"&&typeof P.getAuthoredHydrationScriptMarkup==="function"&&typeof P.getContextProviders==="function"&&typeof P.getHydrationBindings==="function"&&typeof P.getReactiveProperties==="function"&&typeof P.getSlotProjectionScriptTag==="function"&&typeof P.resolveTrackedRenderOutput==="function"&&typeof P.renderViewToString==="function"}function p(P){let q=F(P);if(!q)throw Error("Radiant SSR runtime requires a server extraction host shape on the component.");return{constructor:q.constructor,getAttribute:(D)=>q.getAttribute(D),getAttributeNames:()=>q.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>q.getAuthoredHydrationScriptMarkup?.(),getContextProviders:()=>q.getContextProviders(),getHydrationBindings:()=>q.getHydrationBindings(),getReactiveProperties:()=>q.getReactiveProperties(),getReactivePropDefinitions:()=>B(P),getPropertyValue:(D)=>Reflect.get(P,D),getSlotProjectionScriptTag:()=>q.getSlotProjectionScriptTag?.(),resolveTrackedRenderOutput:()=>q.resolveTrackedRenderOutput(),renderViewToString:(D)=>q.renderViewToString(D)}}class H{component;host;constructor(P){this.component=P,this.host=p(P)}ensureReady(){k(this.component,"ssr")}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(P={},q=this.getHostAttributes()){this.ensureReady();let D=this.getTagName(),W=l(this.host.getContextProviders());try{return`<${D}${v(q)}>${this.renderHostContent(P)}</${D}>`}finally{W()}}getHostAttributes(){return this.ensureReady(),V(this.host)}renderHostContent(P){let q=P.mode==="hydrate"||P.mode===void 0&&P.hydrate===!0,D=q?this.host.getHydrationBindings().map((W)=>W.renderHydrationScriptTag()).filter((W)=>typeof W==="string").join(""):"";return u({hostContent:this.host.renderViewToString(P),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:D},q)}getTagName(){let P=T(this.host.constructor);if(!P)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return P}}import{renderToString as HP}from"@ecopages/jsx/server";import{createServerHydrationBindingState as s,isServerRenderHydrationActive as i,withForcedServerCustomElementRendering as BP,withServerCustomElementRenderHook as wP,withServerHydrationBindingState as r}from"@ecopages/jsx/server";var X;function a(P){return new H(P)}function G(P){return{nodeType:1,outerHTML:Z(P,{mode:"hydrate"})}}function Uq(P){if(j(P))return G(P);if(!U(P))return;return P.renderHost?.()??{nodeType:1,outerHTML:P.renderHostToString({mode:"hydrate"})}}function Z(P,q={}){return n(()=>a(P).renderHostToString(q,o(P)))}function Kq(P,q={}){if(j(P))return Z(P,q);if(!U(P))return;return P.renderHostToString(q)}function Yq(P,q){if(j(P))return G(P);if(!U(P))return;return P.renderHost?.()??{nodeType:1,outerHTML:q}}function RP(P,q={}){return n(()=>xP(()=>HP(CP(P).value,q)))}function o(P){return a(P).getHostAttributes()}function MP(P){if(!j(P))return;return{renderHost:()=>G(P),renderHostToString:(q)=>Z(P,q)}}function Hq(P){return F(P)}function xP(P){return BP(()=>wP(({instance:q})=>{if(j(q))return{nodeType:1,get outerHTML(){let W=i(),Q={hydrate:W,mode:W?"hydrate":"plain"};if(!W)return Z(q,Q);return r(s(),()=>Z(q,Q))}};if(!U(q))return;let D=q;return{nodeType:1,get outerHTML(){let W=i();if(!W)return D.renderHostToString({hydrate:W,mode:W?"hydrate":"plain"});return r(s(),()=>D.renderHostToString({hydrate:W,mode:W?"hydrate":"plain"}))}}},P))}function CP(P){if(kP(P))return P.resolveTrackedRenderOutput();let q=F(P);if(!q)throw Error("Radiant SSR runtime requires tracked render output support on the component.");return q.resolveTrackedRenderOutput()}function j(P){if(typeof P!=="object"||P===null)return!1;return F(P)!==void 0}function U(P){if(typeof P!=="object"||P===null)return!1;return typeof P.renderHostToString==="function"}function kP(P){if(typeof P!=="object"||P===null)return!1;return typeof P.resolveTrackedRenderOutput==="function"}function OP(){if(X)return X;return X={getHostAttributes:o,renderHost:G,renderHostToString:Z,resolveRenderBridge:MP,renderView:RP},X}function n(P){return N(OP(),P)}export{n as withServerRadiantElementSsrRuntime,xP as withRadiantServerCustomElementRenderBridge,Yq as resolveRegisteredRadiantElementPreview,Hq as resolveRadiantElementSsrHostBridge,MP as resolveRadiantElementRenderBridge,Kq as renderRegisteredRadiantElementHostToString,Uq as renderRegisteredRadiantElementHost,RP as renderRadiantElementViewToString,Z as renderRadiantElementHostToString,G as renderRadiantElementHost,CP as getRadiantElementTrackedRenderOutput,o as getRadiantElementHostSsrAttributes,OP as getOrCreateRadiantElementSsrRuntime,a as createRadiantElementSsrService};
2
+
3
+ //# debugId=99E914A0E7B306E264756E2164756E21
@@ -0,0 +1,24 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/reactive-prop-metadata.ts", "../src/decorators/legacy/instance-initializers.ts", "../src/decorators/legacy/host-readiness.ts", "../src/utils/attribute-utils.ts", "../src/core/radiant-element-ssr-registry.ts", "../src/core/custom-element-metadata.ts", "../src/utils/escape-html-attribute.ts", "../src/server/host-attribute-serialization.ts", "../src/context/context-ssr-bridge.ts", "../src/server/context-ssr.ts", "../src/server/host-script-composition.ts", "../src/core/radiant-element-ssr-host.ts", "../src/server/radiant-element-ssr-extractor.ts", "../src/server/radiant-element-ssr-service.ts", "../src/server/radiant-element-ssr-bridge.ts"],
4
+ "sourcesContent": [
5
+ "import type { ReactivePropertyOptions } from './reactive-prop-core';\n\nconst REACTIVE_PROP_DEFINITIONS = Symbol.for('@ecopages/radiant.reactivePropDefinitions');\n\nexport type ReactivePropDefinition = {\n\tname: string;\n\toptions: ReactivePropertyOptions<unknown>;\n};\n\ntype RadiantConstructorWithReactiveProps = CustomElementConstructor & {\n\t[REACTIVE_PROP_DEFINITIONS]?: ReactivePropDefinition[];\n};\n\nexport function registerReactivePropDefinition(\n\ttarget: object,\n\tpropertyName: string,\n\toptions: ReactivePropertyOptions<unknown>,\n): void {\n\tconst constructor = target.constructor as RadiantConstructorWithReactiveProps;\n\tconst definitions = constructor[REACTIVE_PROP_DEFINITIONS] ?? [];\n\n\tif (definitions.some((definition) => definition.name === propertyName)) {\n\t\treturn;\n\t}\n\n\tdefinitions.push({ name: propertyName, options });\n\tconstructor[REACTIVE_PROP_DEFINITIONS] = definitions;\n}\n\nexport function getReactivePropDefinitions(target: object): ReactivePropDefinition[] {\n\treturn ((target.constructor as RadiantConstructorWithReactiveProps)[REACTIVE_PROP_DEFINITIONS] ?? []).slice();\n}\n",
6
+ "type LegacyInstanceInitializer<T extends object = object> = (instance: T) => void;\n\nconst LEGACY_INSTANCE_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-instance-initializers');\nconst LEGACY_POST_CONSTRUCTION_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-post-construction-initializers');\nconst LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS = Symbol.for(\n\t'@ecopages/radiant.legacy-executed-post-construction-initializers',\n);\n\n/**\n * Registers per-instance initialization work for a legacy decorator.\n *\n * Legacy decorators execute against the prototype, so any initialization that\n * needs the concrete element instance must be deferred until construction time.\n */\nexport function registerLegacyInstanceInitializer<T extends object>(\n\tproto: T,\n\tinitializer: LegacyInstanceInitializer<T>,\n): void {\n\tregisterInitializer(proto, LEGACY_INSTANCE_INITIALIZERS, initializer);\n}\n\n/**\n * Registers post-construction work for a legacy decorator.\n *\n * This phase exists for decorators that eagerly write instance fields. With\n * legacy decorators plus `useDefineForClassFields`, subclass field definition\n * can overwrite values written during the base-class constructor.\n */\nexport function registerLegacyPostConstructionInitializer<T extends object>(\n\tproto: T,\n\tinitializer: LegacyInstanceInitializer<T>,\n): void {\n\tregisterInitializer(proto, LEGACY_POST_CONSTRUCTION_INITIALIZERS, initializer);\n}\n\n/**\n * Runs all legacy decorator initializers for a newly constructed element.\n *\n * Initializers are collected from the prototype chain and executed from base to\n * derived class so inherited setup remains stable.\n */\nexport function runLegacyInstanceInitializers<T extends object>(instance: T): void {\n\trunLegacyInitializers(instance, LEGACY_INSTANCE_INITIALIZERS);\n}\n\n/**\n * Runs legacy decorator setup that must happen after subclass field\n * initialization has completed.\n *\n * Each initializer runs at most once per instance even if multiple lifecycle\n * entrypoints call this helper.\n */\nexport function runLegacyPostConstructionInitializers<T extends object>(instance: T): void {\n\tconst target = instance as Record<PropertyKey, unknown>;\n\n\trunLegacyInitializers(\n\t\tinstance,\n\t\tLEGACY_POST_CONSTRUCTION_INITIALIZERS,\n\t\t(target[LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS] ??= new Set()) as Set<LegacyInstanceInitializer<T>>,\n\t);\n}\n\nfunction registerInitializer<T extends object>(proto: T, key: symbol, initializer: LegacyInstanceInitializer<T>): void {\n\tconst target = proto as Record<PropertyKey, unknown>;\n\tconst ownInitializers = Object.prototype.hasOwnProperty.call(target, key) ? target[key] : undefined;\n\n\tif (Array.isArray(ownInitializers)) {\n\t\townInitializers.push(initializer);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(target, key, {\n\t\tvalue: [initializer],\n\t});\n}\n\nfunction runLegacyInitializers<T extends object>(\n\tinstance: T,\n\tkey: symbol,\n\texecutedInitializers?: Set<LegacyInstanceInitializer<T>>,\n\tprototype: object | null = Object.getPrototypeOf(instance),\n): void {\n\tif (!prototype || prototype === Object.prototype) {\n\t\treturn;\n\t}\n\n\trunLegacyInitializers(instance, key, executedInitializers, Object.getPrototypeOf(prototype));\n\n\tconst initializers = (prototype as Record<PropertyKey, unknown>)[key] as LegacyInstanceInitializer<T>[] | undefined;\n\n\tif (!Array.isArray(initializers)) {\n\t\treturn;\n\t}\n\n\tfor (const initializer of initializers) {\n\t\tif (executedInitializers?.has(initializer)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tinitializer(instance);\n\t\texecutedInitializers?.add(initializer);\n\t}\n}\n",
7
+ "import {\n\trunLegacyInstanceInitializers,\n\trunLegacyPostConstructionInitializers,\n} from './instance-initializers';\n\nexport type LegacyHostReadinessPhase = 'construct' | 'connect' | 'ssr';\n\n/**\n * Runs legacy decorator initialization for the requested lifecycle phase.\n *\n * Post-construction work is idempotent — multiple calls with `connect` or `ssr`\n * only execute each registered initializer once per instance.\n */\nexport function ensureLegacyHostReady<T extends object>(host: T, phase: LegacyHostReadinessPhase): void {\n\tswitch (phase) {\n\t\tcase 'construct':\n\t\t\trunLegacyInstanceInitializers(host);\n\t\t\tbreak;\n\t\tcase 'connect':\n\t\tcase 'ssr':\n\t\t\trunLegacyPostConstructionInitializers(host);\n\t\t\tbreak;\n\t}\n}\n",
8
+ "import type { RadiantElement } from '../core/radiant-element';\n\nexport type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n\tswitch (constant) {\n\t\tcase Array:\n\t\t\treturn 'array';\n\t\tcase Boolean:\n\t\t\treturn 'boolean';\n\t\tcase Number:\n\t\t\treturn 'number';\n\t\tcase Object:\n\t\t\treturn 'object';\n\t\tcase String:\n\t\t\treturn 'string';\n\t}\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n\tswitch (typeof defaultValue) {\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t}\n\n\tif (Array.isArray(defaultValue)) return 'array';\n\tif (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n\tswitch (type) {\n\t\tcase Number:\n\t\t\treturn 0;\n\t\tcase String:\n\t\t\treturn '';\n\t\tcase Boolean:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\tthrow new TypeError('Invalid JSON string');\n\t}\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n\tarray(value: string): unknown[] {\n\t\tconst array = parseJSON<unknown[]>(value);\n\t\tif (!Array.isArray(array)) {\n\t\t\tthrow new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n\t\t}\n\t\treturn array;\n\t},\n\n\tboolean(value: string): boolean {\n\t\treturn !(value === '0' || String(value).toLowerCase() === 'false');\n\t},\n\n\tnumber(value: string): number {\n\t\tconst number = Number(value.replace(/_/g, ''));\n\t\treturn number;\n\t},\n\n\tobject(value: string): object {\n\t\tconst object = JSON.parse(value);\n\t\tif (object === null || typeof object !== 'object' || Array.isArray(object)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n\t\t\t\t\tobject,\n\t\t\t\t)}\"`,\n\t\t\t);\n\t\t}\n\t\treturn object;\n\t},\n\n\tstring(value: string): string {\n\t\treturn value;\n\t},\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n\tdefault: writeString,\n\tarray: writeJSON,\n\tobject: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n\treturn JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n\treturn `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n\tconst readerType = parseAttributeTypeConstant(type);\n\tif (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\treturn readers[readerType]!(value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n\tconst writerType = parseAttributeTypeConstant(type);\n\tif (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\tconst writer: Writer = writers[writerType] ?? writers.default ?? writeString;\n\treturn writer(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n\treturn typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n\tswitch (type) {\n\t\tcase Boolean:\n\t\t\treturn isBoolean(defaultValue);\n\t\tcase Number:\n\t\t\treturn isNumber(defaultValue);\n\t\tcase String:\n\t\t\treturn isString(defaultValue);\n\t\tcase Array:\n\t\t\treturn isArray(defaultValue);\n\t\tcase Object:\n\t\t\treturn isObject(defaultValue);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const getInitialValue = (\n\ttarget: RadiantElement,\n\ttype: AttributeTypeConstant,\n\tattributeKey: string,\n\tdefaultValue: unknown,\n) => {\n\tif (type === Boolean) {\n\t\tconst attributeValue = target.getAttribute(attributeKey);\n\t\tif (attributeValue === null) {\n\t\t\treturn defaultValue;\n\t\t}\n\n\t\treturn attributeValue === '' ? true : readAttributeValue(attributeValue, type);\n\t}\n\n\tconst attributeValue = target.getAttribute(attributeKey);\n\treturn attributeValue !== null\n\t\t? readAttributeValue(attributeValue, type)\n\t\t: (defaultValue ?? (defaultValueForType(type) as typeof defaultValue));\n};\n",
9
+ "import type { JsxRenderable } from '@ecopages/jsx';\nimport { getActiveSsrScopeValue, type RenderToStringOptions, withActiveSsrScopeValue } from '@ecopages/jsx/server';\nimport type { InternalRadiantSsrHost } from './radiant-element-ssr-host';\n\nexport type RadiantElementRenderBridge = {\n\trenderHost?: () => JsxRenderable;\n\trenderHostToString?: (options?: RenderToStringOptions) => string;\n};\n\nexport type RadiantElementServerRenderSsrCapable = InternalRadiantSsrHost;\n\nexport type RadiantElementTrackedRenderSsrCapable = InternalRadiantSsrHost;\n\nexport type RadiantElementSsrRuntime = {\n\tgetHostAttributes(component: InternalRadiantSsrHost): Record<string, string>;\n\trenderHost(component: InternalRadiantSsrHost): JsxRenderable;\n\trenderHostToString(component: InternalRadiantSsrHost, options?: RenderToStringOptions): string;\n\tresolveRenderBridge(component: object): RadiantElementRenderBridge | undefined;\n\trenderView(component: InternalRadiantSsrHost, options?: RenderToStringOptions): string;\n};\n\nconst RADIANT_ELEMENT_SSR_RUNTIME_SYMBOL = Symbol.for('@ecopages/radiant.element-ssr-runtime');\n\nexport function getRadiantElementSsrRuntime(): RadiantElementSsrRuntime | undefined {\n\treturn getActiveSsrScopeValue<RadiantElementSsrRuntime>(RADIANT_ELEMENT_SSR_RUNTIME_SYMBOL);\n}\n\nexport function withRadiantElementSsrRuntime<T>(runtime: RadiantElementSsrRuntime, render: () => T): T {\n\treturn withActiveSsrScopeValue(RADIANT_ELEMENT_SSR_RUNTIME_SYMBOL, runtime, render);\n}\n",
10
+ "export const CUSTOM_ELEMENT_TAG_NAME = Symbol.for('@ecopages/radiant.customElementTagName');\n\ntype CustomElementConstructorWithMetadata = CustomElementConstructor & {\n\t[CUSTOM_ELEMENT_TAG_NAME]?: string;\n};\n\n/**\n * Sets the custom element tag name for a given constructor.\n * This is used internally to associate a class with its custom element tag, which is necessary for features like hydration and SSR support.\n * @param target The constructor of the custom element.\n * @param tagName The tag name to associate with the custom element.\n */\nexport function setCustomElementTagName(target: CustomElementConstructor, tagName: string): void {\n\t(target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME] = tagName;\n}\n\n/**\n * Retrieves the custom element tag name associated with a given constructor.\n * @param target The constructor of the custom element.\n * @returns The tag name associated with the custom element, or `undefined` if not set.\n */\nexport function getCustomElementTagName(target: CustomElementConstructor): string | undefined {\n\treturn (target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME];\n}\n",
11
+ "/** Escapes a string for safe interpolation inside a double-quoted HTML attribute value. */\nexport function escapeHtmlAttribute(value: string): string {\n\treturn value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n",
12
+ "import type { ReactiveProperty } from '../core/reactive-prop-core';\nimport type { ReactivePropDefinition } from '../core/reactive-prop-metadata';\nimport { writeAttributeValue } from '../utils/attribute-utils';\nimport { escapeHtmlAttribute } from '../utils/escape-html-attribute';\n\n/**\n * Minimal host shape needed by the attribute serialization policy.\n *\n * This interface defines the narrow contract that the serialization module\n * consumes, keeping it independent of the full {@link RadiantElementSsrHost}.\n */\nexport type HostAttributeSource = {\n\tgetReactiveProperties: () => ReactiveProperty[];\n\tgetReactivePropDefinitions: () => ReactivePropDefinition[];\n\tgetPropertyValue: (name: string) => unknown;\n\tgetAttributeNames: () => string[];\n\tgetAttribute: (name: string) => string | null;\n};\n\n/**\n * Resolves the final set of SSR host attributes from a Radiant Element Host.\n *\n * ## Source precedence (highest to lowest)\n *\n * 1. **Reactive properties** — legacy attribute reflection via `property.converter`.\n * These are already-registered reactive properties with established converters.\n * Falsy values (`undefined`, `null`, `false`) are omitted.\n *\n * 2. **Reactive prop definitions** — decorator-based definitions. Skipped when the\n * target attribute name was already emitted by source 1 (dedup via `seenAttributes`).\n * Uses `writeAttributeValue` for type-aware conversion.\n *\n * 3. **Authored attributes** — raw host-level attributes from the original markup.\n * These always win if present, regardless of whether sources 1 or 2 already\n * set the same name. This preserves explicit author intent in templates.\n *\n * @param host Host shape providing reactive state and attribute accessors.\n * @returns Flat record of attribute name → serialized value.\n */\nexport function resolveHostAttributes(host: HostAttributeSource): Record<string, string> {\n\tconst attributes: Record<string, string> = {};\n\tconst seenAttributes = new Set<string>();\n\n\tappendReactivePropertyAttributes(host, attributes, seenAttributes);\n\tappendReactivePropDefinitionAttributes(host, attributes, seenAttributes);\n\tappendAuthoredAttributes(host, attributes);\n\n\treturn attributes;\n}\n\n/**\n * Serializes a flat attribute record into an HTML attribute string.\n *\n * Each entry becomes ` name=\"escaped-value\"` with the leading space included.\n * The combined string is safe for direct interpolation into an opening tag.\n *\n * @param attributes Flat attribute record to serialize.\n * @returns HTML attribute string.\n */\nexport function stringifyHostAttributes(attributes: Record<string, string>): string {\n\treturn Object.entries(attributes)\n\t\t.map(([name, value]) => ` ${name}=\"${escapeHtmlAttribute(value)}\"`)\n\t\t.join('');\n}\n\n/**\n * Source 1: Reactive properties with established converters.\n *\n * Falsy runtime values are omitted — they should not appear as attributes\n * in SSR output.\n */\nfunction appendReactivePropertyAttributes(\n\thost: HostAttributeSource,\n\tattributes: Record<string, string>,\n\tseenAttributes: Set<string>,\n): void {\n\tfor (const property of host.getReactiveProperties()) {\n\t\tconst currentValue = host.getPropertyValue(property.name);\n\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[property.attribute] = String(property.converter.toAttribute(currentValue));\n\t\tseenAttributes.add(property.attribute);\n\t}\n}\n\n/**\n * Source 2: Decorator-based reactive prop definitions.\n *\n * Skipped when the attribute name was already emitted by source 1, preventing\n * duplicate or conflicting attribute values.\n */\nfunction appendReactivePropDefinitionAttributes(\n\thost: HostAttributeSource,\n\tattributes: Record<string, string>,\n\tseenAttributes: Set<string>,\n): void {\n\tfor (const definition of host.getReactivePropDefinitions()) {\n\t\tconst attributeName = definition.options.attribute ?? definition.name;\n\n\t\tif (seenAttributes.has(attributeName)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst currentValue = host.getPropertyValue(definition.name);\n\n\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[attributeName] = String(writeAttributeValue(currentValue, definition.options.type));\n\t\tseenAttributes.add(attributeName);\n\t}\n}\n\n/**\n * Source 3: Authored attributes from the original markup.\n *\n * These always overwrite — when an author explicitly sets an attribute in\n * markup, that intent takes precedence over reactive property reflection.\n */\nfunction appendAuthoredAttributes(host: HostAttributeSource, attributes: Record<string, string>): void {\n\tfor (const attributeName of host.getAttributeNames()) {\n\t\tconst attributeValue = host.getAttribute(attributeName);\n\t\tif (attributeValue !== null) {\n\t\t\tattributes[attributeName] = attributeValue;\n\t\t}\n\t}\n}\n\n",
13
+ "import type { SsrSerializableContextProvider } from './context-provider';\nimport type { UnknownContext } from './types';\n\ntype SsrContextProviderResolver = (context: UnknownContext) => SsrSerializableContextProvider | undefined;\n\nconst SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-provider-resolver');\n\ntype GlobalResolverScope = typeof globalThis & {\n\t[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?: SsrContextProviderResolver;\n};\n\nfunction getGlobalResolverScope(): GlobalResolverScope {\n\treturn globalThis as GlobalResolverScope;\n}\n\n/**\n * Installs the ambient SSR provider resolver used by shared context runtime helpers.\n *\n * Server-side rendering infrastructure owns the actual provider stack storage and\n * publishes a lookup function here so client/runtime code does not need to import\n * server-oriented modules.\n */\nexport function installSsrContextProviderResolver(resolver: SsrContextProviderResolver): void {\n\tgetGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL] = resolver;\n}\n\n/**\n * Resolves an ambient SSR provider when a server render has published one.\n */\nexport function resolveAmbientSsrContextProvider(context: UnknownContext): SsrSerializableContextProvider | undefined {\n\treturn getGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?.(context);\n}\n",
14
+ "import type { AsyncLocalStorage } from 'node:async_hooks';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport { installSsrContextProviderResolver } from '../context/context-ssr-bridge';\nimport type { ContextType, UnknownContext } from '../context/types';\n\ntype ProviderFrame = Map<UnknownContext, SsrSerializableContextProvider>;\ntype ProviderStack = ProviderFrame[];\n\nlet resolvedAsyncLocalStorage: AsyncLocalStorage<ProviderStack> | null | undefined;\n\n/**\n * Lazily resolves `AsyncLocalStorage` from `node:async_hooks`.\n *\n * The dynamic `require` is necessary because browser-based SSR tests import\n * this server-oriented module directly. A top-level static import would break\n * those browser bundles even though normal application SSR runs on the server.\n *\n * On the server (Node.js, Bun, Cloudflare Workers) the import always succeeds.\n * In browser test environments where SSR rendering is exercised without a real\n * server, the fallback global stack is used instead.\n */\nfunction getAsyncLocalStorage(): AsyncLocalStorage<ProviderStack> | null {\n\tif (resolvedAsyncLocalStorage !== undefined) {\n\t\treturn resolvedAsyncLocalStorage;\n\t}\n\n\ttry {\n\t\tconst { AsyncLocalStorage: ALS } = require('node:async_hooks') as typeof import('node:async_hooks');\n\t\tresolvedAsyncLocalStorage = new ALS<ProviderStack>();\n\t\treturn resolvedAsyncLocalStorage;\n\t} catch {\n\t\tresolvedAsyncLocalStorage = null;\n\t\treturn null;\n\t}\n}\n\nconst SSR_CONTEXT_FALLBACK_STACK_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-fallback-stack');\n\nfunction getFallbackStack(): ProviderStack {\n\tconst g = globalThis as typeof globalThis & { [SSR_CONTEXT_FALLBACK_STACK_SYMBOL]?: ProviderStack };\n\tg[SSR_CONTEXT_FALLBACK_STACK_SYMBOL] ??= [];\n\treturn g[SSR_CONTEXT_FALLBACK_STACK_SYMBOL];\n}\n\n/**\n * Pushes a temporary provider frame onto the SSR context stack.\n *\n * On the server, each call creates an isolated `AsyncLocalStorage` context so\n * concurrent renders cannot corrupt each other.\n *\n * In browser test environments where `AsyncLocalStorage` is unavailable, a\n * synchronous global stack is used as a fallback.\n */\nexport function withSsrContextProviders(providers: readonly SsrSerializableContextProvider[]): () => void {\n\tif (providers.length === 0) {\n\t\treturn () => undefined;\n\t}\n\n\tconst frame = new Map<UnknownContext, SsrSerializableContextProvider>();\n\n\tfor (const provider of providers) {\n\t\tframe.set(provider.getContextKey(), provider);\n\t}\n\n\tconst als = getAsyncLocalStorage();\n\n\tif (als) {\n\t\tconst parentStack = als.getStore() ?? [];\n\t\tconst childStack = [...parentStack, frame];\n\t\tals.enterWith(childStack);\n\n\t\treturn () => {\n\t\t\tals.enterWith(parentStack);\n\t\t};\n\t}\n\n\tconst stack = getFallbackStack();\n\tstack.push(frame);\n\n\treturn () => {\n\t\tconst index = stack.lastIndexOf(frame);\n\t\tif (index >= 0) stack.splice(index, 1);\n\t};\n}\n\n/**\n * Resolves the nearest SSR-visible provider for a given context token.\n *\n * Lookup walks the provider frames from innermost to outermost so nested host\n * serialization behaves the same way as runtime context resolution in the DOM.\n */\nexport function resolveSsrContextProvider<T extends UnknownContext>(\n\tcontext: T,\n): SsrSerializableContextProvider | undefined {\n\tconst store = getAsyncLocalStorage()?.getStore() ?? getFallbackStack();\n\n\tfor (let index = store.length - 1; index >= 0; index -= 1) {\n\t\tconst provider = store[index]?.get(context);\n\n\t\tif (provider) {\n\t\t\treturn provider;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Resolves the current SSR-visible value for a given context token.\n *\n * This is the ergonomic helper consumed by SSR-aware decorators and component\n * render paths when they only need the context payload instead of the full\n * provider instance.\n */\nexport function resolveSsrContextValue<T extends UnknownContext>(context: T): ContextType<T> | undefined {\n\tconst provider = resolveSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn undefined;\n\t}\n\n\treturn provider.getContext() as ContextType<T>;\n}\n\ninstallSsrContextProviderResolver((context) => resolveSsrContextProvider(context));\n",
15
+ "/**\n * Host script composition for Radiant SSR.\n *\n * This module owns the mode-sensitive ordering and inclusion rules for the\n * script payloads that appear inside a server-rendered Element Host.\n *\n * ## Composition rules\n *\n * | Mode | Order |\n * |-----------|-----------------------------------------------------------------|\n * | `plain` | view content → authored hydration markup → slot projection |\n * | `hydrate` | view content → slot projection → hydration binding scripts |\n *\n * In **plain** mode, authored hydration markup (script tags pre-authored on the\n * host) is preserved because the component may rely on them for standalone\n * behavior. Hydration binding scripts are omitted because there is no client\n * hydrator to consume them.\n *\n * In **hydrate** mode, authored hydration markup is superseded by the formal\n * hydration binding scripts. Slot projection comes before hydration scripts so\n * the client can reconstruct projected content before binding recovery.\n */\n\n/** Individual content parts that make up a server-rendered host's inner HTML. */\nexport type HostContentParts = {\n\t/** The rendered view HTML from `renderViewToString`. */\n\thostContent: string;\n\t/** Authored hydration script markup pre-existing on the host, if any. */\n\tauthoredHydrationMarkup: string;\n\t/** Slot projection JSON payload script tag, if any. */\n\tslotProjectionScript: string;\n\t/** Hydration binding script tags for client-side recovery, if any. */\n\thydrationScripts: string;\n};\n\n/**\n * Assembles the inner HTML of a server-rendered Element Host from its\n * individual content parts, respecting the mode-sensitive ordering rules.\n *\n * @param parts Individual content parts to compose.\n * @param hydrate Whether the output targets client-side hydration.\n * @returns Assembled inner HTML string.\n */\nexport function composeHostContent(parts: HostContentParts, hydrate: boolean): string {\n\tif (!hydrate) {\n\t\treturn `${parts.hostContent}${parts.authoredHydrationMarkup}${parts.slotProjectionScript}`;\n\t}\n\n\treturn `${parts.hostContent}${parts.slotProjectionScript}${parts.hydrationScripts}`;\n}\n",
16
+ "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport type { ReactiveProperty } from './reactive-prop-core';\nimport type { ReactivePropDefinition } from './reactive-prop-metadata';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\n\n/**\n * Unified SSR host shape shared by core resolution and server serialization.\n */\nexport type InternalRadiantSsrHost = {\n\tconstructor: CustomElementConstructor;\n\tgetAttribute(name: string): string | null;\n\tgetAttributeNames(): string[];\n\tgetAuthoredHydrationScriptMarkup?: () => string | undefined;\n\tgetContextProviders: () => SsrSerializableContextProvider[];\n\tgetHydrationBindings: () => SsrSerializableHydrationBinding[];\n\tgetReactiveProperties: () => ReactiveProperty[];\n\tgetReactivePropDefinitions: () => ReactivePropDefinition[];\n\tgetPropertyValue: (name: string) => unknown;\n\tgetSlotProjectionScriptTag?: () => string | undefined;\n\tresolveTrackedRenderOutput: () => { containsSlots: boolean; value: JsxRenderable };\n\trenderViewToString: (options?: RenderToStringOptions) => string;\n};\n\nexport type RadiantElementSsrHostSource = InternalRadiantSsrHost;\n\nexport function resolveRadiantElementSsrHostSource(component: object): InternalRadiantSsrHost | undefined {\n\tif (isInternalRadiantSsrHost(component)) {\n\t\treturn component;\n\t}\n\n\treturn undefined;\n}\n\nexport function isInternalRadiantSsrHost(component: object): component is InternalRadiantSsrHost {\n\treturn (\n\t\ttypeof component.constructor === 'function' &&\n\t\ttypeof (component as { getAttribute?: unknown }).getAttribute === 'function' &&\n\t\ttypeof (component as { getAttributeNames?: unknown }).getAttributeNames === 'function' &&\n\t\ttypeof (component as { getAuthoredHydrationScriptMarkup?: unknown }).getAuthoredHydrationScriptMarkup ===\n\t\t\t'function' &&\n\t\ttypeof (component as { getContextProviders?: unknown }).getContextProviders === 'function' &&\n\t\ttypeof (component as { getHydrationBindings?: unknown }).getHydrationBindings === 'function' &&\n\t\ttypeof (component as { getReactiveProperties?: unknown }).getReactiveProperties === 'function' &&\n\t\ttypeof (component as { getSlotProjectionScriptTag?: unknown }).getSlotProjectionScriptTag === 'function' &&\n\t\ttypeof (component as { resolveTrackedRenderOutput?: unknown }).resolveTrackedRenderOutput === 'function' &&\n\t\ttypeof (component as { renderViewToString?: unknown }).renderViewToString === 'function'\n\t);\n}\n",
17
+ "import { getReactivePropDefinitions } from '../core/reactive-prop-metadata';\nimport { resolveRadiantElementSsrHostSource } from '../core/radiant-element-ssr-host';\nimport type { InternalRadiantSsrHost } from './internal-radiant-host';\n\nexport function toInternalRadiantSsrHost(component: object): InternalRadiantSsrHost {\n\tconst source = resolveRadiantElementSsrHostSource(component);\n\n\tif (!source) {\n\t\tthrow new Error('Radiant SSR runtime requires a server extraction host shape on the component.');\n\t}\n\n\treturn {\n\t\tconstructor: source.constructor,\n\t\tgetAttribute: (name) => source.getAttribute(name),\n\t\tgetAttributeNames: () => source.getAttributeNames(),\n\t\tgetAuthoredHydrationScriptMarkup: () => source.getAuthoredHydrationScriptMarkup?.(),\n\t\tgetContextProviders: () => source.getContextProviders(),\n\t\tgetHydrationBindings: () => source.getHydrationBindings(),\n\t\tgetReactiveProperties: () => source.getReactiveProperties(),\n\t\tgetReactivePropDefinitions: () => getReactivePropDefinitions(component),\n\t\tgetPropertyValue: (name) => Reflect.get(component, name),\n\t\tgetSlotProjectionScriptTag: () => source.getSlotProjectionScriptTag?.(),\n\t\tresolveTrackedRenderOutput: () => source.resolveTrackedRenderOutput(),\n\t\trenderViewToString: (options) => source.renderViewToString(options),\n\t};\n}\n",
18
+ "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport { getCustomElementTagName } from '../core/custom-element-metadata';\nimport { withSsrContextProviders } from './context-ssr';\nimport { composeHostContent } from './host-script-composition';\nimport { resolveHostAttributes, stringifyHostAttributes } from './host-attribute-serialization';\nimport { ensureLegacyHostReady } from '../decorators/legacy/host-readiness';\nimport { toInternalRadiantSsrHost } from './radiant-element-ssr-extractor';\nimport type { InternalRadiantSsrHost } from '../core/radiant-element-ssr-host';\n\nexport class RadiantElementSsrService {\n\tprivate readonly component: object;\n\tprivate readonly host: InternalRadiantSsrHost;\n\n\tconstructor(component: object) {\n\t\tthis.component = component;\n\t\tthis.host = toInternalRadiantSsrHost(component);\n\t}\n\n\tprivate ensureReady(): void {\n\t\tensureLegacyHostReady(this.component, 'ssr');\n\t}\n\n\tpublic renderHost(): JsxRenderable {\n\t\tthis.ensureReady();\n\n\t\treturn {\n\t\t\tnodeType: 1,\n\t\t\touterHTML: this.renderHostToString({ mode: 'hydrate' }),\n\t\t};\n\t}\n\n\tpublic renderHostToString(options: RenderToStringOptions = {}, attributes = this.getHostAttributes()): string {\n\t\tthis.ensureReady();\n\t\tconst tagName = this.getTagName();\n\t\tconst restoreSsrContexts = withSsrContextProviders(this.host.getContextProviders());\n\n\t\ttry {\n\t\t\treturn `<${tagName}${stringifyHostAttributes(attributes)}>${this.renderHostContent(options)}</${tagName}>`;\n\t\t} finally {\n\t\t\trestoreSsrContexts();\n\t\t}\n\t}\n\n\tpublic getHostAttributes(): Record<string, string> {\n\t\tthis.ensureReady();\n\t\treturn resolveHostAttributes(this.host);\n\t}\n\n\tprivate renderHostContent(options: RenderToStringOptions): string {\n\t\tconst hydrate = options.mode === 'hydrate' || (options.mode === undefined && options.hydrate === true);\n\n\t\tconst hydrationScripts = hydrate\n\t\t\t? this.host\n\t\t\t\t\t.getHydrationBindings()\n\t\t\t\t\t.map((binding) => binding.renderHydrationScriptTag())\n\t\t\t\t\t.filter((markup): markup is string => typeof markup === 'string')\n\t\t\t\t\t.join('')\n\t\t\t: '';\n\n\t\treturn composeHostContent(\n\t\t\t{\n\t\t\t\thostContent: this.host.renderViewToString(options),\n\t\t\t\tauthoredHydrationMarkup: this.host.getAuthoredHydrationScriptMarkup?.() ?? '',\n\t\t\t\tslotProjectionScript: this.host.getSlotProjectionScriptTag?.() ?? '',\n\t\t\t\thydrationScripts,\n\t\t\t},\n\t\t\thydrate,\n\t\t);\n\t}\n\n\tprivate getTagName(): string {\n\t\tconst tagName = getCustomElementTagName(this.host.constructor);\n\n\t\tif (!tagName) {\n\t\t\tthrow new Error(`${this.host.constructor.name} is missing @customElement metadata.`);\n\t\t}\n\n\t\treturn tagName;\n\t}\n}\n",
19
+ "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport { renderToString as renderJsxToString } from '@ecopages/jsx/server';\nimport {\n\tcreateServerHydrationBindingState,\n\tisServerRenderHydrationActive,\n\twithForcedServerCustomElementRendering,\n\twithServerCustomElementRenderHook,\n\twithServerHydrationBindingState,\n} from '@ecopages/jsx/server';\nimport { RadiantElementSsrService } from './radiant-element-ssr-service';\nimport { resolveRadiantElementSsrHostSource as resolveInternalRadiantElementSsrHostSource } from '../core/radiant-element-ssr-host';\nimport type {\n\tRadiantElementRenderBridge,\n\tRadiantElementServerRenderSsrCapable,\n\tRadiantElementSsrRuntime,\n\tRadiantElementTrackedRenderSsrCapable,\n} from '../core/radiant-element-ssr-registry';\nimport { withRadiantElementSsrRuntime } from '../core/radiant-element-ssr-registry';\n\nlet radiantElementSsrRuntime: RadiantElementSsrRuntime | undefined;\n\nexport function createRadiantElementSsrService(component: object): RadiantElementSsrService {\n\treturn new RadiantElementSsrService(component);\n}\n\nexport function renderRadiantElementHost(component: RadiantElementServerRenderSsrCapable): JsxRenderable {\n\treturn {\n\t\tnodeType: 1,\n\t\touterHTML: renderRadiantElementHostToString(component, { mode: 'hydrate' }),\n\t};\n}\n\nexport function renderRegisteredRadiantElementHost(component: unknown): JsxRenderable | undefined {\n\tif (isRadiantElementServerRenderable(component)) {\n\t\treturn renderRadiantElementHost(component);\n\t}\n\n\tif (!isLegacyServerRenderable(component)) {\n\t\treturn undefined;\n\t}\n\n\treturn component.renderHost?.() ?? { nodeType: 1, outerHTML: component.renderHostToString({ mode: 'hydrate' }) };\n}\n\nexport function renderRadiantElementHostToString(\n\tcomponent: RadiantElementServerRenderSsrCapable,\n\toptions: RenderToStringOptions = {},\n): string {\n\treturn withServerRadiantElementSsrRuntime(() =>\n\t\tcreateRadiantElementSsrService(component).renderHostToString(\n\t\t\toptions,\n\t\t\tgetRadiantElementHostSsrAttributes(component),\n\t\t),\n\t);\n}\n\nexport function renderRegisteredRadiantElementHostToString(\n\tcomponent: unknown,\n\toptions: RenderToStringOptions = {},\n): string | undefined {\n\tif (isRadiantElementServerRenderable(component)) {\n\t\treturn renderRadiantElementHostToString(component, options);\n\t}\n\n\tif (!isLegacyServerRenderable(component)) {\n\t\treturn undefined;\n\t}\n\n\treturn component.renderHostToString(options);\n}\n\nexport function resolveRegisteredRadiantElementPreview(component: unknown, markup: string): JsxRenderable | undefined {\n\tif (isRadiantElementServerRenderable(component)) {\n\t\treturn renderRadiantElementHost(component);\n\t}\n\n\tif (!isLegacyServerRenderable(component)) {\n\t\treturn undefined;\n\t}\n\n\treturn component.renderHost?.() ?? { nodeType: 1, outerHTML: markup };\n}\n\nexport function renderRadiantElementViewToString(\n\tcomponent: RadiantElementTrackedRenderSsrCapable,\n\toptions: RenderToStringOptions = {},\n): string {\n\treturn withServerRadiantElementSsrRuntime(() =>\n\t\twithRadiantServerCustomElementRenderBridge(() =>\n\t\t\trenderJsxToString(getRadiantElementTrackedRenderOutput(component).value, options),\n\t\t),\n\t);\n}\n\nexport function getRadiantElementHostSsrAttributes(\n\tcomponent: RadiantElementServerRenderSsrCapable,\n): Record<string, string> {\n\treturn createRadiantElementSsrService(component).getHostAttributes();\n}\n\nexport function resolveRadiantElementRenderBridge(component: object): RadiantElementRenderBridge | undefined {\n\tif (!isRadiantElementServerRenderable(component)) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\trenderHost: () => renderRadiantElementHost(component),\n\t\trenderHostToString: (options) => renderRadiantElementHostToString(component, options),\n\t};\n}\n\nexport function resolveRadiantElementSsrHostBridge(component: object): object | undefined {\n\treturn resolveInternalRadiantElementSsrHostSource(component);\n}\n\nexport function withRadiantServerCustomElementRenderBridge<T>(render: () => T): T {\n\treturn withForcedServerCustomElementRendering(() =>\n\t\twithServerCustomElementRenderHook(({ instance }) => {\n\t\t\tif (isRadiantElementServerRenderable(instance)) {\n\t\t\t\treturn {\n\t\t\t\t\tnodeType: 1,\n\t\t\t\t\tget outerHTML() {\n\t\t\t\t\t\tconst hydrate = isServerRenderHydrationActive();\n\t\t\t\t\t\tconst options: RenderToStringOptions = { hydrate, mode: hydrate ? 'hydrate' : 'plain' };\n\n\t\t\t\t\t\tif (!hydrate) {\n\t\t\t\t\t\t\treturn renderRadiantElementHostToString(instance, options);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn withServerHydrationBindingState(createServerHydrationBindingState(), () =>\n\t\t\t\t\t\t\trenderRadiantElementHostToString(instance, options),\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (!isLegacyServerRenderable(instance)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst legacyInstance: { renderHostToString(options?: RenderToStringOptions): string } = instance;\n\n\t\t\treturn {\n\t\t\t\tnodeType: 1,\n\t\t\t\tget outerHTML() {\n\t\t\t\t\tconst hydrate = isServerRenderHydrationActive();\n\n\t\t\t\t\tif (!hydrate) {\n\t\t\t\t\t\treturn legacyInstance.renderHostToString({ hydrate, mode: hydrate ? 'hydrate' : 'plain' });\n\t\t\t\t\t}\n\n\t\t\t\t\treturn withServerHydrationBindingState(createServerHydrationBindingState(), () =>\n\t\t\t\t\t\tlegacyInstance.renderHostToString({ hydrate, mode: hydrate ? 'hydrate' : 'plain' }),\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t};\n\t\t}, render),\n\t);\n}\n\nexport function getRadiantElementTrackedRenderOutput(component: RadiantElementTrackedRenderSsrCapable): {\n\tcontainsSlots: boolean;\n\tvalue: JsxRenderable;\n} {\n\tif (hasTrackedRenderOutput(component)) {\n\t\treturn component.resolveTrackedRenderOutput();\n\t}\n\n\tconst source = resolveInternalRadiantElementSsrHostSource(component);\n\n\tif (!source) {\n\t\tthrow new Error('Radiant SSR runtime requires tracked render output support on the component.');\n\t}\n\n\treturn source.resolveTrackedRenderOutput();\n}\n\nfunction isRadiantElementServerRenderable(component: unknown): component is RadiantElementServerRenderSsrCapable {\n\tif (typeof component !== 'object' || component === null) {\n\t\treturn false;\n\t}\n\n\treturn resolveInternalRadiantElementSsrHostSource(component) !== undefined;\n}\n\nfunction isLegacyServerRenderable(component: unknown): component is {\n\trenderHost?: () => JsxRenderable;\n\trenderHostToString(options?: RenderToStringOptions): string;\n} {\n\tif (typeof component !== 'object' || component === null) {\n\t\treturn false;\n\t}\n\n\treturn typeof (component as { renderHostToString?: unknown }).renderHostToString === 'function';\n}\n\nfunction hasTrackedRenderOutput(component: unknown): component is {\n\tresolveTrackedRenderOutput(): { containsSlots: boolean; value: JsxRenderable };\n} {\n\tif (typeof component !== 'object' || component === null) {\n\t\treturn false;\n\t}\n\n\treturn typeof (component as { resolveTrackedRenderOutput?: unknown }).resolveTrackedRenderOutput === 'function';\n}\n\nexport function getOrCreateRadiantElementSsrRuntime(): RadiantElementSsrRuntime {\n\tif (radiantElementSsrRuntime) {\n\t\treturn radiantElementSsrRuntime;\n\t}\n\n\tradiantElementSsrRuntime = {\n\t\tgetHostAttributes: getRadiantElementHostSsrAttributes,\n\t\trenderHost: renderRadiantElementHost,\n\t\trenderHostToString: renderRadiantElementHostToString,\n\t\tresolveRenderBridge: resolveRadiantElementRenderBridge,\n\t\trenderView: renderRadiantElementViewToString,\n\t};\n\n\treturn radiantElementSsrRuntime;\n}\n\nexport function withServerRadiantElementSsrRuntime<T>(render: () => T): T {\n\treturn withRadiantElementSsrRuntime(getOrCreateRadiantElementSsrRuntime(), render);\n}\n"
20
+ ],
21
+ "mappings": "2PAEA,IAAM,EAA4B,OAAO,IAAI,2CAA2C,EAWjF,SAAS,EAA8B,CAC7C,EACA,EACA,EACO,CACP,IAAM,EAAc,EAAO,YACrB,EAAc,EAAY,IAA8B,CAAC,EAE/D,GAAI,EAAY,KAAK,CAAC,IAAe,EAAW,OAAS,CAAY,EACpE,OAGD,EAAY,KAAK,CAAE,KAAM,EAAc,SAAQ,CAAC,EAChD,EAAY,GAA6B,EAGnC,SAAS,CAA0B,CAAC,EAA0C,CACpF,OAAS,EAAO,YAAoD,IAA8B,CAAC,GAAG,MAAM,EC5B7G,IAAM,EAA+B,OAAO,IAAI,gDAAgD,EAC1F,EAAwC,OAAO,IAAI,yDAAyD,EAC5G,EAAiD,OAAO,IAC7D,kEACD,EAQO,SAAS,EAAmD,CAClE,EACA,EACO,CACP,EAAoB,EAAO,EAA8B,CAAW,EAU9D,SAAS,EAA2D,CAC1E,EACA,EACO,CACP,EAAoB,EAAO,EAAuC,CAAW,EASvE,SAAS,CAA+C,CAAC,EAAmB,CAClF,EAAsB,EAAU,CAA4B,EAUtD,SAAS,CAAuD,CAAC,EAAmB,CAC1F,IAAM,EAAS,EAEf,EACC,EACA,EACC,EAAO,KAAoD,IAAI,GACjE,E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,IAAc,KAClD,MAAO,GAGR,OAAO,OAAQ,EAAuD,6BAA+B,WAG/F,SAAS,EAAmC,EAA6B,CAC/E,GAAI,EACH,OAAO,EAWR,OARA,EAA2B,CAC1B,kBAAmB,EACnB,WAAY,EACZ,mBAAoB,EACpB,oBAAqB,GACrB,WAAY,EACb,EAEO,EAGD,SAAS,CAAqC,CAAC,EAAoB,CACzE,OAAO,EAA6B,GAAoC,EAAG,CAAM",
22
+ "debugId": "99E914A0E7B306E264756E2164756E21",
23
+ "names": []
24
+ }
@@ -0,0 +1,2 @@
1
+ import type { InternalRadiantSsrHost } from './internal-radiant-host';
2
+ export declare function toInternalRadiantSsrHost(component: object): InternalRadiantSsrHost;
@@ -0,0 +1,3 @@
1
+ var I=((i)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var R=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function E(i,t,r){let a=i.constructor,P=a[R]??[];if(P.some((D)=>D.name===t))return;P.push({name:t,options:r}),a[R]=P}function v(i){return(i.constructor[R]??[]).slice()}function f(i){if(C(i))return i;return}function C(i){return typeof i.constructor==="function"&&typeof i.getAttribute==="function"&&typeof i.getAttributeNames==="function"&&typeof i.getAuthoredHydrationScriptMarkup==="function"&&typeof i.getContextProviders==="function"&&typeof i.getHydrationBindings==="function"&&typeof i.getReactiveProperties==="function"&&typeof i.getSlotProjectionScriptTag==="function"&&typeof i.resolveTrackedRenderOutput==="function"&&typeof i.renderViewToString==="function"}function _(i){let t=f(i);if(!t)throw Error("Radiant SSR runtime requires a server extraction host shape on the component.");return{constructor:t.constructor,getAttribute:(r)=>t.getAttribute(r),getAttributeNames:()=>t.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>t.getAuthoredHydrationScriptMarkup?.(),getContextProviders:()=>t.getContextProviders(),getHydrationBindings:()=>t.getHydrationBindings(),getReactiveProperties:()=>t.getReactiveProperties(),getReactivePropDefinitions:()=>v(i),getPropertyValue:(r)=>Reflect.get(i,r),getSlotProjectionScriptTag:()=>t.getSlotProjectionScriptTag?.(),resolveTrackedRenderOutput:()=>t.resolveTrackedRenderOutput(),renderViewToString:(r)=>t.renderViewToString(r)}}export{_ as toInternalRadiantSsrHost};
2
+
3
+ //# debugId=4BE260CD02154AC064756E2164756E21
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/reactive-prop-metadata.ts", "../src/core/radiant-element-ssr-host.ts", "../src/server/radiant-element-ssr-extractor.ts"],
4
+ "sourcesContent": [
5
+ "import type { ReactivePropertyOptions } from './reactive-prop-core';\n\nconst REACTIVE_PROP_DEFINITIONS = Symbol.for('@ecopages/radiant.reactivePropDefinitions');\n\nexport type ReactivePropDefinition = {\n\tname: string;\n\toptions: ReactivePropertyOptions<unknown>;\n};\n\ntype RadiantConstructorWithReactiveProps = CustomElementConstructor & {\n\t[REACTIVE_PROP_DEFINITIONS]?: ReactivePropDefinition[];\n};\n\nexport function registerReactivePropDefinition(\n\ttarget: object,\n\tpropertyName: string,\n\toptions: ReactivePropertyOptions<unknown>,\n): void {\n\tconst constructor = target.constructor as RadiantConstructorWithReactiveProps;\n\tconst definitions = constructor[REACTIVE_PROP_DEFINITIONS] ?? [];\n\n\tif (definitions.some((definition) => definition.name === propertyName)) {\n\t\treturn;\n\t}\n\n\tdefinitions.push({ name: propertyName, options });\n\tconstructor[REACTIVE_PROP_DEFINITIONS] = definitions;\n}\n\nexport function getReactivePropDefinitions(target: object): ReactivePropDefinition[] {\n\treturn ((target.constructor as RadiantConstructorWithReactiveProps)[REACTIVE_PROP_DEFINITIONS] ?? []).slice();\n}\n",
6
+ "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport type { ReactiveProperty } from './reactive-prop-core';\nimport type { ReactivePropDefinition } from './reactive-prop-metadata';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\n\n/**\n * Unified SSR host shape shared by core resolution and server serialization.\n */\nexport type InternalRadiantSsrHost = {\n\tconstructor: CustomElementConstructor;\n\tgetAttribute(name: string): string | null;\n\tgetAttributeNames(): string[];\n\tgetAuthoredHydrationScriptMarkup?: () => string | undefined;\n\tgetContextProviders: () => SsrSerializableContextProvider[];\n\tgetHydrationBindings: () => SsrSerializableHydrationBinding[];\n\tgetReactiveProperties: () => ReactiveProperty[];\n\tgetReactivePropDefinitions: () => ReactivePropDefinition[];\n\tgetPropertyValue: (name: string) => unknown;\n\tgetSlotProjectionScriptTag?: () => string | undefined;\n\tresolveTrackedRenderOutput: () => { containsSlots: boolean; value: JsxRenderable };\n\trenderViewToString: (options?: RenderToStringOptions) => string;\n};\n\nexport type RadiantElementSsrHostSource = InternalRadiantSsrHost;\n\nexport function resolveRadiantElementSsrHostSource(component: object): InternalRadiantSsrHost | undefined {\n\tif (isInternalRadiantSsrHost(component)) {\n\t\treturn component;\n\t}\n\n\treturn undefined;\n}\n\nexport function isInternalRadiantSsrHost(component: object): component is InternalRadiantSsrHost {\n\treturn (\n\t\ttypeof component.constructor === 'function' &&\n\t\ttypeof (component as { getAttribute?: unknown }).getAttribute === 'function' &&\n\t\ttypeof (component as { getAttributeNames?: unknown }).getAttributeNames === 'function' &&\n\t\ttypeof (component as { getAuthoredHydrationScriptMarkup?: unknown }).getAuthoredHydrationScriptMarkup ===\n\t\t\t'function' &&\n\t\ttypeof (component as { getContextProviders?: unknown }).getContextProviders === 'function' &&\n\t\ttypeof (component as { getHydrationBindings?: unknown }).getHydrationBindings === 'function' &&\n\t\ttypeof (component as { getReactiveProperties?: unknown }).getReactiveProperties === 'function' &&\n\t\ttypeof (component as { getSlotProjectionScriptTag?: unknown }).getSlotProjectionScriptTag === 'function' &&\n\t\ttypeof (component as { resolveTrackedRenderOutput?: unknown }).resolveTrackedRenderOutput === 'function' &&\n\t\ttypeof (component as { renderViewToString?: unknown }).renderViewToString === 'function'\n\t);\n}\n",
7
+ "import { getReactivePropDefinitions } from '../core/reactive-prop-metadata';\nimport { resolveRadiantElementSsrHostSource } from '../core/radiant-element-ssr-host';\nimport type { InternalRadiantSsrHost } from './internal-radiant-host';\n\nexport function toInternalRadiantSsrHost(component: object): InternalRadiantSsrHost {\n\tconst source = resolveRadiantElementSsrHostSource(component);\n\n\tif (!source) {\n\t\tthrow new Error('Radiant SSR runtime requires a server extraction host shape on the component.');\n\t}\n\n\treturn {\n\t\tconstructor: source.constructor,\n\t\tgetAttribute: (name) => source.getAttribute(name),\n\t\tgetAttributeNames: () => source.getAttributeNames(),\n\t\tgetAuthoredHydrationScriptMarkup: () => source.getAuthoredHydrationScriptMarkup?.(),\n\t\tgetContextProviders: () => source.getContextProviders(),\n\t\tgetHydrationBindings: () => source.getHydrationBindings(),\n\t\tgetReactiveProperties: () => source.getReactiveProperties(),\n\t\tgetReactivePropDefinitions: () => getReactivePropDefinitions(component),\n\t\tgetPropertyValue: (name) => Reflect.get(component, name),\n\t\tgetSlotProjectionScriptTag: () => source.getSlotProjectionScriptTag?.(),\n\t\tresolveTrackedRenderOutput: () => source.resolveTrackedRenderOutput(),\n\t\trenderViewToString: (options) => source.renderViewToString(options),\n\t};\n}\n"
8
+ ],
9
+ "mappings": "2PAEA,IAAM,EAA4B,OAAO,IAAI,2CAA2C,EAWjF,SAAS,CAA8B,CAC7C,EACA,EACA,EACO,CACP,IAAM,EAAc,EAAO,YACrB,EAAc,EAAY,IAA8B,CAAC,EAE/D,GAAI,EAAY,KAAK,CAAC,IAAe,EAAW,OAAS,CAAY,EACpE,OAGD,EAAY,KAAK,CAAE,KAAM,EAAc,SAAQ,CAAC,EAChD,EAAY,GAA6B,EAGnC,SAAS,CAA0B,CAAC,EAA0C,CACpF,OAAS,EAAO,YAAoD,IAA8B,CAAC,GAAG,MAAM,ECHtG,SAAS,CAAkC,CAAC,EAAuD,CACzG,GAAI,EAAyB,CAAS,EACrC,OAAO,EAGR,OAGM,SAAS,CAAwB,CAAC,EAAwD,CAChG,OACC,OAAO,EAAU,cAAgB,YACjC,OAAQ,EAAyC,eAAiB,YAClE,OAAQ,EAA8C,oBAAsB,YAC5E,OAAQ,EAA6D,mCACpE,YACD,OAAQ,EAAgD,sBAAwB,YAChF,OAAQ,EAAiD,uBAAyB,YAClF,OAAQ,EAAkD,wBAA0B,YACpF,OAAQ,EAAuD,6BAA+B,YAC9F,OAAQ,EAAuD,6BAA+B,YAC9F,OAAQ,EAA+C,qBAAuB,WC3CzE,SAAS,CAAwB,CAAC,EAA2C,CACnF,IAAM,EAAS,EAAmC,CAAS,EAE3D,GAAI,CAAC,EACJ,MAAU,MAAM,+EAA+E,EAGhG,MAAO,CACN,YAAa,EAAO,YACpB,aAAc,CAAC,IAAS,EAAO,aAAa,CAAI,EAChD,kBAAmB,IAAM,EAAO,kBAAkB,EAClD,iCAAkC,IAAM,EAAO,mCAAmC,EAClF,oBAAqB,IAAM,EAAO,oBAAoB,EACtD,qBAAsB,IAAM,EAAO,qBAAqB,EACxD,sBAAuB,IAAM,EAAO,sBAAsB,EAC1D,2BAA4B,IAAM,EAA2B,CAAS,EACtE,iBAAkB,CAAC,IAAS,QAAQ,IAAI,EAAW,CAAI,EACvD,2BAA4B,IAAM,EAAO,6BAA6B,EACtE,2BAA4B,IAAM,EAAO,2BAA2B,EACpE,mBAAoB,CAAC,IAAY,EAAO,mBAAmB,CAAO,CACnE",
10
+ "debugId": "4BE260CD02154AC064756E2164756E21",
11
+ "names": []
12
+ }
@@ -0,0 +1,13 @@
1
+ import type { JsxRenderable } from '@ecopages/jsx';
2
+ import type { RenderToStringOptions } from '@ecopages/jsx/server';
3
+ export declare class RadiantElementSsrService {
4
+ private readonly component;
5
+ private readonly host;
6
+ constructor(component: object);
7
+ private ensureReady;
8
+ renderHost(): JsxRenderable;
9
+ renderHostToString(options?: RenderToStringOptions, attributes?: Record<string, string>): string;
10
+ getHostAttributes(): Record<string, string>;
11
+ private renderHostContent;
12
+ private getTagName;
13
+ }
@@ -0,0 +1,3 @@
1
+ var b=((P)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(P,{get:(D,q)=>(typeof require<"u"?require:D)[q]}):P)(function(P){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+P+'" is not supported')});var Z=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function DP(P,D,q){let W=P.constructor,Q=W[Z]??[];if(Q.some(($)=>$.name===D))return;Q.push({name:D,options:q}),W[Z]=Q}function j(P){return(P.constructor[Z]??[]).slice()}var X=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),U=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),y=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function WP(P,D){B(P,X,D)}function QP(P,D){B(P,U,D)}function G(P){J(P,X)}function Y(P){let D=P;J(P,U,D[y]??=new Set)}function B(P,D,q){let W=P,Q=Object.prototype.hasOwnProperty.call(W,D)?W[D]:void 0;if(Array.isArray(Q)){Q.push(q);return}Object.defineProperty(W,D,{value:[q]})}function J(P,D,q,W=Object.getPrototypeOf(P)){if(!W||W===Object.prototype)return;J(P,D,q,Object.getPrototypeOf(W));let Q=W[D];if(!Array.isArray(Q))return;for(let $ of Q){if(q?.has($))continue;$(P),q?.add($)}}function R(P,D){switch(D){case"construct":G(P);break;case"connect":case"ssr":Y(P);break}}function M(P){switch(P){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function m(P){switch(typeof P){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(P))return"array";if(Object.prototype.toString.call(P)==="[object Object]")return"object"}function d(P){switch(P){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function c(P){try{return JSON.parse(P)}catch{throw TypeError("Invalid JSON string")}}var p={array(P){let D=c(P);if(!Array.isArray(D))throw TypeError(`Expected an array but got a value of type "${typeof D}"`);return D},boolean(P){return!(P==="0"||String(P).toLowerCase()==="false")},number(P){return Number(P.replace(/_/g,""))},object(P){let D=JSON.parse(P);if(D===null||typeof D!=="object"||Array.isArray(D))throw TypeError(`expected value of type "object" but instead got value "${P}" of type "${m(D)}"`);return D},string(P){return P}},K={default:k,array:H,object:H};function H(P){return JSON.stringify(P)}function k(P){return`${P}`}function w(P,D){let q=M(D);if(!q)throw TypeError(`[radiant-element] Unknown type "${D}"`);return p[q](P)}function C(P,D){let q=M(D);if(!q)throw TypeError(`[radiant-element] Unknown type "${D}"`);return(K[q]??K.default??k)(P)}function l(P){return typeof P==="boolean"}function u(P){return typeof P==="number"}function s(P){return typeof P==="string"}function o(P){return Array.isArray(P)}function i(P){return typeof P==="object"&&!Array.isArray(P)&&P!==null}function JP(P,D){switch(P){case Boolean:return l(D);case Number:return u(D);case String:return s(D);case Array:return o(D);case Object:return i(D);default:return!1}}var jP=(P,D,q,W)=>{if(D===Boolean){let $=P.getAttribute(q);if($===null)return W;return $===""?!0:w($,D)}let Q=P.getAttribute(q);return Q!==null?w(Q,D):W??d(D)};var E=Symbol.for("@ecopages/radiant.customElementTagName");function UP(P,D){P[E]=D}function O(P){return P[E]}function x(P){return P.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function I(P){let D={},q=new Set;return n(P,D,q),r(P,D,q),a(P,D),D}function L(P){return Object.entries(P).map(([D,q])=>` ${D}="${x(q)}"`).join("")}function n(P,D,q){for(let W of P.getReactiveProperties()){let Q=P.getPropertyValue(W.name);if(Q===void 0||Q===null||Q===!1)continue;D[W.attribute]=String(W.converter.toAttribute(Q)),q.add(W.attribute)}}function r(P,D,q){for(let W of P.getReactivePropDefinitions()){let Q=W.options.attribute??W.name;if(q.has(Q))continue;let $=P.getPropertyValue(W.name);if($===void 0||$===null||$===!1)continue;D[Q]=String(C($,W.options.type)),q.add(Q)}}function a(P,D){for(let q of P.getAttributeNames()){let W=P.getAttribute(q);if(W!==null)D[q]=W}}var _=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function f(){return globalThis}function N(P){f()[_]=P}function HP(P){return f()[_]?.(P)}var F;function T(){if(F!==void 0)return F;try{let{AsyncLocalStorage:P}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return F=new P,F}catch{return F=null,null}}var z=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function g(){let P=globalThis;return P[z]??=[],P[z]}function A(P){if(P.length===0)return()=>{return};let D=new Map;for(let Q of P)D.set(Q.getContextKey(),Q);let q=T();if(q){let Q=q.getStore()??[],$=[...Q,D];return q.enterWith($),()=>{q.enterWith(Q)}}let W=g();return W.push(D),()=>{let Q=W.lastIndexOf(D);if(Q>=0)W.splice(Q,1)}}function V(P){let D=T()?.getStore()??g();for(let q=D.length-1;q>=0;q-=1){let W=D[q]?.get(P);if(W)return W}return}function kP(P){let D=V(P);if(!D)return;return D.getContext()}N((P)=>V(P));function S(P,D){if(!D)return`${P.hostContent}${P.authoredHydrationMarkup}${P.slotProjectionScript}`;return`${P.hostContent}${P.slotProjectionScript}${P.hydrationScripts}`}function h(P){if(t(P))return P;return}function t(P){return typeof P.constructor==="function"&&typeof P.getAttribute==="function"&&typeof P.getAttributeNames==="function"&&typeof P.getAuthoredHydrationScriptMarkup==="function"&&typeof P.getContextProviders==="function"&&typeof P.getHydrationBindings==="function"&&typeof P.getReactiveProperties==="function"&&typeof P.getSlotProjectionScriptTag==="function"&&typeof P.resolveTrackedRenderOutput==="function"&&typeof P.renderViewToString==="function"}function v(P){let D=h(P);if(!D)throw Error("Radiant SSR runtime requires a server extraction host shape on the component.");return{constructor:D.constructor,getAttribute:(q)=>D.getAttribute(q),getAttributeNames:()=>D.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>D.getAuthoredHydrationScriptMarkup?.(),getContextProviders:()=>D.getContextProviders(),getHydrationBindings:()=>D.getHydrationBindings(),getReactiveProperties:()=>D.getReactiveProperties(),getReactivePropDefinitions:()=>j(P),getPropertyValue:(q)=>Reflect.get(P,q),getSlotProjectionScriptTag:()=>D.getSlotProjectionScriptTag?.(),resolveTrackedRenderOutput:()=>D.resolveTrackedRenderOutput(),renderViewToString:(q)=>D.renderViewToString(q)}}class e{component;host;constructor(P){this.component=P,this.host=v(P)}ensureReady(){R(this.component,"ssr")}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(P={},D=this.getHostAttributes()){this.ensureReady();let q=this.getTagName(),W=A(this.host.getContextProviders());try{return`<${q}${L(D)}>${this.renderHostContent(P)}</${q}>`}finally{W()}}getHostAttributes(){return this.ensureReady(),I(this.host)}renderHostContent(P){let D=P.mode==="hydrate"||P.mode===void 0&&P.hydrate===!0,q=D?this.host.getHydrationBindings().map((W)=>W.renderHydrationScriptTag()).filter((W)=>typeof W==="string").join(""):"";return S({hostContent:this.host.renderViewToString(P),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:q},D)}getTagName(){let P=O(this.host.constructor);if(!P)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return P}}export{e as RadiantElementSsrService};
2
+
3
+ //# debugId=2BEE0DF39ECD091864756E2164756E21