import { defineComponent as w, computed as l, resolveComponent as y, createBlock as p, openBlock as s, withCtx as k, createVNode as i, createElementVNode as c, unref as e, normalizeStyle as b, normalizeClass as d, createElementBlock as h } from "vue";
import { _ as I } from "./TileGrid.vue_vue_type_script_setup_true_lang-jbujDyFY.js";
import { u as $, l as B } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DXtWF7LP.js";
import { _ as C } from "./Default.vue_vue_type_script_setup_true_lang-8Lfk9D0S.js";
import { storeToRefs as z } from "pinia";
import { _ as P } from "./SelectComponent.vue_vue_type_script_setup_true_lang-CGbb3b5G.js";
import { useBreakpoints as R } from "@feedmepos/ui-library";
import { _ as S } from "./MenuTab.vue_vue_type_script_setup_true_lang-CpLX_mmh.js";
import { useI18n as V } from "@feedmepos/mf-common";
import { r as D } from "./i18n-CI_sQ5d_.js";
const E = { class: "sticky top-0 z-10 bg-white" }, M = /* @__PURE__ */ w({
  __name: "OverviewView",
  setup(F) {
    const { t: n, te: u } = V(), f = $(), { breakpoints: o } = R(), { isOpenDownloadDialog: _, overviewReport: r } = z(f), a = l(() => {
      var t;
      return ((t = r.value) == null ? void 0 : t.tiles) || [];
    }), v = l(() => B(a.value)), x = l(() => {
      var t;
      return D(n, u, (t = r.value) == null ? void 0 : t.name, "other");
    });
    return (t, m) => {
      const g = y("FmPageHead");
      return s(), p(C, null, {
        default: k(() => [
          i(g, {
            title: x.value,
            class: "h-[68px]",
            actions: [
              {
                label: e(n)("report.common.download"),
                value: "download",
                isPrimary: !0,
                prependIcon: "download"
              }
            ],
            "onClick:action": m[0] || (m[0] = (H) => _.value = !0)
          }, null, 8, ["title", "actions"]),
          c("div", {
            class: d(`flex flex-col gap-2 overflow-y-auto ${e(o).sm || e(o).xs ? "mb-20" : ""}`),
            style: b({ height: `calc(100% - ${e(o).lg || e(o).md ? 72 : 64}px)` })
          }, [
            c("div", E, [
              i(S)
            ]),
            a.value.length > 0 && e(r) ? (s(), h("div", {
              key: 0,
              class: d(["grid grid-cols-12", e(o).sm || e(o).xs ? "px-3 gap-[16px]" : "px-24 gap-[24px]"])
            }, [
              i(I, {
                tiles: a.value,
                "report-id": e(r).id,
                "leaf-index-by-id": v.value
              }, null, 8, ["tiles", "report-id", "leaf-index-by-id"])
            ], 2)) : (s(), p(P, { key: 1 }))
          ], 6)
        ]),
        _: 1
      });
    };
  }
});
export {
  M as default
};
