import { jsx as a, Fragment as p } from "@emotion/react/jsx-runtime";
import { useEnvironment as I } from "@m4l/core";
import { ICONS as A } from "../../../../../../icons.js";
import { useAreasStore as r } from "../../../../../../hooks/useAreas/index.js";
import { shallow as e } from "zustand/shallow";
import { MenuActions as f } from "../../../../../../../MenuActions/MenuActions.js";
const b = () => {
  const { host_static_assets: c, environment_assets: m } = I(), n = r((o) => o.currentAreaId, e), s = r(
    (o) => o.hashAreas[n] ? o.hashAreas[n].maximizedId : !1,
    e
  ), { maximizeLayout: h } = r((o) => o.areaActions), l = r(
    (o) => o.hashAreas[o.currentAreaId]?.layoutItemsIds?.filter((t) => o.hashWindows[t].emergeType === "layout")?.map((t) => {
      const i = o.hashWindows[t];
      return {
        i: i.windowId,
        url_icon: i.iconUrl,
        title: i.title
      };
    }) ?? [],
    e
  ), u = (o) => {
    h(n, o);
  }, d = l.map((o) => ({
    type: "menuItem",
    onClick: () => u(o.i),
    label: o.title,
    urlIcon: o.url_icon,
    checkable: !0,
    checked: s === o.i
  }));
  return /* @__PURE__ */ a(p, { children: s && /* @__PURE__ */ a(
    f,
    {
      icon: `${c}/${m}/frontend/components/areas_admin/assets/icons/${A.PENDING_ORDER}`,
      arrowType: "no-arrow",
      marginTop: "12px",
      anchorOrigin: { vertical: "bottom", horizontal: "right" },
      transformOrigin: { vertical: "top", horizontal: "right" },
      menuActions: d
    }
  ) });
};
export {
  b as ChipActionsMobile
};
