import {
  TaxRegionTable,
  useTaxRegionTable
} from "./chunk-3IZSQI6K.js";
import "./chunk-PEXMLTJX.js";
import "./chunk-N2TQXB44.js";
import {
  useTaxRegionTableQuery
} from "./chunk-AYVH6Q5O.js";
import "./chunk-JRTZWK77.js";
import "./chunk-U2EI2ZLM.js";
import {
  SingleColumnPage
} from "./chunk-YV6MK4PZ.js";
import "./chunk-KCHYLLVG.js";
import "./chunk-CVXKASWV.js";
import "./chunk-THHRRYRS.js";
import "./chunk-INNFZYX2.js";
import "./chunk-BDGZ4EQO.js";
import "./chunk-LAVHRER2.js";
import "./chunk-Y7QKP6QU.js";
import "./chunk-FV76G2D7.js";
import {
  useTaxRegions
} from "./chunk-GHDLST2P.js";
import "./chunk-RHKRREUU.js";
import "./chunk-ZA2KFUFR.js";
import "./chunk-DTGEFKK4.js";
import "./chunk-NBMM2TZK.js";

// src/pages/settings/tax-regions/index.tsx
import { WidgetZone } from "@mercurjs/dashboard-shared";

// src/pages/settings/tax-regions/_components/tax-region-list-view.tsx
import { Container, Heading, Text } from "@medusajs/ui";
import { keepPreviousData } from "@tanstack/react-query";
import { useTranslation } from "react-i18next";
import { jsx, jsxs } from "react/jsx-runtime";
var PAGE_SIZE = 20;
var TaxRegionListView = () => {
  const { t } = useTranslation();
  const { searchParams, raw } = useTaxRegionTableQuery({
    pageSize: PAGE_SIZE
  });
  const { tax_regions, count, isPending, isError, error } = useTaxRegions(
    {
      ...searchParams,
      order: "country_code",
      parent_id: "null"
    },
    {
      placeholderData: keepPreviousData
    }
  );
  const { table } = useTaxRegionTable({
    count,
    data: tax_regions,
    pageSize: PAGE_SIZE
  });
  if (isError) {
    throw error;
  }
  return /* @__PURE__ */ jsx(Container, { className: "divide-y p-0", children: /* @__PURE__ */ jsxs(
    TaxRegionTable,
    {
      action: {
        to: "create",
        label: t("actions.create")
      },
      isPending,
      queryObject: raw,
      table,
      count,
      children: [
        /* @__PURE__ */ jsx(Heading, { children: t("taxes.domain") }),
        /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle text-pretty", children: t("taxRegions.list.hint") })
      ]
    }
  ) });
};

// src/pages/settings/tax-regions/index.tsx
import { jsx as jsx2 } from "react/jsx-runtime";
var TaxRegionsList = () => {
  return /* @__PURE__ */ jsx2(SingleColumnPage, { hasOutlet: true, children: /* @__PURE__ */ jsx2(WidgetZone, { id: "tax-regions.list", children: /* @__PURE__ */ jsx2(TaxRegionListView, {}) }) });
};
var Component = TaxRegionsList;
export {
  Component
};
