@vervstack/chures 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/chures.js CHANGED
@@ -1,55 +1,167 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._TelegramSignInButtonContainer_1pw4t_1{--tg-blue: #2AABEE;--tg-blue-2: #229ED9;display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--tg-blue) 0%,var(--tg-blue-2) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_1pw4t_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_1pw4t_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_1pw4t_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_1pw4t_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_1pw4t_49{height:100%}._Icon_1pw4t_53{flex-shrink:0}._ToastContainer_1g7il_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1g7il_1{min-height:4rem;border:var(--ta-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:#000;display:flex;flex-direction:column}._Toast_1g7il_1>div:first-child{font-weight:700;font-size:var(--ta-font-sm, .875rem);color:var(--ta-fg, #ffffff)}._Toast_1g7il_1._error_1g7il_33{border-color:var(--ta-error, #ef4444)}._Toast_1g7il_1._error_1g7il_33>div:first-child{color:var(--ta-error, #ef4444)}._Toast_1g7il_1._warn_1g7il_41{border-color:var(--ta-warn, #f59e0b)}._Toast_1g7il_1._warn_1g7il_41>div:first-child{color:var(--ta-warn, #f59e0b)}._Toast_1g7il_1._info_1g7il_49{border-color:var(--ta-accent, #229ED9)}._Toast_1g7il_1 ._Description_1g7il_53{color:var(--ta-fg-muted, #9ca3af);font-size:var(--ta-font-xs, .75rem);margin-top:.125rem}._Toast_1g7il_1 ._DismissButton_1g7il_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--ta-fg-muted, #9ca3af)}._slideIn_1g7il_79{animation:_slideIn_1g7il_79 .2s ease forwards}._slideOut_1g7il_83{animation:_slideOut_1g7il_83 .2s ease forwards}@keyframes _slideIn_1g7il_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1g7il_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- import { jsxs as w, jsx as a, Fragment as S } from "react/jsx-runtime";
3
- import { useRef as C, useState as _, useEffect as y } from "react";
4
- import { AnimatePresence as x, motion as B } from "framer-motion";
5
- import { create as L } from "zustand";
6
- const R = "https://oauth.telegram.org/js/telegram-login.js?3";
7
- function E(n) {
8
- const { botId: o, redirectUri: e, requestAccess: r = "write" } = n, s = C(n.onSuccess);
9
- s.current = n.onSuccess;
10
- const [t, i] = _(!1), [c, l] = _(!1);
11
- y(function() {
12
- if (!o) return;
13
- const u = e ?? window.location.origin;
14
- l(!0), i(!1);
15
- const d = document.createElement("script");
16
- return d.src = R, d.async = !0, d.onload = function() {
17
- const g = window.Telegram;
18
- g && (g.Login.init(
19
- { client_id: o, redirect_uri: u },
20
- function(I) {
21
- s.current(I);
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--chures-accent: #229ED9;--chures-btn-from: #2AABEE;--chures-btn-to: #229ED9;--chures-error: #ef4444;--chures-warn: #f59e0b;--chures-fg: #ffffff;--chures-fg-muted: #9ca3af;--chures-surface: #000000;--chures-font-sm: .875rem;--chures-font-xs: .75rem;--chures-input-bg: #111111;--chures-input-height: 3rem;--chures-input-radius: .75rem;--chures-skeleton-shine: #1e1e1e;--chures-toggle-width: 2.75rem;--chures-toggle-height: 1.5rem;--chures-toggle-thumb: 1.125rem;--chures-toggle-bg-off: rgb(255 255 255 / 13%);--chures-toggle-bg-on: var(--chures-accent);--chures-toggle-thumb-color: #ffffff;--chures-toggle-label-skeleton-w: 5rem}@keyframes _spin_wa8op_1{to{transform:rotate(360deg)}}@keyframes _ripple_wa8op_1{0%{transform:scale(.08);opacity:.9}to{transform:scale(1);opacity:0}}@keyframes _dotPulse_wa8op_1{0%,to{transform:translate(-50%,-50%) scale(.55);opacity:.3}50%{transform:translate(-50%,calc(-50% - var(--sz) * .1)) scale(1);opacity:1}}@keyframes _waveBounce_wa8op_1{0%,55%,to{transform:translate(-50%,-50%) scale(.8);opacity:.4}27%{transform:translate(-50%,calc(-50% - var(--sz) * .28)) scale(1);opacity:1}}._LoaderContainer_wa8op_24{position:relative;flex-shrink:0}._sm_wa8op_31{width:1.5rem;height:1.5rem;--sz: 1.5rem;--arc-gap: .2rem;--arc-bw: .125rem}._md_wa8op_32{width:2.5rem;height:2.5rem;--sz: 2.5rem;--arc-gap: .35rem;--arc-bw: .1875rem}._lg_wa8op_33{width:4rem;height:4rem;--sz: 4rem;--arc-gap: .55rem;--arc-bw: .25rem}._Arc1_wa8op_37,._Arc2_wa8op_38,._Arc3_wa8op_39{position:absolute;border-radius:50%;border:var(--arc-bw) solid transparent}._Arc1_wa8op_37{inset:0;border-top-color:var(--chures-accent, #229ED9);border-left-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.2s linear infinite;filter:drop-shadow(0 0 .25rem var(--chures-accent, #229ED9))}._Arc2_wa8op_38{inset:var(--arc-gap);border-bottom-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.8s linear infinite reverse;opacity:.8}._Arc3_wa8op_39{inset:calc(var(--arc-gap) * 2);border-top-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 2.4s linear infinite;opacity:.6}._Ring1_wa8op_71,._Ring2_wa8op_72,._Ring3_wa8op_73{position:absolute;inset:0;border-radius:50%;border:var(--arc-bw) solid var(--chures-accent, #229ED9);animation:_ripple_wa8op_1 1.8s ease-out infinite both}._Ring2_wa8op_72{animation-delay:.6s}._Ring3_wa8op_73{animation-delay:1.2s}._Dot1_wa8op_86,._Dot2_wa8op_87,._Dot3_wa8op_88{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .2);height:calc(var(--sz) * .2);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .14) var(--chures-accent, #229ED9);animation:_dotPulse_wa8op_1 1.1s ease-in-out infinite both}._Dot1_wa8op_86{left:22%}._Dot2_wa8op_87{left:50%;animation-delay:.18s}._Dot3_wa8op_88{left:78%;animation-delay:.36s}._Wave1_wa8op_105,._Wave2_wa8op_106,._Wave3_wa8op_107,._Wave4_wa8op_108,._Wave5_wa8op_109{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .16);height:calc(var(--sz) * .16);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .1) var(--chures-accent, #229ED9);animation:_waveBounce_wa8op_1 1s ease-in-out infinite both}._Wave1_wa8op_105{left:10%}._Wave2_wa8op_106{left:28%;animation-delay:.12s}._Wave3_wa8op_107{left:46%;animation-delay:.24s}._Wave4_wa8op_108{left:64%;animation-delay:.36s}._Wave5_wa8op_109{left:82%;animation-delay:.48s}._LoadingWrapperContainer_1q0w7_1{display:flex;align-items:center;justify-content:center;width:100%;min-height:4rem}._SkeletonWrapper_1q0w7_9{width:100%}._TelegramSignInButtonContainer_10wun_1{display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--chures-btn-from, #2AABEE) 0%,var(--chures-btn-to, #229ED9) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_10wun_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_10wun_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_10wun_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_10wun_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_10wun_46{height:100%}._Icon_10wun_50{flex-shrink:0}._ToastContainer_1tme2_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1tme2_1{min-height:4rem;border:var(--chures-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:var(--chures-surface, #000000);display:flex;flex-direction:column}._Toast_1tme2_1>div:first-child{font-weight:700;font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff)}._Toast_1tme2_1._error_1tme2_33{border-color:var(--chures-error, #ef4444)}._Toast_1tme2_1._error_1tme2_33>div:first-child{color:var(--chures-error, #ef4444)}._Toast_1tme2_1._warn_1tme2_41{border-color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._warn_1tme2_41>div:first-child{color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._info_1tme2_49{border-color:var(--chures-accent, #229ED9)}._Toast_1tme2_1 ._Description_1tme2_53{color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-xs, .75rem);margin-top:.125rem}._Toast_1tme2_1 ._DismissButton_1tme2_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--chures-fg-muted, #9ca3af)}._slideIn_1tme2_79{animation:_slideIn_1tme2_79 .2s ease forwards}._slideOut_1tme2_83{animation:_slideOut_1tme2_83 .2s ease forwards}@keyframes _slideIn_1tme2_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1tme2_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}@keyframes _shimmer_1a08x_1{0%{background-position:-200% 0}to{background-position:200% 0}}._InputContainer_1a08x_6{position:relative;width:100%;height:var(--chures-input-height, 3rem)}._InputField_1a08x_12{width:100%;height:100%;background:var(--chures-input-bg, #111111);border:.0625rem solid rgb(255 255 255 / 13%);border-radius:var(--chures-input-radius, .75rem);color:var(--chures-fg, #ffffff);font-size:var(--chures-font-sm, .875rem);padding:0 .875rem;outline:none;transition:border-color .18s ease;box-sizing:border-box}._InputField_1a08x_12:focus{border-color:#ffffff59}._hasError_1a08x_30 ._InputField_1a08x_12,._hasError_1a08x_30 ._InputField_1a08x_12:focus{border-color:var(--chures-error, #ef4444)}._disabled_1a08x_35 ._InputField_1a08x_12{opacity:.45;cursor:not-allowed}._Label_1a08x_40{position:absolute;left:.875rem;top:50%;transform:translateY(-50%);transform-origin:left center;color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-sm, .875rem);pointer-events:none;transition:all .18s ease;padding:0 .25rem;border-radius:.1875rem}._Label_1a08x_40._lifted_1a08x_54{top:0;transform:translateY(-50%) scale(.82);background:var(--chures-input-bg, #111111);color:var(--chures-fg-muted, #9ca3af)}._hasError_1a08x_30 ._Label_1a08x_40._lifted_1a08x_54{color:var(--chures-error, #ef4444)}._ErrorText_1a08x_65{display:block;margin-top:.25rem;padding-left:.875rem;font-size:var(--chures-font-xs, .75rem);color:var(--chures-error, #ef4444)}._Skeleton_1a08x_73{width:100%;height:var(--chures-input-height, 3rem);border-radius:var(--chures-input-radius, .75rem);background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1a08x_1 1.5s ease-in-out infinite}@keyframes _shimmer_im4lz_1{0%{background-position:-200% 0}to{background-position:200% 0}}._ToggleContainer_im4lz_6{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}._disabled_im4lz_13{opacity:.45;cursor:not-allowed}._Track_im4lz_18{position:relative;width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:var(--chures-toggle-bg-off, rgb(255 255 255 / 13%));border:none;padding:0;cursor:pointer;transition:background .2s ease;flex-shrink:0}._Track_im4lz_18._on_im4lz_31{background:var(--chures-toggle-bg-on, var(--chures-accent, #229ED9))}._disabled_im4lz_13 ._Track_im4lz_18{cursor:not-allowed}._Thumb_im4lz_39{position:absolute;top:50%;left:.1875rem;transform:translateY(-50%);width:var(--chures-toggle-thumb, 1.125rem);height:var(--chures-toggle-thumb, 1.125rem);border-radius:50%;background:var(--chures-toggle-thumb-color, #ffffff);transition:left .2s ease;pointer-events:none}._Track_im4lz_18._on_im4lz_31 ._Thumb_im4lz_39{left:calc(var(--chures-toggle-width, 2.75rem) - var(--chures-toggle-thumb, 1.125rem) - .1875rem)}._Label_im4lz_56{font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff);-webkit-user-select:none;user-select:none}._LabelSkeleton_im4lz_62{display:inline-block;width:var(--chures-toggle-label-skeleton-w, 5rem);height:var(--chures-font-sm, .875rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}._Skeleton_im4lz_77{width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
+ import { jsx as e, jsxs as f, Fragment as w } from "react/jsx-runtime";
3
+ import { useRef as b, useState as S, useEffect as I } from "react";
4
+ import { AnimatePresence as k, motion as D } from "framer-motion";
5
+ import { create as A } from "zustand";
6
+ function E(o) {
7
+ return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
8
+ }
9
+ var L = { exports: {} };
10
+ var y;
11
+ function B() {
12
+ return y || (y = 1, (function(o) {
13
+ (function() {
14
+ var n = {}.hasOwnProperty;
15
+ function r() {
16
+ for (var t = "", a = 0; a < arguments.length; a++) {
17
+ var c = arguments[a];
18
+ c && (t = i(t, s(c)));
19
+ }
20
+ return t;
21
+ }
22
+ function s(t) {
23
+ if (typeof t == "string" || typeof t == "number")
24
+ return t;
25
+ if (typeof t != "object")
26
+ return "";
27
+ if (Array.isArray(t))
28
+ return r.apply(null, t);
29
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
30
+ return t.toString();
31
+ var a = "";
32
+ for (var c in t)
33
+ n.call(t, c) && t[c] && (a = i(a, c));
34
+ return a;
35
+ }
36
+ function i(t, a) {
37
+ return a ? t ? t + " " + a : t + a : t;
38
+ }
39
+ o.exports ? (r.default = r, o.exports = r) : window.classNames = r;
40
+ })();
41
+ })(L)), L.exports;
42
+ }
43
+ var z = B();
44
+ const u = /* @__PURE__ */ E(z), F = "_LoaderContainer_wa8op_24", j = "_sm_wa8op_31", O = "_md_wa8op_32", $ = "_lg_wa8op_33", q = "_Arc1_wa8op_37", P = "_Arc2_wa8op_38", M = "_Arc3_wa8op_39", U = "_spin_wa8op_1", G = "_Ring1_wa8op_71", V = "_Ring2_wa8op_72", H = "_Ring3_wa8op_73", J = "_ripple_wa8op_1", K = "_Dot1_wa8op_86", Q = "_Dot2_wa8op_87", X = "_Dot3_wa8op_88", Y = "_dotPulse_wa8op_1", Z = "_Wave1_wa8op_105", ee = "_Wave2_wa8op_106", ne = "_Wave3_wa8op_107", te = "_Wave4_wa8op_108", oe = "_Wave5_wa8op_109", re = "_waveBounce_wa8op_1", C = {
45
+ LoaderContainer: F,
46
+ sm: j,
47
+ md: O,
48
+ lg: $,
49
+ Arc1: q,
50
+ Arc2: P,
51
+ Arc3: M,
52
+ spin: U,
53
+ Ring1: G,
54
+ Ring2: V,
55
+ Ring3: H,
56
+ ripple: J,
57
+ Dot1: K,
58
+ Dot2: Q,
59
+ Dot3: X,
60
+ dotPulse: Y,
61
+ Wave1: Z,
62
+ Wave2: ee,
63
+ Wave3: ne,
64
+ Wave4: te,
65
+ Wave5: oe,
66
+ waveBounce: re
67
+ };
68
+ function se(o, n) {
69
+ switch (o) {
70
+ case "ripple":
71
+ return /* @__PURE__ */ f(w, { children: [
72
+ /* @__PURE__ */ e("div", { className: n.Ring1 }),
73
+ /* @__PURE__ */ e("div", { className: n.Ring2 }),
74
+ /* @__PURE__ */ e("div", { className: n.Ring3 })
75
+ ] });
76
+ case "dots":
77
+ return /* @__PURE__ */ f(w, { children: [
78
+ /* @__PURE__ */ e("div", { className: n.Dot1 }),
79
+ /* @__PURE__ */ e("div", { className: n.Dot2 }),
80
+ /* @__PURE__ */ e("div", { className: n.Dot3 })
81
+ ] });
82
+ case "wave":
83
+ return /* @__PURE__ */ f(w, { children: [
84
+ /* @__PURE__ */ e("div", { className: n.Wave1 }),
85
+ /* @__PURE__ */ e("div", { className: n.Wave2 }),
86
+ /* @__PURE__ */ e("div", { className: n.Wave3 }),
87
+ /* @__PURE__ */ e("div", { className: n.Wave4 }),
88
+ /* @__PURE__ */ e("div", { className: n.Wave5 })
89
+ ] });
90
+ default:
91
+ return /* @__PURE__ */ f(w, { children: [
92
+ /* @__PURE__ */ e("div", { className: n.Arc1 }),
93
+ /* @__PURE__ */ e("div", { className: n.Arc2 }),
94
+ /* @__PURE__ */ e("div", { className: n.Arc3 })
95
+ ] });
96
+ }
97
+ }
98
+ function ae({ variant: o = "arcs", size: n = "md", color: r, className: s }) {
99
+ return /* @__PURE__ */ e(
100
+ "div",
101
+ {
102
+ className: u(C.LoaderContainer, C[n], C[o], s),
103
+ role: "status",
104
+ "aria-label": "Loading",
105
+ style: r ? { "--chures-accent": r } : void 0,
106
+ children: se(o, C)
107
+ }
108
+ );
109
+ }
110
+ const ie = "_LoadingWrapperContainer_1q0w7_1", ce = "_SkeletonWrapper_1q0w7_9", W = {
111
+ LoadingWrapperContainer: ie,
112
+ SkeletonWrapper: ce
113
+ };
114
+ function Je({ isLoading: o, children: n, skeleton: r, loaderProps: s, className: i }) {
115
+ return o ? r ? /* @__PURE__ */ e("div", { className: u(W.SkeletonWrapper, i), children: r }) : /* @__PURE__ */ e("div", { className: u(W.LoadingWrapperContainer, i), children: /* @__PURE__ */ e(ae, { ...s }) }) : /* @__PURE__ */ e(w, { children: n });
116
+ }
117
+ const le = "https://oauth.telegram.org/js/telegram-login.js?3";
118
+ function ue(o) {
119
+ const { botId: n, redirectUri: r, requestAccess: s = "write" } = o, i = b(o.onSuccess);
120
+ i.current = o.onSuccess;
121
+ const t = b(!1), [a, c] = S(!1), [d, l] = S(!1);
122
+ I(function() {
123
+ if (!n) return;
124
+ const v = r ?? window.location.origin;
125
+ l(!0), c(!1);
126
+ const m = document.createElement("script");
127
+ return m.src = le, m.async = !0, m.onload = function() {
128
+ const T = window.Telegram;
129
+ T && (T.Login.init(
130
+ { client_id: n, redirect_uri: v },
131
+ function(R) {
132
+ t.current || (t.current = !0, i.current(R));
22
133
  }
23
- ), i(!0)), l(!1);
24
- }, d.onerror = function() {
134
+ ), c(!0)), l(!1);
135
+ }, m.onerror = function() {
25
136
  l(!1);
26
- }, document.head.appendChild(d), function() {
27
- document.head.contains(d) && document.head.removeChild(d), i(!1), l(!1);
137
+ }, document.head.appendChild(m), function() {
138
+ document.head.contains(m) && document.head.removeChild(m), c(!1), l(!1);
28
139
  };
29
- }, [o, e]);
30
- function m() {
31
- const u = window.Telegram;
32
- if (!t || !u) return;
33
- const d = e ?? window.location.origin;
34
- u.Login.auth(
35
- { client_id: o, redirect_uri: d, request_access: r },
36
- function(g) {
37
- s.current(g);
140
+ }, [n, r]);
141
+ function g() {
142
+ const v = window.Telegram;
143
+ if (!a || !v) return;
144
+ t.current = !1;
145
+ const m = r ?? window.location.origin;
146
+ v.Login.auth(
147
+ { client_id: n, redirect_uri: m, request_access: s },
148
+ function(T) {
149
+ t.current || (t.current = !0, i.current(T));
38
150
  }
39
151
  );
40
152
  }
41
- return { login: m, isReady: t, isLoading: c };
153
+ return { login: g, isReady: a, isLoading: d };
42
154
  }
43
- const b = "_TelegramSignInButtonContainer_1pw4t_1", j = "_FullSize_1pw4t_49", D = "_Icon_1pw4t_53", h = {
44
- TelegramSignInButtonContainer: b,
45
- FullSize: j,
46
- Icon: D
47
- }, O = {
155
+ const de = "_TelegramSignInButtonContainer_10wun_1", _e = "_FullSize_10wun_46", me = "_Icon_10wun_50", N = {
156
+ TelegramSignInButtonContainer: de,
157
+ FullSize: _e,
158
+ Icon: me
159
+ }, pe = {
48
160
  en: "Continue with Telegram",
49
161
  ru: "Войти через Telegram"
50
162
  };
51
- function N() {
52
- return /* @__PURE__ */ a(
163
+ function fe() {
164
+ return /* @__PURE__ */ e(
53
165
  "svg",
54
166
  {
55
167
  viewBox: "0 0 24 24",
@@ -57,160 +169,186 @@ function N() {
57
169
  height: "20",
58
170
  fill: "currentColor",
59
171
  "aria-hidden": "true",
60
- className: h.Icon,
61
- children: /* @__PURE__ */ a("path", { d: "M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z" })
172
+ className: N.Icon,
173
+ children: /* @__PURE__ */ e("path", { d: "M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z" })
62
174
  }
63
175
  );
64
176
  }
65
- function A({
66
- onClick: n,
67
- disabled: o,
68
- lang: e = "en",
69
- title: r,
70
- label: s,
177
+ function ge({
178
+ onClick: o,
179
+ disabled: n,
180
+ lang: r = "en",
181
+ title: s,
182
+ label: i,
71
183
  fullSize: t,
72
- className: i
184
+ className: a
73
185
  }) {
74
- y(function() {
75
- const m = "comfortaa-font";
76
- if (document.getElementById(m)) return;
77
- const u = document.createElement("link");
78
- u.id = m, u.rel = "stylesheet", u.href = "https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap", document.head.appendChild(u);
186
+ I(function() {
187
+ const l = "comfortaa-font";
188
+ if (document.getElementById(l)) return;
189
+ const g = document.createElement("link");
190
+ g.id = l, g.rel = "stylesheet", g.href = "https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap", document.head.appendChild(g);
79
191
  }, []);
80
- const c = s ?? r ?? O[e], l = [h.TelegramSignInButtonContainer, t && h.FullSize, i].filter(Boolean).join(" ");
81
- return /* @__PURE__ */ w("button", { type: "button", className: l, onClick: n, disabled: o, children: [
82
- /* @__PURE__ */ a(N, {}),
192
+ const c = i ?? s ?? pe[r], d = [N.TelegramSignInButtonContainer, t && N.FullSize, a].filter(Boolean).join(" ");
193
+ return /* @__PURE__ */ f("button", { type: "button", className: d, onClick: o, disabled: n, children: [
194
+ /* @__PURE__ */ e(fe, {}),
83
195
  c
84
196
  ] });
85
197
  }
86
- function tt({
87
- botId: n,
88
- onSuccess: o,
89
- lang: e,
90
- title: r,
91
- redirectUri: s,
198
+ function Ke({
199
+ botId: o,
200
+ onSuccess: n,
201
+ lang: r,
202
+ title: s,
203
+ redirectUri: i,
92
204
  requestAccess: t,
93
- children: i,
205
+ children: a,
94
206
  className: c
95
207
  }) {
96
- const { login: l, isReady: m } = E({ botId: n, onSuccess: o, redirectUri: s, requestAccess: t });
97
- return i ? /* @__PURE__ */ a(S, { children: i({ login: l, isReady: m }) }) : /* @__PURE__ */ a(
98
- A,
208
+ const { login: d, isReady: l } = ue({ botId: o, onSuccess: n, redirectUri: i, requestAccess: t });
209
+ return a ? /* @__PURE__ */ e(w, { children: a({ login: d, isReady: l }) }) : /* @__PURE__ */ e(
210
+ ge,
99
211
  {
100
- onClick: l,
101
- disabled: !m,
102
- lang: e,
103
- title: r,
212
+ onClick: d,
213
+ disabled: !l,
214
+ lang: r,
215
+ title: s,
104
216
  className: c
105
217
  }
106
218
  );
107
219
  }
108
- function F(n) {
109
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
110
- }
111
- var p = { exports: {} };
112
- var T;
113
- function z() {
114
- return T || (T = 1, (function(n) {
115
- (function() {
116
- var o = {}.hasOwnProperty;
117
- function e() {
118
- for (var t = "", i = 0; i < arguments.length; i++) {
119
- var c = arguments[i];
120
- c && (t = s(t, r(c)));
121
- }
122
- return t;
123
- }
124
- function r(t) {
125
- if (typeof t == "string" || typeof t == "number")
126
- return t;
127
- if (typeof t != "object")
128
- return "";
129
- if (Array.isArray(t))
130
- return e.apply(null, t);
131
- if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
132
- return t.toString();
133
- var i = "";
134
- for (var c in t)
135
- o.call(t, c) && t[c] && (i = s(i, c));
136
- return i;
137
- }
138
- function s(t, i) {
139
- return i ? t ? t + " " + i : t + i : t;
140
- }
141
- n.exports ? (e.default = e, n.exports = e) : window.classNames = e;
142
- })();
143
- })(p)), p.exports;
144
- }
145
- var q = z();
146
- const P = /* @__PURE__ */ F(q), v = L((n, o) => ({
220
+ let he = 0;
221
+ const x = A((o, n) => ({
147
222
  toasts: [],
148
- bake: (e) => {
149
- if (o().toasts.find((s) => s.title === e.title)) {
150
- console.error(`Toast with title "${e.title}" already exists`);
151
- return;
152
- }
153
- n((s) => ({ toasts: [...s.toasts, e] })), setTimeout(() => {
154
- o().dismiss(e.title);
223
+ bake: (r) => {
224
+ const s = he++;
225
+ o((i) => ({ toasts: [...i.toasts, { ...r, id: s }] })), setTimeout(() => {
226
+ n().dismiss(s);
155
227
  }, 5e3);
156
228
  },
157
- dismiss: (e) => {
158
- n((r) => ({
159
- toasts: r.toasts.filter((s) => s.title !== e)
229
+ dismiss: (r) => {
230
+ o((s) => ({
231
+ toasts: s.toasts.filter((i) => i.id !== r)
160
232
  }));
161
233
  }
162
- })), k = "_ToastContainer_1g7il_1", M = "_Toast_1g7il_1", U = "_error_1g7il_33", $ = "_warn_1g7il_41", G = "_info_1g7il_49", V = "_Description_1g7il_53", W = "_DismissButton_1g7il_59", H = "_slideIn_1g7il_79", J = "_slideOut_1g7il_83", f = {
163
- ToastContainer: k,
164
- Toast: M,
165
- error: U,
166
- warn: $,
167
- info: G,
168
- Description: V,
169
- DismissButton: W,
170
- slideIn: H,
171
- slideOut: J
234
+ })), ve = "_ToastContainer_1tme2_1", we = "_Toast_1tme2_1", Te = "_error_1tme2_33", Ce = "_warn_1tme2_41", Se = "_info_1tme2_49", Le = "_Description_1tme2_53", Ne = "_DismissButton_1tme2_59", Ie = "_slideIn_1tme2_79", be = "_slideOut_1tme2_83", p = {
235
+ ToastContainer: ve,
236
+ Toast: we,
237
+ error: Te,
238
+ warn: Ce,
239
+ info: Se,
240
+ Description: Le,
241
+ DismissButton: Ne,
242
+ slideIn: Ie,
243
+ slideOut: be
172
244
  };
173
- function nt() {
174
- const { toasts: n } = v();
175
- return /* @__PURE__ */ a("div", { className: f.ToastContainer, children: /* @__PURE__ */ a(x, { children: n.map((o, e) => /* @__PURE__ */ a(
176
- B.div,
245
+ function Qe() {
246
+ const { toasts: o } = x();
247
+ return /* @__PURE__ */ e("div", { className: p.ToastContainer, children: /* @__PURE__ */ e(k, { children: o.map((n) => /* @__PURE__ */ e(
248
+ D.div,
177
249
  {
178
250
  layout: !0,
179
251
  initial: { opacity: 0, x: 100, y: 50 },
180
252
  animate: { opacity: 1, x: 0, y: 0 },
181
253
  exit: { opacity: 0, y: -50 },
182
254
  transition: { type: "spring", stiffness: 300, damping: 20 },
183
- children: /* @__PURE__ */ a(K, { ...o })
255
+ children: /* @__PURE__ */ e(ye, { ...n })
184
256
  },
185
- e
257
+ n.id
186
258
  )) }) });
187
259
  }
188
- function K({ title: n, description: o, isDismissable: e }) {
189
- const [r, s] = _(!1), t = v();
190
- return y(() => () => {
191
- s(!0);
192
- }, []), /* @__PURE__ */ w(
260
+ function ye({ id: o, title: n, description: r, level: s, isDismissable: i }) {
261
+ const [t, a] = S(!1), c = x();
262
+ return I(() => () => {
263
+ a(!0);
264
+ }, []), /* @__PURE__ */ f(
193
265
  "div",
194
266
  {
195
- className: P(f.Toast, {
196
- [f.error]: n === "Error",
197
- [f.warn]: n === "Warn",
198
- [f.info]: n == null || n === "Info",
199
- [f.slideIn]: !r,
200
- [f.slideOut]: r
267
+ className: u(p.Toast, {
268
+ [p.error]: s === "Error",
269
+ [p.warn]: s === "Warn",
270
+ [p.info]: s == null || s === "Info",
271
+ [p.slideIn]: !t,
272
+ [p.slideOut]: t
201
273
  }),
202
274
  children: [
203
- /* @__PURE__ */ a("div", { children: n }),
204
- /* @__PURE__ */ a("div", { className: f.Description, children: o }),
205
- e && /* @__PURE__ */ a("div", { className: f.DismissButton, onClick: () => t.dismiss(n), children: "×" })
275
+ /* @__PURE__ */ e("div", { children: n }),
276
+ /* @__PURE__ */ e("div", { className: p.Description, children: r }),
277
+ i && o !== void 0 && /* @__PURE__ */ e("div", { className: p.DismissButton, onClick: () => c.dismiss(o), children: "×" })
206
278
  ]
207
279
  }
208
280
  );
209
281
  }
282
+ const We = "_InputContainer_1a08x_6", xe = "_InputField_1a08x_12", Re = "_hasError_1a08x_30", ke = "_disabled_1a08x_35", De = "_Label_1a08x_40", Ae = "_lifted_1a08x_54", Ee = "_ErrorText_1a08x_65", Be = "_Skeleton_1a08x_73", h = {
283
+ InputContainer: We,
284
+ InputField: xe,
285
+ hasError: Re,
286
+ disabled: ke,
287
+ Label: De,
288
+ lifted: Ae,
289
+ ErrorText: Ee,
290
+ Skeleton: Be
291
+ };
292
+ function Xe({ value: o, setValue: n, label: r, isLoader: s, type: i = "text", disabled: t, error: a, className: c }) {
293
+ const [d, l] = S(!1), g = d || o.length > 0;
294
+ return s ? /* @__PURE__ */ e("div", { className: u(h.Skeleton, c), "aria-hidden": "true" }) : /* @__PURE__ */ f("div", { className: u(h.InputContainer, { [h.hasError]: !!a, [h.disabled]: t }, c), children: [
295
+ /* @__PURE__ */ e(
296
+ "input",
297
+ {
298
+ className: h.InputField,
299
+ type: i,
300
+ value: o,
301
+ onChange: (v) => n(v.target.value),
302
+ onFocus: () => l(!0),
303
+ onBlur: () => l(!1),
304
+ disabled: t
305
+ }
306
+ ),
307
+ /* @__PURE__ */ e("label", { className: u(h.Label, { [h.lifted]: g }), children: r }),
308
+ a && /* @__PURE__ */ e("span", { className: h.ErrorText, children: a })
309
+ ] });
310
+ }
311
+ const ze = "_ToggleContainer_im4lz_6", Fe = "_disabled_im4lz_13", je = "_Track_im4lz_18", Oe = "_on_im4lz_31", $e = "_Thumb_im4lz_39", qe = "_Label_im4lz_56", Pe = "_LabelSkeleton_im4lz_62", Me = "_Skeleton_im4lz_77", _ = {
312
+ ToggleContainer: ze,
313
+ disabled: Fe,
314
+ Track: je,
315
+ on: Oe,
316
+ Thumb: $e,
317
+ Label: qe,
318
+ LabelSkeleton: Pe,
319
+ Skeleton: Me
320
+ };
321
+ function Ye({ checked: o, onChange: n, label: r, labelPosition: s = "right", disabled: i, isLoader: t, isLoadingLabel: a, className: c }) {
322
+ const d = !!r || a, l = a ? /* @__PURE__ */ e("span", { className: _.LabelSkeleton, "aria-hidden": "true" }) : r ? /* @__PURE__ */ e("span", { className: _.Label, children: r }) : null;
323
+ return t ? d ? /* @__PURE__ */ f("div", { className: u(_.ToggleContainer, c), children: [
324
+ s === "left" && l,
325
+ /* @__PURE__ */ e("div", { className: _.Skeleton, "aria-hidden": "true" }),
326
+ s === "right" && l
327
+ ] }) : /* @__PURE__ */ e("div", { className: u(_.Skeleton, c), "aria-hidden": "true" }) : /* @__PURE__ */ f("label", { className: u(_.ToggleContainer, { [_.disabled]: i }, c), children: [
328
+ s === "left" && l,
329
+ /* @__PURE__ */ e(
330
+ "button",
331
+ {
332
+ role: "switch",
333
+ "aria-checked": o,
334
+ className: u(_.Track, { [_.on]: o }),
335
+ onClick: () => !i && n(!o),
336
+ disabled: i,
337
+ type: "button",
338
+ children: /* @__PURE__ */ e("span", { className: _.Thumb })
339
+ }
340
+ ),
341
+ s === "right" && l
342
+ ] });
343
+ }
210
344
  export {
211
- tt as TelegramAuth,
212
- A as TelegramSignInButton,
213
- nt as Toaster,
214
- E as useTelegramLogin,
215
- v as useToaster
345
+ Xe as Input,
346
+ ae as Loader,
347
+ Je as LoadingWrapper,
348
+ Ke as TelegramAuth,
349
+ ge as TelegramSignInButton,
350
+ Qe as Toaster,
351
+ Ye as Toggle,
352
+ ue as useTelegramLogin,
353
+ x as useToaster
216
354
  };
@@ -1,2 +1,2 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._TelegramSignInButtonContainer_1pw4t_1{--tg-blue: #2AABEE;--tg-blue-2: #229ED9;display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--tg-blue) 0%,var(--tg-blue-2) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_1pw4t_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_1pw4t_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_1pw4t_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_1pw4t_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_1pw4t_49{height:100%}._Icon_1pw4t_53{flex-shrink:0}._ToastContainer_1g7il_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1g7il_1{min-height:4rem;border:var(--ta-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:#000;display:flex;flex-direction:column}._Toast_1g7il_1>div:first-child{font-weight:700;font-size:var(--ta-font-sm, .875rem);color:var(--ta-fg, #ffffff)}._Toast_1g7il_1._error_1g7il_33{border-color:var(--ta-error, #ef4444)}._Toast_1g7il_1._error_1g7il_33>div:first-child{color:var(--ta-error, #ef4444)}._Toast_1g7il_1._warn_1g7il_41{border-color:var(--ta-warn, #f59e0b)}._Toast_1g7il_1._warn_1g7il_41>div:first-child{color:var(--ta-warn, #f59e0b)}._Toast_1g7il_1._info_1g7il_49{border-color:var(--ta-accent, #229ED9)}._Toast_1g7il_1 ._Description_1g7il_53{color:var(--ta-fg-muted, #9ca3af);font-size:var(--ta-font-xs, .75rem);margin-top:.125rem}._Toast_1g7il_1 ._DismissButton_1g7il_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--ta-fg-muted, #9ca3af)}._slideIn_1g7il_79{animation:_slideIn_1g7il_79 .2s ease forwards}._slideOut_1g7il_83{animation:_slideOut_1g7il_83 .2s ease forwards}@keyframes _slideIn_1g7il_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1g7il_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- (function(a,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react/jsx-runtime"),require("react"),require("framer-motion"),require("zustand")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","framer-motion","zustand"],i):(a=typeof globalThis<"u"?globalThis:a||self,i(a.Chures={},a.ReactJSXRuntime,a.React,a.FramerMotion,a.Zustand))})(this,(function(a,i,g,S,v){"use strict";const B="https://oauth.telegram.org/js/telegram-login.js?3";function I(t){const{botId:r,redirectUri:n,requestAccess:c="write"}=t,o=g.useRef(t.onSuccess);o.current=t.onSuccess;const[e,s]=g.useState(!1),[u,d]=g.useState(!1);g.useEffect(function(){if(!r)return;const f=n??window.location.origin;d(!0),s(!1);const m=document.createElement("script");return m.src=B,m.async=!0,m.onload=function(){const _=window.Telegram;_&&(_.Login.init({client_id:r,redirect_uri:f},function(A){o.current(A)}),s(!0)),d(!1)},m.onerror=function(){d(!1)},document.head.appendChild(m),function(){document.head.contains(m)&&document.head.removeChild(m),s(!1),d(!1)}},[r,n]);function p(){const f=window.Telegram;if(!e||!f)return;const m=n??window.location.origin;f.Login.auth({client_id:r,redirect_uri:m,request_access:c},function(_){o.current(_)})}return{login:p,isReady:e,isLoading:u}}const h={TelegramSignInButtonContainer:"_TelegramSignInButtonContainer_1pw4t_1",FullSize:"_FullSize_1pw4t_49",Icon:"_Icon_1pw4t_53"},L={en:"Continue with Telegram",ru:"Войти через Telegram"};function E(){return i.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",className:h.Icon,children:i.jsx("path",{d:"M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z"})})}function w({onClick:t,disabled:r,lang:n="en",title:c,label:o,fullSize:e,className:s}){g.useEffect(function(){const p="comfortaa-font";if(document.getElementById(p))return;const f=document.createElement("link");f.id=p,f.rel="stylesheet",f.href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap",document.head.appendChild(f)},[]);const u=o??c??L[n],d=[h.TelegramSignInButtonContainer,e&&h.FullSize,s].filter(Boolean).join(" ");return i.jsxs("button",{type:"button",className:d,onClick:t,disabled:r,children:[i.jsx(E,{}),u]})}function j({botId:t,onSuccess:r,lang:n,title:c,redirectUri:o,requestAccess:e,children:s,className:u}){const{login:d,isReady:p}=I({botId:t,onSuccess:r,redirectUri:o,requestAccess:e});return s?i.jsx(i.Fragment,{children:s({login:d,isReady:p})}):i.jsx(w,{onClick:d,disabled:!p,lang:n,title:c,className:u})}function x(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var T={exports:{}};var C;function D(){return C||(C=1,(function(t){(function(){var r={}.hasOwnProperty;function n(){for(var e="",s=0;s<arguments.length;s++){var u=arguments[s];u&&(e=o(e,c(u)))}return e}function c(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e!="object")return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var s="";for(var u in e)r.call(e,u)&&e[u]&&(s=o(s,u));return s}function o(e,s){return s?e?e+" "+s:e+s:e}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(T)),T.exports}var O=D();const b=x(O),y=v.create((t,r)=>({toasts:[],bake:n=>{if(r().toasts.find(o=>o.title===n.title)){console.error(`Toast with title "${n.title}" already exists`);return}t(o=>({toasts:[...o.toasts,n]})),setTimeout(()=>{r().dismiss(n.title)},5e3)},dismiss:n=>{t(c=>({toasts:c.toasts.filter(o=>o.title!==n)}))}})),l={ToastContainer:"_ToastContainer_1g7il_1",Toast:"_Toast_1g7il_1",error:"_error_1g7il_33",warn:"_warn_1g7il_41",info:"_info_1g7il_49",Description:"_Description_1g7il_53",DismissButton:"_DismissButton_1g7il_59",slideIn:"_slideIn_1g7il_79",slideOut:"_slideOut_1g7il_83"};function q(){const{toasts:t}=y();return i.jsx("div",{className:l.ToastContainer,children:i.jsx(S.AnimatePresence,{children:t.map((r,n)=>i.jsx(S.motion.div,{layout:!0,initial:{opacity:0,x:100,y:50},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:-50},transition:{type:"spring",stiffness:300,damping:20},children:i.jsx(z,{...r})},n))})})}function z({title:t,description:r,isDismissable:n}){const[c,o]=g.useState(!1),e=y();return g.useEffect(()=>()=>{o(!0)},[]),i.jsxs("div",{className:b(l.Toast,{[l.error]:t==="Error",[l.warn]:t==="Warn",[l.info]:t==null||t==="Info",[l.slideIn]:!c,[l.slideOut]:c}),children:[i.jsx("div",{children:t}),i.jsx("div",{className:l.Description,children:r}),n&&i.jsx("div",{className:l.DismissButton,onClick:()=>e.dismiss(t),children:"×"})]})}a.TelegramAuth=j,a.TelegramSignInButton=w,a.Toaster=q,a.useTelegramLogin=I,a.useToaster=y,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--chures-accent: #229ED9;--chures-btn-from: #2AABEE;--chures-btn-to: #229ED9;--chures-error: #ef4444;--chures-warn: #f59e0b;--chures-fg: #ffffff;--chures-fg-muted: #9ca3af;--chures-surface: #000000;--chures-font-sm: .875rem;--chures-font-xs: .75rem;--chures-input-bg: #111111;--chures-input-height: 3rem;--chures-input-radius: .75rem;--chures-skeleton-shine: #1e1e1e;--chures-toggle-width: 2.75rem;--chures-toggle-height: 1.5rem;--chures-toggle-thumb: 1.125rem;--chures-toggle-bg-off: rgb(255 255 255 / 13%);--chures-toggle-bg-on: var(--chures-accent);--chures-toggle-thumb-color: #ffffff;--chures-toggle-label-skeleton-w: 5rem}@keyframes _spin_wa8op_1{to{transform:rotate(360deg)}}@keyframes _ripple_wa8op_1{0%{transform:scale(.08);opacity:.9}to{transform:scale(1);opacity:0}}@keyframes _dotPulse_wa8op_1{0%,to{transform:translate(-50%,-50%) scale(.55);opacity:.3}50%{transform:translate(-50%,calc(-50% - var(--sz) * .1)) scale(1);opacity:1}}@keyframes _waveBounce_wa8op_1{0%,55%,to{transform:translate(-50%,-50%) scale(.8);opacity:.4}27%{transform:translate(-50%,calc(-50% - var(--sz) * .28)) scale(1);opacity:1}}._LoaderContainer_wa8op_24{position:relative;flex-shrink:0}._sm_wa8op_31{width:1.5rem;height:1.5rem;--sz: 1.5rem;--arc-gap: .2rem;--arc-bw: .125rem}._md_wa8op_32{width:2.5rem;height:2.5rem;--sz: 2.5rem;--arc-gap: .35rem;--arc-bw: .1875rem}._lg_wa8op_33{width:4rem;height:4rem;--sz: 4rem;--arc-gap: .55rem;--arc-bw: .25rem}._Arc1_wa8op_37,._Arc2_wa8op_38,._Arc3_wa8op_39{position:absolute;border-radius:50%;border:var(--arc-bw) solid transparent}._Arc1_wa8op_37{inset:0;border-top-color:var(--chures-accent, #229ED9);border-left-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.2s linear infinite;filter:drop-shadow(0 0 .25rem var(--chures-accent, #229ED9))}._Arc2_wa8op_38{inset:var(--arc-gap);border-bottom-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.8s linear infinite reverse;opacity:.8}._Arc3_wa8op_39{inset:calc(var(--arc-gap) * 2);border-top-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 2.4s linear infinite;opacity:.6}._Ring1_wa8op_71,._Ring2_wa8op_72,._Ring3_wa8op_73{position:absolute;inset:0;border-radius:50%;border:var(--arc-bw) solid var(--chures-accent, #229ED9);animation:_ripple_wa8op_1 1.8s ease-out infinite both}._Ring2_wa8op_72{animation-delay:.6s}._Ring3_wa8op_73{animation-delay:1.2s}._Dot1_wa8op_86,._Dot2_wa8op_87,._Dot3_wa8op_88{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .2);height:calc(var(--sz) * .2);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .14) var(--chures-accent, #229ED9);animation:_dotPulse_wa8op_1 1.1s ease-in-out infinite both}._Dot1_wa8op_86{left:22%}._Dot2_wa8op_87{left:50%;animation-delay:.18s}._Dot3_wa8op_88{left:78%;animation-delay:.36s}._Wave1_wa8op_105,._Wave2_wa8op_106,._Wave3_wa8op_107,._Wave4_wa8op_108,._Wave5_wa8op_109{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .16);height:calc(var(--sz) * .16);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .1) var(--chures-accent, #229ED9);animation:_waveBounce_wa8op_1 1s ease-in-out infinite both}._Wave1_wa8op_105{left:10%}._Wave2_wa8op_106{left:28%;animation-delay:.12s}._Wave3_wa8op_107{left:46%;animation-delay:.24s}._Wave4_wa8op_108{left:64%;animation-delay:.36s}._Wave5_wa8op_109{left:82%;animation-delay:.48s}._LoadingWrapperContainer_1q0w7_1{display:flex;align-items:center;justify-content:center;width:100%;min-height:4rem}._SkeletonWrapper_1q0w7_9{width:100%}._TelegramSignInButtonContainer_10wun_1{display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--chures-btn-from, #2AABEE) 0%,var(--chures-btn-to, #229ED9) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_10wun_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_10wun_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_10wun_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_10wun_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_10wun_46{height:100%}._Icon_10wun_50{flex-shrink:0}._ToastContainer_1tme2_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1tme2_1{min-height:4rem;border:var(--chures-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:var(--chures-surface, #000000);display:flex;flex-direction:column}._Toast_1tme2_1>div:first-child{font-weight:700;font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff)}._Toast_1tme2_1._error_1tme2_33{border-color:var(--chures-error, #ef4444)}._Toast_1tme2_1._error_1tme2_33>div:first-child{color:var(--chures-error, #ef4444)}._Toast_1tme2_1._warn_1tme2_41{border-color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._warn_1tme2_41>div:first-child{color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._info_1tme2_49{border-color:var(--chures-accent, #229ED9)}._Toast_1tme2_1 ._Description_1tme2_53{color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-xs, .75rem);margin-top:.125rem}._Toast_1tme2_1 ._DismissButton_1tme2_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--chures-fg-muted, #9ca3af)}._slideIn_1tme2_79{animation:_slideIn_1tme2_79 .2s ease forwards}._slideOut_1tme2_83{animation:_slideOut_1tme2_83 .2s ease forwards}@keyframes _slideIn_1tme2_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1tme2_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}@keyframes _shimmer_1a08x_1{0%{background-position:-200% 0}to{background-position:200% 0}}._InputContainer_1a08x_6{position:relative;width:100%;height:var(--chures-input-height, 3rem)}._InputField_1a08x_12{width:100%;height:100%;background:var(--chures-input-bg, #111111);border:.0625rem solid rgb(255 255 255 / 13%);border-radius:var(--chures-input-radius, .75rem);color:var(--chures-fg, #ffffff);font-size:var(--chures-font-sm, .875rem);padding:0 .875rem;outline:none;transition:border-color .18s ease;box-sizing:border-box}._InputField_1a08x_12:focus{border-color:#ffffff59}._hasError_1a08x_30 ._InputField_1a08x_12,._hasError_1a08x_30 ._InputField_1a08x_12:focus{border-color:var(--chures-error, #ef4444)}._disabled_1a08x_35 ._InputField_1a08x_12{opacity:.45;cursor:not-allowed}._Label_1a08x_40{position:absolute;left:.875rem;top:50%;transform:translateY(-50%);transform-origin:left center;color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-sm, .875rem);pointer-events:none;transition:all .18s ease;padding:0 .25rem;border-radius:.1875rem}._Label_1a08x_40._lifted_1a08x_54{top:0;transform:translateY(-50%) scale(.82);background:var(--chures-input-bg, #111111);color:var(--chures-fg-muted, #9ca3af)}._hasError_1a08x_30 ._Label_1a08x_40._lifted_1a08x_54{color:var(--chures-error, #ef4444)}._ErrorText_1a08x_65{display:block;margin-top:.25rem;padding-left:.875rem;font-size:var(--chures-font-xs, .75rem);color:var(--chures-error, #ef4444)}._Skeleton_1a08x_73{width:100%;height:var(--chures-input-height, 3rem);border-radius:var(--chures-input-radius, .75rem);background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1a08x_1 1.5s ease-in-out infinite}@keyframes _shimmer_im4lz_1{0%{background-position:-200% 0}to{background-position:200% 0}}._ToggleContainer_im4lz_6{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}._disabled_im4lz_13{opacity:.45;cursor:not-allowed}._Track_im4lz_18{position:relative;width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:var(--chures-toggle-bg-off, rgb(255 255 255 / 13%));border:none;padding:0;cursor:pointer;transition:background .2s ease;flex-shrink:0}._Track_im4lz_18._on_im4lz_31{background:var(--chures-toggle-bg-on, var(--chures-accent, #229ED9))}._disabled_im4lz_13 ._Track_im4lz_18{cursor:not-allowed}._Thumb_im4lz_39{position:absolute;top:50%;left:.1875rem;transform:translateY(-50%);width:var(--chures-toggle-thumb, 1.125rem);height:var(--chures-toggle-thumb, 1.125rem);border-radius:50%;background:var(--chures-toggle-thumb-color, #ffffff);transition:left .2s ease;pointer-events:none}._Track_im4lz_18._on_im4lz_31 ._Thumb_im4lz_39{left:calc(var(--chures-toggle-width, 2.75rem) - var(--chures-toggle-thumb, 1.125rem) - .1875rem)}._Label_im4lz_56{font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff);-webkit-user-select:none;user-select:none}._LabelSkeleton_im4lz_62{display:inline-block;width:var(--chures-toggle-label-skeleton-w, 5rem);height:var(--chures-font-sm, .875rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}._Skeleton_im4lz_77{width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
+ (function(l,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("framer-motion"),require("zustand")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","framer-motion","zustand"],e):(l=typeof globalThis<"u"?globalThis:l||self,e(l.Chures={},l.ReactJSXRuntime,l.React,l.FramerMotion,l.Zustand))})(this,(function(l,e,f,W,A){"use strict";function E(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var C={exports:{}};var b;function B(){return b||(b=1,(function(o){(function(){var n={}.hasOwnProperty;function r(){for(var t="",s=0;s<arguments.length;s++){var c=arguments[s];c&&(t=i(t,a(c)))}return t}function a(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return r.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var s="";for(var c in t)n.call(t,c)&&t[c]&&(s=i(s,c));return s}function i(t,s){return s?t?t+" "+s:t+s:t}o.exports?(r.default=r,o.exports=r):window.classNames=r})()})(C)),C.exports}var F=B();const _=E(F),w={LoaderContainer:"_LoaderContainer_wa8op_24",sm:"_sm_wa8op_31",md:"_md_wa8op_32",lg:"_lg_wa8op_33",Arc1:"_Arc1_wa8op_37",Arc2:"_Arc2_wa8op_38",Arc3:"_Arc3_wa8op_39",spin:"_spin_wa8op_1",Ring1:"_Ring1_wa8op_71",Ring2:"_Ring2_wa8op_72",Ring3:"_Ring3_wa8op_73",ripple:"_ripple_wa8op_1",Dot1:"_Dot1_wa8op_86",Dot2:"_Dot2_wa8op_87",Dot3:"_Dot3_wa8op_88",dotPulse:"_dotPulse_wa8op_1",Wave1:"_Wave1_wa8op_105",Wave2:"_Wave2_wa8op_106",Wave3:"_Wave3_wa8op_107",Wave4:"_Wave4_wa8op_108",Wave5:"_Wave5_wa8op_109",waveBounce:"_waveBounce_wa8op_1"};function z(o,n){switch(o){case"ripple":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Ring1}),e.jsx("div",{className:n.Ring2}),e.jsx("div",{className:n.Ring3})]});case"dots":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Dot1}),e.jsx("div",{className:n.Dot2}),e.jsx("div",{className:n.Dot3})]});case"wave":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Wave1}),e.jsx("div",{className:n.Wave2}),e.jsx("div",{className:n.Wave3}),e.jsx("div",{className:n.Wave4}),e.jsx("div",{className:n.Wave5})]});default:return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Arc1}),e.jsx("div",{className:n.Arc2}),e.jsx("div",{className:n.Arc3})]})}}function y({variant:o="arcs",size:n="md",color:r,className:a}){return e.jsx("div",{className:_(w.LoaderContainer,w[n],w[o],a),role:"status","aria-label":"Loading",style:r?{"--chures-accent":r}:void 0,children:z(o,w)})}const N={LoadingWrapperContainer:"_LoadingWrapperContainer_1q0w7_1",SkeletonWrapper:"_SkeletonWrapper_1q0w7_9"};function x({isLoading:o,children:n,skeleton:r,loaderProps:a,className:i}){return o?r?e.jsx("div",{className:_(N.SkeletonWrapper,i),children:r}):e.jsx("div",{className:_(N.LoadingWrapperContainer,i),children:e.jsx(y,{...a})}):e.jsx(e.Fragment,{children:n})}const O="https://oauth.telegram.org/js/telegram-login.js?3";function k(o){const{botId:n,redirectUri:r,requestAccess:a="write"}=o,i=f.useRef(o.onSuccess);i.current=o.onSuccess;const t=f.useRef(!1),[s,c]=f.useState(!1),[p,d]=f.useState(!1);f.useEffect(function(){if(!n)return;const T=r??window.location.origin;d(!0),c(!1);const m=document.createElement("script");return m.src=O,m.async=!0,m.onload=function(){const S=window.Telegram;S&&(S.Login.init({client_id:n,redirect_uri:T},function(V){t.current||(t.current=!0,i.current(V))}),c(!0)),d(!1)},m.onerror=function(){d(!1)},document.head.appendChild(m),function(){document.head.contains(m)&&document.head.removeChild(m),c(!1),d(!1)}},[n,r]);function v(){const T=window.Telegram;if(!s||!T)return;t.current=!1;const m=r??window.location.origin;T.Login.auth({client_id:n,redirect_uri:m,request_access:a},function(S){t.current||(t.current=!0,i.current(S))})}return{login:v,isReady:s,isLoading:p}}const L={TelegramSignInButtonContainer:"_TelegramSignInButtonContainer_10wun_1",FullSize:"_FullSize_10wun_46",Icon:"_Icon_10wun_50"},$={en:"Continue with Telegram",ru:"Войти через Telegram"};function q(){return e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",className:L.Icon,children:e.jsx("path",{d:"M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z"})})}function D({onClick:o,disabled:n,lang:r="en",title:a,label:i,fullSize:t,className:s}){f.useEffect(function(){const d="comfortaa-font";if(document.getElementById(d))return;const v=document.createElement("link");v.id=d,v.rel="stylesheet",v.href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap",document.head.appendChild(v)},[]);const c=i??a??$[r],p=[L.TelegramSignInButtonContainer,t&&L.FullSize,s].filter(Boolean).join(" ");return e.jsxs("button",{type:"button",className:p,onClick:o,disabled:n,children:[e.jsx(q,{}),c]})}function j({botId:o,onSuccess:n,lang:r,title:a,redirectUri:i,requestAccess:t,children:s,className:c}){const{login:p,isReady:d}=k({botId:o,onSuccess:n,redirectUri:i,requestAccess:t});return s?e.jsx(e.Fragment,{children:s({login:p,isReady:d})}):e.jsx(D,{onClick:p,disabled:!d,lang:r,title:a,className:c})}let P=0;const I=A.create((o,n)=>({toasts:[],bake:r=>{const a=P++;o(i=>({toasts:[...i.toasts,{...r,id:a}]})),setTimeout(()=>{n().dismiss(a)},5e3)},dismiss:r=>{o(a=>({toasts:a.toasts.filter(i=>i.id!==r)}))}})),g={ToastContainer:"_ToastContainer_1tme2_1",Toast:"_Toast_1tme2_1",error:"_error_1tme2_33",warn:"_warn_1tme2_41",info:"_info_1tme2_49",Description:"_Description_1tme2_53",DismissButton:"_DismissButton_1tme2_59",slideIn:"_slideIn_1tme2_79",slideOut:"_slideOut_1tme2_83"};function M(){const{toasts:o}=I();return e.jsx("div",{className:g.ToastContainer,children:e.jsx(W.AnimatePresence,{children:o.map(n=>e.jsx(W.motion.div,{layout:!0,initial:{opacity:0,x:100,y:50},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:-50},transition:{type:"spring",stiffness:300,damping:20},children:e.jsx(U,{...n})},n.id))})})}function U({id:o,title:n,description:r,level:a,isDismissable:i}){const[t,s]=f.useState(!1),c=I();return f.useEffect(()=>()=>{s(!0)},[]),e.jsxs("div",{className:_(g.Toast,{[g.error]:a==="Error",[g.warn]:a==="Warn",[g.info]:a==null||a==="Info",[g.slideIn]:!t,[g.slideOut]:t}),children:[e.jsx("div",{children:n}),e.jsx("div",{className:g.Description,children:r}),i&&o!==void 0&&e.jsx("div",{className:g.DismissButton,onClick:()=>c.dismiss(o),children:"×"})]})}const h={InputContainer:"_InputContainer_1a08x_6",InputField:"_InputField_1a08x_12",hasError:"_hasError_1a08x_30",disabled:"_disabled_1a08x_35",Label:"_Label_1a08x_40",lifted:"_lifted_1a08x_54",ErrorText:"_ErrorText_1a08x_65",Skeleton:"_Skeleton_1a08x_73"};function G({value:o,setValue:n,label:r,isLoader:a,type:i="text",disabled:t,error:s,className:c}){const[p,d]=f.useState(!1),v=p||o.length>0;return a?e.jsx("div",{className:_(h.Skeleton,c),"aria-hidden":"true"}):e.jsxs("div",{className:_(h.InputContainer,{[h.hasError]:!!s,[h.disabled]:t},c),children:[e.jsx("input",{className:h.InputField,type:i,value:o,onChange:T=>n(T.target.value),onFocus:()=>d(!0),onBlur:()=>d(!1),disabled:t}),e.jsx("label",{className:_(h.Label,{[h.lifted]:v}),children:r}),s&&e.jsx("span",{className:h.ErrorText,children:s})]})}const u={ToggleContainer:"_ToggleContainer_im4lz_6",disabled:"_disabled_im4lz_13",Track:"_Track_im4lz_18",on:"_on_im4lz_31",Thumb:"_Thumb_im4lz_39",Label:"_Label_im4lz_56",LabelSkeleton:"_LabelSkeleton_im4lz_62",Skeleton:"_Skeleton_im4lz_77"};function J({checked:o,onChange:n,label:r,labelPosition:a="right",disabled:i,isLoader:t,isLoadingLabel:s,className:c}){const p=!!r||s,d=s?e.jsx("span",{className:u.LabelSkeleton,"aria-hidden":"true"}):r?e.jsx("span",{className:u.Label,children:r}):null;return t?p?e.jsxs("div",{className:_(u.ToggleContainer,c),children:[a==="left"&&d,e.jsx("div",{className:u.Skeleton,"aria-hidden":"true"}),a==="right"&&d]}):e.jsx("div",{className:_(u.Skeleton,c),"aria-hidden":"true"}):e.jsxs("label",{className:_(u.ToggleContainer,{[u.disabled]:i},c),children:[a==="left"&&d,e.jsx("button",{role:"switch","aria-checked":o,className:_(u.Track,{[u.on]:o}),onClick:()=>!i&&n(!o),disabled:i,type:"button",children:e.jsx("span",{className:u.Thumb})}),a==="right"&&d]})}l.Input=G,l.Loader=y,l.LoadingWrapper=x,l.TelegramAuth=j,l.TelegramSignInButton=D,l.Toaster=M,l.Toggle=J,l.useTelegramLogin=k,l.useToaster=I,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,13 @@
1
+ interface Props {
2
+ value: string;
3
+ setValue: (v: string) => void;
4
+ label: string;
5
+ isLoader?: boolean;
6
+ type?: 'text' | 'password' | 'email' | 'number';
7
+ disabled?: boolean;
8
+ error?: string;
9
+ className?: string;
10
+ }
11
+ export type InputProps = Props;
12
+ export declare function Input({ value, setValue, label, isLoader, type, disabled, error, className }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ variant?: 'arcs' | 'ripple' | 'dots' | 'wave';
3
+ size?: 'sm' | 'md' | 'lg';
4
+ color?: string;
5
+ className?: string;
6
+ }
7
+ export type LoaderProps = Props;
8
+ export declare function Loader({ variant, size, color, className }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { LoaderProps } from './Loader';
2
+ interface Props {
3
+ isLoading: boolean;
4
+ children: React.ReactNode;
5
+ skeleton?: React.ReactNode;
6
+ loaderProps?: LoaderProps;
7
+ className?: string;
8
+ }
9
+ export type LoadingWrapperProps = Props;
10
+ export declare function LoadingWrapper({ isLoading, children, skeleton, loaderProps, className }: Props): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ interface Props {
2
+ checked: boolean;
3
+ onChange: (checked: boolean) => void;
4
+ label?: string;
5
+ labelPosition?: 'left' | 'right';
6
+ disabled?: boolean;
7
+ isLoader?: boolean;
8
+ isLoadingLabel?: boolean;
9
+ className?: string;
10
+ }
11
+ export type ToggleProps = Props;
12
+ export declare function Toggle({ checked, onChange, label, labelPosition, disabled, isLoader, isLoadingLabel, className }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -1,4 +1,5 @@
1
1
  export interface Toast {
2
+ id?: number;
2
3
  title: string;
3
4
  description: string;
4
5
  level?: 'Error' | 'Warn' | 'Info';
@@ -7,6 +8,6 @@ export interface Toast {
7
8
  export interface ToasterStore {
8
9
  toasts: Toast[];
9
10
  bake: (t: Toast) => void;
10
- dismiss: (title: string) => void;
11
+ dismiss: (id: number) => void;
11
12
  }
12
13
  export declare const useToaster: import('zustand').UseBoundStore<import('zustand').StoreApi<ToasterStore>>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,15 @@
1
+ export { Loader } from './components/Loader';
2
+ export type { LoaderProps } from './components/Loader';
3
+ export { LoadingWrapper } from './components/LoadingWrapper';
4
+ export type { LoadingWrapperProps } from './components/LoadingWrapper';
1
5
  export { TelegramAuth } from './components/TelegramAuth';
2
6
  export { default as Toaster } from './components/notifications/Toaster';
3
7
  export { useToaster } from './hooks/toaster/useToaster';
4
8
  export type { Toast, ToasterStore } from './hooks/toaster/useToaster';
9
+ export { Input } from './components/Input';
10
+ export type { InputProps } from './components/Input';
11
+ export { Toggle } from './components/Toggle';
12
+ export type { ToggleProps } from './components/Toggle';
5
13
  export { TelegramSignInButton } from './components/TelegramSignInButton';
6
14
  export { useTelegramLogin } from './hooks/useTelegramLogin';
7
15
  export type { TelegramAuthProps } from './components/TelegramAuth';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vervstack/chures",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "React components and hooks for Telegram OAuth login and toast notifications",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "demo": "vite",
39
39
  "build:demo": "vite build --config vite.config.demo.ts",
40
40
  "type-check": "tsc --noEmit",
41
- "patch": "npm version patch && npm publish --access public"
41
+ "patch": "npm run build && npm version patch && npm publish --access public"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": "^18.0.0 || ^19.0.0",
@@ -52,6 +52,7 @@
52
52
  "@types/react-dom": "^19.0.0",
53
53
  "@vitejs/plugin-react": "^4.5.2",
54
54
  "framer-motion": "^12.40.0",
55
+ "react-tooltip": "^6.0.7",
55
56
  "typescript": "~5.8.3",
56
57
  "vite": "^7.3.1",
57
58
  "vite-plugin-css-injected-by-js": "^3.5.2",