@versini/sassysaint 8.59.4 → 8.61.0
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.Ce5xKXvl.js → AboutChangelog.khIO6IQv.js} +2 -2
- package/dist/chunks/{AboutEntry.BIxJ0nBU.js → AboutEntry.C8vztscz.js} +7 -7
- package/dist/chunks/{App.C0TMLCXL.js → App.BrPp8T2f.js} +22 -22
- package/dist/chunks/{Chart.Dm1awtwo.js → Chart.-OJvZ1z-.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.Dq5_Eygw.js → ChatBubbleAssistant.R0psov42.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.BklufN6-.js → ChatBubbleUser.Cyfsx64P.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.BG-EQekK.js → ChatHistoryTable.CyvWYwYT.js} +9 -9
- package/dist/chunks/{HistoryEntry.DEz9BkNK.js → HistoryEntry.COlV18V9.js} +3 -3
- package/dist/chunks/{ProfileEntry.DlK0mggZ.js → ProfileEntry.Cz0cXlvu.js} +2 -2
- package/dist/chunks/SettingsEntry.DlOg852u.js +799 -0
- package/dist/chunks/{Table.DMMefioh.js → Table.lgFnJD0P.js} +2 -2
- package/dist/chunks/{UsageEntry.By1Tqk3d.js → UsageEntry.DqdOT7Fq.js} +3 -3
- package/dist/chunks/UserMemoriesPanel.oDlcY89z.js +208 -0
- package/dist/chunks/{index._DAcm-25.js → index.B-qS2v_F.js} +1 -1
- package/dist/chunks/{index.Cnzsl-SW.js → index.B73h5HsZ.js} +2 -2
- package/dist/chunks/{index._ok9-Gz7.js → index.BPgNgE6z.js} +3 -3
- package/dist/chunks/{index.DxCuShZW.js → index.D0NeHQ_Z.js} +610 -639
- package/dist/chunks/{index.BQNxqtEh.js → index.DPie0Opm.js} +1 -1
- package/dist/chunks/{index.CowNGsFh.js → index.KT85y0Xl.js} +1 -1
- package/dist/chunks/{index.B1gwgNLh.js → index.UrB_uFIS.js} +1 -1
- package/dist/chunks/{useMarkdown.BF3V5ODx.js → useMarkdown.DCsDrRoY.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/chunks/SettingsEntry.DqU_B5BR.js +0 -430
- package/dist/chunks/UserMemoriesPanel.BaEGaQVG.js +0 -692
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as h, jsxs as
|
|
1
|
+
import { jsx as h, jsxs as q, Fragment as Ar } from "react/jsx-runtime";
|
|
2
2
|
import * as H from "react";
|
|
3
|
-
import
|
|
3
|
+
import ie, { createContext as xt, useReducer as Ir, useCallback as Y, useRef as j, useEffect as W, useSyncExternalStore as _s, useContext as at, useState as ne, useMemo as Je, useId as Rs, useLayoutEffect as Qe, Suspense as Cs, lazy as Os } from "react";
|
|
4
4
|
import y from "clsx";
|
|
5
5
|
var ke = class {
|
|
6
6
|
constructor() {
|
|
@@ -73,16 +73,16 @@ function $s(e, t) {
|
|
|
73
73
|
function Tt(e) {
|
|
74
74
|
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function _r(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 J(e, t) {
|
|
83
83
|
return typeof e == "function" ? e(t) : e;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Qt(e, t) {
|
|
86
86
|
const {
|
|
87
87
|
type: r = "all",
|
|
88
88
|
exact: s,
|
|
@@ -93,7 +93,7 @@ function Yt(e, t) {
|
|
|
93
93
|
} = e;
|
|
94
94
|
if (i) {
|
|
95
95
|
if (s) {
|
|
96
|
-
if (t.queryHash !==
|
|
96
|
+
if (t.queryHash !== Dt(i, t.options))
|
|
97
97
|
return !1;
|
|
98
98
|
} else if (!xe(t.queryKey, i))
|
|
99
99
|
return !1;
|
|
@@ -105,7 +105,7 @@ function Yt(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 Yt(e, t) {
|
|
109
109
|
const { exact: r, status: s, predicate: a, mutationKey: n } = e;
|
|
110
110
|
if (n) {
|
|
111
111
|
if (!t.options.mutationKey)
|
|
@@ -118,7 +118,7 @@ function zt(e, t) {
|
|
|
118
118
|
}
|
|
119
119
|
return !(s && t.state.status !== s || a && !a(t));
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function Dt(e, t) {
|
|
122
122
|
return (t?.queryKeyHashFn || pe)(e);
|
|
123
123
|
}
|
|
124
124
|
function pe(e) {
|
|
@@ -134,7 +134,7 @@ var xs = Object.prototype.hasOwnProperty;
|
|
|
134
134
|
function At(e, t) {
|
|
135
135
|
if (e === t)
|
|
136
136
|
return e;
|
|
137
|
-
const r =
|
|
137
|
+
const r = zt(e) && zt(t);
|
|
138
138
|
if (!r && !(It(e) && It(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;
|
|
@@ -153,7 +153,7 @@ function At(e, t) {
|
|
|
153
153
|
}
|
|
154
154
|
return a === i && c === a ? e : o;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Ye(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,22 +161,22 @@ function ze(e, t) {
|
|
|
161
161
|
return !1;
|
|
162
162
|
return !0;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function zt(e) {
|
|
165
165
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
166
166
|
}
|
|
167
167
|
function It(e) {
|
|
168
|
-
if (!
|
|
168
|
+
if (!Xt(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 !(!Xt(r) || !r.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function Xt(e) {
|
|
177
177
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function Ds(e) {
|
|
180
180
|
return new Promise((t) => {
|
|
181
181
|
fe.setTimeout(t, e);
|
|
182
182
|
});
|
|
@@ -197,7 +197,7 @@ function _t(e, t, r) {
|
|
|
197
197
|
}
|
|
198
198
|
return t;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function Ms(e, t, r = 0) {
|
|
201
201
|
const s = [...e, t];
|
|
202
202
|
return r && s.length > r ? s.slice(1) : s;
|
|
203
203
|
}
|
|
@@ -205,13 +205,13 @@ function Ls(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 ze = Symbol();
|
|
209
|
+
function Rr(e, t) {
|
|
210
|
+
return process.env.NODE_ENV !== "production" && e.queryFn === ze && 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 === ze ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Cr(e, t) {
|
|
215
215
|
return typeof e == "function" ? e(...t) : !!e;
|
|
216
216
|
}
|
|
217
217
|
var Us = class extends ke {
|
|
@@ -251,7 +251,7 @@ var Us = class extends ke {
|
|
|
251
251
|
isFocused() {
|
|
252
252
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
253
253
|
}
|
|
254
|
-
},
|
|
254
|
+
}, Mt = new Us();
|
|
255
255
|
function Rt() {
|
|
256
256
|
let e, t;
|
|
257
257
|
const r = new Promise((a, n) => {
|
|
@@ -365,19 +365,19 @@ var $ = Hs(), Ks = class extends ke {
|
|
|
365
365
|
isOnline() {
|
|
366
366
|
return this.#e;
|
|
367
367
|
}
|
|
368
|
-
},
|
|
368
|
+
}, Xe = new Ks();
|
|
369
369
|
function Gs(e) {
|
|
370
370
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
return (e ?? "online") === "online" ?
|
|
372
|
+
function Or(e) {
|
|
373
|
+
return (e ?? "online") === "online" ? Xe.isOnline() : !0;
|
|
374
374
|
}
|
|
375
375
|
var Ct = 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 kr(e) {
|
|
381
381
|
let t = !1, r = 0, s;
|
|
382
382
|
const a = Rt(), n = () => a.status !== "pending", i = (g) => {
|
|
383
383
|
if (!n()) {
|
|
@@ -388,7 +388,7 @@ function Nr(e) {
|
|
|
388
388
|
t = !0;
|
|
389
389
|
}, c = () => {
|
|
390
390
|
t = !1;
|
|
391
|
-
}, f = () =>
|
|
391
|
+
}, f = () => Mt.isFocused() && (e.networkMode === "always" || Xe.isOnline()) && e.canRun(), d = () => Or(e.networkMode) && e.canRun(), u = (g) => {
|
|
392
392
|
n() || (s?.(), a.resolve(g));
|
|
393
393
|
}, l = (g) => {
|
|
394
394
|
n() || (s?.(), a.reject(g));
|
|
@@ -416,7 +416,7 @@ function Nr(e) {
|
|
|
416
416
|
l(E);
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
|
-
r++, e.onFail?.(r, E),
|
|
419
|
+
r++, e.onFail?.(r, E), Ds(K).then(() => f() ? void 0 : m()).then(() => {
|
|
420
420
|
t ? l(E) : p();
|
|
421
421
|
});
|
|
422
422
|
});
|
|
@@ -432,7 +432,7 @@ function Nr(e) {
|
|
|
432
432
|
start: () => (d() ? p() : m().then(p), a)
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
|
-
var
|
|
435
|
+
var Nr = class {
|
|
436
436
|
#e;
|
|
437
437
|
destroy() {
|
|
438
438
|
this.clearGcTimeout();
|
|
@@ -451,7 +451,7 @@ var Pr = class {
|
|
|
451
451
|
clearGcTimeout() {
|
|
452
452
|
this.#e && (fe.clearTimeout(this.#e), this.#e = void 0);
|
|
453
453
|
}
|
|
454
|
-
}, Bs = class extends
|
|
454
|
+
}, Bs = class extends Nr {
|
|
455
455
|
#e;
|
|
456
456
|
#t;
|
|
457
457
|
#r;
|
|
@@ -460,7 +460,7 @@ var Pr = 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 = Zt(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 Pr = 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 = Zt(this.options);
|
|
474
474
|
t.data !== void 0 && (this.setData(t.data, {
|
|
475
475
|
updatedAt: t.dataUpdatedAt,
|
|
476
476
|
manual: !0
|
|
@@ -504,11 +504,11 @@ var Pr = class {
|
|
|
504
504
|
}
|
|
505
505
|
isActive() {
|
|
506
506
|
return this.observers.some(
|
|
507
|
-
(e) =>
|
|
507
|
+
(e) => J(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 === ze || 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 Pr = 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 : !_r(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 Pr = class {
|
|
|
564
564
|
get: () => (this.#o = !0, r.signal)
|
|
565
565
|
});
|
|
566
566
|
}, a = () => {
|
|
567
|
-
const o =
|
|
567
|
+
const o = Rr(this.options, t), f = (() => {
|
|
568
568
|
const d = {
|
|
569
569
|
client: this.#a,
|
|
570
570
|
queryKey: this.queryKey,
|
|
@@ -588,7 +588,7 @@ var Pr = 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 = kr({
|
|
592
592
|
initialPromise: t?.initialPromise,
|
|
593
593
|
fn: i.fetchFn,
|
|
594
594
|
onCancel: (o) => {
|
|
@@ -669,7 +669,7 @@ var Pr = class {
|
|
|
669
669
|
case "fetch":
|
|
670
670
|
return {
|
|
671
671
|
...r,
|
|
672
|
-
|
|
672
|
+
...Pr(r.data, this.options),
|
|
673
673
|
fetchMeta: e.meta ?? null
|
|
674
674
|
};
|
|
675
675
|
case "success":
|
|
@@ -719,18 +719,18 @@ var Pr = class {
|
|
|
719
719
|
});
|
|
720
720
|
}
|
|
721
721
|
};
|
|
722
|
-
function
|
|
722
|
+
function Pr(e, t) {
|
|
723
723
|
return {
|
|
724
724
|
fetchFailureCount: 0,
|
|
725
725
|
fetchFailureReason: null,
|
|
726
|
-
fetchStatus:
|
|
726
|
+
fetchStatus: Or(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 Zt(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,7 +747,7 @@ function er(e) {
|
|
|
747
747
|
fetchStatus: "idle"
|
|
748
748
|
};
|
|
749
749
|
}
|
|
750
|
-
var
|
|
750
|
+
var Ws = class extends ke {
|
|
751
751
|
constructor(e, t) {
|
|
752
752
|
super(), this.options = t, this.#e = e, this.#n = null, this.#o = Rt(), this.bindMethods(), this.setOptions(t);
|
|
753
753
|
}
|
|
@@ -772,7 +772,7 @@ var qs = 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), er(this.#t, this.options) ? this.#d() : this.updateResult(), this.#E());
|
|
776
776
|
}
|
|
777
777
|
onUnsubscribe() {
|
|
778
778
|
this.hasListeners() || this.destroy();
|
|
@@ -796,24 +796,24 @@ var qs = 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 J(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 && !Ye(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 && tr(
|
|
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 || J(this.options.enabled, this.#t) !== J(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 || J(this.options.enabled, this.#t) !== J(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);
|
|
@@ -868,7 +868,7 @@ var qs = class extends ke {
|
|
|
868
868
|
);
|
|
869
869
|
if (me || this.#a.isStale || !Tt(e))
|
|
870
870
|
return;
|
|
871
|
-
const r =
|
|
871
|
+
const r = _r(this.#a.dataUpdatedAt, e) + 1;
|
|
872
872
|
this.#l = fe.setTimeout(() => {
|
|
873
873
|
this.#a.isStale || this.updateResult();
|
|
874
874
|
}, r);
|
|
@@ -877,8 +877,8 @@ var qs = 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, !(me ||
|
|
881
|
-
(this.options.refetchIntervalInBackground ||
|
|
880
|
+
this.#S(), this.#c = e, !(me || J(this.options.enabled, this.#t) === !1 || !Tt(this.#c) || this.#c === 0) && (this.#u = fe.setInterval(() => {
|
|
881
|
+
(this.options.refetchIntervalInBackground || Mt.isFocused()) && this.#d();
|
|
882
882
|
}, this.#c));
|
|
883
883
|
}
|
|
884
884
|
#E() {
|
|
@@ -894,10 +894,10 @@ var qs = class extends ke {
|
|
|
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 && er(e, t), _ = v && tr(e, r, t, s);
|
|
898
898
|
(x || _) && (d = {
|
|
899
899
|
...d,
|
|
900
|
-
|
|
900
|
+
...Pr(f.data, e.options)
|
|
901
901
|
}), t._optimisticResults === "isRestoring" && (d.fetchStatus = "idle");
|
|
902
902
|
}
|
|
903
903
|
let { error: m, errorUpdatedAt: p, status: g } = d;
|
|
@@ -950,7 +950,7 @@ var qs = class extends ke {
|
|
|
950
950
|
isStale: Lt(e, t),
|
|
951
951
|
refetch: this.refetch,
|
|
952
952
|
promise: this.#o,
|
|
953
|
-
isEnabled:
|
|
953
|
+
isEnabled: J(t.enabled, e) !== !1
|
|
954
954
|
};
|
|
955
955
|
if (this.options.experimental_prefetchInRender) {
|
|
956
956
|
const v = (I) => {
|
|
@@ -975,7 +975,7 @@ var qs = 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), Ye(t, e))
|
|
979
979
|
return;
|
|
980
980
|
this.#a = t;
|
|
981
981
|
const r = () => {
|
|
@@ -1015,29 +1015,29 @@ var qs = class extends ke {
|
|
|
1015
1015
|
});
|
|
1016
1016
|
}
|
|
1017
1017
|
};
|
|
1018
|
-
function
|
|
1019
|
-
return
|
|
1018
|
+
function qs(e, t) {
|
|
1019
|
+
return J(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1022
|
-
return
|
|
1021
|
+
function er(e, t) {
|
|
1022
|
+
return qs(e, t) || e.state.data !== void 0 && Ot(e, t, t.refetchOnMount);
|
|
1023
1023
|
}
|
|
1024
1024
|
function Ot(e, t, r) {
|
|
1025
|
-
if (
|
|
1025
|
+
if (J(t.enabled, e) !== !1 && de(t.staleTime, e) !== "static") {
|
|
1026
1026
|
const s = typeof r == "function" ? r(e) : r;
|
|
1027
1027
|
return s === "always" || s !== !1 && Lt(e, t);
|
|
1028
1028
|
}
|
|
1029
1029
|
return !1;
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return (e !== t ||
|
|
1031
|
+
function tr(e, t, r, s) {
|
|
1032
|
+
return (e !== t || J(s.enabled, e) === !1) && (!r.suspense || e.state.status !== "error") && Lt(e, r);
|
|
1033
1033
|
}
|
|
1034
1034
|
function Lt(e, t) {
|
|
1035
|
-
return
|
|
1035
|
+
return J(t.enabled, e) !== !1 && e.isStaleByTime(de(t.staleTime, e));
|
|
1036
1036
|
}
|
|
1037
1037
|
function js(e, t) {
|
|
1038
|
-
return !
|
|
1038
|
+
return !Ye(e.getCurrentResult(), t);
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function rr(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,28 +1051,28 @@ function sr(e) {
|
|
|
1051
1051
|
d = !0;
|
|
1052
1052
|
}), t.signal)
|
|
1053
1053
|
});
|
|
1054
|
-
}, l =
|
|
1054
|
+
}, l = Rr(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 Q = {
|
|
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(
|
|
1068
|
-
})(), A = await l(O), { maxPages: K } = t.options, R = b ? Ls :
|
|
1067
|
+
return u(Q), Q;
|
|
1068
|
+
})(), A = await l(O), { maxPages: K } = t.options, R = b ? Ls : Ms;
|
|
1069
1069
|
return {
|
|
1070
1070
|
pages: R(p.pages, A, K),
|
|
1071
1071
|
pageParams: R(p.pageParams, g, K)
|
|
1072
1072
|
};
|
|
1073
1073
|
};
|
|
1074
1074
|
if (a && n.length) {
|
|
1075
|
-
const p = a === "backward", g = p ? Vs :
|
|
1075
|
+
const p = a === "backward", g = p ? Vs : sr, b = {
|
|
1076
1076
|
pages: n,
|
|
1077
1077
|
pageParams: i
|
|
1078
1078
|
}, E = g(s, b);
|
|
@@ -1080,7 +1080,7 @@ function sr(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 : sr(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 sr(e) {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function sr(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 ar(e, { pages: t, pageParams: r }) {
|
|
|
1113
1113
|
function Vs(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
|
|
1116
|
+
var Js = class extends Nr {
|
|
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 || $r(), 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 Qs = class extends Pr {
|
|
|
1156
1156
|
meta: this.options.meta,
|
|
1157
1157
|
mutationKey: this.options.mutationKey
|
|
1158
1158
|
};
|
|
1159
|
-
this.#a =
|
|
1159
|
+
this.#a = kr({
|
|
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 Qs = class extends Pr {
|
|
|
1316
1316
|
});
|
|
1317
1317
|
}
|
|
1318
1318
|
};
|
|
1319
|
-
function
|
|
1319
|
+
function $r() {
|
|
1320
1320
|
return {
|
|
1321
1321
|
context: void 0,
|
|
1322
1322
|
data: void 0,
|
|
@@ -1329,7 +1329,7 @@ function xr() {
|
|
|
1329
1329
|
submittedAt: 0
|
|
1330
1330
|
};
|
|
1331
1331
|
}
|
|
1332
|
-
var
|
|
1332
|
+
var Qs = class extends ke {
|
|
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
|
}
|
|
@@ -1337,7 +1337,7 @@ var Js = class extends ke {
|
|
|
1337
1337
|
#t;
|
|
1338
1338
|
#r;
|
|
1339
1339
|
build(e, t, r) {
|
|
1340
|
-
const s = new
|
|
1340
|
+
const s = new Js({
|
|
1341
1341
|
client: e,
|
|
1342
1342
|
mutationCache: this,
|
|
1343
1343
|
mutationId: ++this.#r,
|
|
@@ -1348,7 +1348,7 @@ var Js = class extends ke {
|
|
|
1348
1348
|
}
|
|
1349
1349
|
add(e) {
|
|
1350
1350
|
this.#e.add(e);
|
|
1351
|
-
const t =
|
|
1351
|
+
const t = Ue(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 Js = class extends ke {
|
|
|
1357
1357
|
}
|
|
1358
1358
|
remove(e) {
|
|
1359
1359
|
if (this.#e.delete(e)) {
|
|
1360
|
-
const t =
|
|
1360
|
+
const t = Ue(e);
|
|
1361
1361
|
if (typeof t == "string") {
|
|
1362
1362
|
const r = this.#t.get(t);
|
|
1363
1363
|
if (r)
|
|
@@ -1370,7 +1370,7 @@ var Js = class extends ke {
|
|
|
1370
1370
|
this.notify({ type: "removed", mutation: e });
|
|
1371
1371
|
}
|
|
1372
1372
|
canRun(e) {
|
|
1373
|
-
const t =
|
|
1373
|
+
const t = Ue(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 Js = class extends ke {
|
|
|
1380
1380
|
return !0;
|
|
1381
1381
|
}
|
|
1382
1382
|
runNext(e) {
|
|
1383
|
-
const t =
|
|
1383
|
+
const t = Ue(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 Js = class extends ke {
|
|
|
1396
1396
|
find(e) {
|
|
1397
1397
|
const t = { exact: !0, ...e };
|
|
1398
1398
|
return this.getAll().find(
|
|
1399
|
-
(r) =>
|
|
1399
|
+
(r) => Yt(t, r)
|
|
1400
1400
|
);
|
|
1401
1401
|
}
|
|
1402
1402
|
findAll(e = {}) {
|
|
1403
|
-
return this.getAll().filter((t) =>
|
|
1403
|
+
return this.getAll().filter((t) => Yt(e, t));
|
|
1404
1404
|
}
|
|
1405
1405
|
notify(e) {
|
|
1406
1406
|
$.batch(() => {
|
|
@@ -1418,7 +1418,7 @@ var Js = class extends ke {
|
|
|
1418
1418
|
);
|
|
1419
1419
|
}
|
|
1420
1420
|
};
|
|
1421
|
-
function
|
|
1421
|
+
function Ue(e) {
|
|
1422
1422
|
return e.options.scope?.id;
|
|
1423
1423
|
}
|
|
1424
1424
|
var Ys = class extends ke {
|
|
@@ -1434,7 +1434,7 @@ var Ys = 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), Ye(this.options, t) || this.#e.getMutationCache().notify({
|
|
1438
1438
|
type: "observerOptionsUpdated",
|
|
1439
1439
|
mutation: this.#r,
|
|
1440
1440
|
observer: this
|
|
@@ -1456,7 +1456,7 @@ var Ys = 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 ?? $r();
|
|
1460
1460
|
this.#t = {
|
|
1461
1461
|
...e,
|
|
1462
1462
|
isPending: e.status === "pending",
|
|
@@ -1510,7 +1510,7 @@ var Ys = class extends ke {
|
|
|
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 ?? Dt(s, t);
|
|
1514
1514
|
let n = this.get(a);
|
|
1515
1515
|
return n || (n = new Bs({
|
|
1516
1516
|
client: e,
|
|
@@ -1547,12 +1547,12 @@ var Ys = class extends ke {
|
|
|
1547
1547
|
find(e) {
|
|
1548
1548
|
const t = { exact: !0, ...e };
|
|
1549
1549
|
return this.getAll().find(
|
|
1550
|
-
(r) =>
|
|
1550
|
+
(r) => Qt(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) => Qt(e, r)) : t;
|
|
1556
1556
|
}
|
|
1557
1557
|
notify(e) {
|
|
1558
1558
|
$.batch(() => {
|
|
@@ -1585,12 +1585,12 @@ var Ys = class extends ke {
|
|
|
1585
1585
|
#o;
|
|
1586
1586
|
#n;
|
|
1587
1587
|
constructor(e = {}) {
|
|
1588
|
-
this.#e = e.queryCache || new zs(), this.#t = e.mutationCache || new
|
|
1588
|
+
this.#e = e.queryCache || new zs(), this.#t = e.mutationCache || new Qs(), 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 = Mt.subscribe(async (e) => {
|
|
1592
1592
|
e && (await this.resumePausedMutations(), this.#e.onFocus());
|
|
1593
|
-
}), this.#n =
|
|
1593
|
+
}), this.#n = Xe.subscribe(async (e) => {
|
|
1594
1594
|
e && (await this.resumePausedMutations(), this.#e.onOnline());
|
|
1595
1595
|
}));
|
|
1596
1596
|
}
|
|
@@ -1706,16 +1706,16 @@ var Ys = class extends ke {
|
|
|
1706
1706
|
return this.fetchQuery(e).then(B).catch(B);
|
|
1707
1707
|
}
|
|
1708
1708
|
fetchInfiniteQuery(e) {
|
|
1709
|
-
return e.behavior =
|
|
1709
|
+
return e.behavior = rr(e.pages), this.fetchQuery(e);
|
|
1710
1710
|
}
|
|
1711
1711
|
prefetchInfiniteQuery(e) {
|
|
1712
1712
|
return this.fetchInfiniteQuery(e).then(B).catch(B);
|
|
1713
1713
|
}
|
|
1714
1714
|
ensureInfiniteQueryData(e) {
|
|
1715
|
-
return e.behavior =
|
|
1715
|
+
return e.behavior = rr(e.pages), this.ensureQueryData(e);
|
|
1716
1716
|
}
|
|
1717
1717
|
resumePausedMutations() {
|
|
1718
|
-
return
|
|
1718
|
+
return Xe.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
|
|
1719
1719
|
}
|
|
1720
1720
|
getQueryCache() {
|
|
1721
1721
|
return this.#e;
|
|
@@ -1762,10 +1762,10 @@ var Ys = class extends ke {
|
|
|
1762
1762
|
...e,
|
|
1763
1763
|
_defaulted: !0
|
|
1764
1764
|
};
|
|
1765
|
-
return t.queryHash || (t.queryHash =
|
|
1765
|
+
return t.queryHash || (t.queryHash = Dt(
|
|
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 === ze && (t.enabled = !1), t;
|
|
1769
1769
|
}
|
|
1770
1770
|
defaultMutationOptions(e) {
|
|
1771
1771
|
return e?._defaulted ? e : {
|
|
@@ -1778,10 +1778,10 @@ var Ys = class extends ke {
|
|
|
1778
1778
|
clear() {
|
|
1779
1779
|
this.#e.clear(), this.#t.clear();
|
|
1780
1780
|
}
|
|
1781
|
-
},
|
|
1781
|
+
}, xr = H.createContext(
|
|
1782
1782
|
void 0
|
|
1783
|
-
),
|
|
1784
|
-
const t = H.useContext(
|
|
1783
|
+
), nt = (e) => {
|
|
1784
|
+
const t = H.useContext(xr);
|
|
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 Ys = 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(xr.Provider, { value: e, children: t })), ea = H.createContext(!1), ta = () => H.useContext(ea);
|
|
1794
1794
|
function ra() {
|
|
1795
1795
|
let e = !1;
|
|
1796
1796
|
return {
|
|
@@ -1815,7 +1815,7 @@ var sa = H.createContext(ra()), aa = () => H.useContext(sa), na = (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 || Cr(r, [e.error, s])), ca = (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 sa = H.createContext(ra()), aa = () => H.useContext(sa), na = (e, t) => {
|
|
|
1823
1823
|
1e3
|
|
1824
1824
|
));
|
|
1825
1825
|
}
|
|
1826
|
-
}, la = (e, t) => e.isLoading && e.isFetching && !t, ua = (e, t) => e?.suspense && t.isPending,
|
|
1826
|
+
}, la = (e, t) => e.isLoading && e.isFetching && !t, ua = (e, t) => e?.suspense && t.isPending, ar = (e, t, r) => t.fetchOptimistic(e).catch(() => {
|
|
1827
1827
|
r.clearReset();
|
|
1828
1828
|
});
|
|
1829
1829
|
function da(e, t, r) {
|
|
@@ -1831,7 +1831,7 @@ function da(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 = ta(), a = aa(), n =
|
|
1834
|
+
const s = ta(), a = aa(), n = nt(), 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(
|
|
@@ -1856,7 +1856,7 @@ function da(e, t, r) {
|
|
|
1856
1856
|
), H.useEffect(() => {
|
|
1857
1857
|
c.setOptions(i);
|
|
1858
1858
|
}, [i, c]), ua(i, f))
|
|
1859
|
-
throw
|
|
1859
|
+
throw ar(i, c, a);
|
|
1860
1860
|
if (oa({
|
|
1861
1861
|
result: f,
|
|
1862
1862
|
errorResetBoundary: a,
|
|
@@ -1870,7 +1870,7 @@ function da(e, t, r) {
|
|
|
1870
1870
|
f
|
|
1871
1871
|
), i.experimental_prefetchInRender && !me && la(f, s) && (o ? (
|
|
1872
1872
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1873
|
-
|
|
1873
|
+
ar(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
|
|
@@ -1878,11 +1878,11 @@ function da(e, t, r) {
|
|
|
1878
1878
|
c.updateResult();
|
|
1879
1879
|
}), i.notifyOnChangeProps ? f : c.trackResult(f);
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1882
|
-
return da(e,
|
|
1881
|
+
function ye(e, t) {
|
|
1882
|
+
return da(e, Ws);
|
|
1883
1883
|
}
|
|
1884
|
-
function
|
|
1885
|
-
const r =
|
|
1884
|
+
function Dr(e, t) {
|
|
1885
|
+
const r = nt(), [s] = H.useState(
|
|
1886
1886
|
() => new Ys(
|
|
1887
1887
|
r,
|
|
1888
1888
|
e
|
|
@@ -1904,7 +1904,7 @@ function Ut(e, t) {
|
|
|
1904
1904
|
},
|
|
1905
1905
|
[s]
|
|
1906
1906
|
);
|
|
1907
|
-
if (a.error &&
|
|
1907
|
+
if (a.error && Cr(s.options.throwOnError, [a.error]))
|
|
1908
1908
|
throw a.error;
|
|
1909
1909
|
return { ...a, mutate: n, mutateAsync: a.mutate };
|
|
1910
1910
|
}
|
|
@@ -1925,7 +1925,7 @@ const Pe = {
|
|
|
1925
1925
|
CODE: "code",
|
|
1926
1926
|
REFRESH_TOKEN: "refresh_token",
|
|
1927
1927
|
PASSKEY: "passkey"
|
|
1928
|
-
},
|
|
1928
|
+
}, Mr = {
|
|
1929
1929
|
CLIENT_ID: "X-Auth-ClientId"
|
|
1930
1930
|
}, F = {
|
|
1931
1931
|
ALG: "RS256",
|
|
@@ -1948,7 +1948,7 @@ awIDAQAB
|
|
|
1948
1948
|
LOGOUT: "logout",
|
|
1949
1949
|
LOGIN: "login",
|
|
1950
1950
|
REFRESH: "refresh"
|
|
1951
|
-
},
|
|
1951
|
+
}, Fe = new TextEncoder(), Ce = new TextDecoder();
|
|
1952
1952
|
function fa(...e) {
|
|
1953
1953
|
const t = e.reduce((a, { length: n }) => a + n, 0), r = new Uint8Array(t);
|
|
1954
1954
|
let s = 0;
|
|
@@ -1966,24 +1966,24 @@ function Lr(e) {
|
|
|
1966
1966
|
}
|
|
1967
1967
|
function $e(e) {
|
|
1968
1968
|
if (Uint8Array.fromBase64)
|
|
1969
|
-
return Uint8Array.fromBase64(typeof e == "string" ? e :
|
|
1969
|
+
return Uint8Array.fromBase64(typeof e == "string" ? e : Ce.decode(e), {
|
|
1970
1970
|
alphabet: "base64url"
|
|
1971
1971
|
});
|
|
1972
1972
|
let t = e;
|
|
1973
|
-
t instanceof Uint8Array && (t =
|
|
1973
|
+
t instanceof Uint8Array && (t = Ce.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
1974
1974
|
try {
|
|
1975
1975
|
return Lr(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 ge = 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 ge {
|
|
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
|
+
}, nr = class extends ge {
|
|
1996
1996
|
static code = "ERR_JWT_EXPIRED";
|
|
1997
1997
|
code = "ERR_JWT_EXPIRED";
|
|
1998
1998
|
claim;
|
|
@@ -2001,32 +2001,30 @@ 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
|
-
}, ma = class extends
|
|
2004
|
+
}, ma = class extends ge {
|
|
2005
2005
|
static code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
2006
2006
|
code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
2007
|
-
},
|
|
2007
|
+
}, ae = class extends ge {
|
|
2008
2008
|
static code = "ERR_JOSE_NOT_SUPPORTED";
|
|
2009
2009
|
code = "ERR_JOSE_NOT_SUPPORTED";
|
|
2010
|
-
}
|
|
2011
|
-
class L extends be {
|
|
2010
|
+
}, L = class extends ge {
|
|
2012
2011
|
static code = "ERR_JWS_INVALID";
|
|
2013
2012
|
code = "ERR_JWS_INVALID";
|
|
2014
|
-
}
|
|
2015
|
-
let se = class extends be {
|
|
2013
|
+
}, re = class extends ge {
|
|
2016
2014
|
static code = "ERR_JWT_INVALID";
|
|
2017
2015
|
code = "ERR_JWT_INVALID";
|
|
2018
2016
|
};
|
|
2019
|
-
class pa extends
|
|
2017
|
+
class pa extends ge {
|
|
2020
2018
|
static code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
2021
2019
|
code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
2022
2020
|
constructor(t = "signature verification failed", r) {
|
|
2023
2021
|
super(t, r);
|
|
2024
2022
|
}
|
|
2025
2023
|
}
|
|
2026
|
-
function
|
|
2024
|
+
function X(e, t = "algorithm.name") {
|
|
2027
2025
|
return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
|
|
2028
2026
|
}
|
|
2029
|
-
function
|
|
2027
|
+
function Se(e, t) {
|
|
2030
2028
|
return e.name === t;
|
|
2031
2029
|
}
|
|
2032
2030
|
function ut(e) {
|
|
@@ -2053,54 +2051,54 @@ function ba(e, t, r) {
|
|
|
2053
2051
|
case "HS256":
|
|
2054
2052
|
case "HS384":
|
|
2055
2053
|
case "HS512": {
|
|
2056
|
-
if (!
|
|
2057
|
-
throw
|
|
2054
|
+
if (!Se(e.algorithm, "HMAC"))
|
|
2055
|
+
throw X("HMAC");
|
|
2058
2056
|
const s = parseInt(t.slice(2), 10);
|
|
2059
2057
|
if (ut(e.algorithm.hash) !== s)
|
|
2060
|
-
throw
|
|
2058
|
+
throw X(`SHA-${s}`, "algorithm.hash");
|
|
2061
2059
|
break;
|
|
2062
2060
|
}
|
|
2063
2061
|
case "RS256":
|
|
2064
2062
|
case "RS384":
|
|
2065
2063
|
case "RS512": {
|
|
2066
|
-
if (!
|
|
2067
|
-
throw
|
|
2064
|
+
if (!Se(e.algorithm, "RSASSA-PKCS1-v1_5"))
|
|
2065
|
+
throw X("RSASSA-PKCS1-v1_5");
|
|
2068
2066
|
const s = parseInt(t.slice(2), 10);
|
|
2069
2067
|
if (ut(e.algorithm.hash) !== s)
|
|
2070
|
-
throw
|
|
2068
|
+
throw X(`SHA-${s}`, "algorithm.hash");
|
|
2071
2069
|
break;
|
|
2072
2070
|
}
|
|
2073
2071
|
case "PS256":
|
|
2074
2072
|
case "PS384":
|
|
2075
2073
|
case "PS512": {
|
|
2076
|
-
if (!
|
|
2077
|
-
throw
|
|
2074
|
+
if (!Se(e.algorithm, "RSA-PSS"))
|
|
2075
|
+
throw X("RSA-PSS");
|
|
2078
2076
|
const s = parseInt(t.slice(2), 10);
|
|
2079
2077
|
if (ut(e.algorithm.hash) !== s)
|
|
2080
|
-
throw
|
|
2078
|
+
throw X(`SHA-${s}`, "algorithm.hash");
|
|
2081
2079
|
break;
|
|
2082
2080
|
}
|
|
2083
2081
|
case "Ed25519":
|
|
2084
2082
|
case "EdDSA": {
|
|
2085
|
-
if (!
|
|
2086
|
-
throw
|
|
2083
|
+
if (!Se(e.algorithm, "Ed25519"))
|
|
2084
|
+
throw X("Ed25519");
|
|
2087
2085
|
break;
|
|
2088
2086
|
}
|
|
2089
2087
|
case "ML-DSA-44":
|
|
2090
2088
|
case "ML-DSA-65":
|
|
2091
2089
|
case "ML-DSA-87": {
|
|
2092
|
-
if (!
|
|
2093
|
-
throw
|
|
2090
|
+
if (!Se(e.algorithm, t))
|
|
2091
|
+
throw X(t);
|
|
2094
2092
|
break;
|
|
2095
2093
|
}
|
|
2096
2094
|
case "ES256":
|
|
2097
2095
|
case "ES384":
|
|
2098
2096
|
case "ES512": {
|
|
2099
|
-
if (!
|
|
2100
|
-
throw
|
|
2097
|
+
if (!Se(e.algorithm, "ECDSA"))
|
|
2098
|
+
throw X("ECDSA");
|
|
2101
2099
|
const s = ya(t);
|
|
2102
2100
|
if (e.algorithm.namedCurve !== s)
|
|
2103
|
-
throw
|
|
2101
|
+
throw X(s, "algorithm.namedCurve");
|
|
2104
2102
|
break;
|
|
2105
2103
|
}
|
|
2106
2104
|
default:
|
|
@@ -2147,7 +2145,7 @@ const Gr = (e) => Hr(e) || Kr(e), wa = (...e) => {
|
|
|
2147
2145
|
function Sa(e) {
|
|
2148
2146
|
return typeof e == "object" && e !== null;
|
|
2149
2147
|
}
|
|
2150
|
-
const
|
|
2148
|
+
const De = (e) => {
|
|
2151
2149
|
if (!Sa(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
2152
2150
|
return !1;
|
|
2153
2151
|
if (Object.getPrototypeOf(e) === null)
|
|
@@ -2169,7 +2167,7 @@ const Me = (e) => {
|
|
|
2169
2167
|
if (e[r] !== t[r])
|
|
2170
2168
|
return !1;
|
|
2171
2169
|
return !0;
|
|
2172
|
-
}, Ta = (e) => ({ data: e, pos: 0 }),
|
|
2170
|
+
}, Ta = (e) => ({ data: e, pos: 0 }), Ze = (e) => {
|
|
2173
2171
|
const t = e.data[e.pos++];
|
|
2174
2172
|
if (t & 128) {
|
|
2175
2173
|
const r = t & 127;
|
|
@@ -2179,20 +2177,20 @@ const Me = (e) => {
|
|
|
2179
2177
|
return s;
|
|
2180
2178
|
}
|
|
2181
2179
|
return t;
|
|
2182
|
-
},
|
|
2180
|
+
}, et = (e, t, r) => {
|
|
2183
2181
|
if (e.data[e.pos++] !== t)
|
|
2184
2182
|
throw new Error(r);
|
|
2185
2183
|
}, Br = (e, t) => {
|
|
2186
2184
|
const r = e.data.subarray(e.pos, e.pos + t);
|
|
2187
2185
|
return e.pos += t, r;
|
|
2188
2186
|
}, Aa = (e) => {
|
|
2189
|
-
|
|
2190
|
-
const t =
|
|
2187
|
+
et(e, 6, "Expected algorithm OID");
|
|
2188
|
+
const t = Ze(e);
|
|
2191
2189
|
return Br(e, t);
|
|
2192
2190
|
};
|
|
2193
2191
|
function Ia(e) {
|
|
2194
|
-
|
|
2195
|
-
const t =
|
|
2192
|
+
et(e, 48, "Invalid SPKI structure"), Ze(e), et(e, 48, "Expected algorithm identifier");
|
|
2193
|
+
const t = Ze(e);
|
|
2196
2194
|
return { algIdStart: e.pos, algIdLength: t };
|
|
2197
2195
|
}
|
|
2198
2196
|
const _a = (e) => {
|
|
@@ -2201,8 +2199,8 @@ const _a = (e) => {
|
|
|
2201
2199
|
return "X25519";
|
|
2202
2200
|
if (!dt(t, [42, 134, 72, 206, 61, 2, 1]))
|
|
2203
2201
|
throw new Error("Unsupported key algorithm");
|
|
2204
|
-
|
|
2205
|
-
const r =
|
|
2202
|
+
et(e, 6, "Expected curve OID");
|
|
2203
|
+
const r = Ze(e), s = Br(e, r);
|
|
2206
2204
|
for (const { name: a, oid: n } of [
|
|
2207
2205
|
{ name: "P-256", oid: [42, 134, 72, 206, 61, 3, 1, 7] },
|
|
2208
2206
|
{ name: "P-384", oid: [43, 129, 4, 0, 34] },
|
|
@@ -2248,7 +2246,7 @@ const _a = (e) => {
|
|
|
2248
2246
|
const c = s.getNamedCurve(t);
|
|
2249
2247
|
a = c === "X25519" ? { name: "X25519" } : { name: "ECDH", namedCurve: c };
|
|
2250
2248
|
} catch {
|
|
2251
|
-
throw new
|
|
2249
|
+
throw new ae("Invalid or unsupported key format");
|
|
2252
2250
|
}
|
|
2253
2251
|
n = [];
|
|
2254
2252
|
break;
|
|
@@ -2263,7 +2261,7 @@ const _a = (e) => {
|
|
|
2263
2261
|
a = { name: r }, n = i();
|
|
2264
2262
|
break;
|
|
2265
2263
|
default:
|
|
2266
|
-
throw new
|
|
2264
|
+
throw new ae('Invalid or unsupported "alg" (Algorithm) value');
|
|
2267
2265
|
}
|
|
2268
2266
|
return crypto.subtle.importKey(e, t, a, s?.extractable ?? !0, n);
|
|
2269
2267
|
}, Ca = (e, t) => Lr(e.replace(t, "")), Oa = (e, t, r) => {
|
|
@@ -2285,7 +2283,7 @@ function ka(e) {
|
|
|
2285
2283
|
t = { name: e.alg }, r = e.priv ? ["sign"] : ["verify"];
|
|
2286
2284
|
break;
|
|
2287
2285
|
default:
|
|
2288
|
-
throw new
|
|
2286
|
+
throw new ae('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
2289
2287
|
}
|
|
2290
2288
|
break;
|
|
2291
2289
|
}
|
|
@@ -2311,7 +2309,7 @@ function ka(e) {
|
|
|
2311
2309
|
}, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
|
|
2312
2310
|
break;
|
|
2313
2311
|
default:
|
|
2314
|
-
throw new
|
|
2312
|
+
throw new ae('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
2315
2313
|
}
|
|
2316
2314
|
break;
|
|
2317
2315
|
}
|
|
@@ -2333,7 +2331,7 @@ function ka(e) {
|
|
|
2333
2331
|
t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
2334
2332
|
break;
|
|
2335
2333
|
default:
|
|
2336
|
-
throw new
|
|
2334
|
+
throw new ae('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
2337
2335
|
}
|
|
2338
2336
|
break;
|
|
2339
2337
|
}
|
|
@@ -2350,12 +2348,12 @@ function ka(e) {
|
|
|
2350
2348
|
t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
2351
2349
|
break;
|
|
2352
2350
|
default:
|
|
2353
|
-
throw new
|
|
2351
|
+
throw new ae('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
2354
2352
|
}
|
|
2355
2353
|
break;
|
|
2356
2354
|
}
|
|
2357
2355
|
default:
|
|
2358
|
-
throw new
|
|
2356
|
+
throw new ae('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
|
2359
2357
|
}
|
|
2360
2358
|
return { algorithm: t, keyUsages: r };
|
|
2361
2359
|
}
|
|
@@ -2381,7 +2379,7 @@ const $a = (e, t, r, s, a) => {
|
|
|
2381
2379
|
r !== void 0 ? n = new Map([...Object.entries(r), ...t.entries()]) : n = t;
|
|
2382
2380
|
for (const i of s.crit) {
|
|
2383
2381
|
if (!n.has(i))
|
|
2384
|
-
throw new
|
|
2382
|
+
throw new ae(`Extension Header Parameter "${i}" is not recognized`);
|
|
2385
2383
|
if (a[i] === void 0)
|
|
2386
2384
|
throw new e(`Extension Header Parameter "${i}" is missing`);
|
|
2387
2385
|
if (n.get(i) && s[i] === void 0)
|
|
@@ -2394,29 +2392,29 @@ const $a = (e, t, r, s, a) => {
|
|
|
2394
2392
|
if (t)
|
|
2395
2393
|
return new Set(t);
|
|
2396
2394
|
};
|
|
2397
|
-
function
|
|
2398
|
-
return
|
|
2395
|
+
function Ut(e) {
|
|
2396
|
+
return De(e) && typeof e.kty == "string";
|
|
2399
2397
|
}
|
|
2400
|
-
function
|
|
2398
|
+
function Da(e) {
|
|
2401
2399
|
return e.kty !== "oct" && (e.kty === "AKP" && typeof e.priv == "string" || typeof e.d == "string");
|
|
2402
2400
|
}
|
|
2403
|
-
function
|
|
2401
|
+
function Ma(e) {
|
|
2404
2402
|
return e.kty !== "oct" && typeof e.d > "u" && typeof e.priv > "u";
|
|
2405
2403
|
}
|
|
2406
2404
|
function La(e) {
|
|
2407
2405
|
return e.kty === "oct" && typeof e.k == "string";
|
|
2408
2406
|
}
|
|
2409
|
-
let
|
|
2410
|
-
const
|
|
2411
|
-
|
|
2412
|
-
let a =
|
|
2407
|
+
let Re;
|
|
2408
|
+
const ir = async (e, t, r, s = !1) => {
|
|
2409
|
+
Re ||= /* @__PURE__ */ new WeakMap();
|
|
2410
|
+
let a = Re.get(e);
|
|
2413
2411
|
if (a?.[r])
|
|
2414
2412
|
return a[r];
|
|
2415
2413
|
const n = await Na({ ...t, alg: r });
|
|
2416
|
-
return s && Object.freeze(e), a ? a[r] = n :
|
|
2414
|
+
return s && Object.freeze(e), a ? a[r] = n : Re.set(e, { [r]: n }), n;
|
|
2417
2415
|
}, Ua = (e, t) => {
|
|
2418
|
-
|
|
2419
|
-
let r =
|
|
2416
|
+
Re ||= /* @__PURE__ */ new WeakMap();
|
|
2417
|
+
let r = Re.get(e);
|
|
2420
2418
|
if (r?.[t])
|
|
2421
2419
|
return r[t];
|
|
2422
2420
|
const s = e.type === "public", a = !!s;
|
|
@@ -2509,7 +2507,7 @@ const or = async (e, t, r, s = !1) => {
|
|
|
2509
2507
|
}
|
|
2510
2508
|
if (!n)
|
|
2511
2509
|
throw new TypeError("given KeyObject instance cannot be used for this algorithm");
|
|
2512
|
-
return r ? r[t] = n :
|
|
2510
|
+
return r ? r[t] = n : Re.set(e, { [t]: n }), n;
|
|
2513
2511
|
}, Fa = async (e, t) => {
|
|
2514
2512
|
if (e instanceof Uint8Array || Hr(e))
|
|
2515
2513
|
return e;
|
|
@@ -2524,12 +2522,12 @@ const or = async (e, t, r, s = !1) => {
|
|
|
2524
2522
|
throw s;
|
|
2525
2523
|
}
|
|
2526
2524
|
let r = e.export({ format: "jwk" });
|
|
2527
|
-
return
|
|
2525
|
+
return ir(e, r, t);
|
|
2528
2526
|
}
|
|
2529
|
-
if (
|
|
2530
|
-
return e.k ? $e(e.k) :
|
|
2527
|
+
if (Ut(e))
|
|
2528
|
+
return e.k ? $e(e.k) : ir(e, e, t, !0);
|
|
2531
2529
|
throw new Error("unreachable");
|
|
2532
|
-
},
|
|
2530
|
+
}, _e = (e) => e?.[Symbol.toStringTag], kt = (e, t, r) => {
|
|
2533
2531
|
if (t.use !== void 0) {
|
|
2534
2532
|
let s;
|
|
2535
2533
|
switch (r) {
|
|
@@ -2574,7 +2572,7 @@ const or = async (e, t, r, s = !1) => {
|
|
|
2574
2572
|
return !0;
|
|
2575
2573
|
}, Ha = (e, t, r) => {
|
|
2576
2574
|
if (!(t instanceof Uint8Array)) {
|
|
2577
|
-
if (
|
|
2575
|
+
if (Ut(t)) {
|
|
2578
2576
|
if (La(t) && kt(e, t, r))
|
|
2579
2577
|
return;
|
|
2580
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');
|
|
@@ -2582,39 +2580,39 @@ const or = async (e, t, r, s = !1) => {
|
|
|
2582
2580
|
if (!Gr(t))
|
|
2583
2581
|
throw new TypeError(Fr(e, t, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array"));
|
|
2584
2582
|
if (t.type !== "secret")
|
|
2585
|
-
throw new TypeError(`${
|
|
2583
|
+
throw new TypeError(`${_e(t)} instances for symmetric algorithms must be of type "secret"`);
|
|
2586
2584
|
}
|
|
2587
2585
|
}, Ka = (e, t, r) => {
|
|
2588
|
-
if (
|
|
2586
|
+
if (Ut(t))
|
|
2589
2587
|
switch (r) {
|
|
2590
2588
|
case "decrypt":
|
|
2591
2589
|
case "sign":
|
|
2592
|
-
if (
|
|
2590
|
+
if (Da(t) && kt(e, t, r))
|
|
2593
2591
|
return;
|
|
2594
2592
|
throw new TypeError("JSON Web Key for this operation be a private JWK");
|
|
2595
2593
|
case "encrypt":
|
|
2596
2594
|
case "verify":
|
|
2597
|
-
if (
|
|
2595
|
+
if (Ma(t) && kt(e, t, r))
|
|
2598
2596
|
return;
|
|
2599
2597
|
throw new TypeError("JSON Web Key for this operation be a public JWK");
|
|
2600
2598
|
}
|
|
2601
2599
|
if (!Gr(t))
|
|
2602
2600
|
throw new TypeError(Fr(e, t, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
2603
2601
|
if (t.type === "secret")
|
|
2604
|
-
throw new TypeError(`${
|
|
2602
|
+
throw new TypeError(`${_e(t)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
2605
2603
|
if (t.type === "public")
|
|
2606
2604
|
switch (r) {
|
|
2607
2605
|
case "sign":
|
|
2608
|
-
throw new TypeError(`${
|
|
2606
|
+
throw new TypeError(`${_e(t)} instances for asymmetric algorithm signing must be of type "private"`);
|
|
2609
2607
|
case "decrypt":
|
|
2610
|
-
throw new TypeError(`${
|
|
2608
|
+
throw new TypeError(`${_e(t)} instances for asymmetric algorithm decryption must be of type "private"`);
|
|
2611
2609
|
}
|
|
2612
2610
|
if (t.type === "private")
|
|
2613
2611
|
switch (r) {
|
|
2614
2612
|
case "verify":
|
|
2615
|
-
throw new TypeError(`${
|
|
2613
|
+
throw new TypeError(`${_e(t)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
2616
2614
|
case "encrypt":
|
|
2617
|
-
throw new TypeError(`${
|
|
2615
|
+
throw new TypeError(`${_e(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
2618
2616
|
}
|
|
2619
2617
|
}, Ga = (e, t, r) => {
|
|
2620
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) ? Ha(e, t, r) : Ka(e, t, r);
|
|
@@ -2645,17 +2643,17 @@ const or = async (e, t, r, s = !1) => {
|
|
|
2645
2643
|
case "ML-DSA-87":
|
|
2646
2644
|
return { name: e };
|
|
2647
2645
|
default:
|
|
2648
|
-
throw new
|
|
2646
|
+
throw new ae(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
2649
2647
|
}
|
|
2650
|
-
},
|
|
2648
|
+
}, Wa = async (e, t, r) => {
|
|
2651
2649
|
if (t instanceof Uint8Array) {
|
|
2652
2650
|
if (!e.startsWith("HS"))
|
|
2653
2651
|
throw new TypeError(Ea(t, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
2654
2652
|
return crypto.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
|
|
2655
2653
|
}
|
|
2656
2654
|
return ba(t, e, r), t;
|
|
2657
|
-
},
|
|
2658
|
-
const a = await
|
|
2655
|
+
}, qa = async (e, t, r, s) => {
|
|
2656
|
+
const a = await Wa(e, t, "verify");
|
|
2659
2657
|
va(e, a);
|
|
2660
2658
|
const n = Ba(e, a.algorithm);
|
|
2661
2659
|
try {
|
|
@@ -2665,7 +2663,7 @@ const or = async (e, t, r, s = !1) => {
|
|
|
2665
2663
|
}
|
|
2666
2664
|
};
|
|
2667
2665
|
async function ja(e, t, r) {
|
|
2668
|
-
if (!
|
|
2666
|
+
if (!De(e))
|
|
2669
2667
|
throw new L("Flattened JWS must be an object");
|
|
2670
2668
|
if (e.protected === void 0 && e.header === void 0)
|
|
2671
2669
|
throw new L('Flattened JWS must have either of the "protected" or "header" members');
|
|
@@ -2675,13 +2673,13 @@ async function ja(e, t, r) {
|
|
|
2675
2673
|
throw new L("JWS Payload missing");
|
|
2676
2674
|
if (typeof e.signature != "string")
|
|
2677
2675
|
throw new L("JWS Signature missing or incorrect type");
|
|
2678
|
-
if (e.header !== void 0 && !
|
|
2676
|
+
if (e.header !== void 0 && !De(e.header))
|
|
2679
2677
|
throw new L("JWS Unprotected Header incorrect type");
|
|
2680
2678
|
let s = {};
|
|
2681
2679
|
if (e.protected)
|
|
2682
2680
|
try {
|
|
2683
2681
|
const g = $e(e.protected);
|
|
2684
|
-
s = JSON.parse(
|
|
2682
|
+
s = JSON.parse(Ce.decode(g));
|
|
2685
2683
|
} catch {
|
|
2686
2684
|
throw new L("JWS Protected Header is invalid");
|
|
2687
2685
|
}
|
|
@@ -2707,7 +2705,7 @@ async function ja(e, t, r) {
|
|
|
2707
2705
|
throw new L("JWS Payload must be a string or an Uint8Array instance");
|
|
2708
2706
|
let f = !1;
|
|
2709
2707
|
typeof t == "function" && (t = await t(s, e), f = !0), Ga(o, t, "verify");
|
|
2710
|
-
const d = fa(
|
|
2708
|
+
const d = fa(Fe.encode(e.protected ?? ""), Fe.encode("."), typeof e.payload == "string" ? Fe.encode(e.payload) : e.payload);
|
|
2711
2709
|
let u;
|
|
2712
2710
|
try {
|
|
2713
2711
|
u = $e(e.signature);
|
|
@@ -2715,7 +2713,7 @@ async function ja(e, t, r) {
|
|
|
2715
2713
|
throw new L("Failed to base64url decode the signature");
|
|
2716
2714
|
}
|
|
2717
2715
|
const l = await Fa(t, o);
|
|
2718
|
-
if (!await
|
|
2716
|
+
if (!await qa(o, l, u, d))
|
|
2719
2717
|
throw new pa();
|
|
2720
2718
|
let m;
|
|
2721
2719
|
if (i)
|
|
@@ -2724,12 +2722,12 @@ async function ja(e, t, r) {
|
|
|
2724
2722
|
} catch {
|
|
2725
2723
|
throw new L("Failed to base64url decode the payload");
|
|
2726
2724
|
}
|
|
2727
|
-
else typeof e.payload == "string" ? m =
|
|
2725
|
+
else typeof e.payload == "string" ? m = Fe.encode(e.payload) : m = e.payload;
|
|
2728
2726
|
const p = { payload: m };
|
|
2729
2727
|
return e.protected !== void 0 && (p.protectedHeader = s), e.header !== void 0 && (p.unprotectedHeader = e.header), f ? { ...p, key: l } : p;
|
|
2730
2728
|
}
|
|
2731
2729
|
async function Va(e, t, r) {
|
|
2732
|
-
if (e instanceof Uint8Array && (e =
|
|
2730
|
+
if (e instanceof Uint8Array && (e = Ce.decode(e)), typeof e != "string")
|
|
2733
2731
|
throw new L("Compact JWS must be a string or Uint8Array");
|
|
2734
2732
|
const { 0: s, 1: a, 2: n, length: i } = e.split(".");
|
|
2735
2733
|
if (i !== 3)
|
|
@@ -2737,7 +2735,7 @@ async function Va(e, t, r) {
|
|
|
2737
2735
|
const o = await ja({ payload: a, protected: s, signature: n }, t, r), c = { payload: o.payload, protectedHeader: o.protectedHeader };
|
|
2738
2736
|
return typeof t == "function" ? { ...c, key: o.key } : c;
|
|
2739
2737
|
}
|
|
2740
|
-
const
|
|
2738
|
+
const Ja = (e) => Math.floor(e.getTime() / 1e3), Wr = 60, qr = Wr * 60, Ft = qr * 24, Qa = Ft * 7, Ya = Ft * 365.25, za = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, or = (e) => {
|
|
2741
2739
|
const t = za.exec(e);
|
|
2742
2740
|
if (!t || t[4] && t[1])
|
|
2743
2741
|
throw new TypeError("Invalid time period format");
|
|
@@ -2756,57 +2754,57 @@ const Qa = (e) => Math.floor(e.getTime() / 1e3), qr = 60, Wr = qr * 60, Ht = Wr
|
|
|
2756
2754
|
case "min":
|
|
2757
2755
|
case "mins":
|
|
2758
2756
|
case "m":
|
|
2759
|
-
a = Math.round(r *
|
|
2757
|
+
a = Math.round(r * Wr);
|
|
2760
2758
|
break;
|
|
2761
2759
|
case "hour":
|
|
2762
2760
|
case "hours":
|
|
2763
2761
|
case "hr":
|
|
2764
2762
|
case "hrs":
|
|
2765
2763
|
case "h":
|
|
2766
|
-
a = Math.round(r *
|
|
2764
|
+
a = Math.round(r * qr);
|
|
2767
2765
|
break;
|
|
2768
2766
|
case "day":
|
|
2769
2767
|
case "days":
|
|
2770
2768
|
case "d":
|
|
2771
|
-
a = Math.round(r *
|
|
2769
|
+
a = Math.round(r * Ft);
|
|
2772
2770
|
break;
|
|
2773
2771
|
case "week":
|
|
2774
2772
|
case "weeks":
|
|
2775
2773
|
case "w":
|
|
2776
|
-
a = Math.round(r *
|
|
2774
|
+
a = Math.round(r * Qa);
|
|
2777
2775
|
break;
|
|
2778
2776
|
default:
|
|
2779
2777
|
a = Math.round(r * Ya);
|
|
2780
2778
|
break;
|
|
2781
2779
|
}
|
|
2782
2780
|
return t[1] === "-" || t[4] === "ago" ? -a : a;
|
|
2783
|
-
},
|
|
2781
|
+
}, cr = (e) => e.includes("/") ? e.toLowerCase() : `application/${e.toLowerCase()}`, Xa = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1;
|
|
2784
2782
|
function Za(e, t, r = {}) {
|
|
2785
2783
|
let s;
|
|
2786
2784
|
try {
|
|
2787
|
-
s = JSON.parse(
|
|
2785
|
+
s = JSON.parse(Ce.decode(t));
|
|
2788
2786
|
} catch {
|
|
2789
2787
|
}
|
|
2790
|
-
if (!
|
|
2791
|
-
throw new
|
|
2788
|
+
if (!De(s))
|
|
2789
|
+
throw new re("JWT Claims Set must be a top-level JSON object");
|
|
2792
2790
|
const { typ: a } = r;
|
|
2793
|
-
if (a && (typeof e.typ != "string" ||
|
|
2794
|
-
throw new
|
|
2791
|
+
if (a && (typeof e.typ != "string" || cr(e.typ) !== cr(a)))
|
|
2792
|
+
throw new z('unexpected "typ" JWT header value', s, "typ", "check_failed");
|
|
2795
2793
|
const { requiredClaims: n = [], issuer: i, subject: o, audience: c, maxTokenAge: f } = r, d = [...n];
|
|
2796
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");
|
|
2797
2795
|
for (const p of new Set(d.reverse()))
|
|
2798
2796
|
if (!(p in s))
|
|
2799
|
-
throw new
|
|
2797
|
+
throw new z(`missing required "${p}" claim`, s, p, "missing");
|
|
2800
2798
|
if (i && !(Array.isArray(i) ? i : [i]).includes(s.iss))
|
|
2801
|
-
throw new
|
|
2799
|
+
throw new z('unexpected "iss" claim value', s, "iss", "check_failed");
|
|
2802
2800
|
if (o && s.sub !== o)
|
|
2803
|
-
throw new
|
|
2801
|
+
throw new z('unexpected "sub" claim value', s, "sub", "check_failed");
|
|
2804
2802
|
if (c && !Xa(s.aud, typeof c == "string" ? [c] : c))
|
|
2805
|
-
throw new
|
|
2803
|
+
throw new z('unexpected "aud" claim value', s, "aud", "check_failed");
|
|
2806
2804
|
let u;
|
|
2807
2805
|
switch (typeof r.clockTolerance) {
|
|
2808
2806
|
case "string":
|
|
2809
|
-
u =
|
|
2807
|
+
u = or(r.clockTolerance);
|
|
2810
2808
|
break;
|
|
2811
2809
|
case "number":
|
|
2812
2810
|
u = r.clockTolerance;
|
|
@@ -2817,64 +2815,64 @@ function Za(e, t, r = {}) {
|
|
|
2817
2815
|
default:
|
|
2818
2816
|
throw new TypeError("Invalid clockTolerance option type");
|
|
2819
2817
|
}
|
|
2820
|
-
const { currentDate: l } = r, m =
|
|
2818
|
+
const { currentDate: l } = r, m = Ja(l || /* @__PURE__ */ new Date());
|
|
2821
2819
|
if ((s.iat !== void 0 || f) && typeof s.iat != "number")
|
|
2822
|
-
throw new
|
|
2820
|
+
throw new z('"iat" claim must be a number', s, "iat", "invalid");
|
|
2823
2821
|
if (s.nbf !== void 0) {
|
|
2824
2822
|
if (typeof s.nbf != "number")
|
|
2825
|
-
throw new
|
|
2823
|
+
throw new z('"nbf" claim must be a number', s, "nbf", "invalid");
|
|
2826
2824
|
if (s.nbf > m + u)
|
|
2827
|
-
throw new
|
|
2825
|
+
throw new z('"nbf" claim timestamp check failed', s, "nbf", "check_failed");
|
|
2828
2826
|
}
|
|
2829
2827
|
if (s.exp !== void 0) {
|
|
2830
2828
|
if (typeof s.exp != "number")
|
|
2831
|
-
throw new
|
|
2829
|
+
throw new z('"exp" claim must be a number', s, "exp", "invalid");
|
|
2832
2830
|
if (s.exp <= m - u)
|
|
2833
|
-
throw new
|
|
2831
|
+
throw new nr('"exp" claim timestamp check failed', s, "exp", "check_failed");
|
|
2834
2832
|
}
|
|
2835
2833
|
if (f) {
|
|
2836
|
-
const p = m - s.iat, g = typeof f == "number" ? f :
|
|
2834
|
+
const p = m - s.iat, g = typeof f == "number" ? f : or(f);
|
|
2837
2835
|
if (p - u > g)
|
|
2838
|
-
throw new
|
|
2836
|
+
throw new nr('"iat" claim timestamp check failed (too far in the past)', s, "iat", "check_failed");
|
|
2839
2837
|
if (p < 0 - u)
|
|
2840
|
-
throw new
|
|
2838
|
+
throw new z('"iat" claim timestamp check failed (it should be in the past)', s, "iat", "check_failed");
|
|
2841
2839
|
}
|
|
2842
2840
|
return s;
|
|
2843
2841
|
}
|
|
2844
2842
|
async function en(e, t, r) {
|
|
2845
2843
|
const s = await Va(e, t, r);
|
|
2846
2844
|
if (s.protectedHeader.crit?.includes("b64") && s.protectedHeader.b64 === !1)
|
|
2847
|
-
throw new
|
|
2845
|
+
throw new re("JWTs MUST NOT use unencoded payload");
|
|
2848
2846
|
const a = { payload: Za(s.protectedHeader, s.payload, r), protectedHeader: s.protectedHeader };
|
|
2849
2847
|
return typeof t == "function" ? { ...a, key: s.key } : a;
|
|
2850
2848
|
}
|
|
2851
2849
|
function tn(e) {
|
|
2852
2850
|
if (typeof e != "string")
|
|
2853
|
-
throw new
|
|
2851
|
+
throw new re("JWTs must use Compact JWS serialization, JWT must be a string");
|
|
2854
2852
|
const { 1: t, length: r } = e.split(".");
|
|
2855
2853
|
if (r === 5)
|
|
2856
|
-
throw new
|
|
2854
|
+
throw new re("Only JWTs using Compact JWS serialization can be decoded");
|
|
2857
2855
|
if (r !== 3)
|
|
2858
|
-
throw new
|
|
2856
|
+
throw new re("Invalid JWT");
|
|
2859
2857
|
if (!t)
|
|
2860
|
-
throw new
|
|
2858
|
+
throw new re("JWTs must contain a payload");
|
|
2861
2859
|
let s;
|
|
2862
2860
|
try {
|
|
2863
2861
|
s = $e(t);
|
|
2864
2862
|
} catch {
|
|
2865
|
-
throw new
|
|
2863
|
+
throw new re("Failed to base64url decode the payload");
|
|
2866
2864
|
}
|
|
2867
2865
|
let a;
|
|
2868
2866
|
try {
|
|
2869
|
-
a = JSON.parse(
|
|
2867
|
+
a = JSON.parse(Ce.decode(s));
|
|
2870
2868
|
} catch {
|
|
2871
|
-
throw new
|
|
2869
|
+
throw new re("Failed to parse the decoded payload as JSON");
|
|
2872
2870
|
}
|
|
2873
|
-
if (!
|
|
2874
|
-
throw new
|
|
2871
|
+
if (!De(a))
|
|
2872
|
+
throw new re("Invalid JWT Claims Set");
|
|
2875
2873
|
return a;
|
|
2876
2874
|
}
|
|
2877
|
-
const
|
|
2875
|
+
const Me = async (e) => {
|
|
2878
2876
|
try {
|
|
2879
2877
|
const t = F.ALG, r = await Pa(ha, t);
|
|
2880
2878
|
return await en(e, r, {
|
|
@@ -2889,11 +2887,11 @@ const De = async (e) => {
|
|
|
2889
2887
|
} catch {
|
|
2890
2888
|
return;
|
|
2891
2889
|
}
|
|
2892
|
-
},
|
|
2890
|
+
}, D = [];
|
|
2893
2891
|
for (let e = 0; e < 256; ++e)
|
|
2894
|
-
|
|
2892
|
+
D.push((e + 256).toString(16).slice(1));
|
|
2895
2893
|
function sn(e, t = 0) {
|
|
2896
|
-
return (
|
|
2894
|
+
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();
|
|
2897
2895
|
}
|
|
2898
2896
|
let ht;
|
|
2899
2897
|
const an = new Uint8Array(16);
|
|
@@ -2905,25 +2903,25 @@ function nn() {
|
|
|
2905
2903
|
}
|
|
2906
2904
|
return ht(an);
|
|
2907
2905
|
}
|
|
2908
|
-
const on = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
2909
|
-
function
|
|
2910
|
-
if (
|
|
2911
|
-
return
|
|
2906
|
+
const on = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), lr = { randomUUID: on };
|
|
2907
|
+
function ur(e, t, r) {
|
|
2908
|
+
if (lr.randomUUID && !e)
|
|
2909
|
+
return lr.randomUUID();
|
|
2912
2910
|
e = e || {};
|
|
2913
2911
|
const s = e.random ?? e.rng?.() ?? nn();
|
|
2914
2912
|
if (s.length < 16)
|
|
2915
2913
|
throw new Error("Random bytes length must be >= 16");
|
|
2916
2914
|
return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, sn(s);
|
|
2917
2915
|
}
|
|
2918
|
-
const
|
|
2916
|
+
const dr = globalThis.crypto, cn = (e) => `${ur()}${ur()}`.slice(0, e), ln = (e) => btoa(
|
|
2919
2917
|
[...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
|
|
2920
2918
|
);
|
|
2921
2919
|
async function un(e) {
|
|
2922
|
-
if (!
|
|
2920
|
+
if (!dr.subtle)
|
|
2923
2921
|
throw new Error(
|
|
2924
2922
|
"crypto.subtle is available only in secure contexts (HTTPS)."
|
|
2925
2923
|
);
|
|
2926
|
-
const t = new TextEncoder().encode(e), r = await
|
|
2924
|
+
const t = new TextEncoder().encode(e), r = await dr.subtle.digest("SHA-256", t);
|
|
2927
2925
|
return ln(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
2928
2926
|
}
|
|
2929
2927
|
async function dn(e) {
|
|
@@ -2948,20 +2946,20 @@ try {
|
|
|
2948
2946
|
});
|
|
2949
2947
|
} catch {
|
|
2950
2948
|
}
|
|
2951
|
-
function
|
|
2949
|
+
function Z(e) {
|
|
2952
2950
|
const t = new Uint8Array(e);
|
|
2953
2951
|
let r = "";
|
|
2954
2952
|
for (const s of t)
|
|
2955
2953
|
r += String.fromCharCode(s);
|
|
2956
2954
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2957
2955
|
}
|
|
2958
|
-
function
|
|
2956
|
+
function tt(e) {
|
|
2959
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);
|
|
2960
2958
|
for (let o = 0; o < a.length; o++)
|
|
2961
2959
|
i[o] = a.charCodeAt(o);
|
|
2962
2960
|
return n;
|
|
2963
2961
|
}
|
|
2964
|
-
function
|
|
2962
|
+
function Ht() {
|
|
2965
2963
|
return mn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2966
2964
|
}
|
|
2967
2965
|
const mn = {
|
|
@@ -2971,7 +2969,7 @@ function Vr(e) {
|
|
|
2971
2969
|
const { id: t } = e;
|
|
2972
2970
|
return {
|
|
2973
2971
|
...e,
|
|
2974
|
-
id:
|
|
2972
|
+
id: tt(t),
|
|
2975
2973
|
/**
|
|
2976
2974
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2977
2975
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2980,7 +2978,7 @@ function Vr(e) {
|
|
|
2980
2978
|
transports: e.transports
|
|
2981
2979
|
};
|
|
2982
2980
|
}
|
|
2983
|
-
function
|
|
2981
|
+
function Jr(e) {
|
|
2984
2982
|
return (
|
|
2985
2983
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2986
2984
|
e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)
|
|
@@ -3054,7 +3052,7 @@ function pn({ error: e, options: t }) {
|
|
|
3054
3052
|
});
|
|
3055
3053
|
if (e.name === "SecurityError") {
|
|
3056
3054
|
const s = globalThis.location.hostname;
|
|
3057
|
-
if (
|
|
3055
|
+
if (Jr(s)) {
|
|
3058
3056
|
if (r.rp.id !== s)
|
|
3059
3057
|
return new U({
|
|
3060
3058
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
@@ -3106,7 +3104,7 @@ class yn {
|
|
|
3106
3104
|
}
|
|
3107
3105
|
}
|
|
3108
3106
|
}
|
|
3109
|
-
const
|
|
3107
|
+
const Qr = new yn(), gn = ["cross-platform", "platform"];
|
|
3110
3108
|
function Yr(e) {
|
|
3111
3109
|
if (e && !(gn.indexOf(e) < 0))
|
|
3112
3110
|
return e;
|
|
@@ -3114,18 +3112,18 @@ function Yr(e) {
|
|
|
3114
3112
|
async function bn(e) {
|
|
3115
3113
|
!e.optionsJSON && e.challenge && (console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), e = { optionsJSON: e });
|
|
3116
3114
|
const { optionsJSON: t, useAutoRegister: r = !1 } = e;
|
|
3117
|
-
if (!
|
|
3115
|
+
if (!Ht())
|
|
3118
3116
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3119
3117
|
const s = {
|
|
3120
3118
|
...t,
|
|
3121
|
-
challenge:
|
|
3119
|
+
challenge: tt(t.challenge),
|
|
3122
3120
|
user: {
|
|
3123
3121
|
...t.user,
|
|
3124
|
-
id:
|
|
3122
|
+
id: tt(t.user.id)
|
|
3125
3123
|
},
|
|
3126
3124
|
excludeCredentials: t.excludeCredentials?.map(Vr)
|
|
3127
3125
|
}, a = {};
|
|
3128
|
-
r && (a.mediation = "conditional"), a.publicKey = s, a.signal =
|
|
3126
|
+
r && (a.mediation = "conditional"), a.publicKey = s, a.signal = Qr.createNewAbortSignal();
|
|
3129
3127
|
let n;
|
|
3130
3128
|
try {
|
|
3131
3129
|
n = await navigator.credentials.create(a);
|
|
@@ -3148,23 +3146,23 @@ async function bn(e) {
|
|
|
3148
3146
|
if (typeof c.getPublicKey == "function")
|
|
3149
3147
|
try {
|
|
3150
3148
|
const p = c.getPublicKey();
|
|
3151
|
-
p !== null && (l =
|
|
3149
|
+
p !== null && (l = Z(p));
|
|
3152
3150
|
} catch (p) {
|
|
3153
3151
|
mt("getPublicKey()", p);
|
|
3154
3152
|
}
|
|
3155
3153
|
let m;
|
|
3156
3154
|
if (typeof c.getAuthenticatorData == "function")
|
|
3157
3155
|
try {
|
|
3158
|
-
m =
|
|
3156
|
+
m = Z(c.getAuthenticatorData());
|
|
3159
3157
|
} catch (p) {
|
|
3160
3158
|
mt("getAuthenticatorData()", p);
|
|
3161
3159
|
}
|
|
3162
3160
|
return {
|
|
3163
3161
|
id: i,
|
|
3164
|
-
rawId:
|
|
3162
|
+
rawId: Z(o),
|
|
3165
3163
|
response: {
|
|
3166
|
-
attestationObject:
|
|
3167
|
-
clientDataJSON:
|
|
3164
|
+
attestationObject: Z(c.attestationObject),
|
|
3165
|
+
clientDataJSON: Z(c.clientDataJSON),
|
|
3168
3166
|
transports: d,
|
|
3169
3167
|
publicKeyAlgorithm: u,
|
|
3170
3168
|
publicKey: l,
|
|
@@ -3180,7 +3178,7 @@ function mt(e, t) {
|
|
|
3180
3178
|
`, t);
|
|
3181
3179
|
}
|
|
3182
3180
|
function En() {
|
|
3183
|
-
if (!
|
|
3181
|
+
if (!Ht())
|
|
3184
3182
|
return pt.stubThis(new Promise((t) => t(!1)));
|
|
3185
3183
|
const e = globalThis.PublicKeyCredential;
|
|
3186
3184
|
return e?.isConditionalMediationAvailable === void 0 ? pt.stubThis(new Promise((t) => t(!1))) : pt.stubThis(e.isConditionalMediationAvailable());
|
|
@@ -3208,7 +3206,7 @@ function wn({ error: e, options: t }) {
|
|
|
3208
3206
|
});
|
|
3209
3207
|
if (e.name === "SecurityError") {
|
|
3210
3208
|
const s = globalThis.location.hostname;
|
|
3211
|
-
if (
|
|
3209
|
+
if (Jr(s)) {
|
|
3212
3210
|
if (r.rpId !== s)
|
|
3213
3211
|
return new U({
|
|
3214
3212
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
@@ -3232,13 +3230,13 @@ function wn({ error: e, options: t }) {
|
|
|
3232
3230
|
async function Sn(e) {
|
|
3233
3231
|
!e.optionsJSON && e.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), e = { optionsJSON: e });
|
|
3234
3232
|
const { optionsJSON: t, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: s = !0 } = e;
|
|
3235
|
-
if (!
|
|
3233
|
+
if (!Ht())
|
|
3236
3234
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3237
3235
|
let a;
|
|
3238
3236
|
t.allowCredentials?.length !== 0 && (a = t.allowCredentials?.map(Vr));
|
|
3239
3237
|
const n = {
|
|
3240
3238
|
...t,
|
|
3241
|
-
challenge:
|
|
3239
|
+
challenge: tt(t.challenge),
|
|
3242
3240
|
allowCredentials: a
|
|
3243
3241
|
}, i = {};
|
|
3244
3242
|
if (r) {
|
|
@@ -3248,7 +3246,7 @@ async function Sn(e) {
|
|
|
3248
3246
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
3249
3247
|
i.mediation = "conditional", n.allowCredentials = [];
|
|
3250
3248
|
}
|
|
3251
|
-
i.publicKey = n, i.signal =
|
|
3249
|
+
i.publicKey = n, i.signal = Qr.createNewAbortSignal();
|
|
3252
3250
|
let o;
|
|
3253
3251
|
try {
|
|
3254
3252
|
o = await navigator.credentials.get(i);
|
|
@@ -3259,13 +3257,13 @@ async function Sn(e) {
|
|
|
3259
3257
|
throw new Error("Authentication was not completed");
|
|
3260
3258
|
const { id: c, rawId: f, response: d, type: u } = o;
|
|
3261
3259
|
let l;
|
|
3262
|
-
return d.userHandle && (l =
|
|
3260
|
+
return d.userHandle && (l = Z(d.userHandle)), {
|
|
3263
3261
|
id: c,
|
|
3264
|
-
rawId:
|
|
3262
|
+
rawId: Z(f),
|
|
3265
3263
|
response: {
|
|
3266
|
-
authenticatorData:
|
|
3267
|
-
clientDataJSON:
|
|
3268
|
-
signature:
|
|
3264
|
+
authenticatorData: Z(d.authenticatorData),
|
|
3265
|
+
clientDataJSON: Z(d.clientDataJSON),
|
|
3266
|
+
signature: Z(d.signature),
|
|
3269
3267
|
userHandle: l
|
|
3270
3268
|
},
|
|
3271
3269
|
type: u,
|
|
@@ -3276,23 +3274,23 @@ async function Sn(e) {
|
|
|
3276
3274
|
function zr(e, t) {
|
|
3277
3275
|
window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
|
|
3278
3276
|
}
|
|
3279
|
-
const
|
|
3277
|
+
const hr = (e, t) => {
|
|
3280
3278
|
const r = JSON.stringify(
|
|
3281
3279
|
typeof t == "function" ? t() : t
|
|
3282
3280
|
);
|
|
3283
3281
|
window.localStorage.setItem(e, r), zr(e, r);
|
|
3284
3282
|
}, vn = (e) => {
|
|
3285
3283
|
window.localStorage.removeItem(e), zr(e, null);
|
|
3286
|
-
},
|
|
3287
|
-
function
|
|
3284
|
+
}, fr = (e) => window.localStorage.getItem(e), Tn = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
|
3285
|
+
function He({
|
|
3288
3286
|
key: e,
|
|
3289
3287
|
initialValue: t
|
|
3290
3288
|
}) {
|
|
3291
|
-
const r = _s(Tn, () =>
|
|
3289
|
+
const r = _s(Tn, () => fr(e)), s = Y(
|
|
3292
3290
|
(i) => {
|
|
3293
3291
|
try {
|
|
3294
3292
|
const o = typeof i == "function" ? i(JSON.parse(r)) : i;
|
|
3295
|
-
o == null ? vn(e) :
|
|
3293
|
+
o == null ? vn(e) : hr(e, o);
|
|
3296
3294
|
} catch (o) {
|
|
3297
3295
|
console.warn(o);
|
|
3298
3296
|
}
|
|
@@ -3303,19 +3301,19 @@ function Ke({
|
|
|
3303
3301
|
}, [t, s]), n = Y(() => {
|
|
3304
3302
|
s(null);
|
|
3305
3303
|
}, [s]);
|
|
3306
|
-
return
|
|
3304
|
+
return W(() => {
|
|
3307
3305
|
try {
|
|
3308
|
-
|
|
3306
|
+
fr(e) === null && typeof t < "u" && hr(e, t);
|
|
3309
3307
|
} catch (i) {
|
|
3310
3308
|
console.warn(i);
|
|
3311
3309
|
}
|
|
3312
3310
|
}, [e, t]), [r ? JSON.parse(r) : null, s, a, n];
|
|
3313
3311
|
}
|
|
3314
|
-
const
|
|
3312
|
+
const M = [];
|
|
3315
3313
|
for (let e = 0; e < 256; ++e)
|
|
3316
|
-
|
|
3314
|
+
M.push((e + 256).toString(16).slice(1));
|
|
3317
3315
|
function An(e, t = 0) {
|
|
3318
|
-
return (
|
|
3316
|
+
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();
|
|
3319
3317
|
}
|
|
3320
3318
|
let yt;
|
|
3321
3319
|
const In = new Uint8Array(16);
|
|
@@ -3327,17 +3325,17 @@ function _n() {
|
|
|
3327
3325
|
}
|
|
3328
3326
|
return yt(In);
|
|
3329
3327
|
}
|
|
3330
|
-
const Rn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
3328
|
+
const Rn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), mr = { randomUUID: Rn };
|
|
3331
3329
|
function gt(e, t, r) {
|
|
3332
|
-
if (
|
|
3333
|
-
return
|
|
3330
|
+
if (mr.randomUUID && !e)
|
|
3331
|
+
return mr.randomUUID();
|
|
3334
3332
|
e = e || {};
|
|
3335
3333
|
const s = e.random ?? e.rng?.() ?? _n();
|
|
3336
3334
|
if (s.length < 16)
|
|
3337
3335
|
throw new Error("Random bytes length must be >= 16");
|
|
3338
3336
|
return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, An(s);
|
|
3339
3337
|
}
|
|
3340
|
-
const
|
|
3338
|
+
const ve = "Your session has expired. For your security, please log in again to continue.", Cn = "Your session has been successfully terminated.", bt = "Login failed. Please try again.", On = "Error getting access token, please re-authenticate.", kn = "You forgot to wrap your component in <AuthProvider>.", Ke = "@@auth@@", Ne = "LOADING", qe = "LOGIN", Xr = "LOGOUT", Le = "success", ee = "failure", Zr = "include", es = "POST", ts = "application/json", Ge = {
|
|
3341
3339
|
GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
|
|
3342
3340
|
$clientId: String!,
|
|
3343
3341
|
$username: String!,
|
|
@@ -3418,24 +3416,24 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3418
3416
|
email
|
|
3419
3417
|
}
|
|
3420
3418
|
}`
|
|
3421
|
-
},
|
|
3419
|
+
}, Te = {
|
|
3422
3420
|
GET_REGISTRATION_OPTIONS: {
|
|
3423
|
-
schema:
|
|
3421
|
+
schema: Ge.GET_REGISTRATION_OPTIONS,
|
|
3424
3422
|
method: "getPasskeyRegistrationOptions"
|
|
3425
3423
|
},
|
|
3426
3424
|
VERIFY_REGISTRATION: {
|
|
3427
|
-
schema:
|
|
3425
|
+
schema: Ge.VERIFY_REGISTRATION,
|
|
3428
3426
|
method: "verifyPasskeyRegistration"
|
|
3429
3427
|
},
|
|
3430
3428
|
GET_AUTHENTICATION_OPTIONS: {
|
|
3431
|
-
schema:
|
|
3429
|
+
schema: Ge.GET_AUTHENTICATION_OPTIONS,
|
|
3432
3430
|
method: "getPasskeyAuthenticationOptions"
|
|
3433
3431
|
},
|
|
3434
3432
|
VERIFY_AUTHENTICATION: {
|
|
3435
|
-
schema:
|
|
3433
|
+
schema: Ge.VERIFY_AUTHENTICATION,
|
|
3436
3434
|
method: "verifyPasskeyAuthentication"
|
|
3437
3435
|
}
|
|
3438
|
-
},
|
|
3436
|
+
}, Ae = async ({
|
|
3439
3437
|
accessToken: e,
|
|
3440
3438
|
type: t,
|
|
3441
3439
|
clientId: r,
|
|
@@ -3449,7 +3447,7 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3449
3447
|
headers: {
|
|
3450
3448
|
authorization: n,
|
|
3451
3449
|
"Content-Type": ts,
|
|
3452
|
-
[
|
|
3450
|
+
[Mr.CLIENT_ID]: `${r}`
|
|
3453
3451
|
},
|
|
3454
3452
|
body: JSON.stringify({
|
|
3455
3453
|
query: t.schema,
|
|
@@ -3457,14 +3455,14 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3457
3455
|
})
|
|
3458
3456
|
});
|
|
3459
3457
|
if (i.status !== 200)
|
|
3460
|
-
return { status:
|
|
3458
|
+
return { status: ee, data: [] };
|
|
3461
3459
|
const { data: o } = await i.json();
|
|
3462
3460
|
return {
|
|
3463
|
-
status:
|
|
3461
|
+
status: Le,
|
|
3464
3462
|
data: o[t.method]
|
|
3465
3463
|
};
|
|
3466
3464
|
} catch (n) {
|
|
3467
|
-
return console.error(n), { status:
|
|
3465
|
+
return console.error(n), { status: ee, data: [] };
|
|
3468
3466
|
}
|
|
3469
3467
|
}, ot = async ({
|
|
3470
3468
|
type: e,
|
|
@@ -3478,19 +3476,19 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3478
3476
|
method: es,
|
|
3479
3477
|
headers: {
|
|
3480
3478
|
"Content-Type": ts,
|
|
3481
|
-
[
|
|
3479
|
+
[Mr.CLIENT_ID]: `${t}`
|
|
3482
3480
|
},
|
|
3483
3481
|
body: JSON.stringify(r)
|
|
3484
3482
|
});
|
|
3485
3483
|
if (a.status !== 200)
|
|
3486
|
-
return { status:
|
|
3484
|
+
return { status: ee, data: [] };
|
|
3487
3485
|
const { data: n } = await a.json();
|
|
3488
3486
|
return {
|
|
3489
|
-
status:
|
|
3487
|
+
status: Le,
|
|
3490
3488
|
data: n || []
|
|
3491
3489
|
};
|
|
3492
3490
|
} catch (a) {
|
|
3493
|
-
return console.error(a), { status:
|
|
3491
|
+
return console.error(a), { status: ee, data: [] };
|
|
3494
3492
|
}
|
|
3495
3493
|
}, Nn = process.env.NODE_ENV === "production", Pn = !Nn, rs = {
|
|
3496
3494
|
isLoading: !0,
|
|
@@ -3524,14 +3522,14 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3524
3522
|
domain: r,
|
|
3525
3523
|
idToken: s
|
|
3526
3524
|
}
|
|
3527
|
-
}))?.status ||
|
|
3525
|
+
}))?.status || ee
|
|
3528
3526
|
};
|
|
3529
3527
|
} catch {
|
|
3530
3528
|
return {
|
|
3531
|
-
status:
|
|
3529
|
+
status: ee
|
|
3532
3530
|
};
|
|
3533
3531
|
}
|
|
3534
|
-
},
|
|
3532
|
+
}, Dn = async ({
|
|
3535
3533
|
username: e,
|
|
3536
3534
|
password: t,
|
|
3537
3535
|
clientId: r,
|
|
@@ -3560,7 +3558,7 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3560
3558
|
domain: c,
|
|
3561
3559
|
ua: f
|
|
3562
3560
|
}
|
|
3563
|
-
}), l = await
|
|
3561
|
+
}), l = await Me(u?.data?.idToken);
|
|
3564
3562
|
return l && l.payload[F.USER_ID_KEY] !== "" && l.payload[F.NONCE_KEY] === s ? {
|
|
3565
3563
|
idToken: u.data.idToken,
|
|
3566
3564
|
accessToken: u.data.accessToken,
|
|
@@ -3576,7 +3574,7 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3576
3574
|
status: !1
|
|
3577
3575
|
};
|
|
3578
3576
|
}
|
|
3579
|
-
},
|
|
3577
|
+
}, Mn = async ({
|
|
3580
3578
|
nonce: e,
|
|
3581
3579
|
clientId: t,
|
|
3582
3580
|
code_challenge: r,
|
|
@@ -3594,15 +3592,15 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3594
3592
|
}
|
|
3595
3593
|
});
|
|
3596
3594
|
return a?.data?.code ? {
|
|
3597
|
-
status:
|
|
3595
|
+
status: Le,
|
|
3598
3596
|
data: a.data.code
|
|
3599
3597
|
} : {
|
|
3600
|
-
status:
|
|
3598
|
+
status: ee,
|
|
3601
3599
|
data: ""
|
|
3602
3600
|
};
|
|
3603
3601
|
} catch {
|
|
3604
3602
|
return {
|
|
3605
|
-
status:
|
|
3603
|
+
status: ee,
|
|
3606
3604
|
data: ""
|
|
3607
3605
|
};
|
|
3608
3606
|
}
|
|
@@ -3628,7 +3626,7 @@ const Te = "Your session has expired. For your security, please log in again to
|
|
|
3628
3626
|
accessToken: a,
|
|
3629
3627
|
domain: n
|
|
3630
3628
|
}
|
|
3631
|
-
}), c = await
|
|
3629
|
+
}), c = await Me(o?.data?.accessToken);
|
|
3632
3630
|
return c && c.payload[F.USER_ID_KEY] !== "" && c.payload[F.NONCE_KEY] === r ? {
|
|
3633
3631
|
accessToken: o.data.accessToken,
|
|
3634
3632
|
refreshToken: o.data.refreshToken,
|
|
@@ -3674,7 +3672,7 @@ class Un {
|
|
|
3674
3672
|
nonce: a,
|
|
3675
3673
|
domain: n
|
|
3676
3674
|
}) {
|
|
3677
|
-
const i = await
|
|
3675
|
+
const i = await Me(this.refreshToken);
|
|
3678
3676
|
if (i && i.payload[F.USER_ID_KEY] !== "") {
|
|
3679
3677
|
const o = await Ln({
|
|
3680
3678
|
endpoint: t,
|
|
@@ -3686,46 +3684,46 @@ class Un {
|
|
|
3686
3684
|
domain: n
|
|
3687
3685
|
});
|
|
3688
3686
|
return o.status ? (this.accessToken = o.accessToken, this.refreshToken = o.refreshToken, {
|
|
3689
|
-
status:
|
|
3687
|
+
status: Le,
|
|
3690
3688
|
newAccessToken: o.accessToken,
|
|
3691
3689
|
newRefreshToken: o.refreshToken
|
|
3692
3690
|
}) : {
|
|
3693
|
-
status:
|
|
3691
|
+
status: ee
|
|
3694
3692
|
};
|
|
3695
3693
|
} else
|
|
3696
3694
|
return {
|
|
3697
|
-
status:
|
|
3695
|
+
status: ee
|
|
3698
3696
|
};
|
|
3699
3697
|
}
|
|
3700
3698
|
}
|
|
3701
|
-
const
|
|
3699
|
+
const Ie = () => {
|
|
3702
3700
|
throw new Error(kn);
|
|
3703
3701
|
}, ss = xt({
|
|
3704
3702
|
isAuthenticated: !1,
|
|
3705
3703
|
isLoading: !1,
|
|
3706
|
-
login:
|
|
3707
|
-
logout:
|
|
3708
|
-
getAccessToken:
|
|
3709
|
-
getIdToken:
|
|
3710
|
-
registeringForPasskey:
|
|
3711
|
-
loginWithPasskey:
|
|
3704
|
+
login: Ie,
|
|
3705
|
+
logout: Ie,
|
|
3706
|
+
getAccessToken: Ie,
|
|
3707
|
+
getIdToken: Ie,
|
|
3708
|
+
registeringForPasskey: Ie,
|
|
3709
|
+
loginWithPasskey: Ie,
|
|
3712
3710
|
logoutReason: "",
|
|
3713
3711
|
authenticationType: ""
|
|
3714
3712
|
}), Fn = () => ({
|
|
3715
|
-
...
|
|
3713
|
+
...at(ss)
|
|
3716
3714
|
}), Hn = (e) => Y(
|
|
3717
3715
|
(...t) => {
|
|
3718
3716
|
e && console.info(`==> [Auth ${Date.now()}]: `, ...t);
|
|
3719
3717
|
},
|
|
3720
3718
|
[e]
|
|
3721
|
-
), Kn =
|
|
3719
|
+
), Kn = ie.createContext({
|
|
3722
3720
|
state: rs,
|
|
3723
3721
|
dispatch: () => {
|
|
3724
3722
|
}
|
|
3725
3723
|
}), Gn = (e, t) => t?.type === Ne ? {
|
|
3726
3724
|
...e,
|
|
3727
3725
|
isLoading: t.payload.isLoading
|
|
3728
|
-
} : t?.type ===
|
|
3726
|
+
} : t?.type === qe ? {
|
|
3729
3727
|
...e,
|
|
3730
3728
|
isLoading: !1,
|
|
3731
3729
|
isAuthenticated: !0,
|
|
@@ -3742,7 +3740,7 @@ const _e = () => {
|
|
|
3742
3740
|
} : e, Bn = ({ children: e }) => {
|
|
3743
3741
|
const t = Fn();
|
|
3744
3742
|
return /* @__PURE__ */ h(jr.Provider, { value: t, children: e });
|
|
3745
|
-
},
|
|
3743
|
+
}, pr = ({
|
|
3746
3744
|
children: e,
|
|
3747
3745
|
sessionExpiration: t,
|
|
3748
3746
|
clientId: r,
|
|
@@ -3750,20 +3748,20 @@ const _e = () => {
|
|
|
3750
3748
|
debug: a = !1,
|
|
3751
3749
|
endpoint: n = Pn ? "https://auth.gizmette.local.com:3003" : "https://mylogin.gizmette.com/auth"
|
|
3752
3750
|
}) => {
|
|
3753
|
-
const [i, o] =
|
|
3751
|
+
const [i, o] = Ir(Gn, {
|
|
3754
3752
|
...rs,
|
|
3755
3753
|
debug: a
|
|
3756
|
-
}), c = Hn(a), f = j(!1), [d, u, , l] =
|
|
3757
|
-
key: `${
|
|
3758
|
-
}), [m, p, , g] =
|
|
3759
|
-
key: `${
|
|
3760
|
-
}), [b, E, , O] =
|
|
3754
|
+
}), c = Hn(a), f = j(!1), [d, u, , l] = He({
|
|
3755
|
+
key: `${Ke}::${r}::@@user@@`
|
|
3756
|
+
}), [m, p, , g] = He({
|
|
3757
|
+
key: `${Ke}::${r}::@@access@@`
|
|
3758
|
+
}), [b, E, , O] = He(
|
|
3761
3759
|
{
|
|
3762
|
-
key: `${
|
|
3760
|
+
key: `${Ke}::${r}::@@refresh@@`
|
|
3763
3761
|
}
|
|
3764
|
-
), [A, K, , R] =
|
|
3765
|
-
key: `${
|
|
3766
|
-
}),
|
|
3762
|
+
), [A, K, , R] = He({
|
|
3763
|
+
key: `${Ke}::${r}::@@nonce@@`
|
|
3764
|
+
}), Q = new Un(m, b), C = Y(() => {
|
|
3767
3765
|
c("removeLocalStorage: removing local storage"), l(), g(), O(), R();
|
|
3768
3766
|
}, [
|
|
3769
3767
|
g,
|
|
@@ -3779,7 +3777,7 @@ const _e = () => {
|
|
|
3779
3777
|
), o({
|
|
3780
3778
|
type: Xr,
|
|
3781
3779
|
payload: {
|
|
3782
|
-
logoutReason: w ||
|
|
3780
|
+
logoutReason: w || ve
|
|
3783
3781
|
}
|
|
3784
3782
|
}), C(), o({ type: Ne, payload: { isLoading: !1 } });
|
|
3785
3783
|
},
|
|
@@ -3796,7 +3794,7 @@ const _e = () => {
|
|
|
3796
3794
|
domain: s,
|
|
3797
3795
|
idToken: d,
|
|
3798
3796
|
endpoint: n
|
|
3799
|
-
}), v(w ||
|
|
3797
|
+
}), v(w || ve);
|
|
3800
3798
|
},
|
|
3801
3799
|
[
|
|
3802
3800
|
d,
|
|
@@ -3808,13 +3806,13 @@ const _e = () => {
|
|
|
3808
3806
|
n
|
|
3809
3807
|
]
|
|
3810
3808
|
);
|
|
3811
|
-
|
|
3809
|
+
W(() => {
|
|
3812
3810
|
if (!f.current)
|
|
3813
3811
|
return i.isLoading && d !== null ? (async () => {
|
|
3814
3812
|
try {
|
|
3815
|
-
const w = await
|
|
3813
|
+
const w = await Me(d);
|
|
3816
3814
|
w && w.payload[F.USER_ID_KEY] !== "" ? (c("useEffect: setting the authentication state"), o({
|
|
3817
|
-
type:
|
|
3815
|
+
type: qe,
|
|
3818
3816
|
payload: {
|
|
3819
3817
|
authenticationType: w.payload[F.AUTH_TYPE_KEY],
|
|
3820
3818
|
user: {
|
|
@@ -3823,11 +3821,11 @@ const _e = () => {
|
|
|
3823
3821
|
email: w.payload[F.EMAIL_KEY]
|
|
3824
3822
|
}
|
|
3825
3823
|
}
|
|
3826
|
-
})) : (c("useEffect: invalid JWT, invalidating and logging out"), await x(
|
|
3824
|
+
})) : (c("useEffect: invalid JWT, invalidating and logging out"), await x(ve));
|
|
3827
3825
|
} catch {
|
|
3828
3826
|
c(
|
|
3829
3827
|
"useEffect: exception validating JWT, invalidating and logging out"
|
|
3830
|
-
), await x(
|
|
3828
|
+
), await x(ve);
|
|
3831
3829
|
}
|
|
3832
3830
|
})() : (c("useEffect: setting the loading state to false"), o({ type: Ne, payload: { isLoading: !1 } })), () => {
|
|
3833
3831
|
f.current = !0;
|
|
@@ -3837,14 +3835,14 @@ const _e = () => {
|
|
|
3837
3835
|
o({ type: Ne, payload: { isLoading: !0 } }), C();
|
|
3838
3836
|
const S = gt();
|
|
3839
3837
|
K(S), c("login: Logging in with password");
|
|
3840
|
-
const { code_verifier: le, code_challenge: ue } = await dn(), Jt = await
|
|
3838
|
+
const { code_verifier: le, code_challenge: ue } = await dn(), Jt = await Mn({
|
|
3841
3839
|
endpoint: n,
|
|
3842
3840
|
nonce: S,
|
|
3843
3841
|
clientId: r,
|
|
3844
3842
|
code_challenge: ue
|
|
3845
3843
|
});
|
|
3846
3844
|
if (Jt.status) {
|
|
3847
|
-
const
|
|
3845
|
+
const we = await Dn({
|
|
3848
3846
|
endpoint: n,
|
|
3849
3847
|
username: w,
|
|
3850
3848
|
password: T,
|
|
@@ -3857,14 +3855,14 @@ const _e = () => {
|
|
|
3857
3855
|
domain: s,
|
|
3858
3856
|
ua: navigator.userAgent
|
|
3859
3857
|
});
|
|
3860
|
-
return
|
|
3861
|
-
type:
|
|
3858
|
+
return we.status ? (u(we.idToken), p(we.accessToken), E(we.refreshToken), o({
|
|
3859
|
+
type: qe,
|
|
3862
3860
|
payload: {
|
|
3863
3861
|
authenticationType: Pe.CODE,
|
|
3864
3862
|
user: {
|
|
3865
|
-
userId:
|
|
3863
|
+
userId: we.userId,
|
|
3866
3864
|
username: w,
|
|
3867
|
-
email:
|
|
3865
|
+
email: we.email
|
|
3868
3866
|
}
|
|
3869
3867
|
}
|
|
3870
3868
|
}), !0) : (v(bt), !1);
|
|
@@ -3878,12 +3876,12 @@ const _e = () => {
|
|
|
3878
3876
|
if (w && T && T.userId) {
|
|
3879
3877
|
if (m) {
|
|
3880
3878
|
c("getAccessToken");
|
|
3881
|
-
const le = await
|
|
3879
|
+
const le = await Me(m);
|
|
3882
3880
|
if (le && le.payload[F.USER_ID_KEY] !== "")
|
|
3883
3881
|
return m;
|
|
3884
3882
|
}
|
|
3885
3883
|
c("getAccessToken: invalid access token, trying to refresh it");
|
|
3886
|
-
const S = await
|
|
3884
|
+
const S = await Q.refreshtoken({
|
|
3887
3885
|
endpoint: n,
|
|
3888
3886
|
clientId: r,
|
|
3889
3887
|
userId: T.userId,
|
|
@@ -3892,11 +3890,11 @@ const _e = () => {
|
|
|
3892
3890
|
});
|
|
3893
3891
|
return S.status && S.status === "success" && S.newAccessToken ? (p(S.newAccessToken), E(S.newRefreshToken), S.newAccessToken) : (c(
|
|
3894
3892
|
"getAccessToken: invalid refresh token, need to re-authenticate"
|
|
3895
|
-
), await x(
|
|
3893
|
+
), await x(ve), "");
|
|
3896
3894
|
}
|
|
3897
3895
|
return c(
|
|
3898
3896
|
"getAccessToken: user is not authenticated, cannot get access token"
|
|
3899
|
-
), await x(
|
|
3897
|
+
), await x(ve), "";
|
|
3900
3898
|
} catch {
|
|
3901
3899
|
return c(
|
|
3902
3900
|
"getAccessToken: exception occurred, invalidating and logging out"
|
|
@@ -3904,11 +3902,11 @@ const _e = () => {
|
|
|
3904
3902
|
}
|
|
3905
3903
|
}, V = () => i.isAuthenticated && d ? d : "", ce = async () => {
|
|
3906
3904
|
const { user: w } = i;
|
|
3907
|
-
let T = await
|
|
3905
|
+
let T = await Ae({
|
|
3908
3906
|
endpoint: n,
|
|
3909
3907
|
accessToken: m,
|
|
3910
3908
|
clientId: r,
|
|
3911
|
-
type:
|
|
3909
|
+
type: Te.GET_REGISTRATION_OPTIONS,
|
|
3912
3910
|
params: {
|
|
3913
3911
|
clientId: r,
|
|
3914
3912
|
id: w?.userId,
|
|
@@ -3920,11 +3918,11 @@ const _e = () => {
|
|
|
3920
3918
|
const S = await bn({
|
|
3921
3919
|
optionsJSON: T.data
|
|
3922
3920
|
});
|
|
3923
|
-
return T = await
|
|
3921
|
+
return T = await Ae({
|
|
3924
3922
|
endpoint: n,
|
|
3925
3923
|
accessToken: m,
|
|
3926
3924
|
clientId: r,
|
|
3927
|
-
type:
|
|
3925
|
+
type: Te.VERIFY_REGISTRATION,
|
|
3928
3926
|
params: {
|
|
3929
3927
|
clientId: r,
|
|
3930
3928
|
id: w?.userId,
|
|
@@ -3933,11 +3931,11 @@ const _e = () => {
|
|
|
3933
3931
|
}
|
|
3934
3932
|
}), !!(T.status && T.data.length > 0);
|
|
3935
3933
|
} catch {
|
|
3936
|
-
return await
|
|
3934
|
+
return await Ae({
|
|
3937
3935
|
endpoint: n,
|
|
3938
3936
|
accessToken: m,
|
|
3939
3937
|
clientId: r,
|
|
3940
|
-
type:
|
|
3938
|
+
type: Te.VERIFY_REGISTRATION,
|
|
3941
3939
|
params: {
|
|
3942
3940
|
clientId: r,
|
|
3943
3941
|
id: w?.userId,
|
|
@@ -3947,16 +3945,16 @@ const _e = () => {
|
|
|
3947
3945
|
}), !1;
|
|
3948
3946
|
}
|
|
3949
3947
|
return !1;
|
|
3950
|
-
},
|
|
3948
|
+
}, Ee = async () => {
|
|
3951
3949
|
o({ type: Ne, payload: { isLoading: !0 } }), C();
|
|
3952
3950
|
const w = gt();
|
|
3953
3951
|
K(w), c("loginWithPasskey");
|
|
3954
3952
|
const T = gt();
|
|
3955
|
-
let S = await
|
|
3953
|
+
let S = await Ae({
|
|
3956
3954
|
endpoint: n,
|
|
3957
3955
|
accessToken: m,
|
|
3958
3956
|
clientId: r,
|
|
3959
|
-
type:
|
|
3957
|
+
type: Te.GET_AUTHENTICATION_OPTIONS,
|
|
3960
3958
|
params: {
|
|
3961
3959
|
id: T,
|
|
3962
3960
|
clientId: r
|
|
@@ -3967,11 +3965,11 @@ const _e = () => {
|
|
|
3967
3965
|
const le = await Sn({
|
|
3968
3966
|
optionsJSON: S.data
|
|
3969
3967
|
});
|
|
3970
|
-
return S = await
|
|
3968
|
+
return S = await Ae({
|
|
3971
3969
|
endpoint: n,
|
|
3972
3970
|
accessToken: m,
|
|
3973
3971
|
clientId: r,
|
|
3974
|
-
type:
|
|
3972
|
+
type: Te.VERIFY_AUTHENTICATION,
|
|
3975
3973
|
params: {
|
|
3976
3974
|
clientId: r,
|
|
3977
3975
|
id: T,
|
|
@@ -3981,8 +3979,8 @@ const _e = () => {
|
|
|
3981
3979
|
sessionExpiration: t,
|
|
3982
3980
|
ua: navigator.userAgent
|
|
3983
3981
|
}
|
|
3984
|
-
}), S.data.status ===
|
|
3985
|
-
type:
|
|
3982
|
+
}), S.data.status === Le ? (u(S.data.idToken), p(S.data.accessToken), E(S.data.refreshToken), o({
|
|
3983
|
+
type: qe,
|
|
3986
3984
|
payload: {
|
|
3987
3985
|
authenticationType: Pe.PASSKEY,
|
|
3988
3986
|
user: {
|
|
@@ -3993,11 +3991,11 @@ const _e = () => {
|
|
|
3993
3991
|
}
|
|
3994
3992
|
}), !0) : (v(bt), !1);
|
|
3995
3993
|
} catch {
|
|
3996
|
-
return await
|
|
3994
|
+
return await Ae({
|
|
3997
3995
|
endpoint: n,
|
|
3998
3996
|
accessToken: m,
|
|
3999
3997
|
clientId: r,
|
|
4000
|
-
type:
|
|
3998
|
+
type: Te.VERIFY_AUTHENTICATION,
|
|
4001
3999
|
params: {
|
|
4002
4000
|
clientId: r,
|
|
4003
4001
|
id: T,
|
|
@@ -4020,7 +4018,7 @@ const _e = () => {
|
|
|
4020
4018
|
getAccessToken: N,
|
|
4021
4019
|
getIdToken: V,
|
|
4022
4020
|
registeringForPasskey: ce,
|
|
4023
|
-
loginWithPasskey:
|
|
4021
|
+
loginWithPasskey: Ee
|
|
4024
4022
|
},
|
|
4025
4023
|
children: /* @__PURE__ */ h(Bn, { children: e })
|
|
4026
4024
|
}
|
|
@@ -4040,16 +4038,16 @@ try {
|
|
|
4040
4038
|
} catch {
|
|
4041
4039
|
}
|
|
4042
4040
|
const as = () => {
|
|
4043
|
-
const e =
|
|
4041
|
+
const e = at(jr);
|
|
4044
4042
|
if (!e)
|
|
4045
4043
|
throw new Error("useAuth must be used within an AuthHookProvider");
|
|
4046
4044
|
return e;
|
|
4047
|
-
},
|
|
4048
|
-
let Et = null,
|
|
4045
|
+
}, jo = "I'm having trouble right now. Please try again later.", Vo = "action-search", Jo = "action-sort", Qo = "action-toggle-prompt", Yo = "action-reset-prompt", ns = "sassy-saint-", zo = "search", Xo = "sort", Zo = "sort-timestamp", ec = "sort-token-usage", tc = "sort-memory-direction", rc = "sort-memory-column", sc = "favorites-only", ac = "private-disclosure", nc = "reasoning-disclosure", is = "service-worker", yr = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", ic = 10, oc = 30, cc = "av-prompt", lc = "av-prompt-editable", uc = "size-5 sm:size-4", dc = 30, hc = 15, fc = 130, mc = 160, pc = 16, yc = 24, gc = 76, bc = 76;
|
|
4046
|
+
let Et = null, se = !1;
|
|
4049
4047
|
typeof window < "u" && "serviceWorker" in navigator && navigator.serviceWorker.addEventListener("controllerchange", () => {
|
|
4050
|
-
|
|
4048
|
+
se && (se = !1, window.location.reload());
|
|
4051
4049
|
});
|
|
4052
|
-
function
|
|
4050
|
+
function Kt() {
|
|
4053
4051
|
return "serviceWorker" in navigator;
|
|
4054
4052
|
}
|
|
4055
4053
|
function Nt() {
|
|
@@ -4058,7 +4056,7 @@ function Nt() {
|
|
|
4058
4056
|
);
|
|
4059
4057
|
return e === null ? !1 : e === "true";
|
|
4060
4058
|
}
|
|
4061
|
-
function
|
|
4059
|
+
function Wn(e) {
|
|
4062
4060
|
localStorage.setItem(
|
|
4063
4061
|
ns + is,
|
|
4064
4062
|
e.toString()
|
|
@@ -4067,7 +4065,7 @@ function qn(e) {
|
|
|
4067
4065
|
async function os() {
|
|
4068
4066
|
if (!Nt())
|
|
4069
4067
|
return !1;
|
|
4070
|
-
if (!
|
|
4068
|
+
if (!Kt())
|
|
4071
4069
|
return console.warn("[SW] Service workers not supported"), !1;
|
|
4072
4070
|
try {
|
|
4073
4071
|
return Et = await navigator.serviceWorker.register("/sw.js", {
|
|
@@ -4084,8 +4082,8 @@ async function os() {
|
|
|
4084
4082
|
return console.error("[SW] Service worker registration failed:", e), !1;
|
|
4085
4083
|
}
|
|
4086
4084
|
}
|
|
4087
|
-
async function
|
|
4088
|
-
if (!
|
|
4085
|
+
async function qn() {
|
|
4086
|
+
if (!Kt())
|
|
4089
4087
|
return !1;
|
|
4090
4088
|
try {
|
|
4091
4089
|
const e = await navigator.serviceWorker.getRegistration();
|
|
@@ -4094,19 +4092,19 @@ async function Wn() {
|
|
|
4094
4092
|
return console.error("[SW] Service worker un-registration failed:", e), !1;
|
|
4095
4093
|
}
|
|
4096
4094
|
}
|
|
4097
|
-
async function
|
|
4098
|
-
if (
|
|
4099
|
-
|
|
4095
|
+
async function Ec(e) {
|
|
4096
|
+
if (Wn(e), e) {
|
|
4097
|
+
se = !0;
|
|
4100
4098
|
try {
|
|
4101
4099
|
sessionStorage.setItem("sw-toggle-pending", "enabled");
|
|
4102
4100
|
} catch {
|
|
4103
4101
|
}
|
|
4104
|
-
await os(), navigator.serviceWorker.controller &&
|
|
4102
|
+
await os(), navigator.serviceWorker.controller && se && (se = !1, window.location.reload());
|
|
4105
4103
|
try {
|
|
4106
4104
|
navigator.serviceWorker.ready.then(() => {
|
|
4107
|
-
|
|
4105
|
+
se && Nt() && (se = !1, window.location.reload());
|
|
4108
4106
|
}), setTimeout(() => {
|
|
4109
|
-
|
|
4107
|
+
se && Nt() && (se = !1, window.location.reload());
|
|
4110
4108
|
}, 3e3);
|
|
4111
4109
|
} catch {
|
|
4112
4110
|
}
|
|
@@ -4116,11 +4114,11 @@ async function bc(e) {
|
|
|
4116
4114
|
} catch {
|
|
4117
4115
|
}
|
|
4118
4116
|
try {
|
|
4119
|
-
|
|
4117
|
+
Kt() && await jn();
|
|
4120
4118
|
} catch (t) {
|
|
4121
4119
|
console.warn("[SW] Failed to invalidate cache:", t);
|
|
4122
4120
|
}
|
|
4123
|
-
await
|
|
4121
|
+
await qn(), window.location.reload();
|
|
4124
4122
|
}
|
|
4125
4123
|
}
|
|
4126
4124
|
async function jn() {
|
|
@@ -4149,7 +4147,7 @@ async function jn() {
|
|
|
4149
4147
|
function wt() {
|
|
4150
4148
|
return "unknown";
|
|
4151
4149
|
}
|
|
4152
|
-
async function
|
|
4150
|
+
async function wc(e = {}) {
|
|
4153
4151
|
const { urlLimitPerCache: t } = e;
|
|
4154
4152
|
if (!("caches" in window))
|
|
4155
4153
|
return { version: wt(), caches: [], totalItems: 0 };
|
|
@@ -4176,7 +4174,7 @@ async function Ec(e = {}) {
|
|
|
4176
4174
|
return console.warn("[SW] getCacheInfo failed:", r), { version: wt(), caches: [], totalItems: 0 };
|
|
4177
4175
|
}
|
|
4178
4176
|
}
|
|
4179
|
-
const
|
|
4177
|
+
const Sc = "user", vc = "assistant", Tc = "data", cs = "OpenAI", Vn = "Anthropic", Jn = "Google", Qn = "Perplexity", Ac = cs, Yn = "claude-sonnet-4", zn = "claude-3", Xn = "gpt-", Zn = "o3", ei = "o4", ti = "gemini", ri = "sonar", si = {
|
|
4180
4178
|
[Vn]: [
|
|
4181
4179
|
Yn,
|
|
4182
4180
|
zn
|
|
@@ -4186,16 +4184,16 @@ const wc = "user", Sc = "assistant", vc = "data", cs = "OpenAI", Vn = "Anthropic
|
|
|
4186
4184
|
Zn,
|
|
4187
4185
|
ei
|
|
4188
4186
|
],
|
|
4189
|
-
[
|
|
4190
|
-
[
|
|
4191
|
-
},
|
|
4187
|
+
[Jn]: [ti],
|
|
4188
|
+
[Qn]: [ri]
|
|
4189
|
+
}, Ic = "x-diggidy-chat-id", _c = (e) => {
|
|
4192
4190
|
for (const [t, r] of Object.entries(
|
|
4193
4191
|
si
|
|
4194
4192
|
))
|
|
4195
4193
|
if (r.some((s) => e.startsWith(s)))
|
|
4196
4194
|
return t;
|
|
4197
4195
|
return null;
|
|
4198
|
-
},
|
|
4196
|
+
}, Rc = "timestamp", Cc = "tokenUsage", k = "Diggidy", Oc = {
|
|
4199
4197
|
TOOL: {
|
|
4200
4198
|
MEMORIES: "getUserMemories"
|
|
4201
4199
|
},
|
|
@@ -4323,6 +4321,7 @@ const G = {
|
|
|
4323
4321
|
sendOnEnter
|
|
4324
4322
|
useMemory
|
|
4325
4323
|
showDetails
|
|
4324
|
+
showReasoningButton
|
|
4326
4325
|
entitlements {
|
|
4327
4326
|
version
|
|
4328
4327
|
capabilities
|
|
@@ -4347,6 +4346,7 @@ const G = {
|
|
|
4347
4346
|
$sendOnEnter: Boolean,
|
|
4348
4347
|
$useMemory: Boolean,
|
|
4349
4348
|
$showDetails: Boolean,
|
|
4349
|
+
$showReasoningButton: Boolean,
|
|
4350
4350
|
$tags: [TagIn]) {
|
|
4351
4351
|
setUserPreferences(
|
|
4352
4352
|
user: $user,
|
|
@@ -4357,6 +4357,7 @@ const G = {
|
|
|
4357
4357
|
sendOnEnter: $sendOnEnter,
|
|
4358
4358
|
useMemory: $useMemory,
|
|
4359
4359
|
showDetails: $showDetails,
|
|
4360
|
+
showReasoningButton: $showReasoningButton,
|
|
4360
4361
|
tags: $tags)
|
|
4361
4362
|
}`,
|
|
4362
4363
|
GET_USAGE: `query GetUsage(
|
|
@@ -4373,6 +4374,7 @@ const G = {
|
|
|
4373
4374
|
items {
|
|
4374
4375
|
memoryId
|
|
4375
4376
|
text
|
|
4377
|
+
description
|
|
4376
4378
|
categories
|
|
4377
4379
|
sourceType
|
|
4378
4380
|
confidence
|
|
@@ -4384,16 +4386,13 @@ const G = {
|
|
|
4384
4386
|
total
|
|
4385
4387
|
}
|
|
4386
4388
|
}`,
|
|
4387
|
-
UPDATE_MEMORY: `mutation UpdateMemory($user: String!, $memoryId: String!, $text: String!) {
|
|
4388
|
-
updateMemory(user: $user, memoryId: $memoryId, text: $text)
|
|
4389
|
-
}`,
|
|
4390
4389
|
DELETE_MEMORY: `mutation DeleteMemory($user: String!, $memoryId: String!) {
|
|
4391
4390
|
deleteMemory(user: $user, memoryId: $memoryId)
|
|
4392
4391
|
}`,
|
|
4393
4392
|
DELETE_MEMORIES: `mutation DeleteMemories($user: String!) {
|
|
4394
4393
|
deleteMemories(user: $user)
|
|
4395
4394
|
}`
|
|
4396
|
-
},
|
|
4395
|
+
}, te = {
|
|
4397
4396
|
GET_LOCATION: {
|
|
4398
4397
|
schema: G.GET_LOCATION,
|
|
4399
4398
|
method: "location"
|
|
@@ -4446,16 +4445,13 @@ const G = {
|
|
|
4446
4445
|
schema: G.GET_USER_MEMORIES,
|
|
4447
4446
|
method: "getUserMemories"
|
|
4448
4447
|
},
|
|
4449
|
-
UPDATE_MEMORY: {
|
|
4450
|
-
schema: G.UPDATE_MEMORY
|
|
4451
|
-
},
|
|
4452
4448
|
DELETE_MEMORY: {
|
|
4453
4449
|
schema: G.DELETE_MEMORY
|
|
4454
4450
|
},
|
|
4455
4451
|
DELETE_MEMORIES: {
|
|
4456
4452
|
schema: G.DELETE_MEMORIES
|
|
4457
4453
|
}
|
|
4458
|
-
}, ii = process.env.PUBLIC_SASSY_API_SERVER_URL,
|
|
4454
|
+
}, ii = process.env.PUBLIC_SASSY_API_SERVER_URL, Oe = async ({
|
|
4459
4455
|
query: e,
|
|
4460
4456
|
data: t,
|
|
4461
4457
|
headers: r = {},
|
|
@@ -4478,13 +4474,13 @@ const G = {
|
|
|
4478
4474
|
try {
|
|
4479
4475
|
let r;
|
|
4480
4476
|
if (e.noAuth === !0)
|
|
4481
|
-
r = await
|
|
4477
|
+
r = await Oe({
|
|
4482
4478
|
query: e.type.schema,
|
|
4483
4479
|
data: t
|
|
4484
4480
|
});
|
|
4485
4481
|
else {
|
|
4486
4482
|
const n = `Bearer ${e.accessToken}`;
|
|
4487
|
-
r = await
|
|
4483
|
+
r = await Oe({
|
|
4488
4484
|
headers: {
|
|
4489
4485
|
authorization: n
|
|
4490
4486
|
},
|
|
@@ -4503,7 +4499,7 @@ const G = {
|
|
|
4503
4499
|
} catch (r) {
|
|
4504
4500
|
return console.error(r), { status: 500, data: [] };
|
|
4505
4501
|
}
|
|
4506
|
-
},
|
|
4502
|
+
}, kc = async ({
|
|
4507
4503
|
provider: e,
|
|
4508
4504
|
accessToken: t,
|
|
4509
4505
|
username: r
|
|
@@ -4511,7 +4507,7 @@ const G = {
|
|
|
4511
4507
|
try {
|
|
4512
4508
|
await oi({
|
|
4513
4509
|
accessToken: t,
|
|
4514
|
-
type:
|
|
4510
|
+
type: te.SET_USER_PREFERENCES,
|
|
4515
4511
|
params: {
|
|
4516
4512
|
user: r,
|
|
4517
4513
|
provider: e
|
|
@@ -4519,7 +4515,7 @@ const G = {
|
|
|
4519
4515
|
});
|
|
4520
4516
|
} catch {
|
|
4521
4517
|
}
|
|
4522
|
-
},
|
|
4518
|
+
}, oe = {
|
|
4523
4519
|
CHATS: "chats",
|
|
4524
4520
|
CHATS_STATS: "chatsStats",
|
|
4525
4521
|
CAPABILITIES: "capabilities",
|
|
@@ -4527,16 +4523,16 @@ const G = {
|
|
|
4527
4523
|
PREFERENCES: "preferences",
|
|
4528
4524
|
USAGE: "usage",
|
|
4529
4525
|
USER_MEMORIES: "userMemories"
|
|
4530
|
-
},
|
|
4531
|
-
queryKey: [
|
|
4532
|
-
queryFn: async () => await
|
|
4533
|
-
type:
|
|
4526
|
+
}, Nc = () => ye({
|
|
4527
|
+
queryKey: [oe.CAPABILITIES],
|
|
4528
|
+
queryFn: async () => await be({
|
|
4529
|
+
type: te.GET_SERVER_CAPABILITIES,
|
|
4534
4530
|
noAuth: !0
|
|
4535
4531
|
})
|
|
4536
|
-
}),
|
|
4537
|
-
queryKey: [
|
|
4538
|
-
queryFn: async () => await
|
|
4539
|
-
type:
|
|
4532
|
+
}), Pc = () => ye({
|
|
4533
|
+
queryKey: [oe.CHANGELOGS],
|
|
4534
|
+
queryFn: async () => await be({
|
|
4535
|
+
type: te.GET_CHANGELOGS,
|
|
4540
4536
|
noAuth: !0,
|
|
4541
4537
|
params: {
|
|
4542
4538
|
client: !0
|
|
@@ -4545,40 +4541,40 @@ const G = {
|
|
|
4545
4541
|
}), ci = ({
|
|
4546
4542
|
user: e,
|
|
4547
4543
|
getAccessToken: t
|
|
4548
|
-
}) =>
|
|
4549
|
-
queryKey: [
|
|
4550
|
-
queryFn: async () => await
|
|
4544
|
+
}) => ye({
|
|
4545
|
+
queryKey: [oe.PREFERENCES, e],
|
|
4546
|
+
queryFn: async () => await be({
|
|
4551
4547
|
params: {
|
|
4552
4548
|
user: e
|
|
4553
4549
|
},
|
|
4554
|
-
type:
|
|
4550
|
+
type: te.GET_USER_PREFERENCES,
|
|
4555
4551
|
getAccessToken: t
|
|
4556
4552
|
})
|
|
4557
|
-
}),
|
|
4553
|
+
}), $c = ({
|
|
4558
4554
|
user: e,
|
|
4559
4555
|
getAccessToken: t
|
|
4560
|
-
}) =>
|
|
4561
|
-
queryKey: [
|
|
4562
|
-
queryFn: async () => await
|
|
4556
|
+
}) => ye({
|
|
4557
|
+
queryKey: [oe.CHATS_STATS, e],
|
|
4558
|
+
queryFn: async () => await be({
|
|
4563
4559
|
params: {
|
|
4564
4560
|
user: e
|
|
4565
4561
|
},
|
|
4566
|
-
type:
|
|
4562
|
+
type: te.GET_CHATS_STATS,
|
|
4567
4563
|
getAccessToken: t
|
|
4568
4564
|
})
|
|
4569
|
-
}),
|
|
4565
|
+
}), xc = ({
|
|
4570
4566
|
user: e,
|
|
4571
4567
|
searchString: t,
|
|
4572
4568
|
sortDirection: r,
|
|
4573
4569
|
sortedCell: s,
|
|
4574
4570
|
getAccessToken: a,
|
|
4575
4571
|
enabled: n = !0
|
|
4576
|
-
}) =>
|
|
4572
|
+
}) => ye({
|
|
4577
4573
|
enabled: n,
|
|
4578
4574
|
staleTime: 60 * 1e3,
|
|
4579
4575
|
// 1 minute
|
|
4580
|
-
queryKey: [
|
|
4581
|
-
queryFn: async () => await
|
|
4576
|
+
queryKey: [oe.CHATS, e, t, r, s],
|
|
4577
|
+
queryFn: async () => await be({
|
|
4582
4578
|
params: {
|
|
4583
4579
|
user: e,
|
|
4584
4580
|
searchString: t,
|
|
@@ -4587,25 +4583,25 @@ const G = {
|
|
|
4587
4583
|
limit: 1,
|
|
4588
4584
|
truncateSize: 100
|
|
4589
4585
|
},
|
|
4590
|
-
type:
|
|
4586
|
+
type: te.GET_CHATS,
|
|
4591
4587
|
getAccessToken: a
|
|
4592
4588
|
})
|
|
4593
|
-
}),
|
|
4589
|
+
}), Dc = ({
|
|
4594
4590
|
user: e,
|
|
4595
4591
|
month: t,
|
|
4596
4592
|
year: r = (/* @__PURE__ */ new Date()).getFullYear().toString(),
|
|
4597
4593
|
getAccessToken: s,
|
|
4598
4594
|
enabled: a = !0
|
|
4599
|
-
}) =>
|
|
4595
|
+
}) => ye({
|
|
4600
4596
|
enabled: a,
|
|
4601
|
-
queryKey: [
|
|
4602
|
-
queryFn: async () => await
|
|
4597
|
+
queryKey: [oe.USAGE, e, t, r],
|
|
4598
|
+
queryFn: async () => await be({
|
|
4603
4599
|
params: {
|
|
4604
4600
|
user: e,
|
|
4605
4601
|
month: t,
|
|
4606
4602
|
year: r
|
|
4607
4603
|
},
|
|
4608
|
-
type:
|
|
4604
|
+
type: te.GET_USAGE,
|
|
4609
4605
|
getAccessToken: s
|
|
4610
4606
|
})
|
|
4611
4607
|
}), Mc = ({
|
|
@@ -4613,50 +4609,25 @@ const G = {
|
|
|
4613
4609
|
query: t,
|
|
4614
4610
|
getAccessToken: r,
|
|
4615
4611
|
enabled: s = !0
|
|
4616
|
-
}) =>
|
|
4612
|
+
}) => ye({
|
|
4617
4613
|
enabled: s && !!e,
|
|
4618
|
-
queryKey: [
|
|
4619
|
-
queryFn: async () => await
|
|
4614
|
+
queryKey: [oe.USER_MEMORIES, e, t],
|
|
4615
|
+
queryFn: async () => await be({
|
|
4620
4616
|
params: { user: e, query: t },
|
|
4621
|
-
type:
|
|
4617
|
+
type: te.GET_USER_MEMORIES,
|
|
4622
4618
|
getAccessToken: r
|
|
4623
4619
|
})
|
|
4624
|
-
}),
|
|
4625
|
-
getAccessToken: e
|
|
4626
|
-
}) => {
|
|
4627
|
-
const t = Le();
|
|
4628
|
-
return Ut({
|
|
4629
|
-
mutationFn: async ({
|
|
4630
|
-
user: r,
|
|
4631
|
-
memoryId: s,
|
|
4632
|
-
text: a
|
|
4633
|
-
}) => {
|
|
4634
|
-
const n = await e(), i = await ye({
|
|
4635
|
-
query: z.UPDATE_MEMORY.schema,
|
|
4636
|
-
data: { user: r, memoryId: s, text: a },
|
|
4637
|
-
headers: { authorization: `Bearer ${n}` }
|
|
4638
|
-
}), { data: o, errors: c } = await i.json();
|
|
4639
|
-
if (c)
|
|
4640
|
-
throw new Error(c[0]?.message || "Update memory failed");
|
|
4641
|
-
return o.updateMemory;
|
|
4642
|
-
},
|
|
4643
|
-
onSuccess: (r, s) => {
|
|
4644
|
-
t.invalidateQueries({
|
|
4645
|
-
queryKey: [re.USER_MEMORIES, s.user]
|
|
4646
|
-
});
|
|
4647
|
-
}
|
|
4648
|
-
});
|
|
4649
|
-
}, Lc = ({
|
|
4620
|
+
}), Lc = ({
|
|
4650
4621
|
getAccessToken: e
|
|
4651
4622
|
}) => {
|
|
4652
|
-
const t =
|
|
4653
|
-
return
|
|
4623
|
+
const t = nt();
|
|
4624
|
+
return Dr({
|
|
4654
4625
|
mutationFn: async ({
|
|
4655
4626
|
user: r,
|
|
4656
4627
|
memoryId: s
|
|
4657
4628
|
}) => {
|
|
4658
|
-
const a = await e(), n = await
|
|
4659
|
-
query:
|
|
4629
|
+
const a = await e(), n = await Oe({
|
|
4630
|
+
query: te.DELETE_MEMORY.schema,
|
|
4660
4631
|
data: { user: r, memoryId: s },
|
|
4661
4632
|
headers: { authorization: `Bearer ${a}` }
|
|
4662
4633
|
}), { data: i, errors: o } = await n.json();
|
|
@@ -4666,18 +4637,18 @@ const G = {
|
|
|
4666
4637
|
},
|
|
4667
4638
|
onSuccess: (r, s) => {
|
|
4668
4639
|
t.invalidateQueries({
|
|
4669
|
-
queryKey: [
|
|
4640
|
+
queryKey: [oe.USER_MEMORIES, s.user]
|
|
4670
4641
|
});
|
|
4671
4642
|
}
|
|
4672
4643
|
});
|
|
4673
4644
|
}, Uc = ({
|
|
4674
4645
|
getAccessToken: e
|
|
4675
4646
|
}) => {
|
|
4676
|
-
const t =
|
|
4677
|
-
return
|
|
4647
|
+
const t = nt();
|
|
4648
|
+
return Dr({
|
|
4678
4649
|
mutationFn: async ({ user: r }) => {
|
|
4679
|
-
const s = await e(), a = await
|
|
4680
|
-
query:
|
|
4650
|
+
const s = await e(), a = await Oe({
|
|
4651
|
+
query: te.DELETE_MEMORIES.schema,
|
|
4681
4652
|
data: { user: r },
|
|
4682
4653
|
headers: { authorization: `Bearer ${s}` }
|
|
4683
4654
|
}), { data: n, errors: i } = await a.json();
|
|
@@ -4687,11 +4658,11 @@ const G = {
|
|
|
4687
4658
|
},
|
|
4688
4659
|
onSuccess: (r, s) => {
|
|
4689
4660
|
t.invalidateQueries({
|
|
4690
|
-
queryKey: [
|
|
4661
|
+
queryKey: [oe.USER_MEMORIES, s.user]
|
|
4691
4662
|
});
|
|
4692
4663
|
}
|
|
4693
4664
|
});
|
|
4694
|
-
},
|
|
4665
|
+
}, be = async ({
|
|
4695
4666
|
params: e,
|
|
4696
4667
|
type: t,
|
|
4697
4668
|
noAuth: r,
|
|
@@ -4701,13 +4672,13 @@ const G = {
|
|
|
4701
4672
|
const a = t?.data ? t.data(e) : e;
|
|
4702
4673
|
let n;
|
|
4703
4674
|
if (r === !0)
|
|
4704
|
-
n = await
|
|
4675
|
+
n = await Oe({
|
|
4705
4676
|
query: t.schema,
|
|
4706
4677
|
data: a
|
|
4707
4678
|
});
|
|
4708
4679
|
else if (s) {
|
|
4709
4680
|
const f = await s();
|
|
4710
|
-
n = await
|
|
4681
|
+
n = await Oe({
|
|
4711
4682
|
headers: {
|
|
4712
4683
|
authorization: `Bearer ${f}`
|
|
4713
4684
|
},
|
|
@@ -4729,7 +4700,7 @@ const G = {
|
|
|
4729
4700
|
}
|
|
4730
4701
|
}, ls = xt(
|
|
4731
4702
|
void 0
|
|
4732
|
-
),
|
|
4703
|
+
), gr = {
|
|
4733
4704
|
capabilities: /* @__PURE__ */ new Set(),
|
|
4734
4705
|
version: null,
|
|
4735
4706
|
status: "idle"
|
|
@@ -4738,7 +4709,7 @@ const G = {
|
|
|
4738
4709
|
getAccessToken: t,
|
|
4739
4710
|
children: r
|
|
4740
4711
|
}) => {
|
|
4741
|
-
const [s, a] =
|
|
4712
|
+
const [s, a] = ne(gr), n = Je(
|
|
4742
4713
|
() => e ? `entitlements:${e}` : null,
|
|
4743
4714
|
[e]
|
|
4744
4715
|
), i = Y(() => {
|
|
@@ -4759,19 +4730,19 @@ const G = {
|
|
|
4759
4730
|
}
|
|
4760
4731
|
return !1;
|
|
4761
4732
|
}, [n]);
|
|
4762
|
-
|
|
4733
|
+
W(() => {
|
|
4763
4734
|
s.status === "idle" && i();
|
|
4764
4735
|
}, [i, s.status]);
|
|
4765
4736
|
const o = ci({ user: e, getAccessToken: t });
|
|
4766
|
-
|
|
4737
|
+
W(() => {
|
|
4767
4738
|
o.isLoading && s.status === "idle" && a((u) => ({ ...u, status: "loading" }));
|
|
4768
|
-
}, [o.isLoading, s.status]),
|
|
4739
|
+
}, [o.isLoading, s.status]), W(() => {
|
|
4769
4740
|
o.isError && a((u) => ({
|
|
4770
4741
|
...u,
|
|
4771
4742
|
status: "error",
|
|
4772
4743
|
error: String(o.error)
|
|
4773
4744
|
}));
|
|
4774
|
-
}, [o.isError, o.error]),
|
|
4745
|
+
}, [o.isError, o.error]), W(() => {
|
|
4775
4746
|
const u = o.data?.entitlements;
|
|
4776
4747
|
if (u && (a({
|
|
4777
4748
|
capabilities: new Set(u.capabilities || []),
|
|
@@ -4810,7 +4781,7 @@ const G = {
|
|
|
4810
4781
|
},
|
|
4811
4782
|
[n]
|
|
4812
4783
|
), f = Y(() => {
|
|
4813
|
-
if (a(
|
|
4784
|
+
if (a(gr), n)
|
|
4814
4785
|
try {
|
|
4815
4786
|
sessionStorage.removeItem(n);
|
|
4816
4787
|
} catch {
|
|
@@ -4827,12 +4798,12 @@ const G = {
|
|
|
4827
4798
|
return /* @__PURE__ */ h(ls.Provider, { value: d, children: r });
|
|
4828
4799
|
};
|
|
4829
4800
|
function Fc() {
|
|
4830
|
-
const e =
|
|
4801
|
+
const e = at(ls);
|
|
4831
4802
|
if (!e)
|
|
4832
4803
|
throw new Error("useEntitlements must be used within EntitlementsProvider");
|
|
4833
4804
|
return e;
|
|
4834
4805
|
}
|
|
4835
|
-
const
|
|
4806
|
+
const br = (e) => Number.isFinite(e) ? e : 0;
|
|
4836
4807
|
function ui(e) {
|
|
4837
4808
|
return {
|
|
4838
4809
|
days: Math.trunc(e / 864e5),
|
|
@@ -4840,8 +4811,8 @@ function ui(e) {
|
|
|
4840
4811
|
minutes: Math.trunc(e / 6e4 % 60),
|
|
4841
4812
|
seconds: Math.trunc(e / 1e3 % 60),
|
|
4842
4813
|
milliseconds: Math.trunc(e % 1e3),
|
|
4843
|
-
microseconds: Math.trunc(
|
|
4844
|
-
nanoseconds: Math.trunc(
|
|
4814
|
+
microseconds: Math.trunc(br(e * 1e3) % 1e3),
|
|
4815
|
+
nanoseconds: Math.trunc(br(e * 1e6) % 1e3)
|
|
4845
4816
|
};
|
|
4846
4817
|
}
|
|
4847
4818
|
function di(e) {
|
|
@@ -4912,7 +4883,7 @@ function gi(e, t) {
|
|
|
4912
4883
|
const f = t.colonNotation ? ":" : " ";
|
|
4913
4884
|
return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), s + a.join(f);
|
|
4914
4885
|
}
|
|
4915
|
-
const us = process.env.NODE_ENV === "production",
|
|
4886
|
+
const us = process.env.NODE_ENV === "production", Gt = !us, ds = Gt ? "gizmette.local.com" : "gizmette.com", Bt = (e, t) => {
|
|
4916
4887
|
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;
|
|
4917
4888
|
return {
|
|
4918
4889
|
dir: r,
|
|
@@ -4923,12 +4894,12 @@ const us = process.env.NODE_ENV === "production", Bt = !us, ds = Bt ? "gizmette.
|
|
|
4923
4894
|
}, bi = (e) => {
|
|
4924
4895
|
if (!e && e !== 0)
|
|
4925
4896
|
return "N/A";
|
|
4926
|
-
const t =
|
|
4897
|
+
const t = Bt(e, !1);
|
|
4927
4898
|
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
4928
4899
|
}, Ei = (e) => {
|
|
4929
4900
|
if (!e && e !== 0)
|
|
4930
4901
|
return "N/A";
|
|
4931
|
-
const t =
|
|
4902
|
+
const t = Bt(e, !0);
|
|
4932
4903
|
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
4933
4904
|
}, wi = async () => {
|
|
4934
4905
|
const e = {
|
|
@@ -4984,7 +4955,7 @@ const us = process.env.NODE_ENV === "production", Bt = !us, ds = Bt ? "gizmette.
|
|
|
4984
4955
|
window.atob(e).split("").map(function(t) {
|
|
4985
4956
|
return `%${`00${t.charCodeAt(0).toString(16)}`.slice(-2)}`;
|
|
4986
4957
|
}).join("")
|
|
4987
|
-
), Ti = (e, t, r) => t ? Object.keys(t).map((s) => /* @__PURE__ */ h("dl", { className: "my-0", children: /* @__PURE__ */
|
|
4958
|
+
), Ti = (e, t, r) => t ? Object.keys(t).map((s) => /* @__PURE__ */ h("dl", { className: "my-0", children: /* @__PURE__ */ q("div", { className: "flex items-center justify-between", children: [
|
|
4988
4959
|
/* @__PURE__ */ h(
|
|
4989
4960
|
"dt",
|
|
4990
4961
|
{
|
|
@@ -5081,7 +5052,7 @@ const Ii = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5081
5052
|
theme: c,
|
|
5082
5053
|
transition: f,
|
|
5083
5054
|
icon: d
|
|
5084
|
-
}), Hc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DOMAIN: ds, convertCamelCaseToReadable: $i, convertDDToDMS:
|
|
5055
|
+
}), Hc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DOMAIN: ds, convertCamelCaseToReadable: $i, convertDDToDMS: Bt, convertLatitudeToDMS: bi, convertLongitudeToDMS: Ei, debounce: Oi, durationFormatter: Ri, extractAverage: Ai, getCurrentGeoLocation: wi, getLayoutPaddingClass: fs, getMessageContaintWrapperClass: hs, isDev: Gt, isLastMessageFromRole: Ii, isPWAMode: Pi, isProbablyMobile: ps, isProbablyTablet: ys, isProbablyiPad: Ni, isProbablyiPhone: ki, isProd: us, isTauri: ms, numberFormatter: _i, obfuscate: Si, pluralize: Ci, renderDataAsList: Ti, toastOptions: xi, unObfuscate: vi }, Symbol.toStringTag, { value: "Module" })), Er = "av-button", ct = "icon", Wt = "button", Pt = "link", Di = ({
|
|
5085
5056
|
type: e,
|
|
5086
5057
|
size: t,
|
|
5087
5058
|
labelRight: r,
|
|
@@ -5117,7 +5088,7 @@ const Ii = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5117
5088
|
"h-12": t === "large" && n && (r || s)
|
|
5118
5089
|
});
|
|
5119
5090
|
}
|
|
5120
|
-
},
|
|
5091
|
+
}, Mi = ({
|
|
5121
5092
|
type: e,
|
|
5122
5093
|
size: t,
|
|
5123
5094
|
labelRight: r,
|
|
@@ -5325,7 +5296,7 @@ const Ii = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5325
5296
|
"focus:outline-focus-light": e === "light",
|
|
5326
5297
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
5327
5298
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
5328
|
-
}),
|
|
5299
|
+
}), Wi = ({
|
|
5329
5300
|
mode: e,
|
|
5330
5301
|
raw: t,
|
|
5331
5302
|
iconClassName: r,
|
|
@@ -5352,7 +5323,7 @@ const Ii = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5352
5323
|
} : s === "selected" && (a = {
|
|
5353
5324
|
"text-copy-lighter": !0
|
|
5354
5325
|
}), y(a, r);
|
|
5355
|
-
},
|
|
5326
|
+
}, qi = ({
|
|
5356
5327
|
animated: e
|
|
5357
5328
|
}) => y({
|
|
5358
5329
|
"transition-opacity duration-300 ease-in-out": e
|
|
@@ -5374,8 +5345,8 @@ const Ii = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5374
5345
|
align: p,
|
|
5375
5346
|
radius: g,
|
|
5376
5347
|
animated: b
|
|
5377
|
-
}) => (l || (l = "primary"), r ? y(
|
|
5378
|
-
|
|
5348
|
+
}) => (l || (l = "primary"), r ? y(Er, t) : y(
|
|
5349
|
+
Er,
|
|
5379
5350
|
Li({
|
|
5380
5351
|
mode: s,
|
|
5381
5352
|
variant: l,
|
|
@@ -5384,7 +5355,7 @@ const Ii = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5384
5355
|
}),
|
|
5385
5356
|
Ui({ mode: s, noBackground: u, variant: l }),
|
|
5386
5357
|
Fi({ radius: g }),
|
|
5387
|
-
|
|
5358
|
+
Di({
|
|
5388
5359
|
type: e,
|
|
5389
5360
|
size: o,
|
|
5390
5361
|
labelRight: f,
|
|
@@ -5392,7 +5363,7 @@ const Ii = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5392
5363
|
align: p,
|
|
5393
5364
|
animated: b
|
|
5394
5365
|
}),
|
|
5395
|
-
|
|
5366
|
+
Mi({ type: e, size: o, labelRight: f, labelLeft: d }),
|
|
5396
5367
|
Gi({ mode: s, variant: l, noBorder: c }),
|
|
5397
5368
|
Bi({ focusMode: a }),
|
|
5398
5369
|
Hi({ mode: s, variant: l, disabled: n }),
|
|
@@ -5407,7 +5378,7 @@ const Ii = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5407
5378
|
t
|
|
5408
5379
|
)), ji = (e, t, r) => {
|
|
5409
5380
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof e?.currentTarget?.focus == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
|
|
5410
|
-
},
|
|
5381
|
+
}, qt = ie.forwardRef((e, t) => {
|
|
5411
5382
|
const { onClick: r, noInternalClick: s = !1, ...a } = e;
|
|
5412
5383
|
return /* @__PURE__ */ h(
|
|
5413
5384
|
"button",
|
|
@@ -5420,8 +5391,8 @@ const Ii = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
5420
5391
|
}
|
|
5421
5392
|
);
|
|
5422
5393
|
});
|
|
5423
|
-
|
|
5424
|
-
const bs =
|
|
5394
|
+
qt.displayName = "BaseButton";
|
|
5395
|
+
const bs = ie.forwardRef(
|
|
5425
5396
|
({
|
|
5426
5397
|
children: e,
|
|
5427
5398
|
disabled: t = !1,
|
|
@@ -5452,7 +5423,7 @@ const bs = oe.forwardRef(
|
|
|
5452
5423
|
radius: u
|
|
5453
5424
|
});
|
|
5454
5425
|
return /* @__PURE__ */ h(
|
|
5455
|
-
|
|
5426
|
+
qt,
|
|
5456
5427
|
{
|
|
5457
5428
|
ref: m,
|
|
5458
5429
|
className: p,
|
|
@@ -5466,7 +5437,7 @@ const bs = oe.forwardRef(
|
|
|
5466
5437
|
bs.displayName = "Button";
|
|
5467
5438
|
function Vi() {
|
|
5468
5439
|
const e = j(!1);
|
|
5469
|
-
return
|
|
5440
|
+
return W(() => (e.current = !0, () => {
|
|
5470
5441
|
e.current = !1;
|
|
5471
5442
|
}), []), Y(() => e.current, []);
|
|
5472
5443
|
}
|
|
@@ -5478,7 +5449,7 @@ function Es(e) {
|
|
|
5478
5449
|
});
|
|
5479
5450
|
}, [...e]);
|
|
5480
5451
|
}
|
|
5481
|
-
const
|
|
5452
|
+
const Ji = {
|
|
5482
5453
|
x: 0,
|
|
5483
5454
|
y: 0,
|
|
5484
5455
|
width: 0,
|
|
@@ -5488,14 +5459,14 @@ const Qi = {
|
|
|
5488
5459
|
bottom: 0,
|
|
5489
5460
|
right: 0
|
|
5490
5461
|
};
|
|
5491
|
-
function
|
|
5492
|
-
const t = Vi(), r = j(0), s = j(null), [a, n] =
|
|
5462
|
+
function je(e) {
|
|
5463
|
+
const t = Vi(), r = j(0), s = j(null), [a, n] = ne(Ji), i = Je(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((o) => {
|
|
5493
5464
|
const c = o[0];
|
|
5494
5465
|
c && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
5495
5466
|
s.current && t() && n(c.contentRect);
|
|
5496
5467
|
}));
|
|
5497
5468
|
}), [t]);
|
|
5498
|
-
return
|
|
5469
|
+
return W(() => (s.current && i?.observe(s.current, e), () => {
|
|
5499
5470
|
i?.disconnect(), r.current && cancelAnimationFrame(r.current);
|
|
5500
5471
|
}), [i, e]), [s, a];
|
|
5501
5472
|
}
|
|
@@ -5510,21 +5481,21 @@ function ws(e) {
|
|
|
5510
5481
|
return typeof r == "number" || typeof r == "string" ? `${s}${r}` : `${s}${t}`;
|
|
5511
5482
|
}
|
|
5512
5483
|
}
|
|
5513
|
-
const
|
|
5484
|
+
const Be = {
|
|
5514
5485
|
small: 24,
|
|
5515
5486
|
// w-6
|
|
5516
5487
|
medium: 32,
|
|
5517
5488
|
// w-8
|
|
5518
5489
|
large: 48
|
|
5519
5490
|
// w-12
|
|
5520
|
-
},
|
|
5491
|
+
}, Qi = {
|
|
5521
5492
|
small: 16,
|
|
5522
5493
|
// px-2 x 2
|
|
5523
5494
|
medium: 24,
|
|
5524
5495
|
// px-3 x 2
|
|
5525
5496
|
large: 32
|
|
5526
5497
|
// px-4 x 2
|
|
5527
|
-
}, Yi = 2, zi = 300,
|
|
5498
|
+
}, Yi = 2, zi = 300, rt = ie.forwardRef(
|
|
5528
5499
|
({
|
|
5529
5500
|
children: e,
|
|
5530
5501
|
disabled: t = !1,
|
|
@@ -5548,7 +5519,7 @@ const qe = {
|
|
|
5548
5519
|
animated: A = !1,
|
|
5549
5520
|
...K
|
|
5550
5521
|
}, R) => {
|
|
5551
|
-
const
|
|
5522
|
+
const Q = gs({
|
|
5552
5523
|
type: ct,
|
|
5553
5524
|
mode: r,
|
|
5554
5525
|
focusMode: s,
|
|
@@ -5565,15 +5536,15 @@ const qe = {
|
|
|
5565
5536
|
radius: b,
|
|
5566
5537
|
variant: E,
|
|
5567
5538
|
animated: A
|
|
5568
|
-
}), C =
|
|
5569
|
-
return
|
|
5570
|
-
ce && ce.current && A && (w.current =
|
|
5571
|
-
}, [
|
|
5539
|
+
}), C = Wi({ mode: r, raw: o, iconClassName: O, variant: E }), v = qi({ animated: A }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [_, I] = je(), [N, V] = je(), [ce, Ee] = je(), w = j(0), T = j(null), S = j(null), le = Es([R, T]);
|
|
5540
|
+
return Qe(() => {
|
|
5541
|
+
ce && ce.current && A && (w.current = Ee.width + Qi[u] + (c ? 0 : Yi), T.current && !T.current.style.width && (T.current.style.width = `${Be[u]}px`));
|
|
5542
|
+
}, [Ee, ce, u, c, A]), Qe(() => {
|
|
5572
5543
|
if (T && T.current && A) {
|
|
5573
|
-
let ue =
|
|
5574
|
-
l && _ && I.width > 0 ? ue = I.width + w.current : m && N && V.width > 0 && (ue = V.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 >
|
|
5544
|
+
let ue = Be[u];
|
|
5545
|
+
l && _ && I.width > 0 ? ue = I.width + w.current : m && N && V.width > 0 && (ue = V.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 > Be[u] && (S.current = setTimeout(() => {
|
|
5575
5546
|
_.current && l && (_.current.style.opacity = "1"), N.current && m && (N.current.style.opacity = "1"), S.current = null;
|
|
5576
|
-
}, zi * 0.8))), ue ===
|
|
5547
|
+
}, zi * 0.8))), ue === Be[u] && (_.current && (_.current.style.opacity = "0"), N.current && (N.current.style.opacity = "0"));
|
|
5577
5548
|
}
|
|
5578
5549
|
}, [
|
|
5579
5550
|
I,
|
|
@@ -5584,20 +5555,20 @@ const qe = {
|
|
|
5584
5555
|
N,
|
|
5585
5556
|
u,
|
|
5586
5557
|
A
|
|
5587
|
-
]),
|
|
5558
|
+
]), W(() => () => {
|
|
5588
5559
|
S.current && clearTimeout(S.current);
|
|
5589
5560
|
}, []), /* @__PURE__ */ h(
|
|
5590
|
-
|
|
5561
|
+
qt,
|
|
5591
5562
|
{
|
|
5592
5563
|
ref: le,
|
|
5593
|
-
className:
|
|
5564
|
+
className: Q,
|
|
5594
5565
|
disabled: t,
|
|
5595
5566
|
type: i,
|
|
5596
5567
|
"aria-label": f || d,
|
|
5597
5568
|
...K,
|
|
5598
|
-
children: /* @__PURE__ */
|
|
5569
|
+
children: /* @__PURE__ */ q("div", { className: x, children: [
|
|
5599
5570
|
/* @__PURE__ */ h(
|
|
5600
|
-
|
|
5571
|
+
wr,
|
|
5601
5572
|
{
|
|
5602
5573
|
label: m,
|
|
5603
5574
|
labelRef: N,
|
|
@@ -5608,7 +5579,7 @@ const qe = {
|
|
|
5608
5579
|
),
|
|
5609
5580
|
/* @__PURE__ */ h("span", { ref: ce, className: C, children: e }),
|
|
5610
5581
|
/* @__PURE__ */ h(
|
|
5611
|
-
|
|
5582
|
+
wr,
|
|
5612
5583
|
{
|
|
5613
5584
|
label: l,
|
|
5614
5585
|
labelRef: _,
|
|
@@ -5621,7 +5592,7 @@ const qe = {
|
|
|
5621
5592
|
}
|
|
5622
5593
|
);
|
|
5623
5594
|
}
|
|
5624
|
-
),
|
|
5595
|
+
), wr = ({
|
|
5625
5596
|
labelRef: e,
|
|
5626
5597
|
labelClass: t,
|
|
5627
5598
|
label: r,
|
|
@@ -5636,7 +5607,7 @@ const qe = {
|
|
|
5636
5607
|
children: r && /* @__PURE__ */ h("span", { className: s, children: r })
|
|
5637
5608
|
}
|
|
5638
5609
|
);
|
|
5639
|
-
|
|
5610
|
+
rt.displayName = "ButtonIcon";
|
|
5640
5611
|
/*!
|
|
5641
5612
|
@versini/ui-button v8.0.1
|
|
5642
5613
|
© 2025 gizmette.com
|
|
@@ -5650,7 +5621,7 @@ try {
|
|
|
5650
5621
|
});
|
|
5651
5622
|
} catch {
|
|
5652
5623
|
}
|
|
5653
|
-
const Xi =
|
|
5624
|
+
const Xi = ie.forwardRef(
|
|
5654
5625
|
({
|
|
5655
5626
|
children: e,
|
|
5656
5627
|
mode: t = "system",
|
|
@@ -5676,7 +5647,7 @@ const Xi = oe.forwardRef(
|
|
|
5676
5647
|
}
|
|
5677
5648
|
) : "";
|
|
5678
5649
|
return /* @__PURE__ */ h("div", { className: i, children: /* @__PURE__ */ h(
|
|
5679
|
-
|
|
5650
|
+
rt,
|
|
5680
5651
|
{
|
|
5681
5652
|
className: r,
|
|
5682
5653
|
ref: n,
|
|
@@ -5691,7 +5662,7 @@ const Xi = oe.forwardRef(
|
|
|
5691
5662
|
}
|
|
5692
5663
|
);
|
|
5693
5664
|
Xi.displayName = "ButtonSort";
|
|
5694
|
-
const
|
|
5665
|
+
const Ve = "av-card", Zi = ({
|
|
5695
5666
|
className: e,
|
|
5696
5667
|
headerClassName: t,
|
|
5697
5668
|
bodyClassName: r,
|
|
@@ -5701,7 +5672,7 @@ const Qe = "av-card", Zi = ({
|
|
|
5701
5672
|
noBorder: i
|
|
5702
5673
|
}) => {
|
|
5703
5674
|
const o = y(
|
|
5704
|
-
|
|
5675
|
+
Ve,
|
|
5705
5676
|
"rounded-md",
|
|
5706
5677
|
{
|
|
5707
5678
|
"border-none": i,
|
|
@@ -5715,7 +5686,7 @@ const Qe = "av-card", Zi = ({
|
|
|
5715
5686
|
"border-border-accent bg-surface-dark text-copy-light dark:border-border-dark dark:bg-surface-lighter dark:text-copy-dark": a === "alt-system"
|
|
5716
5687
|
},
|
|
5717
5688
|
e
|
|
5718
|
-
), c = t || y(`${
|
|
5689
|
+
), c = t || y(`${Ve}__header mt-0 border-b-2`, {
|
|
5719
5690
|
"text-copy-light border-border-accent": a === "darker",
|
|
5720
5691
|
"border-border-accent": a === "dark",
|
|
5721
5692
|
"border-border-medium": a === "light",
|
|
@@ -5723,7 +5694,7 @@ const Qe = "av-card", Zi = ({
|
|
|
5723
5694
|
"border-border-accent dark:border-border-medium": a === "alt-system",
|
|
5724
5695
|
"mb-4": !n,
|
|
5725
5696
|
"mb-2": n
|
|
5726
|
-
}), f = y(r), d = s || y(`${
|
|
5697
|
+
}), f = y(r), d = s || y(`${Ve}__footer pt-2`);
|
|
5727
5698
|
return {
|
|
5728
5699
|
wrapper: o,
|
|
5729
5700
|
header: c,
|
|
@@ -5754,7 +5725,7 @@ const to = ({
|
|
|
5754
5725
|
...u
|
|
5755
5726
|
}) => {
|
|
5756
5727
|
let l = null, m = null;
|
|
5757
|
-
const p = typeof e == "string", g = ws(
|
|
5728
|
+
const p = typeof e == "string", g = ws(Ve), b = Zi({
|
|
5758
5729
|
className: n,
|
|
5759
5730
|
headerClassName: t,
|
|
5760
5731
|
bodyClassName: i,
|
|
@@ -5763,7 +5734,7 @@ const to = ({
|
|
|
5763
5734
|
compact: f,
|
|
5764
5735
|
noBorder: d
|
|
5765
5736
|
});
|
|
5766
|
-
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__ */
|
|
5737
|
+
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__ */ q(
|
|
5767
5738
|
"section",
|
|
5768
5739
|
{
|
|
5769
5740
|
...m && {
|
|
@@ -5812,7 +5783,7 @@ const lt = ({
|
|
|
5812
5783
|
...c
|
|
5813
5784
|
}) => {
|
|
5814
5785
|
const f = y(n, s);
|
|
5815
|
-
return /* @__PURE__ */
|
|
5786
|
+
return /* @__PURE__ */ q(
|
|
5816
5787
|
"svg",
|
|
5817
5788
|
{
|
|
5818
5789
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5866,7 +5837,7 @@ const ro = ({
|
|
|
5866
5837
|
title: r,
|
|
5867
5838
|
monotone: s,
|
|
5868
5839
|
...a
|
|
5869
|
-
}) => /* @__PURE__ */
|
|
5840
|
+
}) => /* @__PURE__ */ q(
|
|
5870
5841
|
lt,
|
|
5871
5842
|
{
|
|
5872
5843
|
defaultViewBox: "0 0 640 512",
|
|
@@ -5894,7 +5865,7 @@ const ro = ({
|
|
|
5894
5865
|
...a
|
|
5895
5866
|
}) => {
|
|
5896
5867
|
const n = s ? "1" : "0.4";
|
|
5897
|
-
return /* @__PURE__ */
|
|
5868
|
+
return /* @__PURE__ */ q(
|
|
5898
5869
|
lt,
|
|
5899
5870
|
{
|
|
5900
5871
|
defaultViewBox: "0 0 190 190",
|
|
@@ -5928,7 +5899,7 @@ const ro = ({
|
|
|
5928
5899
|
title: r,
|
|
5929
5900
|
monotone: s,
|
|
5930
5901
|
...a
|
|
5931
|
-
}) => /* @__PURE__ */
|
|
5902
|
+
}) => /* @__PURE__ */ q(
|
|
5932
5903
|
lt,
|
|
5933
5904
|
{
|
|
5934
5905
|
defaultViewBox: "0 0 576 512",
|
|
@@ -5962,7 +5933,7 @@ try {
|
|
|
5962
5933
|
});
|
|
5963
5934
|
} catch {
|
|
5964
5935
|
}
|
|
5965
|
-
const io = "av-flexgrid", We = "av-flexgrid-item",
|
|
5936
|
+
const io = "av-flexgrid", We = "av-flexgrid-item", st = 0.25, $t = ie.createContext({
|
|
5966
5937
|
columnGap: 0,
|
|
5967
5938
|
rowGap: 0
|
|
5968
5939
|
}), oo = ({
|
|
@@ -5988,8 +5959,8 @@ const io = "av-flexgrid", We = "av-flexgrid-item", at = 0.25, $t = oe.createCont
|
|
|
5988
5959
|
* by the columnGap and rowGap that will be applied
|
|
5989
5960
|
* to all FlexgridItems (see context and paddings).
|
|
5990
5961
|
*/
|
|
5991
|
-
marginLeft: r * -1 *
|
|
5992
|
-
marginTop: s * -1 *
|
|
5962
|
+
marginLeft: r * -1 * st + "rem",
|
|
5963
|
+
marginTop: s * -1 * st + "rem"
|
|
5993
5964
|
}, u = y(
|
|
5994
5965
|
io,
|
|
5995
5966
|
"box-border flex flex-wrap"
|
|
@@ -6097,9 +6068,9 @@ const io = "av-flexgrid", We = "av-flexgrid-item", at = 0.25, $t = oe.createCont
|
|
|
6097
6068
|
span: r,
|
|
6098
6069
|
...s
|
|
6099
6070
|
}) => {
|
|
6100
|
-
const { columnGap: a, rowGap: n } =
|
|
6101
|
-
paddingLeft: a *
|
|
6102
|
-
paddingTop: n *
|
|
6071
|
+
const { columnGap: a, rowGap: n } = at($t), i = {
|
|
6072
|
+
paddingLeft: a * st + "rem",
|
|
6073
|
+
paddingTop: n * st + "rem"
|
|
6103
6074
|
}, o = co({
|
|
6104
6075
|
className: t,
|
|
6105
6076
|
span: r
|
|
@@ -6149,7 +6120,7 @@ const Ss = "SET_ANNOUNCEMENT", vs = "CLEAR_ANNOUNCEMENT", lo = {
|
|
|
6149
6120
|
t({
|
|
6150
6121
|
type: vs
|
|
6151
6122
|
}), typeof e == "function" && e();
|
|
6152
|
-
},
|
|
6123
|
+
}, Sr = ({
|
|
6153
6124
|
children: e,
|
|
6154
6125
|
clearAnnouncementDelay: t,
|
|
6155
6126
|
clearAnnouncementTimeoutRef: r,
|
|
@@ -6175,13 +6146,13 @@ const Ss = "SET_ANNOUNCEMENT", vs = "CLEAR_ANNOUNCEMENT", lo = {
|
|
|
6175
6146
|
onAnnouncementClear: n,
|
|
6176
6147
|
dispatch: i
|
|
6177
6148
|
}) => {
|
|
6178
|
-
clearTimeout(t.current), r ? t.current = setTimeout(
|
|
6149
|
+
clearTimeout(t.current), r ? t.current = setTimeout(Sr, r, {
|
|
6179
6150
|
children: e,
|
|
6180
6151
|
clearAnnouncementDelay: s,
|
|
6181
6152
|
clearAnnouncementTimeoutRef: a,
|
|
6182
6153
|
onAnnouncementClear: n,
|
|
6183
6154
|
dispatch: i
|
|
6184
|
-
}) :
|
|
6155
|
+
}) : Sr({
|
|
6185
6156
|
children: e,
|
|
6186
6157
|
clearAnnouncementDelay: s,
|
|
6187
6158
|
clearAnnouncementTimeoutRef: a,
|
|
@@ -6200,11 +6171,11 @@ function Ts({
|
|
|
6200
6171
|
visible: o,
|
|
6201
6172
|
...c
|
|
6202
6173
|
}) {
|
|
6203
|
-
const f = j(null), d = j(null), [u, l] =
|
|
6174
|
+
const f = j(null), d = j(null), [u, l] = Ir(uo, {
|
|
6204
6175
|
announcement: null
|
|
6205
6176
|
});
|
|
6206
6177
|
let m = r;
|
|
6207
|
-
typeof m > "u" && (m = s ? lo[s] : "assertive"),
|
|
6178
|
+
typeof m > "u" && (m = s ? lo[s] : "assertive"), W(() => {
|
|
6208
6179
|
fo({
|
|
6209
6180
|
announcementTimeoutRef: f,
|
|
6210
6181
|
announcementDelay: a,
|
|
@@ -6385,7 +6356,7 @@ const As = "av-text-input", mo = "av-text-input-wrapper", vt = "av-text-input-he
|
|
|
6385
6356
|
helperText: g,
|
|
6386
6357
|
rightElement: b
|
|
6387
6358
|
};
|
|
6388
|
-
},
|
|
6359
|
+
}, jt = ie.forwardRef(
|
|
6389
6360
|
({
|
|
6390
6361
|
id: e,
|
|
6391
6362
|
name: t,
|
|
@@ -6407,7 +6378,7 @@ const As = "av-text-input", mo = "av-text-input-wrapper", vt = "av-text-input-he
|
|
|
6407
6378
|
size: E = "md",
|
|
6408
6379
|
...O
|
|
6409
6380
|
}, A) => {
|
|
6410
|
-
const [K, R] =
|
|
6381
|
+
const [K, R] = je(), [Q, C] = ne(0), v = ws({ id: e, prefix: `${As}-` }), x = `${t} error, ${p}`, _ = j(null), I = j(null), N = {
|
|
6411
6382
|
xs: { label: "-25px", helperText: "30px" },
|
|
6412
6383
|
sm: { label: "-29px", helperText: "34px" },
|
|
6413
6384
|
md: { label: "-33px", helperText: "38px" },
|
|
@@ -6425,15 +6396,15 @@ const As = "av-text-input", mo = "av-text-input-wrapper", vt = "av-text-input-he
|
|
|
6425
6396
|
size: E,
|
|
6426
6397
|
rightElementClassName: b
|
|
6427
6398
|
});
|
|
6428
|
-
return
|
|
6399
|
+
return Qe(() => {
|
|
6429
6400
|
R && R.width && C(R.width + 18 + 10);
|
|
6430
|
-
}, [R]),
|
|
6431
|
-
const { label: ce, helperText:
|
|
6401
|
+
}, [R]), Qe(() => {
|
|
6402
|
+
const { label: ce, helperText: Ee } = N[E];
|
|
6432
6403
|
_?.current?.style.setProperty("--av-text-input-label", ce), I?.current?.style.setProperty(
|
|
6433
6404
|
"--av-text-input-helper-text",
|
|
6434
|
-
|
|
6405
|
+
Ee
|
|
6435
6406
|
);
|
|
6436
|
-
}, [E]), /* @__PURE__ */
|
|
6407
|
+
}, [E]), /* @__PURE__ */ q("div", { className: V.wrapper, children: [
|
|
6437
6408
|
/* @__PURE__ */ h(
|
|
6438
6409
|
"label",
|
|
6439
6410
|
{
|
|
@@ -6455,7 +6426,7 @@ const As = "av-text-input", mo = "av-text-input-wrapper", vt = "av-text-input-he
|
|
|
6455
6426
|
className: V.input,
|
|
6456
6427
|
...p && { "aria-describedby": `${v}-helper` },
|
|
6457
6428
|
...s && { "aria-invalid": "true" },
|
|
6458
|
-
...g && !a && { style: { paddingRight:
|
|
6429
|
+
...g && !a && { style: { paddingRight: Q } },
|
|
6459
6430
|
...O
|
|
6460
6431
|
}
|
|
6461
6432
|
),
|
|
@@ -6490,8 +6461,8 @@ const As = "av-text-input", mo = "av-text-input-wrapper", vt = "av-text-input-he
|
|
|
6490
6461
|
] });
|
|
6491
6462
|
}
|
|
6492
6463
|
);
|
|
6493
|
-
|
|
6494
|
-
const So = 500, vo = 5e3, To = 2e4, Is =
|
|
6464
|
+
jt.displayName = "TextInput";
|
|
6465
|
+
const So = 500, vo = 5e3, To = 2e4, Is = ie.forwardRef(
|
|
6495
6466
|
({
|
|
6496
6467
|
name: e,
|
|
6497
6468
|
disabled: t,
|
|
@@ -6505,7 +6476,7 @@ const So = 500, vo = 5e3, To = 2e4, Is = oe.forwardRef(
|
|
|
6505
6476
|
rightElement: f,
|
|
6506
6477
|
...d
|
|
6507
6478
|
}, u) => {
|
|
6508
|
-
const [l, m] =
|
|
6479
|
+
const [l, m] = ne(!0), [p, g] = ne({
|
|
6509
6480
|
message: null,
|
|
6510
6481
|
politeness: null
|
|
6511
6482
|
}), b = j(!0), E = j(null), O = j(null), A = Es([u, O]), K = l ? "Show" : "Hide", R = () => {
|
|
@@ -6516,7 +6487,7 @@ const So = 500, vo = 5e3, To = 2e4, Is = oe.forwardRef(
|
|
|
6516
6487
|
message: `${r} hiding characters`
|
|
6517
6488
|
}), a && a(!0);
|
|
6518
6489
|
}, To));
|
|
6519
|
-
},
|
|
6490
|
+
}, Q = (I) => {
|
|
6520
6491
|
I.preventDefault();
|
|
6521
6492
|
const N = !b.current;
|
|
6522
6493
|
b.current = N, R(), m(N), g({
|
|
@@ -6534,11 +6505,11 @@ const So = 500, vo = 5e3, To = 2e4, Is = oe.forwardRef(
|
|
|
6534
6505
|
}, _ = (I) => {
|
|
6535
6506
|
R(), n && n(I);
|
|
6536
6507
|
};
|
|
6537
|
-
return
|
|
6508
|
+
return W(() => () => {
|
|
6538
6509
|
E.current && clearTimeout(E.current);
|
|
6539
|
-
}, []), /* @__PURE__ */
|
|
6510
|
+
}, []), /* @__PURE__ */ q(Ar, { children: [
|
|
6540
6511
|
/* @__PURE__ */ h(
|
|
6541
|
-
|
|
6512
|
+
jt,
|
|
6542
6513
|
{
|
|
6543
6514
|
ref: A,
|
|
6544
6515
|
name: e,
|
|
@@ -6549,10 +6520,10 @@ const So = 500, vo = 5e3, To = 2e4, Is = oe.forwardRef(
|
|
|
6549
6520
|
onBlur: v,
|
|
6550
6521
|
onFocus: x,
|
|
6551
6522
|
onChange: _,
|
|
6552
|
-
rightElement:
|
|
6523
|
+
rightElement: ie.cloneElement(f, {
|
|
6553
6524
|
ref: u,
|
|
6554
6525
|
label: K,
|
|
6555
|
-
onClick:
|
|
6526
|
+
onClick: Q,
|
|
6556
6527
|
onBlur: C,
|
|
6557
6528
|
disabled: t
|
|
6558
6529
|
}),
|
|
@@ -6585,8 +6556,8 @@ try {
|
|
|
6585
6556
|
});
|
|
6586
6557
|
} catch {
|
|
6587
6558
|
}
|
|
6588
|
-
const Ao = "ASK! ME! ANYTHING!", Io = "⭐︎ AI DEV MODE ⭐︎", _o = "Log in with a password", Ro = "Log in with a Passkey", Kc = "Log out", Co = "Password", Gc = "Usage", Bc = "Profile",
|
|
6589
|
-
Press Enter to send it or Shift+Enter for new line.`,
|
|
6559
|
+
const Ao = "ASK! ME! ANYTHING!", Io = "⭐︎ AI DEV MODE ⭐︎", _o = "Log in with a password", Ro = "Log in with a Passkey", Kc = "Log out", Co = "Password", Gc = "Usage", Bc = "Profile", Wc = "Settings", qc = "Chat history", jc = "About", Vt = "Type your message here.", Vc = Vt, Jc = `${Vt}
|
|
6560
|
+
Press Enter to send it or Shift+Enter for new line.`, Qc = `${Vt}
|
|
6590
6561
|
Press Ctrl+Enter to send it or Enter for new line.`, Yc = "{{clipboard}}", P = "Review important details.", zc = [
|
|
6591
6562
|
`Sometimes, ${k} just makes stuff up. ${P}`,
|
|
6592
6563
|
`${k} may invent facts on the fly. ${P}`,
|
|
@@ -6648,9 +6619,10 @@ Press Ctrl+Enter to send it or Enter for new line.`, Yc = "{{clipboard}}", P = "
|
|
|
6648
6619
|
SETTINGS_PROMPTS: {
|
|
6649
6620
|
TITLE: "Prompts"
|
|
6650
6621
|
},
|
|
6651
|
-
|
|
6622
|
+
SETTINGS_ADVANCED: {
|
|
6652
6623
|
TITLE: "Advanced Settings",
|
|
6653
|
-
|
|
6624
|
+
REASONING_BUTTON_DESCRIPTION: "The following option allows you to display the Reasoning button in the chat interface. When enabled, you can toggle reasoning mode ON and OFF for more in-depth analysis.",
|
|
6625
|
+
CACHE_DESCRIPTION: "The following option enables caching of application assets for faster loading and improved performance on slow networks. This feature improves performance by storing frequently used resources locally."
|
|
6654
6626
|
},
|
|
6655
6627
|
SETTINGS_DETAILS: {
|
|
6656
6628
|
TITLE: "Chats",
|
|
@@ -6662,7 +6634,7 @@ Press Ctrl+Enter to send it or Enter for new line.`, Yc = "{{clipboard}}", P = "
|
|
|
6662
6634
|
className: e,
|
|
6663
6635
|
isCapabilitiesSuccess: t,
|
|
6664
6636
|
capabilities: r
|
|
6665
|
-
}) => /* @__PURE__ */
|
|
6637
|
+
}) => /* @__PURE__ */ q(
|
|
6666
6638
|
"div",
|
|
6667
6639
|
{
|
|
6668
6640
|
className: y(
|
|
@@ -6671,26 +6643,26 @@ Press Ctrl+Enter to send it or Enter for new line.`, Yc = "{{clipboard}}", P = "
|
|
|
6671
6643
|
),
|
|
6672
6644
|
children: [
|
|
6673
6645
|
/* @__PURE__ */ h("div", { className: "basis-1/4", children: /* @__PURE__ */ h(ro, {}) }),
|
|
6674
|
-
/* @__PURE__ */
|
|
6646
|
+
/* @__PURE__ */ q("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
|
|
6675
6647
|
/* @__PURE__ */ h("h1", { children: k }),
|
|
6676
6648
|
/* @__PURE__ */ h("h2", { children: t && r?.runningMode === "development" ? Io : Ao })
|
|
6677
6649
|
] })
|
|
6678
6650
|
]
|
|
6679
6651
|
}
|
|
6680
6652
|
), ko = () => {
|
|
6681
|
-
const { login: e, logoutReason: t, loginWithPasskey: r } = as(), [s, a] =
|
|
6653
|
+
const { login: e, logoutReason: t, loginWithPasskey: r } = as(), [s, a] = ne(""), [n, i] = ne(""), [o, c] = ne(!0), [f, d] = ne({
|
|
6682
6654
|
username: "",
|
|
6683
6655
|
password: ""
|
|
6684
6656
|
}), u = async (l) => {
|
|
6685
6657
|
l.preventDefault(), await e(f.username, f.password) || (i(""), a("Invalid username or password"));
|
|
6686
6658
|
};
|
|
6687
|
-
return
|
|
6659
|
+
return W(() => {
|
|
6688
6660
|
document.getElementById("logo")?.classList.add("fadeOut"), setTimeout(() => {
|
|
6689
6661
|
document.getElementById("root")?.classList.replace("app-hidden", "fadeIn");
|
|
6690
6662
|
}, 500);
|
|
6691
|
-
}),
|
|
6663
|
+
}), W(() => {
|
|
6692
6664
|
t && i(t);
|
|
6693
|
-
}, [t]), /* @__PURE__ */
|
|
6665
|
+
}, [t]), /* @__PURE__ */ q("main", { className: fs({ extraClass: "mt-5" }), children: [
|
|
6694
6666
|
/* @__PURE__ */ h(
|
|
6695
6667
|
"div",
|
|
6696
6668
|
{
|
|
@@ -6700,10 +6672,10 @@ Press Ctrl+Enter to send it or Enter for new line.`, Yc = "{{clipboard}}", P = "
|
|
|
6700
6672
|
children: /* @__PURE__ */ h(Oo, {})
|
|
6701
6673
|
}
|
|
6702
6674
|
),
|
|
6703
|
-
/* @__PURE__ */ h("form", { className: "mt-5", onSubmit: u, children: /* @__PURE__ */ h(oo, { alignHorizontal: "center", children: /* @__PURE__ */ h(he, { span: 6, children: /* @__PURE__ */
|
|
6675
|
+
/* @__PURE__ */ h("form", { className: "mt-5", onSubmit: u, children: /* @__PURE__ */ h(oo, { alignHorizontal: "center", children: /* @__PURE__ */ h(he, { span: 6, children: /* @__PURE__ */ q(to, { mode: "dark", children: [
|
|
6704
6676
|
/* @__PURE__ */ h(he, { 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 }) }),
|
|
6705
6677
|
/* @__PURE__ */ h(he, { span: 12, children: /* @__PURE__ */ h(
|
|
6706
|
-
|
|
6678
|
+
jt,
|
|
6707
6679
|
{
|
|
6708
6680
|
className: "mt-7",
|
|
6709
6681
|
required: !0,
|
|
@@ -6736,7 +6708,7 @@ Press Ctrl+Enter to send it or Enter for new line.`, Yc = "{{clipboard}}", P = "
|
|
|
6736
6708
|
name: "password",
|
|
6737
6709
|
label: Co,
|
|
6738
6710
|
rightElement: /* @__PURE__ */ h(
|
|
6739
|
-
|
|
6711
|
+
rt,
|
|
6740
6712
|
{
|
|
6741
6713
|
focusMode: "light",
|
|
6742
6714
|
mode: "dark",
|
|
@@ -6767,10 +6739,10 @@ Press Ctrl+Enter to send it or Enter for new line.`, Yc = "{{clipboard}}", P = "
|
|
|
6767
6739
|
children: _o
|
|
6768
6740
|
}
|
|
6769
6741
|
) }),
|
|
6770
|
-
!ms() && /* @__PURE__ */
|
|
6742
|
+
!ms() && /* @__PURE__ */ q(Ar, { children: [
|
|
6771
6743
|
/* @__PURE__ */ h(he, { span: 12, children: /* @__PURE__ */ h("div", { className: "text-center text-copy-light mt-2 mb-2", children: "or" }) }),
|
|
6772
6744
|
/* @__PURE__ */ h(he, { span: 12, children: /* @__PURE__ */ h(
|
|
6773
|
-
|
|
6745
|
+
rt,
|
|
6774
6746
|
{
|
|
6775
6747
|
variant: "selected",
|
|
6776
6748
|
mode: "dark",
|
|
@@ -6785,10 +6757,10 @@ Press Ctrl+Enter to send it or Enter for new line.`, Yc = "{{clipboard}}", P = "
|
|
|
6785
6757
|
] })
|
|
6786
6758
|
] }) }) }) })
|
|
6787
6759
|
] });
|
|
6788
|
-
}, No = new URL(document.location.href).searchParams,
|
|
6760
|
+
}, No = new URL(document.location.href).searchParams, vr = !!No.get("debug") || !1, Po = Os(() => import(
|
|
6789
6761
|
/* webpackChunkName: "LazyApp" */
|
|
6790
|
-
"./App.
|
|
6791
|
-
).then((e) => e.App)), $o = new Xs(),
|
|
6762
|
+
"./App.BrPp8T2f.js"
|
|
6763
|
+
).then((e) => e.App)), $o = new Xs(), Tr = ({
|
|
6792
6764
|
isComponent: e,
|
|
6793
6765
|
headerHeight: t
|
|
6794
6766
|
}) => {
|
|
@@ -6805,20 +6777,20 @@ Press Ctrl+Enter to send it or Enter for new line.`, Yc = "{{clipboard}}", P = "
|
|
|
6805
6777
|
isComponent: e = !1,
|
|
6806
6778
|
headerHeight: t = 0,
|
|
6807
6779
|
domain: r = ds
|
|
6808
|
-
}) => (
|
|
6780
|
+
}) => (W(() => {
|
|
6809
6781
|
e || os().catch((s) => {
|
|
6810
6782
|
console.error("[SW] Failed to register service worker:", s);
|
|
6811
6783
|
});
|
|
6812
|
-
}, [e]),
|
|
6813
|
-
|
|
6784
|
+
}, [e]), Gt ? /* @__PURE__ */ h(
|
|
6785
|
+
pr,
|
|
6814
6786
|
{
|
|
6815
|
-
clientId:
|
|
6787
|
+
clientId: yr,
|
|
6816
6788
|
domain: r,
|
|
6817
|
-
debug:
|
|
6789
|
+
debug: vr,
|
|
6818
6790
|
endpoint: process.env.PUBLIC_AUTH_SERVER_URL,
|
|
6819
|
-
children: /* @__PURE__ */ h(
|
|
6791
|
+
children: /* @__PURE__ */ h(Tr, { isComponent: e, headerHeight: t })
|
|
6820
6792
|
}
|
|
6821
|
-
) : /* @__PURE__ */ h(
|
|
6793
|
+
) : /* @__PURE__ */ h(pr, { clientId: yr, domain: r, debug: vr, children: /* @__PURE__ */ h(Tr, { isComponent: e, headerHeight: t }) })), cl = ({ domain: e, headerHeight: t }) => /* @__PURE__ */ h(
|
|
6822
6794
|
xo,
|
|
6823
6795
|
{
|
|
6824
6796
|
isComponent: !0,
|
|
@@ -6828,50 +6800,51 @@ Press Ctrl+Enter to send it or Enter for new line.`, Yc = "{{clipboard}}", P = "
|
|
|
6828
6800
|
);
|
|
6829
6801
|
export {
|
|
6830
6802
|
jc as ABOUT_TITLE,
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6803
|
+
Yo as ACTION_RESET_PROMPT,
|
|
6804
|
+
Vo as ACTION_SEARCH,
|
|
6805
|
+
Jo as ACTION_SORT,
|
|
6834
6806
|
Qo as ACTION_TOGGLE_PROMPT,
|
|
6835
6807
|
al as APP_CLASSNAME,
|
|
6836
6808
|
bs as C,
|
|
6837
6809
|
ol as CARDS,
|
|
6838
6810
|
Yc as CLIPBOARD_PROMPT,
|
|
6839
|
-
|
|
6811
|
+
uc as DEFAULT_ICON_ACTION_SIZE,
|
|
6840
6812
|
Vn as E,
|
|
6841
|
-
|
|
6813
|
+
jo as ERROR_MESSAGE,
|
|
6842
6814
|
zc as FOOTER_DISCLAIMERS,
|
|
6843
|
-
|
|
6815
|
+
qc as HISTORY_TITLE,
|
|
6844
6816
|
lt as I,
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6817
|
+
oc as INFINITE_SCROLL_LIMIT,
|
|
6818
|
+
ic as INFINITE_SCROLL_THRESHOLD,
|
|
6819
|
+
pc as INPUT_BOTTOM_OFFSET,
|
|
6820
|
+
bc as INPUT_BOTTOM_OFFSET_EXTRA,
|
|
6821
|
+
gc as INPUT_BOTTOM_OFFSET_IPAD,
|
|
6822
|
+
yc as INPUT_BOTTOM_OFFSET_IPHONE,
|
|
6823
|
+
Qc as INPUT_PLACEHOLDER_TEXT_CMD_ENTER,
|
|
6824
|
+
Jc as INPUT_PLACEHOLDER_TEXT_ENTER,
|
|
6853
6825
|
Vc as INPUT_PLACEHOLDER_TEXT_MOBILE,
|
|
6854
6826
|
oo as L,
|
|
6855
|
-
|
|
6827
|
+
sc as LOCAL_STORAGE_FAVORITES_ONLY,
|
|
6856
6828
|
ns as LOCAL_STORAGE_PREFIX,
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6829
|
+
ac as LOCAL_STORAGE_PRIVATE_DISCLOSURE,
|
|
6830
|
+
nc as LOCAL_STORAGE_REASONING_DISCLOSURE,
|
|
6831
|
+
zo as LOCAL_STORAGE_SEARCH,
|
|
6832
|
+
Xo as LOCAL_STORAGE_SORT,
|
|
6833
|
+
rc as LOCAL_STORAGE_SORT_MEMORY_COLUMN,
|
|
6834
|
+
tc as LOCAL_STORAGE_SORT_MEMORY_DIRECTION,
|
|
6835
|
+
Zo as LOCAL_STORAGE_SORT_TIMESTAMP,
|
|
6836
|
+
ec as LOCAL_STORAGE_SORT_TOKEN_USAGE,
|
|
6865
6837
|
Kc as LOG_OUT,
|
|
6866
6838
|
Oo as Logo,
|
|
6867
6839
|
_c as Oe,
|
|
6868
6840
|
Bc as PROFILE_TITLE,
|
|
6869
6841
|
Xc as PROMPTS_DESCRIPTION,
|
|
6870
|
-
|
|
6871
|
-
|
|
6842
|
+
cc as PROMPT_CLASSNAME,
|
|
6843
|
+
lc as PROMPT_EDITABLE_AREA_CLASSNAME,
|
|
6844
|
+
Oc as Pe,
|
|
6872
6845
|
to as S,
|
|
6873
|
-
|
|
6874
|
-
|
|
6846
|
+
te as SERVICE_TYPES,
|
|
6847
|
+
Wc as SETTINGS_TITLE,
|
|
6875
6848
|
cl as SassySaint,
|
|
6876
6849
|
sl as TOAST_CACHE_DISABLED,
|
|
6877
6850
|
rl as TOAST_CACHE_ENABLED,
|
|
@@ -6880,25 +6853,24 @@ export {
|
|
|
6880
6853
|
Zc as TOAST_PROVIDER_CHANGED,
|
|
6881
6854
|
nl as TRIMESTERS,
|
|
6882
6855
|
il as TRIMESTERS_SHORT,
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6856
|
+
hc as UI_BUTTON_SCROLL_BUFFER,
|
|
6857
|
+
fc as UI_DEFAULT_MAIN_HEIGHT,
|
|
6858
|
+
mc as UI_DEFAULT_MAIN_HEIGHT_IPHONE,
|
|
6859
|
+
dc as UI_FOOTER_BUFFER,
|
|
6887
6860
|
Gc as USAGE_TITLE,
|
|
6888
|
-
|
|
6889
|
-
|
|
6861
|
+
jt as Y,
|
|
6862
|
+
k as _e,
|
|
6863
|
+
Sc as a,
|
|
6890
6864
|
Xi as b,
|
|
6891
|
-
|
|
6865
|
+
vc as c,
|
|
6892
6866
|
$i as convertCamelCaseToReadable,
|
|
6893
|
-
Ic as de,
|
|
6894
6867
|
Oi as debounce,
|
|
6895
|
-
|
|
6896
|
-
Ec as getCacheInfo,
|
|
6868
|
+
wc as getCacheInfo,
|
|
6897
6869
|
wi as getCurrentGeoLocation,
|
|
6898
6870
|
fs as getLayoutPaddingClass,
|
|
6899
6871
|
hs as getMessageContaintWrapperClass,
|
|
6900
|
-
|
|
6901
|
-
|
|
6872
|
+
je as h,
|
|
6873
|
+
Ec as handleServiceWorkerToggle,
|
|
6902
6874
|
ws as i,
|
|
6903
6875
|
cs as i$1,
|
|
6904
6876
|
Pi as isPWAMode,
|
|
@@ -6913,31 +6885,30 @@ export {
|
|
|
6913
6885
|
Rc as le,
|
|
6914
6886
|
oi as mutateCall,
|
|
6915
6887
|
as as n,
|
|
6916
|
-
|
|
6888
|
+
Tc as ne,
|
|
6917
6889
|
_i as numberFormatter,
|
|
6918
6890
|
Es as o,
|
|
6919
6891
|
Si as obfuscate,
|
|
6920
|
-
|
|
6921
|
-
|
|
6892
|
+
Ac as oe,
|
|
6893
|
+
Cc as pe,
|
|
6922
6894
|
Ci as pluralize,
|
|
6923
6895
|
Ti as renderDataAsList,
|
|
6924
6896
|
ii as serverUrl,
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6897
|
+
kc as setNewProvider,
|
|
6898
|
+
rt as te,
|
|
6899
|
+
Ic as ue,
|
|
6928
6900
|
vi as unObfuscate,
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6901
|
+
Pc as useChangelogs,
|
|
6902
|
+
xc as useChatsHistory,
|
|
6903
|
+
Dc as useChatsUsage,
|
|
6932
6904
|
Uc as useDeleteAllMemories,
|
|
6933
6905
|
Lc as useDeleteMemory,
|
|
6934
6906
|
Fc as useEntitlements,
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
Pc as useUserChatStats,
|
|
6907
|
+
Nc as useServerCapabilities,
|
|
6908
|
+
$c as useUserChatStats,
|
|
6938
6909
|
Mc as useUserMemories,
|
|
6939
6910
|
ci as useUserPreferences,
|
|
6940
6911
|
Hc as utilities,
|
|
6941
6912
|
Ts as x,
|
|
6942
|
-
|
|
6913
|
+
Jn as y
|
|
6943
6914
|
};
|