import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  messages_default
} from "./chunk-HEANTKSX.js";
import {
  runCommand
} from "./chunk-CFEDWLQU.js";
import {
  ProjectModelProvider
} from "./chunk-75INKCQL.js";
import "./chunk-4BLGYECY.js";
import {
  HttpClientProvider,
  buildHttpClientHeaders
} from "./chunk-WFQIXGJV.js";
import {
  PanoramaProvider
} from "./chunk-ECBO3UFC.js";
import "./chunk-YNEGRO3E.js";
import {
  addUserFields
} from "./chunk-VC5Q2AI5.js";
import {
  BiProvider,
  ErrorReporterProvider,
  SiteAuthProvider
} from "./chunk-HWT3LUJJ.js";
import "./chunk-TOBTRYZF.js";
import {
  I18nProvider
} from "./chunk-7WVNO7VU.js";
import "./chunk-RPTAJN5Y.js";
import {
  render
} from "./chunk-YL4347CI.js";
import {
  require_react
} from "./chunk-TODKQSCF.js";
import "./chunk-AFPDHQYI.js";
import "./chunk-HYKBBZLS.js";
import "./chunk-C5RTKQVL.js";
import "./chunk-SVUXJRFD.js";
import "./chunk-YT5BPQDJ.js";
import "./chunk-LU3R3EBR.js";
import "./chunk-XZUGLEBK.js";
import "./chunk-VASURI4S.js";
import "./chunk-SDLCFZRL.js";
import "./chunk-MTT3QXBC.js";
import {
  __toESM,
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// ../cli-site-old/src/commands/render-command.tsx
init_esm_shims();
var import_react = __toESM(require_react(), 1);
async function renderCommand(command, services, cliVersion, component) {
  await runCommand(command, services, cliVersion, async (model) => {
    const { biLogger, errorReporter, panorama } = services;
    const handleLogin = (userInfo) => {
      errorReporter.setUser({ id: userInfo.userId });
      addUserFields(biLogger, userInfo.userId);
    };
    const headers = buildHttpClientHeaders({
      flow: "Sites",
      command: command.name(),
      cliVersion
    });
    await render(
      /* @__PURE__ */ import_react.default.createElement(BiProvider, { value: biLogger }, /* @__PURE__ */ import_react.default.createElement(ErrorReporterProvider, { value: errorReporter }, /* @__PURE__ */ import_react.default.createElement(PanoramaProvider, { value: panorama }, /* @__PURE__ */ import_react.default.createElement(SiteAuthProvider, { siteId: model.metaSiteId, onLogin: handleLogin }, /* @__PURE__ */ import_react.default.createElement(HttpClientProvider, { headers }, /* @__PURE__ */ import_react.default.createElement(I18nProvider, { messages: messages_default }, /* @__PURE__ */ import_react.default.createElement(ProjectModelProvider, { value: model }, component)))))))
    );
  });
}
export {
  renderCommand
};
//# sourceMappingURL=render-command-X3PU3L7E.js.map