@ecopages/radiant 0.3.0-beta.2 → 0.3.0-beta.3
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.
- package/README.md +11 -7
- package/client/app-bootstrap.js +2 -2
- package/client/app-bootstrap.js.map +2 -2
- package/client/hydrator.js +2 -2
- package/client/hydrator.js.map +2 -2
- package/client/install-hydrator.js +2 -2
- package/client/install-hydrator.js.map +2 -2
- package/context/context-consumer-bootstrap.js +2 -2
- package/context/context-consumer-bootstrap.js.map +4 -4
- package/context/context-consumer-runtime.js +2 -2
- package/context/context-consumer-runtime.js.map +4 -4
- package/context/context-host.js +2 -2
- package/context/context-host.js.map +2 -2
- package/context/context-provider.js +2 -2
- package/context/context-provider.js.map +2 -2
- package/context/context-ssr-bridge.d.ts +1 -1
- package/context/context-ssr-bridge.js +2 -2
- package/context/context-ssr-bridge.js.map +3 -3
- package/context/create-context.js +2 -2
- package/context/create-context.js.map +2 -2
- package/context/decorators/consume-context.js +2 -2
- package/context/decorators/consume-context.js.map +4 -4
- package/context/decorators/context-selection-delivery.js +2 -2
- package/context/decorators/context-selection-delivery.js.map +2 -2
- package/context/decorators/context-selector.js +2 -2
- package/context/decorators/context-selector.js.map +4 -4
- package/context/decorators/legacy/consume-context.js +2 -2
- package/context/decorators/legacy/consume-context.js.map +4 -4
- package/context/decorators/legacy/context-selector-field.js +2 -2
- package/context/decorators/legacy/context-selector-field.js.map +4 -4
- package/context/decorators/legacy/context-selector.js +2 -2
- package/context/decorators/legacy/context-selector.js.map +4 -4
- package/context/decorators/legacy/provide-context.js +2 -2
- package/context/decorators/legacy/provide-context.js.map +2 -2
- package/context/decorators/on-context-update.js +2 -2
- package/context/decorators/on-context-update.js.map +4 -4
- package/context/decorators/provide-context.js +2 -2
- package/context/decorators/provide-context.js.map +2 -2
- package/context/decorators/standard/consume-context.js +2 -2
- package/context/decorators/standard/consume-context.js.map +4 -4
- package/context/decorators/standard/context-selector-field.js +2 -2
- package/context/decorators/standard/context-selector-field.js.map +4 -4
- package/context/decorators/standard/context-selector.js +2 -2
- package/context/decorators/standard/context-selector.js.map +4 -4
- package/context/decorators/standard/provide-context.js +2 -2
- package/context/decorators/standard/provide-context.js.map +2 -2
- package/context/decorators/standard-legacy-dispatch.js +2 -2
- package/context/decorators/standard-legacy-dispatch.js.map +2 -2
- package/context/events.js +2 -2
- package/context/events.js.map +2 -2
- package/context/hydration-script.js +2 -2
- package/context/hydration-script.js.map +2 -2
- package/context/index.js +2 -2
- package/context/index.js.map +4 -4
- package/controller-registry.js +2 -2
- package/controller-registry.js.map +2 -2
- package/core/controller-metadata.js +2 -2
- package/core/controller-metadata.js.map +2 -2
- package/core/custom-element-metadata.js +2 -2
- package/core/custom-element-metadata.js.map +2 -2
- package/core/event-subscription-registry.js +2 -2
- package/core/event-subscription-registry.js.map +2 -2
- package/core/host-ssr-registry.js +2 -2
- package/core/host-ssr-registry.js.map +2 -2
- package/core/hydration-capable-host.js +2 -2
- package/core/hydration-capable-host.js.map +2 -2
- package/core/hydration-codec.js +2 -2
- package/core/hydration-codec.js.map +2 -2
- package/core/radiant-controller.js +2 -2
- package/core/radiant-controller.js.map +2 -2
- package/core/radiant-element-brand.d.ts +2 -0
- package/core/radiant-element-brand.js +3 -0
- package/core/radiant-element-brand.js.map +10 -0
- package/core/radiant-element-ssr-host-source.d.ts +32 -0
- package/core/radiant-element-ssr-host-source.js +3 -0
- package/core/radiant-element-ssr-host-source.js.map +11 -0
- package/core/radiant-element-ssr-host.d.ts +5 -6
- package/core/radiant-element-ssr-host.js +1 -2
- package/core/radiant-element-ssr-host.js.map +3 -4
- package/core/radiant-element-ssr-registry.d.ts +24 -11
- package/core/radiant-element-ssr-registry.js +2 -2
- package/core/radiant-element-ssr-registry.js.map +3 -3
- package/core/radiant-element.d.ts +5 -3
- package/core/radiant-element.js +2 -2
- package/core/radiant-element.js.map +6 -5
- package/core/radiant-hydrator-state.js +2 -2
- package/core/radiant-hydrator-state.js.map +2 -2
- package/core/reactive-binding-adapter.js +2 -2
- package/core/reactive-binding-adapter.js.map +2 -2
- package/core/reactive-host.js +2 -2
- package/core/reactive-host.js.map +2 -2
- package/core/reactive-jsx-value.js +2 -2
- package/core/reactive-jsx-value.js.map +2 -2
- package/core/reactive-prop-core.js +2 -2
- package/core/reactive-prop-core.js.map +2 -2
- package/core/reactive-prop-metadata.js +2 -2
- package/core/reactive-prop-metadata.js.map +2 -2
- package/core/reactive-property-state.js +2 -2
- package/core/reactive-property-state.js.map +2 -2
- package/core/reactivity-adapter.js +2 -2
- package/core/reactivity-adapter.js.map +2 -2
- package/core/reactivity-runtime.js +2 -2
- package/core/reactivity-runtime.js.map +2 -2
- package/core/reactivity-signals.js +2 -2
- package/core/reactivity-signals.js.map +2 -2
- package/core/render-runtime.js +2 -2
- package/core/render-runtime.js.map +2 -2
- package/core/render-scheduler.js +2 -2
- package/core/render-scheduler.js.map +2 -2
- package/core/slot-projection-runtime.js +2 -2
- package/core/slot-projection-runtime.js.map +2 -2
- package/core/ssr-preparation.js +2 -2
- package/core/ssr-preparation.js.map +2 -2
- package/decorators/attr.js +2 -2
- package/decorators/attr.js.map +2 -2
- package/decorators/bound.js +2 -2
- package/decorators/bound.js.map +2 -2
- package/decorators/bridge.js +2 -2
- package/decorators/bridge.js.map +2 -2
- package/decorators/controller.js +2 -2
- package/decorators/controller.js.map +2 -2
- package/decorators/custom-element.js +2 -2
- package/decorators/custom-element.js.map +2 -2
- package/decorators/debounce.js +2 -2
- package/decorators/debounce.js.map +2 -2
- package/decorators/event.js +2 -2
- package/decorators/event.js.map +2 -2
- package/decorators/legacy/attr.js +2 -2
- package/decorators/legacy/attr.js.map +2 -2
- package/decorators/legacy/bound.js +2 -2
- package/decorators/legacy/bound.js.map +2 -2
- package/decorators/legacy/custom-element.js +2 -2
- package/decorators/legacy/custom-element.js.map +2 -2
- package/decorators/legacy/debounce.js +2 -2
- package/decorators/legacy/debounce.js.map +2 -2
- package/decorators/legacy/event.js +2 -2
- package/decorators/legacy/event.js.map +2 -2
- package/decorators/legacy/host-readiness.js +2 -2
- package/decorators/legacy/host-readiness.js.map +2 -2
- package/decorators/legacy/instance-initializers.js +2 -2
- package/decorators/legacy/instance-initializers.js.map +2 -2
- package/decorators/legacy/member-bootstrap.js +2 -2
- package/decorators/legacy/member-bootstrap.js.map +2 -2
- package/decorators/legacy/on-event.js +2 -2
- package/decorators/legacy/on-event.js.map +2 -2
- package/decorators/legacy/on-updated.js +2 -2
- package/decorators/legacy/on-updated.js.map +2 -2
- package/decorators/legacy/query-slot.js +2 -2
- package/decorators/legacy/query-slot.js.map +2 -2
- package/decorators/legacy/query.js +2 -2
- package/decorators/legacy/query.js.map +2 -2
- package/decorators/legacy/reactive-field.js +2 -2
- package/decorators/legacy/reactive-field.js.map +2 -2
- package/decorators/legacy/reactive-prop.js +2 -2
- package/decorators/legacy/reactive-prop.js.map +2 -2
- package/decorators/legacy/signal.js +2 -2
- package/decorators/legacy/signal.js.map +2 -2
- package/decorators/on-event.js +2 -2
- package/decorators/on-event.js.map +2 -2
- package/decorators/on-updated.js +2 -2
- package/decorators/on-updated.js.map +2 -2
- package/decorators/prop.js +2 -2
- package/decorators/prop.js.map +2 -2
- package/decorators/query-slot.js +2 -2
- package/decorators/query-slot.js.map +2 -2
- package/decorators/query.js +2 -2
- package/decorators/query.js.map +2 -2
- package/decorators/shared/auto-bind.js +2 -2
- package/decorators/shared/auto-bind.js.map +2 -2
- package/decorators/shared/reactive-attr.js +2 -2
- package/decorators/shared/reactive-attr.js.map +2 -2
- package/decorators/signal.js +2 -2
- package/decorators/signal.js.map +2 -2
- package/decorators/standard/attr.js +2 -2
- package/decorators/standard/attr.js.map +2 -2
- package/decorators/standard/bound.js +2 -2
- package/decorators/standard/bound.js.map +2 -2
- package/decorators/standard/custom-element.js +2 -2
- package/decorators/standard/custom-element.js.map +2 -2
- package/decorators/standard/debounce.js +2 -2
- package/decorators/standard/debounce.js.map +2 -2
- package/decorators/standard/event.js +2 -2
- package/decorators/standard/event.js.map +2 -2
- package/decorators/standard/on-event.js +2 -2
- package/decorators/standard/on-event.js.map +2 -2
- package/decorators/standard/on-updated.js +2 -2
- package/decorators/standard/on-updated.js.map +2 -2
- package/decorators/standard/query-slot.js +2 -2
- package/decorators/standard/query-slot.js.map +2 -2
- package/decorators/standard/query.js +2 -2
- package/decorators/standard/query.js.map +2 -2
- package/decorators/standard/reactive-field.js +2 -2
- package/decorators/standard/reactive-field.js.map +2 -2
- package/decorators/standard/reactive-prop.js +2 -2
- package/decorators/standard/reactive-prop.js.map +2 -2
- package/decorators/standard/signal.js +2 -2
- package/decorators/standard/signal.js.map +2 -2
- package/decorators/state.js +2 -2
- package/decorators/state.js.map +2 -2
- package/helpers/create-event-listener.js +2 -2
- package/helpers/create-event-listener.js.map +2 -2
- package/helpers/create-event.js +2 -2
- package/helpers/create-event.js.map +2 -2
- package/helpers/create-query-slot.js +2 -2
- package/helpers/create-query-slot.js.map +2 -2
- package/helpers/create-query.js +2 -2
- package/helpers/create-query.js.map +2 -2
- package/helpers/debounce.js +2 -2
- package/helpers/debounce.js.map +2 -2
- package/helpers/index.js +2 -2
- package/helpers/index.js.map +2 -2
- package/index.js +2 -2
- package/index.js.map +6 -5
- package/package.json +13 -3
- package/server/assert-light-dom-ssr.d.ts +10 -0
- package/server/assert-light-dom-ssr.js +3 -0
- package/server/assert-light-dom-ssr.js.map +10 -0
- package/server/context-ssr.d.ts +8 -19
- package/server/context-ssr.js +2 -2
- package/server/context-ssr.js.map +5 -5
- package/server/host-attribute-serialization.js +2 -2
- package/server/host-attribute-serialization.js.map +4 -4
- package/server/host-script-composition.js +2 -2
- package/server/host-script-composition.js.map +2 -2
- package/server/html-parser.js +2 -2
- package/server/html-parser.js.map +2 -2
- package/server/install-light-dom-shim.d.ts +2 -1
- package/server/install-light-dom-shim.js +2 -2
- package/server/install-light-dom-shim.js.map +9 -8
- package/server/install-ssr-runtime.d.ts +8 -0
- package/server/install-ssr-runtime.js +3 -0
- package/server/install-ssr-runtime.js.map +21 -0
- package/server/install-ssr-scope-adapters.d.ts +1 -0
- package/server/install-ssr-scope-adapters.js +3 -0
- package/server/install-ssr-scope-adapters.js.map +11 -0
- package/server/light-dom-shim.js +2 -2
- package/server/light-dom-shim.js.map +8 -7
- package/server/minimal-dom/dataset.d.ts +2 -0
- package/server/minimal-dom/dataset.js +3 -0
- package/server/minimal-dom/dataset.js.map +10 -0
- package/server/minimal-dom/document.js +2 -2
- package/server/minimal-dom/document.js.map +5 -6
- package/server/minimal-dom/html.d.ts +1 -2
- package/server/minimal-dom/html.js +2 -2
- package/server/minimal-dom/html.js.map +6 -5
- package/server/minimal-dom/install.d.ts +1 -0
- package/server/minimal-dom/install.js +2 -2
- package/server/minimal-dom/install.js.map +8 -7
- package/server/minimal-dom/nodes.d.ts +9 -0
- package/server/minimal-dom/nodes.js +3 -0
- package/server/minimal-dom/nodes.js.map +12 -0
- package/server/project-root.js +2 -2
- package/server/project-root.js.map +4 -5
- package/server/radiant-element-ssr-bridge.d.ts +9 -9
- package/server/radiant-element-ssr-bridge.js +2 -2
- package/server/radiant-element-ssr-bridge.js.map +27 -14
- package/server/radiant-element-ssr-extractor.d.ts +5 -1
- package/server/radiant-element-ssr-extractor.js +2 -2
- package/server/radiant-element-ssr-extractor.js.map +6 -5
- package/server/radiant-element-ssr-service.d.ts +4 -1
- package/server/radiant-element-ssr-service.js +2 -2
- package/server/radiant-element-ssr-service.js.map +15 -12
- package/server/radiant-element-ssr.d.ts +1 -1
- package/server/radiant-element-ssr.js +2 -2
- package/server/radiant-element-ssr.js.map +27 -14
- package/server/render-component.d.ts +3 -5
- package/server/render-component.js +2 -2
- package/server/render-component.js.map +27 -20
- package/server/render-controller.d.ts +1 -0
- package/server/render-controller.js +2 -2
- package/server/render-controller.js.map +30 -23
- package/server/render-fragment.js +2 -2
- package/server/render-fragment.js.map +2 -2
- package/server/slot-projection-html.js +2 -2
- package/server/slot-projection-html.js.map +5 -6
- package/signals/host-resource.js +2 -2
- package/signals/host-resource.js.map +2 -2
- package/signals/host-signal.js +2 -2
- package/signals/host-signal.js.map +2 -2
- package/signals/hydration-script.js +2 -2
- package/signals/hydration-script.js.map +2 -2
- package/tools/escape-css-identifier.js +2 -2
- package/tools/escape-css-identifier.js.map +2 -2
- package/tools/escape-script-json.js +2 -2
- package/tools/escape-script-json.js.map +2 -2
- package/tools/event-emitter.js +2 -2
- package/tools/event-emitter.js.map +2 -2
- package/tools/index.js +2 -2
- package/tools/index.js.map +2 -2
- package/tools/render-jsx-template.js +2 -2
- package/tools/render-jsx-template.js.map +2 -2
- package/types.js +2 -2
- package/types.js.map +2 -2
- package/utils/attribute-utils.js +2 -2
- package/utils/attribute-utils.js.map +2 -2
- package/utils/escape-html-attribute.js +2 -2
- package/utils/escape-html-attribute.js.map +2 -2
- package/utils/index.js +2 -2
- package/utils/index.js.map +2 -2
- package/server/internal-radiant-host.d.ts +0 -2
- package/server/internal-radiant-host.js +0 -3
- package/server/internal-radiant-host.js.map +0 -9
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type RenderToStringOptions } from '@ecopages/jsx/server';
|
|
2
2
|
import type { RadiantController } from '../core/radiant-controller';
|
|
3
|
+
import './install-ssr-runtime';
|
|
3
4
|
import { type RenderedComponent, type RenderedComponentAsset, type RenderedComponentPayload, type RenderedComponentWithPreview } from './render-component';
|
|
4
5
|
/** Constructor shape for a server-renderable controller. */
|
|
5
6
|
export type ServerRenderableControllerConstructor<TController extends RadiantController = RadiantController> = new (host: Element) => TController;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var{defineProperty:t,getOwnPropertyNames:T1,getOwnPropertyDescriptor:B1}=Object,Y1=Object.prototype.hasOwnProperty;function K1(P){return this[P]}var w1=(P)=>{var R=(B0??=new WeakMap).get(P),x;if(R)return R;if(R=t({},"__esModule",{value:!0}),P&&typeof P==="object"||typeof P==="function"){for(var F of T1(P))if(!Y1.call(R,F))t(R,F,{get:K1.bind(P,F),enumerable:!(x=B1(P,F))||x.enumerable})}return B0.set(P,R),R},B0;var D1=(P)=>P;function f1(P,R){this[P]=D1.bind(null,R)}var L1=(P,R)=>{for(var x in R)t(P,x,{get:R[x],enumerable:!0,configurable:!0,set:f1.bind(R,x)})};var e=(P,R)=>()=>(P&&(R=P(P=0)),R);var _1=((P)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(P,{get:(R,x)=>(typeof require<"u"?require:R)[x]}):P)(function(P){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+P+'" is not supported')});function L(P){return P.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function x1(P){let R=[],x=0;while(x<P.length){let F=x;if(P.startsWith("<!--",x)){let Q=P.indexOf("-->",x+4);x=Q===-1?P.length:Q+3,R.push(P.slice(F,x));continue}if(P[x]!=="<"){let Q=P.indexOf("<",x);x=Q===-1?P.length:Q,R.push(P.slice(F,x));continue}let $=k(P,x);if(!$){R.push(P.slice(F));break}if($.type!=="open"||$.selfClosing||m.has($.tagName)){x=$.end,R.push(P.slice(F,x));continue}x=$.end;let q=1;while(x<P.length&&q>0){let Q=P.indexOf("<",x);if(Q===-1){x=P.length;break}let H=k(P,Q);if(!H){x=P.length;break}if(x=H.end,H.type==="comment"||H.type==="declaration")continue;if(H.type==="open"&&!H.selfClosing&&!m.has(H.tagName)){q+=1;continue}if(H.type==="close")q-=1}R.push(P.slice(F,x))}return R.filter((F)=>F!=="")}function e1(P,R){let x;for(let F=R+1;F<P.length;F+=1){let $=P[F];if(x){if($===x)x=void 0;continue}if($==='"'||$==="'"){x=$;continue}if($===">")return F+1}return P.length}function PP(P){let R={},x=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let F of P.matchAll(x)){let[,$,q,Q,H]=F;if(!$)continue;R[$]=q??Q??H??""}return R}function k(P,R){if(P.startsWith("<!--",R)){let K=P.indexOf("-->",R+4);return{end:K===-1?P.length:K+3,type:"comment"}}let x=e1(P,R),F=P.slice(R+1,x-1).trim();if(F==="")return;if(F.startsWith("!")||F.startsWith("?"))return{end:x,type:"declaration"};if(F.startsWith("/"))return{end:x,type:"close"};let $=/\/\s*$/.test(F),q=$?F.replace(/\/\s*$/,"").trim():F,Q=q.split(/[\s/>]/,1)[0]?.toLowerCase()??"",H=Q.length,U=q.slice(H).trim(),j=$||m.has(Q)?"":RP(P,R,x,Q);return{attributes:PP(U),end:x,innerHtml:j,selfClosing:$,tagName:Q,type:"open"}}function RP(P,R,x,F){let $=x,q=1;while($<P.length&&q>0){let Q=P.indexOf("<",$);if(Q===-1)return P.slice(x);let H=k(P,Q);if(!H)return P.slice(x);if(H.type==="open"&&H.tagName===F&&!H.selfClosing&&!m.has(F))q+=1;if(H.type==="close"){if(P.slice(Q+2,H.end-1).trim().toLowerCase()===F){if(q-=1,q===0)return P.slice(x,Q)}}$=H.end}return P.slice(x)}var m;var F1=e(()=>{m=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"])});function Z(){return $1??=(H1(),w1(q1)),$1}class Q1{element;constructor(P){this.element=P}add(...P){let R=new Set(this.readTokens());for(let x of P)if(x!=="")R.add(x);this.writeTokens([...R])}remove(...P){let R=new Set(this.readTokens());for(let x of P)R.delete(x);this.writeTokens([...R])}toggle(P,R){let x=this.contains(P);if(R??!x)return this.add(P),!0;return this.remove(P),!1}contains(P){return this.readTokens().includes(P)}toString(){return this.value}get value(){return this.element.getAttribute("class")??""}readTokens(){return this.value.split(/\s+/).map((P)=>P.trim()).filter((P)=>P.length>0)}writeTokens(P){if(P.length===0){this.element.removeAttribute("class");return}this.element.setAttribute("class",P.join(" "))}}class O{bubbles;cancelable;composed;type;constructor(P,R={}){this.type=P,this.bubbles=R.bubbles??!1,this.cancelable=R.cancelable??!1,this.composed=R.composed??!1}}function xP(P){return new B(P,Y())}function Y(){return globalThis.document??null}var $1,W,B,M,p,J,X;var a=e(()=>{W=class W extends EventTarget{nodeType;static DOCUMENT_NODE=9;static ELEMENT_NODE=1;static TEXT_NODE=3;childNodes=[];ownerDocument;parentNode=null;constructor(P,R=null){super();this.nodeType=P;this.ownerDocument=R}append(...P){for(let R of P)this.appendChild(typeof R==="string"?xP(R):R)}appendChild(P){if("parentNode"in P&&P.parentNode&&"removeChild"in P.parentNode)P.parentNode.removeChild(P);return this.childNodes.push(P),P.ownerDocument=this.nodeType===W.DOCUMENT_NODE?this:this.ownerDocument,P.parentNode=this,P}removeChild(P){let R=this.childNodes.indexOf(P);if(R===-1)return P;return this.childNodes.splice(R,1),P.parentNode=null,P}replaceChildren(...P){for(let R of this.childNodes)R.parentNode=null;this.childNodes=[],this.append(...P)}get textContent(){return this.childNodes.map((P)=>P.textContent??"").join("")}set textContent(P){this.replaceChildren(P??"")}getRootNode(){let P=this;while("parentNode"in P&&P.parentNode)P=P.parentNode;return P}};B=class B extends W{value;constructor(P,R=Y()){super(W.TEXT_NODE,R);this.value=P}get textContent(){return this.value}set textContent(P){this.value=P??""}};M=class M extends W{attributes=new Map;classListValue;datasetValue;fragmentHtml;fragmentText;localName;tagName;constructor(P="div",R=Y()){super(W.ELEMENT_NODE,R);this.localName=P.toLowerCase(),this.tagName=this.localName.toUpperCase()}get id(){return this.getAttribute("id")??""}set id(P){if(P===""){this.removeAttribute("id");return}this.setAttribute("id",P)}get classList(){return this.classListValue??=new Q1(this),this.classListValue}get dataset(){return this.datasetValue??=new Proxy({},{deleteProperty:(P,R)=>{if(typeof R!=="string")return!1;return this.removeAttribute(Z().toDataAttributeName(R)),!0},get:(P,R)=>{if(typeof R!=="string")return;return this.getAttribute(Z().toDataAttributeName(R))??void 0},getOwnPropertyDescriptor:(P,R)=>{if(typeof R!=="string")return;return{configurable:!0,enumerable:!0,value:this.getAttribute(Z().toDataAttributeName(R))??void 0,writable:!0}},has:(P,R)=>{return typeof R==="string"&&this.hasAttribute(Z().toDataAttributeName(R))},ownKeys:()=>{return this.getAttributeNames().filter((P)=>P.startsWith("data-")).map((P)=>Z().toDatasetPropertyName(P.slice(5)))},set:(P,R,x)=>{if(typeof R!=="string")return!1;return this.setAttribute(Z().toDataAttributeName(R),String(x)),!0}}),this.datasetValue}hasAttribute(P){return this.attributes.has(P)}getAttribute(P){return this.attributes.get(P)??null}getAttributeNames(){return Array.from(this.attributes.keys())}setAttribute(P,R){this.fragmentHtml=void 0,this.attributes.set(P,String(R))}toggleAttribute(P,R){if(R??!this.hasAttribute(P))return this.setAttribute(P,""),!0;return this.removeAttribute(P),!1}removeAttribute(P){this.fragmentHtml=void 0,this.attributes.delete(P)}querySelector(){return null}querySelectorAll(){return[]}matches(){return!1}get outerHTML(){if(this.fragmentHtml!==void 0)return this.fragmentHtml;let P=Array.from(this.attributes.entries()).map(([R,x])=>` ${R}="${L(x)}"`).join("");return`<${this.localName}${P}>${this.innerHTML}</${this.localName}>`}get innerHTML(){return this.childNodes.map((P)=>Z().serializeNodeHtml(P)).join("")}set innerHTML(P){this.fragmentHtml=void 0,this.fragmentText=void 0,this.replaceChildren(...Z().parseHtmlToNodes(P,this.ownerDocument))}get textContent(){return this.fragmentText??super.textContent??""}set textContent(P){this.fragmentHtml=void 0,this.fragmentText=P??"",super.textContent=P}setSerializedFragment(P,R,x){this.fragmentHtml=P,this.fragmentText=R,this.attributes=new Map(Object.entries(x)),this.replaceChildren()}};p=class p extends O{detail;constructor(P,R={}){super(P,R);this.detail=R.detail}};J=class J extends M{isConnected=!1;constructor(P="div",R=Y()){super(P,R)}insertAdjacentHTML(P,R){this.append(...Z().parseHtmlToNodes(R,this.ownerDocument))}};X=class X extends J{constructor(P=Y()){super("script",P)}}});var q1={};L1(q1,{toDatasetPropertyName:()=>qP,toDataAttributeName:()=>$P,serializeNodeHtml:()=>HP,parseHtmlToNodes:()=>FP,extractTextContent:()=>Z1,createElementFromFragment:()=>W1});function W1(P,R,x){let F=R.tagName==="script"?new X(x):new J(R.tagName,x);return F.setSerializedFragment(P,Z1(R.innerHtml),R.attributes),F}function Z1(P){return P.replace(/<!--.*?-->/gs,"").replace(/<[^>]+>/g,"")}function FP(P,R=Y()){return x1(P).map((x)=>{if(!x.startsWith("<"))return new B(x,R);let F=k(x,0);if(!F||F.type!=="open")return new B(x,R);return W1(x,F,R)})}function $P(P){return`data-${P.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function qP(P){return P.replace(/-([a-z])/g,(R,x)=>x.toUpperCase())}function HP(P){if(P.nodeType===W.TEXT_NODE)return P.textContent??"";return"outerHTML"in P&&typeof P.outerHTML==="string"?P.outerHTML:P.textContent??""}var H1=e(()=>{F1();a()});var P0=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function IP(P,R,x){let F=P.constructor,$=F[P0]??[];if($.some((q)=>q.name===R))return;$.push({name:R,options:x}),F[P0]=$}function Y0(P){return(P.constructor[P0]??[]).slice()}var K0=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),w0=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),g1=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function AP(P,R){f0(P,K0,R)}function NP(P,R){f0(P,w0,R)}function D0(P){I1(P,K0)}function R0(P,R){let x=P;C1(P,R,x[g1]??=new Set)}function f0(P,R,x){let F=P,$=Object.prototype.hasOwnProperty.call(F,R)?F[R]:void 0;if(Array.isArray($)){$.push(x);return}Object.defineProperty(F,R,{value:[x]})}function I1(P,R){A1(P,(x)=>{let F=x[R];if(!Array.isArray(F))return;for(let $ of F)$(P)})}function C1(P,R,x){for(let F of L0(P)){let $=F[w0];if(!Array.isArray($))continue;for(let q of $){if(x.has(q))continue;q(P,R),x.add(q)}}}function L0(P){let R=[],x=Object.getPrototypeOf(P);while(x&&x!==Object.prototype)R.unshift(x),x=Object.getPrototypeOf(x);return R}function A1(P,R){for(let x of L0(P))R(x)}function w(P,R){switch(R){case"construct":D0(P);break;case"connect":R0(P,"connect");break;case"ssr":R0(P,"ssr");break}}function C0(P){switch(P){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function N1(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 V1(P){switch(P){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function k1(P){try{return JSON.parse(P)}catch{throw TypeError("Invalid JSON string")}}var M1={array(P){let R=k1(P);if(!Array.isArray(R))throw TypeError(`Expected an array but got a value of type "${typeof R}"`);return R},boolean(P){return!(P==="0"||String(P).toLowerCase()==="false")},number(P){return Number(P.replace(/_/g,""))},object(P){let R=JSON.parse(P);if(R===null||typeof R!=="object"||Array.isArray(R))throw TypeError(`expected value of type "object" but instead got value "${P}" of type "${N1(R)}"`);return R},string(P){return P}},_0={default:A0,array:g0,object:g0};function g0(P){return JSON.stringify(P)}function A0(P){return`${P}`}function I0(P,R){let x=C0(R);if(!x)throw TypeError(`[radiant-element] Unknown type "${R}"`);return M1[x](P)}function N0(P,R){let x=C0(R);if(!x)throw TypeError(`[radiant-element] Unknown type "${R}"`);return(_0[x]??_0.default??A0)(P)}function O1(P){return typeof P==="boolean"}function z1(P){return typeof P==="number"}function S1(P){return typeof P==="string"}function b1(P){return Array.isArray(P)}function h1(P){return typeof P==="object"&&!Array.isArray(P)&&P!==null}function OP(P,R){switch(P){case Boolean:return O1(R);case Number:return z1(R);case String:return S1(R);case Array:return b1(R);case Object:return h1(R);default:return!1}}var zP=(P,R,x,F)=>{if(R===Boolean){let q=P.getAttribute(x);if(q===null)return F;return q===""?!0:I0(q,R)}let $=P.getAttribute(x);return $!==null?I0($,R):F??V1(R)};import{getActiveSsrScopeValue as y1,withActiveSsrScopeValue as v1}from"@ecopages/jsx/server";var V0=Symbol.for("@ecopages/radiant.element-ssr-runtime");function hP(){return y1(V0)}function D(P,R){return v1(V0,P,R)}var k0=Symbol.for("@ecopages/radiant.controllerIdentifier");function x0(P,R){P[k0]=R}function M0(P){return P[k0]}var G="data-controller",O0=Symbol.for("@ecopages/radiant.controller-registry-state");function u1(){let P=globalThis,R=P[O0];if(R)return R;let x={activeRuntimes:new Set,controllerRegistrationStrategy:"keep-current",controllerRegistry:new Map};return P[O0]=x,x}var v=u1(),E=v.controllerRegistry,f=v.activeRuntimes;function z0(P){let R=P.getAttribute(G);if(!R)return[];return R.split(/\s+/).map((x)=>x.trim()).filter((x)=>x.length>0)}function y(P,R){if(P instanceof Element&&P.hasAttribute(G))R(P);for(let x of Array.from(P.querySelectorAll(`[${G}]`)))R(x)}class S0{root;controllersByElement=new Map;observer;stopped=!1;constructor(P=document){this.root=P;this.start()}stop(){if(this.stopped)return;this.stopped=!0,this.observer?.disconnect(),this.observer=void 0;for(let[P,R]of this.controllersByElement)for(let[x]of R)this.disconnectController(P,x);f.delete(this)}reconcileRegisteredController(P){y(this.root,(R)=>{if(!z0(R).includes(P))return;this.connectController(R,P)})}replaceRegisteredController(P){for(let[R,x]of Array.from(this.controllersByElement.entries())){if(!x.has(P))continue;this.disconnectController(R,P)}this.reconcileRegisteredController(P)}start(){if(y(this.root,(R)=>{this.reconcileElement(R)}),typeof MutationObserver>"u"){f.add(this);return}this.observer=new MutationObserver((R)=>{for(let x of R){if(x.type==="attributes"&&x.target instanceof Element){this.reconcileElement(x.target);continue}for(let F of Array.from(x.removedNodes)){if(!(F instanceof Element))continue;y(F,($)=>{this.disconnectElementControllers($)})}for(let F of Array.from(x.addedNodes)){if(!(F instanceof Element))continue;y(F,($)=>{this.reconcileElement($)})}}});let P=this.root instanceof Document?this.root.documentElement:this.root;this.observer.observe(P,{attributeFilter:[G],attributes:!0,childList:!0,subtree:!0}),f.add(this)}reconcileElement(P){let R=new Set(z0(P)),x=this.controllersByElement.get(P);if(x){for(let F of x.keys())if(!R.has(F))this.disconnectController(P,F)}for(let F of R)this.connectController(P,F)}connectController(P,R){let x=E.get(R);if(!x)return;let F=this.controllersByElement.get(P);if(!F)F=new Map,this.controllersByElement.set(P,F);if(F.has(R))return;let $=new x(P);F.set(R,$),$.connect()}disconnectController(P,R){let x=this.controllersByElement.get(P);if(!x)return;let F=x.get(R);if(!F)return;if(F.disconnect(),x.delete(R),x.size===0)this.controllersByElement.delete(P)}disconnectElementControllers(P){let R=this.controllersByElement.get(P);if(!R)return;for(let x of Array.from(R.keys()))this.disconnectController(P,x)}}function c1(P,R){let x=E.get(P);if(x)return x;x0(R,P),E.set(P,R);for(let F of Array.from(f))F.reconcileRegisteredController(P);return R}function cP(P){return E.has(P)}function dP(P){return E.get(P)}function d1(P,R){if(E.get(P)===R)return R;x0(R,P),E.set(P,R);for(let F of Array.from(f))F.replaceRegisteredController(P);return R}function b0(P){v.controllerRegistrationStrategy=P}function sP(){b0("replace")}function mP(){b0("keep-current")}function pP(P,R){if(v.controllerRegistrationStrategy==="replace")return d1(P,R);return c1(P,R)}function aP(P=document){return new S0(P)}function iP(){for(let P of Array.from(f))P.stop()}var h0=Symbol.for("@ecopages/radiant.customElementTagName");function rP(P,R){P[h0]=R}function u(P){return P[h0]}function y0(P){let R=globalThis.CSS;if(typeof R?.escape==="function")return R.escape(P);let x="";for(let F=0;F<P.length;F+=1){let $=P[F]??"",q=$.codePointAt(0)??0;if(q===0){x+="�";continue}let Q=q>=1&&q<=31||q===127,H=F===0&&q>=48&&q<=57,U=F===1&&q>=48&&q<=57&&(P[0]??"")==="-",j=F===0&&$==="-"&&P.length===1;if(Q||H||U){x+=`\\${q.toString(16)} `;continue}if(q>=128||$==="-"||$==="_"||q>=48&&q<=57||q>=65&&q<=90||q>=97&&q<=122){x+=j?`\\${$}`:$;continue}x+=`\\${$}`}return x}function v0(P){let R={},x=new Set;return m1(P,R,x),p1(P,R,x),a1(P,R),R}function u0(P){return Object.entries(P).map(([R,x])=>` ${R}="${L(x)}"`).join("")}function m1(P,R,x){for(let F of P.getReactiveProperties()){let $=P.getPropertyValue(F.name);if($===void 0||$===null||$===!1)continue;R[F.attribute]=String(F.converter.toAttribute($)),x.add(F.attribute)}}function p1(P,R,x){for(let F of P.getReactivePropDefinitions()){let $=F.options.attribute??F.name;if(x.has($))continue;let q=P.getPropertyValue(F.name);if(q===void 0||q===null||q===!1)continue;R[$]=String(N0(q,F.options.type)),x.add($)}}function a1(P,R){for(let x of P.getAttributeNames()){let F=P.getAttribute(x);if(F!==null)R[x]=F}}var c0=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function d0(){return globalThis}function s0(P){d0()[c0]=P}function xR(P){return d0()[c0]?.(P)}var A;function p0(){if(A!==void 0)return A;try{let{AsyncLocalStorage:P}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return A=new P,A}catch{return A=null,null}}var m0=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function a0(){let P=globalThis;return P[m0]??=[],P[m0]}function _(P){if(P.length===0)return()=>{return};let R=new Map;for(let $ of P)R.set($.getContextKey(),$);let x=p0();if(x){let $=x.getStore()??[],q=[...$,R];return x.enterWith(q),()=>{x.enterWith($)}}let F=a0();return F.push(R),()=>{let $=F.lastIndexOf(R);if($>=0)F.splice($,1)}}function i0(P){let R=p0()?.getStore()??a0();for(let x=R.length-1;x>=0;x-=1){let F=R[x]?.get(P);if(F)return F}return}function qR(P){let R=i0(P);if(!R)return;return R.getContext()}s0((P)=>i0(P));function l0(P,R){if(!R)return`${P.hostContent}${P.authoredHydrationMarkup}${P.slotProjectionScript}`;return`${P.hostContent}${P.slotProjectionScript}${P.hydrationScripts}`}function g(P){if(i1(P))return P;return}function i1(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 r0(P){let R=g(P);if(!R)throw Error("Radiant SSR runtime requires a server extraction host shape on the component.");return{constructor:R.constructor,getAttribute:(x)=>R.getAttribute(x),getAttributeNames:()=>R.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>R.getAuthoredHydrationScriptMarkup?.(),getContextProviders:()=>R.getContextProviders(),getHydrationBindings:()=>R.getHydrationBindings(),getReactiveProperties:()=>R.getReactiveProperties(),getReactivePropDefinitions:()=>Y0(P),getPropertyValue:(x)=>Reflect.get(P,x),getSlotProjectionScriptTag:()=>R.getSlotProjectionScriptTag?.(),resolveTrackedRenderOutput:()=>R.resolveTrackedRenderOutput(),renderViewToString:(x)=>R.renderViewToString(x)}}class F0{component;host;constructor(P){this.component=P,this.host=r0(P)}ensureReady(){w(this.component,"ssr")}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(P={},R=this.getHostAttributes()){this.ensureReady();let x=this.getTagName(),F=_(this.host.getContextProviders());try{return`<${x}${u0(R)}>${this.renderHostContent(P)}</${x}>`}finally{F()}}getHostAttributes(){return this.ensureReady(),v0(this.host)}renderHostContent(P){let R=P.mode==="hydrate"||P.mode===void 0&&P.hydrate===!0,x=R?this.host.getHydrationBindings().map((F)=>F.renderHydrationScriptTag()).filter((F)=>typeof F==="string").join(""):"";return l0({hostContent:this.host.renderViewToString(P),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:x},R)}getTagName(){let P=u(this.host.constructor);if(!P)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return P}}import{renderToString as l1}from"@ecopages/jsx/server";import{createServerHydrationBindingState as n0,isServerRenderHydrationActive as o0,withForcedServerCustomElementRendering as r1,withServerCustomElementRenderHook as n1,withServerHydrationBindingState as t0}from"@ecopages/jsx/server";var c;function $0(P){return new F0(P)}function N(P){return{nodeType:1,outerHTML:T(P,{mode:"hydrate"})}}function q0(P){if(V(P))return N(P);if(!s(P))return;return P.renderHost?.()??{nodeType:1,outerHTML:P.renderHostToString({mode:"hydrate"})}}function T(P,R={}){return Z0(()=>$0(P).renderHostToString(R,W0(P)))}function H0(P,R={}){if(V(P))return T(P,R);if(!s(P))return;return P.renderHostToString(R)}function Q0(P,R){if(V(P))return N(P);if(!s(P))return;return P.renderHost?.()??{nodeType:1,outerHTML:R}}function e0(P,R={}){return Z0(()=>d(()=>l1(R1(P).value,R)))}function W0(P){return $0(P).getHostAttributes()}function P1(P){if(!V(P))return;return{renderHost:()=>N(P),renderHostToString:(R)=>T(P,R)}}function o1(P){return g(P)}function d(P){return r1(()=>n1(({instance:R})=>{if(V(R))return{nodeType:1,get outerHTML(){let F=o0(),$={hydrate:F,mode:F?"hydrate":"plain"};if(!F)return T(R,$);return t0(n0(),()=>T(R,$))}};if(!s(R))return;let x=R;return{nodeType:1,get outerHTML(){let F=o0();if(!F)return x.renderHostToString({hydrate:F,mode:F?"hydrate":"plain"});return t0(n0(),()=>x.renderHostToString({hydrate:F,mode:F?"hydrate":"plain"}))}}},P))}function R1(P){if(t1(P))return P.resolveTrackedRenderOutput();let R=g(P);if(!R)throw Error("Radiant SSR runtime requires tracked render output support on the component.");return R.resolveTrackedRenderOutput()}function V(P){if(typeof P!=="object"||P===null)return!1;return g(P)!==void 0}function s(P){if(typeof P!=="object"||P===null)return!1;return typeof P.renderHostToString==="function"}function t1(P){if(typeof P!=="object"||P===null)return!1;return typeof P.resolveTrackedRenderOutput==="function"}function I(){if(c)return c;return c={getHostAttributes:W0,renderHost:N,renderHostToString:T,resolveRenderBridge:P1,renderView:e0},c}function Z0(P){return D(I(),P)}a();class i extends W{constructor(){super(W.DOCUMENT_NODE)}createElement(P){return P.toLowerCase()==="script"?new X(this):new J(P,this)}createTextNode(P){return new B(P,this)}querySelector(){return null}querySelectorAll(){return[]}}class J0{definitions=new Map;define(P,R){if(this.definitions.has(P))return;this.definitions.set(P,R)}get(P){return this.definitions.get(P)}}a();var z,U0={escape(P){return y0(String(P))}};function J1(){let P=globalThis,R=P.customElements;if(typeof P.Node>"u"||typeof P.Document>"u"||typeof P.Element>"u"||typeof P.HTMLElement>"u"||typeof P.document>"u"||!R||typeof R.define!=="function"||typeof R.get!=="function")return;return P.window??{CSS:P.CSS??U0,CustomEvent:P.CustomEvent??p,Document:P.Document,Element:P.Element,Event:P.Event??O,EventTarget:P.EventTarget??EventTarget,HTMLScriptElement:P.HTMLScriptElement??P.HTMLElement,HTMLElement:P.HTMLElement,Node:P.Node,document:P.document,customElements:R}}function l(){let P=J1();if(P)return P;return U1()}function X0(){return l(),{prepareHost(P,R={}){if(R.authoredContent!==void 0)P.innerHTML=R.authoredContent}}}function U1(){let P=J1();if(P)return P;if(z)return z;let R=new J0,x=new i,F=globalThis.Event??O,$=globalThis.CustomEvent??p,q=i,Q=globalThis.EventTarget??EventTarget;return z={CSS:globalThis.CSS??U0,CustomEvent:$,Document:q,Element:M,Event:F,EventTarget:Q,HTMLScriptElement:X,HTMLElement:J,Node:W,document:x,customElements:R},Object.assign(globalThis,{CSS:globalThis.CSS??U0,CustomEvent:$,Document:q,Element:M,Event:F,EventTarget:Q,HTMLScriptElement:X,HTMLElement:J,Node:W,document:x,customElements:R,window:z}),z}function S(){return new Date}function b(P){if("metadata"in P)return{assets:P.metadata.assets,clientModuleSrc:P.metadata.clientModuleUrl,generatedAt:P.metadata.generatedAt,markup:P.markup,tagName:P.metadata.tagName};let{preview:R,...x}=P;return x}function h(P){return{assets:P.metadata.assets,clientModuleSrc:P.metadata.clientModuleUrl,generatedAt:P.metadata.generatedAt,markup:P.markup,preview:P.preview,tagName:P.metadata.tagName}}function QP(P,R="hydrate"){return{kind:"script-module",src:P,stage:R}}function nR(P){return{kind:"modulepreload",href:P}}function oR(P,R){return R?{kind:"style",href:P,media:R}:{kind:"style",href:P}}async function tR(P,R){return(await r(n(P,R))).markup}async function eR(P,R){return r(n(P,R))}async function Px(P,R){return b(await r(n(P,R)))}async function Rx(P,R){return h(await r(n(P,R)))}async function r(P){return D(I(),async()=>{let R=P.environment??X0(),x=_(JP(P.ssrContext));try{let F="component"in P?P.component:await P.load(),$=new F;w($,"ssr"),ZP(R,$,P.authoredContent,P.prepareHost),P.initialize?.($);let q=P.clientModuleSrc??await P.resolveClientModuleSrc?.(F),Q=P.assets??await P.resolveAssets?.(F)??[],H=j0(Q,q),U=G0(H)??q,j=P.tagName??GP(F),K=(P.now??S)().toISOString(),C=E0(P.renderOptions),T0=H0($,C)??jP($,C),E1=WP($,T0);return{markup:T0,metadata:{assets:H,clientModuleUrl:U,generatedAt:K,tagName:j},preview:E1}}finally{x()}})}function WP(P,R){return Q0(P,R)??q0(P)??P.renderHost?.()??{nodeType:1,outerHTML:R}}function ZP(P,R,x,F){if(!XP(R)){if(x===void 0&&F===void 0)return;throw Error(`${R.constructor.name} cannot prepare SSR host content because it does not expose an innerHTML host surface.`)}P.prepareHost(R,{authoredContent:x}),F?.(R,P)}function JP(P){if(!P||P.length===0)return[];return P.map((R)=>({getContext:()=>R.value,getContextKey:()=>R.context,renderHydrationScript:()=>{return},renderHydrationScriptTag:()=>{return}}))}function UP(P){if(!P)return[];return[QP(P)]}function j0(P,R){if(!R)return P;if(P.some((x)=>x.kind==="script-module"&&x.src===R))return P;return[...UP(R),...P]}function G0(P){return P.find((R)=>R.kind==="script-module")?.src}function n(P,R){if(typeof P==="function")return{...R,component:P};return P}function E0(P){if(P?.mode!==void 0||P?.hydrate!==void 0)return P;return{...P,mode:"hydrate"}}function XP(P){return"innerHTML"in P}function jP(P,R){if(typeof P.renderHostToString==="function")return P.renderHostToString(R);throw Error(`${P.constructor.name} cannot be server-rendered without a registered Radiant SSR host or renderHostToString().`)}function GP(P){let R=u(P);if(!R)throw Error(`${P.name} is missing @customElement metadata.`);return R}import{renderToString as EP}from"@ecopages/jsx/server";async function Ex(P,R){return(await o(P,R)).markup}async function Tx(P,R){return o(P,R)}async function Bx(P,R){return b(await o(P,R))}async function Yx(P,R){return h(await o(P,R))}async function o(P,R){return D(I(),async()=>{let x=TP(R.tagName),F=BP(x,YP(P,R)),$=new P(F);w($,"ssr");try{R.initialize?.($),$.runWithSsrLifecycle(()=>$.connect());let q=R.clientModuleSrc??await R.resolveClientModuleSrc?.(P),Q=R.assets??await R.resolveAssets?.(P)??[],H=j0(Q,q),U=G0(H)??q,j=(R.now??S)().toISOString(),K=E0(R.renderOptions),C=fP($,x,K);return{markup:C,metadata:{assets:H,clientModuleUrl:U,generatedAt:j,tagName:x},preview:{nodeType:1,outerHTML:C}}}finally{$.disconnect()}})}function TP(P){let R=P.trim().toLowerCase();if(!R)throw Error("Controller SSR host tagName is required.");return R}function BP(P,R){let F=l().document.createElement(P);for(let[$,q]of Object.entries(R)){if(q===void 0||q===null||q===!1)continue;F.setAttribute($,q===!0?"":String(q))}return F}function YP(P,R){let x={},F=R.host,$=wP(R.attributes?.class,F?.class,F?.classes);if($!==void 0)x.class=$;X1(x,"data",F?.data),X1(x,"aria",F?.aria),KP(x,R.attributes);let q=M0(P);if(q&&x[G]==null)x[G]=q;return x}function X1(P,R,x){if(!G1(x))return;for(let[F,$]of Object.entries(x))P[`${R}-${DP(F)}`]=$}function KP(P,R){if(!R)return;for(let[x,F]of Object.entries(R))P[x]=F}function wP(...P){let R=[];for(let x of P)j1(R,x);return R.length===0?void 0:R.join(" ")}function j1(P,R){if(R===void 0||R===null||R===!1||R===!0)return;if(typeof R==="string"){if(R!=="")P.push(R);return}if(typeof R==="number"||typeof R==="bigint"){P.push(String(R));return}if(Array.isArray(R)){for(let x of R)j1(P,x);return}if(!G1(R))return;for(let[x,F]of Object.entries(R))if(F)P.push(x)}function G1(P){return Object.prototype.toString.call(P)==="[object Object]"}function DP(P){return P.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function fP(P,R,x){let F=_(P.getSsrContextProviders());try{let $=d(()=>EP(P.render(),x)),Q=x.mode==="hydrate"||x.mode===void 0&&x.hydrate===!0?P.getSsrHydrationBindings().map((H)=>H.renderHydrationScriptTag()).filter((H)=>typeof H==="string").join(""):"";return`<${R}${LP(P.host)}>${$}${Q}</${R}>`}finally{F()}}function LP(P){return P.getAttributeNames().map((R)=>_P(R,P.getAttribute(R))).join("")}function _P(P,R){if(R==="")return` ${P}`;return` ${P}="${L(R??"")}"`}export{Yx as renderControllerWithPreview,Ex as renderControllerToString,Bx as renderControllerToPayload,Tx as renderController};
|
|
1
|
+
function s0(F){switch(F){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}var B0={default:P0,array:U0,object:U0};function U0(F){return JSON.stringify(F)}function P0(F){return`${F}`}function Y0(F,H){let x=s0(H);if(!x)throw TypeError(`[radiant-element] Unknown type "${H}"`);return(B0[x]??B0.default??P0)(F)}function f(F){return F.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function T0(F){let H={},x=new Set;return l0(F,H,x),a0(F,H,x),i0(F,H),H}function E0(F){return Object.entries(F).map(([H,x])=>` ${H}="${f(x)}"`).join("")}function l0(F,H,x){for(let $ of F.getReactiveProperties()){let q=F.getPropertyValue($.name);if(q===void 0||q===null||q===!1)continue;H[$.attribute]=String($.converter.toAttribute(q)),x.add($.attribute)}}function a0(F,H,x){for(let $ of F.getReactivePropDefinitions()){let q=$.options.attribute??$.name;if(x.has(q))continue;let Q=F.getPropertyValue($.name);if(Q===void 0||Q===null||Q===!1)continue;H[q]=String(Y0(Q,$.options.type)),x.add(q)}}function i0(F,H){for(let x of F.getAttributeNames()){let $=F.getAttribute(x);if($!==null)H[x]=$}}import{getActiveSsrScopeValue as i,withActiveSsrScopeValue as f0}from"@ecopages/jsx/server";var r0;function K0(F){r0=F}var I=Symbol.for("@ecopages/radiant.ssr-provider-stack");function L(F){if(i(I)!==void 0)return F();return f0(I,[],F)}function R(F,H){if(F.length===0)return H();let x=i(I);if(x===void 0)throw Error("SSR context providers require runWithSsrProviderStack(...). Wrap the sync render snapshot at the render boundary.");let $=new Map;for(let q of F)$.set(q.getContextKey(),q);return f0(I,[...x,$],H)}function L0(F){let H=i(I);if(!H)return;for(let x=H.length-1;x>=0;x-=1){let $=H[x]?.get(F);if($)return $}return}function r1(F){let H=L0(F);if(!H)return;return H.getContext()}K0((F)=>L0(F));function R0(F,H){if(!H)return`${F.hostContent}${F.authoredHydrationMarkup}${F.slotProjectionScript}`;return`${F.hostContent}${F.slotProjectionScript}${F.hydrationScripts}`}function z(F){if(F.renderRootMode!=="shadow")return;let H=typeof F.constructor==="function"&&F.constructor.name?F.constructor.name:"RadiantElement";throw Error(`${H} uses renderRootMode "shadow". Radiant SSR is light-DOM only; keep renderRootMode "light" for server rendering, or skip SSR for this host.`)}var n0=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function w0(F){return(F.constructor[n0]??[]).slice()}var D0=Symbol.for("@ecopages/radiant.RadiantElement");function P(F){return typeof F==="object"&&F!==null&&D0 in F}function g0(F){if(!P(F))throw Error("Radiant SSR runtime requires a RadiantElement host. Import a Radiant server SSR entrypoint and pass a RadiantElement instance.");return{constructor:F.constructor,renderRootMode:F.renderRootMode,getAttribute:(H)=>F.getAttribute(H),getAttributeNames:()=>F.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>F.getAuthoredHydrationScriptMarkup(),getContextProviders:()=>F.getContextProviders(),getHydrationBindings:()=>F.getHydrationBindings(),getReactiveProperties:()=>F.getReactiveProperties(),getReactivePropDefinitions:()=>w0(F),getPropertyValue:(H)=>Reflect.get(F,H),getSlotProjectionScriptTag:()=>F.getSlotProjectionScriptTag(),resolveTrackedRenderOutput:()=>F.resolveTrackedRenderOutput()}}var o0=Symbol.for("@ecopages/radiant.customElementTagName");function y(F){return F[o0]}var t0=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),_0=Symbol.for("@ecopages/radiant.ssr-preparation-running");function I0(F){let H=F,x=H[t0];if(!Array.isArray(x))return;H[_0]=!0;try{for(let $ of x)$()}finally{delete H[_0]}}var e0=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),F1=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),H1=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function C0(F){x1(F,e0)}function r(F,H){let x=F;$1(F,H,x[H1]??=new Set)}function x1(F,H){q1(F,(x)=>{let $=x[H];if(!Array.isArray($))return;for(let q of $)q(F)})}function $1(F,H,x){for(let $ of M0(F)){let q=$[F1];if(!Array.isArray(q))continue;for(let Q of q){if(x.has(Q))continue;Q(F,H),x.add(Q)}}}function M0(F){let H=[],x=Object.getPrototypeOf(F);while(x&&x!==Object.prototype)H.unshift(x),x=Object.getPrototypeOf(x);return H}function q1(F,H){for(let x of M0(F))H(x)}function w(F,H){switch(H){case"construct":C0(F);break;case"connect":r(F,"connect");break;case"ssr":r(F,"ssr");break}}class n{component;host;renderView;constructor(F,H){this.component=F,this.host=g0(F),this.renderView=H}ensureReady(){z(this.host),w(this.component,"ssr"),I0(this.component)}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(F={},H=this.getHostAttributes()){this.ensureReady();let x=this.getTagName();return R(this.host.getContextProviders(),()=>`<${x}${E0(H)}>${this.renderHostContent(F)}</${x}>`)}getHostAttributes(){return this.ensureReady(),T0(this.host)}renderHostContent(F){let H=F.mode==="hydrate"||F.mode===void 0&&F.hydrate===!0,x=H?this.host.getHydrationBindings().map(($)=>$.renderHydrationScriptTag()).filter(($)=>typeof $==="string").join(""):"";return R0({hostContent:this.renderView(this.host,F),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:x},H)}getTagName(){let F=y(this.host.constructor);if(!F)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return F}}import{getActiveSsrScopeValue as Q1,withActiveSsrScopeValue as W1}from"@ecopages/jsx/server";var V0=Symbol.for("@ecopages/radiant.element-ssr-runtime"),S;function N0(F){S=F}function D(F,H){if(!S)throw Error("Radiant element SSR runtime requires the server scope adapters. Import a Radiant server SSR entrypoint before rendering.");if(S.get(V0)===F)return H();return S.withValue(V0,F,H)}N0({get:Q1,withValue:W1});function Y(F){return`data-${F.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function o(F){return F.replace(/-([a-z])/g,(H,x)=>x.toUpperCase())}var t;function O0(F){t=F}function e(){if(!t)throw Error("Minimal DOM HTML parsers are not registered. Import @ecopages/radiant/server/install-ssr-runtime (or ./html) before using innerHTML.");return t}class J extends EventTarget{nodeType;static DOCUMENT_NODE=9;static ELEMENT_NODE=1;static TEXT_NODE=3;childNodes=[];ownerDocument;parentNode=null;constructor(F,H=null){super();this.nodeType=F;this.ownerDocument=H}append(...F){for(let H of F)this.appendChild(typeof H==="string"?Z1(H):H)}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===J.DOCUMENT_NODE?this:this.ownerDocument,F.parentNode=this,F}removeChild(F){let H=this.childNodes.indexOf(F);if(H===-1)return F;return this.childNodes.splice(H,1),F.parentNode=null,F}replaceChildren(...F){for(let H of this.childNodes)H.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 T extends J{value;constructor(F,H=E()){super(J.TEXT_NODE,H);this.value=F}get textContent(){return this.value}set textContent(F){this.value=F??""}}class k0{element;constructor(F){this.element=F}add(...F){let H=new Set(this.readTokens());for(let x of F)if(x!=="")H.add(x);this.writeTokens([...H])}remove(...F){let H=new Set(this.readTokens());for(let x of F)H.delete(x);this.writeTokens([...H])}toggle(F,H){let x=this.contains(F);if(H??!x)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 C extends J{attributes=new Map;classListValue;datasetValue;fragmentHtml;fragmentText;localName;tagName;constructor(F="div",H=E()){super(J.ELEMENT_NODE,H);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 k0(this),this.classListValue}get dataset(){return this.datasetValue??=new Proxy({},{deleteProperty:(F,H)=>{if(typeof H!=="string")return!1;return this.removeAttribute(Y(H)),!0},get:(F,H)=>{if(typeof H!=="string")return;return this.getAttribute(Y(H))??void 0},getOwnPropertyDescriptor:(F,H)=>{if(typeof H!=="string")return;return{configurable:!0,enumerable:!0,value:this.getAttribute(Y(H))??void 0,writable:!0}},has:(F,H)=>{return typeof H==="string"&&this.hasAttribute(Y(H))},ownKeys:()=>{return this.getAttributeNames().filter((F)=>F.startsWith("data-")).map((F)=>o(F.slice(5)))},set:(F,H,x)=>{if(typeof H!=="string")return!1;return this.setAttribute(Y(H),String(x)),!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,H){this.fragmentHtml=void 0,this.attributes.set(F,String(H))}toggleAttribute(F,H){if(H??!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(([H,x])=>` ${H}="${f(x)}"`).join("");return`<${this.localName}${F}>${this.innerHTML}</${this.localName}>`}get innerHTML(){return this.childNodes.map((F)=>e().serializeNodeHtml(F)).join("")}set innerHTML(F){this.fragmentHtml=void 0,this.fragmentText=void 0,this.replaceChildren(...e().parseHtmlToNodes(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,H,x){this.fragmentHtml=F,this.fragmentText=H,this.attributes=new Map(Object.entries(x)),this.replaceChildren()}}class M{bubbles;cancelable;composed;type;constructor(F,H={}){this.type=F,this.bubbles=H.bubbles??!1,this.cancelable=H.cancelable??!1,this.composed=H.composed??!1}}class b extends M{detail;constructor(F,H={}){super(F,H);this.detail=H.detail}}class j extends C{isConnected=!1;constructor(F="div",H=E()){super(F,H)}insertAdjacentHTML(F,H){this.append(...e().parseHtmlToNodes(H,this.ownerDocument))}}class B extends j{constructor(F=E()){super("script",F)}}function Z1(F){return new T(F,E())}function E(){return globalThis.document??null}class h extends J{constructor(){super(J.DOCUMENT_NODE)}createElement(F){return F.toLowerCase()==="script"?new B(this):new j(F,this)}createTextNode(F){return new T(F,this)}querySelector(){return null}querySelectorAll(){return[]}}class F0{definitions=new Map;define(F,H){if(this.definitions.has(F))return;this.definitions.set(F,H)}get(F){return this.definitions.get(F)}}var v=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function A0(F){let H=[],x=0;while(x<F.length){let $=x;if(F.startsWith("<!--",x)){let W=F.indexOf("-->",x+4);x=W===-1?F.length:W+3,H.push(F.slice($,x));continue}if(F[x]!=="<"){let W=F.indexOf("<",x);x=W===-1?F.length:W,H.push(F.slice($,x));continue}let q=V(F,x);if(!q){H.push(F.slice($));break}if(q.type!=="open"||q.selfClosing||v.has(q.tagName)){x=q.end,H.push(F.slice($,x));continue}x=q.end;let Q=1;while(x<F.length&&Q>0){let W=F.indexOf("<",x);if(W===-1){x=F.length;break}let Z=V(F,W);if(!Z){x=F.length;break}if(x=Z.end,Z.type==="comment"||Z.type==="declaration")continue;if(Z.type==="open"&&!Z.selfClosing&&!v.has(Z.tagName)){Q+=1;continue}if(Z.type==="close")Q-=1}H.push(F.slice($,x))}return H.filter(($)=>$!=="")}function X1(F,H){let x;for(let $=H+1;$<F.length;$+=1){let q=F[$];if(x){if(q===x)x=void 0;continue}if(q==='"'||q==="'"){x=q;continue}if(q===">")return $+1}return F.length}function J1(F){let H={},x=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let $ of F.matchAll(x)){let[,q,Q,W,Z]=$;if(!q)continue;H[q]=Q??W??Z??""}return H}function V(F,H){if(F.startsWith("<!--",H)){let X=F.indexOf("-->",H+4);return{end:X===-1?F.length:X+3,type:"comment"}}let x=X1(F,H),$=F.slice(H+1,x-1).trim();if($==="")return;if($.startsWith("!")||$.startsWith("?"))return{end:x,type:"declaration"};if($.startsWith("/"))return{end:x,type:"close"};let q=/\/\s*$/.test($),Q=q?$.replace(/\/\s*$/,"").trim():$,W=Q.split(/[\s/>]/,1)[0]?.toLowerCase()??"",Z=W.length,G=Q.slice(Z).trim(),U=q||v.has(W)?"":j1(F,H,x,W);return{attributes:J1(G),end:x,innerHtml:U,selfClosing:q,tagName:W,type:"open"}}function j1(F,H,x,$){let q=x,Q=1;while(q<F.length&&Q>0){let W=F.indexOf("<",q);if(W===-1)return F.slice(x);let Z=V(F,W);if(!Z)return F.slice(x);if(Z.type==="open"&&Z.tagName===$&&!Z.selfClosing&&!v.has($))Q+=1;if(Z.type==="close"){if(F.slice(W+2,Z.end-1).trim().toLowerCase()===$){if(Q-=1,Q===0)return F.slice(x,W)}}q=Z.end}return F.slice(x)}function G1(F,H,x){let $=H.tagName==="script"?new B(x):new j(H.tagName,x);return $.setSerializedFragment(F,B1(H.innerHtml),H.attributes),$}function B1(F){return F.replace(/<!--.*?-->/gs,"").replace(/<[^>]+>/g,"")}function U1(F,H=E()){return A0(F).map((x)=>{if(!x.startsWith("<"))return new T(x,H);let $=V(x,0);if(!$||$.type!=="open")return new T(x,H);return G1(x,$,H)})}function P1(F){if(F.nodeType===J.TEXT_NODE)return F.textContent??"";return"outerHTML"in F&&typeof F.outerHTML==="string"?F.outerHTML:F.textContent??""}O0({parseHtmlToNodes:U1,serializeNodeHtml:P1});function z0(F){let H=globalThis.CSS;if(typeof H?.escape==="function")return H.escape(F);let x="";for(let $=0;$<F.length;$+=1){let q=F[$]??"",Q=q.codePointAt(0)??0;if(Q===0){x+="�";continue}let W=Q>=1&&Q<=31||Q===127,Z=$===0&&Q>=48&&Q<=57,G=$===1&&Q>=48&&Q<=57&&(F[0]??"")==="-",U=$===0&&q==="-"&&F.length===1;if(W||Z||G){x+=`\\${Q.toString(16)} `;continue}if(Q>=128||q==="-"||q==="_"||Q>=48&&Q<=57||Q>=65&&Q<=90||Q>=97&&Q<=122){x+=U?`\\${q}`:q;continue}x+=`\\${q}`}return x}var N,H0={escape(F){return z0(String(F))}};function y0(){let F=globalThis,H=F.customElements;if(typeof F.Node>"u"||typeof F.Document>"u"||typeof F.Element>"u"||typeof F.HTMLElement>"u"||typeof F.document>"u"||!H||typeof H.define!=="function"||typeof H.get!=="function")return;return F.window??{CSS:F.CSS??H0,CustomEvent:F.CustomEvent??b,Document:F.Document,Element:F.Element,Event:F.Event??M,EventTarget:F.EventTarget??EventTarget,HTMLScriptElement:F.HTMLScriptElement??F.HTMLElement,HTMLElement:F.HTMLElement,Node:F.Node,document:F.document,customElements:H}}function c(){let F=y0();if(F)return F;return u()}function x0(){return c(),{prepareHost(F,H={}){if(H.authoredContent!==void 0)F.innerHTML=H.authoredContent}}}function u(){let F=y0();if(F)return F;if(N)return N;let H=new F0,x=new h,$=globalThis.Event??M,q=globalThis.CustomEvent??b,Q=h,W=globalThis.EventTarget??EventTarget;return N={CSS:globalThis.CSS??H0,CustomEvent:q,Document:Q,Element:C,Event:$,EventTarget:W,HTMLScriptElement:B,HTMLElement:j,Node:J,document:x,customElements:H},Object.assign(globalThis,{CSS:globalThis.CSS??H0,CustomEvent:q,Document:Q,Element:C,Event:$,EventTarget:W,HTMLScriptElement:B,HTMLElement:j,Node:J,document:x,customElements:H,window:N}),N}u();var mF=!0;var sF=!0;import{renderToString as Y1}from"@ecopages/jsx/server";import{createServerHydrationBindingState as T1,isServerRenderHydrationActive as E1,withServerCustomElementRenderHook as K1,withServerHydrationBindingState as f1}from"@ecopages/jsx/server";var d;function $0(F){return new n(F,W0)}function K(F,H={}){return Z0(()=>{let x=$0(F);return x.renderHostToString(H,x.getHostAttributes())})}function m(F){return{nodeType:1,outerHTML:K(F,{mode:"hydrate"})}}function q0(F){if(!P(F))return;return m(F)}function Q0(F,H={}){if(!P(F))return;return K(F,H)}function W0(F,H={}){return z(F),Z0(()=>p(()=>Y1(F.resolveTrackedRenderOutput().value,H)))}function S0(F){return $0(F).getHostAttributes()}function b0(F){if(!P(F))return;return{renderHost:()=>m(F),renderHostToString:(H)=>K(F,H)}}function p(F){return K1(({instance:H})=>{if(!P(H))return;return{nodeType:1,get outerHTML(){return L1(H)}}},F)}function L1(F){let H=E1(),x={hydrate:H,mode:H?"hydrate":"plain"};if(!H)return K(F,x);return f1(T1(),()=>K(F,x))}function g(){if(d)return d;return d={getHostAttributes:S0,renderHost:m,renderHostToString:K,resolveRenderBridge:b0,renderView:W0},d}function Z0(F){return D(g(),()=>L(F))}function O(){return new Date}function k(F){if("metadata"in F)return{assets:F.metadata.assets,clientModuleSrc:F.metadata.clientModuleUrl,generatedAt:F.metadata.generatedAt,markup:F.markup,tagName:F.metadata.tagName};let{preview:H,...x}=F;return x}function A(F){return{assets:F.metadata.assets,clientModuleSrc:F.metadata.clientModuleUrl,generatedAt:F.metadata.generatedAt,markup:F.markup,preview:F.preview,tagName:F.metadata.tagName}}function R1(F,H="hydrate"){return{kind:"script-module",src:F,stage:H}}function BH(F){return{kind:"modulepreload",href:F}}function UH(F,H){return H?{kind:"style",href:F,media:H}:{kind:"style",href:F}}async function PH(F,H){return(await s(l(F,H))).markup}async function YH(F,H){return s(l(F,H))}async function TH(F,H){return k(await s(l(F,H)))}async function EH(F,H){return A(await s(l(F,H)))}async function s(F){let H=F.environment??x0(),x="component"in F?F.component:await F.load(),$=F.clientModuleSrc??await F.resolveClientModuleSrc?.(x),q=F.assets??await F.resolveAssets?.(x)??[],Q=X0(q,$),W=J0(Q)??$,Z=F.tagName??M1(x),G=(F.now??O)().toISOString(),U=j0(F.renderOptions);return D(g(),()=>L(()=>R(g1(F.ssrContext),()=>{let X=new x;w(X,"ssr"),D1(H,X,F.authoredContent,F.prepareHost),F.initialize?.(X);let _=C1(X,U),p0=w1(X,_);return{markup:_,metadata:{assets:Q,clientModuleUrl:W,generatedAt:G,tagName:Z},preview:p0}})))}function w1(F,H){return q0(F)??{nodeType:1,outerHTML:H}}function D1(F,H,x,$){if(!I1(H)){if(x===void 0&&$===void 0)return;throw Error(`${H.constructor.name} cannot prepare SSR host content because it does not expose an innerHTML host surface.`)}F.prepareHost(H,{authoredContent:x}),$?.(H,F)}function g1(F){if(!F||F.length===0)return[];return F.map((H)=>({getContext:()=>H.value,getContextKey:()=>H.context,renderHydrationScript:()=>{return},renderHydrationScriptTag:()=>{return}}))}function _1(F){if(!F)return[];return[R1(F)]}function X0(F,H){if(!H)return F;if(F.some((x)=>x.kind==="script-module"&&x.src===H))return F;return[..._1(H),...F]}function J0(F){return F.find((H)=>H.kind==="script-module")?.src}function l(F,H){if(typeof F==="function")return{...H,component:F};return F}function j0(F){if(F?.mode!==void 0||F?.hydrate!==void 0)return F;return{...F,mode:"hydrate"}}function I1(F){return"innerHTML"in F}function C1(F,H){let x=Q0(F,H);if(x!==void 0)return x;throw Error(`${F.constructor.name} cannot be server-rendered without a registered Radiant SSR host. Use a RadiantElement subclass and import a Radiant server SSR entrypoint.`)}function M1(F){let H=y(F);if(!H)throw Error(`${F.name} is missing @customElement metadata.`);return H}import{renderToString as O1}from"@ecopages/jsx/server";var V1=Symbol.for("@ecopages/radiant.controllerIdentifier");function h0(F){return F[V1]}var G0="data-controller",v0=Symbol.for("@ecopages/radiant.controller-registry-state");function N1(){let F=globalThis,H=F[v0];if(H)return H;let x={activeRuntimes:new Set,controllerRegistrationStrategy:"keep-current",controllerRegistry:new Map};return F[v0]=x,x}var c0=N1(),RH=c0.controllerRegistry,wH=c0.activeRuntimes;async function yH(F,H){return(await a(F,H)).markup}async function SH(F,H){return a(F,H)}async function bH(F,H){return k(await a(F,H))}async function hH(F,H){return A(await a(F,H))}async function a(F,H){let x=k1(H.tagName),$=H.clientModuleSrc??await H.resolveClientModuleSrc?.(F),q=H.assets??await H.resolveAssets?.(F)??[],Q=X0(q,$),W=J0(Q)??$,Z=(H.now??O)().toISOString(),G=j0(H.renderOptions);return D(g(),()=>L(()=>{let U=A1(x,z1(F,H)),X=new F(U);w(X,"ssr");try{H.initialize?.(X),X.runWithSsrLifecycle(()=>X.connect());let _=h1(X,x,G);return{markup:_,metadata:{assets:Q,clientModuleUrl:W,generatedAt:Z,tagName:x},preview:{nodeType:1,outerHTML:_}}}finally{X.disconnect()}}))}function k1(F){let H=F.trim().toLowerCase();if(!H)throw Error("Controller SSR host tagName is required.");return H}function A1(F,H){let $=c().document.createElement(F);for(let[q,Q]of Object.entries(H)){if(Q===void 0||Q===null||Q===!1)continue;$.setAttribute(q,Q===!0?"":String(Q))}return $}function z1(F,H){let x={},$=H.host,q=S1(H.attributes?.class,$?.class,$?.classes);if(q!==void 0)x.class=q;u0(x,"data",$?.data),u0(x,"aria",$?.aria),y1(x,H.attributes);let Q=h0(F);if(Q&&x[G0]==null)x[G0]=Q;return x}function u0(F,H,x){if(!m0(x))return;for(let[$,q]of Object.entries(x))F[`${H}-${b1($)}`]=q}function y1(F,H){if(!H)return;for(let[x,$]of Object.entries(H))F[x]=$}function S1(...F){let H=[];for(let x of F)d0(H,x);return H.length===0?void 0:H.join(" ")}function d0(F,H){if(H===void 0||H===null||H===!1||H===!0)return;if(typeof H==="string"){if(H!=="")F.push(H);return}if(typeof H==="number"||typeof H==="bigint"){F.push(String(H));return}if(Array.isArray(H)){for(let x of H)d0(F,x);return}if(!m0(H))return;for(let[x,$]of Object.entries(H))if($)F.push(x)}function m0(F){return Object.prototype.toString.call(F)==="[object Object]"}function b1(F){return F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function h1(F,H,x){return R(F.getSsrContextProviders(),()=>{let $=p(()=>O1(F.render(),x)),Q=x.mode==="hydrate"||x.mode===void 0&&x.hydrate===!0?F.getSsrHydrationBindings().map((W)=>W.renderHydrationScriptTag()).filter((W)=>typeof W==="string").join(""):"";return`<${H}${v1(F.host)}>${$}${Q}</${H}>`})}function v1(F){return F.getAttributeNames().map((H)=>c1(H,F.getAttribute(H))).join("")}function c1(F,H){if(H==="")return` ${F}`;return` ${F}="${f(H??"")}"`}export{hH as renderControllerWithPreview,yH as renderControllerToString,bH as renderControllerToPayload,SH as renderController};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=D1D6DD0454A17BC564756E2164756E21
|