import { j as jsxRuntimeExports } from "../../../../../_virtual/jsx-runtime.js";
import components_default, { STATUS } from "../../../../../node_modules/.pnpm/react-joyride@2.9.3_@types_react@19.1.13_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/react-joyride/dist/index.js";
import { tours } from "../tours/index.js";
import { useLocalStorage } from "../../../../../node_modules/.pnpm/usehooks-ts@3.1.1_react@19.1.1/node_modules/usehooks-ts/dist/index.js";
function Tour() {
  const [seenTours, setSeenTours] = useLocalStorage("seen_tours", []);
  const [toursDisabled, setToursDisabled] = useLocalStorage("tours_disabled", false);
  if (toursDisabled) {
    return null;
  }
  const selectedTour = Object.entries(tours).find(([tourId2]) => !seenTours.includes(tourId2));
  const [tourId, steps] = selectedTour || [];
  const handleJoyrideCallback = (data) => {
    const { status } = data;
    if (tourId && (status === STATUS.FINISHED || status === STATUS.SKIPPED)) {
      setSeenTours((prev) => [...prev, tourId]);
    }
  };
  if (tourId && steps) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      components_default,
      {
        steps,
        callback: handleJoyrideCallback,
        continuous: true,
        showSkipButton: true,
        hideCloseButton: true,
        locale: {
          back: "Back",
          close: "Close",
          last: "Finish",
          next: "Next",
          nextLabelWithProgress: "Next ({step}/{steps})",
          skip: "Skip tour"
        },
        styles: {
          buttonNext: {
            backgroundColor: "#7270c6",
            padding: "0.7rem 2rem",
            borderRadius: "0.25rem"
          },
          buttonBack: {
            padding: "0.7rem 2rem",
            backgroundColor: "#EFEFEF",
            borderRadius: "0.25rem",
            color: "#333"
          },
          buttonSkip: {
            padding: "0.7rem 1rem",
            backgroundColor: "#E5E5E5",
            borderRadius: "0.25rem",
            color: "#333",
            width: "auto"
          },
          buttonClose: {
            scale: 0.7,
            borderRadius: "0.25rem",
            padding: "10px"
          },
          tooltip: {
            fontFamily: "inherit",
            padding: "0",
            borderRadius: "0.50rem"
          },
          tooltipFooter: {
            padding: "0.5rem",
            backgroundColor: "#f9f9f9",
            borderTop: "1px solid #e5e5e5",
            borderBottomLeftRadius: "0.5rem",
            borderBottomRightRadius: "0.5rem"
          },
          tooltipTitle: {
            textAlign: "left",
            fontWeight: "500",
            fontSize: "1rem",
            padding: "1rem 1rem 0 1rem",
            fontFamily: "inherit"
          },
          tooltipContent: {
            textAlign: "left",
            padding: "1rem",
            fontFamily: "inherit",
            fontSize: "0.9rem"
          }
        }
      }
    );
  }
  return null;
}
export {
  Tour as default
};
//# sourceMappingURL=Tour.js.map
