import { s as __toESM } from "./chunk-BNovOVIE.js";
import { t as require_react } from "./react-DA-nE2FX.js";
import { u as createLucideIcon } from "./dist-D3ZI9nhS.js";
import { T as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./strings-BiIhGaI8.js";
var ChartPie = createLucideIcon("chart-pie", [["path", {
  d: "M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",
  key: "pzmjnu"
}], ["path", {
  d: "M21.21 15.89A10 10 0 1 1 8 2.83",
  key: "k2fpak"
}]]), ListFilter = createLucideIcon("list-filter", [
  ["path", {
    d: "M2 5h20",
    key: "1fs1ex"
  }],
  ["path", {
    d: "M6 12h12",
    key: "8npq4p"
  }],
  ["path", {
    d: "M9 19h6",
    key: "456am0"
  }]
]), Table = createLucideIcon("table", [
  ["path", {
    d: "M12 3v18",
    key: "108xh3"
  }],
  ["rect", {
    width: "18",
    height: "18",
    x: "3",
    y: "3",
    rx: "2",
    key: "afitv7"
  }],
  ["path", {
    d: "M3 9h18",
    key: "1pudct"
  }],
  ["path", {
    d: "M3 15h18",
    key: "5xshup"
  }]
]), import_react = /* @__PURE__ */ __toESM(require_react(), 1);
function $5a387cc49350e6db$export$722debc0e56fea39(e, g) {
  let _ = (0, import_react.useRef)(null);
  return e && _.current && g(e, _.current) && (e = _.current), _.current = e, e;
}
var $fb18d541ea1ad717$var$formatterCache = /* @__PURE__ */ new Map(), $fb18d541ea1ad717$export$ad991b66133851cf = class {
  format(e) {
    return this.formatter.format(e);
  }
  formatToParts(e) {
    return this.formatter.formatToParts(e);
  }
  formatRange(e, g) {
    if (typeof this.formatter.formatRange == "function") return this.formatter.formatRange(e, g);
    if (g < e) throw RangeError("End date must be >= start date");
    return `${this.formatter.format(e)} \u2013 ${this.formatter.format(g)}`;
  }
  formatRangeToParts(e, g) {
    if (typeof this.formatter.formatRangeToParts == "function") return this.formatter.formatRangeToParts(e, g);
    if (g < e) throw RangeError("End date must be >= start date");
    let _ = this.formatter.formatToParts(e), v = this.formatter.formatToParts(g);
    return [
      ..._.map((e2) => ({
        ...e2,
        source: "startRange"
      })),
      {
        type: "literal",
        value: " \u2013 ",
        source: "shared"
      },
      ...v.map((e2) => ({
        ...e2,
        source: "endRange"
      }))
    ];
  }
  resolvedOptions() {
    let e = this.formatter.resolvedOptions();
    return $fb18d541ea1ad717$var$hasBuggyResolvedHourCycle() && (this.resolvedHourCycle || (this.resolvedHourCycle = $fb18d541ea1ad717$var$getResolvedHourCycle(e.locale, this.options)), e.hourCycle = this.resolvedHourCycle, e.hour12 = this.resolvedHourCycle === "h11" || this.resolvedHourCycle === "h12"), e.calendar === "ethiopic-amete-alem" && (e.calendar = "ethioaa"), e;
  }
  constructor(e, g = {}) {
    this.formatter = $fb18d541ea1ad717$var$getCachedDateFormatter(e, g), this.options = g;
  }
}, $fb18d541ea1ad717$var$hour12Preferences = {
  true: { ja: "h11" },
  false: {}
};
function $fb18d541ea1ad717$var$getCachedDateFormatter(e, g = {}) {
  if (typeof g.hour12 == "boolean" && $fb18d541ea1ad717$var$hasBuggyHour12Behavior()) {
    g = { ...g };
    let _2 = $fb18d541ea1ad717$var$hour12Preferences[String(g.hour12)][e.split("-")[0]], v2 = g.hour12 ? "h12" : "h23";
    g.hourCycle = _2 ?? v2, delete g.hour12;
  }
  let _ = e + (g ? Object.entries(g).sort((e2, g2) => e2[0] < g2[0] ? -1 : 1).join() : "");
  if ($fb18d541ea1ad717$var$formatterCache.has(_)) return $fb18d541ea1ad717$var$formatterCache.get(_);
  let v = new Intl.DateTimeFormat(e, g);
  return $fb18d541ea1ad717$var$formatterCache.set(_, v), v;
}
var $fb18d541ea1ad717$var$_hasBuggyHour12Behavior = null;
function $fb18d541ea1ad717$var$hasBuggyHour12Behavior() {
  return $fb18d541ea1ad717$var$_hasBuggyHour12Behavior ?? ($fb18d541ea1ad717$var$_hasBuggyHour12Behavior = new Intl.DateTimeFormat("en-US", {
    hour: "numeric",
    hour12: false
  }).format(new Date(2020, 2, 3, 0)) === "24"), $fb18d541ea1ad717$var$_hasBuggyHour12Behavior;
}
var $fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle = null;
function $fb18d541ea1ad717$var$hasBuggyResolvedHourCycle() {
  return $fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle ?? ($fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle = new Intl.DateTimeFormat("fr", {
    hour: "numeric",
    hour12: false
  }).resolvedOptions().hourCycle === "h12"), $fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle;
}
function $fb18d541ea1ad717$var$getResolvedHourCycle(e, g) {
  if (!g.timeStyle && !g.hour) return;
  e = e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, ""), e += (e.includes("-u-") ? "" : "-u") + "-nu-latn";
  let _ = $fb18d541ea1ad717$var$getCachedDateFormatter(e, {
    ...g,
    timeZone: void 0
  }), v = parseInt(_.formatToParts(new Date(2020, 2, 3, 0)).find((e2) => e2.type === "hour").value, 10), y = parseInt(_.formatToParts(new Date(2020, 2, 3, 23)).find((e2) => e2.type === "hour").value, 10);
  if (v === 0 && y === 23) return "h23";
  if (v === 24 && y === 23) return "h24";
  if (v === 0 && y === 11) return "h11";
  if (v === 12 && y === 11) return "h12";
  throw Error("Unexpected hour cycle result");
}
function $896ba0a80a8f4d36$export$85fd5fdf27bacc79(e) {
  e = $5a387cc49350e6db$export$722debc0e56fea39(e ?? {}, $896ba0a80a8f4d36$var$isEqual);
  let { locale: g } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
  return (0, import_react.useMemo)(() => new $fb18d541ea1ad717$export$ad991b66133851cf(g, e), [g, e]);
}
function $896ba0a80a8f4d36$var$isEqual(e, g) {
  if (e === g) return true;
  let _ = Object.keys(e), v = Object.keys(g);
  if (_.length !== v.length) return false;
  for (let v2 of _) if (g[v2] !== e[v2]) return false;
  return true;
}
export {
  ListFilter as a,
  Table as i,
  $fb18d541ea1ad717$export$ad991b66133851cf as n,
  ChartPie as o,
  $5a387cc49350e6db$export$722debc0e56fea39 as r,
  $896ba0a80a8f4d36$export$85fd5fdf27bacc79 as t
};
