@myxtra/authentication-green 1.7.4 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as d, j as n, g as wt, u as Q, a as Qe, b as _t, E as Rt } from "./index-
|
|
1
|
+
import { r as d, j as n, g as wt, u as Q, a as Qe, b as _t, E as Rt } from "./index-ca34452c.mjs";
|
|
2
2
|
class H {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
@@ -25,7 +25,7 @@ function k() {
|
|
|
25
25
|
function Et(t, e) {
|
|
26
26
|
return typeof t == "function" ? t(e) : t;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function he(t) {
|
|
29
29
|
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
30
30
|
}
|
|
31
31
|
function qe(t, e) {
|
|
@@ -130,7 +130,7 @@ function Ke(t, e) {
|
|
|
130
130
|
}
|
|
131
131
|
return e;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function re(t, e) {
|
|
134
134
|
if (t && !e || e && !t)
|
|
135
135
|
return !1;
|
|
136
136
|
for (const s in t)
|
|
@@ -211,7 +211,7 @@ class Pt extends H {
|
|
|
211
211
|
return typeof this.focused == "boolean" ? this.focused : typeof document > "u" ? !0 : [void 0, "visible", "prerender"].includes(document.visibilityState);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
const
|
|
214
|
+
const ne = new Pt(), Ne = ["online", "offline"];
|
|
215
215
|
class At extends H {
|
|
216
216
|
constructor() {
|
|
217
217
|
super(), this.setup = (e) => {
|
|
@@ -256,12 +256,12 @@ class At extends H {
|
|
|
256
256
|
return typeof this.online == "boolean" ? this.online : typeof navigator > "u" || typeof navigator.onLine > "u" ? !0 : navigator.onLine;
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
-
const
|
|
259
|
+
const ie = new At();
|
|
260
260
|
function Nt(t) {
|
|
261
261
|
return Math.min(1e3 * 2 ** t, 3e4);
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
return (t ?? "online") === "online" ?
|
|
263
|
+
function le(t) {
|
|
264
|
+
return (t ?? "online") === "online" ? ie.isOnline() : !0;
|
|
265
265
|
}
|
|
266
266
|
class Ve {
|
|
267
267
|
constructor(e) {
|
|
@@ -281,7 +281,7 @@ function $e(t) {
|
|
|
281
281
|
e = !0;
|
|
282
282
|
}, c = () => {
|
|
283
283
|
e = !1;
|
|
284
|
-
}, p = () => !
|
|
284
|
+
}, p = () => !ne.isFocused() || t.networkMode !== "always" && !ie.isOnline(), v = (m) => {
|
|
285
285
|
r || (r = !0, t.onSuccess == null || t.onSuccess(m), i == null || i(), o(m));
|
|
286
286
|
}, f = (m) => {
|
|
287
287
|
r || (r = !0, t.onError == null || t.onError(m), i == null || i(), a(m));
|
|
@@ -318,7 +318,7 @@ function $e(t) {
|
|
|
318
318
|
});
|
|
319
319
|
});
|
|
320
320
|
};
|
|
321
|
-
return
|
|
321
|
+
return le(t.networkMode) ? g() : y().then(g), {
|
|
322
322
|
promise: u,
|
|
323
323
|
cancel: l,
|
|
324
324
|
continue: () => (i == null ? void 0 : i()) ? u : Promise.resolve(),
|
|
@@ -378,7 +378,7 @@ class Ge {
|
|
|
378
378
|
this.clearGcTimeout();
|
|
379
379
|
}
|
|
380
380
|
scheduleGc() {
|
|
381
|
-
this.clearGcTimeout(),
|
|
381
|
+
this.clearGcTimeout(), he(this.cacheTime) && (this.gcTimeout = setTimeout(() => {
|
|
382
382
|
this.optionalRemove();
|
|
383
383
|
}, this.cacheTime));
|
|
384
384
|
}
|
|
@@ -599,7 +599,7 @@ class Ft extends Ge {
|
|
|
599
599
|
fetchFailureCount: 0,
|
|
600
600
|
fetchFailureReason: null,
|
|
601
601
|
fetchMeta: (i = e.meta) != null ? i : null,
|
|
602
|
-
fetchStatus:
|
|
602
|
+
fetchStatus: le(this.options.networkMode) ? "fetching" : "paused",
|
|
603
603
|
...!r.dataUpdatedAt && {
|
|
604
604
|
error: null,
|
|
605
605
|
status: "loading"
|
|
@@ -876,7 +876,7 @@ class Dt extends Ge {
|
|
|
876
876
|
failureCount: 0,
|
|
877
877
|
failureReason: null,
|
|
878
878
|
error: null,
|
|
879
|
-
isPaused: !
|
|
879
|
+
isPaused: !le(this.options.networkMode),
|
|
880
880
|
status: "loading",
|
|
881
881
|
variables: e.variables
|
|
882
882
|
};
|
|
@@ -1026,8 +1026,8 @@ function It() {
|
|
|
1026
1026
|
meta: t.options.meta
|
|
1027
1027
|
};
|
|
1028
1028
|
m(W);
|
|
1029
|
-
const
|
|
1030
|
-
return Promise.resolve(
|
|
1029
|
+
const ce = C(W);
|
|
1030
|
+
return Promise.resolve(ce).then((jt) => _(R, b, jt, F));
|
|
1031
1031
|
};
|
|
1032
1032
|
let S;
|
|
1033
1033
|
if (!v.length)
|
|
@@ -1045,8 +1045,8 @@ function It() {
|
|
|
1045
1045
|
for (let b = 1; b < v.length; b++)
|
|
1046
1046
|
S = S.then((F) => {
|
|
1047
1047
|
if (u && v[b] ? u(v[b], b, v) : !0) {
|
|
1048
|
-
const
|
|
1049
|
-
return j(F, R,
|
|
1048
|
+
const ce = R ? f[b] : Me(t.options, F);
|
|
1049
|
+
return j(F, R, ce);
|
|
1050
1050
|
}
|
|
1051
1051
|
return Promise.resolve(_(F, f[b], v[b]));
|
|
1052
1052
|
});
|
|
@@ -1070,10 +1070,10 @@ class We {
|
|
|
1070
1070
|
this.queryCache = e.queryCache || new Lt(), this.mutationCache = e.mutationCache || new Tt(), this.logger = e.logger || be, this.defaultOptions = e.defaultOptions || {}, this.queryDefaults = [], this.mutationDefaults = [], this.mountCount = 0;
|
|
1071
1071
|
}
|
|
1072
1072
|
mount() {
|
|
1073
|
-
this.mountCount++, this.mountCount === 1 && (this.unsubscribeFocus =
|
|
1074
|
-
|
|
1075
|
-
}), this.unsubscribeOnline =
|
|
1076
|
-
|
|
1073
|
+
this.mountCount++, this.mountCount === 1 && (this.unsubscribeFocus = ne.subscribe(() => {
|
|
1074
|
+
ne.isFocused() && (this.resumePausedMutations(), this.queryCache.onFocus());
|
|
1075
|
+
}), this.unsubscribeOnline = ie.subscribe(() => {
|
|
1076
|
+
ie.isOnline() && (this.resumePausedMutations(), this.queryCache.onOnline());
|
|
1077
1077
|
}));
|
|
1078
1078
|
}
|
|
1079
1079
|
unmount() {
|
|
@@ -1285,7 +1285,7 @@ class Qt extends H {
|
|
|
1285
1285
|
}
|
|
1286
1286
|
setOptions(e, s) {
|
|
1287
1287
|
const r = this.options, i = this.currentQuery;
|
|
1288
|
-
if (this.options = this.client.defaultQueryOptions(e),
|
|
1288
|
+
if (this.options = this.client.defaultQueryOptions(e), re(r, this.options) || this.client.getQueryCache().notify({
|
|
1289
1289
|
type: "observerOptionsUpdated",
|
|
1290
1290
|
query: this.currentQuery,
|
|
1291
1291
|
observer: this
|
|
@@ -1348,7 +1348,7 @@ class Qt extends H {
|
|
|
1348
1348
|
return e != null && e.throwOnError || (s = s.catch(k)), s;
|
|
1349
1349
|
}
|
|
1350
1350
|
updateStaleTimeout() {
|
|
1351
|
-
if (this.clearStaleTimeout(), z || this.currentResult.isStale || !
|
|
1351
|
+
if (this.clearStaleTimeout(), z || this.currentResult.isStale || !he(this.options.staleTime))
|
|
1352
1352
|
return;
|
|
1353
1353
|
const s = qe(this.currentResult.dataUpdatedAt, this.options.staleTime) + 1;
|
|
1354
1354
|
this.staleTimeoutId = setTimeout(() => {
|
|
@@ -1360,8 +1360,8 @@ class Qt extends H {
|
|
|
1360
1360
|
return typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (e = this.options.refetchInterval) != null ? e : !1;
|
|
1361
1361
|
}
|
|
1362
1362
|
updateRefetchInterval(e) {
|
|
1363
|
-
this.clearRefetchInterval(), this.currentRefetchInterval = e, !(z || this.options.enabled === !1 || !
|
|
1364
|
-
(this.options.refetchIntervalInBackground ||
|
|
1363
|
+
this.clearRefetchInterval(), this.currentRefetchInterval = e, !(z || this.options.enabled === !1 || !he(this.currentRefetchInterval) || this.currentRefetchInterval === 0) && (this.refetchIntervalId = setInterval(() => {
|
|
1364
|
+
(this.options.refetchIntervalInBackground || ne.isFocused()) && this.executeFetch();
|
|
1365
1365
|
}, this.currentRefetchInterval));
|
|
1366
1366
|
}
|
|
1367
1367
|
updateTimers() {
|
|
@@ -1386,7 +1386,7 @@ class Qt extends H {
|
|
|
1386
1386
|
} = p, C = !1, _ = !1, j;
|
|
1387
1387
|
if (s._optimisticResults) {
|
|
1388
1388
|
const b = this.hasListeners(), F = !b && Fe(e, s), W = b && ke(e, r, s, i);
|
|
1389
|
-
(F || W) && (g =
|
|
1389
|
+
(F || W) && (g = le(e.options.networkMode) ? "fetching" : "paused", v || (m = "loading")), s._optimisticResults === "isRestoring" && (g = "idle");
|
|
1390
1390
|
}
|
|
1391
1391
|
if (s.keepPreviousData && !p.dataUpdatedAt && c != null && c.isSuccess && m !== "error")
|
|
1392
1392
|
j = c.data, v = c.dataUpdatedAt, m = c.status, C = !0;
|
|
@@ -1445,7 +1445,7 @@ class Qt extends H {
|
|
|
1445
1445
|
}
|
|
1446
1446
|
updateResult(e) {
|
|
1447
1447
|
const s = this.currentResult, r = this.createResult(this.currentQuery, this.options);
|
|
1448
|
-
if (this.currentResultState = this.currentQuery.state, this.currentResultOptions = this.options,
|
|
1448
|
+
if (this.currentResultState = this.currentQuery.state, this.currentResultOptions = this.options, re(r, s))
|
|
1449
1449
|
return;
|
|
1450
1450
|
this.currentResult = r;
|
|
1451
1451
|
const i = {
|
|
@@ -1520,7 +1520,7 @@ function je(t, e) {
|
|
|
1520
1520
|
return t.isStaleByTime(e.staleTime);
|
|
1521
1521
|
}
|
|
1522
1522
|
function Bt(t, e, s) {
|
|
1523
|
-
return s.keepPreviousData ? !1 : s.placeholderData !== void 0 ? e.isPlaceholderData : t.getCurrentResult()
|
|
1523
|
+
return s.keepPreviousData ? !1 : s.placeholderData !== void 0 ? e.isPlaceholderData : !re(t.getCurrentResult(), e);
|
|
1524
1524
|
}
|
|
1525
1525
|
class Kt extends H {
|
|
1526
1526
|
constructor(e, s) {
|
|
@@ -1532,7 +1532,7 @@ class Kt extends H {
|
|
|
1532
1532
|
setOptions(e) {
|
|
1533
1533
|
var s;
|
|
1534
1534
|
const r = this.options;
|
|
1535
|
-
this.options = this.client.defaultMutationOptions(e),
|
|
1535
|
+
this.options = this.client.defaultMutationOptions(e), re(r, this.options) || this.client.getMutationCache().notify({
|
|
1536
1536
|
type: "observerOptionsUpdated",
|
|
1537
1537
|
mutation: this.currentMutation,
|
|
1538
1538
|
observer: this
|
|
@@ -1614,14 +1614,14 @@ var Vt = typeof Object.is == "function" ? Object.is : Ht, $t = K.useState, Gt =
|
|
|
1614
1614
|
function Yt(t, e) {
|
|
1615
1615
|
var s = e(), r = $t({ inst: { value: s, getSnapshot: e } }), i = r[0].inst, o = r[1];
|
|
1616
1616
|
return Zt(function() {
|
|
1617
|
-
i.value = s, i.getSnapshot = e,
|
|
1617
|
+
i.value = s, i.getSnapshot = e, de(i) && o({ inst: i });
|
|
1618
1618
|
}, [t, s, e]), Gt(function() {
|
|
1619
|
-
return
|
|
1620
|
-
|
|
1619
|
+
return de(i) && o({ inst: i }), t(function() {
|
|
1620
|
+
de(i) && o({ inst: i });
|
|
1621
1621
|
});
|
|
1622
1622
|
}, [t]), Wt(s), s;
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1624
|
+
function de(t) {
|
|
1625
1625
|
var e = t.getSnapshot;
|
|
1626
1626
|
t = t.value;
|
|
1627
1627
|
try {
|
|
@@ -1769,31 +1769,31 @@ function O() {
|
|
|
1769
1769
|
(t = arguments[s++]) && (e = it(t)) && (r && (r += " "), r += e);
|
|
1770
1770
|
return r;
|
|
1771
1771
|
}
|
|
1772
|
-
var vs = Object.defineProperty, ms = Object.defineProperties, ys = Object.getOwnPropertyDescriptors,
|
|
1772
|
+
var vs = Object.defineProperty, ms = Object.defineProperties, ys = Object.getOwnPropertyDescriptors, oe = Object.getOwnPropertySymbols, ot = Object.prototype.hasOwnProperty, at = Object.prototype.propertyIsEnumerable, De = (t, e, s) => e in t ? vs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, x = (t, e) => {
|
|
1773
1773
|
for (var s in e || (e = {}))
|
|
1774
1774
|
ot.call(e, s) && De(t, s, e[s]);
|
|
1775
|
-
if (
|
|
1776
|
-
for (var s of
|
|
1775
|
+
if (oe)
|
|
1776
|
+
for (var s of oe(e))
|
|
1777
1777
|
at.call(e, s) && De(t, s, e[s]);
|
|
1778
1778
|
return t;
|
|
1779
1779
|
}, E = (t, e) => ms(t, ys(e)), A = (t, e) => {
|
|
1780
1780
|
var s = {};
|
|
1781
1781
|
for (var r in t)
|
|
1782
1782
|
ot.call(t, r) && e.indexOf(r) < 0 && (s[r] = t[r]);
|
|
1783
|
-
if (t != null &&
|
|
1784
|
-
for (var r of
|
|
1783
|
+
if (t != null && oe)
|
|
1784
|
+
for (var r of oe(t))
|
|
1785
1785
|
e.indexOf(r) < 0 && at.call(t, r) && (s[r] = t[r]);
|
|
1786
1786
|
return s;
|
|
1787
1787
|
};
|
|
1788
|
-
function
|
|
1789
|
-
return
|
|
1788
|
+
function ae() {
|
|
1789
|
+
return ae = Object.assign ? Object.assign.bind() : function(t) {
|
|
1790
1790
|
for (var e = 1; e < arguments.length; e++) {
|
|
1791
1791
|
var s = arguments[e];
|
|
1792
1792
|
for (var r in s)
|
|
1793
1793
|
Object.prototype.hasOwnProperty.call(s, r) && (t[r] = s[r]);
|
|
1794
1794
|
}
|
|
1795
1795
|
return t;
|
|
1796
|
-
},
|
|
1796
|
+
}, ae.apply(this, arguments);
|
|
1797
1797
|
}
|
|
1798
1798
|
function Cs(t, e) {
|
|
1799
1799
|
typeof t == "function" ? t(e) : t != null && (t.current = e);
|
|
@@ -1807,11 +1807,11 @@ var gs = /* @__PURE__ */ d.forwardRef((t, e) => {
|
|
|
1807
1807
|
const s = t, { children: r } = s, i = A(s, ["children"]), o = d.Children.toArray(r), a = o.find(js);
|
|
1808
1808
|
if (a) {
|
|
1809
1809
|
const u = a.props.children, l = o.map((h) => h === a ? d.Children.count(u) > 1 ? d.Children.only(null) : /* @__PURE__ */ d.isValidElement(u) ? u.props.children : null : h);
|
|
1810
|
-
return /* @__PURE__ */ d.createElement(me,
|
|
1810
|
+
return /* @__PURE__ */ d.createElement(me, ae({}, i, {
|
|
1811
1811
|
ref: e
|
|
1812
1812
|
}), /* @__PURE__ */ d.isValidElement(u) ? /* @__PURE__ */ d.cloneElement(u, void 0, l) : null);
|
|
1813
1813
|
}
|
|
1814
|
-
return /* @__PURE__ */ d.createElement(me,
|
|
1814
|
+
return /* @__PURE__ */ d.createElement(me, ae({}, i, {
|
|
1815
1815
|
ref: e
|
|
1816
1816
|
}), r);
|
|
1817
1817
|
});
|
|
@@ -3149,19 +3149,19 @@ const Fr = () => {
|
|
|
3149
3149
|
}
|
|
3150
3150
|
);
|
|
3151
3151
|
};
|
|
3152
|
-
var Lr = Object.defineProperty, Dr = Object.defineProperties, Tr = Object.getOwnPropertyDescriptors,
|
|
3152
|
+
var Lr = Object.defineProperty, Dr = Object.defineProperties, Tr = Object.getOwnPropertyDescriptors, ue = Object.getOwnPropertySymbols, xt = Object.prototype.hasOwnProperty, gt = Object.prototype.propertyIsEnumerable, Ue = (t, e, s) => e in t ? Lr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, q = (t, e) => {
|
|
3153
3153
|
for (var s in e || (e = {}))
|
|
3154
3154
|
xt.call(e, s) && Ue(t, s, e[s]);
|
|
3155
|
-
if (
|
|
3156
|
-
for (var s of
|
|
3155
|
+
if (ue)
|
|
3156
|
+
for (var s of ue(e))
|
|
3157
3157
|
gt.call(e, s) && Ue(t, s, e[s]);
|
|
3158
3158
|
return t;
|
|
3159
3159
|
}, G = (t, e) => Dr(t, Tr(e)), Z = (t, e) => {
|
|
3160
3160
|
var s = {};
|
|
3161
3161
|
for (var r in t)
|
|
3162
3162
|
xt.call(t, r) && e.indexOf(r) < 0 && (s[r] = t[r]);
|
|
3163
|
-
if (t != null &&
|
|
3164
|
-
for (var r of
|
|
3163
|
+
if (t != null && ue)
|
|
3164
|
+
for (var r of ue(t))
|
|
3165
3165
|
e.indexOf(r) < 0 && gt.call(t, r) && (s[r] = t[r]);
|
|
3166
3166
|
return s;
|
|
3167
3167
|
}, Ir = d.forwardRef((t, e) => {
|