import { jsx as e, jsxs as a, Fragment as F } from "react/jsx-runtime";
import { a as Y, o as Q, $ as A, k as X, S as W } from "./core-ClmvtMVZ.js";
import V, { useRef as I, useEffect as S, useState as y, useCallback as L, useSyncExternalStore as Z, forwardRef as G, Component as ee } from "react";
const J = {
  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: m,
  style: d,
  displayStyle: p
}) => {
  const h = Y("card", p);
  return /* @__PURE__ */ a(
    "div",
    {
      className: `nice-alert nice-alert--${n} nice-alert--${l} nice-alert--ds-${h} ${m || ""}`,
      style: d,
      role: "alert",
      children: [
        /* @__PURE__ */ e("div", { className: `nice-alert__icon nice-alert__icon--${n}`, children: c || J[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,
  position: r = "right",
  size: i = "md",
  children: c,
  footer: l,
  transitionDuration: m,
  className: d,
  style: p,
  displayStyle: h
}) => {
  const v = Q("modal", h), g = Y("modal", h), { t: f } = A(), N = I(null);
  return X(N, n), S(() => {
    if (!n)
      return;
    const b = (o) => {
      o.key === "Escape" && t();
    };
    return document.addEventListener("keydown", b), document.body.style.overflow = "hidden", () => {
      document.removeEventListener("keydown", b), document.body.style.overflow = "";
    };
  }, [n, t]), n ? /* @__PURE__ */ a(F, { children: [
    /* @__PURE__ */ e("div", { className: "nice-drawer-overlay", onClick: t }),
    /* @__PURE__ */ a(
      "div",
      {
        ref: N,
        className: `nice-drawer nice-drawer--${r} nice-drawer--${i} nice-drawer--ds-${g} ${d || ""}`,
        style: {
          ...v,
          ...p,
          ...m != null ? { transitionDuration: `${m}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": f("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;
}, _e = ({
  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] = y(!1);
  return S(() => {
    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]), S(() => {
    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: J[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 be() {
  const [n, t] = y([]), s = L(
    (i, c, l) => {
      const m = `toast-${++ie}`;
      return t((d) => [
        ...d,
        { id: m, variant: i, message: c, title: l?.title, duration: l?.duration }
      ]), m;
    },
    []
  ), 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" }) })
}, pe = ({
  visible: n,
  message: t,
  header: s,
  icon: r,
  variant: i = "warning",
  acceptLabel: c,
  rejectLabel: l,
  onAccept: m,
  onReject: d,
  closeOnOverlay: p = !1,
  closeOnEscape: h = !0,
  size: v = "md",
  className: g,
  style: f
}) => {
  const { t: N } = A();
  if (V.useEffect(() => {
    if (!n || !h)
      return;
    const k = (w) => {
      w.key === "Escape" && d();
    };
    return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
  }, [n, h, d]), V.useEffect(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
    document.body.style.overflow = "";
  }), [n]), !n)
    return null;
  const b = r ?? te[i], o = c ?? N("confirm.accept", "Yes"), $ = l ?? N("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--${v} ${g || ""}`,
      style: f,
      role: "alertdialog",
      "aria-modal": "true",
      "aria-label": s,
      "aria-describedby": "nice-confirm-message",
      onClick: (k) => k.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: [
          b && /* @__PURE__ */ e("div", { className: `nice-confirm__icon nice-confirm__icon--${i}`, children: b }),
          /* @__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: m,
              autoFocus: !0,
              children: o
            }
          )
        ] })
      ]
    }
  ) });
}, ge = ({
  error: n,
  onRetry: t,
  retryLabel: s = "Retry",
  title: r = "Operation failed",
  autoRetrySeconds: i,
  variant: c = "error",
  icon: l,
  size: m = "md",
  className: d,
  style: p,
  "data-testid": h
}) => {
  const [v, g] = y(i ?? 0), f = I(), N = typeof n == "string" ? n : n.message, b = L(() => {
    g(i ?? 0), t();
  }, [t, i]);
  return S(() => {
    if (!(!i || i <= 0))
      return g(i), f.current = setInterval(() => {
        g((o) => o <= 1 ? (clearInterval(f.current), t(), 0) : o - 1);
      }, 1e3), () => clearInterval(f.current);
  }, [i, t]), /* @__PURE__ */ a(
    "div",
    {
      className: `nice-retry-panel nice-retry-panel--${c} nice-retry-panel--${m} ${d || ""}`,
      style: p,
      role: "alert",
      "data-testid": h,
      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: N })
        ] }),
        /* @__PURE__ */ a("div", { className: "nice-retry-panel__actions", children: [
          /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: "nice-btn nice-btn--primary nice-btn--sm",
              onClick: b,
              children: s
            }
          ),
          i && v > 0 && /* @__PURE__ */ a("span", { className: "nice-retry-panel__countdown", children: [
            "Auto-retry in ",
            v,
            "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 ve = ({
  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] = y(!1), [m, d] = y(!1), [p, h] = y(!1), [v, g] = y(0), [f, N] = y(0), b = I(null), o = I(null), $ = I(null), k = I(0), w = L(() => {
    b.current && clearTimeout(b.current), o.current && clearTimeout(o.current), $.current && clearInterval($.current);
  }, []), C = L(() => {
    w(), l(!0), d(!1), h(!1), g(0), k.current = Date.now(), $.current = setInterval(() => {
      g(Date.now() - k.current);
    }, 200), b.current = setTimeout(() => {
      d(!0);
    }, t), o.current = setTimeout(() => {
      h(!0), l(!1), d(!1), w(), s?.();
    }, n);
  }, [w, t, n, s]), T = L(() => {
    w(), l(!1), d(!1);
  }, [w]), u = L(() => {
    N((z) => z + 1), h(!1), C();
  }, [C]);
  return S(() => () => w(), [w]), S(() => {
    if (r && p && f < i) {
      const z = Math.pow(2, f) * 1e3, D = setTimeout(() => u(), z);
      return () => clearTimeout(D);
    }
  }, [r, i, p, f, u]), { isLoading: c, isSlow: m, isTimedOut: p, elapsed: v, retryCount: f, start: C, stop: T, retry: u };
}
const Ne = ({
  timeoutMs: n = 1e4,
  slowThresholdMs: t = 3e3,
  onTimeout: s,
  onRetry: r,
  autoRetry: i = !1,
  autoRetryCount: c = 3,
  showProgress: l = !0,
  slowMessage: m = "Operacja trwa dłużej niż zwykle…",
  timeoutMessage: d = "Przekroczono limit czasu. Spróbuj ponownie.",
  loading: p,
  children: h,
  size: v = "md",
  className: g,
  style: f,
  "data-testid": N
}) => {
  const { isSlow: b, isTimedOut: o, elapsed: $, retry: k } = ae({
    timeoutMs: n,
    slowThresholdMs: t,
    onTimeout: s,
    autoRetry: i,
    autoRetryCount: c
  }), w = () => {
    k(), r?.();
  };
  if (!p)
    return /* @__PURE__ */ e(F, { children: h });
  if (o)
    return /* @__PURE__ */ a(
      "div",
      {
        className: `nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${v} ${g ?? ""}`,
        style: f,
        role: "alert",
        "data-testid": N,
        children: [
          /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__message", children: d }),
          /* @__PURE__ */ e("button", { className: "nice-timeout-feedback__retry-btn", onClick: w, type: "button", children: "Spróbuj ponownie" })
        ]
      }
    );
  const C = Math.min(100, $ / n * 100);
  return /* @__PURE__ */ a(
    "div",
    {
      className: `nice-timeout-feedback nice-timeout-feedback--${v} ${b ? "nice-timeout-feedback--slow" : ""} ${g ?? ""}`,
      style: f,
      "data-testid": N,
      children: [
        /* @__PURE__ */ e("div", { className: "nice-timeout-feedback__spinner", "aria-busy": "true" }),
        b && /* @__PURE__ */ e("p", { className: "nice-timeout-feedback__slow-msg", children: m }),
        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 = G(
  ({
    visible: n,
    onAcceptAll: t,
    onRejectAll: s,
    onSave: r,
    categories: i = ["necessary", "analytics", "marketing", "preferences"],
    defaults: c,
    position: l = "bottom",
    size: m = "md",
    policyUrl: d,
    showDetails: p = !1,
    className: h,
    style: v,
    id: g,
    ...f
  }, N) => {
    const b = W(g), { t: o } = A(), [$, k] = y(!0), w = n ?? $, [C, T] = y(p), [u, z] = y(() => {
      const _ = {
        necessary: !0,
        analytics: !1,
        marketing: !1,
        preferences: !1
      };
      return c && Object.assign(_, c), _.necessary = !0, _;
    }), D = {
      necessary: o("cookie.necessary", "Necessary"),
      analytics: o("cookie.analytics", "Analytics"),
      marketing: o("cookie.marketing", "Marketing"),
      preferences: o("cookie.preferences", "Preferences")
    }, E = {
      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 _ = {
        necessary: !0,
        analytics: !0,
        marketing: !0,
        preferences: !0
      };
      t?.(), r?.(_), k(!1);
    }, [t, r]), M = L(() => {
      const _ = {
        necessary: !0,
        analytics: !1,
        marketing: !1,
        preferences: !1
      };
      s?.(), r?.(_), k(!1);
    }, [s, r]), j = L(() => {
      r?.({ ...u, necessary: !0 }), k(!1);
    }, [u, r]);
    return w ? /* @__PURE__ */ e(
      "div",
      {
        ref: N,
        id: b,
        className: `nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${m} ${h ?? ""}`,
        style: v,
        role: "dialog",
        "aria-label": o("cookie.label", "Cookie Consent"),
        "aria-modal": "true",
        ...f,
        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(F, { 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((_) => /* @__PURE__ */ a("label", { className: "nice-cookie-consent__category", children: [
            /* @__PURE__ */ e(
              "input",
              {
                type: "checkbox",
                checked: u[_],
                disabled: _ === "necessary",
                onChange: (B) => z((P) => ({ ...P, [_]: B.target.checked })),
                className: "nice-cookie-consent__checkbox"
              }
            ),
            /* @__PURE__ */ a("div", { className: "nice-cookie-consent__cat-info", children: [
              /* @__PURE__ */ e("strong", { children: D[_] }),
              /* @__PURE__ */ e("span", { className: "nice-cookie-consent__cat-desc", children: E[_] })
            ] })
          ] }, _)) }),
          /* @__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: () => T(!0),
                children: o("cookie.customize", "Customize")
              }
            ),
            C && /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-cookie-consent__btn nice-cookie-consent__btn--save",
                onClick: j,
                children: o("cookie.savePreferences", "Save preferences")
              }
            ),
            /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject",
                onClick: M,
                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 = G(
  ({
    onSubmit: n,
    onForgotPassword: t,
    onRegister: s,
    loading: r = !1,
    error: i,
    variant: c = "primary",
    size: l = "md",
    showRememberMe: m = !0,
    showForgotPassword: d = !0,
    showRegister: p = !1,
    title: h,
    logo: v,
    usernameLabel: g,
    passwordLabel: f,
    usernamePlaceholder: N,
    passwordPlaceholder: b,
    className: o,
    style: $,
    id: k,
    ...w
  }, C) => {
    const T = W(k), { t: u } = A(), [z, D] = y(""), [E, R] = y(""), [M, j] = y(!1), [_, B] = y(!1), P = `${T}-user`, q = `${T}-pass`, H = `${T}-remember`, K = L(
      (x) => {
        x.preventDefault(), !r && n?.({ username: z, password: E, rememberMe: M });
      },
      [r, z, E, M, n]
    );
    return /* @__PURE__ */ a(
      "form",
      {
        ref: C,
        id: T,
        className: `nice-login nice-login--${c} nice-login--${l} ${o ?? ""}`,
        style: $,
        onSubmit: K,
        noValidate: !0,
        ...w,
        children: [
          v && /* @__PURE__ */ e("div", { className: "nice-login__logo", children: v }),
          h && /* @__PURE__ */ e("h2", { className: "nice-login__title", children: h ?? u("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: P, className: "nice-login__label", children: g ?? u("login.username", "Username") }),
            /* @__PURE__ */ e(
              "input",
              {
                id: P,
                className: "nice-login__input",
                type: "text",
                value: z,
                onChange: (x) => D(x.target.value),
                placeholder: N ?? u("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: q, className: "nice-login__label", children: f ?? u("login.password", "Password") }),
            /* @__PURE__ */ a("div", { className: "nice-login__password-wrap", children: [
              /* @__PURE__ */ e(
                "input",
                {
                  id: q,
                  className: "nice-login__input",
                  type: _ ? "text" : "password",
                  value: E,
                  onChange: (x) => R(x.target.value),
                  placeholder: b ?? u("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(!_),
                  "aria-label": _ ? u("login.hidePassword", "Hide password") : u("login.showPassword", "Show password"),
                  tabIndex: -1,
                  children: _ ? "🙈" : "👁"
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ a("div", { className: "nice-login__options", children: [
            m && /* @__PURE__ */ a("label", { className: "nice-login__remember", htmlFor: H, children: [
              /* @__PURE__ */ e(
                "input",
                {
                  id: H,
                  type: "checkbox",
                  checked: M,
                  onChange: (x) => j(x.target.checked),
                  disabled: r
                }
              ),
              /* @__PURE__ */ e("span", { children: u("login.rememberMe", "Remember me") })
            ] }),
            d && t && /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-login__forgot",
                onClick: t,
                disabled: r,
                children: u("login.forgotPassword", "Forgot password?")
              }
            )
          ] }),
          /* @__PURE__ */ e(
            "button",
            {
              type: "submit",
              className: `nice-login__submit nice-login__submit--${c}`,
              disabled: r || !z || !E,
              children: r ? u("login.loading", "Signing in...") : u("login.submit", "Sign In")
            }
          ),
          p && s && /* @__PURE__ */ a("p", { className: "nice-login__register", children: [
            u("login.noAccount", "Don't have an account?"),
            " ",
            /* @__PURE__ */ e(
              "button",
              {
                type: "button",
                className: "nice-login__register-link",
                onClick: s,
                disabled: r,
                children: u("login.register", "Register")
              }
            )
          ] })
        ]
      }
    );
  }
);
le.displayName = "NiceLoginForm";
const O = class O 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;
  }
};
O.displayName = "NiceErrorBoundary";
let U = O;
export {
  he as N,
  pe as a,
  oe as b,
  fe as c,
  U as d,
  le as e,
  ve as f,
  ge as g,
  Ne as h,
  _e as i,
  J as j,
  ae as k,
  be as u
};
