import { useMemo as n } from "react";
import { useEnvironment as w, useModuleDictionary as f } from "@m4l/core";
import { usePopupsStore as l } from "./usePopupsStore.js";
import { shallow as d } from "zustand/shallow";
import { useIsMobile as A } from "@m4l/graphics";
import { getLeftActions as h, getInsideMenuActions as M } from "../../../../WindowBase/helpers.js";
const x = ({
  popupId: e
}) => {
  const { host_static_assets: a, environment_assets: p } = w(), { getLabel: i } = f(), t = A(), r = `${a}/${p}`, s = l(
    (o) => o.hashPopups[e]?.moduleActions || [],
    d
  ), m = n(() => h(t, s).map((o) => ({
    ...o,
    place: "left"
  })), [t, s]), c = l(
    (o) => o.hashPopups[e]?.windowOptions,
    d
  ), u = n(() => M({
    windowId: e,
    isMobile: t,
    moduleActions: s,
    urlPrefix: r,
    saveModuleCookies: () => {
      throw new Error("Not implemented");
    },
    resetModuleCookies: () => {
      throw new Error("Not implemented");
    },
    windowOptions: c,
    getLabel: i
  }), [
    e,
    t,
    s,
    r,
    c,
    i
  ]);
  return n(() => [...m, ...u], [m, u]);
};
export {
  x as useHeaderActionsPopups
};
