@versini/sassysaint 5.5.8 → 5.5.10

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.
@@ -1,1623 +0,0 @@
1
- import C, { useSyncExternalStore as He, useCallback as P, useEffect as R, useContext as B, useRef as f, useState as $, useLayoutEffect as L, useMemo as me, useId as ze, useReducer as Le } from "react";
2
- import { jsxs as N, jsx as c, Fragment as Ve } from "react/jsx-runtime";
3
- import { g as ge, DEFAULT_AI_ENGINE as X, O as Oe, ACTION_RESET as Me } from "./index.CKvmD6Gi.js";
4
- import l from "clsx";
5
- const Ue = ({
6
- className: e,
7
- viewBox: r,
8
- title: t,
9
- monotone: a,
10
- ...o
11
- }) => /* @__PURE__ */ N(
12
- ge,
13
- {
14
- defaultViewBox: "0 0 448 512",
15
- size: "size-5",
16
- viewBox: r,
17
- className: e,
18
- title: t || "Add",
19
- ...o,
20
- children: [
21
- /* @__PURE__ */ c(
22
- "path",
23
- {
24
- opacity: a ? "1" : "0.4",
25
- d: "M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"
26
- }
27
- ),
28
- /* @__PURE__ */ c("path", { d: "" })
29
- ]
30
- }
31
- ), Fe = ({
32
- className: e,
33
- viewBox: r,
34
- title: t,
35
- monotone: a,
36
- ...o
37
- }) => /* @__PURE__ */ c(
38
- ge,
39
- {
40
- defaultViewBox: "0 0 384 512",
41
- size: "size-5",
42
- viewBox: r,
43
- className: e,
44
- title: t || "Close",
45
- ...o,
46
- children: /* @__PURE__ */ c("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3l105.4 105.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4z" })
47
- }
48
- );
49
- function he(e, r) {
50
- window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: r }));
51
- }
52
- const le = (e, r) => {
53
- const t = JSON.stringify(
54
- typeof r == "function" ? r() : r
55
- );
56
- window.localStorage.setItem(e, t), he(e, t);
57
- }, Pe = (e) => {
58
- window.localStorage.removeItem(e), he(e, null);
59
- }, se = (e) => window.localStorage.getItem(e), Ge = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
60
- function Ot({
61
- key: e,
62
- initialValue: r
63
- }) {
64
- const t = He(Ge, () => se(e)), a = P(
65
- (i) => {
66
- try {
67
- const s = typeof i == "function" ? i(JSON.parse(t)) : i;
68
- s == null ? Pe(e) : le(e, s);
69
- } catch (s) {
70
- console.warn(s);
71
- }
72
- },
73
- [e, t]
74
- ), o = P(() => {
75
- a(r);
76
- }, [r, a]), n = P(() => {
77
- a(null);
78
- }, [a]);
79
- return R(() => {
80
- try {
81
- se(e) === null && typeof r < "u" && le(e, r);
82
- } catch (i) {
83
- console.warn(i);
84
- }
85
- }, [e, r]), [t ? JSON.parse(t) : null, a, o, n];
86
- }
87
- const E = {
88
- GET_LOCATION: `query GetLocation($latitude: Float!, $longitude: Float!) {
89
- location(latitude: $latitude, longitude: $longitude) {
90
- country
91
- state
92
- city
93
- displayName
94
- }
95
- }`,
96
- GET_CHATS: `query GetChats(
97
- $userId: String!,
98
- $searchString: String,
99
- $limit: Float,
100
- $direction: String,
101
- $truncateSize: Float) {
102
- chats(
103
- user: $userId,
104
- searchString: $searchString,
105
- limit: $limit,
106
- direction: $direction,
107
- truncateSize: $truncateSize) {
108
- timestamp
109
- id
110
- model
111
- messages {
112
- content
113
- }
114
- }
115
- }`,
116
- GET_CHATS_STATS: `query GetChatsStats($userId: String!) {
117
- chatsStats(user: $userId) {
118
- totalChats
119
- averageProcessingTimes
120
- }
121
- }`,
122
- GET_CHAT: `query GetChatById($id: String!) {
123
- chatById(id: $id) {
124
- model
125
- usage
126
- messages {
127
- content
128
- role
129
- name
130
- processingTime
131
- }
132
- }
133
- }`,
134
- DELETE_CHAT: `mutation DeleteChat(
135
- $id: String!,
136
- $userId: String!,
137
- $searchString: String,
138
- $limit: Float,
139
- $direction: String,
140
- $truncateSize: Float) {
141
- deleteChat(
142
- id: $id,
143
- user: $userId,
144
- searchString: $searchString,
145
- limit: $limit,
146
- direction: $direction,
147
- truncateSize: $truncateSize) {
148
- timestamp
149
- id
150
- model
151
- messages {
152
- content
153
- }
154
- }
155
- }`,
156
- ABOUT: `query About($user: String!) {
157
- about(user: $user) {
158
- version
159
- models
160
- plugins
161
- engine
162
- engines
163
- }
164
- }`,
165
- GET_USER_PREFERENCES: `query GetUserPreferences($user: String!) {
166
- getUserPreferences(user: $user) {
167
- instructions
168
- location
169
- engine
170
- tags {
171
- enabled
172
- slot
173
- label
174
- content
175
- }
176
- }
177
- }`,
178
- SET_USER_PREFERENCES: `mutation SetUserPreferences(
179
- $user: String!,
180
- $instructions: String,
181
- $location: String,
182
- $engine: String,
183
- $tags: [TagIn]) {
184
- setUserPreferences(
185
- user: $user,
186
- instructions: $instructions,
187
- location: $location,
188
- engine: $engine,
189
- tags: $tags)
190
- }`
191
- }, Mt = {
192
- GET_LOCATION: {
193
- schema: E.GET_LOCATION,
194
- method: "location"
195
- },
196
- GET_CHATS: {
197
- schema: E.GET_CHATS,
198
- method: "chats"
199
- },
200
- GET_CHATS_STATS: {
201
- schema: E.GET_CHATS_STATS,
202
- method: "chatsStats"
203
- },
204
- GET_CHAT: {
205
- schema: E.GET_CHAT,
206
- method: "chatById"
207
- },
208
- DELETE_CHAT: {
209
- schema: E.DELETE_CHAT,
210
- method: "deleteChat"
211
- },
212
- ABOUT: {
213
- schema: E.ABOUT,
214
- method: "about"
215
- },
216
- GET_USER_PREFERENCES: {
217
- schema: E.GET_USER_PREFERENCES,
218
- method: "getUserPreferences"
219
- },
220
- SET_USER_PREFERENCES: {
221
- schema: E.SET_USER_PREFERENCES,
222
- method: "setUserPreferences"
223
- }
224
- }, pe = process.env.PUBLIC_SASSY_API_SERVER_URL, De = async ({
225
- query: e,
226
- data: r,
227
- headers: t = {}
228
- }) => await fetch(`${pe}/graphql`, {
229
- method: "POST",
230
- credentials: "include",
231
- headers: {
232
- ...t,
233
- "Content-Type": "application/json",
234
- Accept: "application/json"
235
- },
236
- body: JSON.stringify({
237
- query: e,
238
- variables: r
239
- })
240
- }), Ut = async ({
241
- accessToken: e,
242
- type: r,
243
- params: t = {}
244
- }) => {
245
- const a = r != null && r.data ? r.data(t) : t;
246
- try {
247
- const o = `Bearer ${e}`, n = await De({
248
- headers: {
249
- authorization: o
250
- },
251
- query: r.schema,
252
- data: a
253
- });
254
- if (n.status !== 200)
255
- return { status: n.status, data: [] };
256
- const { data: i, errors: s } = await n.json();
257
- return {
258
- status: n.status,
259
- data: i[r.method],
260
- errors: s
261
- };
262
- } catch (o) {
263
- return console.error(o), { status: 500, data: [] };
264
- }
265
- }, Ft = async ({
266
- accessToken: e,
267
- name: r,
268
- data: t,
269
- method: a = "POST"
270
- }) => {
271
- const o = `Bearer ${e}`;
272
- return await fetch(`${pe}/api/${r}`, {
273
- method: a,
274
- credentials: "include",
275
- headers: {
276
- "Content-Type": "application/json",
277
- authorization: o
278
- },
279
- body: JSON.stringify(t)
280
- });
281
- }, We = C.createContext({
282
- state: {
283
- id: "",
284
- model: X,
285
- engine: X,
286
- usage: 0,
287
- messages: [],
288
- isComponent: !1,
289
- tags: []
290
- },
291
- dispatch: () => {
292
- },
293
- serverStats: {
294
- version: "",
295
- models: [],
296
- plugins: [],
297
- engine: X,
298
- engines: []
299
- }
300
- }), Pt = C.createContext({
301
- state: { searchString: "", sortedCell: "", sortDirection: "" },
302
- dispatch: () => {
303
- }
304
- }), Gt = C.createContext({
305
- state: { tag: "" },
306
- dispatch: () => {
307
- }
308
- }), Dt = ({
309
- mode: e = "light",
310
- focusMode: r = "light",
311
- radius: t = "small"
312
- }) => {
313
- const { state: a, dispatch: o } = B(We), n = f(null), i = f(!1), s = (d) => {
314
- d.preventDefault(), o({
315
- type: Me
316
- });
317
- };
318
- return R(() => {
319
- var d;
320
- (a == null ? void 0 : a.streaming) === !0 && !i.current && n.current && (i.current = !0, n.current.focus()), (a == null ? void 0 : a.streaming) === !1 && (i.current = !1, (d = n.current) == null || d.blur());
321
- }, [a]), /* @__PURE__ */ c(
322
- Oe,
323
- {
324
- noBorder: !0,
325
- radius: t,
326
- mode: e,
327
- focusMode: r,
328
- ref: n,
329
- onClick: s,
330
- children: a != null && a.streaming ? /* @__PURE__ */ c(Fe, { size: "size-4", monotone: !0 }) : /* @__PURE__ */ c(Ue, { size: "size-4", monotone: !0 })
331
- }
332
- );
333
- };
334
- /*!
335
- @versini/ui-table v2.0.8
336
- © 2024 gizmette.com
337
- */
338
- try {
339
- window.__VERSINI_UI_TABLE__ || (window.__VERSINI_UI_TABLE__ = {
340
- version: "2.0.8",
341
- buildTime: "12/31/2024 09:02 AM EST",
342
- homepage: "https://github.com/aversini/ui-components",
343
- license: "MIT"
344
- });
345
- } catch {
346
- }
347
- const G = "thead", K = "tfoot", I = "tbody", F = {
348
- ASC: "asc",
349
- DESC: "desc"
350
- }, je = ({
351
- mode: e,
352
- className: r,
353
- wrapperClassName: t,
354
- stickyHeader: a,
355
- stickyFooter: o
356
- }) => ({
357
- wrapper: l(
358
- "not-prose relative w-full rounded-lg shadow-md",
359
- {
360
- "overflow-x-auto": !a && !o,
361
- "overflow-y-scroll": a || o,
362
- "bg-surface-darker text-copy-light": e === "dark",
363
- "bg-surface-light text-copy-dark": e === "light",
364
- "bg-surface-darker text-copy-light dark:bg-surface-light dark:text-copy-dark": e === "system",
365
- "bg-surface-light text-copy-dark dark:bg-surface-darker dark:text-copy-light": e === "alt-system"
366
- },
367
- t
368
- ),
369
- table: l("my-0 w-full text-left text-sm", r, {
370
- "text-copy-light": e === "dark",
371
- "text-copy-dark": e === "light",
372
- "text-copy-light dark:text-copy-dark": e === "system",
373
- "text-copy-dark dark:text-copy-light": e === "alt-system"
374
- }),
375
- caption: l("py-2 text-sm font-bold", {
376
- "text-copy-light": e === "dark",
377
- "text-copy-dark": e === "light",
378
- "text-copy-light dark:text-copy-dark": e === "system",
379
- "text-copy-dark dark:text-copy-light": e === "alt-system"
380
- })
381
- }), qe = ({
382
- className: e,
383
- stickyHeader: r,
384
- mode: t
385
- }) => l(
386
- {
387
- "sticky top-0 z-10": r,
388
- "shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": r && t === "dark",
389
- "shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": r && t === "system",
390
- "shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": r && t === "light",
391
- "shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": r && t === "alt-system"
392
- },
393
- e
394
- ), Je = ({
395
- className: e,
396
- stickyFooter: r,
397
- mode: t
398
- }) => l(
399
- {
400
- "sticky bottom-0 z-10": r,
401
- "shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": r && t === "dark",
402
- "shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": r && t === "system",
403
- "shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": r && t === "light",
404
- "shadow-[rgb(65_65_65_/30%)_-0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": r && t === "alt-system"
405
- },
406
- e
407
- ), Qe = ({
408
- mode: e,
409
- className: r,
410
- cellWrapper: t
411
- }) => t === G || t === K ? l(
412
- {
413
- "bg-table-head-dark": e === "dark",
414
- "bg-table-head-light": e === "light",
415
- "bg-table-head-dark dark:bg-table-head-light": e === "system",
416
- "bg-table-head-light dark:bg-table-head-dark": e === "alt-system"
417
- },
418
- r
419
- ) : l(
420
- "border-b last:border-0",
421
- {
422
- "border-table-dark": e === "dark",
423
- "odd:bg-table-dark-odd even:bg-table-dark-even": t === I && e === "dark",
424
- "border-table-light": e === "light",
425
- "odd:bg-table-light-odd even:bg-table-light-even": t === I && e === "light",
426
- "border-table-dark dark:border-table-light": e === "system",
427
- "odd:bg-table-dark-odd even:bg-table-dark-even dark:odd:bg-table-light-odd dark:even:bg-table-light-even": t === I && e === "system",
428
- "border-table-light dark:border-table-dark": e === "alt-system",
429
- "odd:bg-table-light-odd even:bg-table-light-even dark:odd:bg-table-dark-odd dark:even:bg-table-dark-even": t === I && e === "alt-system"
430
- },
431
- r
432
- ), Xe = ({
433
- cellWrapper: e,
434
- className: r,
435
- compact: t,
436
- mode: a
437
- }) => l(
438
- {
439
- "text-copy-light": a === "dark",
440
- "text-copy-dark": a === "light",
441
- "text-copy-light dark:text-copy-dark": a === "system",
442
- "text-copy-dark dark:text-copy-light": a === "alt-system",
443
- "px-4 py-3": !t && (e === G || e === K),
444
- "p-4": !t && e === I,
445
- "px-2 py-1.5": t
446
- },
447
- r
448
- ), Ye = ({
449
- buttonClassName: e
450
- }) => l("rounded-none text-sm", e), ce = "av-button", be = "icon", Ke = "button", Ze = "link", et = ({
451
- type: e,
452
- size: r,
453
- labelRight: t,
454
- labelLeft: a,
455
- align: o
456
- }) => {
457
- const n = "text-sm font-medium max-h-8 py-0 px-2", i = "text-base font-medium max-h-9 py-1 px-3", s = "text-lg font-medium max-h-12 py-2 px-4";
458
- switch (e) {
459
- case Ke:
460
- return l({
461
- [n]: r === "small",
462
- [i]: r === "medium",
463
- [s]: r === "large"
464
- });
465
- case Ze:
466
- return l("text-center", {
467
- [n]: r === "small",
468
- [i]: r === "medium",
469
- [s]: r === "large"
470
- });
471
- case be:
472
- return l("inline-flex items-center", {
473
- "justify-center": o === "center",
474
- "justify-start": o === "left",
475
- "justify-end": o === "right",
476
- "h-6 w-6 p-0": r === "small" && !(t || a),
477
- "h-6 px-2 text-sm font-medium": r === "small" && (t || a),
478
- "h-8 w-8 p-1": r === "medium" && !(t || a),
479
- "h-8 px-3 text-base font-medium": r === "medium" && (t || a),
480
- "h-12 w-12 p-2": r === "large" && !(t || a),
481
- "h-12 px-4 text-lg font-medium": r === "large" && (t || a)
482
- });
483
- }
484
- }, tt = ({
485
- mode: e,
486
- noBackground: r,
487
- noTruncate: t,
488
- variant: a,
489
- radius: o
490
- }) => {
491
- if (r)
492
- return l("not-prose", {
493
- "rounded-full": o === "large",
494
- "rounded-md": o === "medium",
495
- "rounded-sm": o === "small"
496
- });
497
- if (a === "primary")
498
- return l("not-prose", {
499
- "rounded-full": o === "large",
500
- "rounded-md": o === "medium",
501
- "rounded-sm": o === "small",
502
- truncate: !t,
503
- "bg-action-dark text-copy-light": e === "dark",
504
- "bg-action-light text-copy-lighter": e === "light",
505
- "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "system",
506
- "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
507
- });
508
- if (a === "secondary")
509
- return l("not-prose", {
510
- "rounded-full": o === "large",
511
- "rounded-md": o === "medium",
512
- "rounded-sm": o === "small",
513
- truncate: !t,
514
- "bg-action-dark text-copy-light": e === "light",
515
- "bg-action-light text-copy-lighter": e === "dark",
516
- "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "alt-system",
517
- "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
518
- });
519
- if (a === "danger")
520
- return l("not-prose", {
521
- "rounded-full": o === "large",
522
- "rounded-md": o === "medium",
523
- "rounded-sm": o === "small",
524
- truncate: !t,
525
- "bg-action-danger-dark text-copy-light": e === "dark",
526
- "bg-action-danger-light text-copy-lighter": e === "light",
527
- "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
528
- "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
529
- });
530
- if (a === "selected")
531
- return l("not-prose", {
532
- "rounded-full": o === "large",
533
- "rounded-md": o === "medium",
534
- "rounded-sm": o === "small",
535
- truncate: !t,
536
- "bg-action-selected-dark text-copy-light": e === "dark",
537
- "bg-action-selected-light text-copy-lighter": e === "light",
538
- "bg-action-selected-dark text-copy-light dark:bg-action-selected-light dark:text-copy-lighter": e === "system",
539
- "bg-action-selected-light text-copy-lighter dark:bg-action-selected-dark dark:text-copy-light": e === "alt-system"
540
- });
541
- }, rt = ({
542
- mode: e,
543
- disabled: r,
544
- variant: t
545
- }) => {
546
- if (r)
547
- return "";
548
- if (t === "primary")
549
- return l("hover:text-copy-light-hover", {
550
- "hover:bg-action-dark-hover": e === "dark",
551
- "hover:bg-action-light-hover": e === "light",
552
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
553
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
554
- });
555
- if (t === "secondary")
556
- return l("hover:text-copy-light-hover", {
557
- "hover:bg-action-dark-hover": e === "light",
558
- "hover:bg-action-light-hover": e === "dark",
559
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
560
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
561
- });
562
- if (t === "danger")
563
- return l("hover:text-copy-light-hover", {
564
- "hover:bg-action-danger-dark-hover": e === "dark",
565
- "hover:bg-action-danger-light-hover": e === "light",
566
- "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
567
- "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
568
- });
569
- if (t === "selected")
570
- return l("hover:text-copy-light-hover", {
571
- "hover:bg-action-selected-dark-hover": e === "dark",
572
- "hover:bg-action-selected-light-hover": e === "light",
573
- "hover:bg-action-selected-dark-hover dark:hover:bg-action-selected-light-hover": e === "system",
574
- "hover:bg-action-selected-light-hover dark:hover:bg-action-selected-dark-hover": e === "alt-system"
575
- });
576
- }, at = ({
577
- mode: e,
578
- disabled: r,
579
- variant: t
580
- }) => {
581
- if (r)
582
- return "";
583
- if (t === "primary")
584
- return l("active:text-copy-light-active", {
585
- "active:bg-action-dark-active": e === "dark",
586
- "active:bg-action-light-active": e === "light",
587
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
588
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
589
- });
590
- if (t === "secondary")
591
- return l("active:text-copy-light-active", {
592
- "active:bg-action-dark-active": e === "light",
593
- "active:bg-action-light-active": e === "dark",
594
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
595
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
596
- });
597
- if (t === "danger")
598
- return l("active:text-copy-lighter-active", {
599
- "active:bg-action-danger-dark-active": e === "dark",
600
- "active:bg-action-danger-light-active": e === "light",
601
- "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
602
- "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
603
- });
604
- if (t === "selected")
605
- return l("active:text-copy-lighter-active", {
606
- "active:bg-action-selected-dark-active": e === "dark",
607
- "active:bg-action-selected-light-active": e === "light",
608
- "active:bg-action-selected-dark-active dark:active:bg-action-selected-light-active": e === "system",
609
- "active:bg-action-selected-light-active dark:active:bg-action-selected-dark-active": e === "alt-system"
610
- });
611
- }, ot = ({
612
- mode: e,
613
- noBorder: r,
614
- variant: t
615
- }) => {
616
- if (r)
617
- return "border border-transparent";
618
- if (t === "primary")
619
- return l("border", {
620
- "border-border-dark": e === "dark",
621
- "border-border-accent": e === "light",
622
- "border-border-dark dark:border-border-accent": e === "system",
623
- "border-border-accent dark:border-border-dark": e === "alt-system"
624
- });
625
- if (t === "secondary")
626
- return l("border", {
627
- "border-border-dark": e === "light",
628
- "border-border-accent": e === "dark",
629
- "border-border-dark dark:border-border-accent": e === "alt-system",
630
- "border-border-accent dark:border-border-dark": e === "system"
631
- });
632
- if (t === "danger")
633
- return l("border", {
634
- "border-border-danger-dark": e === "dark",
635
- "border-border-danger-medium": e === "light",
636
- "border-border-danger-dark dark:border-border-danger-medium": e === "system",
637
- "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
638
- });
639
- if (t === "selected")
640
- return l("border", {
641
- "border-border-selected-dark": e === "dark",
642
- "border-border-selected-medium": e === "light",
643
- "border-border-selected-dark dark:border-border-selected-medium": e === "system",
644
- "border-border-selected-medium dark:border-border-selected-dark": e === "alt-system"
645
- });
646
- }, nt = ({
647
- focusMode: e
648
- }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
649
- "focus:outline-focus-dark": e === "dark",
650
- "focus:outline-focus-light": e === "light",
651
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
652
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
653
- }), it = ({
654
- type: e,
655
- className: r,
656
- raw: t,
657
- mode: a,
658
- focusMode: o,
659
- disabled: n,
660
- fullWidth: i,
661
- size: s,
662
- noBorder: d,
663
- labelRight: u,
664
- labelLeft: m,
665
- noBackground: h,
666
- variant: g,
667
- noTruncate: b,
668
- align: p,
669
- radius: v
670
- }) => (g || (g = "primary"), t ? l(ce, r) : l(
671
- ce,
672
- tt({
673
- mode: a,
674
- variant: g,
675
- noBackground: h,
676
- noTruncate: b,
677
- radius: v
678
- }),
679
- et({
680
- type: e,
681
- size: s,
682
- labelRight: u,
683
- labelLeft: m,
684
- align: p
685
- }),
686
- ot({ mode: a, variant: g, noBorder: d }),
687
- nt({ focusMode: o }),
688
- rt({ mode: a, variant: g, disabled: n }),
689
- at({ mode: a, variant: g, disabled: n }),
690
- {
691
- "w-full": i,
692
- "disabled:cursor-not-allowed disabled:opacity-50": n
693
- },
694
- r
695
- )), lt = (e, r, t) => {
696
- var a;
697
- !r && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof t == "function" && t(e);
698
- }, ye = C.forwardRef((e, r) => {
699
- const { onClick: t, noInternalClick: a = !1, ...o } = e;
700
- return /* @__PURE__ */ c(
701
- "button",
702
- {
703
- ref: r,
704
- onClick: (n) => {
705
- lt(n, a, t);
706
- },
707
- ...o
708
- }
709
- );
710
- });
711
- ye.displayName = "BaseButton";
712
- /*!
713
- @versini/ui-button v3.2.0
714
- © 2024 gizmette.com
715
- */
716
- try {
717
- window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
718
- version: "3.2.0",
719
- buildTime: "12/31/2024 09:01 AM EST",
720
- homepage: "https://github.com/aversini/ui-components",
721
- license: "MIT"
722
- });
723
- } catch {
724
- }
725
- const fe = C.forwardRef(
726
- ({
727
- children: e,
728
- disabled: r = !1,
729
- mode: t = "system",
730
- focusMode: a = "system",
731
- fullWidth: o = !1,
732
- className: n,
733
- type: i = "button",
734
- raw: s = !1,
735
- noBorder: d = !1,
736
- "aria-label": u,
737
- label: m,
738
- size: h = "medium",
739
- labelRight: g,
740
- labelLeft: b,
741
- noBackground: p = !1,
742
- align: v = "center",
743
- active: k = !1,
744
- radius: _ = "large",
745
- ...V
746
- }, O) => {
747
- const M = it({
748
- type: be,
749
- mode: t,
750
- focusMode: a,
751
- fullWidth: o,
752
- disabled: r,
753
- raw: s,
754
- className: n,
755
- noBorder: d,
756
- size: h,
757
- labelRight: g,
758
- labelLeft: b,
759
- noBackground: p,
760
- align: v,
761
- radius: _
762
- }), D = l({
763
- "text-copy-accent-dark": t === "light" && !s,
764
- "text-copy-light": t === "dark" && !s,
765
- "text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !s,
766
- "text-copy-light dark:text-copy-accent-dark": t === "system" && !s
767
- }), W = k ? l(
768
- "relative",
769
- "focus-within:static",
770
- "focus-within:after:border-transparent",
771
- "after:absolute",
772
- "after:content-['']",
773
- "after:border-b-2",
774
- "after:bottom-[-4px]",
775
- "after:left-0",
776
- "after:right-0",
777
- {
778
- "after:border-table-dark": t === "dark",
779
- "after:border-table-light": t === "light",
780
- "after:border-table-dark dark:after:border-table-light": t === "system",
781
- "after:border-table-light dark:after:border-table-dark": t === "alt-system"
782
- }
783
- ) : "";
784
- return /* @__PURE__ */ c("div", { className: W, children: /* @__PURE__ */ N(
785
- ye,
786
- {
787
- ref: O,
788
- className: M,
789
- disabled: r,
790
- type: i,
791
- "aria-label": u || m,
792
- ...V,
793
- children: [
794
- b && /* @__PURE__ */ c("span", { className: "pr-2", children: b }),
795
- /* @__PURE__ */ c("div", { className: D, children: e }),
796
- g && /* @__PURE__ */ c("span", { className: "pl-2", children: g })
797
- ]
798
- }
799
- ) });
800
- }
801
- );
802
- fe.displayName = "ButtonSort";
803
- const Z = ({
804
- children: e,
805
- fill: r,
806
- viewBox: t,
807
- className: a,
808
- defaultViewBox: o,
809
- size: n,
810
- title: i,
811
- semantic: s = !1,
812
- ...d
813
- }) => {
814
- const u = l(n, a);
815
- return /* @__PURE__ */ N(Ve, { children: [
816
- /* @__PURE__ */ c(
817
- "svg",
818
- {
819
- xmlns: "http://www.w3.org/2000/svg",
820
- className: u,
821
- viewBox: t || o,
822
- fill: r || "currentColor",
823
- role: "img",
824
- "aria-hidden": !s,
825
- focusable: !1,
826
- ...d,
827
- children: e
828
- }
829
- ),
830
- i && s && /* @__PURE__ */ c("span", { className: "sr-only", children: i })
831
- ] });
832
- };
833
- /*!
834
- @versini/ui-svgicon v3.0.2
835
- © 2024 gizmette.com
836
- */
837
- try {
838
- window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
839
- version: "3.0.2",
840
- buildTime: "12/31/2024 09:01 AM EST",
841
- homepage: "https://github.com/aversini/ui-components",
842
- license: "MIT"
843
- });
844
- } catch {
845
- }
846
- const st = ({
847
- className: e,
848
- viewBox: r,
849
- title: t,
850
- monotone: a,
851
- ...o
852
- }) => /* @__PURE__ */ N(
853
- Z,
854
- {
855
- defaultViewBox: "0 0 576 512",
856
- size: "size-5",
857
- viewBox: r,
858
- className: e,
859
- title: t || "Sort",
860
- ...o,
861
- children: [
862
- /* @__PURE__ */ c(
863
- "path",
864
- {
865
- opacity: a ? "1" : "0.4",
866
- d: "M393.4 41.4c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L448 141.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V141.3l-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l96-96z"
867
- }
868
- ),
869
- /* @__PURE__ */ c("path", { d: "M137.4 470.6c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 370.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V370.7L86.6 329.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96z" })
870
- ]
871
- }
872
- ), ct = ({
873
- className: e,
874
- viewBox: r,
875
- title: t,
876
- monotone: a,
877
- ...o
878
- }) => /* @__PURE__ */ N(
879
- Z,
880
- {
881
- defaultViewBox: "0 0 576 512",
882
- size: "size-5",
883
- viewBox: r,
884
- className: e,
885
- title: t || "Sort Down",
886
- ...o,
887
- children: [
888
- /* @__PURE__ */ c(
889
- "path",
890
- {
891
- opacity: a ? "1" : "0.4",
892
- d: "M288 448c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32z"
893
- }
894
- ),
895
- /* @__PURE__ */ c("path", { d: "M128 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L160 365.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V365.7L63.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C110.5 476.2 119 480 128 480z" })
896
- ]
897
- }
898
- ), dt = ({
899
- className: e,
900
- viewBox: r,
901
- title: t,
902
- monotone: a,
903
- ...o
904
- }) => /* @__PURE__ */ N(
905
- Z,
906
- {
907
- defaultViewBox: "0 0 576 512",
908
- size: "size-5",
909
- viewBox: r,
910
- className: e,
911
- title: t || "Sort Up",
912
- ...o,
913
- children: [
914
- /* @__PURE__ */ c(
915
- "path",
916
- {
917
- opacity: a ? "1" : "0.4",
918
- d: "M288 64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32z"
919
- }
920
- ),
921
- /* @__PURE__ */ c("path", { d: "M128 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L160 146.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V146.3L63.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C110.5 35.8 119 32 128 32z" })
922
- ]
923
- }
924
- );
925
- /*!
926
- @versini/ui-icons v3.0.2
927
- © 2024 gizmette.com
928
- */
929
- try {
930
- window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
931
- version: "3.0.2",
932
- buildTime: "12/31/2024 09:01 AM EST",
933
- homepage: "https://github.com/aversini/ui-components",
934
- license: "MIT"
935
- });
936
- } catch {
937
- }
938
- const H = C.createContext({
939
- mode: "light",
940
- cellWrapper: "thead",
941
- stickyHeader: !1,
942
- stickyFooter: !1,
943
- compact: !1
944
- }), Wt = ({
945
- children: e,
946
- mode: r = "system",
947
- caption: t,
948
- compact: a,
949
- summary: o,
950
- className: n,
951
- wrapperClassName: i,
952
- maxHeight: s,
953
- stickyHeader: d,
954
- stickyFooter: u,
955
- ...m
956
- }) => {
957
- const h = je({
958
- mode: r,
959
- className: n,
960
- wrapperClassName: i,
961
- stickyHeader: d,
962
- stickyFooter: u
963
- });
964
- return /* @__PURE__ */ c(
965
- H.Provider,
966
- {
967
- value: { mode: r, stickyHeader: d, stickyFooter: u, compact: a },
968
- children: /* @__PURE__ */ c(
969
- "div",
970
- {
971
- className: h.wrapper,
972
- ...s && {
973
- style: { maxHeight: s }
974
- },
975
- children: /* @__PURE__ */ N("table", { className: h.table, summary: o, ...m, children: [
976
- t && /* @__PURE__ */ c("caption", { className: h.caption, children: t }),
977
- e
978
- ] })
979
- }
980
- )
981
- }
982
- );
983
- }, jt = ({
984
- children: e,
985
- className: r,
986
- ...t
987
- }) => {
988
- const a = B(H);
989
- a.cellWrapper = G;
990
- const o = qe({
991
- className: r,
992
- mode: a.mode,
993
- stickyHeader: a.stickyHeader
994
- });
995
- return /* @__PURE__ */ c("thead", { className: o, ...t, children: e });
996
- }, qt = ({
997
- children: e,
998
- className: r,
999
- ...t
1000
- }) => {
1001
- const a = B(H);
1002
- a.cellWrapper = K;
1003
- const o = Je({
1004
- className: r,
1005
- mode: a.mode,
1006
- stickyFooter: a.stickyFooter
1007
- });
1008
- return /* @__PURE__ */ c("tfoot", { className: o, ...t, children: e });
1009
- }, Jt = ({ children: e, ...r }) => {
1010
- const t = B(H);
1011
- return t.cellWrapper = I, /* @__PURE__ */ c("tbody", { ...r, children: e });
1012
- }, Qt = ({
1013
- children: e,
1014
- className: r,
1015
- ...t
1016
- }) => {
1017
- const a = B(H), o = Qe({
1018
- mode: a.mode,
1019
- cellWrapper: a.cellWrapper,
1020
- className: r
1021
- });
1022
- return /* @__PURE__ */ c("tr", { className: o, ...t, children: e });
1023
- }, ut = ({
1024
- children: e,
1025
- component: r,
1026
- className: t,
1027
- ...a
1028
- }) => {
1029
- const o = B(H), n = r || (o.cellWrapper === G ? "th" : "td"), i = Xe({
1030
- cellWrapper: o.cellWrapper,
1031
- className: t,
1032
- mode: o.mode,
1033
- compact: o.compact
1034
- });
1035
- return /* @__PURE__ */ c(n, { className: i, ...a, children: e });
1036
- }, Xt = ({
1037
- align: e,
1038
- children: r,
1039
- buttonClassName: t,
1040
- className: a,
1041
- component: o,
1042
- focusMode: n = "alt-system",
1043
- mode: i = "alt-system",
1044
- onClick: s,
1045
- sortDirection: d,
1046
- sortedCell: u,
1047
- cellId: m,
1048
- ...h
1049
- }) => {
1050
- const g = Ye({ buttonClassName: t });
1051
- return /* @__PURE__ */ c(
1052
- ut,
1053
- {
1054
- component: o,
1055
- className: a,
1056
- role: "columnheader",
1057
- "aria-sort": d === F.ASC && u === m ? "ascending" : d === F.DESC && u === m ? "descending" : "other",
1058
- ...h,
1059
- children: /* @__PURE__ */ c(
1060
- fe,
1061
- {
1062
- active: u === m,
1063
- className: g,
1064
- onClick: s,
1065
- align: e,
1066
- noBorder: !0,
1067
- focusMode: n,
1068
- mode: i,
1069
- fullWidth: !0,
1070
- labelRight: r,
1071
- children: d === F.ASC && u === m ? /* @__PURE__ */ c(dt, { className: "size-4", monotone: !0 }) : d === F.DESC && u === m ? /* @__PURE__ */ c(ct, { className: "size-4", monotone: !0 }) : /* @__PURE__ */ c(st, { className: "size-4", monotone: !0 })
1072
- }
1073
- )
1074
- }
1075
- );
1076
- };
1077
- /*!
1078
- @versini/ui-textarea v2.1.1
1079
- © 2024 gizmette.com
1080
- */
1081
- try {
1082
- window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
1083
- version: "2.1.1",
1084
- buildTime: "12/31/2024 06:19 PM EST",
1085
- homepage: "https://github.com/aversini/ui-components",
1086
- license: "MIT"
1087
- });
1088
- } catch {
1089
- }
1090
- const ke = "av-text-area", mt = "av-text-area-wrapper", Y = "av-text-area-helper-text", gt = "av-text-area__control--right", ht = "av-text-area__control--left";
1091
- function pt() {
1092
- const e = f(!1);
1093
- return R(() => (e.current = !0, () => {
1094
- e.current = !1;
1095
- }), []), P(() => e.current, []);
1096
- }
1097
- function bt(e) {
1098
- return me(() => e.every((r) => r == null) ? () => {
1099
- } : (r) => {
1100
- e.forEach((t) => {
1101
- typeof t == "function" ? t(r) : t != null && (t.current = r);
1102
- });
1103
- }, e);
1104
- }
1105
- const yt = {
1106
- x: 0,
1107
- y: 0,
1108
- width: 0,
1109
- height: 0,
1110
- top: 0,
1111
- left: 0,
1112
- bottom: 0,
1113
- right: 0
1114
- };
1115
- function de(e) {
1116
- const r = pt(), t = f(0), a = f(null), [o, n] = $(yt), i = me(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((s) => {
1117
- const d = s[0];
1118
- d && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
1119
- a.current && r() && n(d.contentRect);
1120
- }));
1121
- }), [r]);
1122
- return R(() => (a.current && (i == null || i.observe(a.current, e)), () => {
1123
- i == null || i.disconnect(), t.current && cancelAnimationFrame(t.current);
1124
- }), [i, e]), [a, o];
1125
- }
1126
- function ft({
1127
- value: e,
1128
- defaultValue: r,
1129
- finalValue: t,
1130
- onChange: a = () => {
1131
- },
1132
- initialControlledDelay: o = 0
1133
- }) {
1134
- const [n, i] = $(!1), [s, d] = $(
1135
- r !== void 0 ? r : t
1136
- ), u = (m) => {
1137
- d(m), a == null || a(m);
1138
- };
1139
- return R(() => {
1140
- (async () => e !== void 0 && !n && o > 0 && (await new Promise(
1141
- (m) => setTimeout(m, o)
1142
- ), i(!0)))();
1143
- }, [e, o, n]), e !== void 0 ? !n && o > 0 ? ["", a, !0] : [e, a, !0] : [s, u, !1];
1144
- }
1145
- function kt(e) {
1146
- const r = ze();
1147
- if (!e)
1148
- return r;
1149
- if (typeof e == "number" || typeof e == "string")
1150
- return `${e}${r}`;
1151
- if (typeof e == "object") {
1152
- const { id: t, prefix: a = "" } = e;
1153
- return typeof t == "number" || typeof t == "string" ? `${a}${t}` : `${a}${r}`;
1154
- }
1155
- }
1156
- const ve = "SET_ANNOUNCEMENT", xe = "CLEAR_ANNOUNCEMENT", vt = {
1157
- alert: null,
1158
- alertdialog: null,
1159
- log: "polite",
1160
- marquee: null,
1161
- progressbar: null,
1162
- status: "polite",
1163
- timer: "assertive"
1164
- }, xt = (e, r) => {
1165
- switch (r == null ? void 0 : r.type) {
1166
- case ve:
1167
- return {
1168
- ...e,
1169
- announcement: r.payload
1170
- };
1171
- case xe:
1172
- return {
1173
- ...e,
1174
- announcement: null
1175
- };
1176
- default:
1177
- return e;
1178
- }
1179
- }, _t = ({
1180
- onAnnouncementClear: e,
1181
- dispatch: r
1182
- }) => {
1183
- r({
1184
- type: xe
1185
- }), typeof e == "function" && e();
1186
- }, ue = ({
1187
- children: e,
1188
- clearAnnouncementDelay: r,
1189
- clearAnnouncementTimeoutRef: t,
1190
- onAnnouncementClear: a,
1191
- dispatch: o
1192
- }) => {
1193
- clearTimeout(t.current), e !== null && o({
1194
- type: ve,
1195
- payload: e
1196
- }), r && (t.current = setTimeout(
1197
- () => _t({
1198
- onAnnouncementClear: a,
1199
- dispatch: o
1200
- }),
1201
- r
1202
- ));
1203
- }, wt = ({
1204
- children: e,
1205
- announcementTimeoutRef: r,
1206
- announcementDelay: t,
1207
- clearAnnouncementDelay: a,
1208
- clearAnnouncementTimeoutRef: o,
1209
- onAnnouncementClear: n,
1210
- dispatch: i
1211
- }) => {
1212
- clearTimeout(r.current), t ? r.current = setTimeout(ue, t, {
1213
- children: e,
1214
- clearAnnouncementDelay: a,
1215
- clearAnnouncementTimeoutRef: o,
1216
- onAnnouncementClear: n,
1217
- dispatch: i
1218
- }) : ue({
1219
- children: e,
1220
- clearAnnouncementDelay: a,
1221
- clearAnnouncementTimeoutRef: o,
1222
- onAnnouncementClear: n,
1223
- dispatch: i
1224
- });
1225
- };
1226
- function Et({
1227
- children: e,
1228
- className: r,
1229
- politeness: t,
1230
- role: a = null,
1231
- announcementDelay: o,
1232
- clearAnnouncementDelay: n,
1233
- onAnnouncementClear: i,
1234
- visible: s,
1235
- ...d
1236
- }) {
1237
- const u = f(null), m = f(null), [h, g] = Le(xt, {
1238
- announcement: null
1239
- });
1240
- let b = t;
1241
- typeof b > "u" && (b = a ? vt[a] : "assertive"), R(() => {
1242
- wt({
1243
- announcementTimeoutRef: u,
1244
- announcementDelay: o,
1245
- children: e,
1246
- clearAnnouncementDelay: n,
1247
- clearAnnouncementTimeoutRef: m,
1248
- onAnnouncementClear: i,
1249
- dispatch: g
1250
- });
1251
- }, [
1252
- e,
1253
- o,
1254
- n,
1255
- i
1256
- ]);
1257
- const p = l(r, {
1258
- "sr-only": !s
1259
- });
1260
- return /* @__PURE__ */ c(
1261
- "div",
1262
- {
1263
- "aria-live": b,
1264
- ...a && { role: a },
1265
- className: p,
1266
- ...d,
1267
- children: h.announcement
1268
- }
1269
- );
1270
- }
1271
- /*!
1272
- @versini/ui-liveregion v1.2.7
1273
- © 2024 gizmette.com
1274
- */
1275
- try {
1276
- window.__VERSINI_UI_LIVEREGION__ || (window.__VERSINI_UI_LIVEREGION__ = {
1277
- version: "1.2.7",
1278
- buildTime: "12/31/2024 06:19 PM EST",
1279
- homepage: "https://github.com/aversini/ui-components",
1280
- license: "MIT"
1281
- });
1282
- } catch {
1283
- }
1284
- const Nt = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", St = ({ mode: e }) => l({
1285
- "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
1286
- "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
1287
- "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
1288
- "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
1289
- }), Tt = ({
1290
- focusMode: e
1291
- }) => l("focus:outline focus:outline-2 focus:outline-offset-2", {
1292
- "focus:outline-focus-dark": e === "dark",
1293
- "focus:outline-focus-light": e === "light",
1294
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
1295
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
1296
- }), Ct = ({
1297
- noBorder: e,
1298
- error: r
1299
- }) => l("border-2", {
1300
- "border-border-dark": !e && !r,
1301
- "focus:border-border-dark": !e && r,
1302
- "border-border-error-dark": !e && r,
1303
- "border-transparent": e
1304
- }), At = ({
1305
- disabled: e,
1306
- raw: r,
1307
- error: t,
1308
- mode: a,
1309
- leftElement: o,
1310
- rightElement: n
1311
- }) => {
1312
- if (r)
1313
- return "";
1314
- if (e)
1315
- return l(
1316
- "transform translate-y-0 scale-100 absolute px-2 cursor-not-allowed opacity-50 font-medium",
1317
- {
1318
- "translate-x-[12px]": n === !0 && !o || !n && !o
1319
- }
1320
- );
1321
- if (!t)
1322
- return l(
1323
- "absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
1324
- {
1325
- "translate-x-[12px]": n === !0 && !o || !n && !o,
1326
- "text-copy-medium": a === "dark",
1327
- "text-copy-dark": a === "light",
1328
- "text-copy-dark dark:text-copy-medium": a === "system",
1329
- "text-copy-medium dark:text-copy-dark": a === "alt-system"
1330
- }
1331
- );
1332
- if (t)
1333
- return l(
1334
- "absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
1335
- {
1336
- "translate-x-[12px]": n === !0 && !o || !n && !o,
1337
- "text-copy-medium": a === "dark",
1338
- "text-copy-error-dark": a === "light",
1339
- "text-copy-error-dark dark:text-copy-error-light": a === "system",
1340
- "text-copy-medium dark:text-copy-error-dark": a === "alt-system"
1341
- }
1342
- );
1343
- }, It = ({
1344
- error: e,
1345
- raw: r,
1346
- mode: t,
1347
- disabled: a
1348
- }) => {
1349
- if (r)
1350
- return "";
1351
- if (a)
1352
- return l(
1353
- Y,
1354
- "absolute px-2 cursor-not-allowed opacity-50 font-medium"
1355
- );
1356
- if (!e)
1357
- return l(Y, "absolute px-2 font-medium", {
1358
- "text-copy-medium": t === "dark",
1359
- "text-copy-dark": t === "light",
1360
- "text-copy-dark dark:text-copy-medium": t === "system",
1361
- "text-copy-medium dark:text-copy-dark": t === "alt-system"
1362
- });
1363
- if (e)
1364
- return l(Y, "absolute px-2 font-medium", {
1365
- "text-copy-error-light": t === "dark",
1366
- "text-copy-error-dark": t === "light",
1367
- "text-copy-error-dark dark:text-copy-error-light": t === "system",
1368
- "dark:text-copy-error-dark text-copy-error-light": t === "alt-system"
1369
- });
1370
- }, $t = ({
1371
- className: e,
1372
- textAreaClassName: r,
1373
- raw: t,
1374
- focusMode: a,
1375
- disabled: o,
1376
- noBorder: n,
1377
- error: i,
1378
- mode: s,
1379
- leftElement: d,
1380
- rightElement: u
1381
- }) => {
1382
- const m = t ? e : l(
1383
- "relative flex w-full flex-col justify-center",
1384
- mt,
1385
- e
1386
- ), h = t ? l(r) : l(
1387
- ke,
1388
- r,
1389
- Nt(),
1390
- St({ mode: s }),
1391
- Tt({ focusMode: a }),
1392
- Ct({
1393
- noBorder: n,
1394
- error: i
1395
- }),
1396
- {
1397
- "disabled:cursor-not-allowed disabled:opacity-50": o
1398
- }
1399
- ), g = t ? void 0 : "sr-only", b = At({
1400
- disabled: o,
1401
- raw: t,
1402
- error: i,
1403
- mode: s,
1404
- rightElement: u,
1405
- leftElement: d
1406
- }), p = It({
1407
- error: i,
1408
- raw: t,
1409
- mode: s,
1410
- disabled: o
1411
- }), v = t ? void 0 : l(gt, "absolute"), k = t ? void 0 : l(ht, "absolute");
1412
- return {
1413
- wrapper: m,
1414
- textArea: h,
1415
- accessibleLabel: g,
1416
- visibleLabel: b,
1417
- helperText: p,
1418
- rightElement: v,
1419
- leftElement: k
1420
- };
1421
- }, Rt = ({
1422
- scrollHeight: e,
1423
- currentHeight: r,
1424
- currentLabelOffset: t = 0,
1425
- currentHelperTextOffset: a = 0
1426
- }) => {
1427
- let o, n;
1428
- if (e > 0 && e !== r) {
1429
- const i = e - r, s = Math.abs(i / 24);
1430
- o = t + -1 * Math.sign(i) * (12 * s), n = a + Math.sign(i) * (12 * s);
1431
- }
1432
- return {
1433
- labelOffset: o,
1434
- helperTextOffset: n,
1435
- scrollHeight: e
1436
- };
1437
- }, Bt = C.forwardRef(
1438
- ({
1439
- id: e,
1440
- name: r,
1441
- label: t,
1442
- error: a = !1,
1443
- raw: o = !1,
1444
- className: n,
1445
- textAreaClassName: i,
1446
- mode: s = "system",
1447
- focusMode: d = "system",
1448
- value: u,
1449
- defaultValue: m,
1450
- disabled: h = !1,
1451
- noBorder: g = !1,
1452
- labelId: b,
1453
- helperText: p = "",
1454
- helperTextOnFocus: v = !1,
1455
- rightElement: k,
1456
- leftElement: _,
1457
- onChange: V,
1458
- onFocus: O,
1459
- onBlur: M,
1460
- ...D
1461
- }, W) => {
1462
- var ee;
1463
- const x = f(null), _e = bt([W, x]), [we, U] = de(), [Ee, A] = de(), j = f(80), te = f(-25), S = f(null), re = f(30), q = f(null), z = kt({ id: e, prefix: `${ke}-` }), [ae, Ne] = $(0), [oe, Se] = $(0), [Te, ne] = $(
1464
- !!(!v && p)
1465
- ), Ce = `${r} error, ${p}`, T = $t({
1466
- className: n,
1467
- textAreaClassName: i,
1468
- error: a,
1469
- raw: o,
1470
- focusMode: d,
1471
- disabled: h,
1472
- noBorder: g,
1473
- mode: s,
1474
- rightElement: !!k,
1475
- leftElement: !!_
1476
- }), [w, Ae] = ft({
1477
- value: u,
1478
- initialControlledDelay: 20,
1479
- defaultValue: m,
1480
- onChange: (y) => {
1481
- V && V({
1482
- target: {
1483
- value: y
1484
- }
1485
- });
1486
- }
1487
- }), Ie = (y) => {
1488
- Ae(y.target.value);
1489
- }, $e = (y) => {
1490
- v && p && ne(!0), O && O(y);
1491
- }, Re = (y) => {
1492
- v && p && !w && ne(!1), M && M(y);
1493
- };
1494
- return L(() => {
1495
- U && U.width && Ne(U.width + 18 + 10);
1496
- }, [U]), L(() => {
1497
- A && A.width && Se(A.width + 18 + 10);
1498
- }, [A]), L(() => {
1499
- o || x && x.current && w !== void 0 && (x.current.style.height = "inherit", x.current.style.height = x.current.scrollHeight + "px");
1500
- }, [w, o]), L(() => {
1501
- o || setTimeout(() => {
1502
- var y;
1503
- (y = S == null ? void 0 : S.current) == null || y.style.setProperty(
1504
- "--av-text-area-wrapper-transition",
1505
- w ? "none" : "all 0.2s ease-out"
1506
- );
1507
- }, 0);
1508
- }, [w, o]), L(() => {
1509
- var y, ie;
1510
- if (!o && x && x.current && w !== void 0) {
1511
- const { labelOffset: J, helperTextOffset: Q, scrollHeight: Be } = Rt({
1512
- scrollHeight: x.current.scrollHeight,
1513
- currentHeight: j.current,
1514
- currentLabelOffset: te.current,
1515
- currentHelperTextOffset: re.current
1516
- });
1517
- J && (te.current = J, (y = S == null ? void 0 : S.current) == null || y.style.setProperty(
1518
- "--av-text-area-label",
1519
- `${J}px`
1520
- )), Q && (re.current = Q, (ie = q == null ? void 0 : q.current) == null || ie.style.setProperty(
1521
- "--av-text-area-helper-text",
1522
- `${Q}px`
1523
- )), j.current = Be || j.current;
1524
- }
1525
- }, [w, o]), A.width > 0 && ((ee = S == null ? void 0 : S.current) == null || ee.style.setProperty(
1526
- "--tw-translate-x",
1527
- `${12 + A.width + 5}px`
1528
- )), /* @__PURE__ */ N("div", { className: T.wrapper, children: [
1529
- /* @__PURE__ */ c(
1530
- "label",
1531
- {
1532
- htmlFor: z,
1533
- id: b,
1534
- className: T.accessibleLabel,
1535
- children: t
1536
- }
1537
- ),
1538
- _ && /* @__PURE__ */ c(
1539
- "div",
1540
- {
1541
- ref: Ee,
1542
- className: T.leftElement,
1543
- children: _
1544
- }
1545
- ),
1546
- /* @__PURE__ */ c(
1547
- "textarea",
1548
- {
1549
- ref: _e,
1550
- id: z,
1551
- name: r,
1552
- disabled: h,
1553
- placeholder: o ? void 0 : " ",
1554
- className: T.textArea,
1555
- rows: 1,
1556
- ...p && { "aria-describedby": `${z}-helper` },
1557
- ...a && { "aria-invalid": "true" },
1558
- ...k && !_ && !o && { style: { paddingRight: ae } },
1559
- ..._ && !k && !o && { style: { paddingLeft: oe } },
1560
- ...k && _ && !o && {
1561
- style: {
1562
- paddingRight: ae,
1563
- paddingLeft: oe
1564
- }
1565
- },
1566
- value: w,
1567
- onChange: Ie,
1568
- onFocus: $e,
1569
- onBlur: Re,
1570
- ...D
1571
- }
1572
- ),
1573
- !o && /* @__PURE__ */ c(
1574
- "label",
1575
- {
1576
- ref: S,
1577
- "aria-hidden": !0,
1578
- htmlFor: z,
1579
- className: `${T.visibleLabel}`,
1580
- children: t
1581
- }
1582
- ),
1583
- Te && /* @__PURE__ */ c(
1584
- "div",
1585
- {
1586
- ref: q,
1587
- id: `${z}-helper`,
1588
- className: T.helperText,
1589
- children: p
1590
- }
1591
- ),
1592
- k && /* @__PURE__ */ c(
1593
- "div",
1594
- {
1595
- ref: we,
1596
- className: T.rightElement,
1597
- children: k
1598
- }
1599
- ),
1600
- a && p && /* @__PURE__ */ c(Et, { politeness: "polite", clearAnnouncementDelay: 500, children: Ce })
1601
- ] });
1602
- }
1603
- );
1604
- Bt.displayName = "TextArea";
1605
- export {
1606
- We as AppContext,
1607
- Ot as E,
1608
- Bt as Fe,
1609
- Pt as HistoryContext,
1610
- Dt as NewChatButton,
1611
- Mt as SERVICE_TYPES,
1612
- Gt as TagsContext,
1613
- Xt as be,
1614
- Wt as ce,
1615
- F as f,
1616
- Jt as ge,
1617
- Qt as he,
1618
- qt as ne,
1619
- ut as oe,
1620
- Ft as restCall,
1621
- jt as se,
1622
- Ut as serviceCall
1623
- };