@tanstack/query-devtools 5.4.2 → 5.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { createContext, delegateEvents, createSignal, createMemo, createComponent, createEffect, onMount, onCleanup, use, insert, Show, createRenderEffect, className, on, setAttribute, spread, mergeProps, For, isServer, $PROXY, $TRACK, getListener, batch, createUniqueId, useContext, Index, template, untrack, useTransition, createRoot, splitProps, Portal, addEventListener, Switch, Match, Dynamic, children, createComputed, getOwner, DEV } from '../chunk/Z53XT47W.js';
1
+ import { createContext, delegateEvents, sortFns, mutationSortFns, createSignal, getPreferredColorScheme, createMemo, createComponent, createEffect, onMount, onCleanup, use, insert, Show, createRenderEffect, className, on, setAttribute, getQueryStatusColor, getMutationStatusColor, getQueryStatusLabel, spread, mergeProps, getQueryStatusColorByLabel, displayValue, For, isServer, $PROXY, $TRACK, getListener, batch, createUniqueId, useContext, Index, updateNestedDataByPath, template, convertRemToPixels, getSidedProp, untrack, useTransition, createRoot, splitProps, Portal, addEventListener, stringify, Switch, Match, deleteNestedDataByPath, Dynamic, children, createComputed, getOwner, DEV } from '../chunk/2CFRQNPI.js';
2
2
 
3
3
  // ../../node_modules/.pnpm/@tanstack+match-sorter-utils@8.8.4/node_modules/@tanstack/match-sorter-utils/build/lib/index.mjs
4
4
  var characterMap = {
@@ -681,8 +681,8 @@ var noop = () => {
681
681
  function createListTransition(source, options) {
682
682
  const initSource = untrack(source);
683
683
  if (isServer) {
684
- const copy2 = initSource.slice();
685
- return () => copy2;
684
+ const copy = initSource.slice();
685
+ return () => copy;
686
686
  }
687
687
  const { onChange } = options;
688
688
  let prevSet = new Set(options.appear ? void 0 : initSource);
@@ -1700,7 +1700,7 @@ function isElementInScope(element, scope) {
1700
1700
  }
1701
1701
  function getFocusableTreeWalker(root, opts, scope) {
1702
1702
  const selector = opts?.tabbable ? TABBABLE_ELEMENT_SELECTOR : FOCUSABLE_ELEMENT_SELECTOR;
1703
- const walker2 = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
1703
+ const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
1704
1704
  acceptNode(node) {
1705
1705
  if (opts?.from?.contains(node)) {
1706
1706
  return NodeFilter.FILTER_REJECT;
@@ -1712,9 +1712,9 @@ function getFocusableTreeWalker(root, opts, scope) {
1712
1712
  }
1713
1713
  });
1714
1714
  if (opts?.from) {
1715
- walker2.currentNode = opts.from;
1715
+ walker.currentNode = opts.from;
1716
1716
  }
1717
- return walker2;
1717
+ return walker;
1718
1718
  }
1719
1719
  function noop3() {
1720
1720
  return;
@@ -2048,19 +2048,19 @@ function updatePath(current, path, traversed = []) {
2048
2048
  let part, prev = current;
2049
2049
  if (path.length > 1) {
2050
2050
  part = path.shift();
2051
- const partType = typeof part, isArray4 = Array.isArray(current);
2051
+ const partType = typeof part, isArray2 = Array.isArray(current);
2052
2052
  if (Array.isArray(part)) {
2053
2053
  for (let i2 = 0; i2 < part.length; i2++) {
2054
2054
  updatePath(current, [part[i2]].concat(path), traversed);
2055
2055
  }
2056
2056
  return;
2057
- } else if (isArray4 && partType === "function") {
2057
+ } else if (isArray2 && partType === "function") {
2058
2058
  for (let i2 = 0; i2 < current.length; i2++) {
2059
2059
  if (part(current[i2], i2))
2060
2060
  updatePath(current, [i2].concat(path), traversed);
2061
2061
  }
2062
2062
  return;
2063
- } else if (isArray4 && partType === "object") {
2063
+ } else if (isArray2 && partType === "object") {
2064
2064
  const { from = 0, to = current.length - 1, by = 1 } = part;
2065
2065
  for (let i2 = from; i2 <= to; i2 += by) {
2066
2066
  updatePath(current, [i2].concat(path), traversed);
@@ -2089,11 +2089,11 @@ function updatePath(current, path, traversed = []) {
2089
2089
  }
2090
2090
  function createStore(...[store, options]) {
2091
2091
  const unwrappedStore = unwrap(store || {});
2092
- const isArray4 = Array.isArray(unwrappedStore);
2092
+ const isArray2 = Array.isArray(unwrappedStore);
2093
2093
  const wrappedStore = wrap$1(unwrappedStore);
2094
2094
  function setStore(...args) {
2095
2095
  batch(() => {
2096
- isArray4 && args.length === 1 ? updateArray(unwrappedStore, args[0]) : updatePath(unwrappedStore, args);
2096
+ isArray2 && args.length === 1 ? updateArray(unwrappedStore, args[0]) : updatePath(unwrappedStore, args);
2097
2097
  });
2098
2098
  }
2099
2099
  return [wrappedStore, setStore];
@@ -4039,7 +4039,7 @@ function ariaHideOutside(targets, root = document.body) {
4039
4039
  }
4040
4040
  return NodeFilter.FILTER_ACCEPT;
4041
4041
  };
4042
- const walker2 = document.createTreeWalker(root2, NodeFilter.SHOW_ELEMENT, {
4042
+ const walker = document.createTreeWalker(root2, NodeFilter.SHOW_ELEMENT, {
4043
4043
  acceptNode
4044
4044
  });
4045
4045
  const acceptRoot = acceptNode(root2);
@@ -4047,10 +4047,10 @@ function ariaHideOutside(targets, root = document.body) {
4047
4047
  hide2(root2);
4048
4048
  }
4049
4049
  if (acceptRoot !== NodeFilter.FILTER_REJECT) {
4050
- let node = walker2.nextNode();
4050
+ let node = walker.nextNode();
4051
4051
  while (node != null) {
4052
4052
  hide2(node);
4053
- node = walker2.nextNode();
4053
+ node = walker.nextNode();
4054
4054
  }
4055
4055
  }
4056
4056
  };
@@ -5022,13 +5022,13 @@ function createSelectableCollection(props, ref, scrollRef) {
5022
5022
  if (e2.shiftKey) {
5023
5023
  refEl.focus();
5024
5024
  } else {
5025
- const walker2 = getFocusableTreeWalker(refEl, {
5025
+ const walker = getFocusableTreeWalker(refEl, {
5026
5026
  tabbable: true
5027
5027
  });
5028
5028
  let next;
5029
5029
  let last;
5030
5030
  do {
5031
- last = walker2.lastChild();
5031
+ last = walker.lastChild();
5032
5032
  if (last) {
5033
5033
  next = last;
5034
5034
  }
@@ -8631,1190 +8631,6 @@ var tokens = {
8631
8631
  }
8632
8632
  };
8633
8633
 
8634
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/double-indexed-kv.js
8635
- var DoubleIndexedKV = (
8636
- /** @class */
8637
- function() {
8638
- function DoubleIndexedKV2() {
8639
- this.keyToValue = /* @__PURE__ */ new Map();
8640
- this.valueToKey = /* @__PURE__ */ new Map();
8641
- }
8642
- DoubleIndexedKV2.prototype.set = function(key, value) {
8643
- this.keyToValue.set(key, value);
8644
- this.valueToKey.set(value, key);
8645
- };
8646
- DoubleIndexedKV2.prototype.getByKey = function(key) {
8647
- return this.keyToValue.get(key);
8648
- };
8649
- DoubleIndexedKV2.prototype.getByValue = function(value) {
8650
- return this.valueToKey.get(value);
8651
- };
8652
- DoubleIndexedKV2.prototype.clear = function() {
8653
- this.keyToValue.clear();
8654
- this.valueToKey.clear();
8655
- };
8656
- return DoubleIndexedKV2;
8657
- }()
8658
- );
8659
-
8660
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/registry.js
8661
- var Registry = (
8662
- /** @class */
8663
- function() {
8664
- function Registry2(generateIdentifier) {
8665
- this.generateIdentifier = generateIdentifier;
8666
- this.kv = new DoubleIndexedKV();
8667
- }
8668
- Registry2.prototype.register = function(value, identifier) {
8669
- if (this.kv.getByValue(value)) {
8670
- return;
8671
- }
8672
- if (!identifier) {
8673
- identifier = this.generateIdentifier(value);
8674
- }
8675
- this.kv.set(identifier, value);
8676
- };
8677
- Registry2.prototype.clear = function() {
8678
- this.kv.clear();
8679
- };
8680
- Registry2.prototype.getIdentifier = function(value) {
8681
- return this.kv.getByValue(value);
8682
- };
8683
- Registry2.prototype.getValue = function(identifier) {
8684
- return this.kv.getByKey(identifier);
8685
- };
8686
- return Registry2;
8687
- }()
8688
- );
8689
-
8690
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/class-registry.js
8691
- var __extends = function() {
8692
- var extendStatics = function(d, b2) {
8693
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b3) {
8694
- d2.__proto__ = b3;
8695
- } || function(d2, b3) {
8696
- for (var p2 in b3)
8697
- if (Object.prototype.hasOwnProperty.call(b3, p2))
8698
- d2[p2] = b3[p2];
8699
- };
8700
- return extendStatics(d, b2);
8701
- };
8702
- return function(d, b2) {
8703
- if (typeof b2 !== "function" && b2 !== null)
8704
- throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
8705
- extendStatics(d, b2);
8706
- function __() {
8707
- this.constructor = d;
8708
- }
8709
- d.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
8710
- };
8711
- }();
8712
- var ClassRegistry = (
8713
- /** @class */
8714
- function(_super) {
8715
- __extends(ClassRegistry2, _super);
8716
- function ClassRegistry2() {
8717
- var _this = _super.call(this, function(c2) {
8718
- return c2.name;
8719
- }) || this;
8720
- _this.classToAllowedProps = /* @__PURE__ */ new Map();
8721
- return _this;
8722
- }
8723
- ClassRegistry2.prototype.register = function(value, options) {
8724
- if (typeof options === "object") {
8725
- if (options.allowProps) {
8726
- this.classToAllowedProps.set(value, options.allowProps);
8727
- }
8728
- _super.prototype.register.call(this, value, options.identifier);
8729
- } else {
8730
- _super.prototype.register.call(this, value, options);
8731
- }
8732
- };
8733
- ClassRegistry2.prototype.getAllowedProps = function(value) {
8734
- return this.classToAllowedProps.get(value);
8735
- };
8736
- return ClassRegistry2;
8737
- }(Registry)
8738
- );
8739
-
8740
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/util.js
8741
- var __read = function(o2, n2) {
8742
- var m = typeof Symbol === "function" && o2[Symbol.iterator];
8743
- if (!m)
8744
- return o2;
8745
- var i2 = m.call(o2), r2, ar = [], e2;
8746
- try {
8747
- while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done)
8748
- ar.push(r2.value);
8749
- } catch (error) {
8750
- e2 = { error };
8751
- } finally {
8752
- try {
8753
- if (r2 && !r2.done && (m = i2["return"]))
8754
- m.call(i2);
8755
- } finally {
8756
- if (e2)
8757
- throw e2.error;
8758
- }
8759
- }
8760
- return ar;
8761
- };
8762
- function valuesOfObj(record) {
8763
- if ("values" in Object) {
8764
- return Object.values(record);
8765
- }
8766
- var values = [];
8767
- for (var key in record) {
8768
- if (record.hasOwnProperty(key)) {
8769
- values.push(record[key]);
8770
- }
8771
- }
8772
- return values;
8773
- }
8774
- function find2(record, predicate) {
8775
- var values = valuesOfObj(record);
8776
- if ("find" in values) {
8777
- return values.find(predicate);
8778
- }
8779
- var valuesNotNever = values;
8780
- for (var i2 = 0; i2 < valuesNotNever.length; i2++) {
8781
- var value = valuesNotNever[i2];
8782
- if (predicate(value)) {
8783
- return value;
8784
- }
8785
- }
8786
- return void 0;
8787
- }
8788
- function forEach(record, run) {
8789
- Object.entries(record).forEach(function(_a) {
8790
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
8791
- return run(value, key);
8792
- });
8793
- }
8794
- function includes(arr, value) {
8795
- return arr.indexOf(value) !== -1;
8796
- }
8797
- function findArr(record, predicate) {
8798
- for (var i2 = 0; i2 < record.length; i2++) {
8799
- var value = record[i2];
8800
- if (predicate(value)) {
8801
- return value;
8802
- }
8803
- }
8804
- return void 0;
8805
- }
8806
-
8807
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/custom-transformer-registry.js
8808
- var CustomTransformerRegistry = (
8809
- /** @class */
8810
- function() {
8811
- function CustomTransformerRegistry2() {
8812
- this.transfomers = {};
8813
- }
8814
- CustomTransformerRegistry2.prototype.register = function(transformer) {
8815
- this.transfomers[transformer.name] = transformer;
8816
- };
8817
- CustomTransformerRegistry2.prototype.findApplicable = function(v) {
8818
- return find2(this.transfomers, function(transformer) {
8819
- return transformer.isApplicable(v);
8820
- });
8821
- };
8822
- CustomTransformerRegistry2.prototype.findByName = function(name) {
8823
- return this.transfomers[name];
8824
- };
8825
- return CustomTransformerRegistry2;
8826
- }()
8827
- );
8828
-
8829
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/is.js
8830
- var getType = function(payload) {
8831
- return Object.prototype.toString.call(payload).slice(8, -1);
8832
- };
8833
- var isUndefined = function(payload) {
8834
- return typeof payload === "undefined";
8835
- };
8836
- var isNull = function(payload) {
8837
- return payload === null;
8838
- };
8839
- var isPlainObject = function(payload) {
8840
- if (typeof payload !== "object" || payload === null)
8841
- return false;
8842
- if (payload === Object.prototype)
8843
- return false;
8844
- if (Object.getPrototypeOf(payload) === null)
8845
- return true;
8846
- return Object.getPrototypeOf(payload) === Object.prototype;
8847
- };
8848
- var isEmptyObject = function(payload) {
8849
- return isPlainObject(payload) && Object.keys(payload).length === 0;
8850
- };
8851
- var isArray2 = function(payload) {
8852
- return Array.isArray(payload);
8853
- };
8854
- var isString2 = function(payload) {
8855
- return typeof payload === "string";
8856
- };
8857
- var isNumber2 = function(payload) {
8858
- return typeof payload === "number" && !isNaN(payload);
8859
- };
8860
- var isBoolean = function(payload) {
8861
- return typeof payload === "boolean";
8862
- };
8863
- var isRegExp = function(payload) {
8864
- return payload instanceof RegExp;
8865
- };
8866
- var isMap = function(payload) {
8867
- return payload instanceof Map;
8868
- };
8869
- var isSet = function(payload) {
8870
- return payload instanceof Set;
8871
- };
8872
- var isSymbol = function(payload) {
8873
- return getType(payload) === "Symbol";
8874
- };
8875
- var isDate = function(payload) {
8876
- return payload instanceof Date && !isNaN(payload.valueOf());
8877
- };
8878
- var isError = function(payload) {
8879
- return payload instanceof Error;
8880
- };
8881
- var isNaNValue = function(payload) {
8882
- return typeof payload === "number" && isNaN(payload);
8883
- };
8884
- var isPrimitive = function(payload) {
8885
- return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber2(payload) || isString2(payload) || isSymbol(payload);
8886
- };
8887
- var isBigint = function(payload) {
8888
- return typeof payload === "bigint";
8889
- };
8890
- var isInfinite = function(payload) {
8891
- return payload === Infinity || payload === -Infinity;
8892
- };
8893
- var isTypedArray = function(payload) {
8894
- return ArrayBuffer.isView(payload) && !(payload instanceof DataView);
8895
- };
8896
- var isURL = function(payload) {
8897
- return payload instanceof URL;
8898
- };
8899
-
8900
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/pathstringifier.js
8901
- var escapeKey = function(key) {
8902
- return key.replace(/\./g, "\\.");
8903
- };
8904
- var stringifyPath = function(path) {
8905
- return path.map(String).map(escapeKey).join(".");
8906
- };
8907
- var parsePath = function(string) {
8908
- var result = [];
8909
- var segment = "";
8910
- for (var i2 = 0; i2 < string.length; i2++) {
8911
- var char = string.charAt(i2);
8912
- var isEscapedDot = char === "\\" && string.charAt(i2 + 1) === ".";
8913
- if (isEscapedDot) {
8914
- segment += ".";
8915
- i2++;
8916
- continue;
8917
- }
8918
- var isEndOfSegment = char === ".";
8919
- if (isEndOfSegment) {
8920
- result.push(segment);
8921
- segment = "";
8922
- continue;
8923
- }
8924
- segment += char;
8925
- }
8926
- var lastSegment = segment;
8927
- result.push(lastSegment);
8928
- return result;
8929
- };
8930
-
8931
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/transformer.js
8932
- var __assign = function() {
8933
- __assign = Object.assign || function(t2) {
8934
- for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
8935
- s2 = arguments[i2];
8936
- for (var p2 in s2)
8937
- if (Object.prototype.hasOwnProperty.call(s2, p2))
8938
- t2[p2] = s2[p2];
8939
- }
8940
- return t2;
8941
- };
8942
- return __assign.apply(this, arguments);
8943
- };
8944
- var __read2 = function(o2, n2) {
8945
- var m = typeof Symbol === "function" && o2[Symbol.iterator];
8946
- if (!m)
8947
- return o2;
8948
- var i2 = m.call(o2), r2, ar = [], e2;
8949
- try {
8950
- while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done)
8951
- ar.push(r2.value);
8952
- } catch (error) {
8953
- e2 = { error };
8954
- } finally {
8955
- try {
8956
- if (r2 && !r2.done && (m = i2["return"]))
8957
- m.call(i2);
8958
- } finally {
8959
- if (e2)
8960
- throw e2.error;
8961
- }
8962
- }
8963
- return ar;
8964
- };
8965
- var __spreadArray = function(to, from) {
8966
- for (var i2 = 0, il = from.length, j = to.length; i2 < il; i2++, j++)
8967
- to[j] = from[i2];
8968
- return to;
8969
- };
8970
- function simpleTransformation(isApplicable, annotation, transform, untransform) {
8971
- return {
8972
- isApplicable,
8973
- annotation,
8974
- transform,
8975
- untransform
8976
- };
8977
- }
8978
- var simpleRules = [
8979
- simpleTransformation(isUndefined, "undefined", function() {
8980
- return null;
8981
- }, function() {
8982
- return void 0;
8983
- }),
8984
- simpleTransformation(isBigint, "bigint", function(v) {
8985
- return v.toString();
8986
- }, function(v) {
8987
- if (typeof BigInt !== "undefined") {
8988
- return BigInt(v);
8989
- }
8990
- return v;
8991
- }),
8992
- simpleTransformation(isDate, "Date", function(v) {
8993
- return v.toISOString();
8994
- }, function(v) {
8995
- return new Date(v);
8996
- }),
8997
- simpleTransformation(isError, "Error", function(v, superJson) {
8998
- var baseError = {
8999
- name: v.name,
9000
- message: v.message
9001
- };
9002
- superJson.allowedErrorProps.forEach(function(prop) {
9003
- baseError[prop] = v[prop];
9004
- });
9005
- return baseError;
9006
- }, function(v, superJson) {
9007
- var e2 = new Error(v.message);
9008
- e2.name = v.name;
9009
- e2.stack = v.stack;
9010
- superJson.allowedErrorProps.forEach(function(prop) {
9011
- e2[prop] = v[prop];
9012
- });
9013
- return e2;
9014
- }),
9015
- simpleTransformation(isRegExp, "regexp", function(v) {
9016
- return "" + v;
9017
- }, function(regex) {
9018
- var body = regex.slice(1, regex.lastIndexOf("/"));
9019
- var flags = regex.slice(regex.lastIndexOf("/") + 1);
9020
- return new RegExp(body, flags);
9021
- }),
9022
- simpleTransformation(
9023
- isSet,
9024
- "set",
9025
- // (sets only exist in es6+)
9026
- // eslint-disable-next-line es5/no-es6-methods
9027
- function(v) {
9028
- return __spreadArray([], __read2(v.values()));
9029
- },
9030
- function(v) {
9031
- return new Set(v);
9032
- }
9033
- ),
9034
- simpleTransformation(isMap, "map", function(v) {
9035
- return __spreadArray([], __read2(v.entries()));
9036
- }, function(v) {
9037
- return new Map(v);
9038
- }),
9039
- simpleTransformation(function(v) {
9040
- return isNaNValue(v) || isInfinite(v);
9041
- }, "number", function(v) {
9042
- if (isNaNValue(v)) {
9043
- return "NaN";
9044
- }
9045
- if (v > 0) {
9046
- return "Infinity";
9047
- } else {
9048
- return "-Infinity";
9049
- }
9050
- }, Number),
9051
- simpleTransformation(function(v) {
9052
- return v === 0 && 1 / v === -Infinity;
9053
- }, "number", function() {
9054
- return "-0";
9055
- }, Number),
9056
- simpleTransformation(isURL, "URL", function(v) {
9057
- return v.toString();
9058
- }, function(v) {
9059
- return new URL(v);
9060
- })
9061
- ];
9062
- function compositeTransformation(isApplicable, annotation, transform, untransform) {
9063
- return {
9064
- isApplicable,
9065
- annotation,
9066
- transform,
9067
- untransform
9068
- };
9069
- }
9070
- var symbolRule = compositeTransformation(function(s2, superJson) {
9071
- if (isSymbol(s2)) {
9072
- var isRegistered = !!superJson.symbolRegistry.getIdentifier(s2);
9073
- return isRegistered;
9074
- }
9075
- return false;
9076
- }, function(s2, superJson) {
9077
- var identifier = superJson.symbolRegistry.getIdentifier(s2);
9078
- return ["symbol", identifier];
9079
- }, function(v) {
9080
- return v.description;
9081
- }, function(_, a2, superJson) {
9082
- var value = superJson.symbolRegistry.getValue(a2[1]);
9083
- if (!value) {
9084
- throw new Error("Trying to deserialize unknown symbol");
9085
- }
9086
- return value;
9087
- });
9088
- var constructorToName = [
9089
- Int8Array,
9090
- Uint8Array,
9091
- Int16Array,
9092
- Uint16Array,
9093
- Int32Array,
9094
- Uint32Array,
9095
- Float32Array,
9096
- Float64Array,
9097
- Uint8ClampedArray
9098
- ].reduce(function(obj, ctor) {
9099
- obj[ctor.name] = ctor;
9100
- return obj;
9101
- }, {});
9102
- var typedArrayRule = compositeTransformation(isTypedArray, function(v) {
9103
- return ["typed-array", v.constructor.name];
9104
- }, function(v) {
9105
- return __spreadArray([], __read2(v));
9106
- }, function(v, a2) {
9107
- var ctor = constructorToName[a2[1]];
9108
- if (!ctor) {
9109
- throw new Error("Trying to deserialize unknown typed array");
9110
- }
9111
- return new ctor(v);
9112
- });
9113
- function isInstanceOfRegisteredClass(potentialClass, superJson) {
9114
- if (potentialClass === null || potentialClass === void 0 ? void 0 : potentialClass.constructor) {
9115
- var isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
9116
- return isRegistered;
9117
- }
9118
- return false;
9119
- }
9120
- var classRule = compositeTransformation(isInstanceOfRegisteredClass, function(clazz, superJson) {
9121
- var identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
9122
- return ["class", identifier];
9123
- }, function(clazz, superJson) {
9124
- var allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
9125
- if (!allowedProps) {
9126
- return __assign({}, clazz);
9127
- }
9128
- var result = {};
9129
- allowedProps.forEach(function(prop) {
9130
- result[prop] = clazz[prop];
9131
- });
9132
- return result;
9133
- }, function(v, a2, superJson) {
9134
- var clazz = superJson.classRegistry.getValue(a2[1]);
9135
- if (!clazz) {
9136
- throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");
9137
- }
9138
- return Object.assign(Object.create(clazz.prototype), v);
9139
- });
9140
- var customRule = compositeTransformation(function(value, superJson) {
9141
- return !!superJson.customTransformerRegistry.findApplicable(value);
9142
- }, function(value, superJson) {
9143
- var transformer = superJson.customTransformerRegistry.findApplicable(value);
9144
- return ["custom", transformer.name];
9145
- }, function(value, superJson) {
9146
- var transformer = superJson.customTransformerRegistry.findApplicable(value);
9147
- return transformer.serialize(value);
9148
- }, function(v, a2, superJson) {
9149
- var transformer = superJson.customTransformerRegistry.findByName(a2[1]);
9150
- if (!transformer) {
9151
- throw new Error("Trying to deserialize unknown custom value");
9152
- }
9153
- return transformer.deserialize(v);
9154
- });
9155
- var compositeRules = [classRule, symbolRule, customRule, typedArrayRule];
9156
- var transformValue = function(value, superJson) {
9157
- var applicableCompositeRule = findArr(compositeRules, function(rule) {
9158
- return rule.isApplicable(value, superJson);
9159
- });
9160
- if (applicableCompositeRule) {
9161
- return {
9162
- value: applicableCompositeRule.transform(value, superJson),
9163
- type: applicableCompositeRule.annotation(value, superJson)
9164
- };
9165
- }
9166
- var applicableSimpleRule = findArr(simpleRules, function(rule) {
9167
- return rule.isApplicable(value, superJson);
9168
- });
9169
- if (applicableSimpleRule) {
9170
- return {
9171
- value: applicableSimpleRule.transform(value, superJson),
9172
- type: applicableSimpleRule.annotation
9173
- };
9174
- }
9175
- return void 0;
9176
- };
9177
- var simpleRulesByAnnotation = {};
9178
- simpleRules.forEach(function(rule) {
9179
- simpleRulesByAnnotation[rule.annotation] = rule;
9180
- });
9181
- var untransformValue = function(json, type, superJson) {
9182
- if (isArray2(type)) {
9183
- switch (type[0]) {
9184
- case "symbol":
9185
- return symbolRule.untransform(json, type, superJson);
9186
- case "class":
9187
- return classRule.untransform(json, type, superJson);
9188
- case "custom":
9189
- return customRule.untransform(json, type, superJson);
9190
- case "typed-array":
9191
- return typedArrayRule.untransform(json, type, superJson);
9192
- default:
9193
- throw new Error("Unknown transformation: " + type);
9194
- }
9195
- } else {
9196
- var transformation = simpleRulesByAnnotation[type];
9197
- if (!transformation) {
9198
- throw new Error("Unknown transformation: " + type);
9199
- }
9200
- return transformation.untransform(json, superJson);
9201
- }
9202
- };
9203
-
9204
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/accessDeep.js
9205
- var getNthKey = function(value, n2) {
9206
- var keys2 = value.keys();
9207
- while (n2 > 0) {
9208
- keys2.next();
9209
- n2--;
9210
- }
9211
- return keys2.next().value;
9212
- };
9213
- function validatePath(path) {
9214
- if (includes(path, "__proto__")) {
9215
- throw new Error("__proto__ is not allowed as a property");
9216
- }
9217
- if (includes(path, "prototype")) {
9218
- throw new Error("prototype is not allowed as a property");
9219
- }
9220
- if (includes(path, "constructor")) {
9221
- throw new Error("constructor is not allowed as a property");
9222
- }
9223
- }
9224
- var getDeep = function(object, path) {
9225
- validatePath(path);
9226
- for (var i2 = 0; i2 < path.length; i2++) {
9227
- var key = path[i2];
9228
- if (isSet(object)) {
9229
- object = getNthKey(object, +key);
9230
- } else if (isMap(object)) {
9231
- var row = +key;
9232
- var type = +path[++i2] === 0 ? "key" : "value";
9233
- var keyOfRow = getNthKey(object, row);
9234
- switch (type) {
9235
- case "key":
9236
- object = keyOfRow;
9237
- break;
9238
- case "value":
9239
- object = object.get(keyOfRow);
9240
- break;
9241
- }
9242
- } else {
9243
- object = object[key];
9244
- }
9245
- }
9246
- return object;
9247
- };
9248
- var setDeep = function(object, path, mapper) {
9249
- validatePath(path);
9250
- if (path.length === 0) {
9251
- return mapper(object);
9252
- }
9253
- var parent = object;
9254
- for (var i2 = 0; i2 < path.length - 1; i2++) {
9255
- var key = path[i2];
9256
- if (isArray2(parent)) {
9257
- var index = +key;
9258
- parent = parent[index];
9259
- } else if (isPlainObject(parent)) {
9260
- parent = parent[key];
9261
- } else if (isSet(parent)) {
9262
- var row = +key;
9263
- parent = getNthKey(parent, row);
9264
- } else if (isMap(parent)) {
9265
- var isEnd = i2 === path.length - 2;
9266
- if (isEnd) {
9267
- break;
9268
- }
9269
- var row = +key;
9270
- var type = +path[++i2] === 0 ? "key" : "value";
9271
- var keyOfRow = getNthKey(parent, row);
9272
- switch (type) {
9273
- case "key":
9274
- parent = keyOfRow;
9275
- break;
9276
- case "value":
9277
- parent = parent.get(keyOfRow);
9278
- break;
9279
- }
9280
- }
9281
- }
9282
- var lastKey = path[path.length - 1];
9283
- if (isArray2(parent)) {
9284
- parent[+lastKey] = mapper(parent[+lastKey]);
9285
- } else if (isPlainObject(parent)) {
9286
- parent[lastKey] = mapper(parent[lastKey]);
9287
- }
9288
- if (isSet(parent)) {
9289
- var oldValue = getNthKey(parent, +lastKey);
9290
- var newValue = mapper(oldValue);
9291
- if (oldValue !== newValue) {
9292
- parent["delete"](oldValue);
9293
- parent.add(newValue);
9294
- }
9295
- }
9296
- if (isMap(parent)) {
9297
- var row = +path[path.length - 2];
9298
- var keyToRow = getNthKey(parent, row);
9299
- var type = +lastKey === 0 ? "key" : "value";
9300
- switch (type) {
9301
- case "key": {
9302
- var newKey = mapper(keyToRow);
9303
- parent.set(newKey, parent.get(keyToRow));
9304
- if (newKey !== keyToRow) {
9305
- parent["delete"](keyToRow);
9306
- }
9307
- break;
9308
- }
9309
- case "value": {
9310
- parent.set(keyToRow, mapper(parent.get(keyToRow)));
9311
- break;
9312
- }
9313
- }
9314
- }
9315
- return object;
9316
- };
9317
-
9318
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/plainer.js
9319
- var __read3 = function(o2, n2) {
9320
- var m = typeof Symbol === "function" && o2[Symbol.iterator];
9321
- if (!m)
9322
- return o2;
9323
- var i2 = m.call(o2), r2, ar = [], e2;
9324
- try {
9325
- while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done)
9326
- ar.push(r2.value);
9327
- } catch (error) {
9328
- e2 = { error };
9329
- } finally {
9330
- try {
9331
- if (r2 && !r2.done && (m = i2["return"]))
9332
- m.call(i2);
9333
- } finally {
9334
- if (e2)
9335
- throw e2.error;
9336
- }
9337
- }
9338
- return ar;
9339
- };
9340
- var __spreadArray2 = function(to, from) {
9341
- for (var i2 = 0, il = from.length, j = to.length; i2 < il; i2++, j++)
9342
- to[j] = from[i2];
9343
- return to;
9344
- };
9345
- function traverse(tree, walker2, origin) {
9346
- if (origin === void 0) {
9347
- origin = [];
9348
- }
9349
- if (!tree) {
9350
- return;
9351
- }
9352
- if (!isArray2(tree)) {
9353
- forEach(tree, function(subtree, key) {
9354
- return traverse(subtree, walker2, __spreadArray2(__spreadArray2([], __read3(origin)), __read3(parsePath(key))));
9355
- });
9356
- return;
9357
- }
9358
- var _a = __read3(tree, 2), nodeValue = _a[0], children2 = _a[1];
9359
- if (children2) {
9360
- forEach(children2, function(child, key) {
9361
- traverse(child, walker2, __spreadArray2(__spreadArray2([], __read3(origin)), __read3(parsePath(key))));
9362
- });
9363
- }
9364
- walker2(nodeValue, origin);
9365
- }
9366
- function applyValueAnnotations(plain, annotations, superJson) {
9367
- traverse(annotations, function(type, path) {
9368
- plain = setDeep(plain, path, function(v) {
9369
- return untransformValue(v, type, superJson);
9370
- });
9371
- });
9372
- return plain;
9373
- }
9374
- function applyReferentialEqualityAnnotations(plain, annotations) {
9375
- function apply(identicalPaths, path) {
9376
- var object = getDeep(plain, parsePath(path));
9377
- identicalPaths.map(parsePath).forEach(function(identicalObjectPath) {
9378
- plain = setDeep(plain, identicalObjectPath, function() {
9379
- return object;
9380
- });
9381
- });
9382
- }
9383
- if (isArray2(annotations)) {
9384
- var _a = __read3(annotations, 2), root = _a[0], other = _a[1];
9385
- root.forEach(function(identicalPath) {
9386
- plain = setDeep(plain, parsePath(identicalPath), function() {
9387
- return plain;
9388
- });
9389
- });
9390
- if (other) {
9391
- forEach(other, apply);
9392
- }
9393
- } else {
9394
- forEach(annotations, apply);
9395
- }
9396
- return plain;
9397
- }
9398
- var isDeep = function(object, superJson) {
9399
- return isPlainObject(object) || isArray2(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
9400
- };
9401
- function addIdentity(object, path, identities) {
9402
- var existingSet = identities.get(object);
9403
- if (existingSet) {
9404
- existingSet.push(path);
9405
- } else {
9406
- identities.set(object, [path]);
9407
- }
9408
- }
9409
- function generateReferentialEqualityAnnotations(identitites) {
9410
- var result = {};
9411
- var rootEqualityPaths = void 0;
9412
- identitites.forEach(function(paths) {
9413
- if (paths.length <= 1) {
9414
- return;
9415
- }
9416
- var _a = __read3(paths.map(function(path) {
9417
- return path.map(String);
9418
- }).sort(function(a2, b2) {
9419
- return a2.length - b2.length;
9420
- })), shortestPath = _a[0], identicalPaths = _a.slice(1);
9421
- if (shortestPath.length === 0) {
9422
- rootEqualityPaths = identicalPaths.map(stringifyPath);
9423
- } else {
9424
- result[stringifyPath(shortestPath)] = identicalPaths.map(stringifyPath);
9425
- }
9426
- });
9427
- if (rootEqualityPaths) {
9428
- if (isEmptyObject(result)) {
9429
- return [rootEqualityPaths];
9430
- } else {
9431
- return [rootEqualityPaths, result];
9432
- }
9433
- } else {
9434
- return isEmptyObject(result) ? void 0 : result;
9435
- }
9436
- }
9437
- var walker = function(object, identities, superJson, path, objectsInThisPath) {
9438
- var _a;
9439
- if (path === void 0) {
9440
- path = [];
9441
- }
9442
- if (objectsInThisPath === void 0) {
9443
- objectsInThisPath = [];
9444
- }
9445
- if (!isPrimitive(object)) {
9446
- addIdentity(object, path, identities);
9447
- }
9448
- if (!isDeep(object, superJson)) {
9449
- var transformed_1 = transformValue(object, superJson);
9450
- if (transformed_1) {
9451
- return {
9452
- transformedValue: transformed_1.value,
9453
- annotations: [transformed_1.type]
9454
- };
9455
- } else {
9456
- return {
9457
- transformedValue: object
9458
- };
9459
- }
9460
- }
9461
- if (includes(objectsInThisPath, object)) {
9462
- return {
9463
- transformedValue: null
9464
- };
9465
- }
9466
- var transformationResult = transformValue(object, superJson);
9467
- var transformed = (_a = transformationResult === null || transformationResult === void 0 ? void 0 : transformationResult.value) !== null && _a !== void 0 ? _a : object;
9468
- if (!isPrimitive(object)) {
9469
- objectsInThisPath = __spreadArray2(__spreadArray2([], __read3(objectsInThisPath)), [object]);
9470
- }
9471
- var transformedValue = isArray2(transformed) ? [] : {};
9472
- var innerAnnotations = {};
9473
- forEach(transformed, function(value, index) {
9474
- var recursiveResult = walker(value, identities, superJson, __spreadArray2(__spreadArray2([], __read3(path)), [index]), objectsInThisPath);
9475
- transformedValue[index] = recursiveResult.transformedValue;
9476
- if (isArray2(recursiveResult.annotations)) {
9477
- innerAnnotations[index] = recursiveResult.annotations;
9478
- } else if (isPlainObject(recursiveResult.annotations)) {
9479
- forEach(recursiveResult.annotations, function(tree, key) {
9480
- innerAnnotations[escapeKey(index) + "." + key] = tree;
9481
- });
9482
- }
9483
- });
9484
- if (isEmptyObject(innerAnnotations)) {
9485
- return {
9486
- transformedValue,
9487
- annotations: !!transformationResult ? [transformationResult.type] : void 0
9488
- };
9489
- } else {
9490
- return {
9491
- transformedValue,
9492
- annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
9493
- };
9494
- }
9495
- };
9496
-
9497
- // ../../node_modules/.pnpm/is-what@4.1.15/node_modules/is-what/dist/index.js
9498
- function getType2(payload) {
9499
- return Object.prototype.toString.call(payload).slice(8, -1);
9500
- }
9501
- function isPlainObject2(payload) {
9502
- if (getType2(payload) !== "Object")
9503
- return false;
9504
- const prototype = Object.getPrototypeOf(payload);
9505
- return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
9506
- }
9507
- function isArray3(payload) {
9508
- return getType2(payload) === "Array";
9509
- }
9510
-
9511
- // ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
9512
- function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
9513
- const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
9514
- if (propType === "enumerable")
9515
- carry[key] = newVal;
9516
- if (includeNonenumerable && propType === "nonenumerable") {
9517
- Object.defineProperty(carry, key, {
9518
- value: newVal,
9519
- enumerable: false,
9520
- writable: true,
9521
- configurable: true
9522
- });
9523
- }
9524
- }
9525
- function copy(target, options = {}) {
9526
- if (isArray3(target)) {
9527
- return target.map((item) => copy(item, options));
9528
- }
9529
- if (!isPlainObject2(target)) {
9530
- return target;
9531
- }
9532
- const props = Object.getOwnPropertyNames(target);
9533
- const symbols = Object.getOwnPropertySymbols(target);
9534
- return [...props, ...symbols].reduce((carry, key) => {
9535
- if (isArray3(options.props) && !options.props.includes(key)) {
9536
- return carry;
9537
- }
9538
- const val = target[key];
9539
- const newVal = copy(val, options);
9540
- assignProp(carry, key, newVal, target, options.nonenumerable);
9541
- return carry;
9542
- }, {});
9543
- }
9544
-
9545
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/index.js
9546
- var __assign2 = function() {
9547
- __assign2 = Object.assign || function(t2) {
9548
- for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
9549
- s2 = arguments[i2];
9550
- for (var p2 in s2)
9551
- if (Object.prototype.hasOwnProperty.call(s2, p2))
9552
- t2[p2] = s2[p2];
9553
- }
9554
- return t2;
9555
- };
9556
- return __assign2.apply(this, arguments);
9557
- };
9558
- var __read4 = function(o2, n2) {
9559
- var m = typeof Symbol === "function" && o2[Symbol.iterator];
9560
- if (!m)
9561
- return o2;
9562
- var i2 = m.call(o2), r2, ar = [], e2;
9563
- try {
9564
- while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done)
9565
- ar.push(r2.value);
9566
- } catch (error) {
9567
- e2 = { error };
9568
- } finally {
9569
- try {
9570
- if (r2 && !r2.done && (m = i2["return"]))
9571
- m.call(i2);
9572
- } finally {
9573
- if (e2)
9574
- throw e2.error;
9575
- }
9576
- }
9577
- return ar;
9578
- };
9579
- var __spreadArray3 = function(to, from) {
9580
- for (var i2 = 0, il = from.length, j = to.length; i2 < il; i2++, j++)
9581
- to[j] = from[i2];
9582
- return to;
9583
- };
9584
- var SuperJSON = (
9585
- /** @class */
9586
- function() {
9587
- function SuperJSON2() {
9588
- this.classRegistry = new ClassRegistry();
9589
- this.symbolRegistry = new Registry(function(s2) {
9590
- var _a;
9591
- return (_a = s2.description) !== null && _a !== void 0 ? _a : "";
9592
- });
9593
- this.customTransformerRegistry = new CustomTransformerRegistry();
9594
- this.allowedErrorProps = [];
9595
- }
9596
- SuperJSON2.prototype.serialize = function(object) {
9597
- var identities = /* @__PURE__ */ new Map();
9598
- var output = walker(object, identities, this);
9599
- var res = {
9600
- json: output.transformedValue
9601
- };
9602
- if (output.annotations) {
9603
- res.meta = __assign2(__assign2({}, res.meta), { values: output.annotations });
9604
- }
9605
- var equalityAnnotations = generateReferentialEqualityAnnotations(identities);
9606
- if (equalityAnnotations) {
9607
- res.meta = __assign2(__assign2({}, res.meta), { referentialEqualities: equalityAnnotations });
9608
- }
9609
- return res;
9610
- };
9611
- SuperJSON2.prototype.deserialize = function(payload) {
9612
- var json = payload.json, meta = payload.meta;
9613
- var result = copy(json);
9614
- if (meta === null || meta === void 0 ? void 0 : meta.values) {
9615
- result = applyValueAnnotations(result, meta.values, this);
9616
- }
9617
- if (meta === null || meta === void 0 ? void 0 : meta.referentialEqualities) {
9618
- result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
9619
- }
9620
- return result;
9621
- };
9622
- SuperJSON2.prototype.stringify = function(object) {
9623
- return JSON.stringify(this.serialize(object));
9624
- };
9625
- SuperJSON2.prototype.parse = function(string) {
9626
- return this.deserialize(JSON.parse(string));
9627
- };
9628
- SuperJSON2.prototype.registerClass = function(v, options) {
9629
- this.classRegistry.register(v, options);
9630
- };
9631
- SuperJSON2.prototype.registerSymbol = function(v, identifier) {
9632
- this.symbolRegistry.register(v, identifier);
9633
- };
9634
- SuperJSON2.prototype.registerCustom = function(transformer, name) {
9635
- this.customTransformerRegistry.register(__assign2({ name }, transformer));
9636
- };
9637
- SuperJSON2.prototype.allowErrorProps = function() {
9638
- var _a;
9639
- var props = [];
9640
- for (var _i = 0; _i < arguments.length; _i++) {
9641
- props[_i] = arguments[_i];
9642
- }
9643
- (_a = this.allowedErrorProps).push.apply(_a, __spreadArray3([], __read4(props)));
9644
- };
9645
- SuperJSON2.defaultInstance = new SuperJSON2();
9646
- SuperJSON2.serialize = SuperJSON2.defaultInstance.serialize.bind(SuperJSON2.defaultInstance);
9647
- SuperJSON2.deserialize = SuperJSON2.defaultInstance.deserialize.bind(SuperJSON2.defaultInstance);
9648
- SuperJSON2.stringify = SuperJSON2.defaultInstance.stringify.bind(SuperJSON2.defaultInstance);
9649
- SuperJSON2.parse = SuperJSON2.defaultInstance.parse.bind(SuperJSON2.defaultInstance);
9650
- SuperJSON2.registerClass = SuperJSON2.defaultInstance.registerClass.bind(SuperJSON2.defaultInstance);
9651
- SuperJSON2.registerSymbol = SuperJSON2.defaultInstance.registerSymbol.bind(SuperJSON2.defaultInstance);
9652
- SuperJSON2.registerCustom = SuperJSON2.defaultInstance.registerCustom.bind(SuperJSON2.defaultInstance);
9653
- SuperJSON2.allowErrorProps = SuperJSON2.defaultInstance.allowErrorProps.bind(SuperJSON2.defaultInstance);
9654
- return SuperJSON2;
9655
- }()
9656
- );
9657
- var serialize = SuperJSON.serialize;
9658
- SuperJSON.deserialize;
9659
- var stringify = SuperJSON.stringify;
9660
- SuperJSON.parse;
9661
- SuperJSON.registerClass;
9662
- SuperJSON.registerCustom;
9663
- SuperJSON.registerSymbol;
9664
- SuperJSON.allowErrorProps;
9665
-
9666
- // src/utils.tsx
9667
- function getQueryStatusLabel(query) {
9668
- return query.state.fetchStatus === "fetching" ? "fetching" : !query.getObserversCount() ? "inactive" : query.state.fetchStatus === "paused" ? "paused" : query.isStale() ? "stale" : "fresh";
9669
- }
9670
- function getSidedProp(prop, side) {
9671
- return `${prop}${side.charAt(0).toUpperCase() + side.slice(1)}`;
9672
- }
9673
- function getQueryStatusColor({
9674
- queryState,
9675
- observerCount,
9676
- isStale
9677
- }) {
9678
- return queryState.fetchStatus === "fetching" ? "blue" : !observerCount ? "gray" : queryState.fetchStatus === "paused" ? "purple" : isStale ? "yellow" : "green";
9679
- }
9680
- function getMutationStatusColor({
9681
- status,
9682
- isPaused
9683
- }) {
9684
- return isPaused ? "purple" : status === "error" ? "red" : status === "pending" ? "yellow" : status === "success" ? "green" : "gray";
9685
- }
9686
- function getQueryStatusColorByLabel(label) {
9687
- return label === "fresh" ? "green" : label === "stale" ? "yellow" : label === "paused" ? "purple" : label === "inactive" ? "gray" : "blue";
9688
- }
9689
- var displayValue = (value, beautify = false) => {
9690
- const {
9691
- json
9692
- } = serialize(value);
9693
- return JSON.stringify(json, null, beautify ? 2 : void 0);
9694
- };
9695
- var getStatusRank = (q) => q.state.fetchStatus !== "idle" ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1;
9696
- var queryHashSort = (a2, b2) => a2.queryHash.localeCompare(b2.queryHash);
9697
- var dateSort = (a2, b2) => a2.state.dataUpdatedAt < b2.state.dataUpdatedAt ? 1 : -1;
9698
- var statusAndDateSort = (a2, b2) => {
9699
- if (getStatusRank(a2) === getStatusRank(b2)) {
9700
- return dateSort(a2, b2);
9701
- }
9702
- return getStatusRank(a2) > getStatusRank(b2) ? 1 : -1;
9703
- };
9704
- var sortFns = {
9705
- status: statusAndDateSort,
9706
- "query hash": queryHashSort,
9707
- "last updated": dateSort
9708
- };
9709
- var getMutationStatusRank = (m) => m.state.isPaused ? 0 : m.state.status === "error" ? 2 : m.state.status === "pending" ? 1 : 3;
9710
- var mutationDateSort = (a2, b2) => a2.state.submittedAt < b2.state.submittedAt ? 1 : -1;
9711
- var mutationStatusSort = (a2, b2) => {
9712
- if (getMutationStatusRank(a2) === getMutationStatusRank(b2)) {
9713
- return mutationDateSort(a2, b2);
9714
- }
9715
- return getMutationStatusRank(a2) > getMutationStatusRank(b2) ? 1 : -1;
9716
- };
9717
- var mutationSortFns = {
9718
- status: mutationStatusSort,
9719
- "last updated": mutationDateSort
9720
- };
9721
- var convertRemToPixels = (rem) => {
9722
- return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
9723
- };
9724
- var getPreferredColorScheme = () => {
9725
- const [colorScheme, setColorScheme] = createSignal("dark");
9726
- onMount(() => {
9727
- const query = window.matchMedia("(prefers-color-scheme: dark)");
9728
- setColorScheme(query.matches ? "dark" : "light");
9729
- const listener = (e2) => {
9730
- setColorScheme(e2.matches ? "dark" : "light");
9731
- };
9732
- query.addEventListener("change", listener);
9733
- onCleanup(() => query.removeEventListener("change", listener));
9734
- });
9735
- return colorScheme;
9736
- };
9737
- var updateNestedDataByPath = (oldData, updatePath2, value) => {
9738
- if (updatePath2.length === 0) {
9739
- return value;
9740
- }
9741
- if (oldData instanceof Map) {
9742
- const newData = new Map(oldData);
9743
- if (updatePath2.length === 1) {
9744
- newData.set(updatePath2[0], value);
9745
- return newData;
9746
- }
9747
- const [head, ...tail] = updatePath2;
9748
- newData.set(head, updateNestedDataByPath(newData.get(head), tail, value));
9749
- return newData;
9750
- }
9751
- if (oldData instanceof Set) {
9752
- const setAsArray = updateNestedDataByPath(Array.from(oldData), updatePath2, value);
9753
- return new Set(setAsArray);
9754
- }
9755
- if (Array.isArray(oldData)) {
9756
- const newData = [...oldData];
9757
- if (updatePath2.length === 1) {
9758
- newData[updatePath2[0]] = value;
9759
- return newData;
9760
- }
9761
- const [head, ...tail] = updatePath2;
9762
- newData[head] = updateNestedDataByPath(newData[head], tail, value);
9763
- return newData;
9764
- }
9765
- if (oldData instanceof Object) {
9766
- const newData = {
9767
- ...oldData
9768
- };
9769
- if (updatePath2.length === 1) {
9770
- newData[updatePath2[0]] = value;
9771
- return newData;
9772
- }
9773
- const [head, ...tail] = updatePath2;
9774
- newData[head] = updateNestedDataByPath(newData[head], tail, value);
9775
- return newData;
9776
- }
9777
- return oldData;
9778
- };
9779
- var deleteNestedDataByPath = (oldData, deletePath) => {
9780
- if (oldData instanceof Map) {
9781
- const newData = new Map(oldData);
9782
- if (deletePath.length === 1) {
9783
- newData.delete(deletePath[0]);
9784
- return newData;
9785
- }
9786
- const [head, ...tail] = deletePath;
9787
- newData.set(head, deleteNestedDataByPath(newData.get(head), tail));
9788
- return newData;
9789
- }
9790
- if (oldData instanceof Set) {
9791
- const setAsArray = deleteNestedDataByPath(Array.from(oldData), deletePath);
9792
- return new Set(setAsArray);
9793
- }
9794
- if (Array.isArray(oldData)) {
9795
- const newData = [...oldData];
9796
- if (deletePath.length === 1) {
9797
- return newData.filter((_, idx) => idx.toString() !== deletePath[0]);
9798
- }
9799
- const [head, ...tail] = deletePath;
9800
- newData[head] = deleteNestedDataByPath(newData[head], tail);
9801
- return newData;
9802
- }
9803
- if (oldData instanceof Object) {
9804
- const newData = {
9805
- ...oldData
9806
- };
9807
- if (deletePath.length === 1) {
9808
- delete newData[deletePath[0]];
9809
- return newData;
9810
- }
9811
- const [head, ...tail] = deletePath;
9812
- newData[head] = deleteNestedDataByPath(newData[head], tail);
9813
- return newData;
9814
- }
9815
- return oldData;
9816
- };
9817
-
9818
8634
  // src/icons/index.tsx
9819
8635
  var _tmpl$ = /* @__PURE__ */ template(`<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>`);
9820
8636
  var _tmpl$2 = /* @__PURE__ */ template(`<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>`);