import { jsx as n } from "@emotion/react/jsx-runtime";
import { useEnvironment as d, useModuleDictionary as v } from "@m4l/core";
import { useStepper as I } from "../../../hooks/useStepper/index.js";
import { useStepperActions as S } from "../../../hooks/useStepperActions/index.js";
import { pathIcons as i } from "../../../icons.js";
import { useIsMobile as $ } from "@m4l/graphics";
import { DICTIONARY as B } from "../../../dictionary.js";
import { IconButton as L } from "../../../../extended/mui/IconButton/IconButton.js";
import { Button as M } from "../../../../extended/mui/Button/Button.js";
function w(s) {
  const { label: p, forceIsMobile: t, ...c } = s, { currentStep: u } = I((b) => ({
    currentStep: b.currentStep
  })), { host_static_assets: o, environment_assets: e } = d(), a = $(), l = t !== void 0 ? t : a, { getLabel: m } = v(), { prevStepAction: f } = S(), r = () => {
    f();
  };
  return u === 0 ? null : l ? /* @__PURE__ */ n(
    L,
    {
      type: "button",
      onClick: r,
      icon: `${o}/${e}/${i.arrowLeft}`,
      "data-testid": "stepper-prev-button",
      variant: "outline",
      color: "default"
    }
  ) : /* @__PURE__ */ n(
    M,
    {
      type: "button",
      label: p || m(B.LABEL_PREV_BUTTON),
      variant: "outlined",
      color: "default",
      onClick: r,
      startIcon: `${o}/${e}/${i.arrowLeft}`,
      "data-testid": "stepper-prev-button",
      ...c
    }
  );
}
export {
  w as StepperPrevButton
};
