;
{
  try {
    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5075bc13-deef-4356-937f-70acbb37626a", e._sentryDebugIdIdentifier = "sentry-dbid-5075bc13-deef-4356-937f-70acbb37626a");
  } catch (e) {
  }
}
;
import { u as useTranslation, a as addResourceBundles, L as Loader, a8 as EntityTypes, g as getLegalEntityCountry, j as TaskTypes, _ as __variableDynamicImportRuntimeHelper } from "./StoreProvider-CqQrndhS.js";
import { jsx } from "preact/jsx-runtime";
import { u as useCapabilityProblems, g as getProblemsForEntity } from "./getProblemsForEntity-C1PgQbDM.js";
import { f as filterProblemsByTaskForms } from "./filterProblemsByTaskForms-Cz7iQtms.js";
import { u as useBusinessDetailsData, g as getForms, B as BusinessDetailsDropin } from "./useBusinessDetailsData-CoYJKPS2.js";
const RootBusinessDetailsPage = ({
  onSubmit,
  handleHomeClick
}) => {
  const { i18n } = useTranslation();
  const capabilityProblems = useCapabilityProblems();
  const taskType = TaskTypes.BUSINESS_DETAILS;
  const { data, isLoading } = useBusinessDetailsData(taskType);
  addResourceBundles(i18n, [
    { ns: "business", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../language/bg-BG.json": () => import("./bg-BG-CFuVZnaC.js"), "../language/cs-CZ.json": () => import("./cs-CZ-CYsR__kj.js"), "../language/da-DK.json": () => import("./da-DK-B3Pg-MWO.js"), "../language/de-DE.json": () => import("./de-DE-S6qDey1L.js"), "../language/el-GR.json": () => import("./el-GR-DoS_Va-n.js"), "../language/en-US.json": () => import("./en-US-DLY20x1O.js"), "../language/es-ES.json": () => import("./es-ES-BYl5-PFR.js"), "../language/et-EE.json": () => import("./et-EE-4fHYOoff.js"), "../language/fi-FI.json": () => import("./fi-FI-DFxljML-.js"), "../language/fr-FR.json": () => import("./fr-FR-DPehHVb6.js"), "../language/hr-HR.json": () => import("./hr-HR-Bjx-KdVs.js"), "../language/hu-HU.json": () => import("./hu-HU-B-lUkFnQ.js"), "../language/it-IT.json": () => import("./it-IT-DOBp2-MP.js"), "../language/ja-JP.json": () => import("./ja-JP-Bv3ru9Xq.js"), "../language/lt-LT.json": () => import("./lt-LT-WRulV980.js"), "../language/lv-LV.json": () => import("./lv-LV-C9Dhkruv.js"), "../language/nl-NL.json": () => import("./nl-NL-SjOGmGk5.js"), "../language/no-NO.json": () => import("./no-NO-BAWVf0GX.js"), "../language/pl-PL.json": () => import("./pl-PL-DEMxxz7h.js"), "../language/pt-BR.json": () => import("./pt-BR-BfDe_8iW.js"), "../language/pt-PT.json": () => import("./pt-PT-F1qPZJ2c.js"), "../language/ro-RO.json": () => import("./ro-RO-0vx6ZLWV.js"), "../language/sk-SK.json": () => import("./sk-SK-DuLm2CVx.js"), "../language/sl-SI.json": () => import("./sl-SI-BAIm-qBe.js"), "../language/sv-SE.json": () => import("./sv-SE-BZNey_8S.js") }), `../language/${lang}.json`, 3) }
  ]);
  if (isLoading) {
    return /* @__PURE__ */ jsx(Loader, {});
  }
  const { rootLe, efpBusinessLines, documents } = data;
  const entityProblems = capabilityProblems ? getProblemsForEntity(capabilityProblems, EntityTypes.LEGAL_ENTITY, rootLe.id) : void 0;
  const country = getLegalEntityCountry(rootLe);
  const initialForms = Object.keys(getForms(country, taskType));
  const problemsByTask = filterProblemsByTaskForms(entityProblems, initialForms);
  return /* @__PURE__ */ jsx(
    BusinessDetailsDropin,
    {
      taskType,
      legalEntityResponse: rootLe,
      efpBusinessLines,
      documents,
      problems: problemsByTask,
      country,
      onSubmit,
      handleHomeClick
    }
  );
};
export {
  RootBusinessDetailsPage
};
