import { defineComponent as R, computed as V, createElementBlock as x, openBlock as a, createElementVNode as y, createVNode as p, unref as e, isRef as i, withCtx as _, createBlock as g, createCommentVNode as k, useModel as $, resolveComponent as f, normalizeClass as C, Fragment as w, renderList as M, toDisplayString as T } from "vue";
import { a as B } from "./app-dOrzXjgr.js";
import { storeToRefs as D } from "pinia";
import { a as I } from "./NavigationTab.vue_vue_type_script_setup_true_lang-TBmbqppw.js";
import { _ as U } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-BuO42-MR.js";
import { _ as N, b as S } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DXtWF7LP.js";
import { useRoute as z } from "vue-router";
import { useBreakpoints as E } from "@feedmepos/ui-library";
const L = { class: "flex flex-col gap-2 overflow-x-auto overflow-y-hidden scrollbar-hide" }, O = { class: "flex flex-col gap-2 py-2" }, q = /* @__PURE__ */ R({
  __name: "Filter",
  setup(F) {
    const {
      locations: d,
      selectedLocationIds: n,
      dateRange: c,
      compareDateRange: l,
      timeRange: m,
      defaultDateSetting: s,
      selectTimeDefault: u
    } = D(B()), v = z(), r = V(() => v.name === "overview");
    return (b, t) => (a(), x("div", L, [
      y("div", O, [
        p(I, {
          modelValue: e(n),
          "onUpdate:modelValue": t[5] || (t[5] = (o) => i(n) ? n.value = o : null),
          options: e(d)
        }, {
          default: _(() => [
            p(U, {
              "date-range": e(c),
              "onUpdate:dateRange": t[0] || (t[0] = (o) => i(c) ? c.value = o : null),
              "compare-date-range": e(l),
              "onUpdate:compareDateRange": t[1] || (t[1] = (o) => i(l) ? l.value = o : null),
              "compare-type": e(s).defaultCompareType,
              "onUpdate:compareType": t[2] || (t[2] = (o) => e(s).defaultCompareType = o),
              compare: ""
            }, null, 8, ["date-range", "compare-date-range", "compare-type"]),
            p(N, {
              "time-range": e(m),
              "onUpdate:timeRange": t[3] || (t[3] = (o) => i(m) ? m.value = o : null),
              "select-time-default": e(u),
              "onUpdate:selectTimeDefault": t[4] || (t[4] = (o) => i(u) ? u.value = o : null),
              "default-date-range": e(s).timeOptions
            }, null, 8, ["time-range", "select-time-default", "default-date-range"]),
            r.value ? k("", !0) : (a(), g(S, { key: 0 }))
          ]),
          _: 1
        }, 8, ["modelValue", "options"])
      ])
    ]));
  }
}), j = { class: "fm-typo-en-body-md-400" }, X = /* @__PURE__ */ R({
  __name: "MenuTab",
  props: {
    modelValue: { required: !1, default: [] },
    modelModifiers: {}
  },
  emits: ["update:modelValue"],
  setup(F) {
    const d = $(F, "modelValue"), { breakpoints: n } = E();
    return (c, l) => {
      const m = f("FmButton"), s = f("FmIcon"), u = f("FmMenuItem"), v = f("FmMenu");
      return a(), x("div", {
        "data-menu-tab": "true",
        class: C(["flex items-start pb-2 px-24", `${e(n).lg || e(n).md ? "px-24" : "pl-3"}`])
      }, [
        p(q),
        l[0] || (l[0] = y("div", { class: "flex grow" }, null, -1)),
        d.value.length > 0 ? (a(), g(v, {
          key: 0,
          trigger: "click",
          placement: "left",
          shift: !0,
          class: C(e(n).sm || e(n).xs ? "pr-3" : "")
        }, {
          "menu-button": _(() => [
            p(m, {
              "append-icon": "more_vert",
              variant: "tertiary",
              size: "md",
              class: "w-[36px] bg-none"
            })
          ]),
          default: _(() => [
            (a(!0), x(w, null, M(d.value, (r, b) => (a(), g(u, {
              key: `button-${b}`,
              onClick: r.onClick
            }, {
              label: _(() => [
                r.prependIcon ?? !1 ? (a(), g(s, {
                  key: 0,
                  name: r.icon
                }, null, 8, ["name"])) : k("", !0),
                y("p", j, T(r.label), 1)
              ]),
              _: 2
            }, 1032, ["onClick"]))), 128))
          ]),
          _: 1
        }, 8, ["class"])) : k("", !0)
      ], 2);
    };
  }
});
export {
  X as _
};
