import { jsx as e, jsxs as a, Fragment as j } from "react/jsx-runtime";
import { i as O, g as P, h as W, c as G, b as J } from "./core-BpghV7Ls.js";
import U, { useRef as I, useState as k, useEffect as x, useCallback as L, useSyncExternalStore as Z, forwardRef as K, Component as ee } from "react";
const Q = {
  info: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", clipRule: "evenodd" }) }),
  success: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", clipRule: "evenodd" }) }),
  warning: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
  error: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z", clipRule: "evenodd" }) })
}, he = ({
  variant: n = "info",
  title: t,
  children: s,
  closable: r,
  onClose: i,
  icon: c,
  size: l = "md",
  className: u,
  style: d,
  displayStyle: p
}) => {
  const m = O("card", p);
  return /* @__PURE__ */ a(
    "div",
    {
      className: `nice-alert nice-alert--${n} nice-alert--${l} nice-alert--ds-${m} ${u || ""}`,
      style: d,
      role: "alert",
      children: [
        /* @__PURE__ */ e("div", { className: `nice-alert__icon nice-alert__icon--${n}`, children: c || Q[n] }),
        /* @__PURE__ */ a("div", { className: "nice-alert__content", children: [
          t && /* @__PURE__ */ e("div", { className: "nice-alert__title", children: t }),
          /* @__PURE__ */ e("div", { children: s })
        ] }),
        r && /* @__PURE__ */ e("button", { type: "button", className: "nice-alert__close", onClick: i, "aria-label": "Close", children: "✕" })
      ]
    }
  );
}, fe = ({
  open: n,
  onClose: t,
  title: s,
  size: r = "md",
  children: i,
  footer: c,
  closeOnOverlay: l = !0,
  closeOnEscape: u = !0,
  fullscreenable: d,
  zIndex: p,
  className: m,
  style: y,
  displayStyle: v
}) => {
  const { t: _ } = P(), g = I(null), [h, o] = k(!1), $ = W("modal", v), w = O("modal", v);
  return G(g, n), x(() => {
    if (!n || !u)
      return;
    const f = (C) => {
      C.key === "Escape" && t();
    };
    return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
  }, [n, u, t]), x(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
    document.body.style.overflow = "";
  }), [n]), n ? /* @__PURE__ */ e(
    "div",
    {
      className: "nice-modal-overlay",
      style: p ? { zIndex: p } : void 0,
      onClick: l ? t : void 0,
      children: /* @__PURE__ */ a(
        "div",
        {
          ref: g,
          className: `nice-modal nice-modal--${h ? "full" : r} nice-modal--ds-${w} ${m || ""}`,
          style: { ...$, ...y },
          role: "dialog",
          "aria-modal": "true",
          "aria-label": s,
          onClick: (f) => f.stopPropagation(),
          children: [
            s && /* @__PURE__ */ a("div", { className: "nice-modal__header", children: [
              /* @__PURE__ */ e("h2", { className: "nice-modal__title", children: s }),
              /* @__PURE__ */ a("div", { className: "nice-modal__header-actions", children: [
                d && /* @__PURE__ */ e(
                  "button",
                  {
                    type: "button",
                    className: "nice-modal__fullscreen",
                    onClick: () => o((f) => !f),
                    "aria-label": h ? "Exit fullscreen" : "Fullscreen",
                    children: h ? "⇲" : "⇱"
                  }
                ),
                /* @__PURE__ */ e(
                  "button",
                  {
                    type: "button",
                    className: "nice-modal__close",
                    onClick: t,
                    "aria-label": _("controls.close", "Close"),
                    children: /* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
                  }
                )
              ] })
            ] }),
            /* @__PURE__ */ e("div", { className: "nice-modal__body", children: i }),
            c && /* @__PURE__ */ e("div", { className: "nice-modal__footer", children: c })
          ]
        }
      )
    }
  ) : null;
}, _e = ({
  open: n,
  onClose: t,
  title: s,
  position: r = "right",
  size: i = "md",
  children: c,
  footer: l,
  transitionDuration: u,
  className: d,
  style: p,
  displayStyle: m
}) => {
  const y = W("modal", m), v = O("modal", m), { t: _ } = P(), g = I(null);
  return G(g, n), x(() => {
    if (!n)
      return;
    const h = (o) => {
      o.key === "Escape" && t();
    };
    return document.addEventListener("keydown", h), document.body.style.overflow = "hidden", () => {
      document.removeEventListener("keydown", h), document.body.style.overflow = "";
    };
  }, [n, t]), n ? /* @__PURE__ */ a(j, { children: [
    /* @__PURE__ */ e("div", { className: "nice-drawer-overlay", onClick: t }),
    /* @__PURE__ */ a(
      "div",
      {
        ref: g,
        className: `nice-drawer nice-drawer--${r} nice-drawer--${i} nice-drawer--ds-${v} ${d || ""}`,
        style: {
          ...y,
          ...p,
          ...u != null ? { transitionDuration: `${u}ms` } : {}
        },
        role: "dialog",
        "aria-modal": "true",
        "aria-label": s,
        children: [
          s && /* @__PURE__ */ a("div", { className: "nice-drawer__header", children: [
            /* @__PURE__ */ e("h3", { className: "nice-drawer__title", children: s }),
            /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-drawer__close",
                onClick: t,
                "aria-label": _("controls.close", "Close"),
                children: /* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
              }
            )
          ] }),
          /* @__PURE__ */ e("div", { className: "nice-drawer__body", children: c }),
          l && /* @__PURE__ */ e("div", { className: "nice-drawer__footer", children: l })
        ]
      }
    )
  ] }) : null;
}, be = ({
  toasts: n,
  onDismiss: t,
  position: s = "top-right"
}) => /* @__PURE__ */ e("div", { className: `nice-toast-container nice-toast-container--${s}`, children: n.map((r) => /* @__PURE__ */ e(ne, { toast: r, onDismiss: t }, r.id)) }), ne = ({
  toast: n,
  onDismiss: t
}) => {
  const [s, r] = k(!1);
  return x(() => {
    if (!n.duration && n.duration !== 0) {
      const i = setTimeout(() => r(!0), 4e3);
      return () => clearTimeout(i);
    }
    if (n.duration > 0) {
      const i = setTimeout(() => r(!0), n.duration);
      return () => clearTimeout(i);
    }
  }, [n.duration]), x(() => {
    if (s) {
      const i = setTimeout(() => t(n.id), 200);
      return () => clearTimeout(i);
    }
  }, [s, n.id, t]), /* @__PURE__ */ a(
    "div",
    {
      className: `nice-toast nice-toast--${n.variant} ${s ? "nice-toast--exiting" : ""}`,
      role: "alert",
      style: { position: "relative" },
      children: [
        /* @__PURE__ */ e("div", { className: "nice-toast__icon", children: Q[n.variant] }),
        /* @__PURE__ */ a("div", { className: "nice-toast__content", children: [
          n.title && /* @__PURE__ */ e("div", { className: "nice-toast__title", children: n.title }),
          /* @__PURE__ */ e("div", { className: "nice-toast__message", children: n.message })
        ] }),
        /* @__PURE__ */ e("button", { type: "button", className: "nice-toast__close", onClick: () => r(!0), children: "✕" })
      ]
    }
  );
};
let ie = 0;
function pe() {
  const [n, t] = k([]), s = L(
    (i, c, l) => {
      const u = `toast-${++ie}`;
      return t((d) => [
        ...d,
        { id: u, variant: i, message: c, title: l?.title, duration: l?.duration }
      ]), u;
    },
    []
  ), r = L((i) => {
    t((c) => c.filter((l) => l.id !== i));
  }, []);
  return {
    toasts: n,
    dismiss: r,
    info: (i, c) => s("info", i, c),
    success: (i, c) => s("success", i, c),
    warning: (i, c) => s("warning", i, c),
    error: (i, c) => s("error", i, c)
  };
}
const te = {
  info: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }),
  warning: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }) }),
  error: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }) }),
  success: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) })
}, ve = ({
  visible: n,
  message: t,
  header: s,
  icon: r,
  variant: i = "warning",
  acceptLabel: c,
  rejectLabel: l,
  onAccept: u,
  onReject: d,
  closeOnOverlay: p = !1,
  closeOnEscape: m = !0,
  size: y = "md",
  className: v,
  style: _
}) => {
  const { t: g } = P();
  if (U.useEffect(() => {
    if (!n || !m)
      return;
    const w = (f) => {
      f.key === "Escape" && d();
    };
    return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
  }, [n, m, d]), U.useEffect(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
    document.body.style.overflow = "";
  }), [n]), !n)
    return null;
  const h = r ?? te[i], o = c ?? g("confirm.accept", "Yes"), $ = l ?? g("confirm.reject", "No");
  return /* @__PURE__ */ e("div", { className: "nice-modal-overlay", onClick: p ? d : void 0, children: /* @__PURE__ */ a(
    "div",
    {
      className: `nice-confirm nice-confirm--${i} nice-confirm--${y} ${v || ""}`,
      style: _,
      role: "alertdialog",
      "aria-modal": "true",
      "aria-label": s,
      "aria-describedby": "nice-confirm-message",
      onClick: (w) => w.stopPropagation(),
      children: [
        s && /* @__PURE__ */ e("div", { className: "nice-confirm__header", children: /* @__PURE__ */ e("h3", { className: "nice-confirm__title", children: s }) }),
        /* @__PURE__ */ a("div", { className: "nice-confirm__body", children: [
          h && /* @__PURE__ */ e("div", { className: `nice-confirm__icon nice-confirm__icon--${i}`, children: h }),
          /* @__PURE__ */ e("div", { id: "nice-confirm-message", className: "nice-confirm__message", children: t })
        ] }),
        /* @__PURE__ */ a("div", { className: "nice-confirm__footer", children: [
          /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: "nice-btn nice-btn--ghost nice-btn--md",
              onClick: d,
              children: $
            }
          ),
          /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: `nice-btn nice-btn--${i === "error" ? "error" : "primary"} nice-btn--md`,
              onClick: u,
              autoFocus: !0,
              children: o
            }
          )
        ] })
      ]
    }
  ) });
}, ge = ({
  error: n,
  onRetry: t,
  retryLabel: s = "Retry",
  title: r = "Operation failed",
  autoRetrySeconds: i,
  variant: c = "error",
  icon: l,
  size: u = "md",
  className: d,
  style: p,
  "data-testid": m
}) => {
  const [y, v] = k(i ?? 0), _ = I(), g = typeof n == "string" ? n : n.message, h = L(() => {
    v(i ?? 0), t();
  }, [t, i]);
  return x(() => {
    if (!(!i || i <= 0))
      return v(i), _.current = setInterval(() => {
        v((o) => o <= 1 ? (clearInterval(_.current), t(), 0) : o - 1);
      }, 1e3), () => clearInterval(_.current);
  }, [i, t]), /* @__PURE__ */ a(
    "div",
    {
      className: `nice-retry-panel nice-retry-panel--${c} nice-retry-panel--${u} ${d || ""}`,
      style: p,
      role: "alert",
      "data-testid": m,
      children: [
        /* @__PURE__ */ e("div", { className: "nice-retry-panel__icon", children: l ?? "⚠️" }),
        /* @__PURE__ */ a("div", { className: "nice-retry-panel__content", children: [
          /* @__PURE__ */ e("div", { className: "nice-retry-panel__title", children: r }),
          /* @__PURE__ */ e("p", { className: "nice-retry-panel__message", children: g })
        ] }),
        /* @__PURE__ */ a("div", { className: "nice-retry-panel__actions", children: [
          /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: "nice-btn nice-btn--primary nice-btn--sm",
              onClick: h,
              children: s
            }
          ),
          i && y > 0 && /* @__PURE__ */ a("span", { className: "nice-retry-panel__countdown", children: [
            "Auto-retry in ",
            y,
            "s"
          ] })
        ] })
      ]
    }
  );
};
function re(n) {
  return window.addEventListener("online", n), window.addEventListener("offline", n), () => {
    window.removeEventListener("online", n), window.removeEventListener("offline", n);
  };
}
function se() {
  return navigator.onLine;
}
function ce() {
  return !0;
}
const Ne = ({
  message: n = "You are offline. Some features may be unavailable.",
  variant: t = "warning",
  icon: s,
  size: r = "md",
  className: i,
  style: c,
  "data-testid": l
}) => Z(re, se, ce) ? null : /* @__PURE__ */ a(
  "div",
  {
    className: `nice-offline-banner nice-offline-banner--${t} nice-offline-banner--${r} ${i || ""}`,
    style: c,
    role: "alert",
    "aria-live": "assertive",
    "data-testid": l,
    children: [
      /* @__PURE__ */ e("span", { className: "nice-offline-banner__icon", children: s ?? "📡" }),
      /* @__PURE__ */ e("span", { className: "nice-offline-banner__message", children: n })
    ]
  }
);
function ae({
  timeoutMs: n = 1e4,
  slowThresholdMs: t = 3e3,
  onTimeout: s,
  autoRetry: r = !1,
  autoRetryCount: i = 3
} = {}) {
  const [c, l] = k(!1), [u, d] = k(!1), [p, m] = k(!1), [y, v] = k(0), [_, g] = k(0), h = I(null), o = I(null), $ = I(null), w = I(0), f = L(() => {
    h.current && clearTimeout(h.current), o.current && clearTimeout(o.current), $.current && clearInterval($.current);
  }, []), C = L(() => {
    f(), l(!0), d(!1), m(!1), v(0), w.current = Date.now(), $.current = setInterval(() => {
      v(Date.now() - w.current);
    }, 200), h.current = setTimeout(() => {
      d(!0);
    }, t), o.current = setTimeout(() => {
      m(!0), l(!1), d(!1), f(), s?.();
    }, n);
  }, [f, t, n, s]), z = L(() => {
    f(), l(!1), d(!1);
  }, [f]), b = L(() => {
    g((T) => T + 1), m(!1), C();
  }, [C]);
  return x(() => () => f(), [f]), x(() => {
    if (r && p && _ < i) {
      const T = Math.pow(2, _) * 1e3, M = setTimeout(() => b(), T);
      return () => clearTimeout(M);
    }
  }, [r, i, p, _, b]), { isLoading: c, isSlow: u, isTimedOut: p, elapsed: y, retryCount: _, start: C, stop: z, retry: b };
}
const ye = ({
  timeoutMs: n = 1e4,
  slowThresholdMs: t = 3e3,
  onTimeout: s,
  onRetry: r,
  autoRetry: i = !1,
  autoRetryCount: c = 3,
  showProgress: l = !0,
  slowMessage: u = "Operacja trwa dłużej niż zwykle…",
  timeoutMessage: d = "Przekroczono limit czasu. Spróbuj ponownie.",
  loading: p,
  children: m,
  size: y = "md",
  className: v,
  style: _,
  "data-testid": g
}) => {
  const { isSlow: h, isTimedOut: o, elapsed: $, retry: w } = ae({
    timeoutMs: n,
    slowThresholdMs: t,
    onTimeout: s,
    autoRetry: i,
    autoRetryCount: c
  }), f = () => {
    w(), r?.();
  };
  if (!p)
    return /* @__PURE__ */ e(j, { children: m });
  if (o)
    return /* @__PURE__ */ a(
      "div",
      {
        className: `nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${y} ${v ?? ""}`,
        style: _,
        role: "alert",
        "data-testid": g,
        children: [
          /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__message", children: d }),
          /* @__PURE__ */ e("button", { className: "nice-timeout-feedback__retry-btn", onClick: f, type: "button", children: "Spróbuj ponownie" })
        ]
      }
    );
  const C = Math.min(100, $ / n * 100);
  return /* @__PURE__ */ a(
    "div",
    {
      className: `nice-timeout-feedback nice-timeout-feedback--${y} ${h ? "nice-timeout-feedback--slow" : ""} ${v ?? ""}`,
      style: _,
      "data-testid": g,
      children: [
        /* @__PURE__ */ e("div", { className: "nice-timeout-feedback__spinner", "aria-busy": "true" }),
        h && /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__slow-msg", children: u }),
        l && /* @__PURE__ */ e(
          "div",
          {
            className: "nice-timeout-feedback__progress",
            role: "progressbar",
            "aria-valuenow": C,
            "aria-valuemin": 0,
            "aria-valuemax": 100,
            children: /* @__PURE__ */ e(
              "div",
              {
                className: "nice-timeout-feedback__progress-bar",
                style: { width: `${C}%` }
              }
            )
          }
        )
      ]
    }
  );
}, oe = K(
  ({
    visible: n,
    onAcceptAll: t,
    onRejectAll: s,
    onSave: r,
    categories: i = ["necessary", "analytics", "marketing", "preferences"],
    defaults: c,
    position: l = "bottom",
    size: u = "md",
    policyUrl: d,
    showDetails: p = !1,
    className: m,
    style: y,
    id: v,
    ..._
  }, g) => {
    const h = J(v), { t: o } = P(), [$, w] = k(!0), f = n ?? $, [C, z] = k(p), [b, T] = k(() => {
      const N = {
        necessary: !0,
        analytics: !1,
        marketing: !1,
        preferences: !1
      };
      return c && Object.assign(N, c), N.necessary = !0, N;
    }), M = {
      necessary: o("cookie.necessary", "Necessary"),
      analytics: o("cookie.analytics", "Analytics"),
      marketing: o("cookie.marketing", "Marketing"),
      preferences: o("cookie.preferences", "Preferences")
    }, D = {
      necessary: o(
        "cookie.necessaryDesc",
        "Required for the website to function. Cannot be disabled."
      ),
      analytics: o(
        "cookie.analyticsDesc",
        "Help us understand how visitors interact with the website."
      ),
      marketing: o("cookie.marketingDesc", "Used to deliver relevant advertisements."),
      preferences: o("cookie.preferencesDesc", "Allow the website to remember your choices.")
    }, R = L(() => {
      const N = {
        necessary: !0,
        analytics: !0,
        marketing: !0,
        preferences: !0
      };
      t?.(), r?.(N), w(!1);
    }, [t, r]), S = L(() => {
      const N = {
        necessary: !0,
        analytics: !1,
        marketing: !1,
        preferences: !1
      };
      s?.(), r?.(N), w(!1);
    }, [s, r]), A = L(() => {
      r?.({ ...b, necessary: !0 }), w(!1);
    }, [b, r]);
    return f ? /* @__PURE__ */ e(
      "div",
      {
        ref: g,
        id: h,
        className: `nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${u} ${m ?? ""}`,
        style: y,
        role: "dialog",
        "aria-label": o("cookie.label", "Cookie Consent"),
        "aria-modal": "true",
        ..._,
        children: /* @__PURE__ */ a("div", { className: "nice-cookie-consent__content", children: [
          /* @__PURE__ */ a("p", { className: "nice-cookie-consent__message", children: [
            o(
              "cookie.message",
              "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."
            ),
            d && /* @__PURE__ */ a(j, { children: [
              " ",
              /* @__PURE__ */ e(
                "a",
                {
                  href: d,
                  className: "nice-cookie-consent__link",
                  target: "_blank",
                  rel: "noopener noreferrer",
                  children: o("cookie.learnMore", "Learn more")
                }
              )
            ] })
          ] }),
          C && /* @__PURE__ */ e("div", { className: "nice-cookie-consent__details", children: i.map((N) => /* @__PURE__ */ a("label", { className: "nice-cookie-consent__category", children: [
            /* @__PURE__ */ e(
              "input",
              {
                type: "checkbox",
                checked: b[N],
                disabled: N === "necessary",
                onChange: (B) => T((F) => ({ ...F, [N]: B.target.checked })),
                className: "nice-cookie-consent__checkbox"
              }
            ),
            /* @__PURE__ */ a("div", { className: "nice-cookie-consent__cat-info", children: [
              /* @__PURE__ */ e("strong", { children: M[N] }),
              /* @__PURE__ */ e("span", { className: "nice-cookie-consent__cat-desc", children: D[N] })
            ] })
          ] }, N)) }),
          /* @__PURE__ */ a("div", { className: "nice-cookie-consent__actions", children: [
            !C && /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-cookie-consent__btn nice-cookie-consent__btn--details",
                onClick: () => z(!0),
                children: o("cookie.customize", "Customize")
              }
            ),
            C && /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-cookie-consent__btn nice-cookie-consent__btn--save",
                onClick: A,
                children: o("cookie.savePreferences", "Save preferences")
              }
            ),
            /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject",
                onClick: S,
                children: o("cookie.rejectAll", "Reject all")
              }
            ),
            /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept",
                onClick: R,
                children: o("cookie.acceptAll", "Accept all")
              }
            )
          ] })
        ] })
      }
    ) : null;
  }
);
oe.displayName = "NiceCookieConsent";
const le = K(
  ({
    onSubmit: n,
    onForgotPassword: t,
    onRegister: s,
    loading: r = !1,
    error: i,
    variant: c = "primary",
    size: l = "md",
    showRememberMe: u = !0,
    showForgotPassword: d = !0,
    showRegister: p = !1,
    title: m,
    logo: y,
    usernameLabel: v,
    passwordLabel: _,
    usernamePlaceholder: g,
    passwordPlaceholder: h,
    className: o,
    style: $,
    id: w,
    ...f
  }, C) => {
    const z = J(w), { t: b } = P(), [T, M] = k(""), [D, R] = k(""), [S, A] = k(!1), [N, B] = k(!1), F = `${z}-user`, H = `${z}-pass`, V = `${z}-remember`, X = L(
      (E) => {
        E.preventDefault(), !r && n?.({ username: T, password: D, rememberMe: S });
      },
      [r, T, D, S, n]
    );
    return /* @__PURE__ */ a(
      "form",
      {
        ref: C,
        id: z,
        className: `nice-login nice-login--${c} nice-login--${l} ${o ?? ""}`,
        style: $,
        onSubmit: X,
        noValidate: !0,
        ...f,
        children: [
          y && /* @__PURE__ */ e("div", { className: "nice-login__logo", children: y }),
          m && /* @__PURE__ */ e("h2", { className: "nice-login__title", children: m ?? b("login.title", "Sign In") }),
          i && /* @__PURE__ */ e("div", { className: "nice-login__error", role: "alert", children: i }),
          /* @__PURE__ */ a("div", { className: "nice-login__field", children: [
            /* @__PURE__ */ e("label", { htmlFor: F, className: "nice-login__label", children: v ?? b("login.username", "Username") }),
            /* @__PURE__ */ e(
              "input",
              {
                id: F,
                className: "nice-login__input",
                type: "text",
                value: T,
                onChange: (E) => M(E.target.value),
                placeholder: g ?? b("login.usernamePlaceholder", "Enter your username"),
                autoComplete: "username",
                required: !0,
                disabled: r,
                "aria-required": "true"
              }
            )
          ] }),
          /* @__PURE__ */ a("div", { className: "nice-login__field", children: [
            /* @__PURE__ */ e("label", { htmlFor: H, className: "nice-login__label", children: _ ?? b("login.password", "Password") }),
            /* @__PURE__ */ a("div", { className: "nice-login__password-wrap", children: [
              /* @__PURE__ */ e(
                "input",
                {
                  id: H,
                  className: "nice-login__input",
                  type: N ? "text" : "password",
                  value: D,
                  onChange: (E) => R(E.target.value),
                  placeholder: h ?? b("login.passwordPlaceholder", "Enter your password"),
                  autoComplete: "current-password",
                  required: !0,
                  disabled: r,
                  "aria-required": "true"
                }
              ),
              /* @__PURE__ */ e(
                "button",
                {
                  type: "button",
                  className: "nice-login__toggle-password",
                  onClick: () => B(!N),
                  "aria-label": N ? b("login.hidePassword", "Hide password") : b("login.showPassword", "Show password"),
                  tabIndex: -1,
                  children: N ? "🙈" : "👁"
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ a("div", { className: "nice-login__options", children: [
            u && /* @__PURE__ */ a("label", { className: "nice-login__remember", htmlFor: V, children: [
              /* @__PURE__ */ e(
                "input",
                {
                  id: V,
                  type: "checkbox",
                  checked: S,
                  onChange: (E) => A(E.target.checked),
                  disabled: r
                }
              ),
              /* @__PURE__ */ e("span", { children: b("login.rememberMe", "Remember me") })
            ] }),
            d && t && /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-login__forgot",
                onClick: t,
                disabled: r,
                children: b("login.forgotPassword", "Forgot password?")
              }
            )
          ] }),
          /* @__PURE__ */ e(
            "button",
            {
              type: "submit",
              className: `nice-login__submit nice-login__submit--${c}`,
              disabled: r || !T || !D,
              children: r ? b("login.loading", "Signing in...") : b("login.submit", "Sign In")
            }
          ),
          p && s && /* @__PURE__ */ a("p", { className: "nice-login__register", children: [
            b("login.noAccount", "Don't have an account?"),
            " ",
            /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-login__register-link",
                onClick: s,
                disabled: r,
                children: b("login.register", "Register")
              }
            )
          ] })
        ]
      }
    );
  }
);
le.displayName = "NiceLoginForm";
const q = class q extends ee {
  constructor() {
    super(...arguments), this.state = {
      hasError: !1,
      error: null
    }, this.handleReset = () => {
      this.setState({ hasError: !1, error: null });
    };
  }
  static getDerivedStateFromError(t) {
    return { hasError: !0, error: t };
  }
  componentDidCatch(t, s) {
    this.props.onError?.(t, s);
  }
  render() {
    if (this.state.hasError && this.state.error) {
      const { fallback: t, showRetry: s = !0, retryLabel: r = "Retry", title: i = "Something went wrong" } = this.props;
      return typeof t == "function" ? t(this.state.error, this.handleReset) : t || /* @__PURE__ */ a("div", { className: "nice-error-boundary", role: "alert", children: [
        /* @__PURE__ */ e("div", { className: "nice-error-boundary__icon", children: "⚠️" }),
        /* @__PURE__ */ e("h2", { className: "nice-error-boundary__title", children: i }),
        /* @__PURE__ */ e("p", { className: "nice-error-boundary__message", children: this.state.error.message }),
        s && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: this.handleReset, children: r })
      ] });
    }
    return this.props.children;
  }
};
q.displayName = "NiceErrorBoundary";
let Y = q;
export {
  he as N,
  ve as a,
  oe as b,
  _e as c,
  Y as d,
  le as e,
  fe as f,
  Ne as g,
  ge as h,
  ye as i,
  be as j,
  Q as k,
  ae as l,
  pe as u
};
