import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  messages_default
} from "./chunk-HEANTKSX.js";
import {
  runCommand
} from "./chunk-4THLGEJA.js";
import {
  ProjectModelProvider
} from "./chunk-KSFSFWUC.js";
import "./chunk-4BLGYECY.js";
import {
  HttpClientProvider,
  buildHttpClientHeaders
} from "./chunk-BRX4HWJE.js";
import {
  PanoramaProvider
} from "./chunk-ZBFOAJ5H.js";
import "./chunk-YNEGRO3E.js";
import {
  addUserFields
} from "./chunk-HENH75UF.js";
import {
  BiProvider,
  ErrorReporterProvider,
  SiteAuthProvider
} from "./chunk-YHFCDWGT.js";
import "./chunk-IVQPYJ5M.js";
import {
  I18nProvider
} from "./chunk-MDUBZZTI.js";
import "./chunk-RPTAJN5Y.js";
import {
  render
} from "./chunk-QK47PIWK.js";
import {
  require_react
} from "./chunk-TODKQSCF.js";
import "./chunk-AFPDHQYI.js";
import "./chunk-HYKBBZLS.js";
import "./chunk-C5RTKQVL.js";
import "./chunk-DGJS6KZB.js";
import "./chunk-YT5BPQDJ.js";
import "./chunk-LU3R3EBR.js";
import "./chunk-XZUGLEBK.js";
import "./chunk-AYCGCYN3.js";
import "./chunk-SDLCFZRL.js";
import "./chunk-WGV2XQSB.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-S6KVN6AK.js.map