import i from "classnames";
import a, { Component as h } from "react";
import { Trans as m } from "react-i18next";
import { A as l, a as p } from "./ArrowIcon-647b10f0.mjs";
import { L as f, m as P } from "./index-0462597a.mjs";
import { generatePath as k } from "react-router";
const u = "pagination _pagination_ea2e0", E = {
  pagination: u
}, d = ({ link: t, children: e, className: n }) => /* @__PURE__ */ a.createElement(f, { className: i(n, "paginationLink"), to: t }, e), S = ({
  callBack: t,
  children: e,
  className: n
}) => /* @__PURE__ */ a.createElement(
  "a",
  {
    href: "#",
    className: i(n, "paginationLink", "link", t ? "" : "disabled"),
    onClick: (r) => {
      r.preventDefault(), t && t();
    }
  },
  e
), g = ({
  linkOrCallback: t,
  children: e,
  className: n
}) => t === !1 ? null : /* @__PURE__ */ a.createElement(a.Fragment, null, typeof t == "string" && /* @__PURE__ */ a.createElement(d, { link: t, className: n }, e), typeof t != "string" && /* @__PURE__ */ a.createElement(S, { callBack: t, className: n }, e));
class y extends h {
  render() {
    return /* @__PURE__ */ a.createElement("div", { className: i(E.pagination, "pagination") }, /* @__PURE__ */ a.createElement(g, { linkOrCallback: this.props.prev, className: "link-prev" }, /* @__PURE__ */ a.createElement(l, { className: i(p.left, "arrowSize") }), /* @__PURE__ */ a.createElement(m, { i18nKey: "Pagination.prev" }, "Previous")), /* @__PURE__ */ a.createElement(g, { linkOrCallback: this.props.next, className: "link-next" }, /* @__PURE__ */ a.createElement(m, { i18nKey: "Pagination.next" }, "Next"), /* @__PURE__ */ a.createElement(l, { className: i(p.right, "arrowSize") })));
  }
}
class A {
  constructor(e) {
    this.link = e;
  }
  makePath(e, n) {
    const r = k(this.link, e), s = new URLSearchParams();
    for (const o in n)
      Object.prototype.hasOwnProperty.call(n, o) && s.append(o, String(n[o]));
    const c = s.toString();
    return `${r}${c ? `?${c}` : ""}`;
  }
  withSearchParams(e) {
    return this.makePath(void 0, e);
  }
  is(e, n = {}) {
    const { exact: r = !0, strict: s = !1 } = n;
    return P(e, {
      path: this.link,
      exact: r,
      strict: s
    });
  }
}
export {
  y as P,
  A as a
};
