@versini/sassysaint 8.70.1 → 8.70.2
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/chunks/{AboutChangelog._T5Lr2_6.js → AboutChangelog.D_coGtfg.js} +2 -2
- package/dist/chunks/{AboutEntry.DJ0OUM4_.js → AboutEntry.BoG1YJgv.js} +7 -7
- package/dist/chunks/{App.CcqDGZun.js → App.fsMPD4V8.js} +1723 -1743
- package/dist/chunks/{Chart.Dm81lz3L.js → Chart.ClJqWZQS.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.D4Ru1U9N.js → ChatBubbleAssistant.DVPvkwc9.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.CvpUTP0y.js → ChatBubbleUser.BRVFV4OE.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.CDC3cvyT.js → ChatHistoryTable.BCuJEN4O.js} +3 -3
- package/dist/chunks/{HistoryEntry.C_3ek905.js → HistoryEntry.s_vx_csj.js} +107 -113
- package/dist/chunks/{ProfileEntry.BcL78DD5.js → ProfileEntry.ZXG7l__n.js} +2 -2
- package/dist/chunks/{SettingsEntry.F8OD9jcf.js → SettingsEntry.BTa21LvJ.js} +29 -29
- package/dist/chunks/{Table.DvDzjCKJ.js → Table.M89-ZLhi.js} +2 -2
- package/dist/chunks/{UsageEntry.BJMW3Rxc.js → UsageEntry.elc98m0S.js} +3 -3
- package/dist/chunks/{UserMemoriesPanel.BByjrVlZ.js → UserMemoriesPanel.DdkrlC6R.js} +4 -4
- package/dist/chunks/{index.CpmMOFcw.js → index.BZMtXIBc.js} +1 -1
- package/dist/chunks/{index.DZlzg3MC.js → index.Bwc2cdjp.js} +1 -1
- package/dist/chunks/{index.DAjlwxaV.js → index.CxV4ixy4.js} +1 -1
- package/dist/chunks/{index.CRvAVi49.js → index.D7PCvd5q.js} +3 -3
- package/dist/chunks/{index.5sFEsLHg.js → index.Dhc-0s9a.js} +1 -1
- package/dist/chunks/{index.BE-5S88E.js → index.DnRHLO_W.js} +1 -1
- package/dist/chunks/{index.B-4Q-F7F.js → index.DwBFDfmf.js} +2 -2
- package/dist/chunks/{index.ByjDYmg9.js → index.waB0Z6fk.js} +909 -837
- package/dist/chunks/{useMarkdown.4pam55Dz.js → useMarkdown.DUddJwCO.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as h, jsxs as
|
|
1
|
+
import { jsx as h, jsxs as V, Fragment as Or } from "react/jsx-runtime";
|
|
2
2
|
import * as H from "react";
|
|
3
|
-
import oe, { createContext as
|
|
3
|
+
import oe, { createContext as Ft, useReducer as kr, useCallback as X, useRef as j, useEffect as W, useSyncExternalStore as Ks, useContext as ct, useState as ie, useMemo as ze, useId as Gs, useLayoutEffect as Xe, Suspense as Bs, lazy as qs } from "react";
|
|
4
4
|
import y from "clsx";
|
|
5
|
-
var
|
|
5
|
+
var Ne = class {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
8
8
|
}
|
|
@@ -18,7 +18,7 @@ var ke = class {
|
|
|
18
18
|
}
|
|
19
19
|
onUnsubscribe() {
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, Ws = {
|
|
22
22
|
// We need the wrapper function syntax below instead of direct references to
|
|
23
23
|
// global setTimeout etc.
|
|
24
24
|
//
|
|
@@ -33,14 +33,14 @@ var ke = class {
|
|
|
33
33
|
clearTimeout: (e) => clearTimeout(e),
|
|
34
34
|
setInterval: (e, t) => setInterval(e, t),
|
|
35
35
|
clearInterval: (e) => clearInterval(e)
|
|
36
|
-
},
|
|
36
|
+
}, Vs = class {
|
|
37
37
|
// We cannot have TimeoutManager<T> as we must instantiate it with a concrete
|
|
38
38
|
// type at app boot; and if we leave that type, then any new timer provider
|
|
39
39
|
// would need to support ReturnType<typeof setTimeout>, which is infeasible.
|
|
40
40
|
//
|
|
41
41
|
// We settle for type safety for the TimeoutProvider type, and accept that
|
|
42
42
|
// this class is unsafe internally to allow for extension.
|
|
43
|
-
#e =
|
|
43
|
+
#e = Ws;
|
|
44
44
|
#t = !1;
|
|
45
45
|
setTimeoutProvider(e) {
|
|
46
46
|
process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error(
|
|
@@ -60,29 +60,29 @@ var ke = class {
|
|
|
60
60
|
clearInterval(e) {
|
|
61
61
|
this.#e.clearInterval(e);
|
|
62
62
|
}
|
|
63
|
-
},
|
|
64
|
-
function
|
|
63
|
+
}, ge = new Vs();
|
|
64
|
+
function js(e) {
|
|
65
65
|
setTimeout(e, 0);
|
|
66
66
|
}
|
|
67
|
-
var
|
|
68
|
-
function
|
|
67
|
+
var be = typeof window > "u" || "Deno" in globalThis;
|
|
68
|
+
function q() {
|
|
69
69
|
}
|
|
70
70
|
function Qs(e, t) {
|
|
71
71
|
return typeof e == "function" ? e(t) : e;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Ct(e) {
|
|
74
74
|
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Nr(e, t) {
|
|
77
77
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
78
78
|
}
|
|
79
79
|
function de(e, t) {
|
|
80
80
|
return typeof e == "function" ? e(t) : e;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Y(e, t) {
|
|
83
83
|
return typeof e == "function" ? e(t) : e;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function er(e, t) {
|
|
86
86
|
const {
|
|
87
87
|
type: r = "all",
|
|
88
88
|
exact: s,
|
|
@@ -93,9 +93,9 @@ function Zt(e, t) {
|
|
|
93
93
|
} = e;
|
|
94
94
|
if (i) {
|
|
95
95
|
if (s) {
|
|
96
|
-
if (t.queryHash !==
|
|
96
|
+
if (t.queryHash !== Ht(i, t.options))
|
|
97
97
|
return !1;
|
|
98
|
-
} else if (!
|
|
98
|
+
} else if (!De(t.queryKey, i))
|
|
99
99
|
return !1;
|
|
100
100
|
}
|
|
101
101
|
if (r !== "all") {
|
|
@@ -105,37 +105,37 @@ function Zt(e, t) {
|
|
|
105
105
|
}
|
|
106
106
|
return !(typeof o == "boolean" && t.isStale() !== o || a && a !== t.state.fetchStatus || n && !n(t));
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function tr(e, t) {
|
|
109
109
|
const { exact: r, status: s, predicate: a, mutationKey: n } = e;
|
|
110
110
|
if (n) {
|
|
111
111
|
if (!t.options.mutationKey)
|
|
112
112
|
return !1;
|
|
113
113
|
if (r) {
|
|
114
|
-
if (
|
|
114
|
+
if (Ee(t.options.mutationKey) !== Ee(n))
|
|
115
115
|
return !1;
|
|
116
|
-
} else if (!
|
|
116
|
+
} else if (!De(t.options.mutationKey, n))
|
|
117
117
|
return !1;
|
|
118
118
|
}
|
|
119
119
|
return !(s && t.state.status !== s || a && !a(t));
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
return (t?.queryKeyHashFn ||
|
|
121
|
+
function Ht(e, t) {
|
|
122
|
+
return (t?.queryKeyHashFn || Ee)(e);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Ee(e) {
|
|
125
125
|
return JSON.stringify(
|
|
126
126
|
e,
|
|
127
|
-
(t, r) =>
|
|
127
|
+
(t, r) => kt(r) ? Object.keys(r).sort().reduce((s, a) => (s[a] = r[a], s), {}) : r
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((r) =>
|
|
130
|
+
function De(e, t) {
|
|
131
|
+
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((r) => De(e[r], t[r])) : !1;
|
|
132
132
|
}
|
|
133
133
|
var Js = Object.prototype.hasOwnProperty;
|
|
134
|
-
function
|
|
134
|
+
function Ot(e, t) {
|
|
135
135
|
if (e === t)
|
|
136
136
|
return e;
|
|
137
|
-
const r =
|
|
138
|
-
if (!r && !(
|
|
137
|
+
const r = rr(e) && rr(t);
|
|
138
|
+
if (!r && !(kt(e) && kt(t))) return t;
|
|
139
139
|
const a = (r ? e : Object.keys(e)).length, n = r ? t : Object.keys(t), i = n.length, o = r ? new Array(i) : {};
|
|
140
140
|
let c = 0;
|
|
141
141
|
for (let f = 0; f < i; f++) {
|
|
@@ -148,12 +148,12 @@ function Rt(e, t) {
|
|
|
148
148
|
o[d] = l;
|
|
149
149
|
continue;
|
|
150
150
|
}
|
|
151
|
-
const m =
|
|
151
|
+
const m = Ot(u, l);
|
|
152
152
|
o[d] = m, m === u && c++;
|
|
153
153
|
}
|
|
154
154
|
return a === i && c === a ? e : o;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Ze(e, t) {
|
|
157
157
|
if (!t || Object.keys(e).length !== Object.keys(t).length)
|
|
158
158
|
return !1;
|
|
159
159
|
for (const r in e)
|
|
@@ -161,39 +161,39 @@ function Xe(e, t) {
|
|
|
161
161
|
return !1;
|
|
162
162
|
return !0;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function rr(e) {
|
|
165
165
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
if (!
|
|
167
|
+
function kt(e) {
|
|
168
|
+
if (!sr(e))
|
|
169
169
|
return !1;
|
|
170
170
|
const t = e.constructor;
|
|
171
171
|
if (t === void 0)
|
|
172
172
|
return !0;
|
|
173
173
|
const r = t.prototype;
|
|
174
|
-
return !(!
|
|
174
|
+
return !(!sr(r) || !r.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function sr(e) {
|
|
177
177
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
178
178
|
}
|
|
179
179
|
function Ys(e) {
|
|
180
180
|
return new Promise((t) => {
|
|
181
|
-
|
|
181
|
+
ge.setTimeout(t, e);
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function Nt(e, t, r) {
|
|
185
185
|
if (typeof r.structuralSharing == "function")
|
|
186
186
|
return r.structuralSharing(e, t);
|
|
187
187
|
if (r.structuralSharing !== !1) {
|
|
188
188
|
if (process.env.NODE_ENV !== "production")
|
|
189
189
|
try {
|
|
190
|
-
return
|
|
190
|
+
return Ot(e, t);
|
|
191
191
|
} catch (s) {
|
|
192
192
|
throw console.error(
|
|
193
193
|
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${s}`
|
|
194
194
|
), s;
|
|
195
195
|
}
|
|
196
|
-
return
|
|
196
|
+
return Ot(e, t);
|
|
197
197
|
}
|
|
198
198
|
return t;
|
|
199
199
|
}
|
|
@@ -205,22 +205,22 @@ function Xs(e, t, r = 0) {
|
|
|
205
205
|
const s = [t, ...e];
|
|
206
206
|
return r && s.length > r ? s.slice(0, -1) : s;
|
|
207
207
|
}
|
|
208
|
-
var
|
|
209
|
-
function
|
|
210
|
-
return process.env.NODE_ENV !== "production" && e.queryFn ===
|
|
208
|
+
var et = Symbol();
|
|
209
|
+
function Pr(e, t) {
|
|
210
|
+
return process.env.NODE_ENV !== "production" && e.queryFn === et && console.error(
|
|
211
211
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
|
|
212
|
-
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn ===
|
|
212
|
+
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === et ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function $r(e, t) {
|
|
215
215
|
return typeof e == "function" ? e(...t) : !!e;
|
|
216
216
|
}
|
|
217
|
-
var Zs = class extends
|
|
217
|
+
var Zs = class extends Ne {
|
|
218
218
|
#e;
|
|
219
219
|
#t;
|
|
220
220
|
#r;
|
|
221
221
|
constructor() {
|
|
222
222
|
super(), this.#r = (e) => {
|
|
223
|
-
if (!
|
|
223
|
+
if (!be && window.addEventListener) {
|
|
224
224
|
const t = () => e();
|
|
225
225
|
return window.addEventListener("visibilitychange", t, !1), () => {
|
|
226
226
|
window.removeEventListener("visibilitychange", t);
|
|
@@ -251,8 +251,8 @@ var Zs = class extends ke {
|
|
|
251
251
|
isFocused() {
|
|
252
252
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
253
253
|
}
|
|
254
|
-
},
|
|
255
|
-
function
|
|
254
|
+
}, Kt = new Zs();
|
|
255
|
+
function Pt() {
|
|
256
256
|
let e, t;
|
|
257
257
|
const r = new Promise((a, n) => {
|
|
258
258
|
e = a, t = n;
|
|
@@ -274,7 +274,7 @@ function kt() {
|
|
|
274
274
|
}), t(a);
|
|
275
275
|
}, r;
|
|
276
276
|
}
|
|
277
|
-
var ea =
|
|
277
|
+
var ea = js;
|
|
278
278
|
function ta() {
|
|
279
279
|
let e = [], t = 0, r = (o) => {
|
|
280
280
|
o();
|
|
@@ -334,13 +334,13 @@ function ta() {
|
|
|
334
334
|
}
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
var $ = ta(), ra = class extends
|
|
337
|
+
var $ = ta(), ra = class extends Ne {
|
|
338
338
|
#e = !0;
|
|
339
339
|
#t;
|
|
340
340
|
#r;
|
|
341
341
|
constructor() {
|
|
342
342
|
super(), this.#r = (e) => {
|
|
343
|
-
if (!
|
|
343
|
+
if (!be && window.addEventListener) {
|
|
344
344
|
const t = () => e(!0), r = () => e(!1);
|
|
345
345
|
return window.addEventListener("online", t, !1), window.addEventListener("offline", r, !1), () => {
|
|
346
346
|
window.removeEventListener("online", t), window.removeEventListener("offline", r);
|
|
@@ -365,30 +365,30 @@ var $ = ta(), ra = class extends ke {
|
|
|
365
365
|
isOnline() {
|
|
366
366
|
return this.#e;
|
|
367
367
|
}
|
|
368
|
-
},
|
|
368
|
+
}, tt = new ra();
|
|
369
369
|
function sa(e) {
|
|
370
370
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
return (e ?? "online") === "online" ?
|
|
372
|
+
function xr(e) {
|
|
373
|
+
return (e ?? "online") === "online" ? tt.isOnline() : !0;
|
|
374
374
|
}
|
|
375
|
-
var
|
|
375
|
+
var $t = class extends Error {
|
|
376
376
|
constructor(e) {
|
|
377
377
|
super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
function
|
|
380
|
+
function Mr(e) {
|
|
381
381
|
let t = !1, r = 0, s;
|
|
382
|
-
const a =
|
|
382
|
+
const a = Pt(), n = () => a.status !== "pending", i = (g) => {
|
|
383
383
|
if (!n()) {
|
|
384
|
-
const b = new
|
|
384
|
+
const b = new $t(g);
|
|
385
385
|
l(b), e.onCancel?.(b);
|
|
386
386
|
}
|
|
387
387
|
}, o = () => {
|
|
388
388
|
t = !0;
|
|
389
389
|
}, c = () => {
|
|
390
390
|
t = !1;
|
|
391
|
-
}, f = () =>
|
|
391
|
+
}, f = () => Kt.isFocused() && (e.networkMode === "always" || tt.isOnline()) && e.canRun(), d = () => xr(e.networkMode) && e.canRun(), u = (g) => {
|
|
392
392
|
n() || (s?.(), a.resolve(g));
|
|
393
393
|
}, l = (g) => {
|
|
394
394
|
n() || (s?.(), a.reject(g));
|
|
@@ -411,7 +411,7 @@ function xr(e) {
|
|
|
411
411
|
Promise.resolve(g).then(u).catch((E) => {
|
|
412
412
|
if (n())
|
|
413
413
|
return;
|
|
414
|
-
const O = e.retry ?? (
|
|
414
|
+
const O = e.retry ?? (be ? 0 : 3), A = e.retryDelay ?? sa, K = typeof A == "function" ? A(r, E) : A, R = O === !0 || typeof O == "number" && r < O || typeof O == "function" && O(r, E);
|
|
415
415
|
if (t || !R) {
|
|
416
416
|
l(E);
|
|
417
417
|
return;
|
|
@@ -432,26 +432,26 @@ function xr(e) {
|
|
|
432
432
|
start: () => (d() ? p() : m().then(p), a)
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
|
-
var
|
|
435
|
+
var Dr = class {
|
|
436
436
|
#e;
|
|
437
437
|
destroy() {
|
|
438
438
|
this.clearGcTimeout();
|
|
439
439
|
}
|
|
440
440
|
scheduleGc() {
|
|
441
|
-
this.clearGcTimeout(),
|
|
441
|
+
this.clearGcTimeout(), Ct(this.gcTime) && (this.#e = ge.setTimeout(() => {
|
|
442
442
|
this.optionalRemove();
|
|
443
443
|
}, this.gcTime));
|
|
444
444
|
}
|
|
445
445
|
updateGcTime(e) {
|
|
446
446
|
this.gcTime = Math.max(
|
|
447
447
|
this.gcTime || 0,
|
|
448
|
-
e ?? (
|
|
448
|
+
e ?? (be ? 1 / 0 : 300 * 1e3)
|
|
449
449
|
);
|
|
450
450
|
}
|
|
451
451
|
clearGcTimeout() {
|
|
452
|
-
this.#e && (
|
|
452
|
+
this.#e && (ge.clearTimeout(this.#e), this.#e = void 0);
|
|
453
453
|
}
|
|
454
|
-
}, aa = class extends
|
|
454
|
+
}, aa = class extends Dr {
|
|
455
455
|
#e;
|
|
456
456
|
#t;
|
|
457
457
|
#r;
|
|
@@ -460,7 +460,7 @@ var Mr = class {
|
|
|
460
460
|
#i;
|
|
461
461
|
#o;
|
|
462
462
|
constructor(e) {
|
|
463
|
-
super(), this.#o = !1, this.#i = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#a = e.client, this.#r = this.#a.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#e =
|
|
463
|
+
super(), this.#o = !1, this.#i = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#a = e.client, this.#r = this.#a.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#e = ar(this.options), this.state = e.state ?? this.#e, this.scheduleGc();
|
|
464
464
|
}
|
|
465
465
|
get meta() {
|
|
466
466
|
return this.options.meta;
|
|
@@ -470,7 +470,7 @@ var Mr = class {
|
|
|
470
470
|
}
|
|
471
471
|
setOptions(e) {
|
|
472
472
|
if (this.options = { ...this.#i, ...e }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
|
|
473
|
-
const t =
|
|
473
|
+
const t = ar(this.options);
|
|
474
474
|
t.data !== void 0 && (this.setData(t.data, {
|
|
475
475
|
updatedAt: t.dataUpdatedAt,
|
|
476
476
|
manual: !0
|
|
@@ -481,7 +481,7 @@ var Mr = class {
|
|
|
481
481
|
!this.observers.length && this.state.fetchStatus === "idle" && this.#r.remove(this);
|
|
482
482
|
}
|
|
483
483
|
setData(e, t) {
|
|
484
|
-
const r =
|
|
484
|
+
const r = Nt(this.state.data, e, this.options);
|
|
485
485
|
return this.#n({
|
|
486
486
|
data: r,
|
|
487
487
|
type: "success",
|
|
@@ -494,7 +494,7 @@ var Mr = class {
|
|
|
494
494
|
}
|
|
495
495
|
cancel(e) {
|
|
496
496
|
const t = this.#s?.promise;
|
|
497
|
-
return this.#s?.cancel(e), t ? t.then(
|
|
497
|
+
return this.#s?.cancel(e), t ? t.then(q).catch(q) : Promise.resolve();
|
|
498
498
|
}
|
|
499
499
|
destroy() {
|
|
500
500
|
super.destroy(), this.cancel({ silent: !0 });
|
|
@@ -504,11 +504,11 @@ var Mr = class {
|
|
|
504
504
|
}
|
|
505
505
|
isActive() {
|
|
506
506
|
return this.observers.some(
|
|
507
|
-
(e) =>
|
|
507
|
+
(e) => Y(e.options.enabled, this) !== !1
|
|
508
508
|
);
|
|
509
509
|
}
|
|
510
510
|
isDisabled() {
|
|
511
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
511
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === et || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
512
512
|
}
|
|
513
513
|
isStatic() {
|
|
514
514
|
return this.getObserversCount() > 0 ? this.observers.some(
|
|
@@ -521,7 +521,7 @@ var Mr = class {
|
|
|
521
521
|
) : this.state.data === void 0 || this.state.isInvalidated;
|
|
522
522
|
}
|
|
523
523
|
isStaleByTime(e = 0) {
|
|
524
|
-
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !
|
|
524
|
+
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !Nr(this.state.dataUpdatedAt, e);
|
|
525
525
|
}
|
|
526
526
|
onFocus() {
|
|
527
527
|
this.observers.find((t) => t.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#s?.continue();
|
|
@@ -564,7 +564,7 @@ var Mr = class {
|
|
|
564
564
|
get: () => (this.#o = !0, r.signal)
|
|
565
565
|
});
|
|
566
566
|
}, a = () => {
|
|
567
|
-
const o =
|
|
567
|
+
const o = Pr(this.options, t), f = (() => {
|
|
568
568
|
const d = {
|
|
569
569
|
client: this.#a,
|
|
570
570
|
queryKey: this.queryKey,
|
|
@@ -588,11 +588,11 @@ var Mr = class {
|
|
|
588
588
|
};
|
|
589
589
|
return s(o), o;
|
|
590
590
|
})();
|
|
591
|
-
this.options.behavior?.onFetch(i, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== i.fetchOptions?.meta) && this.#n({ type: "fetch", meta: i.fetchOptions?.meta }), this.#s =
|
|
591
|
+
this.options.behavior?.onFetch(i, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== i.fetchOptions?.meta) && this.#n({ type: "fetch", meta: i.fetchOptions?.meta }), this.#s = Mr({
|
|
592
592
|
initialPromise: t?.initialPromise,
|
|
593
593
|
fn: i.fetchFn,
|
|
594
594
|
onCancel: (o) => {
|
|
595
|
-
o instanceof
|
|
595
|
+
o instanceof $t && o.revert && this.setState({
|
|
596
596
|
...this.#t,
|
|
597
597
|
fetchStatus: "idle"
|
|
598
598
|
}), r.abort();
|
|
@@ -623,7 +623,7 @@ var Mr = class {
|
|
|
623
623
|
this
|
|
624
624
|
), o;
|
|
625
625
|
} catch (o) {
|
|
626
|
-
if (o instanceof
|
|
626
|
+
if (o instanceof $t) {
|
|
627
627
|
if (o.silent)
|
|
628
628
|
return this.#s.promise;
|
|
629
629
|
if (o.revert) {
|
|
@@ -669,7 +669,7 @@ var Mr = class {
|
|
|
669
669
|
case "fetch":
|
|
670
670
|
return {
|
|
671
671
|
...r,
|
|
672
|
-
...
|
|
672
|
+
...Lr(r.data, this.options),
|
|
673
673
|
fetchMeta: e.meta ?? null
|
|
674
674
|
};
|
|
675
675
|
case "success":
|
|
@@ -719,18 +719,18 @@ var Mr = class {
|
|
|
719
719
|
});
|
|
720
720
|
}
|
|
721
721
|
};
|
|
722
|
-
function
|
|
722
|
+
function Lr(e, t) {
|
|
723
723
|
return {
|
|
724
724
|
fetchFailureCount: 0,
|
|
725
725
|
fetchFailureReason: null,
|
|
726
|
-
fetchStatus:
|
|
726
|
+
fetchStatus: xr(t.networkMode) ? "fetching" : "paused",
|
|
727
727
|
...e === void 0 && {
|
|
728
728
|
error: null,
|
|
729
729
|
status: "pending"
|
|
730
730
|
}
|
|
731
731
|
};
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function ar(e) {
|
|
734
734
|
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, r = t !== void 0, s = r ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
735
735
|
return {
|
|
736
736
|
data: t,
|
|
@@ -747,9 +747,9 @@ function sr(e) {
|
|
|
747
747
|
fetchStatus: "idle"
|
|
748
748
|
};
|
|
749
749
|
}
|
|
750
|
-
var na = class extends
|
|
750
|
+
var na = class extends Ne {
|
|
751
751
|
constructor(e, t) {
|
|
752
|
-
super(), this.options = t, this.#e = e, this.#n = null, this.#o =
|
|
752
|
+
super(), this.options = t, this.#e = e, this.#n = null, this.#o = Pt(), this.bindMethods(), this.setOptions(t);
|
|
753
753
|
}
|
|
754
754
|
#e;
|
|
755
755
|
#t = void 0;
|
|
@@ -772,20 +772,20 @@ var na = class extends ke {
|
|
|
772
772
|
this.refetch = this.refetch.bind(this);
|
|
773
773
|
}
|
|
774
774
|
onSubscribe() {
|
|
775
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
775
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), nr(this.#t, this.options) ? this.#d() : this.updateResult(), this.#E());
|
|
776
776
|
}
|
|
777
777
|
onUnsubscribe() {
|
|
778
778
|
this.hasListeners() || this.destroy();
|
|
779
779
|
}
|
|
780
780
|
shouldFetchOnReconnect() {
|
|
781
|
-
return
|
|
781
|
+
return xt(
|
|
782
782
|
this.#t,
|
|
783
783
|
this.options,
|
|
784
784
|
this.options.refetchOnReconnect
|
|
785
785
|
);
|
|
786
786
|
}
|
|
787
787
|
shouldFetchOnWindowFocus() {
|
|
788
|
-
return
|
|
788
|
+
return xt(
|
|
789
789
|
this.#t,
|
|
790
790
|
this.options,
|
|
791
791
|
this.options.refetchOnWindowFocus
|
|
@@ -796,24 +796,24 @@ var na = class extends ke {
|
|
|
796
796
|
}
|
|
797
797
|
setOptions(e) {
|
|
798
798
|
const t = this.options, r = this.#t;
|
|
799
|
-
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof
|
|
799
|
+
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof Y(this.options.enabled, this.#t) != "boolean")
|
|
800
800
|
throw new Error(
|
|
801
801
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
802
802
|
);
|
|
803
|
-
this.#v(), this.#t.setOptions(this.options), t._defaulted && !
|
|
803
|
+
this.#v(), this.#t.setOptions(this.options), t._defaulted && !Ze(this.options, t) && this.#e.getQueryCache().notify({
|
|
804
804
|
type: "observerOptionsUpdated",
|
|
805
805
|
query: this.#t,
|
|
806
806
|
observer: this
|
|
807
807
|
});
|
|
808
808
|
const s = this.hasListeners();
|
|
809
|
-
s &&
|
|
809
|
+
s && ir(
|
|
810
810
|
this.#t,
|
|
811
811
|
r,
|
|
812
812
|
this.options,
|
|
813
813
|
t
|
|
814
|
-
) && this.#d(), this.updateResult(), s && (this.#t !== r ||
|
|
814
|
+
) && this.#d(), this.updateResult(), s && (this.#t !== r || Y(this.options.enabled, this.#t) !== Y(t.enabled, this.#t) || de(this.options.staleTime, this.#t) !== de(t.staleTime, this.#t)) && this.#y();
|
|
815
815
|
const a = this.#g();
|
|
816
|
-
s && (this.#t !== r ||
|
|
816
|
+
s && (this.#t !== r || Y(this.options.enabled, this.#t) !== Y(t.enabled, this.#t) || a !== this.#c) && this.#b(a);
|
|
817
817
|
}
|
|
818
818
|
getOptimisticResult(e) {
|
|
819
819
|
const t = this.#e.getQueryCache().build(this.#e, e), r = this.createResult(t, e);
|
|
@@ -858,7 +858,7 @@ var na = class extends ke {
|
|
|
858
858
|
this.options,
|
|
859
859
|
e
|
|
860
860
|
);
|
|
861
|
-
return e?.throwOnError || (t = t.catch(
|
|
861
|
+
return e?.throwOnError || (t = t.catch(q)), t;
|
|
862
862
|
}
|
|
863
863
|
#y() {
|
|
864
864
|
this.#w();
|
|
@@ -866,10 +866,10 @@ var na = class extends ke {
|
|
|
866
866
|
this.options.staleTime,
|
|
867
867
|
this.#t
|
|
868
868
|
);
|
|
869
|
-
if (
|
|
869
|
+
if (be || this.#a.isStale || !Ct(e))
|
|
870
870
|
return;
|
|
871
|
-
const r =
|
|
872
|
-
this.#l =
|
|
871
|
+
const r = Nr(this.#a.dataUpdatedAt, e) + 1;
|
|
872
|
+
this.#l = ge.setTimeout(() => {
|
|
873
873
|
this.#a.isStale || this.updateResult();
|
|
874
874
|
}, r);
|
|
875
875
|
}
|
|
@@ -877,27 +877,27 @@ var na = class extends ke {
|
|
|
877
877
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
878
878
|
}
|
|
879
879
|
#b(e) {
|
|
880
|
-
this.#S(), this.#c = e, !(
|
|
881
|
-
(this.options.refetchIntervalInBackground ||
|
|
880
|
+
this.#S(), this.#c = e, !(be || Y(this.options.enabled, this.#t) === !1 || !Ct(this.#c) || this.#c === 0) && (this.#u = ge.setInterval(() => {
|
|
881
|
+
(this.options.refetchIntervalInBackground || Kt.isFocused()) && this.#d();
|
|
882
882
|
}, this.#c));
|
|
883
883
|
}
|
|
884
884
|
#E() {
|
|
885
885
|
this.#y(), this.#b(this.#g());
|
|
886
886
|
}
|
|
887
887
|
#w() {
|
|
888
|
-
this.#l && (
|
|
888
|
+
this.#l && (ge.clearTimeout(this.#l), this.#l = void 0);
|
|
889
889
|
}
|
|
890
890
|
#S() {
|
|
891
|
-
this.#u && (
|
|
891
|
+
this.#u && (ge.clearInterval(this.#u), this.#u = void 0);
|
|
892
892
|
}
|
|
893
893
|
createResult(e, t) {
|
|
894
894
|
const r = this.#t, s = this.options, a = this.#a, n = this.#s, i = this.#i, c = e !== r ? e.state : this.#r, { state: f } = e;
|
|
895
895
|
let d = { ...f }, u = !1, l;
|
|
896
896
|
if (t._optimisticResults) {
|
|
897
|
-
const v = this.hasListeners(), x = !v &&
|
|
897
|
+
const v = this.hasListeners(), x = !v && nr(e, t), _ = v && ir(e, r, t, s);
|
|
898
898
|
(x || _) && (d = {
|
|
899
899
|
...d,
|
|
900
|
-
...
|
|
900
|
+
...Lr(f.data, e.options)
|
|
901
901
|
}), t._optimisticResults === "isRestoring" && (d.fetchStatus = "idle");
|
|
902
902
|
}
|
|
903
903
|
let { error: m, errorUpdatedAt: p, status: g } = d;
|
|
@@ -908,7 +908,7 @@ var na = class extends ke {
|
|
|
908
908
|
a?.isPlaceholderData && t.placeholderData === i?.placeholderData ? (v = a.data, b = !0) : v = typeof t.placeholderData == "function" ? t.placeholderData(
|
|
909
909
|
this.#f?.state.data,
|
|
910
910
|
this.#f
|
|
911
|
-
) : t.placeholderData, v !== void 0 && (g = "success", l =
|
|
911
|
+
) : t.placeholderData, v !== void 0 && (g = "success", l = Nt(
|
|
912
912
|
a?.data,
|
|
913
913
|
v,
|
|
914
914
|
t
|
|
@@ -919,7 +919,7 @@ var na = class extends ke {
|
|
|
919
919
|
l = this.#h;
|
|
920
920
|
else
|
|
921
921
|
try {
|
|
922
|
-
this.#p = t.select, l = t.select(l), l =
|
|
922
|
+
this.#p = t.select, l = t.select(l), l = Nt(a?.data, l, t), this.#h = l, this.#n = null;
|
|
923
923
|
} catch (v) {
|
|
924
924
|
this.#n = v;
|
|
925
925
|
}
|
|
@@ -947,16 +947,16 @@ var na = class extends ke {
|
|
|
947
947
|
isPaused: d.fetchStatus === "paused",
|
|
948
948
|
isPlaceholderData: u,
|
|
949
949
|
isRefetchError: A && R,
|
|
950
|
-
isStale:
|
|
950
|
+
isStale: Gt(e, t),
|
|
951
951
|
refetch: this.refetch,
|
|
952
952
|
promise: this.#o,
|
|
953
|
-
isEnabled:
|
|
953
|
+
isEnabled: Y(t.enabled, e) !== !1
|
|
954
954
|
};
|
|
955
955
|
if (this.options.experimental_prefetchInRender) {
|
|
956
956
|
const v = (I) => {
|
|
957
957
|
C.status === "error" ? I.reject(C.error) : C.data !== void 0 && I.resolve(C.data);
|
|
958
958
|
}, x = () => {
|
|
959
|
-
const I = this.#o = C.promise =
|
|
959
|
+
const I = this.#o = C.promise = Pt();
|
|
960
960
|
v(I);
|
|
961
961
|
}, _ = this.#o;
|
|
962
962
|
switch (_.status) {
|
|
@@ -975,7 +975,7 @@ var na = class extends ke {
|
|
|
975
975
|
}
|
|
976
976
|
updateResult() {
|
|
977
977
|
const e = this.#a, t = this.createResult(this.#t, this.options);
|
|
978
|
-
if (this.#s = this.#t.state, this.#i = this.options, this.#s.data !== void 0 && (this.#f = this.#t),
|
|
978
|
+
if (this.#s = this.#t.state, this.#i = this.options, this.#s.data !== void 0 && (this.#f = this.#t), Ze(t, e))
|
|
979
979
|
return;
|
|
980
980
|
this.#a = t;
|
|
981
981
|
const r = () => {
|
|
@@ -1016,28 +1016,28 @@ var na = class extends ke {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
};
|
|
1018
1018
|
function ia(e, t) {
|
|
1019
|
-
return
|
|
1019
|
+
return Y(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1022
|
-
return ia(e, t) || e.state.data !== void 0 &&
|
|
1021
|
+
function nr(e, t) {
|
|
1022
|
+
return ia(e, t) || e.state.data !== void 0 && xt(e, t, t.refetchOnMount);
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1025
|
-
if (
|
|
1024
|
+
function xt(e, t, r) {
|
|
1025
|
+
if (Y(t.enabled, e) !== !1 && de(t.staleTime, e) !== "static") {
|
|
1026
1026
|
const s = typeof r == "function" ? r(e) : r;
|
|
1027
|
-
return s === "always" || s !== !1 &&
|
|
1027
|
+
return s === "always" || s !== !1 && Gt(e, t);
|
|
1028
1028
|
}
|
|
1029
1029
|
return !1;
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return (e !== t ||
|
|
1031
|
+
function ir(e, t, r, s) {
|
|
1032
|
+
return (e !== t || Y(s.enabled, e) === !1) && (!r.suspense || e.state.status !== "error") && Gt(e, r);
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1035
|
-
return
|
|
1034
|
+
function Gt(e, t) {
|
|
1035
|
+
return Y(t.enabled, e) !== !1 && e.isStaleByTime(de(t.staleTime, e));
|
|
1036
1036
|
}
|
|
1037
1037
|
function oa(e, t) {
|
|
1038
|
-
return !
|
|
1038
|
+
return !Ze(e.getCurrentResult(), t);
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function or(e) {
|
|
1041
1041
|
return {
|
|
1042
1042
|
onFetch: (t, r) => {
|
|
1043
1043
|
const s = t.options, a = t.fetchOptions?.meta?.fetchMore?.direction, n = t.state.data?.pages || [], i = t.state.data?.pageParams || [];
|
|
@@ -1051,20 +1051,20 @@ function ir(e) {
|
|
|
1051
1051
|
d = !0;
|
|
1052
1052
|
}), t.signal)
|
|
1053
1053
|
});
|
|
1054
|
-
}, l =
|
|
1054
|
+
}, l = Pr(t.options, t.fetchOptions), m = async (p, g, b) => {
|
|
1055
1055
|
if (d)
|
|
1056
1056
|
return Promise.reject();
|
|
1057
1057
|
if (g == null && p.pages.length)
|
|
1058
1058
|
return Promise.resolve(p);
|
|
1059
1059
|
const O = (() => {
|
|
1060
|
-
const
|
|
1060
|
+
const z = {
|
|
1061
1061
|
client: t.client,
|
|
1062
1062
|
queryKey: t.queryKey,
|
|
1063
1063
|
pageParam: g,
|
|
1064
1064
|
direction: b ? "backward" : "forward",
|
|
1065
1065
|
meta: t.options.meta
|
|
1066
1066
|
};
|
|
1067
|
-
return u(
|
|
1067
|
+
return u(z), z;
|
|
1068
1068
|
})(), A = await l(O), { maxPages: K } = t.options, R = b ? Xs : zs;
|
|
1069
1069
|
return {
|
|
1070
1070
|
pages: R(p.pages, A, K),
|
|
@@ -1072,7 +1072,7 @@ function ir(e) {
|
|
|
1072
1072
|
};
|
|
1073
1073
|
};
|
|
1074
1074
|
if (a && n.length) {
|
|
1075
|
-
const p = a === "backward", g = p ? ca :
|
|
1075
|
+
const p = a === "backward", g = p ? ca : cr, b = {
|
|
1076
1076
|
pages: n,
|
|
1077
1077
|
pageParams: i
|
|
1078
1078
|
}, E = g(s, b);
|
|
@@ -1080,7 +1080,7 @@ function ir(e) {
|
|
|
1080
1080
|
} else {
|
|
1081
1081
|
const p = e ?? n.length;
|
|
1082
1082
|
do {
|
|
1083
|
-
const g = c === 0 ? i[0] ?? s.initialPageParam :
|
|
1083
|
+
const g = c === 0 ? i[0] ?? s.initialPageParam : cr(s, o);
|
|
1084
1084
|
if (c > 0 && g == null)
|
|
1085
1085
|
break;
|
|
1086
1086
|
o = await m(o, g), c++;
|
|
@@ -1101,7 +1101,7 @@ function ir(e) {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function cr(e, { pages: t, pageParams: r }) {
|
|
1105
1105
|
const s = t.length - 1;
|
|
1106
1106
|
return t.length > 0 ? e.getNextPageParam(
|
|
1107
1107
|
t[s],
|
|
@@ -1113,13 +1113,13 @@ function or(e, { pages: t, pageParams: r }) {
|
|
|
1113
1113
|
function ca(e, { pages: t, pageParams: r }) {
|
|
1114
1114
|
return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, r[0], r) : void 0;
|
|
1115
1115
|
}
|
|
1116
|
-
var la = class extends
|
|
1116
|
+
var la = class extends Dr {
|
|
1117
1117
|
#e;
|
|
1118
1118
|
#t;
|
|
1119
1119
|
#r;
|
|
1120
1120
|
#a;
|
|
1121
1121
|
constructor(e) {
|
|
1122
|
-
super(), this.#e = e.client, this.mutationId = e.mutationId, this.#r = e.mutationCache, this.#t = [], this.state = e.state ||
|
|
1122
|
+
super(), this.#e = e.client, this.mutationId = e.mutationId, this.#r = e.mutationCache, this.#t = [], this.state = e.state || Ur(), this.setOptions(e.options), this.scheduleGc();
|
|
1123
1123
|
}
|
|
1124
1124
|
setOptions(e) {
|
|
1125
1125
|
this.options = e, this.updateGcTime(this.options.gcTime);
|
|
@@ -1156,7 +1156,7 @@ var la = class extends Mr {
|
|
|
1156
1156
|
meta: this.options.meta,
|
|
1157
1157
|
mutationKey: this.options.mutationKey
|
|
1158
1158
|
};
|
|
1159
|
-
this.#a =
|
|
1159
|
+
this.#a = Mr({
|
|
1160
1160
|
fn: () => this.options.mutationFn ? this.options.mutationFn(e, r) : Promise.reject(new Error("No mutationFn found")),
|
|
1161
1161
|
onFail: (n, i) => {
|
|
1162
1162
|
this.#s({ type: "failed", failureCount: n, error: i });
|
|
@@ -1316,7 +1316,7 @@ var la = class extends Mr {
|
|
|
1316
1316
|
});
|
|
1317
1317
|
}
|
|
1318
1318
|
};
|
|
1319
|
-
function
|
|
1319
|
+
function Ur() {
|
|
1320
1320
|
return {
|
|
1321
1321
|
context: void 0,
|
|
1322
1322
|
data: void 0,
|
|
@@ -1329,7 +1329,7 @@ function Lr() {
|
|
|
1329
1329
|
submittedAt: 0
|
|
1330
1330
|
};
|
|
1331
1331
|
}
|
|
1332
|
-
var ua = class extends
|
|
1332
|
+
var ua = class extends Ne {
|
|
1333
1333
|
constructor(e = {}) {
|
|
1334
1334
|
super(), this.config = e, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#r = 0;
|
|
1335
1335
|
}
|
|
@@ -1348,7 +1348,7 @@ var ua = class extends ke {
|
|
|
1348
1348
|
}
|
|
1349
1349
|
add(e) {
|
|
1350
1350
|
this.#e.add(e);
|
|
1351
|
-
const t =
|
|
1351
|
+
const t = Ke(e);
|
|
1352
1352
|
if (typeof t == "string") {
|
|
1353
1353
|
const r = this.#t.get(t);
|
|
1354
1354
|
r ? r.push(e) : this.#t.set(t, [e]);
|
|
@@ -1357,7 +1357,7 @@ var ua = class extends ke {
|
|
|
1357
1357
|
}
|
|
1358
1358
|
remove(e) {
|
|
1359
1359
|
if (this.#e.delete(e)) {
|
|
1360
|
-
const t =
|
|
1360
|
+
const t = Ke(e);
|
|
1361
1361
|
if (typeof t == "string") {
|
|
1362
1362
|
const r = this.#t.get(t);
|
|
1363
1363
|
if (r)
|
|
@@ -1370,7 +1370,7 @@ var ua = class extends ke {
|
|
|
1370
1370
|
this.notify({ type: "removed", mutation: e });
|
|
1371
1371
|
}
|
|
1372
1372
|
canRun(e) {
|
|
1373
|
-
const t =
|
|
1373
|
+
const t = Ke(e);
|
|
1374
1374
|
if (typeof t == "string") {
|
|
1375
1375
|
const s = this.#t.get(t)?.find(
|
|
1376
1376
|
(a) => a.state.status === "pending"
|
|
@@ -1380,7 +1380,7 @@ var ua = class extends ke {
|
|
|
1380
1380
|
return !0;
|
|
1381
1381
|
}
|
|
1382
1382
|
runNext(e) {
|
|
1383
|
-
const t =
|
|
1383
|
+
const t = Ke(e);
|
|
1384
1384
|
return typeof t == "string" ? this.#t.get(t)?.find((s) => s !== e && s.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
|
|
1385
1385
|
}
|
|
1386
1386
|
clear() {
|
|
@@ -1396,11 +1396,11 @@ var ua = class extends ke {
|
|
|
1396
1396
|
find(e) {
|
|
1397
1397
|
const t = { exact: !0, ...e };
|
|
1398
1398
|
return this.getAll().find(
|
|
1399
|
-
(r) =>
|
|
1399
|
+
(r) => tr(t, r)
|
|
1400
1400
|
);
|
|
1401
1401
|
}
|
|
1402
1402
|
findAll(e = {}) {
|
|
1403
|
-
return this.getAll().filter((t) =>
|
|
1403
|
+
return this.getAll().filter((t) => tr(e, t));
|
|
1404
1404
|
}
|
|
1405
1405
|
notify(e) {
|
|
1406
1406
|
$.batch(() => {
|
|
@@ -1413,15 +1413,15 @@ var ua = class extends ke {
|
|
|
1413
1413
|
const e = this.getAll().filter((t) => t.state.isPaused);
|
|
1414
1414
|
return $.batch(
|
|
1415
1415
|
() => Promise.all(
|
|
1416
|
-
e.map((t) => t.continue().catch(
|
|
1416
|
+
e.map((t) => t.continue().catch(q))
|
|
1417
1417
|
)
|
|
1418
1418
|
);
|
|
1419
1419
|
}
|
|
1420
1420
|
};
|
|
1421
|
-
function
|
|
1421
|
+
function Ke(e) {
|
|
1422
1422
|
return e.options.scope?.id;
|
|
1423
1423
|
}
|
|
1424
|
-
var da = class extends
|
|
1424
|
+
var da = class extends Ne {
|
|
1425
1425
|
#e;
|
|
1426
1426
|
#t = void 0;
|
|
1427
1427
|
#r;
|
|
@@ -1434,11 +1434,11 @@ var da = class extends ke {
|
|
|
1434
1434
|
}
|
|
1435
1435
|
setOptions(e) {
|
|
1436
1436
|
const t = this.options;
|
|
1437
|
-
this.options = this.#e.defaultMutationOptions(e),
|
|
1437
|
+
this.options = this.#e.defaultMutationOptions(e), Ze(this.options, t) || this.#e.getMutationCache().notify({
|
|
1438
1438
|
type: "observerOptionsUpdated",
|
|
1439
1439
|
mutation: this.#r,
|
|
1440
1440
|
observer: this
|
|
1441
|
-
}), t?.mutationKey && this.options.mutationKey &&
|
|
1441
|
+
}), t?.mutationKey && this.options.mutationKey && Ee(t.mutationKey) !== Ee(this.options.mutationKey) ? this.reset() : this.#r?.state.status === "pending" && this.#r.setOptions(this.options);
|
|
1442
1442
|
}
|
|
1443
1443
|
onUnsubscribe() {
|
|
1444
1444
|
this.hasListeners() || this.#r?.removeObserver(this);
|
|
@@ -1456,7 +1456,7 @@ var da = class extends ke {
|
|
|
1456
1456
|
return this.#a = t, this.#r?.removeObserver(this), this.#r = this.#e.getMutationCache().build(this.#e, this.options), this.#r.addObserver(this), this.#r.execute(e);
|
|
1457
1457
|
}
|
|
1458
1458
|
#s() {
|
|
1459
|
-
const e = this.#r?.state ??
|
|
1459
|
+
const e = this.#r?.state ?? Ur();
|
|
1460
1460
|
this.#t = {
|
|
1461
1461
|
...e,
|
|
1462
1462
|
isPending: e.status === "pending",
|
|
@@ -1504,13 +1504,13 @@ var da = class extends ke {
|
|
|
1504
1504
|
});
|
|
1505
1505
|
});
|
|
1506
1506
|
}
|
|
1507
|
-
}, ha = class extends
|
|
1507
|
+
}, ha = class extends Ne {
|
|
1508
1508
|
constructor(e = {}) {
|
|
1509
1509
|
super(), this.config = e, this.#e = /* @__PURE__ */ new Map();
|
|
1510
1510
|
}
|
|
1511
1511
|
#e;
|
|
1512
1512
|
build(e, t, r) {
|
|
1513
|
-
const s = t.queryKey, a = t.queryHash ??
|
|
1513
|
+
const s = t.queryKey, a = t.queryHash ?? Ht(s, t);
|
|
1514
1514
|
let n = this.get(a);
|
|
1515
1515
|
return n || (n = new aa({
|
|
1516
1516
|
client: e,
|
|
@@ -1547,12 +1547,12 @@ var da = class extends ke {
|
|
|
1547
1547
|
find(e) {
|
|
1548
1548
|
const t = { exact: !0, ...e };
|
|
1549
1549
|
return this.getAll().find(
|
|
1550
|
-
(r) =>
|
|
1550
|
+
(r) => er(t, r)
|
|
1551
1551
|
);
|
|
1552
1552
|
}
|
|
1553
1553
|
findAll(e = {}) {
|
|
1554
1554
|
const t = this.getAll();
|
|
1555
|
-
return Object.keys(e).length > 0 ? t.filter((r) =>
|
|
1555
|
+
return Object.keys(e).length > 0 ? t.filter((r) => er(e, r)) : t;
|
|
1556
1556
|
}
|
|
1557
1557
|
notify(e) {
|
|
1558
1558
|
$.batch(() => {
|
|
@@ -1588,9 +1588,9 @@ var da = class extends ke {
|
|
|
1588
1588
|
this.#e = e.queryCache || new ha(), this.#t = e.mutationCache || new ua(), this.#r = e.defaultOptions || {}, this.#a = /* @__PURE__ */ new Map(), this.#s = /* @__PURE__ */ new Map(), this.#i = 0;
|
|
1589
1589
|
}
|
|
1590
1590
|
mount() {
|
|
1591
|
-
this.#i++, this.#i === 1 && (this.#o =
|
|
1591
|
+
this.#i++, this.#i === 1 && (this.#o = Kt.subscribe(async (e) => {
|
|
1592
1592
|
e && (await this.resumePausedMutations(), this.#e.onFocus());
|
|
1593
|
-
}), this.#n =
|
|
1593
|
+
}), this.#n = tt.subscribe(async (e) => {
|
|
1594
1594
|
e && (await this.resumePausedMutations(), this.#e.onOnline());
|
|
1595
1595
|
}));
|
|
1596
1596
|
}
|
|
@@ -1669,7 +1669,7 @@ var da = class extends ke {
|
|
|
1669
1669
|
const r = { revert: !0, ...t }, s = $.batch(
|
|
1670
1670
|
() => this.#e.findAll(e).map((a) => a.cancel(r))
|
|
1671
1671
|
);
|
|
1672
|
-
return Promise.all(s).then(
|
|
1672
|
+
return Promise.all(s).then(q).catch(q);
|
|
1673
1673
|
}
|
|
1674
1674
|
invalidateQueries(e, t = {}) {
|
|
1675
1675
|
return $.batch(() => (this.#e.findAll(e).forEach((r) => {
|
|
@@ -1689,10 +1689,10 @@ var da = class extends ke {
|
|
|
1689
1689
|
}, s = $.batch(
|
|
1690
1690
|
() => this.#e.findAll(e).filter((a) => !a.isDisabled() && !a.isStatic()).map((a) => {
|
|
1691
1691
|
let n = a.fetch(void 0, r);
|
|
1692
|
-
return r.throwOnError || (n = n.catch(
|
|
1692
|
+
return r.throwOnError || (n = n.catch(q)), a.state.fetchStatus === "paused" ? Promise.resolve() : n;
|
|
1693
1693
|
})
|
|
1694
1694
|
);
|
|
1695
|
-
return Promise.all(s).then(
|
|
1695
|
+
return Promise.all(s).then(q);
|
|
1696
1696
|
}
|
|
1697
1697
|
fetchQuery(e) {
|
|
1698
1698
|
const t = this.defaultQueryOptions(e);
|
|
@@ -1703,19 +1703,19 @@ var da = class extends ke {
|
|
|
1703
1703
|
) ? r.fetch(t) : Promise.resolve(r.state.data);
|
|
1704
1704
|
}
|
|
1705
1705
|
prefetchQuery(e) {
|
|
1706
|
-
return this.fetchQuery(e).then(
|
|
1706
|
+
return this.fetchQuery(e).then(q).catch(q);
|
|
1707
1707
|
}
|
|
1708
1708
|
fetchInfiniteQuery(e) {
|
|
1709
|
-
return e.behavior =
|
|
1709
|
+
return e.behavior = or(e.pages), this.fetchQuery(e);
|
|
1710
1710
|
}
|
|
1711
1711
|
prefetchInfiniteQuery(e) {
|
|
1712
|
-
return this.fetchInfiniteQuery(e).then(
|
|
1712
|
+
return this.fetchInfiniteQuery(e).then(q).catch(q);
|
|
1713
1713
|
}
|
|
1714
1714
|
ensureInfiniteQueryData(e) {
|
|
1715
|
-
return e.behavior =
|
|
1715
|
+
return e.behavior = or(e.pages), this.ensureQueryData(e);
|
|
1716
1716
|
}
|
|
1717
1717
|
resumePausedMutations() {
|
|
1718
|
-
return
|
|
1718
|
+
return tt.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
|
|
1719
1719
|
}
|
|
1720
1720
|
getQueryCache() {
|
|
1721
1721
|
return this.#e;
|
|
@@ -1730,7 +1730,7 @@ var da = class extends ke {
|
|
|
1730
1730
|
this.#r = e;
|
|
1731
1731
|
}
|
|
1732
1732
|
setQueryDefaults(e, t) {
|
|
1733
|
-
this.#a.set(
|
|
1733
|
+
this.#a.set(Ee(e), {
|
|
1734
1734
|
queryKey: e,
|
|
1735
1735
|
defaultOptions: t
|
|
1736
1736
|
});
|
|
@@ -1738,11 +1738,11 @@ var da = class extends ke {
|
|
|
1738
1738
|
getQueryDefaults(e) {
|
|
1739
1739
|
const t = [...this.#a.values()], r = {};
|
|
1740
1740
|
return t.forEach((s) => {
|
|
1741
|
-
|
|
1741
|
+
De(e, s.queryKey) && Object.assign(r, s.defaultOptions);
|
|
1742
1742
|
}), r;
|
|
1743
1743
|
}
|
|
1744
1744
|
setMutationDefaults(e, t) {
|
|
1745
|
-
this.#s.set(
|
|
1745
|
+
this.#s.set(Ee(e), {
|
|
1746
1746
|
mutationKey: e,
|
|
1747
1747
|
defaultOptions: t
|
|
1748
1748
|
});
|
|
@@ -1750,7 +1750,7 @@ var da = class extends ke {
|
|
|
1750
1750
|
getMutationDefaults(e) {
|
|
1751
1751
|
const t = [...this.#s.values()], r = {};
|
|
1752
1752
|
return t.forEach((s) => {
|
|
1753
|
-
|
|
1753
|
+
De(e, s.mutationKey) && Object.assign(r, s.defaultOptions);
|
|
1754
1754
|
}), r;
|
|
1755
1755
|
}
|
|
1756
1756
|
defaultQueryOptions(e) {
|
|
@@ -1762,10 +1762,10 @@ var da = class extends ke {
|
|
|
1762
1762
|
...e,
|
|
1763
1763
|
_defaulted: !0
|
|
1764
1764
|
};
|
|
1765
|
-
return t.queryHash || (t.queryHash =
|
|
1765
|
+
return t.queryHash || (t.queryHash = Ht(
|
|
1766
1766
|
t.queryKey,
|
|
1767
1767
|
t
|
|
1768
|
-
)), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn ===
|
|
1768
|
+
)), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === et && (t.enabled = !1), t;
|
|
1769
1769
|
}
|
|
1770
1770
|
defaultMutationOptions(e) {
|
|
1771
1771
|
return e?._defaulted ? e : {
|
|
@@ -1778,10 +1778,10 @@ var da = class extends ke {
|
|
|
1778
1778
|
clear() {
|
|
1779
1779
|
this.#e.clear(), this.#t.clear();
|
|
1780
1780
|
}
|
|
1781
|
-
},
|
|
1781
|
+
}, Fr = H.createContext(
|
|
1782
1782
|
void 0
|
|
1783
|
-
),
|
|
1784
|
-
const t = H.useContext(
|
|
1783
|
+
), he = (e) => {
|
|
1784
|
+
const t = H.useContext(Fr);
|
|
1785
1785
|
if (!t)
|
|
1786
1786
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1787
1787
|
return t;
|
|
@@ -1790,7 +1790,7 @@ var da = class extends ke {
|
|
|
1790
1790
|
children: t
|
|
1791
1791
|
}) => (H.useEffect(() => (e.mount(), () => {
|
|
1792
1792
|
e.unmount();
|
|
1793
|
-
}), [e]), /* @__PURE__ */ h(
|
|
1793
|
+
}), [e]), /* @__PURE__ */ h(Fr.Provider, { value: e, children: t })), pa = H.createContext(!1), ya = () => H.useContext(pa);
|
|
1794
1794
|
function ga() {
|
|
1795
1795
|
let e = !1;
|
|
1796
1796
|
return {
|
|
@@ -1815,7 +1815,7 @@ var ba = H.createContext(ga()), Ea = () => H.useContext(ba), wa = (e, t) => {
|
|
|
1815
1815
|
throwOnError: r,
|
|
1816
1816
|
query: s,
|
|
1817
1817
|
suspense: a
|
|
1818
|
-
}) => e.isError && !t.isReset() && !e.isFetching && s && (a && e.data === void 0 ||
|
|
1818
|
+
}) => e.isError && !t.isReset() && !e.isFetching && s && (a && e.data === void 0 || $r(r, [e.error, s])), Ta = (e) => {
|
|
1819
1819
|
if (e.suspense) {
|
|
1820
1820
|
const r = (a) => a === "static" ? a : Math.max(a ?? 1e3, 1e3), s = e.staleTime;
|
|
1821
1821
|
e.staleTime = typeof s == "function" ? (...a) => r(s(...a)) : r(s), typeof e.gcTime == "number" && (e.gcTime = Math.max(
|
|
@@ -1823,7 +1823,7 @@ var ba = H.createContext(ga()), Ea = () => H.useContext(ba), wa = (e, t) => {
|
|
|
1823
1823
|
1e3
|
|
1824
1824
|
));
|
|
1825
1825
|
}
|
|
1826
|
-
}, Aa = (e, t) => e.isLoading && e.isFetching && !t, Ia = (e, t) => e?.suspense && t.isPending,
|
|
1826
|
+
}, Aa = (e, t) => e.isLoading && e.isFetching && !t, Ia = (e, t) => e?.suspense && t.isPending, lr = (e, t, r) => t.fetchOptimistic(e).catch(() => {
|
|
1827
1827
|
r.clearReset();
|
|
1828
1828
|
});
|
|
1829
1829
|
function _a(e, t, r) {
|
|
@@ -1831,7 +1831,7 @@ function _a(e, t, r) {
|
|
|
1831
1831
|
throw new Error(
|
|
1832
1832
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
1833
1833
|
);
|
|
1834
|
-
const s = ya(), a = Ea(), n =
|
|
1834
|
+
const s = ya(), a = Ea(), n = he(), i = n.defaultQueryOptions(e);
|
|
1835
1835
|
n.getDefaultOptions().queries?._experimental_beforeQuery?.(
|
|
1836
1836
|
i
|
|
1837
1837
|
), process.env.NODE_ENV !== "production" && (i.queryFn || console.error(
|
|
@@ -1846,7 +1846,7 @@ function _a(e, t, r) {
|
|
|
1846
1846
|
if (H.useSyncExternalStore(
|
|
1847
1847
|
H.useCallback(
|
|
1848
1848
|
(u) => {
|
|
1849
|
-
const l = d ? c.subscribe($.batchCalls(u)) :
|
|
1849
|
+
const l = d ? c.subscribe($.batchCalls(u)) : q;
|
|
1850
1850
|
return c.updateResult(), l;
|
|
1851
1851
|
},
|
|
1852
1852
|
[c, d]
|
|
@@ -1856,7 +1856,7 @@ function _a(e, t, r) {
|
|
|
1856
1856
|
), H.useEffect(() => {
|
|
1857
1857
|
c.setOptions(i);
|
|
1858
1858
|
}, [i, c]), Ia(i, f))
|
|
1859
|
-
throw
|
|
1859
|
+
throw lr(i, c, a);
|
|
1860
1860
|
if (va({
|
|
1861
1861
|
result: f,
|
|
1862
1862
|
errorResetBoundary: a,
|
|
@@ -1868,21 +1868,21 @@ function _a(e, t, r) {
|
|
|
1868
1868
|
return n.getDefaultOptions().queries?._experimental_afterQuery?.(
|
|
1869
1869
|
i,
|
|
1870
1870
|
f
|
|
1871
|
-
), i.experimental_prefetchInRender && !
|
|
1871
|
+
), i.experimental_prefetchInRender && !be && Aa(f, s) && (o ? (
|
|
1872
1872
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1873
|
-
|
|
1873
|
+
lr(i, c, a)
|
|
1874
1874
|
) : (
|
|
1875
1875
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1876
1876
|
n.getQueryCache().get(i.queryHash)?.promise
|
|
1877
|
-
))?.catch(
|
|
1877
|
+
))?.catch(q).finally(() => {
|
|
1878
1878
|
c.updateResult();
|
|
1879
1879
|
}), i.notifyOnChangeProps ? f : c.trackResult(f);
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1881
|
+
function fe(e, t) {
|
|
1882
1882
|
return _a(e, na);
|
|
1883
1883
|
}
|
|
1884
|
-
function
|
|
1885
|
-
const r =
|
|
1884
|
+
function Pe(e, t) {
|
|
1885
|
+
const r = he(), [s] = H.useState(
|
|
1886
1886
|
() => new da(
|
|
1887
1887
|
r,
|
|
1888
1888
|
e
|
|
@@ -1900,11 +1900,11 @@ function Kt(e, t) {
|
|
|
1900
1900
|
() => s.getCurrentResult()
|
|
1901
1901
|
), n = H.useCallback(
|
|
1902
1902
|
(i, o) => {
|
|
1903
|
-
s.mutate(i, o).catch(
|
|
1903
|
+
s.mutate(i, o).catch(q);
|
|
1904
1904
|
},
|
|
1905
1905
|
[s]
|
|
1906
1906
|
);
|
|
1907
|
-
if (a.error &&
|
|
1907
|
+
if (a.error && $r(s.options.throwOnError, [a.error]))
|
|
1908
1908
|
throw a.error;
|
|
1909
1909
|
return { ...a, mutate: n, mutateAsync: a.mutate };
|
|
1910
1910
|
}
|
|
@@ -1921,11 +1921,11 @@ try {
|
|
|
1921
1921
|
});
|
|
1922
1922
|
} catch {
|
|
1923
1923
|
}
|
|
1924
|
-
const
|
|
1924
|
+
const xe = {
|
|
1925
1925
|
CODE: "code",
|
|
1926
1926
|
REFRESH_TOKEN: "refresh_token",
|
|
1927
1927
|
PASSKEY: "passkey"
|
|
1928
|
-
},
|
|
1928
|
+
}, Hr = {
|
|
1929
1929
|
CLIENT_ID: "X-Auth-ClientId"
|
|
1930
1930
|
}, F = {
|
|
1931
1931
|
ALG: "RS256",
|
|
@@ -1943,12 +1943,12 @@ aMwPFOIcJH+rKfFgNcHLcaS5syp7zU1ANwZ+trgR+DifBr8TLVkBynmNeTyhDm2+
|
|
|
1943
1943
|
l0haqjMk0UoNPPE8iYBWUHQJJE1Dqstj65d6Eh5g64Pao25y4cmYJbKjiblIGEkE
|
|
1944
1944
|
sjqybA9mARAqh9k/eiIopecWSiffNQTwVQVd2I9ZH3BalhEXHlqFgrjz51kFqg81
|
|
1945
1945
|
awIDAQAB
|
|
1946
|
-
-----END PUBLIC KEY-----`,
|
|
1946
|
+
-----END PUBLIC KEY-----`, lt = {
|
|
1947
1947
|
CODE: "code",
|
|
1948
1948
|
LOGOUT: "logout",
|
|
1949
1949
|
LOGIN: "login",
|
|
1950
1950
|
REFRESH: "refresh"
|
|
1951
|
-
},
|
|
1951
|
+
}, Ge = new TextEncoder(), ke = new TextDecoder();
|
|
1952
1952
|
function Ca(...e) {
|
|
1953
1953
|
const t = e.reduce((a, { length: n }) => a + n, 0), r = new Uint8Array(t);
|
|
1954
1954
|
let s = 0;
|
|
@@ -1956,7 +1956,7 @@ function Ca(...e) {
|
|
|
1956
1956
|
r.set(a, s), s += a.length;
|
|
1957
1957
|
return r;
|
|
1958
1958
|
}
|
|
1959
|
-
function
|
|
1959
|
+
function Kr(e) {
|
|
1960
1960
|
if (Uint8Array.fromBase64)
|
|
1961
1961
|
return Uint8Array.fromBase64(e);
|
|
1962
1962
|
const t = atob(e), r = new Uint8Array(t.length);
|
|
@@ -1964,26 +1964,26 @@ function Hr(e) {
|
|
|
1964
1964
|
r[s] = t.charCodeAt(s);
|
|
1965
1965
|
return r;
|
|
1966
1966
|
}
|
|
1967
|
-
function
|
|
1967
|
+
function Me(e) {
|
|
1968
1968
|
if (Uint8Array.fromBase64)
|
|
1969
|
-
return Uint8Array.fromBase64(typeof e == "string" ? e :
|
|
1969
|
+
return Uint8Array.fromBase64(typeof e == "string" ? e : ke.decode(e), {
|
|
1970
1970
|
alphabet: "base64url"
|
|
1971
1971
|
});
|
|
1972
1972
|
let t = e;
|
|
1973
|
-
t instanceof Uint8Array && (t =
|
|
1973
|
+
t instanceof Uint8Array && (t = ke.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
1974
1974
|
try {
|
|
1975
|
-
return
|
|
1975
|
+
return Kr(t);
|
|
1976
1976
|
} catch {
|
|
1977
1977
|
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
1978
1978
|
}
|
|
1979
1979
|
}
|
|
1980
|
-
let
|
|
1980
|
+
let we = class extends Error {
|
|
1981
1981
|
static code = "ERR_JOSE_GENERIC";
|
|
1982
1982
|
code = "ERR_JOSE_GENERIC";
|
|
1983
1983
|
constructor(t, r) {
|
|
1984
1984
|
super(t, r), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
|
|
1985
1985
|
}
|
|
1986
|
-
},
|
|
1986
|
+
}, Z = class extends we {
|
|
1987
1987
|
static code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
1988
1988
|
code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
1989
1989
|
claim;
|
|
@@ -1992,7 +1992,7 @@ let be = class extends Error {
|
|
|
1992
1992
|
constructor(t, r, s = "unspecified", a = "unspecified") {
|
|
1993
1993
|
super(t, { cause: { claim: s, reason: a, payload: r } }), this.claim = s, this.reason = a, this.payload = r;
|
|
1994
1994
|
}
|
|
1995
|
-
},
|
|
1995
|
+
}, ur = class extends we {
|
|
1996
1996
|
static code = "ERR_JWT_EXPIRED";
|
|
1997
1997
|
code = "ERR_JWT_EXPIRED";
|
|
1998
1998
|
claim;
|
|
@@ -2001,33 +2001,33 @@ let be = class extends Error {
|
|
|
2001
2001
|
constructor(t, r, s = "unspecified", a = "unspecified") {
|
|
2002
2002
|
super(t, { cause: { claim: s, reason: a, payload: r } }), this.claim = s, this.reason = a, this.payload = r;
|
|
2003
2003
|
}
|
|
2004
|
-
}, Oa = class extends
|
|
2004
|
+
}, Oa = class extends we {
|
|
2005
2005
|
static code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
2006
2006
|
code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
2007
|
-
}, ne = class extends
|
|
2007
|
+
}, ne = class extends we {
|
|
2008
2008
|
static code = "ERR_JOSE_NOT_SUPPORTED";
|
|
2009
2009
|
code = "ERR_JOSE_NOT_SUPPORTED";
|
|
2010
|
-
}, L = class extends
|
|
2010
|
+
}, L = class extends we {
|
|
2011
2011
|
static code = "ERR_JWS_INVALID";
|
|
2012
2012
|
code = "ERR_JWS_INVALID";
|
|
2013
|
-
}, se = class extends
|
|
2013
|
+
}, se = class extends we {
|
|
2014
2014
|
static code = "ERR_JWT_INVALID";
|
|
2015
2015
|
code = "ERR_JWT_INVALID";
|
|
2016
2016
|
};
|
|
2017
|
-
class ka extends
|
|
2017
|
+
class ka extends we {
|
|
2018
2018
|
static code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
2019
2019
|
code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
2020
2020
|
constructor(t = "signature verification failed", r) {
|
|
2021
2021
|
super(t, r);
|
|
2022
2022
|
}
|
|
2023
2023
|
}
|
|
2024
|
-
function
|
|
2024
|
+
function ee(e, t = "algorithm.name") {
|
|
2025
2025
|
return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
|
|
2026
2026
|
}
|
|
2027
|
-
function
|
|
2027
|
+
function Te(e, t) {
|
|
2028
2028
|
return e.name === t;
|
|
2029
2029
|
}
|
|
2030
|
-
function
|
|
2030
|
+
function pt(e) {
|
|
2031
2031
|
return parseInt(e.name.slice(4), 10);
|
|
2032
2032
|
}
|
|
2033
2033
|
function Na(e) {
|
|
@@ -2051,54 +2051,54 @@ function $a(e, t, r) {
|
|
|
2051
2051
|
case "HS256":
|
|
2052
2052
|
case "HS384":
|
|
2053
2053
|
case "HS512": {
|
|
2054
|
-
if (!
|
|
2055
|
-
throw
|
|
2054
|
+
if (!Te(e.algorithm, "HMAC"))
|
|
2055
|
+
throw ee("HMAC");
|
|
2056
2056
|
const s = parseInt(t.slice(2), 10);
|
|
2057
|
-
if (
|
|
2058
|
-
throw
|
|
2057
|
+
if (pt(e.algorithm.hash) !== s)
|
|
2058
|
+
throw ee(`SHA-${s}`, "algorithm.hash");
|
|
2059
2059
|
break;
|
|
2060
2060
|
}
|
|
2061
2061
|
case "RS256":
|
|
2062
2062
|
case "RS384":
|
|
2063
2063
|
case "RS512": {
|
|
2064
|
-
if (!
|
|
2065
|
-
throw
|
|
2064
|
+
if (!Te(e.algorithm, "RSASSA-PKCS1-v1_5"))
|
|
2065
|
+
throw ee("RSASSA-PKCS1-v1_5");
|
|
2066
2066
|
const s = parseInt(t.slice(2), 10);
|
|
2067
|
-
if (
|
|
2068
|
-
throw
|
|
2067
|
+
if (pt(e.algorithm.hash) !== s)
|
|
2068
|
+
throw ee(`SHA-${s}`, "algorithm.hash");
|
|
2069
2069
|
break;
|
|
2070
2070
|
}
|
|
2071
2071
|
case "PS256":
|
|
2072
2072
|
case "PS384":
|
|
2073
2073
|
case "PS512": {
|
|
2074
|
-
if (!
|
|
2075
|
-
throw
|
|
2074
|
+
if (!Te(e.algorithm, "RSA-PSS"))
|
|
2075
|
+
throw ee("RSA-PSS");
|
|
2076
2076
|
const s = parseInt(t.slice(2), 10);
|
|
2077
|
-
if (
|
|
2078
|
-
throw
|
|
2077
|
+
if (pt(e.algorithm.hash) !== s)
|
|
2078
|
+
throw ee(`SHA-${s}`, "algorithm.hash");
|
|
2079
2079
|
break;
|
|
2080
2080
|
}
|
|
2081
2081
|
case "Ed25519":
|
|
2082
2082
|
case "EdDSA": {
|
|
2083
|
-
if (!
|
|
2084
|
-
throw
|
|
2083
|
+
if (!Te(e.algorithm, "Ed25519"))
|
|
2084
|
+
throw ee("Ed25519");
|
|
2085
2085
|
break;
|
|
2086
2086
|
}
|
|
2087
2087
|
case "ML-DSA-44":
|
|
2088
2088
|
case "ML-DSA-65":
|
|
2089
2089
|
case "ML-DSA-87": {
|
|
2090
|
-
if (!
|
|
2091
|
-
throw
|
|
2090
|
+
if (!Te(e.algorithm, t))
|
|
2091
|
+
throw ee(t);
|
|
2092
2092
|
break;
|
|
2093
2093
|
}
|
|
2094
2094
|
case "ES256":
|
|
2095
2095
|
case "ES384":
|
|
2096
2096
|
case "ES512": {
|
|
2097
|
-
if (!
|
|
2098
|
-
throw
|
|
2097
|
+
if (!Te(e.algorithm, "ECDSA"))
|
|
2098
|
+
throw ee("ECDSA");
|
|
2099
2099
|
const s = Na(t);
|
|
2100
2100
|
if (e.algorithm.namedCurve !== s)
|
|
2101
|
-
throw
|
|
2101
|
+
throw ee(s, "algorithm.namedCurve");
|
|
2102
2102
|
break;
|
|
2103
2103
|
}
|
|
2104
2104
|
default:
|
|
@@ -2106,24 +2106,24 @@ function $a(e, t, r) {
|
|
|
2106
2106
|
}
|
|
2107
2107
|
Pa(e, r);
|
|
2108
2108
|
}
|
|
2109
|
-
function
|
|
2109
|
+
function Gr(e, t, ...r) {
|
|
2110
2110
|
if (r = r.filter(Boolean), r.length > 2) {
|
|
2111
2111
|
const s = r.pop();
|
|
2112
2112
|
e += `one of type ${r.join(", ")}, or ${s}.`;
|
|
2113
2113
|
} else r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
|
|
2114
2114
|
return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && t.constructor?.name && (e += ` Received an instance of ${t.constructor.name}`), e;
|
|
2115
2115
|
}
|
|
2116
|
-
const xa = (e, ...t) =>
|
|
2117
|
-
function
|
|
2118
|
-
return
|
|
2116
|
+
const xa = (e, ...t) => Gr("Key must be ", e, ...t);
|
|
2117
|
+
function Br(e, t, ...r) {
|
|
2118
|
+
return Gr(`Key for the ${e} algorithm must be `, t, ...r);
|
|
2119
2119
|
}
|
|
2120
|
-
function
|
|
2120
|
+
function qr(e) {
|
|
2121
2121
|
return e?.[Symbol.toStringTag] === "CryptoKey";
|
|
2122
2122
|
}
|
|
2123
2123
|
function Wr(e) {
|
|
2124
2124
|
return e?.[Symbol.toStringTag] === "KeyObject";
|
|
2125
2125
|
}
|
|
2126
|
-
const
|
|
2126
|
+
const Vr = (e) => qr(e) || Wr(e), Ma = (...e) => {
|
|
2127
2127
|
const t = e.filter(Boolean);
|
|
2128
2128
|
if (t.length === 0 || t.length === 1)
|
|
2129
2129
|
return !0;
|
|
@@ -2145,7 +2145,7 @@ const qr = (e) => Br(e) || Wr(e), Ma = (...e) => {
|
|
|
2145
2145
|
function Da(e) {
|
|
2146
2146
|
return typeof e == "object" && e !== null;
|
|
2147
2147
|
}
|
|
2148
|
-
const
|
|
2148
|
+
const Le = (e) => {
|
|
2149
2149
|
if (!Da(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
2150
2150
|
return !1;
|
|
2151
2151
|
if (Object.getPrototypeOf(e) === null)
|
|
@@ -2160,14 +2160,14 @@ const Me = (e) => {
|
|
|
2160
2160
|
if (typeof r != "number" || r < 2048)
|
|
2161
2161
|
throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
|
|
2162
2162
|
}
|
|
2163
|
-
},
|
|
2163
|
+
}, yt = (e, t) => {
|
|
2164
2164
|
if (e.byteLength !== t.length)
|
|
2165
2165
|
return !1;
|
|
2166
2166
|
for (let r = 0; r < e.byteLength; r++)
|
|
2167
2167
|
if (e[r] !== t[r])
|
|
2168
2168
|
return !1;
|
|
2169
2169
|
return !0;
|
|
2170
|
-
}, Ua = (e) => ({ data: e, pos: 0 }),
|
|
2170
|
+
}, Ua = (e) => ({ data: e, pos: 0 }), rt = (e) => {
|
|
2171
2171
|
const t = e.data[e.pos++];
|
|
2172
2172
|
if (t & 128) {
|
|
2173
2173
|
const r = t & 127;
|
|
@@ -2177,36 +2177,36 @@ const Me = (e) => {
|
|
|
2177
2177
|
return s;
|
|
2178
2178
|
}
|
|
2179
2179
|
return t;
|
|
2180
|
-
},
|
|
2180
|
+
}, st = (e, t, r) => {
|
|
2181
2181
|
if (e.data[e.pos++] !== t)
|
|
2182
2182
|
throw new Error(r);
|
|
2183
2183
|
}, jr = (e, t) => {
|
|
2184
2184
|
const r = e.data.subarray(e.pos, e.pos + t);
|
|
2185
2185
|
return e.pos += t, r;
|
|
2186
2186
|
}, Fa = (e) => {
|
|
2187
|
-
|
|
2188
|
-
const t =
|
|
2187
|
+
st(e, 6, "Expected algorithm OID");
|
|
2188
|
+
const t = rt(e);
|
|
2189
2189
|
return jr(e, t);
|
|
2190
2190
|
};
|
|
2191
2191
|
function Ha(e) {
|
|
2192
|
-
|
|
2193
|
-
const t =
|
|
2192
|
+
st(e, 48, "Invalid SPKI structure"), rt(e), st(e, 48, "Expected algorithm identifier");
|
|
2193
|
+
const t = rt(e);
|
|
2194
2194
|
return { algIdStart: e.pos, algIdLength: t };
|
|
2195
2195
|
}
|
|
2196
2196
|
const Ka = (e) => {
|
|
2197
2197
|
const t = Fa(e);
|
|
2198
|
-
if (
|
|
2198
|
+
if (yt(t, [43, 101, 110]))
|
|
2199
2199
|
return "X25519";
|
|
2200
|
-
if (!
|
|
2200
|
+
if (!yt(t, [42, 134, 72, 206, 61, 2, 1]))
|
|
2201
2201
|
throw new Error("Unsupported key algorithm");
|
|
2202
|
-
|
|
2203
|
-
const r =
|
|
2202
|
+
st(e, 6, "Expected curve OID");
|
|
2203
|
+
const r = rt(e), s = jr(e, r);
|
|
2204
2204
|
for (const { name: a, oid: n } of [
|
|
2205
2205
|
{ name: "P-256", oid: [42, 134, 72, 206, 61, 3, 1, 7] },
|
|
2206
2206
|
{ name: "P-384", oid: [43, 129, 4, 0, 34] },
|
|
2207
2207
|
{ name: "P-521", oid: [43, 129, 4, 0, 35] }
|
|
2208
2208
|
])
|
|
2209
|
-
if (
|
|
2209
|
+
if (yt(s, n))
|
|
2210
2210
|
return a;
|
|
2211
2211
|
throw new Error("Unsupported named curve");
|
|
2212
2212
|
}, Ga = async (e, t, r, s) => {
|
|
@@ -2264,7 +2264,7 @@ const Ka = (e) => {
|
|
|
2264
2264
|
throw new ne('Invalid or unsupported "alg" (Algorithm) value');
|
|
2265
2265
|
}
|
|
2266
2266
|
return crypto.subtle.importKey(e, t, a, s?.extractable ?? !0, n);
|
|
2267
|
-
}, Ba = (e, t) =>
|
|
2267
|
+
}, Ba = (e, t) => Kr(e.replace(t, "")), qa = (e, t, r) => {
|
|
2268
2268
|
const s = Ba(e, /(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g);
|
|
2269
2269
|
let a = r;
|
|
2270
2270
|
return t?.startsWith?.("ECDH-ES") && (a ||= {}, a.getNamedCurve = (n) => {
|
|
@@ -2272,7 +2272,7 @@ const Ka = (e) => {
|
|
|
2272
2272
|
return Ha(i), Ka(i);
|
|
2273
2273
|
}), Ga("spki", s, t, a);
|
|
2274
2274
|
};
|
|
2275
|
-
function
|
|
2275
|
+
function Wa(e) {
|
|
2276
2276
|
let t, r;
|
|
2277
2277
|
switch (e.kty) {
|
|
2278
2278
|
case "AKP": {
|
|
@@ -2357,16 +2357,16 @@ function qa(e) {
|
|
|
2357
2357
|
}
|
|
2358
2358
|
return { algorithm: t, keyUsages: r };
|
|
2359
2359
|
}
|
|
2360
|
-
const
|
|
2360
|
+
const Va = async (e) => {
|
|
2361
2361
|
if (!e.alg)
|
|
2362
2362
|
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
2363
|
-
const { algorithm: t, keyUsages: r } =
|
|
2363
|
+
const { algorithm: t, keyUsages: r } = Wa(e), s = { ...e };
|
|
2364
2364
|
return s.kty !== "AKP" && delete s.alg, delete s.use, crypto.subtle.importKey("jwk", s, t, e.ext ?? !(e.d || e.priv), e.key_ops ?? r);
|
|
2365
2365
|
};
|
|
2366
|
-
async function
|
|
2366
|
+
async function ja(e, t, r) {
|
|
2367
2367
|
if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
|
|
2368
2368
|
throw new TypeError('"spki" must be SPKI formatted string');
|
|
2369
|
-
return
|
|
2369
|
+
return qa(e, t, r);
|
|
2370
2370
|
}
|
|
2371
2371
|
const Qa = (e, t, r, s, a) => {
|
|
2372
2372
|
if (a.crit !== void 0 && s?.crit === void 0)
|
|
@@ -2392,8 +2392,8 @@ const Qa = (e, t, r, s, a) => {
|
|
|
2392
2392
|
if (t)
|
|
2393
2393
|
return new Set(t);
|
|
2394
2394
|
};
|
|
2395
|
-
function
|
|
2396
|
-
return
|
|
2395
|
+
function Bt(e) {
|
|
2396
|
+
return Le(e) && typeof e.kty == "string";
|
|
2397
2397
|
}
|
|
2398
2398
|
function Ya(e) {
|
|
2399
2399
|
return e.kty !== "oct" && (e.kty === "AKP" && typeof e.priv == "string" || typeof e.d == "string");
|
|
@@ -2404,17 +2404,17 @@ function za(e) {
|
|
|
2404
2404
|
function Xa(e) {
|
|
2405
2405
|
return e.kty === "oct" && typeof e.k == "string";
|
|
2406
2406
|
}
|
|
2407
|
-
let
|
|
2408
|
-
const
|
|
2409
|
-
|
|
2410
|
-
let a =
|
|
2407
|
+
let Oe;
|
|
2408
|
+
const dr = async (e, t, r, s = !1) => {
|
|
2409
|
+
Oe ||= /* @__PURE__ */ new WeakMap();
|
|
2410
|
+
let a = Oe.get(e);
|
|
2411
2411
|
if (a?.[r])
|
|
2412
2412
|
return a[r];
|
|
2413
|
-
const n = await
|
|
2414
|
-
return s && Object.freeze(e), a ? a[r] = n :
|
|
2413
|
+
const n = await Va({ ...t, alg: r });
|
|
2414
|
+
return s && Object.freeze(e), a ? a[r] = n : Oe.set(e, { [r]: n }), n;
|
|
2415
2415
|
}, Za = (e, t) => {
|
|
2416
|
-
|
|
2417
|
-
let r =
|
|
2416
|
+
Oe ||= /* @__PURE__ */ new WeakMap();
|
|
2417
|
+
let r = Oe.get(e);
|
|
2418
2418
|
if (r?.[t])
|
|
2419
2419
|
return r[t];
|
|
2420
2420
|
const s = e.type === "public", a = !!s;
|
|
@@ -2507,9 +2507,9 @@ const ur = async (e, t, r, s = !1) => {
|
|
|
2507
2507
|
}
|
|
2508
2508
|
if (!n)
|
|
2509
2509
|
throw new TypeError("given KeyObject instance cannot be used for this algorithm");
|
|
2510
|
-
return r ? r[t] = n :
|
|
2510
|
+
return r ? r[t] = n : Oe.set(e, { [t]: n }), n;
|
|
2511
2511
|
}, en = async (e, t) => {
|
|
2512
|
-
if (e instanceof Uint8Array ||
|
|
2512
|
+
if (e instanceof Uint8Array || qr(e))
|
|
2513
2513
|
return e;
|
|
2514
2514
|
if (Wr(e)) {
|
|
2515
2515
|
if (e.type === "secret")
|
|
@@ -2522,12 +2522,12 @@ const ur = async (e, t, r, s = !1) => {
|
|
|
2522
2522
|
throw s;
|
|
2523
2523
|
}
|
|
2524
2524
|
let r = e.export({ format: "jwk" });
|
|
2525
|
-
return
|
|
2525
|
+
return dr(e, r, t);
|
|
2526
2526
|
}
|
|
2527
|
-
if (
|
|
2528
|
-
return e.k ?
|
|
2527
|
+
if (Bt(e))
|
|
2528
|
+
return e.k ? Me(e.k) : dr(e, e, t, !0);
|
|
2529
2529
|
throw new Error("unreachable");
|
|
2530
|
-
},
|
|
2530
|
+
}, Ce = (e) => e?.[Symbol.toStringTag], Mt = (e, t, r) => {
|
|
2531
2531
|
if (t.use !== void 0) {
|
|
2532
2532
|
let s;
|
|
2533
2533
|
switch (r) {
|
|
@@ -2572,47 +2572,47 @@ const ur = async (e, t, r, s = !1) => {
|
|
|
2572
2572
|
return !0;
|
|
2573
2573
|
}, tn = (e, t, r) => {
|
|
2574
2574
|
if (!(t instanceof Uint8Array)) {
|
|
2575
|
-
if (
|
|
2576
|
-
if (Xa(t) &&
|
|
2575
|
+
if (Bt(t)) {
|
|
2576
|
+
if (Xa(t) && Mt(e, t, r))
|
|
2577
2577
|
return;
|
|
2578
2578
|
throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present');
|
|
2579
2579
|
}
|
|
2580
|
-
if (!
|
|
2581
|
-
throw new TypeError(
|
|
2580
|
+
if (!Vr(t))
|
|
2581
|
+
throw new TypeError(Br(e, t, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array"));
|
|
2582
2582
|
if (t.type !== "secret")
|
|
2583
|
-
throw new TypeError(`${
|
|
2583
|
+
throw new TypeError(`${Ce(t)} instances for symmetric algorithms must be of type "secret"`);
|
|
2584
2584
|
}
|
|
2585
2585
|
}, rn = (e, t, r) => {
|
|
2586
|
-
if (
|
|
2586
|
+
if (Bt(t))
|
|
2587
2587
|
switch (r) {
|
|
2588
2588
|
case "decrypt":
|
|
2589
2589
|
case "sign":
|
|
2590
|
-
if (Ya(t) &&
|
|
2590
|
+
if (Ya(t) && Mt(e, t, r))
|
|
2591
2591
|
return;
|
|
2592
2592
|
throw new TypeError("JSON Web Key for this operation be a private JWK");
|
|
2593
2593
|
case "encrypt":
|
|
2594
2594
|
case "verify":
|
|
2595
|
-
if (za(t) &&
|
|
2595
|
+
if (za(t) && Mt(e, t, r))
|
|
2596
2596
|
return;
|
|
2597
2597
|
throw new TypeError("JSON Web Key for this operation be a public JWK");
|
|
2598
2598
|
}
|
|
2599
|
-
if (!
|
|
2600
|
-
throw new TypeError(
|
|
2599
|
+
if (!Vr(t))
|
|
2600
|
+
throw new TypeError(Br(e, t, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
2601
2601
|
if (t.type === "secret")
|
|
2602
|
-
throw new TypeError(`${
|
|
2602
|
+
throw new TypeError(`${Ce(t)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
2603
2603
|
if (t.type === "public")
|
|
2604
2604
|
switch (r) {
|
|
2605
2605
|
case "sign":
|
|
2606
|
-
throw new TypeError(`${
|
|
2606
|
+
throw new TypeError(`${Ce(t)} instances for asymmetric algorithm signing must be of type "private"`);
|
|
2607
2607
|
case "decrypt":
|
|
2608
|
-
throw new TypeError(`${
|
|
2608
|
+
throw new TypeError(`${Ce(t)} instances for asymmetric algorithm decryption must be of type "private"`);
|
|
2609
2609
|
}
|
|
2610
2610
|
if (t.type === "private")
|
|
2611
2611
|
switch (r) {
|
|
2612
2612
|
case "verify":
|
|
2613
|
-
throw new TypeError(`${
|
|
2613
|
+
throw new TypeError(`${Ce(t)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
2614
2614
|
case "encrypt":
|
|
2615
|
-
throw new TypeError(`${
|
|
2615
|
+
throw new TypeError(`${Ce(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
2616
2616
|
}
|
|
2617
2617
|
}, sn = (e, t, r) => {
|
|
2618
2618
|
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e) || /^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e) ? tn(e, t, r) : rn(e, t, r);
|
|
@@ -2663,7 +2663,7 @@ const ur = async (e, t, r, s = !1) => {
|
|
|
2663
2663
|
}
|
|
2664
2664
|
};
|
|
2665
2665
|
async function cn(e, t, r) {
|
|
2666
|
-
if (!
|
|
2666
|
+
if (!Le(e))
|
|
2667
2667
|
throw new L("Flattened JWS must be an object");
|
|
2668
2668
|
if (e.protected === void 0 && e.header === void 0)
|
|
2669
2669
|
throw new L('Flattened JWS must have either of the "protected" or "header" members');
|
|
@@ -2673,13 +2673,13 @@ async function cn(e, t, r) {
|
|
|
2673
2673
|
throw new L("JWS Payload missing");
|
|
2674
2674
|
if (typeof e.signature != "string")
|
|
2675
2675
|
throw new L("JWS Signature missing or incorrect type");
|
|
2676
|
-
if (e.header !== void 0 && !
|
|
2676
|
+
if (e.header !== void 0 && !Le(e.header))
|
|
2677
2677
|
throw new L("JWS Unprotected Header incorrect type");
|
|
2678
2678
|
let s = {};
|
|
2679
2679
|
if (e.protected)
|
|
2680
2680
|
try {
|
|
2681
|
-
const g =
|
|
2682
|
-
s = JSON.parse(
|
|
2681
|
+
const g = Me(e.protected);
|
|
2682
|
+
s = JSON.parse(ke.decode(g));
|
|
2683
2683
|
} catch {
|
|
2684
2684
|
throw new L("JWS Protected Header is invalid");
|
|
2685
2685
|
}
|
|
@@ -2705,10 +2705,10 @@ async function cn(e, t, r) {
|
|
|
2705
2705
|
throw new L("JWS Payload must be a string or an Uint8Array instance");
|
|
2706
2706
|
let f = !1;
|
|
2707
2707
|
typeof t == "function" && (t = await t(s, e), f = !0), sn(o, t, "verify");
|
|
2708
|
-
const d = Ca(
|
|
2708
|
+
const d = Ca(Ge.encode(e.protected ?? ""), Ge.encode("."), typeof e.payload == "string" ? Ge.encode(e.payload) : e.payload);
|
|
2709
2709
|
let u;
|
|
2710
2710
|
try {
|
|
2711
|
-
u =
|
|
2711
|
+
u = Me(e.signature);
|
|
2712
2712
|
} catch {
|
|
2713
2713
|
throw new L("Failed to base64url decode the signature");
|
|
2714
2714
|
}
|
|
@@ -2718,16 +2718,16 @@ async function cn(e, t, r) {
|
|
|
2718
2718
|
let m;
|
|
2719
2719
|
if (i)
|
|
2720
2720
|
try {
|
|
2721
|
-
m =
|
|
2721
|
+
m = Me(e.payload);
|
|
2722
2722
|
} catch {
|
|
2723
2723
|
throw new L("Failed to base64url decode the payload");
|
|
2724
2724
|
}
|
|
2725
|
-
else typeof e.payload == "string" ? m =
|
|
2725
|
+
else typeof e.payload == "string" ? m = Ge.encode(e.payload) : m = e.payload;
|
|
2726
2726
|
const p = { payload: m };
|
|
2727
2727
|
return e.protected !== void 0 && (p.protectedHeader = s), e.header !== void 0 && (p.unprotectedHeader = e.header), f ? { ...p, key: l } : p;
|
|
2728
2728
|
}
|
|
2729
2729
|
async function ln(e, t, r) {
|
|
2730
|
-
if (e instanceof Uint8Array && (e =
|
|
2730
|
+
if (e instanceof Uint8Array && (e = ke.decode(e)), typeof e != "string")
|
|
2731
2731
|
throw new L("Compact JWS must be a string or Uint8Array");
|
|
2732
2732
|
const { 0: s, 1: a, 2: n, length: i } = e.split(".");
|
|
2733
2733
|
if (i !== 3)
|
|
@@ -2735,7 +2735,7 @@ async function ln(e, t, r) {
|
|
|
2735
2735
|
const o = await cn({ payload: a, protected: s, signature: n }, t, r), c = { payload: o.payload, protectedHeader: o.protectedHeader };
|
|
2736
2736
|
return typeof t == "function" ? { ...c, key: o.key } : c;
|
|
2737
2737
|
}
|
|
2738
|
-
const un = (e) => Math.floor(e.getTime() / 1e3),
|
|
2738
|
+
const un = (e) => Math.floor(e.getTime() / 1e3), Qr = 60, Jr = Qr * 60, qt = Jr * 24, dn = qt * 7, hn = qt * 365.25, fn = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, hr = (e) => {
|
|
2739
2739
|
const t = fn.exec(e);
|
|
2740
2740
|
if (!t || t[4] && t[1])
|
|
2741
2741
|
throw new TypeError("Invalid time period format");
|
|
@@ -2754,19 +2754,19 @@ const un = (e) => Math.floor(e.getTime() / 1e3), Vr = 60, Qr = Vr * 60, Bt = Qr
|
|
|
2754
2754
|
case "min":
|
|
2755
2755
|
case "mins":
|
|
2756
2756
|
case "m":
|
|
2757
|
-
a = Math.round(r *
|
|
2757
|
+
a = Math.round(r * Qr);
|
|
2758
2758
|
break;
|
|
2759
2759
|
case "hour":
|
|
2760
2760
|
case "hours":
|
|
2761
2761
|
case "hr":
|
|
2762
2762
|
case "hrs":
|
|
2763
2763
|
case "h":
|
|
2764
|
-
a = Math.round(r *
|
|
2764
|
+
a = Math.round(r * Jr);
|
|
2765
2765
|
break;
|
|
2766
2766
|
case "day":
|
|
2767
2767
|
case "days":
|
|
2768
2768
|
case "d":
|
|
2769
|
-
a = Math.round(r *
|
|
2769
|
+
a = Math.round(r * qt);
|
|
2770
2770
|
break;
|
|
2771
2771
|
case "week":
|
|
2772
2772
|
case "weeks":
|
|
@@ -2778,33 +2778,33 @@ const un = (e) => Math.floor(e.getTime() / 1e3), Vr = 60, Qr = Vr * 60, Bt = Qr
|
|
|
2778
2778
|
break;
|
|
2779
2779
|
}
|
|
2780
2780
|
return t[1] === "-" || t[4] === "ago" ? -a : a;
|
|
2781
|
-
},
|
|
2781
|
+
}, fr = (e) => e.includes("/") ? e.toLowerCase() : `application/${e.toLowerCase()}`, mn = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1;
|
|
2782
2782
|
function pn(e, t, r = {}) {
|
|
2783
2783
|
let s;
|
|
2784
2784
|
try {
|
|
2785
|
-
s = JSON.parse(
|
|
2785
|
+
s = JSON.parse(ke.decode(t));
|
|
2786
2786
|
} catch {
|
|
2787
2787
|
}
|
|
2788
|
-
if (!
|
|
2788
|
+
if (!Le(s))
|
|
2789
2789
|
throw new se("JWT Claims Set must be a top-level JSON object");
|
|
2790
2790
|
const { typ: a } = r;
|
|
2791
|
-
if (a && (typeof e.typ != "string" ||
|
|
2792
|
-
throw new
|
|
2791
|
+
if (a && (typeof e.typ != "string" || fr(e.typ) !== fr(a)))
|
|
2792
|
+
throw new Z('unexpected "typ" JWT header value', s, "typ", "check_failed");
|
|
2793
2793
|
const { requiredClaims: n = [], issuer: i, subject: o, audience: c, maxTokenAge: f } = r, d = [...n];
|
|
2794
2794
|
f !== void 0 && d.push("iat"), c !== void 0 && d.push("aud"), o !== void 0 && d.push("sub"), i !== void 0 && d.push("iss");
|
|
2795
2795
|
for (const p of new Set(d.reverse()))
|
|
2796
2796
|
if (!(p in s))
|
|
2797
|
-
throw new
|
|
2797
|
+
throw new Z(`missing required "${p}" claim`, s, p, "missing");
|
|
2798
2798
|
if (i && !(Array.isArray(i) ? i : [i]).includes(s.iss))
|
|
2799
|
-
throw new
|
|
2799
|
+
throw new Z('unexpected "iss" claim value', s, "iss", "check_failed");
|
|
2800
2800
|
if (o && s.sub !== o)
|
|
2801
|
-
throw new
|
|
2801
|
+
throw new Z('unexpected "sub" claim value', s, "sub", "check_failed");
|
|
2802
2802
|
if (c && !mn(s.aud, typeof c == "string" ? [c] : c))
|
|
2803
|
-
throw new
|
|
2803
|
+
throw new Z('unexpected "aud" claim value', s, "aud", "check_failed");
|
|
2804
2804
|
let u;
|
|
2805
2805
|
switch (typeof r.clockTolerance) {
|
|
2806
2806
|
case "string":
|
|
2807
|
-
u =
|
|
2807
|
+
u = hr(r.clockTolerance);
|
|
2808
2808
|
break;
|
|
2809
2809
|
case "number":
|
|
2810
2810
|
u = r.clockTolerance;
|
|
@@ -2817,25 +2817,25 @@ function pn(e, t, r = {}) {
|
|
|
2817
2817
|
}
|
|
2818
2818
|
const { currentDate: l } = r, m = un(l || /* @__PURE__ */ new Date());
|
|
2819
2819
|
if ((s.iat !== void 0 || f) && typeof s.iat != "number")
|
|
2820
|
-
throw new
|
|
2820
|
+
throw new Z('"iat" claim must be a number', s, "iat", "invalid");
|
|
2821
2821
|
if (s.nbf !== void 0) {
|
|
2822
2822
|
if (typeof s.nbf != "number")
|
|
2823
|
-
throw new
|
|
2823
|
+
throw new Z('"nbf" claim must be a number', s, "nbf", "invalid");
|
|
2824
2824
|
if (s.nbf > m + u)
|
|
2825
|
-
throw new
|
|
2825
|
+
throw new Z('"nbf" claim timestamp check failed', s, "nbf", "check_failed");
|
|
2826
2826
|
}
|
|
2827
2827
|
if (s.exp !== void 0) {
|
|
2828
2828
|
if (typeof s.exp != "number")
|
|
2829
|
-
throw new
|
|
2829
|
+
throw new Z('"exp" claim must be a number', s, "exp", "invalid");
|
|
2830
2830
|
if (s.exp <= m - u)
|
|
2831
|
-
throw new
|
|
2831
|
+
throw new ur('"exp" claim timestamp check failed', s, "exp", "check_failed");
|
|
2832
2832
|
}
|
|
2833
2833
|
if (f) {
|
|
2834
|
-
const p = m - s.iat, g = typeof f == "number" ? f :
|
|
2834
|
+
const p = m - s.iat, g = typeof f == "number" ? f : hr(f);
|
|
2835
2835
|
if (p - u > g)
|
|
2836
|
-
throw new
|
|
2836
|
+
throw new ur('"iat" claim timestamp check failed (too far in the past)', s, "iat", "check_failed");
|
|
2837
2837
|
if (p < 0 - u)
|
|
2838
|
-
throw new
|
|
2838
|
+
throw new Z('"iat" claim timestamp check failed (it should be in the past)', s, "iat", "check_failed");
|
|
2839
2839
|
}
|
|
2840
2840
|
return s;
|
|
2841
2841
|
}
|
|
@@ -2858,23 +2858,23 @@ function gn(e) {
|
|
|
2858
2858
|
throw new se("JWTs must contain a payload");
|
|
2859
2859
|
let s;
|
|
2860
2860
|
try {
|
|
2861
|
-
s =
|
|
2861
|
+
s = Me(t);
|
|
2862
2862
|
} catch {
|
|
2863
2863
|
throw new se("Failed to base64url decode the payload");
|
|
2864
2864
|
}
|
|
2865
2865
|
let a;
|
|
2866
2866
|
try {
|
|
2867
|
-
a = JSON.parse(
|
|
2867
|
+
a = JSON.parse(ke.decode(s));
|
|
2868
2868
|
} catch {
|
|
2869
2869
|
throw new se("Failed to parse the decoded payload as JSON");
|
|
2870
2870
|
}
|
|
2871
|
-
if (!
|
|
2871
|
+
if (!Le(a))
|
|
2872
2872
|
throw new se("Invalid JWT Claims Set");
|
|
2873
2873
|
return a;
|
|
2874
2874
|
}
|
|
2875
|
-
const
|
|
2875
|
+
const Ue = async (e) => {
|
|
2876
2876
|
try {
|
|
2877
|
-
const t = F.ALG, r = await
|
|
2877
|
+
const t = F.ALG, r = await ja(Ra, t);
|
|
2878
2878
|
return await yn(e, r, {
|
|
2879
2879
|
issuer: F.ISSUER
|
|
2880
2880
|
});
|
|
@@ -2893,35 +2893,35 @@ for (let e = 0; e < 256; ++e)
|
|
|
2893
2893
|
function En(e, t = 0) {
|
|
2894
2894
|
return (M[e[t + 0]] + M[e[t + 1]] + M[e[t + 2]] + M[e[t + 3]] + "-" + M[e[t + 4]] + M[e[t + 5]] + "-" + M[e[t + 6]] + M[e[t + 7]] + "-" + M[e[t + 8]] + M[e[t + 9]] + "-" + M[e[t + 10]] + M[e[t + 11]] + M[e[t + 12]] + M[e[t + 13]] + M[e[t + 14]] + M[e[t + 15]]).toLowerCase();
|
|
2895
2895
|
}
|
|
2896
|
-
let
|
|
2896
|
+
let gt;
|
|
2897
2897
|
const wn = new Uint8Array(16);
|
|
2898
2898
|
function Sn() {
|
|
2899
|
-
if (!
|
|
2899
|
+
if (!gt) {
|
|
2900
2900
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
2901
2901
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2902
|
-
|
|
2902
|
+
gt = crypto.getRandomValues.bind(crypto);
|
|
2903
2903
|
}
|
|
2904
|
-
return
|
|
2904
|
+
return gt(wn);
|
|
2905
2905
|
}
|
|
2906
|
-
const vn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
2907
|
-
function
|
|
2908
|
-
if (
|
|
2909
|
-
return
|
|
2906
|
+
const vn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), mr = { randomUUID: vn };
|
|
2907
|
+
function pr(e, t, r) {
|
|
2908
|
+
if (mr.randomUUID && !e)
|
|
2909
|
+
return mr.randomUUID();
|
|
2910
2910
|
e = e || {};
|
|
2911
2911
|
const s = e.random ?? e.rng?.() ?? Sn();
|
|
2912
2912
|
if (s.length < 16)
|
|
2913
2913
|
throw new Error("Random bytes length must be >= 16");
|
|
2914
2914
|
return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, En(s);
|
|
2915
2915
|
}
|
|
2916
|
-
const
|
|
2916
|
+
const yr = globalThis.crypto, Tn = (e) => `${pr()}${pr()}`.slice(0, e), An = (e) => btoa(
|
|
2917
2917
|
[...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
|
|
2918
2918
|
);
|
|
2919
2919
|
async function In(e) {
|
|
2920
|
-
if (!
|
|
2920
|
+
if (!yr.subtle)
|
|
2921
2921
|
throw new Error(
|
|
2922
2922
|
"crypto.subtle is available only in secure contexts (HTTPS)."
|
|
2923
2923
|
);
|
|
2924
|
-
const t = new TextEncoder().encode(e), r = await
|
|
2924
|
+
const t = new TextEncoder().encode(e), r = await yr.subtle.digest("SHA-256", t);
|
|
2925
2925
|
return An(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
2926
2926
|
}
|
|
2927
2927
|
async function _n(e) {
|
|
@@ -2931,8 +2931,8 @@ async function _n(e) {
|
|
|
2931
2931
|
code_challenge: s
|
|
2932
2932
|
};
|
|
2933
2933
|
}
|
|
2934
|
-
const
|
|
2935
|
-
var Rn = Object.defineProperty, Cn = (e, t, r) => t in e ? Rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r,
|
|
2934
|
+
const Yr = Ft(null);
|
|
2935
|
+
var Rn = Object.defineProperty, Cn = (e, t, r) => t in e ? Rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, bt = (e, t, r) => Cn(e, typeof t != "symbol" ? t + "" : t, r);
|
|
2936
2936
|
/*!
|
|
2937
2937
|
@versini/auth-provider v8.0.5
|
|
2938
2938
|
© 2025 gizmette.com
|
|
@@ -2946,14 +2946,14 @@ try {
|
|
|
2946
2946
|
});
|
|
2947
2947
|
} catch {
|
|
2948
2948
|
}
|
|
2949
|
-
function
|
|
2949
|
+
function te(e) {
|
|
2950
2950
|
const t = new Uint8Array(e);
|
|
2951
2951
|
let r = "";
|
|
2952
2952
|
for (const s of t)
|
|
2953
2953
|
r += String.fromCharCode(s);
|
|
2954
2954
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2955
2955
|
}
|
|
2956
|
-
function
|
|
2956
|
+
function at(e) {
|
|
2957
2957
|
const t = e.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - t.length % 4) % 4, s = t.padEnd(t.length + r, "="), a = atob(s), n = new ArrayBuffer(a.length), i = new Uint8Array(n);
|
|
2958
2958
|
for (let o = 0; o < a.length; o++)
|
|
2959
2959
|
i[o] = a.charCodeAt(o);
|
|
@@ -2965,11 +2965,11 @@ function Wt() {
|
|
|
2965
2965
|
const On = {
|
|
2966
2966
|
stubThis: (e) => e
|
|
2967
2967
|
};
|
|
2968
|
-
function
|
|
2968
|
+
function zr(e) {
|
|
2969
2969
|
const { id: t } = e;
|
|
2970
2970
|
return {
|
|
2971
2971
|
...e,
|
|
2972
|
-
id:
|
|
2972
|
+
id: at(t),
|
|
2973
2973
|
/**
|
|
2974
2974
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2975
2975
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2978,7 +2978,7 @@ function Yr(e) {
|
|
|
2978
2978
|
transports: e.transports
|
|
2979
2979
|
};
|
|
2980
2980
|
}
|
|
2981
|
-
function
|
|
2981
|
+
function Xr(e) {
|
|
2982
2982
|
return (
|
|
2983
2983
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2984
2984
|
e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)
|
|
@@ -3052,7 +3052,7 @@ function kn({ error: e, options: t }) {
|
|
|
3052
3052
|
});
|
|
3053
3053
|
if (e.name === "SecurityError") {
|
|
3054
3054
|
const s = globalThis.location.hostname;
|
|
3055
|
-
if (
|
|
3055
|
+
if (Xr(s)) {
|
|
3056
3056
|
if (r.rp.id !== s)
|
|
3057
3057
|
return new U({
|
|
3058
3058
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
@@ -3104,8 +3104,8 @@ class Nn {
|
|
|
3104
3104
|
}
|
|
3105
3105
|
}
|
|
3106
3106
|
}
|
|
3107
|
-
const
|
|
3108
|
-
function
|
|
3107
|
+
const Zr = new Nn(), Pn = ["cross-platform", "platform"];
|
|
3108
|
+
function es(e) {
|
|
3109
3109
|
if (e && !(Pn.indexOf(e) < 0))
|
|
3110
3110
|
return e;
|
|
3111
3111
|
}
|
|
@@ -3116,14 +3116,14 @@ async function $n(e) {
|
|
|
3116
3116
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3117
3117
|
const s = {
|
|
3118
3118
|
...t,
|
|
3119
|
-
challenge:
|
|
3119
|
+
challenge: at(t.challenge),
|
|
3120
3120
|
user: {
|
|
3121
3121
|
...t.user,
|
|
3122
|
-
id:
|
|
3122
|
+
id: at(t.user.id)
|
|
3123
3123
|
},
|
|
3124
|
-
excludeCredentials: t.excludeCredentials?.map(
|
|
3124
|
+
excludeCredentials: t.excludeCredentials?.map(zr)
|
|
3125
3125
|
}, a = {};
|
|
3126
|
-
r && (a.mediation = "conditional"), a.publicKey = s, a.signal =
|
|
3126
|
+
r && (a.mediation = "conditional"), a.publicKey = s, a.signal = Zr.createNewAbortSignal();
|
|
3127
3127
|
let n;
|
|
3128
3128
|
try {
|
|
3129
3129
|
n = await navigator.credentials.create(a);
|
|
@@ -3140,29 +3140,29 @@ async function $n(e) {
|
|
|
3140
3140
|
try {
|
|
3141
3141
|
u = c.getPublicKeyAlgorithm();
|
|
3142
3142
|
} catch (p) {
|
|
3143
|
-
|
|
3143
|
+
Et("getPublicKeyAlgorithm()", p);
|
|
3144
3144
|
}
|
|
3145
3145
|
let l;
|
|
3146
3146
|
if (typeof c.getPublicKey == "function")
|
|
3147
3147
|
try {
|
|
3148
3148
|
const p = c.getPublicKey();
|
|
3149
|
-
p !== null && (l =
|
|
3149
|
+
p !== null && (l = te(p));
|
|
3150
3150
|
} catch (p) {
|
|
3151
|
-
|
|
3151
|
+
Et("getPublicKey()", p);
|
|
3152
3152
|
}
|
|
3153
3153
|
let m;
|
|
3154
3154
|
if (typeof c.getAuthenticatorData == "function")
|
|
3155
3155
|
try {
|
|
3156
|
-
m =
|
|
3156
|
+
m = te(c.getAuthenticatorData());
|
|
3157
3157
|
} catch (p) {
|
|
3158
|
-
|
|
3158
|
+
Et("getAuthenticatorData()", p);
|
|
3159
3159
|
}
|
|
3160
3160
|
return {
|
|
3161
3161
|
id: i,
|
|
3162
|
-
rawId:
|
|
3162
|
+
rawId: te(o),
|
|
3163
3163
|
response: {
|
|
3164
|
-
attestationObject:
|
|
3165
|
-
clientDataJSON:
|
|
3164
|
+
attestationObject: te(c.attestationObject),
|
|
3165
|
+
clientDataJSON: te(c.clientDataJSON),
|
|
3166
3166
|
transports: d,
|
|
3167
3167
|
publicKeyAlgorithm: u,
|
|
3168
3168
|
publicKey: l,
|
|
@@ -3170,20 +3170,20 @@ async function $n(e) {
|
|
|
3170
3170
|
},
|
|
3171
3171
|
type: f,
|
|
3172
3172
|
clientExtensionResults: n.getClientExtensionResults(),
|
|
3173
|
-
authenticatorAttachment:
|
|
3173
|
+
authenticatorAttachment: es(n.authenticatorAttachment)
|
|
3174
3174
|
};
|
|
3175
3175
|
}
|
|
3176
|
-
function
|
|
3176
|
+
function Et(e, t) {
|
|
3177
3177
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
|
|
3178
3178
|
`, t);
|
|
3179
3179
|
}
|
|
3180
3180
|
function xn() {
|
|
3181
3181
|
if (!Wt())
|
|
3182
|
-
return
|
|
3182
|
+
return wt.stubThis(new Promise((t) => t(!1)));
|
|
3183
3183
|
const e = globalThis.PublicKeyCredential;
|
|
3184
|
-
return e?.isConditionalMediationAvailable === void 0 ?
|
|
3184
|
+
return e?.isConditionalMediationAvailable === void 0 ? wt.stubThis(new Promise((t) => t(!1))) : wt.stubThis(e.isConditionalMediationAvailable());
|
|
3185
3185
|
}
|
|
3186
|
-
const
|
|
3186
|
+
const wt = {
|
|
3187
3187
|
stubThis: (e) => e
|
|
3188
3188
|
};
|
|
3189
3189
|
function Mn({ error: e, options: t }) {
|
|
@@ -3206,7 +3206,7 @@ function Mn({ error: e, options: t }) {
|
|
|
3206
3206
|
});
|
|
3207
3207
|
if (e.name === "SecurityError") {
|
|
3208
3208
|
const s = globalThis.location.hostname;
|
|
3209
|
-
if (
|
|
3209
|
+
if (Xr(s)) {
|
|
3210
3210
|
if (r.rpId !== s)
|
|
3211
3211
|
return new U({
|
|
3212
3212
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
@@ -3233,10 +3233,10 @@ async function Dn(e) {
|
|
|
3233
3233
|
if (!Wt())
|
|
3234
3234
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3235
3235
|
let a;
|
|
3236
|
-
t.allowCredentials?.length !== 0 && (a = t.allowCredentials?.map(
|
|
3236
|
+
t.allowCredentials?.length !== 0 && (a = t.allowCredentials?.map(zr));
|
|
3237
3237
|
const n = {
|
|
3238
3238
|
...t,
|
|
3239
|
-
challenge:
|
|
3239
|
+
challenge: at(t.challenge),
|
|
3240
3240
|
allowCredentials: a
|
|
3241
3241
|
}, i = {};
|
|
3242
3242
|
if (r) {
|
|
@@ -3246,7 +3246,7 @@ async function Dn(e) {
|
|
|
3246
3246
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
3247
3247
|
i.mediation = "conditional", n.allowCredentials = [];
|
|
3248
3248
|
}
|
|
3249
|
-
i.publicKey = n, i.signal =
|
|
3249
|
+
i.publicKey = n, i.signal = Zr.createNewAbortSignal();
|
|
3250
3250
|
let o;
|
|
3251
3251
|
try {
|
|
3252
3252
|
o = await navigator.credentials.get(i);
|
|
@@ -3257,53 +3257,53 @@ async function Dn(e) {
|
|
|
3257
3257
|
throw new Error("Authentication was not completed");
|
|
3258
3258
|
const { id: c, rawId: f, response: d, type: u } = o;
|
|
3259
3259
|
let l;
|
|
3260
|
-
return d.userHandle && (l =
|
|
3260
|
+
return d.userHandle && (l = te(d.userHandle)), {
|
|
3261
3261
|
id: c,
|
|
3262
|
-
rawId:
|
|
3262
|
+
rawId: te(f),
|
|
3263
3263
|
response: {
|
|
3264
|
-
authenticatorData:
|
|
3265
|
-
clientDataJSON:
|
|
3266
|
-
signature:
|
|
3264
|
+
authenticatorData: te(d.authenticatorData),
|
|
3265
|
+
clientDataJSON: te(d.clientDataJSON),
|
|
3266
|
+
signature: te(d.signature),
|
|
3267
3267
|
userHandle: l
|
|
3268
3268
|
},
|
|
3269
3269
|
type: u,
|
|
3270
3270
|
clientExtensionResults: o.getClientExtensionResults(),
|
|
3271
|
-
authenticatorAttachment:
|
|
3271
|
+
authenticatorAttachment: es(o.authenticatorAttachment)
|
|
3272
3272
|
};
|
|
3273
3273
|
}
|
|
3274
|
-
function
|
|
3274
|
+
function ts(e, t) {
|
|
3275
3275
|
window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
|
|
3276
3276
|
}
|
|
3277
|
-
const
|
|
3277
|
+
const gr = (e, t) => {
|
|
3278
3278
|
const r = JSON.stringify(
|
|
3279
3279
|
typeof t == "function" ? t() : t
|
|
3280
3280
|
);
|
|
3281
|
-
window.localStorage.setItem(e, r),
|
|
3281
|
+
window.localStorage.setItem(e, r), ts(e, r);
|
|
3282
3282
|
}, Ln = (e) => {
|
|
3283
|
-
window.localStorage.removeItem(e),
|
|
3284
|
-
},
|
|
3285
|
-
function
|
|
3283
|
+
window.localStorage.removeItem(e), ts(e, null);
|
|
3284
|
+
}, br = (e) => window.localStorage.getItem(e), Un = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
|
3285
|
+
function Be({
|
|
3286
3286
|
key: e,
|
|
3287
3287
|
initialValue: t
|
|
3288
3288
|
}) {
|
|
3289
|
-
const r = Ks(Un, () =>
|
|
3289
|
+
const r = Ks(Un, () => br(e)), s = X(
|
|
3290
3290
|
(i) => {
|
|
3291
3291
|
try {
|
|
3292
3292
|
const o = typeof i == "function" ? i(JSON.parse(r)) : i;
|
|
3293
|
-
o == null ? Ln(e) :
|
|
3293
|
+
o == null ? Ln(e) : gr(e, o);
|
|
3294
3294
|
} catch (o) {
|
|
3295
3295
|
console.warn(o);
|
|
3296
3296
|
}
|
|
3297
3297
|
},
|
|
3298
3298
|
[e, r]
|
|
3299
|
-
), a =
|
|
3299
|
+
), a = X(() => {
|
|
3300
3300
|
s(t);
|
|
3301
|
-
}, [t, s]), n =
|
|
3301
|
+
}, [t, s]), n = X(() => {
|
|
3302
3302
|
s(null);
|
|
3303
3303
|
}, [s]);
|
|
3304
3304
|
return W(() => {
|
|
3305
3305
|
try {
|
|
3306
|
-
|
|
3306
|
+
br(e) === null && typeof t < "u" && gr(e, t);
|
|
3307
3307
|
} catch (i) {
|
|
3308
3308
|
console.warn(i);
|
|
3309
3309
|
}
|
|
@@ -3315,27 +3315,27 @@ for (let e = 0; e < 256; ++e)
|
|
|
3315
3315
|
function Fn(e, t = 0) {
|
|
3316
3316
|
return (D[e[t + 0]] + D[e[t + 1]] + D[e[t + 2]] + D[e[t + 3]] + "-" + D[e[t + 4]] + D[e[t + 5]] + "-" + D[e[t + 6]] + D[e[t + 7]] + "-" + D[e[t + 8]] + D[e[t + 9]] + "-" + D[e[t + 10]] + D[e[t + 11]] + D[e[t + 12]] + D[e[t + 13]] + D[e[t + 14]] + D[e[t + 15]]).toLowerCase();
|
|
3317
3317
|
}
|
|
3318
|
-
let
|
|
3318
|
+
let St;
|
|
3319
3319
|
const Hn = new Uint8Array(16);
|
|
3320
3320
|
function Kn() {
|
|
3321
|
-
if (!
|
|
3321
|
+
if (!St) {
|
|
3322
3322
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
3323
3323
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
3324
|
-
|
|
3324
|
+
St = crypto.getRandomValues.bind(crypto);
|
|
3325
3325
|
}
|
|
3326
|
-
return
|
|
3326
|
+
return St(Hn);
|
|
3327
3327
|
}
|
|
3328
|
-
const Gn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
3329
|
-
function
|
|
3330
|
-
if (
|
|
3331
|
-
return
|
|
3328
|
+
const Gn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Er = { randomUUID: Gn };
|
|
3329
|
+
function vt(e, t, r) {
|
|
3330
|
+
if (Er.randomUUID && !e)
|
|
3331
|
+
return Er.randomUUID();
|
|
3332
3332
|
e = e || {};
|
|
3333
3333
|
const s = e.random ?? e.rng?.() ?? Kn();
|
|
3334
3334
|
if (s.length < 16)
|
|
3335
3335
|
throw new Error("Random bytes length must be >= 16");
|
|
3336
3336
|
return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, Fn(s);
|
|
3337
3337
|
}
|
|
3338
|
-
const
|
|
3338
|
+
const Ae = "Your session has expired. For your security, please log in again to continue.", Bn = "Your session has been successfully terminated.", Tt = "Login failed. Please try again.", qn = "Error getting access token, please re-authenticate.", Wn = "You forgot to wrap your component in <AuthProvider>.", qe = "@@auth@@", $e = "LOADING", Qe = "LOGIN", rs = "LOGOUT", Fe = "success", re = "failure", ss = "include", as = "POST", ns = "application/json", We = {
|
|
3339
3339
|
GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
|
|
3340
3340
|
$clientId: String!,
|
|
3341
3341
|
$username: String!,
|
|
@@ -3416,7 +3416,7 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3416
3416
|
email
|
|
3417
3417
|
}
|
|
3418
3418
|
}`
|
|
3419
|
-
},
|
|
3419
|
+
}, Ie = {
|
|
3420
3420
|
GET_REGISTRATION_OPTIONS: {
|
|
3421
3421
|
schema: We.GET_REGISTRATION_OPTIONS,
|
|
3422
3422
|
method: "getPasskeyRegistrationOptions"
|
|
@@ -3433,7 +3433,7 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3433
3433
|
schema: We.VERIFY_AUTHENTICATION,
|
|
3434
3434
|
method: "verifyPasskeyAuthentication"
|
|
3435
3435
|
}
|
|
3436
|
-
},
|
|
3436
|
+
}, _e = async ({
|
|
3437
3437
|
accessToken: e,
|
|
3438
3438
|
type: t,
|
|
3439
3439
|
clientId: r,
|
|
@@ -3442,12 +3442,12 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3442
3442
|
}) => {
|
|
3443
3443
|
try {
|
|
3444
3444
|
const n = `Bearer ${e}`, i = await fetch(`${a}/graphql`, {
|
|
3445
|
-
credentials:
|
|
3446
|
-
method:
|
|
3445
|
+
credentials: ss,
|
|
3446
|
+
method: as,
|
|
3447
3447
|
headers: {
|
|
3448
3448
|
authorization: n,
|
|
3449
|
-
"Content-Type":
|
|
3450
|
-
[
|
|
3449
|
+
"Content-Type": ns,
|
|
3450
|
+
[Hr.CLIENT_ID]: `${r}`
|
|
3451
3451
|
},
|
|
3452
3452
|
body: JSON.stringify({
|
|
3453
3453
|
query: t.schema,
|
|
@@ -3455,16 +3455,16 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3455
3455
|
})
|
|
3456
3456
|
});
|
|
3457
3457
|
if (i.status !== 200)
|
|
3458
|
-
return { status:
|
|
3458
|
+
return { status: re, data: [] };
|
|
3459
3459
|
const { data: o } = await i.json();
|
|
3460
3460
|
return {
|
|
3461
|
-
status:
|
|
3461
|
+
status: Fe,
|
|
3462
3462
|
data: o[t.method]
|
|
3463
3463
|
};
|
|
3464
3464
|
} catch (n) {
|
|
3465
|
-
return console.error(n), { status:
|
|
3465
|
+
return console.error(n), { status: re, data: [] };
|
|
3466
3466
|
}
|
|
3467
|
-
},
|
|
3467
|
+
}, ut = async ({
|
|
3468
3468
|
type: e,
|
|
3469
3469
|
clientId: t,
|
|
3470
3470
|
params: r = {},
|
|
@@ -3472,25 +3472,25 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3472
3472
|
}) => {
|
|
3473
3473
|
try {
|
|
3474
3474
|
const a = await fetch(`${s}/${e}`, {
|
|
3475
|
-
credentials:
|
|
3476
|
-
method:
|
|
3475
|
+
credentials: ss,
|
|
3476
|
+
method: as,
|
|
3477
3477
|
headers: {
|
|
3478
|
-
"Content-Type":
|
|
3479
|
-
[
|
|
3478
|
+
"Content-Type": ns,
|
|
3479
|
+
[Hr.CLIENT_ID]: `${t}`
|
|
3480
3480
|
},
|
|
3481
3481
|
body: JSON.stringify(r)
|
|
3482
3482
|
});
|
|
3483
3483
|
if (a.status !== 200)
|
|
3484
|
-
return { status:
|
|
3484
|
+
return { status: re, data: [] };
|
|
3485
3485
|
const { data: n } = await a.json();
|
|
3486
3486
|
return {
|
|
3487
|
-
status:
|
|
3487
|
+
status: Fe,
|
|
3488
3488
|
data: n || []
|
|
3489
3489
|
};
|
|
3490
3490
|
} catch (a) {
|
|
3491
|
-
return console.error(a), { status:
|
|
3491
|
+
return console.error(a), { status: re, data: [] };
|
|
3492
3492
|
}
|
|
3493
|
-
},
|
|
3493
|
+
}, Vn = process.env.NODE_ENV === "production", jn = !Vn, is = {
|
|
3494
3494
|
isLoading: !0,
|
|
3495
3495
|
isAuthenticated: !1,
|
|
3496
3496
|
user: void 0,
|
|
@@ -3513,20 +3513,20 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3513
3513
|
}) => {
|
|
3514
3514
|
try {
|
|
3515
3515
|
return {
|
|
3516
|
-
status: (await
|
|
3516
|
+
status: (await ut({
|
|
3517
3517
|
endpoint: a,
|
|
3518
|
-
type:
|
|
3518
|
+
type: lt.LOGOUT,
|
|
3519
3519
|
clientId: t,
|
|
3520
3520
|
params: {
|
|
3521
3521
|
userId: e,
|
|
3522
3522
|
domain: r,
|
|
3523
3523
|
idToken: s
|
|
3524
3524
|
}
|
|
3525
|
-
}))?.status ||
|
|
3525
|
+
}))?.status || re
|
|
3526
3526
|
};
|
|
3527
3527
|
} catch {
|
|
3528
3528
|
return {
|
|
3529
|
-
status:
|
|
3529
|
+
status: re
|
|
3530
3530
|
};
|
|
3531
3531
|
}
|
|
3532
3532
|
}, Yn = async ({
|
|
@@ -3543,9 +3543,9 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3543
3543
|
endpoint: d
|
|
3544
3544
|
}) => {
|
|
3545
3545
|
try {
|
|
3546
|
-
const u = await
|
|
3546
|
+
const u = await ut({
|
|
3547
3547
|
endpoint: d,
|
|
3548
|
-
type:
|
|
3548
|
+
type: lt.LOGIN,
|
|
3549
3549
|
clientId: r,
|
|
3550
3550
|
params: {
|
|
3551
3551
|
type: a,
|
|
@@ -3558,7 +3558,7 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3558
3558
|
domain: c,
|
|
3559
3559
|
ua: f
|
|
3560
3560
|
}
|
|
3561
|
-
}), l = await
|
|
3561
|
+
}), l = await Ue(u?.data?.idToken);
|
|
3562
3562
|
return l && l.payload[F.USER_ID_KEY] !== "" && l.payload[F.NONCE_KEY] === s ? {
|
|
3563
3563
|
idToken: u.data.idToken,
|
|
3564
3564
|
accessToken: u.data.accessToken,
|
|
@@ -3581,26 +3581,26 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3581
3581
|
endpoint: s
|
|
3582
3582
|
}) => {
|
|
3583
3583
|
try {
|
|
3584
|
-
const a = await
|
|
3584
|
+
const a = await ut({
|
|
3585
3585
|
endpoint: s,
|
|
3586
|
-
type:
|
|
3586
|
+
type: lt.CODE,
|
|
3587
3587
|
clientId: t,
|
|
3588
3588
|
params: {
|
|
3589
|
-
type:
|
|
3589
|
+
type: xe.CODE,
|
|
3590
3590
|
nonce: e,
|
|
3591
3591
|
code_challenge: r
|
|
3592
3592
|
}
|
|
3593
3593
|
});
|
|
3594
3594
|
return a?.data?.code ? {
|
|
3595
|
-
status:
|
|
3595
|
+
status: Fe,
|
|
3596
3596
|
data: a.data.code
|
|
3597
3597
|
} : {
|
|
3598
|
-
status:
|
|
3598
|
+
status: re,
|
|
3599
3599
|
data: ""
|
|
3600
3600
|
};
|
|
3601
3601
|
} catch {
|
|
3602
3602
|
return {
|
|
3603
|
-
status:
|
|
3603
|
+
status: re,
|
|
3604
3604
|
data: ""
|
|
3605
3605
|
};
|
|
3606
3606
|
}
|
|
@@ -3614,19 +3614,19 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3614
3614
|
endpoint: i
|
|
3615
3615
|
}) => {
|
|
3616
3616
|
try {
|
|
3617
|
-
const o = await
|
|
3617
|
+
const o = await ut({
|
|
3618
3618
|
endpoint: i,
|
|
3619
|
-
type:
|
|
3619
|
+
type: lt.REFRESH,
|
|
3620
3620
|
clientId: e,
|
|
3621
3621
|
params: {
|
|
3622
|
-
type:
|
|
3622
|
+
type: xe.REFRESH_TOKEN,
|
|
3623
3623
|
userId: t,
|
|
3624
3624
|
nonce: r,
|
|
3625
3625
|
refreshToken: s,
|
|
3626
3626
|
accessToken: a,
|
|
3627
3627
|
domain: n
|
|
3628
3628
|
}
|
|
3629
|
-
}), c = await
|
|
3629
|
+
}), c = await Ue(o?.data?.accessToken);
|
|
3630
3630
|
return c && c.payload[F.USER_ID_KEY] !== "" && c.payload[F.NONCE_KEY] === r ? {
|
|
3631
3631
|
accessToken: o.data.accessToken,
|
|
3632
3632
|
refreshToken: o.data.refreshToken,
|
|
@@ -3643,7 +3643,7 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3643
3643
|
};
|
|
3644
3644
|
class Zn {
|
|
3645
3645
|
constructor(t = null, r = null) {
|
|
3646
|
-
|
|
3646
|
+
bt(this, "refreshTokenPromise", null), bt(this, "accessToken"), bt(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
|
|
3647
3647
|
}
|
|
3648
3648
|
async refreshtoken({
|
|
3649
3649
|
clientId: t,
|
|
@@ -3672,7 +3672,7 @@ class Zn {
|
|
|
3672
3672
|
nonce: a,
|
|
3673
3673
|
domain: n
|
|
3674
3674
|
}) {
|
|
3675
|
-
const i = await
|
|
3675
|
+
const i = await Ue(this.refreshToken);
|
|
3676
3676
|
if (i && i.payload[F.USER_ID_KEY] !== "") {
|
|
3677
3677
|
const o = await Xn({
|
|
3678
3678
|
endpoint: t,
|
|
@@ -3684,53 +3684,53 @@ class Zn {
|
|
|
3684
3684
|
domain: n
|
|
3685
3685
|
});
|
|
3686
3686
|
return o.status ? (this.accessToken = o.accessToken, this.refreshToken = o.refreshToken, {
|
|
3687
|
-
status:
|
|
3687
|
+
status: Fe,
|
|
3688
3688
|
newAccessToken: o.accessToken,
|
|
3689
3689
|
newRefreshToken: o.refreshToken
|
|
3690
3690
|
}) : {
|
|
3691
|
-
status:
|
|
3691
|
+
status: re
|
|
3692
3692
|
};
|
|
3693
3693
|
} else
|
|
3694
3694
|
return {
|
|
3695
|
-
status:
|
|
3695
|
+
status: re
|
|
3696
3696
|
};
|
|
3697
3697
|
}
|
|
3698
3698
|
}
|
|
3699
|
-
const
|
|
3700
|
-
throw new Error(
|
|
3701
|
-
},
|
|
3699
|
+
const Re = () => {
|
|
3700
|
+
throw new Error(Wn);
|
|
3701
|
+
}, os = Ft({
|
|
3702
3702
|
isAuthenticated: !1,
|
|
3703
3703
|
isLoading: !1,
|
|
3704
|
-
login:
|
|
3705
|
-
logout:
|
|
3706
|
-
getAccessToken:
|
|
3707
|
-
getIdToken:
|
|
3708
|
-
registeringForPasskey:
|
|
3709
|
-
loginWithPasskey:
|
|
3704
|
+
login: Re,
|
|
3705
|
+
logout: Re,
|
|
3706
|
+
getAccessToken: Re,
|
|
3707
|
+
getIdToken: Re,
|
|
3708
|
+
registeringForPasskey: Re,
|
|
3709
|
+
loginWithPasskey: Re,
|
|
3710
3710
|
logoutReason: "",
|
|
3711
3711
|
authenticationType: ""
|
|
3712
3712
|
}), ei = () => ({
|
|
3713
|
-
...
|
|
3714
|
-
}), ti = (e) =>
|
|
3713
|
+
...ct(os)
|
|
3714
|
+
}), ti = (e) => X(
|
|
3715
3715
|
(...t) => {
|
|
3716
3716
|
e && console.info(`==> [Auth ${Date.now()}]: `, ...t);
|
|
3717
3717
|
},
|
|
3718
3718
|
[e]
|
|
3719
3719
|
), ri = oe.createContext({
|
|
3720
|
-
state:
|
|
3720
|
+
state: is,
|
|
3721
3721
|
dispatch: () => {
|
|
3722
3722
|
}
|
|
3723
|
-
}), si = (e, t) => t?.type ===
|
|
3723
|
+
}), si = (e, t) => t?.type === $e ? {
|
|
3724
3724
|
...e,
|
|
3725
3725
|
isLoading: t.payload.isLoading
|
|
3726
|
-
} : t?.type ===
|
|
3726
|
+
} : t?.type === Qe ? {
|
|
3727
3727
|
...e,
|
|
3728
3728
|
isLoading: !1,
|
|
3729
3729
|
isAuthenticated: !0,
|
|
3730
3730
|
user: t.payload.user,
|
|
3731
3731
|
authenticationType: t.payload.authenticationType,
|
|
3732
3732
|
logoutReason: ""
|
|
3733
|
-
} : t?.type ===
|
|
3733
|
+
} : t?.type === rs ? {
|
|
3734
3734
|
...e,
|
|
3735
3735
|
isLoading: !1,
|
|
3736
3736
|
isAuthenticated: !1,
|
|
@@ -3739,29 +3739,29 @@ const _e = () => {
|
|
|
3739
3739
|
logoutReason: t.payload.logoutReason
|
|
3740
3740
|
} : e, ai = ({ children: e }) => {
|
|
3741
3741
|
const t = ei();
|
|
3742
|
-
return /* @__PURE__ */ h(
|
|
3743
|
-
},
|
|
3742
|
+
return /* @__PURE__ */ h(Yr.Provider, { value: t, children: e });
|
|
3743
|
+
}, wr = ({
|
|
3744
3744
|
children: e,
|
|
3745
3745
|
sessionExpiration: t,
|
|
3746
3746
|
clientId: r,
|
|
3747
3747
|
domain: s = "",
|
|
3748
3748
|
debug: a = !1,
|
|
3749
|
-
endpoint: n =
|
|
3749
|
+
endpoint: n = jn ? "https://auth.gizmette.local.com:3003" : "https://mylogin.gizmette.com/auth"
|
|
3750
3750
|
}) => {
|
|
3751
|
-
const [i, o] =
|
|
3752
|
-
...
|
|
3751
|
+
const [i, o] = kr(si, {
|
|
3752
|
+
...is,
|
|
3753
3753
|
debug: a
|
|
3754
|
-
}), c = ti(a), f = j(!1), [d, u, , l] =
|
|
3755
|
-
key: `${
|
|
3756
|
-
}), [m, p, , g] =
|
|
3757
|
-
key: `${
|
|
3758
|
-
}), [b, E, , O] =
|
|
3754
|
+
}), c = ti(a), f = j(!1), [d, u, , l] = Be({
|
|
3755
|
+
key: `${qe}::${r}::@@user@@`
|
|
3756
|
+
}), [m, p, , g] = Be({
|
|
3757
|
+
key: `${qe}::${r}::@@access@@`
|
|
3758
|
+
}), [b, E, , O] = Be(
|
|
3759
3759
|
{
|
|
3760
|
-
key: `${
|
|
3760
|
+
key: `${qe}::${r}::@@refresh@@`
|
|
3761
3761
|
}
|
|
3762
|
-
), [A, K, , R] =
|
|
3763
|
-
key: `${
|
|
3764
|
-
}),
|
|
3762
|
+
), [A, K, , R] = Be({
|
|
3763
|
+
key: `${qe}::${r}::@@nonce@@`
|
|
3764
|
+
}), z = new Zn(m, b), C = X(() => {
|
|
3765
3765
|
c("removeLocalStorage: removing local storage"), l(), g(), O(), R();
|
|
3766
3766
|
}, [
|
|
3767
3767
|
g,
|
|
@@ -3769,20 +3769,20 @@ const _e = () => {
|
|
|
3769
3769
|
R,
|
|
3770
3770
|
O,
|
|
3771
3771
|
c
|
|
3772
|
-
]), v =
|
|
3772
|
+
]), v = X(
|
|
3773
3773
|
(w) => {
|
|
3774
3774
|
c(
|
|
3775
3775
|
"removeStateAndLocalStorage: removing state and local storage with reason: ",
|
|
3776
3776
|
w
|
|
3777
3777
|
), o({
|
|
3778
|
-
type:
|
|
3778
|
+
type: rs,
|
|
3779
3779
|
payload: {
|
|
3780
|
-
logoutReason: w ||
|
|
3780
|
+
logoutReason: w || Ae
|
|
3781
3781
|
}
|
|
3782
|
-
}), C(), o({ type:
|
|
3782
|
+
}), C(), o({ type: $e, payload: { isLoading: !1 } });
|
|
3783
3783
|
},
|
|
3784
3784
|
[C, c]
|
|
3785
|
-
), x =
|
|
3785
|
+
), x = X(
|
|
3786
3786
|
async (w) => {
|
|
3787
3787
|
c("invalidateAndLogout: invalidating and logging out");
|
|
3788
3788
|
const { user: T } = i, S = T?.userId || Qn(d);
|
|
@@ -3794,7 +3794,7 @@ const _e = () => {
|
|
|
3794
3794
|
domain: s,
|
|
3795
3795
|
idToken: d,
|
|
3796
3796
|
endpoint: n
|
|
3797
|
-
}), v(w ||
|
|
3797
|
+
}), v(w || Ae);
|
|
3798
3798
|
},
|
|
3799
3799
|
[
|
|
3800
3800
|
d,
|
|
@@ -3810,9 +3810,9 @@ const _e = () => {
|
|
|
3810
3810
|
if (!f.current)
|
|
3811
3811
|
return i.isLoading && d !== null ? (async () => {
|
|
3812
3812
|
try {
|
|
3813
|
-
const w = await
|
|
3813
|
+
const w = await Ue(d);
|
|
3814
3814
|
w && w.payload[F.USER_ID_KEY] !== "" ? (c("useEffect: setting the authentication state"), o({
|
|
3815
|
-
type:
|
|
3815
|
+
type: Qe,
|
|
3816
3816
|
payload: {
|
|
3817
3817
|
authenticationType: w.payload[F.AUTH_TYPE_KEY],
|
|
3818
3818
|
user: {
|
|
@@ -3821,51 +3821,51 @@ const _e = () => {
|
|
|
3821
3821
|
email: w.payload[F.EMAIL_KEY]
|
|
3822
3822
|
}
|
|
3823
3823
|
}
|
|
3824
|
-
})) : (c("useEffect: invalid JWT, invalidating and logging out"), await x(
|
|
3824
|
+
})) : (c("useEffect: invalid JWT, invalidating and logging out"), await x(Ae));
|
|
3825
3825
|
} catch {
|
|
3826
3826
|
c(
|
|
3827
3827
|
"useEffect: exception validating JWT, invalidating and logging out"
|
|
3828
|
-
), await x(
|
|
3828
|
+
), await x(Ae);
|
|
3829
3829
|
}
|
|
3830
|
-
})() : (c("useEffect: setting the loading state to false"), o({ type:
|
|
3830
|
+
})() : (c("useEffect: setting the loading state to false"), o({ type: $e, payload: { isLoading: !1 } })), () => {
|
|
3831
3831
|
f.current = !0;
|
|
3832
3832
|
};
|
|
3833
3833
|
}, [i.isLoading, d, x, c]);
|
|
3834
3834
|
const _ = async (w, T) => {
|
|
3835
|
-
o({ type:
|
|
3836
|
-
const S =
|
|
3835
|
+
o({ type: $e, payload: { isLoading: !0 } }), C();
|
|
3836
|
+
const S = vt();
|
|
3837
3837
|
K(S), c("login: Logging in with password");
|
|
3838
|
-
const { code_verifier: le, code_challenge: ue } = await _n(),
|
|
3838
|
+
const { code_verifier: le, code_challenge: ue } = await _n(), Zt = await zn({
|
|
3839
3839
|
endpoint: n,
|
|
3840
3840
|
nonce: S,
|
|
3841
3841
|
clientId: r,
|
|
3842
3842
|
code_challenge: ue
|
|
3843
3843
|
});
|
|
3844
|
-
if (
|
|
3845
|
-
const
|
|
3844
|
+
if (Zt.status) {
|
|
3845
|
+
const ve = await Yn({
|
|
3846
3846
|
endpoint: n,
|
|
3847
3847
|
username: w,
|
|
3848
3848
|
password: T,
|
|
3849
3849
|
clientId: r,
|
|
3850
3850
|
sessionExpiration: t,
|
|
3851
3851
|
nonce: S,
|
|
3852
|
-
type:
|
|
3853
|
-
code:
|
|
3852
|
+
type: xe.CODE,
|
|
3853
|
+
code: Zt.data,
|
|
3854
3854
|
code_verifier: le,
|
|
3855
3855
|
domain: s,
|
|
3856
3856
|
ua: navigator.userAgent
|
|
3857
3857
|
});
|
|
3858
|
-
return
|
|
3859
|
-
type:
|
|
3858
|
+
return ve.status ? (u(ve.idToken), p(ve.accessToken), E(ve.refreshToken), o({
|
|
3859
|
+
type: Qe,
|
|
3860
3860
|
payload: {
|
|
3861
|
-
authenticationType:
|
|
3861
|
+
authenticationType: xe.CODE,
|
|
3862
3862
|
user: {
|
|
3863
|
-
userId:
|
|
3863
|
+
userId: ve.userId,
|
|
3864
3864
|
username: w,
|
|
3865
|
-
email:
|
|
3865
|
+
email: ve.email
|
|
3866
3866
|
}
|
|
3867
3867
|
}
|
|
3868
|
-
}), !0) : (v(
|
|
3868
|
+
}), !0) : (v(Tt), !1);
|
|
3869
3869
|
}
|
|
3870
3870
|
return !1;
|
|
3871
3871
|
}, I = async (w) => {
|
|
@@ -3876,12 +3876,12 @@ const _e = () => {
|
|
|
3876
3876
|
if (w && T && T.userId) {
|
|
3877
3877
|
if (m) {
|
|
3878
3878
|
c("getAccessToken");
|
|
3879
|
-
const le = await
|
|
3879
|
+
const le = await Ue(m);
|
|
3880
3880
|
if (le && le.payload[F.USER_ID_KEY] !== "")
|
|
3881
3881
|
return m;
|
|
3882
3882
|
}
|
|
3883
3883
|
c("getAccessToken: invalid access token, trying to refresh it");
|
|
3884
|
-
const S = await
|
|
3884
|
+
const S = await z.refreshtoken({
|
|
3885
3885
|
endpoint: n,
|
|
3886
3886
|
clientId: r,
|
|
3887
3887
|
userId: T.userId,
|
|
@@ -3890,23 +3890,23 @@ const _e = () => {
|
|
|
3890
3890
|
});
|
|
3891
3891
|
return S.status && S.status === "success" && S.newAccessToken ? (p(S.newAccessToken), E(S.newRefreshToken), S.newAccessToken) : (c(
|
|
3892
3892
|
"getAccessToken: invalid refresh token, need to re-authenticate"
|
|
3893
|
-
), await x(
|
|
3893
|
+
), await x(Ae), "");
|
|
3894
3894
|
}
|
|
3895
3895
|
return c(
|
|
3896
3896
|
"getAccessToken: user is not authenticated, cannot get access token"
|
|
3897
|
-
), await x(
|
|
3897
|
+
), await x(Ae), "";
|
|
3898
3898
|
} catch {
|
|
3899
3899
|
return c(
|
|
3900
3900
|
"getAccessToken: exception occurred, invalidating and logging out"
|
|
3901
|
-
), await x(
|
|
3901
|
+
), await x(qn), "";
|
|
3902
3902
|
}
|
|
3903
|
-
},
|
|
3903
|
+
}, J = () => i.isAuthenticated && d ? d : "", ce = async () => {
|
|
3904
3904
|
const { user: w } = i;
|
|
3905
|
-
let T = await
|
|
3905
|
+
let T = await _e({
|
|
3906
3906
|
endpoint: n,
|
|
3907
3907
|
accessToken: m,
|
|
3908
3908
|
clientId: r,
|
|
3909
|
-
type:
|
|
3909
|
+
type: Ie.GET_REGISTRATION_OPTIONS,
|
|
3910
3910
|
params: {
|
|
3911
3911
|
clientId: r,
|
|
3912
3912
|
id: w?.userId,
|
|
@@ -3918,11 +3918,11 @@ const _e = () => {
|
|
|
3918
3918
|
const S = await $n({
|
|
3919
3919
|
optionsJSON: T.data
|
|
3920
3920
|
});
|
|
3921
|
-
return T = await
|
|
3921
|
+
return T = await _e({
|
|
3922
3922
|
endpoint: n,
|
|
3923
3923
|
accessToken: m,
|
|
3924
3924
|
clientId: r,
|
|
3925
|
-
type:
|
|
3925
|
+
type: Ie.VERIFY_REGISTRATION,
|
|
3926
3926
|
params: {
|
|
3927
3927
|
clientId: r,
|
|
3928
3928
|
id: w?.userId,
|
|
@@ -3931,11 +3931,11 @@ const _e = () => {
|
|
|
3931
3931
|
}
|
|
3932
3932
|
}), !!(T.status && T.data.length > 0);
|
|
3933
3933
|
} catch {
|
|
3934
|
-
return await
|
|
3934
|
+
return await _e({
|
|
3935
3935
|
endpoint: n,
|
|
3936
3936
|
accessToken: m,
|
|
3937
3937
|
clientId: r,
|
|
3938
|
-
type:
|
|
3938
|
+
type: Ie.VERIFY_REGISTRATION,
|
|
3939
3939
|
params: {
|
|
3940
3940
|
clientId: r,
|
|
3941
3941
|
id: w?.userId,
|
|
@@ -3945,16 +3945,16 @@ const _e = () => {
|
|
|
3945
3945
|
}), !1;
|
|
3946
3946
|
}
|
|
3947
3947
|
return !1;
|
|
3948
|
-
},
|
|
3949
|
-
o({ type:
|
|
3950
|
-
const w =
|
|
3948
|
+
}, Se = async () => {
|
|
3949
|
+
o({ type: $e, payload: { isLoading: !0 } }), C();
|
|
3950
|
+
const w = vt();
|
|
3951
3951
|
K(w), c("loginWithPasskey");
|
|
3952
|
-
const T =
|
|
3953
|
-
let S = await
|
|
3952
|
+
const T = vt();
|
|
3953
|
+
let S = await _e({
|
|
3954
3954
|
endpoint: n,
|
|
3955
3955
|
accessToken: m,
|
|
3956
3956
|
clientId: r,
|
|
3957
|
-
type:
|
|
3957
|
+
type: Ie.GET_AUTHENTICATION_OPTIONS,
|
|
3958
3958
|
params: {
|
|
3959
3959
|
id: T,
|
|
3960
3960
|
clientId: r
|
|
@@ -3965,11 +3965,11 @@ const _e = () => {
|
|
|
3965
3965
|
const le = await Dn({
|
|
3966
3966
|
optionsJSON: S.data
|
|
3967
3967
|
});
|
|
3968
|
-
return S = await
|
|
3968
|
+
return S = await _e({
|
|
3969
3969
|
endpoint: n,
|
|
3970
3970
|
accessToken: m,
|
|
3971
3971
|
clientId: r,
|
|
3972
|
-
type:
|
|
3972
|
+
type: Ie.VERIFY_AUTHENTICATION,
|
|
3973
3973
|
params: {
|
|
3974
3974
|
clientId: r,
|
|
3975
3975
|
id: T,
|
|
@@ -3979,23 +3979,23 @@ const _e = () => {
|
|
|
3979
3979
|
sessionExpiration: t,
|
|
3980
3980
|
ua: navigator.userAgent
|
|
3981
3981
|
}
|
|
3982
|
-
}), S.data.status ===
|
|
3983
|
-
type:
|
|
3982
|
+
}), S.data.status === Fe ? (u(S.data.idToken), p(S.data.accessToken), E(S.data.refreshToken), o({
|
|
3983
|
+
type: Qe,
|
|
3984
3984
|
payload: {
|
|
3985
|
-
authenticationType:
|
|
3985
|
+
authenticationType: xe.PASSKEY,
|
|
3986
3986
|
user: {
|
|
3987
3987
|
userId: S.data.userId,
|
|
3988
3988
|
username: S.data.username,
|
|
3989
3989
|
email: S.data.email
|
|
3990
3990
|
}
|
|
3991
3991
|
}
|
|
3992
|
-
}), !0) : (v(
|
|
3992
|
+
}), !0) : (v(Tt), !1);
|
|
3993
3993
|
} catch {
|
|
3994
|
-
return await
|
|
3994
|
+
return await _e({
|
|
3995
3995
|
endpoint: n,
|
|
3996
3996
|
accessToken: m,
|
|
3997
3997
|
clientId: r,
|
|
3998
|
-
type:
|
|
3998
|
+
type: Ie.VERIFY_AUTHENTICATION,
|
|
3999
3999
|
params: {
|
|
4000
4000
|
clientId: r,
|
|
4001
4001
|
id: T,
|
|
@@ -4004,21 +4004,21 @@ const _e = () => {
|
|
|
4004
4004
|
domain: s,
|
|
4005
4005
|
sessionExpiration: t
|
|
4006
4006
|
}
|
|
4007
|
-
}), v(
|
|
4007
|
+
}), v(Tt), !1;
|
|
4008
4008
|
}
|
|
4009
4009
|
return !1;
|
|
4010
4010
|
};
|
|
4011
4011
|
return /* @__PURE__ */ h(ri.Provider, { value: { state: i, dispatch: o }, children: /* @__PURE__ */ h(
|
|
4012
|
-
|
|
4012
|
+
os.Provider,
|
|
4013
4013
|
{
|
|
4014
4014
|
value: {
|
|
4015
4015
|
...i,
|
|
4016
4016
|
login: _,
|
|
4017
4017
|
logout: I,
|
|
4018
4018
|
getAccessToken: N,
|
|
4019
|
-
getIdToken:
|
|
4019
|
+
getIdToken: J,
|
|
4020
4020
|
registeringForPasskey: ce,
|
|
4021
|
-
loginWithPasskey:
|
|
4021
|
+
loginWithPasskey: Se
|
|
4022
4022
|
},
|
|
4023
4023
|
children: /* @__PURE__ */ h(ai, { children: e })
|
|
4024
4024
|
}
|
|
@@ -4037,41 +4037,41 @@ try {
|
|
|
4037
4037
|
});
|
|
4038
4038
|
} catch {
|
|
4039
4039
|
}
|
|
4040
|
-
const
|
|
4041
|
-
const e =
|
|
4040
|
+
const cs = () => {
|
|
4041
|
+
const e = ct(Yr);
|
|
4042
4042
|
if (!e)
|
|
4043
4043
|
throw new Error("useAuth must be used within an AuthHookProvider");
|
|
4044
4044
|
return e;
|
|
4045
|
-
}, nc = "I'm having trouble right now. Please try again later.", ic = "action-search", oc = "action-sort", cc = "action-toggle-prompt", lc = "action-reset-prompt",
|
|
4046
|
-
let
|
|
4045
|
+
}, nc = "I'm having trouble right now. Please try again later.", ic = "action-search", oc = "action-sort", cc = "action-toggle-prompt", lc = "action-reset-prompt", ls = "sassy-saint-", uc = "search", dc = "sort", hc = "sort-timestamp", fc = "sort-token-usage", mc = "sort-memory-direction", pc = "sort-memory-column", yc = "favorites-only", gc = "private-disclosure", bc = "reasoning-disclosure", us = "service-worker", Ec = "chat-id", Sr = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", wc = 10, Sc = 30, vc = "av-prompt", Tc = "av-prompt-editable", Ac = "size-5 sm:size-4", Ic = 30, _c = 15, Rc = 130, Cc = 160, Oc = 16, kc = 24, Nc = 76, Pc = 76;
|
|
4046
|
+
let At = null, ae = !1;
|
|
4047
4047
|
typeof window < "u" && "serviceWorker" in navigator && navigator.serviceWorker.addEventListener("controllerchange", () => {
|
|
4048
4048
|
ae && (ae = !1, window.location.reload());
|
|
4049
4049
|
});
|
|
4050
|
-
function
|
|
4050
|
+
function Vt() {
|
|
4051
4051
|
return "serviceWorker" in navigator;
|
|
4052
4052
|
}
|
|
4053
|
-
function
|
|
4053
|
+
function Dt() {
|
|
4054
4054
|
const e = localStorage.getItem(
|
|
4055
|
-
|
|
4055
|
+
ls + us
|
|
4056
4056
|
);
|
|
4057
4057
|
return e === null ? !1 : e === "true";
|
|
4058
4058
|
}
|
|
4059
4059
|
function ni(e) {
|
|
4060
4060
|
localStorage.setItem(
|
|
4061
|
-
|
|
4061
|
+
ls + us,
|
|
4062
4062
|
e.toString()
|
|
4063
4063
|
);
|
|
4064
4064
|
}
|
|
4065
|
-
async function
|
|
4066
|
-
if (!
|
|
4065
|
+
async function ds() {
|
|
4066
|
+
if (!Dt())
|
|
4067
4067
|
return !1;
|
|
4068
|
-
if (!
|
|
4068
|
+
if (!Vt())
|
|
4069
4069
|
return console.warn("[SW] Service workers not supported"), !1;
|
|
4070
4070
|
try {
|
|
4071
|
-
return
|
|
4071
|
+
return At = await navigator.serviceWorker.register("/sw.js", {
|
|
4072
4072
|
scope: "/"
|
|
4073
|
-
}),
|
|
4074
|
-
const e =
|
|
4073
|
+
}), At.addEventListener("updatefound", () => {
|
|
4074
|
+
const e = At?.installing;
|
|
4075
4075
|
e && e.addEventListener("statechange", () => {
|
|
4076
4076
|
e.state === "installed" && navigator.serviceWorker.controller && confirm(
|
|
4077
4077
|
"A new version of the app is available. Reload to update cache?"
|
|
@@ -4083,7 +4083,7 @@ async function us() {
|
|
|
4083
4083
|
}
|
|
4084
4084
|
}
|
|
4085
4085
|
async function ii() {
|
|
4086
|
-
if (!
|
|
4086
|
+
if (!Vt())
|
|
4087
4087
|
return !1;
|
|
4088
4088
|
try {
|
|
4089
4089
|
const e = await navigator.serviceWorker.getRegistration();
|
|
@@ -4099,12 +4099,12 @@ async function $c(e) {
|
|
|
4099
4099
|
sessionStorage.setItem("sw-toggle-pending", "enabled");
|
|
4100
4100
|
} catch {
|
|
4101
4101
|
}
|
|
4102
|
-
await
|
|
4102
|
+
await ds(), navigator.serviceWorker.controller && ae && (ae = !1, window.location.reload());
|
|
4103
4103
|
try {
|
|
4104
4104
|
navigator.serviceWorker.ready.then(() => {
|
|
4105
|
-
ae &&
|
|
4105
|
+
ae && Dt() && (ae = !1, window.location.reload());
|
|
4106
4106
|
}), setTimeout(() => {
|
|
4107
|
-
ae &&
|
|
4107
|
+
ae && Dt() && (ae = !1, window.location.reload());
|
|
4108
4108
|
}, 3e3);
|
|
4109
4109
|
} catch {
|
|
4110
4110
|
}
|
|
@@ -4114,7 +4114,7 @@ async function $c(e) {
|
|
|
4114
4114
|
} catch {
|
|
4115
4115
|
}
|
|
4116
4116
|
try {
|
|
4117
|
-
|
|
4117
|
+
Vt() && await oi();
|
|
4118
4118
|
} catch (t) {
|
|
4119
4119
|
console.warn("[SW] Failed to invalidate cache:", t);
|
|
4120
4120
|
}
|
|
@@ -4144,13 +4144,13 @@ async function oi() {
|
|
|
4144
4144
|
console.warn("[SW] Failed to invalidate cache:", e);
|
|
4145
4145
|
}
|
|
4146
4146
|
}
|
|
4147
|
-
function
|
|
4147
|
+
function It() {
|
|
4148
4148
|
return "unknown";
|
|
4149
4149
|
}
|
|
4150
4150
|
async function xc(e = {}) {
|
|
4151
4151
|
const { urlLimitPerCache: t } = e;
|
|
4152
4152
|
if (!("caches" in window))
|
|
4153
|
-
return { version:
|
|
4153
|
+
return { version: It(), caches: [], totalItems: 0 };
|
|
4154
4154
|
try {
|
|
4155
4155
|
const r = await caches.keys(), s = [];
|
|
4156
4156
|
let a = 0;
|
|
@@ -4166,51 +4166,51 @@ async function xc(e = {}) {
|
|
|
4166
4166
|
console.warn("[SW] Failed reading cache", n, i);
|
|
4167
4167
|
}
|
|
4168
4168
|
return {
|
|
4169
|
-
version:
|
|
4169
|
+
version: It(),
|
|
4170
4170
|
caches: s,
|
|
4171
4171
|
totalItems: a
|
|
4172
4172
|
};
|
|
4173
4173
|
} catch (r) {
|
|
4174
|
-
return console.warn("[SW] getCacheInfo failed:", r), { version:
|
|
4175
|
-
}
|
|
4176
|
-
}
|
|
4177
|
-
const Mc = "user", Dc = "assistant", Lc = "data",
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
],
|
|
4182
|
-
[
|
|
4183
|
-
[
|
|
4184
|
-
[
|
|
4185
|
-
[
|
|
4186
|
-
[
|
|
4187
|
-
[
|
|
4188
|
-
[
|
|
4189
|
-
[
|
|
4190
|
-
[
|
|
4191
|
-
[
|
|
4192
|
-
},
|
|
4193
|
-
[
|
|
4194
|
-
|
|
4195
|
-
hs,
|
|
4174
|
+
return console.warn("[SW] getCacheInfo failed:", r), { version: It(), caches: [], totalItems: 0 };
|
|
4175
|
+
}
|
|
4176
|
+
}
|
|
4177
|
+
const Mc = "user", Dc = "assistant", Lc = "data", He = "OpenAI", dt = "Anthropic", ht = "Google", hs = "Perplexity", Uc = He, ci = [
|
|
4178
|
+
He,
|
|
4179
|
+
dt,
|
|
4180
|
+
ht
|
|
4181
|
+
], fs = "gpt-5", ms = "gpt-5-mini", ps = "gpt-5-nano", ys = "gpt-4.1-nano", gs = "claude-haiku-4-5-20251001", bs = "claude-sonnet-4-5-20250929", Es = "gemini-2.5-flash", ws = "gemini-2.5-pro", Ss = "sonar", vs = "sonar-pro", Fc = {
|
|
4182
|
+
[fs]: "GPT-5",
|
|
4183
|
+
[ms]: "GPT-5 Mini",
|
|
4184
|
+
[ps]: "GPT-5 Nano",
|
|
4185
|
+
[ys]: "GPT-4.1 Nano",
|
|
4186
|
+
[gs]: "Claude Haiku 4.5",
|
|
4187
|
+
[bs]: "Claude Sonnet 4.5",
|
|
4188
|
+
[Es]: "Gemini 2.5 Flash",
|
|
4189
|
+
[ws]: "Gemini 2.5 Pro",
|
|
4190
|
+
[Ss]: "Sonar",
|
|
4191
|
+
[vs]: "Sonar Pro"
|
|
4192
|
+
}, Ts = {
|
|
4193
|
+
[He]: [
|
|
4194
|
+
ys,
|
|
4196
4195
|
fs,
|
|
4197
|
-
ms
|
|
4196
|
+
ms,
|
|
4197
|
+
ps
|
|
4198
4198
|
],
|
|
4199
|
-
[
|
|
4200
|
-
[
|
|
4201
|
-
[
|
|
4199
|
+
[dt]: [gs, bs],
|
|
4200
|
+
[ht]: [Es, ws],
|
|
4201
|
+
[hs]: [Ss, vs]
|
|
4202
4202
|
}, li = "claude-sonnet-4", ui = "claude-3", di = "gpt-", hi = "o3", fi = "o4", mi = "gemini", pi = "sonar", yi = {
|
|
4203
|
-
[
|
|
4203
|
+
[dt]: [
|
|
4204
4204
|
li,
|
|
4205
4205
|
ui
|
|
4206
4206
|
],
|
|
4207
|
-
[
|
|
4207
|
+
[He]: [
|
|
4208
4208
|
di,
|
|
4209
4209
|
hi,
|
|
4210
4210
|
fi
|
|
4211
4211
|
],
|
|
4212
|
-
[
|
|
4213
|
-
[
|
|
4212
|
+
[ht]: [mi],
|
|
4213
|
+
[hs]: [pi]
|
|
4214
4214
|
}, Hc = "x-diggidy-chat-id", Kc = "timestamp", Gc = "tokenUsage", k = "Diggidy", Bc = {
|
|
4215
4215
|
TOOL: {
|
|
4216
4216
|
MEMORIES: "getUserMemories"
|
|
@@ -4219,22 +4219,22 @@ const Mc = "user", Dc = "assistant", Lc = "data", Fe = "OpenAI", lt = "Anthropic
|
|
|
4219
4219
|
ATTACHMENTS: "addon:attachments",
|
|
4220
4220
|
REASONING: "addon:reasoning"
|
|
4221
4221
|
}
|
|
4222
|
-
},
|
|
4222
|
+
}, qc = (e) => {
|
|
4223
4223
|
for (const [t, r] of Object.entries(
|
|
4224
4224
|
yi
|
|
4225
4225
|
))
|
|
4226
4226
|
if (r.some((s) => e.startsWith(s)))
|
|
4227
4227
|
return t;
|
|
4228
4228
|
return null;
|
|
4229
|
-
},
|
|
4229
|
+
}, Wc = (e) => {
|
|
4230
4230
|
if (!e || e.length === 0)
|
|
4231
4231
|
return [];
|
|
4232
4232
|
const t = /* @__PURE__ */ new Set();
|
|
4233
4233
|
for (const r of e)
|
|
4234
4234
|
for (const [s, a] of Object.entries(
|
|
4235
|
-
|
|
4235
|
+
Ts
|
|
4236
4236
|
))
|
|
4237
|
-
a.includes(r) && (s ===
|
|
4237
|
+
a.includes(r) && (s === He || s === dt || s === ht) && t.add(s);
|
|
4238
4238
|
return ci.filter((r) => t.has(r));
|
|
4239
4239
|
}, gi = (e) => {
|
|
4240
4240
|
const t = /* @__PURE__ */ new Map();
|
|
@@ -4242,20 +4242,20 @@ const Mc = "user", Dc = "assistant", Lc = "data", Fe = "OpenAI", lt = "Anthropic
|
|
|
4242
4242
|
return t;
|
|
4243
4243
|
for (const r of e)
|
|
4244
4244
|
for (const [s, a] of Object.entries(
|
|
4245
|
-
|
|
4245
|
+
Ts
|
|
4246
4246
|
))
|
|
4247
4247
|
if (a.includes(r)) {
|
|
4248
4248
|
t.has(s) || t.set(s, []), t.get(s)?.push(r);
|
|
4249
4249
|
break;
|
|
4250
4250
|
}
|
|
4251
4251
|
return t;
|
|
4252
|
-
},
|
|
4252
|
+
}, Vc = (e) => {
|
|
4253
4253
|
const t = gi(e);
|
|
4254
4254
|
for (const r of t.values())
|
|
4255
4255
|
if (r.length > 1)
|
|
4256
4256
|
return !0;
|
|
4257
4257
|
return !1;
|
|
4258
|
-
},
|
|
4258
|
+
}, jc = (e, t) => !e || !t || t.length === 0 ? !1 : t.includes(e);
|
|
4259
4259
|
function bi(e) {
|
|
4260
4260
|
return e ? new Set(e) : null;
|
|
4261
4261
|
}
|
|
@@ -4466,7 +4466,7 @@ const G = {
|
|
|
4466
4466
|
DELETE_MEMORIES: `mutation DeleteMemories($user: String!) {
|
|
4467
4467
|
deleteMemories(user: $user)
|
|
4468
4468
|
}`
|
|
4469
|
-
},
|
|
4469
|
+
}, B = {
|
|
4470
4470
|
GET_LOCATION: {
|
|
4471
4471
|
schema: G.GET_LOCATION,
|
|
4472
4472
|
method: "location"
|
|
@@ -4520,15 +4520,18 @@ const G = {
|
|
|
4520
4520
|
method: "getUserMemories"
|
|
4521
4521
|
},
|
|
4522
4522
|
DELETE_MEMORY: {
|
|
4523
|
-
schema: G.DELETE_MEMORY
|
|
4523
|
+
schema: G.DELETE_MEMORY,
|
|
4524
|
+
method: "deleteMemory"
|
|
4524
4525
|
},
|
|
4525
4526
|
UPDATE_MEMORY: {
|
|
4526
|
-
schema: G.UPDATE_MEMORY
|
|
4527
|
+
schema: G.UPDATE_MEMORY,
|
|
4528
|
+
method: "updateMemory"
|
|
4527
4529
|
},
|
|
4528
4530
|
DELETE_MEMORIES: {
|
|
4529
|
-
schema: G.DELETE_MEMORIES
|
|
4531
|
+
schema: G.DELETE_MEMORIES,
|
|
4532
|
+
method: "deleteMemories"
|
|
4530
4533
|
}
|
|
4531
|
-
}, wi = process.env.PUBLIC_SASSY_API_SERVER_URL,
|
|
4534
|
+
}, wi = process.env.PUBLIC_SASSY_API_SERVER_URL, nt = async ({
|
|
4532
4535
|
query: e,
|
|
4533
4536
|
data: t,
|
|
4534
4537
|
headers: r = {},
|
|
@@ -4546,18 +4549,18 @@ const G = {
|
|
|
4546
4549
|
variables: t
|
|
4547
4550
|
}),
|
|
4548
4551
|
...s
|
|
4549
|
-
}),
|
|
4552
|
+
}), me = async (e) => {
|
|
4550
4553
|
const t = e.type?.data ? e.type.data(e.params) : e.params;
|
|
4551
4554
|
try {
|
|
4552
4555
|
let r;
|
|
4553
4556
|
if (e.noAuth === !0)
|
|
4554
|
-
r = await
|
|
4557
|
+
r = await nt({
|
|
4555
4558
|
query: e.type.schema,
|
|
4556
4559
|
data: t
|
|
4557
4560
|
});
|
|
4558
4561
|
else {
|
|
4559
4562
|
const n = `Bearer ${e.accessToken}`;
|
|
4560
|
-
r = await
|
|
4563
|
+
r = await nt({
|
|
4561
4564
|
headers: {
|
|
4562
4565
|
authorization: n
|
|
4563
4566
|
},
|
|
@@ -4588,23 +4591,24 @@ const G = {
|
|
|
4588
4591
|
user: s,
|
|
4589
4592
|
provider: e
|
|
4590
4593
|
};
|
|
4591
|
-
return t && (a.model = t), await
|
|
4594
|
+
return t && (a.model = t), await me({
|
|
4592
4595
|
accessToken: r,
|
|
4593
|
-
type:
|
|
4596
|
+
type: B.SET_USER_PREFERENCES,
|
|
4594
4597
|
params: a
|
|
4595
4598
|
});
|
|
4596
4599
|
}, Jc = async ({
|
|
4597
4600
|
plan: e,
|
|
4598
4601
|
accessToken: t,
|
|
4599
4602
|
username: r
|
|
4600
|
-
}) => await
|
|
4603
|
+
}) => await me({
|
|
4601
4604
|
accessToken: t,
|
|
4602
|
-
type:
|
|
4605
|
+
type: B.SET_USER_PREFERENCES,
|
|
4603
4606
|
params: {
|
|
4604
4607
|
user: r,
|
|
4605
4608
|
plan: e
|
|
4606
4609
|
}
|
|
4607
|
-
}),
|
|
4610
|
+
}), Q = {
|
|
4611
|
+
CHAT: "chat",
|
|
4608
4612
|
CHATS: "chats",
|
|
4609
4613
|
CHATS_STATS: "chatsStats",
|
|
4610
4614
|
CAPABILITIES: "capabilities",
|
|
@@ -4612,16 +4616,16 @@ const G = {
|
|
|
4612
4616
|
PREFERENCES: "preferences",
|
|
4613
4617
|
USAGE: "usage",
|
|
4614
4618
|
USER_MEMORIES: "userMemories"
|
|
4615
|
-
}, Yc = () =>
|
|
4616
|
-
queryKey: [
|
|
4617
|
-
queryFn: async () => await
|
|
4618
|
-
type:
|
|
4619
|
+
}, Yc = () => fe({
|
|
4620
|
+
queryKey: [Q.CAPABILITIES],
|
|
4621
|
+
queryFn: async () => await pe({
|
|
4622
|
+
type: B.GET_SERVER_CAPABILITIES,
|
|
4619
4623
|
noAuth: !0
|
|
4620
4624
|
})
|
|
4621
|
-
}), zc = () =>
|
|
4622
|
-
queryKey: [
|
|
4623
|
-
queryFn: async () => await
|
|
4624
|
-
type:
|
|
4625
|
+
}), zc = () => fe({
|
|
4626
|
+
queryKey: [Q.CHANGELOGS],
|
|
4627
|
+
queryFn: async () => await pe({
|
|
4628
|
+
type: B.GET_CHANGELOGS,
|
|
4625
4629
|
noAuth: !0,
|
|
4626
4630
|
params: {
|
|
4627
4631
|
client: !0
|
|
@@ -4630,25 +4634,25 @@ const G = {
|
|
|
4630
4634
|
}), Si = ({
|
|
4631
4635
|
user: e,
|
|
4632
4636
|
getAccessToken: t
|
|
4633
|
-
}) =>
|
|
4634
|
-
queryKey: [
|
|
4635
|
-
queryFn: async () => await
|
|
4637
|
+
}) => fe({
|
|
4638
|
+
queryKey: [Q.PREFERENCES, e],
|
|
4639
|
+
queryFn: async () => await pe({
|
|
4636
4640
|
params: {
|
|
4637
4641
|
user: e
|
|
4638
4642
|
},
|
|
4639
|
-
type:
|
|
4643
|
+
type: B.GET_USER_PREFERENCES,
|
|
4640
4644
|
getAccessToken: t
|
|
4641
4645
|
})
|
|
4642
4646
|
}), Xc = ({
|
|
4643
4647
|
user: e,
|
|
4644
4648
|
getAccessToken: t
|
|
4645
|
-
}) =>
|
|
4646
|
-
queryKey: [
|
|
4647
|
-
queryFn: async () => await
|
|
4649
|
+
}) => fe({
|
|
4650
|
+
queryKey: [Q.CHATS_STATS, e],
|
|
4651
|
+
queryFn: async () => await pe({
|
|
4648
4652
|
params: {
|
|
4649
4653
|
user: e
|
|
4650
4654
|
},
|
|
4651
|
-
type:
|
|
4655
|
+
type: B.GET_CHATS_STATS,
|
|
4652
4656
|
getAccessToken: t
|
|
4653
4657
|
})
|
|
4654
4658
|
}), Zc = ({
|
|
@@ -4658,12 +4662,12 @@ const G = {
|
|
|
4658
4662
|
sortedCell: s,
|
|
4659
4663
|
getAccessToken: a,
|
|
4660
4664
|
enabled: n = !0
|
|
4661
|
-
}) =>
|
|
4665
|
+
}) => fe({
|
|
4662
4666
|
enabled: n,
|
|
4663
4667
|
staleTime: 60 * 1e3,
|
|
4664
4668
|
// 1 minute
|
|
4665
|
-
queryKey: [
|
|
4666
|
-
queryFn: async () => await
|
|
4669
|
+
queryKey: [Q.CHATS, e, t, r, s],
|
|
4670
|
+
queryFn: async () => await pe({
|
|
4667
4671
|
params: {
|
|
4668
4672
|
user: e,
|
|
4669
4673
|
searchString: t,
|
|
@@ -4672,111 +4676,174 @@ const G = {
|
|
|
4672
4676
|
limit: 1,
|
|
4673
4677
|
truncateSize: 100
|
|
4674
4678
|
},
|
|
4675
|
-
type:
|
|
4679
|
+
type: B.GET_CHATS,
|
|
4676
4680
|
getAccessToken: a
|
|
4677
4681
|
})
|
|
4678
4682
|
}), el = ({
|
|
4683
|
+
chatId: e,
|
|
4684
|
+
getAccessToken: t,
|
|
4685
|
+
enabled: r = !0
|
|
4686
|
+
}) => fe({
|
|
4687
|
+
enabled: r && !!e,
|
|
4688
|
+
queryKey: [Q.CHAT, e],
|
|
4689
|
+
queryFn: async () => await pe({
|
|
4690
|
+
params: { id: e },
|
|
4691
|
+
type: B.GET_CHAT,
|
|
4692
|
+
getAccessToken: t
|
|
4693
|
+
})
|
|
4694
|
+
}), tl = ({
|
|
4695
|
+
getAccessToken: e
|
|
4696
|
+
}) => {
|
|
4697
|
+
const t = he();
|
|
4698
|
+
return Pe({
|
|
4699
|
+
mutationFn: async ({
|
|
4700
|
+
userId: r,
|
|
4701
|
+
id: s,
|
|
4702
|
+
messages: a,
|
|
4703
|
+
provider: n,
|
|
4704
|
+
tokenUsage: i
|
|
4705
|
+
}) => {
|
|
4706
|
+
const o = await e();
|
|
4707
|
+
return (await me({
|
|
4708
|
+
accessToken: o,
|
|
4709
|
+
type: B.SAVE_CHAT,
|
|
4710
|
+
params: { userId: r, id: s, messages: a, provider: n, tokenUsage: i }
|
|
4711
|
+
})).data;
|
|
4712
|
+
},
|
|
4713
|
+
onSuccess: (r, s) => {
|
|
4714
|
+
t.invalidateQueries({ queryKey: [Q.CHATS, s.userId] });
|
|
4715
|
+
}
|
|
4716
|
+
});
|
|
4717
|
+
}, rl = ({
|
|
4718
|
+
getAccessToken: e
|
|
4719
|
+
}) => {
|
|
4720
|
+
const t = he();
|
|
4721
|
+
return Pe({
|
|
4722
|
+
mutationFn: async ({ userId: r, id: s }) => {
|
|
4723
|
+
const a = await e();
|
|
4724
|
+
return (await me({
|
|
4725
|
+
accessToken: a,
|
|
4726
|
+
type: B.DELETE_CHAT,
|
|
4727
|
+
params: { userId: r, id: s }
|
|
4728
|
+
})).data;
|
|
4729
|
+
},
|
|
4730
|
+
onSuccess: (r, s) => {
|
|
4731
|
+
t.invalidateQueries({ queryKey: [Q.CHATS, s.userId] });
|
|
4732
|
+
}
|
|
4733
|
+
});
|
|
4734
|
+
}, sl = ({
|
|
4735
|
+
getAccessToken: e
|
|
4736
|
+
}) => {
|
|
4737
|
+
const t = he();
|
|
4738
|
+
return Pe({
|
|
4739
|
+
mutationFn: async ({ userId: r, id: s }) => {
|
|
4740
|
+
const a = await e();
|
|
4741
|
+
return (await me({
|
|
4742
|
+
accessToken: a,
|
|
4743
|
+
type: B.TOGGLE_FAVORITE_CHAT,
|
|
4744
|
+
params: { userId: r, id: s }
|
|
4745
|
+
})).data;
|
|
4746
|
+
},
|
|
4747
|
+
onSuccess: (r, s) => {
|
|
4748
|
+
t.invalidateQueries({ queryKey: [Q.CHATS, s.userId] });
|
|
4749
|
+
}
|
|
4750
|
+
});
|
|
4751
|
+
}, al = ({
|
|
4679
4752
|
user: e,
|
|
4680
4753
|
month: t,
|
|
4681
4754
|
year: r = (/* @__PURE__ */ new Date()).getFullYear().toString(),
|
|
4682
4755
|
getAccessToken: s,
|
|
4683
4756
|
enabled: a = !0
|
|
4684
|
-
}) =>
|
|
4757
|
+
}) => fe({
|
|
4685
4758
|
enabled: a,
|
|
4686
|
-
queryKey: [
|
|
4687
|
-
queryFn: async () => await
|
|
4759
|
+
queryKey: [Q.USAGE, e, t, r],
|
|
4760
|
+
queryFn: async () => await pe({
|
|
4688
4761
|
params: {
|
|
4689
4762
|
user: e,
|
|
4690
4763
|
month: t,
|
|
4691
4764
|
year: r
|
|
4692
4765
|
},
|
|
4693
|
-
type:
|
|
4766
|
+
type: B.GET_USAGE,
|
|
4694
4767
|
getAccessToken: s
|
|
4695
4768
|
})
|
|
4696
|
-
}),
|
|
4769
|
+
}), nl = ({
|
|
4697
4770
|
user: e,
|
|
4698
4771
|
query: t,
|
|
4699
4772
|
getAccessToken: r,
|
|
4700
4773
|
enabled: s = !0
|
|
4701
|
-
}) =>
|
|
4774
|
+
}) => fe({
|
|
4702
4775
|
enabled: s && !!e,
|
|
4703
|
-
queryKey: [
|
|
4704
|
-
queryFn: async () => await
|
|
4776
|
+
queryKey: [Q.USER_MEMORIES, e, t],
|
|
4777
|
+
queryFn: async () => await pe({
|
|
4705
4778
|
params: { user: e, query: t },
|
|
4706
|
-
type:
|
|
4779
|
+
type: B.GET_USER_MEMORIES,
|
|
4707
4780
|
getAccessToken: r
|
|
4708
4781
|
})
|
|
4709
|
-
}),
|
|
4782
|
+
}), il = ({
|
|
4710
4783
|
getAccessToken: e
|
|
4711
4784
|
}) => {
|
|
4712
|
-
const t =
|
|
4713
|
-
return
|
|
4785
|
+
const t = he();
|
|
4786
|
+
return Pe({
|
|
4714
4787
|
mutationFn: async ({
|
|
4715
4788
|
user: r,
|
|
4716
4789
|
memoryId: s,
|
|
4717
4790
|
description: a
|
|
4718
4791
|
}) => {
|
|
4719
|
-
const n = await e()
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
throw new Error(c[0]?.message || "Update memory failed");
|
|
4726
|
-
return o.updateMemory;
|
|
4792
|
+
const n = await e();
|
|
4793
|
+
return (await me({
|
|
4794
|
+
accessToken: n,
|
|
4795
|
+
type: B.UPDATE_MEMORY,
|
|
4796
|
+
params: { user: r, memoryId: s, description: a }
|
|
4797
|
+
})).data;
|
|
4727
4798
|
},
|
|
4728
4799
|
onSuccess: (r, s) => {
|
|
4729
4800
|
t.invalidateQueries({
|
|
4730
|
-
queryKey: [
|
|
4801
|
+
queryKey: [Q.USER_MEMORIES, s.user]
|
|
4731
4802
|
});
|
|
4732
4803
|
}
|
|
4733
4804
|
});
|
|
4734
|
-
},
|
|
4805
|
+
}, ol = ({
|
|
4735
4806
|
getAccessToken: e
|
|
4736
4807
|
}) => {
|
|
4737
|
-
const t =
|
|
4738
|
-
return
|
|
4808
|
+
const t = he();
|
|
4809
|
+
return Pe({
|
|
4739
4810
|
mutationFn: async ({
|
|
4740
4811
|
user: r,
|
|
4741
4812
|
memoryId: s
|
|
4742
4813
|
}) => {
|
|
4743
|
-
const a = await e()
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
throw new Error(o[0]?.message || "Delete memory failed");
|
|
4750
|
-
return i.deleteMemory;
|
|
4814
|
+
const a = await e();
|
|
4815
|
+
return (await me({
|
|
4816
|
+
accessToken: a,
|
|
4817
|
+
type: B.DELETE_MEMORY,
|
|
4818
|
+
params: { user: r, memoryId: s }
|
|
4819
|
+
})).data;
|
|
4751
4820
|
},
|
|
4752
4821
|
onSuccess: (r, s) => {
|
|
4753
4822
|
t.invalidateQueries({
|
|
4754
|
-
queryKey: [
|
|
4823
|
+
queryKey: [Q.USER_MEMORIES, s.user]
|
|
4755
4824
|
});
|
|
4756
4825
|
}
|
|
4757
4826
|
});
|
|
4758
|
-
},
|
|
4827
|
+
}, cl = ({
|
|
4759
4828
|
getAccessToken: e
|
|
4760
4829
|
}) => {
|
|
4761
|
-
const t =
|
|
4762
|
-
return
|
|
4830
|
+
const t = he();
|
|
4831
|
+
return Pe({
|
|
4763
4832
|
mutationFn: async ({ user: r }) => {
|
|
4764
|
-
const s = await e()
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
throw new Error(i[0]?.message || "Delete memories failed");
|
|
4771
|
-
return n.deleteMemories;
|
|
4833
|
+
const s = await e();
|
|
4834
|
+
return (await me({
|
|
4835
|
+
accessToken: s,
|
|
4836
|
+
type: B.DELETE_MEMORIES,
|
|
4837
|
+
params: { user: r }
|
|
4838
|
+
})).data;
|
|
4772
4839
|
},
|
|
4773
4840
|
onSuccess: (r, s) => {
|
|
4774
4841
|
t.invalidateQueries({
|
|
4775
|
-
queryKey: [
|
|
4842
|
+
queryKey: [Q.USER_MEMORIES, s.user]
|
|
4776
4843
|
});
|
|
4777
4844
|
}
|
|
4778
4845
|
});
|
|
4779
|
-
},
|
|
4846
|
+
}, pe = async ({
|
|
4780
4847
|
params: e,
|
|
4781
4848
|
type: t,
|
|
4782
4849
|
noAuth: r,
|
|
@@ -4786,13 +4853,13 @@ const G = {
|
|
|
4786
4853
|
const a = t?.data ? t.data(e) : e;
|
|
4787
4854
|
let n;
|
|
4788
4855
|
if (r === !0)
|
|
4789
|
-
n = await
|
|
4856
|
+
n = await nt({
|
|
4790
4857
|
query: t.schema,
|
|
4791
4858
|
data: a
|
|
4792
4859
|
});
|
|
4793
4860
|
else if (s) {
|
|
4794
4861
|
const f = await s();
|
|
4795
|
-
n = await
|
|
4862
|
+
n = await nt({
|
|
4796
4863
|
headers: {
|
|
4797
4864
|
authorization: `Bearer ${f}`
|
|
4798
4865
|
},
|
|
@@ -4812,9 +4879,9 @@ const G = {
|
|
|
4812
4879
|
} catch (a) {
|
|
4813
4880
|
return Promise.reject(a);
|
|
4814
4881
|
}
|
|
4815
|
-
}, As =
|
|
4882
|
+
}, As = Ft(
|
|
4816
4883
|
void 0
|
|
4817
|
-
),
|
|
4884
|
+
), vr = {
|
|
4818
4885
|
capabilities: /* @__PURE__ */ new Set(),
|
|
4819
4886
|
allowedModels: [],
|
|
4820
4887
|
version: null,
|
|
@@ -4824,10 +4891,10 @@ const G = {
|
|
|
4824
4891
|
getAccessToken: t,
|
|
4825
4892
|
children: r
|
|
4826
4893
|
}) => {
|
|
4827
|
-
const [s, a] = ie(
|
|
4894
|
+
const [s, a] = ie(vr), n = ze(
|
|
4828
4895
|
() => e ? `entitlements:${e}` : null,
|
|
4829
4896
|
[e]
|
|
4830
|
-
), i =
|
|
4897
|
+
), i = X(() => {
|
|
4831
4898
|
if (!n)
|
|
4832
4899
|
return !1;
|
|
4833
4900
|
try {
|
|
@@ -4878,7 +4945,7 @@ const G = {
|
|
|
4878
4945
|
} catch {
|
|
4879
4946
|
}
|
|
4880
4947
|
}, [o.data, n]);
|
|
4881
|
-
const c =
|
|
4948
|
+
const c = X(
|
|
4882
4949
|
(u) => {
|
|
4883
4950
|
const l = u?.entitlements;
|
|
4884
4951
|
if (l && (a({
|
|
@@ -4900,13 +4967,13 @@ const G = {
|
|
|
4900
4967
|
}
|
|
4901
4968
|
},
|
|
4902
4969
|
[n]
|
|
4903
|
-
), f =
|
|
4904
|
-
if (a(
|
|
4970
|
+
), f = X(() => {
|
|
4971
|
+
if (a(vr), n)
|
|
4905
4972
|
try {
|
|
4906
4973
|
sessionStorage.removeItem(n);
|
|
4907
4974
|
} catch {
|
|
4908
4975
|
}
|
|
4909
|
-
}, [n]), d =
|
|
4976
|
+
}, [n]), d = ze(
|
|
4910
4977
|
() => ({
|
|
4911
4978
|
...s,
|
|
4912
4979
|
check: (u, l) => s.status !== "ready" ? !1 : Ei(s.capabilities, u, { any: l?.any }),
|
|
@@ -4917,13 +4984,13 @@ const G = {
|
|
|
4917
4984
|
);
|
|
4918
4985
|
return /* @__PURE__ */ h(As.Provider, { value: d, children: r });
|
|
4919
4986
|
};
|
|
4920
|
-
function
|
|
4921
|
-
const e =
|
|
4987
|
+
function ll() {
|
|
4988
|
+
const e = ct(As);
|
|
4922
4989
|
if (!e)
|
|
4923
4990
|
throw new Error("useEntitlements must be used within EntitlementsProvider");
|
|
4924
4991
|
return e;
|
|
4925
4992
|
}
|
|
4926
|
-
const
|
|
4993
|
+
const Tr = (e) => Number.isFinite(e) ? e : 0;
|
|
4927
4994
|
function Ti(e) {
|
|
4928
4995
|
return {
|
|
4929
4996
|
days: Math.trunc(e / 864e5),
|
|
@@ -4931,8 +4998,8 @@ function Ti(e) {
|
|
|
4931
4998
|
minutes: Math.trunc(e / 6e4 % 60),
|
|
4932
4999
|
seconds: Math.trunc(e / 1e3 % 60),
|
|
4933
5000
|
milliseconds: Math.trunc(e % 1e3),
|
|
4934
|
-
microseconds: Math.trunc(
|
|
4935
|
-
nanoseconds: Math.trunc(
|
|
5001
|
+
microseconds: Math.trunc(Tr(e * 1e3) % 1e3),
|
|
5002
|
+
nanoseconds: Math.trunc(Tr(e * 1e6) % 1e3)
|
|
4936
5003
|
};
|
|
4937
5004
|
}
|
|
4938
5005
|
function Ai(e) {
|
|
@@ -5003,7 +5070,7 @@ function ki(e, t) {
|
|
|
5003
5070
|
const f = t.colonNotation ? ":" : " ";
|
|
5004
5071
|
return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), s + a.join(f);
|
|
5005
5072
|
}
|
|
5006
|
-
const Is = process.env.NODE_ENV === "production", jt = !Is, _s = jt ? "gizmette.local.com" : "gizmette.com",
|
|
5073
|
+
const Is = process.env.NODE_ENV === "production", jt = !Is, _s = jt ? "gizmette.local.com" : "gizmette.com", Qt = (e, t) => {
|
|
5007
5074
|
const r = e < 0 ? t ? "W" : "S" : t ? "E" : "N", s = 0 | Math.abs(e), a = 0 | Math.abs(e) * 60 % 60, n = (0 | Math.abs(e) * 60 % 1 * 6e3) / 100;
|
|
5008
5075
|
return {
|
|
5009
5076
|
dir: r,
|
|
@@ -5014,12 +5081,12 @@ const Is = process.env.NODE_ENV === "production", jt = !Is, _s = jt ? "gizmette.
|
|
|
5014
5081
|
}, Ni = (e) => {
|
|
5015
5082
|
if (!e && e !== 0)
|
|
5016
5083
|
return "N/A";
|
|
5017
|
-
const t =
|
|
5084
|
+
const t = Qt(e, !1);
|
|
5018
5085
|
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
5019
5086
|
}, Pi = (e) => {
|
|
5020
5087
|
if (!e && e !== 0)
|
|
5021
5088
|
return "N/A";
|
|
5022
|
-
const t =
|
|
5089
|
+
const t = Qt(e, !0);
|
|
5023
5090
|
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
5024
5091
|
}, $i = async () => {
|
|
5025
5092
|
const e = {
|
|
@@ -5075,7 +5142,7 @@ const Is = process.env.NODE_ENV === "production", jt = !Is, _s = jt ? "gizmette.
|
|
|
5075
5142
|
window.atob(e).split("").map(function(t) {
|
|
5076
5143
|
return `%${`00${t.charCodeAt(0).toString(16)}`.slice(-2)}`;
|
|
5077
5144
|
}).join("")
|
|
5078
|
-
), Di = (e, t, r) => t ? Object.keys(t).map((s) => /* @__PURE__ */ h("dl", { className: "my-0", children: /* @__PURE__ */
|
|
5145
|
+
), Di = (e, t, r) => t ? Object.keys(t).map((s) => /* @__PURE__ */ h("dl", { className: "my-0", children: /* @__PURE__ */ V("div", { className: "flex items-center justify-between", children: [
|
|
5079
5146
|
/* @__PURE__ */ h(
|
|
5080
5147
|
"dt",
|
|
5081
5148
|
{
|
|
@@ -5142,13 +5209,13 @@ const Ui = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5142
5209
|
}, Os = () => !!window?.__VERSINI_DIGGIDY_TAURI__, ks = () => window.innerWidth < 403, Ns = () => window.innerWidth >= 403 && window.innerWidth <= 1220, Bi = () => {
|
|
5143
5210
|
const e = ["iPhone Simulator", "iPhone"].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document || window.indexedDB !== null, t = /iPhone/.test(navigator.userAgent), r = ks(), s = navigator.maxTouchPoints > 1;
|
|
5144
5211
|
return e && t && r && s;
|
|
5145
|
-
},
|
|
5212
|
+
}, qi = () => {
|
|
5146
5213
|
const e = ["iPad Simulator", "iPad"].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document || window.indexedDB !== null, t = Ns(), r = navigator.maxTouchPoints > 1;
|
|
5147
5214
|
return e && t && r;
|
|
5148
|
-
},
|
|
5215
|
+
}, Wi = () => window.matchMedia("(display-mode: standalone)").matches || window.navigator.standalone === !0, Vi = (e) => {
|
|
5149
5216
|
const t = e.replace(/([A-Z])/g, " $1");
|
|
5150
5217
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
5151
|
-
},
|
|
5218
|
+
}, ji = ({
|
|
5152
5219
|
autoClose: e = 3e3,
|
|
5153
5220
|
containerId: t,
|
|
5154
5221
|
position: r = "top-center",
|
|
@@ -5172,7 +5239,7 @@ const Ui = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5172
5239
|
theme: c,
|
|
5173
5240
|
transition: f,
|
|
5174
5241
|
icon: d
|
|
5175
|
-
}), Qi = (e, t) => t === "ready" && !!e && e.length > 0,
|
|
5242
|
+
}), Qi = (e, t) => t === "ready" && !!e && e.length > 0, ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DOMAIN: _s, canEvaluateModels: Qi, convertCamelCaseToReadable: Vi, convertDDToDMS: Qt, convertLatitudeToDMS: Ni, convertLongitudeToDMS: Pi, debounce: Gi, durationFormatter: Hi, extractAverage: Li, getCurrentGeoLocation: $i, getLayoutPaddingClass: Cs, getMessageContaintWrapperClass: Rs, isDev: jt, isLastMessageFromRole: Ui, isPWAMode: Wi, isProbablyMobile: ks, isProbablyTablet: Ns, isProbablyiPad: qi, isProbablyiPhone: Bi, isProd: Is, isTauri: Os, numberFormatter: Fi, obfuscate: xi, pluralize: Ki, renderDataAsList: Di, toastOptions: ji, unObfuscate: Mi }, Symbol.toStringTag, { value: "Module" })), Ar = "av-button", ft = "icon", Jt = "button", Lt = "link", Ji = ({
|
|
5176
5243
|
type: e,
|
|
5177
5244
|
size: t,
|
|
5178
5245
|
labelRight: r,
|
|
@@ -5182,14 +5249,14 @@ const Ui = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5182
5249
|
}) => {
|
|
5183
5250
|
const i = "max-h-8 py-0 px-2", o = "max-h-9 h-8 px-3", c = "max-h-12 py-2 px-4";
|
|
5184
5251
|
switch (e) {
|
|
5185
|
-
case
|
|
5186
|
-
case
|
|
5252
|
+
case Jt:
|
|
5253
|
+
case Lt:
|
|
5187
5254
|
return y({
|
|
5188
5255
|
[i]: t === "small",
|
|
5189
5256
|
[o]: t === "medium",
|
|
5190
5257
|
[c]: t === "large"
|
|
5191
5258
|
});
|
|
5192
|
-
case
|
|
5259
|
+
case ft:
|
|
5193
5260
|
return y("flex items-center", {
|
|
5194
5261
|
"justify-center": a === "center",
|
|
5195
5262
|
"justify-start": a === "left",
|
|
@@ -5216,15 +5283,15 @@ const Ui = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5216
5283
|
}) => {
|
|
5217
5284
|
const a = "text-sm font-medium", n = "text-base font-medium", i = "text-lg font-medium";
|
|
5218
5285
|
switch (e) {
|
|
5219
|
-
case
|
|
5220
|
-
case
|
|
5286
|
+
case Jt:
|
|
5287
|
+
case Lt:
|
|
5221
5288
|
return y({
|
|
5222
|
-
"text-center": e ===
|
|
5289
|
+
"text-center": e === Lt,
|
|
5223
5290
|
[a]: t === "small",
|
|
5224
5291
|
[n]: t === "medium",
|
|
5225
5292
|
[i]: t === "large"
|
|
5226
5293
|
});
|
|
5227
|
-
case
|
|
5294
|
+
case ft:
|
|
5228
5295
|
return y({
|
|
5229
5296
|
[a]: t === "small" && (r || s),
|
|
5230
5297
|
[n]: t === "medium" && (r || s),
|
|
@@ -5465,8 +5532,8 @@ const Ui = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5465
5532
|
align: p,
|
|
5466
5533
|
radius: g,
|
|
5467
5534
|
animated: b
|
|
5468
|
-
}) => (l || (l = "primary"), r ? y(
|
|
5469
|
-
|
|
5535
|
+
}) => (l || (l = "primary"), r ? y(Ar, t) : y(
|
|
5536
|
+
Ar,
|
|
5470
5537
|
zi({
|
|
5471
5538
|
mode: s,
|
|
5472
5539
|
variant: l,
|
|
@@ -5493,12 +5560,12 @@ const Ui = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5493
5560
|
"disabled:cursor-not-allowed disabled:opacity-50": n
|
|
5494
5561
|
},
|
|
5495
5562
|
y({
|
|
5496
|
-
"transition-[width] duration-300 ease-in": e ===
|
|
5563
|
+
"transition-[width] duration-300 ease-in": e === ft && b
|
|
5497
5564
|
}),
|
|
5498
5565
|
t
|
|
5499
5566
|
)), io = (e, t, r) => {
|
|
5500
5567
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof e?.currentTarget?.focus == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
|
|
5501
|
-
},
|
|
5568
|
+
}, Yt = oe.forwardRef((e, t) => {
|
|
5502
5569
|
const { onClick: r, noInternalClick: s = !1, ...a } = e;
|
|
5503
5570
|
return /* @__PURE__ */ h(
|
|
5504
5571
|
"button",
|
|
@@ -5511,7 +5578,7 @@ const Ui = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5511
5578
|
}
|
|
5512
5579
|
);
|
|
5513
5580
|
});
|
|
5514
|
-
|
|
5581
|
+
Yt.displayName = "BaseButton";
|
|
5515
5582
|
const $s = oe.forwardRef(
|
|
5516
5583
|
({
|
|
5517
5584
|
children: e,
|
|
@@ -5529,7 +5596,7 @@ const $s = oe.forwardRef(
|
|
|
5529
5596
|
...l
|
|
5530
5597
|
}, m) => {
|
|
5531
5598
|
const p = Ps({
|
|
5532
|
-
type:
|
|
5599
|
+
type: Jt,
|
|
5533
5600
|
mode: r,
|
|
5534
5601
|
focusMode: s,
|
|
5535
5602
|
fullWidth: a,
|
|
@@ -5543,7 +5610,7 @@ const $s = oe.forwardRef(
|
|
|
5543
5610
|
radius: u
|
|
5544
5611
|
});
|
|
5545
5612
|
return /* @__PURE__ */ h(
|
|
5546
|
-
|
|
5613
|
+
Yt,
|
|
5547
5614
|
{
|
|
5548
5615
|
ref: m,
|
|
5549
5616
|
className: p,
|
|
@@ -5559,10 +5626,10 @@ function oo() {
|
|
|
5559
5626
|
const e = j(!1);
|
|
5560
5627
|
return W(() => (e.current = !0, () => {
|
|
5561
5628
|
e.current = !1;
|
|
5562
|
-
}), []),
|
|
5629
|
+
}), []), X(() => e.current, []);
|
|
5563
5630
|
}
|
|
5564
5631
|
function xs(e) {
|
|
5565
|
-
return
|
|
5632
|
+
return ze(() => e.every((t) => t == null) ? () => {
|
|
5566
5633
|
} : (t) => {
|
|
5567
5634
|
e.forEach((r) => {
|
|
5568
5635
|
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
@@ -5579,8 +5646,8 @@ const co = {
|
|
|
5579
5646
|
bottom: 0,
|
|
5580
5647
|
right: 0
|
|
5581
5648
|
};
|
|
5582
|
-
function
|
|
5583
|
-
const t = oo(), r = j(0), s = j(null), [a, n] = ie(co), i =
|
|
5649
|
+
function Je(e) {
|
|
5650
|
+
const t = oo(), r = j(0), s = j(null), [a, n] = ie(co), i = ze(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((o) => {
|
|
5584
5651
|
const c = o[0];
|
|
5585
5652
|
c && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
5586
5653
|
s.current && t() && n(c.contentRect);
|
|
@@ -5601,7 +5668,7 @@ function Ms(e) {
|
|
|
5601
5668
|
return typeof r == "number" || typeof r == "string" ? `${s}${r}` : `${s}${t}`;
|
|
5602
5669
|
}
|
|
5603
5670
|
}
|
|
5604
|
-
const
|
|
5671
|
+
const Ve = {
|
|
5605
5672
|
small: 24,
|
|
5606
5673
|
// w-6
|
|
5607
5674
|
medium: 32,
|
|
@@ -5615,7 +5682,7 @@ const qe = {
|
|
|
5615
5682
|
// px-3 x 2
|
|
5616
5683
|
large: 32
|
|
5617
5684
|
// px-4 x 2
|
|
5618
|
-
}, uo = 2, ho = 300,
|
|
5685
|
+
}, uo = 2, ho = 300, it = oe.forwardRef(
|
|
5619
5686
|
({
|
|
5620
5687
|
children: e,
|
|
5621
5688
|
disabled: t = !1,
|
|
@@ -5639,8 +5706,8 @@ const qe = {
|
|
|
5639
5706
|
animated: A = !1,
|
|
5640
5707
|
...K
|
|
5641
5708
|
}, R) => {
|
|
5642
|
-
const
|
|
5643
|
-
type:
|
|
5709
|
+
const z = Ps({
|
|
5710
|
+
type: ft,
|
|
5644
5711
|
mode: r,
|
|
5645
5712
|
focusMode: s,
|
|
5646
5713
|
fullWidth: a,
|
|
@@ -5656,21 +5723,21 @@ const qe = {
|
|
|
5656
5723
|
radius: b,
|
|
5657
5724
|
variant: E,
|
|
5658
5725
|
animated: A
|
|
5659
|
-
}), C = ao({ mode: r, raw: o, iconClassName: O, variant: E }), v = no({ animated: A }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [_, I] =
|
|
5660
|
-
return
|
|
5661
|
-
ce && ce.current && A && (w.current =
|
|
5662
|
-
}, [
|
|
5726
|
+
}), C = ao({ mode: r, raw: o, iconClassName: O, variant: E }), v = no({ animated: A }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [_, I] = Je(), [N, J] = Je(), [ce, Se] = Je(), w = j(0), T = j(null), S = j(null), le = xs([R, T]);
|
|
5727
|
+
return Xe(() => {
|
|
5728
|
+
ce && ce.current && A && (w.current = Se.width + lo[u] + (c ? 0 : uo), T.current && !T.current.style.width && (T.current.style.width = `${Ve[u]}px`));
|
|
5729
|
+
}, [Se, ce, u, c, A]), Xe(() => {
|
|
5663
5730
|
if (T && T.current && A) {
|
|
5664
|
-
let ue =
|
|
5665
|
-
l && _ && I.width > 0 ? ue = I.width + w.current : m && N &&
|
|
5731
|
+
let ue = Ve[u];
|
|
5732
|
+
l && _ && I.width > 0 ? ue = I.width + w.current : m && N && J.width > 0 && (ue = J.width + w.current), S.current && clearTimeout(S.current), ue !== parseInt(T.current.style.width || "0", 10) && (_.current && (_.current.style.opacity = "0"), N.current && (N.current.style.opacity = "0"), T.current.style.width = `${ue}px`, ue > Ve[u] && (S.current = setTimeout(() => {
|
|
5666
5733
|
_.current && l && (_.current.style.opacity = "1"), N.current && m && (N.current.style.opacity = "1"), S.current = null;
|
|
5667
|
-
}, ho * 0.8))), ue ===
|
|
5734
|
+
}, ho * 0.8))), ue === Ve[u] && (_.current && (_.current.style.opacity = "0"), N.current && (N.current.style.opacity = "0"));
|
|
5668
5735
|
}
|
|
5669
5736
|
}, [
|
|
5670
5737
|
I,
|
|
5671
5738
|
l,
|
|
5672
5739
|
_,
|
|
5673
|
-
|
|
5740
|
+
J,
|
|
5674
5741
|
m,
|
|
5675
5742
|
N,
|
|
5676
5743
|
u,
|
|
@@ -5678,17 +5745,17 @@ const qe = {
|
|
|
5678
5745
|
]), W(() => () => {
|
|
5679
5746
|
S.current && clearTimeout(S.current);
|
|
5680
5747
|
}, []), /* @__PURE__ */ h(
|
|
5681
|
-
|
|
5748
|
+
Yt,
|
|
5682
5749
|
{
|
|
5683
5750
|
ref: le,
|
|
5684
|
-
className:
|
|
5751
|
+
className: z,
|
|
5685
5752
|
disabled: t,
|
|
5686
5753
|
type: i,
|
|
5687
5754
|
"aria-label": f || d,
|
|
5688
5755
|
...K,
|
|
5689
|
-
children: /* @__PURE__ */
|
|
5756
|
+
children: /* @__PURE__ */ V("div", { className: x, children: [
|
|
5690
5757
|
/* @__PURE__ */ h(
|
|
5691
|
-
|
|
5758
|
+
Ir,
|
|
5692
5759
|
{
|
|
5693
5760
|
label: m,
|
|
5694
5761
|
labelRef: N,
|
|
@@ -5699,7 +5766,7 @@ const qe = {
|
|
|
5699
5766
|
),
|
|
5700
5767
|
/* @__PURE__ */ h("span", { ref: ce, className: C, children: e }),
|
|
5701
5768
|
/* @__PURE__ */ h(
|
|
5702
|
-
|
|
5769
|
+
Ir,
|
|
5703
5770
|
{
|
|
5704
5771
|
label: l,
|
|
5705
5772
|
labelRef: _,
|
|
@@ -5712,7 +5779,7 @@ const qe = {
|
|
|
5712
5779
|
}
|
|
5713
5780
|
);
|
|
5714
5781
|
}
|
|
5715
|
-
),
|
|
5782
|
+
), Ir = ({
|
|
5716
5783
|
labelRef: e,
|
|
5717
5784
|
labelClass: t,
|
|
5718
5785
|
label: r,
|
|
@@ -5727,7 +5794,7 @@ const qe = {
|
|
|
5727
5794
|
children: r && /* @__PURE__ */ h("span", { className: s, children: r })
|
|
5728
5795
|
}
|
|
5729
5796
|
);
|
|
5730
|
-
|
|
5797
|
+
it.displayName = "ButtonIcon";
|
|
5731
5798
|
/*!
|
|
5732
5799
|
@versini/ui-button v8.1.3
|
|
5733
5800
|
© 2025 gizmette.com
|
|
@@ -5767,7 +5834,7 @@ const fo = oe.forwardRef(
|
|
|
5767
5834
|
}
|
|
5768
5835
|
) : "";
|
|
5769
5836
|
return /* @__PURE__ */ h("div", { className: i, children: /* @__PURE__ */ h(
|
|
5770
|
-
|
|
5837
|
+
it,
|
|
5771
5838
|
{
|
|
5772
5839
|
className: r,
|
|
5773
5840
|
ref: n,
|
|
@@ -5782,7 +5849,7 @@ const fo = oe.forwardRef(
|
|
|
5782
5849
|
}
|
|
5783
5850
|
);
|
|
5784
5851
|
fo.displayName = "ButtonSort";
|
|
5785
|
-
const
|
|
5852
|
+
const Ye = "av-card", mo = ({
|
|
5786
5853
|
className: e,
|
|
5787
5854
|
headerClassName: t,
|
|
5788
5855
|
bodyClassName: r,
|
|
@@ -5792,7 +5859,7 @@ const Je = "av-card", mo = ({
|
|
|
5792
5859
|
noBorder: i
|
|
5793
5860
|
}) => {
|
|
5794
5861
|
const o = y(
|
|
5795
|
-
|
|
5862
|
+
Ye,
|
|
5796
5863
|
"rounded-md",
|
|
5797
5864
|
{
|
|
5798
5865
|
"border-none": i,
|
|
@@ -5806,7 +5873,7 @@ const Je = "av-card", mo = ({
|
|
|
5806
5873
|
"border-border-accent bg-surface-dark text-copy-light dark:border-border-dark dark:bg-surface-lighter dark:text-copy-dark": a === "alt-system"
|
|
5807
5874
|
},
|
|
5808
5875
|
e
|
|
5809
|
-
), c = t || y(`${
|
|
5876
|
+
), c = t || y(`${Ye}__header mt-0 border-b-2`, {
|
|
5810
5877
|
"text-copy-light border-border-accent": a === "darker",
|
|
5811
5878
|
"border-border-accent": a === "dark",
|
|
5812
5879
|
"border-border-medium": a === "light",
|
|
@@ -5814,7 +5881,7 @@ const Je = "av-card", mo = ({
|
|
|
5814
5881
|
"border-border-accent dark:border-border-medium": a === "alt-system",
|
|
5815
5882
|
"mb-4": !n,
|
|
5816
5883
|
"mb-2": n
|
|
5817
|
-
}), f = y(r), d = s || y(`${
|
|
5884
|
+
}), f = y(r), d = s || y(`${Ye}__footer pt-2`);
|
|
5818
5885
|
return {
|
|
5819
5886
|
wrapper: o,
|
|
5820
5887
|
header: c,
|
|
@@ -5845,7 +5912,7 @@ const yo = ({
|
|
|
5845
5912
|
...u
|
|
5846
5913
|
}) => {
|
|
5847
5914
|
let l = null, m = null;
|
|
5848
|
-
const p = typeof e == "string", g = Ms(
|
|
5915
|
+
const p = typeof e == "string", g = Ms(Ye), b = mo({
|
|
5849
5916
|
className: n,
|
|
5850
5917
|
headerClassName: t,
|
|
5851
5918
|
bodyClassName: i,
|
|
@@ -5854,7 +5921,7 @@ const yo = ({
|
|
|
5854
5921
|
compact: f,
|
|
5855
5922
|
noBorder: d
|
|
5856
5923
|
});
|
|
5857
|
-
return p ? (l = g, m = l) : !p && e && o ? (l = null, m = o) : !p && e && !o ? (l = g, m = l) : (l = null, m = o || null), /* @__PURE__ */ h("div", { className: b.wrapper, children: /* @__PURE__ */
|
|
5924
|
+
return p ? (l = g, m = l) : !p && e && o ? (l = null, m = o) : !p && e && !o ? (l = g, m = l) : (l = null, m = o || null), /* @__PURE__ */ h("div", { className: b.wrapper, children: /* @__PURE__ */ V(
|
|
5858
5925
|
"section",
|
|
5859
5926
|
{
|
|
5860
5927
|
...m && {
|
|
@@ -5891,7 +5958,7 @@ try {
|
|
|
5891
5958
|
});
|
|
5892
5959
|
} catch {
|
|
5893
5960
|
}
|
|
5894
|
-
const
|
|
5961
|
+
const mt = ({
|
|
5895
5962
|
children: e,
|
|
5896
5963
|
fill: t,
|
|
5897
5964
|
viewBox: r,
|
|
@@ -5903,7 +5970,7 @@ const ht = ({
|
|
|
5903
5970
|
...c
|
|
5904
5971
|
}) => {
|
|
5905
5972
|
const f = y(n, s);
|
|
5906
|
-
return /* @__PURE__ */
|
|
5973
|
+
return /* @__PURE__ */ V(
|
|
5907
5974
|
"svg",
|
|
5908
5975
|
{
|
|
5909
5976
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5941,7 +6008,7 @@ const go = ({
|
|
|
5941
6008
|
monotone: s,
|
|
5942
6009
|
...a
|
|
5943
6010
|
}) => /* @__PURE__ */ h(
|
|
5944
|
-
|
|
6011
|
+
mt,
|
|
5945
6012
|
{
|
|
5946
6013
|
defaultViewBox: "0 0 1200 500",
|
|
5947
6014
|
size: "w-full",
|
|
@@ -5957,8 +6024,8 @@ const go = ({
|
|
|
5957
6024
|
title: r,
|
|
5958
6025
|
monotone: s,
|
|
5959
6026
|
...a
|
|
5960
|
-
}) => /* @__PURE__ */
|
|
5961
|
-
|
|
6027
|
+
}) => /* @__PURE__ */ V(
|
|
6028
|
+
mt,
|
|
5962
6029
|
{
|
|
5963
6030
|
defaultViewBox: "0 0 640 512",
|
|
5964
6031
|
size: "size-5",
|
|
@@ -5985,8 +6052,8 @@ const go = ({
|
|
|
5985
6052
|
...a
|
|
5986
6053
|
}) => {
|
|
5987
6054
|
const n = s ? "1" : "0.4";
|
|
5988
|
-
return /* @__PURE__ */
|
|
5989
|
-
|
|
6055
|
+
return /* @__PURE__ */ V(
|
|
6056
|
+
mt,
|
|
5990
6057
|
{
|
|
5991
6058
|
defaultViewBox: "0 0 190 190",
|
|
5992
6059
|
size: "size-5",
|
|
@@ -6019,8 +6086,8 @@ const go = ({
|
|
|
6019
6086
|
title: r,
|
|
6020
6087
|
monotone: s,
|
|
6021
6088
|
...a
|
|
6022
|
-
}) => /* @__PURE__ */
|
|
6023
|
-
|
|
6089
|
+
}) => /* @__PURE__ */ V(
|
|
6090
|
+
mt,
|
|
6024
6091
|
{
|
|
6025
6092
|
defaultViewBox: "0 0 576 512",
|
|
6026
6093
|
size: "size-5",
|
|
@@ -6053,7 +6120,7 @@ try {
|
|
|
6053
6120
|
});
|
|
6054
6121
|
} catch {
|
|
6055
6122
|
}
|
|
6056
|
-
const So = "av-flexgrid", je = "av-flexgrid-item",
|
|
6123
|
+
const So = "av-flexgrid", je = "av-flexgrid-item", ot = 0.25, Ut = oe.createContext({
|
|
6057
6124
|
columnGap: 0,
|
|
6058
6125
|
rowGap: 0
|
|
6059
6126
|
}), vo = ({
|
|
@@ -6079,14 +6146,14 @@ const So = "av-flexgrid", je = "av-flexgrid-item", nt = 0.25, Dt = oe.createCont
|
|
|
6079
6146
|
* by the columnGap and rowGap that will be applied
|
|
6080
6147
|
* to all FlexgridItems (see context and paddings).
|
|
6081
6148
|
*/
|
|
6082
|
-
marginLeft: r * -1 *
|
|
6083
|
-
marginTop: s * -1 *
|
|
6149
|
+
marginLeft: r * -1 * ot + "rem",
|
|
6150
|
+
marginTop: s * -1 * ot + "rem"
|
|
6084
6151
|
}, u = y(
|
|
6085
6152
|
So,
|
|
6086
6153
|
"box-border flex flex-wrap"
|
|
6087
6154
|
), l = { columnGap: r, rowGap: s };
|
|
6088
|
-
return t ? /* @__PURE__ */ h("div", { className: t, children: /* @__PURE__ */ h("div", { className: u, style: d, ...f, children: /* @__PURE__ */ h(
|
|
6089
|
-
},
|
|
6155
|
+
return t ? /* @__PURE__ */ h("div", { className: t, children: /* @__PURE__ */ h("div", { className: u, style: d, ...f, children: /* @__PURE__ */ h(Ut.Provider, { value: l, children: e }) }) }) : /* @__PURE__ */ h("div", { className: u, style: d, ...f, children: /* @__PURE__ */ h(Ut.Provider, { value: l, children: e }) });
|
|
6156
|
+
}, _t = (e, t) => y({
|
|
6090
6157
|
"basis-1/12": e === 1 && !t,
|
|
6091
6158
|
"sm:basis-1/12": e === 1 && t === "sm",
|
|
6092
6159
|
"md:basis-1/12": e === 1 && t === "md",
|
|
@@ -6167,14 +6234,14 @@ const So = "av-flexgrid", je = "av-flexgrid-item", nt = 0.25, Dt = oe.createCont
|
|
|
6167
6234
|
return y(e, je, "box-border basis-auto");
|
|
6168
6235
|
if (typeof t == "number")
|
|
6169
6236
|
return y(e, je, "box-border max-w-full", {
|
|
6170
|
-
[`${
|
|
6237
|
+
[`${_t(t)}`]: !0
|
|
6171
6238
|
});
|
|
6172
6239
|
if (typeof t == "string")
|
|
6173
6240
|
return y(e, je, "box-border basis-auto", {
|
|
6174
6241
|
"max-w-full grow": t === "auto"
|
|
6175
6242
|
});
|
|
6176
6243
|
if (typeof t == "object") {
|
|
6177
|
-
const r = Object.entries(t).map(([s, a]) => s === "fallback" ?
|
|
6244
|
+
const r = Object.entries(t).map(([s, a]) => s === "fallback" ? _t(a) : _t(a, s));
|
|
6178
6245
|
return y(
|
|
6179
6246
|
e,
|
|
6180
6247
|
je,
|
|
@@ -6182,15 +6249,15 @@ const So = "av-flexgrid", je = "av-flexgrid-item", nt = 0.25, Dt = oe.createCont
|
|
|
6182
6249
|
r
|
|
6183
6250
|
);
|
|
6184
6251
|
}
|
|
6185
|
-
},
|
|
6252
|
+
}, ye = ({
|
|
6186
6253
|
children: e,
|
|
6187
6254
|
className: t,
|
|
6188
6255
|
span: r,
|
|
6189
6256
|
...s
|
|
6190
6257
|
}) => {
|
|
6191
|
-
const { columnGap: a, rowGap: n } =
|
|
6192
|
-
paddingLeft: a *
|
|
6193
|
-
paddingTop: n *
|
|
6258
|
+
const { columnGap: a, rowGap: n } = ct(Ut), i = {
|
|
6259
|
+
paddingLeft: a * ot + "rem",
|
|
6260
|
+
paddingTop: n * ot + "rem"
|
|
6194
6261
|
}, o = To({
|
|
6195
6262
|
className: t,
|
|
6196
6263
|
span: r
|
|
@@ -6240,7 +6307,7 @@ const Ds = "SET_ANNOUNCEMENT", Ls = "CLEAR_ANNOUNCEMENT", Ao = {
|
|
|
6240
6307
|
t({
|
|
6241
6308
|
type: Ls
|
|
6242
6309
|
}), typeof e == "function" && e();
|
|
6243
|
-
},
|
|
6310
|
+
}, _r = ({
|
|
6244
6311
|
children: e,
|
|
6245
6312
|
clearAnnouncementDelay: t,
|
|
6246
6313
|
clearAnnouncementTimeoutRef: r,
|
|
@@ -6266,13 +6333,13 @@ const Ds = "SET_ANNOUNCEMENT", Ls = "CLEAR_ANNOUNCEMENT", Ao = {
|
|
|
6266
6333
|
onAnnouncementClear: n,
|
|
6267
6334
|
dispatch: i
|
|
6268
6335
|
}) => {
|
|
6269
|
-
clearTimeout(t.current), r ? t.current = setTimeout(
|
|
6336
|
+
clearTimeout(t.current), r ? t.current = setTimeout(_r, r, {
|
|
6270
6337
|
children: e,
|
|
6271
6338
|
clearAnnouncementDelay: s,
|
|
6272
6339
|
clearAnnouncementTimeoutRef: a,
|
|
6273
6340
|
onAnnouncementClear: n,
|
|
6274
6341
|
dispatch: i
|
|
6275
|
-
}) :
|
|
6342
|
+
}) : _r({
|
|
6276
6343
|
children: e,
|
|
6277
6344
|
clearAnnouncementDelay: s,
|
|
6278
6345
|
clearAnnouncementTimeoutRef: a,
|
|
@@ -6291,7 +6358,7 @@ function Us({
|
|
|
6291
6358
|
visible: o,
|
|
6292
6359
|
...c
|
|
6293
6360
|
}) {
|
|
6294
|
-
const f = j(null), d = j(null), [u, l] =
|
|
6361
|
+
const f = j(null), d = j(null), [u, l] = kr(Io, {
|
|
6295
6362
|
announcement: null
|
|
6296
6363
|
});
|
|
6297
6364
|
let m = r;
|
|
@@ -6338,7 +6405,7 @@ try {
|
|
|
6338
6405
|
});
|
|
6339
6406
|
} catch {
|
|
6340
6407
|
}
|
|
6341
|
-
const Fs = "av-text-input", Co = "av-text-input-wrapper",
|
|
6408
|
+
const Fs = "av-text-input", Co = "av-text-input-wrapper", Rt = "av-text-input-helper-text", Oo = ({
|
|
6342
6409
|
mode: e
|
|
6343
6410
|
}) => y({
|
|
6344
6411
|
"bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
|
|
@@ -6394,18 +6461,18 @@ const Fs = "av-text-input", Co = "av-text-input-wrapper", It = "av-text-input-he
|
|
|
6394
6461
|
return "";
|
|
6395
6462
|
if (s)
|
|
6396
6463
|
return y(
|
|
6397
|
-
|
|
6464
|
+
Rt,
|
|
6398
6465
|
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
6399
6466
|
);
|
|
6400
6467
|
if (!e)
|
|
6401
|
-
return y(
|
|
6468
|
+
return y(Rt, "absolute px-2 font-medium", {
|
|
6402
6469
|
"text-copy-lighter": r === "dark",
|
|
6403
6470
|
"text-copy-dark": r === "light",
|
|
6404
6471
|
"text-copy-dark dark:text-copy-lighter": r === "system",
|
|
6405
6472
|
"text-copy-lighter dark:text-copy-dark": r === "alt-system"
|
|
6406
6473
|
});
|
|
6407
6474
|
if (e)
|
|
6408
|
-
return y(
|
|
6475
|
+
return y(Rt, "absolute px-2 font-medium", {
|
|
6409
6476
|
"text-copy-error-light bg-surface-darker": r === "dark",
|
|
6410
6477
|
"text-copy-error-dark": r === "light",
|
|
6411
6478
|
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
|
|
@@ -6476,7 +6543,7 @@ const Fs = "av-text-input", Co = "av-text-input-wrapper", It = "av-text-input-he
|
|
|
6476
6543
|
helperText: g,
|
|
6477
6544
|
rightElement: b
|
|
6478
6545
|
};
|
|
6479
|
-
},
|
|
6546
|
+
}, zt = oe.forwardRef(
|
|
6480
6547
|
({
|
|
6481
6548
|
id: e,
|
|
6482
6549
|
name: t,
|
|
@@ -6498,13 +6565,13 @@ const Fs = "av-text-input", Co = "av-text-input-wrapper", It = "av-text-input-he
|
|
|
6498
6565
|
size: E = "md",
|
|
6499
6566
|
...O
|
|
6500
6567
|
}, A) => {
|
|
6501
|
-
const [K, R] =
|
|
6568
|
+
const [K, R] = Je(), [z, C] = ie(0), v = Ms({ id: e, prefix: `${Fs}-` }), x = `${t} error, ${p}`, _ = j(null), I = j(null), N = {
|
|
6502
6569
|
xs: { label: "-25px", helperText: "30px" },
|
|
6503
6570
|
sm: { label: "-29px", helperText: "34px" },
|
|
6504
6571
|
md: { label: "-33px", helperText: "38px" },
|
|
6505
6572
|
lg: { label: "-15px", helperText: "22px" },
|
|
6506
6573
|
xl: { label: "-19px", helperText: "25px" }
|
|
6507
|
-
},
|
|
6574
|
+
}, J = xo({
|
|
6508
6575
|
className: n,
|
|
6509
6576
|
inputClassName: i,
|
|
6510
6577
|
error: s,
|
|
@@ -6516,21 +6583,21 @@ const Fs = "av-text-input", Co = "av-text-input-wrapper", It = "av-text-input-he
|
|
|
6516
6583
|
size: E,
|
|
6517
6584
|
rightElementClassName: b
|
|
6518
6585
|
});
|
|
6519
|
-
return
|
|
6586
|
+
return Xe(() => {
|
|
6520
6587
|
R && R.width && C(R.width + 18 + 10);
|
|
6521
|
-
}, [R]),
|
|
6522
|
-
const { label: ce, helperText:
|
|
6588
|
+
}, [R]), Xe(() => {
|
|
6589
|
+
const { label: ce, helperText: Se } = N[E];
|
|
6523
6590
|
_?.current?.style.setProperty("--av-text-input-label", ce), I?.current?.style.setProperty(
|
|
6524
6591
|
"--av-text-input-helper-text",
|
|
6525
|
-
|
|
6592
|
+
Se
|
|
6526
6593
|
);
|
|
6527
|
-
}, [E]), /* @__PURE__ */
|
|
6594
|
+
}, [E]), /* @__PURE__ */ V("div", { className: J.wrapper, children: [
|
|
6528
6595
|
/* @__PURE__ */ h(
|
|
6529
6596
|
"label",
|
|
6530
6597
|
{
|
|
6531
6598
|
htmlFor: v,
|
|
6532
6599
|
id: u,
|
|
6533
|
-
className:
|
|
6600
|
+
className: J.accessibleLabel,
|
|
6534
6601
|
children: r
|
|
6535
6602
|
}
|
|
6536
6603
|
),
|
|
@@ -6543,10 +6610,10 @@ const Fs = "av-text-input", Co = "av-text-input-wrapper", It = "av-text-input-he
|
|
|
6543
6610
|
type: m,
|
|
6544
6611
|
disabled: f,
|
|
6545
6612
|
placeholder: a ? void 0 : " ",
|
|
6546
|
-
className:
|
|
6613
|
+
className: J.input,
|
|
6547
6614
|
...p && { "aria-describedby": `${v}-helper` },
|
|
6548
6615
|
...s && { "aria-invalid": "true" },
|
|
6549
|
-
...g && !a && { style: { paddingRight:
|
|
6616
|
+
...g && !a && { style: { paddingRight: z } },
|
|
6550
6617
|
...O
|
|
6551
6618
|
}
|
|
6552
6619
|
),
|
|
@@ -6556,7 +6623,7 @@ const Fs = "av-text-input", Co = "av-text-input-wrapper", It = "av-text-input-he
|
|
|
6556
6623
|
ref: _,
|
|
6557
6624
|
"aria-hidden": !0,
|
|
6558
6625
|
htmlFor: v,
|
|
6559
|
-
className:
|
|
6626
|
+
className: J.visibleLabel,
|
|
6560
6627
|
children: r
|
|
6561
6628
|
}
|
|
6562
6629
|
),
|
|
@@ -6565,7 +6632,7 @@ const Fs = "av-text-input", Co = "av-text-input-wrapper", It = "av-text-input-he
|
|
|
6565
6632
|
{
|
|
6566
6633
|
ref: I,
|
|
6567
6634
|
id: `${v}-helper`,
|
|
6568
|
-
className:
|
|
6635
|
+
className: J.helperText,
|
|
6569
6636
|
children: p
|
|
6570
6637
|
}
|
|
6571
6638
|
),
|
|
@@ -6573,7 +6640,7 @@ const Fs = "av-text-input", Co = "av-text-input-wrapper", It = "av-text-input-he
|
|
|
6573
6640
|
"div",
|
|
6574
6641
|
{
|
|
6575
6642
|
ref: K,
|
|
6576
|
-
className:
|
|
6643
|
+
className: J.rightElement,
|
|
6577
6644
|
children: g
|
|
6578
6645
|
}
|
|
6579
6646
|
),
|
|
@@ -6581,7 +6648,7 @@ const Fs = "av-text-input", Co = "av-text-input-wrapper", It = "av-text-input-he
|
|
|
6581
6648
|
] });
|
|
6582
6649
|
}
|
|
6583
6650
|
);
|
|
6584
|
-
|
|
6651
|
+
zt.displayName = "TextInput";
|
|
6585
6652
|
const Mo = 500, Do = 5e3, Lo = 2e4, Hs = oe.forwardRef(
|
|
6586
6653
|
({
|
|
6587
6654
|
name: e,
|
|
@@ -6607,7 +6674,7 @@ const Mo = 500, Do = 5e3, Lo = 2e4, Hs = oe.forwardRef(
|
|
|
6607
6674
|
message: `${r} hiding characters`
|
|
6608
6675
|
}), a && a(!0);
|
|
6609
6676
|
}, Lo));
|
|
6610
|
-
},
|
|
6677
|
+
}, z = (I) => {
|
|
6611
6678
|
I.preventDefault();
|
|
6612
6679
|
const N = !b.current;
|
|
6613
6680
|
b.current = N, R(), m(N), g({
|
|
@@ -6627,9 +6694,9 @@ const Mo = 500, Do = 5e3, Lo = 2e4, Hs = oe.forwardRef(
|
|
|
6627
6694
|
};
|
|
6628
6695
|
return W(() => () => {
|
|
6629
6696
|
E.current && clearTimeout(E.current);
|
|
6630
|
-
}, []), /* @__PURE__ */
|
|
6697
|
+
}, []), /* @__PURE__ */ V(Or, { children: [
|
|
6631
6698
|
/* @__PURE__ */ h(
|
|
6632
|
-
|
|
6699
|
+
zt,
|
|
6633
6700
|
{
|
|
6634
6701
|
ref: A,
|
|
6635
6702
|
name: e,
|
|
@@ -6643,7 +6710,7 @@ const Mo = 500, Do = 5e3, Lo = 2e4, Hs = oe.forwardRef(
|
|
|
6643
6710
|
rightElement: oe.cloneElement(f, {
|
|
6644
6711
|
ref: u,
|
|
6645
6712
|
label: K,
|
|
6646
|
-
onClick:
|
|
6713
|
+
onClick: z,
|
|
6647
6714
|
onBlur: C,
|
|
6648
6715
|
disabled: t
|
|
6649
6716
|
}),
|
|
@@ -6676,9 +6743,9 @@ try {
|
|
|
6676
6743
|
});
|
|
6677
6744
|
} catch {
|
|
6678
6745
|
}
|
|
6679
|
-
const Uo = "ASK! ME! ANYTHING!", Fo = "Log in with a password", Ho = "Log in with a Passkey",
|
|
6680
|
-
Press Enter to send it or Shift+Enter for new line.`,
|
|
6681
|
-
Press Ctrl+Enter to send it or Enter for new line.`,
|
|
6746
|
+
const Uo = "ASK! ME! ANYTHING!", Fo = "Log in with a password", Ho = "Log in with a Passkey", dl = "Log out", Ko = "Password", hl = "Usage", fl = "Profile", ml = "Settings", pl = "Chat history", yl = "About", Xt = "Type your message here.", gl = Xt, bl = `${Xt}
|
|
6747
|
+
Press Enter to send it or Shift+Enter for new line.`, El = `${Xt}
|
|
6748
|
+
Press Ctrl+Enter to send it or Enter for new line.`, wl = "{{clipboard}}", P = "Review important details.", Sl = [
|
|
6682
6749
|
`Sometimes, ${k} just makes stuff up. ${P}`,
|
|
6683
6750
|
`${k} may invent facts on the fly. ${P}`,
|
|
6684
6751
|
`${k} may be confidently wrong. ${P}`,
|
|
@@ -6699,17 +6766,17 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6699
6766
|
`Sometimes, ${k} howls at the moon. ${P}`,
|
|
6700
6767
|
`${k} may dig up imaginary bones. ${P}`,
|
|
6701
6768
|
`${k} may sniff out nonsense. ${P}`
|
|
6702
|
-
],
|
|
6769
|
+
], vl = "Prompts are pre-filled menus available on the main screen, to help you quickly start requests. If you select the 'Private Chat' checkbox, the corresponding chat will not be saved. If you select the 'Clipboard Access' checkbox, your clipboard content (if any) will be provided to the request.", Tl = "Default provider set to", Al = "Chat successfully deleted!", Il = "Chat successfully saved!", _l = "Caching enabled. Assets are now stored locally.", Rl = "Caching disabled. Local asset cache cleared.", Cl = "av-sassy", Ol = {
|
|
6703
6770
|
0: ["January", "February", "March"],
|
|
6704
6771
|
3: ["April", "May", "June"],
|
|
6705
6772
|
6: ["July", "August", "September"],
|
|
6706
6773
|
9: ["October", "November", "December"]
|
|
6707
|
-
},
|
|
6774
|
+
}, kl = {
|
|
6708
6775
|
0: ["Jan", "Feb", "Mar"],
|
|
6709
6776
|
3: ["Apr", "May", "Jun"],
|
|
6710
6777
|
6: ["Jul", "Aug", "Sep"],
|
|
6711
6778
|
9: ["Oct", "Nov", "Dec"]
|
|
6712
|
-
},
|
|
6779
|
+
}, Nl = {
|
|
6713
6780
|
PREFERENCES: {
|
|
6714
6781
|
TITLE: "User profile",
|
|
6715
6782
|
USERNAME: "Username",
|
|
@@ -6762,7 +6829,7 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6762
6829
|
className: e,
|
|
6763
6830
|
isCapabilitiesSuccess: t,
|
|
6764
6831
|
capabilities: r
|
|
6765
|
-
}) => /* @__PURE__ */
|
|
6832
|
+
}) => /* @__PURE__ */ V(
|
|
6766
6833
|
"div",
|
|
6767
6834
|
{
|
|
6768
6835
|
className: y(
|
|
@@ -6771,7 +6838,7 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6771
6838
|
),
|
|
6772
6839
|
children: [
|
|
6773
6840
|
/* @__PURE__ */ h("div", { className: "basis-1/4", children: /* @__PURE__ */ h(go, {}) }),
|
|
6774
|
-
/* @__PURE__ */
|
|
6841
|
+
/* @__PURE__ */ V("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
|
|
6775
6842
|
/* @__PURE__ */ h("h1", { children: k }),
|
|
6776
6843
|
/* @__PURE__ */ h(
|
|
6777
6844
|
"h2",
|
|
@@ -6786,7 +6853,7 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6786
6853
|
]
|
|
6787
6854
|
}
|
|
6788
6855
|
), Bo = () => {
|
|
6789
|
-
const { login: e, logoutReason: t, loginWithPasskey: r } =
|
|
6856
|
+
const { login: e, logoutReason: t, loginWithPasskey: r } = cs(), [s, a] = ie(""), [n, i] = ie(""), [o, c] = ie(!0), [f, d] = ie({
|
|
6790
6857
|
username: "",
|
|
6791
6858
|
password: ""
|
|
6792
6859
|
}), u = async (l) => {
|
|
@@ -6798,7 +6865,7 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6798
6865
|
}, 500);
|
|
6799
6866
|
}), W(() => {
|
|
6800
6867
|
t && i(t);
|
|
6801
|
-
}, [t]), /* @__PURE__ */
|
|
6868
|
+
}, [t]), /* @__PURE__ */ V("main", { className: Cs({ extraClass: "mt-5" }), children: [
|
|
6802
6869
|
/* @__PURE__ */ h(
|
|
6803
6870
|
"div",
|
|
6804
6871
|
{
|
|
@@ -6808,10 +6875,10 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6808
6875
|
children: /* @__PURE__ */ h(Go, {})
|
|
6809
6876
|
}
|
|
6810
6877
|
),
|
|
6811
|
-
/* @__PURE__ */ h("form", { className: "mt-5", onSubmit: u, children: /* @__PURE__ */ h(vo, { alignHorizontal: "center", children: /* @__PURE__ */ h(
|
|
6812
|
-
/* @__PURE__ */ h(
|
|
6813
|
-
/* @__PURE__ */ h(
|
|
6814
|
-
|
|
6878
|
+
/* @__PURE__ */ h("form", { className: "mt-5", onSubmit: u, children: /* @__PURE__ */ h(vo, { alignHorizontal: "center", children: /* @__PURE__ */ h(ye, { span: 6, children: /* @__PURE__ */ V(yo, { mode: "dark", children: [
|
|
6879
|
+
/* @__PURE__ */ h(ye, { span: 12, className: "mt-7", children: n && /* @__PURE__ */ h("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: n }) }),
|
|
6880
|
+
/* @__PURE__ */ h(ye, { span: 12, children: /* @__PURE__ */ h(
|
|
6881
|
+
zt,
|
|
6815
6882
|
{
|
|
6816
6883
|
className: "mt-7",
|
|
6817
6884
|
required: !0,
|
|
@@ -6831,7 +6898,7 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6831
6898
|
error: s !== ""
|
|
6832
6899
|
}
|
|
6833
6900
|
) }),
|
|
6834
|
-
/* @__PURE__ */ h(
|
|
6901
|
+
/* @__PURE__ */ h(ye, { span: 12, children: /* @__PURE__ */ h(
|
|
6835
6902
|
Hs,
|
|
6836
6903
|
{
|
|
6837
6904
|
className: "mt-7",
|
|
@@ -6844,7 +6911,7 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6844
6911
|
name: "password",
|
|
6845
6912
|
label: Ko,
|
|
6846
6913
|
rightElement: /* @__PURE__ */ h(
|
|
6847
|
-
|
|
6914
|
+
it,
|
|
6848
6915
|
{
|
|
6849
6916
|
focusMode: "light",
|
|
6850
6917
|
mode: "dark",
|
|
@@ -6863,7 +6930,7 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6863
6930
|
helperText: s
|
|
6864
6931
|
}
|
|
6865
6932
|
) }),
|
|
6866
|
-
/* @__PURE__ */ h(
|
|
6933
|
+
/* @__PURE__ */ h(ye, { span: 12, children: /* @__PURE__ */ h(
|
|
6867
6934
|
$s,
|
|
6868
6935
|
{
|
|
6869
6936
|
mode: "dark",
|
|
@@ -6875,10 +6942,10 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6875
6942
|
children: Fo
|
|
6876
6943
|
}
|
|
6877
6944
|
) }),
|
|
6878
|
-
!Os() && /* @__PURE__ */
|
|
6879
|
-
/* @__PURE__ */ h(
|
|
6880
|
-
/* @__PURE__ */ h(
|
|
6881
|
-
|
|
6945
|
+
!Os() && /* @__PURE__ */ V(Or, { children: [
|
|
6946
|
+
/* @__PURE__ */ h(ye, { span: 12, children: /* @__PURE__ */ h("div", { className: "text-center text-copy-light mt-2 mb-2", children: "or" }) }),
|
|
6947
|
+
/* @__PURE__ */ h(ye, { span: 12, children: /* @__PURE__ */ h(
|
|
6948
|
+
it,
|
|
6882
6949
|
{
|
|
6883
6950
|
variant: "selected",
|
|
6884
6951
|
mode: "dark",
|
|
@@ -6893,41 +6960,41 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6893
6960
|
] })
|
|
6894
6961
|
] }) }) }) })
|
|
6895
6962
|
] });
|
|
6896
|
-
},
|
|
6963
|
+
}, qo = new URL(document.location.href).searchParams, Rr = !!qo.get("debug") || !1, Wo = qs(() => import(
|
|
6897
6964
|
/* webpackChunkName: "LazyApp" */
|
|
6898
|
-
"./App.
|
|
6899
|
-
).then((e) => e.App)),
|
|
6965
|
+
"./App.fsMPD4V8.js"
|
|
6966
|
+
).then((e) => e.App)), Vo = new fa(), Cr = ({
|
|
6900
6967
|
isComponent: e,
|
|
6901
6968
|
headerHeight: t
|
|
6902
6969
|
}) => {
|
|
6903
|
-
const { isAuthenticated: r, isLoading: s, user: a, getAccessToken: n } =
|
|
6904
|
-
return s ? /* @__PURE__ */ h("div", {}) : r ? /* @__PURE__ */ h(Bs, { fallback: /* @__PURE__ */ h("div", {}), children: /* @__PURE__ */ h(ma, { client:
|
|
6970
|
+
const { isAuthenticated: r, isLoading: s, user: a, getAccessToken: n } = cs();
|
|
6971
|
+
return s ? /* @__PURE__ */ h("div", {}) : r ? /* @__PURE__ */ h(Bs, { fallback: /* @__PURE__ */ h("div", {}), children: /* @__PURE__ */ h(ma, { client: Vo, children: /* @__PURE__ */ h(
|
|
6905
6972
|
vi,
|
|
6906
6973
|
{
|
|
6907
6974
|
user: a?.username,
|
|
6908
6975
|
getAccessToken: n,
|
|
6909
|
-
children: /* @__PURE__ */ h(
|
|
6976
|
+
children: /* @__PURE__ */ h(Wo, { isComponent: e, headerHeight: t })
|
|
6910
6977
|
}
|
|
6911
6978
|
) }) }) : /* @__PURE__ */ h(Bo, {});
|
|
6912
|
-
},
|
|
6979
|
+
}, jo = ({
|
|
6913
6980
|
isComponent: e = !1,
|
|
6914
6981
|
headerHeight: t = 0,
|
|
6915
6982
|
domain: r = _s
|
|
6916
6983
|
}) => (W(() => {
|
|
6917
|
-
e ||
|
|
6984
|
+
e || ds().catch((s) => {
|
|
6918
6985
|
console.error("[SW] Failed to register service worker:", s);
|
|
6919
6986
|
});
|
|
6920
6987
|
}, [e]), jt ? /* @__PURE__ */ h(
|
|
6921
|
-
|
|
6988
|
+
wr,
|
|
6922
6989
|
{
|
|
6923
|
-
clientId:
|
|
6990
|
+
clientId: Sr,
|
|
6924
6991
|
domain: r,
|
|
6925
|
-
debug:
|
|
6992
|
+
debug: Rr,
|
|
6926
6993
|
endpoint: process.env.PUBLIC_AUTH_SERVER_URL,
|
|
6927
|
-
children: /* @__PURE__ */ h(
|
|
6994
|
+
children: /* @__PURE__ */ h(Cr, { isComponent: e, headerHeight: t })
|
|
6928
6995
|
}
|
|
6929
|
-
) : /* @__PURE__ */ h(
|
|
6930
|
-
|
|
6996
|
+
) : /* @__PURE__ */ h(wr, { clientId: Sr, domain: r, debug: Rr, children: /* @__PURE__ */ h(Cr, { isComponent: e, headerHeight: t }) })), Pl = ({ domain: e, headerHeight: t }) => /* @__PURE__ */ h(
|
|
6997
|
+
jo,
|
|
6931
6998
|
{
|
|
6932
6999
|
isComponent: !0,
|
|
6933
7000
|
domain: e,
|
|
@@ -6935,39 +7002,39 @@ Press Ctrl+Enter to send it or Enter for new line.`, yl = "{{clipboard}}", P = "
|
|
|
6935
7002
|
}
|
|
6936
7003
|
);
|
|
6937
7004
|
export {
|
|
6938
|
-
|
|
7005
|
+
yl as ABOUT_TITLE,
|
|
6939
7006
|
lc as ACTION_RESET_PROMPT,
|
|
6940
7007
|
ic as ACTION_SEARCH,
|
|
6941
7008
|
oc as ACTION_SORT,
|
|
6942
7009
|
cc as ACTION_TOGGLE_PROMPT,
|
|
6943
|
-
|
|
7010
|
+
Cl as APP_CLASSNAME,
|
|
6944
7011
|
Uc as B,
|
|
6945
7012
|
$s as C,
|
|
6946
|
-
|
|
6947
|
-
|
|
7013
|
+
Nl as CARDS,
|
|
7014
|
+
wl as CLIPBOARD_PROMPT,
|
|
6948
7015
|
Ac as DEFAULT_ICON_ACTION_SIZE,
|
|
6949
7016
|
Dc as E,
|
|
6950
7017
|
nc as ERROR_MESSAGE,
|
|
6951
|
-
|
|
6952
|
-
|
|
7018
|
+
jc as Et,
|
|
7019
|
+
Sl as FOOTER_DISCLAIMERS,
|
|
6953
7020
|
gi as H,
|
|
6954
|
-
|
|
6955
|
-
|
|
7021
|
+
pl as HISTORY_TITLE,
|
|
7022
|
+
mt as I,
|
|
6956
7023
|
Sc as INFINITE_SCROLL_LIMIT,
|
|
6957
7024
|
wc as INFINITE_SCROLL_THRESHOLD,
|
|
6958
7025
|
Oc as INPUT_BOTTOM_OFFSET,
|
|
6959
7026
|
Pc as INPUT_BOTTOM_OFFSET_EXTRA,
|
|
6960
7027
|
Nc as INPUT_BOTTOM_OFFSET_IPAD,
|
|
6961
7028
|
kc as INPUT_BOTTOM_OFFSET_IPHONE,
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
7029
|
+
El as INPUT_PLACEHOLDER_TEXT_CMD_ENTER,
|
|
7030
|
+
bl as INPUT_PLACEHOLDER_TEXT_ENTER,
|
|
7031
|
+
gl as INPUT_PLACEHOLDER_TEXT_MOBILE,
|
|
6965
7032
|
Gc as J,
|
|
6966
7033
|
Hc as K,
|
|
6967
7034
|
vo as L,
|
|
6968
7035
|
Ec as LOCAL_STORAGE_CHAT_ID,
|
|
6969
7036
|
yc as LOCAL_STORAGE_FAVORITES_ONLY,
|
|
6970
|
-
|
|
7037
|
+
ls as LOCAL_STORAGE_PREFIX,
|
|
6971
7038
|
gc as LOCAL_STORAGE_PRIVATE_DISCLOSURE,
|
|
6972
7039
|
bc as LOCAL_STORAGE_REASONING_DISCLOSURE,
|
|
6973
7040
|
uc as LOCAL_STORAGE_SEARCH,
|
|
@@ -6976,85 +7043,90 @@ export {
|
|
|
6976
7043
|
mc as LOCAL_STORAGE_SORT_MEMORY_DIRECTION,
|
|
6977
7044
|
hc as LOCAL_STORAGE_SORT_TIMESTAMP,
|
|
6978
7045
|
fc as LOCAL_STORAGE_SORT_TOKEN_USAGE,
|
|
6979
|
-
|
|
7046
|
+
dl as LOG_OUT,
|
|
6980
7047
|
Go as Logo,
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
7048
|
+
dt as O,
|
|
7049
|
+
fl as PROFILE_TITLE,
|
|
7050
|
+
vl as PROMPTS_DESCRIPTION,
|
|
6984
7051
|
vc as PROMPT_CLASSNAME,
|
|
6985
7052
|
Tc as PROMPT_EDITABLE_AREA_CLASSNAME,
|
|
6986
7053
|
k as Q,
|
|
6987
7054
|
yo as S,
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
7055
|
+
B as SERVICE_TYPES,
|
|
7056
|
+
ml as SETTINGS_TITLE,
|
|
7057
|
+
Pl as SassySaint,
|
|
7058
|
+
Rl as TOAST_CACHE_DISABLED,
|
|
7059
|
+
_l as TOAST_CACHE_ENABLED,
|
|
7060
|
+
Al as TOAST_CHAT_DELETED,
|
|
7061
|
+
Il as TOAST_CHAT_SAVED,
|
|
7062
|
+
Tl as TOAST_PROVIDER_CHANGED,
|
|
7063
|
+
Ol as TRIMESTERS,
|
|
7064
|
+
kl as TRIMESTERS_SHORT,
|
|
6998
7065
|
_c as UI_BUTTON_SCROLL_BUFFER,
|
|
6999
7066
|
Rc as UI_DEFAULT_MAIN_HEIGHT,
|
|
7000
7067
|
Cc as UI_DEFAULT_MAIN_HEIGHT_IPHONE,
|
|
7001
7068
|
Ic as UI_FOOTER_BUFFER,
|
|
7002
|
-
|
|
7069
|
+
hl as USAGE_TITLE,
|
|
7003
7070
|
Lc as Y,
|
|
7004
|
-
|
|
7071
|
+
zt as Y$1,
|
|
7005
7072
|
Kc as Z,
|
|
7006
7073
|
fo as b,
|
|
7007
|
-
|
|
7074
|
+
ht as c,
|
|
7008
7075
|
Qi as canEvaluateModels,
|
|
7009
|
-
|
|
7076
|
+
Vi as convertCamelCaseToReadable,
|
|
7010
7077
|
Gi as debounce,
|
|
7011
7078
|
Mc as e,
|
|
7012
|
-
|
|
7079
|
+
Vc as et,
|
|
7013
7080
|
xc as getCacheInfo,
|
|
7014
7081
|
$i as getCurrentGeoLocation,
|
|
7015
7082
|
Cs as getLayoutPaddingClass,
|
|
7016
7083
|
Rs as getMessageContaintWrapperClass,
|
|
7017
|
-
|
|
7084
|
+
me as graphQLRequest,
|
|
7085
|
+
Je as h,
|
|
7018
7086
|
$c as handleServiceWorkerToggle,
|
|
7019
7087
|
Ms as i,
|
|
7020
7088
|
jt as isDev,
|
|
7021
|
-
|
|
7089
|
+
Wi as isPWAMode,
|
|
7022
7090
|
ks as isProbablyMobile,
|
|
7023
|
-
|
|
7091
|
+
qi as isProbablyiPad,
|
|
7024
7092
|
Bi as isProbablyiPhone,
|
|
7025
|
-
|
|
7093
|
+
Dt as isServiceWorkerEnabled,
|
|
7026
7094
|
Os as isTauri,
|
|
7027
|
-
|
|
7028
|
-
|
|
7095
|
+
xe as it,
|
|
7096
|
+
ye as j,
|
|
7029
7097
|
Eo as l,
|
|
7030
|
-
|
|
7031
|
-
os as n,
|
|
7098
|
+
cs as n,
|
|
7032
7099
|
Bc as nt,
|
|
7033
7100
|
Fi as numberFormatter,
|
|
7034
7101
|
xs as o,
|
|
7035
7102
|
xi as obfuscate,
|
|
7036
|
-
|
|
7103
|
+
qc as ot,
|
|
7037
7104
|
Ki as pluralize,
|
|
7038
|
-
|
|
7105
|
+
He as r,
|
|
7039
7106
|
Di as renderDataAsList,
|
|
7040
7107
|
wi as serverUrl,
|
|
7041
7108
|
Qc as setNewProvider,
|
|
7042
7109
|
Jc as setUserPlan,
|
|
7043
|
-
|
|
7044
|
-
|
|
7110
|
+
Wc as st,
|
|
7111
|
+
it as te,
|
|
7045
7112
|
Mi as unObfuscate,
|
|
7046
7113
|
zc as useChangelogs,
|
|
7114
|
+
el as useChat,
|
|
7047
7115
|
Zc as useChatsHistory,
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7116
|
+
al as useChatsUsage,
|
|
7117
|
+
cl as useDeleteAllMemories,
|
|
7118
|
+
rl as useDeleteChat,
|
|
7119
|
+
ol as useDeleteMemory,
|
|
7120
|
+
ll as useEntitlements,
|
|
7121
|
+
he as useQueryClient,
|
|
7122
|
+
tl as useSaveChat,
|
|
7052
7123
|
Yc as useServerCapabilities,
|
|
7053
|
-
|
|
7124
|
+
sl as useToggleFavoriteChat,
|
|
7125
|
+
il as useUpdateMemory,
|
|
7054
7126
|
Xc as useUserChatStats,
|
|
7055
|
-
|
|
7127
|
+
nl as useUserMemories,
|
|
7056
7128
|
Si as useUserPreferences,
|
|
7057
|
-
|
|
7129
|
+
ul as utilities,
|
|
7058
7130
|
Fc as x,
|
|
7059
7131
|
Us as x$1
|
|
7060
7132
|
};
|