import { jsx as e, jsxs as r } from "react/jsx-runtime";
import { useCallback as u } from "react";
import { countryOptions as h } from "../schemas.js";
import f from "../../../hooks/useStepperState.js";
import y from "../../../hooks/useStepperHandlers.js";
import S from "../../../../form/hooks/useZodForm.js";
import N from "../../../hooks/useStepperBeforeNavigate.js";
import x from "../../../../form/Form.js";
import C from "../../../../box/Box.js";
import t from "../../../../field/Field.js";
import a from "../../../../field/components/field-label/FieldLabel.js";
import o from "../../../../field/components/field-control/FieldControl.js";
import l from "../../../../input/Input.js";
import g from "../../../../select/Select.js";
const q = ({ id: D }) => {
  const { currentStep: d } = f(), { setStepData: c } = y(), { schema: m, defaultValues: s } = d.initialData, n = S({ schema: m, defaultValues: d.storedData ?? s });
  N(async (i) => {
    if (i.type === "next" && !await n.trigger()) return !1;
    c("company", n.getValues());
  });
  const p = u(
    (i) => {
      n.setValue("country", i, { shouldValidate: !0 });
    },
    [n]
  );
  return /* @__PURE__ */ e(x, { form: n, onSubmit: () => {
  }, noValidate: !0, children: /* @__PURE__ */ r(C, { className: "flex flex-col gap-[var(--spacing-6)]", children: [
    /* @__PURE__ */ r(t, { name: "firstName", children: [
      /* @__PURE__ */ e(a, { required: !0, children: "First Name" }),
      /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(l, { placeholder: "Sebastian" }) })
    ] }),
    /* @__PURE__ */ r(t, { name: "lastName", children: [
      /* @__PURE__ */ e(a, { required: !0, children: "Last Name" }),
      /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(l, { placeholder: "Evers" }) })
    ] }),
    /* @__PURE__ */ r(t, { name: "companyName", children: [
      /* @__PURE__ */ e(a, { required: !0, children: "Company Name" }),
      /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(l, { placeholder: "Tassen-Tycoon Evers" }) })
    ] }),
    /* @__PURE__ */ r(t, { name: "address", children: [
      /* @__PURE__ */ e(a, { required: !0, children: "Address" }),
      /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(l, { placeholder: "Rheinstr. 3, 33602 Bielefeld" }) })
    ] }),
    /* @__PURE__ */ r(t, { name: "country", children: [
      /* @__PURE__ */ e(a, { required: !0, children: "Country" }),
      /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(g, { options: h, placeholder: "Select a country", onChange: p, value: n.watch("country") }) })
    ] }),
    /* @__PURE__ */ r(t, { name: "taxId", children: [
      /* @__PURE__ */ e(a, { required: !0, children: "Tax ID" }),
      /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(l, { placeholder: "DE123456789" }) })
    ] }),
    /* @__PURE__ */ r(t, { name: "phone", children: [
      /* @__PURE__ */ e(a, { required: !0, children: "Phone Number" }),
      /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(l, { placeholder: "+49 521 123456" }) })
    ] })
  ] }) });
};
q.displayName = "CompanyDataStep";
export {
  q as default
};
//# sourceMappingURL=CompanyDataStep.js.map
