@pdf-viewer/react 1.9.0-beta.4 → 1.9.0-beta.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.
- package/dist/Checkbox.module-3edaacbb.js +7 -0
- package/dist/Combination-9a0a3e65.js +693 -0
- package/dist/Container.module-f8b5c306.js +6 -0
- package/dist/DropDown.module-a78567cb.js +11 -0
- package/dist/MenuItem.module-bc11d0d3.js +6 -0
- package/dist/MenuSeparator.module-89b2ff7f.js +6 -0
- package/dist/PropertyItem.module-db0150cc.js +8 -0
- package/dist/RPSplitter.module-13d612c4.js +7 -0
- package/dist/RPTheme.module-bd9038da.js +8 -0
- package/dist/RotateTool.module-03987eba.js +6 -0
- package/dist/SearchTool.module-016f3a8d.js +16 -0
- package/dist/ToolbarLayout.module-88476995.js +2464 -0
- package/dist/WrapperLayout.module-147bc943.js +6 -0
- package/dist/assets/ToolbarLayout.css +1 -0
- package/dist/components/RPConfig.js +673 -691
- package/dist/components/RPController.js +34 -34
- package/dist/components/RPDropFileZone.js +21 -23
- package/dist/components/RPPages.js +21 -18
- package/dist/components/RPProvider.js +19 -15
- package/dist/components/layout/Container.js +10 -11
- package/dist/components/layout/LayoutContainer.js +19 -16
- package/dist/components/layout/RPDefaultLayout.js +76 -14
- package/dist/components/layout/RPLayout.js +74 -24
- package/dist/components/layout/WrapperLayout.js +7 -8
- package/dist/components/layout/sidebar/RPSidebar.js +51 -12
- package/dist/components/layout/sidebar/RPSplitter.js +7 -9
- package/dist/components/layout/sidebar/Thumbnail.js +49 -2
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +307 -24
- package/dist/components/layout/toolbar/FileDownloadTool.js +23 -13
- package/dist/components/layout/toolbar/MenuItem.js +6 -7
- package/dist/components/layout/toolbar/MenuSeparator.js +4 -5
- package/dist/components/layout/toolbar/MostPageTool.js +50 -23
- package/dist/components/layout/toolbar/OtherTool.js +115 -22
- package/dist/components/layout/toolbar/Paginate.js +99 -17
- package/dist/components/layout/toolbar/PrintTool.js +43 -13
- package/dist/components/layout/toolbar/PropertyItem.js +5 -8
- package/dist/components/layout/toolbar/RPToolbar.js +28 -7
- package/dist/components/layout/toolbar/RPToolbarEnd.js +22 -7
- package/dist/components/layout/toolbar/RotateTool.js +20 -21
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchCloseButton.js +19 -7
- package/dist/components/layout/toolbar/SearchResultNavigator.js +42 -8
- package/dist/components/layout/toolbar/SearchTool.js +198 -29
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ThumbnailTool.js +3 -3
- package/dist/components/layout/toolbar/ToolbarCustom.js +48 -20
- package/dist/components/layout/toolbar/ToolbarDefault.js +82 -0
- package/dist/components/layout/toolbar/ToolbarLayout.js +10 -0
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +140 -28
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +3 -3
- package/dist/components/layout/toolbar/tools/InputPageTool.js +11 -11
- package/dist/components/layout/toolbar/tools/NextPageTool.js +21 -18
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +3 -3
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +10 -10
- package/dist/components/layout/toolbar/tools/defaults/{TopbarDefaultTools.js → RPHorizontalBar.js} +29 -20
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +16 -0
- package/dist/components/page/AnnotationLayer.js +20 -17
- package/dist/components/page/CanvasLayer.js +20 -18
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +20 -17
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +20 -17
- package/dist/components/page/TextLayer.js +20 -17
- package/dist/components/ui/Checkbox.js +125 -239
- package/dist/components/ui/DropDown.js +13 -19
- package/dist/components/ui/LoadingIndicator.js +22 -5
- package/dist/components/ui/RPTooltip.js +133 -133
- package/dist/contexts/ElementPageContext.js +37 -37
- package/dist/contexts/FileInputContext.js +18 -20
- package/dist/contexts/PaginationContext.js +4 -4
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +10 -0
- package/dist/contexts/SearchContext.js +3 -3
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/contexts/ViewportContext.js +42 -35
- package/dist/index-2160dd99.js +307 -0
- package/dist/{index-5f66a29f.js → index-492f99d0.js} +491 -515
- package/dist/index-49b9a615.js +978 -0
- package/dist/main.js +76 -73
- package/dist/types/components/layout/RPDefaultLayout.d.ts +2 -1
- package/dist/types/components/layout/RPLayout.d.ts +2 -1
- package/dist/types/components/layout/sidebar/Thumbnail.d.ts +0 -1
- package/dist/types/components/layout/toolbar/RPToolbar.d.ts +2 -3
- package/dist/types/components/layout/toolbar/ToolbarCustom.d.ts +2 -2
- package/dist/types/components/layout/toolbar/ToolbarDefault.d.ts +4 -0
- package/dist/types/components/layout/toolbar/ToolbarLayout.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/defaults/RPHorizontalBar.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/defaults/RPVerticalBar.d.ts +3 -0
- package/dist/types/contexts/RenderQueueProvider.d.ts +16 -0
- package/dist/types/main.d.ts +3 -3
- package/dist/types/utils/Queue.d.ts +18 -0
- package/dist/types/utils/renderPage.d.ts +1 -6
- package/dist/types/utils/types.d.ts +22 -17
- package/dist/utils/Queue.js +47 -0
- package/dist/utils/hooks/useFileDownload.js +20 -17
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePageRotateContext.js +14 -14
- package/dist/utils/hooks/usePaginate.js +20 -17
- package/dist/utils/hooks/usePresentPage.js +20 -17
- package/dist/utils/hooks/usePrint.js +20 -17
- package/dist/utils/hooks/useScrollToPage.js +20 -17
- package/dist/utils/hooks/useSearch.js +20 -17
- package/dist/utils/hooks/useThumbnail.js +20 -18
- package/dist/utils/hooks/useVirtualReactWindow.js +20 -17
- package/package.json +1 -1
- package/dist/RPLayout-5892502c.js +0 -3494
- package/dist/SearchCloseButton-cbf182aa.js +0 -33
- package/dist/assets/RPLayout.css +0 -1
- package/dist/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.js +0 -16
- package/dist/index-00f8683a.js +0 -1672
- package/dist/index-6b37f504.js +0 -332
- package/dist/types/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.d.ts +0 -3
- package/dist/types/components/layout/toolbar/tools/defaults/TopbarDefaultTools.d.ts +0 -3
- /package/dist/assets/{RPDropFileZone.css → RPTheme.css} +0 -0
- /package/dist/assets/{SearchCloseButton.css → SearchTool.css} +0 -0
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
if (!
|
|
1
|
+
var we = (t, e, s) => {
|
|
2
|
+
if (!e.has(t))
|
|
3
3
|
throw TypeError("Cannot " + s);
|
|
4
4
|
};
|
|
5
|
-
var i = (
|
|
6
|
-
if (
|
|
5
|
+
var i = (t, e, s) => (we(t, e, "read from private field"), s ? s.call(t) : e.get(t)), l = (t, e, s) => {
|
|
6
|
+
if (e.has(t))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
-
|
|
9
|
-
}, o = (
|
|
10
|
-
var
|
|
8
|
+
e instanceof WeakSet ? e.add(t) : e.set(t, s);
|
|
9
|
+
}, o = (t, e, s, r) => (we(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
|
|
10
|
+
var ye = (t, e, s, r) => ({
|
|
11
11
|
set _(n) {
|
|
12
|
-
o(
|
|
12
|
+
o(t, e, n, s);
|
|
13
13
|
},
|
|
14
14
|
get _() {
|
|
15
|
-
return i(
|
|
16
|
-
}
|
|
17
|
-
}),
|
|
18
|
-
import { jsx as
|
|
19
|
-
import { RPTheme as
|
|
20
|
-
import { ConfigContextProvider as
|
|
21
|
-
import { useLoadWorker as
|
|
22
|
-
import * as
|
|
23
|
-
import { LicenseProvider as
|
|
24
|
-
var
|
|
15
|
+
return i(t, e, r);
|
|
16
|
+
}
|
|
17
|
+
}), P = (t, e, s) => (we(t, e, "access private method"), s);
|
|
18
|
+
import { jsx as oe } from "react/jsx-runtime";
|
|
19
|
+
import { RPTheme as ze } from "./RPTheme.js";
|
|
20
|
+
import { ConfigContextProvider as Be } from "../contexts/ConfigContext.js";
|
|
21
|
+
import { useLoadWorker as Je } from "../utils/hooks/useLoadWorker.js";
|
|
22
|
+
import * as He from "react";
|
|
23
|
+
import { LicenseProvider as We } from "../contexts/LicenseContext.js";
|
|
24
|
+
var ge = class {
|
|
25
25
|
constructor() {
|
|
26
26
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
27
27
|
}
|
|
28
|
-
subscribe(
|
|
29
|
-
return this.listeners.add(
|
|
30
|
-
this.listeners.delete(
|
|
28
|
+
subscribe(t) {
|
|
29
|
+
return this.listeners.add(t), this.onSubscribe(), () => {
|
|
30
|
+
this.listeners.delete(t), this.onUnsubscribe();
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
hasListeners() {
|
|
@@ -37,146 +37,146 @@ var bt = class {
|
|
|
37
37
|
}
|
|
38
38
|
onUnsubscribe() {
|
|
39
39
|
}
|
|
40
|
-
},
|
|
41
|
-
function
|
|
40
|
+
}, be = typeof window > "u" || "Deno" in globalThis;
|
|
41
|
+
function Q() {
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return typeof
|
|
43
|
+
function Xe(t, e) {
|
|
44
|
+
return typeof t == "function" ? t(e) : t;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return typeof
|
|
46
|
+
function Ye(t) {
|
|
47
|
+
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return Math.max(
|
|
49
|
+
function Ze(t, e) {
|
|
50
|
+
return Math.max(t + (e || 0) - Date.now(), 0);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return typeof
|
|
52
|
+
function Ce(t, e) {
|
|
53
|
+
return typeof t == "function" ? t(e) : t;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return typeof
|
|
55
|
+
function et(t, e) {
|
|
56
|
+
return typeof t == "function" ? t(e) : t;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function qe(t, e) {
|
|
59
59
|
const {
|
|
60
60
|
type: s = "all",
|
|
61
61
|
exact: r,
|
|
62
62
|
fetchStatus: n,
|
|
63
63
|
predicate: u,
|
|
64
|
-
queryKey:
|
|
64
|
+
queryKey: h,
|
|
65
65
|
stale: a
|
|
66
|
-
} =
|
|
67
|
-
if (
|
|
66
|
+
} = t;
|
|
67
|
+
if (h) {
|
|
68
68
|
if (r) {
|
|
69
|
-
if (
|
|
69
|
+
if (e.queryHash !== Fe(h, e.options))
|
|
70
70
|
return !1;
|
|
71
|
-
} else if (!
|
|
71
|
+
} else if (!ce(e.queryKey, h))
|
|
72
72
|
return !1;
|
|
73
73
|
}
|
|
74
74
|
if (s !== "all") {
|
|
75
|
-
const
|
|
76
|
-
if (s === "active" && !
|
|
75
|
+
const f = e.isActive();
|
|
76
|
+
if (s === "active" && !f || s === "inactive" && f)
|
|
77
77
|
return !1;
|
|
78
78
|
}
|
|
79
|
-
return !(typeof a == "boolean" &&
|
|
79
|
+
return !(typeof a == "boolean" && e.isStale() !== a || n && n !== e.state.fetchStatus || u && !u(e));
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const { exact: s, status: r, predicate: n, mutationKey: u } =
|
|
81
|
+
function Ee(t, e) {
|
|
82
|
+
const { exact: s, status: r, predicate: n, mutationKey: u } = t;
|
|
83
83
|
if (u) {
|
|
84
|
-
if (!
|
|
84
|
+
if (!e.options.mutationKey)
|
|
85
85
|
return !1;
|
|
86
86
|
if (s) {
|
|
87
|
-
if (
|
|
87
|
+
if (he(e.options.mutationKey) !== he(u))
|
|
88
88
|
return !1;
|
|
89
|
-
} else if (!
|
|
89
|
+
} else if (!ce(e.options.mutationKey, u))
|
|
90
90
|
return !1;
|
|
91
91
|
}
|
|
92
|
-
return !(r &&
|
|
92
|
+
return !(r && e.state.status !== r || n && !n(e));
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
return ((
|
|
94
|
+
function Fe(t, e) {
|
|
95
|
+
return ((e == null ? void 0 : e.queryKeyHashFn) || he)(t);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function he(t) {
|
|
98
98
|
return JSON.stringify(
|
|
99
|
-
|
|
100
|
-
(
|
|
99
|
+
t,
|
|
100
|
+
(e, s) => Se(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
return
|
|
103
|
+
function ce(t, e) {
|
|
104
|
+
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((s) => !ce(t[s], e[s])) : !1;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
if (
|
|
108
|
-
return
|
|
109
|
-
const s =
|
|
110
|
-
if (s ||
|
|
111
|
-
const r = s ?
|
|
112
|
-
let
|
|
113
|
-
for (let
|
|
114
|
-
const m = s ?
|
|
115
|
-
(!s &&
|
|
106
|
+
function Oe(t, e) {
|
|
107
|
+
if (t === e)
|
|
108
|
+
return t;
|
|
109
|
+
const s = De(t) && De(e);
|
|
110
|
+
if (s || Se(t) && Se(e)) {
|
|
111
|
+
const r = s ? t : Object.keys(t), n = r.length, u = s ? e : Object.keys(e), h = u.length, a = s ? [] : {};
|
|
112
|
+
let f = 0;
|
|
113
|
+
for (let w = 0; w < h; w++) {
|
|
114
|
+
const m = s ? w : u[w];
|
|
115
|
+
(!s && r.includes(m) || s) && t[m] === void 0 && e[m] === void 0 ? (a[m] = void 0, f++) : (a[m] = Oe(t[m], e[m]), a[m] === t[m] && t[m] !== void 0 && f++);
|
|
116
116
|
}
|
|
117
|
-
return n ===
|
|
117
|
+
return n === h && f === n ? t : a;
|
|
118
118
|
}
|
|
119
|
-
return
|
|
119
|
+
return e;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
return Array.isArray(
|
|
121
|
+
function De(t) {
|
|
122
|
+
return Array.isArray(t) && t.length === Object.keys(t).length;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
if (!
|
|
124
|
+
function Se(t) {
|
|
125
|
+
if (!Ae(t))
|
|
126
126
|
return !1;
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
127
|
+
const e = t.constructor;
|
|
128
|
+
if (e === void 0)
|
|
129
129
|
return !0;
|
|
130
|
-
const s =
|
|
131
|
-
return !(!
|
|
130
|
+
const s = e.prototype;
|
|
131
|
+
return !(!Ae(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
return Object.prototype.toString.call(
|
|
133
|
+
function Ae(t) {
|
|
134
|
+
return Object.prototype.toString.call(t) === "[object Object]";
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
return new Promise((
|
|
138
|
-
setTimeout(
|
|
136
|
+
function tt(t) {
|
|
137
|
+
return new Promise((e) => {
|
|
138
|
+
setTimeout(e, t);
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function st(t, e, s) {
|
|
142
142
|
if (typeof s.structuralSharing == "function")
|
|
143
|
-
return s.structuralSharing(
|
|
143
|
+
return s.structuralSharing(t, e);
|
|
144
144
|
if (s.structuralSharing !== !1) {
|
|
145
145
|
if (process.env.NODE_ENV !== "production")
|
|
146
146
|
try {
|
|
147
|
-
return
|
|
147
|
+
return Oe(t, e);
|
|
148
148
|
} catch (r) {
|
|
149
|
-
|
|
149
|
+
console.error(
|
|
150
150
|
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
|
|
151
|
-
)
|
|
151
|
+
);
|
|
152
152
|
}
|
|
153
|
-
return
|
|
153
|
+
return Oe(t, e);
|
|
154
154
|
}
|
|
155
|
-
return
|
|
155
|
+
return e;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
const r = [...
|
|
157
|
+
function rt(t, e, s = 0) {
|
|
158
|
+
const r = [...t, e];
|
|
159
159
|
return s && r.length > s ? r.slice(1) : r;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
const r = [
|
|
161
|
+
function it(t, e, s = 0) {
|
|
162
|
+
const r = [e, ...t];
|
|
163
163
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
164
164
|
}
|
|
165
|
-
var
|
|
166
|
-
function
|
|
167
|
-
return process.env.NODE_ENV !== "production" &&
|
|
168
|
-
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${
|
|
169
|
-
), !
|
|
165
|
+
var me = Symbol();
|
|
166
|
+
function Le(t, e) {
|
|
167
|
+
return process.env.NODE_ENV !== "production" && t.queryFn === me && console.error(
|
|
168
|
+
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
|
|
169
|
+
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === me ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
|
|
170
170
|
}
|
|
171
|
-
var B, N,
|
|
171
|
+
var B, N, Z, Re, nt = (Re = class extends ge {
|
|
172
172
|
constructor() {
|
|
173
173
|
super();
|
|
174
174
|
l(this, B, void 0);
|
|
175
175
|
l(this, N, void 0);
|
|
176
|
-
l(this,
|
|
177
|
-
o(this,
|
|
178
|
-
if (!
|
|
179
|
-
const s = () =>
|
|
176
|
+
l(this, Z, void 0);
|
|
177
|
+
o(this, Z, (e) => {
|
|
178
|
+
if (!be && window.addEventListener) {
|
|
179
|
+
const s = () => e();
|
|
180
180
|
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
181
181
|
window.removeEventListener("visibilitychange", s);
|
|
182
182
|
};
|
|
@@ -184,40 +184,40 @@ var B, N, tt, xt, ue = (xt = class extends bt {
|
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
onSubscribe() {
|
|
187
|
-
i(this, N) || this.setEventListener(i(this,
|
|
187
|
+
i(this, N) || this.setEventListener(i(this, Z));
|
|
188
188
|
}
|
|
189
189
|
onUnsubscribe() {
|
|
190
|
-
var
|
|
191
|
-
this.hasListeners() || ((
|
|
190
|
+
var e;
|
|
191
|
+
this.hasListeners() || ((e = i(this, N)) == null || e.call(this), o(this, N, void 0));
|
|
192
192
|
}
|
|
193
|
-
setEventListener(
|
|
193
|
+
setEventListener(e) {
|
|
194
194
|
var s;
|
|
195
|
-
o(this,
|
|
195
|
+
o(this, Z, e), (s = i(this, N)) == null || s.call(this), o(this, N, e((r) => {
|
|
196
196
|
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
197
197
|
}));
|
|
198
198
|
}
|
|
199
|
-
setFocused(
|
|
200
|
-
i(this, B) !==
|
|
199
|
+
setFocused(e) {
|
|
200
|
+
i(this, B) !== e && (o(this, B, e), this.onFocus());
|
|
201
201
|
}
|
|
202
202
|
onFocus() {
|
|
203
|
-
const
|
|
203
|
+
const e = this.isFocused();
|
|
204
204
|
this.listeners.forEach((s) => {
|
|
205
|
-
s(
|
|
205
|
+
s(e);
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
isFocused() {
|
|
209
|
-
var
|
|
210
|
-
return typeof i(this, B) == "boolean" ? i(this, B) : ((
|
|
209
|
+
var e;
|
|
210
|
+
return typeof i(this, B) == "boolean" ? i(this, B) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
|
|
211
211
|
}
|
|
212
|
-
}, B = new WeakMap(), N = new WeakMap(),
|
|
212
|
+
}, B = new WeakMap(), N = new WeakMap(), Z = new WeakMap(), Re), Ne = new nt(), ee, G, te, Te, at = (Te = class extends ge {
|
|
213
213
|
constructor() {
|
|
214
214
|
super();
|
|
215
|
-
l(this,
|
|
215
|
+
l(this, ee, !0);
|
|
216
216
|
l(this, G, void 0);
|
|
217
|
-
l(this,
|
|
218
|
-
o(this,
|
|
219
|
-
if (!
|
|
220
|
-
const s = () =>
|
|
217
|
+
l(this, te, void 0);
|
|
218
|
+
o(this, te, (e) => {
|
|
219
|
+
if (!be && window.addEventListener) {
|
|
220
|
+
const s = () => e(!0), r = () => e(!1);
|
|
221
221
|
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
222
222
|
window.removeEventListener("online", s), window.removeEventListener("offline", r);
|
|
223
223
|
};
|
|
@@ -225,29 +225,29 @@ var B, N, tt, xt, ue = (xt = class extends bt {
|
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
onSubscribe() {
|
|
228
|
-
i(this, G) || this.setEventListener(i(this,
|
|
228
|
+
i(this, G) || this.setEventListener(i(this, te));
|
|
229
229
|
}
|
|
230
230
|
onUnsubscribe() {
|
|
231
|
-
var
|
|
232
|
-
this.hasListeners() || ((
|
|
231
|
+
var e;
|
|
232
|
+
this.hasListeners() || ((e = i(this, G)) == null || e.call(this), o(this, G, void 0));
|
|
233
233
|
}
|
|
234
|
-
setEventListener(
|
|
234
|
+
setEventListener(e) {
|
|
235
235
|
var s;
|
|
236
|
-
o(this,
|
|
236
|
+
o(this, te, e), (s = i(this, G)) == null || s.call(this), o(this, G, e(this.setOnline.bind(this)));
|
|
237
237
|
}
|
|
238
|
-
setOnline(
|
|
239
|
-
i(this,
|
|
240
|
-
r(
|
|
238
|
+
setOnline(e) {
|
|
239
|
+
i(this, ee) !== e && (o(this, ee, e), this.listeners.forEach((r) => {
|
|
240
|
+
r(e);
|
|
241
241
|
}));
|
|
242
242
|
}
|
|
243
243
|
isOnline() {
|
|
244
|
-
return i(this,
|
|
244
|
+
return i(this, ee);
|
|
245
245
|
}
|
|
246
|
-
},
|
|
247
|
-
function
|
|
248
|
-
let
|
|
246
|
+
}, ee = new WeakMap(), G = new WeakMap(), te = new WeakMap(), Te), ve = new at();
|
|
247
|
+
function ut() {
|
|
248
|
+
let t, e;
|
|
249
249
|
const s = new Promise((n, u) => {
|
|
250
|
-
|
|
250
|
+
t = n, e = u;
|
|
251
251
|
});
|
|
252
252
|
s.status = "pending", s.catch(() => {
|
|
253
253
|
});
|
|
@@ -258,123 +258,122 @@ function he() {
|
|
|
258
258
|
r({
|
|
259
259
|
status: "fulfilled",
|
|
260
260
|
value: n
|
|
261
|
-
}),
|
|
261
|
+
}), t(n);
|
|
262
262
|
}, s.reject = (n) => {
|
|
263
263
|
r({
|
|
264
264
|
status: "rejected",
|
|
265
265
|
reason: n
|
|
266
|
-
}),
|
|
266
|
+
}), e(n);
|
|
267
267
|
}, s;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
return Math.min(1e3 * 2 **
|
|
269
|
+
function ot(t) {
|
|
270
|
+
return Math.min(1e3 * 2 ** t, 3e4);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
return (
|
|
272
|
+
function Ge(t) {
|
|
273
|
+
return (t ?? "online") === "online" ? ve.isOnline() : !0;
|
|
274
274
|
}
|
|
275
|
-
var
|
|
276
|
-
constructor(
|
|
277
|
-
super("CancelledError"), this.revert =
|
|
275
|
+
var _e = class extends Error {
|
|
276
|
+
constructor(t) {
|
|
277
|
+
super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function Pe(t) {
|
|
281
|
+
return t instanceof _e;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
let
|
|
285
|
-
const u =
|
|
286
|
-
var
|
|
287
|
-
r || (
|
|
283
|
+
function Ve(t) {
|
|
284
|
+
let e = !1, s = 0, r = !1, n;
|
|
285
|
+
const u = ut(), h = (c) => {
|
|
286
|
+
var p;
|
|
287
|
+
r || (y(new _e(c)), (p = t.abort) == null || p.call(t));
|
|
288
288
|
}, a = () => {
|
|
289
|
-
|
|
290
|
-
},
|
|
291
|
-
|
|
292
|
-
},
|
|
293
|
-
var
|
|
294
|
-
r || (r = !0, (
|
|
295
|
-
},
|
|
296
|
-
var
|
|
297
|
-
r || (r = !0, (
|
|
298
|
-
},
|
|
299
|
-
var
|
|
300
|
-
n = (
|
|
301
|
-
(r ||
|
|
302
|
-
}, (
|
|
289
|
+
e = !0;
|
|
290
|
+
}, f = () => {
|
|
291
|
+
e = !1;
|
|
292
|
+
}, w = () => Ne.isFocused() && (t.networkMode === "always" || ve.isOnline()) && t.canRun(), m = () => Ge(t.networkMode) && t.canRun(), d = (c) => {
|
|
293
|
+
var p;
|
|
294
|
+
r || (r = !0, (p = t.onSuccess) == null || p.call(t, c), n == null || n(), u.resolve(c));
|
|
295
|
+
}, y = (c) => {
|
|
296
|
+
var p;
|
|
297
|
+
r || (r = !0, (p = t.onError) == null || p.call(t, c), n == null || n(), u.reject(c));
|
|
298
|
+
}, q = () => new Promise((c) => {
|
|
299
|
+
var p;
|
|
300
|
+
n = (E) => {
|
|
301
|
+
(r || w()) && c(E);
|
|
302
|
+
}, (p = t.onPause) == null || p.call(t);
|
|
303
303
|
}).then(() => {
|
|
304
|
-
var
|
|
305
|
-
n = void 0, r || (
|
|
306
|
-
}),
|
|
304
|
+
var c;
|
|
305
|
+
n = void 0, r || (c = t.onContinue) == null || c.call(t);
|
|
306
|
+
}), S = () => {
|
|
307
307
|
if (r)
|
|
308
308
|
return;
|
|
309
|
-
let
|
|
310
|
-
const
|
|
309
|
+
let c;
|
|
310
|
+
const p = s === 0 ? t.initialPromise : void 0;
|
|
311
311
|
try {
|
|
312
|
-
|
|
313
|
-
} catch (
|
|
314
|
-
|
|
312
|
+
c = p ?? t.fn();
|
|
313
|
+
} catch (E) {
|
|
314
|
+
c = Promise.reject(E);
|
|
315
315
|
}
|
|
316
|
-
Promise.resolve(
|
|
317
|
-
var
|
|
316
|
+
Promise.resolve(c).then(d).catch((E) => {
|
|
317
|
+
var k;
|
|
318
318
|
if (r)
|
|
319
319
|
return;
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
|
|
320
|
+
const M = t.retry ?? (be ? 0 : 3), g = t.retryDelay ?? ot, D = typeof g == "function" ? g(s, E) : g, j = M === !0 || typeof M == "number" && s < M || typeof M == "function" && M(s, E);
|
|
321
|
+
if (e || !j) {
|
|
322
|
+
y(E);
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
s++, (
|
|
326
|
-
|
|
325
|
+
s++, (k = t.onFail) == null || k.call(t, s, E), tt(D).then(() => w() ? void 0 : q()).then(() => {
|
|
326
|
+
e ? y(E) : S();
|
|
327
327
|
});
|
|
328
328
|
});
|
|
329
329
|
};
|
|
330
330
|
return {
|
|
331
331
|
promise: u,
|
|
332
|
-
cancel:
|
|
332
|
+
cancel: h,
|
|
333
333
|
continue: () => (n == null || n(), u),
|
|
334
334
|
cancelRetry: a,
|
|
335
|
-
continueRetry:
|
|
336
|
-
canStart:
|
|
337
|
-
start: () => (
|
|
335
|
+
continueRetry: f,
|
|
336
|
+
canStart: m,
|
|
337
|
+
start: () => (m() ? S() : q().then(S), u)
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
let e = [], t = 0, s = (a) => {
|
|
340
|
+
function ht() {
|
|
341
|
+
let t = [], e = 0, s = (a) => {
|
|
343
342
|
a();
|
|
344
343
|
}, r = (a) => {
|
|
345
344
|
a();
|
|
346
|
-
}, n =
|
|
345
|
+
}, n = (a) => setTimeout(a, 0);
|
|
347
346
|
const u = (a) => {
|
|
348
|
-
|
|
347
|
+
e ? t.push(a) : n(() => {
|
|
349
348
|
s(a);
|
|
350
349
|
});
|
|
351
|
-
},
|
|
352
|
-
const a =
|
|
353
|
-
|
|
350
|
+
}, h = () => {
|
|
351
|
+
const a = t;
|
|
352
|
+
t = [], a.length && n(() => {
|
|
354
353
|
r(() => {
|
|
355
|
-
a.forEach((
|
|
356
|
-
s(
|
|
354
|
+
a.forEach((f) => {
|
|
355
|
+
s(f);
|
|
357
356
|
});
|
|
358
357
|
});
|
|
359
358
|
});
|
|
360
359
|
};
|
|
361
360
|
return {
|
|
362
361
|
batch: (a) => {
|
|
363
|
-
let
|
|
364
|
-
|
|
362
|
+
let f;
|
|
363
|
+
e++;
|
|
365
364
|
try {
|
|
366
|
-
|
|
365
|
+
f = a();
|
|
367
366
|
} finally {
|
|
368
|
-
|
|
367
|
+
e--, e || h();
|
|
369
368
|
}
|
|
370
|
-
return
|
|
369
|
+
return f;
|
|
371
370
|
},
|
|
372
371
|
/**
|
|
373
372
|
* All calls to the wrapped function will be batched.
|
|
374
373
|
*/
|
|
375
|
-
batchCalls: (a) => (...
|
|
374
|
+
batchCalls: (a) => (...f) => {
|
|
376
375
|
u(() => {
|
|
377
|
-
a(...
|
|
376
|
+
a(...f);
|
|
378
377
|
});
|
|
379
378
|
},
|
|
380
379
|
schedule: u,
|
|
@@ -397,7 +396,7 @@ function de() {
|
|
|
397
396
|
}
|
|
398
397
|
};
|
|
399
398
|
}
|
|
400
|
-
var
|
|
399
|
+
var C = ht(), J, je, $e = (je = class {
|
|
401
400
|
constructor() {
|
|
402
401
|
l(this, J, void 0);
|
|
403
402
|
}
|
|
@@ -405,222 +404,214 @@ var E = de(), J, kt, Bt = (kt = class {
|
|
|
405
404
|
this.clearGcTimeout();
|
|
406
405
|
}
|
|
407
406
|
scheduleGc() {
|
|
408
|
-
this.clearGcTimeout(),
|
|
407
|
+
this.clearGcTimeout(), Ye(this.gcTime) && o(this, J, setTimeout(() => {
|
|
409
408
|
this.optionalRemove();
|
|
410
409
|
}, this.gcTime));
|
|
411
410
|
}
|
|
412
|
-
updateGcTime(
|
|
411
|
+
updateGcTime(t) {
|
|
413
412
|
this.gcTime = Math.max(
|
|
414
413
|
this.gcTime || 0,
|
|
415
|
-
|
|
414
|
+
t ?? (be ? 1 / 0 : 5 * 60 * 1e3)
|
|
416
415
|
);
|
|
417
416
|
}
|
|
418
417
|
clearGcTimeout() {
|
|
419
418
|
i(this, J) && (clearTimeout(i(this, J)), o(this, J, void 0));
|
|
420
419
|
}
|
|
421
|
-
}, J = new WeakMap(),
|
|
422
|
-
constructor(
|
|
420
|
+
}, J = new WeakMap(), je), se, re, A, W, O, le, X, R, x, ke, ct = (ke = class extends $e {
|
|
421
|
+
constructor(e) {
|
|
423
422
|
super();
|
|
424
423
|
l(this, R);
|
|
425
|
-
l(this,
|
|
424
|
+
l(this, se, void 0);
|
|
425
|
+
l(this, re, void 0);
|
|
426
|
+
l(this, A, void 0);
|
|
426
427
|
l(this, W, void 0);
|
|
427
|
-
l(this,
|
|
428
|
+
l(this, O, void 0);
|
|
429
|
+
l(this, le, void 0);
|
|
428
430
|
l(this, X, void 0);
|
|
429
|
-
|
|
430
|
-
l(this, lt, void 0);
|
|
431
|
-
l(this, Y, void 0);
|
|
432
|
-
o(this, Y, !1), o(this, lt, t.defaultOptions), this.setOptions(t.options), this.observers = [], o(this, X, t.client), o(this, Q, i(this, X).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, o(this, rt, pe(this.options)), this.state = t.state ?? i(this, rt), this.scheduleGc();
|
|
431
|
+
o(this, X, !1), o(this, le, e.defaultOptions), this.setOptions(e.options), this.observers = [], o(this, W, e.client), o(this, A, i(this, W).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, o(this, se, dt(this.options)), this.state = e.state ?? i(this, se), this.scheduleGc();
|
|
433
432
|
}
|
|
434
433
|
get meta() {
|
|
435
434
|
return this.options.meta;
|
|
436
435
|
}
|
|
437
436
|
get promise() {
|
|
438
|
-
var
|
|
439
|
-
return (
|
|
437
|
+
var e;
|
|
438
|
+
return (e = i(this, O)) == null ? void 0 : e.promise;
|
|
440
439
|
}
|
|
441
|
-
setOptions(
|
|
442
|
-
this.options = { ...i(this,
|
|
440
|
+
setOptions(e) {
|
|
441
|
+
this.options = { ...i(this, le), ...e }, this.updateGcTime(this.options.gcTime);
|
|
443
442
|
}
|
|
444
443
|
optionalRemove() {
|
|
445
|
-
!this.observers.length && this.state.fetchStatus === "idle" && i(this,
|
|
444
|
+
!this.observers.length && this.state.fetchStatus === "idle" && i(this, A).remove(this);
|
|
446
445
|
}
|
|
447
|
-
setData(
|
|
448
|
-
const r =
|
|
449
|
-
return
|
|
446
|
+
setData(e, s) {
|
|
447
|
+
const r = st(this.state.data, e, this.options);
|
|
448
|
+
return P(this, R, x).call(this, {
|
|
450
449
|
data: r,
|
|
451
450
|
type: "success",
|
|
452
451
|
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
453
452
|
manual: s == null ? void 0 : s.manual
|
|
454
453
|
}), r;
|
|
455
454
|
}
|
|
456
|
-
setState(
|
|
457
|
-
|
|
455
|
+
setState(e, s) {
|
|
456
|
+
P(this, R, x).call(this, { type: "setState", state: e, setStateOptions: s });
|
|
458
457
|
}
|
|
459
|
-
cancel(
|
|
458
|
+
cancel(e) {
|
|
460
459
|
var r, n;
|
|
461
|
-
const s = (r = i(this,
|
|
462
|
-
return (n = i(this,
|
|
460
|
+
const s = (r = i(this, O)) == null ? void 0 : r.promise;
|
|
461
|
+
return (n = i(this, O)) == null || n.cancel(e), s ? s.then(Q).catch(Q) : Promise.resolve();
|
|
463
462
|
}
|
|
464
463
|
destroy() {
|
|
465
464
|
super.destroy(), this.cancel({ silent: !0 });
|
|
466
465
|
}
|
|
467
466
|
reset() {
|
|
468
|
-
this.destroy(), this.setState(i(this,
|
|
467
|
+
this.destroy(), this.setState(i(this, se));
|
|
469
468
|
}
|
|
470
469
|
isActive() {
|
|
471
470
|
return this.observers.some(
|
|
472
|
-
(
|
|
471
|
+
(e) => et(e.options.enabled, this) !== !1
|
|
473
472
|
);
|
|
474
473
|
}
|
|
475
474
|
isDisabled() {
|
|
476
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
477
|
-
}
|
|
478
|
-
isStatic() {
|
|
479
|
-
return this.getObserversCount() > 0 ? this.observers.some(
|
|
480
|
-
(t) => Ot(t.options.staleTime, this) === "static"
|
|
481
|
-
) : !1;
|
|
475
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === me || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
482
476
|
}
|
|
483
477
|
isStale() {
|
|
484
|
-
return this.getObserversCount() > 0 ? this.observers.some(
|
|
485
|
-
(
|
|
486
|
-
) : this.state.data === void 0
|
|
478
|
+
return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
|
|
479
|
+
(e) => e.getCurrentResult().isStale
|
|
480
|
+
) : this.state.data === void 0;
|
|
487
481
|
}
|
|
488
|
-
isStaleByTime(
|
|
489
|
-
return this.state.
|
|
482
|
+
isStaleByTime(e = 0) {
|
|
483
|
+
return this.state.isInvalidated || this.state.data === void 0 || !Ze(this.state.dataUpdatedAt, e);
|
|
490
484
|
}
|
|
491
485
|
onFocus() {
|
|
492
486
|
var s;
|
|
493
|
-
const
|
|
494
|
-
|
|
487
|
+
const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
|
|
488
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, O)) == null || s.continue();
|
|
495
489
|
}
|
|
496
490
|
onOnline() {
|
|
497
491
|
var s;
|
|
498
|
-
const
|
|
499
|
-
|
|
492
|
+
const e = this.observers.find((r) => r.shouldFetchOnReconnect());
|
|
493
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, O)) == null || s.continue();
|
|
500
494
|
}
|
|
501
|
-
addObserver(
|
|
502
|
-
this.observers.includes(
|
|
495
|
+
addObserver(e) {
|
|
496
|
+
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this, A).notify({ type: "observerAdded", query: this, observer: e }));
|
|
503
497
|
}
|
|
504
|
-
removeObserver(
|
|
505
|
-
this.observers.includes(
|
|
498
|
+
removeObserver(e) {
|
|
499
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, O) && (i(this, X) ? i(this, O).cancel({ revert: !0 }) : i(this, O).cancelRetry()), this.scheduleGc()), i(this, A).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
506
500
|
}
|
|
507
501
|
getObserversCount() {
|
|
508
502
|
return this.observers.length;
|
|
509
503
|
}
|
|
510
504
|
invalidate() {
|
|
511
|
-
this.state.isInvalidated ||
|
|
505
|
+
this.state.isInvalidated || P(this, R, x).call(this, { type: "invalidate" });
|
|
512
506
|
}
|
|
513
|
-
fetch(
|
|
514
|
-
var
|
|
507
|
+
fetch(e, s) {
|
|
508
|
+
var f, w, m;
|
|
515
509
|
if (this.state.fetchStatus !== "idle") {
|
|
516
510
|
if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
|
|
517
511
|
this.cancel({ silent: !0 });
|
|
518
|
-
else if (i(this,
|
|
519
|
-
return i(this,
|
|
512
|
+
else if (i(this, O))
|
|
513
|
+
return i(this, O).continueRetry(), i(this, O).promise;
|
|
520
514
|
}
|
|
521
|
-
if (
|
|
522
|
-
const
|
|
523
|
-
|
|
515
|
+
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
516
|
+
const d = this.observers.find((y) => y.options.queryFn);
|
|
517
|
+
d && this.setOptions(d.options);
|
|
524
518
|
}
|
|
525
519
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
526
520
|
"As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
|
|
527
521
|
));
|
|
528
|
-
const r = new AbortController(), n = (
|
|
529
|
-
Object.defineProperty(
|
|
522
|
+
const r = new AbortController(), n = (d) => {
|
|
523
|
+
Object.defineProperty(d, "signal", {
|
|
530
524
|
enumerable: !0,
|
|
531
|
-
get: () => (o(this,
|
|
525
|
+
get: () => (o(this, X, !0), r.signal)
|
|
532
526
|
});
|
|
533
527
|
}, u = () => {
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
client: i(this, X),
|
|
537
|
-
queryKey: this.queryKey,
|
|
538
|
-
meta: this.meta
|
|
539
|
-
};
|
|
540
|
-
return n(h), h;
|
|
541
|
-
})();
|
|
542
|
-
return o(this, Y, !1), this.options.persister ? this.options.persister(
|
|
543
|
-
c,
|
|
544
|
-
g,
|
|
545
|
-
this
|
|
546
|
-
) : c(g);
|
|
547
|
-
}, a = (() => {
|
|
548
|
-
const c = {
|
|
549
|
-
fetchOptions: s,
|
|
550
|
-
options: this.options,
|
|
528
|
+
const d = Le(this.options, s), y = {
|
|
529
|
+
client: i(this, W),
|
|
551
530
|
queryKey: this.queryKey,
|
|
552
|
-
|
|
553
|
-
state: this.state,
|
|
554
|
-
fetchFn: u
|
|
531
|
+
meta: this.meta
|
|
555
532
|
};
|
|
556
|
-
return n(
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
533
|
+
return n(y), o(this, X, !1), this.options.persister ? this.options.persister(
|
|
534
|
+
d,
|
|
535
|
+
y,
|
|
536
|
+
this
|
|
537
|
+
) : d(y);
|
|
538
|
+
}, h = {
|
|
539
|
+
fetchOptions: s,
|
|
540
|
+
options: this.options,
|
|
541
|
+
queryKey: this.queryKey,
|
|
542
|
+
client: i(this, W),
|
|
543
|
+
state: this.state,
|
|
544
|
+
fetchFn: u
|
|
545
|
+
};
|
|
546
|
+
n(h), (f = this.options.behavior) == null || f.onFetch(
|
|
547
|
+
h,
|
|
548
|
+
this
|
|
549
|
+
), o(this, re, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((w = h.fetchOptions) == null ? void 0 : w.meta)) && P(this, R, x).call(this, { type: "fetch", meta: (m = h.fetchOptions) == null ? void 0 : m.meta });
|
|
550
|
+
const a = (d) => {
|
|
551
|
+
var y, q, S, c;
|
|
552
|
+
Pe(d) && d.silent || P(this, R, x).call(this, {
|
|
562
553
|
type: "error",
|
|
563
|
-
error:
|
|
564
|
-
}),
|
|
565
|
-
|
|
566
|
-
|
|
554
|
+
error: d
|
|
555
|
+
}), Pe(d) || ((q = (y = i(this, A).config).onError) == null || q.call(
|
|
556
|
+
y,
|
|
557
|
+
d,
|
|
567
558
|
this
|
|
568
|
-
), (
|
|
569
|
-
|
|
559
|
+
), (c = (S = i(this, A).config).onSettled) == null || c.call(
|
|
560
|
+
S,
|
|
570
561
|
this.state.data,
|
|
571
|
-
|
|
562
|
+
d,
|
|
572
563
|
this
|
|
573
564
|
)), this.scheduleGc();
|
|
574
565
|
};
|
|
575
|
-
return o(this,
|
|
566
|
+
return o(this, O, Ve({
|
|
576
567
|
initialPromise: s == null ? void 0 : s.initialPromise,
|
|
577
|
-
fn:
|
|
568
|
+
fn: h.fetchFn,
|
|
578
569
|
abort: r.abort.bind(r),
|
|
579
|
-
onSuccess: (
|
|
580
|
-
var
|
|
581
|
-
if (
|
|
570
|
+
onSuccess: (d) => {
|
|
571
|
+
var y, q, S, c;
|
|
572
|
+
if (d === void 0) {
|
|
582
573
|
process.env.NODE_ENV !== "production" && console.error(
|
|
583
574
|
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
584
|
-
),
|
|
575
|
+
), a(new Error(`${this.queryHash} data is undefined`));
|
|
585
576
|
return;
|
|
586
577
|
}
|
|
587
578
|
try {
|
|
588
|
-
this.setData(
|
|
589
|
-
} catch (
|
|
590
|
-
|
|
579
|
+
this.setData(d);
|
|
580
|
+
} catch (p) {
|
|
581
|
+
a(p);
|
|
591
582
|
return;
|
|
592
583
|
}
|
|
593
|
-
(
|
|
594
|
-
|
|
595
|
-
|
|
584
|
+
(q = (y = i(this, A).config).onSuccess) == null || q.call(y, d, this), (c = (S = i(this, A).config).onSettled) == null || c.call(
|
|
585
|
+
S,
|
|
586
|
+
d,
|
|
596
587
|
this.state.error,
|
|
597
588
|
this
|
|
598
589
|
), this.scheduleGc();
|
|
599
590
|
},
|
|
600
|
-
onError:
|
|
601
|
-
onFail: (
|
|
602
|
-
|
|
591
|
+
onError: a,
|
|
592
|
+
onFail: (d, y) => {
|
|
593
|
+
P(this, R, x).call(this, { type: "failed", failureCount: d, error: y });
|
|
603
594
|
},
|
|
604
595
|
onPause: () => {
|
|
605
|
-
|
|
596
|
+
P(this, R, x).call(this, { type: "pause" });
|
|
606
597
|
},
|
|
607
598
|
onContinue: () => {
|
|
608
|
-
|
|
599
|
+
P(this, R, x).call(this, { type: "continue" });
|
|
609
600
|
},
|
|
610
|
-
retry:
|
|
611
|
-
retryDelay:
|
|
612
|
-
networkMode:
|
|
601
|
+
retry: h.options.retry,
|
|
602
|
+
retryDelay: h.options.retryDelay,
|
|
603
|
+
networkMode: h.options.networkMode,
|
|
613
604
|
canRun: () => !0
|
|
614
|
-
})), i(this,
|
|
605
|
+
})), i(this, O).start();
|
|
615
606
|
}
|
|
616
|
-
},
|
|
607
|
+
}, se = new WeakMap(), re = new WeakMap(), A = new WeakMap(), W = new WeakMap(), O = new WeakMap(), le = new WeakMap(), X = new WeakMap(), R = new WeakSet(), x = function(e) {
|
|
617
608
|
const s = (r) => {
|
|
618
|
-
switch (
|
|
609
|
+
switch (e.type) {
|
|
619
610
|
case "failed":
|
|
620
611
|
return {
|
|
621
612
|
...r,
|
|
622
|
-
fetchFailureCount:
|
|
623
|
-
fetchFailureReason:
|
|
613
|
+
fetchFailureCount: e.failureCount,
|
|
614
|
+
fetchFailureReason: e.error
|
|
624
615
|
};
|
|
625
616
|
case "pause":
|
|
626
617
|
return {
|
|
@@ -635,27 +626,27 @@ var E = de(), J, kt, Bt = (kt = class {
|
|
|
635
626
|
case "fetch":
|
|
636
627
|
return {
|
|
637
628
|
...r,
|
|
638
|
-
...
|
|
639
|
-
fetchMeta:
|
|
629
|
+
...lt(r.data, this.options),
|
|
630
|
+
fetchMeta: e.meta ?? null
|
|
640
631
|
};
|
|
641
632
|
case "success":
|
|
642
|
-
return
|
|
633
|
+
return {
|
|
643
634
|
...r,
|
|
644
|
-
data:
|
|
635
|
+
data: e.data,
|
|
645
636
|
dataUpdateCount: r.dataUpdateCount + 1,
|
|
646
|
-
dataUpdatedAt:
|
|
637
|
+
dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
|
|
647
638
|
error: null,
|
|
648
639
|
isInvalidated: !1,
|
|
649
640
|
status: "success",
|
|
650
|
-
...!
|
|
641
|
+
...!e.manual && {
|
|
651
642
|
fetchStatus: "idle",
|
|
652
643
|
fetchFailureCount: 0,
|
|
653
644
|
fetchFailureReason: null
|
|
654
645
|
}
|
|
655
646
|
};
|
|
656
647
|
case "error":
|
|
657
|
-
const n =
|
|
658
|
-
return
|
|
648
|
+
const n = e.error;
|
|
649
|
+
return Pe(n) && n.revert && i(this, re) ? { ...i(this, re), fetchStatus: "idle" } : {
|
|
659
650
|
...r,
|
|
660
651
|
error: n,
|
|
661
652
|
errorUpdateCount: r.errorUpdateCount + 1,
|
|
@@ -673,31 +664,31 @@ var E = de(), J, kt, Bt = (kt = class {
|
|
|
673
664
|
case "setState":
|
|
674
665
|
return {
|
|
675
666
|
...r,
|
|
676
|
-
...
|
|
667
|
+
...e.state
|
|
677
668
|
};
|
|
678
669
|
}
|
|
679
670
|
};
|
|
680
|
-
this.state = s(this.state),
|
|
671
|
+
this.state = s(this.state), C.batch(() => {
|
|
681
672
|
this.observers.forEach((r) => {
|
|
682
673
|
r.onQueryUpdate();
|
|
683
|
-
}), i(this,
|
|
674
|
+
}), i(this, A).notify({ query: this, type: "updated", action: e });
|
|
684
675
|
});
|
|
685
|
-
},
|
|
686
|
-
function
|
|
676
|
+
}, ke);
|
|
677
|
+
function lt(t, e) {
|
|
687
678
|
return {
|
|
688
679
|
fetchFailureCount: 0,
|
|
689
680
|
fetchFailureReason: null,
|
|
690
|
-
fetchStatus:
|
|
691
|
-
...
|
|
681
|
+
fetchStatus: Ge(e.networkMode) ? "fetching" : "paused",
|
|
682
|
+
...t === void 0 && {
|
|
692
683
|
error: null,
|
|
693
684
|
status: "pending"
|
|
694
685
|
}
|
|
695
686
|
};
|
|
696
687
|
}
|
|
697
|
-
function
|
|
698
|
-
const
|
|
688
|
+
function dt(t) {
|
|
689
|
+
const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, r = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
|
|
699
690
|
return {
|
|
700
|
-
data:
|
|
691
|
+
data: e,
|
|
701
692
|
dataUpdateCount: 0,
|
|
702
693
|
dataUpdatedAt: s ? r ?? Date.now() : 0,
|
|
703
694
|
error: null,
|
|
@@ -711,209 +702,206 @@ function pe(e) {
|
|
|
711
702
|
fetchStatus: "idle"
|
|
712
703
|
};
|
|
713
704
|
}
|
|
714
|
-
var
|
|
715
|
-
constructor(
|
|
705
|
+
var U, Ue, ft = (Ue = class extends ge {
|
|
706
|
+
constructor(e = {}) {
|
|
716
707
|
super();
|
|
717
|
-
l(this,
|
|
718
|
-
this.config =
|
|
719
|
-
}
|
|
720
|
-
build(
|
|
721
|
-
const n = s.queryKey, u = s.queryHash ??
|
|
722
|
-
let
|
|
723
|
-
return
|
|
724
|
-
client:
|
|
708
|
+
l(this, U, void 0);
|
|
709
|
+
this.config = e, o(this, U, /* @__PURE__ */ new Map());
|
|
710
|
+
}
|
|
711
|
+
build(e, s, r) {
|
|
712
|
+
const n = s.queryKey, u = s.queryHash ?? Fe(n, s);
|
|
713
|
+
let h = this.get(u);
|
|
714
|
+
return h || (h = new ct({
|
|
715
|
+
client: e,
|
|
725
716
|
queryKey: n,
|
|
726
717
|
queryHash: u,
|
|
727
|
-
options:
|
|
718
|
+
options: e.defaultQueryOptions(s),
|
|
728
719
|
state: r,
|
|
729
|
-
defaultOptions:
|
|
730
|
-
}), this.add(
|
|
720
|
+
defaultOptions: e.getQueryDefaults(n)
|
|
721
|
+
}), this.add(h)), h;
|
|
731
722
|
}
|
|
732
|
-
add(
|
|
733
|
-
i(this,
|
|
723
|
+
add(e) {
|
|
724
|
+
i(this, U).has(e.queryHash) || (i(this, U).set(e.queryHash, e), this.notify({
|
|
734
725
|
type: "added",
|
|
735
|
-
query:
|
|
726
|
+
query: e
|
|
736
727
|
}));
|
|
737
728
|
}
|
|
738
|
-
remove(
|
|
739
|
-
const s = i(this,
|
|
740
|
-
s && (
|
|
729
|
+
remove(e) {
|
|
730
|
+
const s = i(this, U).get(e.queryHash);
|
|
731
|
+
s && (e.destroy(), s === e && i(this, U).delete(e.queryHash), this.notify({ type: "removed", query: e }));
|
|
741
732
|
}
|
|
742
733
|
clear() {
|
|
743
|
-
|
|
744
|
-
this.getAll().forEach((
|
|
745
|
-
this.remove(
|
|
734
|
+
C.batch(() => {
|
|
735
|
+
this.getAll().forEach((e) => {
|
|
736
|
+
this.remove(e);
|
|
746
737
|
});
|
|
747
738
|
});
|
|
748
739
|
}
|
|
749
|
-
get(
|
|
750
|
-
return i(this,
|
|
740
|
+
get(e) {
|
|
741
|
+
return i(this, U).get(e);
|
|
751
742
|
}
|
|
752
743
|
getAll() {
|
|
753
|
-
return [...i(this,
|
|
744
|
+
return [...i(this, U).values()];
|
|
754
745
|
}
|
|
755
|
-
find(
|
|
756
|
-
const s = { exact: !0, ...
|
|
746
|
+
find(e) {
|
|
747
|
+
const s = { exact: !0, ...e };
|
|
757
748
|
return this.getAll().find(
|
|
758
|
-
(r) =>
|
|
749
|
+
(r) => qe(s, r)
|
|
759
750
|
);
|
|
760
751
|
}
|
|
761
|
-
findAll(
|
|
752
|
+
findAll(e = {}) {
|
|
762
753
|
const s = this.getAll();
|
|
763
|
-
return Object.keys(
|
|
754
|
+
return Object.keys(e).length > 0 ? s.filter((r) => qe(e, r)) : s;
|
|
764
755
|
}
|
|
765
|
-
notify(
|
|
766
|
-
|
|
756
|
+
notify(e) {
|
|
757
|
+
C.batch(() => {
|
|
767
758
|
this.listeners.forEach((s) => {
|
|
768
|
-
s(
|
|
759
|
+
s(e);
|
|
769
760
|
});
|
|
770
761
|
});
|
|
771
762
|
}
|
|
772
763
|
onFocus() {
|
|
773
|
-
|
|
774
|
-
this.getAll().forEach((
|
|
775
|
-
|
|
764
|
+
C.batch(() => {
|
|
765
|
+
this.getAll().forEach((e) => {
|
|
766
|
+
e.onFocus();
|
|
776
767
|
});
|
|
777
768
|
});
|
|
778
769
|
}
|
|
779
770
|
onOnline() {
|
|
780
|
-
|
|
781
|
-
this.getAll().forEach((
|
|
782
|
-
|
|
771
|
+
C.batch(() => {
|
|
772
|
+
this.getAll().forEach((e) => {
|
|
773
|
+
e.onOnline();
|
|
783
774
|
});
|
|
784
775
|
});
|
|
785
776
|
}
|
|
786
|
-
},
|
|
787
|
-
constructor(
|
|
777
|
+
}, U = new WeakMap(), Ue), K, F, Y, I, L, Ke, yt = (Ke = class extends $e {
|
|
778
|
+
constructor(e) {
|
|
788
779
|
super();
|
|
789
|
-
l(this,
|
|
790
|
-
l(this,
|
|
791
|
-
l(this,
|
|
792
|
-
l(this,
|
|
793
|
-
this.mutationId =
|
|
780
|
+
l(this, I);
|
|
781
|
+
l(this, K, void 0);
|
|
782
|
+
l(this, F, void 0);
|
|
783
|
+
l(this, Y, void 0);
|
|
784
|
+
this.mutationId = e.mutationId, o(this, F, e.mutationCache), o(this, K, []), this.state = e.state || pt(), this.setOptions(e.options), this.scheduleGc();
|
|
794
785
|
}
|
|
795
|
-
setOptions(
|
|
796
|
-
this.options =
|
|
786
|
+
setOptions(e) {
|
|
787
|
+
this.options = e, this.updateGcTime(this.options.gcTime);
|
|
797
788
|
}
|
|
798
789
|
get meta() {
|
|
799
790
|
return this.options.meta;
|
|
800
791
|
}
|
|
801
|
-
addObserver(
|
|
802
|
-
i(this,
|
|
792
|
+
addObserver(e) {
|
|
793
|
+
i(this, K).includes(e) || (i(this, K).push(e), this.clearGcTimeout(), i(this, F).notify({
|
|
803
794
|
type: "observerAdded",
|
|
804
795
|
mutation: this,
|
|
805
|
-
observer:
|
|
796
|
+
observer: e
|
|
806
797
|
}));
|
|
807
798
|
}
|
|
808
|
-
removeObserver(
|
|
809
|
-
o(this,
|
|
799
|
+
removeObserver(e) {
|
|
800
|
+
o(this, K, i(this, K).filter((s) => s !== e)), this.scheduleGc(), i(this, F).notify({
|
|
810
801
|
type: "observerRemoved",
|
|
811
802
|
mutation: this,
|
|
812
|
-
observer:
|
|
803
|
+
observer: e
|
|
813
804
|
});
|
|
814
805
|
}
|
|
815
806
|
optionalRemove() {
|
|
816
|
-
i(this,
|
|
807
|
+
i(this, K).length || (this.state.status === "pending" ? this.scheduleGc() : i(this, F).remove(this));
|
|
817
808
|
}
|
|
818
809
|
continue() {
|
|
819
|
-
var
|
|
820
|
-
return ((
|
|
810
|
+
var e;
|
|
811
|
+
return ((e = i(this, Y)) == null ? void 0 : e.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
821
812
|
this.execute(this.state.variables);
|
|
822
813
|
}
|
|
823
|
-
async execute(
|
|
824
|
-
var u,
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
|
|
830
|
-
onFail: (w, z) => {
|
|
831
|
-
O(this, U, L).call(this, { type: "failed", failureCount: w, error: z });
|
|
814
|
+
async execute(e) {
|
|
815
|
+
var n, u, h, a, f, w, m, d, y, q, S, c, p, E, M, g, D, j, k, fe;
|
|
816
|
+
o(this, Y, Ve({
|
|
817
|
+
fn: () => this.options.mutationFn ? this.options.mutationFn(e) : Promise.reject(new Error("No mutationFn found")),
|
|
818
|
+
onFail: (b, z) => {
|
|
819
|
+
P(this, I, L).call(this, { type: "failed", failureCount: b, error: z });
|
|
832
820
|
},
|
|
833
821
|
onPause: () => {
|
|
834
|
-
|
|
822
|
+
P(this, I, L).call(this, { type: "pause" });
|
|
823
|
+
},
|
|
824
|
+
onContinue: () => {
|
|
825
|
+
P(this, I, L).call(this, { type: "continue" });
|
|
835
826
|
},
|
|
836
|
-
onContinue: s,
|
|
837
827
|
retry: this.options.retry ?? 0,
|
|
838
828
|
retryDelay: this.options.retryDelay,
|
|
839
829
|
networkMode: this.options.networkMode,
|
|
840
|
-
canRun: () => i(this,
|
|
830
|
+
canRun: () => i(this, F).canRun(this)
|
|
841
831
|
}));
|
|
842
|
-
const
|
|
832
|
+
const s = this.state.status === "pending", r = !i(this, Y).canStart();
|
|
843
833
|
try {
|
|
844
|
-
if (
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
u,
|
|
849
|
-
t,
|
|
834
|
+
if (!s) {
|
|
835
|
+
P(this, I, L).call(this, { type: "pending", variables: e, isPaused: r }), await ((u = (n = i(this, F).config).onMutate) == null ? void 0 : u.call(
|
|
836
|
+
n,
|
|
837
|
+
e,
|
|
850
838
|
this
|
|
851
839
|
));
|
|
852
|
-
const z = await ((
|
|
853
|
-
z !== this.state.context &&
|
|
840
|
+
const z = await ((a = (h = this.options).onMutate) == null ? void 0 : a.call(h, e));
|
|
841
|
+
z !== this.state.context && P(this, I, L).call(this, {
|
|
854
842
|
type: "pending",
|
|
855
843
|
context: z,
|
|
856
|
-
variables:
|
|
857
|
-
isPaused:
|
|
844
|
+
variables: e,
|
|
845
|
+
isPaused: r
|
|
858
846
|
});
|
|
859
847
|
}
|
|
860
|
-
const
|
|
861
|
-
return await ((
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
848
|
+
const b = await i(this, Y).start();
|
|
849
|
+
return await ((w = (f = i(this, F).config).onSuccess) == null ? void 0 : w.call(
|
|
850
|
+
f,
|
|
851
|
+
b,
|
|
852
|
+
e,
|
|
865
853
|
this.state.context,
|
|
866
854
|
this
|
|
867
|
-
)), await ((
|
|
868
|
-
|
|
869
|
-
|
|
855
|
+
)), await ((d = (m = this.options).onSuccess) == null ? void 0 : d.call(m, b, e, this.state.context)), await ((q = (y = i(this, F).config).onSettled) == null ? void 0 : q.call(
|
|
856
|
+
y,
|
|
857
|
+
b,
|
|
870
858
|
null,
|
|
871
859
|
this.state.variables,
|
|
872
860
|
this.state.context,
|
|
873
861
|
this
|
|
874
|
-
)), await ((
|
|
875
|
-
} catch (
|
|
862
|
+
)), await ((c = (S = this.options).onSettled) == null ? void 0 : c.call(S, b, null, e, this.state.context)), P(this, I, L).call(this, { type: "success", data: b }), b;
|
|
863
|
+
} catch (b) {
|
|
876
864
|
try {
|
|
877
|
-
throw await ((
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
865
|
+
throw await ((E = (p = i(this, F).config).onError) == null ? void 0 : E.call(
|
|
866
|
+
p,
|
|
867
|
+
b,
|
|
868
|
+
e,
|
|
881
869
|
this.state.context,
|
|
882
870
|
this
|
|
883
|
-
)), await ((
|
|
871
|
+
)), await ((g = (M = this.options).onError) == null ? void 0 : g.call(
|
|
872
|
+
M,
|
|
884
873
|
b,
|
|
885
|
-
|
|
886
|
-
t,
|
|
874
|
+
e,
|
|
887
875
|
this.state.context
|
|
888
|
-
)), await ((
|
|
889
|
-
|
|
876
|
+
)), await ((j = (D = i(this, F).config).onSettled) == null ? void 0 : j.call(
|
|
877
|
+
D,
|
|
890
878
|
void 0,
|
|
891
|
-
|
|
879
|
+
b,
|
|
892
880
|
this.state.variables,
|
|
893
881
|
this.state.context,
|
|
894
882
|
this
|
|
895
|
-
)), await ((
|
|
896
|
-
|
|
883
|
+
)), await ((fe = (k = this.options).onSettled) == null ? void 0 : fe.call(
|
|
884
|
+
k,
|
|
897
885
|
void 0,
|
|
898
|
-
|
|
899
|
-
|
|
886
|
+
b,
|
|
887
|
+
e,
|
|
900
888
|
this.state.context
|
|
901
|
-
)),
|
|
889
|
+
)), b;
|
|
902
890
|
} finally {
|
|
903
|
-
|
|
891
|
+
P(this, I, L).call(this, { type: "error", error: b });
|
|
904
892
|
}
|
|
905
893
|
} finally {
|
|
906
|
-
i(this,
|
|
894
|
+
i(this, F).runNext(this);
|
|
907
895
|
}
|
|
908
896
|
}
|
|
909
|
-
},
|
|
897
|
+
}, K = new WeakMap(), F = new WeakMap(), Y = new WeakMap(), I = new WeakSet(), L = function(e) {
|
|
910
898
|
const s = (r) => {
|
|
911
|
-
switch (
|
|
899
|
+
switch (e.type) {
|
|
912
900
|
case "failed":
|
|
913
901
|
return {
|
|
914
902
|
...r,
|
|
915
|
-
failureCount:
|
|
916
|
-
failureReason:
|
|
903
|
+
failureCount: e.failureCount,
|
|
904
|
+
failureReason: e.error
|
|
917
905
|
};
|
|
918
906
|
case "pause":
|
|
919
907
|
return {
|
|
@@ -928,20 +916,20 @@ var j, Kt, me = (Kt = class extends bt {
|
|
|
928
916
|
case "pending":
|
|
929
917
|
return {
|
|
930
918
|
...r,
|
|
931
|
-
context:
|
|
919
|
+
context: e.context,
|
|
932
920
|
data: void 0,
|
|
933
921
|
failureCount: 0,
|
|
934
922
|
failureReason: null,
|
|
935
923
|
error: null,
|
|
936
|
-
isPaused:
|
|
924
|
+
isPaused: e.isPaused,
|
|
937
925
|
status: "pending",
|
|
938
|
-
variables:
|
|
926
|
+
variables: e.variables,
|
|
939
927
|
submittedAt: Date.now()
|
|
940
928
|
};
|
|
941
929
|
case "success":
|
|
942
930
|
return {
|
|
943
931
|
...r,
|
|
944
|
-
data:
|
|
932
|
+
data: e.data,
|
|
945
933
|
failureCount: 0,
|
|
946
934
|
failureReason: null,
|
|
947
935
|
error: null,
|
|
@@ -952,25 +940,25 @@ var j, Kt, me = (Kt = class extends bt {
|
|
|
952
940
|
return {
|
|
953
941
|
...r,
|
|
954
942
|
data: void 0,
|
|
955
|
-
error:
|
|
943
|
+
error: e.error,
|
|
956
944
|
failureCount: r.failureCount + 1,
|
|
957
|
-
failureReason:
|
|
945
|
+
failureReason: e.error,
|
|
958
946
|
isPaused: !1,
|
|
959
947
|
status: "error"
|
|
960
948
|
};
|
|
961
949
|
}
|
|
962
950
|
};
|
|
963
|
-
this.state = s(this.state),
|
|
964
|
-
i(this,
|
|
965
|
-
r.onMutationUpdate(
|
|
966
|
-
}), i(this,
|
|
951
|
+
this.state = s(this.state), C.batch(() => {
|
|
952
|
+
i(this, K).forEach((r) => {
|
|
953
|
+
r.onMutationUpdate(e);
|
|
954
|
+
}), i(this, F).notify({
|
|
967
955
|
mutation: this,
|
|
968
956
|
type: "updated",
|
|
969
|
-
action:
|
|
957
|
+
action: e
|
|
970
958
|
});
|
|
971
959
|
});
|
|
972
|
-
},
|
|
973
|
-
function
|
|
960
|
+
}, Ke);
|
|
961
|
+
function pt() {
|
|
974
962
|
return {
|
|
975
963
|
context: void 0,
|
|
976
964
|
data: void 0,
|
|
@@ -983,334 +971,328 @@ function ge() {
|
|
|
983
971
|
submittedAt: 0
|
|
984
972
|
};
|
|
985
973
|
}
|
|
986
|
-
var
|
|
987
|
-
constructor(
|
|
974
|
+
var H, T, de, Ie, mt = (Ie = class extends ge {
|
|
975
|
+
constructor(e = {}) {
|
|
988
976
|
super();
|
|
989
|
-
l(this,
|
|
977
|
+
l(this, H, void 0);
|
|
990
978
|
l(this, T, void 0);
|
|
991
|
-
l(this,
|
|
992
|
-
this.config =
|
|
979
|
+
l(this, de, void 0);
|
|
980
|
+
this.config = e, o(this, H, /* @__PURE__ */ new Set()), o(this, T, /* @__PURE__ */ new Map()), o(this, de, 0);
|
|
993
981
|
}
|
|
994
|
-
build(
|
|
995
|
-
const n = new
|
|
982
|
+
build(e, s, r) {
|
|
983
|
+
const n = new yt({
|
|
996
984
|
mutationCache: this,
|
|
997
|
-
mutationId: ++
|
|
998
|
-
options:
|
|
985
|
+
mutationId: ++ye(this, de)._,
|
|
986
|
+
options: e.defaultMutationOptions(s),
|
|
999
987
|
state: r
|
|
1000
988
|
});
|
|
1001
989
|
return this.add(n), n;
|
|
1002
990
|
}
|
|
1003
|
-
add(
|
|
1004
|
-
i(this,
|
|
1005
|
-
const s =
|
|
991
|
+
add(e) {
|
|
992
|
+
i(this, H).add(e);
|
|
993
|
+
const s = pe(e);
|
|
1006
994
|
if (typeof s == "string") {
|
|
1007
995
|
const r = i(this, T).get(s);
|
|
1008
|
-
r ? r.push(
|
|
996
|
+
r ? r.push(e) : i(this, T).set(s, [e]);
|
|
1009
997
|
}
|
|
1010
|
-
this.notify({ type: "added", mutation:
|
|
998
|
+
this.notify({ type: "added", mutation: e });
|
|
1011
999
|
}
|
|
1012
|
-
remove(
|
|
1013
|
-
if (i(this,
|
|
1014
|
-
const s =
|
|
1000
|
+
remove(e) {
|
|
1001
|
+
if (i(this, H).delete(e)) {
|
|
1002
|
+
const s = pe(e);
|
|
1015
1003
|
if (typeof s == "string") {
|
|
1016
1004
|
const r = i(this, T).get(s);
|
|
1017
1005
|
if (r)
|
|
1018
1006
|
if (r.length > 1) {
|
|
1019
|
-
const n = r.indexOf(
|
|
1007
|
+
const n = r.indexOf(e);
|
|
1020
1008
|
n !== -1 && r.splice(n, 1);
|
|
1021
1009
|
} else
|
|
1022
|
-
r[0] ===
|
|
1010
|
+
r[0] === e && i(this, T).delete(s);
|
|
1023
1011
|
}
|
|
1024
1012
|
}
|
|
1025
|
-
this.notify({ type: "removed", mutation:
|
|
1013
|
+
this.notify({ type: "removed", mutation: e });
|
|
1026
1014
|
}
|
|
1027
|
-
canRun(
|
|
1028
|
-
const s =
|
|
1015
|
+
canRun(e) {
|
|
1016
|
+
const s = pe(e);
|
|
1029
1017
|
if (typeof s == "string") {
|
|
1030
1018
|
const r = i(this, T).get(s), n = r == null ? void 0 : r.find(
|
|
1031
1019
|
(u) => u.state.status === "pending"
|
|
1032
1020
|
);
|
|
1033
|
-
return !n || n ===
|
|
1021
|
+
return !n || n === e;
|
|
1034
1022
|
} else
|
|
1035
1023
|
return !0;
|
|
1036
1024
|
}
|
|
1037
|
-
runNext(
|
|
1025
|
+
runNext(e) {
|
|
1038
1026
|
var r;
|
|
1039
|
-
const s =
|
|
1027
|
+
const s = pe(e);
|
|
1040
1028
|
if (typeof s == "string") {
|
|
1041
|
-
const n = (r = i(this, T).get(s)) == null ? void 0 : r.find((u) => u !==
|
|
1029
|
+
const n = (r = i(this, T).get(s)) == null ? void 0 : r.find((u) => u !== e && u.state.isPaused);
|
|
1042
1030
|
return (n == null ? void 0 : n.continue()) ?? Promise.resolve();
|
|
1043
1031
|
} else
|
|
1044
1032
|
return Promise.resolve();
|
|
1045
1033
|
}
|
|
1046
1034
|
clear() {
|
|
1047
|
-
|
|
1048
|
-
i(this,
|
|
1049
|
-
this.notify({ type: "removed", mutation:
|
|
1050
|
-
}), i(this,
|
|
1035
|
+
C.batch(() => {
|
|
1036
|
+
i(this, H).forEach((e) => {
|
|
1037
|
+
this.notify({ type: "removed", mutation: e });
|
|
1038
|
+
}), i(this, H).clear(), i(this, T).clear();
|
|
1051
1039
|
});
|
|
1052
1040
|
}
|
|
1053
1041
|
getAll() {
|
|
1054
|
-
return Array.from(i(this,
|
|
1042
|
+
return Array.from(i(this, H));
|
|
1055
1043
|
}
|
|
1056
|
-
find(
|
|
1057
|
-
const s = { exact: !0, ...
|
|
1044
|
+
find(e) {
|
|
1045
|
+
const s = { exact: !0, ...e };
|
|
1058
1046
|
return this.getAll().find(
|
|
1059
|
-
(r) =>
|
|
1047
|
+
(r) => Ee(s, r)
|
|
1060
1048
|
);
|
|
1061
1049
|
}
|
|
1062
|
-
findAll(
|
|
1063
|
-
return this.getAll().filter((s) =>
|
|
1050
|
+
findAll(e = {}) {
|
|
1051
|
+
return this.getAll().filter((s) => Ee(e, s));
|
|
1064
1052
|
}
|
|
1065
|
-
notify(
|
|
1066
|
-
|
|
1053
|
+
notify(e) {
|
|
1054
|
+
C.batch(() => {
|
|
1067
1055
|
this.listeners.forEach((s) => {
|
|
1068
|
-
s(
|
|
1056
|
+
s(e);
|
|
1069
1057
|
});
|
|
1070
1058
|
});
|
|
1071
1059
|
}
|
|
1072
1060
|
resumePausedMutations() {
|
|
1073
|
-
const
|
|
1074
|
-
return
|
|
1061
|
+
const e = this.getAll().filter((s) => s.state.isPaused);
|
|
1062
|
+
return C.batch(
|
|
1075
1063
|
() => Promise.all(
|
|
1076
|
-
|
|
1064
|
+
e.map((s) => s.continue().catch(Q))
|
|
1077
1065
|
)
|
|
1078
1066
|
);
|
|
1079
1067
|
}
|
|
1080
|
-
},
|
|
1081
|
-
function
|
|
1082
|
-
var
|
|
1083
|
-
return (
|
|
1068
|
+
}, H = new WeakMap(), T = new WeakMap(), de = new WeakMap(), Ie);
|
|
1069
|
+
function pe(t) {
|
|
1070
|
+
var e;
|
|
1071
|
+
return (e = t.options.scope) == null ? void 0 : e.id;
|
|
1084
1072
|
}
|
|
1085
|
-
function
|
|
1073
|
+
function Me(t) {
|
|
1086
1074
|
return {
|
|
1087
|
-
onFetch: (
|
|
1088
|
-
var
|
|
1089
|
-
const r =
|
|
1090
|
-
let a = { pages: [], pageParams: [] },
|
|
1091
|
-
const
|
|
1092
|
-
let
|
|
1093
|
-
const
|
|
1094
|
-
Object.defineProperty(
|
|
1075
|
+
onFetch: (e, s) => {
|
|
1076
|
+
var m, d, y, q, S;
|
|
1077
|
+
const r = e.options, n = (y = (d = (m = e.fetchOptions) == null ? void 0 : m.meta) == null ? void 0 : d.fetchMore) == null ? void 0 : y.direction, u = ((q = e.state.data) == null ? void 0 : q.pages) || [], h = ((S = e.state.data) == null ? void 0 : S.pageParams) || [];
|
|
1078
|
+
let a = { pages: [], pageParams: [] }, f = 0;
|
|
1079
|
+
const w = async () => {
|
|
1080
|
+
let c = !1;
|
|
1081
|
+
const p = (g) => {
|
|
1082
|
+
Object.defineProperty(g, "signal", {
|
|
1095
1083
|
enumerable: !0,
|
|
1096
|
-
get: () => (
|
|
1097
|
-
|
|
1098
|
-
}),
|
|
1084
|
+
get: () => (e.signal.aborted ? c = !0 : e.signal.addEventListener("abort", () => {
|
|
1085
|
+
c = !0;
|
|
1086
|
+
}), e.signal)
|
|
1099
1087
|
});
|
|
1100
|
-
},
|
|
1101
|
-
if (
|
|
1088
|
+
}, E = Le(e.options, e.fetchOptions), M = async (g, D, j) => {
|
|
1089
|
+
if (c)
|
|
1102
1090
|
return Promise.reject();
|
|
1103
|
-
if (D == null &&
|
|
1104
|
-
return Promise.resolve(
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1091
|
+
if (D == null && g.pages.length)
|
|
1092
|
+
return Promise.resolve(g);
|
|
1093
|
+
const k = {
|
|
1094
|
+
client: e.client,
|
|
1095
|
+
queryKey: e.queryKey,
|
|
1096
|
+
pageParam: D,
|
|
1097
|
+
direction: j ? "backward" : "forward",
|
|
1098
|
+
meta: e.options.meta
|
|
1099
|
+
};
|
|
1100
|
+
p(k);
|
|
1101
|
+
const fe = await E(
|
|
1102
|
+
k
|
|
1103
|
+
), { maxPages: b } = e.options, z = j ? it : rt;
|
|
1115
1104
|
return {
|
|
1116
|
-
pages: z(
|
|
1117
|
-
pageParams: z(
|
|
1105
|
+
pages: z(g.pages, fe, b),
|
|
1106
|
+
pageParams: z(g.pageParams, D, b)
|
|
1118
1107
|
};
|
|
1119
1108
|
};
|
|
1120
1109
|
if (n && u.length) {
|
|
1121
|
-
const
|
|
1110
|
+
const g = n === "backward", D = g ? vt : Qe, j = {
|
|
1122
1111
|
pages: u,
|
|
1123
|
-
pageParams:
|
|
1124
|
-
},
|
|
1125
|
-
a = await
|
|
1112
|
+
pageParams: h
|
|
1113
|
+
}, k = D(r, j);
|
|
1114
|
+
a = await M(j, k, g);
|
|
1126
1115
|
} else {
|
|
1127
|
-
const
|
|
1116
|
+
const g = t ?? u.length;
|
|
1128
1117
|
do {
|
|
1129
|
-
const D =
|
|
1130
|
-
if (
|
|
1118
|
+
const D = f === 0 ? h[0] ?? r.initialPageParam : Qe(r, a);
|
|
1119
|
+
if (f > 0 && D == null)
|
|
1131
1120
|
break;
|
|
1132
|
-
a = await
|
|
1133
|
-
} while (
|
|
1121
|
+
a = await M(a, D), f++;
|
|
1122
|
+
} while (f < g);
|
|
1134
1123
|
}
|
|
1135
1124
|
return a;
|
|
1136
1125
|
};
|
|
1137
|
-
|
|
1138
|
-
var
|
|
1139
|
-
return (
|
|
1140
|
-
|
|
1141
|
-
|
|
1126
|
+
e.options.persister ? e.fetchFn = () => {
|
|
1127
|
+
var c, p;
|
|
1128
|
+
return (p = (c = e.options).persister) == null ? void 0 : p.call(
|
|
1129
|
+
c,
|
|
1130
|
+
w,
|
|
1142
1131
|
{
|
|
1143
|
-
client:
|
|
1144
|
-
queryKey:
|
|
1145
|
-
meta:
|
|
1146
|
-
signal:
|
|
1132
|
+
client: e.client,
|
|
1133
|
+
queryKey: e.queryKey,
|
|
1134
|
+
meta: e.options.meta,
|
|
1135
|
+
signal: e.signal
|
|
1147
1136
|
},
|
|
1148
1137
|
s
|
|
1149
1138
|
);
|
|
1150
|
-
} :
|
|
1139
|
+
} : e.fetchFn = w;
|
|
1151
1140
|
}
|
|
1152
1141
|
};
|
|
1153
1142
|
}
|
|
1154
|
-
function
|
|
1155
|
-
const r =
|
|
1156
|
-
return
|
|
1157
|
-
|
|
1158
|
-
|
|
1143
|
+
function Qe(t, { pages: e, pageParams: s }) {
|
|
1144
|
+
const r = e.length - 1;
|
|
1145
|
+
return e.length > 0 ? t.getNextPageParam(
|
|
1146
|
+
e[r],
|
|
1147
|
+
e,
|
|
1159
1148
|
s[r],
|
|
1160
1149
|
s
|
|
1161
1150
|
) : void 0;
|
|
1162
1151
|
}
|
|
1163
|
-
function
|
|
1152
|
+
function vt(t, { pages: e, pageParams: s }) {
|
|
1164
1153
|
var r;
|
|
1165
|
-
return
|
|
1154
|
+
return e.length > 0 ? (r = t.getPreviousPageParam) == null ? void 0 : r.call(t, e[0], e, s[0], s) : void 0;
|
|
1166
1155
|
}
|
|
1167
|
-
var
|
|
1168
|
-
constructor(
|
|
1169
|
-
l(this,
|
|
1156
|
+
var v, _, V, ie, ne, $, ae, ue, xe, gt = (xe = class {
|
|
1157
|
+
constructor(t = {}) {
|
|
1158
|
+
l(this, v, void 0);
|
|
1170
1159
|
l(this, _, void 0);
|
|
1171
1160
|
l(this, V, void 0);
|
|
1172
|
-
l(this,
|
|
1173
|
-
l(this,
|
|
1161
|
+
l(this, ie, void 0);
|
|
1162
|
+
l(this, ne, void 0);
|
|
1174
1163
|
l(this, $, void 0);
|
|
1175
|
-
l(this,
|
|
1176
|
-
l(this,
|
|
1177
|
-
o(this,
|
|
1164
|
+
l(this, ae, void 0);
|
|
1165
|
+
l(this, ue, void 0);
|
|
1166
|
+
o(this, v, t.queryCache || new ft()), o(this, _, t.mutationCache || new mt()), o(this, V, t.defaultOptions || {}), o(this, ie, /* @__PURE__ */ new Map()), o(this, ne, /* @__PURE__ */ new Map()), o(this, $, 0);
|
|
1178
1167
|
}
|
|
1179
1168
|
mount() {
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
})), o(this,
|
|
1183
|
-
|
|
1169
|
+
ye(this, $)._++, i(this, $) === 1 && (o(this, ae, Ne.subscribe(async (t) => {
|
|
1170
|
+
t && (await this.resumePausedMutations(), i(this, v).onFocus());
|
|
1171
|
+
})), o(this, ue, ve.subscribe(async (t) => {
|
|
1172
|
+
t && (await this.resumePausedMutations(), i(this, v).onOnline());
|
|
1184
1173
|
})));
|
|
1185
1174
|
}
|
|
1186
1175
|
unmount() {
|
|
1187
|
-
var
|
|
1188
|
-
|
|
1189
|
-
}
|
|
1190
|
-
isFetching(
|
|
1191
|
-
return i(this,
|
|
1192
|
-
}
|
|
1193
|
-
isMutating(
|
|
1194
|
-
return i(this, _).findAll({ ...
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
* Imperative (non-reactive) way to retrieve data for a QueryKey.
|
|
1198
|
-
* Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
|
|
1199
|
-
*
|
|
1200
|
-
* Hint: Do not use this function inside a component, because it won't receive updates.
|
|
1201
|
-
* Use `useQuery` to create a `QueryObserver` that subscribes to changes.
|
|
1202
|
-
*/
|
|
1203
|
-
getQueryData(e) {
|
|
1176
|
+
var t, e;
|
|
1177
|
+
ye(this, $)._--, i(this, $) === 0 && ((t = i(this, ae)) == null || t.call(this), o(this, ae, void 0), (e = i(this, ue)) == null || e.call(this), o(this, ue, void 0));
|
|
1178
|
+
}
|
|
1179
|
+
isFetching(t) {
|
|
1180
|
+
return i(this, v).findAll({ ...t, fetchStatus: "fetching" }).length;
|
|
1181
|
+
}
|
|
1182
|
+
isMutating(t) {
|
|
1183
|
+
return i(this, _).findAll({ ...t, status: "pending" }).length;
|
|
1184
|
+
}
|
|
1185
|
+
getQueryData(t) {
|
|
1204
1186
|
var s;
|
|
1205
|
-
const
|
|
1206
|
-
return (s = i(this,
|
|
1187
|
+
const e = this.defaultQueryOptions({ queryKey: t });
|
|
1188
|
+
return (s = i(this, v).get(e.queryHash)) == null ? void 0 : s.state.data;
|
|
1207
1189
|
}
|
|
1208
|
-
ensureQueryData(
|
|
1209
|
-
const
|
|
1210
|
-
return r === void 0 ? this.fetchQuery(
|
|
1190
|
+
ensureQueryData(t) {
|
|
1191
|
+
const e = this.defaultQueryOptions(t), s = i(this, v).build(this, e), r = s.state.data;
|
|
1192
|
+
return r === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && s.isStaleByTime(Ce(e.staleTime, s)) && this.prefetchQuery(e), Promise.resolve(r));
|
|
1211
1193
|
}
|
|
1212
|
-
getQueriesData(
|
|
1213
|
-
return i(this,
|
|
1194
|
+
getQueriesData(t) {
|
|
1195
|
+
return i(this, v).findAll(t).map(({ queryKey: e, state: s }) => {
|
|
1214
1196
|
const r = s.data;
|
|
1215
|
-
return [
|
|
1197
|
+
return [e, r];
|
|
1216
1198
|
});
|
|
1217
1199
|
}
|
|
1218
|
-
setQueryData(
|
|
1219
|
-
const r = this.defaultQueryOptions({ queryKey:
|
|
1200
|
+
setQueryData(t, e, s) {
|
|
1201
|
+
const r = this.defaultQueryOptions({ queryKey: t }), n = i(this, v).get(
|
|
1220
1202
|
r.queryHash
|
|
1221
|
-
), u = n == null ? void 0 : n.state.data,
|
|
1222
|
-
if (
|
|
1223
|
-
return i(this,
|
|
1203
|
+
), u = n == null ? void 0 : n.state.data, h = Xe(e, u);
|
|
1204
|
+
if (h !== void 0)
|
|
1205
|
+
return i(this, v).build(this, r).setData(h, { ...s, manual: !0 });
|
|
1224
1206
|
}
|
|
1225
|
-
setQueriesData(
|
|
1226
|
-
return
|
|
1227
|
-
() => i(this,
|
|
1207
|
+
setQueriesData(t, e, s) {
|
|
1208
|
+
return C.batch(
|
|
1209
|
+
() => i(this, v).findAll(t).map(({ queryKey: r }) => [
|
|
1228
1210
|
r,
|
|
1229
|
-
this.setQueryData(r,
|
|
1211
|
+
this.setQueryData(r, e, s)
|
|
1230
1212
|
])
|
|
1231
1213
|
);
|
|
1232
1214
|
}
|
|
1233
|
-
getQueryState(
|
|
1215
|
+
getQueryState(t) {
|
|
1234
1216
|
var s;
|
|
1235
|
-
const
|
|
1236
|
-
return (s = i(this,
|
|
1237
|
-
|
|
1217
|
+
const e = this.defaultQueryOptions({ queryKey: t });
|
|
1218
|
+
return (s = i(this, v).get(
|
|
1219
|
+
e.queryHash
|
|
1238
1220
|
)) == null ? void 0 : s.state;
|
|
1239
1221
|
}
|
|
1240
|
-
removeQueries(
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1222
|
+
removeQueries(t) {
|
|
1223
|
+
const e = i(this, v);
|
|
1224
|
+
C.batch(() => {
|
|
1225
|
+
e.findAll(t).forEach((s) => {
|
|
1226
|
+
e.remove(s);
|
|
1245
1227
|
});
|
|
1246
1228
|
});
|
|
1247
1229
|
}
|
|
1248
|
-
resetQueries(
|
|
1249
|
-
const s = i(this,
|
|
1250
|
-
return
|
|
1230
|
+
resetQueries(t, e) {
|
|
1231
|
+
const s = i(this, v);
|
|
1232
|
+
return C.batch(() => (s.findAll(t).forEach((r) => {
|
|
1251
1233
|
r.reset();
|
|
1252
1234
|
}), this.refetchQueries(
|
|
1253
1235
|
{
|
|
1254
1236
|
type: "active",
|
|
1255
|
-
...
|
|
1237
|
+
...t
|
|
1256
1238
|
},
|
|
1257
|
-
|
|
1239
|
+
e
|
|
1258
1240
|
)));
|
|
1259
1241
|
}
|
|
1260
|
-
cancelQueries(
|
|
1261
|
-
const s = { revert: !0, ...
|
|
1262
|
-
() => i(this,
|
|
1242
|
+
cancelQueries(t, e = {}) {
|
|
1243
|
+
const s = { revert: !0, ...e }, r = C.batch(
|
|
1244
|
+
() => i(this, v).findAll(t).map((n) => n.cancel(s))
|
|
1263
1245
|
);
|
|
1264
|
-
return Promise.all(r).then(
|
|
1246
|
+
return Promise.all(r).then(Q).catch(Q);
|
|
1265
1247
|
}
|
|
1266
|
-
invalidateQueries(
|
|
1267
|
-
return
|
|
1248
|
+
invalidateQueries(t, e = {}) {
|
|
1249
|
+
return C.batch(() => (i(this, v).findAll(t).forEach((s) => {
|
|
1268
1250
|
s.invalidate();
|
|
1269
|
-
}), (
|
|
1251
|
+
}), (t == null ? void 0 : t.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
|
|
1270
1252
|
{
|
|
1271
|
-
...
|
|
1272
|
-
type: (
|
|
1253
|
+
...t,
|
|
1254
|
+
type: (t == null ? void 0 : t.refetchType) ?? (t == null ? void 0 : t.type) ?? "active"
|
|
1273
1255
|
},
|
|
1274
|
-
|
|
1256
|
+
e
|
|
1275
1257
|
)));
|
|
1276
1258
|
}
|
|
1277
|
-
refetchQueries(
|
|
1259
|
+
refetchQueries(t, e = {}) {
|
|
1278
1260
|
const s = {
|
|
1279
|
-
...
|
|
1280
|
-
cancelRefetch:
|
|
1281
|
-
}, r =
|
|
1282
|
-
() => i(this,
|
|
1261
|
+
...e,
|
|
1262
|
+
cancelRefetch: e.cancelRefetch ?? !0
|
|
1263
|
+
}, r = C.batch(
|
|
1264
|
+
() => i(this, v).findAll(t).filter((n) => !n.isDisabled()).map((n) => {
|
|
1283
1265
|
let u = n.fetch(void 0, s);
|
|
1284
|
-
return s.throwOnError || (u = u.catch(
|
|
1266
|
+
return s.throwOnError || (u = u.catch(Q)), n.state.fetchStatus === "paused" ? Promise.resolve() : u;
|
|
1285
1267
|
})
|
|
1286
1268
|
);
|
|
1287
|
-
return Promise.all(r).then(
|
|
1269
|
+
return Promise.all(r).then(Q);
|
|
1288
1270
|
}
|
|
1289
|
-
fetchQuery(
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1292
|
-
const s = i(this,
|
|
1271
|
+
fetchQuery(t) {
|
|
1272
|
+
const e = this.defaultQueryOptions(t);
|
|
1273
|
+
e.retry === void 0 && (e.retry = !1);
|
|
1274
|
+
const s = i(this, v).build(this, e);
|
|
1293
1275
|
return s.isStaleByTime(
|
|
1294
|
-
|
|
1295
|
-
) ? s.fetch(
|
|
1276
|
+
Ce(e.staleTime, s)
|
|
1277
|
+
) ? s.fetch(e) : Promise.resolve(s.state.data);
|
|
1296
1278
|
}
|
|
1297
|
-
prefetchQuery(
|
|
1298
|
-
return this.fetchQuery(
|
|
1279
|
+
prefetchQuery(t) {
|
|
1280
|
+
return this.fetchQuery(t).then(Q).catch(Q);
|
|
1299
1281
|
}
|
|
1300
|
-
fetchInfiniteQuery(
|
|
1301
|
-
return
|
|
1282
|
+
fetchInfiniteQuery(t) {
|
|
1283
|
+
return t.behavior = Me(t.pages), this.fetchQuery(t);
|
|
1302
1284
|
}
|
|
1303
|
-
prefetchInfiniteQuery(
|
|
1304
|
-
return this.fetchInfiniteQuery(
|
|
1285
|
+
prefetchInfiniteQuery(t) {
|
|
1286
|
+
return this.fetchInfiniteQuery(t).then(Q).catch(Q);
|
|
1305
1287
|
}
|
|
1306
|
-
ensureInfiniteQueryData(
|
|
1307
|
-
return
|
|
1288
|
+
ensureInfiniteQueryData(t) {
|
|
1289
|
+
return t.behavior = Me(t.pages), this.ensureQueryData(t);
|
|
1308
1290
|
}
|
|
1309
1291
|
resumePausedMutations() {
|
|
1310
|
-
return
|
|
1292
|
+
return ve.isOnline() ? i(this, _).resumePausedMutations() : Promise.resolve();
|
|
1311
1293
|
}
|
|
1312
1294
|
getQueryCache() {
|
|
1313
|
-
return i(this,
|
|
1295
|
+
return i(this, v);
|
|
1314
1296
|
}
|
|
1315
1297
|
getMutationCache() {
|
|
1316
1298
|
return i(this, _);
|
|
@@ -1318,70 +1300,70 @@ var p, _, V, it, nt, $, at, ut, Lt, Pe = (Lt = class {
|
|
|
1318
1300
|
getDefaultOptions() {
|
|
1319
1301
|
return i(this, V);
|
|
1320
1302
|
}
|
|
1321
|
-
setDefaultOptions(
|
|
1322
|
-
o(this, V,
|
|
1303
|
+
setDefaultOptions(t) {
|
|
1304
|
+
o(this, V, t);
|
|
1323
1305
|
}
|
|
1324
|
-
setQueryDefaults(
|
|
1325
|
-
i(this,
|
|
1326
|
-
queryKey:
|
|
1327
|
-
defaultOptions:
|
|
1306
|
+
setQueryDefaults(t, e) {
|
|
1307
|
+
i(this, ie).set(he(t), {
|
|
1308
|
+
queryKey: t,
|
|
1309
|
+
defaultOptions: e
|
|
1328
1310
|
});
|
|
1329
1311
|
}
|
|
1330
|
-
getQueryDefaults(
|
|
1331
|
-
const
|
|
1332
|
-
return
|
|
1333
|
-
|
|
1312
|
+
getQueryDefaults(t) {
|
|
1313
|
+
const e = [...i(this, ie).values()], s = {};
|
|
1314
|
+
return e.forEach((r) => {
|
|
1315
|
+
ce(t, r.queryKey) && Object.assign(s, r.defaultOptions);
|
|
1334
1316
|
}), s;
|
|
1335
1317
|
}
|
|
1336
|
-
setMutationDefaults(
|
|
1337
|
-
i(this,
|
|
1338
|
-
mutationKey:
|
|
1339
|
-
defaultOptions:
|
|
1318
|
+
setMutationDefaults(t, e) {
|
|
1319
|
+
i(this, ne).set(he(t), {
|
|
1320
|
+
mutationKey: t,
|
|
1321
|
+
defaultOptions: e
|
|
1340
1322
|
});
|
|
1341
1323
|
}
|
|
1342
|
-
getMutationDefaults(
|
|
1343
|
-
const
|
|
1344
|
-
return
|
|
1345
|
-
|
|
1324
|
+
getMutationDefaults(t) {
|
|
1325
|
+
const e = [...i(this, ne).values()], s = {};
|
|
1326
|
+
return e.forEach((r) => {
|
|
1327
|
+
ce(t, r.mutationKey) && Object.assign(s, r.defaultOptions);
|
|
1346
1328
|
}), s;
|
|
1347
1329
|
}
|
|
1348
|
-
defaultQueryOptions(
|
|
1349
|
-
if (
|
|
1350
|
-
return
|
|
1351
|
-
const
|
|
1330
|
+
defaultQueryOptions(t) {
|
|
1331
|
+
if (t._defaulted)
|
|
1332
|
+
return t;
|
|
1333
|
+
const e = {
|
|
1352
1334
|
...i(this, V).queries,
|
|
1353
|
-
...this.getQueryDefaults(
|
|
1354
|
-
...
|
|
1335
|
+
...this.getQueryDefaults(t.queryKey),
|
|
1336
|
+
...t,
|
|
1355
1337
|
_defaulted: !0
|
|
1356
1338
|
};
|
|
1357
|
-
return
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
)),
|
|
1339
|
+
return e.queryHash || (e.queryHash = Fe(
|
|
1340
|
+
e.queryKey,
|
|
1341
|
+
e
|
|
1342
|
+
)), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn === me && (e.enabled = !1), e;
|
|
1361
1343
|
}
|
|
1362
|
-
defaultMutationOptions(
|
|
1363
|
-
return
|
|
1344
|
+
defaultMutationOptions(t) {
|
|
1345
|
+
return t != null && t._defaulted ? t : {
|
|
1364
1346
|
...i(this, V).mutations,
|
|
1365
|
-
...(
|
|
1366
|
-
...
|
|
1347
|
+
...(t == null ? void 0 : t.mutationKey) && this.getMutationDefaults(t.mutationKey),
|
|
1348
|
+
...t,
|
|
1367
1349
|
_defaulted: !0
|
|
1368
1350
|
};
|
|
1369
1351
|
}
|
|
1370
1352
|
clear() {
|
|
1371
|
-
i(this,
|
|
1353
|
+
i(this, v).clear(), i(this, _).clear();
|
|
1372
1354
|
}
|
|
1373
|
-
},
|
|
1355
|
+
}, v = new WeakMap(), _ = new WeakMap(), V = new WeakMap(), ie = new WeakMap(), ne = new WeakMap(), $ = new WeakMap(), ae = new WeakMap(), ue = new WeakMap(), xe), bt = He.createContext(
|
|
1374
1356
|
void 0
|
|
1375
|
-
),
|
|
1376
|
-
client:
|
|
1377
|
-
children:
|
|
1378
|
-
}) => (
|
|
1379
|
-
|
|
1380
|
-
}), [
|
|
1381
|
-
const
|
|
1382
|
-
const { children:
|
|
1383
|
-
return /* @__PURE__ */
|
|
1357
|
+
), wt = ({
|
|
1358
|
+
client: t,
|
|
1359
|
+
children: e
|
|
1360
|
+
}) => (He.useEffect(() => (t.mount(), () => {
|
|
1361
|
+
t.unmount();
|
|
1362
|
+
}), [t]), /* @__PURE__ */ oe(bt.Provider, { value: t, children: e }));
|
|
1363
|
+
const Pt = new gt(), Dt = (t) => {
|
|
1364
|
+
const { children: e, customVariables: s, customDarkVariables: r, workerUrl: n, licenseKey: u, ...h } = t, { workerUrlAdded: a } = Je(n);
|
|
1365
|
+
return /* @__PURE__ */ oe(wt, { client: Pt, children: /* @__PURE__ */ oe(We, { licenseKey: u, children: /* @__PURE__ */ oe(Be, { workerUrlAdded: a, ...h, children: /* @__PURE__ */ oe(ze, { customDarkVariables: r, customVariables: s, children: e }) }) }) });
|
|
1384
1366
|
};
|
|
1385
1367
|
export {
|
|
1386
|
-
|
|
1368
|
+
Dt as RPConfig
|
|
1387
1369
|
};
|