import{ReactDOMClient as c,ReactDOM$1 as i,React as s,createRoot as l}from"./chunks/vendor-react.js";import"./chunks/_commonjsHelpers.js";function f(n,r){const e=document.getElementById("root");if(!e){console.error("[Html Template] 找不到 #root 元素");return}const o=r||{container:e,config:{},data:{},events:{}};try{l(e).render(s.createElement(n,o))}catch(t){console.error("[Html Template] 渲染失败:",t)}}const m={...i,...c};if(typeof window<"u"){window.__AXHUB_DEFINE_COMPONENT__=t=>(window.UserComponent=t,t);const n=new URLSearchParams(window.location.search),r=n.get("scale"),e=n.get("width"),a=n.get("height"),o=document.getElementById("root");if(o){if(r){const t=parseFloat(r);!isNaN(t)&&t>0&&(o.style.transform=`scale(${t})`,o.style.transformOrigin="top left")}if(e||a){if(e){const t=parseInt(e);!isNaN(t)&&t>0&&(o.style.width=`${t}px`)}if(a){const t=parseInt(a);!isNaN(t)&&t>0&&(o.style.height=`${t}px`)}}}window.HtmlTemplateBootstrap={renderComponent:f,React:s,ReactDOM:m}}export{s as React,m as ReactDOM,f as renderComponent};
