"use strict";exports.id=7300,exports.ids=[7300],exports.modules={47300:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{actionBundlePath:()=>v,buildUtility:()=>l,rebuildUtility:()=>t,uiBundlePath:()=>u});var e=c(71152),f=c(73024),g=c(76760),h=c.n(g),i=c(36306),j=c(85933),k=a([i]);i=(k.then?(await k)():k)[0];let w=["@host/ui","@host/api"],x=[],y=["react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client","react-markdown","remark-gfm","mermaid"];async function l(a){let{manifest:b,dir:c}=a,d=h().join(c,b.ui),g=h().join(c,"bundle.js");await n(d,"ui");let i="./"+h().basename(b.ui).replace(/\.(tsx?|jsx?)$/,""),j=`import * as __user from ${JSON.stringify(i)};
import { createElement } from "react";
import { createRoot } from "react-dom/client";
const __root = typeof document !== "undefined"
  ? document.getElementById("root")
  : null;
const __Component = (__user && typeof __user === "object")
  ? (__user["default"] ?? __user["App"])
  : null;
if (__root && typeof __Component === "function") {
  createRoot(__root).render(createElement(__Component));
}
`,k=await e.build({stdin:{contents:j,resolveDir:c,sourcefile:"_reflex-bootstrap.tsx",loader:"tsx"},outfile:g,bundle:!0,format:"esm",platform:"browser",target:"es2022",jsx:"automatic",minify:!1,write:!0,sourcemap:"inline",external:w,plugins:[s([...w,...y])],logLevel:"silent"});m(k,"UI bundle");let l=await f.promises.stat(g);if(l.size>0x2800000)throw Error(`UI bundle too large: ${l.size} bytes (cap 41943040)`);await o(a);let p=[];if(b.serverActions.length>0){let a=h().join(c,"dist","actions");for(let d of(await f.promises.mkdir(a,{recursive:!0}),b.serverActions)){let b=h().join(c,d.entry);await n(b,`action ${d.name}`);let g=h().join(a,`${d.name}.js`),i=await e.build({entryPoints:[b],outfile:g,bundle:!0,format:"esm",platform:"node",target:"es2022",minify:!1,write:!0,sourcemap:"inline",external:x,plugins:[{name:"reflex-host-api-virtual",setup(a){a.onResolve({filter:/^@host\/api$/},a=>({path:a.path,namespace:"reflex-host-api"})),a.onLoad({filter:/.*/,namespace:"reflex-host-api"},()=>({contents:"const h = globalThis.__reflexHost;\nif (!h) throw new Error('@host/api not available — worker not bootstrapped?');\nexport const reflex = h;\nexport const llm = h.llm;\nexport const kb = h.kb;\nexport const fs = h.fs;\nexport const web = h.web;\nexport const audit = h.audit;\nexport const actions = h.actions;\nexport const mcp = h.mcp;\nexport const secrets = h.secrets;\nexport const agent = h.agent;\nexport const workflow = h.workflow;\nexport const cards = h.cards;\nexport default h;\n",loader:"js"}))}},s([...x,"@host/api"])],logLevel:"silent"});m(i,`action ${d.name}`);let j=await f.promises.stat(g);if(j.size>0x2800000)throw Error(`action ${d.name} bundle too large: ${j.size}`);p.push({name:d.name,size:j.size})}}return{uiBundleSize:l.size,actionBundles:p}}function m(a,b){if(a.errors&&a.errors.length>0){let c=a.errors.map(a=>`${a.location?.file}:${a.location?.line??"?"}: ${a.text}`).join("\n");throw Error(`esbuild failed for ${b}:
${c}`)}}async function n(a,b){try{await f.promises.access(a)}catch{throw Error(`${b} entry not found: ${a}`)}}async function o(a){let{dir:b}=a,c=await p(b),d=new Set;for(let a of c){let b=await f.promises.readFile(a,"utf8");for(let a of q(b))d.add(a)}for(let a of q(j.g))d.add(a);let e=(await (0,i.compile)(`@import "tailwindcss";
`,{base:process.cwd(),onDependency:()=>{}})).build([...d]);await f.promises.writeFile(h().join(b,"style.css"),e,"utf8")}async function p(a){let b=[],c=async a=>{for(let d of(await f.promises.readdir(a,{withFileTypes:!0}))){let e=h().join(a,d.name);if(d.isDirectory()){if("data"===d.name||"dist"===d.name||"node_modules"===d.name)continue;await c(e)}else/\.(tsx?|jsx?|html|css|md)$/.test(d.name)&&b.push(e)}};return await c(a),b}function q(a){return a.split(/[\s"'`{}();,<>=]+/).filter(a=>a.length>0&&/^[a-zA-Z@!-]/.test(a))}let z={mermaid:"dist/mermaid.esm.min.mjs"};function r(a){if(null==a)return null;if("string"==typeof a)return a;if("object"!=typeof a)return null;for(let b of["browser","import","module","default","require"])if(b in a){let c=r(a[b]);if(c)return c}return null}function s(a){let b=new Set(a),c=new Set(y),d=h().join(process.cwd(),"node_modules");return{name:"reflex-import-whitelist",setup(a){a.onResolve({filter:/.*/},a=>{if(a.importer.startsWith(d+h().sep)||a.importer.includes(h().sep+"node_modules"+h().sep)||a.path.startsWith(".")||a.path.startsWith("/")||h().isAbsolute(a.path))return null;if(a.path.startsWith("node:"))return{errors:[{text:`import "${a.path}" is not allowed in utility code`}]};if(!b.has(a.path))return{errors:[{text:`import "${a.path}" is not in the allowed list: ${Array.from(b).join(", ")}`}]};if(a.path.startsWith("@host/"))return{path:a.path,external:!0};if(c.has(a.path)){let b=function(a){let b,c=a.split("/"),d=a.startsWith("@")?c.slice(0,2).join("/"):c[0],e=a.startsWith("@")?c.slice(2):c.slice(1),g=e.length>0?"./"+e.join("/"):".",i=h().join(process.cwd(),"node_modules",d);if("."===g&&d&&z[d]){let a=h().join(i,z[d]);if((0,f.existsSync)(a))return a}let j=h().join(i,"package.json");if(!(0,f.existsSync)(j))return null;try{b=JSON.parse((0,f.readFileSync)(j,"utf8"))}catch{return null}let k=function(a,b){if(null==a)return null;if("string"==typeof a)return"."===b?a:null;if("object"!=typeof a)return null;if(Object.keys(a).some(a=>a.startsWith("."))){let c=a[b];return void 0!==c?r(c):null}return"."===b?r(a):null}(b.exports,g);if(null!==k){let a=h().join(i,k);return(0,f.existsSync)(a)?a:null}if("."===g){let a=b.module??b.main??"index.js",c=h().join(i,a);return(0,f.existsSync)(c)?c:null}for(let a of["",".js",".mjs",".cjs"]){let b=h().join(i,g.slice(2)+a);if((0,f.existsSync)(b))return b}return null}(a.path);return b?{path:b}:{errors:[{text:`could not resolve "${a.path}" from Reflex node_modules`}]}}return null})}}}async function t(a){return l(a)}function u(a){return h().join(a,"bundle.js")}function v(a,b){return h().join(a,"dist","actions",`${b}.js`)}d()}catch(a){d(a)}})},85933:(a,b,c)=>{c.d(b,{g:()=>d});let d=String.raw`import { createElement, forwardRef } from "react";

function cls(...parts) {
  return parts.filter(Boolean).join(" ");
}

export const Button = forwardRef(function Button(
  { variant = "default", size = "default", className, ...props },
  ref,
) {
  const v = {
    default: "bg-slate-900 text-white hover:bg-slate-800",
    secondary: "bg-slate-100 text-slate-900 hover:bg-slate-200",
    outline: "border border-slate-300 bg-white hover:bg-slate-50",
    destructive: "bg-red-600 text-white hover:bg-red-700",
    ghost: "hover:bg-slate-100",
  }[variant] ?? "";
  const s = {
    default: "h-9 px-4 py-2 text-sm",
    sm: "h-8 px-3 text-xs",
    lg: "h-11 px-6 text-base",
    icon: "h-9 w-9 p-0",
  }[size] ?? "";
  return createElement("button", {
    ref,
    className: cls(
      "inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 disabled:opacity-50 disabled:pointer-events-none",
      v, s, className,
    ),
    ...props,
  });
});

export const Input = forwardRef(function Input({ className, ...props }, ref) {
  return createElement("input", {
    ref,
    className: cls(
      "flex h-9 w-full rounded-md border border-slate-300 bg-white px-3 py-1 text-sm placeholder:text-slate-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 disabled:opacity-50",
      className,
    ),
    ...props,
  });
});

export const Textarea = forwardRef(function Textarea({ className, ...props }, ref) {
  return createElement("textarea", {
    ref,
    className: cls(
      "flex min-h-[80px] w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-sm placeholder:text-slate-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 disabled:opacity-50",
      className,
    ),
    ...props,
  });
});

export function Label({ className, ...props }) {
  return createElement("label", {
    className: cls("text-xs font-medium text-slate-600", className),
    ...props,
  });
}

export function Card({ className, ...props }) {
  return createElement("div", {
    className: cls(
      "rounded-lg border border-slate-200 bg-white shadow-sm",
      className,
    ),
    ...props,
  });
}

export function CardContent({ className, ...props }) {
  return createElement("div", {
    className: cls("p-4", className),
    ...props,
  });
}

export function CardHeader({ className, ...props }) {
  return createElement("div", {
    className: cls("p-4 border-b border-slate-100", className),
    ...props,
  });
}

export function CardTitle({ className, ...props }) {
  return createElement("h3", {
    className: cls("text-base font-semibold", className),
    ...props,
  });
}

export function Badge({ variant = "default", className, ...props }) {
  const v = {
    default: "bg-slate-900 text-white",
    secondary: "bg-slate-100 text-slate-900",
    outline: "border border-slate-300 text-slate-700",
  }[variant] ?? "";
  return createElement("span", {
    className: cls(
      "inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium",
      v, className,
    ),
    ...props,
  });
}

export function ScrollArea({ className, children }) {
  return createElement("div", {
    className: cls("overflow-y-auto", className),
  }, children);
}
`}};