gentiq 0.7.26 → 0.7.27
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/{checkbox-D3JJhc0K.js → checkbox-plYm_Rxp.js} +1000 -987
- package/dist/gentiq-admin.es.js +1038 -952
- package/dist/gentiq-index.es.js +1017 -1027
- package/dist/gentiq.css +1 -1
- package/dist/src/locales/en.json.d.ts +8 -1
- package/dist/src/locales/fa.json.d.ts +8 -1
- package/package.json +1 -1
package/dist/gentiq-index.es.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { QueryClient as
|
|
5
|
-
import { I18nextProvider as
|
|
6
|
-
import { Trans as
|
|
7
|
-
import { g as
|
|
8
|
-
import {
|
|
9
|
-
import { Loader2Icon as
|
|
10
|
-
import { useTheme as
|
|
11
|
-
import { Toaster as
|
|
12
|
-
import { useChat as
|
|
13
|
-
import { DefaultChatTransport as
|
|
14
|
-
import { useLocation as
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
+
import * as ae from "react";
|
|
3
|
+
import { useState as _, useMemo as O, useEffect as $, useRef as ee, useCallback as Y, useLayoutEffect as Xe } from "react";
|
|
4
|
+
import { QueryClient as Je, QueryClientProvider as Ye, useQueryClient as pe, useQuery as Ze, useInfiniteQuery as et } from "@tanstack/react-query";
|
|
5
|
+
import { I18nextProvider as tt, useTranslation as ce } from "react-i18next";
|
|
6
|
+
import { Trans as Ya, Translation as Za, useTranslation as er, withTranslation as tr } from "react-i18next";
|
|
7
|
+
import { g as at, u as M, d as rt, C as qe, T as nt, a as te, b as Fe, j as be, G as st, c as le, e as f, f as ot, h as je, i as Oe, k as $e, l as Be, B as Z, m as Ue, n as he, D as Ke, o as it, p as He, L as Q, I as V, S as ve, q as xe, r as ye, s as we, t as me, v as lt, w as Pe, x as ct, y as dt, z as ut, A as de, E as mt, F as ht, H as pt, J as gt, K as ft, M as bt } from "./checkbox-plYm_Rxp.js";
|
|
8
|
+
import { N as rr, O as nr, P as sr, Q as or, R as ir, U as lr, V as cr, W as dr, X as ur, Y as mr, Z as hr, _ as pr, $ as gr } from "./checkbox-plYm_Rxp.js";
|
|
9
|
+
import { Loader2Icon as vt, OctagonXIcon as xt, TriangleAlertIcon as yt, InfoIcon as wt, CircleCheckIcon as Nt, XIcon as kt, PanelLeftIcon as Ct, Layers as Me, User as _t, ShieldCheck as St, Settings as Ne, Smartphone as Pt, Lock as Mt, Save as Tt, Sun as Dt, Moon as It, Monitor as Et, Zap as Te, Globe as Lt, Coins as At, LogOut as zt, CirclePlus as Rt, Plus as qt, Search as Ft, Check as jt, X as Ot, Pin as De, MoreVertical as $t, PinOff as Bt, Share2 as Ut, Pencil as Kt, Trash as Ht } from "lucide-react";
|
|
10
|
+
import { useTheme as Qt } from "next-themes";
|
|
11
|
+
import { Toaster as Gt, toast as J } from "sonner";
|
|
12
|
+
import { useChat as Vt } from "@ai-sdk/react";
|
|
13
|
+
import { DefaultChatTransport as Wt } from "ai";
|
|
14
|
+
import { useLocation as Qe, useNavigate as Ce, Navigate as Xt, useParams as Jt } from "react-router-dom";
|
|
15
15
|
import { nanoid as ue } from "nanoid";
|
|
16
|
-
import { Slot as
|
|
17
|
-
import { cva as
|
|
16
|
+
import { Slot as Yt } from "@radix-ui/react-slot";
|
|
17
|
+
import { cva as Zt } from "class-variance-authority";
|
|
18
18
|
import "@radix-ui/react-separator";
|
|
19
|
-
import * as
|
|
20
|
-
const
|
|
21
|
-
const { theme: t = "system" } =
|
|
19
|
+
import * as ne from "@radix-ui/react-dialog";
|
|
20
|
+
const ea = ({ ...a }) => {
|
|
21
|
+
const { theme: t = "system" } = Qt();
|
|
22
22
|
return /* @__PURE__ */ e(
|
|
23
|
-
|
|
23
|
+
Gt,
|
|
24
24
|
{
|
|
25
25
|
theme: t,
|
|
26
26
|
className: "toaster group",
|
|
27
27
|
icons: {
|
|
28
|
-
success: /* @__PURE__ */ e(
|
|
29
|
-
info: /* @__PURE__ */ e(
|
|
30
|
-
warning: /* @__PURE__ */ e(
|
|
31
|
-
error: /* @__PURE__ */ e(
|
|
32
|
-
loading: /* @__PURE__ */ e(
|
|
28
|
+
success: /* @__PURE__ */ e(Nt, { className: "size-4" }),
|
|
29
|
+
info: /* @__PURE__ */ e(wt, { className: "size-4" }),
|
|
30
|
+
warning: /* @__PURE__ */ e(yt, { className: "size-4" }),
|
|
31
|
+
error: /* @__PURE__ */ e(xt, { className: "size-4" }),
|
|
32
|
+
loading: /* @__PURE__ */ e(vt, { className: "size-4 animate-spin" })
|
|
33
33
|
},
|
|
34
34
|
style: {
|
|
35
35
|
"--normal-bg": "var(--popover)",
|
|
@@ -37,107 +37,107 @@ const Jt = ({ ...r }) => {
|
|
|
37
37
|
"--normal-border": "var(--border)",
|
|
38
38
|
"--border-radius": "var(--radius)"
|
|
39
39
|
},
|
|
40
|
-
...
|
|
40
|
+
...a
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
};
|
|
44
|
-
function
|
|
45
|
-
children:
|
|
44
|
+
function Ha({
|
|
45
|
+
children: a,
|
|
46
46
|
api: t,
|
|
47
|
-
app:
|
|
48
|
-
i18n:
|
|
49
|
-
components:
|
|
50
|
-
history:
|
|
51
|
-
welcome:
|
|
47
|
+
app: i,
|
|
48
|
+
i18n: u,
|
|
49
|
+
components: l,
|
|
50
|
+
history: d,
|
|
51
|
+
welcome: h,
|
|
52
52
|
threadActions: p,
|
|
53
|
-
composer:
|
|
54
|
-
theme:
|
|
55
|
-
disclaimer:
|
|
56
|
-
settings:
|
|
53
|
+
composer: m,
|
|
54
|
+
theme: N,
|
|
55
|
+
disclaimer: v,
|
|
56
|
+
settings: y
|
|
57
57
|
}) {
|
|
58
|
-
const [
|
|
59
|
-
() =>
|
|
58
|
+
const [c, P] = _(null), S = O(
|
|
59
|
+
() => u?.instance ?? at,
|
|
60
60
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
-
[
|
|
62
|
-
),
|
|
61
|
+
[u?.instance]
|
|
62
|
+
), z = t || {};
|
|
63
63
|
$(() => {
|
|
64
|
-
|
|
64
|
+
M.getAppConfig().then((n) => P(n)).catch((n) => console.debug("Gentiq: No dynamic settings available or fetch failed", n));
|
|
65
65
|
}, []), $(() => {
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
const
|
|
69
|
-
const
|
|
66
|
+
c?.app_name && (document.title = S.t(c.app_name));
|
|
67
|
+
}, [c, S]);
|
|
68
|
+
const B = O(() => {
|
|
69
|
+
const n = {
|
|
70
70
|
basePath: "/",
|
|
71
71
|
cacheNamespace: "gentiq",
|
|
72
|
-
...
|
|
72
|
+
...i
|
|
73
73
|
};
|
|
74
|
-
return
|
|
75
|
-
...
|
|
76
|
-
name: (
|
|
77
|
-
adminTitle: (
|
|
78
|
-
showSettings:
|
|
79
|
-
showToolDetails:
|
|
80
|
-
settingsGeneralMode:
|
|
81
|
-
settingsProfileMode:
|
|
82
|
-
settingsAccountMode:
|
|
83
|
-
} :
|
|
84
|
-
}, [
|
|
85
|
-
...
|
|
86
|
-
greeting:
|
|
87
|
-
subtitle:
|
|
88
|
-
} :
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
}, [
|
|
92
|
-
...
|
|
93
|
-
enabled:
|
|
94
|
-
showDelete:
|
|
95
|
-
showRename:
|
|
96
|
-
showShare:
|
|
97
|
-
showPin:
|
|
98
|
-
} :
|
|
74
|
+
return c ? {
|
|
75
|
+
...n,
|
|
76
|
+
name: (c.app_name ? S.t(c.app_name) : null) || n.name,
|
|
77
|
+
adminTitle: (c.admin_title ? S.t(c.admin_title) : null) || n.adminTitle,
|
|
78
|
+
showSettings: c.show_settings ?? n.showSettings,
|
|
79
|
+
showToolDetails: c.show_tool_details ?? n.showToolDetails,
|
|
80
|
+
settingsGeneralMode: c.settings_general_mode || n.settingsGeneralMode,
|
|
81
|
+
settingsProfileMode: c.settings_profile_mode || n.settingsProfileMode,
|
|
82
|
+
settingsAccountMode: c.settings_account_mode || n.settingsAccountMode
|
|
83
|
+
} : n;
|
|
84
|
+
}, [i, c, S]), C = O(() => c ? {
|
|
85
|
+
...h,
|
|
86
|
+
greeting: c.welcome_greeting || h?.greeting,
|
|
87
|
+
subtitle: c.welcome_subtitle || h?.subtitle
|
|
88
|
+
} : h, [h, c]), x = O(() => {
|
|
89
|
+
const n = c?.disclaimer || v;
|
|
90
|
+
return n && S.t(n);
|
|
91
|
+
}, [v, c, S]), g = O(() => c ? {
|
|
92
|
+
...d,
|
|
93
|
+
enabled: c.history_enabled ?? d?.enabled,
|
|
94
|
+
showDelete: c.history_show_delete ?? d?.showDelete,
|
|
95
|
+
showRename: c.history_show_rename ?? d?.showRename,
|
|
96
|
+
showShare: c.history_show_share ?? d?.showShare,
|
|
97
|
+
showPin: c.history_show_pin ?? d?.showPin
|
|
98
|
+
} : d, [d, c]), L = O(() => c ? {
|
|
99
99
|
...p,
|
|
100
|
-
feedback:
|
|
101
|
-
retry:
|
|
102
|
-
} : p, [p,
|
|
103
|
-
...
|
|
100
|
+
feedback: c.thread_actions_feedback ?? p?.feedback,
|
|
101
|
+
retry: c.thread_actions_retry ?? p?.retry
|
|
102
|
+
} : p, [p, c]), q = O(() => c ? {
|
|
103
|
+
...m,
|
|
104
104
|
attachments: {
|
|
105
|
-
...
|
|
106
|
-
enabled:
|
|
105
|
+
...m?.attachments,
|
|
106
|
+
enabled: c.composer_attachments ?? m?.attachments?.enabled
|
|
107
107
|
}
|
|
108
|
-
} :
|
|
109
|
-
...
|
|
108
|
+
} : m, [m, c]), D = O(() => c ? {
|
|
109
|
+
...y,
|
|
110
110
|
sections: {
|
|
111
|
-
...
|
|
111
|
+
...y?.sections,
|
|
112
112
|
general: {
|
|
113
|
-
...
|
|
114
|
-
mode:
|
|
115
|
-
enabled:
|
|
113
|
+
...y?.sections?.general,
|
|
114
|
+
mode: c.settings_general_mode || y?.sections?.general?.mode,
|
|
115
|
+
enabled: y?.sections?.general?.enabled ?? !0,
|
|
116
116
|
fields: {
|
|
117
|
-
...
|
|
118
|
-
...
|
|
117
|
+
...y?.sections?.general?.fields,
|
|
118
|
+
...c.settings_general_fields
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
profile: {
|
|
122
|
-
...
|
|
123
|
-
mode:
|
|
124
|
-
enabled:
|
|
122
|
+
...y?.sections?.profile,
|
|
123
|
+
mode: c.settings_profile_mode || y?.sections?.profile?.mode,
|
|
124
|
+
enabled: y?.sections?.profile?.enabled ?? !0,
|
|
125
125
|
fields: {
|
|
126
|
-
...
|
|
127
|
-
...
|
|
126
|
+
...y?.sections?.profile?.fields,
|
|
127
|
+
...c.settings_profile_fields
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
account: {
|
|
131
|
-
...
|
|
132
|
-
mode:
|
|
133
|
-
enabled:
|
|
131
|
+
...y?.sections?.account,
|
|
132
|
+
mode: c.settings_account_mode || y?.sections?.account?.mode,
|
|
133
|
+
enabled: y?.sections?.account?.enabled ?? !0,
|
|
134
134
|
fields: {
|
|
135
|
-
...
|
|
136
|
-
...
|
|
135
|
+
...y?.sections?.account?.fields,
|
|
136
|
+
...c.settings_account_fields
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
} :
|
|
140
|
+
} : y, [y, c]), j = O(() => new Je({
|
|
141
141
|
defaultOptions: {
|
|
142
142
|
queries: {
|
|
143
143
|
staleTime: 5e3,
|
|
@@ -146,354 +146,343 @@ function Ua({
|
|
|
146
146
|
}
|
|
147
147
|
}), []);
|
|
148
148
|
$(() => {
|
|
149
|
-
|
|
150
|
-
api:
|
|
151
|
-
app:
|
|
149
|
+
M.init({
|
|
150
|
+
api: z,
|
|
151
|
+
app: B
|
|
152
152
|
});
|
|
153
|
-
}, [
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
Object.entries(
|
|
157
|
-
|
|
153
|
+
}, [B]);
|
|
154
|
+
const U = ee(null), A = u?.resources;
|
|
155
|
+
A !== U.current && (U.current = A, A && Object.entries(A).forEach(([n, w]) => {
|
|
156
|
+
Object.entries(w).forEach(([T, I]) => {
|
|
157
|
+
S.addResourceBundle(n, T, I, !0, !0);
|
|
158
158
|
});
|
|
159
159
|
}));
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
Object.entries(
|
|
163
|
-
|
|
160
|
+
const E = ee(null), G = c?.translations;
|
|
161
|
+
G && G !== E.current && (E.current = G, Object.entries(G).forEach(([n, w]) => {
|
|
162
|
+
Object.entries(w).forEach(([T, I]) => {
|
|
163
|
+
S.addResourceBundle(n, T, I, !0, !0);
|
|
164
164
|
});
|
|
165
165
|
}));
|
|
166
|
-
const K = ee(null),
|
|
167
|
-
return
|
|
168
|
-
Object.entries(
|
|
169
|
-
|
|
166
|
+
const K = ee(null), b = u?.instance;
|
|
167
|
+
return b && b !== K.current && (K.current = b, Object.entries(rt).forEach(([n, w]) => {
|
|
168
|
+
Object.entries(w).forEach(([T, I]) => {
|
|
169
|
+
b.hasResourceBundle(n, T) || b.addResourceBundle(n, T, I, !0, !1);
|
|
170
170
|
});
|
|
171
|
-
})), /* @__PURE__ */ e(
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
|
|
171
|
+
})), /* @__PURE__ */ e(tt, { i18n: S, children: /* @__PURE__ */ r(Ye, { client: j, children: [
|
|
172
|
+
/* @__PURE__ */ r(
|
|
173
|
+
qe,
|
|
174
174
|
{
|
|
175
|
-
components:
|
|
176
|
-
history:
|
|
177
|
-
welcome:
|
|
178
|
-
threadActions:
|
|
179
|
-
composer:
|
|
180
|
-
theme:
|
|
181
|
-
disclaimer:
|
|
182
|
-
app:
|
|
183
|
-
i18n:
|
|
184
|
-
settings:
|
|
175
|
+
components: l,
|
|
176
|
+
history: g,
|
|
177
|
+
welcome: C,
|
|
178
|
+
threadActions: L,
|
|
179
|
+
composer: q,
|
|
180
|
+
theme: N,
|
|
181
|
+
disclaimer: x,
|
|
182
|
+
app: B,
|
|
183
|
+
i18n: u,
|
|
184
|
+
settings: D,
|
|
185
185
|
children: [
|
|
186
|
-
/* @__PURE__ */ e(
|
|
187
|
-
/* @__PURE__ */ e(
|
|
186
|
+
/* @__PURE__ */ e(ta, {}),
|
|
187
|
+
/* @__PURE__ */ e(nt, { defaultTheme: "system", storageKey: "chatbot-theme", config: N, children: a })
|
|
188
188
|
]
|
|
189
189
|
}
|
|
190
190
|
),
|
|
191
|
-
/* @__PURE__ */ e(
|
|
191
|
+
/* @__PURE__ */ e(ea, { richColors: !0 })
|
|
192
192
|
] }) });
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
const { app:
|
|
196
|
-
return
|
|
197
|
-
|
|
198
|
-
}, [
|
|
199
|
-
if (!
|
|
194
|
+
function ta() {
|
|
195
|
+
const { app: a } = te();
|
|
196
|
+
return Fe(), $(() => {
|
|
197
|
+
a?.name && (document.title = a.name);
|
|
198
|
+
}, [a?.name]), $(() => {
|
|
199
|
+
if (!a?.favicon) return;
|
|
200
200
|
let t = document.querySelector("link[rel~='icon']");
|
|
201
|
-
t || (t = document.createElement("link"), t.rel = "icon", document.head.appendChild(t)), t.href =
|
|
202
|
-
}, [
|
|
201
|
+
t || (t = document.createElement("link"), t.rel = "icon", document.head.appendChild(t)), t.href = a.favicon;
|
|
202
|
+
}, [a?.favicon]), null;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
const
|
|
206
|
-
const
|
|
207
|
-
if (p === (
|
|
208
|
-
if (
|
|
209
|
-
let
|
|
210
|
-
return
|
|
204
|
+
function _e() {
|
|
205
|
+
const a = Qe(), t = Ce(), u = M.getConfig().app?.basePath || "/", l = O(() => {
|
|
206
|
+
const h = a.pathname, p = h.endsWith("/") && h !== "/" ? h.slice(0, -1) : h, m = u.endsWith("/") && u !== "/" ? u.slice(0, -1) : u;
|
|
207
|
+
if (p === (m || "/")) return "/";
|
|
208
|
+
if (h.startsWith(m) && m !== "/") {
|
|
209
|
+
let N = h.slice(m.length);
|
|
210
|
+
return N.startsWith("/") || (N = "/" + N), N;
|
|
211
211
|
}
|
|
212
|
-
return
|
|
213
|
-
}, [
|
|
214
|
-
t(
|
|
215
|
-
}, [t,
|
|
216
|
-
return [
|
|
212
|
+
return m === "/" ? h : "/";
|
|
213
|
+
}, [a.pathname, u]), d = Y((h) => {
|
|
214
|
+
t(be(u, h || "/"), { replace: !1 });
|
|
215
|
+
}, [t, u]);
|
|
216
|
+
return [l, d];
|
|
217
217
|
}
|
|
218
|
-
function
|
|
219
|
-
const { t } =
|
|
218
|
+
function aa({ onFinish: a } = {}) {
|
|
219
|
+
const { t } = ce(["chat", "errors"]), i = pe(), u = M.getConfig(), l = u.app?.cacheNamespace || "gentiq", [d, h] = _e(), [p, m] = _(() => ue()), N = ee(/* @__PURE__ */ new Set());
|
|
220
220
|
$(() => {
|
|
221
|
-
|
|
222
|
-
}, [
|
|
223
|
-
const
|
|
224
|
-
|
|
221
|
+
d === "/" ? m(ue()) : p && d !== `/${p}` && m(ue());
|
|
222
|
+
}, [d]);
|
|
223
|
+
const v = O(() => d === "/" ? p : d.replace(/^\//, ""), [d, p]), y = Y((b) => (N.current.add(b), b), []), c = Y(() => {
|
|
224
|
+
N.current.forEach((b) => URL.revokeObjectURL(b)), N.current.clear();
|
|
225
225
|
}, []);
|
|
226
|
-
$(() => () =>
|
|
226
|
+
$(() => () => c(), [c]);
|
|
227
227
|
const {
|
|
228
|
-
data:
|
|
229
|
-
isLoading:
|
|
230
|
-
isError:
|
|
231
|
-
} =
|
|
232
|
-
queryKey: [
|
|
228
|
+
data: P,
|
|
229
|
+
isLoading: S,
|
|
230
|
+
isError: z
|
|
231
|
+
} = Ze({
|
|
232
|
+
queryKey: [l, "threadMessages", v],
|
|
233
233
|
queryFn: async () => {
|
|
234
|
-
if (
|
|
235
|
-
if (
|
|
236
|
-
const
|
|
237
|
-
return !
|
|
238
|
-
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
if (
|
|
234
|
+
if (d === "/") return [];
|
|
235
|
+
if (d === `/${p}`) return [];
|
|
236
|
+
const b = await M.getThreadMessages(v);
|
|
237
|
+
return !b.items || !Array.isArray(b.items) ? [] : Promise.all(
|
|
238
|
+
b.items.map(async (n) => {
|
|
239
|
+
const w = typeof n.content == "string" ? n.content : n.content?.text || JSON.stringify(n.content), I = [...Array.isArray(n.parts) && n.parts.length > 0 ? n.parts : [{ type: "text", text: w }]].sort((k, R) => k.type === "file" && R.type !== "file" ? -1 : k.type !== "file" && R.type === "file" ? 1 : 0), W = await Promise.all(
|
|
240
|
+
I.map(async (k) => {
|
|
241
|
+
if (k.type === "file" && k.object_name && !k.url)
|
|
242
242
|
try {
|
|
243
|
-
const R = await
|
|
244
|
-
return { ...
|
|
243
|
+
const R = await M.getAttachmentBlobUrl(k.object_name);
|
|
244
|
+
return { ...k, url: y(R), mediaType: k.mediaType || k.media_type };
|
|
245
245
|
} catch (R) {
|
|
246
|
-
return console.warn("Load attachment failed:",
|
|
246
|
+
return console.warn("Load attachment failed:", k.object_name, R), { ...k, mediaType: k.mediaType || k.media_type };
|
|
247
247
|
}
|
|
248
|
-
return
|
|
248
|
+
return k;
|
|
249
249
|
})
|
|
250
250
|
);
|
|
251
251
|
return {
|
|
252
|
-
id:
|
|
253
|
-
role:
|
|
254
|
-
parts:
|
|
255
|
-
metadata: { feedback:
|
|
252
|
+
id: n.id || ue(),
|
|
253
|
+
role: n.role,
|
|
254
|
+
parts: W,
|
|
255
|
+
metadata: { feedback: n.feedback }
|
|
256
256
|
};
|
|
257
257
|
})
|
|
258
258
|
);
|
|
259
259
|
},
|
|
260
|
-
enabled:
|
|
260
|
+
enabled: d !== "/",
|
|
261
261
|
staleTime: 5e3
|
|
262
262
|
// Keep history fresh for 5 seconds
|
|
263
|
-
}),
|
|
264
|
-
api:
|
|
265
|
-
fetch: async (
|
|
266
|
-
const
|
|
267
|
-
Object.entries(
|
|
268
|
-
|
|
269
|
-
}),
|
|
270
|
-
const
|
|
271
|
-
if (!
|
|
272
|
-
const R = await
|
|
263
|
+
}), B = O(() => new Wt({
|
|
264
|
+
api: M.getEndpoint("chat", "/chat"),
|
|
265
|
+
fetch: async (b, n) => {
|
|
266
|
+
const w = new Headers(n?.headers), T = M.getHeaders();
|
|
267
|
+
Object.entries(T).forEach(([R, X]) => {
|
|
268
|
+
w.set(R, X);
|
|
269
|
+
}), w.set("X-Thread-Id", v);
|
|
270
|
+
const I = u.api?.basePath || "/api", W = typeof b == "string" && !b.startsWith("http") ? `${I}${b.startsWith("/") ? b : "/" + b}` : b, k = await fetch(W, { ...n, headers: w });
|
|
271
|
+
if (!k.ok) {
|
|
272
|
+
const R = await k.json().catch(() => ({}));
|
|
273
273
|
if (R.error && (R.error.code || R.error.message))
|
|
274
|
-
throw new
|
|
275
|
-
const
|
|
276
|
-
throw new Error(`${
|
|
274
|
+
throw new st(R, k.status);
|
|
275
|
+
const X = R.error || R.message || k.statusText;
|
|
276
|
+
throw new Error(`${k.status}: ${X}`);
|
|
277
277
|
}
|
|
278
|
-
return
|
|
278
|
+
return k;
|
|
279
279
|
}
|
|
280
|
-
}), [
|
|
281
|
-
|
|
282
|
-
}, [
|
|
283
|
-
id:
|
|
284
|
-
onFinish:
|
|
285
|
-
transport:
|
|
286
|
-
}), [
|
|
287
|
-
|
|
280
|
+
}), [v, u.api?.basePath]), C = Y(() => {
|
|
281
|
+
L("ready"), i.invalidateQueries({ queryKey: [l, "conversations"] }), a?.();
|
|
282
|
+
}, [i, a, l]), x = Vt({
|
|
283
|
+
id: v,
|
|
284
|
+
onFinish: C,
|
|
285
|
+
transport: B
|
|
286
|
+
}), [g, L] = _("idle"), [q, D] = _(null), j = Y(() => {
|
|
287
|
+
D(null);
|
|
288
288
|
}, []);
|
|
289
289
|
$(() => {
|
|
290
|
-
|
|
291
|
-
}, [
|
|
292
|
-
|
|
293
|
-
}, [
|
|
294
|
-
if (
|
|
295
|
-
|
|
290
|
+
P && (d === `/${p}` || (x.setMessages(P), L("ready")));
|
|
291
|
+
}, [P, x.setMessages, d, p]), $(() => {
|
|
292
|
+
d === "/" && (x.setMessages([]), L("idle"));
|
|
293
|
+
}, [d, x.setMessages]), $(() => {
|
|
294
|
+
if (d === "/") {
|
|
295
|
+
L("idle");
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
}, [
|
|
301
|
-
|
|
302
|
-
}, [
|
|
303
|
-
const
|
|
298
|
+
const b = d === `/${p}`;
|
|
299
|
+
S && !b ? L("loading-history") : z || q || x.error ? L("error") : x.status === "streaming" || x.status === "submitted" ? L(x.status) : L("ready");
|
|
300
|
+
}, [S, z, x.status, q, x.error, d, p]), $(() => () => {
|
|
301
|
+
x.stop();
|
|
302
|
+
}, [v, x.stop]);
|
|
303
|
+
const U = ee(/* @__PURE__ */ new Set()), A = O(() => x.messages.filter((b) => b.role === "assistant"), [x.messages]);
|
|
304
304
|
$(() => {
|
|
305
|
-
let
|
|
306
|
-
for (const
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
|
|
305
|
+
let b = !1;
|
|
306
|
+
for (const n of A) {
|
|
307
|
+
if (U.current.has(n.id)) continue;
|
|
308
|
+
const w = n.parts.find((T) => T.type === "data-title");
|
|
309
|
+
w && w.data?.[0]?.title && (U.current.add(n.id), b = !0);
|
|
310
310
|
}
|
|
311
|
-
|
|
312
|
-
}, [
|
|
313
|
-
const
|
|
314
|
-
const
|
|
315
|
-
if (!(!
|
|
316
|
-
if (
|
|
317
|
-
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
const R = { id: `/${
|
|
321
|
-
return
|
|
322
|
-
...
|
|
323
|
-
pages:
|
|
324
|
-
...
|
|
325
|
-
threads: [R, ...
|
|
326
|
-
} :
|
|
327
|
-
} : [R, ...Array.isArray(
|
|
311
|
+
b && i.invalidateQueries({ queryKey: [l, "conversations"] });
|
|
312
|
+
}, [A, i, l]);
|
|
313
|
+
const E = Y(async (b, n) => {
|
|
314
|
+
const w = d === "/", T = b.trim();
|
|
315
|
+
if (!(!T && (!n || n.length === 0)) && !(g === "loading-history" || g === "streaming" || g === "submitted")) {
|
|
316
|
+
if (x.stop(), w) {
|
|
317
|
+
h(`/${v}`);
|
|
318
|
+
const I = T || t("attach_file"), W = I.length > 30 ? I.slice(0, 30) + "..." : I;
|
|
319
|
+
i.setQueryData([l, "conversations"], (k) => {
|
|
320
|
+
const R = { id: `/${v}`, firstMessage: W, timestamp: Date.now() };
|
|
321
|
+
return k && Array.isArray(k.pages) ? {
|
|
322
|
+
...k,
|
|
323
|
+
pages: k.pages.map((X, se) => se === 0 ? {
|
|
324
|
+
...X,
|
|
325
|
+
threads: [R, ...X.threads || []]
|
|
326
|
+
} : X)
|
|
327
|
+
} : [R, ...Array.isArray(k) ? k : []];
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
L("submitted"), D(null);
|
|
331
331
|
try {
|
|
332
|
-
await
|
|
333
|
-
} catch (
|
|
334
|
-
console.error("Failed to send message:",
|
|
335
|
-
const
|
|
336
|
-
|
|
332
|
+
await x.sendMessage({ text: T, files: n });
|
|
333
|
+
} catch (I) {
|
|
334
|
+
console.error("Failed to send message:", I);
|
|
335
|
+
const W = le(I, t);
|
|
336
|
+
D(new Error(W)), L("error");
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
}, [
|
|
340
|
-
|
|
341
|
-
}, [
|
|
342
|
-
if (
|
|
343
|
-
if (
|
|
344
|
-
const
|
|
345
|
-
return new Error(
|
|
339
|
+
}, [x, h, d, v, t, i, g, l]), G = Y(() => {
|
|
340
|
+
x.stop(), L("ready"), i.invalidateQueries({ queryKey: [l, "conversations"] });
|
|
341
|
+
}, [x.stop, i, l]), K = O(() => {
|
|
342
|
+
if (q) return q;
|
|
343
|
+
if (x.error) {
|
|
344
|
+
const b = le(x.error, t);
|
|
345
|
+
return new Error(b);
|
|
346
346
|
}
|
|
347
347
|
return null;
|
|
348
|
-
}, [
|
|
349
|
-
return
|
|
350
|
-
...
|
|
351
|
-
sendMessage:
|
|
352
|
-
stop:
|
|
353
|
-
clearError:
|
|
348
|
+
}, [q, x.error, t]);
|
|
349
|
+
return O(() => ({
|
|
350
|
+
...x,
|
|
351
|
+
sendMessage: E,
|
|
352
|
+
stop: G,
|
|
353
|
+
clearError: j,
|
|
354
354
|
error: K,
|
|
355
|
-
status:
|
|
355
|
+
status: g,
|
|
356
356
|
// Cast to any to satisfy Chat.tsx expectations of AI SDK statuses
|
|
357
|
-
isLoadingHistory:
|
|
358
|
-
isErrorHistory:
|
|
359
|
-
conversationId:
|
|
360
|
-
}), [
|
|
357
|
+
isLoadingHistory: g === "loading-history",
|
|
358
|
+
isErrorHistory: g === "error" || !!K || z,
|
|
359
|
+
conversationId: d
|
|
360
|
+
}), [x, E, G, j, K, g, z, d]);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
363
|
-
const { t:
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}, [
|
|
367
|
-
const
|
|
362
|
+
function ra({ classNames: a = {}, disclaimer: t }) {
|
|
363
|
+
const { t: i, i18n: u } = ce(["chat", "translation"]), l = aa(), { messages: d, status: h, regenerate: p, error: m, clearError: N, stop: v, isLoadingHistory: y, conversationId: c, sendMessage: P } = l, { MessageList: S, PromptInput: z, disclaimer: B } = te(), C = t ?? B, x = u.exists("chat:disclaimer") ? i("chat:disclaimer") : null, g = typeof C == "string" ? i(C) : C ?? x, [L, q] = _(null), D = ee(h);
|
|
364
|
+
Xe(() => {
|
|
365
|
+
m && N();
|
|
366
|
+
}, [c, N, m]);
|
|
367
|
+
const j = d[d.length - 1], U = j?.role === "assistant" && (h === "ready" || j.parts.some((E) => E.type === "data-chat-finished"));
|
|
368
368
|
$(() => {
|
|
369
|
-
|
|
370
|
-
}, [
|
|
371
|
-
const
|
|
372
|
-
return /* @__PURE__ */
|
|
369
|
+
h === "error" && D.current !== "error" && L !== c ? q(c) : h === "submitted" && L !== null && q(null), D.current = h;
|
|
370
|
+
}, [h, c]);
|
|
371
|
+
const A = h === "error" && (c === "/" || L === c);
|
|
372
|
+
return /* @__PURE__ */ r("div", { className: f("relative flex flex-col h-full overflow-hidden", a.container), children: [
|
|
373
373
|
/* @__PURE__ */ e(
|
|
374
|
-
|
|
374
|
+
S,
|
|
375
375
|
{
|
|
376
|
-
messages:
|
|
377
|
-
status:
|
|
378
|
-
isLoadingHistory:
|
|
379
|
-
error:
|
|
380
|
-
conversationId:
|
|
381
|
-
regen: (
|
|
382
|
-
onSuggestionClick: (
|
|
383
|
-
chat:
|
|
384
|
-
className:
|
|
376
|
+
messages: d,
|
|
377
|
+
status: h,
|
|
378
|
+
isLoadingHistory: y,
|
|
379
|
+
error: A ? m : null,
|
|
380
|
+
conversationId: c,
|
|
381
|
+
regen: (E) => p({ messageId: E }),
|
|
382
|
+
onSuggestionClick: (E) => P(E),
|
|
383
|
+
chat: l,
|
|
384
|
+
className: f("flex-1", a.messageList)
|
|
385
385
|
}
|
|
386
386
|
),
|
|
387
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ r("div", { className: "absolute bottom-0 left-0 right-0 z-10 pointer-events-none flex flex-col items-stretch", children: [
|
|
388
388
|
/* @__PURE__ */ e(
|
|
389
|
-
|
|
389
|
+
z,
|
|
390
390
|
{
|
|
391
|
-
onSend:
|
|
392
|
-
status:
|
|
393
|
-
isLastMessageFinished:
|
|
394
|
-
stop:
|
|
395
|
-
isErrorVisible:
|
|
396
|
-
conversationId:
|
|
397
|
-
className:
|
|
391
|
+
onSend: P,
|
|
392
|
+
status: h,
|
|
393
|
+
isLastMessageFinished: U,
|
|
394
|
+
stop: v,
|
|
395
|
+
isErrorVisible: A,
|
|
396
|
+
conversationId: c,
|
|
397
|
+
className: f("pointer-events-auto", a.inputArea, g && "pb-0 md:pb-0")
|
|
398
398
|
}
|
|
399
399
|
),
|
|
400
|
-
|
|
400
|
+
g && /* @__PURE__ */ r("div", { className: "relative py-1 px-4 flex justify-center items-center pointer-events-auto", children: [
|
|
401
401
|
/* @__PURE__ */ e("div", { className: "absolute inset-x-0 bottom-0 top-[-20px] bg-background/80 backdrop-blur-sm [mask-image:linear-gradient(to_top,black_60%,transparent)] pointer-events-none -z-10" }),
|
|
402
|
-
/* @__PURE__ */ e("p", { className: "text-[10px] md:text-[11px] text-muted-foreground/60 select-none text-center leading-tight", children:
|
|
402
|
+
/* @__PURE__ */ e("p", { className: "text-[10px] md:text-[11px] text-muted-foreground/60 select-none text-center leading-tight", children: g })
|
|
403
403
|
] })
|
|
404
404
|
] })
|
|
405
405
|
] });
|
|
406
406
|
}
|
|
407
|
-
const
|
|
408
|
-
components:
|
|
407
|
+
const na = ({
|
|
408
|
+
components: a,
|
|
409
409
|
history: t,
|
|
410
|
-
welcome:
|
|
411
|
-
threadActions:
|
|
412
|
-
composer:
|
|
413
|
-
theme:
|
|
414
|
-
disclaimer:
|
|
410
|
+
welcome: i,
|
|
411
|
+
threadActions: u,
|
|
412
|
+
composer: l,
|
|
413
|
+
theme: d,
|
|
414
|
+
disclaimer: h,
|
|
415
415
|
...p
|
|
416
416
|
}) => {
|
|
417
|
-
const
|
|
418
|
-
...
|
|
419
|
-
...
|
|
417
|
+
const m = te(), N = O(() => ({
|
|
418
|
+
...m,
|
|
419
|
+
...a,
|
|
420
420
|
toolComponents: {
|
|
421
|
-
...
|
|
422
|
-
...
|
|
421
|
+
...m.toolComponents,
|
|
422
|
+
...a?.toolComponents
|
|
423
423
|
}
|
|
424
|
-
}), [
|
|
424
|
+
}), [m, a]);
|
|
425
425
|
return /* @__PURE__ */ e(
|
|
426
|
-
|
|
426
|
+
qe,
|
|
427
427
|
{
|
|
428
|
-
components:
|
|
429
|
-
history: t ??
|
|
430
|
-
welcome:
|
|
431
|
-
threadActions:
|
|
432
|
-
composer:
|
|
433
|
-
theme:
|
|
434
|
-
disclaimer:
|
|
435
|
-
app:
|
|
436
|
-
i18n:
|
|
437
|
-
settings:
|
|
438
|
-
children: /* @__PURE__ */ e(
|
|
428
|
+
components: N,
|
|
429
|
+
history: t ?? m.history,
|
|
430
|
+
welcome: i ?? m.welcome,
|
|
431
|
+
threadActions: u ?? m.threadActions,
|
|
432
|
+
composer: l ?? m.composer,
|
|
433
|
+
theme: d ?? m.theme,
|
|
434
|
+
disclaimer: h ?? m.disclaimer,
|
|
435
|
+
app: m.app,
|
|
436
|
+
i18n: m.i18n,
|
|
437
|
+
settings: m.settings,
|
|
438
|
+
children: /* @__PURE__ */ e(ra, { ...p })
|
|
439
439
|
}
|
|
440
440
|
);
|
|
441
|
-
}
|
|
442
|
-
function
|
|
443
|
-
|
|
444
|
-
return Z.useEffect(() => {
|
|
445
|
-
const o = window.matchMedia(`(max-width: ${ge - 1}px)`), d = () => {
|
|
446
|
-
t(window.innerWidth < ge);
|
|
447
|
-
};
|
|
448
|
-
return o.addEventListener("change", d), t(window.innerWidth < ge), () => {
|
|
449
|
-
o.removeEventListener("change", d);
|
|
450
|
-
};
|
|
451
|
-
}, []), !!r;
|
|
452
|
-
}
|
|
453
|
-
function ra({ ...r }) {
|
|
454
|
-
return /* @__PURE__ */ e(re.Root, { "data-slot": "sheet", ...r });
|
|
441
|
+
};
|
|
442
|
+
function sa({ ...a }) {
|
|
443
|
+
return /* @__PURE__ */ e(ne.Root, { "data-slot": "sheet", ...a });
|
|
455
444
|
}
|
|
456
|
-
function
|
|
457
|
-
return /* @__PURE__ */ e(
|
|
445
|
+
function oa({ ...a }) {
|
|
446
|
+
return /* @__PURE__ */ e(ne.Portal, { "data-slot": "sheet-portal", ...a });
|
|
458
447
|
}
|
|
459
|
-
function
|
|
448
|
+
function ia({ className: a, ...t }) {
|
|
460
449
|
return /* @__PURE__ */ e(
|
|
461
|
-
|
|
450
|
+
ne.Overlay,
|
|
462
451
|
{
|
|
463
452
|
"data-slot": "sheet-overlay",
|
|
464
|
-
className:
|
|
453
|
+
className: f(
|
|
465
454
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
466
|
-
|
|
455
|
+
a
|
|
467
456
|
),
|
|
468
457
|
...t
|
|
469
458
|
}
|
|
470
459
|
);
|
|
471
460
|
}
|
|
472
|
-
function
|
|
473
|
-
className:
|
|
461
|
+
function la({
|
|
462
|
+
className: a,
|
|
474
463
|
children: t,
|
|
475
|
-
side:
|
|
476
|
-
...
|
|
464
|
+
side: i = "right",
|
|
465
|
+
...u
|
|
477
466
|
}) {
|
|
478
|
-
return /* @__PURE__ */
|
|
479
|
-
/* @__PURE__ */ e(
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
|
|
467
|
+
return /* @__PURE__ */ r(oa, { children: [
|
|
468
|
+
/* @__PURE__ */ e(ia, {}),
|
|
469
|
+
/* @__PURE__ */ r(
|
|
470
|
+
ne.Content,
|
|
482
471
|
{
|
|
483
472
|
"data-slot": "sheet-content",
|
|
484
|
-
className:
|
|
473
|
+
className: f(
|
|
485
474
|
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
475
|
+
i === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
476
|
+
i === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
477
|
+
i === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
478
|
+
i === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
479
|
+
a
|
|
491
480
|
),
|
|
492
|
-
...
|
|
481
|
+
...u,
|
|
493
482
|
children: [
|
|
494
483
|
t,
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */ e(
|
|
484
|
+
/* @__PURE__ */ r(ne.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
|
|
485
|
+
/* @__PURE__ */ e(kt, { className: "size-4" }),
|
|
497
486
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
|
|
498
487
|
] })
|
|
499
488
|
]
|
|
@@ -501,141 +490,141 @@ function oa({
|
|
|
501
490
|
)
|
|
502
491
|
] });
|
|
503
492
|
}
|
|
504
|
-
function
|
|
505
|
-
return /* @__PURE__ */ e("div", { "data-slot": "sheet-header", className:
|
|
493
|
+
function ca({ className: a, ...t }) {
|
|
494
|
+
return /* @__PURE__ */ e("div", { "data-slot": "sheet-header", className: f("flex flex-col gap-1.5 p-4", a), ...t });
|
|
506
495
|
}
|
|
507
|
-
function
|
|
496
|
+
function da({ className: a, ...t }) {
|
|
508
497
|
return /* @__PURE__ */ e(
|
|
509
|
-
|
|
498
|
+
ne.Title,
|
|
510
499
|
{
|
|
511
500
|
"data-slot": "sheet-title",
|
|
512
|
-
className:
|
|
501
|
+
className: f("text-foreground font-semibold", a),
|
|
513
502
|
...t
|
|
514
503
|
}
|
|
515
504
|
);
|
|
516
505
|
}
|
|
517
|
-
function
|
|
506
|
+
function ua({ className: a, ...t }) {
|
|
518
507
|
return /* @__PURE__ */ e(
|
|
519
|
-
|
|
508
|
+
ne.Description,
|
|
520
509
|
{
|
|
521
510
|
"data-slot": "sheet-description",
|
|
522
|
-
className:
|
|
511
|
+
className: f("text-muted-foreground text-sm", a),
|
|
523
512
|
...t
|
|
524
513
|
}
|
|
525
514
|
);
|
|
526
515
|
}
|
|
527
|
-
const
|
|
528
|
-
function
|
|
529
|
-
const
|
|
530
|
-
if (!
|
|
516
|
+
const ma = "sidebar_state", ha = 3600 * 24 * 7, pa = "19rem", ga = "18rem", fa = "3rem", ba = "b", Ge = ae.createContext(null);
|
|
517
|
+
function ge() {
|
|
518
|
+
const a = ae.useContext(Ge);
|
|
519
|
+
if (!a)
|
|
531
520
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
532
|
-
return
|
|
521
|
+
return a;
|
|
533
522
|
}
|
|
534
|
-
function
|
|
535
|
-
defaultOpen:
|
|
523
|
+
function va({
|
|
524
|
+
defaultOpen: a = !0,
|
|
536
525
|
open: t,
|
|
537
|
-
onOpenChange:
|
|
538
|
-
className:
|
|
539
|
-
style:
|
|
540
|
-
children:
|
|
541
|
-
...
|
|
526
|
+
onOpenChange: i,
|
|
527
|
+
className: u,
|
|
528
|
+
style: l,
|
|
529
|
+
children: d,
|
|
530
|
+
...h
|
|
542
531
|
}) {
|
|
543
|
-
const p =
|
|
544
|
-
(
|
|
545
|
-
const
|
|
546
|
-
|
|
532
|
+
const p = ot(), [m, N] = ae.useState(!1), [v, y] = ae.useState(a), c = t ?? v, P = ae.useCallback(
|
|
533
|
+
(C) => {
|
|
534
|
+
const x = typeof C == "function" ? C(c) : C;
|
|
535
|
+
i ? i(x) : y(x), document.cookie = `${ma}=${x}; path=/; max-age=${ha}`;
|
|
547
536
|
},
|
|
548
|
-
[
|
|
549
|
-
),
|
|
550
|
-
p ?
|
|
551
|
-
}, [p,
|
|
552
|
-
|
|
553
|
-
const
|
|
554
|
-
|
|
537
|
+
[i, c]
|
|
538
|
+
), S = ae.useCallback(() => {
|
|
539
|
+
p ? N((C) => !C) : P((C) => !C);
|
|
540
|
+
}, [p, P, N]);
|
|
541
|
+
ae.useEffect(() => {
|
|
542
|
+
const C = (x) => {
|
|
543
|
+
x.key === ba && (x.metaKey || x.ctrlKey) && (x.preventDefault(), S());
|
|
555
544
|
};
|
|
556
|
-
return window.addEventListener("keydown",
|
|
557
|
-
window.removeEventListener("keydown",
|
|
545
|
+
return window.addEventListener("keydown", C), () => {
|
|
546
|
+
window.removeEventListener("keydown", C);
|
|
558
547
|
};
|
|
559
|
-
}, [
|
|
560
|
-
const
|
|
548
|
+
}, [S]);
|
|
549
|
+
const z = c ? "expanded" : "collapsed", B = ae.useMemo(
|
|
561
550
|
() => ({
|
|
562
|
-
state:
|
|
563
|
-
open:
|
|
564
|
-
setOpen:
|
|
551
|
+
state: z,
|
|
552
|
+
open: c,
|
|
553
|
+
setOpen: P,
|
|
565
554
|
isMobile: p,
|
|
566
|
-
openMobile:
|
|
567
|
-
setOpenMobile:
|
|
568
|
-
toggleSidebar:
|
|
555
|
+
openMobile: m,
|
|
556
|
+
setOpenMobile: N,
|
|
557
|
+
toggleSidebar: S
|
|
569
558
|
}),
|
|
570
|
-
[
|
|
559
|
+
[z, c, P, p, m, N, S]
|
|
571
560
|
);
|
|
572
|
-
return /* @__PURE__ */ e(
|
|
561
|
+
return /* @__PURE__ */ e(Ge.Provider, { value: B, children: /* @__PURE__ */ e(je, { delayDuration: 0, children: /* @__PURE__ */ e(
|
|
573
562
|
"div",
|
|
574
563
|
{
|
|
575
564
|
"data-slot": "sidebar-wrapper",
|
|
576
565
|
style: {
|
|
577
|
-
"--sidebar-width":
|
|
578
|
-
"--sidebar-width-icon":
|
|
579
|
-
...
|
|
566
|
+
"--sidebar-width": pa,
|
|
567
|
+
"--sidebar-width-icon": fa,
|
|
568
|
+
...l
|
|
580
569
|
},
|
|
581
|
-
className:
|
|
582
|
-
...
|
|
583
|
-
children:
|
|
570
|
+
className: f("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", u),
|
|
571
|
+
...h,
|
|
572
|
+
children: d
|
|
584
573
|
}
|
|
585
574
|
) }) });
|
|
586
575
|
}
|
|
587
|
-
function
|
|
588
|
-
side:
|
|
576
|
+
function xa({
|
|
577
|
+
side: a = "left",
|
|
589
578
|
variant: t = "sidebar",
|
|
590
|
-
collapsible:
|
|
591
|
-
className:
|
|
592
|
-
children:
|
|
593
|
-
...
|
|
579
|
+
collapsible: i = "offcanvas",
|
|
580
|
+
className: u,
|
|
581
|
+
children: l,
|
|
582
|
+
...d
|
|
594
583
|
}) {
|
|
595
|
-
const { isMobile:
|
|
596
|
-
return
|
|
584
|
+
const { isMobile: h, state: p, openMobile: m, setOpenMobile: N } = ge();
|
|
585
|
+
return i === "none" ? /* @__PURE__ */ e(
|
|
597
586
|
"div",
|
|
598
587
|
{
|
|
599
588
|
"data-slot": "sidebar",
|
|
600
|
-
className:
|
|
601
|
-
...
|
|
602
|
-
children:
|
|
589
|
+
className: f("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", u),
|
|
590
|
+
...d,
|
|
591
|
+
children: l
|
|
603
592
|
}
|
|
604
|
-
) :
|
|
605
|
-
|
|
593
|
+
) : h ? /* @__PURE__ */ e(sa, { open: m, onOpenChange: N, ...d, children: /* @__PURE__ */ r(
|
|
594
|
+
la,
|
|
606
595
|
{
|
|
607
|
-
onOpenAutoFocus: (
|
|
596
|
+
onOpenAutoFocus: (v) => v.preventDefault(),
|
|
608
597
|
"data-sidebar": "sidebar",
|
|
609
598
|
"data-slot": "sidebar",
|
|
610
599
|
"data-mobile": "true",
|
|
611
600
|
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
612
601
|
style: {
|
|
613
|
-
"--sidebar-width":
|
|
602
|
+
"--sidebar-width": ga
|
|
614
603
|
},
|
|
615
|
-
side:
|
|
604
|
+
side: a,
|
|
616
605
|
children: [
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
/* @__PURE__ */ e(
|
|
619
|
-
/* @__PURE__ */ e(
|
|
606
|
+
/* @__PURE__ */ r(ca, { className: "sr-only", children: [
|
|
607
|
+
/* @__PURE__ */ e(da, { children: "Sidebar" }),
|
|
608
|
+
/* @__PURE__ */ e(ua, { children: "Displays the mobile sidebar." })
|
|
620
609
|
] }),
|
|
621
|
-
/* @__PURE__ */ e("div", { className: "flex h-full w-full flex-col", children:
|
|
610
|
+
/* @__PURE__ */ e("div", { className: "flex h-full w-full flex-col", children: l })
|
|
622
611
|
]
|
|
623
612
|
}
|
|
624
|
-
) }) : /* @__PURE__ */
|
|
613
|
+
) }) : /* @__PURE__ */ r(
|
|
625
614
|
"div",
|
|
626
615
|
{
|
|
627
616
|
className: "group peer text-sidebar-foreground hidden md:block",
|
|
628
617
|
"data-state": p,
|
|
629
|
-
"data-collapsible": p === "collapsed" ?
|
|
618
|
+
"data-collapsible": p === "collapsed" ? i : "",
|
|
630
619
|
"data-variant": t,
|
|
631
|
-
"data-side":
|
|
620
|
+
"data-side": a,
|
|
632
621
|
"data-slot": "sidebar",
|
|
633
622
|
children: [
|
|
634
623
|
/* @__PURE__ */ e(
|
|
635
624
|
"div",
|
|
636
625
|
{
|
|
637
626
|
"data-slot": "sidebar-gap",
|
|
638
|
-
className:
|
|
627
|
+
className: f(
|
|
639
628
|
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
640
629
|
"group-data-[collapsible=offcanvas]:w-0",
|
|
641
630
|
"group-data-[side=right]:rotate-180",
|
|
@@ -647,21 +636,21 @@ function ba({
|
|
|
647
636
|
"div",
|
|
648
637
|
{
|
|
649
638
|
"data-slot": "sidebar-container",
|
|
650
|
-
className:
|
|
639
|
+
className: f(
|
|
651
640
|
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
652
|
-
|
|
641
|
+
a === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
653
642
|
// Adjust the padding for floating and inset variants.
|
|
654
643
|
t === "floating" || t === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
655
|
-
|
|
644
|
+
u
|
|
656
645
|
),
|
|
657
|
-
...
|
|
646
|
+
...d,
|
|
658
647
|
children: /* @__PURE__ */ e(
|
|
659
648
|
"div",
|
|
660
649
|
{
|
|
661
650
|
"data-sidebar": "sidebar",
|
|
662
651
|
"data-slot": "sidebar-inner",
|
|
663
652
|
className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
664
|
-
children:
|
|
653
|
+
children: l
|
|
665
654
|
}
|
|
666
655
|
)
|
|
667
656
|
}
|
|
@@ -670,97 +659,97 @@ function ba({
|
|
|
670
659
|
}
|
|
671
660
|
);
|
|
672
661
|
}
|
|
673
|
-
function
|
|
674
|
-
const { toggleSidebar:
|
|
675
|
-
return /* @__PURE__ */
|
|
676
|
-
|
|
662
|
+
function ya({ className: a, onClick: t, ...i }) {
|
|
663
|
+
const { toggleSidebar: u } = ge();
|
|
664
|
+
return /* @__PURE__ */ r(
|
|
665
|
+
Z,
|
|
677
666
|
{
|
|
678
667
|
"data-sidebar": "trigger",
|
|
679
668
|
"data-slot": "sidebar-trigger",
|
|
680
669
|
variant: "ghost",
|
|
681
670
|
size: "icon",
|
|
682
|
-
className:
|
|
683
|
-
onClick: (
|
|
684
|
-
t?.(
|
|
671
|
+
className: f("size-7", a),
|
|
672
|
+
onClick: (l) => {
|
|
673
|
+
t?.(l), u();
|
|
685
674
|
},
|
|
686
|
-
...
|
|
675
|
+
...i,
|
|
687
676
|
children: [
|
|
688
|
-
/* @__PURE__ */ e(
|
|
677
|
+
/* @__PURE__ */ e(Ct, {}),
|
|
689
678
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
690
679
|
]
|
|
691
680
|
}
|
|
692
681
|
);
|
|
693
682
|
}
|
|
694
|
-
function
|
|
683
|
+
function wa({ className: a, ...t }) {
|
|
695
684
|
return /* @__PURE__ */ e(
|
|
696
685
|
"div",
|
|
697
686
|
{
|
|
698
687
|
"data-slot": "sidebar-footer",
|
|
699
688
|
"data-sidebar": "footer",
|
|
700
|
-
className:
|
|
689
|
+
className: f("flex flex-col gap-2 p-2", a),
|
|
701
690
|
...t
|
|
702
691
|
}
|
|
703
692
|
);
|
|
704
693
|
}
|
|
705
|
-
function
|
|
694
|
+
function Na({ className: a, ...t }) {
|
|
706
695
|
return /* @__PURE__ */ e(
|
|
707
696
|
"div",
|
|
708
697
|
{
|
|
709
698
|
"data-slot": "sidebar-content",
|
|
710
699
|
"data-sidebar": "content",
|
|
711
|
-
className:
|
|
700
|
+
className: f(
|
|
712
701
|
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
713
|
-
|
|
702
|
+
a
|
|
714
703
|
),
|
|
715
704
|
...t
|
|
716
705
|
}
|
|
717
706
|
);
|
|
718
707
|
}
|
|
719
|
-
function
|
|
708
|
+
function ka({ className: a, ...t }) {
|
|
720
709
|
return /* @__PURE__ */ e(
|
|
721
710
|
"div",
|
|
722
711
|
{
|
|
723
712
|
"data-slot": "sidebar-group",
|
|
724
713
|
"data-sidebar": "group",
|
|
725
|
-
className:
|
|
714
|
+
className: f("relative flex w-full min-w-0 flex-col p-2", a),
|
|
726
715
|
...t
|
|
727
716
|
}
|
|
728
717
|
);
|
|
729
718
|
}
|
|
730
|
-
function Ie({ className:
|
|
719
|
+
function Ie({ className: a, ...t }) {
|
|
731
720
|
return /* @__PURE__ */ e(
|
|
732
721
|
"div",
|
|
733
722
|
{
|
|
734
723
|
"data-slot": "sidebar-group-content",
|
|
735
724
|
"data-sidebar": "group-content",
|
|
736
|
-
className:
|
|
725
|
+
className: f("w-full text-sm", a),
|
|
737
726
|
...t
|
|
738
727
|
}
|
|
739
728
|
);
|
|
740
729
|
}
|
|
741
|
-
function
|
|
730
|
+
function Ee({ className: a, ...t }) {
|
|
742
731
|
return /* @__PURE__ */ e(
|
|
743
732
|
"ul",
|
|
744
733
|
{
|
|
745
734
|
"data-slot": "sidebar-menu",
|
|
746
735
|
"data-sidebar": "menu",
|
|
747
|
-
className:
|
|
736
|
+
className: f("flex w-full min-w-0 flex-col gap-1", a),
|
|
748
737
|
...t
|
|
749
738
|
}
|
|
750
739
|
);
|
|
751
740
|
}
|
|
752
|
-
function
|
|
741
|
+
function Le({ className: a, ...t }) {
|
|
753
742
|
return /* @__PURE__ */ e(
|
|
754
743
|
"li",
|
|
755
744
|
{
|
|
756
745
|
"data-slot": "sidebar-menu-item",
|
|
757
746
|
"data-sidebar": "menu-item",
|
|
758
|
-
className:
|
|
747
|
+
className: f("group/menu-item relative", a),
|
|
759
748
|
...t
|
|
760
749
|
}
|
|
761
750
|
);
|
|
762
751
|
}
|
|
763
|
-
const
|
|
752
|
+
const Ca = Zt(
|
|
764
753
|
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-start text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
765
754
|
{
|
|
766
755
|
variants: {
|
|
@@ -780,184 +769,184 @@ const Na = Xt(
|
|
|
780
769
|
}
|
|
781
770
|
}
|
|
782
771
|
);
|
|
783
|
-
function
|
|
784
|
-
asChild:
|
|
772
|
+
function Ae({
|
|
773
|
+
asChild: a = !1,
|
|
785
774
|
isActive: t = !1,
|
|
786
|
-
variant:
|
|
787
|
-
size:
|
|
788
|
-
tooltip:
|
|
789
|
-
className:
|
|
790
|
-
...
|
|
775
|
+
variant: i = "default",
|
|
776
|
+
size: u = "default",
|
|
777
|
+
tooltip: l,
|
|
778
|
+
className: d,
|
|
779
|
+
...h
|
|
791
780
|
}) {
|
|
792
|
-
const p =
|
|
781
|
+
const p = a ? Yt : "button", { isMobile: m, state: N } = ge(), v = /* @__PURE__ */ e(
|
|
793
782
|
p,
|
|
794
783
|
{
|
|
795
784
|
"data-slot": "sidebar-menu-button",
|
|
796
785
|
"data-sidebar": "menu-button",
|
|
797
|
-
"data-size":
|
|
786
|
+
"data-size": u,
|
|
798
787
|
"data-active": t,
|
|
799
|
-
className:
|
|
800
|
-
...
|
|
788
|
+
className: f(Ca({ variant: i, size: u }), d),
|
|
789
|
+
...h
|
|
801
790
|
}
|
|
802
791
|
);
|
|
803
|
-
return
|
|
804
|
-
children:
|
|
805
|
-
}), /* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */ e(
|
|
807
|
-
/* @__PURE__ */ e(
|
|
808
|
-
] })) :
|
|
792
|
+
return l ? (typeof l == "string" && (l = {
|
|
793
|
+
children: l
|
|
794
|
+
}), /* @__PURE__ */ r(Oe, { children: [
|
|
795
|
+
/* @__PURE__ */ e($e, { asChild: !0, children: v }),
|
|
796
|
+
/* @__PURE__ */ e(Be, { side: "right", align: "center", hidden: N !== "collapsed" || m, ...l })
|
|
797
|
+
] })) : v;
|
|
809
798
|
}
|
|
810
|
-
function
|
|
811
|
-
const { t, i18n:
|
|
812
|
-
{ id: "general", label: t("sections.general", "General"), icon:
|
|
813
|
-
{ id: "profile", label: t("sections.profile", "Profile"), icon:
|
|
814
|
-
{ id: "account", label: t("sections.account", "Account"), icon:
|
|
815
|
-
].filter((
|
|
816
|
-
const
|
|
817
|
-
return (
|
|
818
|
-
}), [t,
|
|
819
|
-
const
|
|
820
|
-
return
|
|
821
|
-
}, [
|
|
799
|
+
function _a({ trigger: a }) {
|
|
800
|
+
const { t, i18n: i } = ce(["settings", "translation"]), { app: u, settings: l } = te(), { theme: d, setTheme: h, accent: p, setAccent: m, radius: N, setRadius: v } = Ue(), [y, c] = _(null), [P, S] = _(!1), z = ee(null), B = O(() => [
|
|
801
|
+
{ id: "general", label: t("sections.general", "General"), icon: Me },
|
|
802
|
+
{ id: "profile", label: t("sections.profile", "Profile"), icon: _t },
|
|
803
|
+
{ id: "account", label: t("sections.account", "Account"), icon: St }
|
|
804
|
+
].filter((F) => {
|
|
805
|
+
const s = l?.sections?.[F.id];
|
|
806
|
+
return (s?.mode ?? (s?.enabled === !1 ? "hidden" : "editable")) !== "hidden";
|
|
807
|
+
}), [t, l]), [C, x] = _(B[0]?.id || "general"), g = Y((o, F, s = "editable") => {
|
|
808
|
+
const H = l?.sections?.[o]?.fields;
|
|
809
|
+
return H && H[F] || s;
|
|
810
|
+
}, [l]), [L, q] = _(""), [D, j] = _(""), [U, A] = _(""), [E, G] = _(""), K = O(() => u?.userMetadataFields?.filter((o) => o.showInProfile) || [], [u?.userMetadataFields]), [b, n] = _({}), [w, T] = _(!1), I = i.language === "fa", W = I ? "text-right" : "text-left", k = Y(async () => {
|
|
822
811
|
try {
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
const
|
|
826
|
-
K.forEach((
|
|
827
|
-
|
|
828
|
-
}),
|
|
829
|
-
} catch (
|
|
830
|
-
console.error("Failed to fetch user:",
|
|
812
|
+
const o = await M.getMe();
|
|
813
|
+
c(o), q(o.name || ""), j(o.surname || ""), A(o.phone || "");
|
|
814
|
+
const F = {};
|
|
815
|
+
K.forEach((s) => {
|
|
816
|
+
F[s.key] = o.metadata?.[s.key] ?? s.defaultValue ?? "";
|
|
817
|
+
}), n(F);
|
|
818
|
+
} catch (o) {
|
|
819
|
+
console.error("Failed to fetch user:", o), J.error(le(o, t));
|
|
831
820
|
}
|
|
832
821
|
}, [t, K]);
|
|
833
822
|
$(() => {
|
|
834
|
-
if (!
|
|
835
|
-
|
|
823
|
+
if (!P) {
|
|
824
|
+
z.current = null;
|
|
836
825
|
return;
|
|
837
826
|
}
|
|
838
|
-
(
|
|
839
|
-
}, [
|
|
840
|
-
const
|
|
841
|
-
let
|
|
842
|
-
K.forEach((
|
|
843
|
-
|
|
844
|
-
}),
|
|
845
|
-
}, [
|
|
827
|
+
(z.current === null || C === "account") && k(), z.current = C;
|
|
828
|
+
}, [P, C, k]), $(() => {
|
|
829
|
+
const o = { ...b };
|
|
830
|
+
let F = !1;
|
|
831
|
+
K.forEach((s) => {
|
|
832
|
+
s.condition && !he(s.condition, b) && o[s.key] !== void 0 && (delete o[s.key], F = !0);
|
|
833
|
+
}), F && n(o);
|
|
834
|
+
}, [b, K]);
|
|
846
835
|
const R = async () => {
|
|
847
|
-
|
|
836
|
+
T(!0);
|
|
848
837
|
try {
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
} catch (
|
|
852
|
-
|
|
838
|
+
const o = { name: L, surname: D, phone: U, metadata: b };
|
|
839
|
+
E && (o.password = E), await M.updateMe(o), J.success(t("profile.success", "Profile updated successfully")), G(""), k();
|
|
840
|
+
} catch (o) {
|
|
841
|
+
J.error(le(o, t));
|
|
853
842
|
} finally {
|
|
854
|
-
|
|
843
|
+
T(!1);
|
|
855
844
|
}
|
|
856
|
-
},
|
|
857
|
-
window.confirm(t("account.logout_confirm", "Are you sure you want to logout?")) && (
|
|
858
|
-
},
|
|
859
|
-
|
|
860
|
-
},
|
|
861
|
-
return /* @__PURE__ */
|
|
862
|
-
/* @__PURE__ */ e(
|
|
845
|
+
}, X = () => {
|
|
846
|
+
window.confirm(t("account.logout_confirm", "Are you sure you want to logout?")) && (M.clearToken(), window.location.reload());
|
|
847
|
+
}, se = (o) => {
|
|
848
|
+
i.changeLanguage(o);
|
|
849
|
+
}, re = y ? Math.max(0, Math.min(100, y.balance.tokens / (y.balance.token_limit || 1) * 100)) : 0, oe = y ? Math.max(0, Math.min(100, y.balance.requests / (y.balance.request_limit || 1) * 100)) : 0;
|
|
850
|
+
return /* @__PURE__ */ r(Ke, { open: P, onOpenChange: S, children: [
|
|
851
|
+
/* @__PURE__ */ e(it, { asChild: !0, children: a || /* @__PURE__ */ e(Z, { variant: "ghost", size: "icon", className: "rounded-full", children: /* @__PURE__ */ e(Ne, { className: "h-5 w-5" }) }) }),
|
|
863
852
|
/* @__PURE__ */ e(
|
|
864
|
-
|
|
853
|
+
He,
|
|
865
854
|
{
|
|
866
|
-
dir:
|
|
867
|
-
className:
|
|
855
|
+
dir: I ? "rtl" : "ltr",
|
|
856
|
+
className: f(
|
|
868
857
|
"w-full sm:w-[95vw] sm:max-w-[700px] p-0 gap-0 overflow-hidden rounded-t-2xl sm:rounded-3xl border-none shadow-2xl bg-background/95 backdrop-blur-md h-[90vh] sm:h-[750px]",
|
|
869
|
-
|
|
858
|
+
I && "rtl"
|
|
870
859
|
),
|
|
871
|
-
children: /* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between px-4 sm:px-6 mb-2 sm:mb-4", children: /* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */ e("div", { className: "bg-primary/10 p-1.5 rounded-lg", children: /* @__PURE__ */ e(
|
|
860
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-col h-full w-full min-h-0 overflow-hidden", children: [
|
|
861
|
+
/* @__PURE__ */ r("div", { className: "w-full bg-muted/20 sm:bg-muted/30 border-b border-border/40 pt-12 sm:pt-6 flex flex-col shrink-0", children: [
|
|
862
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between px-4 sm:px-6 mb-2 sm:mb-4", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
863
|
+
/* @__PURE__ */ e("div", { className: "bg-primary/10 p-1.5 rounded-lg", children: /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-primary" }) }),
|
|
875
864
|
/* @__PURE__ */ e("span", { className: "font-bold text-lg", children: t("title", "Settings") })
|
|
876
865
|
] }) }),
|
|
877
|
-
/* @__PURE__ */ e("div", { className: "w-full overflow-x-auto no-scrollbar pt-2 px-2 sm:px-4", children: /* @__PURE__ */ e("nav", { className: "flex items-center gap-2 sm:gap-6 w-max", children:
|
|
866
|
+
/* @__PURE__ */ e("div", { className: "w-full overflow-x-auto no-scrollbar pt-2 px-2 sm:px-4", children: /* @__PURE__ */ e("nav", { className: "flex items-center gap-2 sm:gap-6 w-max", children: B.map((o) => /* @__PURE__ */ r(
|
|
878
867
|
"button",
|
|
879
868
|
{
|
|
880
|
-
onClick: () =>
|
|
881
|
-
className:
|
|
869
|
+
onClick: () => x(o.id),
|
|
870
|
+
className: f(
|
|
882
871
|
"flex items-center gap-1.5 sm:gap-2 pb-2 sm:pb-3 pt-1 px-2 sm:px-1 text-sm sm:text-base font-medium transition-all border-b-2 whitespace-nowrap shrink-0",
|
|
883
|
-
|
|
884
|
-
|
|
872
|
+
C === o.id ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border",
|
|
873
|
+
l?.sections?.[o.id]?.mode === "faded" && "opacity-50 pointer-events-none select-none"
|
|
885
874
|
),
|
|
886
875
|
children: [
|
|
887
|
-
/* @__PURE__ */ e(
|
|
876
|
+
/* @__PURE__ */ e(o.icon, { className: f(
|
|
888
877
|
"h-3.5 w-3.5 sm:h-4 sm:w-4 transition-transform",
|
|
889
|
-
|
|
878
|
+
C === o.id && "scale-110"
|
|
890
879
|
) }),
|
|
891
|
-
|
|
880
|
+
o.label
|
|
892
881
|
]
|
|
893
882
|
},
|
|
894
|
-
|
|
883
|
+
o.id
|
|
895
884
|
)) }) })
|
|
896
885
|
] }),
|
|
897
|
-
/* @__PURE__ */ e("div", { className: "flex-1 relative min-h-0 h-full bg-background", children: /* @__PURE__ */
|
|
898
|
-
|
|
899
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ e("div", { className: "flex-1 relative min-h-0 h-full bg-background", children: /* @__PURE__ */ r("div", { className: "absolute inset-0 overflow-y-auto p-5 sm:p-8 pt-12 sm:pt-12 custom-scrollbar", children: [
|
|
887
|
+
C === "profile" && /* @__PURE__ */ r("div", { className: "space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-300", children: [
|
|
888
|
+
/* @__PURE__ */ r("div", { children: [
|
|
900
889
|
/* @__PURE__ */ e("h2", { className: "text-xl font-bold tracking-tight", children: t("profile.title", "Profile Information") }),
|
|
901
890
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t("profile.subtitle", "Update your personal details below.") })
|
|
902
891
|
] }),
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
|
|
892
|
+
/* @__PURE__ */ r("div", { className: "grid gap-6", children: [
|
|
893
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
894
|
+
g("profile", "name") !== "hidden" && /* @__PURE__ */ r("div", { className: f("flex flex-col gap-3", g("profile", "name") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
906
895
|
/* @__PURE__ */ e(Q, { htmlFor: "name", className: "px-1", children: t("profile.name", "First Name") }),
|
|
907
896
|
/* @__PURE__ */ e(
|
|
908
|
-
|
|
897
|
+
V,
|
|
909
898
|
{
|
|
910
899
|
id: "name",
|
|
911
|
-
value:
|
|
912
|
-
onChange: (
|
|
913
|
-
disabled:
|
|
914
|
-
className:
|
|
900
|
+
value: L,
|
|
901
|
+
onChange: (o) => q(o.target.value),
|
|
902
|
+
disabled: g("profile", "name") === "faded",
|
|
903
|
+
className: f("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", W)
|
|
915
904
|
}
|
|
916
905
|
)
|
|
917
906
|
] }),
|
|
918
|
-
|
|
907
|
+
g("profile", "surname") !== "hidden" && /* @__PURE__ */ r("div", { className: f("flex flex-col gap-3", g("profile", "surname") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
919
908
|
/* @__PURE__ */ e(Q, { htmlFor: "surname", className: "px-1", children: t("profile.surname", "Last Name") }),
|
|
920
909
|
/* @__PURE__ */ e(
|
|
921
|
-
|
|
910
|
+
V,
|
|
922
911
|
{
|
|
923
912
|
id: "surname",
|
|
924
|
-
value:
|
|
925
|
-
onChange: (
|
|
926
|
-
disabled:
|
|
927
|
-
className:
|
|
913
|
+
value: D,
|
|
914
|
+
onChange: (o) => j(o.target.value),
|
|
915
|
+
disabled: g("profile", "surname") === "faded",
|
|
916
|
+
className: f("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", W)
|
|
928
917
|
}
|
|
929
918
|
)
|
|
930
919
|
] })
|
|
931
920
|
] }),
|
|
932
|
-
|
|
921
|
+
g("profile", "phone") !== "hidden" && /* @__PURE__ */ r("div", { className: f("flex flex-col gap-3", g("profile", "phone") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
933
922
|
/* @__PURE__ */ e(Q, { htmlFor: "phone", className: "px-1 text-left", children: t("profile.phone", "Phone Number") }),
|
|
934
|
-
/* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */ e(
|
|
923
|
+
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
924
|
+
/* @__PURE__ */ e(Pt, { className: "absolute top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground left-3" }),
|
|
936
925
|
/* @__PURE__ */ e(
|
|
937
|
-
|
|
926
|
+
V,
|
|
938
927
|
{
|
|
939
928
|
id: "phone",
|
|
940
|
-
value:
|
|
941
|
-
onChange: (
|
|
942
|
-
disabled:
|
|
929
|
+
value: U,
|
|
930
|
+
onChange: (o) => A(o.target.value),
|
|
931
|
+
disabled: g("profile", "phone") === "faded",
|
|
943
932
|
className: "bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary pl-10 pr-3 text-left",
|
|
944
933
|
dir: "ltr"
|
|
945
934
|
}
|
|
946
935
|
)
|
|
947
936
|
] })
|
|
948
937
|
] }),
|
|
949
|
-
|
|
938
|
+
g("profile", "password") !== "hidden" && /* @__PURE__ */ r("div", { className: f("flex flex-col gap-3", g("profile", "password") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
950
939
|
/* @__PURE__ */ e(Q, { htmlFor: "pass", className: "px-1 text-left", children: t("profile.password", "New Password") }),
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */ e(
|
|
940
|
+
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
941
|
+
/* @__PURE__ */ e(Mt, { className: "absolute top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground left-3" }),
|
|
953
942
|
/* @__PURE__ */ e(
|
|
954
|
-
|
|
943
|
+
V,
|
|
955
944
|
{
|
|
956
945
|
id: "pass",
|
|
957
946
|
type: "password",
|
|
958
|
-
value:
|
|
959
|
-
onChange: (
|
|
960
|
-
disabled:
|
|
947
|
+
value: E,
|
|
948
|
+
onChange: (o) => G(o.target.value),
|
|
949
|
+
disabled: g("profile", "password") === "faded",
|
|
961
950
|
placeholder: t("profile.password_placeholder", "Leave empty to keep current"),
|
|
962
951
|
className: "bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary pl-10 pr-3 text-left",
|
|
963
952
|
dir: "ltr"
|
|
@@ -965,125 +954,125 @@ function ka({ trigger: r }) {
|
|
|
965
954
|
)
|
|
966
955
|
] })
|
|
967
956
|
] }),
|
|
968
|
-
K.map((
|
|
969
|
-
const
|
|
970
|
-
return
|
|
971
|
-
/* @__PURE__ */ e(Q, { htmlFor: `profile-${
|
|
972
|
-
|
|
973
|
-
|
|
957
|
+
K.map((o) => {
|
|
958
|
+
const F = g("profile", o.key, o.mode || "editable");
|
|
959
|
+
return F === "hidden" || !he(o.condition, b) ? null : /* @__PURE__ */ r("div", { className: f("flex flex-col gap-3 animate-in fade-in slide-in-from-top-1 duration-200", F === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
960
|
+
/* @__PURE__ */ e(Q, { htmlFor: `profile-${o.key}`, className: "px-1", children: t(o.label) }),
|
|
961
|
+
o.type === "select" ? /* @__PURE__ */ r(
|
|
962
|
+
ve,
|
|
974
963
|
{
|
|
975
|
-
value: String(
|
|
976
|
-
onValueChange: (
|
|
977
|
-
disabled:
|
|
978
|
-
dir:
|
|
964
|
+
value: String(b[o.key] || ""),
|
|
965
|
+
onValueChange: (s) => n({ ...b, [o.key]: s }),
|
|
966
|
+
disabled: F === "faded",
|
|
967
|
+
dir: I ? "rtl" : "ltr",
|
|
979
968
|
children: [
|
|
980
|
-
/* @__PURE__ */ e(
|
|
981
|
-
/* @__PURE__ */ e(
|
|
969
|
+
/* @__PURE__ */ e(xe, { className: "bg-muted/30 border-border/50 rounded-xl focus:ring-primary h-11", children: /* @__PURE__ */ e(ye, { placeholder: t(o.placeholder || "profile.select_placeholder") }) }),
|
|
970
|
+
/* @__PURE__ */ e(we, { className: "rounded-xl border-border/40 shadow-xl bg-background/95 backdrop-blur-md", children: o.options?.map((s) => /* @__PURE__ */ e(me, { value: String(s.value), className: "rounded-lg focus:bg-primary/10", children: t(s.label) }, String(s.value))) })
|
|
982
971
|
]
|
|
983
972
|
}
|
|
984
|
-
) :
|
|
973
|
+
) : o.type === "checkbox" ? /* @__PURE__ */ r("div", { className: "flex items-center gap-3 px-1 py-1", children: [
|
|
985
974
|
/* @__PURE__ */ e(
|
|
986
975
|
"input",
|
|
987
976
|
{
|
|
988
|
-
id: `profile-${
|
|
977
|
+
id: `profile-${o.key}`,
|
|
989
978
|
type: "checkbox",
|
|
990
|
-
checked: !!
|
|
991
|
-
disabled:
|
|
992
|
-
onChange: (
|
|
979
|
+
checked: !!b[o.key],
|
|
980
|
+
disabled: F === "faded",
|
|
981
|
+
onChange: (s) => n({ ...b, [o.key]: s.target.checked }),
|
|
993
982
|
className: "h-5 w-5 rounded-md border-border/50 bg-muted/30 text-primary focus:ring-primary transition-all cursor-pointer"
|
|
994
983
|
}
|
|
995
984
|
),
|
|
996
|
-
/* @__PURE__ */ e(Q, { htmlFor: `profile-${
|
|
985
|
+
/* @__PURE__ */ e(Q, { htmlFor: `profile-${o.key}`, className: "text-sm font-medium text-muted-foreground cursor-pointer", children: t(o.placeholder || o.label) })
|
|
997
986
|
] }) : /* @__PURE__ */ e(
|
|
998
|
-
|
|
987
|
+
V,
|
|
999
988
|
{
|
|
1000
|
-
id: `profile-${
|
|
1001
|
-
type:
|
|
1002
|
-
value:
|
|
1003
|
-
disabled:
|
|
1004
|
-
onChange: (
|
|
1005
|
-
placeholder: t(
|
|
1006
|
-
className:
|
|
989
|
+
id: `profile-${o.key}`,
|
|
990
|
+
type: o.type,
|
|
991
|
+
value: b[o.key] || "",
|
|
992
|
+
disabled: F === "faded",
|
|
993
|
+
onChange: (s) => n({ ...b, [o.key]: s.target.value }),
|
|
994
|
+
placeholder: t(o.placeholder || ""),
|
|
995
|
+
className: f("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", W)
|
|
1007
996
|
}
|
|
1008
997
|
)
|
|
1009
|
-
] },
|
|
998
|
+
] }, o.key);
|
|
1010
999
|
}),
|
|
1011
|
-
/* @__PURE__ */ e("div", { className: "pt-4 flex justify-center", children: /* @__PURE__ */
|
|
1012
|
-
|
|
1000
|
+
/* @__PURE__ */ e("div", { className: "pt-4 flex justify-center", children: /* @__PURE__ */ r(
|
|
1001
|
+
Z,
|
|
1013
1002
|
{
|
|
1014
1003
|
onClick: R,
|
|
1015
|
-
disabled:
|
|
1004
|
+
disabled: w,
|
|
1016
1005
|
className: "w-full sm:w-auto px-8 rounded-xl gap-2 font-semibold shadow-lg shadow-primary/20 h-11 transition-all active:scale-[0.98]",
|
|
1017
1006
|
children: [
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1019
|
-
|
|
1007
|
+
/* @__PURE__ */ e(Tt, { className: "h-4 w-4" }),
|
|
1008
|
+
w ? t("profile.saving", "Saving...") : t("profile.save", "Save Changes")
|
|
1020
1009
|
]
|
|
1021
1010
|
}
|
|
1022
1011
|
) })
|
|
1023
1012
|
] })
|
|
1024
1013
|
] }),
|
|
1025
|
-
|
|
1026
|
-
/* @__PURE__ */
|
|
1014
|
+
C === "general" && /* @__PURE__ */ r("div", { className: "space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-300", children: [
|
|
1015
|
+
/* @__PURE__ */ r("div", { children: [
|
|
1027
1016
|
/* @__PURE__ */ e("h2", { className: "text-xl font-bold tracking-tight", children: t("general.title", "General Settings") }),
|
|
1028
1017
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t("general.subtitle", "Configure look and feel and language.") })
|
|
1029
1018
|
] }),
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */ e(
|
|
1019
|
+
/* @__PURE__ */ r("div", { className: "space-y-8", children: [
|
|
1020
|
+
g("general", "theme") !== "hidden" && /* @__PURE__ */ r("div", { className: f("space-y-3", g("general", "theme") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
1021
|
+
/* @__PURE__ */ r(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
|
|
1022
|
+
/* @__PURE__ */ e(Me, { className: "h-4 w-4 text-primary" }),
|
|
1034
1023
|
t("general.theme", "Theme")
|
|
1035
1024
|
] }),
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
/* @__PURE__ */
|
|
1025
|
+
/* @__PURE__ */ r("div", { className: "flex p-1 bg-muted/50 rounded-2xl border border-border/40 w-full", children: [
|
|
1026
|
+
/* @__PURE__ */ r(
|
|
1038
1027
|
"button",
|
|
1039
1028
|
{
|
|
1040
|
-
onClick: () =>
|
|
1041
|
-
disabled:
|
|
1042
|
-
className:
|
|
1029
|
+
onClick: () => h("light"),
|
|
1030
|
+
disabled: g("general", "theme") === "faded",
|
|
1031
|
+
className: f(
|
|
1043
1032
|
"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl transition-all",
|
|
1044
|
-
|
|
1033
|
+
d === "light" ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
|
|
1045
1034
|
),
|
|
1046
1035
|
children: [
|
|
1047
|
-
/* @__PURE__ */ e(
|
|
1036
|
+
/* @__PURE__ */ e(Dt, { className: "h-4 w-4" }),
|
|
1048
1037
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: t("general.themes.light", "Light") })
|
|
1049
1038
|
]
|
|
1050
1039
|
}
|
|
1051
1040
|
),
|
|
1052
|
-
/* @__PURE__ */
|
|
1041
|
+
/* @__PURE__ */ r(
|
|
1053
1042
|
"button",
|
|
1054
1043
|
{
|
|
1055
|
-
onClick: () =>
|
|
1056
|
-
disabled:
|
|
1057
|
-
className:
|
|
1044
|
+
onClick: () => h("dark"),
|
|
1045
|
+
disabled: g("general", "theme") === "faded",
|
|
1046
|
+
className: f(
|
|
1058
1047
|
"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl transition-all",
|
|
1059
|
-
|
|
1048
|
+
d === "dark" ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
|
|
1060
1049
|
),
|
|
1061
1050
|
children: [
|
|
1062
|
-
/* @__PURE__ */ e(
|
|
1051
|
+
/* @__PURE__ */ e(It, { className: "h-4 w-4" }),
|
|
1063
1052
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: t("general.themes.dark", "Dark") })
|
|
1064
1053
|
]
|
|
1065
1054
|
}
|
|
1066
1055
|
),
|
|
1067
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ r(
|
|
1068
1057
|
"button",
|
|
1069
1058
|
{
|
|
1070
|
-
onClick: () =>
|
|
1071
|
-
disabled:
|
|
1072
|
-
className:
|
|
1059
|
+
onClick: () => h("system"),
|
|
1060
|
+
disabled: g("general", "theme") === "faded",
|
|
1061
|
+
className: f(
|
|
1073
1062
|
"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl transition-all",
|
|
1074
|
-
|
|
1063
|
+
d === "system" ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
|
|
1075
1064
|
),
|
|
1076
1065
|
children: [
|
|
1077
|
-
/* @__PURE__ */ e(
|
|
1066
|
+
/* @__PURE__ */ e(Et, { className: "h-4 w-4" }),
|
|
1078
1067
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: t("general.themes.system", "System") })
|
|
1079
1068
|
]
|
|
1080
1069
|
}
|
|
1081
1070
|
)
|
|
1082
1071
|
] })
|
|
1083
1072
|
] }),
|
|
1084
|
-
|
|
1085
|
-
/* @__PURE__ */
|
|
1086
|
-
/* @__PURE__ */ e(
|
|
1073
|
+
g("general", "accent") !== "hidden" && /* @__PURE__ */ r("div", { className: f("space-y-4", g("general", "accent") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
1074
|
+
/* @__PURE__ */ r(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
|
|
1075
|
+
/* @__PURE__ */ e(Te, { className: "h-4 w-4 text-primary" }),
|
|
1087
1076
|
t("general.accent", "Accent Color")
|
|
1088
1077
|
] }),
|
|
1089
1078
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-4 sm:grid-cols-8 gap-3 w-full", children: [
|
|
@@ -1103,68 +1092,68 @@ function ka({ trigger: r }) {
|
|
|
1103
1092
|
// Teal
|
|
1104
1093
|
"oklch(0.552 0.016 285.938)"
|
|
1105
1094
|
// Slate
|
|
1106
|
-
].map((
|
|
1107
|
-
const
|
|
1095
|
+
].map((o) => {
|
|
1096
|
+
const F = (p || "oklch(0.623 0.214 259.815)") === o;
|
|
1108
1097
|
return /* @__PURE__ */ e(
|
|
1109
1098
|
"button",
|
|
1110
1099
|
{
|
|
1111
|
-
onClick: () =>
|
|
1112
|
-
disabled:
|
|
1113
|
-
className:
|
|
1100
|
+
onClick: () => m(o),
|
|
1101
|
+
disabled: g("general", "accent") === "faded",
|
|
1102
|
+
className: f(
|
|
1114
1103
|
"h-8 w-8 rounded-full border-2 transition-all hover:scale-110 active:scale-95 shadow-sm",
|
|
1115
|
-
|
|
1104
|
+
F ? "border-foreground" : "border-transparent"
|
|
1116
1105
|
),
|
|
1117
|
-
style: { backgroundColor:
|
|
1106
|
+
style: { backgroundColor: o }
|
|
1118
1107
|
},
|
|
1119
|
-
|
|
1108
|
+
o
|
|
1120
1109
|
);
|
|
1121
1110
|
}) })
|
|
1122
1111
|
] }),
|
|
1123
|
-
|
|
1124
|
-
/* @__PURE__ */
|
|
1112
|
+
g("general", "radius") !== "hidden" && /* @__PURE__ */ r("div", { className: f("space-y-4", g("general", "radius") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
1113
|
+
/* @__PURE__ */ r(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
|
|
1125
1114
|
/* @__PURE__ */ e("div", { className: "h-4 w-4 rounded-md border-2 border-primary" }),
|
|
1126
1115
|
t("general.radius", "Rounded Corners")
|
|
1127
1116
|
] }),
|
|
1128
1117
|
/* @__PURE__ */ e("div", { className: "flex p-1 bg-muted/50 rounded-2xl border border-border/40 w-full", children: [
|
|
1129
1118
|
{ id: "sharp", value: "0.3rem" },
|
|
1130
1119
|
{ id: "round", value: "1.25rem" }
|
|
1131
|
-
].map((
|
|
1132
|
-
const
|
|
1120
|
+
].map((o) => {
|
|
1121
|
+
const F = (N || "1.25rem") === o.value;
|
|
1133
1122
|
return /* @__PURE__ */ e(
|
|
1134
1123
|
"button",
|
|
1135
1124
|
{
|
|
1136
|
-
onClick: () =>
|
|
1137
|
-
disabled:
|
|
1138
|
-
className:
|
|
1125
|
+
onClick: () => v(o.value),
|
|
1126
|
+
disabled: g("general", "radius") === "faded",
|
|
1127
|
+
className: f(
|
|
1139
1128
|
"flex-1 py-2 rounded-xl transition-all text-sm font-medium",
|
|
1140
|
-
|
|
1129
|
+
F ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
|
|
1141
1130
|
),
|
|
1142
|
-
children: t(`general.radius_levels.${
|
|
1131
|
+
children: t(`general.radius_levels.${o.id}`)
|
|
1143
1132
|
},
|
|
1144
|
-
|
|
1133
|
+
o.id
|
|
1145
1134
|
);
|
|
1146
1135
|
}) })
|
|
1147
1136
|
] }),
|
|
1148
|
-
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
/* @__PURE__ */ e(
|
|
1137
|
+
g("general", "language") !== "hidden" && /* @__PURE__ */ r("div", { className: f("space-y-3", g("general", "language") === "faded" && "opacity-50"), children: [
|
|
1138
|
+
/* @__PURE__ */ r(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
|
|
1139
|
+
/* @__PURE__ */ e(Lt, { className: "h-4 w-4 text-primary" }),
|
|
1151
1140
|
t("general.language", "Language")
|
|
1152
1141
|
] }),
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
|
|
1142
|
+
/* @__PURE__ */ r(
|
|
1143
|
+
ve,
|
|
1155
1144
|
{
|
|
1156
|
-
value:
|
|
1157
|
-
onValueChange:
|
|
1158
|
-
disabled:
|
|
1159
|
-
dir:
|
|
1145
|
+
value: i.language,
|
|
1146
|
+
onValueChange: se,
|
|
1147
|
+
disabled: g("general", "language") === "faded",
|
|
1148
|
+
dir: I ? "rtl" : "ltr",
|
|
1160
1149
|
children: [
|
|
1161
|
-
/* @__PURE__ */ e(
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */ e(me, { value: "en", className: "rounded-xl focus:bg-primary/10", children: /* @__PURE__ */
|
|
1150
|
+
/* @__PURE__ */ e(xe, { className: "w-full bg-muted/50 rounded-2xl border-border/40 h-11 focus:ring-primary/20", children: /* @__PURE__ */ e(ye, { placeholder: t("general.language_placeholder", "Select language") }) }),
|
|
1151
|
+
/* @__PURE__ */ r(we, { className: "rounded-2xl border-border/40 shadow-xl bg-background/95 backdrop-blur-md", children: [
|
|
1152
|
+
/* @__PURE__ */ e(me, { value: "en", className: "rounded-xl focus:bg-primary/10", children: /* @__PURE__ */ r("span", { className: "flex items-center gap-2", children: [
|
|
1164
1153
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-muted-foreground mr-1", children: "EN" }),
|
|
1165
1154
|
t("general.languages.en", "English")
|
|
1166
1155
|
] }) }),
|
|
1167
|
-
/* @__PURE__ */ e(me, { value: "fa", className: "rounded-xl focus:bg-primary/10", children: /* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ e(me, { value: "fa", className: "rounded-xl focus:bg-primary/10", children: /* @__PURE__ */ r("span", { className: "flex items-center gap-2", children: [
|
|
1168
1157
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-muted-foreground mr-1", children: "FA" }),
|
|
1169
1158
|
t("general.languages.fa", "Persian")
|
|
1170
1159
|
] }) })
|
|
@@ -1175,76 +1164,76 @@ function ka({ trigger: r }) {
|
|
|
1175
1164
|
] })
|
|
1176
1165
|
] })
|
|
1177
1166
|
] }),
|
|
1178
|
-
|
|
1179
|
-
/* @__PURE__ */
|
|
1167
|
+
C === "account" && /* @__PURE__ */ r("div", { className: "space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-300", children: [
|
|
1168
|
+
/* @__PURE__ */ r("div", { children: [
|
|
1180
1169
|
/* @__PURE__ */ e("h2", { className: "text-xl font-bold tracking-tight", children: t("account.title", "Account & Usage") }),
|
|
1181
1170
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t("account.subtitle", "Monitor your quotas and manage your session.") })
|
|
1182
1171
|
] }),
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
|
|
1185
|
-
/* @__PURE__ */
|
|
1186
|
-
/* @__PURE__ */ e(
|
|
1172
|
+
/* @__PURE__ */ r("div", { className: "space-y-6", children: [
|
|
1173
|
+
g("account", "balance") !== "hidden" && /* @__PURE__ */ r("div", { className: f("p-6 bg-muted/30 rounded-3xl border border-border/40 space-y-6", g("account", "balance") === "faded" && "opacity-50"), children: [
|
|
1174
|
+
/* @__PURE__ */ r(Q, { className: "text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2", children: [
|
|
1175
|
+
/* @__PURE__ */ e(At, { className: "h-4 w-4" }),
|
|
1187
1176
|
t("account.balance", "Current Balance")
|
|
1188
1177
|
] }),
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
/* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ r("div", { className: "space-y-5", children: [
|
|
1179
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
1180
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between text-sm mb-1", children: [
|
|
1192
1181
|
/* @__PURE__ */ e("span", { className: "font-medium text-muted-foreground", children: t("account.tokens", "Tokens") }),
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
|
|
1182
|
+
/* @__PURE__ */ r("span", { className: "font-bold text-primary", children: [
|
|
1183
|
+
re.toLocaleString(i.language, { maximumFractionDigits: 0 }),
|
|
1195
1184
|
"%"
|
|
1196
1185
|
] })
|
|
1197
1186
|
] }),
|
|
1198
1187
|
/* @__PURE__ */ e("div", { className: "h-2.5 w-full bg-muted/50 rounded-full overflow-hidden border border-border/20 p-0.5", dir: "ltr", children: /* @__PURE__ */ e(
|
|
1199
1188
|
"div",
|
|
1200
1189
|
{
|
|
1201
|
-
className:
|
|
1190
|
+
className: f(
|
|
1202
1191
|
"h-full rounded-full transition-all duration-1000 shadow-sm",
|
|
1203
|
-
|
|
1192
|
+
re > 60 ? "bg-emerald-500 shadow-emerald-500/20" : re > 20 ? "bg-amber-500 shadow-amber-500/20" : "bg-destructive shadow-destructive/20"
|
|
1204
1193
|
),
|
|
1205
|
-
style: { width: `${
|
|
1194
|
+
style: { width: `${re}%` }
|
|
1206
1195
|
}
|
|
1207
1196
|
) })
|
|
1208
1197
|
] }),
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
/* @__PURE__ */ e(
|
|
1198
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
1199
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between text-sm mb-1", children: [
|
|
1200
|
+
/* @__PURE__ */ r("span", { className: "font-medium text-muted-foreground flex items-center gap-1.5 focus:outline-none", children: [
|
|
1201
|
+
/* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 text-blue-500" }),
|
|
1213
1202
|
t("account.requests", "Requests")
|
|
1214
1203
|
] }),
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
|
|
1204
|
+
/* @__PURE__ */ r("span", { className: "font-bold text-primary", children: [
|
|
1205
|
+
oe.toLocaleString(i.language, { maximumFractionDigits: 0 }),
|
|
1217
1206
|
"%"
|
|
1218
1207
|
] })
|
|
1219
1208
|
] }),
|
|
1220
1209
|
/* @__PURE__ */ e("div", { className: "h-2.5 w-full bg-muted/50 rounded-full overflow-hidden border border-border/20 p-0.5", dir: "ltr", children: /* @__PURE__ */ e(
|
|
1221
1210
|
"div",
|
|
1222
1211
|
{
|
|
1223
|
-
className:
|
|
1212
|
+
className: f(
|
|
1224
1213
|
"h-full rounded-full transition-all duration-1000 shadow-sm",
|
|
1225
|
-
|
|
1214
|
+
oe > 60 ? "bg-emerald-500 shadow-emerald-500/20" : oe > 20 ? "bg-amber-500 shadow-amber-500/20" : "bg-destructive shadow-destructive/20"
|
|
1226
1215
|
),
|
|
1227
|
-
style: { width: `${
|
|
1216
|
+
style: { width: `${oe}%` }
|
|
1228
1217
|
}
|
|
1229
1218
|
) })
|
|
1230
1219
|
] })
|
|
1231
1220
|
] })
|
|
1232
1221
|
] }),
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
|
|
1222
|
+
/* @__PURE__ */ r("div", { className: "pt-2 flex flex-col gap-3", children: [
|
|
1223
|
+
y?.balance.updated_at && g("account", "balance") !== "hidden" && /* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground px-1", children: [
|
|
1235
1224
|
t("account.last_recharge", "Last balance update on"),
|
|
1236
1225
|
": ",
|
|
1237
|
-
new Date(
|
|
1226
|
+
new Date(y.balance.updated_at).toLocaleDateString(i.language)
|
|
1238
1227
|
] }),
|
|
1239
|
-
|
|
1240
|
-
|
|
1228
|
+
g("account", "logout") !== "hidden" && /* @__PURE__ */ r(
|
|
1229
|
+
Z,
|
|
1241
1230
|
{
|
|
1242
1231
|
variant: "destructive",
|
|
1243
|
-
onClick:
|
|
1244
|
-
disabled:
|
|
1245
|
-
className:
|
|
1232
|
+
onClick: X,
|
|
1233
|
+
disabled: g("account", "logout") === "faded",
|
|
1234
|
+
className: f("rounded-2xl gap-2 font-bold h-12 shadow-lg shadow-destructive/10 transition-all active:scale-[0.98]", g("account", "logout") === "faded" && "opacity-50 pointer-events-none"),
|
|
1246
1235
|
children: [
|
|
1247
|
-
/* @__PURE__ */ e(
|
|
1236
|
+
/* @__PURE__ */ e(zt, { className: "h-4 w-4" }),
|
|
1248
1237
|
t("account.logout", "Logout from Account")
|
|
1249
1238
|
]
|
|
1250
1239
|
}
|
|
@@ -1258,53 +1247,53 @@ function ka({ trigger: r }) {
|
|
|
1258
1247
|
)
|
|
1259
1248
|
] });
|
|
1260
1249
|
}
|
|
1261
|
-
function
|
|
1262
|
-
const [, t] =
|
|
1250
|
+
function Ve({ hideActions: a = !1 }) {
|
|
1251
|
+
const [, t] = _e(), { t: i } = ce(["sidebar", "chat"]), { history: u, app: l } = te(), { theme: d } = Ue(), h = !a && (u?.enabled ?? !0), [p, m] = _("light");
|
|
1263
1252
|
$(() => {
|
|
1264
|
-
if (
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1253
|
+
if (d === "system") {
|
|
1254
|
+
const y = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1255
|
+
m(y ? "dark" : "light");
|
|
1267
1256
|
} else
|
|
1268
|
-
|
|
1269
|
-
}, [
|
|
1270
|
-
const
|
|
1271
|
-
return /* @__PURE__ */
|
|
1272
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 md:gap-2 min-w-[36px] md:min-w-[80px]", children:
|
|
1257
|
+
m(d);
|
|
1258
|
+
}, [d]);
|
|
1259
|
+
const N = O(() => l?.logo ? typeof l.logo == "string" ? l.logo : p === "dark" ? l.logo.dark : l.logo.light : lt, [l?.logo, p]), v = l?.name || "Gentiq";
|
|
1260
|
+
return /* @__PURE__ */ r("header", { className: "relative flex items-center justify-between px-3 md:px-4 h-14 sticky top-0 z-40 w-full glass border-b border-border/30 transition-all duration-300", children: [
|
|
1261
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 md:gap-2 min-w-[36px] md:min-w-[80px]", children: h && /* @__PURE__ */ e(ya, { className: "hover:bg-accent/60 transition-all duration-200 hover:scale-105 active:scale-95 rounded-lg size-9" }) }),
|
|
1273
1262
|
/* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-2.5 select-none animate-in fade-in zoom-in-95 duration-500", children: /* @__PURE__ */ e(
|
|
1274
1263
|
"img",
|
|
1275
1264
|
{
|
|
1276
|
-
src:
|
|
1277
|
-
alt:
|
|
1265
|
+
src: N,
|
|
1266
|
+
alt: v,
|
|
1278
1267
|
className: "size-8 object-contain"
|
|
1279
1268
|
}
|
|
1280
1269
|
) }) }),
|
|
1281
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 min-w-[36px] md:min-w-[80px] justify-end", children: !
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
/* @__PURE__ */ e(
|
|
1270
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 min-w-[36px] md:min-w-[80px] justify-end", children: !a && /* @__PURE__ */ r(ke, { children: [
|
|
1271
|
+
/* @__PURE__ */ r(Oe, { children: [
|
|
1272
|
+
/* @__PURE__ */ e($e, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1284
1273
|
"button",
|
|
1285
1274
|
{
|
|
1286
1275
|
type: "button",
|
|
1287
|
-
className:
|
|
1276
|
+
className: f(
|
|
1288
1277
|
"flex items-center justify-center size-9 rounded-lg hover:bg-accent/60 transition-all duration-200 hover:scale-105 active:scale-95 text-muted-foreground hover:text-primary",
|
|
1289
|
-
|
|
1278
|
+
h && "md:hidden"
|
|
1290
1279
|
),
|
|
1291
1280
|
onClick: () => {
|
|
1292
1281
|
t("/");
|
|
1293
1282
|
},
|
|
1294
|
-
children: /* @__PURE__ */ e(
|
|
1283
|
+
children: /* @__PURE__ */ e(Rt, { className: "size-5" })
|
|
1295
1284
|
}
|
|
1296
1285
|
) }),
|
|
1297
|
-
/* @__PURE__ */ e(
|
|
1286
|
+
/* @__PURE__ */ e(Be, { side: "bottom", className: "text-xs", children: i("new_chat") })
|
|
1298
1287
|
] }),
|
|
1299
|
-
|
|
1300
|
-
|
|
1288
|
+
l?.showSettings !== !1 && /* @__PURE__ */ e(
|
|
1289
|
+
_a,
|
|
1301
1290
|
{
|
|
1302
1291
|
trigger: /* @__PURE__ */ e(
|
|
1303
1292
|
"button",
|
|
1304
1293
|
{
|
|
1305
1294
|
type: "button",
|
|
1306
1295
|
className: "flex items-center justify-center size-9 rounded-lg hover:bg-accent/60 transition-all duration-200 hover:scale-105 active:scale-95 text-muted-foreground hover:text-primary",
|
|
1307
|
-
children: /* @__PURE__ */ e(
|
|
1296
|
+
children: /* @__PURE__ */ e(Ne, { className: "size-5" })
|
|
1308
1297
|
}
|
|
1309
1298
|
)
|
|
1310
1299
|
}
|
|
@@ -1312,219 +1301,219 @@ function Qe({ hideActions: r = !1 }) {
|
|
|
1312
1301
|
] }) })
|
|
1313
1302
|
] });
|
|
1314
1303
|
}
|
|
1315
|
-
const
|
|
1316
|
-
function
|
|
1317
|
-
const t =
|
|
1318
|
-
return
|
|
1304
|
+
const ze = 20;
|
|
1305
|
+
function Sa() {
|
|
1306
|
+
const t = M.getConfig().app?.cacheNamespace || "gentiq";
|
|
1307
|
+
return et({
|
|
1319
1308
|
queryKey: [t, "conversations"],
|
|
1320
|
-
queryFn: async ({ pageParam:
|
|
1321
|
-
const
|
|
1309
|
+
queryFn: async ({ pageParam: i = 0 }) => {
|
|
1310
|
+
const u = await M.getHistory(i, ze);
|
|
1322
1311
|
return {
|
|
1323
|
-
threads:
|
|
1324
|
-
id: `/${
|
|
1325
|
-
firstMessage:
|
|
1326
|
-
timestamp: new Date(
|
|
1327
|
-
pinned: !!
|
|
1312
|
+
threads: u.threads.map((l) => ({
|
|
1313
|
+
id: `/${l.id}`,
|
|
1314
|
+
firstMessage: l.title || l.firstMessage || "Chat",
|
|
1315
|
+
timestamp: new Date(l.created_at).getTime(),
|
|
1316
|
+
pinned: !!l.pinned
|
|
1328
1317
|
})),
|
|
1329
|
-
nextSkip:
|
|
1330
|
-
hasMore:
|
|
1318
|
+
nextSkip: i + ze,
|
|
1319
|
+
hasMore: i + u.threads.length < (u.total_count ?? 0)
|
|
1331
1320
|
};
|
|
1332
1321
|
},
|
|
1333
1322
|
initialPageParam: 0,
|
|
1334
|
-
getNextPageParam: (
|
|
1323
|
+
getNextPageParam: (i) => i.hasMore ? i.nextSkip : void 0,
|
|
1335
1324
|
staleTime: 1e3 * 60 * 5
|
|
1336
1325
|
// 5 minutes
|
|
1337
1326
|
});
|
|
1338
1327
|
}
|
|
1339
|
-
async function
|
|
1340
|
-
const
|
|
1328
|
+
async function Pa(a, t, i, u) {
|
|
1329
|
+
const d = M.getConfig().app?.cacheNamespace || "gentiq";
|
|
1341
1330
|
try {
|
|
1342
|
-
await
|
|
1343
|
-
} catch (
|
|
1344
|
-
console.error("Failed to delete conversation:",
|
|
1331
|
+
await M.deleteThread(a), t.invalidateQueries({ queryKey: [d, "conversations"] }), u === a && i("/");
|
|
1332
|
+
} catch (h) {
|
|
1333
|
+
console.error("Failed to delete conversation:", h), J.error("Failed to delete conversation");
|
|
1345
1334
|
}
|
|
1346
1335
|
}
|
|
1347
|
-
function
|
|
1348
|
-
const { t, i18n:
|
|
1336
|
+
function Ma({ side: a = "left" }) {
|
|
1337
|
+
const { t, i18n: i } = ce(["sidebar", "translation"]), { setOpenMobile: u, isMobile: l } = ge(), {
|
|
1349
1338
|
data: d,
|
|
1350
|
-
fetchNextPage:
|
|
1351
|
-
hasNextPage:
|
|
1339
|
+
fetchNextPage: h,
|
|
1340
|
+
hasNextPage: p,
|
|
1352
1341
|
isFetchingNextPage: m,
|
|
1353
|
-
isLoading:
|
|
1354
|
-
} =
|
|
1355
|
-
(
|
|
1356
|
-
|
|
1357
|
-
(
|
|
1358
|
-
|
|
1342
|
+
isLoading: N
|
|
1343
|
+
} = Sa(), { history: v, app: y } = te(), c = y?.basePath || "/", P = v?.enabled ?? !1, S = d?.pages.flatMap((s) => s.threads) ?? [], [z, B] = _e(), C = pe(), x = ee(null), g = Y(
|
|
1344
|
+
(s) => {
|
|
1345
|
+
x.current && (x.current.disconnect(), x.current = null), s && p && !m && (x.current = new IntersectionObserver(
|
|
1346
|
+
(H) => {
|
|
1347
|
+
H[0].isIntersecting && h();
|
|
1359
1348
|
},
|
|
1360
1349
|
{
|
|
1361
1350
|
threshold: 0,
|
|
1362
1351
|
rootMargin: "100px"
|
|
1363
1352
|
}
|
|
1364
|
-
),
|
|
1353
|
+
), x.current.observe(s));
|
|
1365
1354
|
},
|
|
1366
|
-
[
|
|
1367
|
-
),
|
|
1368
|
-
|
|
1369
|
-
}, [
|
|
1370
|
-
(
|
|
1371
|
-
).sort((
|
|
1355
|
+
[p, h, m]
|
|
1356
|
+
), q = M.getConfig().app?.cacheNamespace || "gentiq", [D, j] = _(!1), [U, A] = _(null), [E, G] = _(""), [K, b] = _(null), [n, w] = _(""), T = ee(null), I = Y((s, H) => {
|
|
1357
|
+
s.button !== 0 || s.metaKey || s.ctrlKey || (s.preventDefault(), B(H), l && u(!1));
|
|
1358
|
+
}, [B, l, u]), W = S.filter(
|
|
1359
|
+
(s) => s.firstMessage?.toLowerCase().includes(E.toLowerCase())
|
|
1360
|
+
).sort((s, H) => s.pinned && !H.pinned ? -1 : !s.pinned && H.pinned ? 1 : H.timestamp - s.timestamp), k = async (s) => {
|
|
1372
1361
|
try {
|
|
1373
|
-
await
|
|
1362
|
+
await M.pinThread(s.id.replace(/^\//, ""), !s.pinned), C.invalidateQueries({ queryKey: [q, "conversations"] }), J.success(s.pinned ? t("unpinned_success") : t("pinned_success"));
|
|
1374
1363
|
} catch {
|
|
1375
|
-
|
|
1364
|
+
J.error(t("pin_failed"));
|
|
1376
1365
|
}
|
|
1377
|
-
},
|
|
1366
|
+
}, R = async (s) => {
|
|
1378
1367
|
try {
|
|
1379
|
-
const
|
|
1380
|
-
navigator.clipboard.writeText(
|
|
1368
|
+
const H = await M.shareThread(s.id.replace(/^\//, "")), fe = `${window.location.origin}${H.url}`;
|
|
1369
|
+
navigator.clipboard.writeText(fe), J.success(t("share_success"), {
|
|
1381
1370
|
description: t("share_description")
|
|
1382
1371
|
});
|
|
1383
1372
|
} catch {
|
|
1384
|
-
|
|
1373
|
+
J.error(t("share_failed"));
|
|
1385
1374
|
}
|
|
1386
|
-
},
|
|
1387
|
-
|
|
1388
|
-
},
|
|
1389
|
-
|
|
1390
|
-
},
|
|
1391
|
-
if (
|
|
1375
|
+
}, X = (s) => {
|
|
1376
|
+
b(s.id), w(s.firstMessage ?? ""), setTimeout(() => T.current?.focus(), 0);
|
|
1377
|
+
}, se = (s) => {
|
|
1378
|
+
s?.preventDefault(), s?.stopPropagation(), b(null), w("");
|
|
1379
|
+
}, re = async (s) => {
|
|
1380
|
+
if (s?.preventDefault(), s && "stopPropagation" in s && s.stopPropagation(), !(!K || !n.trim()))
|
|
1392
1381
|
try {
|
|
1393
|
-
await
|
|
1382
|
+
await M.updateThreadTitle(K, n), C.invalidateQueries({ queryKey: [q, "conversations"] }), b(null), J.success(t("rename_success"));
|
|
1394
1383
|
} catch {
|
|
1395
|
-
|
|
1384
|
+
J.error(t("rename_failed"));
|
|
1396
1385
|
}
|
|
1397
|
-
},
|
|
1398
|
-
|
|
1399
|
-
},
|
|
1400
|
-
|
|
1401
|
-
},
|
|
1386
|
+
}, oe = (s) => {
|
|
1387
|
+
A(s), j(!0);
|
|
1388
|
+
}, o = () => {
|
|
1389
|
+
U && (Pa(U.id, C, B, z), j(!1), A(null), J.success(t("chat_deleted_success")));
|
|
1390
|
+
}, F = (s) => new Intl.DateTimeFormat(i.language, {
|
|
1402
1391
|
year: "numeric",
|
|
1403
1392
|
month: "short",
|
|
1404
1393
|
day: "numeric",
|
|
1405
1394
|
hour: "2-digit",
|
|
1406
1395
|
minute: "2-digit",
|
|
1407
|
-
calendar:
|
|
1408
|
-
}).format(new Date(
|
|
1409
|
-
return /* @__PURE__ */ e(
|
|
1410
|
-
/* @__PURE__ */ e(
|
|
1411
|
-
/* @__PURE__ */ e(
|
|
1412
|
-
|
|
1396
|
+
calendar: i.language === "fa" ? "persian" : "gregory"
|
|
1397
|
+
}).format(new Date(s));
|
|
1398
|
+
return /* @__PURE__ */ e(je, { children: /* @__PURE__ */ r(xa, { collapsible: "icon", side: a, children: [
|
|
1399
|
+
/* @__PURE__ */ e(Na, { className: "custom-scrollbar", children: /* @__PURE__ */ r(ka, { children: [
|
|
1400
|
+
/* @__PURE__ */ e(Ee, { className: "mt-2 mb-6 px-2 group-data-[collapsible=icon]:px-0", children: /* @__PURE__ */ e(Le, { className: "group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:justify-center", children: /* @__PURE__ */ e(
|
|
1401
|
+
Ae,
|
|
1413
1402
|
{
|
|
1414
1403
|
asChild: !0,
|
|
1415
1404
|
tooltip: t("tooltip_new_conversation"),
|
|
1416
1405
|
className: "h-[52px] rounded-2xl bg-white/40 dark:bg-white/5 border border-border/40 hover:border-primary/50 hover:bg-white/90 dark:hover:bg-white/10 text-foreground shadow-[0_4px_12px_-4px_rgba(0,0,0,0.1)] hover:shadow-[0_12px_30px_-10px_var(--glow)] transition-all duration-500 group-data-[collapsible=icon]:size-10 group-data-[collapsible=icon]:p-0! mb-2 group/new-chat overflow-hidden backdrop-blur-md group-data-[collapsible=icon]:mx-auto",
|
|
1417
|
-
children: /* @__PURE__ */
|
|
1406
|
+
children: /* @__PURE__ */ r(
|
|
1418
1407
|
"a",
|
|
1419
1408
|
{
|
|
1420
|
-
href:
|
|
1421
|
-
onClick: (
|
|
1409
|
+
href: be(c, "/"),
|
|
1410
|
+
onClick: (s) => I(s, "/"),
|
|
1422
1411
|
className: "px-5 group-data-[collapsible=icon]:px-0 group-data-[collapsible=icon]:justify-center flex items-center gap-3 active:scale-[0.96] w-full h-full relative",
|
|
1423
1412
|
children: [
|
|
1424
1413
|
/* @__PURE__ */ e("div", { className: "absolute inset-0 bg-linear-to-tr from-primary/10 via-transparent to-primary/5 opacity-0 group-hover/new-chat:opacity-100 transition-opacity duration-700" }),
|
|
1425
|
-
/* @__PURE__ */ e("div", { className: "relative size-8 rounded-xl bg-linear-to-br from-primary/20 to-primary/5 flex items-center justify-center shrink-0 group-hover/new-chat:from-primary/30 group-hover/new-chat:to-primary/10 transition-all duration-500 shadow-inner", children: /* @__PURE__ */ e(
|
|
1414
|
+
/* @__PURE__ */ e("div", { className: "relative size-8 rounded-xl bg-linear-to-br from-primary/20 to-primary/5 flex items-center justify-center shrink-0 group-hover/new-chat:from-primary/30 group-hover/new-chat:to-primary/10 transition-all duration-500 shadow-inner", children: /* @__PURE__ */ e(qt, { className: "size-5! text-primary transition-all duration-700 group-hover/new-chat:rotate-180 group-hover/new-chat:scale-110" }) }),
|
|
1426
1415
|
/* @__PURE__ */ e("span", { className: "font-bold text-[0.95rem] group-data-[collapsible=icon]:hidden tracking-tight bg-clip-text text-foreground/90 group-hover/new-chat:text-foreground transition-colors", children: t("new_conversation") })
|
|
1427
1416
|
]
|
|
1428
1417
|
}
|
|
1429
1418
|
)
|
|
1430
1419
|
}
|
|
1431
1420
|
) }) }),
|
|
1432
|
-
|
|
1433
|
-
/* @__PURE__ */ e(
|
|
1421
|
+
P && /* @__PURE__ */ e(Ie, { className: "group-data-[collapsible=icon]:hidden mb-6 px-2", children: /* @__PURE__ */ r("div", { className: "relative group/search", children: [
|
|
1422
|
+
/* @__PURE__ */ e(Ft, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 opacity-40 group-focus-within/search:opacity-70 transition-opacity" }),
|
|
1434
1423
|
/* @__PURE__ */ e(
|
|
1435
|
-
|
|
1424
|
+
V,
|
|
1436
1425
|
{
|
|
1437
1426
|
placeholder: t("search_conversations"),
|
|
1438
|
-
value:
|
|
1439
|
-
onChange: (
|
|
1427
|
+
value: E,
|
|
1428
|
+
onChange: (s) => G(s.target.value),
|
|
1440
1429
|
className: "pl-9 h-10 bg-accent/15 border border-border/40 focus-visible:ring-primary/20 rounded-xl transition-all"
|
|
1441
1430
|
}
|
|
1442
1431
|
)
|
|
1443
1432
|
] }) }),
|
|
1444
|
-
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
|
|
1447
|
-
const
|
|
1448
|
-
return /* @__PURE__ */ e(
|
|
1433
|
+
P && /* @__PURE__ */ r(Ie, { className: "group-data-[collapsible=icon]:hidden", children: [
|
|
1434
|
+
/* @__PURE__ */ r(Ee, { children: [
|
|
1435
|
+
W.map((s, H) => {
|
|
1436
|
+
const fe = K === s.id, Se = Pe(s.firstMessage ?? ""), We = Se === "rtl";
|
|
1437
|
+
return /* @__PURE__ */ e(Le, { className: "group/sidebar-menu-item relative", children: fe ? /* @__PURE__ */ r("div", { className: "flex items-center gap-1 px-2 py-1.5 w-full", children: [
|
|
1449
1438
|
/* @__PURE__ */ e(
|
|
1450
|
-
|
|
1439
|
+
V,
|
|
1451
1440
|
{
|
|
1452
|
-
ref:
|
|
1453
|
-
value:
|
|
1454
|
-
onChange: (
|
|
1455
|
-
onKeyDown: (
|
|
1456
|
-
|
|
1441
|
+
ref: T,
|
|
1442
|
+
value: n,
|
|
1443
|
+
onChange: (ie) => w(ie.target.value),
|
|
1444
|
+
onKeyDown: (ie) => {
|
|
1445
|
+
ie.key === "Enter" && re(), ie.key === "Escape" && se();
|
|
1457
1446
|
},
|
|
1458
1447
|
className: "h-8 py-0 px-2 text-sm",
|
|
1459
|
-
dir:
|
|
1448
|
+
dir: Pe(n)
|
|
1460
1449
|
}
|
|
1461
1450
|
),
|
|
1462
|
-
/* @__PURE__ */ e(
|
|
1463
|
-
/* @__PURE__ */ e(
|
|
1464
|
-
] }) : /* @__PURE__ */
|
|
1451
|
+
/* @__PURE__ */ e(Z, { size: "icon", variant: "ghost", className: "size-8 shrink-0 text-green-600 hover:text-green-700 hover:bg-green-50", onClick: re, children: /* @__PURE__ */ e(jt, { className: "size-4" }) }),
|
|
1452
|
+
/* @__PURE__ */ e(Z, { size: "icon", variant: "ghost", className: "size-8 shrink-0 text-destructive hover:bg-destructive/10", onClick: se, children: /* @__PURE__ */ e(Ot, { className: "size-4" }) })
|
|
1453
|
+
] }) : /* @__PURE__ */ r(ke, { children: [
|
|
1465
1454
|
/* @__PURE__ */ e(
|
|
1466
|
-
|
|
1455
|
+
Ae,
|
|
1467
1456
|
{
|
|
1468
1457
|
asChild: !0,
|
|
1469
|
-
className:
|
|
1470
|
-
"bg-accent opacity-100 pointer-events-none":
|
|
1471
|
-
"opacity-70 hover:opacity-100":
|
|
1458
|
+
className: f("h-auto py-2.5 px-3", {
|
|
1459
|
+
"bg-accent opacity-100 pointer-events-none": s.id === z,
|
|
1460
|
+
"opacity-70 hover:opacity-100": s.id !== z
|
|
1472
1461
|
}),
|
|
1473
|
-
children: /* @__PURE__ */
|
|
1462
|
+
children: /* @__PURE__ */ r(
|
|
1474
1463
|
"a",
|
|
1475
1464
|
{
|
|
1476
|
-
href:
|
|
1477
|
-
onClick: (
|
|
1478
|
-
dir:
|
|
1479
|
-
className:
|
|
1465
|
+
href: be(c, s.id),
|
|
1466
|
+
onClick: (ie) => I(ie, s.id),
|
|
1467
|
+
dir: Se,
|
|
1468
|
+
className: f("flex flex-col gap-0.5 w-full overflow-hidden", We ? "items-end" : "items-start"),
|
|
1480
1469
|
children: [
|
|
1481
|
-
/* @__PURE__ */ e("span", { className:
|
|
1482
|
-
/* @__PURE__ */ e("div", { className:
|
|
1470
|
+
/* @__PURE__ */ e("span", { className: f("truncate w-full font-medium text-[0.9375rem]", i.language === "fa" ? "pl-16 text-right" : "pr-16 text-left"), children: s.firstMessage }),
|
|
1471
|
+
/* @__PURE__ */ e("div", { className: f("text-[10px] opacity-40 w-full", i.language === "fa" ? "pl-16 text-right" : "pr-16 text-left"), children: F(s.timestamp) })
|
|
1483
1472
|
]
|
|
1484
1473
|
}
|
|
1485
1474
|
)
|
|
1486
1475
|
}
|
|
1487
1476
|
),
|
|
1488
|
-
/* @__PURE__ */
|
|
1477
|
+
/* @__PURE__ */ r("div", { className: f(
|
|
1489
1478
|
"absolute top-1/2 -translate-y-1/2 flex items-center gap-1 transition-all duration-200 z-10",
|
|
1490
|
-
|
|
1479
|
+
i.language === "fa" ? "left-2" : "right-1.5"
|
|
1491
1480
|
), children: [
|
|
1492
|
-
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
/* @__PURE__ */ e(
|
|
1495
|
-
|
|
1481
|
+
s.pinned && /* @__PURE__ */ e(De, { className: "size-3.5 text-primary opacity-70 md:absolute md:inset-0 md:m-auto md:group-hover/sidebar-menu-item:opacity-0 transition-opacity pointer-events-none" }),
|
|
1482
|
+
/* @__PURE__ */ r(ct, { dir: i.language === "fa" ? "rtl" : "ltr", children: [
|
|
1483
|
+
/* @__PURE__ */ e(dt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1484
|
+
Z,
|
|
1496
1485
|
{
|
|
1497
1486
|
variant: "ghost",
|
|
1498
1487
|
size: "icon",
|
|
1499
1488
|
className: "size-7 rounded-full opacity-100 md:opacity-0 md:group-hover/sidebar-menu-item:opacity-100 hover:bg-accent hover:text-accent-foreground data-[state=open]:opacity-100 transition-all",
|
|
1500
|
-
children: /* @__PURE__ */ e(
|
|
1489
|
+
children: /* @__PURE__ */ e($t, { className: "size-3.5" })
|
|
1501
1490
|
}
|
|
1502
1491
|
) }),
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
|
|
1492
|
+
/* @__PURE__ */ r(
|
|
1493
|
+
ut,
|
|
1505
1494
|
{
|
|
1506
1495
|
align: "end",
|
|
1507
1496
|
className: "min-w-[120px] p-1",
|
|
1508
1497
|
children: [
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
/* @__PURE__ */ e("span", { children:
|
|
1498
|
+
v?.showPin !== !1 && /* @__PURE__ */ r(de, { onSelect: () => k(s), className: "cursor-pointer flex items-center gap-2", children: [
|
|
1499
|
+
s.pinned ? /* @__PURE__ */ e(Bt, { className: "size-4" }) : /* @__PURE__ */ e(De, { className: "size-4" }),
|
|
1500
|
+
/* @__PURE__ */ e("span", { children: s.pinned ? t("unpin_conversation") : t("pin_conversation") })
|
|
1512
1501
|
] }),
|
|
1513
|
-
|
|
1514
|
-
/* @__PURE__ */ e(
|
|
1502
|
+
v?.showShare !== !1 && /* @__PURE__ */ r(de, { onSelect: () => R(s), className: "cursor-pointer flex items-center gap-2", children: [
|
|
1503
|
+
/* @__PURE__ */ e(Ut, { className: "size-4" }),
|
|
1515
1504
|
/* @__PURE__ */ e("span", { children: t("share_conversation") })
|
|
1516
1505
|
] }),
|
|
1517
|
-
(
|
|
1518
|
-
/* @__PURE__ */ e(
|
|
1506
|
+
(v?.showRename ?? !1) && /* @__PURE__ */ r(de, { onSelect: () => X(s), className: "cursor-pointer flex items-center gap-2", children: [
|
|
1507
|
+
/* @__PURE__ */ e(Kt, { className: "size-4" }),
|
|
1519
1508
|
/* @__PURE__ */ e("span", { children: t("rename_conversation") })
|
|
1520
1509
|
] }),
|
|
1521
|
-
(
|
|
1510
|
+
(v?.showDelete ?? !1) && /* @__PURE__ */ r(
|
|
1522
1511
|
de,
|
|
1523
1512
|
{
|
|
1524
1513
|
className: "text-destructive focus:text-destructive focus:bg-destructive/10 cursor-pointer flex items-center gap-2",
|
|
1525
|
-
onSelect: () =>
|
|
1514
|
+
onSelect: () => oe(s),
|
|
1526
1515
|
children: [
|
|
1527
|
-
/* @__PURE__ */ e(
|
|
1516
|
+
/* @__PURE__ */ e(Ht, { className: "size-4" }),
|
|
1528
1517
|
/* @__PURE__ */ e("span", { children: t("delete_conversation") })
|
|
1529
1518
|
]
|
|
1530
1519
|
}
|
|
@@ -1534,67 +1523,67 @@ function Sa({ side: r = "left" }) {
|
|
|
1534
1523
|
)
|
|
1535
1524
|
] })
|
|
1536
1525
|
] })
|
|
1537
|
-
] }) },
|
|
1526
|
+
] }) }, H);
|
|
1538
1527
|
}),
|
|
1539
|
-
!
|
|
1528
|
+
!N && S.length === 0 && !E && /* @__PURE__ */ e("div", { className: "px-4 py-8 text-center text-sm opacity-40", children: t("no_conversations") })
|
|
1540
1529
|
] }),
|
|
1541
|
-
/* @__PURE__ */ e("div", { ref:
|
|
1542
|
-
m && /* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ e("div", { ref: g, className: "h-4 w-full" }),
|
|
1531
|
+
m && /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 p-4 pt-0 opacity-60", children: [
|
|
1543
1532
|
/* @__PURE__ */ e("div", { className: "size-4 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
|
|
1544
1533
|
/* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-wider font-medium", children: t("loading_more") })
|
|
1545
1534
|
] })
|
|
1546
1535
|
] })
|
|
1547
1536
|
] }) }),
|
|
1548
|
-
/* @__PURE__ */ e(
|
|
1549
|
-
/* @__PURE__ */ e(
|
|
1550
|
-
|
|
1537
|
+
/* @__PURE__ */ e(wa, {}),
|
|
1538
|
+
/* @__PURE__ */ e(Ke, { open: D, onOpenChange: j, children: /* @__PURE__ */ r(
|
|
1539
|
+
He,
|
|
1551
1540
|
{
|
|
1552
|
-
onKeyDown: (
|
|
1553
|
-
|
|
1541
|
+
onKeyDown: (s) => {
|
|
1542
|
+
s.key === "Enter" && (s.preventDefault(), o());
|
|
1554
1543
|
},
|
|
1555
1544
|
children: [
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */ e(
|
|
1558
|
-
/* @__PURE__ */ e(
|
|
1545
|
+
/* @__PURE__ */ r(mt, { children: [
|
|
1546
|
+
/* @__PURE__ */ e(ht, { children: t("delete_confirm_title") }),
|
|
1547
|
+
/* @__PURE__ */ e(pt, { children: t("delete_confirm_description") })
|
|
1559
1548
|
] }),
|
|
1560
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ r(gt, { children: [
|
|
1561
1550
|
/* @__PURE__ */ e(
|
|
1562
|
-
|
|
1551
|
+
Z,
|
|
1563
1552
|
{
|
|
1564
1553
|
variant: "outline",
|
|
1565
1554
|
onClick: () => {
|
|
1566
|
-
|
|
1555
|
+
j(!1);
|
|
1567
1556
|
},
|
|
1568
1557
|
children: t("cancel")
|
|
1569
1558
|
}
|
|
1570
1559
|
),
|
|
1571
|
-
/* @__PURE__ */ e(
|
|
1560
|
+
/* @__PURE__ */ e(Z, { variant: "destructive", onClick: o, autoFocus: !0, children: t("delete") })
|
|
1572
1561
|
] })
|
|
1573
1562
|
]
|
|
1574
1563
|
}
|
|
1575
1564
|
) })
|
|
1576
1565
|
] }) });
|
|
1577
1566
|
}
|
|
1578
|
-
function
|
|
1579
|
-
const { config:
|
|
1580
|
-
return /* @__PURE__ */
|
|
1581
|
-
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
t !== void 0 ? t : /* @__PURE__ */ e(
|
|
1567
|
+
function Qa({ sidebar: a, header: t, components: i, classNames: u, disclaimer: l, welcome: d }) {
|
|
1568
|
+
const { config: h } = Fe(), { history: p } = te(), m = h?.language === "fa" ? "right" : "left", N = p?.enabled ?? !0;
|
|
1569
|
+
return /* @__PURE__ */ r(va, { defaultOpen: N, children: [
|
|
1570
|
+
a !== void 0 ? a : N ? /* @__PURE__ */ e(Ma, { side: m }) : null,
|
|
1571
|
+
/* @__PURE__ */ r("div", { className: "flex flex-col flex-1 h-dvh overflow-hidden relative", children: [
|
|
1572
|
+
t !== void 0 ? t : /* @__PURE__ */ e(Ve, {}),
|
|
1584
1573
|
/* @__PURE__ */ e(
|
|
1585
1574
|
"div",
|
|
1586
1575
|
{
|
|
1587
|
-
className:
|
|
1576
|
+
className: f(
|
|
1588
1577
|
"flex flex-col relative w-full flex-1 min-h-0 overflow-hidden",
|
|
1589
1578
|
"has-[.stick-to-bottom:empty]:overflow-visible has-[.stick-to-bottom:empty]:flex-initial transition-[flex] duration-200"
|
|
1590
1579
|
),
|
|
1591
1580
|
children: /* @__PURE__ */ e(
|
|
1592
|
-
|
|
1581
|
+
na,
|
|
1593
1582
|
{
|
|
1594
|
-
components:
|
|
1595
|
-
classNames:
|
|
1596
|
-
disclaimer:
|
|
1597
|
-
welcome:
|
|
1583
|
+
components: i,
|
|
1584
|
+
classNames: u,
|
|
1585
|
+
disclaimer: l,
|
|
1586
|
+
welcome: d
|
|
1598
1587
|
}
|
|
1599
1588
|
)
|
|
1600
1589
|
}
|
|
@@ -1602,78 +1591,79 @@ function Ka({ sidebar: r, header: t, components: o, classNames: d, disclaimer: i
|
|
|
1602
1591
|
] })
|
|
1603
1592
|
] });
|
|
1604
1593
|
}
|
|
1605
|
-
function
|
|
1606
|
-
const [t,
|
|
1594
|
+
function Ga({ children: a }) {
|
|
1595
|
+
const [t, i] = _(null), u = Qe(), l = Ce(), d = pe();
|
|
1607
1596
|
return $(() => {
|
|
1608
1597
|
(async () => {
|
|
1609
|
-
const p = new URLSearchParams(
|
|
1610
|
-
if (
|
|
1598
|
+
const p = new URLSearchParams(u.search), m = p.get("token");
|
|
1599
|
+
if (m)
|
|
1611
1600
|
try {
|
|
1612
|
-
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1601
|
+
M.setToken(m), await M.getBalance(), p.delete("token");
|
|
1602
|
+
const v = p.toString(), y = u.pathname + (v ? `?${v}` : "");
|
|
1603
|
+
l(y, { replace: !0 }), i(!0);
|
|
1615
1604
|
return;
|
|
1616
|
-
} catch (
|
|
1617
|
-
console.error("Error validating token from URL:",
|
|
1605
|
+
} catch (v) {
|
|
1606
|
+
console.error("Error validating token from URL:", v), i(!1);
|
|
1618
1607
|
return;
|
|
1619
1608
|
}
|
|
1620
|
-
if (!
|
|
1621
|
-
|
|
1609
|
+
if (!M.getToken()) {
|
|
1610
|
+
i(!1);
|
|
1622
1611
|
return;
|
|
1623
1612
|
}
|
|
1624
1613
|
try {
|
|
1625
|
-
await
|
|
1626
|
-
} catch (
|
|
1627
|
-
console.error("Token validation failed:",
|
|
1614
|
+
await M.getBalance(), i(!0);
|
|
1615
|
+
} catch (v) {
|
|
1616
|
+
console.error("Token validation failed:", v), v.status === 401 ? (M.clearToken(), d.clear(), i(!1)) : i(!0);
|
|
1628
1617
|
}
|
|
1629
1618
|
})();
|
|
1630
|
-
}, [
|
|
1619
|
+
}, [u.search, l, u.pathname, d]), t === null ? /* @__PURE__ */ e("div", { className: "flex h-screen w-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "size-8 rounded-full border-4 border-primary border-t-transparent animate-spin" }) }) : t ? /* @__PURE__ */ e(ke, { children: a }) : /* @__PURE__ */ e(Xt, { to: "/login", replace: !0 });
|
|
1631
1620
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1621
|
+
const Re = (a) => a.replace(/[^0-9]/g, "");
|
|
1622
|
+
function Va() {
|
|
1623
|
+
const { t: a, i18n: t } = ce(["login", "translation"]), { app: i } = te(), u = t.dir() === "rtl", l = u ? "text-right" : "text-left", d = Ce(), h = pe(), [p, m] = _("login"), [N, v] = _(""), [y, c] = _(""), [P, S] = _(""), [z, B] = _(""), [C, x] = _(""), [g, L] = _(""), q = O(() => i?.userMetadataFields?.filter((n) => n.showInSignup) || [], [i?.userMetadataFields]), [D, j] = _(() => {
|
|
1624
|
+
const n = {};
|
|
1625
|
+
return q.forEach((w) => {
|
|
1626
|
+
w.defaultValue !== void 0 && (n[w.key] = w.defaultValue);
|
|
1627
|
+
}), n;
|
|
1638
1628
|
});
|
|
1639
1629
|
$(() => {
|
|
1640
|
-
const
|
|
1641
|
-
let
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
}),
|
|
1645
|
-
}, [
|
|
1646
|
-
const [
|
|
1647
|
-
|
|
1630
|
+
const n = { ...D };
|
|
1631
|
+
let w = !1;
|
|
1632
|
+
q.forEach((T) => {
|
|
1633
|
+
T.condition && !he(T.condition, D) && n[T.key] !== void 0 && (delete n[T.key], w = !0);
|
|
1634
|
+
}), w && j(n);
|
|
1635
|
+
}, [D, q]);
|
|
1636
|
+
const [U, A] = _(""), [E, G] = _(!1), K = async (n) => {
|
|
1637
|
+
n.preventDefault(), A(""), G(!0);
|
|
1648
1638
|
try {
|
|
1649
|
-
await
|
|
1650
|
-
} catch (
|
|
1651
|
-
|
|
1639
|
+
await M.login(N, y), h.clear(), d("/");
|
|
1640
|
+
} catch (w) {
|
|
1641
|
+
A(le(w, a));
|
|
1652
1642
|
} finally {
|
|
1653
|
-
|
|
1643
|
+
G(!1);
|
|
1654
1644
|
}
|
|
1655
|
-
},
|
|
1656
|
-
|
|
1645
|
+
}, b = async (n) => {
|
|
1646
|
+
n.preventDefault(), A(""), G(!0);
|
|
1657
1647
|
try {
|
|
1658
|
-
await
|
|
1659
|
-
} catch (
|
|
1660
|
-
|
|
1648
|
+
await M.register(P, z, C, g, D), h.clear(), d("/");
|
|
1649
|
+
} catch (w) {
|
|
1650
|
+
A(le(w, a));
|
|
1661
1651
|
} finally {
|
|
1662
|
-
|
|
1652
|
+
G(!1);
|
|
1663
1653
|
}
|
|
1664
1654
|
};
|
|
1665
|
-
return /* @__PURE__ */ e("div", { className: "min-h-screen bg-background flex flex-col items-center justify-center p-4", dir: t.dir(), children: /* @__PURE__ */
|
|
1666
|
-
/* @__PURE__ */ e("div", { className: "text-center mb-6", children: /* @__PURE__ */ e("h1", { className: "text-2xl font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent", children:
|
|
1667
|
-
/* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ e("div", { className: "min-h-screen bg-background flex flex-col items-center justify-center p-4", dir: t.dir(), children: /* @__PURE__ */ r("div", { className: "w-full max-w-md bg-card border border-border rounded-xl shadow-lg p-6", children: [
|
|
1656
|
+
/* @__PURE__ */ e("div", { className: "text-center mb-6", children: /* @__PURE__ */ e("h1", { className: "text-2xl font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent", children: i?.name }) }),
|
|
1657
|
+
/* @__PURE__ */ r("div", { className: "flex bg-muted p-1 rounded-lg mb-6", children: [
|
|
1668
1658
|
/* @__PURE__ */ e(
|
|
1669
1659
|
"button",
|
|
1670
1660
|
{
|
|
1671
1661
|
type: "button",
|
|
1672
1662
|
onClick: () => {
|
|
1673
|
-
|
|
1663
|
+
m("login"), A("");
|
|
1674
1664
|
},
|
|
1675
1665
|
className: `flex-1 py-2 text-sm font-medium rounded-md transition-all ${p === "login" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
1676
|
-
children:
|
|
1666
|
+
children: a("login_tab", "Login")
|
|
1677
1667
|
}
|
|
1678
1668
|
),
|
|
1679
1669
|
/* @__PURE__ */ e(
|
|
@@ -1681,39 +1671,39 @@ function Qa() {
|
|
|
1681
1671
|
{
|
|
1682
1672
|
type: "button",
|
|
1683
1673
|
onClick: () => {
|
|
1684
|
-
|
|
1674
|
+
m("register"), A("");
|
|
1685
1675
|
},
|
|
1686
1676
|
className: `flex-1 py-2 text-sm font-medium rounded-md transition-all ${p === "register" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
1687
|
-
children:
|
|
1677
|
+
children: a("signup_tab", "Sign Up")
|
|
1688
1678
|
}
|
|
1689
1679
|
)
|
|
1690
1680
|
] }),
|
|
1691
|
-
p === "login" && /* @__PURE__ */
|
|
1692
|
-
/* @__PURE__ */
|
|
1693
|
-
/* @__PURE__ */ e(Q, { htmlFor: "login-phone", children:
|
|
1681
|
+
p === "login" && /* @__PURE__ */ r("form", { onSubmit: K, className: "space-y-4", children: [
|
|
1682
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1683
|
+
/* @__PURE__ */ e(Q, { htmlFor: "login-phone", children: a("phone", "Phone") }),
|
|
1694
1684
|
/* @__PURE__ */ e(
|
|
1695
|
-
|
|
1685
|
+
V,
|
|
1696
1686
|
{
|
|
1697
1687
|
id: "login-phone",
|
|
1698
1688
|
type: "tel",
|
|
1699
|
-
value:
|
|
1700
|
-
onChange: (
|
|
1689
|
+
value: N,
|
|
1690
|
+
onChange: (n) => v(Re(n.target.value)),
|
|
1701
1691
|
required: !0,
|
|
1702
1692
|
className: "text-left",
|
|
1703
|
-
placeholder:
|
|
1693
|
+
placeholder: a("phone_placeholder", "Phone number"),
|
|
1704
1694
|
dir: "ltr"
|
|
1705
1695
|
}
|
|
1706
1696
|
)
|
|
1707
1697
|
] }),
|
|
1708
|
-
/* @__PURE__ */
|
|
1709
|
-
/* @__PURE__ */ e(Q, { htmlFor: "login-pass", children:
|
|
1698
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1699
|
+
/* @__PURE__ */ e(Q, { htmlFor: "login-pass", children: a("password", "Password") }),
|
|
1710
1700
|
/* @__PURE__ */ e(
|
|
1711
|
-
|
|
1701
|
+
V,
|
|
1712
1702
|
{
|
|
1713
1703
|
id: "login-pass",
|
|
1714
1704
|
type: "password",
|
|
1715
|
-
value:
|
|
1716
|
-
onChange: (
|
|
1705
|
+
value: y,
|
|
1706
|
+
onChange: (n) => c(n.target.value),
|
|
1717
1707
|
required: !0,
|
|
1718
1708
|
className: "text-left",
|
|
1719
1709
|
placeholder: "••••••••",
|
|
@@ -1721,43 +1711,43 @@ function Qa() {
|
|
|
1721
1711
|
}
|
|
1722
1712
|
)
|
|
1723
1713
|
] }),
|
|
1724
|
-
|
|
1714
|
+
U && /* @__PURE__ */ e("div", { className: "text-sm text-destructive", children: U }),
|
|
1725
1715
|
/* @__PURE__ */ e(
|
|
1726
|
-
|
|
1716
|
+
Z,
|
|
1727
1717
|
{
|
|
1728
1718
|
type: "submit",
|
|
1729
|
-
disabled:
|
|
1719
|
+
disabled: E,
|
|
1730
1720
|
className: "w-full font-semibold",
|
|
1731
|
-
children:
|
|
1721
|
+
children: E ? a("logging_in", "Logging in...") : a("login_button", "Login")
|
|
1732
1722
|
}
|
|
1733
1723
|
)
|
|
1734
1724
|
] }),
|
|
1735
|
-
p === "register" && /* @__PURE__ */
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
/* @__PURE__ */ e(Q, { htmlFor: "reg-phone", children:
|
|
1725
|
+
p === "register" && /* @__PURE__ */ r("form", { onSubmit: b, className: "space-y-4", children: [
|
|
1726
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1727
|
+
/* @__PURE__ */ e(Q, { htmlFor: "reg-phone", children: a("phone", "Phone") }),
|
|
1738
1728
|
/* @__PURE__ */ e(
|
|
1739
|
-
|
|
1729
|
+
V,
|
|
1740
1730
|
{
|
|
1741
1731
|
id: "reg-phone",
|
|
1742
1732
|
type: "tel",
|
|
1743
|
-
value:
|
|
1744
|
-
onChange: (
|
|
1733
|
+
value: P,
|
|
1734
|
+
onChange: (n) => S(Re(n.target.value)),
|
|
1745
1735
|
required: !0,
|
|
1746
1736
|
className: "text-left",
|
|
1747
|
-
placeholder:
|
|
1737
|
+
placeholder: a("phone_placeholder", "Phone number"),
|
|
1748
1738
|
dir: "ltr"
|
|
1749
1739
|
}
|
|
1750
1740
|
)
|
|
1751
1741
|
] }),
|
|
1752
|
-
/* @__PURE__ */
|
|
1753
|
-
/* @__PURE__ */ e(Q, { htmlFor: "reg-pass", children:
|
|
1742
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1743
|
+
/* @__PURE__ */ e(Q, { htmlFor: "reg-pass", children: a("password", "Password") }),
|
|
1754
1744
|
/* @__PURE__ */ e(
|
|
1755
|
-
|
|
1745
|
+
V,
|
|
1756
1746
|
{
|
|
1757
1747
|
id: "reg-pass",
|
|
1758
1748
|
type: "password",
|
|
1759
|
-
value:
|
|
1760
|
-
onChange: (
|
|
1749
|
+
value: z,
|
|
1750
|
+
onChange: (n) => B(n.target.value),
|
|
1761
1751
|
required: !0,
|
|
1762
1752
|
className: "text-left",
|
|
1763
1753
|
placeholder: "••••••••",
|
|
@@ -1765,128 +1755,128 @@ function Qa() {
|
|
|
1765
1755
|
}
|
|
1766
1756
|
)
|
|
1767
1757
|
] }),
|
|
1768
|
-
/* @__PURE__ */
|
|
1769
|
-
/* @__PURE__ */
|
|
1770
|
-
/* @__PURE__ */ e(Q, { htmlFor: "reg-name", children:
|
|
1758
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
1759
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1760
|
+
/* @__PURE__ */ e(Q, { htmlFor: "reg-name", children: a("name", "Name") }),
|
|
1771
1761
|
/* @__PURE__ */ e(
|
|
1772
|
-
|
|
1762
|
+
V,
|
|
1773
1763
|
{
|
|
1774
1764
|
id: "reg-name",
|
|
1775
1765
|
type: "text",
|
|
1776
|
-
value:
|
|
1777
|
-
onChange: (
|
|
1766
|
+
value: C,
|
|
1767
|
+
onChange: (n) => x(n.target.value),
|
|
1778
1768
|
required: !0,
|
|
1779
|
-
className:
|
|
1780
|
-
placeholder:
|
|
1769
|
+
className: l,
|
|
1770
|
+
placeholder: a("name_placeholder", "First Name")
|
|
1781
1771
|
}
|
|
1782
1772
|
)
|
|
1783
1773
|
] }),
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */ e(Q, { htmlFor: "reg-surname", children:
|
|
1774
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1775
|
+
/* @__PURE__ */ e(Q, { htmlFor: "reg-surname", children: a("surname", "Surname") }),
|
|
1786
1776
|
/* @__PURE__ */ e(
|
|
1787
|
-
|
|
1777
|
+
V,
|
|
1788
1778
|
{
|
|
1789
1779
|
id: "reg-surname",
|
|
1790
1780
|
type: "text",
|
|
1791
|
-
value:
|
|
1792
|
-
onChange: (
|
|
1781
|
+
value: g,
|
|
1782
|
+
onChange: (n) => L(n.target.value),
|
|
1793
1783
|
required: !0,
|
|
1794
|
-
className:
|
|
1795
|
-
placeholder:
|
|
1784
|
+
className: l,
|
|
1785
|
+
placeholder: a("surname_placeholder", "Last Name")
|
|
1796
1786
|
}
|
|
1797
1787
|
)
|
|
1798
1788
|
] })
|
|
1799
1789
|
] }),
|
|
1800
|
-
|
|
1801
|
-
/* @__PURE__ */ e(Q, { htmlFor: `signup-${
|
|
1802
|
-
|
|
1803
|
-
|
|
1790
|
+
q.map((n) => he(n.condition, D) ? /* @__PURE__ */ r("div", { className: "space-y-3 animate-in fade-in slide-in-from-top-1 duration-200", children: [
|
|
1791
|
+
/* @__PURE__ */ e(Q, { htmlFor: `signup-${n.key}`, children: a(n.label) }),
|
|
1792
|
+
n.type === "select" ? /* @__PURE__ */ r(
|
|
1793
|
+
ve,
|
|
1804
1794
|
{
|
|
1805
|
-
value: String(
|
|
1806
|
-
onValueChange: (
|
|
1807
|
-
required:
|
|
1808
|
-
dir:
|
|
1795
|
+
value: String(D[n.key] || ""),
|
|
1796
|
+
onValueChange: (w) => j({ ...D, [n.key]: w }),
|
|
1797
|
+
required: n.required,
|
|
1798
|
+
dir: u ? "rtl" : "ltr",
|
|
1809
1799
|
children: [
|
|
1810
|
-
/* @__PURE__ */ e(
|
|
1811
|
-
/* @__PURE__ */ e(
|
|
1800
|
+
/* @__PURE__ */ e(xe, { className: f("bg-background", l), children: /* @__PURE__ */ e(ye, { placeholder: a(n.placeholder || "select_placeholder") }) }),
|
|
1801
|
+
/* @__PURE__ */ e(we, { className: "rounded-xl", children: n.options?.map((w) => /* @__PURE__ */ e(me, { value: String(w.value), children: a(w.label) }, String(w.value))) })
|
|
1812
1802
|
]
|
|
1813
1803
|
}
|
|
1814
|
-
) :
|
|
1804
|
+
) : n.type === "checkbox" ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 py-2", children: [
|
|
1815
1805
|
/* @__PURE__ */ e(
|
|
1816
|
-
|
|
1806
|
+
ft,
|
|
1817
1807
|
{
|
|
1818
|
-
id: `signup-${
|
|
1819
|
-
checked: !!
|
|
1820
|
-
onCheckedChange: (
|
|
1821
|
-
required:
|
|
1808
|
+
id: `signup-${n.key}`,
|
|
1809
|
+
checked: !!D[n.key],
|
|
1810
|
+
onCheckedChange: (w) => j({ ...D, [n.key]: !!w }),
|
|
1811
|
+
required: n.required
|
|
1822
1812
|
}
|
|
1823
1813
|
),
|
|
1824
|
-
/* @__PURE__ */ e("label", { htmlFor: `signup-${
|
|
1814
|
+
/* @__PURE__ */ e("label", { htmlFor: `signup-${n.key}`, className: "text-sm text-muted-foreground cursor-pointer select-none", children: a(n.placeholder || n.label) })
|
|
1825
1815
|
] }) : /* @__PURE__ */ e(
|
|
1826
|
-
|
|
1816
|
+
V,
|
|
1827
1817
|
{
|
|
1828
|
-
id: `signup-${
|
|
1829
|
-
type:
|
|
1830
|
-
value:
|
|
1831
|
-
onChange: (
|
|
1832
|
-
required:
|
|
1833
|
-
className:
|
|
1834
|
-
placeholder:
|
|
1818
|
+
id: `signup-${n.key}`,
|
|
1819
|
+
type: n.type,
|
|
1820
|
+
value: D[n.key] || "",
|
|
1821
|
+
onChange: (w) => j({ ...D, [n.key]: w.target.value }),
|
|
1822
|
+
required: n.required,
|
|
1823
|
+
className: l,
|
|
1824
|
+
placeholder: a(n.placeholder || "")
|
|
1835
1825
|
}
|
|
1836
1826
|
)
|
|
1837
|
-
] },
|
|
1838
|
-
|
|
1827
|
+
] }, n.key) : null),
|
|
1828
|
+
U && /* @__PURE__ */ e("div", { className: "text-sm text-destructive", children: U }),
|
|
1839
1829
|
/* @__PURE__ */ e(
|
|
1840
|
-
|
|
1830
|
+
Z,
|
|
1841
1831
|
{
|
|
1842
1832
|
type: "submit",
|
|
1843
|
-
disabled:
|
|
1833
|
+
disabled: E,
|
|
1844
1834
|
className: "w-full font-semibold",
|
|
1845
|
-
children:
|
|
1835
|
+
children: E ? a("signing_up", "Signing up...") : a("signup_button", "Sign Up")
|
|
1846
1836
|
}
|
|
1847
1837
|
)
|
|
1848
1838
|
] })
|
|
1849
1839
|
] }) });
|
|
1850
1840
|
}
|
|
1851
|
-
function
|
|
1852
|
-
const { shareId:
|
|
1841
|
+
function Ta() {
|
|
1842
|
+
const { shareId: a } = Jt(), [t, i] = _(null), [u, l] = _(!0), [d, h] = _(null), { MessageList: p } = te(), m = ee(/* @__PURE__ */ new Set());
|
|
1853
1843
|
return $(() => () => {
|
|
1854
|
-
|
|
1844
|
+
m.current.forEach((N) => URL.revokeObjectURL(N)), m.current.clear();
|
|
1855
1845
|
}, []), $(() => {
|
|
1856
|
-
if (!
|
|
1846
|
+
if (!a) return;
|
|
1857
1847
|
(async () => {
|
|
1858
1848
|
try {
|
|
1859
|
-
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
if (!
|
|
1864
|
-
const
|
|
1865
|
-
|
|
1866
|
-
if (
|
|
1849
|
+
l(!0);
|
|
1850
|
+
const v = await M.getSharedThread(a);
|
|
1851
|
+
v.items && (v.items = await Promise.all(
|
|
1852
|
+
v.items.map(async (y) => {
|
|
1853
|
+
if (!y.parts) return y;
|
|
1854
|
+
const c = await Promise.all(
|
|
1855
|
+
y.parts.map(async (P) => {
|
|
1856
|
+
if (P.type === "file" && P.object_name && !P.url)
|
|
1867
1857
|
try {
|
|
1868
|
-
const
|
|
1869
|
-
return
|
|
1870
|
-
} catch (
|
|
1871
|
-
console.error("Failed to resolve shared attachment:",
|
|
1858
|
+
const S = await M.getPublicAttachmentBlobUrl(P.object_name);
|
|
1859
|
+
return m.current.add(S), { ...P, url: S };
|
|
1860
|
+
} catch (S) {
|
|
1861
|
+
console.error("Failed to resolve shared attachment:", P.object_name, S);
|
|
1872
1862
|
}
|
|
1873
|
-
return
|
|
1863
|
+
return P;
|
|
1874
1864
|
})
|
|
1875
1865
|
);
|
|
1876
|
-
return { ...
|
|
1866
|
+
return { ...y, parts: c };
|
|
1877
1867
|
})
|
|
1878
|
-
)),
|
|
1879
|
-
} catch (
|
|
1880
|
-
console.error("Failed to fetch shared chat:",
|
|
1868
|
+
)), i(v);
|
|
1869
|
+
} catch (v) {
|
|
1870
|
+
console.error("Failed to fetch shared chat:", v), h(v.message || "Failed to load shared chat");
|
|
1881
1871
|
} finally {
|
|
1882
|
-
|
|
1872
|
+
l(!1);
|
|
1883
1873
|
}
|
|
1884
1874
|
})();
|
|
1885
|
-
}, [
|
|
1875
|
+
}, [a]), u ? /* @__PURE__ */ e("div", { className: "flex h-dvh items-center justify-center", children: /* @__PURE__ */ e(bt, {}) }) : d || !t ? /* @__PURE__ */ r("div", { className: "flex h-dvh flex-col items-center justify-center p-4 text-center", children: [
|
|
1886
1876
|
/* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-destructive mb-2 font-display", children: "Shared Chat Not Found" }),
|
|
1887
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground max-w-md", children:
|
|
1888
|
-
] }) : /* @__PURE__ */
|
|
1889
|
-
/* @__PURE__ */ e(
|
|
1877
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground max-w-md", children: d || "This shared conversation might have been deleted or the link is invalid." })
|
|
1878
|
+
] }) : /* @__PURE__ */ r("div", { className: "relative flex flex-col h-dvh overflow-hidden bg-background", children: [
|
|
1879
|
+
/* @__PURE__ */ e(Ve, { hideActions: !0 }),
|
|
1890
1880
|
/* @__PURE__ */ e("div", { className: "flex-1 min-h-0 overflow-hidden relative flex flex-col", children: /* @__PURE__ */ e(
|
|
1891
1881
|
p,
|
|
1892
1882
|
{
|
|
@@ -1905,42 +1895,42 @@ function Pa() {
|
|
|
1905
1895
|
) })
|
|
1906
1896
|
] });
|
|
1907
1897
|
}
|
|
1908
|
-
function
|
|
1909
|
-
return /* @__PURE__ */ e(
|
|
1898
|
+
function Wa() {
|
|
1899
|
+
return /* @__PURE__ */ e(Ta, {});
|
|
1910
1900
|
}
|
|
1911
1901
|
export {
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1902
|
+
Ma as AppSidebar,
|
|
1903
|
+
na as Chat,
|
|
1904
|
+
Qa as ChatUI,
|
|
1905
|
+
rr as FilePart,
|
|
1906
|
+
Ha as GentiqProvider,
|
|
1907
|
+
nr as MessageList,
|
|
1908
|
+
sr as Part,
|
|
1909
|
+
or as PromptInputArea,
|
|
1910
|
+
ir as ReasoningPart,
|
|
1911
|
+
Ga as RequireAuth,
|
|
1912
|
+
ve as Select,
|
|
1913
|
+
we as SelectContent,
|
|
1914
|
+
lr as SelectGroup,
|
|
1925
1915
|
me as SelectItem,
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1916
|
+
cr as SelectLabel,
|
|
1917
|
+
dr as SelectScrollDownButton,
|
|
1918
|
+
ur as SelectScrollUpButton,
|
|
1919
|
+
mr as SelectSeparator,
|
|
1920
|
+
xe as SelectTrigger,
|
|
1921
|
+
ye as SelectValue,
|
|
1922
|
+
_a as SettingsDialog,
|
|
1923
|
+
Wa as SharedChatView,
|
|
1924
|
+
va as SidebarProvider,
|
|
1925
|
+
hr as TextPart,
|
|
1926
|
+
pr as ToolPart,
|
|
1927
|
+
Ya as Trans,
|
|
1928
|
+
Za as Translation,
|
|
1929
|
+
Va as UserLoginPage,
|
|
1930
|
+
gr as WelcomeScreen,
|
|
1941
1931
|
te as useComponents,
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1932
|
+
aa as useGentiqChat,
|
|
1933
|
+
er as useTranslation,
|
|
1934
|
+
M as userAPI,
|
|
1935
|
+
tr as withTranslation
|
|
1946
1936
|
};
|