@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,3 +1,3 @@
|
|
|
1
|
-
var{defineProperty:u,getOwnPropertyNames:t0,getOwnPropertyDescriptor:o0}=Object,e0=Object.prototype.hasOwnProperty;function ff(f){return this[f]}var xf=(f)=>{var x=($0??=new WeakMap).get(f),P;if(x)return x;if(x=u({},"__esModule",{value:!0}),f&&typeof f==="object"||typeof f==="function"){for(var R of t0(f))if(!e0.call(x,R))u(x,R,{get:ff.bind(f,R),enumerable:!(P=o0(f,R))||P.enumerable})}return $0.set(f,x),x},$0;var Pf=(f)=>f;function Rf(f,x){this[f]=Pf.bind(null,x)}var Ff=(f,x)=>{for(var P in x)u(f,P,{get:x[P],enumerable:!0,configurable:!0,set:Rf.bind(x,P)})};var d=(f,x)=>()=>(f&&(x=f(f=0)),x);var $f=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(x,P)=>(typeof require<"u"?require:x)[P]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});function I(f){return f.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function v0(f){let x=[],P=0;while(P<f.length){let R=P;if(f.startsWith("<!--",P)){let q=f.indexOf("-->",P+4);P=q===-1?f.length:q+3,x.push(f.slice(R,P));continue}if(f[P]!=="<"){let q=f.indexOf("<",P);P=q===-1?f.length:q,x.push(f.slice(R,P));continue}let F=w(f,P);if(!F){x.push(f.slice(R));break}if(F.type!=="open"||F.selfClosing||S.has(F.tagName)){P=F.end,x.push(f.slice(R,P));continue}P=F.end;let $=1;while(P<f.length&&$>0){let q=f.indexOf("<",P);if(q===-1){P=f.length;break}let H=w(f,q);if(!H){P=f.length;break}if(P=H.end,H.type==="comment"||H.type==="declaration")continue;if(H.type==="open"&&!H.selfClosing&&!S.has(H.tagName)){$+=1;continue}if(H.type==="close")$-=1}x.push(f.slice(R,P))}return x.filter((R)=>R!=="")}function Vf(f,x){let P;for(let R=x+1;R<f.length;R+=1){let F=f[R];if(P){if(F===P)P=void 0;continue}if(F==='"'||F==="'"){P=F;continue}if(F===">")return R+1}return f.length}function bf(f){let x={},P=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let R of f.matchAll(P)){let[,F,$,q,H]=R;if(!F)continue;x[F]=$??q??H??""}return x}function w(f,x){if(f.startsWith("<!--",x)){let _=f.indexOf("-->",x+4);return{end:_===-1?f.length:_+3,type:"comment"}}let P=Vf(f,x),R=f.slice(x+1,P-1).trim();if(R==="")return;if(R.startsWith("!")||R.startsWith("?"))return{end:P,type:"declaration"};if(R.startsWith("/"))return{end:P,type:"close"};let F=/\/\s*$/.test(R),$=F?R.replace(/\/\s*$/,"").trim():R,q=$.split(/[\s/>]/,1)[0]?.toLowerCase()??"",H=q.length,j=$.slice(H).trim(),T=F||S.has(q)?"":zf(f,x,P,q);return{attributes:bf(j),end:P,innerHtml:T,selfClosing:F,tagName:q,type:"open"}}function zf(f,x,P,R){let F=P,$=1;while(F<f.length&&$>0){let q=f.indexOf("<",F);if(q===-1)return f.slice(P);let H=w(f,q);if(!H)return f.slice(P);if(H.type==="open"&&H.tagName===R&&!H.selfClosing&&!S.has(R))$+=1;if(H.type==="close"){if(f.slice(q+2,H.end-1).trim().toLowerCase()===R){if($-=1,$===0)return f.slice(P,q)}}F=H.end}return f.slice(P)}var S;var u0=d(()=>{S=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"])});function Q(){return d0??=(s0(),xf(c0)),d0}class r0{element;constructor(f){this.element=f}add(...f){let x=new Set(this.readTokens());for(let P of f)if(P!=="")x.add(P);this.writeTokens([...x])}remove(...f){let x=new Set(this.readTokens());for(let P of f)x.delete(P);this.writeTokens([...x])}toggle(f,x){let P=this.contains(f);if(x??!P)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 E{bubbles;cancelable;composed;type;constructor(f,x={}){this.type=f,this.bubbles=x.bubbles??!1,this.cancelable=x.cancelable??!1,this.composed=x.composed??!1}}function Sf(f){return new U(f,X())}function X(){return globalThis.document??null}var d0,g,U,D,M,Z,W;var O=d(()=>{g=class g extends EventTarget{nodeType;static DOCUMENT_NODE=9;static ELEMENT_NODE=1;static TEXT_NODE=3;childNodes=[];ownerDocument;parentNode=null;constructor(f,x=null){super();this.nodeType=f;this.ownerDocument=x}append(...f){for(let x of f)this.appendChild(typeof x==="string"?Sf(x):x)}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===g.DOCUMENT_NODE?this:this.ownerDocument,f.parentNode=this,f}removeChild(f){let x=this.childNodes.indexOf(f);if(x===-1)return f;return this.childNodes.splice(x,1),f.parentNode=null,f}replaceChildren(...f){for(let x of this.childNodes)x.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}};U=class U extends g{value;constructor(f,x=X()){super(g.TEXT_NODE,x);this.value=f}get textContent(){return this.value}set textContent(f){this.value=f??""}};D=class D extends g{attributes=new Map;classListValue;datasetValue;fragmentHtml;fragmentText;localName;tagName;constructor(f="div",x=X()){super(g.ELEMENT_NODE,x);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 r0(this),this.classListValue}get dataset(){return this.datasetValue??=new Proxy({},{deleteProperty:(f,x)=>{if(typeof x!=="string")return!1;return this.removeAttribute(Q().toDataAttributeName(x)),!0},get:(f,x)=>{if(typeof x!=="string")return;return this.getAttribute(Q().toDataAttributeName(x))??void 0},getOwnPropertyDescriptor:(f,x)=>{if(typeof x!=="string")return;return{configurable:!0,enumerable:!0,value:this.getAttribute(Q().toDataAttributeName(x))??void 0,writable:!0}},has:(f,x)=>{return typeof x==="string"&&this.hasAttribute(Q().toDataAttributeName(x))},ownKeys:()=>{return this.getAttributeNames().filter((f)=>f.startsWith("data-")).map((f)=>Q().toDatasetPropertyName(f.slice(5)))},set:(f,x,P)=>{if(typeof x!=="string")return!1;return this.setAttribute(Q().toDataAttributeName(x),String(P)),!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,x){this.fragmentHtml=void 0,this.attributes.set(f,String(x))}toggleAttribute(f,x){if(x??!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(([x,P])=>` ${x}="${I(P)}"`).join("");return`<${this.localName}${f}>${this.innerHTML}</${this.localName}>`}get innerHTML(){return this.childNodes.map((f)=>Q().serializeNodeHtml(f)).join("")}set innerHTML(f){this.fragmentHtml=void 0,this.fragmentText=void 0,this.replaceChildren(...Q().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,x,P){this.fragmentHtml=f,this.fragmentText=x,this.attributes=new Map(Object.entries(P)),this.replaceChildren()}};M=class M extends E{detail;constructor(f,x={}){super(f,x);this.detail=x.detail}};Z=class Z extends D{isConnected=!1;constructor(f="div",x=X()){super(f,x)}insertAdjacentHTML(f,x){this.append(...Q().parseHtmlToNodes(x,this.ownerDocument))}};W=class W extends Z{constructor(f=X()){super("script",f)}}});var c0={};Ff(c0,{toDatasetPropertyName:()=>hf,toDataAttributeName:()=>Of,serializeNodeHtml:()=>yf,parseHtmlToNodes:()=>Mf,extractTextContent:()=>l0,createElementFromFragment:()=>i0});function i0(f,x,P){let R=x.tagName==="script"?new W(P):new Z(x.tagName,P);return R.setSerializedFragment(f,l0(x.innerHtml),x.attributes),R}function l0(f){return f.replace(/<!--.*?-->/gs,"").replace(/<[^>]+>/g,"")}function Mf(f,x=X()){return v0(f).map((P)=>{if(!P.startsWith("<"))return new U(P,x);let R=w(P,0);if(!R||R.type!=="open")return new U(P,x);return i0(P,R,x)})}function Of(f){return`data-${f.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function hf(f){return f.replace(/-([a-z])/g,(x,P)=>P.toUpperCase())}function yf(f){if(f.nodeType===g.TEXT_NODE)return f.textContent??"";return"outerHTML"in f&&typeof f.outerHTML==="string"?f.outerHTML:f.textContent??""}var s0=d(()=>{u0();O()});var c=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function of(f,x,P){let R=f.constructor,F=R[c]??[];if(F.some(($)=>$.name===x))return;F.push({name:x,options:P}),R[c]=F}function q0(f){return(f.constructor[c]??[]).slice()}var H0=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),g0=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),qf=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function f1(f,x){Z0(f,H0,x)}function x1(f,x){Z0(f,g0,x)}function Q0(f){Hf(f,H0)}function s(f,x){let P=f;gf(f,x,P[qf]??=new Set)}function Z0(f,x,P){let R=f,F=Object.prototype.hasOwnProperty.call(R,x)?R[x]:void 0;if(Array.isArray(F)){F.push(P);return}Object.defineProperty(R,x,{value:[P]})}function Hf(f,x){Qf(f,(P)=>{let R=P[x];if(!Array.isArray(R))return;for(let F of R)F(f)})}function gf(f,x,P){for(let R of W0(f)){let F=R[g0];if(!Array.isArray(F))continue;for(let $ of F){if(P.has($))continue;$(f,x),P.add($)}}}function W0(f){let x=[],P=Object.getPrototypeOf(f);while(P&&P!==Object.prototype)x.unshift(P),P=Object.getPrototypeOf(P);return x}function Qf(f,x){for(let P of W0(f))x(P)}function L(f,x){switch(x){case"construct":Q0(f);break;case"connect":s(f,"connect");break;case"ssr":s(f,"ssr");break}}function j0(f){switch(f){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function Zf(f){switch(typeof f){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(f))return"array";if(Object.prototype.toString.call(f)==="[object Object]")return"object"}function Wf(f){switch(f){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function Jf(f){try{return JSON.parse(f)}catch{throw TypeError("Invalid JSON string")}}var Uf={array(f){let x=Jf(f);if(!Array.isArray(x))throw TypeError(`Expected an array but got a value of type "${typeof x}"`);return x},boolean(f){return!(f==="0"||String(f).toLowerCase()==="false")},number(f){return Number(f.replace(/_/g,""))},object(f){let x=JSON.parse(f);if(x===null||typeof x!=="object"||Array.isArray(x))throw TypeError(`expected value of type "object" but instead got value "${f}" of type "${Zf(x)}"`);return x},string(f){return f}},J0={default:G0,array:U0,object:U0};function U0(f){return JSON.stringify(f)}function G0(f){return`${f}`}function X0(f,x){let P=j0(x);if(!P)throw TypeError(`[radiant-element] Unknown type "${x}"`);return Uf[P](f)}function T0(f,x){let P=j0(x);if(!P)throw TypeError(`[radiant-element] Unknown type "${x}"`);return(J0[P]??J0.default??G0)(f)}function Xf(f){return typeof f==="boolean"}function jf(f){return typeof f==="number"}function Gf(f){return typeof f==="string"}function Tf(f){return Array.isArray(f)}function Bf(f){return typeof f==="object"&&!Array.isArray(f)&&f!==null}function $1(f,x){switch(f){case Boolean:return Xf(x);case Number:return jf(x);case String:return Gf(x);case Array:return Tf(x);case Object:return Bf(x);default:return!1}}var q1=(f,x,P,R)=>{if(x===Boolean){let $=f.getAttribute(P);if($===null)return R;return $===""?!0:X0($,x)}let F=f.getAttribute(P);return F!==null?X0(F,x):R??Wf(x)};import{getActiveSsrScopeValue as Yf,withActiveSsrScopeValue as Kf}from"@ecopages/jsx/server";var B0=Symbol.for("@ecopages/radiant.element-ssr-runtime");function Q1(){return Yf(B0)}function N(f,x){return Kf(B0,f,x)}var Y0=Symbol.for("@ecopages/radiant.customElementTagName");function W1(f,x){f[Y0]=x}function A(f){return f[Y0]}function K0(f){let x=globalThis.CSS;if(typeof x?.escape==="function")return x.escape(f);let P="";for(let R=0;R<f.length;R+=1){let F=f[R]??"",$=F.codePointAt(0)??0;if($===0){P+="�";continue}let q=$>=1&&$<=31||$===127,H=R===0&&$>=48&&$<=57,j=R===1&&$>=48&&$<=57&&(f[0]??"")==="-",T=R===0&&F==="-"&&f.length===1;if(q||H||j){P+=`\\${$.toString(16)} `;continue}if($>=128||F==="-"||F==="_"||$>=48&&$<=57||$>=65&&$<=90||$>=97&&$<=122){P+=T?`\\${F}`:F;continue}P+=`\\${F}`}return P}function w0(f){let x={},P=new Set;return Df(f,x,P),Ef(f,x,P),Cf(f,x),x}function D0(f){return Object.entries(f).map(([x,P])=>` ${x}="${I(P)}"`).join("")}function Df(f,x,P){for(let R of f.getReactiveProperties()){let F=f.getPropertyValue(R.name);if(F===void 0||F===null||F===!1)continue;x[R.attribute]=String(R.converter.toAttribute(F)),P.add(R.attribute)}}function Ef(f,x,P){for(let R of f.getReactivePropDefinitions()){let F=R.options.attribute??R.name;if(P.has(F))continue;let $=f.getPropertyValue(R.name);if($===void 0||$===null||$===!1)continue;x[F]=String(T0($,R.options.type)),P.add(F)}}function Cf(f,x){for(let P of f.getAttributeNames()){let R=f.getAttribute(P);if(R!==null)x[P]=R}}var E0=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function C0(){return globalThis}function _0(f){C0()[E0]=f}function B1(f){return C0()[E0]?.(f)}var B;function N0(){if(B!==void 0)return B;try{let{AsyncLocalStorage:f}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return B=new f,B}catch{return B=null,null}}var L0=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function A0(){let f=globalThis;return f[L0]??=[],f[L0]}function k(f){if(f.length===0)return()=>{return};let x=new Map;for(let F of f)x.set(F.getContextKey(),F);let P=N0();if(P){let F=P.getStore()??[],$=[...F,x];return P.enterWith($),()=>{P.enterWith(F)}}let R=A0();return R.push(x),()=>{let F=R.lastIndexOf(x);if(F>=0)R.splice(F,1)}}function I0(f){let x=N0()?.getStore()??A0();for(let P=x.length-1;P>=0;P-=1){let R=x[P]?.get(f);if(R)return R}return}function w1(f){let x=I0(f);if(!x)return;return x.getContext()}_0((f)=>I0(f));function k0(f,x){if(!x)return`${f.hostContent}${f.authoredHydrationMarkup}${f.slotProjectionScript}`;return`${f.hostContent}${f.slotProjectionScript}${f.hydrationScripts}`}function G(f){if(_f(f))return f;return}function _f(f){return typeof f.constructor==="function"&&typeof f.getAttribute==="function"&&typeof f.getAttributeNames==="function"&&typeof f.getAuthoredHydrationScriptMarkup==="function"&&typeof f.getContextProviders==="function"&&typeof f.getHydrationBindings==="function"&&typeof f.getReactiveProperties==="function"&&typeof f.getSlotProjectionScriptTag==="function"&&typeof f.resolveTrackedRenderOutput==="function"&&typeof f.renderViewToString==="function"}function V0(f){let x=G(f);if(!x)throw Error("Radiant SSR runtime requires a server extraction host shape on the component.");return{constructor:x.constructor,getAttribute:(P)=>x.getAttribute(P),getAttributeNames:()=>x.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>x.getAuthoredHydrationScriptMarkup?.(),getContextProviders:()=>x.getContextProviders(),getHydrationBindings:()=>x.getHydrationBindings(),getReactiveProperties:()=>x.getReactiveProperties(),getReactivePropDefinitions:()=>q0(f),getPropertyValue:(P)=>Reflect.get(f,P),getSlotProjectionScriptTag:()=>x.getSlotProjectionScriptTag?.(),resolveTrackedRenderOutput:()=>x.resolveTrackedRenderOutput(),renderViewToString:(P)=>x.renderViewToString(P)}}class r{component;host;constructor(f){this.component=f,this.host=V0(f)}ensureReady(){L(this.component,"ssr")}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(f={},x=this.getHostAttributes()){this.ensureReady();let P=this.getTagName(),R=k(this.host.getContextProviders());try{return`<${P}${D0(x)}>${this.renderHostContent(f)}</${P}>`}finally{R()}}getHostAttributes(){return this.ensureReady(),w0(this.host)}renderHostContent(f){let x=f.mode==="hydrate"||f.mode===void 0&&f.hydrate===!0,P=x?this.host.getHydrationBindings().map((R)=>R.renderHydrationScriptTag()).filter((R)=>typeof R==="string").join(""):"";return k0({hostContent:this.host.renderViewToString(f),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:P},x)}getTagName(){let f=A(this.host.constructor);if(!f)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return f}}import{renderToString as Lf}from"@ecopages/jsx/server";import{createServerHydrationBindingState as b0,isServerRenderHydrationActive as z0,withForcedServerCustomElementRendering as Nf,withServerCustomElementRenderHook as Af,withServerHydrationBindingState as S0}from"@ecopages/jsx/server";var V;function i(f){return new r(f)}function Y(f){return{nodeType:1,outerHTML:J(f,{mode:"hydrate"})}}function l(f){if(K(f))return Y(f);if(!b(f))return;return f.renderHost?.()??{nodeType:1,outerHTML:f.renderHostToString({mode:"hydrate"})}}function J(f,x={}){return n(()=>i(f).renderHostToString(x,a(f)))}function m(f,x={}){if(K(f))return J(f,x);if(!b(f))return;return f.renderHostToString(x)}function p(f,x){if(K(f))return Y(f);if(!b(f))return;return f.renderHost?.()??{nodeType:1,outerHTML:x}}function M0(f,x={}){return n(()=>h0(()=>Lf(y0(f).value,x)))}function a(f){return i(f).getHostAttributes()}function O0(f){if(!K(f))return;return{renderHost:()=>Y(f),renderHostToString:(x)=>J(f,x)}}function If(f){return G(f)}function h0(f){return Nf(()=>Af(({instance:x})=>{if(K(x))return{nodeType:1,get outerHTML(){let R=z0(),F={hydrate:R,mode:R?"hydrate":"plain"};if(!R)return J(x,F);return S0(b0(),()=>J(x,F))}};if(!b(x))return;let P=x;return{nodeType:1,get outerHTML(){let R=z0();if(!R)return P.renderHostToString({hydrate:R,mode:R?"hydrate":"plain"});return S0(b0(),()=>P.renderHostToString({hydrate:R,mode:R?"hydrate":"plain"}))}}},f))}function y0(f){if(kf(f))return f.resolveTrackedRenderOutput();let x=G(f);if(!x)throw Error("Radiant SSR runtime requires tracked render output support on the component.");return x.resolveTrackedRenderOutput()}function K(f){if(typeof f!=="object"||f===null)return!1;return G(f)!==void 0}function b(f){if(typeof f!=="object"||f===null)return!1;return typeof f.renderHostToString==="function"}function kf(f){if(typeof f!=="object"||f===null)return!1;return typeof f.resolveTrackedRenderOutput==="function"}function z(){if(V)return V;return V={getHostAttributes:a,renderHost:Y,renderHostToString:J,resolveRenderBridge:O0,renderView:M0},V}function n(f){return N(z(),f)}O();class h extends g{constructor(){super(g.DOCUMENT_NODE)}createElement(f){return f.toLowerCase()==="script"?new W(this):new Z(f,this)}createTextNode(f){return new U(f,this)}querySelector(){return null}querySelectorAll(){return[]}}class t{definitions=new Map;define(f,x){if(this.definitions.has(f))return;this.definitions.set(f,x)}get(f){return this.definitions.get(f)}}O();var C,o={escape(f){return K0(String(f))}};function m0(){let f=globalThis,x=f.customElements;if(typeof f.Node>"u"||typeof f.Document>"u"||typeof f.Element>"u"||typeof f.HTMLElement>"u"||typeof f.document>"u"||!x||typeof x.define!=="function"||typeof x.get!=="function")return;return f.window??{CSS:f.CSS??o,CustomEvent:f.CustomEvent??M,Document:f.Document,Element:f.Element,Event:f.Event??E,EventTarget:f.EventTarget??EventTarget,HTMLScriptElement:f.HTMLScriptElement??f.HTMLElement,HTMLElement:f.HTMLElement,Node:f.Node,document:f.document,customElements:x}}function p0(){let f=m0();if(f)return f;return a0()}function e(){return p0(),{prepareHost(f,x={}){if(x.authoredContent!==void 0)f.innerHTML=x.authoredContent}}}function a0(){let f=m0();if(f)return f;if(C)return C;let x=new t,P=new h,R=globalThis.Event??E,F=globalThis.CustomEvent??M,$=h,q=globalThis.EventTarget??EventTarget;return C={CSS:globalThis.CSS??o,CustomEvent:F,Document:$,Element:D,Event:R,EventTarget:q,HTMLScriptElement:W,HTMLElement:Z,Node:g,document:P,customElements:x},Object.assign(globalThis,{CSS:globalThis.CSS??o,CustomEvent:F,Document:$,Element:D,Event:R,EventTarget:q,HTMLScriptElement:W,HTMLElement:Z,Node:g,document:P,customElements:x,window:C}),C}function f0(){return new Date}function x0(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:x,...P}=f;return P}function P0(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 vf(f,x="hydrate"){return{kind:"script-module",src:f,stage:x}}function Jx(f){return{kind:"modulepreload",href:f}}function Ux(f,x){return x?{kind:"style",href:f,media:x}:{kind:"style",href:f}}async function Xx(f,x){return(await y(v(f,x))).markup}async function jx(f,x){return y(v(f,x))}async function Gx(f,x){return x0(await y(v(f,x)))}async function Tx(f,x){return P0(await y(v(f,x)))}async function y(f){return N(z(),async()=>{let x=f.environment??e(),P=k(cf(f.ssrContext));try{let R="component"in f?f.component:await f.load(),F=new R;L(F,"ssr"),df(x,F,f.authoredContent,f.prepareHost),f.initialize?.(F);let $=f.clientModuleSrc??await f.resolveClientModuleSrc?.(R),q=f.assets??await f.resolveAssets?.(R)??[],H=rf(q,$),j=lf(H)??$,T=f.tagName??nf(R),_=(f.now??f0)().toISOString(),R0=mf(f.renderOptions),F0=m(F,R0)??af(F,R0),n0=uf(F,F0);return{markup:F0,metadata:{assets:H,clientModuleUrl:j,generatedAt:_,tagName:T},preview:n0}}finally{P()}})}function uf(f,x){return p(f,x)??l(f)??f.renderHost?.()??{nodeType:1,outerHTML:x}}function df(f,x,P,R){if(!pf(x)){if(P===void 0&&R===void 0)return;throw Error(`${x.constructor.name} cannot prepare SSR host content because it does not expose an innerHTML host surface.`)}f.prepareHost(x,{authoredContent:P}),R?.(x,f)}function cf(f){if(!f||f.length===0)return[];return f.map((x)=>({getContext:()=>x.value,getContextKey:()=>x.context,renderHydrationScript:()=>{return},renderHydrationScriptTag:()=>{return}}))}function sf(f){if(!f)return[];return[vf(f)]}function rf(f,x){if(!x)return f;if(f.some((P)=>P.kind==="script-module"&&P.src===x))return f;return[...sf(x),...f]}function lf(f){return f.find((x)=>x.kind==="script-module")?.src}function v(f,x){if(typeof f==="function")return{...x,component:f};return f}function mf(f){if(f?.mode!==void 0||f?.hydrate!==void 0)return f;return{...f,mode:"hydrate"}}function pf(f){return"innerHTML"in f}function af(f,x){if(typeof f.renderHostToString==="function")return f.renderHostToString(x);throw Error(`${f.constructor.name} cannot be server-rendered without a registered Radiant SSR host or renderHostToString().`)}function nf(f){let x=A(f);if(!x)throw Error(`${f.name} is missing @customElement metadata.`);return x}export{P0 as toRenderedComponentWithPreview,x0 as toRenderedComponentPayload,Ux as styleAsset,vf as scriptModuleAsset,lf as resolvePrimaryClientModuleSrc,Tx as renderComponentWithPreview,Xx as renderComponentToString,Gx as renderComponentToPayload,jx as renderComponent,mf as normalizeRenderOptions,Jx as modulePreloadAsset,rf as mergeRenderedComponentAssets,f0 as createDefaultRenderTimestamp};
|
|
1
|
+
function O0(f){switch(f){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}var q0={default:Z0,array:Q0,object:Q0};function Q0(f){return JSON.stringify(f)}function Z0(f){return`${f}`}function g0(f,x){let F=O0(x);if(!F)throw TypeError(`[radiant-element] Unknown type "${x}"`);return(q0[F]??q0.default??Z0)(f)}function D(f){return f.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function X0(f){let x={},F=new Set;return b0(f,x,F),S0(f,x,F),y0(f,x),x}function W0(f){return Object.entries(f).map(([x,F])=>` ${x}="${D(F)}"`).join("")}function b0(f,x,F){for(let H of f.getReactiveProperties()){let $=f.getPropertyValue(H.name);if($===void 0||$===null||$===!1)continue;x[H.attribute]=String(H.converter.toAttribute($)),F.add(H.attribute)}}function S0(f,x,F){for(let H of f.getReactivePropDefinitions()){let $=H.options.attribute??H.name;if(F.has($))continue;let q=f.getPropertyValue(H.name);if(q===void 0||q===null||q===!1)continue;x[$]=String(g0(q,H.options.type)),F.add($)}}function y0(f,x){for(let F of f.getAttributeNames()){let H=f.getAttribute(F);if(H!==null)x[F]=H}}import{getActiveSsrScopeValue as u,withActiveSsrScopeValue as j0}from"@ecopages/jsx/server";var h0;function J0(f){h0=f}var K=Symbol.for("@ecopages/radiant.ssr-provider-stack");function E(f){if(u(K)!==void 0)return f();return j0(K,[],f)}function _(f,x){if(f.length===0)return x();let F=u(K);if(F===void 0)throw Error("SSR context providers require runWithSsrProviderStack(...). Wrap the sync render snapshot at the render boundary.");let H=new Map;for(let $ of f)H.set($.getContextKey(),$);return j0(K,[...F,H],x)}function G0(f){let x=u(K);if(!x)return;for(let F=x.length-1;F>=0;F-=1){let H=x[F]?.get(f);if(H)return H}return}function kf(f){let x=G0(f);if(!x)return;return x.getContext()}J0((f)=>G0(f));function B0(f,x){if(!x)return`${f.hostContent}${f.authoredHydrationMarkup}${f.slotProjectionScript}`;return`${f.hostContent}${f.slotProjectionScript}${f.hydrationScripts}`}function N(f){if(f.renderRootMode!=="shadow")return;let x=typeof f.constructor==="function"&&f.constructor.name?f.constructor.name:"RadiantElement";throw Error(`${x} uses renderRootMode "shadow". Radiant SSR is light-DOM only; keep renderRootMode "light" for server rendering, or skip SSR for this host.`)}var v0=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function U0(f){return(f.constructor[v0]??[]).slice()}var P0=Symbol.for("@ecopages/radiant.RadiantElement");function j(f){return typeof f==="object"&&f!==null&&P0 in f}function Y0(f){if(!j(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:(x)=>f.getAttribute(x),getAttributeNames:()=>f.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>f.getAuthoredHydrationScriptMarkup(),getContextProviders:()=>f.getContextProviders(),getHydrationBindings:()=>f.getHydrationBindings(),getReactiveProperties:()=>f.getReactiveProperties(),getReactivePropDefinitions:()=>U0(f),getPropertyValue:(x)=>Reflect.get(f,x),getSlotProjectionScriptTag:()=>f.getSlotProjectionScriptTag(),resolveTrackedRenderOutput:()=>f.resolveTrackedRenderOutput()}}var c0=Symbol.for("@ecopages/radiant.customElementTagName");function I(f){return f[c0]}var u0=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),T0=Symbol.for("@ecopages/radiant.ssr-preparation-running");function K0(f){let x=f,F=x[u0];if(!Array.isArray(F))return;x[T0]=!0;try{for(let H of F)H()}finally{delete x[T0]}}var d0=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),m0=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),s0=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function R0(f){l0(f,d0)}function d(f,x){let F=f;p0(f,x,F[s0]??=new Set)}function l0(f,x){i0(f,(F)=>{let H=F[x];if(!Array.isArray(H))return;for(let $ of H)$(f)})}function p0(f,x,F){for(let H of w0(f)){let $=H[m0];if(!Array.isArray($))continue;for(let q of $){if(F.has(q))continue;q(f,x),F.add(q)}}}function w0(f){let x=[],F=Object.getPrototypeOf(f);while(F&&F!==Object.prototype)x.unshift(F),F=Object.getPrototypeOf(F);return x}function i0(f,x){for(let F of w0(f))x(F)}function k(f,x){switch(x){case"construct":R0(f);break;case"connect":d(f,"connect");break;case"ssr":d(f,"ssr");break}}class m{component;host;renderView;constructor(f,x){this.component=f,this.host=Y0(f),this.renderView=x}ensureReady(){N(this.host),k(this.component,"ssr"),K0(this.component)}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(f={},x=this.getHostAttributes()){this.ensureReady();let F=this.getTagName();return _(this.host.getContextProviders(),()=>`<${F}${W0(x)}>${this.renderHostContent(f)}</${F}>`)}getHostAttributes(){return this.ensureReady(),X0(this.host)}renderHostContent(f){let x=f.mode==="hydrate"||f.mode===void 0&&f.hydrate===!0,F=x?this.host.getHydrationBindings().map((H)=>H.renderHydrationScriptTag()).filter((H)=>typeof H==="string").join(""):"";return B0({hostContent:this.renderView(this.host,f),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:F},x)}getTagName(){let f=I(this.host.constructor);if(!f)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return f}}import{getActiveSsrScopeValue as r0,withActiveSsrScopeValue as a0}from"@ecopages/jsx/server";var L0=Symbol.for("@ecopages/radiant.element-ssr-runtime"),V;function C0(f){V=f}function M(f,x){if(!V)throw Error("Radiant element SSR runtime requires the server scope adapters. Import a Radiant server SSR entrypoint before rendering.");if(V.get(L0)===f)return x();return V.withValue(L0,f,x)}C0({get:r0,withValue:a0});function G(f){return`data-${f.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function s(f){return f.replace(/-([a-z])/g,(x,F)=>F.toUpperCase())}var l;function D0(f){l=f}function p(){if(!l)throw Error("Minimal DOM HTML parsers are not registered. Import @ecopages/radiant/server/install-ssr-runtime (or ./html) before using innerHTML.");return l}class g extends EventTarget{nodeType;static DOCUMENT_NODE=9;static ELEMENT_NODE=1;static TEXT_NODE=3;childNodes=[];ownerDocument;parentNode=null;constructor(f,x=null){super();this.nodeType=f;this.ownerDocument=x}append(...f){for(let x of f)this.appendChild(typeof x==="string"?n0(x):x)}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===g.DOCUMENT_NODE?this:this.ownerDocument,f.parentNode=this,f}removeChild(f){let x=this.childNodes.indexOf(f);if(x===-1)return f;return this.childNodes.splice(x,1),f.parentNode=null,f}replaceChildren(...f){for(let x of this.childNodes)x.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 B extends g{value;constructor(f,x=U()){super(g.TEXT_NODE,x);this.value=f}get textContent(){return this.value}set textContent(f){this.value=f??""}}class E0{element;constructor(f){this.element=f}add(...f){let x=new Set(this.readTokens());for(let F of f)if(F!=="")x.add(F);this.writeTokens([...x])}remove(...f){let x=new Set(this.readTokens());for(let F of f)x.delete(F);this.writeTokens([...x])}toggle(f,x){let F=this.contains(f);if(x??!F)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 g{attributes=new Map;classListValue;datasetValue;fragmentHtml;fragmentText;localName;tagName;constructor(f="div",x=U()){super(g.ELEMENT_NODE,x);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 E0(this),this.classListValue}get dataset(){return this.datasetValue??=new Proxy({},{deleteProperty:(f,x)=>{if(typeof x!=="string")return!1;return this.removeAttribute(G(x)),!0},get:(f,x)=>{if(typeof x!=="string")return;return this.getAttribute(G(x))??void 0},getOwnPropertyDescriptor:(f,x)=>{if(typeof x!=="string")return;return{configurable:!0,enumerable:!0,value:this.getAttribute(G(x))??void 0,writable:!0}},has:(f,x)=>{return typeof x==="string"&&this.hasAttribute(G(x))},ownKeys:()=>{return this.getAttributeNames().filter((f)=>f.startsWith("data-")).map((f)=>s(f.slice(5)))},set:(f,x,F)=>{if(typeof x!=="string")return!1;return this.setAttribute(G(x),String(F)),!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,x){this.fragmentHtml=void 0,this.attributes.set(f,String(x))}toggleAttribute(f,x){if(x??!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(([x,F])=>` ${x}="${D(F)}"`).join("");return`<${this.localName}${f}>${this.innerHTML}</${this.localName}>`}get innerHTML(){return this.childNodes.map((f)=>p().serializeNodeHtml(f)).join("")}set innerHTML(f){this.fragmentHtml=void 0,this.fragmentText=void 0,this.replaceChildren(...p().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,x,F){this.fragmentHtml=f,this.fragmentText=x,this.attributes=new Map(Object.entries(F)),this.replaceChildren()}}class w{bubbles;cancelable;composed;type;constructor(f,x={}){this.type=f,this.bubbles=x.bubbles??!1,this.cancelable=x.cancelable??!1,this.composed=x.composed??!1}}class A extends w{detail;constructor(f,x={}){super(f,x);this.detail=x.detail}}class X extends R{isConnected=!1;constructor(f="div",x=U()){super(f,x)}insertAdjacentHTML(f,x){this.append(...p().parseHtmlToNodes(x,this.ownerDocument))}}class J extends X{constructor(f=U()){super("script",f)}}function n0(f){return new B(f,U())}function U(){return globalThis.document??null}class z extends g{constructor(){super(g.DOCUMENT_NODE)}createElement(f){return f.toLowerCase()==="script"?new J(this):new X(f,this)}createTextNode(f){return new B(f,this)}querySelector(){return null}querySelectorAll(){return[]}}class i{definitions=new Map;define(f,x){if(this.definitions.has(f))return;this.definitions.set(f,x)}get(f){return this.definitions.get(f)}}var O=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function _0(f){let x=[],F=0;while(F<f.length){let H=F;if(f.startsWith("<!--",F)){let Q=f.indexOf("-->",F+4);F=Q===-1?f.length:Q+3,x.push(f.slice(H,F));continue}if(f[F]!=="<"){let Q=f.indexOf("<",F);F=Q===-1?f.length:Q,x.push(f.slice(H,F));continue}let $=L(f,F);if(!$){x.push(f.slice(H));break}if($.type!=="open"||$.selfClosing||O.has($.tagName)){F=$.end,x.push(f.slice(H,F));continue}F=$.end;let q=1;while(F<f.length&&q>0){let Q=f.indexOf("<",F);if(Q===-1){F=f.length;break}let Z=L(f,Q);if(!Z){F=f.length;break}if(F=Z.end,Z.type==="comment"||Z.type==="declaration")continue;if(Z.type==="open"&&!Z.selfClosing&&!O.has(Z.tagName)){q+=1;continue}if(Z.type==="close")q-=1}x.push(f.slice(H,F))}return x.filter((H)=>H!=="")}function o0(f,x){let F;for(let H=x+1;H<f.length;H+=1){let $=f[H];if(F){if($===F)F=void 0;continue}if($==='"'||$==="'"){F=$;continue}if($===">")return H+1}return f.length}function t0(f){let x={},F=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let H of f.matchAll(F)){let[,$,q,Q,Z]=H;if(!$)continue;x[$]=q??Q??Z??""}return x}function L(f,x){if(f.startsWith("<!--",x)){let W=f.indexOf("-->",x+4);return{end:W===-1?f.length:W+3,type:"comment"}}let F=o0(f,x),H=f.slice(x+1,F-1).trim();if(H==="")return;if(H.startsWith("!")||H.startsWith("?"))return{end:F,type:"declaration"};if(H.startsWith("/"))return{end:F,type:"close"};let $=/\/\s*$/.test(H),q=$?H.replace(/\/\s*$/,"").trim():H,Q=q.split(/[\s/>]/,1)[0]?.toLowerCase()??"",Z=Q.length,Y=q.slice(Z).trim(),T=$||O.has(Q)?"":e0(f,x,F,Q);return{attributes:t0(Y),end:F,innerHtml:T,selfClosing:$,tagName:Q,type:"open"}}function e0(f,x,F,H){let $=F,q=1;while($<f.length&&q>0){let Q=f.indexOf("<",$);if(Q===-1)return f.slice(F);let Z=L(f,Q);if(!Z)return f.slice(F);if(Z.type==="open"&&Z.tagName===H&&!Z.selfClosing&&!O.has(H))q+=1;if(Z.type==="close"){if(f.slice(Q+2,Z.end-1).trim().toLowerCase()===H){if(q-=1,q===0)return f.slice(F,Q)}}$=Z.end}return f.slice(F)}function ff(f,x,F){let H=x.tagName==="script"?new J(F):new X(x.tagName,F);return H.setSerializedFragment(f,xf(x.innerHtml),x.attributes),H}function xf(f){return f.replace(/<!--.*?-->/gs,"").replace(/<[^>]+>/g,"")}function Ff(f,x=U()){return _0(f).map((F)=>{if(!F.startsWith("<"))return new B(F,x);let H=L(F,0);if(!H||H.type!=="open")return new B(F,x);return ff(F,H,x)})}function Hf(f){if(f.nodeType===g.TEXT_NODE)return f.textContent??"";return"outerHTML"in f&&typeof f.outerHTML==="string"?f.outerHTML:f.textContent??""}D0({parseHtmlToNodes:Ff,serializeNodeHtml:Hf});function N0(f){let x=globalThis.CSS;if(typeof x?.escape==="function")return x.escape(f);let F="";for(let H=0;H<f.length;H+=1){let $=f[H]??"",q=$.codePointAt(0)??0;if(q===0){F+="�";continue}let Q=q>=1&&q<=31||q===127,Z=H===0&&q>=48&&q<=57,Y=H===1&&q>=48&&q<=57&&(f[0]??"")==="-",T=H===0&&$==="-"&&f.length===1;if(Q||Z||Y){F+=`\\${q.toString(16)} `;continue}if(q>=128||$==="-"||$==="_"||q>=48&&q<=57||q>=65&&q<=90||q>=97&&q<=122){F+=T?`\\${$}`:$;continue}F+=`\\${$}`}return F}var C,r={escape(f){return N0(String(f))}};function I0(){let f=globalThis,x=f.customElements;if(typeof f.Node>"u"||typeof f.Document>"u"||typeof f.Element>"u"||typeof f.HTMLElement>"u"||typeof f.document>"u"||!x||typeof x.define!=="function"||typeof x.get!=="function")return;return f.window??{CSS:f.CSS??r,CustomEvent:f.CustomEvent??A,Document:f.Document,Element:f.Element,Event:f.Event??w,EventTarget:f.EventTarget??EventTarget,HTMLScriptElement:f.HTMLScriptElement??f.HTMLElement,HTMLElement:f.HTMLElement,Node:f.Node,document:f.document,customElements:x}}function k0(){let f=I0();if(f)return f;return b()}function a(){return k0(),{prepareHost(f,x={}){if(x.authoredContent!==void 0)f.innerHTML=x.authoredContent}}}function b(){let f=I0();if(f)return f;if(C)return C;let x=new i,F=new z,H=globalThis.Event??w,$=globalThis.CustomEvent??A,q=z,Q=globalThis.EventTarget??EventTarget;return C={CSS:globalThis.CSS??r,CustomEvent:$,Document:q,Element:R,Event:H,EventTarget:Q,HTMLScriptElement:J,HTMLElement:X,Node:g,document:F,customElements:x},Object.assign(globalThis,{CSS:globalThis.CSS??r,CustomEvent:$,Document:q,Element:R,Event:H,EventTarget:Q,HTMLScriptElement:J,HTMLElement:X,Node:g,document:F,customElements:x,window:C}),C}b();var D1=!0;var _1=!0;import{renderToString as $f}from"@ecopages/jsx/server";import{createServerHydrationBindingState as qf,isServerRenderHydrationActive as Qf,withServerCustomElementRenderHook as Zf,withServerHydrationBindingState as gf}from"@ecopages/jsx/server";var S;function n(f){return new m(f,e)}function P(f,x={}){return f0(()=>{let F=n(f);return F.renderHostToString(x,F.getHostAttributes())})}function y(f){return{nodeType:1,outerHTML:P(f,{mode:"hydrate"})}}function o(f){if(!j(f))return;return y(f)}function t(f,x={}){if(!j(f))return;return P(f,x)}function e(f,x={}){return N(f),f0(()=>A0(()=>$f(f.resolveTrackedRenderOutput().value,x)))}function V0(f){return n(f).getHostAttributes()}function M0(f){if(!j(f))return;return{renderHost:()=>y(f),renderHostToString:(x)=>P(f,x)}}function A0(f){return Zf(({instance:x})=>{if(!j(x))return;return{nodeType:1,get outerHTML(){return Xf(x)}}},f)}function Xf(f){let x=Qf(),F={hydrate:x,mode:x?"hydrate":"plain"};if(!x)return P(f,F);return gf(qf(),()=>P(f,F))}function h(){if(S)return S;return S={getHostAttributes:V0,renderHost:y,renderHostToString:P,resolveRenderBridge:M0,renderView:e},S}function f0(f){return M(h(),()=>E(f))}function x0(){return new Date}function F0(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:x,...F}=f;return F}function H0(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 Wf(f,x="hydrate"){return{kind:"script-module",src:f,stage:x}}function i1(f){return{kind:"modulepreload",href:f}}function r1(f,x){return x?{kind:"style",href:f,media:x}:{kind:"style",href:f}}async function a1(f,x){return(await v(c(f,x))).markup}async function n1(f,x){return v(c(f,x))}async function o1(f,x){return F0(await v(c(f,x)))}async function t1(f,x){return H0(await v(c(f,x)))}async function v(f){let x=f.environment??a(),F="component"in f?f.component:await f.load(),H=f.clientModuleSrc??await f.resolveClientModuleSrc?.(F),$=f.assets??await f.resolveAssets?.(F)??[],q=Uf($,H),Q=Pf(q)??H,Z=f.tagName??Rf(F),Y=(f.now??x0)().toISOString(),T=Yf(f.renderOptions);return M(h(),()=>E(()=>_(Gf(f.ssrContext),()=>{let W=new F;k(W,"ssr"),jf(x,W,f.authoredContent,f.prepareHost),f.initialize?.(W);let $0=Kf(W,T),z0=Jf(W,$0);return{markup:$0,metadata:{assets:q,clientModuleUrl:Q,generatedAt:Y,tagName:Z},preview:z0}})))}function Jf(f,x){return o(f)??{nodeType:1,outerHTML:x}}function jf(f,x,F,H){if(!Tf(x)){if(F===void 0&&H===void 0)return;throw Error(`${x.constructor.name} cannot prepare SSR host content because it does not expose an innerHTML host surface.`)}f.prepareHost(x,{authoredContent:F}),H?.(x,f)}function Gf(f){if(!f||f.length===0)return[];return f.map((x)=>({getContext:()=>x.value,getContextKey:()=>x.context,renderHydrationScript:()=>{return},renderHydrationScriptTag:()=>{return}}))}function Bf(f){if(!f)return[];return[Wf(f)]}function Uf(f,x){if(!x)return f;if(f.some((F)=>F.kind==="script-module"&&F.src===x))return f;return[...Bf(x),...f]}function Pf(f){return f.find((x)=>x.kind==="script-module")?.src}function c(f,x){if(typeof f==="function")return{...x,component:f};return f}function Yf(f){if(f?.mode!==void 0||f?.hydrate!==void 0)return f;return{...f,mode:"hydrate"}}function Tf(f){return"innerHTML"in f}function Kf(f,x){let F=t(f,x);if(F!==void 0)return F;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 Rf(f){let x=I(f);if(!x)throw Error(`${f.name} is missing @customElement metadata.`);return x}export{H0 as toRenderedComponentWithPreview,F0 as toRenderedComponentPayload,r1 as styleAsset,Wf as scriptModuleAsset,Pf as resolvePrimaryClientModuleSrc,t1 as renderComponentWithPreview,a1 as renderComponentToString,o1 as renderComponentToPayload,n1 as renderComponent,Yf as normalizeRenderOptions,i1 as modulePreloadAsset,Uf as mergeRenderedComponentAssets,x0 as createDefaultRenderTimestamp};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=81F03BF25AA0D55164756E2164756E21
|