@tanstack/query-devtools 5.4.2 → 5.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Devtools/{KWB27UDF.jsx → G2DL2NKW.jsx} +30 -1208
- package/build/Devtools/{HESZYUBG.js → G2MVXYID.js} +16 -1200
- package/build/Devtools/{7FRXYIEA.jsx → RGHE4TS2.jsx} +29 -1210
- package/build/Devtools/{MVUALMJ4.js → VZTWBJH5.js} +16 -1201
- package/build/chunk/{Z53XT47W.js → 2CFRQNPI.js} +1200 -3
- package/build/chunk/3V52ZCRQ.js +3231 -0
- package/build/chunk/{JRAMSUCV.jsx → MJH6GUJH.jsx} +1222 -3
- package/build/chunk/SPPEWFNK.jsx +3295 -0
- package/build/dev.cjs +9913 -9895
- package/build/dev.js +7 -3
- package/build/dev.jsx +9 -4
- package/build/index.cjs +9912 -9894
- package/build/index.d.cts +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +7 -3
- package/build/index.jsx +9 -4
- package/package.json +4 -4
- package/src/index.tsx +8 -2
- package/src/utils.tsx +14 -0
|
@@ -277,12 +277,12 @@ function untrack(fn) {
|
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
function on(deps, fn, options) {
|
|
280
|
-
const
|
|
280
|
+
const isArray3 = Array.isArray(deps);
|
|
281
281
|
let prevInput;
|
|
282
282
|
let defer = options && options.defer;
|
|
283
283
|
return (prevValue) => {
|
|
284
284
|
let input;
|
|
285
|
-
if (
|
|
285
|
+
if (isArray3) {
|
|
286
286
|
input = Array(deps.length);
|
|
287
287
|
for (let i = 0; i < deps.length; i++)
|
|
288
288
|
input[i] = deps[i]();
|
|
@@ -2032,6 +2032,1211 @@ function Dynamic(props) {
|
|
|
2032
2032
|
});
|
|
2033
2033
|
}
|
|
2034
2034
|
|
|
2035
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/double-indexed-kv.js
|
|
2036
|
+
var DoubleIndexedKV = (
|
|
2037
|
+
/** @class */
|
|
2038
|
+
function() {
|
|
2039
|
+
function DoubleIndexedKV2() {
|
|
2040
|
+
this.keyToValue = /* @__PURE__ */ new Map();
|
|
2041
|
+
this.valueToKey = /* @__PURE__ */ new Map();
|
|
2042
|
+
}
|
|
2043
|
+
DoubleIndexedKV2.prototype.set = function(key, value) {
|
|
2044
|
+
this.keyToValue.set(key, value);
|
|
2045
|
+
this.valueToKey.set(value, key);
|
|
2046
|
+
};
|
|
2047
|
+
DoubleIndexedKV2.prototype.getByKey = function(key) {
|
|
2048
|
+
return this.keyToValue.get(key);
|
|
2049
|
+
};
|
|
2050
|
+
DoubleIndexedKV2.prototype.getByValue = function(value) {
|
|
2051
|
+
return this.valueToKey.get(value);
|
|
2052
|
+
};
|
|
2053
|
+
DoubleIndexedKV2.prototype.clear = function() {
|
|
2054
|
+
this.keyToValue.clear();
|
|
2055
|
+
this.valueToKey.clear();
|
|
2056
|
+
};
|
|
2057
|
+
return DoubleIndexedKV2;
|
|
2058
|
+
}()
|
|
2059
|
+
);
|
|
2060
|
+
|
|
2061
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/registry.js
|
|
2062
|
+
var Registry = (
|
|
2063
|
+
/** @class */
|
|
2064
|
+
function() {
|
|
2065
|
+
function Registry2(generateIdentifier) {
|
|
2066
|
+
this.generateIdentifier = generateIdentifier;
|
|
2067
|
+
this.kv = new DoubleIndexedKV();
|
|
2068
|
+
}
|
|
2069
|
+
Registry2.prototype.register = function(value, identifier) {
|
|
2070
|
+
if (this.kv.getByValue(value)) {
|
|
2071
|
+
return;
|
|
2072
|
+
}
|
|
2073
|
+
if (!identifier) {
|
|
2074
|
+
identifier = this.generateIdentifier(value);
|
|
2075
|
+
}
|
|
2076
|
+
this.kv.set(identifier, value);
|
|
2077
|
+
};
|
|
2078
|
+
Registry2.prototype.clear = function() {
|
|
2079
|
+
this.kv.clear();
|
|
2080
|
+
};
|
|
2081
|
+
Registry2.prototype.getIdentifier = function(value) {
|
|
2082
|
+
return this.kv.getByValue(value);
|
|
2083
|
+
};
|
|
2084
|
+
Registry2.prototype.getValue = function(identifier) {
|
|
2085
|
+
return this.kv.getByKey(identifier);
|
|
2086
|
+
};
|
|
2087
|
+
return Registry2;
|
|
2088
|
+
}()
|
|
2089
|
+
);
|
|
2090
|
+
|
|
2091
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/class-registry.js
|
|
2092
|
+
var __extends = function() {
|
|
2093
|
+
var extendStatics = function(d, b) {
|
|
2094
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
2095
|
+
d2.__proto__ = b2;
|
|
2096
|
+
} || function(d2, b2) {
|
|
2097
|
+
for (var p in b2)
|
|
2098
|
+
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
2099
|
+
d2[p] = b2[p];
|
|
2100
|
+
};
|
|
2101
|
+
return extendStatics(d, b);
|
|
2102
|
+
};
|
|
2103
|
+
return function(d, b) {
|
|
2104
|
+
if (typeof b !== "function" && b !== null)
|
|
2105
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2106
|
+
extendStatics(d, b);
|
|
2107
|
+
function __() {
|
|
2108
|
+
this.constructor = d;
|
|
2109
|
+
}
|
|
2110
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2111
|
+
};
|
|
2112
|
+
}();
|
|
2113
|
+
var ClassRegistry = (
|
|
2114
|
+
/** @class */
|
|
2115
|
+
function(_super) {
|
|
2116
|
+
__extends(ClassRegistry2, _super);
|
|
2117
|
+
function ClassRegistry2() {
|
|
2118
|
+
var _this = _super.call(this, function(c) {
|
|
2119
|
+
return c.name;
|
|
2120
|
+
}) || this;
|
|
2121
|
+
_this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
2122
|
+
return _this;
|
|
2123
|
+
}
|
|
2124
|
+
ClassRegistry2.prototype.register = function(value, options) {
|
|
2125
|
+
if (typeof options === "object") {
|
|
2126
|
+
if (options.allowProps) {
|
|
2127
|
+
this.classToAllowedProps.set(value, options.allowProps);
|
|
2128
|
+
}
|
|
2129
|
+
_super.prototype.register.call(this, value, options.identifier);
|
|
2130
|
+
} else {
|
|
2131
|
+
_super.prototype.register.call(this, value, options);
|
|
2132
|
+
}
|
|
2133
|
+
};
|
|
2134
|
+
ClassRegistry2.prototype.getAllowedProps = function(value) {
|
|
2135
|
+
return this.classToAllowedProps.get(value);
|
|
2136
|
+
};
|
|
2137
|
+
return ClassRegistry2;
|
|
2138
|
+
}(Registry)
|
|
2139
|
+
);
|
|
2140
|
+
|
|
2141
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/util.js
|
|
2142
|
+
var __read = function(o, n) {
|
|
2143
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2144
|
+
if (!m)
|
|
2145
|
+
return o;
|
|
2146
|
+
var i = m.call(o), r, ar = [], e;
|
|
2147
|
+
try {
|
|
2148
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
2149
|
+
ar.push(r.value);
|
|
2150
|
+
} catch (error) {
|
|
2151
|
+
e = { error };
|
|
2152
|
+
} finally {
|
|
2153
|
+
try {
|
|
2154
|
+
if (r && !r.done && (m = i["return"]))
|
|
2155
|
+
m.call(i);
|
|
2156
|
+
} finally {
|
|
2157
|
+
if (e)
|
|
2158
|
+
throw e.error;
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
return ar;
|
|
2162
|
+
};
|
|
2163
|
+
function valuesOfObj(record) {
|
|
2164
|
+
if ("values" in Object) {
|
|
2165
|
+
return Object.values(record);
|
|
2166
|
+
}
|
|
2167
|
+
var values = [];
|
|
2168
|
+
for (var key in record) {
|
|
2169
|
+
if (record.hasOwnProperty(key)) {
|
|
2170
|
+
values.push(record[key]);
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
return values;
|
|
2174
|
+
}
|
|
2175
|
+
function find(record, predicate) {
|
|
2176
|
+
var values = valuesOfObj(record);
|
|
2177
|
+
if ("find" in values) {
|
|
2178
|
+
return values.find(predicate);
|
|
2179
|
+
}
|
|
2180
|
+
var valuesNotNever = values;
|
|
2181
|
+
for (var i = 0; i < valuesNotNever.length; i++) {
|
|
2182
|
+
var value = valuesNotNever[i];
|
|
2183
|
+
if (predicate(value)) {
|
|
2184
|
+
return value;
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
return void 0;
|
|
2188
|
+
}
|
|
2189
|
+
function forEach(record, run) {
|
|
2190
|
+
Object.entries(record).forEach(function(_a) {
|
|
2191
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
2192
|
+
return run(value, key);
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
function includes(arr, value) {
|
|
2196
|
+
return arr.indexOf(value) !== -1;
|
|
2197
|
+
}
|
|
2198
|
+
function findArr(record, predicate) {
|
|
2199
|
+
for (var i = 0; i < record.length; i++) {
|
|
2200
|
+
var value = record[i];
|
|
2201
|
+
if (predicate(value)) {
|
|
2202
|
+
return value;
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
return void 0;
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/custom-transformer-registry.js
|
|
2209
|
+
var CustomTransformerRegistry = (
|
|
2210
|
+
/** @class */
|
|
2211
|
+
function() {
|
|
2212
|
+
function CustomTransformerRegistry2() {
|
|
2213
|
+
this.transfomers = {};
|
|
2214
|
+
}
|
|
2215
|
+
CustomTransformerRegistry2.prototype.register = function(transformer) {
|
|
2216
|
+
this.transfomers[transformer.name] = transformer;
|
|
2217
|
+
};
|
|
2218
|
+
CustomTransformerRegistry2.prototype.findApplicable = function(v) {
|
|
2219
|
+
return find(this.transfomers, function(transformer) {
|
|
2220
|
+
return transformer.isApplicable(v);
|
|
2221
|
+
});
|
|
2222
|
+
};
|
|
2223
|
+
CustomTransformerRegistry2.prototype.findByName = function(name) {
|
|
2224
|
+
return this.transfomers[name];
|
|
2225
|
+
};
|
|
2226
|
+
return CustomTransformerRegistry2;
|
|
2227
|
+
}()
|
|
2228
|
+
);
|
|
2229
|
+
|
|
2230
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/is.js
|
|
2231
|
+
var getType = function(payload) {
|
|
2232
|
+
return Object.prototype.toString.call(payload).slice(8, -1);
|
|
2233
|
+
};
|
|
2234
|
+
var isUndefined = function(payload) {
|
|
2235
|
+
return typeof payload === "undefined";
|
|
2236
|
+
};
|
|
2237
|
+
var isNull = function(payload) {
|
|
2238
|
+
return payload === null;
|
|
2239
|
+
};
|
|
2240
|
+
var isPlainObject = function(payload) {
|
|
2241
|
+
if (typeof payload !== "object" || payload === null)
|
|
2242
|
+
return false;
|
|
2243
|
+
if (payload === Object.prototype)
|
|
2244
|
+
return false;
|
|
2245
|
+
if (Object.getPrototypeOf(payload) === null)
|
|
2246
|
+
return true;
|
|
2247
|
+
return Object.getPrototypeOf(payload) === Object.prototype;
|
|
2248
|
+
};
|
|
2249
|
+
var isEmptyObject = function(payload) {
|
|
2250
|
+
return isPlainObject(payload) && Object.keys(payload).length === 0;
|
|
2251
|
+
};
|
|
2252
|
+
var isArray = function(payload) {
|
|
2253
|
+
return Array.isArray(payload);
|
|
2254
|
+
};
|
|
2255
|
+
var isString = function(payload) {
|
|
2256
|
+
return typeof payload === "string";
|
|
2257
|
+
};
|
|
2258
|
+
var isNumber = function(payload) {
|
|
2259
|
+
return typeof payload === "number" && !isNaN(payload);
|
|
2260
|
+
};
|
|
2261
|
+
var isBoolean = function(payload) {
|
|
2262
|
+
return typeof payload === "boolean";
|
|
2263
|
+
};
|
|
2264
|
+
var isRegExp = function(payload) {
|
|
2265
|
+
return payload instanceof RegExp;
|
|
2266
|
+
};
|
|
2267
|
+
var isMap = function(payload) {
|
|
2268
|
+
return payload instanceof Map;
|
|
2269
|
+
};
|
|
2270
|
+
var isSet = function(payload) {
|
|
2271
|
+
return payload instanceof Set;
|
|
2272
|
+
};
|
|
2273
|
+
var isSymbol = function(payload) {
|
|
2274
|
+
return getType(payload) === "Symbol";
|
|
2275
|
+
};
|
|
2276
|
+
var isDate = function(payload) {
|
|
2277
|
+
return payload instanceof Date && !isNaN(payload.valueOf());
|
|
2278
|
+
};
|
|
2279
|
+
var isError = function(payload) {
|
|
2280
|
+
return payload instanceof Error;
|
|
2281
|
+
};
|
|
2282
|
+
var isNaNValue = function(payload) {
|
|
2283
|
+
return typeof payload === "number" && isNaN(payload);
|
|
2284
|
+
};
|
|
2285
|
+
var isPrimitive = function(payload) {
|
|
2286
|
+
return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
|
|
2287
|
+
};
|
|
2288
|
+
var isBigint = function(payload) {
|
|
2289
|
+
return typeof payload === "bigint";
|
|
2290
|
+
};
|
|
2291
|
+
var isInfinite = function(payload) {
|
|
2292
|
+
return payload === Infinity || payload === -Infinity;
|
|
2293
|
+
};
|
|
2294
|
+
var isTypedArray = function(payload) {
|
|
2295
|
+
return ArrayBuffer.isView(payload) && !(payload instanceof DataView);
|
|
2296
|
+
};
|
|
2297
|
+
var isURL = function(payload) {
|
|
2298
|
+
return payload instanceof URL;
|
|
2299
|
+
};
|
|
2300
|
+
|
|
2301
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/pathstringifier.js
|
|
2302
|
+
var escapeKey = function(key) {
|
|
2303
|
+
return key.replace(/\./g, "\\.");
|
|
2304
|
+
};
|
|
2305
|
+
var stringifyPath = function(path) {
|
|
2306
|
+
return path.map(String).map(escapeKey).join(".");
|
|
2307
|
+
};
|
|
2308
|
+
var parsePath = function(string) {
|
|
2309
|
+
var result = [];
|
|
2310
|
+
var segment = "";
|
|
2311
|
+
for (var i = 0; i < string.length; i++) {
|
|
2312
|
+
var char = string.charAt(i);
|
|
2313
|
+
var isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
|
|
2314
|
+
if (isEscapedDot) {
|
|
2315
|
+
segment += ".";
|
|
2316
|
+
i++;
|
|
2317
|
+
continue;
|
|
2318
|
+
}
|
|
2319
|
+
var isEndOfSegment = char === ".";
|
|
2320
|
+
if (isEndOfSegment) {
|
|
2321
|
+
result.push(segment);
|
|
2322
|
+
segment = "";
|
|
2323
|
+
continue;
|
|
2324
|
+
}
|
|
2325
|
+
segment += char;
|
|
2326
|
+
}
|
|
2327
|
+
var lastSegment = segment;
|
|
2328
|
+
result.push(lastSegment);
|
|
2329
|
+
return result;
|
|
2330
|
+
};
|
|
2331
|
+
|
|
2332
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/transformer.js
|
|
2333
|
+
var __assign = function() {
|
|
2334
|
+
__assign = Object.assign || function(t) {
|
|
2335
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2336
|
+
s = arguments[i];
|
|
2337
|
+
for (var p in s)
|
|
2338
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
2339
|
+
t[p] = s[p];
|
|
2340
|
+
}
|
|
2341
|
+
return t;
|
|
2342
|
+
};
|
|
2343
|
+
return __assign.apply(this, arguments);
|
|
2344
|
+
};
|
|
2345
|
+
var __read2 = function(o, n) {
|
|
2346
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2347
|
+
if (!m)
|
|
2348
|
+
return o;
|
|
2349
|
+
var i = m.call(o), r, ar = [], e;
|
|
2350
|
+
try {
|
|
2351
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
2352
|
+
ar.push(r.value);
|
|
2353
|
+
} catch (error) {
|
|
2354
|
+
e = { error };
|
|
2355
|
+
} finally {
|
|
2356
|
+
try {
|
|
2357
|
+
if (r && !r.done && (m = i["return"]))
|
|
2358
|
+
m.call(i);
|
|
2359
|
+
} finally {
|
|
2360
|
+
if (e)
|
|
2361
|
+
throw e.error;
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
return ar;
|
|
2365
|
+
};
|
|
2366
|
+
var __spreadArray = function(to, from) {
|
|
2367
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
2368
|
+
to[j] = from[i];
|
|
2369
|
+
return to;
|
|
2370
|
+
};
|
|
2371
|
+
function simpleTransformation(isApplicable, annotation, transform, untransform) {
|
|
2372
|
+
return {
|
|
2373
|
+
isApplicable,
|
|
2374
|
+
annotation,
|
|
2375
|
+
transform,
|
|
2376
|
+
untransform
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2379
|
+
var simpleRules = [
|
|
2380
|
+
simpleTransformation(isUndefined, "undefined", function() {
|
|
2381
|
+
return null;
|
|
2382
|
+
}, function() {
|
|
2383
|
+
return void 0;
|
|
2384
|
+
}),
|
|
2385
|
+
simpleTransformation(isBigint, "bigint", function(v) {
|
|
2386
|
+
return v.toString();
|
|
2387
|
+
}, function(v) {
|
|
2388
|
+
if (typeof BigInt !== "undefined") {
|
|
2389
|
+
return BigInt(v);
|
|
2390
|
+
}
|
|
2391
|
+
return v;
|
|
2392
|
+
}),
|
|
2393
|
+
simpleTransformation(isDate, "Date", function(v) {
|
|
2394
|
+
return v.toISOString();
|
|
2395
|
+
}, function(v) {
|
|
2396
|
+
return new Date(v);
|
|
2397
|
+
}),
|
|
2398
|
+
simpleTransformation(isError, "Error", function(v, superJson) {
|
|
2399
|
+
var baseError = {
|
|
2400
|
+
name: v.name,
|
|
2401
|
+
message: v.message
|
|
2402
|
+
};
|
|
2403
|
+
superJson.allowedErrorProps.forEach(function(prop) {
|
|
2404
|
+
baseError[prop] = v[prop];
|
|
2405
|
+
});
|
|
2406
|
+
return baseError;
|
|
2407
|
+
}, function(v, superJson) {
|
|
2408
|
+
var e = new Error(v.message);
|
|
2409
|
+
e.name = v.name;
|
|
2410
|
+
e.stack = v.stack;
|
|
2411
|
+
superJson.allowedErrorProps.forEach(function(prop) {
|
|
2412
|
+
e[prop] = v[prop];
|
|
2413
|
+
});
|
|
2414
|
+
return e;
|
|
2415
|
+
}),
|
|
2416
|
+
simpleTransformation(isRegExp, "regexp", function(v) {
|
|
2417
|
+
return "" + v;
|
|
2418
|
+
}, function(regex) {
|
|
2419
|
+
var body = regex.slice(1, regex.lastIndexOf("/"));
|
|
2420
|
+
var flags = regex.slice(regex.lastIndexOf("/") + 1);
|
|
2421
|
+
return new RegExp(body, flags);
|
|
2422
|
+
}),
|
|
2423
|
+
simpleTransformation(
|
|
2424
|
+
isSet,
|
|
2425
|
+
"set",
|
|
2426
|
+
// (sets only exist in es6+)
|
|
2427
|
+
// eslint-disable-next-line es5/no-es6-methods
|
|
2428
|
+
function(v) {
|
|
2429
|
+
return __spreadArray([], __read2(v.values()));
|
|
2430
|
+
},
|
|
2431
|
+
function(v) {
|
|
2432
|
+
return new Set(v);
|
|
2433
|
+
}
|
|
2434
|
+
),
|
|
2435
|
+
simpleTransformation(isMap, "map", function(v) {
|
|
2436
|
+
return __spreadArray([], __read2(v.entries()));
|
|
2437
|
+
}, function(v) {
|
|
2438
|
+
return new Map(v);
|
|
2439
|
+
}),
|
|
2440
|
+
simpleTransformation(function(v) {
|
|
2441
|
+
return isNaNValue(v) || isInfinite(v);
|
|
2442
|
+
}, "number", function(v) {
|
|
2443
|
+
if (isNaNValue(v)) {
|
|
2444
|
+
return "NaN";
|
|
2445
|
+
}
|
|
2446
|
+
if (v > 0) {
|
|
2447
|
+
return "Infinity";
|
|
2448
|
+
} else {
|
|
2449
|
+
return "-Infinity";
|
|
2450
|
+
}
|
|
2451
|
+
}, Number),
|
|
2452
|
+
simpleTransformation(function(v) {
|
|
2453
|
+
return v === 0 && 1 / v === -Infinity;
|
|
2454
|
+
}, "number", function() {
|
|
2455
|
+
return "-0";
|
|
2456
|
+
}, Number),
|
|
2457
|
+
simpleTransformation(isURL, "URL", function(v) {
|
|
2458
|
+
return v.toString();
|
|
2459
|
+
}, function(v) {
|
|
2460
|
+
return new URL(v);
|
|
2461
|
+
})
|
|
2462
|
+
];
|
|
2463
|
+
function compositeTransformation(isApplicable, annotation, transform, untransform) {
|
|
2464
|
+
return {
|
|
2465
|
+
isApplicable,
|
|
2466
|
+
annotation,
|
|
2467
|
+
transform,
|
|
2468
|
+
untransform
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2471
|
+
var symbolRule = compositeTransformation(function(s, superJson) {
|
|
2472
|
+
if (isSymbol(s)) {
|
|
2473
|
+
var isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
|
|
2474
|
+
return isRegistered;
|
|
2475
|
+
}
|
|
2476
|
+
return false;
|
|
2477
|
+
}, function(s, superJson) {
|
|
2478
|
+
var identifier = superJson.symbolRegistry.getIdentifier(s);
|
|
2479
|
+
return ["symbol", identifier];
|
|
2480
|
+
}, function(v) {
|
|
2481
|
+
return v.description;
|
|
2482
|
+
}, function(_, a, superJson) {
|
|
2483
|
+
var value = superJson.symbolRegistry.getValue(a[1]);
|
|
2484
|
+
if (!value) {
|
|
2485
|
+
throw new Error("Trying to deserialize unknown symbol");
|
|
2486
|
+
}
|
|
2487
|
+
return value;
|
|
2488
|
+
});
|
|
2489
|
+
var constructorToName = [
|
|
2490
|
+
Int8Array,
|
|
2491
|
+
Uint8Array,
|
|
2492
|
+
Int16Array,
|
|
2493
|
+
Uint16Array,
|
|
2494
|
+
Int32Array,
|
|
2495
|
+
Uint32Array,
|
|
2496
|
+
Float32Array,
|
|
2497
|
+
Float64Array,
|
|
2498
|
+
Uint8ClampedArray
|
|
2499
|
+
].reduce(function(obj, ctor) {
|
|
2500
|
+
obj[ctor.name] = ctor;
|
|
2501
|
+
return obj;
|
|
2502
|
+
}, {});
|
|
2503
|
+
var typedArrayRule = compositeTransformation(isTypedArray, function(v) {
|
|
2504
|
+
return ["typed-array", v.constructor.name];
|
|
2505
|
+
}, function(v) {
|
|
2506
|
+
return __spreadArray([], __read2(v));
|
|
2507
|
+
}, function(v, a) {
|
|
2508
|
+
var ctor = constructorToName[a[1]];
|
|
2509
|
+
if (!ctor) {
|
|
2510
|
+
throw new Error("Trying to deserialize unknown typed array");
|
|
2511
|
+
}
|
|
2512
|
+
return new ctor(v);
|
|
2513
|
+
});
|
|
2514
|
+
function isInstanceOfRegisteredClass(potentialClass, superJson) {
|
|
2515
|
+
if (potentialClass === null || potentialClass === void 0 ? void 0 : potentialClass.constructor) {
|
|
2516
|
+
var isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
|
|
2517
|
+
return isRegistered;
|
|
2518
|
+
}
|
|
2519
|
+
return false;
|
|
2520
|
+
}
|
|
2521
|
+
var classRule = compositeTransformation(isInstanceOfRegisteredClass, function(clazz, superJson) {
|
|
2522
|
+
var identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
|
|
2523
|
+
return ["class", identifier];
|
|
2524
|
+
}, function(clazz, superJson) {
|
|
2525
|
+
var allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
|
|
2526
|
+
if (!allowedProps) {
|
|
2527
|
+
return __assign({}, clazz);
|
|
2528
|
+
}
|
|
2529
|
+
var result = {};
|
|
2530
|
+
allowedProps.forEach(function(prop) {
|
|
2531
|
+
result[prop] = clazz[prop];
|
|
2532
|
+
});
|
|
2533
|
+
return result;
|
|
2534
|
+
}, function(v, a, superJson) {
|
|
2535
|
+
var clazz = superJson.classRegistry.getValue(a[1]);
|
|
2536
|
+
if (!clazz) {
|
|
2537
|
+
throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");
|
|
2538
|
+
}
|
|
2539
|
+
return Object.assign(Object.create(clazz.prototype), v);
|
|
2540
|
+
});
|
|
2541
|
+
var customRule = compositeTransformation(function(value, superJson) {
|
|
2542
|
+
return !!superJson.customTransformerRegistry.findApplicable(value);
|
|
2543
|
+
}, function(value, superJson) {
|
|
2544
|
+
var transformer = superJson.customTransformerRegistry.findApplicable(value);
|
|
2545
|
+
return ["custom", transformer.name];
|
|
2546
|
+
}, function(value, superJson) {
|
|
2547
|
+
var transformer = superJson.customTransformerRegistry.findApplicable(value);
|
|
2548
|
+
return transformer.serialize(value);
|
|
2549
|
+
}, function(v, a, superJson) {
|
|
2550
|
+
var transformer = superJson.customTransformerRegistry.findByName(a[1]);
|
|
2551
|
+
if (!transformer) {
|
|
2552
|
+
throw new Error("Trying to deserialize unknown custom value");
|
|
2553
|
+
}
|
|
2554
|
+
return transformer.deserialize(v);
|
|
2555
|
+
});
|
|
2556
|
+
var compositeRules = [classRule, symbolRule, customRule, typedArrayRule];
|
|
2557
|
+
var transformValue = function(value, superJson) {
|
|
2558
|
+
var applicableCompositeRule = findArr(compositeRules, function(rule) {
|
|
2559
|
+
return rule.isApplicable(value, superJson);
|
|
2560
|
+
});
|
|
2561
|
+
if (applicableCompositeRule) {
|
|
2562
|
+
return {
|
|
2563
|
+
value: applicableCompositeRule.transform(value, superJson),
|
|
2564
|
+
type: applicableCompositeRule.annotation(value, superJson)
|
|
2565
|
+
};
|
|
2566
|
+
}
|
|
2567
|
+
var applicableSimpleRule = findArr(simpleRules, function(rule) {
|
|
2568
|
+
return rule.isApplicable(value, superJson);
|
|
2569
|
+
});
|
|
2570
|
+
if (applicableSimpleRule) {
|
|
2571
|
+
return {
|
|
2572
|
+
value: applicableSimpleRule.transform(value, superJson),
|
|
2573
|
+
type: applicableSimpleRule.annotation
|
|
2574
|
+
};
|
|
2575
|
+
}
|
|
2576
|
+
return void 0;
|
|
2577
|
+
};
|
|
2578
|
+
var simpleRulesByAnnotation = {};
|
|
2579
|
+
simpleRules.forEach(function(rule) {
|
|
2580
|
+
simpleRulesByAnnotation[rule.annotation] = rule;
|
|
2581
|
+
});
|
|
2582
|
+
var untransformValue = function(json, type, superJson) {
|
|
2583
|
+
if (isArray(type)) {
|
|
2584
|
+
switch (type[0]) {
|
|
2585
|
+
case "symbol":
|
|
2586
|
+
return symbolRule.untransform(json, type, superJson);
|
|
2587
|
+
case "class":
|
|
2588
|
+
return classRule.untransform(json, type, superJson);
|
|
2589
|
+
case "custom":
|
|
2590
|
+
return customRule.untransform(json, type, superJson);
|
|
2591
|
+
case "typed-array":
|
|
2592
|
+
return typedArrayRule.untransform(json, type, superJson);
|
|
2593
|
+
default:
|
|
2594
|
+
throw new Error("Unknown transformation: " + type);
|
|
2595
|
+
}
|
|
2596
|
+
} else {
|
|
2597
|
+
var transformation = simpleRulesByAnnotation[type];
|
|
2598
|
+
if (!transformation) {
|
|
2599
|
+
throw new Error("Unknown transformation: " + type);
|
|
2600
|
+
}
|
|
2601
|
+
return transformation.untransform(json, superJson);
|
|
2602
|
+
}
|
|
2603
|
+
};
|
|
2604
|
+
|
|
2605
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/accessDeep.js
|
|
2606
|
+
var getNthKey = function(value, n) {
|
|
2607
|
+
var keys = value.keys();
|
|
2608
|
+
while (n > 0) {
|
|
2609
|
+
keys.next();
|
|
2610
|
+
n--;
|
|
2611
|
+
}
|
|
2612
|
+
return keys.next().value;
|
|
2613
|
+
};
|
|
2614
|
+
function validatePath(path) {
|
|
2615
|
+
if (includes(path, "__proto__")) {
|
|
2616
|
+
throw new Error("__proto__ is not allowed as a property");
|
|
2617
|
+
}
|
|
2618
|
+
if (includes(path, "prototype")) {
|
|
2619
|
+
throw new Error("prototype is not allowed as a property");
|
|
2620
|
+
}
|
|
2621
|
+
if (includes(path, "constructor")) {
|
|
2622
|
+
throw new Error("constructor is not allowed as a property");
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
var getDeep = function(object, path) {
|
|
2626
|
+
validatePath(path);
|
|
2627
|
+
for (var i = 0; i < path.length; i++) {
|
|
2628
|
+
var key = path[i];
|
|
2629
|
+
if (isSet(object)) {
|
|
2630
|
+
object = getNthKey(object, +key);
|
|
2631
|
+
} else if (isMap(object)) {
|
|
2632
|
+
var row = +key;
|
|
2633
|
+
var type = +path[++i] === 0 ? "key" : "value";
|
|
2634
|
+
var keyOfRow = getNthKey(object, row);
|
|
2635
|
+
switch (type) {
|
|
2636
|
+
case "key":
|
|
2637
|
+
object = keyOfRow;
|
|
2638
|
+
break;
|
|
2639
|
+
case "value":
|
|
2640
|
+
object = object.get(keyOfRow);
|
|
2641
|
+
break;
|
|
2642
|
+
}
|
|
2643
|
+
} else {
|
|
2644
|
+
object = object[key];
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
return object;
|
|
2648
|
+
};
|
|
2649
|
+
var setDeep = function(object, path, mapper) {
|
|
2650
|
+
validatePath(path);
|
|
2651
|
+
if (path.length === 0) {
|
|
2652
|
+
return mapper(object);
|
|
2653
|
+
}
|
|
2654
|
+
var parent = object;
|
|
2655
|
+
for (var i = 0; i < path.length - 1; i++) {
|
|
2656
|
+
var key = path[i];
|
|
2657
|
+
if (isArray(parent)) {
|
|
2658
|
+
var index = +key;
|
|
2659
|
+
parent = parent[index];
|
|
2660
|
+
} else if (isPlainObject(parent)) {
|
|
2661
|
+
parent = parent[key];
|
|
2662
|
+
} else if (isSet(parent)) {
|
|
2663
|
+
var row = +key;
|
|
2664
|
+
parent = getNthKey(parent, row);
|
|
2665
|
+
} else if (isMap(parent)) {
|
|
2666
|
+
var isEnd = i === path.length - 2;
|
|
2667
|
+
if (isEnd) {
|
|
2668
|
+
break;
|
|
2669
|
+
}
|
|
2670
|
+
var row = +key;
|
|
2671
|
+
var type = +path[++i] === 0 ? "key" : "value";
|
|
2672
|
+
var keyOfRow = getNthKey(parent, row);
|
|
2673
|
+
switch (type) {
|
|
2674
|
+
case "key":
|
|
2675
|
+
parent = keyOfRow;
|
|
2676
|
+
break;
|
|
2677
|
+
case "value":
|
|
2678
|
+
parent = parent.get(keyOfRow);
|
|
2679
|
+
break;
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
var lastKey = path[path.length - 1];
|
|
2684
|
+
if (isArray(parent)) {
|
|
2685
|
+
parent[+lastKey] = mapper(parent[+lastKey]);
|
|
2686
|
+
} else if (isPlainObject(parent)) {
|
|
2687
|
+
parent[lastKey] = mapper(parent[lastKey]);
|
|
2688
|
+
}
|
|
2689
|
+
if (isSet(parent)) {
|
|
2690
|
+
var oldValue = getNthKey(parent, +lastKey);
|
|
2691
|
+
var newValue = mapper(oldValue);
|
|
2692
|
+
if (oldValue !== newValue) {
|
|
2693
|
+
parent["delete"](oldValue);
|
|
2694
|
+
parent.add(newValue);
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
if (isMap(parent)) {
|
|
2698
|
+
var row = +path[path.length - 2];
|
|
2699
|
+
var keyToRow = getNthKey(parent, row);
|
|
2700
|
+
var type = +lastKey === 0 ? "key" : "value";
|
|
2701
|
+
switch (type) {
|
|
2702
|
+
case "key": {
|
|
2703
|
+
var newKey = mapper(keyToRow);
|
|
2704
|
+
parent.set(newKey, parent.get(keyToRow));
|
|
2705
|
+
if (newKey !== keyToRow) {
|
|
2706
|
+
parent["delete"](keyToRow);
|
|
2707
|
+
}
|
|
2708
|
+
break;
|
|
2709
|
+
}
|
|
2710
|
+
case "value": {
|
|
2711
|
+
parent.set(keyToRow, mapper(parent.get(keyToRow)));
|
|
2712
|
+
break;
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
return object;
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2719
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/plainer.js
|
|
2720
|
+
var __read3 = function(o, n) {
|
|
2721
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2722
|
+
if (!m)
|
|
2723
|
+
return o;
|
|
2724
|
+
var i = m.call(o), r, ar = [], e;
|
|
2725
|
+
try {
|
|
2726
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
2727
|
+
ar.push(r.value);
|
|
2728
|
+
} catch (error) {
|
|
2729
|
+
e = { error };
|
|
2730
|
+
} finally {
|
|
2731
|
+
try {
|
|
2732
|
+
if (r && !r.done && (m = i["return"]))
|
|
2733
|
+
m.call(i);
|
|
2734
|
+
} finally {
|
|
2735
|
+
if (e)
|
|
2736
|
+
throw e.error;
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
return ar;
|
|
2740
|
+
};
|
|
2741
|
+
var __spreadArray2 = function(to, from) {
|
|
2742
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
2743
|
+
to[j] = from[i];
|
|
2744
|
+
return to;
|
|
2745
|
+
};
|
|
2746
|
+
function traverse(tree, walker2, origin) {
|
|
2747
|
+
if (origin === void 0) {
|
|
2748
|
+
origin = [];
|
|
2749
|
+
}
|
|
2750
|
+
if (!tree) {
|
|
2751
|
+
return;
|
|
2752
|
+
}
|
|
2753
|
+
if (!isArray(tree)) {
|
|
2754
|
+
forEach(tree, function(subtree, key) {
|
|
2755
|
+
return traverse(subtree, walker2, __spreadArray2(__spreadArray2([], __read3(origin)), __read3(parsePath(key))));
|
|
2756
|
+
});
|
|
2757
|
+
return;
|
|
2758
|
+
}
|
|
2759
|
+
var _a = __read3(tree, 2), nodeValue = _a[0], children2 = _a[1];
|
|
2760
|
+
if (children2) {
|
|
2761
|
+
forEach(children2, function(child, key) {
|
|
2762
|
+
traverse(child, walker2, __spreadArray2(__spreadArray2([], __read3(origin)), __read3(parsePath(key))));
|
|
2763
|
+
});
|
|
2764
|
+
}
|
|
2765
|
+
walker2(nodeValue, origin);
|
|
2766
|
+
}
|
|
2767
|
+
function applyValueAnnotations(plain, annotations, superJson) {
|
|
2768
|
+
traverse(annotations, function(type, path) {
|
|
2769
|
+
plain = setDeep(plain, path, function(v) {
|
|
2770
|
+
return untransformValue(v, type, superJson);
|
|
2771
|
+
});
|
|
2772
|
+
});
|
|
2773
|
+
return plain;
|
|
2774
|
+
}
|
|
2775
|
+
function applyReferentialEqualityAnnotations(plain, annotations) {
|
|
2776
|
+
function apply(identicalPaths, path) {
|
|
2777
|
+
var object = getDeep(plain, parsePath(path));
|
|
2778
|
+
identicalPaths.map(parsePath).forEach(function(identicalObjectPath) {
|
|
2779
|
+
plain = setDeep(plain, identicalObjectPath, function() {
|
|
2780
|
+
return object;
|
|
2781
|
+
});
|
|
2782
|
+
});
|
|
2783
|
+
}
|
|
2784
|
+
if (isArray(annotations)) {
|
|
2785
|
+
var _a = __read3(annotations, 2), root = _a[0], other = _a[1];
|
|
2786
|
+
root.forEach(function(identicalPath) {
|
|
2787
|
+
plain = setDeep(plain, parsePath(identicalPath), function() {
|
|
2788
|
+
return plain;
|
|
2789
|
+
});
|
|
2790
|
+
});
|
|
2791
|
+
if (other) {
|
|
2792
|
+
forEach(other, apply);
|
|
2793
|
+
}
|
|
2794
|
+
} else {
|
|
2795
|
+
forEach(annotations, apply);
|
|
2796
|
+
}
|
|
2797
|
+
return plain;
|
|
2798
|
+
}
|
|
2799
|
+
var isDeep = function(object, superJson) {
|
|
2800
|
+
return isPlainObject(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
|
|
2801
|
+
};
|
|
2802
|
+
function addIdentity(object, path, identities) {
|
|
2803
|
+
var existingSet = identities.get(object);
|
|
2804
|
+
if (existingSet) {
|
|
2805
|
+
existingSet.push(path);
|
|
2806
|
+
} else {
|
|
2807
|
+
identities.set(object, [path]);
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
function generateReferentialEqualityAnnotations(identitites) {
|
|
2811
|
+
var result = {};
|
|
2812
|
+
var rootEqualityPaths = void 0;
|
|
2813
|
+
identitites.forEach(function(paths) {
|
|
2814
|
+
if (paths.length <= 1) {
|
|
2815
|
+
return;
|
|
2816
|
+
}
|
|
2817
|
+
var _a = __read3(paths.map(function(path) {
|
|
2818
|
+
return path.map(String);
|
|
2819
|
+
}).sort(function(a, b) {
|
|
2820
|
+
return a.length - b.length;
|
|
2821
|
+
})), shortestPath = _a[0], identicalPaths = _a.slice(1);
|
|
2822
|
+
if (shortestPath.length === 0) {
|
|
2823
|
+
rootEqualityPaths = identicalPaths.map(stringifyPath);
|
|
2824
|
+
} else {
|
|
2825
|
+
result[stringifyPath(shortestPath)] = identicalPaths.map(stringifyPath);
|
|
2826
|
+
}
|
|
2827
|
+
});
|
|
2828
|
+
if (rootEqualityPaths) {
|
|
2829
|
+
if (isEmptyObject(result)) {
|
|
2830
|
+
return [rootEqualityPaths];
|
|
2831
|
+
} else {
|
|
2832
|
+
return [rootEqualityPaths, result];
|
|
2833
|
+
}
|
|
2834
|
+
} else {
|
|
2835
|
+
return isEmptyObject(result) ? void 0 : result;
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
var walker = function(object, identities, superJson, path, objectsInThisPath) {
|
|
2839
|
+
var _a;
|
|
2840
|
+
if (path === void 0) {
|
|
2841
|
+
path = [];
|
|
2842
|
+
}
|
|
2843
|
+
if (objectsInThisPath === void 0) {
|
|
2844
|
+
objectsInThisPath = [];
|
|
2845
|
+
}
|
|
2846
|
+
if (!isPrimitive(object)) {
|
|
2847
|
+
addIdentity(object, path, identities);
|
|
2848
|
+
}
|
|
2849
|
+
if (!isDeep(object, superJson)) {
|
|
2850
|
+
var transformed_1 = transformValue(object, superJson);
|
|
2851
|
+
if (transformed_1) {
|
|
2852
|
+
return {
|
|
2853
|
+
transformedValue: transformed_1.value,
|
|
2854
|
+
annotations: [transformed_1.type]
|
|
2855
|
+
};
|
|
2856
|
+
} else {
|
|
2857
|
+
return {
|
|
2858
|
+
transformedValue: object
|
|
2859
|
+
};
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
if (includes(objectsInThisPath, object)) {
|
|
2863
|
+
return {
|
|
2864
|
+
transformedValue: null
|
|
2865
|
+
};
|
|
2866
|
+
}
|
|
2867
|
+
var transformationResult = transformValue(object, superJson);
|
|
2868
|
+
var transformed = (_a = transformationResult === null || transformationResult === void 0 ? void 0 : transformationResult.value) !== null && _a !== void 0 ? _a : object;
|
|
2869
|
+
if (!isPrimitive(object)) {
|
|
2870
|
+
objectsInThisPath = __spreadArray2(__spreadArray2([], __read3(objectsInThisPath)), [object]);
|
|
2871
|
+
}
|
|
2872
|
+
var transformedValue = isArray(transformed) ? [] : {};
|
|
2873
|
+
var innerAnnotations = {};
|
|
2874
|
+
forEach(transformed, function(value, index) {
|
|
2875
|
+
var recursiveResult = walker(value, identities, superJson, __spreadArray2(__spreadArray2([], __read3(path)), [index]), objectsInThisPath);
|
|
2876
|
+
transformedValue[index] = recursiveResult.transformedValue;
|
|
2877
|
+
if (isArray(recursiveResult.annotations)) {
|
|
2878
|
+
innerAnnotations[index] = recursiveResult.annotations;
|
|
2879
|
+
} else if (isPlainObject(recursiveResult.annotations)) {
|
|
2880
|
+
forEach(recursiveResult.annotations, function(tree, key) {
|
|
2881
|
+
innerAnnotations[escapeKey(index) + "." + key] = tree;
|
|
2882
|
+
});
|
|
2883
|
+
}
|
|
2884
|
+
});
|
|
2885
|
+
if (isEmptyObject(innerAnnotations)) {
|
|
2886
|
+
return {
|
|
2887
|
+
transformedValue,
|
|
2888
|
+
annotations: !!transformationResult ? [transformationResult.type] : void 0
|
|
2889
|
+
};
|
|
2890
|
+
} else {
|
|
2891
|
+
return {
|
|
2892
|
+
transformedValue,
|
|
2893
|
+
annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
|
|
2894
|
+
};
|
|
2895
|
+
}
|
|
2896
|
+
};
|
|
2897
|
+
|
|
2898
|
+
// ../../node_modules/.pnpm/is-what@4.1.15/node_modules/is-what/dist/index.js
|
|
2899
|
+
function getType2(payload) {
|
|
2900
|
+
return Object.prototype.toString.call(payload).slice(8, -1);
|
|
2901
|
+
}
|
|
2902
|
+
function isUndefined2(payload) {
|
|
2903
|
+
return getType2(payload) === "Undefined";
|
|
2904
|
+
}
|
|
2905
|
+
function isNull2(payload) {
|
|
2906
|
+
return getType2(payload) === "Null";
|
|
2907
|
+
}
|
|
2908
|
+
function isPlainObject2(payload) {
|
|
2909
|
+
if (getType2(payload) !== "Object")
|
|
2910
|
+
return false;
|
|
2911
|
+
const prototype = Object.getPrototypeOf(payload);
|
|
2912
|
+
return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
|
|
2913
|
+
}
|
|
2914
|
+
function isArray2(payload) {
|
|
2915
|
+
return getType2(payload) === "Array";
|
|
2916
|
+
}
|
|
2917
|
+
var isNullOrUndefined = isOneOf(isNull2, isUndefined2);
|
|
2918
|
+
function isOneOf(a, b, c, d, e) {
|
|
2919
|
+
return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
// ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
|
|
2923
|
+
function assignProp2(carry, key, newVal, originalObject, includeNonenumerable) {
|
|
2924
|
+
const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
|
|
2925
|
+
if (propType === "enumerable")
|
|
2926
|
+
carry[key] = newVal;
|
|
2927
|
+
if (includeNonenumerable && propType === "nonenumerable") {
|
|
2928
|
+
Object.defineProperty(carry, key, {
|
|
2929
|
+
value: newVal,
|
|
2930
|
+
enumerable: false,
|
|
2931
|
+
writable: true,
|
|
2932
|
+
configurable: true
|
|
2933
|
+
});
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
function copy(target, options = {}) {
|
|
2937
|
+
if (isArray2(target)) {
|
|
2938
|
+
return target.map((item) => copy(item, options));
|
|
2939
|
+
}
|
|
2940
|
+
if (!isPlainObject2(target)) {
|
|
2941
|
+
return target;
|
|
2942
|
+
}
|
|
2943
|
+
const props = Object.getOwnPropertyNames(target);
|
|
2944
|
+
const symbols = Object.getOwnPropertySymbols(target);
|
|
2945
|
+
return [...props, ...symbols].reduce((carry, key) => {
|
|
2946
|
+
if (isArray2(options.props) && !options.props.includes(key)) {
|
|
2947
|
+
return carry;
|
|
2948
|
+
}
|
|
2949
|
+
const val = target[key];
|
|
2950
|
+
const newVal = copy(val, options);
|
|
2951
|
+
assignProp2(carry, key, newVal, target, options.nonenumerable);
|
|
2952
|
+
return carry;
|
|
2953
|
+
}, {});
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
// ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/index.js
|
|
2957
|
+
var __assign2 = function() {
|
|
2958
|
+
__assign2 = Object.assign || function(t) {
|
|
2959
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2960
|
+
s = arguments[i];
|
|
2961
|
+
for (var p in s)
|
|
2962
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
2963
|
+
t[p] = s[p];
|
|
2964
|
+
}
|
|
2965
|
+
return t;
|
|
2966
|
+
};
|
|
2967
|
+
return __assign2.apply(this, arguments);
|
|
2968
|
+
};
|
|
2969
|
+
var __read4 = function(o, n) {
|
|
2970
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2971
|
+
if (!m)
|
|
2972
|
+
return o;
|
|
2973
|
+
var i = m.call(o), r, ar = [], e;
|
|
2974
|
+
try {
|
|
2975
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
2976
|
+
ar.push(r.value);
|
|
2977
|
+
} catch (error) {
|
|
2978
|
+
e = { error };
|
|
2979
|
+
} finally {
|
|
2980
|
+
try {
|
|
2981
|
+
if (r && !r.done && (m = i["return"]))
|
|
2982
|
+
m.call(i);
|
|
2983
|
+
} finally {
|
|
2984
|
+
if (e)
|
|
2985
|
+
throw e.error;
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
return ar;
|
|
2989
|
+
};
|
|
2990
|
+
var __spreadArray3 = function(to, from) {
|
|
2991
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
2992
|
+
to[j] = from[i];
|
|
2993
|
+
return to;
|
|
2994
|
+
};
|
|
2995
|
+
var SuperJSON = (
|
|
2996
|
+
/** @class */
|
|
2997
|
+
function() {
|
|
2998
|
+
function SuperJSON2() {
|
|
2999
|
+
this.classRegistry = new ClassRegistry();
|
|
3000
|
+
this.symbolRegistry = new Registry(function(s) {
|
|
3001
|
+
var _a;
|
|
3002
|
+
return (_a = s.description) !== null && _a !== void 0 ? _a : "";
|
|
3003
|
+
});
|
|
3004
|
+
this.customTransformerRegistry = new CustomTransformerRegistry();
|
|
3005
|
+
this.allowedErrorProps = [];
|
|
3006
|
+
}
|
|
3007
|
+
SuperJSON2.prototype.serialize = function(object) {
|
|
3008
|
+
var identities = /* @__PURE__ */ new Map();
|
|
3009
|
+
var output = walker(object, identities, this);
|
|
3010
|
+
var res = {
|
|
3011
|
+
json: output.transformedValue
|
|
3012
|
+
};
|
|
3013
|
+
if (output.annotations) {
|
|
3014
|
+
res.meta = __assign2(__assign2({}, res.meta), { values: output.annotations });
|
|
3015
|
+
}
|
|
3016
|
+
var equalityAnnotations = generateReferentialEqualityAnnotations(identities);
|
|
3017
|
+
if (equalityAnnotations) {
|
|
3018
|
+
res.meta = __assign2(__assign2({}, res.meta), { referentialEqualities: equalityAnnotations });
|
|
3019
|
+
}
|
|
3020
|
+
return res;
|
|
3021
|
+
};
|
|
3022
|
+
SuperJSON2.prototype.deserialize = function(payload) {
|
|
3023
|
+
var json = payload.json, meta = payload.meta;
|
|
3024
|
+
var result = copy(json);
|
|
3025
|
+
if (meta === null || meta === void 0 ? void 0 : meta.values) {
|
|
3026
|
+
result = applyValueAnnotations(result, meta.values, this);
|
|
3027
|
+
}
|
|
3028
|
+
if (meta === null || meta === void 0 ? void 0 : meta.referentialEqualities) {
|
|
3029
|
+
result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
|
|
3030
|
+
}
|
|
3031
|
+
return result;
|
|
3032
|
+
};
|
|
3033
|
+
SuperJSON2.prototype.stringify = function(object) {
|
|
3034
|
+
return JSON.stringify(this.serialize(object));
|
|
3035
|
+
};
|
|
3036
|
+
SuperJSON2.prototype.parse = function(string) {
|
|
3037
|
+
return this.deserialize(JSON.parse(string));
|
|
3038
|
+
};
|
|
3039
|
+
SuperJSON2.prototype.registerClass = function(v, options) {
|
|
3040
|
+
this.classRegistry.register(v, options);
|
|
3041
|
+
};
|
|
3042
|
+
SuperJSON2.prototype.registerSymbol = function(v, identifier) {
|
|
3043
|
+
this.symbolRegistry.register(v, identifier);
|
|
3044
|
+
};
|
|
3045
|
+
SuperJSON2.prototype.registerCustom = function(transformer, name) {
|
|
3046
|
+
this.customTransformerRegistry.register(__assign2({ name }, transformer));
|
|
3047
|
+
};
|
|
3048
|
+
SuperJSON2.prototype.allowErrorProps = function() {
|
|
3049
|
+
var _a;
|
|
3050
|
+
var props = [];
|
|
3051
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3052
|
+
props[_i] = arguments[_i];
|
|
3053
|
+
}
|
|
3054
|
+
(_a = this.allowedErrorProps).push.apply(_a, __spreadArray3([], __read4(props)));
|
|
3055
|
+
};
|
|
3056
|
+
SuperJSON2.defaultInstance = new SuperJSON2();
|
|
3057
|
+
SuperJSON2.serialize = SuperJSON2.defaultInstance.serialize.bind(SuperJSON2.defaultInstance);
|
|
3058
|
+
SuperJSON2.deserialize = SuperJSON2.defaultInstance.deserialize.bind(SuperJSON2.defaultInstance);
|
|
3059
|
+
SuperJSON2.stringify = SuperJSON2.defaultInstance.stringify.bind(SuperJSON2.defaultInstance);
|
|
3060
|
+
SuperJSON2.parse = SuperJSON2.defaultInstance.parse.bind(SuperJSON2.defaultInstance);
|
|
3061
|
+
SuperJSON2.registerClass = SuperJSON2.defaultInstance.registerClass.bind(SuperJSON2.defaultInstance);
|
|
3062
|
+
SuperJSON2.registerSymbol = SuperJSON2.defaultInstance.registerSymbol.bind(SuperJSON2.defaultInstance);
|
|
3063
|
+
SuperJSON2.registerCustom = SuperJSON2.defaultInstance.registerCustom.bind(SuperJSON2.defaultInstance);
|
|
3064
|
+
SuperJSON2.allowErrorProps = SuperJSON2.defaultInstance.allowErrorProps.bind(SuperJSON2.defaultInstance);
|
|
3065
|
+
return SuperJSON2;
|
|
3066
|
+
}()
|
|
3067
|
+
);
|
|
3068
|
+
var serialize = SuperJSON.serialize;
|
|
3069
|
+
var deserialize = SuperJSON.deserialize;
|
|
3070
|
+
var stringify = SuperJSON.stringify;
|
|
3071
|
+
var parse = SuperJSON.parse;
|
|
3072
|
+
var registerClass = SuperJSON.registerClass;
|
|
3073
|
+
var registerCustom = SuperJSON.registerCustom;
|
|
3074
|
+
var registerSymbol = SuperJSON.registerSymbol;
|
|
3075
|
+
var allowErrorProps = SuperJSON.allowErrorProps;
|
|
3076
|
+
|
|
3077
|
+
// src/utils.tsx
|
|
3078
|
+
function getQueryStatusLabel(query) {
|
|
3079
|
+
return query.state.fetchStatus === "fetching" ? "fetching" : !query.getObserversCount() ? "inactive" : query.state.fetchStatus === "paused" ? "paused" : query.isStale() ? "stale" : "fresh";
|
|
3080
|
+
}
|
|
3081
|
+
function getSidedProp(prop, side) {
|
|
3082
|
+
return `${prop}${side.charAt(0).toUpperCase() + side.slice(1)}`;
|
|
3083
|
+
}
|
|
3084
|
+
function getQueryStatusColor({
|
|
3085
|
+
queryState,
|
|
3086
|
+
observerCount,
|
|
3087
|
+
isStale
|
|
3088
|
+
}) {
|
|
3089
|
+
return queryState.fetchStatus === "fetching" ? "blue" : !observerCount ? "gray" : queryState.fetchStatus === "paused" ? "purple" : isStale ? "yellow" : "green";
|
|
3090
|
+
}
|
|
3091
|
+
function getMutationStatusColor({
|
|
3092
|
+
status,
|
|
3093
|
+
isPaused
|
|
3094
|
+
}) {
|
|
3095
|
+
return isPaused ? "purple" : status === "error" ? "red" : status === "pending" ? "yellow" : status === "success" ? "green" : "gray";
|
|
3096
|
+
}
|
|
3097
|
+
function getQueryStatusColorByLabel(label) {
|
|
3098
|
+
return label === "fresh" ? "green" : label === "stale" ? "yellow" : label === "paused" ? "purple" : label === "inactive" ? "gray" : "blue";
|
|
3099
|
+
}
|
|
3100
|
+
var displayValue = (value, beautify = false) => {
|
|
3101
|
+
const { json } = serialize(value);
|
|
3102
|
+
return JSON.stringify(json, null, beautify ? 2 : void 0);
|
|
3103
|
+
};
|
|
3104
|
+
var getStatusRank = (q) => q.state.fetchStatus !== "idle" ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1;
|
|
3105
|
+
var queryHashSort = (a, b) => a.queryHash.localeCompare(b.queryHash);
|
|
3106
|
+
var dateSort = (a, b) => a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1;
|
|
3107
|
+
var statusAndDateSort = (a, b) => {
|
|
3108
|
+
if (getStatusRank(a) === getStatusRank(b)) {
|
|
3109
|
+
return dateSort(a, b);
|
|
3110
|
+
}
|
|
3111
|
+
return getStatusRank(a) > getStatusRank(b) ? 1 : -1;
|
|
3112
|
+
};
|
|
3113
|
+
var sortFns = {
|
|
3114
|
+
status: statusAndDateSort,
|
|
3115
|
+
"query hash": queryHashSort,
|
|
3116
|
+
"last updated": dateSort
|
|
3117
|
+
};
|
|
3118
|
+
var getMutationStatusRank = (m) => m.state.isPaused ? 0 : m.state.status === "error" ? 2 : m.state.status === "pending" ? 1 : 3;
|
|
3119
|
+
var mutationDateSort = (a, b) => a.state.submittedAt < b.state.submittedAt ? 1 : -1;
|
|
3120
|
+
var mutationStatusSort = (a, b) => {
|
|
3121
|
+
if (getMutationStatusRank(a) === getMutationStatusRank(b)) {
|
|
3122
|
+
return mutationDateSort(a, b);
|
|
3123
|
+
}
|
|
3124
|
+
return getMutationStatusRank(a) > getMutationStatusRank(b) ? 1 : -1;
|
|
3125
|
+
};
|
|
3126
|
+
var mutationSortFns = {
|
|
3127
|
+
status: mutationStatusSort,
|
|
3128
|
+
"last updated": mutationDateSort
|
|
3129
|
+
};
|
|
3130
|
+
var convertRemToPixels = (rem) => {
|
|
3131
|
+
return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
3132
|
+
};
|
|
3133
|
+
var getPreferredColorScheme = () => {
|
|
3134
|
+
const [colorScheme, setColorScheme] = createSignal("dark");
|
|
3135
|
+
onMount(() => {
|
|
3136
|
+
const query = window.matchMedia("(prefers-color-scheme: dark)");
|
|
3137
|
+
setColorScheme(query.matches ? "dark" : "light");
|
|
3138
|
+
const listener = (e) => {
|
|
3139
|
+
setColorScheme(e.matches ? "dark" : "light");
|
|
3140
|
+
};
|
|
3141
|
+
query.addEventListener("change", listener);
|
|
3142
|
+
onCleanup(() => query.removeEventListener("change", listener));
|
|
3143
|
+
});
|
|
3144
|
+
return colorScheme;
|
|
3145
|
+
};
|
|
3146
|
+
var updateNestedDataByPath = (oldData, updatePath, value) => {
|
|
3147
|
+
if (updatePath.length === 0) {
|
|
3148
|
+
return value;
|
|
3149
|
+
}
|
|
3150
|
+
if (oldData instanceof Map) {
|
|
3151
|
+
const newData = new Map(oldData);
|
|
3152
|
+
if (updatePath.length === 1) {
|
|
3153
|
+
newData.set(updatePath[0], value);
|
|
3154
|
+
return newData;
|
|
3155
|
+
}
|
|
3156
|
+
const [head, ...tail] = updatePath;
|
|
3157
|
+
newData.set(head, updateNestedDataByPath(newData.get(head), tail, value));
|
|
3158
|
+
return newData;
|
|
3159
|
+
}
|
|
3160
|
+
if (oldData instanceof Set) {
|
|
3161
|
+
const setAsArray = updateNestedDataByPath(
|
|
3162
|
+
Array.from(oldData),
|
|
3163
|
+
updatePath,
|
|
3164
|
+
value
|
|
3165
|
+
);
|
|
3166
|
+
return new Set(setAsArray);
|
|
3167
|
+
}
|
|
3168
|
+
if (Array.isArray(oldData)) {
|
|
3169
|
+
const newData = [...oldData];
|
|
3170
|
+
if (updatePath.length === 1) {
|
|
3171
|
+
newData[updatePath[0]] = value;
|
|
3172
|
+
return newData;
|
|
3173
|
+
}
|
|
3174
|
+
const [head, ...tail] = updatePath;
|
|
3175
|
+
newData[head] = updateNestedDataByPath(newData[head], tail, value);
|
|
3176
|
+
return newData;
|
|
3177
|
+
}
|
|
3178
|
+
if (oldData instanceof Object) {
|
|
3179
|
+
const newData = { ...oldData };
|
|
3180
|
+
if (updatePath.length === 1) {
|
|
3181
|
+
newData[updatePath[0]] = value;
|
|
3182
|
+
return newData;
|
|
3183
|
+
}
|
|
3184
|
+
const [head, ...tail] = updatePath;
|
|
3185
|
+
newData[head] = updateNestedDataByPath(newData[head], tail, value);
|
|
3186
|
+
return newData;
|
|
3187
|
+
}
|
|
3188
|
+
return oldData;
|
|
3189
|
+
};
|
|
3190
|
+
var deleteNestedDataByPath = (oldData, deletePath) => {
|
|
3191
|
+
if (oldData instanceof Map) {
|
|
3192
|
+
const newData = new Map(oldData);
|
|
3193
|
+
if (deletePath.length === 1) {
|
|
3194
|
+
newData.delete(deletePath[0]);
|
|
3195
|
+
return newData;
|
|
3196
|
+
}
|
|
3197
|
+
const [head, ...tail] = deletePath;
|
|
3198
|
+
newData.set(head, deleteNestedDataByPath(newData.get(head), tail));
|
|
3199
|
+
return newData;
|
|
3200
|
+
}
|
|
3201
|
+
if (oldData instanceof Set) {
|
|
3202
|
+
const setAsArray = deleteNestedDataByPath(Array.from(oldData), deletePath);
|
|
3203
|
+
return new Set(setAsArray);
|
|
3204
|
+
}
|
|
3205
|
+
if (Array.isArray(oldData)) {
|
|
3206
|
+
const newData = [...oldData];
|
|
3207
|
+
if (deletePath.length === 1) {
|
|
3208
|
+
return newData.filter((_, idx) => idx.toString() !== deletePath[0]);
|
|
3209
|
+
}
|
|
3210
|
+
const [head, ...tail] = deletePath;
|
|
3211
|
+
newData[head] = deleteNestedDataByPath(newData[head], tail);
|
|
3212
|
+
return newData;
|
|
3213
|
+
}
|
|
3214
|
+
if (oldData instanceof Object) {
|
|
3215
|
+
const newData = { ...oldData };
|
|
3216
|
+
if (deletePath.length === 1) {
|
|
3217
|
+
delete newData[deletePath[0]];
|
|
3218
|
+
return newData;
|
|
3219
|
+
}
|
|
3220
|
+
const [head, ...tail] = deletePath;
|
|
3221
|
+
newData[head] = deleteNestedDataByPath(newData[head], tail);
|
|
3222
|
+
return newData;
|
|
3223
|
+
}
|
|
3224
|
+
return oldData;
|
|
3225
|
+
};
|
|
3226
|
+
var setupStyleSheet = (nonce) => {
|
|
3227
|
+
if (!nonce)
|
|
3228
|
+
return;
|
|
3229
|
+
const styleExists = document.querySelector("#_goober");
|
|
3230
|
+
if (styleExists)
|
|
3231
|
+
return;
|
|
3232
|
+
const styleTag = document.createElement("style");
|
|
3233
|
+
const textNode = document.createTextNode("");
|
|
3234
|
+
styleTag.appendChild(textNode);
|
|
3235
|
+
styleTag.id = "_goober";
|
|
3236
|
+
styleTag.setAttribute("nonce", nonce);
|
|
3237
|
+
document.head.appendChild(styleTag);
|
|
3238
|
+
};
|
|
3239
|
+
|
|
2035
3240
|
export {
|
|
2036
3241
|
$PROXY,
|
|
2037
3242
|
$TRACK,
|
|
@@ -2071,5 +3276,19 @@ export {
|
|
|
2071
3276
|
use,
|
|
2072
3277
|
isServer,
|
|
2073
3278
|
Portal,
|
|
2074
|
-
Dynamic
|
|
3279
|
+
Dynamic,
|
|
3280
|
+
stringify,
|
|
3281
|
+
getQueryStatusLabel,
|
|
3282
|
+
getSidedProp,
|
|
3283
|
+
getQueryStatusColor,
|
|
3284
|
+
getMutationStatusColor,
|
|
3285
|
+
getQueryStatusColorByLabel,
|
|
3286
|
+
displayValue,
|
|
3287
|
+
sortFns,
|
|
3288
|
+
mutationSortFns,
|
|
3289
|
+
convertRemToPixels,
|
|
3290
|
+
getPreferredColorScheme,
|
|
3291
|
+
updateNestedDataByPath,
|
|
3292
|
+
deleteNestedDataByPath,
|
|
3293
|
+
setupStyleSheet
|
|
2075
3294
|
};
|