import { jsxs as p, Fragment as u, jsx as r } from "react/jsx-runtime";
import { useState as c } from "react";
import { useLoadFrmType as d } from "./hooks/useLoadFiles.js";
import { u as f } from "./useQuery-n4ls1rLk.js";
import i from "./components/AlertDialog/index.js";
import n from "./components/Buttons/index.js";
import { BasicFormProvider as F } from "./components/FormProvider.js";
import { F as a } from "./index-ec7CVlTE.js";
import { formClient as v } from "./config/index.js";
import "./index.esm--ZdnNCdl.js";
import "./_commonjsHelpers-2ufMB8rV.js";
import "./context/generalContext/index.js";
import "./context/index.js";
import "react-dom";
import "./components/Icons.js";
import "./utils/functions.js";
import "./clsx-7d8NmkQq.js";
import "./utils/components/RenderIf.js";
import "./components/AlertDialog/variants.js";
import "./index-xVF7D3FM.js";
import "./index.esm-BQxOvVZs.js";
import "./components/Buttons/variants.js";
import "./composables/Modal.js";
import "./hooks/useAnimatePresence.js";
import "./SVGVisualElement-aqO4D4Z5.js";
import "./use-unmount-effect-Wy5iLAex.js";
import "./index-T7wQHOux.js";
import "./LayoutGroupContext-3euHzeKi.js";
import "./feature/govco/FormModal.js";
import "./feature/RenderFeatureComponents.js";
import "./components/Layouts.js";
import "./hooks/useHasNextSiblingByAttribute.js";
import "./index-OHO5PlsB.js";
import "./utils/components/RenderEach.js";
import "./components/Inputs/variants.js";
import "./motion-dVICNqWI.js";
import "./components/Maps/index.js";
import "./hooks/useDeepCompareEffect.js";
import "./components/Inputs/InputFileSimple.js";
import "./hooks/useUploadFiles.js";
import "./axios-f2q_J-wz.js";
import "./components/Inputs/CircleProgressLoading.js";
import "./PdfViewer-tzZO2boW.js";
import "./index-XF2mSoW7.js";
import "./index-JtU1DT1I.js";
import "./index-5sPke2Og.js";
import "./components/Table/components/Basic.js";
import "./components/Table/context/index.js";
import "./components/Table/utils/useTableInfoRest.js";
import "./components/Table/components/Elements.js";
import "./dayjs.min-KYonM6tp.js";
import "./components/Table/components/TdComponents/WrapperTableTdComponents.js";
import "./components/Table/components/variants.js";
import "./components/Table/components/Filters.js";
import "./hooks/useClickOutside.js";
import "./components/Table/context/useCases.js";
import "./components/Table/hooks/usePaginationSelector.js";
import "./components/Table/hooks/useHandleInputWithTimer.js";
import "./components/Table/components/TableStatesComponents.js";
import "./components/Table/components/HeaderComponents/QuickSearch.js";
import "./composables/FunctionalComponents.js";
import "./hooks/useDebounce.js";
import "./style.module-m7wnmRz9.js";
const Dr = () => {
  const [e, m] = c(!1), { configFrm: o } = d(), l = f(), s = async (t) => {
    await v.put("frmtype", {
      id: "42404B79-6BA6-EE11-B9E7-C87F5406F554",
      name: "formulario test",
      description: "este es un formulario",
      jsx: t.jsx,
      functions: t.functions || "5971536A-6BA6-EE11-B9E7-C87F5406F554"
    }), l.invalidateQueries({ queryKey: ["frmtype"] }), m(!1);
  };
  return o ? /* @__PURE__ */ p(u, { children: [
    /* @__PURE__ */ r("div", { className: "_flex", children: /* @__PURE__ */ r(n.Button, { onClick: () => m(!e), children: "Editar Formulario" }) }),
    /* @__PURE__ */ r(i.AlertDialog, { open: e, children: /* @__PURE__ */ p(i.AlertDialogContent, { variant: { variant: "govco" }, children: [
      /* @__PURE__ */ r(i.AlertDialogHeader, { variants: { variant: "govco" }, closeModal: () => m(!1), children: "Editar formulario" }),
      /* @__PURE__ */ p(
        F,
        {
          className: "_px-2",
          submit: (t) => s(t),
          defaultValue: { jsx: o == null ? void 0 : o.jsx, functions: o == null ? void 0 : o.functions },
          children: [
            /* @__PURE__ */ r(
              a.InputFormCntx,
              {
                currentId: "functions",
                label: "GUID de los esquemas (validación, formulas, etc.)",
                placeholder: "ej: 5971536A-6BA6-EE11-B9E7-C87F5406F554"
              }
            ),
            /* @__PURE__ */ r(a.TextAreaFormCntx, { currentId: "jsx", inputProps: { rows: 15, style: { resize: "none" } }, label: "Plantilla del formulario" }),
            /* @__PURE__ */ r(i.AlertDialogFooter, { variants: { variant: "govco" }, children: /* @__PURE__ */ r(n.FormButton, { children: "Editar" }) })
          ]
        }
      )
    ] }) })
  ] }) : "loading...";
};
export {
  Dr as ConfigForm
};
