@bigbinary/neeto-payments-frontend 1.6.0-beta2 → 2.0.1
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/AccountsDashboard.js +8 -10
- package/dist/AccountsDashboard.js.map +1 -1
- package/dist/Dashboard.js +11 -11
- package/dist/{ExportModal-85725c35.js → ExportModal-48434e79.js} +8 -8
- package/dist/{ExportModal-85725c35.js.map → ExportModal-48434e79.js.map} +1 -1
- package/dist/PayoutsDashboard.js +10 -12
- package/dist/PayoutsDashboard.js.map +1 -1
- package/dist/PayoutsPage.js +11 -11
- package/dist/RazorpayDashboard.js +9 -11
- package/dist/RazorpayDashboard.js.map +1 -1
- package/dist/RazorpayPaymentButton.js +6 -9
- package/dist/RazorpayPaymentButton.js.map +1 -1
- package/dist/StripeConnect.js +5 -6
- package/dist/StripeConnect.js.map +1 -1
- package/dist/UpiMarkAsPaidButton.js +4 -7
- package/dist/UpiMarkAsPaidButton.js.map +1 -1
- package/dist/UpiPayment.js +2 -5
- package/dist/UpiPayment.js.map +1 -1
- package/dist/V2PaymentsDashboard.js +5 -6
- package/dist/V2PaymentsDashboard.js.map +1 -1
- package/dist/cjs/AccountsDashboard.js +11 -12
- package/dist/cjs/AccountsDashboard.js.map +1 -1
- package/dist/cjs/Dashboard.js +15 -13
- package/dist/cjs/Dashboard.js.map +1 -1
- package/dist/cjs/{ExportModal-20f368a1.js → ExportModal-edfd3a7f.js} +11 -10
- package/dist/cjs/{ExportModal-20f368a1.js.map → ExportModal-edfd3a7f.js.map} +1 -1
- package/dist/cjs/PayoutsDashboard.js +12 -13
- package/dist/cjs/PayoutsDashboard.js.map +1 -1
- package/dist/cjs/PayoutsPage.js +11 -11
- package/dist/cjs/RazorpayDashboard.js +10 -12
- package/dist/cjs/RazorpayDashboard.js.map +1 -1
- package/dist/cjs/RazorpayPaymentButton.js +6 -9
- package/dist/cjs/RazorpayPaymentButton.js.map +1 -1
- package/dist/cjs/StripeConnect.js +6 -7
- package/dist/cjs/StripeConnect.js.map +1 -1
- package/dist/cjs/UpiMarkAsPaidButton.js +4 -7
- package/dist/cjs/UpiMarkAsPaidButton.js.map +1 -1
- package/dist/cjs/UpiPayment.js +2 -5
- package/dist/cjs/UpiPayment.js.map +1 -1
- package/dist/cjs/V2PaymentsDashboard.js +6 -7
- package/dist/cjs/V2PaymentsDashboard.js.map +1 -1
- package/dist/cjs/{exportChannel-7bd80952.js → exportChannel-9ac7cd08.js} +3 -3
- package/dist/cjs/{exportChannel-7bd80952.js.map → exportChannel-9ac7cd08.js.map} +1 -1
- package/dist/cjs/index.js +14 -14
- package/dist/cjs/queryConstants-45f84f3e.js +23 -0
- package/dist/cjs/queryConstants-45f84f3e.js.map +1 -0
- package/dist/cjs/renderFunctions-ec0f0a22.js +167 -0
- package/dist/cjs/renderFunctions-ec0f0a22.js.map +1 -0
- package/dist/cjs/{useConnectApi-f0665633.js → useConnectApi-c4afdf7d.js} +9 -8
- package/dist/cjs/useConnectApi-c4afdf7d.js.map +1 -0
- package/dist/cjs/{useFiltersAndPagination-312c0331.js → useFiltersAndPagination-0a176991.js} +2 -2
- package/dist/cjs/{useFiltersAndPagination-312c0331.js.map → useFiltersAndPagination-0a176991.js.map} +1 -1
- package/dist/cjs/{usePaymentApi-ae70e5df.js → usePaymentApi-7e79121a.js} +5 -5
- package/dist/cjs/{usePaymentApi-ae70e5df.js.map → usePaymentApi-7e79121a.js.map} +1 -1
- package/dist/cjs/{usePaymentsApi-815be3da.js → usePaymentsApi-74c8e44e.js} +4 -4
- package/dist/cjs/{usePaymentsApi-815be3da.js.map → usePaymentsApi-74c8e44e.js.map} +1 -1
- package/dist/cjs/{usePlatformApi-830827fa.js → usePlatformApi-cbedf69d.js} +11 -10
- package/dist/cjs/{usePlatformApi-830827fa.js.map → usePlatformApi-cbedf69d.js.map} +1 -1
- package/dist/cjs/useRazorpayPayment.js +3 -7
- package/dist/cjs/useRazorpayPayment.js.map +1 -1
- package/dist/{exportChannel-250e6f14.js → exportChannel-d0b7ed09.js} +2 -2
- package/dist/{exportChannel-250e6f14.js.map → exportChannel-d0b7ed09.js.map} +1 -1
- package/dist/index.js +14 -14
- package/dist/queryConstants-7d91832f.js +21 -0
- package/dist/queryConstants-7d91832f.js.map +1 -0
- package/dist/renderFunctions-058c9e2b.js +147 -0
- package/dist/renderFunctions-058c9e2b.js.map +1 -0
- package/dist/{useConnectApi-87335bf6.js → useConnectApi-4009b9b5.js} +3 -2
- package/dist/useConnectApi-4009b9b5.js.map +1 -0
- package/dist/{useFiltersAndPagination-2ab7bc8f.js → useFiltersAndPagination-bc8bad69.js} +2 -2
- package/dist/{useFiltersAndPagination-2ab7bc8f.js.map → useFiltersAndPagination-bc8bad69.js.map} +1 -1
- package/dist/{usePaymentApi-12737871.js → usePaymentApi-9876df31.js} +3 -3
- package/dist/{usePaymentApi-12737871.js.map → usePaymentApi-9876df31.js.map} +1 -1
- package/dist/{usePaymentsApi-a801ab15.js → usePaymentsApi-f3be0081.js} +2 -2
- package/dist/{usePaymentsApi-a801ab15.js.map → usePaymentsApi-f3be0081.js.map} +1 -1
- package/dist/{usePlatformApi-8adc2a50.js → usePlatformApi-b6664fae.js} +4 -3
- package/dist/{usePlatformApi-8adc2a50.js.map → usePlatformApi-b6664fae.js.map} +1 -1
- package/dist/useRazorpayPayment.js +3 -7
- package/dist/useRazorpayPayment.js.map +1 -1
- package/package.json +12 -10
- package/dist/U2TDTBMY-c464dc98.js +0 -12081
- package/dist/U2TDTBMY-c464dc98.js.map +0 -1
- package/dist/cjs/U2TDTBMY-e2fad970.js +0 -12083
- package/dist/cjs/U2TDTBMY-e2fad970.js.map +0 -1
- package/dist/cjs/mutation-ed7b84fc.js +0 -235
- package/dist/cjs/mutation-ed7b84fc.js.map +0 -1
- package/dist/cjs/queryConstants-de21eed5.js +0 -944
- package/dist/cjs/queryConstants-de21eed5.js.map +0 -1
- package/dist/cjs/renderFunctions-398d3fb5.js +0 -3719
- package/dist/cjs/renderFunctions-398d3fb5.js.map +0 -1
- package/dist/cjs/useConnectApi-f0665633.js.map +0 -1
- package/dist/cjs/useMutation-4c7cdbe1.js +0 -154
- package/dist/cjs/useMutation-4c7cdbe1.js.map +0 -1
- package/dist/cjs/utils-7eba34a4.js +0 -664
- package/dist/cjs/utils-7eba34a4.js.map +0 -1
- package/dist/mutation-286611ef.js +0 -232
- package/dist/mutation-286611ef.js.map +0 -1
- package/dist/queryConstants-765c8816.js +0 -920
- package/dist/queryConstants-765c8816.js.map +0 -1
- package/dist/renderFunctions-97b121a4.js +0 -3633
- package/dist/renderFunctions-97b121a4.js.map +0 -1
- package/dist/useConnectApi-87335bf6.js.map +0 -1
- package/dist/useMutation-8d67f853.js +0 -132
- package/dist/useMutation-8d67f853.js.map +0 -1
- package/dist/utils-e29db9c9.js +0 -614
- package/dist/utils-e29db9c9.js.map +0 -1
|
@@ -1,3719 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var utils = require('./utils-7eba34a4.js');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
7
|
-
var queryConstants = require('./queryConstants-de21eed5.js');
|
|
8
|
-
var mutation = require('./mutation-ed7b84fc.js');
|
|
9
|
-
var neetoCist = require('@bigbinary/neeto-cist');
|
|
10
|
-
var ramda = require('ramda');
|
|
11
|
-
var constants$1 = require('./constants.js');
|
|
12
|
-
var i18next = require('i18next');
|
|
13
|
-
var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
|
|
14
|
-
var Button = require('@bigbinary/neetoui/Button');
|
|
15
|
-
var Tag = require('@bigbinary/neetoui/Tag');
|
|
16
|
-
var Tooltip = require('@bigbinary/neetoui/Tooltip');
|
|
17
|
-
var CopyToClipboardButton = require('@bigbinary/neeto-molecules/CopyToClipboardButton');
|
|
18
|
-
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
function _interopNamespace(e) {
|
|
22
|
-
if (e && e.__esModule) return e;
|
|
23
|
-
var n = Object.create(null);
|
|
24
|
-
if (e) {
|
|
25
|
-
Object.keys(e).forEach(function (k) {
|
|
26
|
-
if (k !== 'default') {
|
|
27
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
28
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () { return e[k]; }
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
n["default"] = e;
|
|
36
|
-
return Object.freeze(n);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
40
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
41
|
-
var DateFormat__default = /*#__PURE__*/_interopDefaultLegacy(DateFormat);
|
|
42
|
-
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
43
|
-
var Tag__default = /*#__PURE__*/_interopDefaultLegacy(Tag);
|
|
44
|
-
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
|
45
|
-
var CopyToClipboardButton__default = /*#__PURE__*/_interopDefaultLegacy(CopyToClipboardButton);
|
|
46
|
-
|
|
47
|
-
// src/queryCache.ts
|
|
48
|
-
var QueryCache = class extends utils.Subscribable {
|
|
49
|
-
constructor(config = {}) {
|
|
50
|
-
super();
|
|
51
|
-
this.config = config;
|
|
52
|
-
this.#queries = /* @__PURE__ */ new Map();
|
|
53
|
-
}
|
|
54
|
-
#queries;
|
|
55
|
-
build(client, options, state) {
|
|
56
|
-
const queryKey = options.queryKey;
|
|
57
|
-
const queryHash = options.queryHash ?? utils.hashQueryKeyByOptions(queryKey, options);
|
|
58
|
-
let query = this.get(queryHash);
|
|
59
|
-
if (!query) {
|
|
60
|
-
query = new queryConstants.Query({
|
|
61
|
-
cache: this,
|
|
62
|
-
queryKey,
|
|
63
|
-
queryHash,
|
|
64
|
-
options: client.defaultQueryOptions(options),
|
|
65
|
-
state,
|
|
66
|
-
defaultOptions: client.getQueryDefaults(queryKey)
|
|
67
|
-
});
|
|
68
|
-
this.add(query);
|
|
69
|
-
}
|
|
70
|
-
return query;
|
|
71
|
-
}
|
|
72
|
-
add(query) {
|
|
73
|
-
if (!this.#queries.has(query.queryHash)) {
|
|
74
|
-
this.#queries.set(query.queryHash, query);
|
|
75
|
-
this.notify({
|
|
76
|
-
type: "added",
|
|
77
|
-
query
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
remove(query) {
|
|
82
|
-
const queryInMap = this.#queries.get(query.queryHash);
|
|
83
|
-
if (queryInMap) {
|
|
84
|
-
query.destroy();
|
|
85
|
-
if (queryInMap === query) {
|
|
86
|
-
this.#queries.delete(query.queryHash);
|
|
87
|
-
}
|
|
88
|
-
this.notify({ type: "removed", query });
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
clear() {
|
|
92
|
-
utils.notifyManager.batch(() => {
|
|
93
|
-
this.getAll().forEach((query) => {
|
|
94
|
-
this.remove(query);
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
get(queryHash) {
|
|
99
|
-
return this.#queries.get(queryHash);
|
|
100
|
-
}
|
|
101
|
-
getAll() {
|
|
102
|
-
return [...this.#queries.values()];
|
|
103
|
-
}
|
|
104
|
-
find(filters) {
|
|
105
|
-
const defaultedFilters = { exact: true, ...filters };
|
|
106
|
-
return this.getAll().find(
|
|
107
|
-
(query) => utils.matchQuery(defaultedFilters, query)
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
findAll(filters = {}) {
|
|
111
|
-
const queries = this.getAll();
|
|
112
|
-
return Object.keys(filters).length > 0 ? queries.filter((query) => utils.matchQuery(filters, query)) : queries;
|
|
113
|
-
}
|
|
114
|
-
notify(event) {
|
|
115
|
-
utils.notifyManager.batch(() => {
|
|
116
|
-
this.listeners.forEach((listener) => {
|
|
117
|
-
listener(event);
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
onFocus() {
|
|
122
|
-
utils.notifyManager.batch(() => {
|
|
123
|
-
this.getAll().forEach((query) => {
|
|
124
|
-
query.onFocus();
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
onOnline() {
|
|
129
|
-
utils.notifyManager.batch(() => {
|
|
130
|
-
this.getAll().forEach((query) => {
|
|
131
|
-
query.onOnline();
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
// src/mutationCache.ts
|
|
138
|
-
var MutationCache = class extends utils.Subscribable {
|
|
139
|
-
constructor(config = {}) {
|
|
140
|
-
super();
|
|
141
|
-
this.config = config;
|
|
142
|
-
this.#mutations = /* @__PURE__ */ new Map();
|
|
143
|
-
this.#mutationId = Date.now();
|
|
144
|
-
}
|
|
145
|
-
#mutations;
|
|
146
|
-
#mutationId;
|
|
147
|
-
build(client, options, state) {
|
|
148
|
-
const mutation$1 = new mutation.Mutation({
|
|
149
|
-
mutationCache: this,
|
|
150
|
-
mutationId: ++this.#mutationId,
|
|
151
|
-
options: client.defaultMutationOptions(options),
|
|
152
|
-
state
|
|
153
|
-
});
|
|
154
|
-
this.add(mutation$1);
|
|
155
|
-
return mutation$1;
|
|
156
|
-
}
|
|
157
|
-
add(mutation) {
|
|
158
|
-
const scope = scopeFor(mutation);
|
|
159
|
-
const mutations = this.#mutations.get(scope) ?? [];
|
|
160
|
-
mutations.push(mutation);
|
|
161
|
-
this.#mutations.set(scope, mutations);
|
|
162
|
-
this.notify({ type: "added", mutation });
|
|
163
|
-
}
|
|
164
|
-
remove(mutation) {
|
|
165
|
-
const scope = scopeFor(mutation);
|
|
166
|
-
if (this.#mutations.has(scope)) {
|
|
167
|
-
const mutations = this.#mutations.get(scope)?.filter((x) => x !== mutation);
|
|
168
|
-
if (mutations) {
|
|
169
|
-
if (mutations.length === 0) {
|
|
170
|
-
this.#mutations.delete(scope);
|
|
171
|
-
} else {
|
|
172
|
-
this.#mutations.set(scope, mutations);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
this.notify({ type: "removed", mutation });
|
|
177
|
-
}
|
|
178
|
-
canRun(mutation) {
|
|
179
|
-
const firstPendingMutation = this.#mutations.get(scopeFor(mutation))?.find((m) => m.state.status === "pending");
|
|
180
|
-
return !firstPendingMutation || firstPendingMutation === mutation;
|
|
181
|
-
}
|
|
182
|
-
runNext(mutation) {
|
|
183
|
-
const foundMutation = this.#mutations.get(scopeFor(mutation))?.find((m) => m !== mutation && m.state.isPaused);
|
|
184
|
-
return foundMutation?.continue() ?? Promise.resolve();
|
|
185
|
-
}
|
|
186
|
-
clear() {
|
|
187
|
-
utils.notifyManager.batch(() => {
|
|
188
|
-
this.getAll().forEach((mutation) => {
|
|
189
|
-
this.remove(mutation);
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
getAll() {
|
|
194
|
-
return [...this.#mutations.values()].flat();
|
|
195
|
-
}
|
|
196
|
-
find(filters) {
|
|
197
|
-
const defaultedFilters = { exact: true, ...filters };
|
|
198
|
-
return this.getAll().find(
|
|
199
|
-
(mutation) => utils.matchMutation(defaultedFilters, mutation)
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
findAll(filters = {}) {
|
|
203
|
-
return this.getAll().filter((mutation) => utils.matchMutation(filters, mutation));
|
|
204
|
-
}
|
|
205
|
-
notify(event) {
|
|
206
|
-
utils.notifyManager.batch(() => {
|
|
207
|
-
this.listeners.forEach((listener) => {
|
|
208
|
-
listener(event);
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
resumePausedMutations() {
|
|
213
|
-
const pausedMutations = this.getAll().filter((x) => x.state.isPaused);
|
|
214
|
-
return utils.notifyManager.batch(
|
|
215
|
-
() => Promise.all(
|
|
216
|
-
pausedMutations.map((mutation) => mutation.continue().catch(utils.noop))
|
|
217
|
-
)
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
function scopeFor(mutation) {
|
|
222
|
-
return mutation.options.scope?.id ?? String(mutation.mutationId);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// src/infiniteQueryBehavior.ts
|
|
226
|
-
function infiniteQueryBehavior(pages) {
|
|
227
|
-
return {
|
|
228
|
-
onFetch: (context, query) => {
|
|
229
|
-
const fetchFn = async () => {
|
|
230
|
-
const options = context.options;
|
|
231
|
-
const direction = context.fetchOptions?.meta?.fetchMore?.direction;
|
|
232
|
-
const oldPages = context.state.data?.pages || [];
|
|
233
|
-
const oldPageParams = context.state.data?.pageParams || [];
|
|
234
|
-
const empty = { pages: [], pageParams: [] };
|
|
235
|
-
let cancelled = false;
|
|
236
|
-
const addSignalProperty = (object) => {
|
|
237
|
-
Object.defineProperty(object, "signal", {
|
|
238
|
-
enumerable: true,
|
|
239
|
-
get: () => {
|
|
240
|
-
if (context.signal.aborted) {
|
|
241
|
-
cancelled = true;
|
|
242
|
-
} else {
|
|
243
|
-
context.signal.addEventListener("abort", () => {
|
|
244
|
-
cancelled = true;
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
return context.signal;
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
};
|
|
251
|
-
const queryFn = utils.ensureQueryFn(context.options, context.fetchOptions);
|
|
252
|
-
const fetchPage = async (data, param, previous) => {
|
|
253
|
-
if (cancelled) {
|
|
254
|
-
return Promise.reject();
|
|
255
|
-
}
|
|
256
|
-
if (param == null && data.pages.length) {
|
|
257
|
-
return Promise.resolve(data);
|
|
258
|
-
}
|
|
259
|
-
const queryFnContext = {
|
|
260
|
-
queryKey: context.queryKey,
|
|
261
|
-
pageParam: param,
|
|
262
|
-
direction: previous ? "backward" : "forward",
|
|
263
|
-
meta: context.options.meta
|
|
264
|
-
};
|
|
265
|
-
addSignalProperty(queryFnContext);
|
|
266
|
-
const page = await queryFn(
|
|
267
|
-
queryFnContext
|
|
268
|
-
);
|
|
269
|
-
const { maxPages } = context.options;
|
|
270
|
-
const addTo = previous ? utils.addToStart : utils.addToEnd;
|
|
271
|
-
return {
|
|
272
|
-
pages: addTo(data.pages, page, maxPages),
|
|
273
|
-
pageParams: addTo(data.pageParams, param, maxPages)
|
|
274
|
-
};
|
|
275
|
-
};
|
|
276
|
-
let result;
|
|
277
|
-
if (direction && oldPages.length) {
|
|
278
|
-
const previous = direction === "backward";
|
|
279
|
-
const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;
|
|
280
|
-
const oldData = {
|
|
281
|
-
pages: oldPages,
|
|
282
|
-
pageParams: oldPageParams
|
|
283
|
-
};
|
|
284
|
-
const param = pageParamFn(options, oldData);
|
|
285
|
-
result = await fetchPage(oldData, param, previous);
|
|
286
|
-
} else {
|
|
287
|
-
result = await fetchPage(
|
|
288
|
-
empty,
|
|
289
|
-
oldPageParams[0] ?? options.initialPageParam
|
|
290
|
-
);
|
|
291
|
-
const remainingPages = pages ?? oldPages.length;
|
|
292
|
-
for (let i = 1; i < remainingPages; i++) {
|
|
293
|
-
const param = getNextPageParam(options, result);
|
|
294
|
-
result = await fetchPage(result, param);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
return result;
|
|
298
|
-
};
|
|
299
|
-
if (context.options.persister) {
|
|
300
|
-
context.fetchFn = () => {
|
|
301
|
-
return context.options.persister?.(
|
|
302
|
-
fetchFn,
|
|
303
|
-
{
|
|
304
|
-
queryKey: context.queryKey,
|
|
305
|
-
meta: context.options.meta,
|
|
306
|
-
signal: context.signal
|
|
307
|
-
},
|
|
308
|
-
query
|
|
309
|
-
);
|
|
310
|
-
};
|
|
311
|
-
} else {
|
|
312
|
-
context.fetchFn = fetchFn;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
function getNextPageParam(options, { pages, pageParams }) {
|
|
318
|
-
const lastIndex = pages.length - 1;
|
|
319
|
-
return options.getNextPageParam(
|
|
320
|
-
pages[lastIndex],
|
|
321
|
-
pages,
|
|
322
|
-
pageParams[lastIndex],
|
|
323
|
-
pageParams
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
function getPreviousPageParam(options, { pages, pageParams }) {
|
|
327
|
-
return options.getPreviousPageParam?.(
|
|
328
|
-
pages[0],
|
|
329
|
-
pages,
|
|
330
|
-
pageParams[0],
|
|
331
|
-
pageParams
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
// src/queryClient.ts
|
|
336
|
-
var QueryClient = class {
|
|
337
|
-
#queryCache;
|
|
338
|
-
#mutationCache;
|
|
339
|
-
#defaultOptions;
|
|
340
|
-
#queryDefaults;
|
|
341
|
-
#mutationDefaults;
|
|
342
|
-
#mountCount;
|
|
343
|
-
#unsubscribeFocus;
|
|
344
|
-
#unsubscribeOnline;
|
|
345
|
-
constructor(config = {}) {
|
|
346
|
-
this.#queryCache = config.queryCache || new QueryCache();
|
|
347
|
-
this.#mutationCache = config.mutationCache || new MutationCache();
|
|
348
|
-
this.#defaultOptions = config.defaultOptions || {};
|
|
349
|
-
this.#queryDefaults = /* @__PURE__ */ new Map();
|
|
350
|
-
this.#mutationDefaults = /* @__PURE__ */ new Map();
|
|
351
|
-
this.#mountCount = 0;
|
|
352
|
-
}
|
|
353
|
-
mount() {
|
|
354
|
-
this.#mountCount++;
|
|
355
|
-
if (this.#mountCount !== 1)
|
|
356
|
-
return;
|
|
357
|
-
this.#unsubscribeFocus = utils.focusManager.subscribe(async (focused) => {
|
|
358
|
-
if (focused) {
|
|
359
|
-
await this.resumePausedMutations();
|
|
360
|
-
this.#queryCache.onFocus();
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
this.#unsubscribeOnline = utils.onlineManager.subscribe(async (online) => {
|
|
364
|
-
if (online) {
|
|
365
|
-
await this.resumePausedMutations();
|
|
366
|
-
this.#queryCache.onOnline();
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
unmount() {
|
|
371
|
-
this.#mountCount--;
|
|
372
|
-
if (this.#mountCount !== 0)
|
|
373
|
-
return;
|
|
374
|
-
this.#unsubscribeFocus?.();
|
|
375
|
-
this.#unsubscribeFocus = void 0;
|
|
376
|
-
this.#unsubscribeOnline?.();
|
|
377
|
-
this.#unsubscribeOnline = void 0;
|
|
378
|
-
}
|
|
379
|
-
isFetching(filters) {
|
|
380
|
-
return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length;
|
|
381
|
-
}
|
|
382
|
-
isMutating(filters) {
|
|
383
|
-
return this.#mutationCache.findAll({ ...filters, status: "pending" }).length;
|
|
384
|
-
}
|
|
385
|
-
getQueryData(queryKey) {
|
|
386
|
-
const options = this.defaultQueryOptions({ queryKey });
|
|
387
|
-
return this.#queryCache.get(options.queryHash)?.state.data;
|
|
388
|
-
}
|
|
389
|
-
ensureQueryData(options) {
|
|
390
|
-
const cachedData = this.getQueryData(options.queryKey);
|
|
391
|
-
if (cachedData === void 0)
|
|
392
|
-
return this.fetchQuery(options);
|
|
393
|
-
else {
|
|
394
|
-
const defaultedOptions = this.defaultQueryOptions(options);
|
|
395
|
-
const query = this.#queryCache.build(this, defaultedOptions);
|
|
396
|
-
if (options.revalidateIfStale && query.isStaleByTime(defaultedOptions.staleTime)) {
|
|
397
|
-
void this.prefetchQuery(defaultedOptions);
|
|
398
|
-
}
|
|
399
|
-
return Promise.resolve(cachedData);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
getQueriesData(filters) {
|
|
403
|
-
return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {
|
|
404
|
-
const data = state.data;
|
|
405
|
-
return [queryKey, data];
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
setQueryData(queryKey, updater, options) {
|
|
409
|
-
const defaultedOptions = this.defaultQueryOptions({ queryKey });
|
|
410
|
-
const query = this.#queryCache.get(
|
|
411
|
-
defaultedOptions.queryHash
|
|
412
|
-
);
|
|
413
|
-
const prevData = query?.state.data;
|
|
414
|
-
const data = utils.functionalUpdate(updater, prevData);
|
|
415
|
-
if (data === void 0) {
|
|
416
|
-
return void 0;
|
|
417
|
-
}
|
|
418
|
-
return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });
|
|
419
|
-
}
|
|
420
|
-
setQueriesData(filters, updater, options) {
|
|
421
|
-
return utils.notifyManager.batch(
|
|
422
|
-
() => this.#queryCache.findAll(filters).map(({ queryKey }) => [
|
|
423
|
-
queryKey,
|
|
424
|
-
this.setQueryData(queryKey, updater, options)
|
|
425
|
-
])
|
|
426
|
-
);
|
|
427
|
-
}
|
|
428
|
-
getQueryState(queryKey) {
|
|
429
|
-
const options = this.defaultQueryOptions({ queryKey });
|
|
430
|
-
return this.#queryCache.get(options.queryHash)?.state;
|
|
431
|
-
}
|
|
432
|
-
removeQueries(filters) {
|
|
433
|
-
const queryCache = this.#queryCache;
|
|
434
|
-
utils.notifyManager.batch(() => {
|
|
435
|
-
queryCache.findAll(filters).forEach((query) => {
|
|
436
|
-
queryCache.remove(query);
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
resetQueries(filters, options) {
|
|
441
|
-
const queryCache = this.#queryCache;
|
|
442
|
-
const refetchFilters = {
|
|
443
|
-
type: "active",
|
|
444
|
-
...filters
|
|
445
|
-
};
|
|
446
|
-
return utils.notifyManager.batch(() => {
|
|
447
|
-
queryCache.findAll(filters).forEach((query) => {
|
|
448
|
-
query.reset();
|
|
449
|
-
});
|
|
450
|
-
return this.refetchQueries(refetchFilters, options);
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
cancelQueries(filters = {}, cancelOptions = {}) {
|
|
454
|
-
const defaultedCancelOptions = { revert: true, ...cancelOptions };
|
|
455
|
-
const promises = utils.notifyManager.batch(
|
|
456
|
-
() => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))
|
|
457
|
-
);
|
|
458
|
-
return Promise.all(promises).then(utils.noop).catch(utils.noop);
|
|
459
|
-
}
|
|
460
|
-
invalidateQueries(filters = {}, options = {}) {
|
|
461
|
-
return utils.notifyManager.batch(() => {
|
|
462
|
-
this.#queryCache.findAll(filters).forEach((query) => {
|
|
463
|
-
query.invalidate();
|
|
464
|
-
});
|
|
465
|
-
if (filters.refetchType === "none") {
|
|
466
|
-
return Promise.resolve();
|
|
467
|
-
}
|
|
468
|
-
const refetchFilters = {
|
|
469
|
-
...filters,
|
|
470
|
-
type: filters.refetchType ?? filters.type ?? "active"
|
|
471
|
-
};
|
|
472
|
-
return this.refetchQueries(refetchFilters, options);
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
refetchQueries(filters = {}, options) {
|
|
476
|
-
const fetchOptions = {
|
|
477
|
-
...options,
|
|
478
|
-
cancelRefetch: options?.cancelRefetch ?? true
|
|
479
|
-
};
|
|
480
|
-
const promises = utils.notifyManager.batch(
|
|
481
|
-
() => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => {
|
|
482
|
-
let promise = query.fetch(void 0, fetchOptions);
|
|
483
|
-
if (!fetchOptions.throwOnError) {
|
|
484
|
-
promise = promise.catch(utils.noop);
|
|
485
|
-
}
|
|
486
|
-
return query.state.fetchStatus === "paused" ? Promise.resolve() : promise;
|
|
487
|
-
})
|
|
488
|
-
);
|
|
489
|
-
return Promise.all(promises).then(utils.noop);
|
|
490
|
-
}
|
|
491
|
-
fetchQuery(options) {
|
|
492
|
-
const defaultedOptions = this.defaultQueryOptions(options);
|
|
493
|
-
if (defaultedOptions.retry === void 0) {
|
|
494
|
-
defaultedOptions.retry = false;
|
|
495
|
-
}
|
|
496
|
-
const query = this.#queryCache.build(this, defaultedOptions);
|
|
497
|
-
return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);
|
|
498
|
-
}
|
|
499
|
-
prefetchQuery(options) {
|
|
500
|
-
return this.fetchQuery(options).then(utils.noop).catch(utils.noop);
|
|
501
|
-
}
|
|
502
|
-
fetchInfiniteQuery(options) {
|
|
503
|
-
options.behavior = infiniteQueryBehavior(options.pages);
|
|
504
|
-
return this.fetchQuery(options);
|
|
505
|
-
}
|
|
506
|
-
prefetchInfiniteQuery(options) {
|
|
507
|
-
return this.fetchInfiniteQuery(options).then(utils.noop).catch(utils.noop);
|
|
508
|
-
}
|
|
509
|
-
resumePausedMutations() {
|
|
510
|
-
if (utils.onlineManager.isOnline()) {
|
|
511
|
-
return this.#mutationCache.resumePausedMutations();
|
|
512
|
-
}
|
|
513
|
-
return Promise.resolve();
|
|
514
|
-
}
|
|
515
|
-
getQueryCache() {
|
|
516
|
-
return this.#queryCache;
|
|
517
|
-
}
|
|
518
|
-
getMutationCache() {
|
|
519
|
-
return this.#mutationCache;
|
|
520
|
-
}
|
|
521
|
-
getDefaultOptions() {
|
|
522
|
-
return this.#defaultOptions;
|
|
523
|
-
}
|
|
524
|
-
setDefaultOptions(options) {
|
|
525
|
-
this.#defaultOptions = options;
|
|
526
|
-
}
|
|
527
|
-
setQueryDefaults(queryKey, options) {
|
|
528
|
-
this.#queryDefaults.set(utils.hashKey(queryKey), {
|
|
529
|
-
queryKey,
|
|
530
|
-
defaultOptions: options
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
getQueryDefaults(queryKey) {
|
|
534
|
-
const defaults = [...this.#queryDefaults.values()];
|
|
535
|
-
let result = {};
|
|
536
|
-
defaults.forEach((queryDefault) => {
|
|
537
|
-
if (utils.partialMatchKey(queryKey, queryDefault.queryKey)) {
|
|
538
|
-
result = { ...result, ...queryDefault.defaultOptions };
|
|
539
|
-
}
|
|
540
|
-
});
|
|
541
|
-
return result;
|
|
542
|
-
}
|
|
543
|
-
setMutationDefaults(mutationKey, options) {
|
|
544
|
-
this.#mutationDefaults.set(utils.hashKey(mutationKey), {
|
|
545
|
-
mutationKey,
|
|
546
|
-
defaultOptions: options
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
getMutationDefaults(mutationKey) {
|
|
550
|
-
const defaults = [...this.#mutationDefaults.values()];
|
|
551
|
-
let result = {};
|
|
552
|
-
defaults.forEach((queryDefault) => {
|
|
553
|
-
if (utils.partialMatchKey(mutationKey, queryDefault.mutationKey)) {
|
|
554
|
-
result = { ...result, ...queryDefault.defaultOptions };
|
|
555
|
-
}
|
|
556
|
-
});
|
|
557
|
-
return result;
|
|
558
|
-
}
|
|
559
|
-
defaultQueryOptions(options) {
|
|
560
|
-
if (options._defaulted) {
|
|
561
|
-
return options;
|
|
562
|
-
}
|
|
563
|
-
const defaultedOptions = {
|
|
564
|
-
...this.#defaultOptions.queries,
|
|
565
|
-
...this.getQueryDefaults(options.queryKey),
|
|
566
|
-
...options,
|
|
567
|
-
_defaulted: true
|
|
568
|
-
};
|
|
569
|
-
if (!defaultedOptions.queryHash) {
|
|
570
|
-
defaultedOptions.queryHash = utils.hashQueryKeyByOptions(
|
|
571
|
-
defaultedOptions.queryKey,
|
|
572
|
-
defaultedOptions
|
|
573
|
-
);
|
|
574
|
-
}
|
|
575
|
-
if (defaultedOptions.refetchOnReconnect === void 0) {
|
|
576
|
-
defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
|
|
577
|
-
}
|
|
578
|
-
if (defaultedOptions.throwOnError === void 0) {
|
|
579
|
-
defaultedOptions.throwOnError = !!defaultedOptions.suspense;
|
|
580
|
-
}
|
|
581
|
-
if (!defaultedOptions.networkMode && defaultedOptions.persister) {
|
|
582
|
-
defaultedOptions.networkMode = "offlineFirst";
|
|
583
|
-
}
|
|
584
|
-
if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === utils.skipToken) {
|
|
585
|
-
defaultedOptions.enabled = false;
|
|
586
|
-
}
|
|
587
|
-
return defaultedOptions;
|
|
588
|
-
}
|
|
589
|
-
defaultMutationOptions(options) {
|
|
590
|
-
if (options?._defaulted) {
|
|
591
|
-
return options;
|
|
592
|
-
}
|
|
593
|
-
return {
|
|
594
|
-
...this.#defaultOptions.mutations,
|
|
595
|
-
...options?.mutationKey && this.getMutationDefaults(options.mutationKey),
|
|
596
|
-
...options,
|
|
597
|
-
_defaulted: true
|
|
598
|
-
};
|
|
599
|
-
}
|
|
600
|
-
clear() {
|
|
601
|
-
this.#queryCache.clear();
|
|
602
|
-
this.#mutationCache.clear();
|
|
603
|
-
}
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
// ../../node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/dist/solid.js
|
|
607
|
-
var sharedConfig = {
|
|
608
|
-
context: void 0,
|
|
609
|
-
registry: void 0
|
|
610
|
-
};
|
|
611
|
-
function setHydrateContext(context) {
|
|
612
|
-
sharedConfig.context = context;
|
|
613
|
-
}
|
|
614
|
-
var equalFn = (a, b) => a === b;
|
|
615
|
-
var $PROXY = Symbol("solid-proxy");
|
|
616
|
-
var $TRACK = Symbol("solid-track");
|
|
617
|
-
var signalOptions = {
|
|
618
|
-
equals: equalFn
|
|
619
|
-
};
|
|
620
|
-
var runEffects = runQueue;
|
|
621
|
-
var STALE = 1;
|
|
622
|
-
var PENDING = 2;
|
|
623
|
-
var UNOWNED = {
|
|
624
|
-
owned: null,
|
|
625
|
-
cleanups: null,
|
|
626
|
-
context: null,
|
|
627
|
-
owner: null
|
|
628
|
-
};
|
|
629
|
-
var NO_INIT = {};
|
|
630
|
-
var Owner = null;
|
|
631
|
-
var Transition = null;
|
|
632
|
-
var ExternalSourceConfig = null;
|
|
633
|
-
var Listener = null;
|
|
634
|
-
var Updates = null;
|
|
635
|
-
var Effects = null;
|
|
636
|
-
var ExecCount = 0;
|
|
637
|
-
function createRoot(fn, detachedOwner) {
|
|
638
|
-
const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {
|
|
639
|
-
owned: null,
|
|
640
|
-
cleanups: null,
|
|
641
|
-
context: current ? current.context : null,
|
|
642
|
-
owner: current
|
|
643
|
-
}, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
|
|
644
|
-
Owner = root;
|
|
645
|
-
Listener = null;
|
|
646
|
-
try {
|
|
647
|
-
return runUpdates(updateFn, true);
|
|
648
|
-
} finally {
|
|
649
|
-
Listener = listener;
|
|
650
|
-
Owner = owner;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
function createSignal(value, options) {
|
|
654
|
-
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
655
|
-
const s = {
|
|
656
|
-
value,
|
|
657
|
-
observers: null,
|
|
658
|
-
observerSlots: null,
|
|
659
|
-
comparator: options.equals || void 0
|
|
660
|
-
};
|
|
661
|
-
const setter = (value2) => {
|
|
662
|
-
if (typeof value2 === "function") {
|
|
663
|
-
value2 = value2(s.value);
|
|
664
|
-
}
|
|
665
|
-
return writeSignal(s, value2);
|
|
666
|
-
};
|
|
667
|
-
return [readSignal.bind(s), setter];
|
|
668
|
-
}
|
|
669
|
-
function createComputed(fn, value, options) {
|
|
670
|
-
const c = createComputation(fn, value, true, STALE);
|
|
671
|
-
updateComputation(c);
|
|
672
|
-
}
|
|
673
|
-
function createRenderEffect(fn, value, options) {
|
|
674
|
-
const c = createComputation(fn, value, false, STALE);
|
|
675
|
-
updateComputation(c);
|
|
676
|
-
}
|
|
677
|
-
function createEffect(fn, value, options) {
|
|
678
|
-
runEffects = runUserEffects;
|
|
679
|
-
const c = createComputation(fn, value, false, STALE);
|
|
680
|
-
if (!options || !options.render)
|
|
681
|
-
c.user = true;
|
|
682
|
-
Effects ? Effects.push(c) : updateComputation(c);
|
|
683
|
-
}
|
|
684
|
-
function createMemo(fn, value, options) {
|
|
685
|
-
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
686
|
-
const c = createComputation(fn, value, true, 0);
|
|
687
|
-
c.observers = null;
|
|
688
|
-
c.observerSlots = null;
|
|
689
|
-
c.comparator = options.equals || void 0;
|
|
690
|
-
updateComputation(c);
|
|
691
|
-
return readSignal.bind(c);
|
|
692
|
-
}
|
|
693
|
-
function isPromise(v) {
|
|
694
|
-
return v && typeof v === "object" && "then" in v;
|
|
695
|
-
}
|
|
696
|
-
function createResource(pSource, pFetcher, pOptions) {
|
|
697
|
-
let source;
|
|
698
|
-
let fetcher;
|
|
699
|
-
let options;
|
|
700
|
-
if (arguments.length === 2 && typeof pFetcher === "object" || arguments.length === 1) {
|
|
701
|
-
source = true;
|
|
702
|
-
fetcher = pSource;
|
|
703
|
-
options = pFetcher || {};
|
|
704
|
-
} else {
|
|
705
|
-
source = pSource;
|
|
706
|
-
fetcher = pFetcher;
|
|
707
|
-
options = pOptions || {};
|
|
708
|
-
}
|
|
709
|
-
let pr = null, initP = NO_INIT, id = null, scheduled = false, resolved = "initialValue" in options, dynamic = typeof source === "function" && createMemo(source);
|
|
710
|
-
const contexts = /* @__PURE__ */ new Set(), [value, setValue] = (options.storage || createSignal)(options.initialValue), [error, setError] = createSignal(void 0), [track, trigger] = createSignal(void 0, {
|
|
711
|
-
equals: false
|
|
712
|
-
}), [state, setState] = createSignal(resolved ? "ready" : "unresolved");
|
|
713
|
-
if (sharedConfig.context) {
|
|
714
|
-
id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
|
|
715
|
-
let v;
|
|
716
|
-
if (options.ssrLoadFrom === "initial")
|
|
717
|
-
initP = options.initialValue;
|
|
718
|
-
else if (sharedConfig.load && (v = sharedConfig.load(id)))
|
|
719
|
-
initP = v;
|
|
720
|
-
}
|
|
721
|
-
function loadEnd(p, v, error2, key) {
|
|
722
|
-
if (pr === p) {
|
|
723
|
-
pr = null;
|
|
724
|
-
key !== void 0 && (resolved = true);
|
|
725
|
-
if ((p === initP || v === initP) && options.onHydrated)
|
|
726
|
-
queueMicrotask(
|
|
727
|
-
() => options.onHydrated(key, {
|
|
728
|
-
value: v
|
|
729
|
-
})
|
|
730
|
-
);
|
|
731
|
-
initP = NO_INIT;
|
|
732
|
-
completeLoad(v, error2);
|
|
733
|
-
}
|
|
734
|
-
return v;
|
|
735
|
-
}
|
|
736
|
-
function completeLoad(v, err) {
|
|
737
|
-
runUpdates(() => {
|
|
738
|
-
if (err === void 0)
|
|
739
|
-
setValue(() => v);
|
|
740
|
-
setState(err !== void 0 ? "errored" : resolved ? "ready" : "unresolved");
|
|
741
|
-
setError(err);
|
|
742
|
-
for (const c of contexts.keys())
|
|
743
|
-
c.decrement();
|
|
744
|
-
contexts.clear();
|
|
745
|
-
}, false);
|
|
746
|
-
}
|
|
747
|
-
function read() {
|
|
748
|
-
const c = SuspenseContext , v = value(), err = error();
|
|
749
|
-
if (err !== void 0 && !pr)
|
|
750
|
-
throw err;
|
|
751
|
-
if (Listener && !Listener.user && c) {
|
|
752
|
-
createComputed(() => {
|
|
753
|
-
track();
|
|
754
|
-
if (pr) {
|
|
755
|
-
if (c.resolved )
|
|
756
|
-
;
|
|
757
|
-
else if (!contexts.has(c)) {
|
|
758
|
-
c.increment();
|
|
759
|
-
contexts.add(c);
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
return v;
|
|
765
|
-
}
|
|
766
|
-
function load(refetching = true) {
|
|
767
|
-
if (refetching !== false && scheduled)
|
|
768
|
-
return;
|
|
769
|
-
scheduled = false;
|
|
770
|
-
const lookup = dynamic ? dynamic() : source;
|
|
771
|
-
if (lookup == null || lookup === false) {
|
|
772
|
-
loadEnd(pr, untrack(value));
|
|
773
|
-
return;
|
|
774
|
-
}
|
|
775
|
-
const p = initP !== NO_INIT ? initP : untrack(
|
|
776
|
-
() => fetcher(lookup, {
|
|
777
|
-
value: value(),
|
|
778
|
-
refetching
|
|
779
|
-
})
|
|
780
|
-
);
|
|
781
|
-
if (!isPromise(p)) {
|
|
782
|
-
loadEnd(pr, p, void 0, lookup);
|
|
783
|
-
return p;
|
|
784
|
-
}
|
|
785
|
-
pr = p;
|
|
786
|
-
if ("value" in p) {
|
|
787
|
-
if (p.status === "success")
|
|
788
|
-
loadEnd(pr, p.value, void 0, lookup);
|
|
789
|
-
else
|
|
790
|
-
loadEnd(pr, void 0, void 0, lookup);
|
|
791
|
-
return p;
|
|
792
|
-
}
|
|
793
|
-
scheduled = true;
|
|
794
|
-
queueMicrotask(() => scheduled = false);
|
|
795
|
-
runUpdates(() => {
|
|
796
|
-
setState(resolved ? "refreshing" : "pending");
|
|
797
|
-
trigger();
|
|
798
|
-
}, false);
|
|
799
|
-
return p.then(
|
|
800
|
-
(v) => loadEnd(p, v, void 0, lookup),
|
|
801
|
-
(e) => loadEnd(p, void 0, castError(e), lookup)
|
|
802
|
-
);
|
|
803
|
-
}
|
|
804
|
-
Object.defineProperties(read, {
|
|
805
|
-
state: {
|
|
806
|
-
get: () => state()
|
|
807
|
-
},
|
|
808
|
-
error: {
|
|
809
|
-
get: () => error()
|
|
810
|
-
},
|
|
811
|
-
loading: {
|
|
812
|
-
get() {
|
|
813
|
-
const s = state();
|
|
814
|
-
return s === "pending" || s === "refreshing";
|
|
815
|
-
}
|
|
816
|
-
},
|
|
817
|
-
latest: {
|
|
818
|
-
get() {
|
|
819
|
-
if (!resolved)
|
|
820
|
-
return read();
|
|
821
|
-
const err = error();
|
|
822
|
-
if (err && !pr)
|
|
823
|
-
throw err;
|
|
824
|
-
return value();
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
if (dynamic)
|
|
829
|
-
createComputed(() => load(false));
|
|
830
|
-
else
|
|
831
|
-
load(false);
|
|
832
|
-
return [
|
|
833
|
-
read,
|
|
834
|
-
{
|
|
835
|
-
refetch: load,
|
|
836
|
-
mutate: setValue
|
|
837
|
-
}
|
|
838
|
-
];
|
|
839
|
-
}
|
|
840
|
-
function batch(fn) {
|
|
841
|
-
return runUpdates(fn, false);
|
|
842
|
-
}
|
|
843
|
-
function untrack(fn) {
|
|
844
|
-
if (Listener === null)
|
|
845
|
-
return fn();
|
|
846
|
-
const listener = Listener;
|
|
847
|
-
Listener = null;
|
|
848
|
-
try {
|
|
849
|
-
if (ExternalSourceConfig)
|
|
850
|
-
;
|
|
851
|
-
return fn();
|
|
852
|
-
} finally {
|
|
853
|
-
Listener = listener;
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
function on(deps, fn, options) {
|
|
857
|
-
const isArray3 = Array.isArray(deps);
|
|
858
|
-
let prevInput;
|
|
859
|
-
let defer = options && options.defer;
|
|
860
|
-
return (prevValue) => {
|
|
861
|
-
let input;
|
|
862
|
-
if (isArray3) {
|
|
863
|
-
input = Array(deps.length);
|
|
864
|
-
for (let i = 0; i < deps.length; i++)
|
|
865
|
-
input[i] = deps[i]();
|
|
866
|
-
} else
|
|
867
|
-
input = deps();
|
|
868
|
-
if (defer) {
|
|
869
|
-
defer = false;
|
|
870
|
-
return prevValue;
|
|
871
|
-
}
|
|
872
|
-
const result = untrack(() => fn(input, prevInput, prevValue));
|
|
873
|
-
prevInput = input;
|
|
874
|
-
return result;
|
|
875
|
-
};
|
|
876
|
-
}
|
|
877
|
-
function onMount(fn) {
|
|
878
|
-
createEffect(() => untrack(fn));
|
|
879
|
-
}
|
|
880
|
-
function onCleanup(fn) {
|
|
881
|
-
if (Owner === null)
|
|
882
|
-
;
|
|
883
|
-
else if (Owner.cleanups === null)
|
|
884
|
-
Owner.cleanups = [fn];
|
|
885
|
-
else
|
|
886
|
-
Owner.cleanups.push(fn);
|
|
887
|
-
return fn;
|
|
888
|
-
}
|
|
889
|
-
function getOwner() {
|
|
890
|
-
return Owner;
|
|
891
|
-
}
|
|
892
|
-
function runWithOwner(o, fn) {
|
|
893
|
-
const prev = Owner;
|
|
894
|
-
const prevListener = Listener;
|
|
895
|
-
Owner = o;
|
|
896
|
-
Listener = null;
|
|
897
|
-
try {
|
|
898
|
-
return runUpdates(fn, true);
|
|
899
|
-
} catch (err) {
|
|
900
|
-
handleError(err);
|
|
901
|
-
} finally {
|
|
902
|
-
Owner = prev;
|
|
903
|
-
Listener = prevListener;
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
function startTransition(fn) {
|
|
907
|
-
const l = Listener;
|
|
908
|
-
const o = Owner;
|
|
909
|
-
return Promise.resolve().then(() => {
|
|
910
|
-
Listener = l;
|
|
911
|
-
Owner = o;
|
|
912
|
-
let t;
|
|
913
|
-
runUpdates(fn, false);
|
|
914
|
-
Listener = Owner = null;
|
|
915
|
-
return t ? t.done : void 0;
|
|
916
|
-
});
|
|
917
|
-
}
|
|
918
|
-
var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
919
|
-
function useTransition() {
|
|
920
|
-
return [transPending, startTransition];
|
|
921
|
-
}
|
|
922
|
-
function createContext(defaultValue, options) {
|
|
923
|
-
const id = Symbol("context");
|
|
924
|
-
return {
|
|
925
|
-
id,
|
|
926
|
-
Provider: createProvider(id),
|
|
927
|
-
defaultValue
|
|
928
|
-
};
|
|
929
|
-
}
|
|
930
|
-
function useContext(context) {
|
|
931
|
-
return Owner && Owner.context && Owner.context[context.id] !== void 0 ? Owner.context[context.id] : context.defaultValue;
|
|
932
|
-
}
|
|
933
|
-
function children(fn) {
|
|
934
|
-
const children2 = createMemo(fn);
|
|
935
|
-
const memo = createMemo(() => resolveChildren(children2()));
|
|
936
|
-
memo.toArray = () => {
|
|
937
|
-
const c = memo();
|
|
938
|
-
return Array.isArray(c) ? c : c != null ? [c] : [];
|
|
939
|
-
};
|
|
940
|
-
return memo;
|
|
941
|
-
}
|
|
942
|
-
var SuspenseContext;
|
|
943
|
-
function readSignal() {
|
|
944
|
-
if (this.sources && (this.state)) {
|
|
945
|
-
if ((this.state) === STALE)
|
|
946
|
-
updateComputation(this);
|
|
947
|
-
else {
|
|
948
|
-
const updates = Updates;
|
|
949
|
-
Updates = null;
|
|
950
|
-
runUpdates(() => lookUpstream(this), false);
|
|
951
|
-
Updates = updates;
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
if (Listener) {
|
|
955
|
-
const sSlot = this.observers ? this.observers.length : 0;
|
|
956
|
-
if (!Listener.sources) {
|
|
957
|
-
Listener.sources = [this];
|
|
958
|
-
Listener.sourceSlots = [sSlot];
|
|
959
|
-
} else {
|
|
960
|
-
Listener.sources.push(this);
|
|
961
|
-
Listener.sourceSlots.push(sSlot);
|
|
962
|
-
}
|
|
963
|
-
if (!this.observers) {
|
|
964
|
-
this.observers = [Listener];
|
|
965
|
-
this.observerSlots = [Listener.sources.length - 1];
|
|
966
|
-
} else {
|
|
967
|
-
this.observers.push(Listener);
|
|
968
|
-
this.observerSlots.push(Listener.sources.length - 1);
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
return this.value;
|
|
972
|
-
}
|
|
973
|
-
function writeSignal(node, value, isComp) {
|
|
974
|
-
let current = node.value;
|
|
975
|
-
if (!node.comparator || !node.comparator(current, value)) {
|
|
976
|
-
node.value = value;
|
|
977
|
-
if (node.observers && node.observers.length) {
|
|
978
|
-
runUpdates(() => {
|
|
979
|
-
for (let i = 0; i < node.observers.length; i += 1) {
|
|
980
|
-
const o = node.observers[i];
|
|
981
|
-
const TransitionRunning = Transition && Transition.running;
|
|
982
|
-
if (TransitionRunning && Transition.disposed.has(o))
|
|
983
|
-
;
|
|
984
|
-
if (TransitionRunning ? !o.tState : !o.state) {
|
|
985
|
-
if (o.pure)
|
|
986
|
-
Updates.push(o);
|
|
987
|
-
else
|
|
988
|
-
Effects.push(o);
|
|
989
|
-
if (o.observers)
|
|
990
|
-
markDownstream(o);
|
|
991
|
-
}
|
|
992
|
-
if (!TransitionRunning)
|
|
993
|
-
o.state = STALE;
|
|
994
|
-
}
|
|
995
|
-
if (Updates.length > 1e6) {
|
|
996
|
-
Updates = [];
|
|
997
|
-
if (false)
|
|
998
|
-
;
|
|
999
|
-
throw new Error();
|
|
1000
|
-
}
|
|
1001
|
-
}, false);
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
return value;
|
|
1005
|
-
}
|
|
1006
|
-
function updateComputation(node) {
|
|
1007
|
-
if (!node.fn)
|
|
1008
|
-
return;
|
|
1009
|
-
cleanNode(node);
|
|
1010
|
-
const time = ExecCount;
|
|
1011
|
-
runComputation(
|
|
1012
|
-
node,
|
|
1013
|
-
node.value,
|
|
1014
|
-
time
|
|
1015
|
-
);
|
|
1016
|
-
}
|
|
1017
|
-
function runComputation(node, value, time) {
|
|
1018
|
-
let nextValue;
|
|
1019
|
-
const owner = Owner, listener = Listener;
|
|
1020
|
-
Listener = Owner = node;
|
|
1021
|
-
try {
|
|
1022
|
-
nextValue = node.fn(value);
|
|
1023
|
-
} catch (err) {
|
|
1024
|
-
if (node.pure) {
|
|
1025
|
-
{
|
|
1026
|
-
node.state = STALE;
|
|
1027
|
-
node.owned && node.owned.forEach(cleanNode);
|
|
1028
|
-
node.owned = null;
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
node.updatedAt = time + 1;
|
|
1032
|
-
return handleError(err);
|
|
1033
|
-
} finally {
|
|
1034
|
-
Listener = listener;
|
|
1035
|
-
Owner = owner;
|
|
1036
|
-
}
|
|
1037
|
-
if (!node.updatedAt || node.updatedAt <= time) {
|
|
1038
|
-
if (node.updatedAt != null && "observers" in node) {
|
|
1039
|
-
writeSignal(node, nextValue);
|
|
1040
|
-
} else node.value = nextValue;
|
|
1041
|
-
node.updatedAt = time;
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
function createComputation(fn, init, pure, state = STALE, options) {
|
|
1045
|
-
const c = {
|
|
1046
|
-
fn,
|
|
1047
|
-
state,
|
|
1048
|
-
updatedAt: null,
|
|
1049
|
-
owned: null,
|
|
1050
|
-
sources: null,
|
|
1051
|
-
sourceSlots: null,
|
|
1052
|
-
cleanups: null,
|
|
1053
|
-
value: init,
|
|
1054
|
-
owner: Owner,
|
|
1055
|
-
context: Owner ? Owner.context : null,
|
|
1056
|
-
pure
|
|
1057
|
-
};
|
|
1058
|
-
if (Owner === null)
|
|
1059
|
-
;
|
|
1060
|
-
else if (Owner !== UNOWNED) {
|
|
1061
|
-
{
|
|
1062
|
-
if (!Owner.owned)
|
|
1063
|
-
Owner.owned = [c];
|
|
1064
|
-
else
|
|
1065
|
-
Owner.owned.push(c);
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
return c;
|
|
1069
|
-
}
|
|
1070
|
-
function runTop(node) {
|
|
1071
|
-
if ((node.state) === 0)
|
|
1072
|
-
return;
|
|
1073
|
-
if ((node.state) === PENDING)
|
|
1074
|
-
return lookUpstream(node);
|
|
1075
|
-
if (node.suspense && untrack(node.suspense.inFallback))
|
|
1076
|
-
return node.suspense.effects.push(node);
|
|
1077
|
-
const ancestors = [node];
|
|
1078
|
-
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
1079
|
-
if (node.state)
|
|
1080
|
-
ancestors.push(node);
|
|
1081
|
-
}
|
|
1082
|
-
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
1083
|
-
node = ancestors[i];
|
|
1084
|
-
if ((node.state) === STALE) {
|
|
1085
|
-
updateComputation(node);
|
|
1086
|
-
} else if ((node.state) === PENDING) {
|
|
1087
|
-
const updates = Updates;
|
|
1088
|
-
Updates = null;
|
|
1089
|
-
runUpdates(() => lookUpstream(node, ancestors[0]), false);
|
|
1090
|
-
Updates = updates;
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
function runUpdates(fn, init) {
|
|
1095
|
-
if (Updates)
|
|
1096
|
-
return fn();
|
|
1097
|
-
let wait = false;
|
|
1098
|
-
if (!init)
|
|
1099
|
-
Updates = [];
|
|
1100
|
-
if (Effects)
|
|
1101
|
-
wait = true;
|
|
1102
|
-
else
|
|
1103
|
-
Effects = [];
|
|
1104
|
-
ExecCount++;
|
|
1105
|
-
try {
|
|
1106
|
-
const res = fn();
|
|
1107
|
-
completeUpdates(wait);
|
|
1108
|
-
return res;
|
|
1109
|
-
} catch (err) {
|
|
1110
|
-
if (!wait)
|
|
1111
|
-
Effects = null;
|
|
1112
|
-
Updates = null;
|
|
1113
|
-
handleError(err);
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
function completeUpdates(wait) {
|
|
1117
|
-
if (Updates) {
|
|
1118
|
-
runQueue(Updates);
|
|
1119
|
-
Updates = null;
|
|
1120
|
-
}
|
|
1121
|
-
if (wait)
|
|
1122
|
-
return;
|
|
1123
|
-
const e = Effects;
|
|
1124
|
-
Effects = null;
|
|
1125
|
-
if (e.length)
|
|
1126
|
-
runUpdates(() => runEffects(e), false);
|
|
1127
|
-
}
|
|
1128
|
-
function runQueue(queue) {
|
|
1129
|
-
for (let i = 0; i < queue.length; i++)
|
|
1130
|
-
runTop(queue[i]);
|
|
1131
|
-
}
|
|
1132
|
-
function runUserEffects(queue) {
|
|
1133
|
-
let i, userLength = 0;
|
|
1134
|
-
for (i = 0; i < queue.length; i++) {
|
|
1135
|
-
const e = queue[i];
|
|
1136
|
-
if (!e.user)
|
|
1137
|
-
runTop(e);
|
|
1138
|
-
else
|
|
1139
|
-
queue[userLength++] = e;
|
|
1140
|
-
}
|
|
1141
|
-
if (sharedConfig.context) {
|
|
1142
|
-
if (sharedConfig.count) {
|
|
1143
|
-
sharedConfig.effects || (sharedConfig.effects = []);
|
|
1144
|
-
sharedConfig.effects.push(...queue.slice(0, userLength));
|
|
1145
|
-
return;
|
|
1146
|
-
} else if (sharedConfig.effects) {
|
|
1147
|
-
queue = [...sharedConfig.effects, ...queue];
|
|
1148
|
-
userLength += sharedConfig.effects.length;
|
|
1149
|
-
delete sharedConfig.effects;
|
|
1150
|
-
}
|
|
1151
|
-
setHydrateContext();
|
|
1152
|
-
}
|
|
1153
|
-
for (i = 0; i < userLength; i++)
|
|
1154
|
-
runTop(queue[i]);
|
|
1155
|
-
}
|
|
1156
|
-
function lookUpstream(node, ignore) {
|
|
1157
|
-
node.state = 0;
|
|
1158
|
-
for (let i = 0; i < node.sources.length; i += 1) {
|
|
1159
|
-
const source = node.sources[i];
|
|
1160
|
-
if (source.sources) {
|
|
1161
|
-
const state = source.state;
|
|
1162
|
-
if (state === STALE) {
|
|
1163
|
-
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
|
|
1164
|
-
runTop(source);
|
|
1165
|
-
} else if (state === PENDING)
|
|
1166
|
-
lookUpstream(source, ignore);
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
function markDownstream(node) {
|
|
1171
|
-
for (let i = 0; i < node.observers.length; i += 1) {
|
|
1172
|
-
const o = node.observers[i];
|
|
1173
|
-
if (!o.state) {
|
|
1174
|
-
o.state = PENDING;
|
|
1175
|
-
if (o.pure)
|
|
1176
|
-
Updates.push(o);
|
|
1177
|
-
else
|
|
1178
|
-
Effects.push(o);
|
|
1179
|
-
o.observers && markDownstream(o);
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
function cleanNode(node) {
|
|
1184
|
-
let i;
|
|
1185
|
-
if (node.sources) {
|
|
1186
|
-
while (node.sources.length) {
|
|
1187
|
-
const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;
|
|
1188
|
-
if (obs && obs.length) {
|
|
1189
|
-
const n = obs.pop(), s = source.observerSlots.pop();
|
|
1190
|
-
if (index < obs.length) {
|
|
1191
|
-
n.sourceSlots[s] = index;
|
|
1192
|
-
obs[index] = n;
|
|
1193
|
-
source.observerSlots[index] = s;
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
if (node.owned) {
|
|
1199
|
-
for (i = node.owned.length - 1; i >= 0; i--)
|
|
1200
|
-
cleanNode(node.owned[i]);
|
|
1201
|
-
node.owned = null;
|
|
1202
|
-
}
|
|
1203
|
-
if (node.cleanups) {
|
|
1204
|
-
for (i = node.cleanups.length - 1; i >= 0; i--)
|
|
1205
|
-
node.cleanups[i]();
|
|
1206
|
-
node.cleanups = null;
|
|
1207
|
-
}
|
|
1208
|
-
node.state = 0;
|
|
1209
|
-
}
|
|
1210
|
-
function castError(err) {
|
|
1211
|
-
if (err instanceof Error)
|
|
1212
|
-
return err;
|
|
1213
|
-
return new Error(typeof err === "string" ? err : "Unknown error", {
|
|
1214
|
-
cause: err
|
|
1215
|
-
});
|
|
1216
|
-
}
|
|
1217
|
-
function handleError(err, owner = Owner) {
|
|
1218
|
-
const error = castError(err);
|
|
1219
|
-
throw error;
|
|
1220
|
-
}
|
|
1221
|
-
function resolveChildren(children2) {
|
|
1222
|
-
if (typeof children2 === "function" && !children2.length)
|
|
1223
|
-
return resolveChildren(children2());
|
|
1224
|
-
if (Array.isArray(children2)) {
|
|
1225
|
-
const results = [];
|
|
1226
|
-
for (let i = 0; i < children2.length; i++) {
|
|
1227
|
-
const result = resolveChildren(children2[i]);
|
|
1228
|
-
Array.isArray(result) ? results.push.apply(results, result) : results.push(result);
|
|
1229
|
-
}
|
|
1230
|
-
return results;
|
|
1231
|
-
}
|
|
1232
|
-
return children2;
|
|
1233
|
-
}
|
|
1234
|
-
function createProvider(id, options) {
|
|
1235
|
-
return function provider(props) {
|
|
1236
|
-
let res;
|
|
1237
|
-
createRenderEffect(
|
|
1238
|
-
() => res = untrack(() => {
|
|
1239
|
-
Owner.context = {
|
|
1240
|
-
...Owner.context,
|
|
1241
|
-
[id]: props.value
|
|
1242
|
-
};
|
|
1243
|
-
return children(() => props.children);
|
|
1244
|
-
}),
|
|
1245
|
-
void 0
|
|
1246
|
-
);
|
|
1247
|
-
return res;
|
|
1248
|
-
};
|
|
1249
|
-
}
|
|
1250
|
-
var FALLBACK = Symbol("fallback");
|
|
1251
|
-
function dispose(d) {
|
|
1252
|
-
for (let i = 0; i < d.length; i++)
|
|
1253
|
-
d[i]();
|
|
1254
|
-
}
|
|
1255
|
-
function mapArray(list, mapFn, options = {}) {
|
|
1256
|
-
let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;
|
|
1257
|
-
onCleanup(() => dispose(disposers));
|
|
1258
|
-
return () => {
|
|
1259
|
-
let newItems = list() || [], i, j;
|
|
1260
|
-
newItems[$TRACK];
|
|
1261
|
-
return untrack(() => {
|
|
1262
|
-
let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;
|
|
1263
|
-
if (newLen === 0) {
|
|
1264
|
-
if (len !== 0) {
|
|
1265
|
-
dispose(disposers);
|
|
1266
|
-
disposers = [];
|
|
1267
|
-
items = [];
|
|
1268
|
-
mapped = [];
|
|
1269
|
-
len = 0;
|
|
1270
|
-
indexes && (indexes = []);
|
|
1271
|
-
}
|
|
1272
|
-
if (options.fallback) {
|
|
1273
|
-
items = [FALLBACK];
|
|
1274
|
-
mapped[0] = createRoot((disposer) => {
|
|
1275
|
-
disposers[0] = disposer;
|
|
1276
|
-
return options.fallback();
|
|
1277
|
-
});
|
|
1278
|
-
len = 1;
|
|
1279
|
-
}
|
|
1280
|
-
} else if (len === 0) {
|
|
1281
|
-
mapped = new Array(newLen);
|
|
1282
|
-
for (j = 0; j < newLen; j++) {
|
|
1283
|
-
items[j] = newItems[j];
|
|
1284
|
-
mapped[j] = createRoot(mapper);
|
|
1285
|
-
}
|
|
1286
|
-
len = newLen;
|
|
1287
|
-
} else {
|
|
1288
|
-
temp = new Array(newLen);
|
|
1289
|
-
tempdisposers = new Array(newLen);
|
|
1290
|
-
indexes && (tempIndexes = new Array(newLen));
|
|
1291
|
-
for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)
|
|
1292
|
-
;
|
|
1293
|
-
for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
|
|
1294
|
-
temp[newEnd] = mapped[end];
|
|
1295
|
-
tempdisposers[newEnd] = disposers[end];
|
|
1296
|
-
indexes && (tempIndexes[newEnd] = indexes[end]);
|
|
1297
|
-
}
|
|
1298
|
-
newIndices = /* @__PURE__ */ new Map();
|
|
1299
|
-
newIndicesNext = new Array(newEnd + 1);
|
|
1300
|
-
for (j = newEnd; j >= start; j--) {
|
|
1301
|
-
item = newItems[j];
|
|
1302
|
-
i = newIndices.get(item);
|
|
1303
|
-
newIndicesNext[j] = i === void 0 ? -1 : i;
|
|
1304
|
-
newIndices.set(item, j);
|
|
1305
|
-
}
|
|
1306
|
-
for (i = start; i <= end; i++) {
|
|
1307
|
-
item = items[i];
|
|
1308
|
-
j = newIndices.get(item);
|
|
1309
|
-
if (j !== void 0 && j !== -1) {
|
|
1310
|
-
temp[j] = mapped[i];
|
|
1311
|
-
tempdisposers[j] = disposers[i];
|
|
1312
|
-
indexes && (tempIndexes[j] = indexes[i]);
|
|
1313
|
-
j = newIndicesNext[j];
|
|
1314
|
-
newIndices.set(item, j);
|
|
1315
|
-
} else
|
|
1316
|
-
disposers[i]();
|
|
1317
|
-
}
|
|
1318
|
-
for (j = start; j < newLen; j++) {
|
|
1319
|
-
if (j in temp) {
|
|
1320
|
-
mapped[j] = temp[j];
|
|
1321
|
-
disposers[j] = tempdisposers[j];
|
|
1322
|
-
if (indexes) {
|
|
1323
|
-
indexes[j] = tempIndexes[j];
|
|
1324
|
-
indexes[j](j);
|
|
1325
|
-
}
|
|
1326
|
-
} else
|
|
1327
|
-
mapped[j] = createRoot(mapper);
|
|
1328
|
-
}
|
|
1329
|
-
mapped = mapped.slice(0, len = newLen);
|
|
1330
|
-
items = newItems.slice(0);
|
|
1331
|
-
}
|
|
1332
|
-
return mapped;
|
|
1333
|
-
});
|
|
1334
|
-
function mapper(disposer) {
|
|
1335
|
-
disposers[j] = disposer;
|
|
1336
|
-
if (indexes) {
|
|
1337
|
-
const [s, set] = createSignal(j);
|
|
1338
|
-
indexes[j] = set;
|
|
1339
|
-
return mapFn(newItems[j], s);
|
|
1340
|
-
}
|
|
1341
|
-
return mapFn(newItems[j]);
|
|
1342
|
-
}
|
|
1343
|
-
};
|
|
1344
|
-
}
|
|
1345
|
-
function indexArray(list, mapFn, options = {}) {
|
|
1346
|
-
let items = [], mapped = [], disposers = [], signals = [], len = 0, i;
|
|
1347
|
-
onCleanup(() => dispose(disposers));
|
|
1348
|
-
return () => {
|
|
1349
|
-
const newItems = list() || [];
|
|
1350
|
-
newItems[$TRACK];
|
|
1351
|
-
return untrack(() => {
|
|
1352
|
-
if (newItems.length === 0) {
|
|
1353
|
-
if (len !== 0) {
|
|
1354
|
-
dispose(disposers);
|
|
1355
|
-
disposers = [];
|
|
1356
|
-
items = [];
|
|
1357
|
-
mapped = [];
|
|
1358
|
-
len = 0;
|
|
1359
|
-
signals = [];
|
|
1360
|
-
}
|
|
1361
|
-
if (options.fallback) {
|
|
1362
|
-
items = [FALLBACK];
|
|
1363
|
-
mapped[0] = createRoot((disposer) => {
|
|
1364
|
-
disposers[0] = disposer;
|
|
1365
|
-
return options.fallback();
|
|
1366
|
-
});
|
|
1367
|
-
len = 1;
|
|
1368
|
-
}
|
|
1369
|
-
return mapped;
|
|
1370
|
-
}
|
|
1371
|
-
if (items[0] === FALLBACK) {
|
|
1372
|
-
disposers[0]();
|
|
1373
|
-
disposers = [];
|
|
1374
|
-
items = [];
|
|
1375
|
-
mapped = [];
|
|
1376
|
-
len = 0;
|
|
1377
|
-
}
|
|
1378
|
-
for (i = 0; i < newItems.length; i++) {
|
|
1379
|
-
if (i < items.length && items[i] !== newItems[i]) {
|
|
1380
|
-
signals[i](() => newItems[i]);
|
|
1381
|
-
} else if (i >= items.length) {
|
|
1382
|
-
mapped[i] = createRoot(mapper);
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
for (; i < items.length; i++) {
|
|
1386
|
-
disposers[i]();
|
|
1387
|
-
}
|
|
1388
|
-
len = signals.length = disposers.length = newItems.length;
|
|
1389
|
-
items = newItems.slice(0);
|
|
1390
|
-
return mapped = mapped.slice(0, len);
|
|
1391
|
-
});
|
|
1392
|
-
function mapper(disposer) {
|
|
1393
|
-
disposers[i] = disposer;
|
|
1394
|
-
const [s, set] = createSignal(newItems[i]);
|
|
1395
|
-
signals[i] = set;
|
|
1396
|
-
return mapFn(s, i);
|
|
1397
|
-
}
|
|
1398
|
-
};
|
|
1399
|
-
}
|
|
1400
|
-
function createComponent(Comp, props) {
|
|
1401
|
-
return untrack(() => Comp(props || {}));
|
|
1402
|
-
}
|
|
1403
|
-
function trueFn() {
|
|
1404
|
-
return true;
|
|
1405
|
-
}
|
|
1406
|
-
var propTraps = {
|
|
1407
|
-
get(_, property, receiver) {
|
|
1408
|
-
if (property === $PROXY)
|
|
1409
|
-
return receiver;
|
|
1410
|
-
return _.get(property);
|
|
1411
|
-
},
|
|
1412
|
-
has(_, property) {
|
|
1413
|
-
if (property === $PROXY)
|
|
1414
|
-
return true;
|
|
1415
|
-
return _.has(property);
|
|
1416
|
-
},
|
|
1417
|
-
set: trueFn,
|
|
1418
|
-
deleteProperty: trueFn,
|
|
1419
|
-
getOwnPropertyDescriptor(_, property) {
|
|
1420
|
-
return {
|
|
1421
|
-
configurable: true,
|
|
1422
|
-
enumerable: true,
|
|
1423
|
-
get() {
|
|
1424
|
-
return _.get(property);
|
|
1425
|
-
},
|
|
1426
|
-
set: trueFn,
|
|
1427
|
-
deleteProperty: trueFn
|
|
1428
|
-
};
|
|
1429
|
-
},
|
|
1430
|
-
ownKeys(_) {
|
|
1431
|
-
return _.keys();
|
|
1432
|
-
}
|
|
1433
|
-
};
|
|
1434
|
-
function resolveSource(s) {
|
|
1435
|
-
return !(s = typeof s === "function" ? s() : s) ? {} : s;
|
|
1436
|
-
}
|
|
1437
|
-
function resolveSources() {
|
|
1438
|
-
for (let i = 0, length = this.length; i < length; ++i) {
|
|
1439
|
-
const v = this[i]();
|
|
1440
|
-
if (v !== void 0)
|
|
1441
|
-
return v;
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
function mergeProps(...sources) {
|
|
1445
|
-
let proxy = false;
|
|
1446
|
-
for (let i = 0; i < sources.length; i++) {
|
|
1447
|
-
const s = sources[i];
|
|
1448
|
-
proxy = proxy || !!s && $PROXY in s;
|
|
1449
|
-
sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
|
|
1450
|
-
}
|
|
1451
|
-
if (proxy) {
|
|
1452
|
-
return new Proxy(
|
|
1453
|
-
{
|
|
1454
|
-
get(property) {
|
|
1455
|
-
for (let i = sources.length - 1; i >= 0; i--) {
|
|
1456
|
-
const v = resolveSource(sources[i])[property];
|
|
1457
|
-
if (v !== void 0)
|
|
1458
|
-
return v;
|
|
1459
|
-
}
|
|
1460
|
-
},
|
|
1461
|
-
has(property) {
|
|
1462
|
-
for (let i = sources.length - 1; i >= 0; i--) {
|
|
1463
|
-
if (property in resolveSource(sources[i]))
|
|
1464
|
-
return true;
|
|
1465
|
-
}
|
|
1466
|
-
return false;
|
|
1467
|
-
},
|
|
1468
|
-
keys() {
|
|
1469
|
-
const keys = [];
|
|
1470
|
-
for (let i = 0; i < sources.length; i++)
|
|
1471
|
-
keys.push(...Object.keys(resolveSource(sources[i])));
|
|
1472
|
-
return [...new Set(keys)];
|
|
1473
|
-
}
|
|
1474
|
-
},
|
|
1475
|
-
propTraps
|
|
1476
|
-
);
|
|
1477
|
-
}
|
|
1478
|
-
const sourcesMap = {};
|
|
1479
|
-
const defined = /* @__PURE__ */ Object.create(null);
|
|
1480
|
-
for (let i = sources.length - 1; i >= 0; i--) {
|
|
1481
|
-
const source = sources[i];
|
|
1482
|
-
if (!source)
|
|
1483
|
-
continue;
|
|
1484
|
-
const sourceKeys = Object.getOwnPropertyNames(source);
|
|
1485
|
-
for (let i2 = sourceKeys.length - 1; i2 >= 0; i2--) {
|
|
1486
|
-
const key = sourceKeys[i2];
|
|
1487
|
-
if (key === "__proto__" || key === "constructor")
|
|
1488
|
-
continue;
|
|
1489
|
-
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1490
|
-
if (!defined[key]) {
|
|
1491
|
-
defined[key] = desc.get ? {
|
|
1492
|
-
enumerable: true,
|
|
1493
|
-
configurable: true,
|
|
1494
|
-
get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
|
|
1495
|
-
} : desc.value !== void 0 ? desc : void 0;
|
|
1496
|
-
} else {
|
|
1497
|
-
const sources2 = sourcesMap[key];
|
|
1498
|
-
if (sources2) {
|
|
1499
|
-
if (desc.get)
|
|
1500
|
-
sources2.push(desc.get.bind(source));
|
|
1501
|
-
else if (desc.value !== void 0)
|
|
1502
|
-
sources2.push(() => desc.value);
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
const target = {};
|
|
1508
|
-
const definedKeys = Object.keys(defined);
|
|
1509
|
-
for (let i = definedKeys.length - 1; i >= 0; i--) {
|
|
1510
|
-
const key = definedKeys[i], desc = defined[key];
|
|
1511
|
-
if (desc && desc.get)
|
|
1512
|
-
Object.defineProperty(target, key, desc);
|
|
1513
|
-
else
|
|
1514
|
-
target[key] = desc ? desc.value : void 0;
|
|
1515
|
-
}
|
|
1516
|
-
return target;
|
|
1517
|
-
}
|
|
1518
|
-
function splitProps(props, ...keys) {
|
|
1519
|
-
if ($PROXY in props) {
|
|
1520
|
-
const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
|
|
1521
|
-
const res = keys.map((k) => {
|
|
1522
|
-
return new Proxy(
|
|
1523
|
-
{
|
|
1524
|
-
get(property) {
|
|
1525
|
-
return k.includes(property) ? props[property] : void 0;
|
|
1526
|
-
},
|
|
1527
|
-
has(property) {
|
|
1528
|
-
return k.includes(property) && property in props;
|
|
1529
|
-
},
|
|
1530
|
-
keys() {
|
|
1531
|
-
return k.filter((property) => property in props);
|
|
1532
|
-
}
|
|
1533
|
-
},
|
|
1534
|
-
propTraps
|
|
1535
|
-
);
|
|
1536
|
-
});
|
|
1537
|
-
res.push(
|
|
1538
|
-
new Proxy(
|
|
1539
|
-
{
|
|
1540
|
-
get(property) {
|
|
1541
|
-
return blocked.has(property) ? void 0 : props[property];
|
|
1542
|
-
},
|
|
1543
|
-
has(property) {
|
|
1544
|
-
return blocked.has(property) ? false : property in props;
|
|
1545
|
-
},
|
|
1546
|
-
keys() {
|
|
1547
|
-
return Object.keys(props).filter((k) => !blocked.has(k));
|
|
1548
|
-
}
|
|
1549
|
-
},
|
|
1550
|
-
propTraps
|
|
1551
|
-
)
|
|
1552
|
-
);
|
|
1553
|
-
return res;
|
|
1554
|
-
}
|
|
1555
|
-
const otherObject = {};
|
|
1556
|
-
const objects = keys.map(() => ({}));
|
|
1557
|
-
for (const propName of Object.getOwnPropertyNames(props)) {
|
|
1558
|
-
const desc = Object.getOwnPropertyDescriptor(props, propName);
|
|
1559
|
-
const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
|
|
1560
|
-
let blocked = false;
|
|
1561
|
-
let objectIndex = 0;
|
|
1562
|
-
for (const k of keys) {
|
|
1563
|
-
if (k.includes(propName)) {
|
|
1564
|
-
blocked = true;
|
|
1565
|
-
isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc);
|
|
1566
|
-
}
|
|
1567
|
-
++objectIndex;
|
|
1568
|
-
}
|
|
1569
|
-
if (!blocked) {
|
|
1570
|
-
isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc);
|
|
1571
|
-
}
|
|
1572
|
-
}
|
|
1573
|
-
return [...objects, otherObject];
|
|
1574
|
-
}
|
|
1575
|
-
function lazy(fn) {
|
|
1576
|
-
let comp;
|
|
1577
|
-
let p;
|
|
1578
|
-
const wrap = (props) => {
|
|
1579
|
-
const ctx = sharedConfig.context;
|
|
1580
|
-
if (ctx) {
|
|
1581
|
-
const [s, set] = createSignal();
|
|
1582
|
-
sharedConfig.count || (sharedConfig.count = 0);
|
|
1583
|
-
sharedConfig.count++;
|
|
1584
|
-
(p || (p = fn())).then((mod) => {
|
|
1585
|
-
setHydrateContext(ctx);
|
|
1586
|
-
sharedConfig.count--;
|
|
1587
|
-
set(() => mod.default);
|
|
1588
|
-
setHydrateContext();
|
|
1589
|
-
});
|
|
1590
|
-
comp = s;
|
|
1591
|
-
} else if (!comp) {
|
|
1592
|
-
const [s] = createResource(() => (p || (p = fn())).then((mod) => mod.default));
|
|
1593
|
-
comp = s;
|
|
1594
|
-
}
|
|
1595
|
-
let Comp;
|
|
1596
|
-
return createMemo(
|
|
1597
|
-
() => (Comp = comp()) && untrack(() => {
|
|
1598
|
-
if (false)
|
|
1599
|
-
;
|
|
1600
|
-
if (!ctx)
|
|
1601
|
-
return Comp(props);
|
|
1602
|
-
const c = sharedConfig.context;
|
|
1603
|
-
setHydrateContext(ctx);
|
|
1604
|
-
const r = Comp(props);
|
|
1605
|
-
setHydrateContext(c);
|
|
1606
|
-
return r;
|
|
1607
|
-
})
|
|
1608
|
-
);
|
|
1609
|
-
};
|
|
1610
|
-
wrap.preload = () => p || ((p = fn()).then((mod) => comp = () => mod.default), p);
|
|
1611
|
-
return wrap;
|
|
1612
|
-
}
|
|
1613
|
-
var counter = 0;
|
|
1614
|
-
function createUniqueId() {
|
|
1615
|
-
const ctx = sharedConfig.context;
|
|
1616
|
-
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1617
|
-
}
|
|
1618
|
-
var narrowedError = (name) => `Stale read from <${name}>.`;
|
|
1619
|
-
function For(props) {
|
|
1620
|
-
const fallback = "fallback" in props && {
|
|
1621
|
-
fallback: () => props.fallback
|
|
1622
|
-
};
|
|
1623
|
-
return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
|
|
1624
|
-
}
|
|
1625
|
-
function Index(props) {
|
|
1626
|
-
const fallback = "fallback" in props && {
|
|
1627
|
-
fallback: () => props.fallback
|
|
1628
|
-
};
|
|
1629
|
-
return createMemo(indexArray(() => props.each, props.children, fallback || void 0));
|
|
1630
|
-
}
|
|
1631
|
-
function Show(props) {
|
|
1632
|
-
const keyed = props.keyed;
|
|
1633
|
-
const condition = createMemo(() => props.when, void 0, {
|
|
1634
|
-
equals: (a, b) => keyed ? a === b : !a === !b
|
|
1635
|
-
});
|
|
1636
|
-
return createMemo(
|
|
1637
|
-
() => {
|
|
1638
|
-
const c = condition();
|
|
1639
|
-
if (c) {
|
|
1640
|
-
const child = props.children;
|
|
1641
|
-
const fn = typeof child === "function" && child.length > 0;
|
|
1642
|
-
return fn ? untrack(
|
|
1643
|
-
() => child(
|
|
1644
|
-
keyed ? c : () => {
|
|
1645
|
-
if (!untrack(condition))
|
|
1646
|
-
throw narrowedError("Show");
|
|
1647
|
-
return props.when;
|
|
1648
|
-
}
|
|
1649
|
-
)
|
|
1650
|
-
) : child;
|
|
1651
|
-
}
|
|
1652
|
-
return props.fallback;
|
|
1653
|
-
},
|
|
1654
|
-
void 0,
|
|
1655
|
-
void 0
|
|
1656
|
-
);
|
|
1657
|
-
}
|
|
1658
|
-
function Switch(props) {
|
|
1659
|
-
let keyed = false;
|
|
1660
|
-
const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1661
|
-
const conditions = children(() => props.children), evalConditions = createMemo(
|
|
1662
|
-
() => {
|
|
1663
|
-
let conds = conditions();
|
|
1664
|
-
if (!Array.isArray(conds))
|
|
1665
|
-
conds = [conds];
|
|
1666
|
-
for (let i = 0; i < conds.length; i++) {
|
|
1667
|
-
const c = conds[i].when;
|
|
1668
|
-
if (c) {
|
|
1669
|
-
keyed = !!conds[i].keyed;
|
|
1670
|
-
return [i, c, conds[i]];
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
return [-1];
|
|
1674
|
-
},
|
|
1675
|
-
void 0,
|
|
1676
|
-
{
|
|
1677
|
-
equals
|
|
1678
|
-
}
|
|
1679
|
-
);
|
|
1680
|
-
return createMemo(
|
|
1681
|
-
() => {
|
|
1682
|
-
const [index, when, cond] = evalConditions();
|
|
1683
|
-
if (index < 0)
|
|
1684
|
-
return props.fallback;
|
|
1685
|
-
const c = cond.children;
|
|
1686
|
-
const fn = typeof c === "function" && c.length > 0;
|
|
1687
|
-
return fn ? untrack(
|
|
1688
|
-
() => c(
|
|
1689
|
-
keyed ? when : () => {
|
|
1690
|
-
if (untrack(evalConditions)[0] !== index)
|
|
1691
|
-
throw narrowedError("Match");
|
|
1692
|
-
return cond.when;
|
|
1693
|
-
}
|
|
1694
|
-
)
|
|
1695
|
-
) : c;
|
|
1696
|
-
},
|
|
1697
|
-
void 0,
|
|
1698
|
-
void 0
|
|
1699
|
-
);
|
|
1700
|
-
}
|
|
1701
|
-
function Match(props) {
|
|
1702
|
-
return props;
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
// ../../node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/web.js
|
|
1706
|
-
var booleans = [
|
|
1707
|
-
"allowfullscreen",
|
|
1708
|
-
"async",
|
|
1709
|
-
"autofocus",
|
|
1710
|
-
"autoplay",
|
|
1711
|
-
"checked",
|
|
1712
|
-
"controls",
|
|
1713
|
-
"default",
|
|
1714
|
-
"disabled",
|
|
1715
|
-
"formnovalidate",
|
|
1716
|
-
"hidden",
|
|
1717
|
-
"indeterminate",
|
|
1718
|
-
"inert",
|
|
1719
|
-
"ismap",
|
|
1720
|
-
"loop",
|
|
1721
|
-
"multiple",
|
|
1722
|
-
"muted",
|
|
1723
|
-
"nomodule",
|
|
1724
|
-
"novalidate",
|
|
1725
|
-
"open",
|
|
1726
|
-
"playsinline",
|
|
1727
|
-
"readonly",
|
|
1728
|
-
"required",
|
|
1729
|
-
"reversed",
|
|
1730
|
-
"seamless",
|
|
1731
|
-
"selected"
|
|
1732
|
-
];
|
|
1733
|
-
var Properties = /* @__PURE__ */ new Set([
|
|
1734
|
-
"className",
|
|
1735
|
-
"value",
|
|
1736
|
-
"readOnly",
|
|
1737
|
-
"formNoValidate",
|
|
1738
|
-
"isMap",
|
|
1739
|
-
"noModule",
|
|
1740
|
-
"playsInline",
|
|
1741
|
-
...booleans
|
|
1742
|
-
]);
|
|
1743
|
-
var ChildProperties = /* @__PURE__ */ new Set([
|
|
1744
|
-
"innerHTML",
|
|
1745
|
-
"textContent",
|
|
1746
|
-
"innerText",
|
|
1747
|
-
"children"
|
|
1748
|
-
]);
|
|
1749
|
-
var Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
1750
|
-
className: "class",
|
|
1751
|
-
htmlFor: "for"
|
|
1752
|
-
});
|
|
1753
|
-
var PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
1754
|
-
class: "className",
|
|
1755
|
-
formnovalidate: {
|
|
1756
|
-
$: "formNoValidate",
|
|
1757
|
-
BUTTON: 1,
|
|
1758
|
-
INPUT: 1
|
|
1759
|
-
},
|
|
1760
|
-
ismap: {
|
|
1761
|
-
$: "isMap",
|
|
1762
|
-
IMG: 1
|
|
1763
|
-
},
|
|
1764
|
-
nomodule: {
|
|
1765
|
-
$: "noModule",
|
|
1766
|
-
SCRIPT: 1
|
|
1767
|
-
},
|
|
1768
|
-
playsinline: {
|
|
1769
|
-
$: "playsInline",
|
|
1770
|
-
VIDEO: 1
|
|
1771
|
-
},
|
|
1772
|
-
readonly: {
|
|
1773
|
-
$: "readOnly",
|
|
1774
|
-
INPUT: 1,
|
|
1775
|
-
TEXTAREA: 1
|
|
1776
|
-
}
|
|
1777
|
-
});
|
|
1778
|
-
function getPropAlias(prop, tagName) {
|
|
1779
|
-
const a = PropAliases[prop];
|
|
1780
|
-
return typeof a === "object" ? a[tagName] ? a["$"] : void 0 : a;
|
|
1781
|
-
}
|
|
1782
|
-
var DelegatedEvents = /* @__PURE__ */ new Set([
|
|
1783
|
-
"beforeinput",
|
|
1784
|
-
"click",
|
|
1785
|
-
"dblclick",
|
|
1786
|
-
"contextmenu",
|
|
1787
|
-
"focusin",
|
|
1788
|
-
"focusout",
|
|
1789
|
-
"input",
|
|
1790
|
-
"keydown",
|
|
1791
|
-
"keyup",
|
|
1792
|
-
"mousedown",
|
|
1793
|
-
"mousemove",
|
|
1794
|
-
"mouseout",
|
|
1795
|
-
"mouseover",
|
|
1796
|
-
"mouseup",
|
|
1797
|
-
"pointerdown",
|
|
1798
|
-
"pointermove",
|
|
1799
|
-
"pointerout",
|
|
1800
|
-
"pointerover",
|
|
1801
|
-
"pointerup",
|
|
1802
|
-
"touchend",
|
|
1803
|
-
"touchmove",
|
|
1804
|
-
"touchstart"
|
|
1805
|
-
]);
|
|
1806
|
-
var SVGElements = /* @__PURE__ */ new Set([
|
|
1807
|
-
"altGlyph",
|
|
1808
|
-
"altGlyphDef",
|
|
1809
|
-
"altGlyphItem",
|
|
1810
|
-
"animate",
|
|
1811
|
-
"animateColor",
|
|
1812
|
-
"animateMotion",
|
|
1813
|
-
"animateTransform",
|
|
1814
|
-
"circle",
|
|
1815
|
-
"clipPath",
|
|
1816
|
-
"color-profile",
|
|
1817
|
-
"cursor",
|
|
1818
|
-
"defs",
|
|
1819
|
-
"desc",
|
|
1820
|
-
"ellipse",
|
|
1821
|
-
"feBlend",
|
|
1822
|
-
"feColorMatrix",
|
|
1823
|
-
"feComponentTransfer",
|
|
1824
|
-
"feComposite",
|
|
1825
|
-
"feConvolveMatrix",
|
|
1826
|
-
"feDiffuseLighting",
|
|
1827
|
-
"feDisplacementMap",
|
|
1828
|
-
"feDistantLight",
|
|
1829
|
-
"feDropShadow",
|
|
1830
|
-
"feFlood",
|
|
1831
|
-
"feFuncA",
|
|
1832
|
-
"feFuncB",
|
|
1833
|
-
"feFuncG",
|
|
1834
|
-
"feFuncR",
|
|
1835
|
-
"feGaussianBlur",
|
|
1836
|
-
"feImage",
|
|
1837
|
-
"feMerge",
|
|
1838
|
-
"feMergeNode",
|
|
1839
|
-
"feMorphology",
|
|
1840
|
-
"feOffset",
|
|
1841
|
-
"fePointLight",
|
|
1842
|
-
"feSpecularLighting",
|
|
1843
|
-
"feSpotLight",
|
|
1844
|
-
"feTile",
|
|
1845
|
-
"feTurbulence",
|
|
1846
|
-
"filter",
|
|
1847
|
-
"font",
|
|
1848
|
-
"font-face",
|
|
1849
|
-
"font-face-format",
|
|
1850
|
-
"font-face-name",
|
|
1851
|
-
"font-face-src",
|
|
1852
|
-
"font-face-uri",
|
|
1853
|
-
"foreignObject",
|
|
1854
|
-
"g",
|
|
1855
|
-
"glyph",
|
|
1856
|
-
"glyphRef",
|
|
1857
|
-
"hkern",
|
|
1858
|
-
"image",
|
|
1859
|
-
"line",
|
|
1860
|
-
"linearGradient",
|
|
1861
|
-
"marker",
|
|
1862
|
-
"mask",
|
|
1863
|
-
"metadata",
|
|
1864
|
-
"missing-glyph",
|
|
1865
|
-
"mpath",
|
|
1866
|
-
"path",
|
|
1867
|
-
"pattern",
|
|
1868
|
-
"polygon",
|
|
1869
|
-
"polyline",
|
|
1870
|
-
"radialGradient",
|
|
1871
|
-
"rect",
|
|
1872
|
-
"set",
|
|
1873
|
-
"stop",
|
|
1874
|
-
"svg",
|
|
1875
|
-
"switch",
|
|
1876
|
-
"symbol",
|
|
1877
|
-
"text",
|
|
1878
|
-
"textPath",
|
|
1879
|
-
"tref",
|
|
1880
|
-
"tspan",
|
|
1881
|
-
"use",
|
|
1882
|
-
"view",
|
|
1883
|
-
"vkern"
|
|
1884
|
-
]);
|
|
1885
|
-
var SVGNamespace = {
|
|
1886
|
-
xlink: "http://www.w3.org/1999/xlink",
|
|
1887
|
-
xml: "http://www.w3.org/XML/1998/namespace"
|
|
1888
|
-
};
|
|
1889
|
-
function reconcileArrays(parentNode, a, b) {
|
|
1890
|
-
let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null;
|
|
1891
|
-
while (aStart < aEnd || bStart < bEnd) {
|
|
1892
|
-
if (a[aStart] === b[bStart]) {
|
|
1893
|
-
aStart++;
|
|
1894
|
-
bStart++;
|
|
1895
|
-
continue;
|
|
1896
|
-
}
|
|
1897
|
-
while (a[aEnd - 1] === b[bEnd - 1]) {
|
|
1898
|
-
aEnd--;
|
|
1899
|
-
bEnd--;
|
|
1900
|
-
}
|
|
1901
|
-
if (aEnd === aStart) {
|
|
1902
|
-
const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
|
|
1903
|
-
while (bStart < bEnd)
|
|
1904
|
-
parentNode.insertBefore(b[bStart++], node);
|
|
1905
|
-
} else if (bEnd === bStart) {
|
|
1906
|
-
while (aStart < aEnd) {
|
|
1907
|
-
if (!map || !map.has(a[aStart]))
|
|
1908
|
-
a[aStart].remove();
|
|
1909
|
-
aStart++;
|
|
1910
|
-
}
|
|
1911
|
-
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
1912
|
-
const node = a[--aEnd].nextSibling;
|
|
1913
|
-
parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
|
|
1914
|
-
parentNode.insertBefore(b[--bEnd], node);
|
|
1915
|
-
a[aEnd] = b[bEnd];
|
|
1916
|
-
} else {
|
|
1917
|
-
if (!map) {
|
|
1918
|
-
map = /* @__PURE__ */ new Map();
|
|
1919
|
-
let i = bStart;
|
|
1920
|
-
while (i < bEnd)
|
|
1921
|
-
map.set(b[i], i++);
|
|
1922
|
-
}
|
|
1923
|
-
const index = map.get(a[aStart]);
|
|
1924
|
-
if (index != null) {
|
|
1925
|
-
if (bStart < index && index < bEnd) {
|
|
1926
|
-
let i = aStart, sequence = 1, t;
|
|
1927
|
-
while (++i < aEnd && i < bEnd) {
|
|
1928
|
-
if ((t = map.get(a[i])) == null || t !== index + sequence)
|
|
1929
|
-
break;
|
|
1930
|
-
sequence++;
|
|
1931
|
-
}
|
|
1932
|
-
if (sequence > index - bStart) {
|
|
1933
|
-
const node = a[aStart];
|
|
1934
|
-
while (bStart < index)
|
|
1935
|
-
parentNode.insertBefore(b[bStart++], node);
|
|
1936
|
-
} else
|
|
1937
|
-
parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
1938
|
-
} else
|
|
1939
|
-
aStart++;
|
|
1940
|
-
} else
|
|
1941
|
-
a[aStart++].remove();
|
|
1942
|
-
}
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1945
|
-
var $$EVENTS = "_$DX_DELEGATE";
|
|
1946
|
-
function render(code, element, init, options = {}) {
|
|
1947
|
-
let disposer;
|
|
1948
|
-
createRoot((dispose2) => {
|
|
1949
|
-
disposer = dispose2;
|
|
1950
|
-
element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init);
|
|
1951
|
-
}, options.owner);
|
|
1952
|
-
return () => {
|
|
1953
|
-
disposer();
|
|
1954
|
-
element.textContent = "";
|
|
1955
|
-
};
|
|
1956
|
-
}
|
|
1957
|
-
function template(html, isCE, isSVG) {
|
|
1958
|
-
let node;
|
|
1959
|
-
const create = () => {
|
|
1960
|
-
const t = document.createElement("template");
|
|
1961
|
-
t.innerHTML = html;
|
|
1962
|
-
return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
1963
|
-
};
|
|
1964
|
-
const fn = isCE ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
1965
|
-
fn.cloneNode = fn;
|
|
1966
|
-
return fn;
|
|
1967
|
-
}
|
|
1968
|
-
function delegateEvents(eventNames, document2 = window.document) {
|
|
1969
|
-
const e = document2[$$EVENTS] || (document2[$$EVENTS] = /* @__PURE__ */ new Set());
|
|
1970
|
-
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
1971
|
-
const name = eventNames[i];
|
|
1972
|
-
if (!e.has(name)) {
|
|
1973
|
-
e.add(name);
|
|
1974
|
-
document2.addEventListener(name, eventHandler);
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1978
|
-
function clearDelegatedEvents(document2 = window.document) {
|
|
1979
|
-
if (document2[$$EVENTS]) {
|
|
1980
|
-
for (let name of document2[$$EVENTS].keys())
|
|
1981
|
-
document2.removeEventListener(name, eventHandler);
|
|
1982
|
-
delete document2[$$EVENTS];
|
|
1983
|
-
}
|
|
1984
|
-
}
|
|
1985
|
-
function setAttribute(node, name, value) {
|
|
1986
|
-
if (!!sharedConfig.context && node.isConnected)
|
|
1987
|
-
return;
|
|
1988
|
-
if (value == null)
|
|
1989
|
-
node.removeAttribute(name);
|
|
1990
|
-
else
|
|
1991
|
-
node.setAttribute(name, value);
|
|
1992
|
-
}
|
|
1993
|
-
function setAttributeNS(node, namespace, name, value) {
|
|
1994
|
-
if (!!sharedConfig.context && node.isConnected)
|
|
1995
|
-
return;
|
|
1996
|
-
if (value == null)
|
|
1997
|
-
node.removeAttributeNS(namespace, name);
|
|
1998
|
-
else
|
|
1999
|
-
node.setAttributeNS(namespace, name, value);
|
|
2000
|
-
}
|
|
2001
|
-
function className(node, value) {
|
|
2002
|
-
if (!!sharedConfig.context && node.isConnected)
|
|
2003
|
-
return;
|
|
2004
|
-
if (value == null)
|
|
2005
|
-
node.removeAttribute("class");
|
|
2006
|
-
else
|
|
2007
|
-
node.className = value;
|
|
2008
|
-
}
|
|
2009
|
-
function addEventListener(node, name, handler, delegate) {
|
|
2010
|
-
if (delegate) {
|
|
2011
|
-
if (Array.isArray(handler)) {
|
|
2012
|
-
node[`$$${name}`] = handler[0];
|
|
2013
|
-
node[`$$${name}Data`] = handler[1];
|
|
2014
|
-
} else
|
|
2015
|
-
node[`$$${name}`] = handler;
|
|
2016
|
-
} else if (Array.isArray(handler)) {
|
|
2017
|
-
const handlerFn = handler[0];
|
|
2018
|
-
node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e));
|
|
2019
|
-
} else
|
|
2020
|
-
node.addEventListener(name, handler);
|
|
2021
|
-
}
|
|
2022
|
-
function classList(node, value, prev = {}) {
|
|
2023
|
-
const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev);
|
|
2024
|
-
let i, len;
|
|
2025
|
-
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
2026
|
-
const key = prevKeys[i];
|
|
2027
|
-
if (!key || key === "undefined" || value[key])
|
|
2028
|
-
continue;
|
|
2029
|
-
toggleClassKey(node, key, false);
|
|
2030
|
-
delete prev[key];
|
|
2031
|
-
}
|
|
2032
|
-
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
2033
|
-
const key = classKeys[i], classValue = !!value[key];
|
|
2034
|
-
if (!key || key === "undefined" || prev[key] === classValue || !classValue)
|
|
2035
|
-
continue;
|
|
2036
|
-
toggleClassKey(node, key, true);
|
|
2037
|
-
prev[key] = classValue;
|
|
2038
|
-
}
|
|
2039
|
-
return prev;
|
|
2040
|
-
}
|
|
2041
|
-
function style(node, value, prev) {
|
|
2042
|
-
if (!value)
|
|
2043
|
-
return prev ? setAttribute(node, "style") : value;
|
|
2044
|
-
const nodeStyle = node.style;
|
|
2045
|
-
if (typeof value === "string")
|
|
2046
|
-
return nodeStyle.cssText = value;
|
|
2047
|
-
typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
|
|
2048
|
-
prev || (prev = {});
|
|
2049
|
-
value || (value = {});
|
|
2050
|
-
let v, s;
|
|
2051
|
-
for (s in prev) {
|
|
2052
|
-
value[s] == null && nodeStyle.removeProperty(s);
|
|
2053
|
-
delete prev[s];
|
|
2054
|
-
}
|
|
2055
|
-
for (s in value) {
|
|
2056
|
-
v = value[s];
|
|
2057
|
-
if (v !== prev[s]) {
|
|
2058
|
-
nodeStyle.setProperty(s, v);
|
|
2059
|
-
prev[s] = v;
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
2062
|
-
return prev;
|
|
2063
|
-
}
|
|
2064
|
-
function spread(node, props = {}, isSVG, skipChildren) {
|
|
2065
|
-
const prevProps = {};
|
|
2066
|
-
if (!skipChildren) {
|
|
2067
|
-
createRenderEffect(
|
|
2068
|
-
() => prevProps.children = insertExpression(node, props.children, prevProps.children)
|
|
2069
|
-
);
|
|
2070
|
-
}
|
|
2071
|
-
createRenderEffect(
|
|
2072
|
-
() => typeof props.ref === "function" ? use(props.ref, node) : props.ref = node
|
|
2073
|
-
);
|
|
2074
|
-
createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
2075
|
-
return prevProps;
|
|
2076
|
-
}
|
|
2077
|
-
function use(fn, element, arg) {
|
|
2078
|
-
return untrack(() => fn(element, arg));
|
|
2079
|
-
}
|
|
2080
|
-
function insert(parent, accessor, marker, initial) {
|
|
2081
|
-
if (marker !== void 0 && !initial)
|
|
2082
|
-
initial = [];
|
|
2083
|
-
if (typeof accessor !== "function")
|
|
2084
|
-
return insertExpression(parent, accessor, initial, marker);
|
|
2085
|
-
createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial);
|
|
2086
|
-
}
|
|
2087
|
-
function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
|
|
2088
|
-
props || (props = {});
|
|
2089
|
-
for (const prop in prevProps) {
|
|
2090
|
-
if (!(prop in props)) {
|
|
2091
|
-
if (prop === "children")
|
|
2092
|
-
continue;
|
|
2093
|
-
prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
for (const prop in props) {
|
|
2097
|
-
if (prop === "children") {
|
|
2098
|
-
if (!skipChildren)
|
|
2099
|
-
insertExpression(node, props.children);
|
|
2100
|
-
continue;
|
|
2101
|
-
}
|
|
2102
|
-
const value = props[prop];
|
|
2103
|
-
prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);
|
|
2104
|
-
}
|
|
2105
|
-
}
|
|
2106
|
-
function getNextElement(template2) {
|
|
2107
|
-
let node, key;
|
|
2108
|
-
if (!sharedConfig.context || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
|
|
2109
|
-
return template2();
|
|
2110
|
-
}
|
|
2111
|
-
if (sharedConfig.completed)
|
|
2112
|
-
sharedConfig.completed.add(node);
|
|
2113
|
-
sharedConfig.registry.delete(key);
|
|
2114
|
-
return node;
|
|
2115
|
-
}
|
|
2116
|
-
function toPropertyName(name) {
|
|
2117
|
-
return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
|
|
2118
|
-
}
|
|
2119
|
-
function toggleClassKey(node, key, value) {
|
|
2120
|
-
const classNames = key.trim().split(/\s+/);
|
|
2121
|
-
for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
|
|
2122
|
-
node.classList.toggle(classNames[i], value);
|
|
2123
|
-
}
|
|
2124
|
-
function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
2125
|
-
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
2126
|
-
if (prop === "style")
|
|
2127
|
-
return style(node, value, prev);
|
|
2128
|
-
if (prop === "classList")
|
|
2129
|
-
return classList(node, value, prev);
|
|
2130
|
-
if (value === prev)
|
|
2131
|
-
return prev;
|
|
2132
|
-
if (prop === "ref") {
|
|
2133
|
-
if (!skipRef)
|
|
2134
|
-
value(node);
|
|
2135
|
-
} else if (prop.slice(0, 3) === "on:") {
|
|
2136
|
-
const e = prop.slice(3);
|
|
2137
|
-
prev && node.removeEventListener(e, prev);
|
|
2138
|
-
value && node.addEventListener(e, value);
|
|
2139
|
-
} else if (prop.slice(0, 10) === "oncapture:") {
|
|
2140
|
-
const e = prop.slice(10);
|
|
2141
|
-
prev && node.removeEventListener(e, prev, true);
|
|
2142
|
-
value && node.addEventListener(e, value, true);
|
|
2143
|
-
} else if (prop.slice(0, 2) === "on") {
|
|
2144
|
-
const name = prop.slice(2).toLowerCase();
|
|
2145
|
-
const delegate = DelegatedEvents.has(name);
|
|
2146
|
-
if (!delegate && prev) {
|
|
2147
|
-
const h = Array.isArray(prev) ? prev[0] : prev;
|
|
2148
|
-
node.removeEventListener(name, h);
|
|
2149
|
-
}
|
|
2150
|
-
if (delegate || value) {
|
|
2151
|
-
addEventListener(node, name, value, delegate);
|
|
2152
|
-
delegate && delegateEvents([name]);
|
|
2153
|
-
}
|
|
2154
|
-
} else if (prop.slice(0, 5) === "attr:") {
|
|
2155
|
-
setAttribute(node, prop.slice(5), value);
|
|
2156
|
-
} else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-"))) {
|
|
2157
|
-
if (forceProp) {
|
|
2158
|
-
prop = prop.slice(5);
|
|
2159
|
-
isProp = true;
|
|
2160
|
-
} else if (!!sharedConfig.context && node.isConnected)
|
|
2161
|
-
return value;
|
|
2162
|
-
if (prop === "class" || prop === "className")
|
|
2163
|
-
className(node, value);
|
|
2164
|
-
else if (isCE && !isProp && !isChildProp)
|
|
2165
|
-
node[toPropertyName(prop)] = value;
|
|
2166
|
-
else
|
|
2167
|
-
node[propAlias || prop] = value;
|
|
2168
|
-
} else {
|
|
2169
|
-
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
2170
|
-
if (ns)
|
|
2171
|
-
setAttributeNS(node, ns, prop, value);
|
|
2172
|
-
else
|
|
2173
|
-
setAttribute(node, Aliases[prop] || prop, value);
|
|
2174
|
-
}
|
|
2175
|
-
return value;
|
|
2176
|
-
}
|
|
2177
|
-
function eventHandler(e) {
|
|
2178
|
-
const key = `$$${e.type}`;
|
|
2179
|
-
let node = e.composedPath && e.composedPath()[0] || e.target;
|
|
2180
|
-
if (e.target !== node) {
|
|
2181
|
-
Object.defineProperty(e, "target", {
|
|
2182
|
-
configurable: true,
|
|
2183
|
-
value: node
|
|
2184
|
-
});
|
|
2185
|
-
}
|
|
2186
|
-
Object.defineProperty(e, "currentTarget", {
|
|
2187
|
-
configurable: true,
|
|
2188
|
-
get() {
|
|
2189
|
-
return node || document;
|
|
2190
|
-
}
|
|
2191
|
-
});
|
|
2192
|
-
if (sharedConfig.registry && !sharedConfig.done)
|
|
2193
|
-
sharedConfig.done = _$HY.done = true;
|
|
2194
|
-
while (node) {
|
|
2195
|
-
const handler = node[key];
|
|
2196
|
-
if (handler && !node.disabled) {
|
|
2197
|
-
const data = node[`${key}Data`];
|
|
2198
|
-
data !== void 0 ? handler.call(node, data, e) : handler.call(node, e);
|
|
2199
|
-
if (e.cancelBubble)
|
|
2200
|
-
return;
|
|
2201
|
-
}
|
|
2202
|
-
node = node._$host || node.parentNode || node.host;
|
|
2203
|
-
}
|
|
2204
|
-
}
|
|
2205
|
-
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
2206
|
-
const hydrating = !!sharedConfig.context && parent.isConnected;
|
|
2207
|
-
if (hydrating) {
|
|
2208
|
-
!current && (current = [...parent.childNodes]);
|
|
2209
|
-
let cleaned = [];
|
|
2210
|
-
for (let i = 0; i < current.length; i++) {
|
|
2211
|
-
const node = current[i];
|
|
2212
|
-
if (node.nodeType === 8 && node.data.slice(0, 2) === "!$")
|
|
2213
|
-
node.remove();
|
|
2214
|
-
else
|
|
2215
|
-
cleaned.push(node);
|
|
2216
|
-
}
|
|
2217
|
-
current = cleaned;
|
|
2218
|
-
}
|
|
2219
|
-
while (typeof current === "function")
|
|
2220
|
-
current = current();
|
|
2221
|
-
if (value === current)
|
|
2222
|
-
return current;
|
|
2223
|
-
const t = typeof value, multi = marker !== void 0;
|
|
2224
|
-
parent = multi && current[0] && current[0].parentNode || parent;
|
|
2225
|
-
if (t === "string" || t === "number") {
|
|
2226
|
-
if (hydrating)
|
|
2227
|
-
return current;
|
|
2228
|
-
if (t === "number")
|
|
2229
|
-
value = value.toString();
|
|
2230
|
-
if (multi) {
|
|
2231
|
-
let node = current[0];
|
|
2232
|
-
if (node && node.nodeType === 3) {
|
|
2233
|
-
node.data !== value && (node.data = value);
|
|
2234
|
-
} else
|
|
2235
|
-
node = document.createTextNode(value);
|
|
2236
|
-
current = cleanChildren(parent, current, marker, node);
|
|
2237
|
-
} else {
|
|
2238
|
-
if (current !== "" && typeof current === "string") {
|
|
2239
|
-
current = parent.firstChild.data = value;
|
|
2240
|
-
} else
|
|
2241
|
-
current = parent.textContent = value;
|
|
2242
|
-
}
|
|
2243
|
-
} else if (value == null || t === "boolean") {
|
|
2244
|
-
if (hydrating)
|
|
2245
|
-
return current;
|
|
2246
|
-
current = cleanChildren(parent, current, marker);
|
|
2247
|
-
} else if (t === "function") {
|
|
2248
|
-
createRenderEffect(() => {
|
|
2249
|
-
let v = value();
|
|
2250
|
-
while (typeof v === "function")
|
|
2251
|
-
v = v();
|
|
2252
|
-
current = insertExpression(parent, v, current, marker);
|
|
2253
|
-
});
|
|
2254
|
-
return () => current;
|
|
2255
|
-
} else if (Array.isArray(value)) {
|
|
2256
|
-
const array = [];
|
|
2257
|
-
const currentArray = current && Array.isArray(current);
|
|
2258
|
-
if (normalizeIncomingArray(array, value, current, unwrapArray)) {
|
|
2259
|
-
createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
|
|
2260
|
-
return () => current;
|
|
2261
|
-
}
|
|
2262
|
-
if (hydrating) {
|
|
2263
|
-
if (!array.length)
|
|
2264
|
-
return current;
|
|
2265
|
-
if (marker === void 0)
|
|
2266
|
-
return [...parent.childNodes];
|
|
2267
|
-
let node = array[0];
|
|
2268
|
-
let nodes = [node];
|
|
2269
|
-
while ((node = node.nextSibling) !== marker)
|
|
2270
|
-
nodes.push(node);
|
|
2271
|
-
return current = nodes;
|
|
2272
|
-
}
|
|
2273
|
-
if (array.length === 0) {
|
|
2274
|
-
current = cleanChildren(parent, current, marker);
|
|
2275
|
-
if (multi)
|
|
2276
|
-
return current;
|
|
2277
|
-
} else if (currentArray) {
|
|
2278
|
-
if (current.length === 0) {
|
|
2279
|
-
appendNodes(parent, array, marker);
|
|
2280
|
-
} else
|
|
2281
|
-
reconcileArrays(parent, current, array);
|
|
2282
|
-
} else {
|
|
2283
|
-
current && cleanChildren(parent);
|
|
2284
|
-
appendNodes(parent, array);
|
|
2285
|
-
}
|
|
2286
|
-
current = array;
|
|
2287
|
-
} else if (value.nodeType) {
|
|
2288
|
-
if (hydrating && value.parentNode)
|
|
2289
|
-
return current = multi ? [value] : value;
|
|
2290
|
-
if (Array.isArray(current)) {
|
|
2291
|
-
if (multi)
|
|
2292
|
-
return current = cleanChildren(parent, current, marker, value);
|
|
2293
|
-
cleanChildren(parent, current, null, value);
|
|
2294
|
-
} else if (current == null || current === "" || !parent.firstChild) {
|
|
2295
|
-
parent.appendChild(value);
|
|
2296
|
-
} else
|
|
2297
|
-
parent.replaceChild(value, parent.firstChild);
|
|
2298
|
-
current = value;
|
|
2299
|
-
} else
|
|
2300
|
-
;
|
|
2301
|
-
return current;
|
|
2302
|
-
}
|
|
2303
|
-
function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
2304
|
-
let dynamic = false;
|
|
2305
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
2306
|
-
let item = array[i], prev = current && current[normalized.length], t;
|
|
2307
|
-
if (item == null || item === true || item === false)
|
|
2308
|
-
;
|
|
2309
|
-
else if ((t = typeof item) === "object" && item.nodeType) {
|
|
2310
|
-
normalized.push(item);
|
|
2311
|
-
} else if (Array.isArray(item)) {
|
|
2312
|
-
dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
|
|
2313
|
-
} else if (t === "function") {
|
|
2314
|
-
if (unwrap) {
|
|
2315
|
-
while (typeof item === "function")
|
|
2316
|
-
item = item();
|
|
2317
|
-
dynamic = normalizeIncomingArray(
|
|
2318
|
-
normalized,
|
|
2319
|
-
Array.isArray(item) ? item : [item],
|
|
2320
|
-
Array.isArray(prev) ? prev : [prev]
|
|
2321
|
-
) || dynamic;
|
|
2322
|
-
} else {
|
|
2323
|
-
normalized.push(item);
|
|
2324
|
-
dynamic = true;
|
|
2325
|
-
}
|
|
2326
|
-
} else {
|
|
2327
|
-
const value = String(item);
|
|
2328
|
-
if (prev && prev.nodeType === 3 && prev.data === value)
|
|
2329
|
-
normalized.push(prev);
|
|
2330
|
-
else
|
|
2331
|
-
normalized.push(document.createTextNode(value));
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
2334
|
-
return dynamic;
|
|
2335
|
-
}
|
|
2336
|
-
function appendNodes(parent, array, marker = null) {
|
|
2337
|
-
for (let i = 0, len = array.length; i < len; i++)
|
|
2338
|
-
parent.insertBefore(array[i], marker);
|
|
2339
|
-
}
|
|
2340
|
-
function cleanChildren(parent, current, marker, replacement) {
|
|
2341
|
-
if (marker === void 0)
|
|
2342
|
-
return parent.textContent = "";
|
|
2343
|
-
const node = replacement || document.createTextNode("");
|
|
2344
|
-
if (current.length) {
|
|
2345
|
-
let inserted = false;
|
|
2346
|
-
for (let i = current.length - 1; i >= 0; i--) {
|
|
2347
|
-
const el = current[i];
|
|
2348
|
-
if (node !== el) {
|
|
2349
|
-
const isParent = el.parentNode === parent;
|
|
2350
|
-
if (!inserted && !i)
|
|
2351
|
-
isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
|
|
2352
|
-
else
|
|
2353
|
-
isParent && el.remove();
|
|
2354
|
-
} else
|
|
2355
|
-
inserted = true;
|
|
2356
|
-
}
|
|
2357
|
-
} else
|
|
2358
|
-
parent.insertBefore(node, marker);
|
|
2359
|
-
return [node];
|
|
2360
|
-
}
|
|
2361
|
-
function getHydrationKey() {
|
|
2362
|
-
const hydrate = sharedConfig.context;
|
|
2363
|
-
return `${hydrate.id}${hydrate.count++}`;
|
|
2364
|
-
}
|
|
2365
|
-
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
2366
|
-
function createElement(tagName, isSVG = false) {
|
|
2367
|
-
return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);
|
|
2368
|
-
}
|
|
2369
|
-
function Portal(props) {
|
|
2370
|
-
const { useShadow } = props, marker = document.createTextNode(""), mount = () => props.mount || document.body, owner = getOwner();
|
|
2371
|
-
let content;
|
|
2372
|
-
let hydrating = !!sharedConfig.context;
|
|
2373
|
-
createEffect(
|
|
2374
|
-
() => {
|
|
2375
|
-
if (hydrating)
|
|
2376
|
-
getOwner().user = hydrating = false;
|
|
2377
|
-
content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
|
|
2378
|
-
const el = mount();
|
|
2379
|
-
if (el instanceof HTMLHeadElement) {
|
|
2380
|
-
const [clean, setClean] = createSignal(false);
|
|
2381
|
-
const cleanup = () => setClean(true);
|
|
2382
|
-
createRoot((dispose2) => insert(el, () => !clean() ? content() : dispose2(), null));
|
|
2383
|
-
onCleanup(cleanup);
|
|
2384
|
-
} else {
|
|
2385
|
-
const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({
|
|
2386
|
-
mode: "open"
|
|
2387
|
-
}) : container;
|
|
2388
|
-
Object.defineProperty(container, "_$host", {
|
|
2389
|
-
get() {
|
|
2390
|
-
return marker.parentNode;
|
|
2391
|
-
},
|
|
2392
|
-
configurable: true
|
|
2393
|
-
});
|
|
2394
|
-
insert(renderRoot, content);
|
|
2395
|
-
el.appendChild(container);
|
|
2396
|
-
props.ref && props.ref(container);
|
|
2397
|
-
onCleanup(() => el.removeChild(container));
|
|
2398
|
-
}
|
|
2399
|
-
},
|
|
2400
|
-
void 0,
|
|
2401
|
-
{
|
|
2402
|
-
render: !hydrating
|
|
2403
|
-
}
|
|
2404
|
-
);
|
|
2405
|
-
return marker;
|
|
2406
|
-
}
|
|
2407
|
-
function Dynamic(props) {
|
|
2408
|
-
const [p, others] = splitProps(props, ["component"]);
|
|
2409
|
-
const cached = createMemo(() => p.component);
|
|
2410
|
-
return createMemo(() => {
|
|
2411
|
-
const component = cached();
|
|
2412
|
-
switch (typeof component) {
|
|
2413
|
-
case "function":
|
|
2414
|
-
return untrack(() => component(others));
|
|
2415
|
-
case "string":
|
|
2416
|
-
const isSvg = SVGElements.has(component);
|
|
2417
|
-
const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);
|
|
2418
|
-
spread(el, others, isSvg);
|
|
2419
|
-
return el;
|
|
2420
|
-
}
|
|
2421
|
-
});
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/double-indexed-kv.js
|
|
2425
|
-
var DoubleIndexedKV = class {
|
|
2426
|
-
constructor() {
|
|
2427
|
-
this.keyToValue = /* @__PURE__ */ new Map();
|
|
2428
|
-
this.valueToKey = /* @__PURE__ */ new Map();
|
|
2429
|
-
}
|
|
2430
|
-
set(key, value) {
|
|
2431
|
-
this.keyToValue.set(key, value);
|
|
2432
|
-
this.valueToKey.set(value, key);
|
|
2433
|
-
}
|
|
2434
|
-
getByKey(key) {
|
|
2435
|
-
return this.keyToValue.get(key);
|
|
2436
|
-
}
|
|
2437
|
-
getByValue(value) {
|
|
2438
|
-
return this.valueToKey.get(value);
|
|
2439
|
-
}
|
|
2440
|
-
clear() {
|
|
2441
|
-
this.keyToValue.clear();
|
|
2442
|
-
this.valueToKey.clear();
|
|
2443
|
-
}
|
|
2444
|
-
};
|
|
2445
|
-
|
|
2446
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/registry.js
|
|
2447
|
-
var Registry = class {
|
|
2448
|
-
constructor(generateIdentifier) {
|
|
2449
|
-
this.generateIdentifier = generateIdentifier;
|
|
2450
|
-
this.kv = new DoubleIndexedKV();
|
|
2451
|
-
}
|
|
2452
|
-
register(value, identifier) {
|
|
2453
|
-
if (this.kv.getByValue(value)) {
|
|
2454
|
-
return;
|
|
2455
|
-
}
|
|
2456
|
-
if (!identifier) {
|
|
2457
|
-
identifier = this.generateIdentifier(value);
|
|
2458
|
-
}
|
|
2459
|
-
this.kv.set(identifier, value);
|
|
2460
|
-
}
|
|
2461
|
-
clear() {
|
|
2462
|
-
this.kv.clear();
|
|
2463
|
-
}
|
|
2464
|
-
getIdentifier(value) {
|
|
2465
|
-
return this.kv.getByValue(value);
|
|
2466
|
-
}
|
|
2467
|
-
getValue(identifier) {
|
|
2468
|
-
return this.kv.getByKey(identifier);
|
|
2469
|
-
}
|
|
2470
|
-
};
|
|
2471
|
-
|
|
2472
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/class-registry.js
|
|
2473
|
-
var ClassRegistry = class extends Registry {
|
|
2474
|
-
constructor() {
|
|
2475
|
-
super((c) => c.name);
|
|
2476
|
-
this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
2477
|
-
}
|
|
2478
|
-
register(value, options) {
|
|
2479
|
-
if (typeof options === "object") {
|
|
2480
|
-
if (options.allowProps) {
|
|
2481
|
-
this.classToAllowedProps.set(value, options.allowProps);
|
|
2482
|
-
}
|
|
2483
|
-
super.register(value, options.identifier);
|
|
2484
|
-
} else {
|
|
2485
|
-
super.register(value, options);
|
|
2486
|
-
}
|
|
2487
|
-
}
|
|
2488
|
-
getAllowedProps(value) {
|
|
2489
|
-
return this.classToAllowedProps.get(value);
|
|
2490
|
-
}
|
|
2491
|
-
};
|
|
2492
|
-
|
|
2493
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/util.js
|
|
2494
|
-
function valuesOfObj(record) {
|
|
2495
|
-
if ("values" in Object) {
|
|
2496
|
-
return Object.values(record);
|
|
2497
|
-
}
|
|
2498
|
-
const values = [];
|
|
2499
|
-
for (const key in record) {
|
|
2500
|
-
if (record.hasOwnProperty(key)) {
|
|
2501
|
-
values.push(record[key]);
|
|
2502
|
-
}
|
|
2503
|
-
}
|
|
2504
|
-
return values;
|
|
2505
|
-
}
|
|
2506
|
-
function find(record, predicate) {
|
|
2507
|
-
const values = valuesOfObj(record);
|
|
2508
|
-
if ("find" in values) {
|
|
2509
|
-
return values.find(predicate);
|
|
2510
|
-
}
|
|
2511
|
-
const valuesNotNever = values;
|
|
2512
|
-
for (let i = 0; i < valuesNotNever.length; i++) {
|
|
2513
|
-
const value = valuesNotNever[i];
|
|
2514
|
-
if (predicate(value)) {
|
|
2515
|
-
return value;
|
|
2516
|
-
}
|
|
2517
|
-
}
|
|
2518
|
-
return void 0;
|
|
2519
|
-
}
|
|
2520
|
-
function forEach(record, run) {
|
|
2521
|
-
Object.entries(record).forEach(([key, value]) => run(value, key));
|
|
2522
|
-
}
|
|
2523
|
-
function includes(arr, value) {
|
|
2524
|
-
return arr.indexOf(value) !== -1;
|
|
2525
|
-
}
|
|
2526
|
-
function findArr(record, predicate) {
|
|
2527
|
-
for (let i = 0; i < record.length; i++) {
|
|
2528
|
-
const value = record[i];
|
|
2529
|
-
if (predicate(value)) {
|
|
2530
|
-
return value;
|
|
2531
|
-
}
|
|
2532
|
-
}
|
|
2533
|
-
return void 0;
|
|
2534
|
-
}
|
|
2535
|
-
|
|
2536
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/custom-transformer-registry.js
|
|
2537
|
-
var CustomTransformerRegistry = class {
|
|
2538
|
-
constructor() {
|
|
2539
|
-
this.transfomers = {};
|
|
2540
|
-
}
|
|
2541
|
-
register(transformer) {
|
|
2542
|
-
this.transfomers[transformer.name] = transformer;
|
|
2543
|
-
}
|
|
2544
|
-
findApplicable(v) {
|
|
2545
|
-
return find(this.transfomers, (transformer) => transformer.isApplicable(v));
|
|
2546
|
-
}
|
|
2547
|
-
findByName(name) {
|
|
2548
|
-
return this.transfomers[name];
|
|
2549
|
-
}
|
|
2550
|
-
};
|
|
2551
|
-
|
|
2552
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/is.js
|
|
2553
|
-
var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
|
|
2554
|
-
var isUndefined = (payload) => typeof payload === "undefined";
|
|
2555
|
-
var isNull = (payload) => payload === null;
|
|
2556
|
-
var isPlainObject = (payload) => {
|
|
2557
|
-
if (typeof payload !== "object" || payload === null)
|
|
2558
|
-
return false;
|
|
2559
|
-
if (payload === Object.prototype)
|
|
2560
|
-
return false;
|
|
2561
|
-
if (Object.getPrototypeOf(payload) === null)
|
|
2562
|
-
return true;
|
|
2563
|
-
return Object.getPrototypeOf(payload) === Object.prototype;
|
|
2564
|
-
};
|
|
2565
|
-
var isEmptyObject = (payload) => isPlainObject(payload) && Object.keys(payload).length === 0;
|
|
2566
|
-
var isArray = (payload) => Array.isArray(payload);
|
|
2567
|
-
var isString = (payload) => typeof payload === "string";
|
|
2568
|
-
var isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
|
|
2569
|
-
var isBoolean = (payload) => typeof payload === "boolean";
|
|
2570
|
-
var isRegExp = (payload) => payload instanceof RegExp;
|
|
2571
|
-
var isMap = (payload) => payload instanceof Map;
|
|
2572
|
-
var isSet = (payload) => payload instanceof Set;
|
|
2573
|
-
var isSymbol = (payload) => getType(payload) === "Symbol";
|
|
2574
|
-
var isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
|
|
2575
|
-
var isError = (payload) => payload instanceof Error;
|
|
2576
|
-
var isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
|
|
2577
|
-
var isPrimitive = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
|
|
2578
|
-
var isBigint = (payload) => typeof payload === "bigint";
|
|
2579
|
-
var isInfinite = (payload) => payload === Infinity || payload === -Infinity;
|
|
2580
|
-
var isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
|
|
2581
|
-
var isURL = (payload) => payload instanceof URL;
|
|
2582
|
-
|
|
2583
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/pathstringifier.js
|
|
2584
|
-
var escapeKey = (key) => key.replace(/\./g, "\\.");
|
|
2585
|
-
var stringifyPath = (path) => path.map(String).map(escapeKey).join(".");
|
|
2586
|
-
var parsePath = (string) => {
|
|
2587
|
-
const result = [];
|
|
2588
|
-
let segment = "";
|
|
2589
|
-
for (let i = 0; i < string.length; i++) {
|
|
2590
|
-
let char = string.charAt(i);
|
|
2591
|
-
const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
|
|
2592
|
-
if (isEscapedDot) {
|
|
2593
|
-
segment += ".";
|
|
2594
|
-
i++;
|
|
2595
|
-
continue;
|
|
2596
|
-
}
|
|
2597
|
-
const isEndOfSegment = char === ".";
|
|
2598
|
-
if (isEndOfSegment) {
|
|
2599
|
-
result.push(segment);
|
|
2600
|
-
segment = "";
|
|
2601
|
-
continue;
|
|
2602
|
-
}
|
|
2603
|
-
segment += char;
|
|
2604
|
-
}
|
|
2605
|
-
const lastSegment = segment;
|
|
2606
|
-
result.push(lastSegment);
|
|
2607
|
-
return result;
|
|
2608
|
-
};
|
|
2609
|
-
|
|
2610
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/transformer.js
|
|
2611
|
-
function simpleTransformation(isApplicable, annotation, transform, untransform) {
|
|
2612
|
-
return {
|
|
2613
|
-
isApplicable,
|
|
2614
|
-
annotation,
|
|
2615
|
-
transform,
|
|
2616
|
-
untransform
|
|
2617
|
-
};
|
|
2618
|
-
}
|
|
2619
|
-
var simpleRules = [
|
|
2620
|
-
simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
|
|
2621
|
-
simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
|
|
2622
|
-
if (typeof BigInt !== "undefined") {
|
|
2623
|
-
return BigInt(v);
|
|
2624
|
-
}
|
|
2625
|
-
return v;
|
|
2626
|
-
}),
|
|
2627
|
-
simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
|
|
2628
|
-
simpleTransformation(isError, "Error", (v, superJson) => {
|
|
2629
|
-
const baseError = {
|
|
2630
|
-
name: v.name,
|
|
2631
|
-
message: v.message
|
|
2632
|
-
};
|
|
2633
|
-
superJson.allowedErrorProps.forEach((prop) => {
|
|
2634
|
-
baseError[prop] = v[prop];
|
|
2635
|
-
});
|
|
2636
|
-
return baseError;
|
|
2637
|
-
}, (v, superJson) => {
|
|
2638
|
-
const e = new Error(v.message);
|
|
2639
|
-
e.name = v.name;
|
|
2640
|
-
e.stack = v.stack;
|
|
2641
|
-
superJson.allowedErrorProps.forEach((prop) => {
|
|
2642
|
-
e[prop] = v[prop];
|
|
2643
|
-
});
|
|
2644
|
-
return e;
|
|
2645
|
-
}),
|
|
2646
|
-
simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
|
|
2647
|
-
const body = regex.slice(1, regex.lastIndexOf("/"));
|
|
2648
|
-
const flags = regex.slice(regex.lastIndexOf("/") + 1);
|
|
2649
|
-
return new RegExp(body, flags);
|
|
2650
|
-
}),
|
|
2651
|
-
simpleTransformation(
|
|
2652
|
-
isSet,
|
|
2653
|
-
"set",
|
|
2654
|
-
// (sets only exist in es6+)
|
|
2655
|
-
// eslint-disable-next-line es5/no-es6-methods
|
|
2656
|
-
(v) => [...v.values()],
|
|
2657
|
-
(v) => new Set(v)
|
|
2658
|
-
),
|
|
2659
|
-
simpleTransformation(isMap, "map", (v) => [...v.entries()], (v) => new Map(v)),
|
|
2660
|
-
simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
|
|
2661
|
-
if (isNaNValue(v)) {
|
|
2662
|
-
return "NaN";
|
|
2663
|
-
}
|
|
2664
|
-
if (v > 0) {
|
|
2665
|
-
return "Infinity";
|
|
2666
|
-
} else {
|
|
2667
|
-
return "-Infinity";
|
|
2668
|
-
}
|
|
2669
|
-
}, Number),
|
|
2670
|
-
simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
|
|
2671
|
-
return "-0";
|
|
2672
|
-
}, Number),
|
|
2673
|
-
simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
|
|
2674
|
-
];
|
|
2675
|
-
function compositeTransformation(isApplicable, annotation, transform, untransform) {
|
|
2676
|
-
return {
|
|
2677
|
-
isApplicable,
|
|
2678
|
-
annotation,
|
|
2679
|
-
transform,
|
|
2680
|
-
untransform
|
|
2681
|
-
};
|
|
2682
|
-
}
|
|
2683
|
-
var symbolRule = compositeTransformation((s, superJson) => {
|
|
2684
|
-
if (isSymbol(s)) {
|
|
2685
|
-
const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
|
|
2686
|
-
return isRegistered;
|
|
2687
|
-
}
|
|
2688
|
-
return false;
|
|
2689
|
-
}, (s, superJson) => {
|
|
2690
|
-
const identifier = superJson.symbolRegistry.getIdentifier(s);
|
|
2691
|
-
return ["symbol", identifier];
|
|
2692
|
-
}, (v) => v.description, (_, a, superJson) => {
|
|
2693
|
-
const value = superJson.symbolRegistry.getValue(a[1]);
|
|
2694
|
-
if (!value) {
|
|
2695
|
-
throw new Error("Trying to deserialize unknown symbol");
|
|
2696
|
-
}
|
|
2697
|
-
return value;
|
|
2698
|
-
});
|
|
2699
|
-
var constructorToName = [
|
|
2700
|
-
Int8Array,
|
|
2701
|
-
Uint8Array,
|
|
2702
|
-
Int16Array,
|
|
2703
|
-
Uint16Array,
|
|
2704
|
-
Int32Array,
|
|
2705
|
-
Uint32Array,
|
|
2706
|
-
Float32Array,
|
|
2707
|
-
Float64Array,
|
|
2708
|
-
Uint8ClampedArray
|
|
2709
|
-
].reduce((obj, ctor) => {
|
|
2710
|
-
obj[ctor.name] = ctor;
|
|
2711
|
-
return obj;
|
|
2712
|
-
}, {});
|
|
2713
|
-
var typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
|
|
2714
|
-
const ctor = constructorToName[a[1]];
|
|
2715
|
-
if (!ctor) {
|
|
2716
|
-
throw new Error("Trying to deserialize unknown typed array");
|
|
2717
|
-
}
|
|
2718
|
-
return new ctor(v);
|
|
2719
|
-
});
|
|
2720
|
-
function isInstanceOfRegisteredClass(potentialClass, superJson) {
|
|
2721
|
-
if (potentialClass?.constructor) {
|
|
2722
|
-
const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
|
|
2723
|
-
return isRegistered;
|
|
2724
|
-
}
|
|
2725
|
-
return false;
|
|
2726
|
-
}
|
|
2727
|
-
var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
|
|
2728
|
-
const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
|
|
2729
|
-
return ["class", identifier];
|
|
2730
|
-
}, (clazz, superJson) => {
|
|
2731
|
-
const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
|
|
2732
|
-
if (!allowedProps) {
|
|
2733
|
-
return { ...clazz };
|
|
2734
|
-
}
|
|
2735
|
-
const result = {};
|
|
2736
|
-
allowedProps.forEach((prop) => {
|
|
2737
|
-
result[prop] = clazz[prop];
|
|
2738
|
-
});
|
|
2739
|
-
return result;
|
|
2740
|
-
}, (v, a, superJson) => {
|
|
2741
|
-
const clazz = superJson.classRegistry.getValue(a[1]);
|
|
2742
|
-
if (!clazz) {
|
|
2743
|
-
throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");
|
|
2744
|
-
}
|
|
2745
|
-
return Object.assign(Object.create(clazz.prototype), v);
|
|
2746
|
-
});
|
|
2747
|
-
var customRule = compositeTransformation((value, superJson) => {
|
|
2748
|
-
return !!superJson.customTransformerRegistry.findApplicable(value);
|
|
2749
|
-
}, (value, superJson) => {
|
|
2750
|
-
const transformer = superJson.customTransformerRegistry.findApplicable(value);
|
|
2751
|
-
return ["custom", transformer.name];
|
|
2752
|
-
}, (value, superJson) => {
|
|
2753
|
-
const transformer = superJson.customTransformerRegistry.findApplicable(value);
|
|
2754
|
-
return transformer.serialize(value);
|
|
2755
|
-
}, (v, a, superJson) => {
|
|
2756
|
-
const transformer = superJson.customTransformerRegistry.findByName(a[1]);
|
|
2757
|
-
if (!transformer) {
|
|
2758
|
-
throw new Error("Trying to deserialize unknown custom value");
|
|
2759
|
-
}
|
|
2760
|
-
return transformer.deserialize(v);
|
|
2761
|
-
});
|
|
2762
|
-
var compositeRules = [classRule, symbolRule, customRule, typedArrayRule];
|
|
2763
|
-
var transformValue = (value, superJson) => {
|
|
2764
|
-
const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
|
|
2765
|
-
if (applicableCompositeRule) {
|
|
2766
|
-
return {
|
|
2767
|
-
value: applicableCompositeRule.transform(value, superJson),
|
|
2768
|
-
type: applicableCompositeRule.annotation(value, superJson)
|
|
2769
|
-
};
|
|
2770
|
-
}
|
|
2771
|
-
const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
|
|
2772
|
-
if (applicableSimpleRule) {
|
|
2773
|
-
return {
|
|
2774
|
-
value: applicableSimpleRule.transform(value, superJson),
|
|
2775
|
-
type: applicableSimpleRule.annotation
|
|
2776
|
-
};
|
|
2777
|
-
}
|
|
2778
|
-
return void 0;
|
|
2779
|
-
};
|
|
2780
|
-
var simpleRulesByAnnotation = {};
|
|
2781
|
-
simpleRules.forEach((rule) => {
|
|
2782
|
-
simpleRulesByAnnotation[rule.annotation] = rule;
|
|
2783
|
-
});
|
|
2784
|
-
var untransformValue = (json, type, superJson) => {
|
|
2785
|
-
if (isArray(type)) {
|
|
2786
|
-
switch (type[0]) {
|
|
2787
|
-
case "symbol":
|
|
2788
|
-
return symbolRule.untransform(json, type, superJson);
|
|
2789
|
-
case "class":
|
|
2790
|
-
return classRule.untransform(json, type, superJson);
|
|
2791
|
-
case "custom":
|
|
2792
|
-
return customRule.untransform(json, type, superJson);
|
|
2793
|
-
case "typed-array":
|
|
2794
|
-
return typedArrayRule.untransform(json, type, superJson);
|
|
2795
|
-
default:
|
|
2796
|
-
throw new Error("Unknown transformation: " + type);
|
|
2797
|
-
}
|
|
2798
|
-
} else {
|
|
2799
|
-
const transformation = simpleRulesByAnnotation[type];
|
|
2800
|
-
if (!transformation) {
|
|
2801
|
-
throw new Error("Unknown transformation: " + type);
|
|
2802
|
-
}
|
|
2803
|
-
return transformation.untransform(json, superJson);
|
|
2804
|
-
}
|
|
2805
|
-
};
|
|
2806
|
-
|
|
2807
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/accessDeep.js
|
|
2808
|
-
var getNthKey = (value, n) => {
|
|
2809
|
-
const keys = value.keys();
|
|
2810
|
-
while (n > 0) {
|
|
2811
|
-
keys.next();
|
|
2812
|
-
n--;
|
|
2813
|
-
}
|
|
2814
|
-
return keys.next().value;
|
|
2815
|
-
};
|
|
2816
|
-
function validatePath(path) {
|
|
2817
|
-
if (includes(path, "__proto__")) {
|
|
2818
|
-
throw new Error("__proto__ is not allowed as a property");
|
|
2819
|
-
}
|
|
2820
|
-
if (includes(path, "prototype")) {
|
|
2821
|
-
throw new Error("prototype is not allowed as a property");
|
|
2822
|
-
}
|
|
2823
|
-
if (includes(path, "constructor")) {
|
|
2824
|
-
throw new Error("constructor is not allowed as a property");
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
var getDeep = (object, path) => {
|
|
2828
|
-
validatePath(path);
|
|
2829
|
-
for (let i = 0; i < path.length; i++) {
|
|
2830
|
-
const key = path[i];
|
|
2831
|
-
if (isSet(object)) {
|
|
2832
|
-
object = getNthKey(object, +key);
|
|
2833
|
-
} else if (isMap(object)) {
|
|
2834
|
-
const row = +key;
|
|
2835
|
-
const type = +path[++i] === 0 ? "key" : "value";
|
|
2836
|
-
const keyOfRow = getNthKey(object, row);
|
|
2837
|
-
switch (type) {
|
|
2838
|
-
case "key":
|
|
2839
|
-
object = keyOfRow;
|
|
2840
|
-
break;
|
|
2841
|
-
case "value":
|
|
2842
|
-
object = object.get(keyOfRow);
|
|
2843
|
-
break;
|
|
2844
|
-
}
|
|
2845
|
-
} else {
|
|
2846
|
-
object = object[key];
|
|
2847
|
-
}
|
|
2848
|
-
}
|
|
2849
|
-
return object;
|
|
2850
|
-
};
|
|
2851
|
-
var setDeep = (object, path, mapper) => {
|
|
2852
|
-
validatePath(path);
|
|
2853
|
-
if (path.length === 0) {
|
|
2854
|
-
return mapper(object);
|
|
2855
|
-
}
|
|
2856
|
-
let parent = object;
|
|
2857
|
-
for (let i = 0; i < path.length - 1; i++) {
|
|
2858
|
-
const key = path[i];
|
|
2859
|
-
if (isArray(parent)) {
|
|
2860
|
-
const index = +key;
|
|
2861
|
-
parent = parent[index];
|
|
2862
|
-
} else if (isPlainObject(parent)) {
|
|
2863
|
-
parent = parent[key];
|
|
2864
|
-
} else if (isSet(parent)) {
|
|
2865
|
-
const row = +key;
|
|
2866
|
-
parent = getNthKey(parent, row);
|
|
2867
|
-
} else if (isMap(parent)) {
|
|
2868
|
-
const isEnd = i === path.length - 2;
|
|
2869
|
-
if (isEnd) {
|
|
2870
|
-
break;
|
|
2871
|
-
}
|
|
2872
|
-
const row = +key;
|
|
2873
|
-
const type = +path[++i] === 0 ? "key" : "value";
|
|
2874
|
-
const keyOfRow = getNthKey(parent, row);
|
|
2875
|
-
switch (type) {
|
|
2876
|
-
case "key":
|
|
2877
|
-
parent = keyOfRow;
|
|
2878
|
-
break;
|
|
2879
|
-
case "value":
|
|
2880
|
-
parent = parent.get(keyOfRow);
|
|
2881
|
-
break;
|
|
2882
|
-
}
|
|
2883
|
-
}
|
|
2884
|
-
}
|
|
2885
|
-
const lastKey = path[path.length - 1];
|
|
2886
|
-
if (isArray(parent)) {
|
|
2887
|
-
parent[+lastKey] = mapper(parent[+lastKey]);
|
|
2888
|
-
} else if (isPlainObject(parent)) {
|
|
2889
|
-
parent[lastKey] = mapper(parent[lastKey]);
|
|
2890
|
-
}
|
|
2891
|
-
if (isSet(parent)) {
|
|
2892
|
-
const oldValue = getNthKey(parent, +lastKey);
|
|
2893
|
-
const newValue = mapper(oldValue);
|
|
2894
|
-
if (oldValue !== newValue) {
|
|
2895
|
-
parent.delete(oldValue);
|
|
2896
|
-
parent.add(newValue);
|
|
2897
|
-
}
|
|
2898
|
-
}
|
|
2899
|
-
if (isMap(parent)) {
|
|
2900
|
-
const row = +path[path.length - 2];
|
|
2901
|
-
const keyToRow = getNthKey(parent, row);
|
|
2902
|
-
const type = +lastKey === 0 ? "key" : "value";
|
|
2903
|
-
switch (type) {
|
|
2904
|
-
case "key": {
|
|
2905
|
-
const newKey = mapper(keyToRow);
|
|
2906
|
-
parent.set(newKey, parent.get(keyToRow));
|
|
2907
|
-
if (newKey !== keyToRow) {
|
|
2908
|
-
parent.delete(keyToRow);
|
|
2909
|
-
}
|
|
2910
|
-
break;
|
|
2911
|
-
}
|
|
2912
|
-
case "value": {
|
|
2913
|
-
parent.set(keyToRow, mapper(parent.get(keyToRow)));
|
|
2914
|
-
break;
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2917
|
-
}
|
|
2918
|
-
return object;
|
|
2919
|
-
};
|
|
2920
|
-
|
|
2921
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/plainer.js
|
|
2922
|
-
function traverse(tree, walker2, origin = []) {
|
|
2923
|
-
if (!tree) {
|
|
2924
|
-
return;
|
|
2925
|
-
}
|
|
2926
|
-
if (!isArray(tree)) {
|
|
2927
|
-
forEach(tree, (subtree, key) => traverse(subtree, walker2, [...origin, ...parsePath(key)]));
|
|
2928
|
-
return;
|
|
2929
|
-
}
|
|
2930
|
-
const [nodeValue, children2] = tree;
|
|
2931
|
-
if (children2) {
|
|
2932
|
-
forEach(children2, (child, key) => {
|
|
2933
|
-
traverse(child, walker2, [...origin, ...parsePath(key)]);
|
|
2934
|
-
});
|
|
2935
|
-
}
|
|
2936
|
-
walker2(nodeValue, origin);
|
|
2937
|
-
}
|
|
2938
|
-
function applyValueAnnotations(plain, annotations, superJson) {
|
|
2939
|
-
traverse(annotations, (type, path) => {
|
|
2940
|
-
plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
|
|
2941
|
-
});
|
|
2942
|
-
return plain;
|
|
2943
|
-
}
|
|
2944
|
-
function applyReferentialEqualityAnnotations(plain, annotations) {
|
|
2945
|
-
function apply(identicalPaths, path) {
|
|
2946
|
-
const object = getDeep(plain, parsePath(path));
|
|
2947
|
-
identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
|
|
2948
|
-
plain = setDeep(plain, identicalObjectPath, () => object);
|
|
2949
|
-
});
|
|
2950
|
-
}
|
|
2951
|
-
if (isArray(annotations)) {
|
|
2952
|
-
const [root, other] = annotations;
|
|
2953
|
-
root.forEach((identicalPath) => {
|
|
2954
|
-
plain = setDeep(plain, parsePath(identicalPath), () => plain);
|
|
2955
|
-
});
|
|
2956
|
-
if (other) {
|
|
2957
|
-
forEach(other, apply);
|
|
2958
|
-
}
|
|
2959
|
-
} else {
|
|
2960
|
-
forEach(annotations, apply);
|
|
2961
|
-
}
|
|
2962
|
-
return plain;
|
|
2963
|
-
}
|
|
2964
|
-
var isDeep = (object, superJson) => isPlainObject(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
|
|
2965
|
-
function addIdentity(object, path, identities) {
|
|
2966
|
-
const existingSet = identities.get(object);
|
|
2967
|
-
if (existingSet) {
|
|
2968
|
-
existingSet.push(path);
|
|
2969
|
-
} else {
|
|
2970
|
-
identities.set(object, [path]);
|
|
2971
|
-
}
|
|
2972
|
-
}
|
|
2973
|
-
function generateReferentialEqualityAnnotations(identitites, dedupe) {
|
|
2974
|
-
const result = {};
|
|
2975
|
-
let rootEqualityPaths = void 0;
|
|
2976
|
-
identitites.forEach((paths) => {
|
|
2977
|
-
if (paths.length <= 1) {
|
|
2978
|
-
return;
|
|
2979
|
-
}
|
|
2980
|
-
if (!dedupe) {
|
|
2981
|
-
paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length);
|
|
2982
|
-
}
|
|
2983
|
-
const [representativePath, ...identicalPaths] = paths;
|
|
2984
|
-
if (representativePath.length === 0) {
|
|
2985
|
-
rootEqualityPaths = identicalPaths.map(stringifyPath);
|
|
2986
|
-
} else {
|
|
2987
|
-
result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
|
|
2988
|
-
}
|
|
2989
|
-
});
|
|
2990
|
-
if (rootEqualityPaths) {
|
|
2991
|
-
if (isEmptyObject(result)) {
|
|
2992
|
-
return [rootEqualityPaths];
|
|
2993
|
-
} else {
|
|
2994
|
-
return [rootEqualityPaths, result];
|
|
2995
|
-
}
|
|
2996
|
-
} else {
|
|
2997
|
-
return isEmptyObject(result) ? void 0 : result;
|
|
2998
|
-
}
|
|
2999
|
-
}
|
|
3000
|
-
var walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
|
|
3001
|
-
const primitive = isPrimitive(object);
|
|
3002
|
-
if (!primitive) {
|
|
3003
|
-
addIdentity(object, path, identities);
|
|
3004
|
-
const seen = seenObjects.get(object);
|
|
3005
|
-
if (seen) {
|
|
3006
|
-
return dedupe ? {
|
|
3007
|
-
transformedValue: null
|
|
3008
|
-
} : seen;
|
|
3009
|
-
}
|
|
3010
|
-
}
|
|
3011
|
-
if (!isDeep(object, superJson)) {
|
|
3012
|
-
const transformed2 = transformValue(object, superJson);
|
|
3013
|
-
const result2 = transformed2 ? {
|
|
3014
|
-
transformedValue: transformed2.value,
|
|
3015
|
-
annotations: [transformed2.type]
|
|
3016
|
-
} : {
|
|
3017
|
-
transformedValue: object
|
|
3018
|
-
};
|
|
3019
|
-
if (!primitive) {
|
|
3020
|
-
seenObjects.set(object, result2);
|
|
3021
|
-
}
|
|
3022
|
-
return result2;
|
|
3023
|
-
}
|
|
3024
|
-
if (includes(objectsInThisPath, object)) {
|
|
3025
|
-
return {
|
|
3026
|
-
transformedValue: null
|
|
3027
|
-
};
|
|
3028
|
-
}
|
|
3029
|
-
const transformationResult = transformValue(object, superJson);
|
|
3030
|
-
const transformed = transformationResult?.value ?? object;
|
|
3031
|
-
const transformedValue = isArray(transformed) ? [] : {};
|
|
3032
|
-
const innerAnnotations = {};
|
|
3033
|
-
forEach(transformed, (value, index) => {
|
|
3034
|
-
if (index === "__proto__" || index === "constructor" || index === "prototype") {
|
|
3035
|
-
throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
|
|
3036
|
-
}
|
|
3037
|
-
const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
|
|
3038
|
-
transformedValue[index] = recursiveResult.transformedValue;
|
|
3039
|
-
if (isArray(recursiveResult.annotations)) {
|
|
3040
|
-
innerAnnotations[index] = recursiveResult.annotations;
|
|
3041
|
-
} else if (isPlainObject(recursiveResult.annotations)) {
|
|
3042
|
-
forEach(recursiveResult.annotations, (tree, key) => {
|
|
3043
|
-
innerAnnotations[escapeKey(index) + "." + key] = tree;
|
|
3044
|
-
});
|
|
3045
|
-
}
|
|
3046
|
-
});
|
|
3047
|
-
const result = isEmptyObject(innerAnnotations) ? {
|
|
3048
|
-
transformedValue,
|
|
3049
|
-
annotations: !!transformationResult ? [transformationResult.type] : void 0
|
|
3050
|
-
} : {
|
|
3051
|
-
transformedValue,
|
|
3052
|
-
annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
|
|
3053
|
-
};
|
|
3054
|
-
if (!primitive) {
|
|
3055
|
-
seenObjects.set(object, result);
|
|
3056
|
-
}
|
|
3057
|
-
return result;
|
|
3058
|
-
};
|
|
3059
|
-
|
|
3060
|
-
// ../../node_modules/.pnpm/is-what@4.1.15/node_modules/is-what/dist/index.js
|
|
3061
|
-
function getType2(payload) {
|
|
3062
|
-
return Object.prototype.toString.call(payload).slice(8, -1);
|
|
3063
|
-
}
|
|
3064
|
-
function isPlainObject2(payload) {
|
|
3065
|
-
if (getType2(payload) !== "Object")
|
|
3066
|
-
return false;
|
|
3067
|
-
const prototype = Object.getPrototypeOf(payload);
|
|
3068
|
-
return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
|
|
3069
|
-
}
|
|
3070
|
-
function isArray2(payload) {
|
|
3071
|
-
return getType2(payload) === "Array";
|
|
3072
|
-
}
|
|
3073
|
-
|
|
3074
|
-
// ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
|
|
3075
|
-
function assignProp2(carry, key, newVal, originalObject, includeNonenumerable) {
|
|
3076
|
-
const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
|
|
3077
|
-
if (propType === "enumerable")
|
|
3078
|
-
carry[key] = newVal;
|
|
3079
|
-
if (includeNonenumerable && propType === "nonenumerable") {
|
|
3080
|
-
Object.defineProperty(carry, key, {
|
|
3081
|
-
value: newVal,
|
|
3082
|
-
enumerable: false,
|
|
3083
|
-
writable: true,
|
|
3084
|
-
configurable: true
|
|
3085
|
-
});
|
|
3086
|
-
}
|
|
3087
|
-
}
|
|
3088
|
-
function copy(target, options = {}) {
|
|
3089
|
-
if (isArray2(target)) {
|
|
3090
|
-
return target.map((item) => copy(item, options));
|
|
3091
|
-
}
|
|
3092
|
-
if (!isPlainObject2(target)) {
|
|
3093
|
-
return target;
|
|
3094
|
-
}
|
|
3095
|
-
const props = Object.getOwnPropertyNames(target);
|
|
3096
|
-
const symbols = Object.getOwnPropertySymbols(target);
|
|
3097
|
-
return [...props, ...symbols].reduce((carry, key) => {
|
|
3098
|
-
if (isArray2(options.props) && !options.props.includes(key)) {
|
|
3099
|
-
return carry;
|
|
3100
|
-
}
|
|
3101
|
-
const val = target[key];
|
|
3102
|
-
const newVal = copy(val, options);
|
|
3103
|
-
assignProp2(carry, key, newVal, target, options.nonenumerable);
|
|
3104
|
-
return carry;
|
|
3105
|
-
}, {});
|
|
3106
|
-
}
|
|
3107
|
-
|
|
3108
|
-
// ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/index.js
|
|
3109
|
-
var SuperJSON = class {
|
|
3110
|
-
/**
|
|
3111
|
-
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
3112
|
-
*/
|
|
3113
|
-
constructor({ dedupe = false } = {}) {
|
|
3114
|
-
this.classRegistry = new ClassRegistry();
|
|
3115
|
-
this.symbolRegistry = new Registry((s) => s.description ?? "");
|
|
3116
|
-
this.customTransformerRegistry = new CustomTransformerRegistry();
|
|
3117
|
-
this.allowedErrorProps = [];
|
|
3118
|
-
this.dedupe = dedupe;
|
|
3119
|
-
}
|
|
3120
|
-
serialize(object) {
|
|
3121
|
-
const identities = /* @__PURE__ */ new Map();
|
|
3122
|
-
const output = walker(object, identities, this, this.dedupe);
|
|
3123
|
-
const res = {
|
|
3124
|
-
json: output.transformedValue
|
|
3125
|
-
};
|
|
3126
|
-
if (output.annotations) {
|
|
3127
|
-
res.meta = {
|
|
3128
|
-
...res.meta,
|
|
3129
|
-
values: output.annotations
|
|
3130
|
-
};
|
|
3131
|
-
}
|
|
3132
|
-
const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
|
|
3133
|
-
if (equalityAnnotations) {
|
|
3134
|
-
res.meta = {
|
|
3135
|
-
...res.meta,
|
|
3136
|
-
referentialEqualities: equalityAnnotations
|
|
3137
|
-
};
|
|
3138
|
-
}
|
|
3139
|
-
return res;
|
|
3140
|
-
}
|
|
3141
|
-
deserialize(payload) {
|
|
3142
|
-
const { json, meta } = payload;
|
|
3143
|
-
let result = copy(json);
|
|
3144
|
-
if (meta?.values) {
|
|
3145
|
-
result = applyValueAnnotations(result, meta.values, this);
|
|
3146
|
-
}
|
|
3147
|
-
if (meta?.referentialEqualities) {
|
|
3148
|
-
result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
|
|
3149
|
-
}
|
|
3150
|
-
return result;
|
|
3151
|
-
}
|
|
3152
|
-
stringify(object) {
|
|
3153
|
-
return JSON.stringify(this.serialize(object));
|
|
3154
|
-
}
|
|
3155
|
-
parse(string) {
|
|
3156
|
-
return this.deserialize(JSON.parse(string));
|
|
3157
|
-
}
|
|
3158
|
-
registerClass(v, options) {
|
|
3159
|
-
this.classRegistry.register(v, options);
|
|
3160
|
-
}
|
|
3161
|
-
registerSymbol(v, identifier) {
|
|
3162
|
-
this.symbolRegistry.register(v, identifier);
|
|
3163
|
-
}
|
|
3164
|
-
registerCustom(transformer, name) {
|
|
3165
|
-
this.customTransformerRegistry.register({
|
|
3166
|
-
name,
|
|
3167
|
-
...transformer
|
|
3168
|
-
});
|
|
3169
|
-
}
|
|
3170
|
-
allowErrorProps(...props) {
|
|
3171
|
-
this.allowedErrorProps.push(...props);
|
|
3172
|
-
}
|
|
3173
|
-
};
|
|
3174
|
-
SuperJSON.defaultInstance = new SuperJSON();
|
|
3175
|
-
SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
|
|
3176
|
-
SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
|
|
3177
|
-
SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
|
|
3178
|
-
SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
|
|
3179
|
-
SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
|
|
3180
|
-
SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
|
|
3181
|
-
SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
|
|
3182
|
-
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
|
3183
|
-
var serialize = SuperJSON.serialize;
|
|
3184
|
-
var stringify = SuperJSON.stringify;
|
|
3185
|
-
|
|
3186
|
-
// src/utils.tsx
|
|
3187
|
-
function getQueryStatusLabel(query) {
|
|
3188
|
-
return query.state.fetchStatus === "fetching" ? "fetching" : !query.getObserversCount() ? "inactive" : query.state.fetchStatus === "paused" ? "paused" : query.isStale() ? "stale" : "fresh";
|
|
3189
|
-
}
|
|
3190
|
-
function getSidedProp(prop, side) {
|
|
3191
|
-
return `${prop}${side.charAt(0).toUpperCase() + side.slice(1)}`;
|
|
3192
|
-
}
|
|
3193
|
-
function getQueryStatusColor({
|
|
3194
|
-
queryState,
|
|
3195
|
-
observerCount,
|
|
3196
|
-
isStale
|
|
3197
|
-
}) {
|
|
3198
|
-
return queryState.fetchStatus === "fetching" ? "blue" : !observerCount ? "gray" : queryState.fetchStatus === "paused" ? "purple" : isStale ? "yellow" : "green";
|
|
3199
|
-
}
|
|
3200
|
-
function getMutationStatusColor({
|
|
3201
|
-
status,
|
|
3202
|
-
isPaused
|
|
3203
|
-
}) {
|
|
3204
|
-
return isPaused ? "purple" : status === "error" ? "red" : status === "pending" ? "yellow" : status === "success" ? "green" : "gray";
|
|
3205
|
-
}
|
|
3206
|
-
function getQueryStatusColorByLabel(label) {
|
|
3207
|
-
return label === "fresh" ? "green" : label === "stale" ? "yellow" : label === "paused" ? "purple" : label === "inactive" ? "gray" : "blue";
|
|
3208
|
-
}
|
|
3209
|
-
var displayValue = (value, beautify = false) => {
|
|
3210
|
-
const {
|
|
3211
|
-
json
|
|
3212
|
-
} = serialize(value);
|
|
3213
|
-
return JSON.stringify(json, null, beautify ? 2 : void 0);
|
|
3214
|
-
};
|
|
3215
|
-
var getStatusRank = (q) => q.state.fetchStatus !== "idle" ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1;
|
|
3216
|
-
var queryHashSort = (a, b) => a.queryHash.localeCompare(b.queryHash);
|
|
3217
|
-
var dateSort = (a, b) => a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1;
|
|
3218
|
-
var statusAndDateSort = (a, b) => {
|
|
3219
|
-
if (getStatusRank(a) === getStatusRank(b)) {
|
|
3220
|
-
return dateSort(a, b);
|
|
3221
|
-
}
|
|
3222
|
-
return getStatusRank(a) > getStatusRank(b) ? 1 : -1;
|
|
3223
|
-
};
|
|
3224
|
-
var sortFns = {
|
|
3225
|
-
status: statusAndDateSort,
|
|
3226
|
-
"query hash": queryHashSort,
|
|
3227
|
-
"last updated": dateSort
|
|
3228
|
-
};
|
|
3229
|
-
var getMutationStatusRank = (m) => m.state.isPaused ? 0 : m.state.status === "error" ? 2 : m.state.status === "pending" ? 1 : 3;
|
|
3230
|
-
var mutationDateSort = (a, b) => a.state.submittedAt < b.state.submittedAt ? 1 : -1;
|
|
3231
|
-
var mutationStatusSort = (a, b) => {
|
|
3232
|
-
if (getMutationStatusRank(a) === getMutationStatusRank(b)) {
|
|
3233
|
-
return mutationDateSort(a, b);
|
|
3234
|
-
}
|
|
3235
|
-
return getMutationStatusRank(a) > getMutationStatusRank(b) ? 1 : -1;
|
|
3236
|
-
};
|
|
3237
|
-
var mutationSortFns = {
|
|
3238
|
-
status: mutationStatusSort,
|
|
3239
|
-
"last updated": mutationDateSort
|
|
3240
|
-
};
|
|
3241
|
-
var convertRemToPixels = (rem) => {
|
|
3242
|
-
return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
3243
|
-
};
|
|
3244
|
-
var getPreferredColorScheme = () => {
|
|
3245
|
-
const [colorScheme, setColorScheme] = createSignal("dark");
|
|
3246
|
-
onMount(() => {
|
|
3247
|
-
const query = window.matchMedia("(prefers-color-scheme: dark)");
|
|
3248
|
-
setColorScheme(query.matches ? "dark" : "light");
|
|
3249
|
-
const listener = (e) => {
|
|
3250
|
-
setColorScheme(e.matches ? "dark" : "light");
|
|
3251
|
-
};
|
|
3252
|
-
query.addEventListener("change", listener);
|
|
3253
|
-
onCleanup(() => query.removeEventListener("change", listener));
|
|
3254
|
-
});
|
|
3255
|
-
return colorScheme;
|
|
3256
|
-
};
|
|
3257
|
-
var updateNestedDataByPath = (oldData, updatePath, value) => {
|
|
3258
|
-
if (updatePath.length === 0) {
|
|
3259
|
-
return value;
|
|
3260
|
-
}
|
|
3261
|
-
if (oldData instanceof Map) {
|
|
3262
|
-
const newData = new Map(oldData);
|
|
3263
|
-
if (updatePath.length === 1) {
|
|
3264
|
-
newData.set(updatePath[0], value);
|
|
3265
|
-
return newData;
|
|
3266
|
-
}
|
|
3267
|
-
const [head, ...tail] = updatePath;
|
|
3268
|
-
newData.set(head, updateNestedDataByPath(newData.get(head), tail, value));
|
|
3269
|
-
return newData;
|
|
3270
|
-
}
|
|
3271
|
-
if (oldData instanceof Set) {
|
|
3272
|
-
const setAsArray = updateNestedDataByPath(Array.from(oldData), updatePath, value);
|
|
3273
|
-
return new Set(setAsArray);
|
|
3274
|
-
}
|
|
3275
|
-
if (Array.isArray(oldData)) {
|
|
3276
|
-
const newData = [...oldData];
|
|
3277
|
-
if (updatePath.length === 1) {
|
|
3278
|
-
newData[updatePath[0]] = value;
|
|
3279
|
-
return newData;
|
|
3280
|
-
}
|
|
3281
|
-
const [head, ...tail] = updatePath;
|
|
3282
|
-
newData[head] = updateNestedDataByPath(newData[head], tail, value);
|
|
3283
|
-
return newData;
|
|
3284
|
-
}
|
|
3285
|
-
if (oldData instanceof Object) {
|
|
3286
|
-
const newData = {
|
|
3287
|
-
...oldData
|
|
3288
|
-
};
|
|
3289
|
-
if (updatePath.length === 1) {
|
|
3290
|
-
newData[updatePath[0]] = value;
|
|
3291
|
-
return newData;
|
|
3292
|
-
}
|
|
3293
|
-
const [head, ...tail] = updatePath;
|
|
3294
|
-
newData[head] = updateNestedDataByPath(newData[head], tail, value);
|
|
3295
|
-
return newData;
|
|
3296
|
-
}
|
|
3297
|
-
return oldData;
|
|
3298
|
-
};
|
|
3299
|
-
var deleteNestedDataByPath = (oldData, deletePath) => {
|
|
3300
|
-
if (oldData instanceof Map) {
|
|
3301
|
-
const newData = new Map(oldData);
|
|
3302
|
-
if (deletePath.length === 1) {
|
|
3303
|
-
newData.delete(deletePath[0]);
|
|
3304
|
-
return newData;
|
|
3305
|
-
}
|
|
3306
|
-
const [head, ...tail] = deletePath;
|
|
3307
|
-
newData.set(head, deleteNestedDataByPath(newData.get(head), tail));
|
|
3308
|
-
return newData;
|
|
3309
|
-
}
|
|
3310
|
-
if (oldData instanceof Set) {
|
|
3311
|
-
const setAsArray = deleteNestedDataByPath(Array.from(oldData), deletePath);
|
|
3312
|
-
return new Set(setAsArray);
|
|
3313
|
-
}
|
|
3314
|
-
if (Array.isArray(oldData)) {
|
|
3315
|
-
const newData = [...oldData];
|
|
3316
|
-
if (deletePath.length === 1) {
|
|
3317
|
-
return newData.filter((_, idx) => idx.toString() !== deletePath[0]);
|
|
3318
|
-
}
|
|
3319
|
-
const [head, ...tail] = deletePath;
|
|
3320
|
-
newData[head] = deleteNestedDataByPath(newData[head], tail);
|
|
3321
|
-
return newData;
|
|
3322
|
-
}
|
|
3323
|
-
if (oldData instanceof Object) {
|
|
3324
|
-
const newData = {
|
|
3325
|
-
...oldData
|
|
3326
|
-
};
|
|
3327
|
-
if (deletePath.length === 1) {
|
|
3328
|
-
delete newData[deletePath[0]];
|
|
3329
|
-
return newData;
|
|
3330
|
-
}
|
|
3331
|
-
const [head, ...tail] = deletePath;
|
|
3332
|
-
newData[head] = deleteNestedDataByPath(newData[head], tail);
|
|
3333
|
-
return newData;
|
|
3334
|
-
}
|
|
3335
|
-
return oldData;
|
|
3336
|
-
};
|
|
3337
|
-
var setupStyleSheet = (nonce, target) => {
|
|
3338
|
-
if (!nonce)
|
|
3339
|
-
return;
|
|
3340
|
-
const styleExists = document.querySelector("#_goober") || target?.querySelector("#_goober");
|
|
3341
|
-
if (styleExists)
|
|
3342
|
-
return;
|
|
3343
|
-
const styleTag = document.createElement("style");
|
|
3344
|
-
const textNode = document.createTextNode("");
|
|
3345
|
-
styleTag.appendChild(textNode);
|
|
3346
|
-
styleTag.id = "_goober";
|
|
3347
|
-
styleTag.setAttribute("nonce", nonce);
|
|
3348
|
-
if (target) {
|
|
3349
|
-
target.appendChild(styleTag);
|
|
3350
|
-
} else {
|
|
3351
|
-
document.head.appendChild(styleTag);
|
|
3352
|
-
}
|
|
3353
|
-
};
|
|
3354
|
-
|
|
3355
|
-
// src/index.tsx
|
|
3356
|
-
var TanstackQueryDevtools = class {
|
|
3357
|
-
#client;
|
|
3358
|
-
#onlineManager;
|
|
3359
|
-
#queryFlavor;
|
|
3360
|
-
#version;
|
|
3361
|
-
#isMounted = false;
|
|
3362
|
-
#styleNonce;
|
|
3363
|
-
#shadowDOMTarget;
|
|
3364
|
-
#buttonPosition;
|
|
3365
|
-
#position;
|
|
3366
|
-
#initialIsOpen;
|
|
3367
|
-
#errorTypes;
|
|
3368
|
-
#Component;
|
|
3369
|
-
#dispose;
|
|
3370
|
-
constructor(config) {
|
|
3371
|
-
const {
|
|
3372
|
-
client,
|
|
3373
|
-
queryFlavor,
|
|
3374
|
-
version,
|
|
3375
|
-
onlineManager,
|
|
3376
|
-
buttonPosition,
|
|
3377
|
-
position,
|
|
3378
|
-
initialIsOpen,
|
|
3379
|
-
errorTypes,
|
|
3380
|
-
styleNonce,
|
|
3381
|
-
shadowDOMTarget
|
|
3382
|
-
} = config;
|
|
3383
|
-
this.#client = createSignal(client);
|
|
3384
|
-
this.#queryFlavor = queryFlavor;
|
|
3385
|
-
this.#version = version;
|
|
3386
|
-
this.#onlineManager = onlineManager;
|
|
3387
|
-
this.#styleNonce = styleNonce;
|
|
3388
|
-
this.#shadowDOMTarget = shadowDOMTarget;
|
|
3389
|
-
this.#buttonPosition = createSignal(buttonPosition);
|
|
3390
|
-
this.#position = createSignal(position);
|
|
3391
|
-
this.#initialIsOpen = createSignal(initialIsOpen);
|
|
3392
|
-
this.#errorTypes = createSignal(errorTypes);
|
|
3393
|
-
}
|
|
3394
|
-
setButtonPosition(position) {
|
|
3395
|
-
this.#buttonPosition[1](position);
|
|
3396
|
-
}
|
|
3397
|
-
setPosition(position) {
|
|
3398
|
-
this.#position[1](position);
|
|
3399
|
-
}
|
|
3400
|
-
setInitialIsOpen(isOpen) {
|
|
3401
|
-
this.#initialIsOpen[1](isOpen);
|
|
3402
|
-
}
|
|
3403
|
-
setErrorTypes(errorTypes) {
|
|
3404
|
-
this.#errorTypes[1](errorTypes);
|
|
3405
|
-
}
|
|
3406
|
-
setClient(client) {
|
|
3407
|
-
this.#client[1](client);
|
|
3408
|
-
}
|
|
3409
|
-
mount(el) {
|
|
3410
|
-
if (this.#isMounted) {
|
|
3411
|
-
throw new Error("Devtools is already mounted");
|
|
3412
|
-
}
|
|
3413
|
-
const dispose = render(() => {
|
|
3414
|
-
const _self$ = this;
|
|
3415
|
-
const [btnPosition] = this.#buttonPosition;
|
|
3416
|
-
const [pos] = this.#position;
|
|
3417
|
-
const [isOpen] = this.#initialIsOpen;
|
|
3418
|
-
const [errors] = this.#errorTypes;
|
|
3419
|
-
const [queryClient] = this.#client;
|
|
3420
|
-
let Devtools;
|
|
3421
|
-
if (this.#Component) {
|
|
3422
|
-
Devtools = this.#Component;
|
|
3423
|
-
} else {
|
|
3424
|
-
Devtools = lazy(() => Promise.resolve().then(function () { return require('./U2TDTBMY-e2fad970.js'); }));
|
|
3425
|
-
this.#Component = Devtools;
|
|
3426
|
-
}
|
|
3427
|
-
setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
|
|
3428
|
-
return createComponent(Devtools, mergeProps({
|
|
3429
|
-
get queryFlavor() {
|
|
3430
|
-
return _self$.#queryFlavor;
|
|
3431
|
-
},
|
|
3432
|
-
get version() {
|
|
3433
|
-
return _self$.#version;
|
|
3434
|
-
},
|
|
3435
|
-
get onlineManager() {
|
|
3436
|
-
return _self$.#onlineManager;
|
|
3437
|
-
},
|
|
3438
|
-
get shadowDOMTarget() {
|
|
3439
|
-
return _self$.#shadowDOMTarget;
|
|
3440
|
-
}
|
|
3441
|
-
}, {
|
|
3442
|
-
get client() {
|
|
3443
|
-
return queryClient();
|
|
3444
|
-
},
|
|
3445
|
-
get buttonPosition() {
|
|
3446
|
-
return btnPosition();
|
|
3447
|
-
},
|
|
3448
|
-
get position() {
|
|
3449
|
-
return pos();
|
|
3450
|
-
},
|
|
3451
|
-
get initialIsOpen() {
|
|
3452
|
-
return isOpen();
|
|
3453
|
-
},
|
|
3454
|
-
get errorTypes() {
|
|
3455
|
-
return errors();
|
|
3456
|
-
}
|
|
3457
|
-
}));
|
|
3458
|
-
}, el);
|
|
3459
|
-
this.#isMounted = true;
|
|
3460
|
-
this.#dispose = dispose;
|
|
3461
|
-
}
|
|
3462
|
-
unmount() {
|
|
3463
|
-
if (!this.#isMounted) {
|
|
3464
|
-
throw new Error("Devtools is not mounted");
|
|
3465
|
-
}
|
|
3466
|
-
this.#dispose?.();
|
|
3467
|
-
this.#isMounted = false;
|
|
3468
|
-
}
|
|
3469
|
-
};
|
|
3470
|
-
|
|
3471
|
-
function ReactQueryDevtools(props) {
|
|
3472
|
-
const queryClient = utils.useQueryClient(props.client);
|
|
3473
|
-
const ref = React__namespace.useRef(null);
|
|
3474
|
-
const {
|
|
3475
|
-
buttonPosition,
|
|
3476
|
-
position,
|
|
3477
|
-
initialIsOpen,
|
|
3478
|
-
errorTypes,
|
|
3479
|
-
styleNonce,
|
|
3480
|
-
shadowDOMTarget
|
|
3481
|
-
} = props;
|
|
3482
|
-
const [devtools] = React__namespace.useState(
|
|
3483
|
-
new TanstackQueryDevtools({
|
|
3484
|
-
client: queryClient,
|
|
3485
|
-
queryFlavor: "React Query",
|
|
3486
|
-
version: "5",
|
|
3487
|
-
onlineManager: utils.onlineManager,
|
|
3488
|
-
buttonPosition,
|
|
3489
|
-
position,
|
|
3490
|
-
initialIsOpen,
|
|
3491
|
-
errorTypes,
|
|
3492
|
-
styleNonce,
|
|
3493
|
-
shadowDOMTarget
|
|
3494
|
-
})
|
|
3495
|
-
);
|
|
3496
|
-
React__namespace.useEffect(() => {
|
|
3497
|
-
devtools.setClient(queryClient);
|
|
3498
|
-
}, [queryClient, devtools]);
|
|
3499
|
-
React__namespace.useEffect(() => {
|
|
3500
|
-
if (buttonPosition) {
|
|
3501
|
-
devtools.setButtonPosition(buttonPosition);
|
|
3502
|
-
}
|
|
3503
|
-
}, [buttonPosition, devtools]);
|
|
3504
|
-
React__namespace.useEffect(() => {
|
|
3505
|
-
if (position) {
|
|
3506
|
-
devtools.setPosition(position);
|
|
3507
|
-
}
|
|
3508
|
-
}, [position, devtools]);
|
|
3509
|
-
React__namespace.useEffect(() => {
|
|
3510
|
-
devtools.setInitialIsOpen(initialIsOpen || false);
|
|
3511
|
-
}, [initialIsOpen, devtools]);
|
|
3512
|
-
React__namespace.useEffect(() => {
|
|
3513
|
-
devtools.setErrorTypes(errorTypes || []);
|
|
3514
|
-
}, [errorTypes, devtools]);
|
|
3515
|
-
React__namespace.useEffect(() => {
|
|
3516
|
-
if (ref.current) {
|
|
3517
|
-
devtools.mount(ref.current);
|
|
3518
|
-
}
|
|
3519
|
-
return () => {
|
|
3520
|
-
devtools.unmount();
|
|
3521
|
-
};
|
|
3522
|
-
}, [devtools]);
|
|
3523
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsqd-parent-container", ref });
|
|
3524
|
-
}
|
|
3525
|
-
|
|
3526
|
-
var ReactQueryDevtools2 = process.env.NODE_ENV !== "development" ? function() {
|
|
3527
|
-
return null;
|
|
3528
|
-
} : ReactQueryDevtools;
|
|
3529
|
-
|
|
3530
|
-
/* eslint-disable @bigbinary/neeto/api-connector-name-should-match-filename */
|
|
3531
|
-
const queryClient = new QueryClient({
|
|
3532
|
-
queryCache: new QueryCache(),
|
|
3533
|
-
defaultOptions: {
|
|
3534
|
-
queries: {
|
|
3535
|
-
staleTime: constants.DEFAULT_STALE_TIME,
|
|
3536
|
-
placeholderData: utils.keepPreviousData
|
|
3537
|
-
}
|
|
3538
|
-
}
|
|
3539
|
-
});
|
|
3540
|
-
|
|
3541
|
-
/* eslint-disable sonarjs/prefer-immediate-return */
|
|
3542
|
-
const withReactQuery = Component => {
|
|
3543
|
-
const QueryWrapper = props => /*#__PURE__*/React__default["default"].createElement(utils.QueryClientProvider, {
|
|
3544
|
-
client: queryClient
|
|
3545
|
-
}, /*#__PURE__*/React__default["default"].createElement(Component, props), /*#__PURE__*/React__default["default"].createElement(ReactQueryDevtools2, {
|
|
3546
|
-
initialIsOpen: false,
|
|
3547
|
-
position: "bottom"
|
|
3548
|
-
}));
|
|
3549
|
-
return QueryWrapper;
|
|
3550
|
-
};
|
|
3551
|
-
|
|
3552
|
-
const processSortProperties = sortProperties => {
|
|
3553
|
-
if (sortProperties.sortBy === "payment_amount") {
|
|
3554
|
-
return ramda.assoc("sortBy", "neeto_payments_engine_stripe_transactions.amount", sortProperties);
|
|
3555
|
-
}
|
|
3556
|
-
if (sortProperties.sortBy === "email" || sortProperties.sortBy === "first_name") {
|
|
3557
|
-
return ramda.modify("sortBy", ramda.concat("users."), sortProperties);
|
|
3558
|
-
}
|
|
3559
|
-
if (sortProperties.sortBy === "payable,ends_at") {
|
|
3560
|
-
return ramda.assoc("sortBy", "bookings.ends_at", sortProperties);
|
|
3561
|
-
}
|
|
3562
|
-
return sortProperties;
|
|
3563
|
-
};
|
|
3564
|
-
const buildDefaultPageProperties = tabs => tabs.reduce((pageProperties, tab) => ({
|
|
3565
|
-
...pageProperties,
|
|
3566
|
-
[tab]: constants$1.DEFAULT_PAGE_VALUES
|
|
3567
|
-
}), {});
|
|
3568
|
-
const buildPayload = _ref => {
|
|
3569
|
-
let {
|
|
3570
|
-
tab,
|
|
3571
|
-
filters,
|
|
3572
|
-
pageProperties,
|
|
3573
|
-
sortProperties = {},
|
|
3574
|
-
payoutId = null
|
|
3575
|
-
} = _ref;
|
|
3576
|
-
return {
|
|
3577
|
-
tab: neetoCist.camelToSnakeCase(tab),
|
|
3578
|
-
payoutId,
|
|
3579
|
-
page: pageProperties[tab]?.page,
|
|
3580
|
-
pageSize: pageProperties[tab]?.pageSize,
|
|
3581
|
-
filters,
|
|
3582
|
-
...processSortProperties(sortProperties)
|
|
3583
|
-
};
|
|
3584
|
-
};
|
|
3585
|
-
const buildRowData = _ref2 => {
|
|
3586
|
-
let {
|
|
3587
|
-
data,
|
|
3588
|
-
pageProperties = {},
|
|
3589
|
-
tab = "all"
|
|
3590
|
-
} = _ref2;
|
|
3591
|
-
return data.map((element, index) => ({
|
|
3592
|
-
...element,
|
|
3593
|
-
payable: element.payable,
|
|
3594
|
-
identifier: element,
|
|
3595
|
-
id: ramda.isEmpty(pageProperties) ? index + 1 : pageProperties[tab]?.pageSize * (pageProperties[tab]?.page - 1) + index + 1
|
|
3596
|
-
}));
|
|
3597
|
-
};
|
|
3598
|
-
|
|
3599
|
-
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
3600
|
-
|
|
3601
|
-
var css = ".ant-table-cell-row-hover .identifier-copy-button{visibility:visible!important}";
|
|
3602
|
-
n(css,{});
|
|
3603
|
-
|
|
3604
|
-
const CopyButtonWrapper = _ref => {
|
|
3605
|
-
let {
|
|
3606
|
-
content,
|
|
3607
|
-
children
|
|
3608
|
-
} = _ref;
|
|
3609
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3610
|
-
className: "flex items-center space-x-2"
|
|
3611
|
-
}, children, neetoCist.isPresent(content) && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3612
|
-
className: "identifier-copy-button invisible"
|
|
3613
|
-
}, /*#__PURE__*/React__default["default"].createElement(CopyToClipboardButton__default["default"], {
|
|
3614
|
-
size: "small",
|
|
3615
|
-
style: "text",
|
|
3616
|
-
value: content
|
|
3617
|
-
})));
|
|
3618
|
-
};
|
|
3619
|
-
|
|
3620
|
-
const getTagStyle = status => constants$1.TAG_STYLE[status] || constants$1.DEFAULT_TAG_STYLE;
|
|
3621
|
-
const preProcessStatus = function (type, status) {
|
|
3622
|
-
let record = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
3623
|
-
if (type === "transaction" || type === "payment") {
|
|
3624
|
-
return record.isRefunded ? "refunded" : status;
|
|
3625
|
-
}
|
|
3626
|
-
if (status === "voided") {
|
|
3627
|
-
return "incomplete";
|
|
3628
|
-
}
|
|
3629
|
-
return neetoCist.snakeToCamelCase(status);
|
|
3630
|
-
};
|
|
3631
|
-
const renderStatus = ramda.curry((type, status, record) => {
|
|
3632
|
-
const processedStatus = preProcessStatus(type, status, record);
|
|
3633
|
-
return /*#__PURE__*/React__default["default"].createElement(Tooltip__default["default"], {
|
|
3634
|
-
content: i18next.t(`neetoPayments.tooltipContent.${type}.${processedStatus}`),
|
|
3635
|
-
position: "top"
|
|
3636
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3637
|
-
className: "w-fit"
|
|
3638
|
-
}, /*#__PURE__*/React__default["default"].createElement(Tag__default["default"], {
|
|
3639
|
-
label: i18next.t(`neetoPayments.tagLabels.${type}.${processedStatus}`),
|
|
3640
|
-
style: getTagStyle(processedStatus)
|
|
3641
|
-
})));
|
|
3642
|
-
});
|
|
3643
|
-
const renderFullName = (_, _ref) => {
|
|
3644
|
-
let {
|
|
3645
|
-
firstName,
|
|
3646
|
-
lastName
|
|
3647
|
-
} = _ref;
|
|
3648
|
-
return `${firstName} ${lastName}`;
|
|
3649
|
-
};
|
|
3650
|
-
const renderEmail = email => /*#__PURE__*/React__default["default"].createElement(CopyButtonWrapper, {
|
|
3651
|
-
content: email
|
|
3652
|
-
}, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
|
|
3653
|
-
href: `mailto:${email}`,
|
|
3654
|
-
label: email,
|
|
3655
|
-
style: "link"
|
|
3656
|
-
}));
|
|
3657
|
-
const renderDate = date => /*#__PURE__*/React__default["default"].createElement(DateFormat__default["default"].DateTime, {
|
|
3658
|
-
date
|
|
3659
|
-
});
|
|
3660
|
-
|
|
3661
|
-
exports.$TRACK = $TRACK;
|
|
3662
|
-
exports.CopyButtonWrapper = CopyButtonWrapper;
|
|
3663
|
-
exports.Dynamic = Dynamic;
|
|
3664
|
-
exports.For = For;
|
|
3665
|
-
exports.Index = Index;
|
|
3666
|
-
exports.Match = Match;
|
|
3667
|
-
exports.Portal = Portal;
|
|
3668
|
-
exports.Show = Show;
|
|
3669
|
-
exports.Switch = Switch;
|
|
3670
|
-
exports.addEventListener = addEventListener;
|
|
3671
|
-
exports.batch = batch;
|
|
3672
|
-
exports.buildDefaultPageProperties = buildDefaultPageProperties;
|
|
3673
|
-
exports.buildPayload = buildPayload;
|
|
3674
|
-
exports.buildRowData = buildRowData;
|
|
3675
|
-
exports.className = className;
|
|
3676
|
-
exports.clearDelegatedEvents = clearDelegatedEvents;
|
|
3677
|
-
exports.convertRemToPixels = convertRemToPixels;
|
|
3678
|
-
exports.createComponent = createComponent;
|
|
3679
|
-
exports.createComputed = createComputed;
|
|
3680
|
-
exports.createContext = createContext;
|
|
3681
|
-
exports.createEffect = createEffect;
|
|
3682
|
-
exports.createMemo = createMemo;
|
|
3683
|
-
exports.createRenderEffect = createRenderEffect;
|
|
3684
|
-
exports.createRoot = createRoot;
|
|
3685
|
-
exports.createSignal = createSignal;
|
|
3686
|
-
exports.createUniqueId = createUniqueId;
|
|
3687
|
-
exports.delegateEvents = delegateEvents;
|
|
3688
|
-
exports.deleteNestedDataByPath = deleteNestedDataByPath;
|
|
3689
|
-
exports.displayValue = displayValue;
|
|
3690
|
-
exports.getMutationStatusColor = getMutationStatusColor;
|
|
3691
|
-
exports.getPreferredColorScheme = getPreferredColorScheme;
|
|
3692
|
-
exports.getQueryStatusColor = getQueryStatusColor;
|
|
3693
|
-
exports.getQueryStatusColorByLabel = getQueryStatusColorByLabel;
|
|
3694
|
-
exports.getQueryStatusLabel = getQueryStatusLabel;
|
|
3695
|
-
exports.getSidedProp = getSidedProp;
|
|
3696
|
-
exports.insert = insert;
|
|
3697
|
-
exports.mergeProps = mergeProps;
|
|
3698
|
-
exports.mutationSortFns = mutationSortFns;
|
|
3699
|
-
exports.n = n;
|
|
3700
|
-
exports.on = on;
|
|
3701
|
-
exports.onCleanup = onCleanup;
|
|
3702
|
-
exports.onMount = onMount;
|
|
3703
|
-
exports.renderDate = renderDate;
|
|
3704
|
-
exports.renderEmail = renderEmail;
|
|
3705
|
-
exports.renderFullName = renderFullName;
|
|
3706
|
-
exports.renderStatus = renderStatus;
|
|
3707
|
-
exports.setAttribute = setAttribute;
|
|
3708
|
-
exports.sortFns = sortFns;
|
|
3709
|
-
exports.splitProps = splitProps;
|
|
3710
|
-
exports.spread = spread;
|
|
3711
|
-
exports.stringify = stringify;
|
|
3712
|
-
exports.template = template;
|
|
3713
|
-
exports.untrack = untrack;
|
|
3714
|
-
exports.updateNestedDataByPath = updateNestedDataByPath;
|
|
3715
|
-
exports.use = use;
|
|
3716
|
-
exports.useContext = useContext;
|
|
3717
|
-
exports.useTransition = useTransition;
|
|
3718
|
-
exports.withReactQuery = withReactQuery;
|
|
3719
|
-
//# sourceMappingURL=renderFunctions-398d3fb5.js.map
|