import { defineComponent, unref, mergeProps, useSSRContext, withCtx, createVNode } from "vue";
import { ssrRenderComponent } from "vue/server-renderer";
import { Head } from "@inertiajs/vue3";
import { _ as _sfc_main$2 } from "./AppLayout-DXKl-uoF.js";
import ApexChart from "vue3-apexcharts";
import "class-variance-authority";
import "./AppLogoIcon-DhmQfNIw.js";
import "clsx";
import "tailwind-merge";
import "reka-ui";
import "@vueuse/core";
import "lucide-vue-next";
import "./Input-CFG4Vy8n.js";
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  __name: "PolarAreaChart",
  __ssrInlineRender: true,
  props: {
    data: {}
  },
  setup(__props) {
    const props = __props;
    const options = {
      chart: {
        type: "polarArea"
      },
      stroke: {
        colors: ["#fff"]
      },
      fill: {
        opacity: 0.8
      },
      labels: props.data.labels,
      responsive: [
        {
          breakpoint: 480,
          options: {
            chart: {
              width: 300
            },
            legend: {
              position: "bottom"
            }
          }
        }
      ],
      legend: {
        position: "bottom"
      }
    };
    const series = props.data.values;
    return (_ctx, _push, _parent, _attrs) => {
      _push(ssrRenderComponent(unref(ApexChart), mergeProps({
        type: "polarArea",
        options,
        series: unref(series),
        width: "100%",
        height: "400",
        class: "max-w-[400px] mx-auto"
      }, _attrs), null, _parent));
    };
  }
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/components/PolarAreaChart.vue");
  return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Overview",
  __ssrInlineRender: true,
  props: {
    byRegion: {}
  },
  setup(__props) {
    const breadcrumbs = [
      {
        title: "Аналитика",
        href: "/analytics/overview"
      }
    ];
    const props = __props;
    const labels = props.byRegion.map((r) => r.region || "Не указан");
    const values = props.byRegion.map((r) => r.total);
    return (_ctx, _push, _parent, _attrs) => {
      _push(`<!--[-->`);
      _push(ssrRenderComponent(unref(Head), { title: "Аналитика" }, null, _parent));
      _push(ssrRenderComponent(_sfc_main$2, { breadcrumbs }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<div class="flex flex-1 flex-col gap-4 rounded-xl p-4"${_scopeId}><h1 class="text-2xl font-bold mb-4"${_scopeId}>Аналитика</h1>`);
            _push2(ssrRenderComponent(_sfc_main$1, {
              data: { labels: unref(labels), values: unref(values) }
            }, null, _parent2, _scopeId));
            _push2(`</div>`);
          } else {
            return [
              createVNode("div", { class: "flex flex-1 flex-col gap-4 rounded-xl p-4" }, [
                createVNode("h1", { class: "text-2xl font-bold mb-4" }, "Аналитика"),
                createVNode(_sfc_main$1, {
                  data: { labels: unref(labels), values: unref(values) }
                }, null, 8, ["data"])
              ])
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`<!--]-->`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/pages/analytics/Overview.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as default
};
